u
This commit is contained in:
1 parent
7bd5f1dde9
commit
f3936cec61
70 files changed
+13074
-187
No files matched your search
@@ -197,13 +197,31 @@ const App = {
|
||||
// 注意必须是 ref:模板里 v-model:columns 要能回写,否则拖列宽无处落库(松手回弹)
|
||||
const tableColumns = ref([
|
||||
{ dataIndex: 'name', title: '名称', width: 180 },
|
||||
{ dataIndex: 'amount', title: '金额', width: 120, align: 'right' },
|
||||
{
|
||||
dataIndex: 'amount',
|
||||
title: '金额',
|
||||
width: 120,
|
||||
align: 'right',
|
||||
editor: {
|
||||
type: 'number',
|
||||
// 金额必须 > 0:让「校验态全表可见」在 E2E 里有可断言的 error 数据
|
||||
validate: (v: unknown) => Number(v) > 0 || '金额必须大于 0',
|
||||
},
|
||||
},
|
||||
{ dataIndex: 'status', title: '状态', width: 110, editor: { type: 'select', options: [
|
||||
{ label: '启用', value: 1 },
|
||||
{ label: '停用', value: 0 },
|
||||
] } },
|
||||
{ dataIndex: 'enabled', title: '启用', width: 80, editor: { type: 'checkbox' } },
|
||||
{ dataIndex: 'remark', title: '备注', editor: { type: 'text' } },
|
||||
{
|
||||
dataIndex: 'remark',
|
||||
title: '备注',
|
||||
editor: {
|
||||
type: 'text',
|
||||
// 备注非空:提供 warning 级校验(金额是 error,这里是 warning,两级都有样例)
|
||||
validateWarning: (v: unknown) => String(v ?? '').length > 0 || '建议填写备注',
|
||||
},
|
||||
},
|
||||
{ dataIndex: 'op', title: '操作', width: 140, resizable: false, actions: [
|
||||
{ label: '编辑', onClick: () => {} },
|
||||
{ label: '删除', type: 'danger', confirm: '确认删除该行?', onClick: () => {} },
|
||||
@@ -211,7 +229,7 @@ const App = {
|
||||
])
|
||||
const tableData = ref([
|
||||
{ id: 1, name: '合同 A', amount: 12000, status: 1, enabled: 1, remark: '已归档' },
|
||||
{ id: 2, name: '合同 B', amount: 8600, status: 0, enabled: 0, remark: '' },
|
||||
{ id: 2, name: '合同 B', amount: 0, status: 0, enabled: 0, remark: '' },
|
||||
{ id: 3, name: '合同 C', amount: 43000, status: 1, enabled: 1, remark: '待复核' },
|
||||
])
|
||||
const tableSelectedKeys = ref([])
|
||||
|
||||
Reference in new issue
Block a user