|
|
@@ -68,6 +68,10 @@
|
|
|
<SvgIcon name="ele-Search"/>
|
|
|
查询
|
|
|
</el-button>
|
|
|
+ <el-button :disabled="state.checkedList.length===0" class="ml10" plain size="default"
|
|
|
+ type="success" @click="handleBatchBind">
|
|
|
+ 批量绑定平台
|
|
|
+ </el-button>
|
|
|
|
|
|
<!-- <el-button class="ml10" plain size="default" type="success" @click="handleUploadVisible">-->
|
|
|
<!-- <SvgIcon name="ele-Upload"/>-->
|
|
|
@@ -76,7 +80,7 @@
|
|
|
</el-form>
|
|
|
|
|
|
<el-table
|
|
|
- border
|
|
|
+ ref="table_ref"
|
|
|
stripe="stripe"
|
|
|
:height="state.tableData.height"
|
|
|
highlight-current-row
|
|
|
@@ -89,6 +93,7 @@
|
|
|
<template #empty>
|
|
|
<el-empty></el-empty>
|
|
|
</template>
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
<el-table-column
|
|
|
v-for="field in state.tableData.columns"
|
|
|
:key="field.prop"
|
|
|
@@ -136,6 +141,7 @@
|
|
|
<!-- <EquipmentInfoDialog ref="equipmentInfoDialogRef" @refresh="loadData(true)"/>-->
|
|
|
<endpoint-upload ref="endpoint_upload_ref"></endpoint-upload>
|
|
|
<endpoint-dialog ref="endpoint_dialog_ref"></endpoint-dialog>
|
|
|
+ <EndpointBatchBindDialog ref="endpoint_batch_bind_ref" @refresh="handleBindFinish"></EndpointBatchBindDialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts" name="EquipmentInfoList">
|
|
|
@@ -153,15 +159,19 @@ import ExtDSelect from "/@/components/form/ExtDSelect.vue";
|
|
|
import ExtSelect from "/@/components/form/ExtSelect.vue";
|
|
|
|
|
|
import {useRouter} from "vue-router";
|
|
|
+import {Msg} from "/@/utils/message";
|
|
|
|
|
|
const router = useRouter();
|
|
|
const EndpointUpload = defineAsyncComponent(() => import("/@/views/admin/station/endpoint/upload.vue"));
|
|
|
const EndpointDialog = defineAsyncComponent(() => import("/@/views/admin/station/endpoint/dialog.vue"));
|
|
|
+const EndpointBatchBindDialog = defineAsyncComponent(() => import("/@/views/admin/station/endpoint/batch.vue"));
|
|
|
|
|
|
//定义引用
|
|
|
const queryRef = ref();
|
|
|
const endpoint_upload_ref = ref();
|
|
|
const endpoint_dialog_ref = ref();
|
|
|
+const table_ref = ref();
|
|
|
+const endpoint_batch_bind_ref = ref();
|
|
|
|
|
|
//定义变量
|
|
|
const state = reactive({
|
|
|
@@ -197,11 +207,12 @@ const state = reactive({
|
|
|
// {label: '设备生产商名称', prop: 'manufacturerName', width: 160, resizable: true},
|
|
|
// {label: '设备生产日期', prop: 'productionDate', width: 160, resizable: true},
|
|
|
{label: '更新时间', prop: 'updateTime', sortable: 'custom', resizable: true, width: 180},
|
|
|
- {
|
|
|
- label: '操作', prop: 'action', width: 120, align: 'center', fixed: 'right',
|
|
|
- }
|
|
|
+ // {
|
|
|
+ // label: '操作', prop: 'action', width: 120, align: 'center', fixed: 'right',
|
|
|
+ // }
|
|
|
],
|
|
|
},
|
|
|
+ checkedList:[]
|
|
|
})
|
|
|
|
|
|
|
|
|
@@ -241,6 +252,21 @@ const handleGotoOrder = (row: any) => {
|
|
|
router.push(`/ordering?connectorId=${row.equipmentId}`)
|
|
|
}
|
|
|
|
|
|
+const handleBatchBind = () => {
|
|
|
+ if(state.checkedList.length<=0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ endpoint_batch_bind_ref.value?.open(state.checkedList.map(k=>k.equipmentId))
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const handleBindFinish = () => {
|
|
|
+ state.checkedList =[];
|
|
|
+ table_ref.value?.clearSelection();
|
|
|
+ Msg.showLoading()
|
|
|
+ loadData(true);
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
// 初始化表格数据
|
|
|
const loadData = (refresh: boolean = false) => {
|
|
|
@@ -253,8 +279,10 @@ const loadData = (refresh: boolean = false) => {
|
|
|
state.tableData.data = list;
|
|
|
state.pageQuery.total = total;
|
|
|
state.tableData.loading = false;
|
|
|
+ Msg.hideLoading();
|
|
|
}).catch(e => {
|
|
|
console.error(e)
|
|
|
+ Msg.hideLoading();
|
|
|
state.tableData.loading = false;
|
|
|
})
|
|
|
};
|
|
|
@@ -267,11 +295,13 @@ const handleRowClick = (type: string, row: any) => {
|
|
|
const handleTableSelectionChange = (selection: any) => {
|
|
|
console.log("handleTableSelectionChange>>", selection)
|
|
|
// emit("on-check-change", selection)
|
|
|
+ state.checkedList = selection;
|
|
|
}
|
|
|
|
|
|
const handleTableSortChange = (column, prop, order) => {
|
|
|
console.log("handleTableSortChange>>", column, prop, order)
|
|
|
// emit("on-sort-change", column)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
const handleUploadVisible = () => {
|