| | |
| | | <template> |
| | | <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 class="smallBtn" plain size="small" 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> |
| | | |
| | | <!-- 新增 修改 --> |
| | | <basic-container> |
| | | <avue-crud |
| | | ref="crud" |
| | | :data="data" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | @refresh-change="getTableList" |
| | | @selection-change="selectChange" |
| | | @row-click="rowClickHandler"> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="permissionList.addBtn" class="button-custom-icon" plain size="small" type="primary" |
| | | @click="addClickHandler"> |
| | | <icon-show :name="permissionList.addBtn.source"></icon-show> |
| | | 创建 |
| | | </el-button> |
| | | <el-button v-if="permissionList.viewTheScopeBtn" class="button-custom-icon" plain size="small" type="primary" |
| | | @click="checkViewClickHandler"> |
| | | <icon-show :name="permissionList.viewTheScopeBtn.source"></icon-show> |
| | | 查看使用范围 |
| | | </el-button> |
| | | <el-button v-if="permissionList.importBtn" class="button-custom-icon" plain size="small" type="primary" |
| | | @click="uploadClickHandler"> |
| | | <icon-show :name="permissionList.importBtn.source"></icon-show> |
| | | 导入 |
| | | </el-button> |
| | | <el-button v-if="permissionList.exportBtn" class="button-custom-icon" plain size="small" type="primary" |
| | | @click="exportClickHandler"> |
| | | <icon-show :name="permissionList.exportBtn.source"></icon-show> |
| | | 导出 |
| | | </el-button> |
| | | </template> |
| | | <template slot="menu" slot-scope="{row,index}"> |
| | | <el-button v-if="permissionList.editBtn" size="small" type="text" |
| | | @click="editClickHandler(row)"> |
| | | <icon-show :name="permissionList.editBtn.source"></icon-show> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button v-if="permissionList.delBtn" size="small" type="text" @click="delClickHandler(row)"> |
| | | <icon-show :name="permissionList.delBtn.source"></icon-show> |
| | | 删除 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <!-- 新增 修改 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :title="dialogTitle === 'add' ? '创建' : '修改'" |
| | | :visible.sync="visible" |
| | | append-to-body="true" |
| | | class="avue-dialog" |
| | | width="40%" |
| | | width="800px" |
| | | @close="visibleCloseHandler" |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="95px"> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="95px" size="small"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="名称:" prop="id"> |
| | | <el-input v-model="form.id"></el-input> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="visibleCloseHandler">取 消</el-button> |
| | | <el-button type="primary" @click="addSaveHandler">确 定</el-button> |
| | | <el-button size="small" type="primary" @click="addSaveHandler">确 定</el-button> |
| | | <el-button size="small" @click="visibleCloseHandler">取 消</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | <!-- 导入 --> |
| | | <!-- 导入 --> |
| | | <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入" |
| | | @updata="getTreeList"></upload-file> |
| | | @updata="getTableList"></upload-file> |
| | | |
| | | <!-- 查看使用范围 --> |
| | | <!-- 查看使用范围 --> |
| | | <el-dialog |
| | | v-dialogDrag |
| | | :visible.sync="checkViewVisible" |
| | |
| | | > |
| | | </avue-crud> |
| | | </el-dialog> |
| | | </el-container> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | } from "@/api/modeling/version/api"; |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | loading: false, |
| | | data: [], |
| | | option: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | calcHeight: -30, |
| | | column: [ |
| | | { |
| | | label: '名称', |
| | | prop: 'id', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '标签', |
| | | prop: 'name', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '跳跃字符', |
| | | prop: 'jumpCharacter', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '初始值', |
| | | prop: 'initialValue', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '步长', |
| | | prop: 'stepLength', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '前缀', |
| | | prop: 'prefixion', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '后缀', |
| | | prop: 'suffix', |
| | | sortable: true, |
| | | }, |
| | | { |
| | | label: '描述', |
| | | prop: 'description', |
| | | sortable: true, |
| | | }, |
| | | ] |
| | | }, |
| | | checkViewVisible: false, |
| | | checkViewData: [], |
| | | checkViewDataSearch: [], |
| | |
| | | searchMenuSpan: 8, |
| | | refreshBtn: false, |
| | | selection: false, |
| | | header: false, |
| | | column: [ |
| | | { |
| | | label: '名称', |
| | |
| | | right: 'el-icon-caret-right', |
| | | desc: 'el-icon-chat-line-square' |
| | | }, |
| | | selectList: [], |
| | | lastIndex: null, |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permission[this.$route.query.id].ADD, false), |
| | | delBtn: this.vaildData(this.permission[this.$route.query.id].DELETE, false), |
| | | editBtn: this.vaildData(this.permission[this.$route.query.id].EDIT, false), |
| | | exportBtn: this.vaildData(this.permission[this.$route.query.id].EXPORT, false), |
| | | importBtn: this.vaildData(this.permission[this.$route.query.id].IMPORT, false), |
| | | viewTheScopeBtn: this.vaildData(this.permission[this.$route.query.id].SEARCH, false), |
| | | }; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getTreeList(); |
| | | this.getTableList(); |
| | | }, |
| | | methods: { |
| | | //左侧树查询 |
| | | getTreeList() { |
| | | // 左侧树查询 |
| | | getTableList() { |
| | | this.loading = true; |
| | | getVersionRuleAllList().then(res => { |
| | | const data = res.data.data; |
| | | this.treeData = data; |
| | | this.data = data; |
| | | this.loading = false; |
| | | }).catch(err => { |
| | | this.$message.error(err) |
| | | }); |
| | | }, |
| | | |
| | | // 左侧树行点击 |
| | | nodeClick(row) { |
| | | this.nodeRow = row; |
| | | }, |
| | | |
| | | // 创建按钮 |
| | |
| | | }, |
| | | |
| | | // 修改按钮 |
| | | editClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据!'); |
| | | return; |
| | | } |
| | | editClickHandler(row) { |
| | | this.form = {...row}; |
| | | this.visible = true; |
| | | this.dialogTitle = 'edit'; |
| | | this.form = this.nodeRow; |
| | | }, |
| | | |
| | | // 新增修改对话框关闭 |
| | |
| | | saveFunction(this.form).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.getTableList(); |
| | | this.visible = false; |
| | | } else { |
| | | this.$message.error(res.data.obj); |
| | |
| | | }, |
| | | |
| | | // 删除按钮 |
| | | delClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | this.$message.error('请至少选择一条数据!'); |
| | | return; |
| | | } |
| | | delClickHandler(row) { |
| | | this.$confirm('您确定要删除所选择的数据吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | const list = [this.nodeRow]; |
| | | const list = [row]; |
| | | deleteVersionRule(list).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.$message.success(res.data.obj); |
| | | this.getTreeList(); |
| | | this.nodeRow = {}; |
| | | this.getTableList(); |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | |
| | | |
| | | // 导出 |
| | | exportClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.error('请至少选择一条数据!'); |
| | | return; |
| | | } |
| | | |
| | | exportVersionRule({vrNames: this.nodeRow.id}).then(res => { |
| | | if (this.selectList.length > 1) { |
| | | this.$message.error('只能选择一条数据!'); |
| | | return; |
| | | } |
| | | |
| | | exportVersionRule({vrNames: this.selectList[0].id}).then(res => { |
| | | func.downloadFileByBlobHandler(res); |
| | | this.$message.success('导出成功'); |
| | | }).catch(err => { |
| | |
| | | |
| | | // 查看使用范围 |
| | | checkViewClickHandler() { |
| | | if (func.isEmptyObject(this.nodeRow)) { |
| | | if (this.selectList.length <= 0) { |
| | | this.$message.error('请至少选择一条数据!'); |
| | | return; |
| | | } |
| | | getUsedVersionRuleList({vrName: this.nodeRow.id}).then(res => { |
| | | |
| | | if (this.selectList.length > 1) { |
| | | this.$message.error('只能选择一条数据!'); |
| | | return; |
| | | } |
| | | getUsedVersionRuleList({vrName: this.selectList[0].id}).then(res => { |
| | | if (res.data.code === 200) { |
| | | this.checkViewVisible = true; |
| | | const data = res.data.data; |
| | |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | return done(); |
| | | } |
| | | ; |
| | | |
| | | this.checkViewData = this.checkViewDataSearch.filter(item => { |
| | | return item.source && item.source.includes(source); |
| | |
| | | checkHandleReset() { |
| | | this.checkViewData = this.checkViewDataSearch; |
| | | }, |
| | | |
| | | // 选择框 |
| | | selectChange(row) { |
| | | this.selectList = row; |
| | | }, |
| | | |
| | | // 点击行 |
| | | rowClickHandler(row) { |
| | | func.rowClickHandler( |
| | | row, |
| | | this.$refs.crud, |
| | | this.lastIndex, |
| | | (newIndex) => { |
| | | this.lastIndex = newIndex; |
| | | }, |
| | | () => { |
| | | this.selectList = [row]; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | overflow: auto !important; |
| | | } |
| | | |
| | | .headerCon { |
| | | .el-button { |
| | | width: 82px; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | .headerCon { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin-bottom: 5px; |
| | | |
| | | .el-button + .el-button { |
| | | margin-left: 5px; |
| | | } |
| | | |
| | | .el-button { |
| | | margin-top: 5px; |
| | | .el-input-number--small { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .headerCon > .el-button:nth-child(4) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .headerCon > .el-button:nth-child(7) { |
| | | margin-left: 0; |
| | | } |
| | | |
| | | .smallBtn { |
| | | width: 82px; |
| | | text-align: center; |
| | | padding-left: 4.5px; |
| | | } |
| | | |
| | | </style> |