¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | //ä¸å¡ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | // 模æ¿å表æ¥è¯¢ |
| | | export function gridTemplate(params) { |
| | | return request({ |
| | | url: "/api/templateController/queryTemplateList", |
| | | method: "get", |
| | | params:{ |
| | | ...params |
| | | } |
| | | }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | //龿¥ç±»åæ¥è¯¢æ¨¡æ¿ |
| | | // å é¤ |
| | | export function deleteLinkTemplate(params) { |
| | | return request({ |
| | | url: "/api/templateController/deleteLinkTemplate", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
| | |
| | | import request from '@/router/axios'; |
| | | //æ¥è¯¢æ¨¡æ¿å®ä¹ |
| | | // 模æ¿å表æ¥è¯¢ |
| | | // 模æ¿å表å®ä¹ä¸ææ¡æ¥è¯¢ |
| | | export function gridTemplate(params) { |
| | | return request({ |
| | | url: "/api/templateController/queryTemplateList", |
| | |
| | | }); |
| | | } |
| | | |
| | | export function getObjTypeQTs(params) { |
| | | return request({ |
| | | url: "/api/templateController/getObjTypeQTs", |
| | | method: "get", |
| | | params:{ |
| | | ...params |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateTemplate(params) { |
| | | return request({ |
| | |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 300px);"> |
| | | <div style="height: calc(100vh - 260px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | |
| | | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> |
| | | <div class="headerCon"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å建 |
| | | </el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </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> |
| | | <el-button class="smallBtn" plain size="small" type="primary" |
| | | @click="checkViewClickHandler">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | </div> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 280px);"> |
| | | <div style="height: calc(100vh - 190px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud ref="crud" |
| | | :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> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getBizTypes} from "@/api/modeling/businessType/api"; |
| | | import {gridTemplate,saveTemplate,updateTemplate,deleteTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import func from "@/util/func"; |
| | | import {dateFormat} from "@/util/date"; |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandedKeys: ['topNode'], |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'label', |
| | | value: 'oid', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | nodeRow: {}, |
| | | treeData: [ { |
| | | label: 'ä¸å¡ç±»åæ ', |
| | | oid: 'topNode', |
| | | children: [] |
| | | }], |
| | | templateForm: '', |
| | | templateData: [], |
| | | form: { |
| | | name: '' |
| | | }, |
| | | rules: { |
| | | name: [ |
| | | {required: true, message: '请è¾å
¥æ¥è¯¢æ¨¡æ¿åç§°', trigger: 'blur'} |
| | | ] |
| | | }, |
| | | title: '', |
| | | visible: false, |
| | | tableLoading: false, |
| | | crudData: [], |
| | | crudOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: true, |
| | | menu: false, |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | tip: false, |
| | | column: [{ |
| | | label: 'æ¥è¯¢æ¨¡æ¿åç§°', |
| | | prop: 'name' |
| | | }, { |
| | | label: 'å建人', |
| | | prop: 'creator' |
| | | }, { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | formatter:function (row, value) { |
| | | return dateFormat(new Date(value)) |
| | | } |
| | | }] |
| | | }, |
| | | selectionRow: [], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | //æ 表æ¥è¯¢ |
| | | getTreeList() { |
| | | const loading = this.$loading({}); |
| | | getBizTypes().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label = item.attributes.id; |
| | | return item; |
| | | }); |
| | | this.treeData[0].children = data; |
| | | loading.close(); |
| | | }) |
| | | }, |
| | | |
| | | // æ ç¹å» |
| | | nodeClick(row) { |
| | | this.nodeRow = row; |
| | | this.tableLoading = true; |
| | | this.getTemp(); |
| | | }, |
| | | getTemp() { |
| | | gridTemplate({btmName: this.nodeRow.label, linkFlag: false}).then(res => { |
| | | this.crudData = res.data.data; |
| | | this.tableLoading = false; |
| | | }) |
| | | }, |
| | | selectHandler(selection, row) { |
| | | |
| | | }, |
| | | changeTemp(data) { |
| | | this.$refs.queryCrud.clearSelection(); |
| | | if (data.value != '') { |
| | | let abNames = data.item.abNames.join(',').toLowerCase().split(',') |
| | | |
| | | } |
| | | }, |
| | | //å建 |
| | | addHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©è¦æ·»å çèç¹'); |
| | | return; |
| | | } |
| | | this.title = 'add'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | }); |
| | | }, |
| | | //ä¿®æ¹ |
| | | editHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | 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; |
| | | }, |
| | | //å é¤ |
| | | delHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©æ°æ®'); |
| | | return; |
| | | } |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteTemplate({ |
| | | name: this.templateForm, |
| | | btmName: this.nodeRow.label, |
| | | linkFlag: false |
| | | }).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | |
| | | <el-aside> |
| | | <basic-container> |
| | | <div ref="TreeBox" style="height: calc(100vh - 144px);!important;"> |
| | | <div class="headerCon"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="addClickHandler">å建 |
| | | </el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editClickHandler">ä¿®æ¹ |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delClickHandler">å é¤ |
| | | </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> |
| | | <el-button class="smallBtn" plain size="small" type="primary" |
| | | @click="checkViewClickHandler">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | </div> |
| | | <div ref="TreeBox" style="height: calc(100vh - 154px);!important;"> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 280px);"> |
| | | <div style="height: calc(100vh - 190px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <avue-crud ref="crud" |
| | | :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> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {gridLink} from "@/api/modeling/linkType/api"; |
| | | import { gridTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; |
| | | import func from "@/util/func"; |
| | | import {dateFormat} from "@/util/date"; |
| | | import basicOption from "@/util/basic-option"; |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandedKeys: ['topNode'], |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'label', |
| | | value: 'oid', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | nodeRow: {}, |
| | | treeData: [{ |
| | | label: '龿¥ç±»å', |
| | | oid: 'topNode', |
| | | children: [] |
| | | }], |
| | | templateForm: '', |
| | | templateData: [], |
| | | form: { |
| | | name: '' |
| | | }, |
| | | rules: { |
| | | name: [ |
| | | {required: true, message: '请è¾å
¥æ¥è¯¢æ¨¡æ¿åç§°', trigger: 'blur'} |
| | | ] |
| | | }, |
| | | title: '', |
| | | visible: false, |
| | | tableLoading: false, |
| | | crudData: [], |
| | | crudOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | selection: true, |
| | | menu: false, |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | tip: false, |
| | | column: [{ |
| | | label: 'æ¥è¯¢æ¨¡æ¿åç§°', |
| | | prop: 'name' |
| | | }, { |
| | | label: 'å建人', |
| | | prop: 'creator' |
| | | }, { |
| | | label: 'å建æ¶é´', |
| | | prop: 'createTime', |
| | | formatter:function (row, value) { |
| | | return dateFormat(new Date(value)) |
| | | } |
| | | }] |
| | | }, |
| | | selectionRow: [], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | //æ 表æ¥è¯¢ |
| | | getTreeList() { |
| | | const loading = this.$loading({}); |
| | | gridLink().then(res => { |
| | | const data = res.data.data.map(item => { |
| | | item.label=item.name; |
| | | return item; |
| | | }); |
| | | this.treeData[0].children = data; |
| | | loading.close(); |
| | | }) |
| | | }, |
| | | |
| | | // æ ç¹å» |
| | | nodeClick(row) { |
| | | this.nodeRow = row; |
| | | this.tableLoading = true; |
| | | this.getTemp(); |
| | | }, |
| | | getTemp() { |
| | | gridTemplate({btmName: this.nodeRow.label, linkFlag: true}).then(res => { |
| | | this.crudData = res.data.data; |
| | | this.tableLoading = false; |
| | | }) |
| | | }, |
| | | selectHandler(selection, row) { |
| | | |
| | | }, |
| | | changeTemp(data) { |
| | | this.$refs.queryCrud.clearSelection(); |
| | | if (data.value != '') { |
| | | let abNames = data.item.abNames.join(',').toLowerCase().split(',') |
| | | |
| | | } |
| | | }, |
| | | //å建 |
| | | addHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©è¦æ·»å çèç¹'); |
| | | return; |
| | | } |
| | | this.title = 'add'; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | }); |
| | | }, |
| | | //ä¿®æ¹ |
| | | editHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | 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; |
| | | }, |
| | | //å é¤ |
| | | delHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('è¯·éæ©æ°æ®'); |
| | | return; |
| | | } |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteLinkTemplate({ |
| | | name: this.templateForm, |
| | | btmName: this.nodeRow.label, |
| | | linkFlag: false |
| | | }).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <el-main> |
| | | <basic-container> |
| | | 模æ¿å表ï¼<avue-select v-model="templateForm" placeholder="è¯·éæ©æ¨¡æ¿" type="tree" :dic="templateData" @change="changeTemp"></avue-select> |
| | | <h3>æ¥è¯¢å±æ§</h3> |
| | | <avue-crud ref="queryCrud" |
| | | :data="attrData" :option="attrOption" :table-loading="tableLoading" style="margin-top: 10px"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | |
| | | menu:false, |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | title:'æ¥è¯¢å±æ§', |
| | | tip:false, |
| | | column: [{ |
| | | label: 'åæ®µç¼ç ', |