2022-07-06 18:32:05 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
|
<!--工具栏-->
|
|
|
|
|
|
<div class="head-container">
|
|
|
|
|
|
<div v-if="crud.props.searchToggle">
|
|
|
|
|
|
<!-- 搜索 -->
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="query.blurry"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
placeholder="模糊搜索"
|
|
|
|
|
|
style="width: 200px;margin-bottom: 10px"
|
|
|
|
|
|
class="filter-item"
|
|
|
|
|
|
@keyup.enter.native="queryBlurry"
|
|
|
|
|
|
/>
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
v-model="query.systemType"
|
|
|
|
|
|
style="width: 100px; height: 35px;top: -5px;"
|
|
|
|
|
|
placeholder="所属系统"
|
|
|
|
|
|
@change="changetype"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
v-for="item in dict.system_type"
|
|
|
|
|
|
:label="item.label"
|
|
|
|
|
|
:value="item.value"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-select>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<rrOperation />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<crudOperation :permission="permission" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<!--表单渲染-->
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-dialog
|
|
|
|
|
|
append-to-body
|
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
|
:before-close="crud.cancelCU"
|
|
|
|
|
|
:visible.sync="crud.status.cu > 0"
|
|
|
|
|
|
:title="crud.status.title"
|
|
|
|
|
|
width="650px"
|
|
|
|
|
|
>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="mini" label-width="80px">
|
|
|
|
|
|
<el-form-item label="菜单类型" prop="type">
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-radio-group v-model="form.type" size="mini">
|
|
|
|
|
|
<el-radio-button label="1">系统</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="2">目录</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="3">菜单</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="4">按钮</el-radio-button>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
</el-form-item>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-form-item v-show="form.type.toString() !== '1' && form.type.toString() !== '4' " label="菜单图标" prop="icon">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<el-popover
|
|
|
|
|
|
placement="bottom-start"
|
|
|
|
|
|
width="450"
|
|
|
|
|
|
trigger="click"
|
|
|
|
|
|
@show="$refs['iconSelect'].reset()"
|
|
|
|
|
|
>
|
|
|
|
|
|
<IconSelect ref="iconSelect" @selected="selected" />
|
|
|
|
|
|
<el-input slot="reference" v-model="form.icon" style="width: 450px;" placeholder="点击选择图标" readonly>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<svg-icon
|
|
|
|
|
|
v-if="form.icon"
|
|
|
|
|
|
slot="prefix"
|
|
|
|
|
|
:icon-class="form.icon"
|
|
|
|
|
|
class="el-input__icon"
|
|
|
|
|
|
style="height: 32px;width: 16px;"
|
|
|
|
|
|
/>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<i v-else slot="prefix" class="el-icon-search el-input__icon" />
|
|
|
|
|
|
</el-input>
|
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
</el-form-item>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1'" label="外链菜单" prop="iframe">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<el-radio-group v-model="form.iframe" size="mini">
|
|
|
|
|
|
<el-radio-button label="true">是</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="false">否</el-radio-button>
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
</el-form-item>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-form-item v-show="form.type.toString() === '2'" label="菜单缓存" prop="cache">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<el-radio-group v-model="form.cache" size="mini">
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-radio-button label="1">是</el-radio-button>
|
|
|
|
|
|
<el-radio-button label="0">否</el-radio-button>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
</el-form-item>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-form-item v-show="form.type.toString() !== '2' && form.type.toString() !== '1' " label="菜单可见" prop="hidden">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<el-radio-group v-model="form.hidden" size="mini">
|
2023-01-04 18:11:52 +08:00
|
|
|
|
<el-radio-button label=true>是</el-radio-button>
|
|
|
|
|
|
<el-radio-button label=false>否</el-radio-button>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item v-if="form.type.toString() !== '2'" label="菜单标题" prop="title">
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-input
|
|
|
|
|
|
v-model="form.title"
|
|
|
|
|
|
:style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 190px'"
|
|
|
|
|
|
placeholder="菜单标题"
|
|
|
|
|
|
/>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item v-if="form.type.toString() === '2'" label="按钮名称" prop="title">
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-input v-model="form.title" placeholder="按钮名称" style="width: 190px;" />
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-form-item>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-form-item v-show="form.type.toString() !== '1' " label="权限标识" prop="permission">
|
|
|
|
|
|
<el-input v-model="form.permission" :disabled="form.iframe" placeholder="权限标识" style="width: 190px;" />
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-form-item>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-form-item v-if="form.type.toString() !== '1' && form.type.toString() !== '2'" label="路由地址" prop="path">
|
|
|
|
|
|
<el-input v-model="form.path" placeholder="路由地址" style="width: 190px;" />
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="菜单排序" prop="menuSort">
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-input-number
|
|
|
|
|
|
v-model.number="form.menuSort"
|
|
|
|
|
|
:min="0"
|
|
|
|
|
|
:max="999"
|
|
|
|
|
|
controls-position="right"
|
|
|
|
|
|
style="width: 190px;"
|
|
|
|
|
|
/>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-form-item>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-form-item v-show="!form.iframe && form.type.toString() === '3' " label="组件名称" prop="componentName">
|
|
|
|
|
|
<el-input v-model="form.componentName" style="width: 190px;" placeholder="匹配组件内Name字段" />
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-form-item>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-form-item v-show="!form.iframe && (form.type.toString() === '2' ||form.type.toString() === '3' ) " label="组件路径" prop="component">
|
|
|
|
|
|
<el-input v-model="form.component" style="width: 190px;" placeholder="组件路径" />
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="上级类目" prop="pid">
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<!-- normalizer转换- loadMenus 点击扩展的时候会调用该方法-->
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<treeselect
|
|
|
|
|
|
v-model="form.pid"
|
|
|
|
|
|
:options="menus"
|
|
|
|
|
|
:load-options="loadMenus"
|
2022-12-29 15:04:15 +08:00
|
|
|
|
:normalizer="normalizer"
|
2022-07-06 18:32:05 +08:00
|
|
|
|
style="width: 450px;"
|
|
|
|
|
|
placeholder="选择上级类目"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
|
|
|
|
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
<!--表格渲染-->
|
|
|
|
|
|
<el-table
|
|
|
|
|
|
ref="table"
|
|
|
|
|
|
v-loading="crud.loading"
|
|
|
|
|
|
lazy
|
|
|
|
|
|
:load="getMenus"
|
2022-12-29 15:04:15 +08:00
|
|
|
|
:auto-load-root-options="false"
|
2022-07-06 18:32:05 +08:00
|
|
|
|
:data="crud.data"
|
|
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
2022-12-29 15:04:15 +08:00
|
|
|
|
row-key="menuId"
|
|
|
|
|
|
|
2022-07-06 18:32:05 +08:00
|
|
|
|
@select="crud.selectChange"
|
|
|
|
|
|
@select-all="crud.selectAllChange"
|
|
|
|
|
|
@selection-change="crud.selectionChangeHandler"
|
|
|
|
|
|
>
|
|
|
|
|
|
<el-table-column type="selection" width="55" />
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-table-column label="菜单标题" prop="title" :min-width="100" />
|
|
|
|
|
|
<el-table-column label="所属系统" prop="systemType" :min-width="flexWidth('systemType',crud.data,'所属系统')">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
{{ dict.label.system_type[scope.row.systemType] }} : {{scope.row.systemType}}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="icon" label="图标" align="center" :min-width="flexWidth('icon',crud.data,'图标')">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<svg-icon :icon-class="scope.row.icon ? scope.row.icon : ''" />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-table-column prop="menuSort" align="center" label="排序" :min-width="flexWidth('menuSort',crud.data,'排序')">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
{{ scope.row.menuSort }}
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-table-column prop="permission" label="权限标识" :min-width="flexWidth('permission',crud.data,'权限标识')" />
|
|
|
|
|
|
<el-table-column prop="component" label="组件路径" min-width="120" />
|
|
|
|
|
|
<el-table-column prop="iframe" label="外链" :formatter="crud.formatIsOrNot" :min-width="flexWidth('iframe',crud.data,'外链')">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<span v-if="scope.row.iframe">是</span>
|
|
|
|
|
|
<span v-else>否</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-table-column prop="cache" label="缓存" :formatter="crud.formatIsOrNot" :min-width="flexWidth('cache',crud.data,'缓存')">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<span v-if="scope.row.cache">是</span>
|
|
|
|
|
|
<span v-else>否</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-table-column prop="hidden" label="可见" :formatter="crud.formatIsOrNot" :min-width="flexWidth('hidden',crud.data,'可见')">
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<span v-if="scope.row.hidden">否</span>
|
|
|
|
|
|
<span v-else>是</span>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
<el-table-column prop="createTime" label="创建日期" :min-width="flexWidth('createTime',crud.data,'创建日期')" />
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
v-permission="['admin','menu:edit','menu:del']"
|
|
|
|
|
|
label="操作"
|
|
|
|
|
|
width="130px"
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
fixed="right"
|
|
|
|
|
|
>
|
2022-07-06 18:32:05 +08:00
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<udOperation
|
|
|
|
|
|
:data="scope.row"
|
|
|
|
|
|
:permission="permission"
|
|
|
|
|
|
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
|
|
|
|
|
|
/>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
import crudMenu from '@/views/system/menu/menu'
|
2022-07-06 18:32:05 +08:00
|
|
|
|
import IconSelect from '@/components/IconSelect'
|
|
|
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
|
import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
|
|
|
|
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
|
|
|
|
|
import rrOperation from '@crud/RR.operation'
|
|
|
|
|
|
import crudOperation from '@crud/CRUD.operation'
|
|
|
|
|
|
import udOperation from '@crud/UD.operation'
|
|
|
|
|
|
import DateRangePicker from '@/components/DateRangePicker'
|
2022-12-29 15:04:15 +08:00
|
|
|
|
import Dict from '../../../components/Dict/Dict'
|
2022-07-06 18:32:05 +08:00
|
|
|
|
|
|
|
|
|
|
// crud交由presenter持有
|
2022-12-29 15:04:15 +08:00
|
|
|
|
const defaultForm = {
|
|
|
|
|
|
menuId: null,
|
|
|
|
|
|
title: null,
|
|
|
|
|
|
menuSort: 999,
|
|
|
|
|
|
path: null,
|
|
|
|
|
|
systemType: null,
|
|
|
|
|
|
category: null,
|
|
|
|
|
|
component: null,
|
|
|
|
|
|
componentName: null,
|
|
|
|
|
|
iframe: false,
|
|
|
|
|
|
roles: [],
|
|
|
|
|
|
pid: 0,
|
|
|
|
|
|
icon: null,
|
|
|
|
|
|
cache: 0,
|
|
|
|
|
|
hidden: 0,
|
|
|
|
|
|
type: 0,
|
|
|
|
|
|
permission: null
|
|
|
|
|
|
}
|
2022-07-06 18:32:05 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'Menu',
|
|
|
|
|
|
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation, DateRangePicker },
|
|
|
|
|
|
cruds() {
|
2022-12-29 15:04:15 +08:00
|
|
|
|
return CRUD({ title: '菜单', idField: 'menuId', url: 'api/sysMenu', crudMethod: { ...crudMenu }})
|
2022-07-06 18:32:05 +08:00
|
|
|
|
},
|
|
|
|
|
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
2022-12-29 15:04:15 +08:00
|
|
|
|
dicts: ['system_type'],
|
2022-07-06 18:32:05 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2022-12-29 15:04:15 +08:00
|
|
|
|
typeList: [],
|
|
|
|
|
|
defaultType: '',
|
2022-07-06 18:32:05 +08:00
|
|
|
|
menus: [],
|
|
|
|
|
|
permission: {
|
|
|
|
|
|
add: ['admin', 'menu:add'],
|
|
|
|
|
|
edit: ['admin', 'menu:edit'],
|
|
|
|
|
|
del: ['admin', 'menu:del']
|
|
|
|
|
|
},
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
title: [
|
|
|
|
|
|
{ required: true, message: '请输入标题', trigger: 'blur' }
|
|
|
|
|
|
],
|
|
|
|
|
|
path: [
|
|
|
|
|
|
{ required: true, message: '请输入地址', trigger: 'blur' }
|
|
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2022-12-29 15:04:15 +08:00
|
|
|
|
normalizer(node) {
|
|
|
|
|
|
return {
|
|
|
|
|
|
id: node.menuId,
|
|
|
|
|
|
label: node.title,
|
|
|
|
|
|
children: node.children
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
queryBlurry() {
|
|
|
|
|
|
if (this.query.blurry) {
|
|
|
|
|
|
this.query.pid = null
|
|
|
|
|
|
}
|
|
|
|
|
|
this.crud.toQuery()
|
|
|
|
|
|
},
|
|
|
|
|
|
changetype() {
|
|
|
|
|
|
const sysType = this.dict.dict.system_type[this.query.systemType]
|
|
|
|
|
|
this.query.pid = sysType.para1
|
|
|
|
|
|
this.crud.toQuery()
|
|
|
|
|
|
},
|
|
|
|
|
|
[CRUD.HOOK.beforeRefresh]() {
|
|
|
|
|
|
// if (this.crud.query.system_type == null) {
|
|
|
|
|
|
// this.crud.query.system_type = '1'
|
|
|
|
|
|
// }
|
|
|
|
|
|
return true
|
|
|
|
|
|
},
|
2022-07-06 18:32:05 +08:00
|
|
|
|
// 新增与编辑前做的操作
|
|
|
|
|
|
[CRUD.HOOK.afterToCU](crud, form) {
|
2022-12-29 15:04:15 +08:00
|
|
|
|
console.log(this.dict)
|
2022-07-06 18:32:05 +08:00
|
|
|
|
this.menus = []
|
2022-12-29 15:04:15 +08:00
|
|
|
|
if (form.menuId) { // 修改
|
|
|
|
|
|
if (!form.pid) { // 一级菜单,一级的父级菜单的pid为0.
|
2022-07-06 18:32:05 +08:00
|
|
|
|
form.pid = 0
|
|
|
|
|
|
}
|
2022-12-29 15:04:15 +08:00
|
|
|
|
this.getSupMenus(form.menuId)
|
|
|
|
|
|
} else { // 新增
|
|
|
|
|
|
this.menus.push({ menuId: 0, title: '顶级类目', children: null })
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
[CRUD.HOOK.afterSubmit](crud, form) {
|
|
|
|
|
|
if (this.$options.dicts instanceof Array) {
|
|
|
|
|
|
new Dict(this.dict).init(this.$options.dicts, () => {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$emit('dictReady')
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
[CRUD.HOOK.afterDelete](crud, form) {
|
|
|
|
|
|
if (this.$options.dicts instanceof Array) {
|
|
|
|
|
|
new Dict(this.dict).init(this.$options.dicts, () => {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.$emit('dictReady')
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
2022-07-06 18:32:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
getMenus(tree, treeNode, resolve) {
|
2022-12-29 15:04:15 +08:00
|
|
|
|
const params = { pid: tree.menuId, systemType: tree.systemType }
|
2022-07-06 18:32:05 +08:00
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
crudMenu.getMenus(params).then(res => {
|
|
|
|
|
|
resolve(res.content)
|
|
|
|
|
|
})
|
|
|
|
|
|
}, 100)
|
|
|
|
|
|
},
|
2022-12-29 15:04:15 +08:00
|
|
|
|
getSupMenus(menuId) {
|
|
|
|
|
|
crudMenu.getMenuSuperior(menuId).then(res => {
|
2022-07-06 18:32:05 +08:00
|
|
|
|
const children = res.map(function(obj) {
|
|
|
|
|
|
if (!obj.leaf && !obj.children) {
|
|
|
|
|
|
obj.children = null
|
|
|
|
|
|
}
|
|
|
|
|
|
return obj
|
|
|
|
|
|
})
|
2022-12-29 15:04:15 +08:00
|
|
|
|
this.menus = [{ menuId: 0, title: '顶级类目', children: children }]
|
2022-07-06 18:32:05 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
loadMenus({ action, parentNode, callback }) {
|
|
|
|
|
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
2022-12-29 15:04:15 +08:00
|
|
|
|
crudMenu.getMenusTree(parentNode.menuId).then(res => {
|
2022-07-06 18:32:05 +08:00
|
|
|
|
parentNode.children = res.map(function(obj) {
|
|
|
|
|
|
if (!obj.leaf) {
|
|
|
|
|
|
obj.children = null
|
|
|
|
|
|
}
|
|
|
|
|
|
return obj
|
|
|
|
|
|
})
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
callback()
|
|
|
|
|
|
}, 100)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 选中图标
|
|
|
|
|
|
selected(name) {
|
|
|
|
|
|
this.form.icon = name
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
2022-12-29 15:04:15 +08:00
|
|
|
|
::v-deep .el-input-number .el-input__inner {
|
|
|
|
|
|
text-align: left;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
::v-deep .vue-treeselect__control, ::v-deep .vue-treeselect__placeholder, ::v-deep .vue-treeselect__single-value {
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
|
}
|
2022-07-06 18:32:05 +08:00
|
|
|
|
</style>
|