From 882c04207fdc667b0be8dc347e320d0414eedb94 Mon Sep 17 00:00:00 2001 From: fei <791364011@qq.com> Date: 星期二, 16 九月 2025 22:27:11 +0800 Subject: [PATCH] 新增了代码 --- src/views/archiveManager/archiveMaterial/index.vue | 84 +++++++++++ src/views/system/role/index.vue | 7 src/views/archiveProjectName/index.vue | 76 ++++++++++ src/views/archiveToUserStatistic/index.vue | 5 src/api/system/materials.js | 14 ++ src/layout/components/Navbar.vue | 4 src/views/archiveStatics/index.vue | 9 src/api/system/placeName.js | 12 + src/views/system/user/index.vue | 24 +- src/views/archivePlaceName/index.vue | 73 ++++++++++ src/api/system/category.js | 12 + src/views/archiveCategory/index.vue | 71 ++++++++++ src/api/system/projectName.js | 12 + 13 files changed, 373 insertions(+), 30 deletions(-) diff --git a/src/api/system/category.js b/src/api/system/category.js index 4305f29..ece5264 100644 --- a/src/api/system/category.js +++ b/src/api/system/category.js @@ -50,3 +50,15 @@ method: 'delete' }) } +//瀵煎叆 +export function enload(data) { + + return request({ + url: '/system/category/importData', + method: 'post', + headers: { + 'Content-Type': 'multipart/form-data' + }, + data: data + }) +} \ No newline at end of file diff --git a/src/api/system/materials.js b/src/api/system/materials.js index e8a1226..570b3e7 100644 --- a/src/api/system/materials.js +++ b/src/api/system/materials.js @@ -42,3 +42,17 @@ method: 'delete' }) } + + +//瀵煎叆 +export function enload(data) { + + return request({ + url: '/system/materials/importData', + method: 'post', + headers: { + 'Content-Type': 'multipart/form-data' + }, + data: data + }) +} \ No newline at end of file diff --git a/src/api/system/placeName.js b/src/api/system/placeName.js index 3444a33..70df6ce 100644 --- a/src/api/system/placeName.js +++ b/src/api/system/placeName.js @@ -42,3 +42,15 @@ method: 'delete' }) } +//瀵煎叆 +export function enload(data) { + + return request({ + url: '/system/placeName/importData', + method: 'post', + headers: { + 'Content-Type': 'multipart/form-data' + }, + data: data + }) +} \ No newline at end of file diff --git a/src/api/system/projectName.js b/src/api/system/projectName.js index 132366f..6d70882 100644 --- a/src/api/system/projectName.js +++ b/src/api/system/projectName.js @@ -42,3 +42,15 @@ method: 'delete' }) } +//瀵煎叆 +export function enload(data) { + + return request({ + url: '/system/projectName/importData', + method: 'post', + headers: { + 'Content-Type': 'multipart/form-data' + }, + data: data + }) +} \ No newline at end of file diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 5c31196..ff331fe 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -9,13 +9,13 @@ <template v-if="device!=='mobile'"> <search id="header-search" class="right-menu-item" /> - <el-tooltip content="婧愮爜鍦板潃" effect="dark" placement="bottom"> + <!-- <el-tooltip content="婧愮爜鍦板潃" effect="dark" placement="bottom"> <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" /> </el-tooltip> <el-tooltip content="鏂囨。鍦板潃" effect="dark" placement="bottom"> <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" /> - </el-tooltip> + </el-tooltip> --> <screenfull id="screenfull" class="right-menu-item hover-effect" /> diff --git a/src/views/archiveCategory/index.vue b/src/views/archiveCategory/index.vue index cdcc401..6e46542 100644 --- a/src/views/archiveCategory/index.vue +++ b/src/views/archiveCategory/index.vue @@ -65,6 +65,35 @@ @click="handleExport" v-hasPermi="['system:category:export']" >瀵煎嚭</el-button> + </el-col> + + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExportTemplate" + v-hasPermi="['system:category:export']" + >瀵煎叆妯℃澘涓嬭浇</el-button> + </el-col> + + <el-col :span="1.5"> + + <el-upload + action="" + + class="upload-demo" + :show-file-list="false" + :http-request="handleImport" + accept=".xlsx,.xls" + + > + <el-button size="mini" type="primary" + plain + icon="el-icon-top">瀵煎叆</el-button> + + </el-upload> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> @@ -121,7 +150,7 @@ </template> <script> -import { listCategory, getCategory, delCategory, addCategory, updateCategory } from "@/api/system/category" +import { listCategory, getCategory, delCategory, addCategory, updateCategory, enload } from "@/api/system/category" export default { name: "Category", @@ -253,6 +282,46 @@ this.download('system/category/export', { ...this.queryParams }, `category_${new Date().getTime()}.xlsx`) + }, + /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/ + handleExportTemplate() + { + this.download('/system/category/model', { + + }, `category_${new Date().getTime()}.xlsx`) + }, + /** 瀵煎叆鎿嶄綔*/ + async handleImport({file}){ + // 妫�鏌ユ枃浠剁被鍨嬫槸鍚︿负xlsx + // if (!params.file.name.endsWith('.xlsx')) { + // this.$message.error('璇蜂笂浼�.xlsx鏍煎紡鐨勬枃浠�'); + // return; + // } + const formData = new FormData(); + formData.append('file', file); + console.log(file) + + // 鏄剧ず鍔犺浇涓姸鎬� + const loading = this.$loading({ + lock: true, + text: '涓婁紶涓�...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + + enload(formData, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }).then(response => { + loading.close(); + this.$message.success('瀵煎叆鎴愬姛'); + this.getList(); + }).catch(error => { + loading.close(); + this.$message.error('瀵煎叆澶辫触: ' + (error.message || '鏈煡閿欒')); + }); + } } } diff --git a/src/views/archiveManager/archiveMaterial/index.vue b/src/views/archiveManager/archiveMaterial/index.vue index b0b9a5c..e9f1ffb 100644 --- a/src/views/archiveManager/archiveMaterial/index.vue +++ b/src/views/archiveManager/archiveMaterial/index.vue @@ -178,7 +178,7 @@ - <el-row :gutter="10" class="mb8"> + <el-row :gutter="12" class="mb8"> <el-col :span="1.5"> <el-button type="primary" @@ -220,6 +220,7 @@ @click="handleExport" v-hasPermi="['system:materials:export']" >瀵煎嚭</el-button> + </el-col> <el-col :span="1.5"> <el-button type="success" @@ -229,6 +230,8 @@ @click="handleImport" v-hasPermi="['system:materials:edit']" >鍏ㄩ儴闄勪欢瀵煎叆</el-button> + + <!-- 鍦ㄦ寜閽笅鏂规坊鍔犲鍏ュ璇濇 --> <el-dialog title="鎵归噺瀵煎叆闄勪欢" :visible.sync="importDialogVisible" width="50%"> <el-upload @@ -248,12 +251,38 @@ > <el-button slot="trigger" size="small" type="primary">閫夋嫨鏂囦欢</el-button> <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">涓婁紶鍒版湇鍔″櫒</el-button> - <div slot="tip" class="el-upload__tip">鍙笂浼燩DF/DOC/XLS/JPG绛夋牸寮忔枃浠讹紝鍗曚釜鏂囦欢涓嶈秴杩�50MB</div> + <div slot="tip" class="el-upload__tip">鍙笂浼燡PG绛夋牸寮忔枃浠讹紝鍗曚釜鏂囦欢涓嶈秴杩�50MB</div> </el-upload> </el-dialog> </el-col> - - </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExportTemplate" + v-hasPermi="['system:materials:edit']" + >瀵煎叆妯℃澘涓嬭浇</el-button> + </el-col> + + <el-col :span="1.5"> + + <el-upload + action="" + + class="upload-demo" + :show-file-list="false" + :http-request="handleImportData" + accept=".xlsx,.xls" + + > + <el-button size="mini" type="primary" + plain + icon="el-icon-top">瀵煎叆</el-button> + + </el-upload> + </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> @@ -657,7 +686,7 @@ </template> <script> - import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials" + import { listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials" import { getToken } from '@/utils/auth' export default { @@ -1032,7 +1061,50 @@ this.download('system/materials/export', { ...this.queryParams }, `materials_${new Date().getTime()}.xlsx`) - } + }, + + /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/ + handleExportTemplate() + { + this.download('/system/materials/model', { + + }, `materials_${new Date().getTime()}.xlsx`) + }, + /** 瀵煎叆鎿嶄綔*/ + async handleImportData({file}){ + // 妫�鏌ユ枃浠剁被鍨嬫槸鍚︿负xlsx + // if (!params.file.name.endsWith('.xlsx')) { + // this.$message.error('璇蜂笂浼�.xlsx鏍煎紡鐨勬枃浠�'); + // return; + // } + const formData = new FormData(); + formData.append('file', file); + formData.append('recordId', this.recordId) + alert(this.recordId) + console.log(file) + + // 鏄剧ず鍔犺浇涓姸鎬� + const loading = this.$loading({ + lock: true, + text: '涓婁紶涓�...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + + enload(formData, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }).then(response => { + loading.close(); + this.$message.success('瀵煎叆鎴愬姛'); + this.getList(); + }).catch(error => { + loading.close(); + this.$message.error('瀵煎叆澶辫触: ' + (error.message || '鏈煡閿欒')); + }); + + } } } </script> diff --git a/src/views/archivePlaceName/index.vue b/src/views/archivePlaceName/index.vue index a10a45d..c78fa6f 100644 --- a/src/views/archivePlaceName/index.vue +++ b/src/views/archivePlaceName/index.vue @@ -58,6 +58,35 @@ v-hasPermi="['system:name:export']" >瀵煎嚭</el-button> </el-col> + + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-download" + size="mini" + @click="handleExportTemplate" + v-hasPermi="['system:name:export']" + >瀵煎叆妯℃澘涓嬭浇</el-button> + </el-col> + + <el-col :span="1.5"> + + <el-upload + action="" + + class="upload-demo" + :show-file-list="false" + :http-request="handleImport" + accept=".xlsx,.xls" + + > + <el-button size="mini" type="primary" + plain + icon="el-icon-top">瀵煎叆</el-button> + + </el-upload> + </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> @@ -113,7 +142,7 @@ </template> <script> -import { listPlaceName, getName, delName, addName, updateName } from "@/api/system/placeName" +import { listPlaceName, enload,getName, delName, addName, updateName } from "@/api/system/placeName" export default { name: "Name", @@ -246,7 +275,49 @@ this.download('/system/placeName/export', { ...this.queryParams }, `name_${new Date().getTime()}.xlsx`) + }, + /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/ + handleExportTemplate() + { + + this.download('/system/placeName/model', { + + }, `placeName_${new Date().getTime()}.xlsx`) + }, + /** 瀵煎叆鎿嶄綔*/ + async handleImport({file}){ + // 妫�鏌ユ枃浠剁被鍨嬫槸鍚︿负xlsx + // if (!params.file.name.endsWith('.xlsx')) { + // this.$message.error('璇蜂笂浼�.xlsx鏍煎紡鐨勬枃浠�'); + // return; + // } + const formData = new FormData(); + formData.append('file', file); + console.log(file) + + // 鏄剧ず鍔犺浇涓姸鎬� + const loading = this.$loading({ + lock: true, + text: '涓婁紶涓�...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + + enload(formData, { + headers: { + 'Content-Type': 'multipart/form-data' } + }).then(response => { + loading.close(); + this.$message.success('瀵煎叆鎴愬姛'); + this.getList(); + }).catch(error => { + loading.close(); + this.$message.error('瀵煎叆澶辫触: ' + (error.message || '鏈煡閿欒')); + }); + + } + } } </script> diff --git a/src/views/archiveProjectName/index.vue b/src/views/archiveProjectName/index.vue index 53e0793..8ed9064 100644 --- a/src/views/archiveProjectName/index.vue +++ b/src/views/archiveProjectName/index.vue @@ -50,6 +50,35 @@ v-hasPermi="['system:projectName:export']" >瀵煎嚭</el-button> </el-col> + + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExportTemplate" + v-hasPermi="['system:category:export']" + >瀵煎叆妯℃澘涓嬭浇</el-button> + </el-col> + + <el-col :span="1.5"> + + <el-upload + action="" + + class="upload-demo" + :show-file-list="false" + :http-request="handleImport" + accept=".xlsx,.xls" + + > + <el-button size="mini" type="primary" + plain + icon="el-icon-top">瀵煎叆</el-button> + + </el-upload> + </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> @@ -57,6 +86,9 @@ <el-table-column type="selection" width="55" align="center" /> <!-- <el-table-column label="${comment}" align="center" prop="id" /> --> <el-table-column label="椤圭洰鍚嶇О" align="center" prop="name" /> + <el-table-column label="鍏徃鍚嶇О" align="center" prop="companyName" /> + <el-table-column label="椤圭洰璐熻矗浜�" align="center" prop="createPerson" /> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <el-button @@ -101,7 +133,7 @@ </template> <script> -import { listName, getName, delName, addName, updateName } from "@/api/system/projectName" +import { listName, getName, enload,delName, addName, updateName } from "@/api/system/projectName" export default { name: "Name", @@ -147,6 +179,7 @@ this.loading = true listName(this.queryParams).then(response => { this.nameList = response.data.data + console.log(response.data.data) this.total = response.data.total this.loading = false }) @@ -233,6 +266,47 @@ this.download('system/projectName/export', { ...this.queryParams }, `name_${new Date().getTime()}.xlsx`) + }, + /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/ + handleExportTemplate() + { + this.download('/system/projectName/model', { + + }, `projectName_${new Date().getTime()}.xlsx`) + }, + + /** 瀵煎叆鎿嶄綔*/ + async handleImport({file}){ + // 妫�鏌ユ枃浠剁被鍨嬫槸鍚︿负xlsx + // if (!params.file.name.endsWith('.xlsx')) { + // this.$message.error('璇蜂笂浼�.xlsx鏍煎紡鐨勬枃浠�'); + // return; + // } + const formData = new FormData(); + formData.append('file', file); + console.log(file) + + // 鏄剧ず鍔犺浇涓姸鎬� + const loading = this.$loading({ + lock: true, + text: '涓婁紶涓�...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + + enload(formData, { + headers: { + 'Content-Type': 'multipart/form-data' + } + }).then(response => { + loading.close(); + this.$message.success('瀵煎叆鎴愬姛'); + this.getList(); + }).catch(error => { + loading.close(); + this.$message.error('瀵煎叆澶辫触: ' + (error.message || '鏈煡閿欒')); + }); + } } } diff --git a/src/views/archiveStatics/index.vue b/src/views/archiveStatics/index.vue index 7c0b815..8801d9e 100644 --- a/src/views/archiveStatics/index.vue +++ b/src/views/archiveStatics/index.vue @@ -3,7 +3,7 @@ <el-row :gutter="10" class="mb8"> - <el-col :span="1.5"> + <!-- <el-col :span="1.5"> <el-button type="primary" plain @@ -34,7 +34,7 @@ @click="handleDelete" v-hasPermi="['system:records:remove']" >鍒犻櫎</el-button> - </el-col> + </el-col> --> <el-col :span="1.5"> <el-button type="warning" @@ -538,8 +538,9 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - this.download('system/records/export', { - ...this.queryParams + // alert(98) + this.download('system/records/exportAllStatis', { + // ...this.queryParams }, `records_${new Date().getTime()}.xlsx`) } } diff --git a/src/views/archiveToUserStatistic/index.vue b/src/views/archiveToUserStatistic/index.vue index 3f30e4c..5a5acdd 100644 --- a/src/views/archiveToUserStatistic/index.vue +++ b/src/views/archiveToUserStatistic/index.vue @@ -206,7 +206,6 @@ this.loading = true console.log(this.queryParams) console.log("--------------") - alert(123) listArchiverecordstouserStatistic(this.queryParams).then(response => { console.log(response) @@ -350,8 +349,8 @@ }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - this.download('system/records/export', { - ...this.queryParams + this.download('system/archiverecordstouser/exportArToUser', { + // ...this.queryParams }, `records_${new Date().getTime()}.xlsx`) } } diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 8019f56..f0b6185 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -358,7 +358,12 @@ /** 鏌ヨ鑿滃崟鏍戠粨鏋� */ getMenuTreeselect() { menuTreeselect().then(response => { - this.menuOptions = response.data + const hiddenMenuIds = [1, 2, 3]; + + this.menuOptions = response.data.filter(menu => !hiddenMenuIds.includes(menu.id) + ); + console.log(this.menuOptions) + }) }, // 鎵�鏈夎彍鍗曡妭鐐规暟鎹� diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index e8bcb1f..2bde078 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -103,11 +103,19 @@ <el-input v-model="form.nickName" placeholder="璇疯緭鍏ョ敤鎴锋樀绉�" maxlength="30" /> </el-form-item> </el-col> - <el-col :span="12"> + + <el-col :span="12"> + <el-form-item label="瑙掕壊"> + <el-select v-model="form.roleIds" multiple placeholder="璇烽�夋嫨瑙掕壊"> + <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option> + </el-select> + </el-form-item> + </el-col> + <!-- <el-col :span="12"> <el-form-item label="褰掑睘閮ㄩ棬" prop="deptId"> <treeselect v-model="form.deptId" :options="enabledDeptOptions" :show-count="true" placeholder="璇烽�夋嫨褰掑睘閮ㄩ棬" /> </el-form-item> - </el-col> + </el-col> --> </el-row> <el-row> <el-col :span="12"> @@ -150,20 +158,14 @@ </el-col> </el-row> <el-row> - <el-col :span="12"> + <!-- <el-col :span="12"> <el-form-item label="宀椾綅"> <el-select v-model="form.postIds" multiple placeholder="璇烽�夋嫨宀椾綅"> <el-option v-for="item in postOptions" :key="item.postId" :label="item.postName" :value="item.postId" :disabled="item.status == 1" ></el-option> </el-select> </el-form-item> - </el-col> - <el-col :span="12"> - <el-form-item label="瑙掕壊"> - <el-select v-model="form.roleIds" multiple placeholder="璇烽�夋嫨瑙掕壊"> - <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId" :disabled="item.status == 1"></el-option> - </el-select> - </el-form-item> - </el-col> + </el-col> --> + </el-row> <el-row> <el-col :span="24"> -- Gitblit v1.9.1