| | |
| | | const rowKey = ref(''); |
| | | const returnFieldName = ref(''); |
| | | const schemas = ref([] as FormSchema[]); |
| | | const which = ref(''); |
| | | |
| | | //列表 |
| | | const ItemColumns = ref([] as BasicColumn[]); |
| | |
| | | const emit = defineEmits(['success', 'register']); |
| | | const checkedKeys = ref<Array<string | number>>([]); |
| | | const checkedIds = ref<Array<string | number>>([]); |
| | | const [registerTable, { reload, getForm }] = useTable({ |
| | | const [registerTable, { reload, getForm, setProps }] = useTable({ |
| | | title: '列表信息', |
| | | api: getListByPage, |
| | | searchInfo: searchInfo, |
| | | columns: ItemColumns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas, |
| | | schemas: schemas.value, |
| | | }, |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | rowKey: rowKey, |
| | | rowSelection: { |
| | | selectedRowKeys: checkedKeys, |
| | | |
| | | selectedRowKeys: checkedKeys.value, |
| | | type: 'checkbox', |
| | | // getCheckboxProps(record: Recordable) { |
| | | // // Demo: 第一行(id为0)的选择框禁用 |
| | |
| | | }); |
| | | const [register, { setModalProps, closeModal }] = useModalInner((data) => { |
| | | setModalProps({ confirmLoading: false }); |
| | | setProps({ |
| | | dataSource: [], |
| | | }); |
| | | data && onDataReceive(data); |
| | | }); |
| | | |
| | |
| | | rowKey.value = data?.rowKey; |
| | | returnFieldName.value = data?.returnFieldName; |
| | | checkedKeys.value = []; |
| | | which.value = data?.which; |
| | | getForm().resetFields(); |
| | | reload(); |
| | | // reload(); |
| | | } |
| | | |
| | | // function handleVisibleChange(v) { |
| | |
| | | isUpdate: unref(false), |
| | | values: { val: record[rowKey.value], id: record['ID'] }, |
| | | returnFieldName: returnFieldName.value, |
| | | which: which.value, |
| | | }); |
| | | } finally { |
| | | setModalProps({ confirmLoading: false }); |
| | |
| | | isUpdate: unref(false), |
| | | values: { val: values, id: ids }, |
| | | returnFieldName: returnFieldName.value, |
| | | which: which.value, |
| | | }); |
| | | } finally { |
| | | setModalProps({ confirmLoading: false }); |