3277f5d5 by fanguang Committed by lihua

fix

1 parent 41b59a4e
...@@ -35,13 +35,13 @@ const selectRowData = ref([]) ...@@ -35,13 +35,13 @@ const selectRowData = ref([])
35 const page = ref({ 35 const page = ref({
36 limit: 50, 36 limit: 50,
37 curr: 1, 37 curr: 1,
38 // sizes: [ 38 sizes: [
39 // { label: "100", value: 100 }, 39 { label: "100", value: 100 },
40 // { label: "200", value: 200 }, 40 { label: "200", value: 200 },
41 // { label: "300", value: 300 }, 41 { label: "300", value: 300 },
42 // { label: "400", value: 400 }, 42 { label: "400", value: 400 },
43 // { label: "500", value: 500 }, 43 { label: "500", value: 500 },
44 // ], 44 ],
45 }); 45 });
46 const tableChunkData: any = ref([]) 46 const tableChunkData: any = ref([])
47 const tableData: any = ref([]) 47 const tableData: any = ref([])
...@@ -51,7 +51,7 @@ const tableInfo: any = ref({ ...@@ -51,7 +51,7 @@ const tableInfo: any = ref({
51 fields: [], 51 fields: [],
52 data: [], 52 data: [],
53 page: { 53 page: {
54 type: "count", 54 type: "normal",
55 rows: 0, 55 rows: 0,
56 ...page.value, 56 ...page.value,
57 }, 57 },
...@@ -117,13 +117,14 @@ const dialogInfo = ref({ ...@@ -117,13 +117,14 @@ const dialogInfo = ref({
117 117
118 118
119 const getFirstPageData = () => { 119 const getFirstPageData = () => {
120 page.value.curr = 1;
120 toSearch({}) 121 toSearch({})
121 } 122 }
122 123
123 const toSearch = (val: any, clear: boolean = false) => { 124 const toSearch = (val: any, clear: boolean = false) => {
124 let params = { 125 let params = {
125 pageIndex: 1, 126 pageIndex: page.value.curr,
126 pageSize: -1, 127 pageSize: page.value.limit,
127 standardGuid : standardGuid.value 128 standardGuid : standardGuid.value
128 } 129 }
129 getTableData(params); 130 getTableData(params);
...@@ -145,15 +146,18 @@ const tableSelectionChange = (val, tId) => { ...@@ -145,15 +146,18 @@ const tableSelectionChange = (val, tId) => {
145 146
146 const tablePageChange = (info) => { 147 const tablePageChange = (info) => {
147 page.value.curr = Number(info.curr); 148 page.value.curr = Number(info.curr);
148 if (page.value.limit != Number(info.limit)) {
149 page.value.limit = Number(info.limit); 149 page.value.limit = Number(info.limit);
150 chunkData() 150 toSearch({});
151 } else { 151 // page.value.curr = Number(info.curr);
152 tableData.value = tableChunkData.value[page.value.curr - 1] 152 // if (page.value.limit != Number(info.limit)) {
153 tableInfo.value.data = tableData.value 153 // page.value.limit = Number(info.limit);
154 tableInfo.value.page.limit = page.value.limit 154 // chunkData()
155 tableInfo.value.page.curr = page.value.curr 155 // } else {
156 } 156 // tableData.value = tableChunkData.value[page.value.curr - 1]
157 // tableInfo.value.data = tableData.value
158 // tableInfo.value.page.limit = page.value.limit
159 // tableInfo.value.page.curr = page.value.curr
160 // }
157 }; 161 };
158 162
159 const toolBtnClick = (btn) => { 163 const toolBtnClick = (btn) => {
......
1 <route lang="yaml"> 1 <route lang="yaml">
2 name: dictionary 2 name: metadataStandardCodetable
3 </route> 3 </route>
4 4
5 <script lang="ts" setup name="dictionary"> 5 <script lang="ts" setup name="metadataStandardCodetable">
6 import { ref } from 'vue' 6 import { ref } from 'vue'
7 import { ElMessage, ElMessageBox } from "element-plus"; 7 import { ElMessage, ElMessageBox } from "element-plus";
8 import { Search } from '@element-plus/icons-vue' 8 import { Search } from '@element-plus/icons-vue'
...@@ -39,6 +39,7 @@ import { ...@@ -39,6 +39,7 @@ import {
39 getNewDataTypeList 39 getNewDataTypeList
40 } from '@/api/modules/dataInventory'; 40 } from '@/api/modules/dataInventory';
41 import router from '@/router' 41 import router from '@/router'
42 import { TableColumnWidth } from '@/utils/enum';
42 43
43 const { proxy } = getCurrentInstance() as any; 44 const { proxy } = getCurrentInstance() as any;
44 45
...@@ -119,7 +120,7 @@ const tableInfo: any = ref({ ...@@ -119,7 +120,7 @@ const tableInfo: any = ref({
119 let status = scope.row.bizState; 120 let status = scope.row.bizState;
120 return status == 'Y' ? '启用' : '停用'; 121 return status == 'Y' ? '启用' : '停用';
121 } }, 122 } },
122 { label: '创建时间', field: 'createTime', width: 140 } 123 { label: '创建时间', field: 'createTime', width: TableColumnWidth }
123 ], 124 ],
124 data: [], 125 data: [],
125 page: { 126 page: {
...@@ -130,9 +131,10 @@ const tableInfo: any = ref({ ...@@ -130,9 +131,10 @@ const tableInfo: any = ref({
130 actionInfo: { 131 actionInfo: {
131 label: "操作", 132 label: "操作",
132 type: "btn", 133 type: "btn",
133 width: 92, //不要刚好90.缩小浏览器会因为小数点的差距而换行, 134 width: 132, //不要刚好90.缩小浏览器会因为小数点的差距而换行,
134 fixed: 'right', 135 fixed: 'right',
135 btns: [ 136 btns: [
137 { label: '查看', value: 'detail'},
136 { label: "编辑", value: "edit" }, 138 { label: "编辑", value: "edit" },
137 { label: "删除", value: "delete" }, 139 { label: "删除", value: "delete" },
138 ], 140 ],
...@@ -146,89 +148,6 @@ const orginOptions = [ ...@@ -146,89 +148,6 @@ const orginOptions = [
146 { label: 'name', value: 'name' }, 148 { label: 'name', value: 'name' },
147 ] 149 ]
148 let codeOptions = ref([]) 150 let codeOptions = ref([])
149 const orginItems = [
150 {
151 label: '标准类型',
152 type: 'select',
153 placeholder: '请选择',
154 field: 'standardTypeCode',
155 default: '',
156 options: standardOptions,
157 clearable: true,
158 required: true
159 }
160 , {
161 label: '字典英文名',
162 type: 'input',
163 maxlength: 20,
164 placeholder: '请输入',
165 field: 'enName',
166 clearable: true,
167 required: true,
168 disabled: false
169 }, {
170 label: '排序',
171 type: 'input',
172 placeholder: '请输入',
173 field: 'orderNum',
174 maxlength: 6,
175 clearable: true,
176 required: true,
177 visible: true,
178 }, {
179 label: '字典类型',
180 type: 'radio-panel',
181 placeholder: '',
182 field: 'dictionaryType',
183 default: 1,
184 options: [
185 { label: '列表结构', value: 1 },
186 { label: '层级结构', value: 2 }
187 ],
188 children: [
189 {
190 label: '编码字段',
191 type: 'select',
192 placeholder: '请输入',
193 field: 'codeColumn',
194 default: '',
195 options: [],
196 clearable: true,
197 required: true
198 }, {
199 label: '编码名称',
200 type: 'select',
201 placeholder: '请输入',
202 field: 'codeName',
203 default: '',
204 options: [],
205 clearable: true,
206 required: true
207 }, {
208 label: '顶级节点值',
209 type: 'input',
210 placeholder: '请输入',
211 field: 'topNodeValue',
212 clearable: true,
213 required: true,
214 visible: false
215 }, {
216 label: '路径',
217 type: 'input',
218 placeholder: '请输入',
219 field: 'path',
220 clearable: true,
221 required: true,
222 block: true,
223 visible: false
224 }
225 ],
226 clearable: true,
227 required: false,
228 block: true,
229 visible: true,
230 },
231 ]
232 const formItems: any = ref([ 151 const formItems: any = ref([
233 { 152 {
234 label: '标准类型', 153 label: '标准类型',
...@@ -448,7 +367,7 @@ const formTable = ref({ ...@@ -448,7 +367,7 @@ const formTable = ref({
448 }, 367 },
449 tableTool: { 368 tableTool: {
450 col: 'float-right', 369 col: 'float-right',
451 visible: true, 370 visible: false,
452 btns: [ 371 btns: [
453 { label: "新增行", value: "add-row", type: 'primary' }, 372 { label: "新增行", value: "add-row", type: 'primary' },
454 { label: "批量删除", value: "remove_batch" }, 373 { label: "批量删除", value: "remove_batch" },
...@@ -569,7 +488,7 @@ const drawerInfo: any = ref({ ...@@ -569,7 +488,7 @@ const drawerInfo: any = ref({
569 footer: { 488 footer: {
570 btns: [ 489 btns: [
571 { type: 'default', label: '取消', value: 'cancel' }, 490 { type: 'default', label: '取消', value: 'cancel' },
572 { type: 'primary', label: '保存', value: 'submit' }, 491 { type: 'primary', label: '保存', value: 'submit', visible: true },
573 { type: 'primary', label: '保存并添加数据', value: 'submit', visible: true }, 492 { type: 'primary', label: '保存并添加数据', value: 'submit', visible: true },
574 ] 493 ]
575 }, 494 },
...@@ -941,17 +860,24 @@ const tableBtnClick = (scope, btn) => { ...@@ -941,17 +860,24 @@ const tableBtnClick = (scope, btn) => {
941 if (type == "edit" || type == 'detail') { 860 if (type == "edit" || type == 'detail') {
942 fieldTableInfo.value.tableInfo.fields = [] 861 fieldTableInfo.value.tableInfo.fields = []
943 fieldTableInfo.value.tableInfo.data = [] 862 fieldTableInfo.value.tableInfo.data = []
944 drawerInfo.value.header.title = type == 'edit' ? "编辑标准代码" : "数据字典详情"; 863 drawerInfo.value.header.title = type == 'edit' ? "编辑标准代码" : "标准代码详情";
945 drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto' 864 drawerInfo.value.modalClass = type == 'edit' ? '' : 'wrap_width_auto'
946 drawerInfo.value.type = type 865 drawerInfo.value.type = type
866 drawerInfo.value.footer.btns.forEach(item => {
867 if (item.value === 'submit') {
868 item.visible = type === 'detail' ? false : true
869 }
870 })
947 drawerInfo.value.visible = true; 871 drawerInfo.value.visible = true;
948 drawerInfo.value.loading = true; 872 drawerInfo.value.loading = true;
873 formTable.value.tableInfo.actionInfo.show = type === 'detail' ? false : true
874 formTable.value.tableTool.visible = type === 'detail' ? false : true
949 formTable.value.tableInfo.loading = true 875 formTable.value.tableInfo.loading = true
950 getStandardCodeDetail(row.guid).then((res: any) => { 876 getStandardCodeDetail(row.guid).then((res: any) => {
951 if (res.code == proxy.$passCode && res.data) { 877 if (res.code == proxy.$passCode && res.data) {
952 let data = res.data 878 let data = res.data
953 currTableData.value = data; 879 currTableData.value = data;
954 setDetailInfo() 880 setDetailInfo(type)
955 } else { 881 } else {
956 ElMessage({ 882 ElMessage({
957 type: "error", 883 type: "error",
...@@ -970,7 +896,7 @@ const tableBtnClick = (scope, btn) => { ...@@ -970,7 +896,7 @@ const tableBtnClick = (scope, btn) => {
970 open("此操作将永久删除, 是否继续?", "warning"); 896 open("此操作将永久删除, 是否继续?", "warning");
971 tableInfo.value.loading = false 897 tableInfo.value.loading = false
972 } 898 }
973 }; 899 }
974 900
975 const checkDelete = (isBatch: any = false) => { 901 const checkDelete = (isBatch: any = false) => {
976 if (drawerInfo.value.visible) { 902 if (drawerInfo.value.visible) {
...@@ -1307,10 +1233,12 @@ function loadTreeNode (node, resolve) { ...@@ -1307,10 +1233,12 @@ function loadTreeNode (node, resolve) {
1307 } 1233 }
1308 1234
1309 // 设置详情信息 1235 // 设置详情信息
1310 const setDetailInfo = () => { 1236 const setDetailInfo = (type) => {
1237 console.log('type', type)
1311 const row = JSON.parse(JSON.stringify(currTableData.value)) 1238 const row = JSON.parse(JSON.stringify(currTableData.value))
1312 formItems.value.forEach(item => { 1239 formItems.value.forEach(item => {
1313 item.default = row[item.field] || '' 1240 item.default = row[item.field] || ''
1241 item.disabled = type === 'detail' ? true : false
1314 }) 1242 })
1315 formInfo.value.formInfo.items = formItems.value 1243 formInfo.value.formInfo.items = formItems.value
1316 formTableData.value = row.standardCodeFields.map(item => { 1244 formTableData.value = row.standardCodeFields.map(item => {
...@@ -1328,13 +1256,15 @@ const setDetailInfo = () => { ...@@ -1328,13 +1256,15 @@ const setDetailInfo = () => {
1328 formTable.value.tableInfo.fields = fields 1256 formTable.value.tableInfo.fields = fields
1329 formTable.value.tableInfo.data = formTableData.value 1257 formTable.value.tableInfo.data = formTableData.value
1330 formTable.value.tableInfo.editInfo = JSON.parse(JSON.stringify(editTableInfo.value)) 1258 formTable.value.tableInfo.editInfo = JSON.parse(JSON.stringify(editTableInfo.value))
1331 formTable.value.tableInfo.readonly = false 1259 formTable.value.tableInfo.readonly = type === 'detail' ? true : false
1332 formTable.value.tableInfo.multiple = true 1260 formTable.value.tableInfo.multiple = true
1333 formTable.value.tableInfo.actionInfo.show = true 1261 // formTable.value.tableInfo.actionInfo.show = true
1334 formTable.value.tableTool.visible = true 1262 // formTable.value.tableTool.visible = true
1335 drawerInfo.value.container.contents = contents.value['add'] 1263 drawerInfo.value.container.contents = contents.value['add']
1336
1337 drawerInfo.value.visible = true 1264 drawerInfo.value.visible = true
1265
1266
1267
1338 setCodeOptions() 1268 setCodeOptions()
1339 } 1269 }
1340 1270
...@@ -1416,56 +1346,12 @@ const radioGroupChange = async (val, info) => { ...@@ -1416,56 +1346,12 @@ const radioGroupChange = async (val, info) => {
1416 // setGroup() 1346 // setGroup()
1417 if (val == 1) { 1347 if (val == 1) {
1418 // 列表结构 1348 // 列表结构
1419 formItems.value.find(v => v.field === 'codeFields')['visible'] = true
1420 formItems.value.find(v => v.field === 'codeFieldName')['visible'] = true
1421 formItems.value.find(v => v.field === 'hierarchy')['visible'] = false 1349 formItems.value.find(v => v.field === 'hierarchy')['visible'] = false
1422 } else { 1350 } else {
1423 formItems.value.find(v => v.field === 'codeFields')['visible'] = false
1424 formItems.value.find(v => v.field === 'codeFieldName')['visible'] = false
1425 formItems.value.find(v => v.field === 'hierarchy')['visible'] = true 1351 formItems.value.find(v => v.field === 'hierarchy')['visible'] = true
1426 } 1352 }
1427 } 1353 }
1428 1354
1429 // 切换结构类型 设置选项显隐
1430 const setGroup = () => {
1431 let dictionaryOpts = formItems.value.at(-1).children
1432 if (dictionaryType.value == 1) {
1433 dictionaryOpts[2].visible = false
1434 dictionaryOpts[3].visible = false
1435 } else if (dictionaryType.value == 2) {
1436 dictionaryOpts[2].visible = false
1437 dictionaryOpts[3].block = false
1438 dictionaryOpts[3].visible = true
1439 } else if (dictionaryType.value == 3) {
1440 dictionaryOpts[2].visible = true
1441 dictionaryOpts[3].block = true
1442 dictionaryOpts[3].visible = true
1443 } else if (dictionaryType.value == 4) {
1444 dictionaryOpts[2].visible = false
1445 dictionaryOpts[3].block = true
1446 dictionaryOpts[3].visible = true
1447 }
1448 formInfo.value.formInfo.items = formItems.value
1449 }
1450
1451 onActivated(() => {
1452 // getCodeRuleData();
1453 // let guid = cacheStore.getCatch('dictionaryGuid');
1454 // if (guid) {
1455 // nextTick(() => {
1456 // if (treePromise.value) {
1457 // treePromise.value.then(() => {
1458 // nodeClick({ guid: guid, dictionaryType: '1', type: 2 });
1459 // cacheStore.setCatch('dictionaryGuid', null);
1460 // });
1461 // } else {
1462 // nodeClick({ guid: guid, type: 1 });
1463 // cacheStore.setCatch('dictionaryGuid', null);
1464 // }
1465 // });
1466 // }
1467 })
1468
1469 onBeforeMount(() => { 1355 onBeforeMount(() => {
1470 // getDataType() 1356 // getDataType()
1471 getTreeData() 1357 getTreeData()
......
1 <route lang="yaml"> 1 <route lang="yaml">
2 name: importFile 2 name: metadataStandardImport
3 </route> 3 </route>
4 4
5 <script lang="ts" setup name="importFile"> 5 <script lang="ts" setup name="metadataStandardImport">
6 import { ref } from "vue"; 6 import { ref } from "vue";
7 import { useRoute, useRouter } from "vue-router" 7 import { useRoute, useRouter } from "vue-router"
8 import useUserStore from "@/store/modules/user"; 8 import useUserStore from "@/store/modules/user";
...@@ -516,7 +516,7 @@ onActivated(() => { ...@@ -516,7 +516,7 @@ onActivated(() => {
516 @cascaderChange="cascaderChange" @selectChange="selectChange"> 516 @cascaderChange="cascaderChange" @selectChange="selectChange">
517 <div> 517 <div>
518 <div class="title" style="color:#333">2、导入前请先导入文件的sheet与标准做对应</div> 518 <div class="title" style="color:#333">2、导入前请先导入文件的sheet与标准做对应</div>
519 <el-form :label-width="120" style="margin-top:20px"> 519 <el-form :label-width="240" style="margin-top:20px">
520 <el-form-item label="全局变量"> 520 <el-form-item label="全局变量">
521 <span>选择sheet页</span> 521 <span>选择sheet页</span>
522 </el-form-item> 522 </el-form-item>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!