From 100079be55493c439bfef2d4792bfa0d9f429bd1 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 29 十月 2024 15:14:43 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/plt-web/plt-web-ui/src/views/system/department/option.js | 4 Source/plt-web/plt-web-ui/src/views/system/role/index.vue | 1 Source/plt-web/plt-web-ui/src/views/systemModel/systemConfig/index.vue | 130 ++++++++++----------- Source/plt-web/plt-web-ui/src/views/system/user/index.vue | 90 +------------- Source/plt-web/plt-web-ui/src/views/authority/secure/classification/index.vue | 22 ++- Source/plt-web/plt-web-ui/src/views/system/department/index.vue | 5 Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue | 10 Source/plt-web/plt-web-ui/src/api/authority/secure/classification.js | 16 ++ Source/plt-web/plt-web-ui/src/api/systemModel/systemConfig/api.js | 8 + Source/plt-web/plt-web-ui/src/views/system/user/option.js | 18 ++ Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue | 12 +- 11 files changed, 141 insertions(+), 175 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/api/authority/secure/classification.js b/Source/plt-web/plt-web-ui/src/api/authority/secure/classification.js new file mode 100644 index 0000000..df84d01 --- /dev/null +++ b/Source/plt-web/plt-web-ui/src/api/authority/secure/classification.js @@ -0,0 +1,16 @@ +import request from '@/router/axios'; + +export function getSecretGradeConfig(params) { + return request({ + url: "/api/secretGradeController/getSecretGradeConfig", + method: "get", + params + }); +} +export const saveSecretGrade = (params) => { + return request({ + url: '/api/secretGradeController/saveSecretGrade', + method: 'post', + params: params + }) +} diff --git a/Source/plt-web/plt-web-ui/src/api/systemModel/systemConfig/api.js b/Source/plt-web/plt-web-ui/src/api/systemModel/systemConfig/api.js index e96a110..3af0926 100644 --- a/Source/plt-web/plt-web-ui/src/api/systemModel/systemConfig/api.js +++ b/Source/plt-web/plt-web-ui/src/api/systemModel/systemConfig/api.js @@ -43,6 +43,14 @@ data: params }); } +// 鍒犻櫎閰嶇疆 +export function delAppConf(params) { + return request({ + url: "/api/hmSysModConfigController/delAppConf", + method: "delete", + params: params + }); +} // 瀵煎嚭 export function exportSysConf(params) { diff --git a/Source/plt-web/plt-web-ui/src/views/authority/secure/classification/index.vue b/Source/plt-web/plt-web-ui/src/views/authority/secure/classification/index.vue index d87b584..ddebd32 100644 --- a/Source/plt-web/plt-web-ui/src/views/authority/secure/classification/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/authority/secure/classification/index.vue @@ -7,7 +7,7 @@ </template> <script> -import {deleteLog, getPeroid, savePeriod} from "@/api/system/log/logBasic"; +import {getSecretGradeConfig, saveSecretGrade} from "@/api/authority/secure/classification"; export default { name: "index", @@ -36,18 +36,26 @@ } }, created() { - this.getPeroid() + this.getSecretGradeConfig() }, methods:{ - getPeroid:function (){ - getPeroid().then(res => { - //this.form=res.data.data; + getSecretGradeConfig:function (){ + getSecretGradeConfig().then(res => { + if(res.data.obj.userSecuritySwith){ + this.form.type=[0] + } + if(res.data.obj.ipSecuritySwith){ + this.form.type.push(1) + } }).catch(error => { }) }, saveHandler:function (form,done){ - debugger; - savePeriod({'type':this.form.type}).then(res => { + const params={ + userSecuritySwith:this.form.type.includes(0), + ipSecuritySwith:this.form.type.includes(1) + } + saveSecretGrade(params).then(res => { if (res.data.success) { this.$message.success('淇濆瓨鎴愬姛') } diff --git a/Source/plt-web/plt-web-ui/src/views/system/department/index.vue b/Source/plt-web/plt-web-ui/src/views/system/department/index.vue index 82e6fcc..bcc41bd 100644 --- a/Source/plt-web/plt-web-ui/src/views/system/department/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/system/department/index.vue @@ -95,6 +95,7 @@ ...basicOption, rowKey: 'oid', rowParentKey: 'parentId', + expandRowKeys:[], selection: false, addBtn: false, editBtn: false, @@ -156,6 +157,7 @@ getTableList() { refTree({queryAllLevel: true, 'extandParamsMap[showAllDepartmentNode]': true}).then(res => { this.tableData = this.departDtaFormAtter(res.data.treeData); + this.option.expandRowKeys=[res.data.treeData[0].oid]; }) }, @@ -164,6 +166,7 @@ return items.map(item => { // 杞崲褰撳墠鑺傜偣鐨勫睘鎬� const formList = { + expanded:item.expanded, oid: item.oid, id: item.attributes.id, name: item.attributes.name, @@ -207,7 +210,6 @@ done(); } }).catch(err => { - console.log(err); loading(); }) @@ -235,7 +237,6 @@ done(); } }).catch(err => { - console.log(err); loading(); }) }, diff --git a/Source/plt-web/plt-web-ui/src/views/system/department/option.js b/Source/plt-web/plt-web-ui/src/views/system/department/option.js index 2063461..f55e5b1 100644 --- a/Source/plt-web/plt-web-ui/src/views/system/department/option.js +++ b/Source/plt-web/plt-web-ui/src/views/system/department/option.js @@ -14,10 +14,12 @@ { label: '缂栧彿', prop: 'id', + width:200, }, { label: '浠e彿', - prop: 'code' + prop: 'code', + width:200 }, { label:'涓撲笟', diff --git a/Source/plt-web/plt-web-ui/src/views/system/role/index.vue b/Source/plt-web/plt-web-ui/src/views/system/role/index.vue index 53aaddb..6f9e5f6 100644 --- a/Source/plt-web/plt-web-ui/src/views/system/role/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/system/role/index.vue @@ -113,6 +113,7 @@ refreshBtn: false, addBtn: false, menu: false, + header:false, column: [ { label: '閮ㄩ棬', diff --git a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue index 2f6ccea..1f75a2b 100644 --- a/Source/plt-web/plt-web-ui/src/views/system/user/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/system/user/index.vue @@ -2,7 +2,6 @@ <basic-container> <avue-crud ref="userCrud" - :before-open="beforeOpen" :data="tableData" :option="option" :page.sync="page" @@ -18,26 +17,6 @@ @row-save="rowSaveHandler" @row-update="rowUpdateHandler" > - <!-- 閮ㄩ棬澶撮儴鎼滅储鎻掓Ы --> - <template slot-scope="{disabled,size}" slot="pkDepartmentNameSearch"> - <div style="display: flex;gap: 5px"> - <el-select v-model="departSearchValue" clearable placeholder="璇烽�夋嫨閮ㄩ棬"> - <el-option :label="departSearchObj.name" :value="departSearchObj.oid"></el-option> - </el-select> - <el-button size="small" type="success" @click="dialogDepartSearchHandler">閫夋嫨閮ㄩ棬</el-button> - </div> - </template> - - <!-- 瀵硅瘽妗嗛儴闂ㄦ彃妲� --> - <template slot="pkDepartmentNameForm" slot-scope="scope"> - <div style="display: flex;gap: 5px"> - <el-select v-model="departValue" clearable placeholder="璇烽�夋嫨閮ㄩ棬"> - <el-option :label="departObj.name" :value="departObj.oid"></el-option> - </el-select> - <el-button size="small" type="success" @click="dialogDepartHandler">閫夋嫨閮ㄩ棬</el-button> - </div> - </template> - <template slot="status" slot-scope="{row}"> <el-tag v-if="row.status === 0" type="success">鍚敤</el-tag> <el-tag v-if="row.status === 1" type="danger">鍋滅敤</el-tag> @@ -154,8 +133,6 @@ departSearchValue:'', loadKey: 0, departStatus: '', // 鍖哄垎涓嶅悓鏂瑰紡鎵撳紑閮ㄩ棬瀵硅瘽妗� - departValue: '', // 閮ㄩ棬瀵硅瘽妗嗕笅鎷夋缁戝畾鍊� - departObj: {}, // 閮ㄩ棬瀵硅瘽妗嗕笅鎷夋閫夐」缁戝畾鍊� departCurrenRow: {}, departOption: { ...basicOption, @@ -168,6 +145,7 @@ menu: false, refreshBtn: false, gridBtn: false, + header:false, column: [ { label: '鍚嶇О', @@ -221,15 +199,6 @@ created() { }, methods: { - // 鏂板鎴栦慨鏀瑰璇濇鎵撳紑鍓� - beforeOpen(done, type) { - if(type == 'add'){ - this.departObj = {}; - this.departValue = ""; - } - done(); - }, - // 琛ㄦ牸璇锋眰 getTableList() { this.tableLoading = true; @@ -239,6 +208,7 @@ this.page.total = res.data.total; this.tableLoading = false; }) + this.departmentQueryOnLoad() }, // 琛ㄦ牸鍙充晶鍒锋柊鍥炬爣 @@ -249,10 +219,6 @@ // 鎼滅储鏌ヨ handleSearch(params, done) { this.searchParams = {}; - if(this.departSearchObj && this.departSearchValue){ - this.searchParams['conditionMap["pkDepartment"]'] = this.departSearchValue; - } - if (!func.isEmptyObject(params)) { for (let key in params) { if (params.hasOwnProperty(key)) { @@ -263,7 +229,7 @@ } } - if (func.isEmptyObject(params) && !this.departSearchValue) { + if (func.isEmptyObject(params)) { this.searchParams = {}; } @@ -273,8 +239,6 @@ // 閲嶇疆鎼滅储鏉′欢 handleReset() { - this.departSearchObj = {}; - this.departSearchValue = ""; this.searchParams = {}; this.getTableList(); }, @@ -399,7 +363,6 @@ this.$message.error('璇锋鏌ヤ袱娆″瘑鐮佹槸鍚﹁緭鍏ヤ竴鑷达紒') return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false; } - row.pkDepartment = this.departValue; // 灏嗗綋鍓嶈鐨勯儴闂ㄥ弬鏁皃kDepartment 璧嬪�间负涓嬫媺妗嗙粦瀹氱殑鍊� addUser(row).then(res => { if (res.data.code === 200) { this.$message.success(res.data.obj); @@ -413,14 +376,7 @@ // 鎿嶄綔鏍忕紪杈� rowEditHandler(row, index) { - let obj = { name: row.pkDepartmentName, oid: row.pkDepartment, rowOid: row.oid }; - this.departValue = row.pkDepartment; - this.departObj = obj; - - if (this.departObj.rowOid) { - this.$refs.userCrud.rowEdit(row, index); - } - + this.$refs.userCrud.rowEdit(row, index); }, // 缂栬緫 @@ -429,7 +385,6 @@ this.$message.error('璇锋鏌ヤ袱娆″瘑鐮佹槸鍚﹁緭鍏ヤ竴鑷达紒') return this.$refs.userCrud.$refs.dialogForm.$refs.tableForm.allDisabled = false; } - row.pkDepartment = this.departValue; // 灏嗗綋鍓嶈鐨勯儴闂ㄥ弬鏁皃kDepartment 璧嬪�间负涓嬫媺妗嗙粦瀹氱殑鍊� updateUser(row).then(res => { if (res.data.code === 200) { this.$message.success(res.data.obj); @@ -497,11 +452,8 @@ // 涓嬭浇瀵煎叆妯℃澘 downloadHandler() { download().then(res => { - console.log(res); func.downloadFileByBlobHandler(res); this.$message.success('涓嬭浇鎴愬姛'); - }).catch(err => { - this.$message.error(err); }) }, @@ -517,7 +469,7 @@ return; } this.departStatus = 'default'; // 鍖哄垎涓嶅悓鏂瑰紡鎵撳紑閮ㄩ棬瀵硅瘽妗� - this.departmentQueryOnLoad(); + this.departVisible = true; }, // 鍒嗛厤閮ㄩ棬琛ㄦ牸鍒濆鍖栬姹� @@ -525,7 +477,8 @@ departmentQueryController({queryAllLevel: true}).then(res => { const data = res.data.treeData; this.departData = this.departDtaFormAtter(data); - this.departVisible = true; + this.option.column[7].dicData=[{oid:'ALLDept',name:'鎵�鏈夐儴闂�',expand:true,disabled:true,children:this.departData}] + this.option.column[7].defaultExpandedKeys=['ALLDept']; }).catch(err => { this.$message.error(err); }) @@ -562,6 +515,7 @@ return; } + //鍒嗛厤閮ㄩ棬 if (this.departStatus == 'default') { let params = { userOIds: this.selectList.map(item => item.oid).join(','), @@ -573,37 +527,9 @@ this.getTableList(); this.$message.success('鍒嗛厤鎴愬姛锛�') } - }).catch(err => { - console.log(err); }) return; } - - if (this.departStatus == 'handle') { - this.departObj = this.departCurrenRow; - this.departValue = this.departCurrenRow.oid; - this.departVisible = false; - return;; - } - - if(this.departStatus == 'search'){ - this.departSearchObj = this.departCurrenRow; - this.departSearchValue = this.departCurrenRow.oid; - this.departVisible = false; - return; - } - }, - - // 瀵硅瘽妗嗗垎閰嶉儴闂ㄦ寜閽� - dialogDepartHandler() { - this.departmentQueryOnLoad(); - this.departStatus = 'handle'; // 鍖哄垎涓嶅悓鏂瑰紡鎵撳紑閮ㄩ棬瀵硅瘽妗� - }, - - // 鎼滅储瀵硅瘽妗嗗垎閰嶉儴闂ㄦ寜閽� - dialogDepartSearchHandler(){ - this.departmentQueryOnLoad(); - this.departStatus = 'search'; // 鍖哄垎涓嶅悓鏂瑰紡鎵撳紑閮ㄩ棬瀵硅瘽妗� }, } diff --git a/Source/plt-web/plt-web-ui/src/views/system/user/option.js b/Source/plt-web/plt-web-ui/src/views/system/user/option.js index a4dbce6..890f98b 100644 --- a/Source/plt-web/plt-web-ui/src/views/system/user/option.js +++ b/Source/plt-web/plt-web-ui/src/views/system/user/option.js @@ -4,6 +4,7 @@ prop: 'id', search:true, sortable:true, + editDisabled: true, rules: [ { required: true, @@ -61,23 +62,32 @@ prop: 'status', display:false, sortable:true, + width: 80, }, { label: '瀵嗙爜绛栫暐', prop: 'pkPasswordStrategyName', sortable:true, display:false, + width: 100 }, { label: '閿佸畾鐘舵��', prop: 'lockFlag', sortable:true, display:false, + width: 100, }, { label: '鎵�灞為儴闂�', - prop: 'pkDepartmentName', + prop: 'pkDepartment', align:'center', + type:'tree', + dicData: [], + props: { + label: 'name', + value: 'oid' + }, search:true, sortable:true, overHidden: true, @@ -107,7 +117,8 @@ prop: 'email', sortable:true, overHidden: true, - row:true + row:true, + span:24 }, { label: '鎻忚堪', @@ -115,6 +126,7 @@ prop: 'description', sortable:true, overHidden: true, + span:24 }, { label: '閮ㄩ棬棰嗗', @@ -125,7 +137,7 @@ { label: '鎵�灞炲瘑绾�', prop: 'secretGradeText', - sortable:true, display:false, + width: 80 }, ]; diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue index ef5069c..b04332e 100644 --- a/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/systemModel/businessModel/index.vue @@ -139,7 +139,7 @@ append-to-body="true" class="avue-dialog" title="鎿嶄綔鍒嗙被" - width="60%" + width="500px" > <avue-crud ref="methodsCrud" @@ -148,11 +148,10 @@ :table-loading="methodsLoading" @row-click="rowMethodsClickHandler" @selection-change="selectMethodsChange"> - </avue-crud> <span slot="footer" class="dialog-footer"> - <el-button @click="methodsVisble = false">鍙� 娑�</el-button> <el-button type="primary" @click="methodsSaveClickHandler">淇� 瀛�</el-button> + <el-button @click="methodsVisble = false">鍙� 娑�</el-button> </span> </el-dialog> <!--瀵煎叆 --> @@ -193,6 +192,7 @@ addBtn: false, menu: false, height: 500, + header:false, column: [ { label: '鎿嶄綔鍒嗙被', @@ -408,10 +408,10 @@ // 澧炲姞鎿嶄綔绫诲瀷 addMethodsClickHandler() { this.methodsLoading = true; - getSysModelTreeMenuByPID({parentId: 'sysOptionNode'}).then(res => { + getSysModelTreeMenuByPID({parentId: 'operateNode'}).then(res => { if (res.data.code === 200 && res.data.data.length>0) { this.methodsVisble = true; - const data = res.data.data[0].children; + const data = res.data.data; this.methodsData = data; this.methodsLoading = false; }else { diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue index 6a8f5e5..5f7d4ac 100644 --- a/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/systemModel/mangeModel/index.vue @@ -139,7 +139,7 @@ append-to-body="true" class="avue-dialog" title="鎿嶄綔鍒嗙被" - width="60%" + width="500px" > <avue-crud ref="methodsCrud" @@ -148,11 +148,10 @@ :table-loading="methodsLoading" @row-click="rowMethodsClickHandler" @selection-change="selectMethodsChange"> - </avue-crud> <span slot="footer" class="dialog-footer"> - <el-button @click="methodsVisble = false">鍙� 娑�</el-button> <el-button type="primary" @click="methodsSaveClickHandler">淇� 瀛�</el-button> + <el-button @click="methodsVisble = false">鍙� 娑�</el-button> </span> </el-dialog> <!--瀵煎叆 --> @@ -193,6 +192,7 @@ addBtn: false, menu: false, height: 500, + header:false, column: [ { label: '鎿嶄綔鍒嗙被', @@ -411,10 +411,10 @@ // 澧炲姞鎿嶄綔绫诲瀷 addMethodsClickHandler() { this.methodsLoading = true; - getSysModelTreeMenuByPID({parentId: 'sysOptionNode'}).then(res => { + getSysModelTreeMenuByPID({parentId: 'operateNode'}).then(res => { if (res.data.code === 200 && res.data.data.length>0) { this.methodsVisble = true; - const data = res.data.data[0].children; + const data = res.data.data; this.methodsData = data; this.methodsLoading = false; }else { @@ -441,7 +441,7 @@ this.methodsVisble = false; this.$message.success(res.data.msg); this.form.childType = null; - this.refresh = Math.random(); // 鍒锋柊宸︿晶鏍� + this.handleRefreshTree('add') } }) }, diff --git a/Source/plt-web/plt-web-ui/src/views/systemModel/systemConfig/index.vue b/Source/plt-web/plt-web-ui/src/views/systemModel/systemConfig/index.vue index 3971d0f..8b2b4e9 100644 --- a/Source/plt-web/plt-web-ui/src/views/systemModel/systemConfig/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/systemModel/systemConfig/index.vue @@ -2,7 +2,7 @@ <el-container> <el-aside> <basic-container> - <div style="max-height: calc(100vh - 170px);overflow: auto"> + <div style="max-height: calc(100vh - 150px);overflow: auto"> <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> <span slot-scope="{ node, data }" class="el-tree-node__label"> <span style="font-size: 15px"> @@ -16,7 +16,6 @@ </el-aside> <el-main> <basic-container> - <avue-crud ref="crud" :data="configData" @@ -47,20 +46,20 @@ :visible.sync="addVisible" append-to-body="true" class="avue-dialog" - width="50%" + width="600px" @close="addVisibleClose"> - <el-form ref="form" :model="form" label-width="80px"> - <el-form-item label="鍚嶇О锛�"> - <el-input v-model="form.name"></el-input> + <el-form ref="form" :model="form" :rules="rules" label-width="80px" size="small"> + <el-form-item label="鍚嶇О锛�" prop="name"> + <el-input v-model="form.name" ></el-input> </el-form-item> - <el-form-item v-if="nodeRow.id !== 'firstNode'" label="key锛�"> + <el-form-item v-if="nodeRow.id !== 'firstNode'" label="key锛�" prop="key"> <el-input v-model="form.key"></el-input> </el-form-item> - <el-form-item v-if="nodeRow.id !== 'firstNode'" label="value锛�"> + <el-form-item v-if="nodeRow.id !== 'firstNode'" label="鍊硷細" prop="value"> <el-input v-model="form.value"></el-input> </el-form-item> <el-form-item label="鎻忚堪锛�"> - <el-input v-model="form.desc" type="textarea"></el-input> + <el-input v-model="form.desc" type="textarea" prop="desc"></el-input> </el-form-item> </el-form> <span slot="footer" class="dialog-footer"> @@ -83,6 +82,7 @@ getAppConfigDetailsByID, addAppConf, updateAppConf, + delAppConf, exportSysConf } from "@/api/systemModel/systemConfig/api" import basicOption from "@/util/basic-option"; @@ -103,7 +103,16 @@ editStatus: false, form: { name: "", + key:"", + value:"", desc: "" + }, + rules: { + name: [ + {required: true, message: '璇疯緭鍏ュ悕绉�', trigger: 'blur'} + ], + key: [{required: true, message: '璇疯緭鍏ey', trigger: 'blur'}], + value: [{required: true, message: '璇疯緭鍏ュ��', trigger: 'blur'}] }, addVisible: false, nodeRow: {}, @@ -127,7 +136,7 @@ sortable: true }, { - label: 'value', + label: '鍊�', prop: 'value', overHidden: true, sortable: true @@ -231,67 +240,52 @@ this.form[key] = ""; }) this.addVisible = false; + this.$refs.form.clearValidate(); }, // 淇濆瓨 addSaveClickHandler() { - if (this.nodeRow.id === 'firstNode') { - if (!this.form.name) { - this.$message.error('鍚嶇О涓嶈兘涓虹┖锛�'); - return; - } - } else { - if (!this.form.name) { - this.$message.error('鍚嶇О涓嶈兘涓虹┖锛�'); - return; - } - if (!this.form.key) { - this.$message.error('key鍊间笉鑳戒负绌猴紒'); - return; - } - if (!this.form.value) { - this.$message.error('value鍊间笉鑳戒负绌猴紒'); - return; - } - } - - const params = this.nodeRow.id === 'firstNode' ? { - appConfigDetailInfo: { - name: this.form.name, - desc: this.form.desc, - id: this.editStatus ? this.form.id : null - }, - isConfCategorys: true //true琛ㄧず缁欓《灞傛坊鍔犻厤缃」鍒嗙被 - } : { - appConfigDetailInfo: { - categoryId: this.nodeRow.id, - name: this.form.name, - desc: this.form.desc, - key: this.form.key, - value: this.form.value, - id: this.editStatus ? this.form.id : null - }, - isConfCategorys: false //true琛ㄧず缁欓《灞傛坊鍔犻厤缃」鍒嗙被 - } - const saveApi = this.editStatus ? updateAppConf : addAppConf; - saveApi(params).then(res => { - if (res.data.code === 200) { - this.$message.success(res.data.obj); - this.addVisibleClose(); - if (this.nodeRow.id === 'firstNode') { - this.getTreeList('save'); - } else { - this.configLoading = true; - getAppConfigDetailsByID({clsId: this.nodeRow.id}).then(res => { - if (res.data.code === 200) { - const data = res.data.data; - this.configData = data; - this.configLoading = false; - } - }) + this.$refs.form.validate((valid) => { + if (valid) { + const params = this.nodeRow.id === 'firstNode' ? { + appConfigDetailInfo: { + name: this.form.name, + desc: this.form.desc, + id: this.editStatus ? this.form.id : null + }, + isConfCategorys: true //true琛ㄧず缁欓《灞傛坊鍔犻厤缃」鍒嗙被 + } : { + appConfigDetailInfo: { + categoryId: this.nodeRow.id, + name: this.form.name, + desc: this.form.desc, + key: this.form.key, + value: this.form.value, + id: this.editStatus ? this.form.id : null + }, + isConfCategorys: false //true琛ㄧず缁欓《灞傛坊鍔犻厤缃」鍒嗙被 } + const saveApi = this.editStatus ? updateAppConf : addAppConf; + saveApi(params).then(res => { + if (res.data.code === 200) { + this.$message.success(res.data.obj); + this.addVisibleClose(); + if (this.nodeRow.id === 'firstNode') { + this.getTreeList('save'); + } else { + this.configLoading = true; + getAppConfigDetailsByID({clsId: this.nodeRow.id}).then(res => { + if (res.data.code === 200) { + const data = res.data.data; + this.configData = data; + this.configLoading = false; + } + }) + } + } + }) } - }) + }); }, // 缂栬緫鎸夐挳 @@ -312,8 +306,7 @@ cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - getAppConfigCategoryInfo(params).then(res => { - console.log(res) + delAppConf(params).then(res => { if (res.data.code === 200) { this.$message.success('鍒犻櫎鎴愬姛'); if (this.nodeRow.id === 'firstNode') { @@ -377,8 +370,7 @@ cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - getAppConfigCategoryInfo(params).then(res => { - console.log(res) + delAppConf(params).then(res => { if (res.data.code === 200) { this.$message.success('鍒犻櫎鎴愬姛'); if (this.nodeRow.id === 'firstNode') { -- Gitblit v1.9.3