D:\Source\Invoice\ipsvue\node_modules\pdfjs-dist\build 在这个路径下存在pdf.worker.js,pdfjsLib.GlobalWorkerOptions.workerSrc应该怎么设置
时间: 2023-07-17 14:01:52 浏览: 177
如果你的 `pdf.worker.js` 文件路径在 `D:\Source\Invoice\ipsvue\node_modules\pdfjs-dist\build` 下,你可以使用以下方式设置 `pdfjsLib.GlobalWorkerOptions.workerSrc`:
```javascript
import * as pdfjsLib from 'pdfjs-dist/build/pdf';
pdfjsLib.GlobalWorkerOptions.workerSrc = 'D:/Source/Invoice/ipsvue/node_modules/pdfjs-dist/build/pdf.worker.js';
```
注意,你需要将 `import` 语句中的路径指向正确的 `pdf.js` 文件,它位于 `pdfjs-dist/build/pdf`。
然后,将正确的路径设置为 `pdf.worker.js` 文件的实际路径,并将其分配给 `pdfjsLib.GlobalWorkerOptions.workerSrc` 属性。
确保使用正确的斜杠方向(正斜杠或反斜杠)和文件路径大小写匹配。
如果你在设置之后仍然无法访问 `pdfjsLib` 对象,请确保你已经正确安装了 `pdfjs-dist` 包,并且在导入时没有发生任何错误。
相关问题
URIError: Failed to decode param '/%3C%=' at decodeURIComponent (<anonymous>) at decode_param (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\layer.js:172:12) at Layer.match (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\layer.js:123:27) at matchLayer (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:585:18) at next (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:226:15) at expressInit (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\middleware\init.js:40:5) at Layer.handle [as handle_request] (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:328:13) at D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:286:9 at Function.process_params (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:346:12) at next (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:280:10) at query (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\middleware\query.js:45:5) at Layer.handle [as handle_request] (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:328:13) at D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:286:9 at Function.process_params (D:\fp\invoice\unimall\unimall-admin\node_modules\express\lib\router\index.js:346:12) vue 在NPM RUN DEV的时间怎么解决这个问题
这个错误是因为你的 URL 参数传递了一个无效的编码字符串导致的。可以尝试使用 `decodeURIComponent()` 函数对字符串进行解码,它会将编码的字符串转换为原始字符串。另外,检查一下你的代码中是否存在对这个 URL 参数的错误处理,例如验证和过滤输入,以防止类似的错误发生。关于 Vue 在 NPM RUN DEV 的问题,可以尝试重新安装依赖包和重启服务来解决问题。
SELECT PIS.SHOW_FLT_DETAIL AS SHOW_FLT_DETAIL -- new , PIS.SHOW_AWB_DETAIL AS SHOW_AWB_DETAIL -- new , PIS.DISPLAY_AIRLINE_CODE AS CARRIER_CODE , DECODE(PIS.REVERT_FLOW,'N',PIS.FLOW_TYPE,DECODE(PIS.FLOW_TYPE,'I','E','I')) AS FLOW_TYPE , PIS.SHIP_TO_LOCATION AS SHIP_TO_LOCATION , PIS.INVOICE_SEQUENCE AS INVOICE_SEQUENCE , PFT.FLIGHT_DATE AS FLIGHT_DATE , PFT.FLIGHT_CARRIER_CODE AS FLIGHT_CARRIER_CODE , PFT.FLIGHT_SERIAL_NUMBER AS FLIGHT_SERIAL_NUMBER , PFT.FLOW_TYPE AS AIRCRAFT_FLOW , FAST.AIRCRAFT_SERVICE_TYPE AS AIRCRAFT_SERVICE_TYPE , PPT.AWB_NUMBER AS AWB_NUMBER , PPT.WEIGHT AS WEIGHT , PPT.CARGO_HANDLING_OPERATOR AS CARGO_HANDLING_OPERATOR , PPT.SHIPMENT_PACKING_TYPE AS SHIPMENT_PACKING_TYPE , PPT.SHIPMENT_FLOW_TYPE AS SHIPMENT_FLOW_TYPE , PPT.SHIPMENT_BUILD_TYPE AS SHIPMENT_BUILD_TYPE , PPT.SHIPMENT_CARGO_TYPE AS SHIPMENT_CARGO_TYPE , PPT.REVENUE_TYPE AS REVENUE_TYPE , PFT.JV_FLIGHT_CARRIER_CODE AS JV_FLIGHT_CARRIER_CODE , PPT.PORT_TONNAGE_UID AS PORT_TONNAGE_UID , PPT.AWB_UID AS AWB_UID , PIS.INVOICE_SEPARATION_UID AS INVOICE_SEPARATION_UID , PFT.FLIGHT_TONNAGE_UID AS FLIGHT_TONNAGE_UID FROM PN_FLT_TONNAGES PFT , FZ_AIRLINES FA , PN_TONNAGE_FLT_PORTS PTFP , PN_PORT_TONNAGES PPT , FF_AIRCRAFT_SERVICE_TYPES FAST , SR_PN_INVOICE_SEPARATIONS PIS --new , SR_PN_INVOICE_SEP_DETAILS PISD--new , SR_PN_INV_SEP_PORT_TONNAGES PISPT --new WHERE PFT.FLIGHT_OPERATION_DATE >= trunc( CASE :rundate WHEN TO_DATE('01/01/1900', 'DD/MM/YYYY') THEN ADD_MONTHS(SYSDATE,-1) ELSE ADD_MONTHS(:rundate,-1) END, 'MON') AND PFT.FLIGHT_OPERATION_DATE < trunc( CASE :rundate WHEN TO_DATE('01/01/1900', 'DD/MM/YYYY') THEN TRUNC(SYSDATE) ELSE TRUNC(:rundate) END, 'MON') AND PFT.TYPE IN ('C', 'F') AND PFT.RECORD_TYPE = 'M' AND (PFT.TERMINAL_OPERATOR NOT IN ('X', 'A') OR (PFT.TERMINAL_OPERATOR <> 'X' AND FA.CARRIER_CODE IN (SELECT * FROM SPECIAL_HANDLING_AIRLINE) AND PPT.REVENUE_TYPE IN (SELECT * FROM SPECIAL_REVENUE_TYPE) AND PPT.SHIPMENT_FLOW_TYPE IN (SELECT * FROM SPECIAL_SHIPMENT_FLOW_TYPE) AND PFT.FLIGHT_OPERATION_DATE >= (select EFF_DATE from SPECIAL_HANDLING_EFF_DATE) )) AND PFT.DELETING_DATETIME IS NULL AND FA.AIRLINE_UID = PFT.AIRLINE_UID AND FA.DELETING_DATETIME IS NULL AND PTFP.FLIGHT_TONNAGE_UID = PFT.FLIGHT_TONNAGE_UID AND PTFP.RECORD_TYPE = 'M' AND PTFP.DELETING_DATETIME IS NULL AND PPT.TONNAGE_FLIGHT_PORT_UID (+)= PTFP.TONNAGE_FLIGHT_PORT_UID AND PPT.RECORD_TYPE (+)= 'M' AND PPT.DISCREPANCY_TYPE (+)= 'NONE' AND PPT.ADJUSTMENT_INC_FLAG (+)= 'Y' AND PPT.DELETING_DATETIME (+) IS NULL AND FAST.AIRCRAFT_SERVICE_TYPE_UID = PFT.AIRCRAFT_SERVICE_TYPE_UID AND FAST.DELETING_DATETIME IS NULL AND PIS.TEMPORAL_NAME = TO_CHAR((CASE :rundate --new WHEN TO_DATE('01/01/1900', 'DD/MM/YYYY') THEN TRUNC(SYSDATE) ELSE TRUNC(:rundate) END ), 'YYYYMM') || '00' AND PIS.INVOICE_SEPARATION_UID = PISD.INVOICE_SEPARATION_UID --new AND PISD.INVOICE_SEP_DETAIL_UID = PISPT.INVOICE_SEP_DETAIL_UID --new AND PISPT.PORT_TONNAGE_UID = PPT.PORT_TONNAGE_UID --new AND PIS.PRINT_SUPPORTING_DOC = 'Y';上面是oracle的写法,请转成spark SQL的写法。
以下是转换为 Spark SQL 查询的代码:
```
SELECT
PIS.SHOW_FLT_DETAIL AS SHOW_FLT_DETAIL,
PIS.SHOW_AWB_DETAIL AS SHOW_AWB_DETAIL,
PIS.DISPLAY_AIRLINE_CODE AS CARRIER_CODE,
CASE
WHEN PIS.REVERT_FLOW = 'N' THEN PIS.FLOW_TYPE
ELSE CASE
WHEN PIS.FLOW_TYPE = 'I' THEN 'E'
ELSE 'I'
END
END AS FLOW_TYPE,
PIS.SHIP_TO_LOCATION AS SHIP_TO_LOCATION,
PIS.INVOICE_SEQUENCE AS INVOICE_SEQUENCE,
PFT.FLIGHT_DATE AS FLIGHT_DATE,
PFT.FLIGHT_CARRIER_CODE AS FLIGHT_CARRIER_CODE,
PFT.FLIGHT_SERIAL_NUMBER AS FLIGHT_SERIAL_NUMBER,
PFT.FLOW_TYPE AS AIRCRAFT_FLOW,
FAST.AIRCRAFT_SERVICE_TYPE AS AIRCRAFT_SERVICE_TYPE,
PPT.AWB_NUMBER AS AWB_NUMBER,
PPT.WEIGHT AS WEIGHT,
PPT.CARGO_HANDLING_OPERATOR AS CARGO_HANDLING_OPERATOR,
PPT.SHIPMENT_PACKING_TYPE AS SHIPMENT_PACKING_TYPE,
PPT.SHIPMENT_FLOW_TYPE AS SHIPMENT_FLOW_TYPE,
PPT.SHIPMENT_BUILD_TYPE AS SHIPMENT_BUILD_TYPE,
PPT.SHIPMENT_CARGO_TYPE AS SHIPMENT_CARGO_TYPE,
PPT.REVENUE_TYPE AS REVENUE_TYPE,
PFT.JV_FLIGHT_CARRIER_CODE AS JV_FLIGHT_CARRIER_CODE,
PPT.PORT_TONNAGE_UID AS PORT_TONNAGE_UID,
PPT.AWB_UID AS AWB_UID,
PIS.INVOICE_SEPARATION_UID AS INVOICE_SEPARATION_UID,
PFT.FLIGHT_TONNAGE_UID AS FLIGHT_TONNAGE_UID
FROM
PN_FLT_TONNAGES PFT
JOIN FZ_AIRLINES FA ON FA.AIRLINE_UID = PFT.AIRLINE_UID AND FA.DELETING_DATETIME IS NULL
JOIN PN_TONNAGE_FLT_PORTS PTFP ON PTFP.FLIGHT_TONNAGE_UID = PFT.FLIGHT_TONNAGE_UID AND PTFP.RECORD_TYPE = 'M' AND PTFP.DELETING_DATETIME IS NULL
LEFT JOIN PN_PORT_TONNAGES PPT ON PPT.TONNAGE_FLIGHT_PORT_UID = PTFP.TONNAGE_FLIGHT_PORT_UID AND PPT.RECORD_TYPE = 'M' AND PPT.DISCREPANCY_TYPE = 'NONE' AND PPT.ADJUSTMENT_INC_FLAG = 'Y' AND PPT.DELETING_DATETIME IS NULL
JOIN FF_AIRCRAFT_SERVICE_TYPES FAST ON FAST.AIRCRAFT_SERVICE_TYPE_UID = PFT.AIRCRAFT_SERVICE_TYPE_UID AND FAST.DELETING_DATETIME IS NULL
JOIN SR_PN_INVOICE_SEPARATIONS PIS ON PIS.TEMPORAL_NAME = CONCAT(YEAR(:rundate), RIGHT(CONCAT('0', MONTH(:rundate)), 2), '00') AND PIS.INVOICE_SEPARATION_UID = PISD.INVOICE_SEPARATION_UID AND PIS.PRINT_SUPPORTING_DOC = 'Y'
JOIN SR_PN_INVOICE_SEP_DETAILS PISD ON PISD.INVOICE_SEP_DETAIL_UID = PISPT.INVOICE_SEP_DETAIL_UID
JOIN SR_PN_INV_SEP_PORT_TONNAGES PISPT ON PISPT.PORT_TONNAGE_UID = PPT.PORT_TONNAGE_UID
WHERE
PFT.FLIGHT_OPERATION_DATE >= trunc(CASE
WHEN :rundate = TO_DATE('01/01/1900', 'DD/MM/YYYY') THEN ADD_MONTHS(SYSDATE, -1)
ELSE ADD_MONTHS(:rundate, -1)
END, 'MON')
AND PFT.FLIGHT_OPERATION_DATE < trunc(CASE
WHEN :rundate = TO_DATE('01/01/1900', 'DD/MM/YYYY') THEN TRUNC(SYSDATE)
ELSE TRUNC(:rundate)
END, 'MON')
AND PFT.TYPE IN ('C', 'F')
AND PFT.RECORD_TYPE = 'M'
AND (
PFT.TERMINAL_OPERATOR NOT IN ('X', 'A')
OR (
PFT.TERMINAL_OPERATOR <> 'X'
AND FA.CARRIER_CODE IN (SELECT * FROM SPECIAL_HANDLING_AIRLINE)
AND PPT.REVENUE_TYPE IN (SELECT * FROM SPECIAL_REVENUE_TYPE)
AND PPT.SHIPMENT_FLOW_TYPE IN (SELECT * FROM SPECIAL_SHIPMENT_FLOW_TYPE)
AND PFT.FLIGHT_OPERATION_DATE >= (SELECT EFF_DATE FROM SPECIAL_HANDLING_EFF_DATE)
)
)
AND PFT.DELETING_DATETIME IS NULL;
```
请注意,需要将 `TRUNC` 和 `CONCAT` 函数替换为 Spark SQL 中的相应函数,并使用 `JOIN` 语句替换 `LEFT JOIN` 语句。还需要更改零散的子查询,以便在 Spark SQL 中使用。
阅读全文