链接类型搭建创建对话框以及一致性检查 创建视图 && 版本管理模块所有功能
| | |
| | | }); |
| | | } |
| | | |
| | | // å建 |
| | | // ä¿®æ¹ |
| | | export function updateAttribute(params) { |
| | | return request({ |
| | | url: "/api/attributeController/updateAttribute", |
| | |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | // å建 |
| | | export function addAttribute(params) { |
| | | return request({ |
| | | url: "/api/attributeController/addAttribute", |
| | |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export function download (params) { |
| | | export function exportAttributes (params) { |
| | | return request({ |
| | | url: '/api/attributeController/importAttributes', |
| | | url: '/api/attributeController/exportAttributes', |
| | | method: 'get', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // ä¸è´æ§æ£æ¥ |
| | | export function checkLinkType(params) { |
| | | return request({ |
| | | url: "/api/linkTypeController/checkLinkType", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å建è§å¾ |
| | | export function createView() { |
| | | return request({ |
| | | url: "/api/linkTypeController/createView", |
| | | method: "post", |
| | | }); |
| | | } |
| | |
| | | return request({ |
| | | url: "/api/statusController/gridStatus", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å建 |
| | | export function addSave(params) { |
| | | return request({ |
| | | url: "/api/statusController/addSave", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function editSave(params) { |
| | | return request({ |
| | | url: "/api/statusController/editSave", |
| | | method: "put", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ |
| | | export function deleteStatus(params) { |
| | | return request({ |
| | | url: "/api/statusController/deleteStatus", |
| | | method: "delete", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export function exportStatus (params) { |
| | | return request({ |
| | | url: '/api/statusController/exportStatus', |
| | | method: 'get', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | // æ¥ç使ç¨èå´ |
| | | export function listUsed(params) { |
| | | return request({ |
| | | url: "/api/statusController/listUsed", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | // å表æ¥è¯¢ |
| | | export function getVersionRuleAllList() { |
| | | return request({ |
| | | url: "/api/revisionRuleController/getVersionRuleAllList", |
| | | method: "get", |
| | | }); |
| | | } |
| | | |
| | | // å建 |
| | | export function addVersionRule(params) { |
| | | return request({ |
| | | url: "/api/revisionRuleController/addVersionRule", |
| | | method: "post", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹ |
| | | export function updateVersionRule(params) { |
| | | return request({ |
| | | url: "/api/revisionRuleController/updateVersionRule", |
| | | method: "put", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // å é¤ |
| | | export function deleteVersionRule(params) { |
| | | return request({ |
| | | url: "/api/revisionRuleController/deleteVersionRule", |
| | | method: "delete", |
| | | data: params |
| | | }); |
| | | } |
| | | |
| | | // æ¥ç使ç¨èå´ |
| | | export function getUsedVersionRuleList(params) { |
| | | return request({ |
| | | url: "/api/revisionRuleController/getUsedVersionRuleList", |
| | | method: "get", |
| | | params |
| | | }); |
| | | } |
| | | |
| | | // å¯¼åº |
| | | export function exportVersionRule (params) { |
| | | return request({ |
| | | url: '/api/revisionRuleController/exportVersionRule', |
| | | method: 'get', |
| | | headers: {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'}, |
| | | responseType: 'blob', |
| | | params |
| | | }) |
| | | } |
| | | |
| | |
| | | </el-form-item> |
| | | |
| | | |
| | | <el-form-item :label="form.enumSwitch ? 'æä¸¾éæ©ï¼' : 'æ·»å æä¸¾å¼ï¼'" prop="enumSwitch"> |
| | | <el-form-item :label="form.enumSwitch ? 'æä¸¾éæ©ï¼' : 'æ·»å å¼åï¼'" prop="enumSwitch"> |
| | | <el-select v-if="form.enumSwitch" v-model="form.enumId" placeholder="è¯·éæ©æä¸¾ç±»å" |
| | | @change="enumSelectChange"> |
| | | <el-option v-for="(item,index) in attributeDataTypePickList" :key="index" :label="item.key" |
| | |
| | | <el-button size="mini" @click="enumAddHandler"> = </el-button> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="å½åæä¸¾å¼ï¼" prop="rangeValue"> |
| | | <textarea v-model="form.rangeValue" |
| | | <el-form-item :label="form.enumSwitch ? 'å½åæä¸¾å¼ï¼' : 'å½åå¼åï¼'" prop="rangeValue"> |
| | | <textarea v-model="form.rangeValue" :readonly="form.enumSwitch" |
| | | style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;"> |
| | | </textarea> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | |
| | | |
| | | <el-form-item :label="form.enumSwitch ? 'æä¸¾éæ©ï¼' : 'æ·»å æä¸¾å¼ï¼'" prop="enumSwitch"> |
| | | <el-form-item :label="form.enumSwitch ? 'æä¸¾éæ©ï¼' : 'æ·»å å¼åï¼'" prop="enumSwitch"> |
| | | <el-select v-if="form.enumSwitch" v-model="form.enumId" placeholder="è¯·éæ©æä¸¾ç±»å" |
| | | @change="enumSelectChange"> |
| | | <el-option v-for="(item,index) in attributeDataTypePickList" :key="index" :label="item.key" |
| | |
| | | <el-button size="mini" @click="operationHandler('()')"> () </el-button> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="å½åæä¸¾å¼ï¼" prop="rangeValue"> |
| | | <textarea v-model="form.rangeValue" |
| | | <el-form-item :label="form.enumSwitch ? 'å½åæä¸¾å¼ï¼' : 'å½åå¼åï¼'" prop="rangeValue"> |
| | | <textarea v-model="form.rangeValue" :readonly="form.enumSwitch" |
| | | style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;"> |
| | | </textarea> |
| | | </el-form-item> |
| | |
| | | <!-- VTDouble --> |
| | | <div v-if="form.attributeDataType === 'VTDouble'" class="right"> |
| | | <h3>å¼å</h3> |
| | | <el-form-item label="æ·»å æä¸¾å¼ï¼" prop="enumAddValue"> |
| | | <el-form-item :label="form.enumSwitch ? 'æä¸¾éæ©ï¼' : 'æ·»å å¼åï¼'" prop="enumAddValue"> |
| | | <el-input v-model="form.enumAddValue"> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | <el-button size="mini" @click="operationHandler('()')"> () </el-button> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item label="å½åæä¸¾å¼ï¼" prop="rangeValue"> |
| | | <el-form-item :label="form.enumSwitch ? 'å½åæä¸¾å¼ï¼' : 'å½åå¼åï¼'" prop="rangeValue"> |
| | | <textarea v-model="form.rangeValue" |
| | | style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;"> |
| | | </textarea> |
| | |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="æ¥ç使ç¨èå´" |
| | | width="70%" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | ref="checkViewCrud" |
| | |
| | | getUsedAttributeList, |
| | | getEnumMapByType, |
| | | deleteAttributes, |
| | | download, |
| | | exportAttributes, |
| | | downloadAttributeTemplate, |
| | | getBizTypes, |
| | | getAllLtName, |
| | |
| | | this.form.attributeDataType === 'VTFilePath'; |
| | | }, |
| | | rangeOptionValue() { |
| | | return this.form.rangeValue.split('\n') |
| | | let values = this.form.rangeValue.split('\n'); |
| | | |
| | | // å¤çæ¯ä¸ªå¼ï¼å»é¤çå·åçé¨åï¼åªä¿ççå·åçé¨å |
| | | return values.map(value => { |
| | | let parts = value.split('='); |
| | | return parts.length > 1 ? parts[1].trim() : value.trim(); |
| | | }); |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | enumSelectChange(val) { |
| | | const list = this.attributeDataTypePickList.find(item => item.key === val).values; |
| | | this.form.rangeValue = list.join('\n'); |
| | | this.form.defaultValue = list[0]; |
| | | this.form.defaultValue = this.rangeOptionValue[0]; |
| | | }, |
| | | |
| | | // ä½¿ç¨æä¸¾switchæ»åchangeäºä»¶ |
| | | switchEnumChange(status) { |
| | | if (status) { |
| | | this.form.enumId = this.attributeDataTypePickList[0].key; |
| | | this.form.defaultValue = this.attributeDataTypePickList[0].values[0]; |
| | | const list = this.attributeDataTypePickList[0].values; |
| | | this.form.rangeValue = list.join('\n'); |
| | | this.form.defaultValue = this.rangeOptionValue[0]; |
| | | } else { |
| | | this.form.defaultValue = ""; |
| | | this.form.rangeValue = ""; |
| | |
| | | } |
| | | addAttribute(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.msg); |
| | | this.$message.success(res.data.obj); |
| | | this.getTableList(); |
| | | this.form = form; |
| | | this.addVisible = false; |
| | |
| | | } |
| | | |
| | | let attrNames = this.selectList.map(item => item.id).join(','); |
| | | download({attrNames: attrNames}).then(res => { |
| | | exportAttributes({attrNames: attrNames}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="æ¥ç使ç¨èå´" |
| | | width="70%" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | ref="checkViewCrud" |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-container v-loading="createViewLoading"> |
| | | <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">å建 |
| | | <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">ä¿®æ¹ |
| | | </el-button> |
| | |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary">导å
¥ |
| | | </el-button> |
| | | <el-button icon="el-icon-circle-plus-outline" plain size="small" |
| | | type="primary">å建è§å¾ |
| | | type="primary" @click="createViewClickHandler">å建è§å¾ |
| | | </el-button> |
| | | <el-button icon="el-icon-menu" plain size="small" |
| | | type="primary">ä¸è´æ§æ£æ¥ |
| | | type="primary" @click="checkClickHandler">ä¸è´æ§æ£æ¥ |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 300px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | |
| | | <i :class="icons.domain"></i> |
| | | å½¢ç¶ |
| | | </template> |
| | | <el-tag v-if="nodeRow.shape" size="small"> |
| | | <el-tag v-if="nodeRow.shape"> |
| | | {{ nodeRow.shape }} |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | |
| | | From端类å |
| | | </template> |
| | | <span v-for="item in nodeRow.btmItemsFrom" style="margin-left:2px;"> |
| | | <el-tag effect="plain" size="small" style="margin-top: 2px;"> |
| | | <el-tag effect="plain" style="margin-top: 2px;"> |
| | | {{ item }} |
| | | </el-tag> |
| | | </span> |
| | |
| | | <i :class="icons.from"></i> |
| | | Form端主类å |
| | | </template> |
| | | <el-tag v-if="nodeRow.primitivesFrom" effect="plain" size="small"> |
| | | <el-tag v-if="nodeRow.primitivesFrom" effect="plain"> |
| | | {{ nodeRow.primitivesFrom === 'è¯·éæ©' ? nodeRow.btmItemsFrom[0] : nodeRow.primitivesFrom }} |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | |
| | | <i :class="icons.from"></i> |
| | | From端对åºå
³ç³» |
| | | </template> |
| | | <el-tag v-if="nodeRow.relationFrom" effect="plain" size="small">{{ nodeRow.relationFrom }}</el-tag> |
| | | <el-tag v-if="nodeRow.relationFrom" effect="plain">{{ nodeRow.relationFrom }}</el-tag> |
| | | </el-descriptions-item> |
| | | |
| | | </el-descriptions> |
| | |
| | | To端类å |
| | | </template> |
| | | <span v-for="item in nodeRow.btmItemsTo" style="margin-left:2px;"> |
| | | <el-tag effect="plain" size="small" style="margin-top: 2px;"> |
| | | <el-tag effect="plain" style="margin-top: 2px;"> |
| | | {{ item }} |
| | | </el-tag> |
| | | </span> |
| | |
| | | <i :class="icons.to"></i> |
| | | To端主类å |
| | | </template> |
| | | <el-tag v-if="nodeRow.primitivesTo" effect="plain" size="small"> |
| | | <el-tag v-if="nodeRow.primitivesTo" effect="plain"> |
| | | {{ nodeRow.primitivesTo === 'è¯·éæ©' ? nodeRow.btmItemsTo[0] : nodeRow.primitivesTo }} |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | |
| | | <i :class="icons.to"></i> |
| | | To端对åºå
³ç³» |
| | | </template> |
| | | <el-tag v-if="nodeRow.relationTo" effect="plain" size="small">{{ nodeRow.relationTo }}</el-tag> |
| | | <el-tag v-if="nodeRow.relationTo" effect="plain">{{ nodeRow.relationTo }}</el-tag> |
| | | </el-descriptions-item> |
| | | |
| | | </el-descriptions> |
| | |
| | | </div> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | | <!-- å建 && ç¼è¾ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="å建" |
| | | width="70%" |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="90px"> |
| | | <div class="dialogForm"> |
| | | <div class="leftForm"> |
| | | <el-form-item label="åç§°ï¼" prop="name"> |
| | | <el-input v-model="form.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ ç¾ï¼"> |
| | | <el-input v-model="form.tag"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å®ç°ç±»ï¼"> |
| | | <el-input v-model="form.impClass"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å½¢ç¶"> |
| | | <el-input v-model="form.shape"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°"> |
| | | <el-input v-model="form.description" :rows="2" type="textarea"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | <div class="centerForm"> |
| | | <el-form-item label="Form端类åï¼" label-width="110px"> |
| | | <el-input v-model="form.btmItemsFrom"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="对åºå
³ç³»ï¼" label-width="110px"> |
| | | <el-select v-model="form.relationFrom"> |
| | | <el-option label="N" value="N"></el-option> |
| | | <el-option label="1" value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="主类åï¼" label-width="110px"> |
| | | <el-input v-model="form.primitivesFrom"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | <div class="rightForm"> |
| | | <el-form-item label="To端类åï¼" label-width="110px"> |
| | | <el-input v-model="form.btmItemsTo"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="对åºå
³ç³»ï¼" label-width="110px"> |
| | | <el-select v-model="form.relationTo"> |
| | | <el-option label="N" value="N"></el-option> |
| | | <el-option label="1" value="1"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="主类åï¼" label-width="110px"> |
| | | <el-input v-model="form.primitivesTo"></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | | |
| | | <div class="bottomForm"> |
| | | <h3>屿§æ± å表</h3> |
| | | <avue-crud |
| | | :data="dialogBottomData" |
| | | :option="dialogBottomOption" |
| | | > |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="dialogAddClickHandler">å¢ å |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button>å æ¶</el-button> |
| | | <el-button type="primary">ç¡® å®</el-button> |
| | | </span> |
| | | |
| | | <!-- 屿§æ± å表 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="attrPollDialogVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="屿§æ± " |
| | | width="60%" |
| | | @close="dialogAttrClose" |
| | | > |
| | | <avue-crud |
| | | ref="dialogAttrCrud" |
| | | :key="dialogAttrReload" |
| | | :data="dialogAttrData" |
| | | :option="dialogAttrOption" |
| | | :table-loading="dialogAttrLoading" |
| | | @selection-change="dialogAttrSelectChange" |
| | | @row-click="dialogAttrRowClickHandler" |
| | | > |
| | | </avue-crud> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogAttrClose">å æ¶</el-button> |
| | | <el-button type="primary">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | |
| | | <!-- ä¸è´æ§æ£æ¥ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="checkVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="ä¸è´æ§æ£æ¥" |
| | | width="60%" |
| | | > |
| | | </el-dialog> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import {gridLink} from "@/api/modeling/linkType/api"; |
| | | import {gridLink, getByAttributeNames, checkLinkType, createView} from "@/api/modeling/linkType/api"; |
| | | import basicOption from '@/util/basic-option' |
| | | import {gridAttribute} from "@/api/modeling/attributePool/api"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | dialogAttrReload: Math.random(), |
| | | dialogAttrSelectList: [], |
| | | dialogAttrLoading: false, |
| | | dialogAttrData: [], // 屿§æ± æ°å¢è¡¨æ ¼ |
| | | dialogAttrOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | menu: false, |
| | | refreshBtn: false, |
| | | index:false, |
| | | highlightCurrentRow: true, |
| | | height:450, |
| | | column: [ |
| | | { |
| | | label: '屿§å', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '屿§ç±»å', |
| | | prop: 'attributeDataType', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'åå§å¼', |
| | | prop: 'defaultValue', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '说æ', |
| | | prop: 'description', |
| | | sortable: true, |
| | | overHidden:true |
| | | } |
| | | ] |
| | | }, |
| | | attrPollDialogVisible: false, // å¯¹è¯æ¡ 屿§æ± å表visible |
| | | createViewLoading: false, // å建è§å¾ |
| | | checkVisible: false, |
| | | rules: { |
| | | name: [ |
| | | {required: true, message: '请è¾å
¥åç§°', trigger: 'blur'}, |
| | | ], |
| | | }, |
| | | form: { |
| | | name: '', // åç§° |
| | | tag: '', // æ ç¾ |
| | | impClass: '', // å®ç°ç±» |
| | | shape: '', // å½¢ç¶ |
| | | description: '', // æè¿° |
| | | btmItemsFrom: '', // From端类åå表 |
| | | relationFrom: 'N', // form端对åºå
³ç³» |
| | | primitivesFrom: '', // form端主类å |
| | | btmItemsTo: '', // to端类åå表 |
| | | relationTo: 'N', // to端对åºå
³ç³» |
| | | primitivesTo: '', // to端主类å |
| | | }, |
| | | dialogBottomOption: { |
| | | ...basicOption, |
| | | editBtn: false, |
| | | refreshBtn: false, |
| | | selection: false, |
| | | height: 300, |
| | | addBtn: false, |
| | | delBtn: false, |
| | | // index:false, |
| | | column: [ |
| | | { |
| | | label: '屿§å', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '屿§ç±»å', |
| | | prop: 'attributeDataType', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'åå§å¼', |
| | | prop: 'defaultValue', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '说æ', |
| | | prop: 'description', |
| | | } |
| | | ] |
| | | }, |
| | | dialogBottomData: [], |
| | | visible: false, |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandAll: false, |
| | |
| | | refreshBtn: false, |
| | | selection: false, |
| | | // index:false, |
| | | addBtn: false, |
| | | menu: false, |
| | | column: [ |
| | | { |
| | | label: '屿§å', |
| | | prop: 'attributeName', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '屿§ç±»å', |
| | | prop: 'source', |
| | | prop: 'attributeDataType', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'åå§å¼', |
| | | prop: 'source', |
| | | prop: 'defaultValue', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '说æ', |
| | | prop: 'desc', |
| | | prop: 'description', |
| | | } |
| | | ] |
| | | }, |
| | |
| | | |
| | | // æ ç¹å»äºä»¶ |
| | | nodeClick(row) { |
| | | console.log(row); |
| | | this.nodeRow = row; |
| | | this.getAttrPollData(row); // è·å屿§æ± å表 |
| | | }, |
| | | |
| | | // è·å屿§æ± å表 |
| | | getAttrPollData(row) { |
| | | let value = row.attributes.join(','); |
| | | getByAttributeNames({attrNames: value}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.tableData = res.data.data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å建æé® |
| | | addClickHandler() { |
| | | this.visible = true; |
| | | }, |
| | | |
| | | // ä¸è´æ§æ£æ¥ |
| | | checkClickHandler() { |
| | | this.checkVisible = true; |
| | | checkLinkType().then(res => { |
| | | |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }) |
| | | }, |
| | | |
| | | // å建è§å¾ |
| | | createViewClickHandler() { |
| | | this.createViewLoading = true; |
| | | createView().then(res => { |
| | | if (res.data.code === 200) { |
| | | this.createViewLoading = false; |
| | | this.$message.success(res.data.obj) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // å¯¹è¯æ¡ 屿§æ± å表å¢å æé® |
| | | dialogAddClickHandler() { |
| | | this.dialogAttrLoading = true; |
| | | this.attrPollDialogVisible = true; |
| | | this.dialogAttrReload = Math.random(); // 强å¶å·æ°è¡¨æ ¼ è§£å³è¡¨æ ¼éè¡ |
| | | gridAttribute(1, -1, this.searchParams).then(res => { |
| | | const data = res.data.data; |
| | | this.dialogAttrData = data; |
| | | this.dialogAttrLoading = false; |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }); |
| | | }, |
| | | |
| | | // æ·»å 屿§æ± è¡¨æ ¼éæ©æ¡ |
| | | dialogAttrSelectChange(row) { |
| | | this.dialogAttrSelectList = row; |
| | | }, |
| | | |
| | | // æ·»å 屿§æ± è¡ç¹å» |
| | | dialogAttrRowClickHandler(row) { |
| | | this.$refs.dialogAttrCrud.toggleRowSelection(row); |
| | | }, |
| | | |
| | | // æ·»å 屿§æ± å
³éå¯¹è¯æ¡ |
| | | dialogAttrClose(){ |
| | | this.attrPollDialogVisible = false; |
| | | } |
| | | } |
| | | } |
| | |
| | | ::v-deep { |
| | | .el-scrollbar__wrap { |
| | | overflow: auto !important; |
| | | } |
| | | |
| | | .el-form-item .el-select { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | |
| | | .headerCon > .el-button:nth-child(7) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .dialogForm { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | } |
| | | |
| | | .dialogForm > div { |
| | | width: 28%; |
| | | border: 1px solid #eee; |
| | | padding: 25px 20px 5px 10px; /* ä¸ å³ ä¸ å·¦ */ |
| | | box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2); /* æ·»å é´å½±ææ */ |
| | | } |
| | | </style> |
| | |
| | | <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">å建 |
| | | <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">ä¿®æ¹ |
| | | <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">å é¤ |
| | | <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">å¯¼åº |
| | | <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">导å
¥ |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导å
¥ |
| | | </el-button> |
| | | <el-button icon="el-icon-view" plain size="small" type="primary">æ¥ç |
| | | <el-button plain size="small" style="width: 100px;text-align: center" type="primary" |
| | | @click="checkViewClickHandler">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 280px);"> |
| | | <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span> |
| | | <span style="font-size: 15px"> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | |
| | | <el-descriptions :column="1" border class="margin-top" size="medium" title="屿§ä¿¡æ¯"> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.id"></i> |
| | | åç§° |
| | | </template> |
| | | <el-tag v-if="nodeRow.id">{{ nodeRow.id }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.name"></i> |
| | | æ ç¾ |
| | | </template> |
| | | <el-tag v-if="nodeRow.name">{{ nodeRow.name }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.desc"></i> |
| | | æè¿° |
| | | </template> |
| | | <el-tag v-if="nodeRow.description">{{ nodeRow.description }}</el-tag> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | | <!-- æ°å¢ ä¿®æ¹ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :title="dialogTitle === 'add' ? 'å建' : 'ä¿®æ¹'" |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | width="40%" |
| | | @close="visibleCloseHandler" |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <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="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 @click="visibleCloseHandler">å æ¶</el-button> |
| | | <el-button type="primary" @click="addSaveHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 导å
¥ --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导å
¥" |
| | | @updata="getTreeList"></upload-file> |
| | | |
| | | <!-- æ¥ç使ç¨èå´ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="checkViewVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="æ¥ç使ç¨èå´" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | ref="checkViewCrud" |
| | | :data="checkViewData" |
| | | :option="checkViewOption" |
| | | :table-loading="checkViewLoading" |
| | | @search-change="checkHandleSearch" |
| | | @search-reset="checkHandleReset" |
| | | > |
| | | </avue-crud> |
| | | </el-dialog> |
| | | |
| | | </el-container> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import {gridStatus} from "@/api/modeling/statusPool/api"; |
| | | import {gridStatus, addSave, editSave, deleteStatus, exportStatus, listUsed} from "@/api/modeling/statusPool/api"; |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | checkViewVisible: false, |
| | | checkViewData: [], |
| | | checkViewDataSearch: [], |
| | | checkViewLoading: false, |
| | | checkViewOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | menu: false, |
| | | searchMenuSpan: 8, |
| | | refreshBtn: false, |
| | | selection: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'TreeId', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'æ¥æº', |
| | | prop: 'name', |
| | | sortable: true, |
| | | search: true |
| | | }, |
| | | { |
| | | label: '说æ', |
| | | prop: 'description', |
| | | } |
| | | ] |
| | | }, |
| | | tipList: [ |
| | | "请注æåç§°ä¸è½ä¸ºç©º", |
| | | ], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/statusController/importStatus', |
| | | dialogTitle: '', |
| | | form: { |
| | | id: "", |
| | | name: "", |
| | | description: "" |
| | | }, |
| | | rules: { |
| | | id: [ |
| | | {required: true, message: '请è¾å
¥åç§°', trigger: 'blur'}, |
| | | ] |
| | | }, |
| | | visible: false, |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandAll: false, |
| | |
| | | } |
| | | }, |
| | | treeData: [], |
| | | nodeRow:{} |
| | | nodeRow: {}, |
| | | descriptionOption: { |
| | | labelStyle: 'text-align:center;width:120px', |
| | | contentStyle: 'width:240px;text-align:center;word-break;break-all;' |
| | | }, |
| | | icons: { |
| | | id: 'el-icon-finished', |
| | | name: 'el-icon-tickets', |
| | | desc: 'el-icon-chat-line-square' |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | // 左侧æ è¯·æ± |
| | | getTreeList() { |
| | | gridStatus().then(res => { |
| | | gridStatus({page: 1, limit: -1}).then(res => { |
| | | const data = res.data.data; |
| | | this.treeData = data; |
| | | this.tableLoading = false; |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }); |
| | | }, |
| | | |
| | | // æ èç¹ç¹å»äºä»¶ |
| | | nodeClick(row) { |
| | | this.nodeRow = row; |
| | | } |
| | | }, |
| | | |
| | | // å建æé® |
| | | addClickHandler() { |
| | | this.visible = true; |
| | | this.dialogTitle = 'add'; |
| | | }, |
| | | |
| | | // ç¼è¾æé® |
| | | editClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | this.visible = true; |
| | | this.dialogTitle = 'edit'; |
| | | this.form = this.nodeRow; |
| | | }, |
| | | |
| | | // å é¤ |
| | | delClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const list = [this.nodeRow]; |
| | | deleteStatus(list).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.nodeRow = {}; |
| | | } |
| | | }) |
| | | }).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; |
| | | |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.visible = false; |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | | } |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | }); |
| | | }, |
| | | |
| | | // å¯¼åº |
| | | exportClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | |
| | | exportStatus({statusOids: this.nodeRow.oid}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥ |
| | | uploadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | |
| | | // æ¥ç使ç¨èå´ |
| | | checkViewClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | listUsed({oid: this.nodeRow.oid}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.checkViewVisible = true; |
| | | const data = res.data.data; |
| | | data.forEach(item => { |
| | | item.name = item.id + `( ${item.name} )`; |
| | | item.TreeId = this.nodeRow.id; |
| | | }) |
| | | this.checkViewData = res.data.data; |
| | | this.checkViewDataSearch = res.data.data; |
| | | } |
| | | }) |
| | | }, |
| | | // æ¥ç使ç¨èå´æ¥è¯¢ |
| | | checkHandleSearch(params, done) { |
| | | const {name} = params; |
| | | |
| | | if (!params.name) { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | return done(); |
| | | } |
| | | ; |
| | | |
| | | this.checkViewData = this.checkViewData.filter(item => { |
| | | return item.name && item.name.includes(name); |
| | | }); |
| | | |
| | | done(); |
| | | |
| | | }, |
| | | |
| | | // æ¥ç使ç¨èå´éç½® |
| | | checkHandleReset() { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | .headerCon > .el-button:nth-child(7) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .upload-demo { |
| | | margin-left: 20px; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <p>çæ¬ç®¡ç</p> |
| | | <el-container> |
| | | <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 plain size="small" style="width: 100px;text-align: center" type="primary" |
| | | @click="checkViewClickHandler">æ¥ç使ç¨èå´ |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧æ --> |
| | | <div style="height: calc(100vh - 300px);"> |
| | | <avue-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> |
| | | </div> |
| | | </basic-container> |
| | | </el-aside> |
| | | |
| | | <el-main> |
| | | <basic-container> |
| | | <el-descriptions :column="1" border class="margin-top" size="medium" title="屿§ä¿¡æ¯"> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.id"></i> |
| | | åç§° |
| | | </template> |
| | | <el-tag v-if="nodeRow.id">{{ nodeRow.id }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.name"></i> |
| | | æ ç¾ |
| | | </template> |
| | | <el-tag v-if="nodeRow.name">{{ nodeRow.name }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.jump"></i> |
| | | è·³è·å符 |
| | | </template> |
| | | <el-tag v-if="nodeRow.jumpCharacter">{{ nodeRow.jumpCharacter }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.init"></i> |
| | | åå§å¼ |
| | | </template> |
| | | <el-tag v-if="nodeRow.initialValue">{{ nodeRow.initialValue }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.length"></i> |
| | | æ¥é¿ |
| | | </template> |
| | | <el-tag v-if="nodeRow.stepLength">{{ nodeRow.stepLength }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.left"></i> |
| | | åç¼ |
| | | </template> |
| | | <el-tag v-if="nodeRow.prefixion">{{ nodeRow.prefixion }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.right"></i> |
| | | åç¼ |
| | | </template> |
| | | <el-tag v-if="nodeRow.suffix">{{ nodeRow.suffix }}</el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :contentStyle="descriptionOption.contentStyle" |
| | | :labelStyle="descriptionOption.labelStyle"> |
| | | <template slot="label"> |
| | | <i :class="icons.desc"></i> |
| | | æè¿° |
| | | </template> |
| | | <el-tag v-if="nodeRow.description">{{ nodeRow.description }}</el-tag> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </basic-container> |
| | | </el-main> |
| | | |
| | | <!-- æ°å¢ ä¿®æ¹ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :title="dialogTitle === 'add' ? 'å建' : 'ä¿®æ¹'" |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | width="40%" |
| | | @close="visibleCloseHandler" |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="95px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç§°ï¼" prop="id"> |
| | | <el-input v-model="form.id"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ ç¾ï¼" prop="name"> |
| | | <el-input v-model="form.name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="è·³è·å符ï¼" prop="jumpCharacter"> |
| | | <el-input v-model="form.jumpCharacter"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åå§å¼ï¼" prop="initialValue"> |
| | | <el-input v-model="form.initialValue"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¥é¿ï¼" prop="stepLength"> |
| | | <el-input-number v-model="form.stepLength" :max="9" :min="1" label="æè¿°æå"></el-input-number> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç¼ï¼" prop="prefixion"> |
| | | <el-input v-model="form.prefixion"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="åç¼ï¼" prop="suffix"> |
| | | <el-input v-model="form.suffix"></el-input> |
| | | </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 @click="visibleCloseHandler">å æ¶</el-button> |
| | | <el-button type="primary" @click="addSaveHandler">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 导å
¥ --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导å
¥" |
| | | @updata="getTreeList"></upload-file> |
| | | |
| | | <!-- æ¥ç使ç¨èå´ --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="checkViewVisible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | title="æ¥ç使ç¨èå´" |
| | | width="60%" |
| | | > |
| | | <avue-crud |
| | | ref="checkViewCrud" |
| | | :data="checkViewData" |
| | | :option="checkViewOption" |
| | | :table-loading="checkViewLoading" |
| | | @search-change="checkHandleSearch" |
| | | @search-reset="checkHandleReset" |
| | | > |
| | | </avue-crud> |
| | | </el-dialog> |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getVersionRuleAllList, |
| | | addVersionRule, |
| | | updateVersionRule, |
| | | deleteVersionRule, |
| | | exportVersionRule, |
| | | getUsedVersionRuleList |
| | | } from "@/api/modeling/version/api"; |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | | |
| | | export default { |
| | | name: "index" |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | checkViewVisible: false, |
| | | checkViewData: [], |
| | | checkViewDataSearch: [], |
| | | checkViewLoading: false, |
| | | checkViewOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | menu: false, |
| | | searchMenuSpan: 8, |
| | | refreshBtn: false, |
| | | selection: false, |
| | | column: [ |
| | | { |
| | | label: 'åç§°', |
| | | prop: 'versionRuleName', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: 'æ¥æº', |
| | | prop: 'source', |
| | | sortable: true, |
| | | search: true |
| | | }, |
| | | { |
| | | label: '说æ', |
| | | prop: 'description', |
| | | } |
| | | ] |
| | | }, |
| | | tipList: [ |
| | | "åç§°ä¸è½ä¸ºç©ºä¸åªè½è¾å
¥è±æå符", |
| | | "è·³è·å符åªè½è¾å
¥æ°åæåæ¯ï¼å¹¶ä¸ä»¥è±æéå·åé", |
| | | "åå§å¼åªè½è¾å
¥æ°åã忝æè±æç¬¦å·", |
| | | "æ¥é¿ä¸è½ä¸ºç©ºä¸å¿
须为1-9çæ´æ°", |
| | | ], |
| | | upFileType: ['xls', 'xlsx'], |
| | | fileUrl: 'api/revisionRuleController/importVersionRules', |
| | | rules: { |
| | | id: [ |
| | | {required: true, message: '请è¾å
¥åç§°', trigger: 'blur'}, |
| | | {pattern: /^[a-zA-Z]+$/, message: 'åªè½è¾å
¥è±æå符', trigger: 'blur'} |
| | | ], |
| | | initialValue: [ |
| | | {required: true, message: '请è¾å
¥åå§å¼', trigger: 'blur'}, |
| | | {pattern: /^[a-zA-Z0-9!@#$%^&*()_+{}\[\]:;"'<>,.?/\\|-]*$/, message: 'åªè½è¾å
¥æ°åã忝æè±æç¬¦å·', trigger: 'blur'} |
| | | ], |
| | | jumpCharacter: [ |
| | | {required: true, message: '请è¾å
¥è·³è·å符', trigger: 'blur'}, |
| | | {pattern: /^[a-zA-Z0-9]+(?:,[a-zA-Z0-9]+)*$/, message: 'åªè½è¾å
¥æ°åæåæ¯ï¼å¹¶ä¸ä»¥éå·åé', trigger: 'blur'} |
| | | ] |
| | | }, |
| | | form: { |
| | | id: '', |
| | | name: '', |
| | | jumpCharacter: '', |
| | | initialValue: '', |
| | | stepLength: 1, |
| | | prefixion: '', |
| | | suffix: '', |
| | | description: '' |
| | | }, |
| | | visible: false, |
| | | dialogTitle: '', |
| | | nodeRow: {}, |
| | | treeData: [], |
| | | treeOption: { |
| | | height: 'auto', |
| | | defaultExpandAll: false, |
| | | menu: false, |
| | | addBtn: false, |
| | | props: { |
| | | label: 'id', |
| | | value: 'id', |
| | | children: 'children' |
| | | } |
| | | }, |
| | | descriptionOption: { |
| | | labelStyle: 'text-align:center;width:120px', |
| | | contentStyle: 'width:240px;text-align:center;word-break;break-all;' |
| | | }, |
| | | icons: { |
| | | id: 'el-icon-finished', |
| | | name: 'el-icon-tickets', |
| | | jump: 'el-icon-mouse', |
| | | init: 'el-icon-s-promotion', |
| | | length: 'el-icon-collection-tag', |
| | | left: 'el-icon-caret-left', |
| | | right: 'el-icon-caret-right', |
| | | desc: 'el-icon-chat-line-square' |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | }, |
| | | methods: { |
| | | //å·¦ä¾§æ æ¥è¯¢ |
| | | getTreeList() { |
| | | getVersionRuleAllList().then(res => { |
| | | console.log(res); |
| | | const data = res.data.data; |
| | | this.treeData = data; |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }); |
| | | }, |
| | | |
| | | // 左侧æ è¡ç¹å» |
| | | nodeClick(row) { |
| | | this.nodeRow = row; |
| | | }, |
| | | |
| | | // å建æé® |
| | | addClickHandler() { |
| | | this.dialogTitle = 'add'; |
| | | this.visible = true; |
| | | }, |
| | | |
| | | // ä¿®æ¹æé® |
| | | editClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | this.visible = true; |
| | | this.dialogTitle = 'edit'; |
| | | this.form = this.nodeRow; |
| | | }, |
| | | |
| | | // æ°å¢ä¿®æ¹å¯¹è¯æ¡å
³é |
| | | visibleCloseHandler() { |
| | | const form = { |
| | | id: '', |
| | | name: '', |
| | | jumpCharacter: '', |
| | | initialValue: '', |
| | | stepLength: 1, |
| | | prefixion: '', |
| | | suffix: '', |
| | | description: '' |
| | | } |
| | | this.form = form; |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | }, |
| | | |
| | | // æ°å¢ ç¼è¾ ä¿å |
| | | addSaveHandler() { |
| | | const saveFunction = this.dialogTitle === 'add' ? addVersionRule : updateVersionRule; |
| | | |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.visible = false; |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | | } |
| | | }).catch(error => { |
| | | this.$message.error(error); |
| | | }); |
| | | }, |
| | | |
| | | // å é¤æé® |
| | | delClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | this.$confirm('æ¨ç¡®å®è¦å é¤æéæ©çæ°æ®åï¼', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const list = [this.nodeRow]; |
| | | deleteVersionRule(list).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.nodeRow = {}; |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已忶å é¤' |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // å¯¼åº |
| | | exportClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | |
| | | exportVersionRule({vrNames: this.nodeRow.id}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('å¯¼åºæå'); |
| | | }).catch(err => { |
| | | this.$message.error(err); |
| | | }) |
| | | }, |
| | | |
| | | // 导å
¥ |
| | | uploadClickHandler() { |
| | | this.$refs.upload.visible = true; |
| | | }, |
| | | |
| | | // æ¥ç使ç¨èå´ |
| | | checkViewClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请è³å°éæ©ä¸æ¡æ°æ®ï¼'); |
| | | return; |
| | | } |
| | | getUsedVersionRuleList({vrName: this.nodeRow.id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.checkViewVisible = true; |
| | | const data = res.data.data; |
| | | this.checkViewData = res.data.data; |
| | | this.checkViewDataSearch = res.data.data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ¥ç使ç¨èå´æ¥è¯¢ |
| | | checkHandleSearch(params, done) { |
| | | const {source} = params; |
| | | |
| | | if (!params.source) { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | return done(); |
| | | } |
| | | ; |
| | | |
| | | this.checkViewData = this.checkViewData.filter(item => { |
| | | return item.source && item.source.includes(source); |
| | | }); |
| | | |
| | | done(); |
| | | |
| | | }, |
| | | |
| | | // æ¥ç使ç¨èå´éç½® |
| | | checkHandleReset() { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | <style lang="scss" scoped> |
| | | ::v-deep { |
| | | .el-scrollbar__wrap { |
| | | overflow: auto !important; |
| | | } |
| | | } |
| | | |
| | | .headerCon { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 5px; |
| | | |
| | | .el-button + .el-button { |
| | | margin-left: 5px; |
| | | } |
| | | |
| | | .el-button { |
| | | margin-top: 5px; |
| | | } |
| | | } |
| | | |
| | | .headerCon > .el-button:nth-child(4) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .headerCon > .el-button:nth-child(7) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | </style> |