diff --git a/src/api/dictionary/index.ts b/src/api/dictionary/index.ts index 91bfe28..a97ca0c 100644 --- a/src/api/dictionary/index.ts +++ b/src/api/dictionary/index.ts @@ -1,5 +1,5 @@ import { http } from '@/utils/http/axios' -import type { PageParam } from '/#/api' +import type { BusinessParam, PageParam } from '/#/api' /** * 获取地区列表 @@ -315,3 +315,69 @@ export async function getBackList() { const list = res.data return list } + +/** + * 业务字典查询接口 + * @returns + */ +export async function getBusinessList(field: string, page: PageParam = { pageNo: 1, pageSize: 200 }) { + const res = await http.request({ + url: `/ocr/dictionary/getDictionaryByField`, + method: 'get', + params: { ...page, field }, + }) + + const { otherMessage: { records } } = res + return records.map((record) => { + return { + label: record.lable || 'todo', + value: record.value || 'todo', + } + }) +} + +/** + * 业务字典查询接口 + * @returns + */ +export async function getSystemList(code: string) { + const res = await http.request({ + url: `/static/admin/web/distionary/bytypecode`, + method: 'get', + params: { code }, + }) + + const { otherMessage: { records } } = res + return records.map((record) => { + return { + label: record.lable || 'todo', + value: record.value || 'todo', + } + }) +} + +/** + * 获取筛选关系字典 + * @returns + */ +export async function getRelationTypeList() { + const res = await http.request({ + url: `/static/admin/web/distionary/bytypecode/searchRelationType`, + method: 'get', + }) + + return res.data[0].distionaryList +} + +/** + * 获取审核状态字典 + * @returns + */ +export async function getizstatusList() { + const res = await http.request({ + url: `/static/admin/web/distionary/bytypecode/izstatus`, + method: 'get', + }) + + return res.data[0].distionaryList +} diff --git a/src/api/home/filter.ts b/src/api/home/filter.ts index 7287f1b..353a0b1 100644 --- a/src/api/home/filter.ts +++ b/src/api/home/filter.ts @@ -6,13 +6,14 @@ import type { FilterCondition, FilterParam, FilterSearchParam, FilterUpdate, Pag * @param params * @returns 1 */ -export async function getConditionList(params: PageParam, searchParam: FilterSearchParam): Promise { +export async function getConditionList(page: PageParam, searchParam: FilterSearchParam, type: number): Promise { const res = await http.request({ url: `/ocr/ocrUsersearch/list?`, method: 'get', params: { - ...params, + ...page, search_searchname: JSON.stringify(searchParam.search_searchname), + type, }, }) @@ -56,7 +57,7 @@ export async function updateCondition(params: FilterUpdate) { export async function deleteCondition(params: { ids: string }) { return http.request({ url: `/ocr/ocrUsersearch/deleteBatch`, - method: 'delete', + method: 'get', params, }) } @@ -65,10 +66,11 @@ export async function deleteCondition(params: { ids: string }) { * 获取设置为显示的筛选 * @returns */ -export async function getFilter(): Promise { +export async function getFilter(type: number): Promise { return http.request({ url: `/ocr/ocrSearchmanager/query`, method: 'get', + params: { type }, }) } diff --git a/src/api/task/task.ts b/src/api/task/task.ts index 1d711d0..1be74e1 100644 --- a/src/api/task/task.ts +++ b/src/api/task/task.ts @@ -7,11 +7,11 @@ import { ContentTypeEnum } from '@/enums/httpEnum' * 获取审核列表 * @returns */ -export async function getApprovalList(params: PageParam, assigneeId: string) { +export async function getApprovalList(page: PageParam, assigneeId: string) { const res = await http.request({ - url: `/flow/task/listdata`, + url: `/flow/task/listalldata`, method: 'get', - params: { ...params, assigneeId }, + params: { pageSize: page.pageSize, currPage: page.pageNo, assigneeId }, }) const { data: { list, totalPage } } = res diff --git a/src/assets/images/avatar.jpg b/src/assets/images/avatar.jpg new file mode 100644 index 0000000..428ae6e Binary files /dev/null and b/src/assets/images/avatar.jpg differ diff --git a/src/config/1.json b/src/config/1.json new file mode 100644 index 0000000..911d159 --- /dev/null +++ b/src/config/1.json @@ -0,0 +1,52 @@ +export const asideMap: Recordable = { + izupuser: { + label: '提报人', + defaultValue: null, + isDefaultFilter: true, + key: 'izupuser', + component: ReportUserVue, + }, + izproject: { + label: '所属项目', + defaultValue: null, + isDefaultFilter: true, + key: 'izproject', + component: IzProjectVue, + }, + izplan: { + label: '所属计划', + defaultValue: null, + isDefaultFilter: true, + key: 'izplan', + component: PlanVue, + }, + izstatus: { + label: '审批状态', + defaultValue: null, + isDefaultFilter: false, + key: 'izstatus', + component: PlanVue, // todo + }, + izuptime: { + label: '提报时间', + defaultValue: null, + isDefaultFilter: false, + key: 'izuptime', + component: TimeVue, + }, + iztaskrrom: { + label: '任务来源', + defaultValue: null, + isDefaultFilter: false, + key: 'iztaskrrom', + component: IztaskrromVue, + }, + izshowall: { + label: '显示全部任务数据', + defaultValue: true, + isDefaultFilter: false, + key: 'izshowall', + component: PictureDownloadVue, + inFilterList: false, + }, +} diff --git a/src/config/aside.ts b/src/config/aside.ts index 96d5bc2..1a1b6fd 100644 --- a/src/config/aside.ts +++ b/src/config/aside.ts @@ -42,13 +42,13 @@ export const asideMap: Recordable = { key: 'izplan', component: PlanVue, }, - // izsimilarity: { - // label: '相似度阈值', - // defaultValue: [0,100], - // isDefaultFilter: false, - // key: 'izsimilarity', - // component: SimilarityVue, - // }, + izsimilarity: { + label: '相似度阈值', + defaultValue: [0, 100], + isDefaultFilter: false, + key: 'izsimilarity', + component: SimilarityVue, + }, izyear: { label: '年份', defaultValue: null, @@ -69,6 +69,7 @@ export const asideMap: Recordable = { isDefaultFilter: false, key: 'izupload', component: PictureUploadVue, + inFilterList: false, }, izcustomtype: { label: '客户类型', diff --git a/src/config/final.ts b/src/config/final.ts index 4edf17d..e338520 100644 --- a/src/config/final.ts +++ b/src/config/final.ts @@ -1,3 +1,6 @@ +import type { AsideEntity } from './aside' +import { IzProjectVue, IztaskrromVue, PictureDownloadVue, PlanVue, ReportUserVue, TimeVue } from '@/views/home/aside/comp/items' + export interface RowData { id: string fromtaskname: string @@ -72,3 +75,57 @@ export function findKey(columns: any[], header: string) { const item = columns.find((column) => { return (column as any).title === header }) return (item as any).key } + +// 终审左侧配置 +export const asideMap: Recordable = { + izupuser: { + label: '提报人', + defaultValue: null, + isDefaultFilter: true, + key: 'izupuser', + component: ReportUserVue, + }, + izproject: { + label: '所属项目', + defaultValue: null, + isDefaultFilter: true, + key: 'izproject', + component: IzProjectVue, + }, + izplan: { + label: '所属计划', + defaultValue: null, + isDefaultFilter: true, + key: 'izplan', + component: PlanVue, + }, + izstatus: { + label: '审批状态', + defaultValue: null, + isDefaultFilter: false, + key: 'izstatus', + component: PlanVue, // todo + }, + izuptime: { + label: '提报时间', + defaultValue: null, + isDefaultFilter: false, + key: 'izuptime', + component: TimeVue, + }, + iztaskrrom: { + label: '任务来源', + defaultValue: null, + isDefaultFilter: false, + key: 'iztaskrrom', + component: IztaskrromVue, + }, + izshowall: { + label: '显示全部任务数据', + defaultValue: true, + isDefaultFilter: false, + key: 'izshowall', + component: PictureDownloadVue, + inFilterList: false, + }, +} diff --git a/src/store/modules/asideConfig.ts b/src/store/modules/asideConfig.ts index 90e765f..721eb2a 100644 --- a/src/store/modules/asideConfig.ts +++ b/src/store/modules/asideConfig.ts @@ -7,7 +7,7 @@ import type { AsideConfig } from '/#/api' export interface ConfigState { systemConfig: AsideConfig | null - customConfig: any + customConfig: string[] | null asideValue: any } @@ -22,7 +22,7 @@ export const useAsideConfigStore = defineStore({ getConfig(): AsideConfig | null { return this.systemConfig }, - getCustomConfig(): any { + getCustomConfig(): string[] | null { return this.customConfig }, getAsideValue(): any { @@ -33,9 +33,6 @@ export const useAsideConfigStore = defineStore({ setConfig(config: AsideConfig) { this.systemConfig = config }, - setCustomConfig(config: any) { - this.customConfig = config - }, setAsideValue(value) { this.asideValue = value }, @@ -47,9 +44,11 @@ export const useAsideConfigStore = defineStore({ }, // 获取个性化配置 async fetchCustomConfig() { - const response = await getFilter() - this.setCustomConfig(response.data) - return response.data + const res = await getFilter(0) + const { data } = res + const list = data && data.searchcount ? data.searchcount.split(',') : [] + this.customConfig = list + return list }, }, }) diff --git a/src/store/modules/dictonary.ts b/src/store/modules/dictonary.ts index 391ec58..ac5b6af 100644 --- a/src/store/modules/dictonary.ts +++ b/src/store/modules/dictonary.ts @@ -1,6 +1,6 @@ import { defineStore } from 'pinia' import { store } from '@/store' -import { getBackList, getIzCustomtypeList, getIzProjectList, getIzShowList, getIzcustomlevel, getIzfirmList, getIzproductnameList, getIzprojecttypeList, getIztaskrromList, getIztaskstatusList, getIzvisitcityList, getIzvisitproList, getPersonList, getPictureTypeList, getPlanList, getRegionList, getRejectList, getTFList, getizcustomnameList } from '@/api/dictionary' +import { getBackList, getBusinessList, getIzShowList, getIztaskstatusList, getPictureTypeList, getRegionList, getRejectList, getRelationTypeList, getTFList, getizstatusList } from '@/api/dictionary' export interface DictionaryState { regionList: any @@ -22,6 +22,8 @@ export interface DictionaryState { izvisitcityList: any rejectList: any backList: any + relationTypeList: any + izstatusList: any } export const useDictionaryStore = defineStore({ @@ -46,6 +48,8 @@ export const useDictionaryStore = defineStore({ izvisitcityList: null, rejectList: null, backList: null, + relationTypeList: null, + izstatusList: null, }), getters: { getRegionList: (state) => { @@ -112,14 +116,14 @@ export const useDictionaryStore = defineStore({ }, // 获取提报人列表 async fetchPersionList() { - const list = await getPersonList() - this.personList = generateOptions(list, 'id', 'upname') + const list = await getBusinessList('person') + this.personList = list return this.personList }, // 获取计划列表 async fetchPlanList() { - const list = await getPlanList() - this.planList = generateOptions(list, 'id', 'planname') + const list = await getBusinessList('plan') + this.planList = list return this.planList }, // 获取图片真假原因 @@ -134,71 +138,96 @@ export const useDictionaryStore = defineStore({ this.izShowList = generateOptions2(list, 'id', 'classname') return this.izShowList }, + // 所属项目 async fetchIzProjectList() { - const list = await getIzProjectList() - this.izProjectList = generateOptions(list, 'id', 'categoryname') + const list = await getBusinessList('project') + this.izProjectList = list return this.izProjectList }, + // 任务来源 async fetchIztaskrromList() { - const list = await getIztaskrromList('1') - this.izCustomtypeList = generateOptions(list) - return this.izCustomtypeList + const list = await getBusinessList('iztaskrrom') + this.iztaskrromList = list + return this.iztaskrromList }, + // 任务状态 async fetchIztaskstatusList() { - const list = await getIztaskstatusList('1') - this.iztaskstatusList = generateOptions(list) + const list = await getBusinessList('iztaskstatus') + this.iztaskstatusList = list return this.iztaskstatusList }, + // 地区(省信息) async fetchIzvisitproList() { - const list = await getIzvisitproList() - this.izvisitproList = generateOptions(list, 'id', 'proname') + const list = await getBusinessList('izvisitpro') + this.izvisitproList = list return this.izvisitproList }, + // 厂商 async fetchIzfirmList() { - const list = await getIzfirmList('1') - this.izfirmList = generateOptions(list) + const list = await getBusinessList('izfirm') + this.izfirmList = list return this.izfirmList }, + // 产品名称 async fetchIzproductnameList() { - const list = await getIzproductnameList('1') - this.izproductnameList = generateOptions(list) + const list = await getBusinessList('izproductname') + this.izproductnameList = list return this.izproductnameList }, + // 客户名称 async fetchizcustomnameList() { - const list = await getizcustomnameList('1') - this.izcustomnameList = generateOptions(list) + const list = await getBusinessList('izcustomname') + this.izcustomnameList = list return this.izcustomnameList }, + // 客户类型 async fetchIzCustomtypeList() { - const list = await getIzCustomtypeList() - this.izCustomtypeList = generateOptions(list) + const list = await getBusinessList('izcustomtype') + this.izCustomtypeList = list return this.izCustomtypeList }, + // 客户级别 async fetchIzcustomlevelList() { - const list = await getIzcustomlevel('1') - this.izcustomlevelList = generateOptions(list) + const list = await getBusinessList('izcustomlevel') + this.izcustomlevelList = list return this.izcustomlevelList }, + // 项目类别 async fetchizizprojecttypeList() { - const list = await getIzprojecttypeList('1') - this.izizprojecttypeList = generateOptions(list) + const list = await getBusinessList('izprojecttype') + this.izizprojecttypeList = list return this.izizprojecttypeList }, + // 发布地区 async fetchizvisitcityList() { - const list = await getIzvisitcityList() - this.izvisitcityList = generateOptions(list) + const list = await getBusinessList('izvisitcity') + this.izvisitcityList = list return this.izvisitcityList }, + // 拒绝原因 async fetchRejectList() { const list = await getRejectList() this.rejectList = generateOptions(list) return this.rejectList }, + // 退回方式 async fetchBackList() { const list = await getBackList() this.backList = generateOptions(list) return this.backList }, + // 退回方式 + async fetchRelationTypeList() { + const list = await getRelationTypeList() + this.relationTypeList = generateOptions2(list, 'content', 'name') + return this.relationTypeList + }, + // 审核状态 + async fetchizstatusListt() { + const list = await getizstatusList() + this.izstatusList = generateOptions2(list, 'codeno', 'name') + return this.backList + }, }, }) @@ -208,25 +237,25 @@ export function useDictionary() { } // label和value都是name,不用id -function generateOptions(list: any[], idkey: string = 'id', namekey: string = 'name') { +function generateOptions(list: any[], valueKey: string = 'id', labelKey: string = 'name') { const items = list || [] return items.map((item) => { return { - label: item[namekey] || 'todo', - value: item[namekey] || 'todo', + label: item[labelKey] || 'todo', + value: item[labelKey] || 'todo', } }) } // label是name,value是id -function generateOptions2(list: any[], idkey: string = 'id', namekey: string = 'name') { +function generateOptions2(list: any[], valueKey: string = 'id', labelKey: string = 'name') { const items = list || [] return items.map((item) => { return { - label: item[namekey] || 'todo', - value: item[idkey] || 'todo', + label: item[labelKey] || 'todo', + value: item[valueKey] || 'todo', } }) } diff --git a/src/store/modules/final.ts b/src/store/modules/final.ts new file mode 100644 index 0000000..909ff65 --- /dev/null +++ b/src/store/modules/final.ts @@ -0,0 +1,42 @@ +import { defineStore } from 'pinia' +import { store } from '@/store' +import { getFilter } from '@/api/home/filter' + +export interface ConfigState { + customConfig: string[] | null + asideValue: any +} + +export const useFinalStore = defineStore({ + id: 'app-final', + state: (): ConfigState => ({ + customConfig: null, + asideValue: null, + }), + getters: { + getCustomConfig(): string[] | null { + return this.customConfig + }, + getAsideValue(): any { + return this.asideValue + }, + }, + actions: { + setAsideValue(value) { + this.asideValue = value + }, + // 获取终审个性化配置 + async fetchCustomConfig() { + const res = await getFilter(1) + const { data } = res + const list = data && data.searchcount ? data.searchcount.split(',') : [] + this.customConfig = list + return list + }, + }, +}) + +// Need to be used outside the setup +export function useFinal() { + return useFinalStore(store) +} diff --git a/src/store/modules/task.ts b/src/store/modules/task.ts index 26253d8..869f655 100644 --- a/src/store/modules/task.ts +++ b/src/store/modules/task.ts @@ -45,15 +45,15 @@ export const useTaskStore = defineStore({ }, async fetchApprovalList(pagination, id, refresh?: boolean) { const res = await getApprovalList(pagination, id) - this.setApprovalList(res.data) if (res.data.length > 0) { + this.setApprovalList(res.data) this.setActive(0) // 审批操作完成后,需要刷新,为防止activeId在刷新后值不变,通过此值刷新 this.refresh = !this.refresh } - return res.data + return res }, updateImmersion() { this.immersion = !this.immersion diff --git a/src/views/final/aside/Aside.vue b/src/views/final/aside/Aside.vue index d4efaf5..70ae259 100644 --- a/src/views/final/aside/Aside.vue +++ b/src/views/final/aside/Aside.vue @@ -1,21 +1,21 @@ @@ -179,10 +179,6 @@ watch(asideValue, (newVal) => { v-model:value="asideValue[item.key]" :label="item.config.label" /> - - - - @@ -217,7 +213,7 @@ watch(asideValue, (newVal) => { height: 100%; background: #507afd; position: absolute; - right: 0; + right: -2px; top: 0; z-index: 18; } diff --git a/src/views/final/comp/CustomFilterModalVue.vue b/src/views/final/comp/CustomFilterModalVue.vue new file mode 100644 index 0000000..1d8a67c --- /dev/null +++ b/src/views/final/comp/CustomFilterModalVue.vue @@ -0,0 +1,417 @@ + + + + + diff --git a/src/views/final/comp/index.ts b/src/views/final/comp/index.ts index b4cd4cb..26f47eb 100644 --- a/src/views/final/comp/index.ts +++ b/src/views/final/comp/index.ts @@ -4,5 +4,6 @@ import RepeatModal from './RepeatModal.vue' import RepeatTaskTableModal from './RepeatTaskTableModal.vue' import Action from './Action.vue' import RejectModal from './RejectModal.vue' +import CustomFilterModalVue from './CustomFilterModalVue.vue' -export { CustomTabelModal, ImportExcelModal, RepeatModal, RepeatTaskTableModal, Action, RejectModal } +export { CustomTabelModal, ImportExcelModal, RepeatModal, RepeatTaskTableModal, Action, RejectModal, CustomFilterModalVue } diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue index 61e66a2..4cf33b9 100644 --- a/src/views/final/content/Content.vue +++ b/src/views/final/content/Content.vue @@ -454,7 +454,7 @@ function reload() {