ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<script lang="ts" setup>
import type { BasicColumn } from '@jnpf/ui/vxeTable';
 
import { computed, reactive, toRefs } from 'vue';
 
import { BasicModal, useModalInner } from '@jnpf/ui/modal';
import { BasicVxeTable, useVxeTable } from '@jnpf/ui/vxeTable';
 
import { getHandleNum } from '#/api/system/sysConfig';
import { $t } from '#/locales';
 
interface State {
  title: string;
  resultType: number;
  synType: number;
}
 
const props = defineProps({
  type: {
    // 1-企业微信 2-钉钉
    default: 1,
    type: Number,
  },
});
 
const state = reactive<State>({
  title: '',
  resultType: 0,
  synType: 0,
});
const { title } = toRefs(state);
const [registerModal] = useModalInner(init);
const columns: BasicColumn[] = [
  { title: '本系统对象名称', dataIndex: 'systemObjectName', width: 200, align: 'center' },
  { title: '第三方系统对象名称', dataIndex: 'thirdName', width: 200, align: 'center' },
  { title: '异常描述', dataIndex: 'description', minWidth: 200 },
];
 
const [registerTable, { getForm }] = useVxeTable({
  api: getHandleNum,
  columns,
  useSearchForm: true,
  formConfig: {
    baseColProps: { span: 8 },
    schemas: [
      {
        field: 'keyword',
        label: $t('common.keyword'),
        component: 'Input',
        componentProps: {
          placeholder: $t('common.enterKeyword'),
          submitOnPressEnter: true,
        },
      },
    ],
  },
  immediate: false,
  showTableSetting: false,
});
 
const getSearchInfo = computed(() => ({ thirdType: props.type || 1, resultType: state.resultType, type: state.synType }));
function init(data) {
  state.synType = data.synType;
  state.resultType = data.resultType;
  state.title = data.resultType == 2 ? '同步失败数据' : '未同步数据';
  getForm().resetFields();
}
</script>
 
<template>
  <BasicModal v-bind="$attrs" :title="title" @register="registerModal" :width="800" class="jnpf-list-modal">
    <BasicVxeTable @register="registerTable" :search-info="getSearchInfo" />
  </BasicModal>
</template>