| | |
| | | :data="crudData" :option="crudOption" :table-loading="tableLoading" style="margin-top: 10px"> |
| | | </avue-crud> |
| | | <form-dialog ref="formRef" @refresh="getTemp"></form-dialog> |
| | | <!--导入 --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入" |
| | | @updata="uploadCallBack"></upload-file> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | |
| | | |
| | | <script> |
| | | import {getBizTypes} from "@/api/modeling/businessType/api"; |
| | | import {gridTemplate,saveTemplate,updateTemplate,deleteTemplate} from "@/api/queryTemplate/queryDefine"; |
| | | import {deleteLinkTemplate,expBtmQTTemplate,impBtmTemplate} from "@/api/queryTemplate/businessTypeQuery"; |
| | | import {getObjTypeQTs} from "@/api/queryTemplate/queryDefine"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import func from "@/util/func"; |
| | | import {dateFormat} from "@/util/date"; |
| | | import FormDialog from "./formDialog.vue" |
| | | import {deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery"; |
| | | export default { |
| | | name: "index", |
| | | components: {FormDialog}, |
| | |
| | | height: "auto", |
| | | calcHeight: -40, |
| | | tip: false, |
| | | header:false, |
| | | column: [{ |
| | | label: '查询模板名称', |
| | | prop: 'name' |
| | | prop: 'qtName' |
| | | }, { |
| | | label: '创建人', |
| | | prop: 'creator' |
| | | }, { |
| | | label: '创建时间', |
| | | prop: 'createTime', |
| | | formatter:function (row, value) { |
| | | return dateFormat(new Date(value)) |
| | | } |
| | | prop: 'createTimeText' |
| | | }] |
| | | }, |
| | | selectionRow: [], |
| | | tipList: [ |
| | | "导入仅能上传.vciqtf格式文件" |
| | | ], |
| | | upFileType: ['vciqtf'], |
| | | fileUrl: 'api/templateController/impBtmTemplate', |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getTemp(); |
| | | }, |
| | | getTemp() { |
| | | gridTemplate({btmName: this.nodeRow.label, linkFlag: false}).then(res => { |
| | | getObjTypeQTs(this.nodeRow.label).then(res => { |
| | | this.crudData = res.data.data; |
| | | this.tableLoading = false; |
| | | }) |
| | |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | }, |
| | | //导出 |
| | | exportClickHandler(){ |
| | | if (this.selectionRow.length <= 0) { |
| | | this.$message.warning('请至少选择一条数据进行导出'); |
| | | return; |
| | | } |
| | | |
| | | let qtNames = this.selectionRow.map(item => item.qtName).join(','); |
| | | expBtmQTTemplate({qtNames: qtNames}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('导出成功'); |
| | | }) |
| | | }, |
| | | upLoadClickHandler(){ |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | uploadCallBack(res){ |
| | | function getText(child){ |
| | | let text='' |
| | | if(child[0].children && child[0].children.length>0){ |
| | | text=getText(child[0].children) |
| | | }else{ |
| | | text=child[0].text ||child[0]; |
| | | } |
| | | return text |
| | | } |
| | | if(res.obj) { |
| | | if (res.obj.children) { |
| | | this.$message.info(getText(res.obj.children)); |
| | | } |
| | | } |
| | | if(res.data){ |
| | | this.crudData = res.data; |
| | | } |
| | | //this.getTemp(); |
| | | } |
| | | } |
| | | } |