| | |
| | | margin: 50px auto; |
| | | } |
| | | .avue-dialog .el-dialog{ |
| | | top:47%; |
| | | max-height: calc(100% - 100px); |
| | | top:50%; |
| | | max-height: calc(100% - 80px); |
| | | -webkit-transform: translate(-50%, 0); |
| | | transform: translate(-50%, -50%); |
| | | margin-top: 0 !important; |
| | |
| | | }); |
| | | } |
| | | |
| | | // 龿¥ç±»åæ¥è¯¢æ¨¡æ¿æåºè®¾ç½®åæ®µä¸æï¼åæ°linkType=witoannotatelink&btmType=fileobject&direction=positive |
| | | export function getAllOrderbyAttributeByLink(params) { |
| | | return request({ |
| | | url: "/api/linkTypeController/getAllOrderbyAttributeByLink", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | |
| | | import request from '@/router/axios'; |
| | | //龿¥ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | //å表 |
| | | export function getObjTypeQTs(btName) { |
| | | return request({ |
| | | url: "/api/templateController/getObjTypeQTs", |
| | | method: "get", |
| | | params:{ |
| | | btName |
| | | } |
| | | }); |
| | | } |
| | | // å建 |
| | | export function linkSave(params) { |
| | | return request({ |
| | | url: "/api/templateController/linkSave", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | // å é¤ |
| | | export function deleteLinkTemplate(params) { |
| | | return request({ |
| | | url: "/api/templateController/deleteLinkTemplate", |
| | | method: "delete", |
| | | data:params |
| | | params:params |
| | | }); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | export function getObjTypeQTs(params) { |
| | | return request({ |
| | | url: "/api/templateController/getObjTypeQTs", |
| | | method: "get", |
| | | params:{ |
| | | ...params |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateTemplate(params) { |
| | | return request({ |
| | |
| | | }, |
| | | initItem(item){ |
| | | const type=this.columnType[item.type] || item.type; |
| | | item.text=item.text || item.label; |
| | | const col= { |
| | | ...item, |
| | | label: item.text, |
| | | prop: item.field, |
| | | showProp:item.showField, |
| | |
| | | valueFormat: item.dateFormate || "yyyy-MM-dd HH:mm:ss", |
| | | format: item.dateFormate, |
| | | rules: this.isEdit?(type=="select" || type=="refer" || type=="date" || type=="datetime"?[{ |
| | | required: item.required, |
| | | required: item.required || false, |
| | | message: `è¯·éæ©${item.text}!`, |
| | | trigger: "change" |
| | | },{ |
| | | required: item.required, |
| | | required: item.required|| false, |
| | | message: `è¯·éæ©${item.text}!`, |
| | | trigger: "submit" |
| | | }]:[{ |
| | | required: item.required, |
| | | required: item.required|| false, |
| | | message: `请è¾å
¥${item.text}!`, |
| | | trigger: "blur" |
| | | },{ |
| | | required: item.required, |
| | | required: item.required|| false, |
| | | message: `请è¾å
¥${item.text}!`, |
| | | trigger: "submit" |
| | | }]):[] |
| | | }]):[], |
| | | ...item |
| | | }; |
| | | if(!this.isEdit){ |
| | | col.placeholder=col.label; |
| | |
| | | }, |
| | | clearValidate(props){ |
| | | this.$refs.form.clearValidate(props) |
| | | }, |
| | | updateDic(prop,data){ |
| | | this.$refs.form.updateDic(prop,data) |
| | | } |
| | | }, |
| | | }; |
| | |
| | | default:'70%' |
| | | }, height: { |
| | | type: String, |
| | | default:'60%' |
| | | default:(document.body.clientHeight-400)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | default:'70%' |
| | | }, height: { |
| | | type: String, |
| | | default:'60%' |
| | | default:(document.body.clientHeight-400)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | default:'70%' |
| | | }, height: { |
| | | type: String, |
| | | default:'60%' |
| | | default:(document.body.clientHeight-400)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | rConfig.options.tableConfig={ |
| | | cols:[{ |
| | | prop: 'code', |
| | | label: 'ç¨æ·å', |
| | | label: (this.$project.user.code || "è´¦å·"), |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | },{ |
| | | prop: 'name', |
| | | label: 'å§å', |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | }, { |
| | | prop: 'deptIdName', |
| | | label: 'æå±é¨é¨', |
| | | width: 260, |
| | | }, { |
| | | prop: 'sexText', |
| | | label: 'æ§å«', |
| | | width: 80 |
| | | }] |
| | | }; |
| | | rConfig.options.classifys=[{ |
| | | title:'é¨é¨', |
| | | treeUrl:'/org/deptController/referGrid', //åç±»çè·¯å¾ |
| | | queryByClassifyUrl:'/permission/userQueryController/listUserByDeptId', //'å表' |
| | | queryByClassifyUrl:'/permission/userQueryController/gridUserByDeptIdGet', //'å表' |
| | | queryField:'deptId', //åè¡¨æ°æ®ä¸åç±»çåæ®µ |
| | | classifyValueField:'id', //仿 ä¸è·åçåæ®µ |
| | | },{ |
| | | title:'è§è²', |
| | | treeUrl:'/permission/roleController/referGrid', //åç±»çè·¯å¾ |
| | | queryByClassifyUrl:'/permission/userQueryController/listUserByRoleId', //'å表' |
| | | queryByClassifyUrl:'/permission/userQueryController/gridUserInRoleIdGet', //'å表' |
| | | queryField:'roleId', //åè¡¨æ°æ®ä¸åç±»çåæ®µ |
| | | classifyValueField:'id', //仿 ä¸è·åçåæ®µ |
| | | }]; |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | refertype: this.referConfig.type, |
| | | refertype: this.referConfig.options.type, |
| | | emitData: {}, |
| | | width:this.referConfig.width || '900px', |
| | | height:this.referConfig.height || '500px' |
| | | width:this.referConfig.options.width, |
| | | height:this.referConfig.options.height |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | <div> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-dialog-resize |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :width="onlyTable?'60%': '80%'" |
| | |
| | | class="avue-dialog avue-dialog--top" |
| | | @close="dialogClose" |
| | | > |
| | | <el-container :style="{ 'height': height || '60vh' }"> |
| | | <el-aside width="300px" v-if="!onlyTable && classifys.length>0"> |
| | | <el-container :style="{ 'height': height }"> |
| | | <el-aside style="width:200px;height:100%" v-if="!onlyTable && classifys.length>0"> |
| | | <el-tabs type="border-card" style="height: 100%" @tab-click="tabClick" |
| | | v-model="tabName"> |
| | | <el-tab-pane |
| | |
| | | |
| | | <el-tree |
| | | class="filter-tree" |
| | | :style="'height: calc('+height+' - 100px);'" |
| | | :data="treeItem.treeData" |
| | | :lazy="lazy" |
| | | :load="treeLoad" |
| | |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </el-aside> |
| | | <el-main style="padding: 0 0 0 20px"> |
| | | <el-main style="padding: 0 0 0 20px;height:100%"> |
| | | <avue-crud |
| | | ref="referCrud" |
| | | v-model="formValue" |
| | |
| | | </el-container> |
| | | <div class="avue-dialog__footer"> |
| | | <div class="avue-dialog__footer--left valueInfo">{{ valueInfo }}</div> |
| | | <el-button @click="escHandler">å æ¶</el-button> |
| | | <el-button @click="clearValue">æ¸
空</el-button> |
| | | <el-button type="primary" @click="setValue">ç¡® å®</el-button> |
| | | <el-button @click="clearValue">æ¸
空</el-button> |
| | | <el-button @click="escHandler">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | |
| | |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default:'500px' |
| | | default:(document.body.clientHeight-400)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | lazy: this.referConfig.options.loadType == 'node', |
| | | loadType: { all: "all", node: "node" }, |
| | | url: this.referConfig.options.url || "referGrid", |
| | | query: {}, |
| | | query: {},//å表çæç´¢æ¡ä»¶ |
| | | where:{},//åè¡¨çæ¥è¯¢æ¡ä»¶ |
| | | loading: false, |
| | | page: { |
| | | layout: "sizes,prev,pager,next,jumper,total", |
| | | layout: "sizes,prev,pager,next,jumper,sizes,total", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data |
| | |
| | | option: { |
| | | addBtn: false, |
| | | columnBtn: false, |
| | | calcHeight: 30, |
| | | tip: false, |
| | | menu: false, |
| | | searchShow: true, |
| | |
| | | reserveSelection: true, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, |
| | | height:parseInt(this.height)-150, |
| | | rowKey: "id", |
| | | rowParentKey: "parentId", |
| | | column: [], |
| | |
| | | tabClick:function (tab){ |
| | | this.currentTreeIndex= tab.index; |
| | | this.filterText=this.classifys[tab.index].filterText; |
| | | this.option.column.forEach(item => { |
| | | if (item.hideInClassify) { |
| | | let queryField = this.classifys[this.currentTreeIndex].queryField; |
| | | let inClassifyArray = item.hideInClassify.split(","); |
| | | if (inClassifyArray.find((value => value === queryField))) { |
| | | item.hide = true; |
| | | item.showColumn = false; |
| | | } else { |
| | | item.hide = false; |
| | | item.showColumn = true; |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | handleFocus() { |
| | | if (!this.disabled) { |
| | |
| | | this.$refs.referCrud.toggleSelection(); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | this.onLoad(this.page); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | if (this.url) { |
| | | this.loading = true; |
| | | getList( |
| | | Object.assign(params, this.params, this.query), |
| | | Object.assign(params, this.params,this.where, this.query), |
| | | page.currentPage, |
| | | page.pageSize, |
| | | this.url |
| | |
| | | where[this.classifys[this.currentTreeIndex].queryField] = data.attributes[classifyValueField]; |
| | | this.url = this.classifys[this.currentTreeIndex].queryByClassifyUrl || this.options.url; |
| | | this.page.currentPage=1; |
| | | this.onLoad(this.page, where); |
| | | this.where = where; |
| | | this.onLoad(this.page,where); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style lang="scss" scoped> |
| | | .valueInfo { |
| | | float: left; |
| | | border: 1px solid #e9e7e7; |
| | |
| | | padding: 6px 15px; |
| | | line-height: 1; |
| | | } |
| | | .filter-tree{ |
| | | overflow-y: auto; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-dialogDrag |
| | | v-dialog-resize |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :width="width|| '450'" |
| | |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default:'500px' |
| | | default:(document.body.clientHeight-500)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | query: {}, |
| | | loading: false, |
| | | page: { |
| | | layout: "sizes,prev,pager,next,jumper,total", |
| | | layout: "sizes,prev,pager,next,jumper,sizes,total", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data ? this.referConfig.options.data.length : 0 |
| | |
| | | prop: 'code', |
| | | label: 'ç¼å·', |
| | | sortable: true, |
| | | width: 150, |
| | | search: true |
| | | }, { |
| | | prop: 'name', |
| | | label: 'åç§°', |
| | | sortable: true, |
| | | width: 260, |
| | | search: true |
| | | }, { |
| | | prop: 'description', |
| | |
| | | }, { |
| | | prop: 'secretShow', |
| | | label: 'å¯çº§', |
| | | width: 60, |
| | | hide: (!this.controllerSecret) |
| | | }]; |
| | | } else { |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog v-dialogDrag |
| | | v-dialog-resize |
| | | :title="title" |
| | | :visible.sync="visible" |
| | | :width="width" |
| | | :style="'height:'+height || 'auto'" |
| | | :append-to-body="true" |
| | | class="avue-dialog avue-dialog--top" |
| | | @close="dialogClose"> |
| | |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default:'500px' |
| | | default:(document.body.clientHeight-500)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
| | |
| | | }, |
| | | url: this.referConfig.options.url || 'referGrid', |
| | | method: this.referConfig.options.method || 'get', |
| | | query: {}, |
| | | query: this.referConfig.options.query || {orderBy: "createTime", orderMethod: "desc"}, |
| | | loading: false, |
| | | page: { |
| | | layout: "sizes,prev,pager,next,jumper,total", |
| | | layout: "sizes,prev,pager,next,jumper,sizes,total", |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: this.referConfig.options.data ? this.referConfig.options.data.length : 0 |
| | |
| | | default:'70%' |
| | | }, height: { |
| | | type: String, |
| | | default:'60%' |
| | | default:(document.body.clientHeight-650)+'px' |
| | | }, |
| | | reloadFormKey: { |
| | | type: String, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-dialogDrag |
| | | :title="dialog.title" |
| | | :visible.sync="dialog.showDialog" |
| | | width="1600px" |
| | | :append-to-body="true" |
| | | class="avue-dialog" |
| | | :destroy-on-close="true" |
| | | :close-on-click-modal="false" |
| | | @close="cancelDialog"> |
| | | <div style="min-height: 665px;max-height: 85vh;padding-bottom: 50px;"> |
| | | <basic-form key="linkQueryForm" style="margin-bottom: 0" |
| | | ref="form" |
| | | :span="4" |
| | | :formItems="formItems" |
| | | :formData="form" |
| | | @getFormData="getFormData"> |
| | | </basic-form> |
| | | <avue-crud ref="crud" title="设置æåº" |
| | | :data="orderInfoList" :option="crudOption"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addRow">å建</el-button> |
| | | </template> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope)">å é¤ |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog v-dialogDrag |
| | | title="å建" |
| | | :visible.sync="crudDialog.showDialog" |
| | | width="500px" |
| | | :append-to-body="true" |
| | | class="avue-dialog" |
| | | :destroy-on-close="true" |
| | | :close-on-click-modal="false" |
| | | @close="crudDialog.showDialog=false"> |
| | | <avue-form ref="tableForm" :option="tableFormOption" v-model="tableForm"></avue-form> |
| | | <div class="dialog-footer avue-dialog__footer"> |
| | | <el-button type="primary" plain size="small" @click="rowSave" >ä¿ å</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-container style="margin-top: 10px;"> |
| | | <el-aside style="width:350px"> |
| | | <fieldset> |
| | | <legend> 龿¥ç±»åå鿡件 </legend> |
| | | <div> |
| | | æ¥è¯¢æ¨¡æ¿å®ä¹ |
| | | <avue-select @change="linkQueryDefineChange" class="el-input--small" v-model="linkQueryDefineForm" placeholder="è¯·éæ©å
容" type="tree" :dic="linkQueryDefineDic" style="width:240px"></avue-select> |
| | | <avue-tree style="height: 265px" :data="linkTreeData" :option="treeOption"> |
| | | </avue-tree> |
| | | </div> |
| | | </fieldset> |
| | | </el-aside> |
| | | <el-main> |
| | | <fieldset style="margin: 0 10px"> |
| | | <legend> æ¥è¯¢æ¡ä»¶ </legend> |
| | | <div style="height: 300px;"> |
| | | |
| | | </div> |
| | | </fieldset> |
| | | </el-main> |
| | | <el-aside style="width:350px"> |
| | | <fieldset> |
| | | <legend> ä¸å¡ç±»åå鿡件 </legend> |
| | | <div> |
| | | æ¥è¯¢æ¨¡æ¿å®ä¹ |
| | | <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="è¯·éæ©å
容" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select> |
| | | <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption"> |
| | | </avue-tree> |
| | | </div> |
| | | </fieldset> |
| | | </el-aside> |
| | | </el-container> |
| | | </div> |
| | | <div class="dialog-footer avue-dialog__footer"> |
| | | <el-button type="primary" plain size="small" @click="submitDialog" >ä¿ å</el-button> |
| | | <el-button size="small" @click="cancelDialog">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api"; |
| | | import {linkSave} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {gridTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import {deleteAttributes} from "@/api/modeling/attributePool/api"; |
| | | export default { |
| | | name: "formDialog", |
| | | data(){ |
| | | return { |
| | | dialog: { |
| | | showDialog: false, |
| | | title: "å建", |
| | | submitTxt: "ä¿å", |
| | | submitIcon: "el-icon-check", |
| | | loading: false, |
| | | type: "add", |
| | | }, |
| | | crudDialog: { |
| | | showDialog: false, |
| | | submitTxt: "ä¿å", |
| | | submitIcon: "el-icon-check", |
| | | }, |
| | | formItems:[{ |
| | | label: 'æ¥è¯¢æ¨¡æ¿åç§°', |
| | | prop: 'qtName', |
| | | type: 'input', |
| | | span:5, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请è¾å
¥æ¥è¯¢æ¨¡æ¿åç§°", |
| | | trigger: "blur" |
| | | }] |
| | | },{ |
| | | label: 'æ¹å', |
| | | prop: 'direction', |
| | | type: 'radio', |
| | | value:'positive', |
| | | labelWidth:70, |
| | | span: 3, |
| | | dicData: [{ |
| | | label: 'æ£å', |
| | | value: 'positive' |
| | | }, { |
| | | label: 'åå', |
| | | value: 'opposite' |
| | | }] |
| | | },{ |
| | | label: 'ä¸å¡ç±»å', |
| | | prop: 'btmType', |
| | | type: 'select', |
| | | labelWidth:110, |
| | | dicData: [] |
| | | }, { |
| | | label: 'çæ¬çæ¬¡', |
| | | prop: 'version', |
| | | type: 'select', |
| | | span:5, |
| | | dicData: [{ |
| | | label: 'å½åçæ¬å½åçæ¬¡', |
| | | value: 1 |
| | | }, { |
| | | label: 'å½åçæ¬ææ°çæ¬¡', |
| | | value: 2 |
| | | }, { |
| | | label: 'ææ°çæ¬ææ°çæ¬¡', |
| | | value: 3 |
| | | }, { |
| | | label: 'å·²åå¸çææ°çæ¬', |
| | | value: 7 |
| | | }], |
| | | value: 1 |
| | | },{ |
| | | label: 'æ¥è¯¢æ¯å¦æä¸çº§', |
| | | prop: 'queryISLeaf', |
| | | type: 'switch', |
| | | labelWidth:140, |
| | | dicData: [ { |
| | | label: 'å¦', |
| | | value: false |
| | | },{ |
| | | label: 'æ¯', |
| | | value: true |
| | | }], |
| | | value:false |
| | | }, { |
| | | label: 'åèç¹å±æ¬¡æ°', |
| | | prop: 'level', |
| | | type: 'number', |
| | | span:3, |
| | | value:1 |
| | | }], |
| | | form:{ |
| | | btmName:'', |
| | | qtName: '', |
| | | queryTemplate:{ |
| | | |
| | | } |
| | | }, |
| | | formTemplate:{ |
| | | btmName:'', |
| | | qtName: '', |
| | | queryTemplate:{ |
| | | |
| | | } |
| | | }, |
| | | //å·²ææåºå表é
ç½® |
| | | crudOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: false, |
| | | height: "220", |
| | | tip: false, |
| | | column: [{ |
| | | label: 'æåºå段', |
| | | prop: 'orderField' |
| | | }, { |
| | | label: 'æåºæ¹å¼', |
| | | prop: 'orderMode' |
| | | }, { |
| | | label: 'ä¼å
级', |
| | | prop: 'level' |
| | | }] |
| | | }, |
| | | //å·²ææåº |
| | | orderInfoList:[], |
| | | //设置æåºå¼¹çªè¡¨åæ°æ® |
| | | tableForm:{ |
| | | orderField:'', |
| | | orderMode:'ASC', |
| | | level:'' |
| | | }, |
| | | //设置æåºå¼¹çªææå¯æåºå段 |
| | | orderFieldList:[], |
| | | //设置æåºå¼¹çªè¡¨åé
ç½® |
| | | tableFormOption: { |
| | | menuBtn: false, |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | span:24, |
| | | column: [{ |
| | | label: 'æåºå段', |
| | | prop: 'orderField', |
| | | type:'select', |
| | | props: { |
| | | label: 'id', |
| | | value: 'id' |
| | | }, |
| | | rules: [{ |
| | | required: true, |
| | | message: "è¯·éæ©æåºå段", |
| | | trigger: "blur" |
| | | }] |
| | | }, { |
| | | label: 'æåºæ¹å¼', |
| | | prop: 'orderMode', |
| | | type: 'select', |
| | | dicData: [{ |
| | | label: 'ååº', |
| | | value: 'ASC' |
| | | }, { |
| | | label: 'éåº', |
| | | value: 'DESC' |
| | | }], |
| | | value: 'ASC' |
| | | }, { |
| | | label: 'ä¼å
级', |
| | | prop: 'level', |
| | | type: 'number', |
| | | min:1, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请è¾å
¥ä¼å
级", |
| | | trigger: "blur" |
| | | }] |
| | | }] |
| | | }, |
| | | treeOption:{ |
| | | defaultExpandAll:true, |
| | | menu: false, |
| | | addBtn: false, |
| | | filter:false, |
| | | }, |
| | | linkQueryDefineForm:'',//龿¥ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸å¼ |
| | | linkQueryDefineDic:[],//龿¥ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹ä¸ææ°æ® |
| | | //龿¥ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸é¡¹å±æ§ |
| | | linkTreeData: [], |
| | | businessQueryDefineForm:'',//ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸å¼ |
| | | businessQueryDefineDic:[],//ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹ä¸ææ°æ® |
| | | //ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿å®ä¹éä¸é¡¹å±æ§ |
| | | businessTreeData: [], |
| | | }; |
| | | }, |
| | | watch: { |
| | | //æ¹å |
| | | 'form.direction': { |
| | | handler(val) { |
| | | if(val=='positive'){ |
| | | //æ£å |
| | | const dicData=this.treeData.btmItemsTo.map(item=>{ |
| | | return { |
| | | label: item, |
| | | value: item |
| | | } |
| | | }) |
| | | dicData.push({ |
| | | label: 'ææç±»å', |
| | | value: '*' |
| | | }) |
| | | this.$refs.form.updateDic('btmType', dicData); |
| | | this.form.btmType=dicData[0].value |
| | | this.getAllAttr(); |
| | | }else if(val=='opposite'){ |
| | | //åå |
| | | const dicData=this.treeData.btmItemsFrom.map(item=>{ |
| | | return { |
| | | label: item, |
| | | value: item |
| | | } |
| | | }) |
| | | dicData.push({ |
| | | label: 'ææç±»å', |
| | | value: '*' |
| | | }) |
| | | this.$refs.form.updateDic('btmType', dicData); |
| | | this.form.btmType=dicData[0].value |
| | | this.getAllAttr(); |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | //ä¸å¡ç±»å |
| | | 'form.btmType': { |
| | | handler(val) { |
| | | if(val && val!='*'){ |
| | | this.getTemp(val,false); |
| | | } |
| | | }, |
| | | immediate: true, |
| | | }, |
| | | }, |
| | | methods: { |
| | | openDialog(btmName, title, mode, data) { |
| | | this.dialog.title = title; |
| | | this.dialog.showDialog = true; |
| | | this.dialog.type = mode; |
| | | this.form.btmName = btmName; |
| | | this.treeData = data.treeData; |
| | | |
| | | if (data.selectData) { |
| | | this.selectData = data.selectData; |
| | | this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//å·²ææåº |
| | | } else { |
| | | this.selectData = {}; |
| | | this.orderInfoList =[]; |
| | | } |
| | | this.getTemp(data.treeData.label,true) |
| | | }, |
| | | cancelDialog() { |
| | | this.$nextTick(() => { |
| | | this.form = this.formTemplate; |
| | | this.orderInfoList =[]; |
| | | this.dialog.loading = false; |
| | | this.dialog.showDialog = false; |
| | | this.$refs.form.resetFields(); |
| | | this.businessQueryDefineForm=''; |
| | | this.linkQueryDefineForm=''; |
| | | }); |
| | | }, |
| | | submitDialog() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | linkSave(this.form).then(res => { |
| | | if (res.success) { |
| | | this.$message.success("ä¿åæå"); |
| | | this.cancelDialog(); |
| | | this.$emit("refresh"); |
| | | } |
| | | }); |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | getFormData(form) { |
| | | this.form = form; |
| | | }, |
| | | addRow() { |
| | | this.crudDialog.showDialog = true; |
| | | }, |
| | | // è¡å é¤ |
| | | rowDeleteHandler(data) { |
| | | this.orderInfoList.splice(data.index,1); |
| | | this.orderFieldList.unshift({ |
| | | id: data.row.orderField |
| | | }); |
| | | this.tableFormOption.column[0].dicData= this.orderFieldList |
| | | }, |
| | | //è·åæåºè®¾ç½®ä¸æææåºå段 |
| | | getAllAttr() { |
| | | getAllOrderbyAttributeByLink({ |
| | | name: this.treeData.label, |
| | | btmType: this.form.btmType, |
| | | direction: this.form.direction |
| | | }).then(res => { |
| | | const orderInfoStr = JSON.stringify(this.orderInfoList); |
| | | const dicData = []; |
| | | res.data.data.forEach(item => { |
| | | if (orderInfoStr.indexOf('"orderField":"' + item + '"') == -1) { |
| | | dicData.push({id: item}); |
| | | } |
| | | }) |
| | | this.tableFormOption.column[0].dicData=dicData; |
| | | this.orderFieldList=dicData; |
| | | }) |
| | | }, |
| | | //æåºè®¾ç½®ä¿å |
| | | rowSave() { |
| | | this.$refs.tableForm.validate((valid) => { |
| | | if(valid){ |
| | | this.orderInfoList.push(JSON.parse(JSON.stringify(this.tableForm))); |
| | | this.crudDialog.showDialog=false; |
| | | const orderInfoStr = JSON.stringify(this.orderInfoList); |
| | | const dicData = []; |
| | | this.orderFieldList.forEach(item => { |
| | | if (orderInfoStr.indexOf('"orderField":"' + item.id + '"') == -1) { |
| | | dicData.push(item); |
| | | } |
| | | }) |
| | | this.tableFormOption.column[0].dicData=dicData; |
| | | this.orderFieldList=dicData; |
| | | this.tableForm= { |
| | | orderField: '', |
| | | orderMode: 'ASC', |
| | | level: '' |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | //è·åæ¥è¯¢æ¨¡æ¿å®ä¹ä¸æ |
| | | getTemp(btmName,linkFlag) { |
| | | if (btmName) { |
| | | gridTemplate({btmName: btmName, linkFlag: linkFlag}).then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.name + '-' + (item.linkTypeName || item.btmName); |
| | | item.value = item.name; |
| | | return item; |
| | | }); |
| | | if(linkFlag){ |
| | | this.linkQueryDefineDic=data |
| | | data.length>0 && (this.linkQueryDefineForm=data[0].value); |
| | | }else { |
| | | this.businessQueryDefineDic=data; |
| | | data.length>0 && (this.businessQueryDefineForm= data[0].value); |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | linkQueryDefineChange(data) { |
| | | if (data.value) { |
| | | const childData = data.item.abNames.map(item => { |
| | | return { |
| | | label: item, |
| | | value: item |
| | | }; |
| | | }); |
| | | this.linkTreeData = [{ |
| | | label: data.value, |
| | | value: data.value, |
| | | children: childData |
| | | }] |
| | | } |
| | | }, |
| | | businessQueryDefineChange(data) { |
| | | if (data.value) { |
| | | const childData = data.item.abNames.map(item => { |
| | | return { |
| | | label: item, |
| | | value: item |
| | | }; |
| | | }); |
| | | this.businessTreeData = [{ |
| | | label: data.value, |
| | | value: data.value, |
| | | children: childData |
| | | }] |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | fieldset { |
| | | border-radius: 5px; |
| | | -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); |
| | | padding: 10px 6px; |
| | | box-sizing: border-box; |
| | | margin: 0; |
| | | border: 1px solid #EBEEF5; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <el-container> |
| | | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <div v-if="this.nodeRow && this.nodeRow.label"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">å建</el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">ä¿®æ¹</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">å é¤</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导åº</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥</el-button> |
| | | </div> |
| | | <avue-crud ref="crud" |
| | | @selection-change="selectionChange" |
| | | @row-click="rowClick" |
| | | :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" size="small" type="primary" @click="addHandler">å建</el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editHandler">ä¿®æ¹</el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delHandler">å é¤</el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导åº</el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="upLoadClickHandler">导å
¥</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <form-dialog ref="formRef" @refresh="getTemp"></form-dialog> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | | <div style="width: 300px;">111</div> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {gridLink} from "@/api/modeling/linkType/api"; |
| | | import { gridTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import {getObjTypeQTs,deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import func from "@/util/func"; |
| | | import {dateFormat} from "@/util/date"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import FormDialog from "./formDialog.vue" |
| | | |
| | | export default { |
| | | name: "index", |
| | | components: {FormDialog}, |
| | | data() { |
| | | return { |
| | | treeOption: { |
| | |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | tip: false, |
| | | header:false, |
| | | column: [{ |
| | | label: 'æ¥è¯¢æ¨¡æ¿åç§°', |
| | | prop: 'name' |
| | | prop: 'qtName' |
| | | }, { |
| | | label: 'å建人', |
| | | prop: 'creator' |
| | | }, { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | prop: 'createTimeText' |
| | | }, { |
| | | label: 'æ¹å', |
| | | prop: 'direction', |
| | | formatter:function (row, value) { |
| | | return dateFormat(new Date(value)) |
| | | if (row.queryTemplate.direction == 'positive') { |
| | | return 'æ£å' |
| | | }else{ |
| | | return 'åå' |
| | | } |
| | | } |
| | | }, { |
| | | label: 'ä¸å¡ç±»å', |
| | | prop: 'btmType', |
| | | formatter:function (row, value) { |
| | | return row.queryTemplate.btmType; |
| | | } |
| | | }] |
| | | }, |
| | |
| | | this.tableLoading = true; |
| | | this.getTemp(); |
| | | }, |
| | | //è·åæ¥è¯¢æ¨¡æ¿å表 |
| | | getTemp() { |
| | | gridTemplate({btmName: this.nodeRow.label, linkFlag: true}).then(res => { |
| | | getObjTypeQTs(this.nodeRow.label).then(res => { |
| | | this.crudData = res.data.data; |
| | | this.tableLoading = false; |
| | | this.selectionClear(); |
| | | }) |
| | | }, |
| | | selectHandler(selection, row) { |
| | | |
| | | rowClick(row) { |
| | | this.$refs.crud.toggleSelection(); |
| | | this.$refs.crud.toggleRowSelection(row); //éä¸å½åè¡ |
| | | this.selectionRow = [row]; |
| | | }, |
| | | changeTemp(data) { |
| | | this.$refs.queryCrud.clearSelection(); |
| | | if (data.value != '') { |
| | | let abNames = data.item.abNames.join(',').toLowerCase().split(',') |
| | | |
| | | } |
| | | selectionChange(list) { |
| | | this.selectionRow = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionRow = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | //å建 |
| | | addHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©è¦æ·»å çèç¹'); |
| | | return; |
| | | } |
| | | this.title = 'add'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | }); |
| | | this.$refs.formRef.openDialog(this.nodeRow.label,'å建','add',{treeData:this.nodeRow}); |
| | | }, |
| | | //ä¿®æ¹ |
| | | editHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®'); |
| | | if (this.selectionRow.length!=1) { |
| | | this.$message.error('è¯·éæ©ä¸æ¡æ°æ®'); |
| | | return; |
| | | } |
| | | this.form.name = this.templateForm; |
| | | this.title = 'edit'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | }); |
| | | }, |
| | | // æ°å¢ç¼è¾ä¿å |
| | | addDialogSavaHandler() { |
| | | this.$refs.form.validate((valid) => { |
| | | const saveFunction = this.title === 'add' ? saveTemplate : updateTemplate; |
| | | if (valid) { |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.addDialogClose(); |
| | | } |
| | | }) |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | // æ°å¢ç¼è¾å¯¹è¯æ¡åæ¶ |
| | | addDialogClose() { |
| | | this.form = { |
| | | name: '' |
| | | }; |
| | | this.$refs.form.clearValidate(); |
| | | this.visible = false; |
| | | this.$refs.formRef.openDialog(this.nodeRow.label,'ä¿®æ¹','edit',{treeData:this.nodeRow,selectData:this.selectionRow[0]}); |
| | | }, |
| | | //å é¤ |
| | | delHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | if (this.selectionRow.length==0) { |
| | | this.$message.error('è¯·éæ©æ°æ®'); |
| | | return; |
| | | } |
| | |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteLinkTemplate({ |
| | | name: this.templateForm, |
| | | btmName: this.nodeRow.label, |
| | | linkFlag: false |
| | | }).then(res => { |
| | | let names=this.selectionRow.map(item=>{ |
| | | return item.qtName |
| | | }) |
| | | deleteLinkTemplate(names).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | } |