Merge remote-tracking branch 'origin/master'
| | |
| | | if (Object.keys(this.paramVOS).length > 0) { |
| | | for (let j in this.paramVOS) { |
| | | if (this.paramVOS[j] && this.paramVOS[j].constructor === Object) continue; |
| | | if (['type', 'context', 'content', "getdataurl", "getdatamethod", "url", "method", "uploadfileurl", "title", 'querytemplate', 'querytype', 'usesourcedata'].includes(j)) continue; |
| | | if (['type', 'context', 'content', "getdataurl", "getdatamethod", "url", "method", "uploadfileurl", "title", 'querytemplate', 'querytype', 'usesourcedata','component'].includes(j)) continue; |
| | | sourceDataMap['sourceData["' + j + '"]'] = this.paramVOS[j] |
| | | } |
| | | } |
| | |
| | | if (Object.keys(this.paramVOS).length>0) { |
| | | for (let j in this.paramVOS) { |
| | | if (this.paramVOS[j] && this.paramVOS[j].constructor === Object) continue; |
| | | if (['type', 'context', 'content', "getdataurl", "getdatamethod", "url", "method", "uploadfileurl", "title", 'querytemplate', 'querytype', 'usesourcedata'].includes(j)) continue; |
| | | if (['type', 'context', 'content', "getdataurl", "getdatamethod", "url", "method", "uploadfileurl", "title", 'querytemplate', 'querytype', 'usesourcedata','component'].includes(j)) continue; |
| | | sourceDataMap['sourceData["' + j + '"]'] = this.paramVOS[j] |
| | | } |
| | | } |
| | |
| | | if (Object.keys(this.paramVOS).length > 0) { |
| | | for (let j in this.paramVOS) { |
| | | if (this.paramVOS[j] && this.paramVOS[j].constructor === Object) continue; |
| | | if (['type', 'context', 'content', "getdataurl", "getdatamethod", "url", "method", "uploadfileurl", "title", 'querytemplate', 'querytype', 'usesourcedata'].includes(j)) continue; |
| | | if (['type', 'context', 'content', "getdataurl", "getdatamethod", "url", "method", "uploadfileurl", "title", 'querytemplate', 'querytype', 'usesourcedata','component'].includes(j)) continue; |
| | | sourceDataMap['sourceData["' + j + '"]'] = this.paramVOS[j] |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | getTree(parentOid, parentBtmName, params,url).then(res => { |
| | | resolve(res.data.treeData ) |
| | | resolve(res.data.treeData || res.data.obj || []) |
| | | this.$nextTick(()=>{ |
| | | if (this.isRefresh) { |
| | | this.$refs.tree.setCurrentKey(this.currentClickNode.data.oid); |
| | |
| | | meta: meta, |
| | | redirect: (() => { |
| | | // ç¬¬ä¸æ¬¡è¿æ¥ä½æ¯æ²¡æåè·¯ç±ç éè¦æ·»å redirect |
| | | if (!isChild && first && !isURL(path)) return `${path}/index` |
| | | if (!isChild && first && !isURL(path)) return `/${code}/index` |
| | | else return ''; |
| | | })(), |
| | | // æ´çåè·¯ç±çroute é
ç½® |
| | |
| | | |
| | | <!-- 导å
¥ --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导å
¥" |
| | | @updata="getTreeList"></upload-file> |
| | | @updata="getList"></upload-file> |
| | | |
| | | <!-- æ¥ç使ç¨èå´ --> |
| | | <el-dialog |
| | |
| | | </avue-crud> |
| | | </el-dialog> |
| | | </basic-container> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | // 左侧æ è¯·æ± |
| | | getTreeList() { |
| | | getList() { |
| | | gridStatus(this.page.currentPage, this.page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | | this.data = data; |
| | |
| | | |
| | | // è¡¨æ ¼å·æ° |
| | | handleRefresh() { |
| | | this.getTreeList(); |
| | | this.getList(); |
| | | }, |
| | | |
| | | // è¡¨æ ¼å¤é |
| | |
| | | // æ¡æ° |
| | | sizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.getTreeList(); |
| | | this.getList(); |
| | | }, |
| | | |
| | | // 页ç |
| | | currentChange(val) { |
| | | this.page.currentPage = val; |
| | | this.getTreeList(); |
| | | this.getList(); |
| | | }, |
| | | |
| | | // è¡åé |
| | |
| | | deleteStatus(this.selectList).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.getList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | deleteStatus(list).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.getList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.loading = true; |
| | | this.getTreeList(); |
| | | this.getList(); |
| | | this.visible = false; |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | |
| | | queryTemplate:{} |
| | | }, |
| | | //å·²ææåºå表é
ç½® |
| | | crudOption: { |
| | | crudOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 150px);overflow: auto"> |
| | | <avue-tree :key="refresh" node-key="id" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" node-key="id" |
| | | @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <i :class="data.icon"></i> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <div v-if="(form.childType || form.childType === 0) && !addStatus && !editStatus && form.category !== 1" class="btnBox"> |
| | | <el-button :disabled="(mangeShowBtn || form.childType === 0) ? false : !childTypeBtn" icon="el-icon-plus" plain |
| | | <div v-if="(form.childType || form.childType === 0) && !addStatus && !editStatus && form.category !== 1" |
| | | class="btnBox"> |
| | | <el-button :disabled="(mangeShowBtn || form.childType === 0) ? false : !childTypeBtn" icon="el-icon-plus" |
| | | plain |
| | | size="small" |
| | | type="primary" @click="addClickHandler">å¢å |
| | | </el-button> |
| | |
| | | <el-button v-if="editStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="editSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button icon="el-icon-close" plain size="small" |
| | | type="danger" @click="addStatus=false;editStatus=false;">åæ¶ |
| | | <el-button icon="el-icon-close" plain size="small" |
| | | type="danger" @click="addStatus=false;editStatus=false;">åæ¶ |
| | | </el-button> |
| | | </div> |
| | | <div v-if="form.category === 1" class="btnBox"> |
| | |
| | | addBtn: false, |
| | | menu: false, |
| | | height: 500, |
| | | header:false, |
| | | header: false, |
| | | column: [ |
| | | { |
| | | label: 'æä½åç±»', |
| | |
| | | addStatus: false, |
| | | editStatus: false, |
| | | nodeRow: {}, |
| | | currentClickNode:null, |
| | | currentClickNode: null, |
| | | form: {}, |
| | | treeData: [], |
| | | treeOption: { |
| | |
| | | id: item.id, |
| | | name: item.name, |
| | | leaf: !item.hasChildren, |
| | | icon: item.source || 'iconfont iconicon_work' |
| | | icon: item.source || 'el-icon-s-home' |
| | | } |
| | | })) |
| | | }) |
| | |
| | | }, |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | | nodeClick(row,node) { |
| | | nodeClick(row, node) { |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.currentClickNode=node; |
| | | this.currentClickNode = node; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | |
| | | this.defalutName.forEach(key => { |
| | | this.form[key] = null; |
| | | }) |
| | | this.form.isValid = false; |
| | | this.form.isValid = true; |
| | | this.addStatus = true; |
| | | this.editStatus = false; |
| | | }, |
| | |
| | | addMethodsClickHandler() { |
| | | this.methodsLoading = true; |
| | | getSysModelTreeMenuByPID({parentId: 'operateNode'}).then(res => { |
| | | if (res.data.code === 200 && res.data.data.length>0) { |
| | | if (res.data.code === 200 && res.data.data.length > 0) { |
| | | this.methodsVisble = true; |
| | | const data = res.data.data; |
| | | this.methodsData = data; |
| | | this.methodsLoading = false; |
| | | }else { |
| | | } else { |
| | | this.$message.error('æªæ¾å°å¯å¢å çæä½ç±»å'); |
| | | } |
| | | }) |
| | |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | |
| | | handleRefreshTree(type) { |
| | | //type:add\edit\del |
| | | if(type=="del"){ |
| | | if (type == "del") { |
| | | this.$refs.tree.remove(this.currentClickNode); |
| | | this.currentClickNode=null; |
| | | this.form={}; |
| | | }else{ |
| | | this.currentClickNode = null; |
| | | this.form = {}; |
| | | } else { |
| | | if (this.currentClickNode) { |
| | | let node = this.currentClickNode.parent; |
| | | node.loaded = false; |
| | | node.expand(); |
| | | this.$refs.tree.setCurrentNode(this.currentClickNode); |
| | | }else { |
| | | } else { |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | } |
| | |
| | | |
| | | .btnBox { |
| | | display: flex; |
| | | justify-content:left; |
| | | justify-content: left; |
| | | margin-bottom: 15px; |
| | | } |
| | | </style> |
| | |
| | | id: item.id, |
| | | name: item.name, |
| | | leaf: !item.hasChildren, |
| | | icon: item.source || 'iconfont iconicon_work' |
| | | icon: item.source || 'el-icon-s-home' |
| | | } |
| | | })) |
| | | }) |
| | |
| | | upLoadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | |
| | | handleRefreshTree(type) { |
| | | //type:add\edit\del |
| | | if (type == "del") { |
| | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div style="max-height: calc(100vh - 150px);overflow: auto"> |
| | | <avue-tree :key="refresh" node-key="id" ref="tree" :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <avue-tree :key="refresh" ref="tree" :data="treeData" :option="treeOption" node-key="id" |
| | | @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-button v-if="addStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="addSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button v-if="!addStatus && !editStatus" :disabled="nodeRow.childType === -1" icon="el-icon-edit" plain size="small" type="primary" |
| | | <el-button v-if="!addStatus && !editStatus" :disabled="nodeRow.childType === -1" icon="el-icon-edit" plain |
| | | size="small" type="primary" |
| | | @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button v-if="editStatus" icon="el-icon-check" plain size="small" |
| | | type="success" @click="editSaveClickHandler">ä¿å |
| | | </el-button> |
| | | <el-button v-if="addStatus || editStatus" icon="el-icon-close" plain size="small" |
| | | type="danger" @click="addStatus=false;editStatus=false;">åæ¶ |
| | | <el-button v-if="addStatus || editStatus" icon="el-icon-close" plain size="small" |
| | | type="danger" @click="addStatus=false;editStatus=false;">åæ¶ |
| | | </el-button> |
| | | <el-button v-if="!addStatus && !editStatus" :disabled="nodeRow.childType === -1" icon="el-icon-close" plain size="small" type="danger" |
| | | <el-button v-if="!addStatus && !editStatus" :disabled="nodeRow.childType === -1" icon="el-icon-close" plain |
| | | size="small" type="danger" |
| | | @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | <el-button v-if="!addStatus && !editStatus" icon="el-icon-upload2" plain size="small" type="primary" @click="sqlClickExportClick">导åºsql |
| | | <el-button v-if="!addStatus && !editStatus" icon="el-icon-upload2" plain size="small" type="primary" |
| | | @click="sqlClickExportClick">导åºsql |
| | | </el-button> |
| | | </div> |
| | | <el-form ref="form" :model="form" label-width="85px" style="max-height: calc(100vh - 180px);overflow: auto;"> |
| | |
| | | <el-input v-model="form.alias" :disabled="!editStatus && !addStatus" placeholder="请è¾å
¥å«å"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="顺åºï¼"> |
| | | <el-input-number v-model="form.sort" :disabled="!editStatus && !addStatus" :min="0" :max="9999" label="顺åº"></el-input-number> |
| | | <el-input-number v-model="form.sort" :disabled="!editStatus && !addStatus" :max="9999" :min="0" |
| | | label="顺åº"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°ï¼"> |
| | | <el-input v-model="form.remark" :disabled="!editStatus && !addStatus" placeholder="请è¾å
¥æè¿°"></el-input> |
| | |
| | | <script> |
| | | //管çåè½æ¨¡å |
| | | import {exportFunctionSql, getSysModelTreeMenuByPID} from "@/api/systemModel/mangeModel/api" |
| | | import {addOperationType,updateOperationType,delOperationType} from "@/api/systemModel/operateType/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, |
| | | refresh: Math.random(), |
| | | editStatus: false, |
| | | addStatus: false, |
| | | nodeRow: {}, |
| | | currentClickNode:null, |
| | | currentClickNode: {}, |
| | | form: {}, |
| | | treeData: [], |
| | | treeOption: { |
| | |
| | | }, |
| | | created() { |
| | | }, |
| | | computed: { |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | // æ è¡ç¹å» |
| | | nodeClick(row,node) { |
| | | console.log(row); |
| | | nodeClick(row, node) { |
| | | this.form = {...row}; |
| | | this.nodeRow = {...row}; |
| | | this.currentClickNode=node; |
| | | this.currentClickNode = node; |
| | | this.addStatus = false; |
| | | this.editStatus = false; |
| | | }, |
| | |
| | | } |
| | | this.form.parentId = this.nodeRow.id; |
| | | const params = { |
| | | name:this.form.name, |
| | | identify:this.form.code, |
| | | alias:this.form.alias, |
| | | desc:this.form.remark, |
| | | seq:this.form.sort |
| | | 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){ |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.handleRefreshTree('add') |
| | | this.handleRefreshTree('add'); |
| | | this.addStatus = false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler(){ |
| | | editClickHandler() { |
| | | this.addStatus = false; |
| | | this.editStatus = true; |
| | | }, |
| | | |
| | | // ä¿®æ¹ä¿å |
| | | editSaveClickHandler(){ |
| | | editSaveClickHandler() { |
| | | console.log(this.form); |
| | | if (!this.form.name) { |
| | | this.$message.error('åç§°ä¸è½ä¸ºç©º'); |
| | |
| | | this.$message.error('å«åä¸è½ä¸ºç©º'); |
| | | return |
| | | } |
| | | if (!this.form.sort) { |
| | | if (this.form.sort == null || this.form.sort === '' || this.form.sort === undefined) { |
| | | this.$message.error('顺åºä¸è½ä¸ºç©º'); |
| | | return |
| | | return; |
| | | } |
| | | if (this.form.name.length > 128) { |
| | | this.$message.error('åç§°é¿åº¦ä¸è½è¶
è¿128ï¼'); |
| | |
| | | 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 |
| | | 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){ |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.handleRefreshTree('edit') |
| | | this.handleRefreshTree('edit'); |
| | | this.editStatus = false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å é¤ |
| | | delClickHandler(){ |
| | | delClickHandler() { |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | |
| | | }, |
| | | handleRefreshTree(type) { |
| | | //type:add\edit\del |
| | | if(type=="del"){ |
| | | if (type == "del") { |
| | | this.$refs.tree.remove(this.currentClickNode); |
| | | this.currentClickNode=null; |
| | | this.form={}; |
| | | }else{ |
| | | this.currentClickNode = null; |
| | | this.form = {}; |
| | | } else { |
| | | if (this.currentClickNode) { |
| | | let node = this.currentClickNode.parent; |
| | | node.loaded = false; |
| | | node.expand(); |
| | | this.$refs.tree.setCurrentNode(this.currentClickNode); |
| | | }else { |
| | | if (type === 'edit') { |
| | | this.$refs.tree.setCurrentKey(null); |
| | | } else { |
| | | this.$refs.tree.setCurrentNode(this.nodeRow); |
| | | } |
| | | } else { |
| | | this.refresh = Math.random(); // å·æ°å·¦ä¾§æ |
| | | } |
| | | } |
| | |
| | | |
| | | .btnBox { |
| | | display: flex; |
| | | justify-content:left; |
| | | justify-content: left; |
| | | margin-bottom: 15px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud |
| | | ref="useCrud" |
| | | :data="data" |
| | | :option="option" |
| | | :page.sync="page" |
| | | :table-loading="loading" |
| | | @selection-change="selectChange" |
| | | @row-click="rowClickHandler" |
| | | @refresh-change="handleRefresh" |
| | | @size-change="sizeChange" |
| | | @current-change="currentChange" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å建 |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot="menu" slot-scope="{row,index}"> |
| | | <el-button icon="el-icon-edit" plain size="small" type="text" @click="editClickHandler(row)">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="text" @click="delRowClickHandler(row)">å é¤ |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | |
| | | <!-- æ°å¢ ä¿®æ¹ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :title="dialogTitle === 'add' ? 'å建' : 'ä¿®æ¹'" |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | width="500px" |
| | | @close="visibleCloseHandler" |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px" size="small"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="åç§°ï¼" prop="id"> |
| | | <el-input v-model="form.id"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ ç¾ï¼" prop="name"> |
| | | <el-input v-model="form.name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="徿 ï¼" prop="icon"> |
| | | <avue-input-icon v-model="form.icon" :icon-list="iconList" placeholder="è¯·éæ©å¾æ "> |
| | | </avue-input-icon> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æè¿°ï¼" prop="description"> |
| | | <el-input v-model="form.description" :rows="2" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="addSaveHandler">ç¡® å®</el-button> |
| | | <el-button @click="visibleCloseHandler">å æ¶</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import iconList from "@/config/iconList"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {addSave, deleteStatus, editSave, gridStatus} from "@/api/modeling/statusPool/api"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | | name: "homeConfig", |
| | | data() { |
| | | return { |
| | | iconList: iconList, |
| | | loading: false, |
| | | data: [], |
| | | option: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | calcHeight: -60, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '徿 ', |
| | | prop: 'icon' |
| | | }, |
| | | { |
| | | label: 'æ ç¾', |
| | | prop: 'name', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | prop: 'description', |
| | | }, |
| | | ] |
| | | }, |
| | | dialogTitle: '', |
| | | form: { |
| | | id: "", |
| | | name: "", |
| | | description: "" |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | {required: true, message: '请è¾å
¥åç§°', trigger: 'blur'}, |
| | | ] |
| | | }, |
| | | visible: false, |
| | | selectList: [], |
| | | lastIndex: null, |
| | | page: { |
| | | currentPage: 1, |
| | | pageSize: 15, |
| | | total: 0, |
| | | pageSizes: [15, 30, 50, 100], |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | getList() { |
| | | gridStatus(this.page.currentPage, this.page.pageSize).then(res => { |
| | | const data = res.data.data; |
| | | this.data = data; |
| | | this.page.total = res.data.total; |
| | | this.loading = false; |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }); |
| | | }, |
| | | |
| | | // è¡¨æ ¼å·æ° |
| | | handleRefresh() { |
| | | this.getList(); |
| | | }, |
| | | |
| | | // è¡¨æ ¼å¤é |
| | | selectChange(row) { |
| | | this.selectList = row; |
| | | }, |
| | | |
| | | // æ¡æ° |
| | | sizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.getList(); |
| | | }, |
| | | |
| | | // 页ç |
| | | currentChange(val) { |
| | | this.page.currentPage = val; |
| | | this.getList(); |
| | | }, |
| | | |
| | | // è¡åé |
| | | rowClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.useCrud, |
| | | this.lastIndex, |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = []; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // å建æé® |
| | | addClickHandler() { |
| | | this.visible = true; |
| | | this.dialogTitle = 'add'; |
| | | }, |
| | | |
| | | // ç¼è¾æé® |
| | | editClickHandler(row) { |
| | | this.visible = true; |
| | | this.dialogTitle = 'edit'; |
| | | this.form = {...row}; |
| | | }, |
| | | |
| | | // å é¤ |
| | | delClickHandler() { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.loading = true; |
| | | deleteStatus(this.selectList).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // è¡å个å é¤ |
| | | delRowClickHandler(row) { |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const list = [row]; |
| | | this.loading = true; |
| | | deleteStatus(list).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // å
³éå¯¹è¯æ¡ |
| | | visibleCloseHandler() { |
| | | const form = { |
| | | id: "", |
| | | name: "", |
| | | imagePath: "", |
| | | description: "" |
| | | } |
| | | this.form = form; |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | |
| | | // å建æç¼è¾ä¿å |
| | | addSaveHandler() { |
| | | const saveFunction = this.dialogTitle === 'add' ? addSave : editSave; |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.loading = true; |
| | | this.getList(); |
| | | this.visible = false; |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .el-scrollbar__wrap { |
| | | overflow: auto !important; |
| | | } |
| | | |
| | | } |
| | | </style> |