|
@@ -4,14 +4,21 @@ import { h } from 'vue';
|
|
import { Tag } from 'ant-design-vue';
|
|
import { Tag } from 'ant-design-vue';
|
|
import { Icon } from '/@/components/Icon';
|
|
import { Icon } from '/@/components/Icon';
|
|
|
|
|
|
|
|
+// const label =[]
|
|
|
|
+
|
|
export const columns: BasicColumn[] = [
|
|
export const columns: BasicColumn[] = [
|
|
{
|
|
{
|
|
title: '菜单名称',
|
|
title: '菜单名称',
|
|
- dataIndex: 'menuName',
|
|
|
|
|
|
+ dataIndex: 'name',
|
|
width: 200,
|
|
width: 200,
|
|
align: 'left',
|
|
align: 'left',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
|
|
+ title: '上级菜单',
|
|
|
|
+ dataIndex: 'parentName',
|
|
|
|
+ width: 100,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
title: '图标',
|
|
title: '图标',
|
|
dataIndex: 'icon',
|
|
dataIndex: 'icon',
|
|
width: 50,
|
|
width: 50,
|
|
@@ -19,20 +26,29 @@ export const columns: BasicColumn[] = [
|
|
return h(Icon, { icon: record.icon });
|
|
return h(Icon, { icon: record.icon });
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+ // permission
|
|
{
|
|
{
|
|
title: '权限标识',
|
|
title: '权限标识',
|
|
- dataIndex: 'permission',
|
|
|
|
- width: 180,
|
|
|
|
|
|
+ dataIndex: 'perms',
|
|
|
|
+ width: 250,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '组件',
|
|
|
|
- dataIndex: 'component',
|
|
|
|
|
|
+ title: '类型',
|
|
|
|
+ dataIndex: 'type',
|
|
|
|
+ width: 100,
|
|
|
|
+ customRender: ({ record }) => {
|
|
|
|
+ const color = 'green';
|
|
|
|
+ const type = record.type;
|
|
|
|
+
|
|
|
|
+ return h(Tag, { color: color }, () => `目录${type}`);
|
|
|
|
+ },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '排序',
|
|
title: '排序',
|
|
- dataIndex: 'orderNo',
|
|
|
|
|
|
+ dataIndex: 'orderNum',
|
|
width: 50,
|
|
width: 50,
|
|
},
|
|
},
|
|
|
|
+
|
|
{
|
|
{
|
|
title: '状态',
|
|
title: '状态',
|
|
dataIndex: 'status',
|
|
dataIndex: 'status',
|
|
@@ -40,14 +56,14 @@ export const columns: BasicColumn[] = [
|
|
customRender: ({ record }) => {
|
|
customRender: ({ record }) => {
|
|
const status = record.status;
|
|
const status = record.status;
|
|
const enable = ~~status === 0;
|
|
const enable = ~~status === 0;
|
|
- const color = enable ? 'green' : 'red';
|
|
|
|
|
|
+ const color = enable ? 'warning' : 'red';
|
|
const text = enable ? '启用' : '停用';
|
|
const text = enable ? '启用' : '停用';
|
|
return h(Tag, { color: color }, () => text);
|
|
return h(Tag, { color: color }, () => text);
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '创建时间',
|
|
|
|
- dataIndex: 'createTime',
|
|
|
|
|
|
+ title: '菜单URL',
|
|
|
|
+ dataIndex: 'url',
|
|
width: 180,
|
|
width: 180,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
@@ -58,7 +74,7 @@ const isButton = (type: string) => type === '2';
|
|
|
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
export const searchFormSchema: FormSchema[] = [
|
|
{
|
|
{
|
|
- field: 'menuName',
|
|
|
|
|
|
+ field: 'name',
|
|
label: '菜单名称',
|
|
label: '菜单名称',
|
|
component: 'Input',
|
|
component: 'Input',
|
|
colProps: { span: 8 },
|
|
colProps: { span: 8 },
|
|
@@ -93,7 +109,7 @@ export const formSchema: FormSchema[] = [
|
|
colProps: { lg: 24, md: 24 },
|
|
colProps: { lg: 24, md: 24 },
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- field: 'menuName',
|
|
|
|
|
|
+ field: 'name',
|
|
label: '菜单名称',
|
|
label: '菜单名称',
|
|
component: 'Input',
|
|
component: 'Input',
|
|
required: true,
|
|
required: true,
|
|
@@ -105,7 +121,7 @@ export const formSchema: FormSchema[] = [
|
|
component: 'TreeSelect',
|
|
component: 'TreeSelect',
|
|
componentProps: {
|
|
componentProps: {
|
|
fieldNames: {
|
|
fieldNames: {
|
|
- label: 'menuName',
|
|
|
|
|
|
+ label: 'name',
|
|
key: 'id',
|
|
key: 'id',
|
|
value: 'id',
|
|
value: 'id',
|
|
},
|
|
},
|
|
@@ -114,7 +130,7 @@ export const formSchema: FormSchema[] = [
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
{
|
|
- field: 'orderNo',
|
|
|
|
|
|
+ field: 'orderNum',
|
|
label: '排序',
|
|
label: '排序',
|
|
component: 'InputNumber',
|
|
component: 'InputNumber',
|
|
required: true,
|
|
required: true,
|
|
@@ -128,7 +144,7 @@ export const formSchema: FormSchema[] = [
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
{
|
|
- field: 'routePath',
|
|
|
|
|
|
+ field: 'url',
|
|
label: '路由地址',
|
|
label: '路由地址',
|
|
component: 'Input',
|
|
component: 'Input',
|
|
required: true,
|
|
required: true,
|