D:\wz_code\invoice-vue\src\components\layout\News.vue 265:25 error Empty block statement no-empty
时间: 2023-12-07 19:39:34 浏览: 139
这个错误提示表明在你的 `News.vue` 文件的第 265 行,你使用了一个空的大括号 `{}`。在 Vue.js 中,大括号通常用于声明一个块级作用域的语句,例如 `if`、`for`、`while` 等语句。如果你在没有任何需要执行的操作时使用了大括号,就会触发这个错误。
解决这个问题的方法就是检查你的代码,确保你在使用大括号的地方有适当的逻辑或操作。例如,如果你在使用 `if` 语句,确保 `if` 条件是正确的,并且大括号内至少有一个有效的语句。
如果你可以提供更多的代码上下文,我可以更具体地帮助你解决问题。
如果你只是想简单地删除该行的大括号,并且确保它不会对其他部分产生影响,你可以直接在代码编辑器中删除该行,并重新编译你的代码看看问题是否得到解决。但请注意,如果你在删除大括号后仍然遇到其他错误,那么问题可能出在其他地方。
相关问题
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 中使用。
<el-tabs v-if="orderInvoiceData.length" class='invoice_list' v-model="currentOrderTab" @tab-click="clickOrderTab"> <el-tab-pane :label="numToStr(order.order_info.order_no)" :name="numToStr(order.order_info.order_no)" :key="order.order_info.order_no" v-for="order in orderInvoiceData"> <el-tabs v-if="!order.order_info.is_error" tab-position="left" style="height:calc(100% - 96px);" v-model="currentInvoiceTab"> <el-tab-pane :label="invoice.invoice_info.label" :key="invoice.invoice_info.label" :name="invoice.invoice_info.name" v-for='(invoice, index) in order.invoiceList'> </el-tab-pane> </el-tabs> </el-tab-pane> </el-tabs> vue3 如何点击第一个el-tabs时,自动触发对应的标签页
你可以在 `created` 生命周期函数中监听 `currentOrderTab` 的变化,在 `currentOrderTab` 变化时切换第二个 `el-tabs` 的选项卡,例如:
```html
<el-tabs v-if="orderInvoiceData.length" class='invoice_list' v-model="currentOrderTab" @tab-click="clickOrderTab">
<el-tab-pane :label="numToStr(order.order_info.order_no)" :name="numToStr(order.order_info.order_no)" :key="order.order_info.order_no" v-for="order in orderInvoiceData">
<el-tabs v-if="!order.order_info.is_error" tab-position="left" style="height:calc(100% - 96px);" v-model="currentInvoiceTab">
<el-tab-pane :label="invoice.invoice_info.label" :key="invoice.invoice_info.label" :name="invoice.invoice_info.name" v-for='(invoice, index) in order.invoiceList'>
</el-tab-pane>
</el-tabs>
</el-tab-pane>
</el-tabs>
```
```js
created() {
// 监听 currentOrderTab 的变化
this.$watch('currentOrderTab', (newVal) => {
// 找到对应的发票标签页名称
const invoiceName = this.orderInvoiceData.find(order => numToStr(order.order_info.order_no) === newVal).invoiceList[0].invoice_info.name;
// 切换第二个 el-tabs 的选项卡为对应的发票标签页
this.currentInvoiceTab = invoiceName;
});
}
```
这样,当你点击第一个 `el-tabs` 的选项卡时,就会自动触发对应的发票标签页。
阅读全文