|
@@ -3,9 +3,9 @@
|
|
|
v-model="isShow"
|
|
|
:footer="false"
|
|
|
:title="info.tableName"
|
|
|
- @close="dialogClose"
|
|
|
widths="56rem"
|
|
|
- :isTable="true"
|
|
|
+ :is-table="true"
|
|
|
+ @close="dialogClose"
|
|
|
>
|
|
|
<hc-table :column="tableColumn" :datas="tableData">
|
|
|
<template #eType="{ row }">
|
|
@@ -14,68 +14,69 @@
|
|
|
</hc-table>
|
|
|
</hc-dialog>
|
|
|
</template>
|
|
|
+
|
|
|
<script setup>
|
|
|
-import { ref, watch } from "vue";
|
|
|
-import treeApi from "~api/wbs/tree";
|
|
|
-import { getArrValue } from "js-fast-way";
|
|
|
-import { getDictionaryData, getDictionaryName } from "~src/utils/tools";
|
|
|
+import { ref, watch } from 'vue'
|
|
|
+import treeApi from '~api/wbs/tree'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
+import { getDictionaryData, getDictionaryName } from '~src/utils/tools'
|
|
|
|
|
|
const props = defineProps({
|
|
|
info: {
|
|
|
type: Object,
|
|
|
default: () => {},
|
|
|
},
|
|
|
-});
|
|
|
+})
|
|
|
//事件
|
|
|
-const emit = defineEmits(["close"]);
|
|
|
+const emit = defineEmits(['close'])
|
|
|
//双向绑定
|
|
|
// eslint-disable-next-line no-undef
|
|
|
-const isShow = defineModel("modelValue", {
|
|
|
+const isShow = defineModel('modelValue', {
|
|
|
default: false,
|
|
|
-});
|
|
|
-const tableData = ref([]);
|
|
|
+})
|
|
|
+const tableData = ref([])
|
|
|
const getTableData = async () => {
|
|
|
const { data } = await treeApi.selectPrivateFormElements({
|
|
|
id: info.value?.initTableId,
|
|
|
- });
|
|
|
- tableData.value = getArrValue(data);
|
|
|
-};
|
|
|
+ })
|
|
|
+ tableData.value = getArrValue(data)
|
|
|
+}
|
|
|
//监听显示
|
|
|
watch(isShow, (val) => {
|
|
|
if (val) {
|
|
|
- getTableData();
|
|
|
- getDataTypelist();
|
|
|
+ getTableData()
|
|
|
+ getDataTypelist()
|
|
|
}
|
|
|
-});
|
|
|
-const info = ref(props.info);
|
|
|
+})
|
|
|
+const info = ref(props.info)
|
|
|
watch(
|
|
|
() => [props.info],
|
|
|
([inf]) => {
|
|
|
- info.value = inf;
|
|
|
+ info.value = inf
|
|
|
},
|
|
|
- { deep: true }
|
|
|
-);
|
|
|
+ { deep: true },
|
|
|
+)
|
|
|
|
|
|
//关闭弹窗
|
|
|
const dialogClose = () => {
|
|
|
- isShow.value = false;
|
|
|
- emit("close");
|
|
|
-};
|
|
|
+ isShow.value = false
|
|
|
+ emit('close')
|
|
|
+}
|
|
|
|
|
|
const tableColumn = ref([
|
|
|
- { key: "eName", name: "字段信息" },
|
|
|
- { key: "eType", name: "数据类型" },
|
|
|
- { key: "eLength", name: "长度" },
|
|
|
- { key: "eAllowDeviation", name: "允许偏差值" },
|
|
|
- { key: "eInspectionMethod", name: "检查方法和频率" },
|
|
|
-]);
|
|
|
+ { key: 'eName', name: '字段信息' },
|
|
|
+ { key: 'eType', name: '数据类型' },
|
|
|
+ { key: 'eLength', name: '长度' },
|
|
|
+ { key: 'eAllowDeviation', name: '允许偏差值' },
|
|
|
+ { key: 'eInspectionMethod', name: '检查方法和频率' },
|
|
|
+])
|
|
|
|
|
|
//获取数据类型
|
|
|
-const dataTypeList = ref([]);
|
|
|
+const dataTypeList = ref([])
|
|
|
const getDataTypelist = async () => {
|
|
|
if (dataTypeList.value.length > 1) {
|
|
|
- return;
|
|
|
+ return
|
|
|
}
|
|
|
- dataTypeList.value = await getDictionaryData("data_type", false);
|
|
|
-};
|
|
|
+ dataTypeList.value = await getDictionaryData('data_type', false)
|
|
|
+}
|
|
|
</script>
|