| | |
| | | <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"> |
| | |
| | | </el-aside> |
| | | <el-main> |
| | | <basic-container> |
| | | |
| | | <avue-crud |
| | | ref="crud" |
| | | :data="configData" |
| | |
| | | :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"> |
| | |
| | | getAppConfigDetailsByID, |
| | | addAppConf, |
| | | updateAppConf, |
| | | delAppConf, |
| | | exportSysConf |
| | | } from "@/api/systemModel/systemConfig/api" |
| | | import basicOption from "@/util/basic-option"; |
| | |
| | | editStatus: false, |
| | | form: { |
| | | name: "", |
| | | key:"", |
| | | value:"", |
| | | desc: "" |
| | | }, |
| | | rules: { |
| | | name: [ |
| | | {required: true, message: '请输入名称', trigger: 'blur'} |
| | | ], |
| | | key: [{required: true, message: '请输入key', trigger: 'blur'}], |
| | | value: [{required: true, message: '请输入值', trigger: 'blur'}] |
| | | }, |
| | | addVisible: false, |
| | | nodeRow: {}, |
| | |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'value', |
| | | label: '值', |
| | | prop: 'value', |
| | | overHidden: true, |
| | | sortable: true |
| | |
| | | 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; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }); |
| | | }, |
| | | |
| | | // 编辑按钮 |
| | |
| | | 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') { |
| | |
| | | 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') { |