| | |
| | | <template> |
| | | <div class="menuSettings_box"> |
| | | <div class="menuSettings_tree"> |
| | | <My-bread :list="['系统管理', '菜单设置']"></My-bread> |
| | | <My-bread :list="[ |
| | | `${$t('operatManage.operatManage')}`, |
| | | `${$t('operatManage.menuSettings')}`, |
| | | ]"></My-bread> |
| | | <el-divider /> |
| | | </div> |
| | | <div class="left_Tree"> |
| | | <el-card class="el-card-define"> |
| | | <div class="card_tree"> |
| | | <div class="cataLogContent"> |
| | | <div class="left_Tree subpage_Div"> |
| | | <div style="width:auto"> |
| | | <el-tree |
| | | ref="tree" |
| | | :props="defaultProps" |
| | |
| | | :data="menuList" |
| | | :expand-on-click-node="false" |
| | | :default-expand-all="true" |
| | | draggable |
| | | @node-click="handleNodeClick" |
| | | @node-drag-start="handleDragStart" |
| | | @node-drag-end="handleDrop" |
| | | > |
| | | <span class="custom-tree-node" slot-scope="{ node, data }"> |
| | | <span>{{ node.label }}</span> |
| | | <span class="btnBox"> |
| | | <el-button |
| | | v-if="menuStatus.insert" |
| | | type="text" |
| | | size="mini" |
| | | @click="() => append(node, data)" |
| | | > |
| | | <i class="el-icon-circle-plus"></i> |
| | | </el-button> |
| | | <el-button |
| | | v-if="menuStatus.delete" |
| | | type="text" |
| | | size="mini" |
| | | @click="() => remove(node, data)" |
| | | > |
| | | <i class="el-icon-delete-solid"></i> |
| | | </el-button> |
| | | </span> |
| | | </span> |
| | | </el-tree> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <div class="right_menu"> |
| | | <el-card class="el-card-define"> |
| | | <el-breadcrumb separator="/"> |
| | | <el-breadcrumb-item :to="{ path: '/' }">详细信息</el-breadcrumb-item> |
| | | </el-breadcrumb> |
| | | <el-divider /> |
| | | </div> |
| | | <div class="right_menu subpage_Div"> |
| | | <div style="display:flex;justify-content:right;align-items: center;padding-bottom: 14px"> |
| | | <el-breadcrumb separator="/" style="display: none"> |
| | | <el-breadcrumb-item :to="{ path: '/' }">{{ |
| | | $t('dataManage.dictionaryManageObj.particulars') |
| | | }}</el-breadcrumb-item> |
| | | </el-breadcrumb> |
| | | |
| | | <div> |
| | | <el-button |
| | | v-if="menuStatus.insert" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | @click="setNewNode(1)" |
| | | type="success" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | >{{$t('operatManage.menuSetObj.insert')}}</el-button> |
| | | <el-button |
| | | v-if="menuStatus.insert" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | @click="setNewNode(2)" |
| | | type="success" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | >{{$t('operatManage.menuSetObj.subInsert')}}</el-button> |
| | | <el-button |
| | | v-if="menuStatus.delete" |
| | | @click="setDelNode()" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | size="small" |
| | | >{{$t('operatManage.menuSetObj.delete')}}</el-button> |
| | | <el-button |
| | | v-if="menuStatus.update" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | @click="setEditNode(1)" |
| | | type="info" |
| | | icon="el-icon-top" |
| | | size="small" |
| | | >{{$t('operatManage.menuSetObj.moveUp')}}</el-button> |
| | | <el-button |
| | | v-if="menuStatus.update" |
| | | :disabled="itemdetail.pid == null ? true : false" |
| | | @click="setEditNode(2)" |
| | | type="info" |
| | | icon="el-icon-bottom" |
| | | size="small" |
| | | >{{$t('operatManage.menuSetObj.moveDown')}}</el-button> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="dividing-line"></div> |
| | | <!-- <el-divider />--> |
| | | <div class="form_box"> |
| | | <el-form :model="itemdetail" ref="itemdetail" :rules="rules"> |
| | | <el-form |
| | | :model="itemdetail" |
| | | ref="itemdetail" |
| | | :rules="rules" |
| | | label-width="130px" |
| | | > |
| | | <el-form-item |
| | | prop="enName" |
| | | label="英文名称" |
| | | :label="$t('operatManage.menuSetObj.enName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | clear="el_input" |
| | | v-model="itemdetail.enName" |
| | | :placeholder="$t('operatManage.menuSetObj.enNameHolder')" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | prop="cnName" |
| | | label="中文名称" |
| | | :label="$t('operatManage.menuSetObj.cnName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="itemdetail.cnName" |
| | | :placeholder="$t('operatManage.menuSetObj.cnNameHolder')" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="图标" :label-width="formLabelWidth"> |
| | | <el-input v-model="itemdetail.icon" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <!-- <el-form-item--> |
| | | <!-- :label="$t('operatManage.menuSetObj.icon')"--> |
| | | <!-- :label-width="formLabelWidth"--> |
| | | <!-- >--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="itemdetail.icon"--> |
| | | <!-- :placeholder="$t('operatManage.menuSetObj.iconHolder')"--> |
| | | <!-- autocomplete="off"--> |
| | | <!-- ></el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item |
| | | prop="isShow" |
| | | label="是否显示" |
| | | :label="$t('operatManage.menuSetObj.isShow')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-select |
| | | style="width: 400px" |
| | | :popper-append-to-body="false" |
| | | v-model="itemdetail.isShow" |
| | | placeholder="" |
| | | :placeholder="$t('operatManage.menuSetObj.show')" |
| | | > |
| | | <el-option |
| | | v-for="item in options1" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | <el-option :label="$t('operatManage.menuSetObj.hiddeen')" value="0" /> |
| | | <el-option :label="$t('operatManage.menuSetObj.isshow')" value="1" /> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in options1"--> |
| | | <!-- :key="item.value"--> |
| | | <!-- :label="item.label"--> |
| | | <!-- :value="item.value"--> |
| | | <!-- >--> |
| | | <!-- </el-option>--> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="菜单Url" :label-width="formLabelWidth"> |
| | | <el-input v-model="itemdetail.url" autocomplete="off"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="授权" :label-width="formLabelWidth"> |
| | | <el-form-item |
| | | :label="$t('operatManage.menuSetObj.menuUrl')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="itemdetail.perms" |
| | | v-model="itemdetail.url" |
| | | :placeholder="$t('operatManage.menuSetObj.menuUrlHolder')" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="类型" |
| | | :label="$t('operatManage.menuSetObj.authorize')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="itemdetail.perms" |
| | | :placeholder="$t('operatManage.menuSetObj.permsHolder')" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('operatManage.menuSetObj.type')" |
| | | prop="type" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-select |
| | | style="width: 400px" |
| | | :popper-append-to-body="false" |
| | | v-model="itemdetail.type" |
| | | placeholder="请选择类型" |
| | | :placeholder="$t('operatManage.menuSetObj.typeHolder')" |
| | | > |
| | | <el-option |
| | | v-for="item in options2" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | <el-option :label="$t('operatManage.menuSetObj.rootpath')" value="0" /> |
| | | <el-option :label="$t('operatManage.menuSetObj.menu')" value="1" /> |
| | | <el-option :label="$t('operatManage.menuSetObj.button')" value="2" /> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in options2"--> |
| | | <!-- :key="item.value"--> |
| | | <!-- :label="item.label"--> |
| | | <!-- :value="item.value"--> |
| | | <!-- >--> |
| | | <!-- </el-option>--> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注" :label-width="formLabelWidth"> |
| | | <el-input v-model="itemdetail.bak" autocomplete="off"></el-input> |
| | | <el-form-item |
| | | :label="$t('operatManage.menuSetObj.bak')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="itemdetail.bak" |
| | | autocomplete="off" |
| | | :placeholder="$t('operatManage.menuSetObj.bakHolder')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <div class="btnBox" v-if="menuStatus.update"> |
| | | <el-button |
| | | class="el-button-sure" |
| | | type="primary" |
| | | @click="updMenu('itemdetail')" |
| | | >保存</el-button |
| | | > |
| | | <el-button |
| | | class="el-button-remove" |
| | | type="primary" |
| | | @click="reset('itemdetail')" |
| | | >取消</el-button |
| | | > |
| | | <div v-if="menuStatus.update"> |
| | | <el-form-item> |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | @click="updMenu('itemdetail')" |
| | | >{{ $t('common.confirm') }}</el-button> |
| | | <el-button |
| | | size="small" |
| | | type="info" |
| | | @click="reset('itemdetail')" |
| | | >{{ |
| | | $t('common.cancel') |
| | | }}</el-button> |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | | </div> |
| | | </el-card> |
| | | |
| | | </div> |
| | | </div> |
| | | <el-dialog title="新增子菜单" :visible.sync="dialogFormVisible"> |
| | | <el-form :model="ruleForm" ref="ruleForm" :rules="rules"> |
| | | |
| | | <el-dialog |
| | | :title="$t('common.append')" |
| | | :visible.sync="dialogFormVisible" |
| | | :before-close="handleClose" |
| | | > |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form |
| | | :model="ruleForm" |
| | | ref="ruleForm" |
| | | :rules="rules" |
| | | label-position="top" |
| | | > |
| | | <el-form-item |
| | | prop="enName" |
| | | label="英文名称" |
| | | :label="$t('operatManage.menuSetObj.enName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input v-model="ruleForm.enName" autocomplete="off"></el-input> |
| | | <el-input |
| | | v-model="ruleForm.enName" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.enName')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | prop="cnName" |
| | | label="中文名称" |
| | | :label="$t('operatManage.menuSetObj.cnName')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input v-model="ruleForm.cnName" autocomplete="off"></el-input> |
| | | <el-input |
| | | v-model="ruleForm.cnName" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.cnName')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="图标" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.icon" autocomplete="off"></el-input> |
| | | <el-form-item |
| | | :label="$t('operatManage.menuSetObj.icon')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="ruleForm.icon" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.icon')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | prop="isShow" |
| | | label="是否显示" |
| | | :label="$t('operatManage.menuSetObj.isShow')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-select v-model="ruleForm.isShow" placeholder=""> |
| | | <el-select |
| | | :popper-append-to-body="false" |
| | | style="width:85%" |
| | | v-model="ruleForm.isShow" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('operatManage.menuSetObj.isShow')" |
| | | > |
| | | <el-option |
| | | v-for="item in options1" |
| | | :key="item.value" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="菜单Url" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.url" autocomplete="off"></el-input> |
| | | <el-form-item |
| | | :label="$t('operatManage.menuSetObj.menuUrl')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="ruleForm.url" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.menuUrl')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="授权" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.perms" autocomplete="off"></el-input> |
| | | <el-form-item |
| | | :label="$t('operatManage.menuSetObj.authorize')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="ruleForm.perms" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.authorize')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="类型" prop="type" :label-width="formLabelWidth"> |
| | | <el-select v-model="ruleForm.type" placeholder="请选择类型"> |
| | | <el-form-item |
| | | :label="$t('operatManage.menuSetObj.type')" |
| | | prop="type" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-select |
| | | :popper-append-to-body="false" |
| | | style="width:85%" |
| | | v-model="ruleForm.type" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('operatManage.menuSetObj.type')" |
| | | > |
| | | <el-option |
| | | v-for="item in options2" |
| | | :key="item.value" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注" :label-width="formLabelWidth"> |
| | | <el-input v-model="ruleForm.bak" autocomplete="off"></el-input> |
| | | <el-form-item |
| | | :label="$t('operatManage.menuSetObj.bak')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | v-model="ruleForm.bak" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('operatManage.menuSetObj.bak')" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button class="el-button-sure" @click="resetForm('ruleForm')" |
| | | >取消</el-button |
| | | > |
| | | </div> |
| | | <div |
| | | slot="footer" |
| | | class="dialog-footer" |
| | | > |
| | | <el-button @click="resetForm('ruleForm')">{{ |
| | | $t('common.cancel') |
| | | }}</el-button> |
| | | <el-button |
| | | class="el-button-remove" |
| | | type="primary" |
| | | style="background: #409eff; color: white; border: 1px solid #409eff" |
| | | @click="submitForm('ruleForm')" |
| | | v-loading.fullscreen.lock="fullscreenLoading" |
| | | >提交</el-button |
| | | > |
| | | >{{ $t('common.confirm') }}</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | |
| | | queryMaxId, |
| | | insertMenu, |
| | | deleteMenu, |
| | | getPerms, |
| | | } from '../../api/api'; |
| | | export default { |
| | | //import引入的组件需要注入到对象中才能使用 |
| | |
| | | type: null, |
| | | bak: '', |
| | | }, |
| | | rules: { |
| | | rules : { |
| | | enName: [ |
| | | { required: true, message: '请输入英文名称', trigger: 'blur' }, |
| | | { required: true, message: this.$t('operatManage.menuSetObj.enNameHolder'), trigger: 'blur' }, |
| | | ], |
| | | cnName: [ |
| | | { required: true, message: '请输入中文名称', trigger: 'blur' }, |
| | | { required: true, message: this.$t('operatManage.menuSetObj.cnNameHolder'), trigger: 'blur' }, |
| | | ], |
| | | |
| | | isShow: [ |
| | | { |
| | | required: true, |
| | | message: '请选择是否显示', |
| | | message: this.$t('operatManage.menuSetObj.show'), |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | type: [ |
| | | { |
| | | required: true, |
| | | message: '请选择节点类型', |
| | | message: this.$t('operatManage.menuSetObj.typeHolder'), |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | }, |
| | | // 下拉的option里面的value定义成0,1,不能定义成’0’,'1’字符串, |
| | | // 如果要定义成字符串,后台需要返回的也是字符串 |
| | | options1: [ |
| | | { |
| | | value: 0, |
| | | label: '隐藏', |
| | | label:this.$t('operatManage.menuSetObj.hiddeen') |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: '显示', |
| | | label:this.$t('operatManage.menuSetObj.isshow') |
| | | }, |
| | | ], |
| | | options2: [ |
| | | { |
| | | value: 0, |
| | | label: '根目录', |
| | | label:this.$t('operatManage.menuSetObj.rootpath') |
| | | // label: '根目录', |
| | | }, |
| | | { |
| | | value: 1, |
| | | label: '菜单', |
| | | label:this.$t('operatManage.menuSetObj.menu') |
| | | // label: '菜单', |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: '按钮', |
| | | label:this.$t('operatManage.menuSetObj.button') |
| | | // label: '按钮', |
| | | }, |
| | | ], |
| | | newNode: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | this.menuList = this.treeData(res.result); |
| | | this.oriData = res.result; |
| | | this.newData = res.result; |
| | | if (this.itemdetail.id != null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.tree.setCurrentKey(this.itemdetail.id); |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | } else { |
| | | console.log('接口报错'); |
| | | } |
| | |
| | | return father.pid == 0; // 返回一级菜单 |
| | | }); |
| | | }, |
| | | |
| | | setEditNode(res) { |
| | | let node = this.$refs.tree.getCurrentNode(); |
| | | let pchildNodes = this.$refs.tree.getNode(node.id).parent.childNodes; |
| | | let currentId = {}; |
| | | for (let i = 0; i < pchildNodes.length; i++) { |
| | | if (pchildNodes[i].data.id == node.id) { |
| | | currentId = i; |
| | | } |
| | | } |
| | | switch (res) { |
| | | case 1://向上移动 |
| | | if (currentId != 0) { |
| | | const tempChildrenNodex1 = pchildNodes[currentId - 1]; |
| | | const tempChildrenNodex2 = pchildNodes[currentId]; |
| | | tempChildrenNodex2.orderNum = pchildNodes[currentId - 1].data.orderNum; |
| | | tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum |
| | | var arr = []; |
| | | this.oriData.filter(res => { |
| | | if (res.id == tempChildrenNodex2.data.id) { |
| | | res.orderNum = tempChildrenNodex2.orderNum; |
| | | arr.push(res) |
| | | } else if (res.id == tempChildrenNodex1.data.id) { |
| | | res.orderNum = tempChildrenNodex1.orderNum; |
| | | arr.push(res) |
| | | } |
| | | |
| | | }) |
| | | this.newData = arr; |
| | | this.sendChange(); |
| | | } else { |
| | | this.$message({ |
| | | message: '处于顶端,不能继续上移', |
| | | type: 'warning' |
| | | }); |
| | | } |
| | | break; |
| | | case 2://向下移动 |
| | | if (currentId < (pchildNodes.length - 1)) { |
| | | const tempChildrenNodex1 = pchildNodes[currentId + 1]; |
| | | const tempChildrenNodex2 = pchildNodes[currentId]; |
| | | tempChildrenNodex2.orderNum = pchildNodes[currentId + 1].data.orderNum; |
| | | tempChildrenNodex1.orderNum = pchildNodes[currentId].data.orderNum; |
| | | var arr = []; |
| | | this.oriData.filter(res => { |
| | | if (res.id == tempChildrenNodex2.data.id) { |
| | | res.orderNum = tempChildrenNodex2.orderNum; |
| | | arr.push(res) |
| | | } else if (res.id == tempChildrenNodex1.data.id) { |
| | | res.orderNum = tempChildrenNodex1.orderNum; |
| | | arr.push(res) |
| | | } |
| | | }) |
| | | this.newData = arr; |
| | | this.sendChange(); |
| | | } else { |
| | | this.$message({ |
| | | message: '处于底端,不能继续下移', |
| | | type: 'warning' |
| | | }); |
| | | |
| | | } |
| | | break; |
| | | |
| | | } |
| | | }, |
| | | setDelNode() { |
| | | this.remove(this.newNode, this.itemdetail) |
| | | }, |
| | | setNewNode(res) { |
| | | var id, lever, orderNum; |
| | | if (res == 1) {//新增同级 |
| | | id = this.itemdetail.pid; |
| | | orderNum = this.getMaxOrderNum(this.newNode.parent.childNodes) |
| | | |
| | | lever = this.itemdetail.level; |
| | | } else if (res == 2) {//新增子级 |
| | | id = this.itemdetail.id; |
| | | orderNum = this.getMaxOrderNum(this.newNode.childNodes) |
| | | |
| | | lever = this.itemdetail.level + 1; |
| | | } |
| | | |
| | | this.ruleForm.pid = id; |
| | | this.ruleForm.level = lever; |
| | | this.ruleForm.orderNum = orderNum |
| | | this.dialogFormVisible = true; |
| | | }, |
| | | getMaxOrderNum(res) { |
| | | var val = -100; |
| | | for (var i in res) { |
| | | if (res[i].data.orderNum > val) { |
| | | val = res[i].data.orderNum |
| | | } |
| | | } |
| | | val = val + 1; |
| | | return val; |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | append(node, data) { |
| | | this.dialogFormVisible = true; |
| | | this.ruleForm.pid = data.id; |
| | |
| | | this.ruleForm.level = data.level + 1; |
| | | }, |
| | | resetForm(formName) { |
| | | this.dialogFormVisible = false; |
| | | this.$nextTick(() => { |
| | | this.$refs[formName].resetFields(); |
| | | this.ruleForm = {}; |
| | | }); |
| | | this.$confirm("关闭后无法保存,是否关闭?") |
| | | .then((_) => { |
| | | this.dialogFormVisible = false; |
| | | this.$nextTick(() => { |
| | | this.$refs[formName].resetFields(); |
| | | this.ruleForm = {}; |
| | | }); |
| | | }) |
| | | .catch((_) => { }); |
| | | }, |
| | | submitForm(formName) { |
| | | this.$nextTick(() => { |
| | |
| | | this.getMenuTree(); |
| | | return; |
| | | } else { |
| | | alert('调整失败,请重试!'); |
| | | this.$message.error('调整失败,请重试!'); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | alert('修改失败,请重试!'); |
| | | this.$message.error('调整失败,请重试!'); |
| | | }); |
| | | }, |
| | | handleNodeClick(data) { |
| | | // console.log(data); |
| | | handleNodeClick(data, node) { |
| | | this.newNode = node; |
| | | this.backUpData = JSON.stringify(data); |
| | | this.itemdetail = JSON.parse(JSON.stringify(data)); |
| | | this.itemdetail.isShow = this.itemdetail.isShow.toString(); |
| | | this.itemdetail.type = this.itemdetail.type.toString(); |
| | | }, |
| | | updMenu(formName) { |
| | | this.$nextTick(() => { |
| | |
| | | setTimeout(() => { |
| | | this.fullscreenLoading = false; |
| | | if (res.code == 200) { |
| | | this.$router.go(0); |
| | | this.getMenuTree(); |
| | | this.itemdetail = {}; |
| | | this.dialogFormVisible = false; |
| | |
| | | }, 500); |
| | | }) |
| | | .catch((res) => { |
| | | alert('修改失败,请重试!'); |
| | | this.$message.error('调整失败,请重试!'); |
| | | this.fullscreenLoading = false; |
| | | }); |
| | | } else { |
| | |
| | | } |
| | | }, |
| | | showPermsMenu(res) { |
| | | |
| | | switch (res.tag) { |
| | | case '/delete': |
| | | this.menuStatus.delete = true; |
| | |
| | | break; |
| | | } |
| | | }, |
| | | getPerms() { |
| | | var val = this.$store.state.currentPerms; |
| | | var permsEntity = this.$store.state.permsEntity; |
| | | |
| | | if (permsEntity.length == 0) { |
| | | getPerms().then((res) => { |
| | | if (res.code == 200) { |
| | | permsEntity = res.result; |
| | | } |
| | | }); |
| | | } |
| | | for (var i = 0; i < permsEntity.length; i++) { |
| | | if (permsEntity[i].perms == val) { |
| | | this.showPermsMenu(permsEntity[i]); |
| | | } |
| | | } |
| | | }, |
| | | handleClose() { |
| | | this.$confirm("关闭后无法保存,是否关闭?") |
| | | .then((_) => { |
| | | this.dialogFormVisible = false |
| | | }) |
| | | .catch((_) => { }); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.getMenuTree(); |
| | | this.getPerms(); |
| | | }, |
| | | created() { |
| | | var val = this.$store.state.currentPerms; |
| | | |
| | | var permsEntity = this.$store.state.permsEntity; |
| | | |
| | | for (var i = 0; i < permsEntity.length; i++) { |
| | | if (permsEntity[i].perms == val) { |
| | | this.showPermsMenu(permsEntity[i]); |
| | | } |
| | | } |
| | | }, |
| | | created() { }, |
| | | }; |
| | | </script> |
| | | <style lang="less" scoped> |
| | | //@import url(); 引入公共css类 |
| | | .menuSettings_box { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | box-sizing: border-box; |
| | | .left_Tree { |
| | | width: 15%; |
| | | height: 100%; |
| | | position: relative; |
| | | float: left; |
| | | box-sizing: border-box; |
| | | overflow-y: auto; |
| | | .el-icon-circle-plus { |
| | | color: gray; |
| | | } |
| | | .el-icon-delete-solid { |
| | | color: gray; |
| | | } |
| | | } |
| | | .right_menu { |
| | | width: 84%; |
| | | float: right; |
| | | .form_box { |
| | | box-sizing: border-box; |
| | | width: 100%; |
| | | .el-input { |
| | | width: 400px; |
| | | } |
| | | height: 98%; |
| | | width: 98%; |
| | | padding: 0.5% 1%; |
| | | |
| | | /deep/.el-form-item__label { |
| | | color: white; |
| | | .cataLogContent { |
| | | width: 100%; |
| | | height: 92%; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | .left_Tree { |
| | | width: 15%; |
| | | //height: 91%; |
| | | height: 100%; |
| | | border-radius: 5px; |
| | | padding: 1%; |
| | | overflow-y: auto; |
| | | border-right: 1px solid #dcdfe6; |
| | | } |
| | | .right_menu { |
| | | width: 80%; |
| | | height: 91%; |
| | | border-radius: 5px; |
| | | padding: 1%; |
| | | overflow: auto; |
| | | .form_box { |
| | | box-sizing: border-box; |
| | | padding-top: 22px; |
| | | width: 100%; |
| | | .el-input { |
| | | width: 400px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .el-card-define { |
| | | height: 680px; |
| | | background: #303030; |
| | | border: 1px solid gray; |
| | | padding: 1px; |
| | | } |
| | | .card_tree { |
| | | display: block; |
| | | height: 650px; |
| | | overflow-y: auto; |
| | | // 更改指标树图标颜色 |
| | | /deep/ .el-tree .el-icon-caret-right:before { |
| | | color: white; /** 这里是要修改图标的颜色 **/ |
| | | } |
| | | /deep/ .el-tree { |
| | | color: white; /** 这里是要修改图标的颜色 **/ |
| | | background: transparent; |
| | | } |
| | | /deep/.el-tree-node__content { |
| | | &:hover { |
| | | background-color: rgba(255, 255, 255, 0.3) !important; |
| | | } |
| | | } |
| | | /deep/.el-tree-node.is-current > .el-tree-node__content { |
| | | background-color: rgba(255, 255, 255, 0.3) !important; |
| | | color: #409eff; |
| | | } |
| | | } |
| | | /deep/ .el-input__inner { |
| | | background-color: transparent !important; |
| | | border: 1px solid; |
| | | color: white; |
| | | } |
| | | /deep/ .el-dialog { |
| | | background: #303030; |
| | | } |
| | | /deep/.el-range-editor.is-active, |
| | | .el-range-editor.is-active:hover, |
| | | .el-select .el-input.is-focus .el-input__inner { |
| | | border: 1px solid; |
| | | } |
| | | /deep/.el-dialog__title { |
| | | color: white; |
| | | } |
| | | /deep/.el-form-item__label { |
| | | color: white; |
| | | } |
| | | .el-button-sure { |
| | | width: 116px; |
| | | height: 40px; |
| | | background: linear-gradient(180deg, #002992, #080472); |
| | | border: 1px solid #000000; |
| | | box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.21); |
| | | border-radius: 3px; |
| | | } |
| | | .el-button-remove { |
| | | width: 116px; |
| | | height: 40px; |
| | | background: linear-gradient(180deg, #002992, #080472); |
| | | border: 1px solid #000000; |
| | | box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.21); |
| | | opacity: 0.5; |
| | | border-radius: 3px; |
| | | } |
| | | /*里面的代码可以根据自己需求去进行更改*/ |
| | | /* 设置滚动条的样式 */ |
| | | ::-webkit-scrollbar { |
| | | width: 4px; |
| | | } |
| | | /* 滚动槽 */ |
| | | ::-webkit-scrollbar-track { |
| | | -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3); |
| | | border-radius: 10px; |
| | | } |
| | | /* 滚动条滑块 */ |
| | | ::-webkit-scrollbar-thumb { |
| | | border-radius: 10px; |
| | | background: #8b8b8b; |
| | | -webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5); |
| | | } |
| | | ::-webkit-scrollbar-thumb:window-inactive { |
| | | background: #8b8b8b; |
| | | height: 289px; |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less"> |
| | | .el-select-dropdown { |
| | | background: #303030; |
| | | border-color: white; |
| | | } |
| | | //右侧和下方的白边 |
| | | .el-scrollbar__wrap { |
| | | margin-bottom: -20px !important; |
| | | margin-right: -20px !important; |
| | | } |
| | | .el-select-dropdown__item.hover, |
| | | .el-select-dropdown__item:hover { |
| | | background: rgba(255, 255, 255, 0.3); |
| | | } |
| | | .el-select-dropdown__item { |
| | | color: white; |
| | | .btnBox{ |
| | | |
| | | position: absolute; |
| | | bottom: 0; |
| | | right: 0; |
| | | } |
| | | </style> |