1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
| <script lang="ts" setup>
| import { nextTick } from 'vue';
|
| import { BasicModal, useModalInner } from '@jnpf/ui/modal';
| import { BasicVxeTable, useVxeTable } from '@jnpf/ui/vxeTable';
|
| import { getActionList } from '#/api/permission/action';
| import { $t } from '#/locales';
|
| const emit = defineEmits(['register', 'change']);
| const [registerModal, { closeModal }] = useModalInner(init);
| const [registerTable, { getForm, getSelectRows, clearSelectedRowKeys }] = useVxeTable({
| api: getActionList,
| columns: [
| { title: '动作编码', dataIndex: 'enCode' },
| { title: '动作名称', dataIndex: 'fullName' },
| ],
| useSearchForm: true,
| formConfig: {
| baseColProps: { span: 8 },
| schemas: [
| {
| field: 'keyword',
| label: $t('common.keyword'),
| component: 'Input',
| componentProps: {
| placeholder: $t('common.enterKeyword'),
| submitOnPressEnter: true,
| },
| },
| ],
| },
| tableSetting: { size: false, setting: false },
| immediate: false,
| rowSelection: { type: 'checkbox' },
| });
| function init() {
| getForm().resetFields();
| nextTick(() => {
| clearSelectedRowKeys();
| });
| }
| function handleSubmit() {
| const selectedData = getSelectRows();
| emit('change', selectedData);
| closeModal();
| }
| </script>
| <template>
| <BasicModal v-bind="$attrs" @register="registerModal" title="选择动作" @ok="handleSubmit" :width="800" class="jnpf-list-modal">
| <BasicVxeTable @register="registerTable" class="jnpf-sub-table" />
| </BasicModal>
| </template>
|
|