|
|
@@ -107,7 +107,7 @@
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane v-if="tableData.filter(i=>i.type=='cabinet').length>0" label="快递柜" name="cabinet">
|
|
|
<div style="display: flex;align-items: center;flex-wrap: wrap;gap: 10px;place-content: center;width: 100%;justify-content: flex-start;flex-direction: row;align-content: center;">
|
|
|
- <div :class="item.box_status==1?'boxunused':''" v-for="(item,index) in currentCabinet.boxlist" style="width: 60px;height:60px;border: 1px solid #33333317;border-radius: 6px;position: relative;">
|
|
|
+ <div :class="item.box_status==1?'':''" v-for="(item,index) in currentCabinet.boxlist" style="width: 60px;height:60px;border: 1px solid #33333317;border-radius: 6px;position: relative;">
|
|
|
<div style="font-size: 10px;padding:8px">{{ item.box_name }}</div>
|
|
|
|
|
|
<el-button size="small" text style="position: absolute;right: 0;bottom: 0;" @click="openbox">
|
|
|
@@ -158,11 +158,13 @@ import { TreeNode } from "element-plus";
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
import EZUIKit from 'ezuikit-js';
|
|
|
import { getCameraPlayerConfig } from '@/api/gpsData';
|
|
|
-import { updateData } from "@/api/system/dict/data";
|
|
|
+import { updateData,listData } from "@/api/system/dict/data";
|
|
|
import imgulock from "@/assets/images/unlock@2x.png";
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { tbl_sites } = toRefs<any>(proxy?.useDict('tbl_sites'));
|
|
|
+
|
|
|
+const sites = ref([]);
|
|
|
+
|
|
|
|
|
|
const formdata = ref({
|
|
|
name: "",
|
|
|
@@ -203,22 +205,37 @@ const savedata = () => {
|
|
|
//保存数据
|
|
|
var data = {
|
|
|
dictCode: currentdata.value.dictCode,
|
|
|
- dictValue: currentdata.value.value,
|
|
|
- dictLabel: currentdata.value.label,
|
|
|
+ dictValue: currentdata.value.dictValue,
|
|
|
+ dictLabel: currentdata.value.dictLabel,
|
|
|
dictType: "tbl_sites",
|
|
|
remark: JSON.stringify(tableData.value)
|
|
|
}
|
|
|
updateData(data).then(res => {
|
|
|
ElMessage.success("成功!");
|
|
|
+ getSites();
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const getSites = () => {
|
|
|
+ listData({ dictType: "tbl_sites" }).then(res2 => {
|
|
|
+ sites.value = res2.rows;
|
|
|
+
|
|
|
+ var index = 1;
|
|
|
+ data.value = [{
|
|
|
+ id: 1,
|
|
|
+ label: "站点",
|
|
|
+ children: sites.value.map(i => { return { id: ++index, label: i.dictLabel } }),
|
|
|
+ },];
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
const deleteDevice = (datac) => {
|
|
|
tableData.value = tableData.value.filter(i => i.type != datac.type);
|
|
|
var data = {
|
|
|
dictCode: currentdata.value.dictCode,
|
|
|
- dictValue: currentdata.value.value,
|
|
|
- dictLabel: currentdata.value.label,
|
|
|
+ dictValue: currentdata.value.dictValue,
|
|
|
+ dictLabel: currentdata.value.dictLabel,
|
|
|
dictType: "tbl_sites",
|
|
|
remark: JSON.stringify(tableData.value)
|
|
|
}
|
|
|
@@ -241,8 +258,8 @@ const currentdata = ref(null)
|
|
|
|
|
|
const treeclick = (data: TreeNodeData, node: TreeNode) => {
|
|
|
|
|
|
- currentdata.value = tbl_sites.value.filter(i => {
|
|
|
- return i.label == data.label
|
|
|
+ currentdata.value = sites.value.filter(i => {
|
|
|
+ return i.dictLabel == data.label
|
|
|
})[0];
|
|
|
tableData.value = [];
|
|
|
if (currentdata.value) {
|
|
|
@@ -337,7 +354,7 @@ const data = computed(() => {
|
|
|
return [{
|
|
|
id: 1,
|
|
|
label: "站点",
|
|
|
- children: tbl_sites.value.map(i => { return {id:++index,label:i.label} }),
|
|
|
+ children: sites.value.map(i => { return {id:++index,label:i.dictLabel} }),
|
|
|
},]
|
|
|
});
|
|
|
onMounted(() => {
|
|
|
@@ -345,6 +362,7 @@ onMounted(() => {
|
|
|
setTimeout(() => {
|
|
|
treeRef.value.expandNode(treeRef.value.getNode(1))
|
|
|
}, 100);
|
|
|
+ getSites();
|
|
|
// treeRef.value.expandNode(treeRef.value.getNode(1))
|
|
|
}
|
|
|
});
|