diff --git a/components.d.ts b/components.d.ts index 6458938..11049e1 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,7 +11,6 @@ declare module 'vue' { BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] NAvatar: typeof import('naive-ui')['NAvatar'] - NBackTop: typeof import('naive-ui')['NBackTop'] NButton: typeof import('naive-ui')['NButton'] NCard: typeof import('naive-ui')['NCard'] NCheckbox: typeof import('naive-ui')['NCheckbox'] @@ -22,8 +21,6 @@ declare module 'vue' { NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDivider: typeof import('naive-ui')['NDivider'] NDropdown: typeof import('naive-ui')['NDropdown'] - NEllipsis: typeof import('naive-ui')['NEllipsis'] - NEmpty: typeof import('naive-ui')['NEmpty'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NGi: typeof import('naive-ui')['NGi'] @@ -35,7 +32,6 @@ declare module 'vue' { NModal: typeof import('naive-ui')['NModal'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NotPassed: typeof import('./src/components/NotPassed.vue')['default'] - NPopconfirm: typeof import('naive-ui')['NPopconfirm'] NPopover: typeof import('naive-ui')['NPopover'] NPopselect: typeof import('naive-ui')['NPopselect'] NProgress: typeof import('naive-ui')['NProgress'] @@ -45,11 +41,7 @@ declare module 'vue' { NSpace: typeof import('naive-ui')['NSpace'] NSpin: typeof import('naive-ui')['NSpin'] NSwitch: typeof import('naive-ui')['NSwitch'] - NTabPane: typeof import('naive-ui')['NTabPane'] - NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] - NTimeline: typeof import('naive-ui')['NTimeline'] - NTimelineItem: typeof import('naive-ui')['NTimelineItem'] NTooltip: typeof import('naive-ui')['NTooltip'] NUpload: typeof import('naive-ui')['NUpload'] NUploadDragger: typeof import('naive-ui')['NUploadDragger'] diff --git a/src/api/final/index.ts b/src/api/final/index.ts index d5eae04..c60dce5 100644 --- a/src/api/final/index.ts +++ b/src/api/final/index.ts @@ -14,7 +14,7 @@ export async function getFinalList(params: FinalParam) { Object.keys(notEmptyParams).forEach((key) => { const val = notEmptyParams[key] - if (key === 'izuptime') { + if (key === 'izyear') { const start = formatToDate2(val[0]) const end = formatToDate2(val[1]) notEmptyParams[key] = `${start}-${end}` diff --git a/src/config/1.json b/src/config/1.json index 911d159..3c8e5e6 100644 --- a/src/config/1.json +++ b/src/config/1.json @@ -27,11 +27,11 @@ export const asideMap: Recordable = { key: 'izstatus', component: PlanVue, // todo }, - izuptime: { + izyear: { label: '提报时间', defaultValue: null, isDefaultFilter: false, - key: 'izuptime', + key: 'izyear', component: TimeVue, }, iztaskrrom: { diff --git a/src/config/final.ts b/src/config/final.ts index a258f4b..b3b466d 100644 --- a/src/config/final.ts +++ b/src/config/final.ts @@ -1,5 +1,6 @@ import type { AsideEntity } from './aside' import { IzApprovalStatus, IzCustomlevel, IzCustomname, IzCustomtype, IzProductVue, IzProjectVue, IzProjecttype, IzShowAll, IzStatus, IzVisitcity, IzfirmVue, IztaskrromVue, IzvisitproVue, PictureDownloadVue, PlanVue, ReportUserVue, TimeVue } from '@/views/home/aside/comp/items' +import { defineAsyncComponent } from "vue" export interface RowData { id: string @@ -83,49 +84,56 @@ export const asideMap: Recordable = { defaultValue: null, isDefaultFilter: true, key: 'izupuser', - component: ReportUserVue, + // component: ReportUserVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/ReportUser.vue")), }, izproject: { label: '所属项目', defaultValue: null, isDefaultFilter: true, key: 'izproject', - component: IzProjectVue, + // component: IzProjectVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzProject.vue")), }, izplan: { label: '所属计划', defaultValue: null, isDefaultFilter: true, key: 'izplan', - component: PlanVue, + // component: PlanVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Plan.vue")), }, izstatus: { label: '审批状态', defaultValue: null, isDefaultFilter: false, key: 'izstatus', - component: IzStatus, // todo + // component: IzStatus, // todo + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzStatus.vue")), }, - izuptime: { + izyear: { label: '提报时间', defaultValue: null, isDefaultFilter: false, - key: 'izuptime', - component: TimeVue, + key: 'izyear', + // component: TimeVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Time.vue")), }, iztaskrrom: { label: '任务来源', defaultValue: null, isDefaultFilter: false, key: 'iztaskrrom', - component: IztaskrromVue, + // component: IztaskrromVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Iztaskrrom.vue")), }, izshowall: { label: '显示全部任务数据', defaultValue: false, isDefaultFilter: false, key: 'izshowall', - component: IzShowAll, + // component: IzShowAll, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzShowAll.vue")), inFilterList: false, }, } @@ -137,90 +145,103 @@ export const asideTaskMap: Recordable = { defaultValue: null, isDefaultFilter: true, key: 'izApprovalStatus', - component: IzApprovalStatus, // todo + // component: IzApprovalStatus, // todo + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzApprovalStatus.vue")), }, izuptime: { label: '提报时间', defaultValue: null, isDefaultFilter: true, key: 'izuptime', - component: TimeVue, + // component: TimeVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Time.vue")), }, izupuser: { label: '提报人', defaultValue: null, isDefaultFilter: true, key: 'izupuser', - component: ReportUserVue, + // component: ReportUserVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/ReportUser.vue")), }, iztaskrrom: { label: '任务来源', defaultValue: null, isDefaultFilter: true, key: 'iztaskrrom', - component: IztaskrromVue, + // component: IztaskrromVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Iztaskrrom.vue")), }, izcustomname: { label: '拜访客户', defaultValue: null, isDefaultFilter: true, key: 'izcustomname', - component: IzCustomname, + // component: IzCustomname, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzCustomname.vue")), }, izcustomtype: { label: '客户类型', defaultValue: null, isDefaultFilter: true, key: 'izcustomtype', - component: IzCustomtype, + // component: IzCustomtype, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzCustomtype.vue")), }, izproject: { label: '所属项目', defaultValue: null, isDefaultFilter: true, key: 'izproject', - component: IzProjectVue, + // component: IzProjectVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzProject.vue")), }, izvisitpro: { label: '拜访省份/直辖市', defaultValue: null, isDefaultFilter: true, key: 'izvisitpro', - component: IzVisitcity, + // component: IzVisitcity, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzVisitcity.vue")), }, izcustomlevel: { label: '客户级别', defaultValue: null, isDefaultFilter: true, key: 'izcustomlevel', - component: IzCustomlevel, + // component: IzCustomlevel, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzCustomlevel.vue")), }, izprojecttype: { label: '项目类别', defaultValue: null, isDefaultFilter: true, key: 'izprojecttype', - component: IzProjecttype, + // component: IzProjecttype, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzProjecttype.vue")), }, izproductname: { label: '产品名称', defaultValue: null, isDefaultFilter: true, key: 'izproductname', - component: IzProductVue, + // component: IzProductVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzProduct.vue")), }, izvisitcity: { label: '拜访城市', defaultValue: null, isDefaultFilter: true, key: 'izvisitcity', - component: IzvisitproVue, + // component: IzvisitproVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Izvisitpro.vue")), }, izfirm: { label: '厂商', defaultValue: null, isDefaultFilter: true, key: 'izfirm', - component: IzfirmVue, + // component: IzfirmVue, + component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Izfirm.vue")), }, } diff --git a/src/layout/components/Header/RecycleModal.vue b/src/layout/components/Header/RecycleModal.vue index 0a061f0..c9f9b7c 100644 --- a/src/layout/components/Header/RecycleModal.vue +++ b/src/layout/components/Header/RecycleModal.vue @@ -111,6 +111,12 @@ const layout = debounce(() => { const clientHeight = el.value!.clientHeight const top = scrollHeight - clientHeight - 20 el.value!.scrollTo({ top, behavior: 'instant' }) + // let height = 800 - 15; + // const screenWidth = window.screen.width; + // if(screenWidth <= 1920) { + // height = 600 - 15; + // } + // el.value!.scrollTo({ top: height, behavior: 'instant' }) loading = false console.log("loading---------------", loading); }) diff --git a/src/store/modules/final.ts b/src/store/modules/final.ts index 629deec..e0b3ddb 100644 --- a/src/store/modules/final.ts +++ b/src/store/modules/final.ts @@ -82,29 +82,24 @@ export const useFinalStore = defineStore({ }, // 获取系统配置信息 async fetchConfig() { - const response = await getConfig() - console.log("response.data----------", response.data); - this.setSystemConfig(response.data) - return response.data + // const response = await getConfig() + // console.log("response.data----------", response.data); + // this.setSystemConfig(response.data) + // return response.data + let list: any = {}; + let tempAsideMap = cloneDeep(asideMap); + Object.keys(tempAsideMap).map(key => { + list[key] = "Y"; + }); + console.log("setSystemConfig---------------", list); + this.setSystemConfig(list); + return list }, // // 获取终审个性化配置 - // async fetchCustomConfig() { - // const res = await getFilter(1) - // const { data } = res - // const list = data && data.searchcount ? data.searchcount.split(',') : []; - // console.log("listkey---------------", list); - // this.customConfig = list - // return list - // }, - // 获取终审个性化配置 async fetchCustomConfig() { - let list: any = []; - let tempAsideMap = cloneDeep(asideMap); - Object.keys(tempAsideMap).map(key => { - if(!tempAsideMap[key].isDefaultFilter) { - list.push(key); - } - }); + const res = await getFilter(1) + const { data } = res + const list = data && data.searchcount ? data.searchcount.split(',') : []; console.log("listkey---------------", list); this.customConfig = list return list diff --git a/src/store/modules/task.ts b/src/store/modules/task.ts index f66b80c..658dccd 100644 --- a/src/store/modules/task.ts +++ b/src/store/modules/task.ts @@ -49,7 +49,7 @@ export const useTaskStore = defineStore({ back() { if (this.currentIndex === 0) return - + this.setActive(--this.currentIndex) }, async fetchApprovalList(pagination) { diff --git a/src/views/final/aside/Aside.vue b/src/views/final/aside/Aside.vue index 78a7df2..7a743c6 100644 --- a/src/views/final/aside/Aside.vue +++ b/src/views/final/aside/Aside.vue @@ -36,6 +36,7 @@ const showItems = shallowRef<{ key: string; config: AsideEntity }[]>([]); const initAsideValueRef = ref(null); // 所有左侧模块的值(初始值) const customObjRef = ref(null); // 获取高级筛选获取的值 const customTempObjRef = ref(null); // 获取高级筛选获取的值(作对比) +const configFilterRef = ref([]); // 获取排序的值 initAsideValueRef.value = cloneDeep(asideMap); @@ -113,36 +114,128 @@ onBeforeMount(async () => { nextTick(()=>{ finalStore.$subscribe(() => { + // const customConfig = finalStore.getCustomConfig; + // console.log("customConfig订阅aside---------------", customConfig); + // if (customConfig === null) return; + + // const showKeys: string[] = [...customConfig]; + // // const defaultKeys = Object.keys(asideMap).filter( + // // (key) => asideMap[key].isDefaultFilter + // // ); + // // showKeys.unshift(...defaultKeys); + + // Object.keys(asideMap).forEach((key) => { + // // 设置显示的或者默认显示的 + // if (key.startsWith("iz")) + // asideVisible[key] = + // asideMap[key] && (showKeys.includes(key) || asideMap[key].isDefaultFilter); + // }); + + // const items = showKeys.reduce((acc, key) => { + // if (asideMap[key]) { + // const config = { + // key, + // config: asideMap[key], + // }; + // return [...acc, config]; + // } else { + // return acc; + // } + // }, []); + // console.log("showItems111111111---------------", items); + // showItems.value = items; + const config = finalStore.getSystemConfig; const customConfig = finalStore.getCustomConfig; - console.log("customConfig111111111---------------", customConfig); - if (customConfig === null) return; - - const showKeys: string[] = [...customConfig]; - const defaultKeys = Object.keys(asideMap).filter( - (key) => asideMap[key].isDefaultFilter - ); - showKeys.unshift(...defaultKeys); - - Object.keys(asideMap).forEach((key) => { - // 设置显示的或者默认显示的 - if (key.startsWith("iz")) - asideVisible[key] = - asideMap[key] && (showKeys.includes(key) || asideMap[key].isDefaultFilter); + if ( + configFilterRef.value.length > 0 && + isEqual(configFilterRef.value, finalStore.getFilterConfig) && + customObjRef.value && + isEqual(customObjRef.value, customTempObjRef.value) + ) { + return; + } + if (config == null || customConfig == null) return; + // console.log("config", config, "customConfig", customConfig); + /* rao + const showKeys = [...customConfig].filter(key => !asideMap[key].isDefaultFilter)// 获取customConfig 非isDefaultFilter的选项 + const defaultKeys = Object.keys(asideMap).filter(key => asideMap[key].isDefaultFilter)// 获取asideMap isDefaultFilter的选项 + showKeys.unshift(...defaultKeys) + */ + + let sortKeyList: any = []; + finalStore.getFilterConfig.map((item: any) => { + sortKeyList.push(item?.id); }); + const showKeys = [...sortKeyList]; + Object.keys(config).forEach((key) => { + if (key.startsWith("iz") && asideMap[key] !== undefined) + asideVisible[key] = + (showKeys.includes(key) || asideMap[key].isDefaultFilter) && config[key] === "Y"; + }); + if (customObjRef.value) { + // 赋值 + Object.keys(customObjRef.value).map((key) => { + if (asideMap.hasOwnProperty(key)) { + const str = key.toLowerCase(); + // console.log("customObjRef.value[str]1111111111111", customObjRef.value[str]); + if (str == "izsimilarity") { + if (typeof customObjRef.value[str] == "string") { + customObjRef.value[str] = customObjRef.value[str].split(","); + } + asideValue[key] = customObjRef.value[str]; // 赋值 + console.log("相似度2222222222", asideValue[key]); + } else if (str == "izyear") { + if (typeof customObjRef.value[str] == "string") { + let time = customObjRef.value[str].split("-"); + time[0] = new Date(time[0]).getTime(); + time[1] = new Date(time[1]).getTime(); + customObjRef.value[str] = time; + } + asideValue[key] = customObjRef.value[str]; // 赋值 + console.log("时间2222222222", asideValue[key]); + } else if (customObjRef.value[str]) { + console.log("customObjRef.value[str]222222", customObjRef.value[str]); + // let list = customObjRef.value[str].split(','); + // console.log("list222222", list); + if (typeof customObjRef.value[str] == "string") { + customObjRef.value[str] = customObjRef.value[str].split(","); + asideValue[key] = customObjRef.value[str]; // 赋值 + }else { + asideValue[key] = customObjRef.value[str]; // 赋值 + } + } else { + asideValue[key] = null; + } + // asideMap[str].defaultValue = customObjRef.value[str];// 赋值 + } + }); + customTempObjRef.value = customObjRef.value; + console.log("asideValue直接处理后的结果", asideValue); + console.log("customTempObjRef.value", customTempObjRef.value); + let tempobj = cloneDeep(asideValue); + console.log("tempObj", tempobj); + finalStore.setAsideValue(tempobj); + } + // console.log("showKeys", showKeys); const items = showKeys.reduce((acc, key) => { - if (asideMap[key]) { - const config = { - key, - config: asideMap[key], + const currentData = asideMap[key]; + const render = currentData?.render; + if (render !== false) { + const str = key?.toLowerCase(); + + const o = { + key: str, + config: asideMap[str], }; - return [...acc, config]; + return [...acc, o]; } else { return acc; } }, []); - console.log("showItems111111111---------------", items); + console.log("showItems=================================", items); showItems.value = items; + configFilterRef.value = finalStore.getFilterConfig; }); }) @@ -197,9 +290,9 @@ function editFilter(filter: any) { modal.edit(filter); } -watch(asideValue, (newVal) => { - finalStore.setAsideValue(newVal); -}); +// watch(asideValue, (newVal) => { +// finalStore.setAsideValue(newVal); +// }); const inputChange = (keyword) => { emit("inputChange", keyword); @@ -214,6 +307,21 @@ const handleOk = (item: any) => { filterHandler(""); } }; + +function updateComponent(key, e) { + console.log("跟新值", key, e); + console.log("tempAsideValue跟新值", finalStore.getAsideValue, asideValue); + // let tempAsideValue = finalStore.getAsideValue || asideValue; + let tempobj = cloneDeep(asideValue); + console.log(tempobj, "tempobj"); + tempobj[key] = e; + console.log(tempobj, "tempobj After"); + customObjRef.value = tempobj; + // asideValue = Object.assign({}, asideValue, tempobj); + console.log("asideValue跟新值", tempobj); + finalStore.setAsideValue(tempobj); +} + @@ -2151,11 +2037,7 @@ function sortHandler(orderby: "similarityScore" | "createdate") { .small-mark { width: 100%; height: 53px; - background: linear-gradient( - 180deg, - rgba(0, 0, 0, 0.01), - rgba(0, 0, 0, 0.44) 88% - ); + background: linear-gradient(180deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.44) 88%); border-radius: 0px 8px 8px 8px; position: absolute; left: 0; diff --git a/src/views/worksheet/content/Content.vue b/src/views/worksheet/content/Content.vue index 0d531b2..e47ae9e 100644 --- a/src/views/worksheet/content/Content.vue +++ b/src/views/worksheet/content/Content.vue @@ -905,14 +905,14 @@ defineExpose({ .left { flex: 0.6; - background-size: auto 346px; - + // background-size: auto 346px; + background-size: cover; background-position: center; background-repeat: no-repeat; border-radius: 8px; position: relative; - width: 632px; - height: 346px; + // width: 632px; + // height: 346px; .preview { position: absolute;