feat(supervision): 各台账导入功能统一为导入弹窗
This commit is contained in:
@@ -103,19 +103,7 @@
|
|||||||
<a-button type="primary" v-auth="'bqtakepulse:bg_takepulse:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
<a-button type="primary" v-auth="'bqtakepulse:bg_takepulse:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
||||||
导出</a-button
|
导出</a-button
|
||||||
>
|
>
|
||||||
<a-button type="primary" v-auth="'bqtakepulse:bg_takepulse:exportXls'" preIcon="ant-design:download-outlined" @click="handleDownloadTemplate"
|
<a-button type="primary" v-auth="'bqtakepulse:bg_takepulse:importExcel'" preIcon="ant-design:import-outlined" @click="openImportModal">导入</a-button>
|
||||||
>下载模板</a-button
|
|
||||||
>
|
|
||||||
<j-upload-button type="primary" v-auth="'bqtakepulse:bg_takepulse:importExcel'" preIcon="ant-design:check-outlined" @click="handleCheckExcel"
|
|
||||||
>模板校验</j-upload-button
|
|
||||||
>
|
|
||||||
<j-upload-button
|
|
||||||
type="primary"
|
|
||||||
v-auth="'bqtakepulse:bg_takepulse:importExcel'"
|
|
||||||
preIcon="ant-design:import-outlined"
|
|
||||||
@click="handleImportByTemplate"
|
|
||||||
>模板导入</j-upload-button
|
|
||||||
>
|
|
||||||
<a-button v-if="selectedRowKeys.length > 0" v-auth="'bqtakepulse:bg_takepulse:deleteBatch'" danger @click="batchHandleDelete">
|
<a-button v-if="selectedRowKeys.length > 0" v-auth="'bqtakepulse:bg_takepulse:deleteBatch'" danger @click="batchHandleDelete">
|
||||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||||
删除
|
删除
|
||||||
@@ -201,6 +189,33 @@
|
|||||||
<BpmPictureModal @register="registerBpmModal" />
|
<BpmPictureModal @register="registerBpmModal" />
|
||||||
<FlowScheduleStartModalForBG ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
<FlowScheduleStartModalForBG ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
||||||
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
||||||
|
<!-- 导入弹窗:下载模板 / 模板校验 / 模板导入 -->
|
||||||
|
<a-modal v-model:open="importModalVisible" title="导入数据" :footer="null" :width="460" centered destroyOnClose>
|
||||||
|
<div class="import-action-list">
|
||||||
|
<div v-auth="'bqtakepulse:bg_takepulse:exportXls'" class="import-action-card" @click="handleDownloadTemplateFromModal">
|
||||||
|
<Icon icon="ant-design:download-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">下载模板</div>
|
||||||
|
<div class="import-action-desc">下载标准导入模板,按模板格式填写数据</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-auth="'bqtakepulse:bg_takepulse:importExcel'" class="import-action-card" @click="chooseFile('check')">
|
||||||
|
<Icon icon="ant-design:check-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">模板校验</div>
|
||||||
|
<div class="import-action-desc">校验所选文件是否符合导入规范,提前发现错误</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-auth="'bqtakepulse:bg_takepulse:importExcel'" class="import-action-card" @click="chooseFile('import')">
|
||||||
|
<Icon icon="ant-design:import-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">模板导入</div>
|
||||||
|
<div class="import-action-desc">导入校验通过的模板数据到当前台账</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input ref="fileInputRef" type="file" accept=".xls,.xlsx" style="display: none" @change="onFileSelected" />
|
||||||
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -732,6 +747,43 @@
|
|||||||
/**
|
/**
|
||||||
* 重置
|
* 重置
|
||||||
*/
|
*/
|
||||||
|
// ================= 导入弹窗(下载模板 / 模板校验 / 模板导入) =================
|
||||||
|
const importModalVisible = ref(false);
|
||||||
|
const fileInputRef = ref();
|
||||||
|
const pendingAction = ref<'check' | 'import' | null>(null);
|
||||||
|
|
||||||
|
function openImportModal() {
|
||||||
|
importModalVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadTemplateFromModal() {
|
||||||
|
importModalVisible.value = false;
|
||||||
|
handleDownloadTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 触发隐藏文件选择框,记录当前动作(校验 or 导入) */
|
||||||
|
function chooseFile(action: 'check' | 'import') {
|
||||||
|
pendingAction.value = action;
|
||||||
|
fileInputRef.value?.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件选择后按动作分发到原校验/导入逻辑 */
|
||||||
|
function onFileSelected(e) {
|
||||||
|
const file = e.target.files?.[0];
|
||||||
|
e.target.value = '';
|
||||||
|
if (!file) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const action = pendingAction.value;
|
||||||
|
pendingAction.value = null;
|
||||||
|
importModalVisible.value = false;
|
||||||
|
if (action === 'check') {
|
||||||
|
void handleCheckExcel({ file });
|
||||||
|
} else if (action === 'import') {
|
||||||
|
void handleImportByTemplate({ file });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleDownloadTemplate() {
|
async function handleDownloadTemplate() {
|
||||||
const data = await defHttp.get({ url: getExportXlsHeadersUrl, params: {}, responseType: 'blob', timeout: 60000 }, { isTransformResponse: false });
|
const data = await defHttp.get({ url: getExportXlsHeadersUrl, params: {}, responseType: 'blob', timeout: 60000 }, { isTransformResponse: false });
|
||||||
if (!data) {
|
if (!data) {
|
||||||
@@ -979,4 +1031,48 @@
|
|||||||
.status-row-3 td {
|
.status-row-3 td {
|
||||||
background: #f6ffed !important;
|
background: #f6ffed !important;
|
||||||
}
|
}
|
||||||
|
/* 导入弹窗操作卡片 */
|
||||||
|
.import-action-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 4px 8px 8px;
|
||||||
|
}
|
||||||
|
.import-action-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
|
padding: 14px 16px;
|
||||||
|
border: 1px solid #e5e6eb;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.import-action-card:hover {
|
||||||
|
border-color: #1677ff;
|
||||||
|
background: #f0f7ff;
|
||||||
|
box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
.import-action-icon {
|
||||||
|
font-size: 26px;
|
||||||
|
color: #1677ff;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.import-action-body {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.import-action-title {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1f2329;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.import-action-desc {
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a919f;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -99,9 +99,7 @@
|
|||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<a-button type="primary" v-auth="actionAuth.add" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
<a-button type="primary" v-auth="actionAuth.add" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
<a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
<a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||||
<a-button type="primary" v-auth="actionAuth.exportXls" preIcon="ant-design:download-outlined" @click="handleDownloadTemplate">下载模板</a-button>
|
<a-button type="primary" v-auth="actionAuth.importExcel" preIcon="ant-design:import-outlined" @click="openImportModal">导入</a-button>
|
||||||
<j-upload-button type="primary" v-auth="actionAuth.importExcel" preIcon="ant-design:check-outlined" @click="handleCheckExcel">模板校验</j-upload-button>
|
|
||||||
<j-upload-button type="primary" v-auth="actionAuth.importExcel" preIcon="ant-design:import-outlined" @click="handleImportByTemplate">模板导入</j-upload-button>
|
|
||||||
<a-button
|
<a-button
|
||||||
v-if="selectedRowKeys.length > 0"
|
v-if="selectedRowKeys.length > 0"
|
||||||
v-auth="actionAuth.deleteBatch"
|
v-auth="actionAuth.deleteBatch"
|
||||||
@@ -174,6 +172,33 @@
|
|||||||
<FixedContact20260730Modal ref="registerModal" @success="handleSuccess" />
|
<FixedContact20260730Modal ref="registerModal" @success="handleSuccess" />
|
||||||
<FlowScheduleStartModalForBG ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
<FlowScheduleStartModalForBG ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
||||||
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
||||||
|
<!-- 导入弹窗:下载模板 / 模板校验 / 模板导入 -->
|
||||||
|
<a-modal v-model:open="importModalVisible" title="导入数据" :footer="null" :width="460" centered destroyOnClose>
|
||||||
|
<div class="import-action-list">
|
||||||
|
<div v-auth="actionAuth.exportXls" class="import-action-card" @click="handleDownloadTemplateFromModal">
|
||||||
|
<Icon icon="ant-design:download-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">下载模板</div>
|
||||||
|
<div class="import-action-desc">下载标准导入模板,按模板格式填写数据</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-auth="actionAuth.importExcel" class="import-action-card" @click="chooseFile('check')">
|
||||||
|
<Icon icon="ant-design:check-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">模板校验</div>
|
||||||
|
<div class="import-action-desc">校验所选文件是否符合导入规范,提前发现错误</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-auth="actionAuth.importExcel" class="import-action-card" @click="chooseFile('import')">
|
||||||
|
<Icon icon="ant-design:import-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">模板导入</div>
|
||||||
|
<div class="import-action-desc">导入校验通过的模板数据到当前台账</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input ref="fileInputRef" type="file" accept=".xls,.xlsx" style="display: none" @change="onFileSelected" />
|
||||||
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -635,6 +660,43 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
|||||||
sm: { span: 14 },
|
sm: { span: 14 },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// ================= 导入弹窗(下载模板 / 模板校验 / 模板导入) =================
|
||||||
|
const importModalVisible = ref(false);
|
||||||
|
const fileInputRef = ref();
|
||||||
|
const pendingAction = ref<'check' | 'import' | null>(null);
|
||||||
|
|
||||||
|
function openImportModal() {
|
||||||
|
importModalVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadTemplateFromModal() {
|
||||||
|
importModalVisible.value = false;
|
||||||
|
handleDownloadTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 触发隐藏文件选择框,记录当前动作(校验 or 导入) */
|
||||||
|
function chooseFile(action: 'check' | 'import') {
|
||||||
|
pendingAction.value = action;
|
||||||
|
fileInputRef.value?.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件选择后按动作分发到原校验/导入逻辑 */
|
||||||
|
function onFileSelected(e) {
|
||||||
|
const file = e.target.files?.[0];
|
||||||
|
e.target.value = '';
|
||||||
|
if (!file) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const action = pendingAction.value;
|
||||||
|
pendingAction.value = null;
|
||||||
|
importModalVisible.value = false;
|
||||||
|
if (action === 'check') {
|
||||||
|
void handleCheckExcel({ file });
|
||||||
|
} else if (action === 'import') {
|
||||||
|
void handleImportByTemplate({ file });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleDownloadTemplate() {
|
async function handleDownloadTemplate() {
|
||||||
let data;
|
let data;
|
||||||
try {
|
try {
|
||||||
@@ -841,3 +903,50 @@ import { showImportValidationErrors } from '/@/utils/helper/importError';
|
|||||||
background: #f6ffed !important;
|
background: #f6ffed !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/* 导入弹窗操作卡片 */
|
||||||
|
.import-action-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 4px 8px 8px;
|
||||||
|
}
|
||||||
|
.import-action-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
|
padding: 14px 16px;
|
||||||
|
border: 1px solid #e5e6eb;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.import-action-card:hover {
|
||||||
|
border-color: #1677ff;
|
||||||
|
background: #f0f7ff;
|
||||||
|
box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
.import-action-icon {
|
||||||
|
font-size: 26px;
|
||||||
|
color: #1677ff;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.import-action-body {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.import-action-title {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1f2329;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.import-action-desc {
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a919f;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -72,15 +72,7 @@
|
|||||||
<!-- <j-upload-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls"-->
|
<!-- <j-upload-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls"-->
|
||||||
<!-- >导入</j-upload-button-->
|
<!-- >导入</j-upload-button-->
|
||||||
<!-- >-->
|
<!-- >-->
|
||||||
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:exportXls'" preIcon="ant-design:download-outlined" @click="handleDownloadTemplate"
|
<a-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:importExcel'" preIcon="ant-design:import-outlined" @click="openImportModal">导入</a-button>
|
||||||
>下载模板</a-button
|
|
||||||
>
|
|
||||||
<j-upload-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:importExcel'" preIcon="ant-design:check-outlined" @click="handleCheckExcel"
|
|
||||||
>模板校验</j-upload-button
|
|
||||||
>
|
|
||||||
<j-upload-button type="primary" v-auth="'bg.xispeak:bg_xi_speak:importExcel'" preIcon="ant-design:import-outlined" @click="handleImportByTemplate"
|
|
||||||
>模板导入</j-upload-button
|
|
||||||
>
|
|
||||||
<a-button
|
<a-button
|
||||||
v-if="selectedRowKeys.length > 0"
|
v-if="selectedRowKeys.length > 0"
|
||||||
v-auth="'bg.xispeak:bg_xi_speak:deleteBatch'"
|
v-auth="'bg.xispeak:bg_xi_speak:deleteBatch'"
|
||||||
@@ -127,6 +119,33 @@
|
|||||||
<FlowScheduleStartModal ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
<FlowScheduleStartModal ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
||||||
<FeedbackRightNowModal ref="feedbackRightNowModalRef" @confirm="handleFeedbackRightNowConfirm" />
|
<FeedbackRightNowModal ref="feedbackRightNowModalRef" @confirm="handleFeedbackRightNowConfirm" />
|
||||||
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
||||||
|
<!-- 导入弹窗:下载模板 / 模板校验 / 模板导入 -->
|
||||||
|
<a-modal v-model:open="importModalVisible" title="导入数据" :footer="null" :width="460" centered destroyOnClose>
|
||||||
|
<div class="import-action-list">
|
||||||
|
<div v-auth="'bg.xispeak:bg_xi_speak:exportXls'" class="import-action-card" @click="handleDownloadTemplateFromModal">
|
||||||
|
<Icon icon="ant-design:download-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">下载模板</div>
|
||||||
|
<div class="import-action-desc">下载标准导入模板,按模板格式填写数据</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-auth="'bg.xispeak:bg_xi_speak:importExcel'" class="import-action-card" @click="chooseFile('check')">
|
||||||
|
<Icon icon="ant-design:check-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">模板校验</div>
|
||||||
|
<div class="import-action-desc">校验所选文件是否符合导入规范,提前发现错误</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-auth="'bg.xispeak:bg_xi_speak:importExcel'" class="import-action-card" @click="chooseFile('import')">
|
||||||
|
<Icon icon="ant-design:import-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">模板导入</div>
|
||||||
|
<div class="import-action-desc">导入校验通过的模板数据到当前台账</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input ref="fileInputRef" type="file" accept=".xls,.xlsx" style="display: none" @change="onFileSelected" />
|
||||||
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -832,6 +851,43 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
|
|||||||
feedbackViewModalRef.value.open(record);
|
feedbackViewModalRef.value.open(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ================= 导入弹窗(下载模板 / 模板校验 / 模板导入) =================
|
||||||
|
const importModalVisible = ref(false);
|
||||||
|
const fileInputRef = ref();
|
||||||
|
const pendingAction = ref<'check' | 'import' | null>(null);
|
||||||
|
|
||||||
|
function openImportModal() {
|
||||||
|
importModalVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadTemplateFromModal() {
|
||||||
|
importModalVisible.value = false;
|
||||||
|
handleDownloadTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 触发隐藏文件选择框,记录当前动作(校验 or 导入) */
|
||||||
|
function chooseFile(action: 'check' | 'import') {
|
||||||
|
pendingAction.value = action;
|
||||||
|
fileInputRef.value?.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件选择后按动作分发到原校验/导入逻辑 */
|
||||||
|
function onFileSelected(e) {
|
||||||
|
const file = e.target.files?.[0];
|
||||||
|
e.target.value = '';
|
||||||
|
if (!file) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const action = pendingAction.value;
|
||||||
|
pendingAction.value = null;
|
||||||
|
importModalVisible.value = false;
|
||||||
|
if (action === 'check') {
|
||||||
|
void handleCheckExcel({ file });
|
||||||
|
} else if (action === 'import') {
|
||||||
|
void handleImportByTemplate({ file });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleDownloadTemplate() {
|
async function handleDownloadTemplate() {
|
||||||
const data = await defHttp.get(
|
const data = await defHttp.get(
|
||||||
{ url: getExportXlsHeadersUrl, params: {}, responseType: 'blob', timeout: 60000 },
|
{ url: getExportXlsHeadersUrl, params: {}, responseType: 'blob', timeout: 60000 },
|
||||||
@@ -994,3 +1050,50 @@ import { PARTY_COMMITTEE_DEPT_ID, SDW_LEADER_ROLE_ID } from '/@/constant/supervi
|
|||||||
background: #f6ffed !important;
|
background: #f6ffed !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/* 导入弹窗操作卡片 */
|
||||||
|
.import-action-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 4px 8px 8px;
|
||||||
|
}
|
||||||
|
.import-action-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
|
padding: 14px 16px;
|
||||||
|
border: 1px solid #e5e6eb;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.import-action-card:hover {
|
||||||
|
border-color: #1677ff;
|
||||||
|
background: #f0f7ff;
|
||||||
|
box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
.import-action-icon {
|
||||||
|
font-size: 26px;
|
||||||
|
color: #1677ff;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.import-action-body {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.import-action-title {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1f2329;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.import-action-desc {
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a919f;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -59,30 +59,7 @@
|
|||||||
<a-button type="primary" v-auth="'dqinspecttask:dq_inspect_task:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
<a-button type="primary" v-auth="'dqinspecttask:dq_inspect_task:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls">
|
||||||
导出</a-button
|
导出</a-button
|
||||||
>
|
>
|
||||||
<j-upload-button type="primary" v-auth="'dqinspecttask:dq_inspect_task:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls"
|
<a-button type="primary" v-auth="'dqinspecttask:dq_inspect_task:importExcel'" preIcon="ant-design:import-outlined" @click="openImportModal">导入</a-button>
|
||||||
>导入</j-upload-button
|
|
||||||
>
|
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
v-auth="'dqinspecttask:dq_inspect_task:exportXls'"
|
|
||||||
preIcon="ant-design:download-outlined"
|
|
||||||
@click="handleDownloadTemplate"
|
|
||||||
>下载模板</a-button
|
|
||||||
>
|
|
||||||
<j-upload-button
|
|
||||||
type="primary"
|
|
||||||
v-auth="'dqinspecttask:dq_inspect_task:importExcel'"
|
|
||||||
preIcon="ant-design:check-outlined"
|
|
||||||
@click="handleCheckExcel"
|
|
||||||
>模板校验</j-upload-button
|
|
||||||
>
|
|
||||||
<j-upload-button
|
|
||||||
type="primary"
|
|
||||||
v-auth="'dqinspecttask:dq_inspect_task:importExcel'"
|
|
||||||
preIcon="ant-design:import-outlined"
|
|
||||||
@click="handleImportByTemplate"
|
|
||||||
>模板导入</j-upload-button
|
|
||||||
>
|
|
||||||
|
|
||||||
<a-button
|
<a-button
|
||||||
v-if="selectedRowKeys.length > 0"
|
v-if="selectedRowKeys.length > 0"
|
||||||
@@ -126,6 +103,33 @@
|
|||||||
<BpmPictureModal @register="registerBpmModal" />
|
<BpmPictureModal @register="registerBpmModal" />
|
||||||
<FlowScheduleStartModal ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
<FlowScheduleStartModal ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
||||||
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
||||||
|
<!-- 导入弹窗:下载模板 / 模板校验 / 模板导入 -->
|
||||||
|
<a-modal v-model:open="importModalVisible" title="导入数据" :footer="null" :width="460" centered destroyOnClose>
|
||||||
|
<div class="import-action-list">
|
||||||
|
<div v-auth="'dqinspecttask:dq_inspect_task:exportXls'" class="import-action-card" @click="handleDownloadTemplateFromModal">
|
||||||
|
<Icon icon="ant-design:download-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">下载模板</div>
|
||||||
|
<div class="import-action-desc">下载标准导入模板,按模板格式填写数据</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-auth="'dqinspecttask:dq_inspect_task:importExcel'" class="import-action-card" @click="chooseFile('check')">
|
||||||
|
<Icon icon="ant-design:check-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">模板校验</div>
|
||||||
|
<div class="import-action-desc">校验所选文件是否符合导入规范,提前发现错误</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-auth="'dqinspecttask:dq_inspect_task:importExcel'" class="import-action-card" @click="chooseFile('import')">
|
||||||
|
<Icon icon="ant-design:import-outlined" class="import-action-icon" />
|
||||||
|
<div class="import-action-body">
|
||||||
|
<div class="import-action-title">模板导入</div>
|
||||||
|
<div class="import-action-desc">导入校验通过的模板数据到当前台账</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input ref="fileInputRef" type="file" accept=".xls,.xlsx" style="display: none" @change="onFileSelected" />
|
||||||
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -180,7 +184,7 @@
|
|||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls } = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
title: 'dq_inspect_task',
|
title: 'dq_inspect_task',
|
||||||
api: ledgerList,
|
api: ledgerList,
|
||||||
@@ -295,6 +299,43 @@
|
|||||||
(selectedRowKeys.value = []) && reload();
|
(selectedRowKeys.value = []) && reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ================= 导入弹窗(下载模板 / 模板校验 / 模板导入) =================
|
||||||
|
const importModalVisible = ref(false);
|
||||||
|
const fileInputRef = ref();
|
||||||
|
const pendingAction = ref<'check' | 'import' | null>(null);
|
||||||
|
|
||||||
|
function openImportModal() {
|
||||||
|
importModalVisible.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadTemplateFromModal() {
|
||||||
|
importModalVisible.value = false;
|
||||||
|
handleDownloadTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 触发隐藏文件选择框,记录当前动作(校验 or 导入) */
|
||||||
|
function chooseFile(action: 'check' | 'import') {
|
||||||
|
pendingAction.value = action;
|
||||||
|
fileInputRef.value?.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 文件选择后按动作分发到原校验/导入逻辑 */
|
||||||
|
function onFileSelected(e) {
|
||||||
|
const file = e.target.files?.[0];
|
||||||
|
e.target.value = '';
|
||||||
|
if (!file) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const action = pendingAction.value;
|
||||||
|
pendingAction.value = null;
|
||||||
|
importModalVisible.value = false;
|
||||||
|
if (action === 'check') {
|
||||||
|
void handleCheckExcel({ file });
|
||||||
|
} else if (action === 'import') {
|
||||||
|
void handleImportByTemplate({ file });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleDownloadTemplate() {
|
async function handleDownloadTemplate() {
|
||||||
const data = await defHttp.get({ url: getExportXlsHeadersUrl, params: {}, responseType: 'blob', timeout: 60000 }, { isTransformResponse: false });
|
const data = await defHttp.get({ url: getExportXlsHeadersUrl, params: {}, responseType: 'blob', timeout: 60000 }, { isTransformResponse: false });
|
||||||
if (!data) {
|
if (!data) {
|
||||||
@@ -677,3 +718,50 @@
|
|||||||
background: #f6ffed !important;
|
background: #f6ffed !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
/* 导入弹窗操作卡片 */
|
||||||
|
.import-action-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 4px 8px 8px;
|
||||||
|
}
|
||||||
|
.import-action-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
|
padding: 14px 16px;
|
||||||
|
border: 1px solid #e5e6eb;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
.import-action-card:hover {
|
||||||
|
border-color: #1677ff;
|
||||||
|
background: #f0f7ff;
|
||||||
|
box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
.import-action-icon {
|
||||||
|
font-size: 26px;
|
||||||
|
color: #1677ff;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.import-action-body {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.import-action-title {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1f2329;
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
.import-action-desc {
|
||||||
|
margin-top: 4px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a919f;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user