| | |
| | | <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="addTreeClickHandler">创建 |
| | | <el-button v-if="permissionList.addBtn" icon="el-icon-plus" plain size="small" type="primary" @click="addTreeClickHandler">创建 |
| | | </el-button> |
| | | <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">修改 |
| | | <el-button v-if="permissionList.editBtn" icon="el-icon-edit" plain size="small" type="primary" @click="editTreeClickHandler">修改 |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">删除 |
| | | <el-button v-if="permissionList.delBtn" icon="el-icon-delete" plain size="small" type="danger" @click="delTreeClickHandler">删除 |
| | | </el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出 |
| | | <el-button v-if="permissionList.importBtn" icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导入 |
| | | </el-button> |
| | | <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导入 |
| | | <el-button v-if="permissionList.exportBtn" icon="el-icon-download" plain size="small" type="primary" @click="exportClickHandler">导出 |
| | | </el-button> |
| | | </div> |
| | | <!-- 左侧树 --> |
| | |
| | | @update="rowTreeUpdataHandler" |
| | | @node-click="nodeClick"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <span> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | |
| | | </el-tag> |
| | | </template> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button v-if="treeNodeRow.id !== 'root'" icon="el-icon-plus" plain size="small" type="primary" |
| | | <el-button v-if="treeNodeRow.id !== 'root' && permissionList.actionTopAddBtn" icon="el-icon-plus" plain size="small" type="primary" |
| | | @click="addClickHandler">增加 |
| | | </el-button> |
| | | <el-button icon="el-icon-download" plain size="small" type="success" @click="downLoadHandler">导出 |
| | | <el-button v-if="permissionList.actionTopExportBtn" icon="el-icon-download" plain size="small" type="success" @click="downLoadHandler">导出 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | @row-del="BottomRowDelHandler" |
| | | > |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">增加 |
| | | <el-button v-if="permissionList.actionBottomAddBtn" icon="el-icon-plus" plain size="small" type="primary" @click="bottomAddClickHandler">增加 |
| | | </el-button> |
| | | </template> |
| | | <template slot="menuForm" slot-scope="scope"> |
| | |
| | | } from '@/api/UI/Action/api' |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | | name: "index", |
| | |
| | | bottomTableLoading: false, |
| | | bottomForm:{}, |
| | | bottomData: [], |
| | | bottomOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | calcHeight: -30, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | dialogWidth:'700', |
| | | saveBtn:false, |
| | | // height:'auto', |
| | | column: [ |
| | | { |
| | | label: '参数名称', |
| | | prop: 'name', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入参数名称', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '默认值', |
| | | prop: 'defaultValue', |
| | | }, |
| | | { |
| | | label: '提示信息', |
| | | prop: 'description', |
| | | span: 24, |
| | | type: 'textarea', |
| | | rows: 4 |
| | | }, |
| | | ], |
| | | }, |
| | | tableLoading: false, |
| | | lastIndex: null, |
| | | selectList: [], |
| | | data: [], |
| | | option: { |
| | | treeNodeRow: {}, |
| | | treeForm: {}, |
| | | treeOption: { |
| | | addBtn: false, |
| | | defaultExpandedKeys: ['root'], |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'childs' |
| | | }, |
| | | dialogWidth:'800', |
| | | dialogMenuPosition: 'right', |
| | | formOption: { |
| | | dialogMenuPosition: 'right', |
| | | column: [ |
| | | { |
| | | label: '分类名称', |
| | | prop: 'name', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入分类名称', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '分类序号', |
| | | prop: 'serialno', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入分类序号', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '创建者', |
| | | prop: 'creator', |
| | | disabled: true, |
| | | }, |
| | | { |
| | | label: '创建时间', |
| | | prop: 'createTime', |
| | | disabled: true, |
| | | }, |
| | | { |
| | | label: '父主类', |
| | | prop: 'pidName', |
| | | disabled: true, |
| | | span:24 |
| | | }, |
| | | { |
| | | label: '备注', |
| | | prop: 'description', |
| | | type:'textarea', |
| | | span:24 |
| | | }, |
| | | ], |
| | | } |
| | | }, |
| | | treeData: [], |
| | | } |
| | | }, |
| | | 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), |
| | | actionTopAddBtn: this.vaildData(this.permission[this.$route.query.id].actionTopAdd, false), |
| | | actionTopDelBtn: this.vaildData(this.permission[this.$route.query.id].actionTopDel, false), |
| | | actionTopEditBtn: this.vaildData(this.permission[this.$route.query.id].actionTopEdit, false), |
| | | actionTopExportBtn: this.vaildData(this.permission[this.$route.query.id].actionTopExport, false), |
| | | actionBottomAddBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomAdd, false), |
| | | actionBottomDelBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomDel, false), |
| | | actionBottomEditBtn: this.vaildData(this.permission[this.$route.query.id].actionBottomEdit, false), |
| | | }; |
| | | }, |
| | | option() { |
| | | return { |
| | | ...basicOption, |
| | | editBtn:this.permissionList.actionTopEditBtn, |
| | | delBtn:this.permissionList.actionTopDelBtn, |
| | | addBtn: false, |
| | | height: 350, |
| | | highlightCurrentRow: true, |
| | |
| | | type: 'textarea' |
| | | }, |
| | | ] |
| | | }, |
| | | treeNodeRow: {}, |
| | | treeForm: {}, |
| | | treeOption: { |
| | | } |
| | | }, |
| | | bottomOption(){ |
| | | return { |
| | | ...basicOption, |
| | | addBtn: false, |
| | | defaultExpandedKeys: ['root'], |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'childs' |
| | | }, |
| | | dialogWidth:'800', |
| | | dialogMenuPosition: 'right', |
| | | formOption: { |
| | | dialogMenuPosition: 'right', |
| | | column: [ |
| | | { |
| | | label: '分类名称', |
| | | prop: 'name', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入分类名称', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '分类序号', |
| | | prop: 'serialno', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入分类序号', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '创建者', |
| | | prop: 'creator', |
| | | disabled: true, |
| | | }, |
| | | { |
| | | label: '创建时间', |
| | | prop: 'createTime', |
| | | disabled: true, |
| | | }, |
| | | { |
| | | label: '父主类', |
| | | prop: 'pidName', |
| | | disabled: true, |
| | | span:24 |
| | | }, |
| | | { |
| | | label: '备注', |
| | | prop: 'description', |
| | | type:'textarea', |
| | | span:24 |
| | | }, |
| | | ], |
| | | } |
| | | }, |
| | | treeData: [], |
| | | editBtn:this.permissionList.actionBottomEditBtn, |
| | | delBtn:this.permissionList.actionBottomDelBtn, |
| | | calcHeight: -30, |
| | | selection: false, |
| | | refreshBtn: false, |
| | | dialogWidth:'700', |
| | | saveBtn:false, |
| | | // height:'auto', |
| | | column: [ |
| | | { |
| | | label: '参数名称', |
| | | prop: 'name', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入参数名称', |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '默认值', |
| | | prop: 'defaultValue', |
| | | }, |
| | | { |
| | | label: '提示信息', |
| | | prop: 'description', |
| | | span: 24, |
| | | type: 'textarea', |
| | | rows: 4 |
| | | }, |
| | | ], |
| | | } |
| | | } |
| | | }, |
| | | created() { |