|
|
@@ -10,6 +10,9 @@
|
|
|
<el-button type="primary" class="search-table-container--button" @click="handleCreate">
|
|
|
添加
|
|
|
</el-button>
|
|
|
+ <el-button plain class="search-table-container--button" @click="handleImport">
|
|
|
+ 导入
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
|
|
|
<div class="act-search">
|
|
|
@@ -70,6 +73,9 @@
|
|
|
<section class="search-btn">
|
|
|
<el-button type="primary" @click="handleSearch">查询</el-button>
|
|
|
<el-button @click="handleReset">重置</el-button>
|
|
|
+ <el-button plain @click="handleDownload">
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
</section>
|
|
|
</div>
|
|
|
</header>
|
|
|
@@ -270,6 +276,16 @@
|
|
|
<el-button type="primary" @click="handleIssueSave">保存</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <BatchImport
|
|
|
+ v-if="batchImportVisible"
|
|
|
+ :visible="batchImportVisible"
|
|
|
+ :import-api-url="importApiUrl"
|
|
|
+ :template-url="templateUrl"
|
|
|
+ template-name="下载模板"
|
|
|
+ :show-template="false"
|
|
|
+ @close="batchImportVisible = false"
|
|
|
+ @update="handleUpdate"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -290,12 +306,16 @@
|
|
|
cancelAreaCheckPlanManage,
|
|
|
queryAreaCheckPlanManageDetail,
|
|
|
mapAreaCheckPlanApiRecordToUi,
|
|
|
+ exportAreaCheckPlanAdministration,
|
|
|
} from '@/api/production-safety-system';
|
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
|
import type { DeptTree } from '@/types/dept/type';
|
|
|
import { queryUserGroupPage } from '@/api/system/person-group';
|
|
|
import type { PersonGroupListItem } from '@/types/person-group/type';
|
|
|
-
|
|
|
+ import BatchImport from '@/components/batch-import/BatchImport.vue';
|
|
|
+ import { useGlobSetting } from '@/hooks/setting';
|
|
|
+ import urlJoin from 'url-join';
|
|
|
+ import { downloadByData } from '@/utils/file/download';
|
|
|
const router = useRouter();
|
|
|
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
@@ -594,6 +614,36 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 批量导入
|
|
|
+ const batchImportVisible = ref(false);
|
|
|
+ const { urlPrefix } = useGlobSetting();
|
|
|
+ // /productionSafety/academyFile/import
|
|
|
+ const importApiUrl = ref(urlJoin(urlPrefix, '/areaCheckPlanManageAdmin/importAreaCheckPlan'));
|
|
|
+ const templateUrl = ref('./skyeye-file-upload/sfysecurity/TEMPLATE/import-academy-file-template.xlsx');
|
|
|
+
|
|
|
+ const handleImport = () => {
|
|
|
+ batchImportVisible.value = true;
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleUpdate = () => {
|
|
|
+ batchImportVisible.value = false;
|
|
|
+ // getTableData();
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleDownload = async () => {
|
|
|
+ try {
|
|
|
+ const response = await exportAreaCheckPlanAdministration(tableQuery.queryParam);
|
|
|
+ if (response) {
|
|
|
+ const fileName = `区域检查计划管理_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
|
+ downloadByData(response, fileName);
|
|
|
+ ElMessage.success('导出成功');
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.error('导出院级文件失败:', e);
|
|
|
+ ElMessage.error('导出失败,请重试');
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
venueCategoryOptions.value = [
|
|
|
{ label: '各级风险点', value: '各级风险点' },
|