From 3cc338fc245a7ccf7a3fce25e055fd81e1449ba2 Mon Sep 17 00:00:00 2001 From: zelian_wu Date: Mon, 8 Apr 2024 11:55:38 +0800 Subject: [PATCH] 2024-04-08 --- src/api/base/properties.js | 3 + .../base/propertiesItem/propertiesItem.vue | 60 ++++-- .../base/propertiesItem/propertiesModel.vue | 184 +++++++++++++----- src/views/modules/sys/dict-data.vue | 2 +- src/views/modules/sys/dict.vue | 65 +++++-- src/views/modules/test/requestForTest.vue | 19 +- .../modules/test/testSoBom/testTable.vue | 1 + 7 files changed, 238 insertions(+), 96 deletions(-) diff --git a/src/api/base/properties.js b/src/api/base/properties.js index 2d88ed3..55eaf8a 100644 --- a/src/api/base/properties.js +++ b/src/api/base/properties.js @@ -49,4 +49,7 @@ export const searchBUList= (data) => createAPI(`/properties/bu/list`,'post',data export const searchPropertiesGroup= (data) => createAPI(`/properties/group/list`,'post',data) export const searchBUPropertiesList= (data) => createAPI(`/bu/properties/list`,'post',data) export const saveBUPropertiesList= (data) => createAPI(`/bu/properties/save`,'post',data) +export const searchAllItemTypeList= (data) => createAPI(`/properties/item/type/list`,'post',data) +export const searchAllTypeList= (data) => createAPI(`/properties/type/list`,'get',data) +export const searchAllTypeRelationshipList = (data) => createAPI(`/properties/type/relationship/list`,'post',data) diff --git a/src/views/modules/base/propertiesItem/propertiesItem.vue b/src/views/modules/base/propertiesItem/propertiesItem.vue index 47354de..7d906d4 100644 --- a/src/views/modules/base/propertiesItem/propertiesItem.vue +++ b/src/views/modules/base/propertiesItem/propertiesItem.vue @@ -8,15 +8,8 @@ - - - - - - - - - + + @@ -115,13 +108,14 @@ - - - - - - - + + + + + + + + @@ -202,6 +196,7 @@ saveItemAvailable, deleteItemAvailable, } from "@/api/base/properties.js" + import {searchAllItemTypeList, searchAllTypeList} from "../../../../api/base/properties"; export default { watch: { @@ -232,7 +227,7 @@ }, data () { return { - + itemTypeList:[], // 导出 start exportData: [], exportName: "属性" + this.dayjs().format('YYYYMMDDHHmmss'), @@ -292,7 +287,7 @@ serialNumber: '100002001TableValueType', tableId: "100002001Table", tableName: "属性表", - columnProp: 'itemType', + columnProp: 'functionTypeDesc', headerAlign: "center", align: "center", columnLabel: '属性类型', @@ -544,9 +539,36 @@ }) }, created () { - this.getDataList() + this.getDataList(); + // this.searchAllItemTypeList(); + this.searchAllTypeList(); }, methods: { + searchAllTypeList(){ + searchAllTypeList().then(({data})=>{ + if (data && data.code === 0) { + this.itemTypeList = data.rows; + } else { + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error) + }) + }, + searchAllItemTypeList(){ + let params = { + site:this.$store.state.user.site + } + searchAllItemTypeList(params).then(({data})=>{ + if (data && data.code === 0){ + this.itemTypeList = data.rows + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + }, // 每页数 sizeChangeHandle (val) { this.pageSize = val diff --git a/src/views/modules/base/propertiesItem/propertiesModel.vue b/src/views/modules/base/propertiesItem/propertiesModel.vue index 1dc9b6c..445868d 100644 --- a/src/views/modules/base/propertiesItem/propertiesModel.vue +++ b/src/views/modules/base/propertiesItem/propertiesModel.vue @@ -8,27 +8,28 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -156,13 +157,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + v-model="modalData.group" + style="width: 100%;" + placeholder="请选择"> - - - - - - - - - - - - - - { - this.$refs[ref].initOption(); + this.searchAllTypeRelationshipList(val) + // this.$nextTick(()=>{ + // this.$refs[ref].initOption(); + // }) + }, + searchAllTypeRelationshipList(args){ + let params={ + functionType: args + } + searchAllTypeRelationshipList(params).then(({data})=>{ + if (data && data.code === 0){ + this.relationshipList = data.rows; + }else { + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error) + }) + }, + searchAllTypeList(){ + searchAllTypeList().then(({data})=>{ + if (data && data.code === 0) { + this.typeList = data.rows; + } else { + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error) }) }, searchMenuList() { @@ -903,9 +968,9 @@ export default { // this.searchData.menuList.push(this.menuList[0].menuId) } this.getDataList(); - this.$nextTick(()=>{ - this.$refs.dictDataSelect.initOption(); - }) + // this.$nextTick(()=>{ + // this.$refs.dictDataSelect.initOption(); + // }) } else { this.$message.warning(data.msg) } @@ -920,9 +985,9 @@ export default { searchBUList(params).then(({data}) => { if (data && data.code === 0) { this.BUList = data.rows; - if (this.BUList.length > 0) { - this.searchData.buNo = this.BUList[0].buNo - } + // if (this.BUList.length > 0) { + // this.searchData.buNo = this.BUList[0].buNo + // } } else { this.$message.warning(data.msg) } @@ -1010,14 +1075,18 @@ export default { codeNo: '', codeDesc: '', active: 'Y', - functionType: '', - group: '', + functionType: `${this.searchData.functionType?this.searchData.functionType:''}`, + functionGroup: `${this.searchData.functionGroup?this.searchData.functionGroup:''}`, + group: `${this.searchData.group?this.searchData.group:''}`, userId: this.$store.state.user.name, createdBy: this.$store.state.user.name, updateBy: this.$store.state.user.name, }; this.modalDisableFlag = false; this.modalFlag = true; + this.$nextTick(()=>{ + this.$refs['dialogDictDataSelect'].initOption(); + }) }, updateModal(row) { @@ -1029,6 +1098,7 @@ export default { active: row.active, group: row.group, functionType: row.functionType, + functionGroup: row.functionGroup, userId: this.$store.state.user.name, updateBy: this.$store.state.user.name, }; @@ -1080,12 +1150,18 @@ export default { }) return false } - if (this.modalData.functionType === '' && this.modalData.flag === '1') { + if (this.modalData.functionType === '') { this.$alert('选择模板类型!', '错误', { confirmButtonText: '确定' }) return false } + if (this.modalData.functionGroup === '') { + this.$alert('选择模板分组!', '错误', { + confirmButtonText: '确定' + }) + return false + } if (this.modalData.flag === '1') { propertiesModelSave(this.modalData).then(({data}) => { if (data && data.code === 0) { diff --git a/src/views/modules/sys/dict-data.vue b/src/views/modules/sys/dict-data.vue index 7a6c126..373f159 100644 --- a/src/views/modules/sys/dict-data.vue +++ b/src/views/modules/sys/dict-data.vue @@ -286,7 +286,7 @@ export default { - + diff --git a/src/views/modules/sys/dict.vue b/src/views/modules/sys/dict.vue index 0662987..2137559 100644 --- a/src/views/modules/sys/dict.vue +++ b/src/views/modules/sys/dict.vue @@ -2,17 +2,20 @@ import {saveDictType,selectDictTypePage,delDictType,delBatchDictType,updateDictType} from "../../../api/dict"; import DictData from "./dict-data.vue"; import DictDataSelect from "./dict-data-select.vue"; +import {searchMenuAllListId} from "../../../api/base/properties"; export default { name: "dict", components: {DictDataSelect, DictData}, data(){ return{ + menuList:[], // 查询对象 searchData:{ site:this.$store.state.user.site, dictName:undefined, dictType:undefined, status:undefined, + menuId:undefined, }, // 分页条件 no:1, @@ -29,6 +32,7 @@ export default { updateBy:this.$store.state.user.name, updateDate:undefined, remark:undefined, + menuId:undefined, site:this.$store.state.user.site, }, // @@ -36,6 +40,7 @@ export default { {label:'字典名称',value:'dictName'}, {label:'字典类型',value:'dictType'}, {label:'状态',value:'status'}, + {label:'应用菜单',value:'menuId'}, ], // 字典类型集合 dictTypeList:[], @@ -48,6 +53,7 @@ export default { dictName:[{required:true,message:' ',tagger:['blur','change']}], dictType:[{required:true,message:' ',tagger:['blur','change']}], status:[{required:true,message:' ',tagger:['blur','change']}], + menuId:[{required:true,message:' ',tagger:['blur','change']}], }, // 选择的表格列 selectionDictTypeList:[], @@ -203,9 +209,27 @@ export default { } } }, + searchMenuList() { + let params = { + site: this.$store.state.user.site + } + searchMenuAllListId(params).then(({data}) => { + if (data && data.code === 0) { + this.menuList = data.rows; + if (this.menuList.length > 0) { + this.searchData.menuId = this.menuList[0].menuId + } + this.initDictTypeData(); + } else { + this.$message.warning(data.msg) + } + }).catch((error) => { + this.$message.error(error) + }) + }, }, created() { - this.initDictTypeData(); + this.searchMenuList(); } } @@ -213,7 +237,7 @@ export default {