|
|
@ -1,40 +1,62 @@ |
|
|
|
import { BasicColumn } from '/@/components/Table'; |
|
|
|
import { BasicColumn } from '/@/components/Table'; |
|
|
|
import { FormSchema } from '/@/components/Table'; |
|
|
|
import { FormSchema } from '/@/components/Table'; |
|
|
|
|
|
|
|
import {h} from 'vue'; |
|
|
|
|
|
|
|
import {Tag} from 'ant-design-vue'; |
|
|
|
|
|
|
|
|
|
|
|
export const columns: BasicColumn[] = [ |
|
|
|
export const columns: BasicColumn[] = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '标签', |
|
|
|
title: '模板名称', |
|
|
|
dataIndex: 'label', |
|
|
|
dataIndex: 'name', |
|
|
|
width: 100 |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '值', |
|
|
|
title: '模板分类', |
|
|
|
dataIndex: 'value', |
|
|
|
dataIndex: 'type', |
|
|
|
width: 100 |
|
|
|
width: 100, |
|
|
|
|
|
|
|
customRender: ({record}) => { |
|
|
|
|
|
|
|
const type = record.type; |
|
|
|
|
|
|
|
// 采用二进制~~取反,只要为null或者0等等一些其他的空元素都会转为0
|
|
|
|
|
|
|
|
// 第一次取反会运算为-1,在后一次取反会运算为0
|
|
|
|
|
|
|
|
const enable = ~~type === 1; |
|
|
|
|
|
|
|
const color = enable ? 'green' : 'warning'; |
|
|
|
|
|
|
|
const text = enable ? '单表' : '主附表'; |
|
|
|
|
|
|
|
return h(Tag, { color: color }, () => text); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
title: '排序', |
|
|
|
title: '是否系统模板', |
|
|
|
dataIndex: 'sort', |
|
|
|
dataIndex: 'isSystem', |
|
|
|
width: 130 |
|
|
|
width: 80, |
|
|
|
|
|
|
|
customRender: ({ record }) => { |
|
|
|
|
|
|
|
const isSystem = record.isSystem; |
|
|
|
|
|
|
|
// 采用二进制~~取反,只要为null或者0等等一些其他的空元素都会转为0
|
|
|
|
|
|
|
|
// 第一次取反会运算为-1,在后一次取反会运算为0
|
|
|
|
|
|
|
|
const enable = ~~isSystem === 1; |
|
|
|
|
|
|
|
const color = enable ? 'green' : 'warning'; |
|
|
|
|
|
|
|
const text = enable ? '系统内置' : '非系统内置'; |
|
|
|
|
|
|
|
return h(Tag, { color: color }, () => text); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
export const searchFormSchema: FormSchema[] = [ |
|
|
|
export const searchFormSchema: FormSchema[] = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
field: 'label', |
|
|
|
field: 'name', |
|
|
|
label: '标签', |
|
|
|
label: '模板名称', |
|
|
|
component: 'Input', |
|
|
|
component: 'Input', |
|
|
|
componentProps: { |
|
|
|
componentProps: { |
|
|
|
placeholder: '请输入标签', |
|
|
|
placeholder: '请输入模板名称', |
|
|
|
}, |
|
|
|
}, |
|
|
|
colProps: { span: 6 } |
|
|
|
colProps: { span: 6 } |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
field: 'value', |
|
|
|
field: 'type', |
|
|
|
label: '值', |
|
|
|
label: '模版分类', |
|
|
|
component: 'Input', |
|
|
|
component: 'Select', |
|
|
|
componentProps: { |
|
|
|
componentProps: { |
|
|
|
placeholder: '请输入值', |
|
|
|
options: [ |
|
|
|
|
|
|
|
{ label: '单表',value: '1' }, |
|
|
|
|
|
|
|
{ label: '主附表',value: '2' } |
|
|
|
|
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
colProps: { span: 6 } |
|
|
|
colProps: { span: 6 } |
|
|
|
} |
|
|
|
} |
|
|
@ -48,25 +70,36 @@ export const formSchema: FormSchema[] = [ |
|
|
|
show: false |
|
|
|
show: false |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
field: 'label', |
|
|
|
field: 'name', |
|
|
|
label: '标签', |
|
|
|
label: '模板名称', |
|
|
|
component: 'Input', |
|
|
|
component: 'Input', |
|
|
|
required: true |
|
|
|
required: true, |
|
|
|
|
|
|
|
colProps: { span: 12 }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
field: 'value', |
|
|
|
field: 'type', |
|
|
|
label: '值', |
|
|
|
label: '模板分类', |
|
|
|
component: 'Input', |
|
|
|
component: 'Select', |
|
|
|
required: true |
|
|
|
required: true, |
|
|
|
|
|
|
|
componentProps: { |
|
|
|
|
|
|
|
options: [ |
|
|
|
|
|
|
|
{ label: '单表',value: '1' }, |
|
|
|
|
|
|
|
{ label: '主附表',value: '2' } |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
colProps: { span: 12 }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
field: 'sort', |
|
|
|
field: 'isSystem', |
|
|
|
label: '排序', |
|
|
|
label: '是否系统模板', |
|
|
|
component: 'InputNumber', |
|
|
|
component: 'Select', |
|
|
|
|
|
|
|
required: true, |
|
|
|
componentProps: { |
|
|
|
componentProps: { |
|
|
|
style: { width:'100%' }, |
|
|
|
options: [ |
|
|
|
min: 0 |
|
|
|
{ label: '系统内置',value: '1' }, |
|
|
|
|
|
|
|
{ label: '非系统内置',value: '0' } |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
colProps: { span: 12 }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
required: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
]; |
|
|
|
]; |
|
|
|