From 3e60db98fdf6c5b59768ffc81576da3679fafbea Mon Sep 17 00:00:00 2001 From: pengwei <2071057782@qq.com> Date: 星期一, 14 四月 2025 10:04:42 +0800 Subject: [PATCH] 优化 --- 项目代码/client/src/views/tts/BasicInformation/Basicinformation.vue | 63 ++++++++++++++++++++++++++++--- 1 files changed, 57 insertions(+), 6 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/BasicInformation/Basicinformation.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/BasicInformation/Basicinformation.vue" index 628e2a6..9c78316 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/BasicInformation/Basicinformation.vue" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/views/tts/BasicInformation/Basicinformation.vue" @@ -107,6 +107,7 @@ >鏂板缓</el-button > <el-button + @click="importDialogVisible = true" size="small" style="width: 5.5rem; height: 2rem; font-size: 0.88rem" >鎵归噺瀵煎叆</el-button @@ -114,6 +115,7 @@ <el-button size="small" style="width: 5.5rem; height: 2rem; font-size: 0.88rem" + @click="printExcel" >鎵归噺瀵煎嚭</el-button > <el-button @@ -127,6 +129,7 @@ <div style="margin-top: 1rem; height: 100%"> <!-- 淇℃伅鍒楄〃 --> <el-table + empty-text="鏆傛棤鏁版嵁" v-if="isactive == 1" :data="tableData" style="width: 100%" @@ -142,7 +145,7 @@ fontSize: '0.88rem', height: '3rem', }" - @select="InfoSelectionChange" + @selection-change="InfoSelectionChange" > <el-table-column type="selection" align="center" /> <el-table-column prop="articleName" label="淇℃伅鍚嶇О" align="center" /> @@ -161,6 +164,7 @@ <!-- 宸ュ叿鍒楄〃 --> <el-table + empty-text="鏆傛棤鏁版嵁" v-if="isactive == 2" :data="toolList" style="width: 100%" @@ -176,7 +180,7 @@ fontSize: '0.88rem', height: '3rem', }" - @select="ToolSelectionChange" + @selection-change="ToolSelectionChange" > <el-table-column type="selection" align="center" /> <el-table-column prop="toolName" label="宸ュ叿鍚嶇О" align="center" /> @@ -315,7 +319,6 @@ <el-form-item prop="articleRemark"> <template #label> <div style="display: flex; align-items: flex-end"> - <span style="color: red; margin-right: 0.2rem">*</span> <span style="font-size: 0.88rem; color: black; font-weight: bold" >澶囨敞</span @@ -445,7 +448,6 @@ <el-form-item prop="toolremark"> <template #label> <div style="display: flex; align-items: flex-end"> - <span style="color: red; margin-right: 0.2rem">*</span> <span style="font-size: 0.88rem; color: black; font-weight: bold" >澶囨敞</span @@ -481,12 +483,27 @@ </div> </template> </el-dialog> + + <el-dialog v-model="importDialogVisible"> + <UploadExcel + @importExcelAfter="importExcelAfter" + :url="isactive == 1 ? 'api/ArticleInfom/Import' : 'api/Tools/Import'" + :template="{ + url: + isactive == 1 + ? 'api/ArticleInfom/DownLoadTemplate' + : 'api/Tools/DownLoadTemplate', + fileName: isactive == 1 ? '淇℃伅瀵煎叆妯℃澘' : '宸ュ叿瀵煎叆妯℃澘', + }" + /> + </el-dialog> </div> </template> <script setup> import { ref, reactive, onMounted, toRef } from "vue"; import { ElMessage, ElMessageBox } from "element-plus"; import { formatTime } from "@/utils/index.js"; +import UploadExcel from "@/components/basic/UploadExcel.vue"; import { getBasicinformation, addBasicinformation, @@ -496,6 +513,8 @@ editToolData, deleteToolData, deleteBasicinformation, + ExportApi, + ExportTool, } from "@/api/newapi/Basicinformation.js"; // 鍒濆鍖栨暟鎹� const obj = { @@ -512,7 +531,7 @@ const isactive = ref(1); const dialogVisible = ref(false); const dialogVisible1 = ref(false); - +const importDialogVisible = ref(false); // 瀵煎叆 const selectoptions = ref([]); const infoOpitions = ref([ { @@ -708,12 +727,44 @@ } }; +const printExcel = () => { + // 鏌ヨ鏉′欢 + const startTime = formatTime(queryForm.value.selectTime[0]); + const endTime = formatTime(queryForm.value.selectTime[1]); + const filter = [ + { + name: queryForm.value.selectType, + value: queryForm.value.selectInput, + displayType: "like", + }, + { + name: "pustatus", + value: queryForm.value.selectName, + displayType: "String", + }, + { name: "createDate", value: startTime, displayType: "ThanOrEqual" }, + { name: "createDate", value: endTime, displayType: "LessOrEqual" }, + ]; + if (isactive.value == 1) { + ExportApi({ + ...pageQuery.value, + filter, + }); + } + if (isactive.value == 2) { + ExportTool({ + ...pageQuery.value, + filter, + }); + } +}; + //鍒嗛〉璇锋眰鍙傛暟 const pageQuery = ref({ page: 1, //褰撳墠椤甸潰 rows: 10, //姣忛〉鏄剧ず鏉℃暟 order: "desc", //鎺掑簭鏂瑰紡 - sort: "createDate", //鎺掑簭瀛楁 + sort: "", //鎺掑簭瀛楁 wheres: "", //鏉′欢鏌ヨ }); -- Gitblit v1.9.3