| | |
| | | <template> |
| | | <BasicModal |
| | | width="800px" |
| | | :height="600" |
| | | width="1200px" |
| | | :height="700" |
| | | v-bind="$attrs" |
| | | @register="register" |
| | | :title="title" |
| | |
| | | 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, |
| | | }, |
| | | size: 'small', |
| | | useSearchForm: true, |
| | | showTableSetting: false, |
| | | scroll: { y: 550 }, |
| | | canResize: false, |
| | | rowKey: rowKey, |
| | | rowSelection: { |
| | | selectedRowKeys: checkedKeys, |
| | | |
| | | selectedRowKeys: checkedKeys.value, |
| | | type: 'checkbox', |
| | | // getCheckboxProps(record: Recordable) { |
| | | // // Demo: 第一行(id为0)的选择框禁用 |
| | |
| | | }, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | // actionColumn: { |
| | | // width: 80, |
| | | // title: '操作', |
| | | // dataIndex: 'action', |
| | | // slots: { customRender: 'action' }, |
| | | // fixed: 'right' //undefined, |
| | | // }, |
| | | }); |
| | | 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 }); |