You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
192 lines
3.7 KiB
192 lines
3.7 KiB
1 year ago
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||
|
import { dateFormatter } from '@/utils/formatTime'
|
||
|
const { t } = useI18n() // 国际化
|
||
|
|
||
|
/**
|
||
|
* @returns {Array} 货币转换
|
||
|
*/
|
||
|
export const Currencyexchange = useCrudSchemas(reactive<CrudSchema[]>([
|
||
|
{
|
||
|
label: '货币',
|
||
|
field: 'currency',
|
||
|
dictType: DICT_TYPE.CURRENCY,
|
||
|
dictClass: 'string',
|
||
|
isSearch: true,
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150,
|
||
|
fixed: 'left'
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '基础货币',
|
||
|
field: 'basiccurrency',
|
||
|
dictType: DICT_TYPE.BASIC_CURRENCY,
|
||
|
dictClass: 'string',
|
||
|
isSearch: true,
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '比率',
|
||
|
field: 'rate',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'InputNumber',
|
||
|
componentProps: {
|
||
|
min: 0,
|
||
|
precision:6
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '是否可用',
|
||
|
field: 'available',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isSearch: true,
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '生效时间',
|
||
|
field: 'activeTime',
|
||
|
isTable: true,
|
||
|
formatter: dateFormatter,
|
||
|
detail: {
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
||
|
},
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 180
|
||
|
},
|
||
|
form: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
style: {width:'100%'},
|
||
|
type: 'datetime',
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'x',
|
||
|
}
|
||
|
},
|
||
|
isSearch: true,
|
||
|
search: {
|
||
|
show: true,
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
type: 'daterange',
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '失效时间',
|
||
|
field: 'expireTime',
|
||
|
isTable: true,
|
||
|
formatter: dateFormatter,
|
||
|
detail: {
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
||
|
},
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 180
|
||
|
},
|
||
|
form: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
style: {width:'100%'},
|
||
|
type: 'datetime',
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'x',
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '创建时间',
|
||
|
field: 'createTime',
|
||
|
formatter: dateFormatter,
|
||
|
detail: {
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
||
|
},
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 180
|
||
|
},
|
||
|
form: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
style: {width:'100%'},
|
||
|
type: 'datetime',
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'x',
|
||
|
}
|
||
|
},
|
||
|
isForm: false,
|
||
|
isTable: false,
|
||
|
},
|
||
|
{
|
||
|
label: '备注',
|
||
|
field: 'remark',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '创建者',
|
||
|
field: 'creator',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
isForm: false,
|
||
|
isTable: false,
|
||
|
},
|
||
|
{
|
||
|
label: '操作',
|
||
|
field: 'action',
|
||
|
isDetail: false,
|
||
|
isForm: false ,
|
||
|
table: {
|
||
|
width: 150,
|
||
|
fixed: 'right'
|
||
|
}
|
||
|
}
|
||
|
]))
|
||
|
|
||
|
//表单校验
|
||
|
export const CurrencyexchangeRules = reactive({
|
||
|
currency: [
|
||
|
{ required: true, message: '请选择货币', trigger: 'change' }
|
||
|
],
|
||
|
basiccurrency: [
|
||
|
{ required: true, message: '请选择基础货币', trigger: 'change' }
|
||
|
],
|
||
|
rate: [
|
||
|
{ required: true, message: '请输入比率', trigger: 'blur' }
|
||
|
],
|
||
|
available: [
|
||
|
{ required: true, message: '请选择是否可用', trigger: 'change' }
|
||
|
],
|
||
|
remark: [
|
||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
|
||
|
],
|
||
|
})
|