mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-11 13:02:49 +00:00
优化
This commit is contained in:
parent
d31c65d4cb
commit
1cfac24175
@ -1,5 +1,5 @@
|
||||
import { defineComponent, h, nextTick, toRef, watch } from "vue";
|
||||
import { cloneDeep, isBoolean } from "lodash-es";
|
||||
import { cloneDeep, get, isBoolean } from "lodash-es";
|
||||
import { useAction, useForm, usePlugins, useTabs } from "./helper";
|
||||
import { useBrowser, useConfig, useElApi, useRefs } from "../../hooks";
|
||||
import { getValue, merge } from "../../utils";
|
||||
@ -170,7 +170,7 @@ export default defineComponent({
|
||||
if (e.hook) {
|
||||
formHook.submit({
|
||||
...e,
|
||||
value: e.prop ? d[e.prop] : undefined,
|
||||
value: e.prop ? get(d, e.prop) : undefined,
|
||||
form: d
|
||||
});
|
||||
}
|
||||
@ -283,7 +283,7 @@ export default defineComponent({
|
||||
// hook 绑定值
|
||||
formHook.bind({
|
||||
...e,
|
||||
value: form[e.prop] !== undefined ? form[e.prop] : cloneDeep(e.value),
|
||||
value: get(form, e.prop) !== undefined ? get(form, e.prop) : cloneDeep(e.value),
|
||||
form
|
||||
});
|
||||
|
||||
|
||||
6925
pnpm-lock.yaml
generated
6925
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -115,6 +115,7 @@ import MenuImp from './components/imp.vue';
|
||||
import MenuExp from './components/exp.vue';
|
||||
import AutoMenu from '/$/helper/components/auto-menu/index.vue';
|
||||
import AutoPerms from '/$/helper/components/auto-perms/index.vue';
|
||||
import { reactive } from 'vue';
|
||||
|
||||
interface Item extends Eps.BaseSysMenuEntity {
|
||||
children?: Item[];
|
||||
@ -125,6 +126,26 @@ interface Item extends Eps.BaseSysMenuEntity {
|
||||
const { service, mitt } = useCool();
|
||||
const { menu } = useStore();
|
||||
|
||||
const options = reactive({
|
||||
type: [
|
||||
{
|
||||
label: '目录',
|
||||
value: 0,
|
||||
type: 'warning'
|
||||
},
|
||||
{
|
||||
label: '菜单',
|
||||
value: 1,
|
||||
type: 'success'
|
||||
},
|
||||
{
|
||||
label: '权限',
|
||||
value: 2,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// cl-table
|
||||
const Table = useTable({
|
||||
contextMenu: [
|
||||
@ -176,23 +197,7 @@ const Table = useTable({
|
||||
prop: 'type',
|
||||
label: '类型',
|
||||
width: 100,
|
||||
dict: [
|
||||
{
|
||||
label: '目录',
|
||||
value: 0,
|
||||
type: 'warning'
|
||||
},
|
||||
{
|
||||
label: '菜单',
|
||||
value: 1,
|
||||
type: 'success'
|
||||
},
|
||||
{
|
||||
label: '权限',
|
||||
value: 2,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
dict: options.type
|
||||
},
|
||||
{
|
||||
prop: 'router',
|
||||
@ -251,20 +256,7 @@ const Upsert = useUpsert({
|
||||
required: true,
|
||||
component: {
|
||||
name: 'el-radio-group',
|
||||
options: [
|
||||
{
|
||||
label: '目录',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '菜单',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '权限',
|
||||
value: 2
|
||||
}
|
||||
]
|
||||
options: options.type
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@ -266,11 +266,11 @@ const Upsert = useUpsert({
|
||||
name: 'el-radio-group',
|
||||
options: [
|
||||
{
|
||||
label: '开启',
|
||||
label: '启用',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '关闭',
|
||||
label: '禁用',
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
|
||||
@ -57,7 +57,21 @@
|
||||
<template #default="{ data }">
|
||||
<div class="item">
|
||||
<component :is="data.icon" v-if="data.icon" />
|
||||
<span>{{ data[tree.props.label] }}</span>
|
||||
|
||||
<slot
|
||||
name="item-name"
|
||||
:item="data"
|
||||
:selected="selected"
|
||||
>
|
||||
<el-text truncated>
|
||||
{{ data[tree.props.label] }}
|
||||
{{
|
||||
isEmpty(data[tree.props.children])
|
||||
? ``
|
||||
: `(${data[tree.props.children]?.length})`
|
||||
}}
|
||||
</el-text>
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
@ -551,7 +565,8 @@ defineExpose({
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user