完善业务类型创建索引&&完善系统配置模块(管理功能模块、业务功能模块、操作类型管理、系统配置、系统运行监控)
| | |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ç´¢å¼ |
| | | export function delIndex(params) { |
| | | return request({ |
| | | url: "/api/btmTypeController/delIndex", |
| | | method: "delete", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // åå»ºç´¢å¼ |
| | | export function addIndex(params) { |
| | | return request({ |
| | | url: "/api/btmTypeController/addIndex", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | |
| | | // å¢å æä½ç±»å |
| | | export function addOperationType(data) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addOperationType", |
| | | url: "/api/hmSysModConfigController/addFuncOperationType", |
| | | method: "post", |
| | | data |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export const exportModule = (params) => { |
| | | return request({ |
| | | url: '/api/hmSysModConfigController/exportModule', |
| | | method: 'get', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹å«å |
| | | export function updateAlias(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateAlias", |
| | | method: "put", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | export function delFuncOperation(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/delFuncOperation", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // æ°å¢ |
| | | export function addOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addOperationType", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateOperationType", |
| | | method: "put", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ |
| | | export function delOperationType(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/delOperationType", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // å表æ¥è¯¢ |
| | | export function getAppConfigCategoryInfo(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/getAppConfigCategoryInfo", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // é
置项æ¥è¯¢ |
| | | export function getAppConfigDetailsByID(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/getAppConfigDetailsByID", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å¢å é
ç½® |
| | | export function addAppConf(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/addAppConf", |
| | | method: "post", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹é
ç½® |
| | | export function updateAppConf(params) { |
| | | return request({ |
| | | url: "/api/hmSysModConfigController/updateAppConf", |
| | | method: "put", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export function exportSysConf(params) { |
| | | return request({ |
| | | url: '/api/hmSysModConfigController/exportSysConf', |
| | | method: 'post', |
| | | headers: {'Content-Type': 'application/json;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | style="text-align: center" |
| | | width="50%" |
| | | @close="dialogClose"> |
| | | <div style="margin-bottom: 20px;" v-if="topMethodsObj !== {} && topMethodsObj"> |
| | | <div> |
| | | <span>å¯¼åºæ¹å¼ï¼</span> |
| | | <el-radio-group v-model="radio"> |
| | | <el-radio :label="0" v-if="topMethodsObj.select">éæ©</el-radio> |
| | | <el-radio :label="1" v-if="topMethodsObj.all">å
¨é¨</el-radio> |
| | | <el-radio :label="2" v-if="topMethodsObj.page">页ç </el-radio> |
| | | </el-radio-group> |
| | | <span v-if="radio === 2" style="margin-left: 20px;color: #F56C6C; "> |
| | | <el-input v-model="pageExport" style="width: 150px"></el-input> ï¼è¾å
¥é¡µç æè
页é¢èå´ï¼å¦ï¼1-10ï¼</span> |
| | | </div> |
| | | </div> |
| | | <el-transfer |
| | | v-model="rightRoleData" |
| | | v-loading="loading" |
| | |
| | | style="text-align: left; display: inline-block;"> |
| | | </el-transfer> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <div class="valueInfo" v-if="bottomValue">已设置çå¼ä¸ºï¼[{{bottomValue}}]</div> |
| | | <el-button @click="visible = false" size="small">å æ¶</el-button> |
| | | <el-button type="primary" @click="sendHandler" size="small">ç¡® å®</el-button> |
| | | <div v-if="bottomValue" class="valueInfo">已设置çå¼ä¸ºï¼[{{ bottomValue }}]</div> |
| | | <el-button size="small" @click="visible = false">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="sendHandler">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "transfer", |
| | | props: ['title', 'leftRoleData', 'rightRoleData', 'transferTitle' , 'bottomValue'], |
| | | props: ['title', 'leftRoleData', 'rightRoleData', 'transferTitle', 'bottomValue', 'topMethodsObj', 'selectList'], |
| | | /** |
| | | * topMethodsObj:{ |
| | | select:true, |
| | | all:true, |
| | | page:false |
| | | }, |
| | | æ§å¶é¡¶å±éæ©é¡¹æ¯å¦å±ç¤ºï¼éè¦é
åselectListä½¿ç¨ |
| | | * @returns {object} |
| | | */ |
| | | data() { |
| | | return { |
| | | radio: 0, |
| | | pageExport: "", |
| | | visible: false, // éè¿ this.$refs.transfer.visible = true; å¼å¯åç»ä»¶å¯¹è¯æ¡ |
| | | data: [], |
| | | loading: false, |
| | |
| | | this.leftRoleData = []; |
| | | }, |
| | | sendHandler() { |
| | | this.$emit('transferSend', this.rightRoleData); |
| | | if (func.isEmptyObject(this.topMethodsObj)) { |
| | | this.$emit('transferSend', this.rightRoleData); |
| | | } else { |
| | | if (this.radio === 0) { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.warning('è¯·éæ©è¦å¯¼åºç模æ¿') |
| | | return |
| | | } |
| | | this.$emit('transferSend', this.rightRoleData, 0); |
| | | } else if (this.radio === 1) { |
| | | this.$emit('transferSend', this.rightRoleData, 1); |
| | | } |
| | | } |
| | | |
| | | this.visible = false; |
| | | }, |
| | | } |
| | |
| | | /deep/ .el-transfer-panel__list.is-filterable { |
| | | height: 323px; /* ç©¿æ¢æ¡å表é«åº¦ */ |
| | | } |
| | | .valueInfo{ |
| | | |
| | | .valueInfo { |
| | | float: left; |
| | | border: 1px solid #E9E7E7; |
| | | display: inline-block; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <p>transferSelect</p> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "transferSelect" |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | </ul> |
| | | <Divider left="30px" text="éæ©æä»¶åä¼èªå¨ä¸ä¼ "></Divider> |
| | | <el-upload |
| | | :name="fileName" |
| | | :action="fileUrl" |
| | | :before-upload="beforeUpload" |
| | | :data="fileData" |
| | |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | fileName: { |
| | | type: String, |
| | | default: () => "file" |
| | | }, |
| | | // å¯¹è¯æ¡å¤´é¨åç§° |
| | | title: { |
| | | type: String, |
| | |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- ä¸è´æ§æ£æ¥ --> |
| | | <!-- æ¥çç´¢å¼ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="indexVisible" |
| | |
| | | class="avue-dialog" |
| | | title="ç´¢å¼ä¿¡æ¯" |
| | | width="60%" |
| | | @close="indexDialogClose" |
| | | > |
| | | |
| | | <div v-loading="indexLoading" style="display: flex;height: 500px;width: 100%"> |
| | | <basic-container> |
| | | <div style="height: 390px"> |
| | | <el-button plain size="mini" style="margin-bottom: 5px" type="danger" |
| | | @click="deleteIndexLeftTreeClickHandler">å é¤ç´¢å¼ |
| | | </el-button> |
| | | <avue-tree |
| | | :data="indexLeftData" |
| | | :option="indexLeftOption" |
| | | @node-click="indexLeftNodeClick"></avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | <div style="padding: 20px;width: 75%"> |
| | | <div> |
| | | <el-form ref="form" :model="indexForm" label-width="90px" size="mini"> |
| | | <el-form-item label="ç´¢å¼åç§°ï¼"> |
| | | <el-input v-model="indexForm.name" :readOnly="indexFormRead"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="indexForm.desc"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="display: flex;justify-content: center"> |
| | | <el-button plain size="mini" type="success" @click="rightIndexAddClick">å¢å </el-button> |
| | | <el-button plain size="mini" type="danger">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <avue-crud |
| | | :data="indexData" |
| | | :option="indexOption"></avue-crud> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="indexAttrVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="屿§ä¿¡æ¯" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | :data="indexAttrData" |
| | | :option="indexAttrOption" |
| | | @row-click="indexAttrRowClick"></avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="indexAttrVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="indexAttrClickAddHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="indexDialogClose">å æ¶</el-button> |
| | | <el-button type="primary" @click="indexClickAddHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </el-container> |
| | |
| | | getUsedBtmLinkList, |
| | | checkBtmConsistency, |
| | | executeRepair, |
| | | getIndexByCondition |
| | | getIndexByCondition, |
| | | delIndex, |
| | | getAllAttributesByBtmId, |
| | | addIndex |
| | | } from "@/api/modeling/businessType/api" |
| | | import {gridAttribute} from "@/api/modeling/attributePool/api"; |
| | | import func from "@/util/func"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | indexVisible:false, |
| | | indexLoading: false, |
| | | indexFormRead: false, |
| | | indexAttrRow: {}, |
| | | indexAttrOption: { |
| | | ...basicOption, |
| | | height: 380, |
| | | highlightCurrentRow: true, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: '屿§ä¿¡æ¯', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | indexAttrData: [], |
| | | indexData: [], |
| | | indexAttrVisible: false, |
| | | indexLeftNodeRow: {}, |
| | | indexForm: { |
| | | name: '', |
| | | desc: '' |
| | | }, |
| | | indexLeftData: [], |
| | | indexLeftOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | indexOption: { |
| | | ...basicOption, |
| | | height: 280, |
| | | addBtn: false, |
| | | refreshBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: 'ä¸å¡ç±»ååç§°', |
| | | prop: 'typeName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'ç´¢å¼åç§°', |
| | | prop: 'indexName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '屿§åç§°', |
| | | prop: 'attrNames', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'desc', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | indexVisible: false, |
| | | conDefaultCheckData: [], // ä¿çä¸ä¸ªæ¥å£è¿åçæ°æ® |
| | | conCheckLoading: false, |
| | | conCheckOption: { |
| | |
| | | if (res.data.code === 200) { |
| | | this.checkViewVisible = true; |
| | | const data = res.data.data.map(item => { |
| | | return{ |
| | | name:this.nodeRow.id, |
| | | source:item |
| | | return { |
| | | name: this.nodeRow.id, |
| | | source: item |
| | | } |
| | | }); |
| | | this.checkViewData = data; |
| | |
| | | }, |
| | | |
| | | // ä¸è´æ§æ£æ¥æé®ç¹å» |
| | | checkClickHandler(){ |
| | | checkBtmConsistency().then(res =>{ |
| | | if(res && res.data && res.data.data){ |
| | | checkClickHandler() { |
| | | this.createViewLoading = true; |
| | | checkBtmConsistency().then(res => { |
| | | this.createViewLoading = false; |
| | | if (res && res.data && res.data.data) { |
| | | this.conCheckVisible = true; |
| | | this.conCheckLoading = true; |
| | | if(res.data.code === 200){ |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data[0]; |
| | | this.conDefaultCheckData = data; // ä¿çä¸ä»½åå§æ°æ® |
| | | this.conCheckLoading = false; |
| | |
| | | }) |
| | | this.conCheckData = outputData; |
| | | } |
| | | }else { |
| | | } else { |
| | | this.$message.success(res.data.msg); |
| | | } |
| | | }) |
| | |
| | | }, |
| | | |
| | | // åå»ºç´¢å¼æé®ç¹å» |
| | | indexClickHandler(){ |
| | | if(func.isEmptyObject(this.nodeRow)){ |
| | | indexClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.getLeftIndex(); |
| | | this.indexVisible = true; |
| | | }, |
| | | |
| | | // å·¦ä¾§æ æ´æ° |
| | | getLeftIndex() { |
| | | const params = { |
| | | "conditionMap[typename]":this.nodeRow.id |
| | | "conditionMap[typename]": this.nodeRow.id |
| | | } |
| | | getIndexByCondition(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | indexName: item.indexName, |
| | | name: `${item.indexName} ${item.attrNames}`, |
| | | id: item.oid |
| | | } |
| | | }) |
| | | this.indexLeftData = data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç´¢å¼å·¦ä¾§æ ç¹å» |
| | | indexLeftNodeClick(row) { |
| | | this.indexLeftNodeRow = row; |
| | | }, |
| | | |
| | | // å é¤å·¦ä¾§æ ç´¢å¼ |
| | | deleteIndexLeftTreeClickHandler() { |
| | | if (func.isEmptyObject(this.indexLeftNodeRow)) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡æ°æ®è¿è¡å é¤'); |
| | | return; |
| | | } |
| | | const params = { |
| | | btmName: this.nodeRow.id, |
| | | indexName: this.indexLeftNodeRow.indexName |
| | | }; |
| | | delIndex(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å é¤ç´¢å¼æå'); |
| | | this.getLeftIndex(); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | //å³ä¾§è¡¨æ ¼æ·»å 屿§ |
| | | indexAttrClickAddHandler() { |
| | | if (func.isEmptyObject(this.indexAttrRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.indexData.push( |
| | | { |
| | | typeName: this.nodeRow.id, |
| | | attrNames: this.indexAttrRow.id, |
| | | indexName: this.indexForm.name, |
| | | desc: this.indexForm.desc |
| | | } |
| | | ) |
| | | this.indexFormRead = true; |
| | | this.indexAttrVisible = false; |
| | | }, |
| | | |
| | | // å³ä¾§å±æ§è¡¨æ ¼è¡ç¹å» |
| | | indexAttrRowClick(row) { |
| | | this.indexAttrRow = row; |
| | | }, |
| | | |
| | | // å³ä¾§è¡¨æ ¼å¢å |
| | | rightIndexAddClick() { |
| | | if (!this.indexForm.name) { |
| | | this.$message.error('请è¾å
¥ç´¢å¼åç§°'); |
| | | return; |
| | | } |
| | | |
| | | // æ£æ¥æ¯å¦ä¸ºè±æå符 |
| | | const englishRegex = /^[A-Za-z]+$/; |
| | | if (!englishRegex.test(this.indexForm.name)) { |
| | | this.$message.error('ç´¢å¼åç§°åªè½å
å«è±æå符'); |
| | | return; |
| | | } |
| | | this.indexLoading = true; |
| | | getAllAttributesByBtmId({btmId: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data.map(item => { |
| | | return { |
| | | id: item.id |
| | | } |
| | | }) |
| | | this.indexAttrData = data; |
| | | } |
| | | this.indexLoading = false; |
| | | this.indexAttrVisible = true; |
| | | }) |
| | | }, |
| | | |
| | | // å建ä¿åç´¢å¼ |
| | | indexClickAddHandler() { |
| | | const params = { |
| | | typeName: this.nodeRow.id, |
| | | attrNames: this.indexData.map(item => item.attrNames).join(','), |
| | | indexName: this.indexForm.name, |
| | | } |
| | | addIndex([params]).then(res => { |
| | | console.log(res) |
| | | this.$message.success('å建æå'); |
| | | this.indexDialogClose(); |
| | | }).catch(err => { |
| | | this.indexDialogClose(); |
| | | }) |
| | | }, |
| | | |
| | | // ç´¢å¼å¯¹è¯æ¡åæ¶ |
| | | indexDialogClose() { |
| | | this.indexFormRead = false; |
| | | this.indexForm = {}; |
| | | this.indexData = []; |
| | | this.indexVisible = false; |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-container v-loading="createdLoading"> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.childType === 0" class="btnBox"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary">ä¿®æ¹å«å |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="updataAliasClickHandler">ä¿®æ¹å«å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger">å é¤ |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="deleteOperationClickHandler">å é¤ |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | <el-button type="primary" @click="methodsSaveClickHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!--导å
¥ --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" fileName="files" title="导å
¥" |
| | | @updata="resetFormValue"></upload-file> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | updateModel, |
| | | delModule, |
| | | exportFunctionSql, |
| | | addOperationType |
| | | addOperationType, |
| | | exportModule, |
| | | updateAlias, |
| | | delFuncOperation |
| | | } from "@/api/systemModel/mangeModel/api" |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | tipList: [], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/hmSysModConfigController/importModule', |
| | | createdLoading: false, |
| | | lastIndex: null, |
| | | methodsList: [], |
| | | methodsData: [], |
| | |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row.childType); |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | this.resetFormValue(); |
| | | // this.resetFormValue(); |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | // æ°å¢ä¿åæé® |
| | |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('模ååé¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | this.form.parentId = this.form.id; |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.addStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | console.log(this.form); |
| | | this.editStatus = true; |
| | | this.addStatus = false; |
| | | }, |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.editStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delModule(this.form).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = false; |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // ä¿®æ¹å«å |
| | | updataAliasClickHandler() { |
| | | const params = { |
| | | id: this.form.id, |
| | | isValid: this.form.isValid, |
| | | alias: this.form.alias |
| | | } |
| | | updateAlias(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | deleteOperationClickHandler() { |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const params = { |
| | | funcId: this.form.funcId, |
| | | operId: this.form.operId |
| | | } |
| | | delFuncOperation(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // å¯¼åº |
| | | exportClickHandler() { |
| | | this.createdLoading = true; |
| | | exportModule().then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.createdLoading = false |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥ |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-container v-loading="createdLoading"> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.childType === 0" class="btnBox"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary">ä¿®æ¹å«å |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="updataAliasClickHandler">ä¿®æ¹å«å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger">å é¤ |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="deleteOperationClickHandler">å é¤ |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | <el-button type="primary" @click="methodsSaveClickHandler">ä¿ å</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <!--导å
¥ --> |
| | | <upload-file ref="upload" fileName="files" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导å
¥" |
| | | @updata="resetFormValue"></upload-file> |
| | | </el-container> |
| | | </template> |
| | | |
| | |
| | | updateModel, |
| | | delModule, |
| | | exportFunctionSql, |
| | | addOperationType |
| | | addOperationType, |
| | | exportModule, |
| | | updateAlias, |
| | | delFuncOperation |
| | | } from "@/api/systemModel/mangeModel/api" |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | tipList: [], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/hmSysModConfigController/importModule', |
| | | createdLoading: false, |
| | | lastIndex: null, |
| | | methodsList: [], |
| | | methodsData: [], |
| | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | this.resetFormValue(); |
| | | // this.resetFormValue(); |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | // æ°å¢ä¿åæé® |
| | |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('模ååé¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathC && this.form.pathC.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | this.form.parentId = this.form.id; |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.addStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | console.log(this.form); |
| | | this.editStatus = true; |
| | | this.addStatus = false; |
| | | }, |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.editStatus = false; |
| | | // this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delModule(this.form).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | if (res.data.code === 200) { |
| | | this.methodsVisble = false; |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.resetFormValue(); |
| | | this.form.childType = null; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // ä¿®æ¹å«å |
| | | updataAliasClickHandler() { |
| | | const params = { |
| | | id: this.form.id, |
| | | isValid: this.form.isValid, |
| | | alias: this.form.alias |
| | | } |
| | | updateAlias(params).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å 餿¨¡åä¸å
³èçæä½ç±»å |
| | | deleteOperationClickHandler() { |
| | | console.log(this.form); |
| | | const params = { |
| | | funcId: this.form.funcId, |
| | | operId: this.form.operId |
| | | } |
| | | delFuncOperation(params).then(res => { |
| | | console.log(res); |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¯¼åº |
| | | exportClickHandler() { |
| | | this.createdLoading = true; |
| | | exportModule().then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.createdLoading = false |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥ |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);overflow: auto"> |
| | | <avue-tree ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <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"> |
| | | <i class="el-icon-s-promotion"></i> |
| | |
| | | <el-form-item label="å«åï¼"> |
| | | <el-input v-model="form.alias" placeholder="请è¾å
¥å«å"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¼å·ï¼"> |
| | | <el-input v-model="form.sort" placeholder="请è¾å
¥ç¼å·"></el-input> |
| | | <el-form-item label="顺åºï¼"> |
| | | <el-input-number v-model="form.sort" :min="0" :max="9999" label="顺åº"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" placeholder="请è¾å
¥æè¿°"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="mangeShowBtn ? false : !childTypeBtn" icon="el-icon-plus" plain |
| | | <div v-if="nodeRow.childType === 0 || nodeRow.childType === -1" class="btnBox"> |
| | | <el-button v-if="!addStatus" :disabled="nodeRow.childType === 0" icon="el-icon-plus" plain |
| | | size="small" |
| | | type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button v-if="addStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="addSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="addClickHandler">ä¿®æ¹ |
| | | <el-button v-if="!editStatus" :disabled="nodeRow.childType === -1" icon="el-icon-edit" plain size="small" type="primary" |
| | | @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button :disabled="mangeShowBtn" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="addClickHandler">å é¤ |
| | | <el-button v-if="editStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="editSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥sql |
| | | <el-button :disabled="nodeRow.childType === -1" icon="el-icon-close" plain size="small" type="danger" |
| | | @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="sqlClickExportClick">导åºsql |
| | | </el-button> |
| | | </div> |
| | | </basic-container> |
| | |
| | | |
| | | <script> |
| | | //管çåè½æ¨¡å |
| | | import {getSysModelTreeMenuByPID, addModel} from "@/api/systemModel/mangeModel/api" |
| | | import {exportFunctionSql, getSysModelTreeMenuByPID} from "@/api/systemModel/mangeModel/api" |
| | | import {addOperationType,updateOperationType,delOperationType} from "@/api/systemModel/operateType/api" |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | refresh:Math.random(), |
| | | editStatus:false, |
| | | addStatus: false, |
| | | nodeRow: {}, |
| | | form: {}, |
| | |
| | | treeLoad: (node, resolve) => { |
| | | const params = { |
| | | parentId: node.level === 0 ? "operateNode" : node.data.id, |
| | | modeType: node.level === 0 ? "firstNode" : node.data.modeType, |
| | | modeType: node.level === 0 ? 'firstNode' : "", |
| | | } |
| | | getSysModelTreeMenuByPID(params).then(res => { |
| | | resolve(res.data.data.map(item => { |
| | |
| | | created() { |
| | | }, |
| | | computed: { |
| | | /** |
| | | * childType |
| | | * 为-1 å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * ä¸ä¸º-1 éè å é¤éç³»ç»æ¨¡å å é¤ä¸å¡æ¨¡å |
| | | * 为1æ¶ ç¦ç¨æä½ç±»åã导å
¥ãå¯¼åº |
| | | * 为2æ¶ ç¦ç¨å¢å 导å
¥ å¯¼åº |
| | | * mangeShowBtn 为 true è¯´ææ¯é¡¶å±èç¹ å
¨é¨æé®å±ç¤º ç¦ç¨ä¿®æ¹ å é¤ å¢å æä½ç±»å |
| | | * @returns {Number} |
| | | */ |
| | | mangeShowBtn() { |
| | | return this.form.childType === -1; |
| | | }, |
| | | childTypeBtn() { |
| | | return this.form.childType === 1; |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | | // æ¸
空表åç»å®å¼ |
| | | resetFormValue() { |
| | | this.form = {}; |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | }, |
| | | |
| | | |
| | | // æ°å¢æé® |
| | | addClickHandler() { |
| | | for (const key in this.form) { |
| | | if (this.form.hasOwnProperty(key)) { |
| | | this.form[key] = null; |
| | | } |
| | | } |
| | | this.form = {}; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // ä¿åæé® |
| | | addSaveClickHandler() { |
| | | console.log(this.form) |
| | | if (!this.form.name) { |
| | | this.$message.error('模ååä¸è½ä¸ºç©º'); |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.code) { |
| | | this.$message.error('æ è¯ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.alias) { |
| | | this.$message.error('å«åä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.sort) { |
| | | this.$message.error('顺åºä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('模ååé¿åº¦è¶
è¿128ï¼'); |
| | | this.$message.error('åç§°é¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦è¶
è¿255ï¼'); |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceDotNet && this.form.resourceDotNet.length > 255) { |
| | | this.$message.error('.NETæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | if (this.form.alias && this.form.alias.length > 255) { |
| | | this.$message.error('å«åé¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.pathc && this.form.pathc.length > 255) { |
| | | this.$message.error('C/Sæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.resourceMobile && this.form.resourceMobile.length > 255) { |
| | | this.$message.error('Mobileæ è¯é¿åº¦ä¸è½255ï¼'); |
| | | return |
| | | } |
| | | console.log(this.nodeRow); |
| | | this.form.parentId = this.nodeRow.id; |
| | | this.form.modeType = this.nodeRow.modeType; |
| | | addModel(this.form).then(res => { |
| | | console.log(res) |
| | | this.addStatus = false; |
| | | const params = { |
| | | name:this.form.name, |
| | | identify:this.form.code, |
| | | alias:this.form.alias, |
| | | desc:this.form.remark, |
| | | seq:this.form.sort |
| | | } |
| | | addOperationType(params).then(res => { |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.addStatus = false; |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler(){ |
| | | this.addStatus = false; |
| | | this.editStatus = true; |
| | | }, |
| | | |
| | | // ä¿®æ¹ä¿å |
| | | editSaveClickHandler(){ |
| | | console.log(this.form); |
| | | if (!this.form.name) { |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.code) { |
| | | this.$message.error('æ è¯ä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.alias) { |
| | | this.$message.error('å«åä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.sort) { |
| | | this.$message.error('顺åºä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('åç§°é¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | | return |
| | | } |
| | | if (this.form.remark && this.form.remark.length > 255) { |
| | | this.$message.error('æè¿°é¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | } |
| | | if (this.form.alias && this.form.alias.length > 255) { |
| | | this.$message.error('å«åé¿åº¦ä¸è½è¶
è¿255ï¼'); |
| | | return |
| | | }; |
| | | const params = { |
| | | id:this.form.id, |
| | | name:this.form.name, |
| | | identify:this.form.code, |
| | | alias:this.form.alias, |
| | | desc:this.form.remark, |
| | | seq:this.form.sort |
| | | } |
| | | updateOperationType(params).then(res => { |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.msg); |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | this.editStatus = false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å é¤ |
| | | delClickHandler(){ |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | delOperationType(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.resetFormValue(); |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | this.nodeRow = {}; |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 导åºsql |
| | | sqlClickExportClick() { |
| | | exportFunctionSql({isFunction: false}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 170px);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"> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | | </avue-tree> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-main> |
| | | <basic-container> |
| | | |
| | | <avue-crud |
| | | ref="crud" |
| | | :data="configData" |
| | | :option="nodeRow.id === 'firstNode'? firstOption : configOption" |
| | | :table-loading="configLoading" |
| | | @selection-change="selectChange" |
| | | @row-click="rowClickHandler"> |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">å¯¼åº |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template #menu="{row,index,size}"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click.stop="rowEditHandler(row,index)">ç¼è¾ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click.stop="rowDeleteHandler(row)">å é¤</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :title="nodeRow.id === 'firstNode' ? 'é
置项åç±»' : 'é
置项'" |
| | | :visible.sync="addVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | width="50%" |
| | | @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-item> |
| | | <el-form-item v-if="nodeRow.id !== 'firstNode'" label="keyï¼"> |
| | | <el-input v-model="form.key"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="nodeRow.id !== 'firstNode'" label="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-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button size="small" @click="addVisibleClose">å æ¶</el-button> |
| | | <el-button size="small" type="primary" @click="addSaveClickHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 导åºç©¿æ¢æ¡ --> |
| | | <transfer ref="transfer" :left-role-data="leftRoleData" :right-role-data="rightRoleData" |
| | | :select-list="selectList" :top-methods-obj="topMethodsObj" :transferTitle="transferTitle" title="导åº" |
| | | @transferSend="exportSendHandler"> |
| | | </transfer> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getAppConfigCategoryInfo, |
| | | getAppConfigDetailsByID, |
| | | addAppConf, |
| | | updateAppConf, |
| | | exportSysConf |
| | | } from "@/api/systemModel/systemConfig/api" |
| | | import basicOption from "@/util/basic-option"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | topMethodsObj: { |
| | | select: true, |
| | | all: true, |
| | | page: false |
| | | }, |
| | | transferTitle: ['æªéæ©', '已鿩'], |
| | | leftRoleData: [], |
| | | rightRoleData: [], |
| | | editStatus: false, |
| | | form: { |
| | | name: "", |
| | | desc: "" |
| | | }, |
| | | addVisible: false, |
| | | nodeRow: {}, |
| | | configLoading: false, |
| | | configData: [], |
| | | configOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'name', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'key', |
| | | prop: 'key', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'value', |
| | | prop: 'value', |
| | | overHidden: true, |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | overHidden: true, |
| | | prop: 'desc', |
| | | } |
| | | ] |
| | | }, |
| | | defaultData: [], // é¡¶å±èç¹æ°å¢åèµå¼æ°ç» |
| | | firstOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'name', |
| | | sortable: true |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'desc', |
| | | } |
| | | ] |
| | | }, |
| | | refresh: Math.random(), |
| | | treeOption: { |
| | | height: 'auto', |
| | | menu: false, |
| | | addBtn: false, |
| | | defaultExpandAll: true, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | treeData: [ |
| | | { |
| | | name: 'ç³»ç»é
ç½®åç±»', |
| | | id: 'firstNode', |
| | | children: [] |
| | | } |
| | | ], |
| | | selectList: [], |
| | | lastIndex: null |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | // å·¦ä¾§æ æ¥è¯¢ |
| | | getTreeList(val) { |
| | | getAppConfigCategoryInfo().then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.treeData[0].children = data; |
| | | if (val === 'save') { |
| | | this.configData = data; |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ èç¹ç¹å» |
| | | nodeClick(row) { |
| | | console.log(row); |
| | | this.nodeRow = row; |
| | | if (row.id === 'firstNode') { |
| | | this.configData = row.children; |
| | | } else { |
| | | this.configLoading = true; |
| | | getAppConfigDetailsByID({clsId: row.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | const data = res.data.data; |
| | | this.configData = data; |
| | | this.configLoading = false; |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // å¢å æé® |
| | | addClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡èç¹è¿è¡æ·»å ï¼') |
| | | return; |
| | | } |
| | | this.addVisible = true; |
| | | this.editStatus = false; |
| | | }, |
| | | |
| | | // æ°å¢å¯¹è¯æ¡å
³é |
| | | addVisibleClose() { |
| | | Object.keys(this.form).forEach(key => { |
| | | this.form[key] = ""; |
| | | }) |
| | | this.addVisible = false; |
| | | }, |
| | | |
| | | // ä¿å |
| | | 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; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç¼è¾æé® |
| | | rowEditHandler(row) { |
| | | this.addVisible = true; |
| | | this.form = {...row}; |
| | | this.editStatus = true; |
| | | }, |
| | | |
| | | // è¡å é¤ |
| | | rowDeleteHandler(row) { |
| | | const params = { |
| | | ids: row.id, |
| | | isConfCategorys: this.nodeRow.id === 'firstNode' ? true : false |
| | | } |
| | | getAppConfigCategoryInfo(params).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å 餿å'); |
| | | 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; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // éæ©æ¡ |
| | | selectChange(row) { |
| | | this.selectList = row; |
| | | }, |
| | | |
| | | // ç¹å»è¡ |
| | | rowClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.crud, |
| | | this.lastIndex, |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = []; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // å¤éå é¤ |
| | | delClickHandler() { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | const params = { |
| | | ids: this.selectList.map(item => { |
| | | return item.id |
| | | }).join(','), |
| | | isConfCategorys: this.nodeRow.id === 'firstNode' ? true : false |
| | | } |
| | | getAppConfigCategoryInfo(params).then(res => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.$message.success('å 餿å'); |
| | | 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; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¯¼åºæé® |
| | | exportClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.leftRoleData = this.nodeRow.id === 'firstNode' ? [ |
| | | { |
| | | name: 'åç§°', |
| | | oid: 'name' |
| | | }, |
| | | { |
| | | name: 'æè¿°', |
| | | oid: 'desc' |
| | | } |
| | | ] : [ |
| | | { |
| | | name: 'åç§°', |
| | | oid: 'name' |
| | | }, |
| | | { |
| | | name: 'key', |
| | | oid: 'key' |
| | | }, |
| | | { |
| | | name: 'value', |
| | | oid: 'value' |
| | | }, |
| | | { |
| | | name: 'æè¿°', |
| | | oid: 'desc' |
| | | } |
| | | ] |
| | | this.$refs.transfer.visible = true; |
| | | }, |
| | | |
| | | // 导åºä¿å |
| | | exportSendHandler(row, index) { |
| | | console.log(row, index); |
| | | const params = { |
| | | expType: index === 0 ? 'select' : index === 1 ? 'all' : '', |
| | | expAttrNames: row, |
| | | selectDataIdentify: index === 0 ? this.selectList.map(item => { |
| | | return item.id |
| | | }) : null, |
| | | conditionMap: { |
| | | "isExpAppConfDetail": this.nodeRow.id === 'firstNode' ? false : true, |
| | | "clsId": this.nodeRow.id !== 'firstNode' ? this.nodeRow.id : null |
| | | } |
| | | } |
| | | exportSysConf(params).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <template> |
| | | |
| | | <basic-container> |
| | | <div class="container"> |
| | | <el-form ref="form" :model="form" label-width="150px"> |
| | | <el-form-item label="å½åå¨çº¿ç¨æ·äººæ°"> |
| | | <div style="display: flex;"> |
| | | <el-input v-model="form.name" :readOnly="true"></el-input> |
| | | <el-button plain style="margin-left: 10px"> å·æ°</el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | form: { |
| | | name: '0' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | .container { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | width: 500px; |
| | | height: 500px; |
| | | margin: auto; |
| | | } |
| | | </style> |