Commit 00ae9982 authored by 水落(YangLei)'s avatar 水落(YangLei)

feat: 代码优化,增加周报页面

parent 1b45a3e4
......@@ -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 });
}
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&paramCode=inspection_state&paramLocale=${langUtils.get()}`,
);
}
export function getBanZuListApi() {
return getReq(
`/api/v1/parameters/business/list?paramModule=rpis_route_schedule&paramCode=shift_type&paramLocale=${langUtils.get()}`,
);
}
export function getTaskTypeApi() {
return getReq(
`/api/v1/parameters/business/list?paramModule=rpis_route_schedule&paramCode=job_type&paramLocale=${langUtils.get()}`,
);
}
export function addXunJianTaskApi(data) {
return postReq('/ranger/inspection/api/v1/jobs/temporary', data);
}
......@@ -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) {
......
<template>
<a-week-picker
class="tw-w-full"
placeholder="Select week"
@change="change"
v-bind="$attrs"
v-on="$listeners"
/>
</template>
<script>
export default {
props: {
year: String,
week: String,
},
methods: {
change(val) {
this.$emit('update:week', val.week().toString());
this.$emit('update:year', val.year().toString());
},
},
};
</script>
import Index from './index.vue';
export default Index;
<template>
<Table url="/ranger/inspection/api/v1/analysis/reports/inspection/week" rowKey="remotrId">
<template #search="{ query }">
<MoreItem label="周">
<WeeklySelect placeholder="Select week" :week.sync="query.week" :year.sync="query.year" />
</MoreItem>
<MoreItem label="地区">
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="query.regionId"
labelFiled="regionName"
valueFiled="regionId"
/>
</MoreItem>
<MoreItem label="专业">
<UrlSelect
:url="
query.regionId
? `/ranger/inspection/api/v1/specialities/valid/regions/${query.regionId}/list`
: ''
"
v-model="query.specialityId"
labelFiled="specialityName"
valueFiled="specialityId"
/>
</MoreItem>
</template>
<a-table-column title="报表名称" data-index="routeName" />
<a-table-column title="地区" data-index="specialityName" />
<a-table-column title="专业" data-index="regionName" />
<a-table-column title="年" data-index="shiftTypeName" />
<!-- <a-table-column title="周" data-index="shiftTypeName" />
<a-table-column title="任务数" data-index="shiftTypeName" />
<a-table-column title="项目数" data-index="shiftTypeName" />
<a-table-column title="正常数" data-index="shiftTypeName" />
<a-table-column title="异常数" data-index="shiftTypeName" />
<a-table-column title="已检数" data-index="shiftTypeName" />
<a-table-column title="免检数" data-index="shiftTypeName" />
<a-table-column title="未检数" data-index="shiftTypeName" />
<a-table-column title="未检率" data-index="shiftTypeName" />
<a-table-column title="异常率" data-index="shiftTypeName" /> -->
</Table>
</template>
<script>
import Table from '@/components/table/table.vue';
import MoreItem from '@/components/table/more_item.vue';
import UrlSelect from '@/components/MySelect/url_select.vue';
import WeeklySelect from '@/components/table/weekly_select.vue';
export default {
components: { Table, MoreItem, UrlSelect, WeeklySelect },
};
</script>
......@@ -2,8 +2,8 @@
<Wraper :hidden="hidden" :onOk="submit" :refresh="refresh">
<a-form-model layout="vertical" :model="form" :rules="rules" ref="form">
<a-form-model-item label="地区" prop="regionId">
<RequestSelect
:request="getAreaListDataApi"
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="form.regionId"
labelFiled="regionName"
valueFiled="regionId"
......@@ -56,7 +56,7 @@ import Wraper from '@/components/table/wraper.vue';
import RequestSelect from '@/components/MySelect/RequestSelect.vue';
import SearchSelect from '@/components/MySelect/search_select.vue';
import UrlSelect from '@/components/MySelect/url_select.vue';
import { getAreaListDataApi, getBanZuListApi, addXunJianTaskApi } from '@/api';
import { getStaticDataByTwoParamsApi, addXunJianTaskApi } from '@/api';
export default {
props: {
......@@ -66,8 +66,7 @@ export default {
components: { Wraper, RequestSelect, SearchSelect, UrlSelect },
data() {
return {
getAreaListDataApi,
getBanZuListApi,
getBanZuListApi: getStaticDataByTwoParamsApi('rpis_route_schedule', 'shift_type'),
form: {},
rules: {
inspectionIdList: [{ required: true }],
......
......@@ -27,8 +27,8 @@
/>
</MoreItem>
<MoreItem label="地区">
<RequestSelect
:request="getAreaListDataApi"
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="query.regionId"
labelFiled="regionName"
valueFiled="regionId"
......@@ -54,8 +54,8 @@
/>
</MoreItem>
<MoreItem label="地区">
<RequestSelect
:request="getAreaListDataApi"
<UrlSelect
url="/ranger/inspection/api/v1/region/list"
v-model="query.regionId"
labelFiled="regionName"
valueFiled="regionId"
......@@ -151,7 +151,7 @@ import { getXunJianDownloadUrlApi } from '@/api';
import { downloadFileByUrl } from '@/utils';
import RequestSelect from '@/components/MySelect/RequestSelect.vue';
import SearchSelect from '@/components/MySelect/search_select.vue';
import { getAreaListDataApi, getBusinessListApi, getBanZuListApi, getTaskTypeApi } from '@/api';
import { getStaticDataByTwoParamsApi } from '@/api';
import Progress from './progress.vue';
import Detail from './detail.vue';
import MoreItem from '@/components/table/more_item.vue';
......@@ -169,10 +169,9 @@ export default {
},
data() {
return {
getAreaListDataApi,
getBusinessListApi,
getBanZuListApi,
getTaskTypeApi,
getBusinessListApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'inspection_state'),
getBanZuListApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'shift_type'),
getTaskTypeApi: () => getStaticDataByTwoParamsApi('rpis_route_schedule', 'job_type'),
addBtn: {
title: '新建临时任务',
},
......
......@@ -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'),
},
],
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment