From add09862de83e0935d07988a783bc0ce45ff7b28 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Wed, 15 Feb 2023 17:34:25 +0800 Subject: [PATCH] 2023-2-15 --- src/api/yearScore/yearScoreDetail.js | 59 +++++++++ src/components/XyTable/index.vue | 4 +- src/store/modules/permission.js | 63 +++++---- .../component/importRecruitInfo.vue | 2 +- .../unifiedRecruitment/component/init.vue | 46 +++---- .../unifiedRecruitment/component/setting.vue | 35 ++--- src/views/unifiedRecruitment/recruit.vue | 15 ++- .../yearScore/component/addYearScore.vue | 14 +- src/views/yearScore/component/imports.vue | 124 ++++++++++++++++++ src/views/yearScore/yearScore.vue | 108 +++++++++++++-- 10 files changed, 376 insertions(+), 94 deletions(-) create mode 100644 src/api/yearScore/yearScoreDetail.js create mode 100644 src/views/yearScore/component/imports.vue diff --git a/src/api/yearScore/yearScoreDetail.js b/src/api/yearScore/yearScoreDetail.js new file mode 100644 index 0000000..5433ca2 --- /dev/null +++ b/src/api/yearScore/yearScoreDetail.js @@ -0,0 +1,59 @@ +import request from "@/utils/request"; +import qs from 'qs'; + +export function index(params,isLoading = true){ + return request({ + url:"/api/admin/year_socre_detail/index", + method:"get", + isLoading, + params + }) +} + +export function show(params,isLoading = true){ + return request({ + url:"/api/admin/year_socre_detail/show", + method:"get", + isLoading, + params + }) +} + +export function save(data,isLoading = true){ + return request({ + url:"/api/admin/year_socre_detail/save", + method:"post", + data, + isLoading + }) +} + +export function destroy(params,isLoading = true){ + return request({ + url:"/api/admin/year_socre_detail/destroy", + method:"get", + params, + isLoading + }) +} + +export function excelAnalyse(data,isLoading = true){ + return request({ + url:"/api/admin/year_socre_detail/excel_analyse", + method:"post", + data, + isLoading + }) +} + +export function imports(data,isLoading = true){ + return request({ + url:"/api/admin/year_socre_detail/import", + method:"post", + data:qs.stringify(data), + isLoading, + headers:{ + 'Content-Type':'application/x-www-form-urlencoded' + } + }) +} diff --git a/src/components/XyTable/index.vue b/src/components/XyTable/index.vue index 9251311..b2da2e6 100644 --- a/src/components/XyTable/index.vue +++ b/src/components/XyTable/index.vue @@ -618,7 +618,7 @@ export default { } }, created() { - this.getTableData(); + if(this.action) this.getTableData(); }, mounted() { this.initLoad(); @@ -692,7 +692,7 @@ export default { ["expand-change"]: this.expandChange, }} > - {this.tableItem.map((item, index) => { + {this.tableFormat.map((item, index) => { if ($scopedSlots[item.prop]) { return $scopedSlots[item.prop](item, index); } diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 7876b7c..16addc7 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -60,17 +60,27 @@ const state = { * 后台查询的菜单数据拼装成路由格式的数据 * @param routes */ -const pathHandler = (path,id) => { - if(path.includes('$')){ - return path.replace(/^\$+/g,"") +const pathHandler = (item) => { + if(!item.path || item.path?.includes('#') || item.path == ''){ + return item.id + '_key' } - if(path.includes('^')){ - return path.replace(/^\^+/g,"") + if(/^\^/.test(item.path)){ + return item.path.replace(/^\^+/g,"") } - if(path.includes('#') || path == ''){ - return id + '_key' + if(/^\$/.test(item.path)){ + return item.path.replace(/^\$+/g,"") } - return path + return item.path + // if(path.includes('$')){ + // return path.replace(/^\$+/g,"") + // } + // if(path.includes('^')){ + // return path.replace(/^\^+/g,"") + // } + // if(path.includes('#') || path == ''){ + // return id + '_key' + // } + // return path } const componentHandler = (path) => { //return path === '#'|| path == '' ? Layout : loadView(path) @@ -80,34 +90,34 @@ const componentHandler = (path) => { if(path.includes('#') && path !== '#'){ return ()=>import('@/layout/noLayout') } - if(path.includes('$')){ - return loadView(path.replace(/^\$+/g,"")) - } - if(path.includes('^')){ - return loadView(path.replace(/^\^+/g,"")) - } return loadView(path) } -// 为#,左边栏根目录无视图,##下级根目录无视图,$不显示在左边栏视图,^左边栏根目录有视图 +// path为#,左边栏根目录无视图,##下级根目录无视图,$不显示在左边栏视图,^左边栏根目录有视图 export function generaMenu(routes, data) { data.forEach(item => { - + let params; + if(item.path?.includes('?')){ + let flag = item.path.split('?') + item.path = flag[0] + params = flag[1] + } if (item.url === "/") { - } else if(/^\^/.test(item.url)){ + } else if(/^\^/.test(item.path)){ const menu = { - path: pathHandler(item.url,item.id), + path: pathHandler(item), component: Layout, children: [{ path: "", name: 'menu_' + item.id, - component: componentHandler(item.url), + component: (item.url.includes('#')||item.path == '') ? Layout : loadView(item.url), meta: { title: item.name, id: item.id, roles: ['admin'], auths:item.has_auth_node_tags, + params, icon: item.icon } @@ -119,7 +129,7 @@ export function generaMenu(routes, data) { routes.push(menu) } else { const menu = { - path: pathHandler(item.url,item.id), + path: pathHandler(item), //(item.path === '#'||item.path == '' ? item.id + '_key' : item.path), component: componentHandler(item.url), //(item.path === '#'||item.path == '' ? Layout : loadView(item.path)), @@ -135,7 +145,7 @@ export function generaMenu(routes, data) { icon: item.icon } } - if(item.url.includes("$")){ + if(item.path?.includes("$")){ menu.hidden = true } if (item.children) { @@ -143,12 +153,13 @@ export function generaMenu(routes, data) { } routes.push(menu) } + }) - routes.push({ - path: '*', - redirect: '/404', - hidden: true - }) + // routes.push({ + // path: '*', + // redirect: '/404', + // hidden: true + // }) } const mutations = { diff --git a/src/views/unifiedRecruitment/component/importRecruitInfo.vue b/src/views/unifiedRecruitment/component/importRecruitInfo.vue index b54d56a..6a895a3 100644 --- a/src/views/unifiedRecruitment/component/importRecruitInfo.vue +++ b/src/views/unifiedRecruitment/component/importRecruitInfo.vue @@ -3,7 +3,7 @@
diff --git a/src/views/unifiedRecruitment/component/init.vue b/src/views/unifiedRecruitment/component/init.vue index 19a12fe..a35a043 100644 --- a/src/views/unifiedRecruitment/component/init.vue +++ b/src/views/unifiedRecruitment/component/init.vue @@ -2,8 +2,8 @@
@@ -31,8 +25,7 @@
录取省份
diff --git a/src/views/unifiedRecruitment/component/setting.vue b/src/views/unifiedRecruitment/component/setting.vue index a59d6fa..a489d57 100644 --- a/src/views/unifiedRecruitment/component/setting.vue +++ b/src/views/unifiedRecruitment/component/setting.vue @@ -3,24 +3,29 @@ - - - 添加 - - - - - +
+ + + + + + 添加 +
+ + 添加 + + +
diff --git a/src/views/unifiedRecruitment/recruit.vue b/src/views/unifiedRecruitment/recruit.vue index 4a817d0..72630fd 100644 --- a/src/views/unifiedRecruitment/recruit.vue +++ b/src/views/unifiedRecruitment/recruit.vue @@ -38,7 +38,18 @@ > -