|
@@ -1,22 +1,28 @@
|
|
|
<template>
|
|
|
<hc-dialog
|
|
|
v-model="isShow"
|
|
|
- is-footer-center
|
|
|
- title="编辑元素表单信息"
|
|
|
+ :footer="false"
|
|
|
+ :title="info.tableName"
|
|
|
@close="dialogClose"
|
|
|
widths="56rem"
|
|
|
+ :isTable="true"
|
|
|
>
|
|
|
- <hc-table :column="tableColumn" :datas="tableData"> </hc-table>
|
|
|
+ <hc-table :column="tableColumn" :datas="tableData">
|
|
|
+ <template #eType="{ row }">
|
|
|
+ {{ getDictionaryName(dataTypeList, row.eType, true) }}
|
|
|
+ </template>
|
|
|
+ </hc-table>
|
|
|
</hc-dialog>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
import { ref, watch } from "vue";
|
|
|
-import mainApi from "~api/wbs/wbsforelement";
|
|
|
import treeApi from "~api/wbs/tree";
|
|
|
+import { getArrValue } from "js-fast-way";
|
|
|
+import { getDictionaryData, getDictionaryName } from "~src/utils/tools";
|
|
|
|
|
|
const props = defineProps({
|
|
|
info: {
|
|
|
- type: Array,
|
|
|
+ type: Object,
|
|
|
default: () => {},
|
|
|
},
|
|
|
});
|
|
@@ -27,10 +33,18 @@ const emit = defineEmits(["close"]);
|
|
|
const isShow = defineModel("modelValue", {
|
|
|
default: false,
|
|
|
});
|
|
|
+const tableData = ref([]);
|
|
|
+const getTableData = async () => {
|
|
|
+ const { data } = await treeApi.selectPrivateFormElements({
|
|
|
+ id: info.value?.initTableId,
|
|
|
+ });
|
|
|
+ tableData.value = getArrValue(data);
|
|
|
+};
|
|
|
//监听显示
|
|
|
watch(isShow, (val) => {
|
|
|
if (val) {
|
|
|
- // getDataTypelist();
|
|
|
+ getTableData();
|
|
|
+ getDataTypelist();
|
|
|
}
|
|
|
});
|
|
|
const info = ref(props.info);
|
|
@@ -47,7 +61,6 @@ const dialogClose = () => {
|
|
|
isShow.value = false;
|
|
|
emit("close");
|
|
|
};
|
|
|
-const tableData = ref([]);
|
|
|
|
|
|
const tableColumn = ref([
|
|
|
{ key: "eName", name: "字段信息" },
|
|
@@ -56,4 +69,13 @@ const tableColumn = ref([
|
|
|
{ key: "eAllowDeviation", name: "允许偏差值" },
|
|
|
{ key: "eInspectionMethod", name: "检查方法和频率" },
|
|
|
]);
|
|
|
+
|
|
|
+//获取数据类型
|
|
|
+const dataTypeList = ref([]);
|
|
|
+const getDataTypelist = async () => {
|
|
|
+ if (dataTypeList.value.length > 1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dataTypeList.value = await getDictionaryData("data_type", false);
|
|
|
+};
|
|
|
</script>
|