feat(credit): 添加信用模块数据导入导出功能
- 为行政许可、破产重整、分支机构、历史法定代表人、附近企业、专利、疑似关系模块添加导入功能 - 在工具栏中将导入按钮文本更新为导入(多)以区分单个导入和批量导入 - 为各信用模块表格添加导入弹窗组件和相应的导入导出事件处理 - 实现各信用模块的导出功能,支持按搜索条件导出数据 - 优化表格数据源处理,支持关键词搜索和状态筛选 - 添加链接字段的点击跳转功能,提升用户体验 - 移除冗余的表格列字段,精简表格展示内容
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
:disabled="!form.id"
|
||||
@click="openRelatedImport(tab.key)"
|
||||
>
|
||||
导入
|
||||
导入(多)
|
||||
</a-button>
|
||||
<a-button
|
||||
:loading="tabState[tab.key].loading"
|
||||
@@ -86,13 +86,32 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, reactive, ref, watch } from 'vue';
|
||||
import { computed, h, reactive, ref, watch } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { assignObject } from 'ele-admin-pro';
|
||||
import { CreditCompany } from '@/api/credit/creditCompany/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import CreditCompanyRelatedImport from './credit-company-related-import.vue';
|
||||
import {
|
||||
pageCreditAdministrativeLicense,
|
||||
importCreditAdministrativeLicense
|
||||
} from '@/api/credit/creditAdministrativeLicense';
|
||||
import { pageCreditBankruptcy, importCreditBankruptcy } from '@/api/credit/creditBankruptcy';
|
||||
import { pageCreditBranch, importCreditBranch } from '@/api/credit/creditBranch';
|
||||
import {
|
||||
pageCreditHistoricalLegalPerson,
|
||||
importCreditHistoricalLegalPerson
|
||||
} from '@/api/credit/creditHistoricalLegalPerson';
|
||||
import {
|
||||
pageCreditNearbyCompany,
|
||||
importCreditNearbyCompany
|
||||
} from '@/api/credit/creditNearbyCompany';
|
||||
import { pageCreditPatent, importCreditPatent } from '@/api/credit/creditPatent';
|
||||
import {
|
||||
pageCreditSuspectedRelationship,
|
||||
importCreditSuspectedRelationship
|
||||
} from '@/api/credit/creditSuspectedRelationship';
|
||||
import { pageCreditUser, importCreditUsers } from '@/api/credit/creditUser';
|
||||
import {
|
||||
pageCreditExternal,
|
||||
@@ -195,7 +214,14 @@
|
||||
{ key: '终本案件', label: '终本案件' },
|
||||
{ key: '限制高消费', label: '限制高消费' },
|
||||
{ key: '股权冻结', label: '股权冻结' },
|
||||
{ key: '司法案件', label: '司法案件' }
|
||||
{ key: '司法案件', label: '司法案件' },
|
||||
{ key: '附近企业', label: '附近企业' },
|
||||
{ key: '分支机构', label: '分支机构' },
|
||||
{ key: '破产重整', label: '破产重整' },
|
||||
{ key: '行政许可', label: '行政许可' },
|
||||
{ key: '疑似关系', label: '疑似关系' },
|
||||
{ key: '专利', label: '专利' },
|
||||
{ key: '历史法定代表人', label: '历史法定代表人' }
|
||||
];
|
||||
|
||||
type TabApiConfig = {
|
||||
@@ -294,6 +320,41 @@
|
||||
page: pageCreditJudiciary as any,
|
||||
importFn: importCreditJudiciaries as any,
|
||||
templatePath: '/credit/credit-judiciary/import/template'
|
||||
},
|
||||
附近企业: {
|
||||
page: pageCreditNearbyCompany as any,
|
||||
importFn: importCreditNearbyCompany as any,
|
||||
templatePath: '/credit/credit-nearby-company/import/template'
|
||||
},
|
||||
分支机构: {
|
||||
page: pageCreditBranch as any,
|
||||
importFn: importCreditBranch as any,
|
||||
templatePath: '/credit/credit-branch/import/template'
|
||||
},
|
||||
破产重整: {
|
||||
page: pageCreditBankruptcy as any,
|
||||
importFn: importCreditBankruptcy as any,
|
||||
templatePath: '/credit/credit-bankruptcy/import/template'
|
||||
},
|
||||
行政许可: {
|
||||
page: pageCreditAdministrativeLicense as any,
|
||||
importFn: importCreditAdministrativeLicense as any,
|
||||
templatePath: '/credit/credit-administrative-license/import/template'
|
||||
},
|
||||
疑似关系: {
|
||||
page: pageCreditSuspectedRelationship as any,
|
||||
importFn: importCreditSuspectedRelationship as any,
|
||||
templatePath: '/credit/credit-suspected-relationship/import/template'
|
||||
},
|
||||
专利: {
|
||||
page: pageCreditPatent as any,
|
||||
importFn: importCreditPatent as any,
|
||||
templatePath: '/credit/credit-patent/import/template'
|
||||
},
|
||||
历史法定代表人: {
|
||||
page: pageCreditHistoricalLegalPerson as any,
|
||||
importFn: importCreditHistoricalLegalPerson as any,
|
||||
templatePath: '/credit/credit-historical-legal-person/import/template'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -302,6 +363,7 @@
|
||||
dataIndex: string;
|
||||
key: string;
|
||||
ellipsis?: boolean;
|
||||
customRender?: (opt: { text: any; record: Record<string, any> }) => any;
|
||||
};
|
||||
|
||||
type TabColumnConfig = {
|
||||
@@ -376,6 +438,144 @@
|
||||
createTime: '创建时间',
|
||||
updateTime: '修改时间'
|
||||
}
|
||||
},
|
||||
附近企业: {
|
||||
order: [
|
||||
'name',
|
||||
'registrationStatus',
|
||||
'legalPerson',
|
||||
'registeredCapital',
|
||||
'establishDate',
|
||||
'code',
|
||||
'address',
|
||||
'phone',
|
||||
'email',
|
||||
'domain',
|
||||
'createTime'
|
||||
],
|
||||
titleMap: {
|
||||
name: '企业名称',
|
||||
registrationStatus: '登记状态',
|
||||
legalPerson: '法定代表人',
|
||||
registeredCapital: '注册资本',
|
||||
establishDate: '成立日期',
|
||||
code: '统一社会信用代码',
|
||||
address: '注册地址',
|
||||
phone: '有效手机号',
|
||||
email: '邮箱',
|
||||
domain: '官网网址',
|
||||
createTime: '创建时间'
|
||||
}
|
||||
},
|
||||
分支机构: {
|
||||
order: [
|
||||
'name',
|
||||
'curator',
|
||||
'region',
|
||||
'establishDate',
|
||||
'statusText',
|
||||
'createTime'
|
||||
],
|
||||
titleMap: {
|
||||
name: '分支机构名称',
|
||||
curator: '负责人',
|
||||
region: '地区',
|
||||
establishDate: '成立日期',
|
||||
statusText: '状态',
|
||||
createTime: '创建时间'
|
||||
}
|
||||
},
|
||||
破产重整: {
|
||||
order: ['code', 'type', 'party', 'court', 'publicDate', 'createTime'],
|
||||
titleMap: {
|
||||
code: '案号',
|
||||
type: '案件类型',
|
||||
party: '当事人',
|
||||
court: '经办法院',
|
||||
publicDate: '公开日期',
|
||||
createTime: '创建时间'
|
||||
}
|
||||
},
|
||||
行政许可: {
|
||||
order: [
|
||||
'code',
|
||||
'name',
|
||||
'statusText',
|
||||
'type',
|
||||
'validityStart',
|
||||
'validityEnd',
|
||||
'licensingAuthority',
|
||||
'createTime'
|
||||
],
|
||||
titleMap: {
|
||||
code: '许可编号',
|
||||
name: '许可证名称',
|
||||
statusText: '许可状态',
|
||||
type: '许可类型',
|
||||
validityStart: '有效期自',
|
||||
validityEnd: '有效期至',
|
||||
licensingAuthority: '许可机关',
|
||||
createTime: '创建时间'
|
||||
}
|
||||
},
|
||||
疑似关系: {
|
||||
order: [
|
||||
'name',
|
||||
'statusText',
|
||||
'legalPerson',
|
||||
'registeredCapital',
|
||||
'createDate',
|
||||
'relatedParty',
|
||||
'type',
|
||||
'detail',
|
||||
'createTime'
|
||||
],
|
||||
titleMap: {
|
||||
name: '企业名称',
|
||||
statusText: '状态',
|
||||
legalPerson: '法定代表人',
|
||||
registeredCapital: '注册资本',
|
||||
createDate: '成立日期',
|
||||
relatedParty: '关联方',
|
||||
type: '疑似关系类型',
|
||||
detail: '疑似关系详情',
|
||||
createTime: '创建时间'
|
||||
}
|
||||
},
|
||||
专利: {
|
||||
order: [
|
||||
'name',
|
||||
'type',
|
||||
'statusText',
|
||||
'registerNo',
|
||||
'registerDate',
|
||||
'publicNo',
|
||||
'publicDate',
|
||||
'inventor',
|
||||
'patentApplicant',
|
||||
'createTime'
|
||||
],
|
||||
titleMap: {
|
||||
name: '发明名称',
|
||||
type: '专利类型',
|
||||
statusText: '法律状态',
|
||||
registerNo: '申请号',
|
||||
registerDate: '申请日',
|
||||
publicNo: '公开(公告)号',
|
||||
publicDate: '公开(公告)日期',
|
||||
inventor: '发明人',
|
||||
patentApplicant: '申请(专利权)人',
|
||||
createTime: '创建时间'
|
||||
}
|
||||
},
|
||||
历史法定代表人: {
|
||||
order: ['name', 'registerDate', 'publicDate', 'createTime'],
|
||||
titleMap: {
|
||||
name: '名称',
|
||||
registerDate: '任职日期',
|
||||
publicDate: '卸任日期',
|
||||
createTime: '创建时间'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -541,15 +741,28 @@
|
||||
const titleMap = { ...commonTitleMap, ...(config?.titleMap ?? {}) };
|
||||
|
||||
const keysFromData = Object.keys(rows[0]);
|
||||
const keysSet = new Set(keysFromData);
|
||||
const keys = config?.order?.length ? config.order : keysFromData;
|
||||
const finalKeys = keys.filter((k) => !hidden.has(k));
|
||||
const finalKeys = keys.filter((k) => keysSet.has(k) && !hidden.has(k));
|
||||
|
||||
return finalKeys.map((key) => ({
|
||||
title: titleMap[key] ?? key,
|
||||
dataIndex: key,
|
||||
key,
|
||||
ellipsis: true
|
||||
}));
|
||||
const linkTextKeys = new Set(['name', 'code', 'caseNumber', 'registerNo']);
|
||||
return finalKeys.map((key) => {
|
||||
const column: TableColumn = {
|
||||
title: titleMap[key] ?? key,
|
||||
dataIndex: key,
|
||||
key,
|
||||
ellipsis: true
|
||||
};
|
||||
if (linkTextKeys.has(key)) {
|
||||
column.customRender = ({ text, record }) => {
|
||||
if (record?.url && text) {
|
||||
return h('a', { href: record.url, target: '_blank' }, text);
|
||||
}
|
||||
return text;
|
||||
};
|
||||
}
|
||||
return column;
|
||||
});
|
||||
};
|
||||
|
||||
const resetForm = () => {
|
||||
|
||||
Reference in New Issue
Block a user