From 00ae998234cad13f7a52bf207394a671f04ccb2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B0=B4=E8=90=BD=28YangLei=29?= Date: Mon, 12 Jul 2021 15:50:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=91=A8=E6=8A=A5=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 10 +++- src/api/xunjian.js | 23 -------- src/components/table/table.vue | 1 + src/components/table/weekly_select.vue | 24 ++++++++ src/pages/xunjian/report/weekly/index.js | 3 + src/pages/xunjian/report/weekly/index.vue | 55 +++++++++++++++++++ .../xunjian/task_managment/center/form.vue | 9 ++- .../xunjian/task_managment/center/index.vue | 17 +++--- src/router/config.js | 14 ++++- 9 files changed, 115 insertions(+), 41 deletions(-) create mode 100644 src/components/table/weekly_select.vue create mode 100644 src/pages/xunjian/report/weekly/index.js create mode 100644 src/pages/xunjian/report/weekly/index.vue diff --git a/src/api/index.js b/src/api/index.js index 344e86d..f46d324 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -8,11 +8,11 @@ export * from './xunjian'; export function getUserDetailInfoApi() { return request('/api/v1/detail', METHOD.GET); } -export const getStaticParam = async staticKey => { +export const getStaticParam = async (staticKey) => { const res = await request('/api/v1/parameters/business/multi/list', METHOD.GET, { queryList: staticKey, }); - const curData = res.find(i => i.key === staticKey); + const curData = res.find((i) => i.key === staticKey); const newData = await formatObj(curData.businessParameterList || [], { value: 'paramValue', label: 'paramName', @@ -21,7 +21,7 @@ export const getStaticParam = async staticKey => { return newData; }; -export const getStaticDataApi = async data => { +export const getStaticDataApi = async (data) => { const res = await request('/api/v1/parameters/business/list', METHOD.GET, { ...data, paramLocale: Lang.get(), @@ -33,3 +33,7 @@ export const getStaticDataApi = async data => { }); return newData; }; + +export function getStaticDataByTwoParamsApi(paramModule, paramCode) { + return getStaticDataApi({ paramModule, paramCode }); +} diff --git a/src/api/xunjian.js b/src/api/xunjian.js index d4d106f..8f733ca 100644 --- a/src/api/xunjian.js +++ b/src/api/xunjian.js @@ -1,32 +1,9 @@ import { getReq, postReq } from '@/utils/requestUtil'; -import langUtils from '@/utils/langUtils'; export function getXunJianDownloadUrlApi(idList) { return getReq('/ranger/inspection/api/v1/jobs/export', { jobIdList: idList.join(',') }); } -export function getAreaListDataApi() { - return getReq(`/ranger/inspection/api/v1/region/list`); -} - -export function getBusinessListApi() { - return getReq( - `/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=inspection_state¶mLocale=${langUtils.get()}`, - ); -} - -export function getBanZuListApi() { - return getReq( - `/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=shift_type¶mLocale=${langUtils.get()}`, - ); -} - -export function getTaskTypeApi() { - return getReq( - `/api/v1/parameters/business/list?paramModule=rpis_route_schedule¶mCode=job_type¶mLocale=${langUtils.get()}`, - ); -} - export function addXunJianTaskApi(data) { return postReq('/ranger/inspection/api/v1/jobs/temporary', data); } diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 1d3f085..f74b18f 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -163,6 +163,7 @@ export default { methods: { async getData() { this.loading = true; + console.log(this.queryForm); try { this.noPage ? await this.getDataNoPage() : await this.getDataWithPage(); } catch (error) { diff --git a/src/components/table/weekly_select.vue b/src/components/table/weekly_select.vue new file mode 100644 index 0000000..a6f8c3b --- /dev/null +++ b/src/components/table/weekly_select.vue @@ -0,0 +1,24 @@ + + + diff --git a/src/pages/xunjian/report/weekly/index.js b/src/pages/xunjian/report/weekly/index.js new file mode 100644 index 0000000..65e6b7a --- /dev/null +++ b/src/pages/xunjian/report/weekly/index.js @@ -0,0 +1,3 @@ +import Index from './index.vue'; + +export default Index; diff --git a/src/pages/xunjian/report/weekly/index.vue b/src/pages/xunjian/report/weekly/index.vue new file mode 100644 index 0000000..04257ef --- /dev/null +++ b/src/pages/xunjian/report/weekly/index.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/pages/xunjian/task_managment/center/form.vue b/src/pages/xunjian/task_managment/center/form.vue index d92ed28..abd319d 100644 --- a/src/pages/xunjian/task_managment/center/form.vue +++ b/src/pages/xunjian/task_managment/center/form.vue @@ -2,8 +2,8 @@ - - - getStaticDataByTwoParamsApi('rpis_route_schedule', 'inspection_state'), + getBanZuListApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'shift_type'), + getTaskTypeApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'job_type'), addBtn: { title: '新建临时任务', }, diff --git a/src/router/config.js b/src/router/config.js index fd033fb..f56b1ff 100644 --- a/src/router/config.js +++ b/src/router/config.js @@ -68,7 +68,19 @@ const hasAuthorityRoutes = [ { path: 'center', name: '任务中心', - component: () => import('@/pages/xunjian/task_managment/center/index'), + component: () => import('@/pages/xunjian/task_managment/center'), + }, + ], + }, + { + path: 'report', + name: '报表中心', + component: RouterView, + children: [ + { + path: 'week', + name: '巡检周报', + component: () => import('@/pages/xunjian/report/weekly'), }, ], }, -- GitLab