From 1f2566489ee6e435f4d464f8b33d9d214fdf139f Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期三, 02 八月 2023 17:40:02 +0800
Subject: [PATCH] 1、解决通用查询时map字段重复问题。
---
Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue | 98 ++++++++++++++++++++++++++++++++++---------------
1 files changed, 68 insertions(+), 30 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
index 33e8bfe..61fbfc8 100644
--- a/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
+++ b/Source/UBCS-WEB/src/components/MasterCrud/VciMasterCrud.vue
@@ -31,7 +31,7 @@
:label="item.label"
:prop="item.prop" :show-overflow-tooltip="true"
:sortable="item.sortable"
- :width="item.label.length >= 4 ? '150' : item.label.length == 3 ? '120' : '90'"
+ :width="item.width"
align="center">
</el-table-column>
</el-table>
@@ -54,13 +54,13 @@
:type="edit"
:visible.sync="DataVisible"></FormTemplateDialog>
<!-- 鍙戝竷-->
- <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleFlow"></set-personnel>
+ <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleFlow" @onLoad="onLoad"></set-personnel>
<!-- 鍋滅敤-->
- <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleDeactivate"></set-personnel>
+ <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleDeactivate" @onLoad="onLoad"></set-personnel>
<!-- 鍚敤-->
- <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleEnable"></set-personnel>
+ <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleEnable" @onLoad="onLoad"></set-personnel>
<!-- 鍥炴敹-->
- <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleRecovery"></set-personnel>
+ <set-personnel :parameter="this.parameter" :title="title" :visible.sync="visibleRecovery" @onLoad="onLoad"></set-personnel>
<!-- 楂樼骇鏌ヨ-->
<advanced-query :options="this.options" :visible.sync="findvisible"
@echoContion="echoContion"></advanced-query>
@@ -95,7 +95,7 @@
</basic-container>
</template>
<script>
-import {MasterTable, TableData, FindData, addSaveCode, editSaveCode} from "@/api/GetItem";
+import {MasterTable, TableData, FindData, addSaveCode, editSaveCode,deleteCode} from "@/api/GetItem";
import {processTS,changeStatus} from "@/api/template/setPersonnel"
import {listCodeAttributeByClassId} from "@/api/integration/integration.js";
import integrationTransfer from "@/views/integration/integrationTransfer";
@@ -241,13 +241,12 @@
created() {
},
mounted() {
-
},
activated() {
- // this.doLayout();
- this.$nextTick(() => {
- this.$refs.dataTable.doLayout()
- })
+ this.doLayout()
+ },
+ updated() {
+ this.doLayout()
},
watch: {
tableHeadDataFateher: {
@@ -266,6 +265,7 @@
handler(newval, oldval) {
this.tableData = newval;
this.searchResults = newval
+ this.doLayout()
},
},
tableHeadFindData: {
@@ -344,6 +344,8 @@
if (uniqueFlag === 'CODEENABLE') return this.Enable()
//鍥炴敹
if (uniqueFlag === 'CODERECYCLE') return this.Recovery()
+ //鍒犻櫎
+ if (uniqueFlag === 'CODEDELETE') return this.enumDeleteRow()
// 鐩镐技椤规煡璇�
// if(uniqueFlag === 'CODEEDIT') return this.similarHandler()
});
@@ -382,25 +384,29 @@
showMessage = false;
} else if (showMessage) {
processTS({templateId: this.templateOid, buttonTypeKey: 'PUBLIC'}).then(res => {
- if (res.data.records != [] && res.data.code != 200) {
+ if (res.data.data.records && res.data.data.records.length!=0) {
this.userName = localStorage.getItem("username");
this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
- this.parameter.type = 'PUBLIC'
+ this.parameter.type = 'PUBLIC';
+ this.parameter.code=this.templateOid
this.title = '娴佺▼瀹℃壒'
this.visibleFlow = true;
- this.onLoad()
} else {
this.$confirm('褰撳墠鍒嗙被娌℃湁娣诲姞娴佺▼妯℃澘锛屾槸鍚︿笉鐢ㄦ祦绋嬪鎵圭洿鎺ユ墽琛�?', '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- this.userName = localStorage.getItem("username");
- this.parameter.template = this.userName + "-鍙戝竷" + "[鐗╁搧]";
- this.parameter.type = 'PUBLIC'
- this.title = '娴佺▼瀹℃壒'
- this.visibleFlow = true;
- this.onLoad()
+ const index = this.$route.query.id.indexOf('@');
+ const result = this.$route.query.id.substring(0, index);
+ console.log(this.$route.query)
+ const oid = this.selectRow.map(obj => obj.oid).join(",");
+ changeStatus({ oid: oid, btmname: result, lcStatus: 'Released' }).then(res => {
+ if(res.data.code == 200 ){
+ this.$message.success('鍙戝竷鎴愬姛')
+ this.onLoad()
+ }
+ });
}).catch(() => {
this.$message({
type: 'info',
@@ -431,10 +437,11 @@
showMessage = false;
} else if (this.selectRow.length > 1 && hasEditing && showMessage) {
processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => {
- if (res.data.records != [] && res.data.code != 200) {
+ if (res.data.records != [] && res.data.data.records.length!=0) {
this.userName = localStorage.getItem("username");
this.parameter.template = this.userName + "鍋滅敤" + "[鐗╁搧]";
- this.parameter.type = 'DISABLE'
+ this.parameter.type = 'DISABLE';
+ this.parameter.code=this.templateOid
this.title = '鍋滅敤锛堝喕缁擄級缂栫爜鏁版嵁'
this.visibleDeactivate = true;
} else {
@@ -482,10 +489,12 @@
showMessage = false;
} else if (this.selectRow.length >=1 && hasEditing && showMessage) {
processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => {
- if (res.data.records != [] && res.data.code != 200) {
+ if (res.data.data.records && res.data.data.records.length!=0) {
+ this.parameter=res.data.data.records[0]
this.userName = localStorage.getItem("username");
this.parameter.template = this.userName + "鍚敤" + "[鐗╁搧]";
- this.parameter.type = 'Released'
+ this.parameter.type = 'Released';
+ this.parameter.code=this.templateOid
this.title = '鍚敤缂栫爜鏁版嵁'
this.visibleDeactivate = true;
} else {
@@ -540,10 +549,11 @@
} else if (this.selectRow.length >=1 && (disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0) && showMessage) {
//disabledCount 鍜� releasedCount 涓换鎰忎竴涓瓑浜� this.selectRow 鏁扮粍鐨勯暱搴﹀垯琛ㄧず鍏ㄩ儴鏄悓涓�绉嶇姸鎬侊紝杩斿洖 true 濡傛灉disabledCount 鍜� releasedCount 閮藉ぇ浜�0锛屽垯琛ㄧず鏃㈡湁Disabled涔熸湁Released杩斿洖 true
processTS({ templateId: this.templateOid, buttonTypeKey: 'PUBLIC' }).then(res => {
- if (res.data.records != [] && res.data.code != 200) {
+ if (res.data.records != [] && res.data.data.records.length!=0) {
this.userName = localStorage.getItem("username");
this.parameter.template = this.userName + "鍥炴敹" + "[鐗╁搧]";
- this.parameter.type = 'TakeBack'
+ this.parameter.type = 'TakeBack';
+ this.parameter.code=this.templateOid
this.title = '鍥炴敹缂栫爜鏁版嵁'
this.visibleDeactivate = true;
} else {
@@ -572,9 +582,11 @@
}
}
});
- } else if (this.selectRow.length >=1 && !(disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0) && showMessage) {
+ } else if (showMessage && this.selectRow.length >1 && !(disabledCount === this.selectRow.length || releasedCount === this.selectRow.length) || (disabledCount > 0 && releasedCount > 0)) {
this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹叏閮ㄤ负銆愬仠鐢ㄧ姸鎬佹垨鍙戝竷鐘舵�併�戞墠鍙互鍙戣捣娴佺▼');
showMessage = false;
+ }else if(showMessage){
+ this.$message.warning('鎮ㄩ�夋嫨鐨勬暟鎹负銆愬仠鐢ㄧ姸鎬佹垨鍙戝竷鐘舵�併�戞墠鍙互鍙戣捣娴佺▼')
}
});
}
@@ -608,16 +620,41 @@
},
//鍒犻櫎
enumDeleteRow(row) {
- this.tableData.splice(row, 1);
+ this.$confirm('鏄惁鍒犻櫎閫変腑鏁版嵁?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ const list=[];
+ this.selectRow.forEach((item)=>{list.push(item.oid)})
+ deleteCode({codeClassifyOid:this.codeClassifyOid,oidList:list}).then(res=>{
+ console.log(res)
+ if(res.data.code === 200){
+ this.$message({
+ type: 'success',
+ message: '鍒犻櫎鎴愬姛!'
+ });
+ }
+ this.onLoad()
+ })
+ }).catch(() => {
+ this.$message({
+ type: 'info',
+ message: '宸插彇娑堝垹闄�'
+ });
+ });
},
// 灏嗘鍦ㄧ紪杈戠殑琛岀殑鐘舵�佸彉涓� null 锛屽嵆閫�鍑虹紪杈戠姸鎬�
saveRow() {
this.editingRow = null;
},
+ //琛ㄦ牸閿欒闂
doLayout() {
this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
+ if (this.$refs.dataTable && this.$refs.dataTable.doLayout) {
+ this.$refs.dataTable.doLayout();
+ }
+ })
},
//琛ㄦ牸澶存覆鏌�
CrudHeaderRend() {
@@ -688,6 +725,7 @@
limit: this.page.pageSize,
}).then((res) => {
this.tableData = res.data.data;
+ this.doLayout()
});
},
//澶氶��
--
Gitblit v1.10.0