fix: 合并test分支处理冲突

pull/178/head
zhouxiaoan 1 year ago
parent 878a81a355
commit cd42a5bc40

@ -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}`

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.2 MiB

@ -72,7 +72,10 @@ async function getHistory() {
getHistory()
function goPath(item, id) {
router.push({ name: item.path, query: { id } })
const desiredObject = item.data.find(function (item) {
return item.id === id;
});
router.push({ name: item.path, query: { id, searchContent: desiredObject.name } })
emit('close')
}
@ -94,42 +97,30 @@ function highlightText(text, query) {
<img src="../../assets/images/IP.png" alt="">
</div>
<div class="input_box">
<n-input
v-model:value="value"
placeholder="搜索任务ID、任务名称、提报人、拜访终端"
type="text"
@input="inputHandler"
@mousedown="handlerShowList"
>
<n-input v-model:value="value" placeholder="搜索任务ID、任务名称、提报人、拜访终端" type="text" @input="inputHandler"
@mousedown="handlerShowList">
<template #prefix>
<SvgIcon name="magnifying-1" size="18" />
</template>
</n-input>
</div>
<div v-show="showList && (historyList.length || resultList.length)" class="list_box">
<div
v-if="historyList.length"
class="list_classfiy_item"
style="border-bottom:1px solid #e4e4e4"
>
<div v-if="historyList.length" class="list_classfiy_item" style="border-bottom:1px solid #e4e4e4">
<div class="list_title">
历史搜索
</div>
<div class="flex history-list">
<div class="tag-wrap">
<div v-for="(item, index) of historyList" :key="index" class="tag" @click="handlerHistory(item.historyname)">
<div v-for="(item, index) of historyList" :key="index" class="tag"
@click="handlerHistory(item.historyname)">
{{ item.historyname }}
</div>
</div>
<SvgIcon class="icon-delete" name="delete-history" size="16" @click="deleteHistory" />
</div>
</div>
<div
v-for="(item, index) in resultList"
:key="index"
class="list_classfiy_item"
:style="(index === resultList.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'"
>
<div v-for="(item, index) in resultList" :key="index" class="list_classfiy_item"
:style="(index === resultList.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'">
<div class="list_title">
{{ item.title }}
</div>
@ -149,11 +140,13 @@ function highlightText(text, query) {
top: 20%;
left: 20%;
box-shadow: none !important;
.ip_box {
z-index: 0;
position: relative;
left: calc(50% - 40px);
top: 30px;
img {
width: 80px;
height: 80px;
@ -169,6 +162,7 @@ function highlightText(text, query) {
box-shadow: 0px 12px 12px 0px rgba(80, 122, 253, 0.15),
0px 0px 0px 0.5px #d4e3fc;
}
.list_box {
background: #fefefe;
border: 1px dashed #f4f4f4;
@ -176,6 +170,7 @@ function highlightText(text, query) {
box-shadow: 0px 12px 12px 0px rgba(80, 122, 253, 0.15);
margin-top: 15px;
padding: 8px 16px;
.list_classfiy_item {
.list_title {
font-size: 12px;
@ -185,6 +180,7 @@ function highlightText(text, query) {
line-height: 17px;
margin: 10px 0 10px 5px;
}
.list_item {
display: flex;
flex-flow: row nowrap;
@ -194,6 +190,7 @@ function highlightText(text, query) {
}
}
}
:deep(.n-input .n-input-wrapper) {
margin: 8px;
}

@ -27,11 +27,11 @@ export const asideMap: Recordable<AsideEntity> = {
key: 'izstatus',
component: PlanVue, // todo
},
izuptime: {
izyear: {
label: '',
defaultValue: null,
isDefaultFilter: false,
key: 'izuptime',
key: 'izyear',
component: TimeVue,
},
iztaskrrom: {

@ -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<AsideEntity> = {
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<AsideEntity> = {
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")),
},
}

@ -66,6 +66,15 @@ const viewLabel = computed(() => {
return item?.label
})
const maxHeight = computed(() => {
let height = "800";
const screenWidth = window.screen.width;
if(screenWidth <= 1920) {
height = "600";
}
return height + 'px';
})
const masonryRef = ref<ComponentRef>(null)
const el = ref<HTMLDivElement | null>(null)
const elwc = ref<HTMLDivElement | null>(null)
@ -102,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);
})
@ -383,7 +398,8 @@ async function onChange() {
// orderbyname: val,
orderByUptime: timeRange.value
}
pagination.pageNo = 1
pagination.pageNo = 1;
canloadMore = true;
const list = await featchList()
listData.value = list
layout()
@ -399,7 +415,8 @@ async function onChangeView() {
// orderbyname: val,
orderBySimilarity: similarRange.value
}
pagination.pageNo = 1
pagination.pageNo = 1;
canloadMore = true;
const list = await featchList()
listData.value = list
layout()
@ -601,13 +618,13 @@ watch(() => show.value,
watch(() => pagination.pageNo,
(newVal, oldVal) => {
console.log("加载了22222222222222222---------------------------", newVal, oldVal, canloadMore);
if(newVal == oldVal) {
return
}
if((newVal == 1 || newVal == 2) && canloadMore) {
setTimeout(() => {
nextTick(() => {
console.log("加载了22222222222222222---------------------------", newVal);
loading = false
loadMore();
})
@ -695,7 +712,7 @@ watch(() => pagination.pageNo,
</div>
</div>
<div ref="el" class="scroll">
<div ref="el" class="scroll" :style="{height: maxHeight}">
<!-- <n-scrollbar :on-scroll="scrollHandler"> -->
<div ref="masonryRef" class="grid">
<div v-for="(item, index) in listData" :key="item.pictureId" :data-id="item.pictureId"

@ -1,40 +1,106 @@
import { defineStore } from 'pinia'
import { store } from '@/store'
import { getFilter } from '@/api/home/filter'
import { getConfig } from '@/api/system/user'
import { asideMap } from "@/config/final";
import { cloneDeep, isEqual } from "lodash-es";
import type { AsideConfig } from '/#/api'
export interface ConfigState {
systemConfig: AsideConfig | null
customConfig: string[] | null
asideValue: any
listKey: number
searchValue: string
isAllowDownload: boolean
timeNum: number
filterConfig: string[] // 过滤筛选条件
}
export const useFinalStore = defineStore({
id: 'app-final',
state: (): ConfigState => ({
systemConfig: null,
customConfig: null,
asideValue: null,
listKey: 0,
searchValue: "",
isAllowDownload: true,
timeNum: 0,
filterConfig: [],
}),
getters: {
getSystemConfig(): AsideConfig | null {
return this.systemConfig
},
getCustomConfig(): string[] | null {
return this.customConfig
},
getAsideValue(): any {
return this.asideValue
},
getSearchValue(): any {
return this.searchValue
},
getIsAllowDownload(): any {
return this.isAllowDownload
},
getTimeNum(): any {
return this.timeNum
},
getFilterConfig(): any {
return this.filterConfig
},
},
actions: {
setSystemConfig(config: AsideConfig) {
this.systemConfig = config
console.log("systemConfig----------", config);
},
setAsideValue(value) {
this.asideValue = value
},
setListKey() {
this.listKey = new Date().getTime()
},
// 获取终审个性化配置
setSearchValue(value) {
this.searchValue = value
},
setIsAllowDownload(value) {
this.isAllowDownload = value
},
setTimeNum(value) {
this.timeNum = value
},
// 设置个性化配置
setCustomConfig(value) {
this.customConfig = value
},
setFilterConfig(value) {
this.filterConfig = value
},
// 获取系统配置信息
async fetchConfig() {
// 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(',') : []
const list = data && data.searchcount ? data.searchcount.split(',') : [];
console.log("listkey---------------", list);
this.customConfig = list
return list
},

@ -22,6 +22,8 @@ import type { AsideEntity } from "@/config/aside";
import { asideMap } from "@/config/final";
import type { AsideConfig } from "/#/api";
import emitter from "@/utils/mitt";
import { getFilterList } from "@/api/home/main";
import { cloneDeep, isEqual } from "lodash-es";
const emit = defineEmits(["inputChange"]);
const finalStore = useFinal();
@ -31,6 +33,17 @@ const asideValue: Record<keyof typeof asideMap, any> = reactive({});
const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({});
//
const showItems = shallowRef<{ key: string; config: AsideEntity }[]>([]);
const initAsideValueRef = ref<any>(null); // ()
const customObjRef = ref<any>(null); //
const customTempObjRef = ref<any>(null); // ()
const configFilterRef = ref<any>([]); //
initAsideValueRef.value = cloneDeep(asideMap);
onBeforeMount(async () => {
finalStore.fetchConfig();
finalStore.fetchCustomConfig();
});
Object.keys(asideMap).forEach((key) => {
const { defaultValue, inFilterList } = asideMap[key];
@ -99,38 +112,132 @@ onBeforeMount(async () => {
finalStore.fetchCustomConfig();
});
nextTick(()=>{
finalStore.$subscribe(() => {
// const customConfig = finalStore.getCustomConfig;
// console.log("customConfigaside---------------", 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;
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];
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"))
Object.keys(config).forEach((key) => {
if (key.startsWith("iz") && asideMap[key] !== undefined)
asideVisible[key] =
asideMap[key] && (showKeys.includes(key) || asideMap[key].isDefaultFilter);
(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("showItems=================================", items);
showItems.value = items;
configFilterRef.value = finalStore.getFilterConfig;
});
})
watch(asideVisible, (newVal) => {
Object.keys(asideValue).forEach((key) => {
@ -159,8 +266,22 @@ function scrollHandler(key: string) {
element?.scrollIntoView(true);
}
function filterHandler(searchId: string) {
async function filterHandler(searchId: string) {
emitter.emit("filter-final", searchId);
const res = await getFilterList({ userSearchId: searchId });
// console.log("", res);
if (res.code == "OK") {
let obj = res.data;
customObjRef.value = res.data;
let showKeys: any[] = [];
Object.keys(obj).map((key) => {
if (asideMap.hasOwnProperty(key)) {
showKeys.push(key);
}
});
console.log("showKeys1111111111111111", showKeys);
finalStore.setCustomConfig(showKeys);
}
}
function editFilter(filter: any) {
@ -169,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);
@ -186,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);
}
</script>
<template>
@ -208,6 +344,7 @@ const handleOk = (item: any) => {
@select="scrollHandler"
@close="setShowSearch(false)"
@inputChange="inputChange"
@showSearch="setShowSearch(true)"
/>
<!-- 高级筛选 -->
<AdvanceFilter
@ -228,6 +365,7 @@ const handleOk = (item: any) => {
:key="index"
v-model:value="asideValue[item.key]"
:label="item.config.label"
@update:value="(e) => updateComponent(item.key, e)"
/>
<!-- 筛选 -->

@ -1,18 +1,53 @@
<script lang="ts" setup>
import { debounce, difference } from 'lodash-es'
import { computed, ref, watch } from 'vue'
import { computed, ref, watch, onMounted } from 'vue'
import { VueDraggable } from 'vue-draggable-plus'
import { setFilter } from '@/api/home/filter'
import { asideMap } from '@/config/final'
import { useFinal } from '@/store/modules/final'
import { cloneDeep, isEqual } from "lodash-es";
const show = ref(false)
const finalStore = useFinal()
const checkAll = ref(false)
const selectIds = ref<string[]>([])
const finalStore = useFinal()
const tempList = ref<string[]>([])
let extraCustomConfig :any = [];
Object.keys(asideMap).forEach((key) => {
const { isDefaultFilter } = asideMap[key];
if (isDefaultFilter) {
extraCustomConfig.push(key);
}
});
function showModal() {
show.value = true
//
const config = finalStore.getSystemConfig
const customConfig = finalStore.getCustomConfig
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',config, customConfig)
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',tempList.value, finalStore.getFilterConfig)
if (config == null || customConfig == null)
return
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
return
const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList)
console.log("tempList.value开启了lllllllllllllllllll", showList, hideList);
if (tempList.value.length > 0)
finalStore.setFilterConfig(tempList.value)
onList.value = showList
offList.value = hideList
//
checkAll.value = hideList.every(item => item.checked)
//
offKeyword.value = ''
onKeyword.value = ''
}
function closeModal() {
@ -36,16 +71,16 @@ defineExpose({
showModal,
})
function generateDefaultList() {
function generateDefaultList(config) {
return Object.keys(asideMap).reduce((acc, key) => {
const { label, isDefaultFilter } = asideMap[key]
//
if (isDefaultFilter) {
//
if (isDefaultFilter && config[key] === 'Y') {
const config = {
id: key,
name: label || '未配置',
fix: isDefaultFilter,
fix: true,
checked: true,
}
return [...acc, config]
@ -56,20 +91,46 @@ function generateDefaultList() {
}, [])
}
function generatList(customConfig) {
const keys = Object.keys(asideMap)
function generatList(config, customConfig) {
const keys = Object.keys(config)
let onList: object[] = []
const offList: object[] = []
const showKeys = customConfig.map((key: string) => key.toLowerCase())
for (const key of keys) {
if (!key.startsWith('iz') || asideMap[key] === undefined)
continue
let offList: any = []
let showKeys = [];
const tempShowKeys = [...customConfig, ...extraCustomConfig];
tempShowKeys.map(item => {
if(!showKeys.includes(item)) {
showKeys.push(item);
}
});
console.log('原始筛选条件showKeys', showKeys)
console.log('原始筛选条件config customConfig', config, customConfig)
// for (const key of keys) {
// if (!key.startsWith('iz') || config[key] === 'N' || asideMap[key] === undefined)
// continue
// const name = asideMap[key]?.label
// const isDefaultFilter = asideMap[key]?.isDefaultFilter
// // Y
// if (!isDefaultFilter) {
// const isChecked = asideMap[key].isDefaultFilter || showKeys.includes(key)
// offList.push({
// id: key,
// name: name || '',
// fix: isDefaultFilter,
// checked: isChecked,
// })
// if (isChecked && !selectIds.value.includes(key))
// isChecked && selectIds.value.push(key)
// }
// }
Object.keys(asideMap).map(key => {
const name = asideMap[key]?.label
const isDefaultFilter = asideMap[key]?.isDefaultFilter
//
// Y
// if (!isDefaultFilter) {
const isChecked = asideMap[key].isDefaultFilter || showKeys.includes(key)
offList.push({
@ -78,15 +139,17 @@ function generatList(customConfig) {
fix: isDefaultFilter,
checked: isChecked,
})
if (isChecked && !selectIds.value.includes(key))
isChecked && selectIds.value.push(key)
}
// }
})
onList = showKeys.reduce((acc, key) => {
const isDefaultFilter = asideMap[key]?.isDefaultFilter
// ()
if (isDefaultFilter === false) {
// && ()
if (config[key] === 'Y' && isDefaultFilter === false) {
// if (config[key] === 'Y') {
const config = {
id: key,
name: asideMap[key].label || '未配置',
@ -98,35 +161,95 @@ function generatList(customConfig) {
return acc
}
}, [])
const fixedList = generateDefaultList()
console.log('原始筛选条件onList', onList)
const fixedList = generateDefaultList(config)
// offList.unshift(...fixedList)
console.log('原始筛选条件fixedList', fixedList)
onList.unshift(...fixedList)
return { showList: onList, hideList: offList }
console.log('原始筛选条件customConfig', customConfig)
// onListcustomConfig
const tempOnList = cloneDeep(onList)
console.log('原始筛选条件tempOnList', tempOnList)
const sortKeyList: any = []
finalStore.getFilterConfig.map((item: any) => {
console.log("tFilterConfig item000000000000000", item);
sortKeyList.push(item.id)
})
console.log('原始筛选条件sortKeyList', sortKeyList)
console.log('原始筛选条件showKeys', showKeys)
const sortList: any = []
if (sortKeyList.length > 0) {
sortKeyList.map((key) => {
const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) {
sortList.push(tempItem)
}
})
}
else {
showKeys.map((key) => {
const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) {
sortList.push(tempItem)
}
})
}
console.log('原始筛选条件showList', sortList)
console.log('原始筛选条件hideList', offList)
console.log('原始筛选条件configStore.getFilterConfig', finalStore.getFilterConfig)
// return { showList: onList, hideList: offList }
return { showList: sortList, hideList: offList }
}
finalStore.$subscribe(() => {
const config = finalStore.getSystemConfig
const customConfig = finalStore.getCustomConfig
if (customConfig === null)
if (config == null || customConfig == null)
return
console.log('订阅tempList.value-----------', tempList.value)
console.log('订阅finalStore.getFilterConfig-----------', finalStore.getFilterConfig)
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
return
const { showList, hideList } = generatList(customConfig)
const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList)
console.log('订阅克隆条件', tempList.value)
if (tempList.value.length > 0)
finalStore.setFilterConfig(tempList.value)
// setTimeout(() => {
// }, 500);
console.log('订阅showList, hideList-----------', showList, hideList)
onList.value = showList
offList.value = hideList
})
async function handleSumbit(e: MouseEvent) {
e.preventDefault()
const param = onList.value
.filter(item => !asideMap[item.id].isDefaultFilter)
.map((item) => {
const param = onList.value.map((item) => {
return item.id
})
.join(',')
}).join(',')
await setFilter({ searchcount: param, type: 1 })
finalStore.fetchCustomConfig()
const obj = await finalStore.fetchCustomConfig()
console.log('obj-------------------------------', obj)
const tempOnList = cloneDeep(onList.value)
console.log('提交筛选条件tempOnList', tempOnList)
const sortList: any = []
obj.map((key) => {
const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) {
sortList.push(tempItem)
}
})
console.log('finalStore.sortList提交---------------', sortList)
// setTimeout(() => {
if (sortList.length > 0)
finalStore.setFilterConfig(sortList)
// }, 500);
closeModal()
}
@ -147,16 +270,18 @@ function onCheckChange(checked: any, item: any) {
const index = selectIds.value.indexOf(item.id)
item.checked = checked
const currentIndex = offList.value.findIndex(v => v.id == item.id)
offList.value[currentIndex].checked = item.checked
if (index === -1 && checked)
selectIds.value.push(item.id)
else selectIds.value.splice(index, 1)
else
index !== -1 && selectIds.value.splice(index, 1)
checkAll.value = offList.value.every(item => item.checked)
}
const showIds = computed(() => {
return onList.value.map((item) => {
return item.id
return item?.id
})
})
@ -167,10 +292,7 @@ watch(
return
const action = newVal > oldVal ? 'add' : 'remove'
const diff
= action === 'add'
? difference(selectIds.value, showIds.value)
: difference(showIds.value, selectIds.value)
const diff = action === 'add' ? difference(selectIds.value, showIds.value) : difference(showIds.value, selectIds.value)
if (diff.length === 0)
return
@ -178,6 +300,7 @@ watch(
if (action === 'add') {
for (const item of offList.value) {
if (!item.fix && diff.includes(item.id)) {
if (item.checked) {
onList.value.push({
id: item.id,
name: item.name || '未配置',
@ -186,6 +309,7 @@ watch(
}
}
}
}
else {
const list = onList.value
for (let index = 0; index < list.length; index++) {
@ -245,62 +369,59 @@ const leftInputHandler = debounce((keyword) => {
const rightInputHandler = debounce((keyword) => {
onKeyword.value = keyword
}, 300)
// async function getfield() {
// let res
// res = await getAllfieldList(3)
// const userStore = useUser()
// const userInfo = userStore.getUserInfo
// res = await getfieldList(3, userInfo.id)
// }
function onMove(e) {
// e
if (e?.related?.className?.indexOf('fix') !== -1)
return false
}
onMounted(() => {
// getfield()
})
</script>
<template>
<n-modal v-model:show="show" transform-origin="center" :mask-closable="false">
<n-card
class="cardstyle"
:bordered="false"
size="huge"
role="dialog"
aria-modal="true"
>
<n-card class="cardstyle" :bordered="false" size="huge" role="dialog" aria-modal="true">
<div class="wrapper">
<span class="wrapper-title" style="color: #333333;">自定义筛选</span>
<span class="wrapper-title">自定义筛选</span>
<div class="wrapper-bar">
<div class="wrapper-info" style="background-color: #F8F8F8;">
<span :style="{ 'margin-left': '18px', 'color': '#333333' }">筛选项信息</span>
<div class="wrapper-info">
<span :style="{ 'margin-left': '18px' }">筛选项信息</span>
</div>
</div>
<n-grid cols="24" class="mt-4 proCard" responsive="screen" :x-gap="24">
<n-grid-item span="11">
<NCard
:title="allCount"
class="dragcardStyle"
:segmented="{ content: true, footer: true }"
size="small"
:title="allCount" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small"
:bordered="false"
>
<div>
<div class="input_wrap">
<n-input placeholder="搜索关键词" @input="leftInputHandler">
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" color="#999999" />
<SvgIcon size="14px" name="magnifying-1-color999" />
</template>
</n-input>
<n-scrollbar
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
>
<n-scrollbar style="max-height: 500px;border: 1px solid #cad2dd;border-radius: 2px;">
<div class="draggable-ul">
<div class="draggable-li" style="color:#666666">
<n-checkbox
v-model:checked="checkAll"
label="全选"
@update:checked="onCheckAllChange"
/>
<div class="draggable-li">
<n-checkbox v-model:checked="checkAll" label="全选" :indeterminate="!checkAll" @update:checked="onCheckAllChange" />
</div>
<div
v-for="item in offList"
v-show="item.name.includes(offKeyword)"
:key="item.id"
:class="{ 'disable-check': item.fix }"
v-for="item in offList" v-show="item.name.includes(offKeyword)" :key="item.id" :class="{ 'disable-check': item.fix }"
class="draggable-li"
>
<n-checkbox
v-model:checked="item.checked"
:label="item.name"
:disabled="item.fix"
v-model:checked="item.checked" :label="item.name" :disabled="item.fix"
@update:checked="onCheckChange($event, item)"
/>
</div>
@ -309,55 +430,31 @@ const rightInputHandler = debounce((keyword) => {
</div>
</NCard>
</n-grid-item>
<n-grid-item style="display: flex; align-items: center" span="2">
<n-grid-item style="display: flex;align-items: center;" span="2">
<SvgIcon size="20" name="switchsvg" />
</n-grid-item>
<n-grid-item span="11">
<NCard
:title="selectCount"
class="dragcardStyle"
:segmented="{ content: true, footer: true }"
size="small"
:title="selectCount" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small"
:bordered="false"
>
<template #header-extra>
<span class="textbtnStyle" @click="clearDragSource"></span>
</template>
<div>
<!-- j -->
<div class="input_wrap">
<n-input placeholder="搜索关键词" @input="rightInputHandler">
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" color="#999999" />
<SvgIcon size="14px" name="magnifying-1-color999" />
</template>
</n-input>
<n-scrollbar
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
class="scroll"
>
<VueDraggable
v-model="onList"
class="draggable-ul"
filter=".draggable-li[draggable='false']"
:animation="150"
group="shared"
>
<div
v-for="item in onList"
v-show="item.name.includes(onKeyword)"
:key="item.id"
:draggable="!item.fix"
:class="{ fix: item.fix }"
class="cursor-move draggable-li"
>
<!-- v-show="!item.fix" 判断是否为固定值 -->
<SvgIcon name="drag" size="14" />
<n-scrollbar style="max-height: 500px;border: 1px solid #cad2dd;border-radius: 2px;" class="scroll">
<VueDraggable v-model="onList" class="draggable-ul" :animation="150" group="shared">
<div v-for="item in onList" v-show="item.name.includes(onKeyword)" :key="item.id" :draggable="true" class="cursor-move draggable-li">
<SvgIcon name="drag" size="24" />
<span class="ml-2">{{ item.name }}</span>
<SvgIcon
v-if="!item.fix"
size="16px"
style="display: block; margin-left: auto; cursor: pointer"
name="clear"
@click="removeHandler(item.id)"
v-if="!item.fix" size="16px" style="display:block;margin-left: auto;cursor: pointer;"
name="clear" @click="removeHandler(item.id)"
/>
</div>
</VueDraggable>
@ -372,7 +469,7 @@ const rightInputHandler = debounce((keyword) => {
<n-button type="info" @click="handleSumbit">
确定
</n-button>
<n-button secondary style="margin-left: 15px" @click="closeModal">
<n-button secondary style="margin-left:15px; border: 1px solid #CAD2DD;" @click="closeModal">
取消
</n-button>
</div>
@ -389,18 +486,25 @@ const rightInputHandler = debounce((keyword) => {
&-title {
font-weight: bold;
font-size: 16px;
color: #333333;
}
&-bar {
background-color: #e8e8e8;
width: 100%;
background-color: #f8f8f8 !important;
width: calc(100% + 12px);
margin-top: 20px;
color: #333333;
}
&-footer {
display: flex;
justify-content: flex-end;
.n-button--info-type{
background: #507AFD !important;
}
.n-button--default-type{
background: #fff !important;
color: #333333;
}
}
&-info {
@ -409,7 +513,7 @@ const rightInputHandler = debounce((keyword) => {
font-size: 14px;
&:before {
background-color: #1980ff;
background-color: #1980FF;
content: "";
width: 5px;
border-radius: 2px;
@ -423,20 +527,23 @@ const rightInputHandler = debounce((keyword) => {
.dragcardStyle {
--n-padding-bottom: 0px !important;
--n-padding-left: 0px !important;
::v-deep(.n-card__content) {
padding-left: 0 !important;
padding-right: 0 !important;
}
}
.cardstyle {
width: 620px;
height: 800px;
--n-padding-bottom: 16px;
--n-padding-bottom: 20px;
--n-padding-left: 24px;
--n-padding-right: 24px;
--n-padding-top: 20px;
// background-color: #f8f8f8 !important;
}
.textbtnStyle {
cursor: pointer;
color: #1980ff;
color: #1980FF;
}
.draggable-ul {
@ -452,6 +559,10 @@ const rightInputHandler = debounce((keyword) => {
align-items: center;
}
.fix {
cursor: default !important;
}
.disable-check {
color: gainsboro;
}
@ -468,20 +579,30 @@ const rightInputHandler = debounce((keyword) => {
::v-deep(.n-card > .n-card-header .n-card-header__main){
font-weight: lighter !important;
font-size: 14px;
color: #666666;
color: #666;
}
::v-deep(.n-scrollbar){
border-top: none !important;
border-left: 1px solid #cad2dd !important;
border-right: 1px solid #cad2dd !important;
border-bottom: 1px solid #E8E8E8 !important;
border-top: 1px solid #E8E8E8 !important;
}
::v-deep(.n-button--info-type) {
background: #507afd !important;
::v-deep(.n-card__content){
padding: 20px 24px 0 24px !important;
}
::v-deep(.n-card__footer){
padding: 0 16px 16px 16px !important;
padding: 0 24px 16px 24px !important;
}
::v-deep(.n-button--default-type) {
::v-deep(.n-input .n-input-wrapper){
height: 44px !important;
border: 1px solid #cad2dd !important;
color: #333333;
background: #ffffff;
border-bottom: none !important;
// margin-bottom: -3px;
.n-input__input input{
height: 44px !important;
}
}
::v-deep(.n-button--info-type){
background: #507AFD !important;
}
</style>

@ -126,7 +126,7 @@ function handleSumbit(e: MouseEvent) {
}
function formatValue(searchfield: string, searchvalue: any) {
if (searchfield === "izuptime") {
if (searchfield === "izyear") {
const start = formatToDate2(searchvalue[0]);
const end = formatToDate2(searchvalue[1]);
return `${start}-${end}`;
@ -138,7 +138,7 @@ function formatValue(searchfield: string, searchvalue: any) {
//
function unformatValue(searchfield: string, searchvalue: any) {
// 2022/01/03-2023/02/04
if (searchfield === "izuptime") {
if (searchfield === "izyear") {
const dataStrs = searchvalue.split("-");
const start = formatToDate3(dataStrs[0]);
const end = formatToDate3(dataStrs[1]);
@ -329,7 +329,7 @@ defineExpose({
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izuptime'">
<n-space v-if="item.type === 'izyear'">
<n-date-picker
v-model:value="item.result"
style="margin-left: 8px; width: 240px"

@ -274,7 +274,7 @@ async function formatColumns() {
NButton,
{
'strong': true,
'tertiary': true,
// 'tertiary': true,
'text': true,
'size': 'small',
'text-color': '#507AFD',

@ -1,16 +1,23 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { nextTick, onMounted, ref } from 'vue'
import { debounce } from 'lodash-es'
import { asideMap } from '@/config/aside'
import type { SearchEntity } from '/#/home'
import { useConfig } from '@/store/modules/asideConfig'
import { useRoute } from 'vue-router'
import { useFinal } from "@/store/modules/final";
const finalStore = useFinal();
const route = useRoute()
const searchContent = route.query.searchContent as string;
defineOptions({ name: 'Search' })
const emit = defineEmits<{
(e: 'close'): void
(e: 'select', key: string): void
(e: 'inputChange', value: string): void
(e: 'showSearch'): void
}>()
const data = ref<SearchEntity[]>([])
@ -54,25 +61,40 @@ function selectHandler(item: SearchEntity) {
//
const searchName = () => {
configStore.setSearchValue(searchKeyword.value);
finalStore.setSearchValue(searchKeyword.value);
emit('inputChange', searchKeyword.value);
}
const close = () => {
searchKeyword.value = "";
configStore.setSearchValue(searchKeyword.value);
finalStore.setSearchValue(searchKeyword.value);
emit('close');
}
const initSerach = () => {
if (searchContent) {
emit('showSearch')
const id_param = searchContent.match(/-\d+-/);
if (id_param) {
searchKeyword.value = id_param[0].slice(1, -1);
emit('inputChange', searchKeyword.value)
}
}
}
onMounted(() => {
initSerach()
})
</script>
<template>
<div class="wrapper">
<n-popover
ref="popover" :style="{ padding: '0px' }" style="width: 248px" :show-arrow="false" placement="bottom-start"
trigger="focus"
>
<n-popover ref="popover" :style="{ padding: '0px' }" style="width: 248px" :show-arrow="false"
placement="bottom-start" trigger="focus">
<template #trigger>
<n-input v-model:value="searchKeyword" style="width: 260px;height: 32px;" placeholder="请输入你需要搜索的内容" @input="inputHandler">
<n-input v-model:value="searchKeyword" style="width: 260px;height: 32px;" placeholder="请输入你需要搜索的内容"
@input="inputHandler">
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" @click="searchName" style="cursor: pointer;" />
</template>

@ -3,6 +3,7 @@ import { onBeforeMount, onMounted, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const configUseStore = useConfig()
@ -24,6 +25,27 @@ configUseStore.$subscribe(() => {
formValue.value.plans = [];
}
});
const finalStore = useFinal()
finalStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = finalStore.getAsideValue;
if(asideValue && asideValue['izproject']) {
if(typeof asideValue['izproject'] == "string") {
let list = asideValue['izproject'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izproject'];
}
console.log("formValue.value.izproject", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string

@ -3,6 +3,7 @@ import { onBeforeMount, onMounted, ref } from 'vue'
import type { FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const configUseStore = useConfig()
@ -24,6 +25,27 @@ configUseStore.$subscribe(() => {
formValue.value.plans = [];
}
});
const finalStore = useFinal()
finalStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = finalStore.getAsideValue;
if(asideValue && asideValue['izstatus']) {
if(typeof asideValue['izstatus'] == "string") {
let list = asideValue['izstatus'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izstatus'];
}
console.log("formValue.value.izstatus", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string

@ -3,6 +3,7 @@ import { onBeforeMount, onMounted, ref } from 'vue'
import { type FormItemRule, type FormRules, faIR } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const configUseStore = useConfig()
@ -26,6 +27,27 @@ configUseStore.$subscribe(() => {
formValue.value.plans = [];
}
});
const finalStore = useFinal()
finalStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = finalStore.getAsideValue;
if(asideValue && asideValue['iztaskrrom']) {
if(typeof asideValue['iztaskrrom'] == "string") {
let list = asideValue['iztaskrrom'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['iztaskrrom'];
}
console.log("formValue.value.iztaskrrom", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string

@ -3,6 +3,7 @@ import { onBeforeMount, onMounted, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const configUseStore = useConfig()
@ -24,6 +25,27 @@ configUseStore.$subscribe(() => {
formValue.value.plans = [];
}
});
const finalStore = useFinal()
finalStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = finalStore.getAsideValue;
if(asideValue && asideValue['izplan']) {
if(typeof asideValue['izplan'] == "string") {
let list = asideValue['izplan'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izplan'];
}
console.log("formValue.value.izplan", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string

@ -3,6 +3,7 @@ import { onBeforeMount, onMounted, onUpdated, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const configUseStore = useConfig()
@ -26,6 +27,27 @@ configUseStore.$subscribe(() => {
}
});
const finalStore = useFinal()
finalStore.$subscribe(() => {
let asideValue = finalStore.getAsideValue;
console.log("asideValue接受到的", asideValue);
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
if(asideValue && asideValue['izupuser']) {
if(typeof asideValue['izupuser'] == "string") {
let list = asideValue['izupuser'].split(',');
formValue.value.users = list;
}else {
formValue.value.users = asideValue['izupuser'];
}
console.log("formValue.value.users222222222222222", formValue.value.users);
}else {
formValue.value.users = [];
}
});
const props = defineProps<{
value: string[] | null
label: string

@ -3,6 +3,7 @@ import dayjs from "dayjs";
import { onUpdated, watch } from "vue";
import { onMounted, ref } from "vue";
import { useConfig } from "@/store/modules/asideConfig";
import { useFinal } from '@/store/modules/final'
const configUseStore = useConfig();
@ -18,6 +19,23 @@ configUseStore.$subscribe(() => {
time.value = null;
}
});
const finalStore = useFinal()
finalStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false;
return;
}
let asideValue = finalStore.getAsideValue;
console.log("asideValue izyear", asideValue);
if (asideValue && asideValue["izyear"]) {
time.value = asideValue["izyear"];
} else {
time.value = null;
}
});
const props = defineProps<{
value: [number, number] | null;
label: string;

@ -47,12 +47,11 @@ const getStateText = computed(() => {
async function getList(type = "") {
let res = await getMessageList({
pageNo: state.pageNo,
pageSize: "7",
pageSize: "20",
msgCategory: tab.value,
});
console.log("getMessageList", res.data);
if (type == "more") {
while (res.data.endRow > 0) {
if (res.code == "OK") {
if (tab.value === 1) {
res.data.list.forEach((item) => {
@ -63,11 +62,10 @@ async function getList(type = "") {
state.pageNo++;
res = await getMessageList({
pageNo: state.pageNo,
pageSize: "7",
pageSize: "20",
msgCategory: tab.value,
});
}
}
hasNextPage.value = res.data.hasNextPage;
} else {
if (res.code === "OK") {
@ -127,6 +125,8 @@ function getMore() {
state.pageNo += 1;
getList("more");
}
console.log(tabList);
</script>
<template>
@ -140,39 +140,21 @@ function getMore() {
</div>
<div class="content">
<div class="slider">
<div
v-for="item in tabList"
:key="item.value"
:class="{ 'item-active': tab === item.value }"
class="flex item"
@click="switchTab(item.value)"
>
<div v-for="item in tabList" :key="item.value" :class="{ 'item-active': tab === item.value }" class="flex item"
@click="switchTab(item.value)">
<div class="flex item-left align-center">
<img
class="icon"
:src="tab === item.value ? item.activeIcon : item.icon"
alt=""
/>
<img class="icon" :src="tab === item.value ? item.activeIcon : item.icon" alt="" />
<div :class="{ 'text-active': tab === item.value }" class="text">
{{ item.name }}
</div>
</div>
<img
class="icon-arrow"
:src="tab === item.value ? iconArrowActive : iconArrow"
alt=""
/>
<img class="icon-arrow" :src="tab === item.value ? iconArrowActive : iconArrow" alt="" />
<div v-if="tab === item.value" class="line" />
</div>
</div>
<div class="list">
<div
v-for="(item, index) in list"
:key="item.id"
:class="{ pt0: index === 0, 'item-disabled': item.readFlag }"
class="item"
@click="goDetail(item)"
>
<div v-for="(item, index) in list" :key="item.id" :class="{ pt0: index === 0, 'item-disabled': item.readFlag }"
class="item" @click="goDetail(item)">
<div class="left">
<div class="num">
{{ format(item.sendTime, "dd") }}
@ -190,8 +172,8 @@ function getMore() {
{{ item.titile }}
</div>
<div v-if="tab === 1" class="status">
<div class="tag tag-blue">审批节点{{ item.tag.nodeName }}</div>
<div :class="item.tag.states === 5 ? 'tag-red' : 'tag-green'" class="tag">
<div class="tag tag-blue">审批节点{{ item.tag.sendUserName }}</div>
<div :class="item.tag.states === 3 ? 'tag-red' : 'tag-green'" class="tag">
审批状态{{ getStateText(item.tag.states) }}
</div>
</div>
@ -256,6 +238,7 @@ function getMore() {
.content {
display: flex;
.slider {
.icon {
width: 17px;
@ -276,6 +259,7 @@ function getMore() {
align-items: center;
justify-content: space-between;
cursor: pointer;
&-active {
background: rgba(80, 122, 253, 0.1);
}
@ -291,6 +275,7 @@ function getMore() {
font-weight: 600;
color: #333333;
margin-left: 12px;
&-active {
color: #507afd;
}
@ -472,5 +457,4 @@ function getMore() {
// ::v-deep(.n-divider:not(.n-divider--vertical)) {
// margin-top: 12px;
// margin-bottom: 12px;
// }
</style>
// }</style>

@ -23,6 +23,11 @@ import emitter from '@/utils/mitt'
import { useConfig } from '@/store/modules/asideConfig'
import { getConditionList } from "@/api/home/filter";
import type { FilterSearchParam } from "/#/api";
import { useRoute } from 'vue-router'
const route = useRoute()
const searchContent = route.query.searchContent as string;
const CustomFieldModalRef = ref(null)
const collapse = ref(false)
const taskStore = useTaskStore()
@ -156,7 +161,8 @@ async function init(){
//currentlySelectedAdvanced.value=""
}
function handleKeydown(event) {
if (event.key === "s") setShowSearch(true)}
if (event.key === "s") setShowSearch(true)
}
// key
function scrollHandler(key: string) {
const element = document.querySelector(`#${key}`)
@ -200,6 +206,18 @@ defineExpose({
setAsideItemName,
})
const initSerach = () => {
if (searchContent) {
setShowSearch(true);
const id_param = searchContent.match(/-\d+-/);
if (id_param) {
search.value = id_param[0].slice(1, -1);
inputHandler(id_param[0].slice(1, -1));
}
}
}
initSerach();
const handleOk = (item: any) => {
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
@ -212,12 +230,7 @@ const handleOk = (item: any) => {
</script>
<template>
<div
class="aside"
:style="asideStyle"
@mouseenter="asideEnter = true"
@mouseleave="asideEnter = false"
>
<div class="aside" :style="asideStyle" @mouseenter="asideEnter = true" @mouseleave="asideEnter = false">
<div v-show="showCollapse" class="aside-collapse">
<div class="aside-collapse-btn" @click="collapseHandler">
<SvgIcon :name="collapseIcon" size="40" />
@ -246,55 +259,24 @@ const handleOk = (item: any) => {
</div>
</div> -->
<!-- 高级筛选 -->
<AdvanceFilter
v-show="!showSearch"
:type="2"
@select="filterHandler"
@update:search="setShowSearch(true)"
@show-custom="showModal(CustomFieldModalRef)"
@show-filter="showModal(filterModalRef)"
ref="AdvanceFilterRef"
/>
<AdvanceFilter v-show="!showSearch" :type="2" @select="filterHandler" @update:search="setShowSearch(true)"
@show-custom="showModal(CustomFieldModalRef)" @show-filter="showModal(filterModalRef)" ref="AdvanceFilterRef" />
<div v-show="showSearch" class="warpper">
<n-input
v-model:value="search"
style="flex: 1; height: 32px"
placeholder="请输入你需要搜索的内容"
@input="inputHandler"
>
<n-input v-model:value="search" style="flex: 1; height: 32px" placeholder="请输入你需要搜索的内容" @input="inputHandler">
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" />
</template>
</n-input>
<SvgIcon
size="16px"
style="margin-left: 6px; cursor: pointer"
name="clear"
@click="setShowSearch(false)"
/>
<SvgIcon size="16px" style="margin-left: 6px; cursor: pointer" name="clear" @click="setShowSearch(false)" />
</div>
</div>
<TaskList
ref="taskListRef"
:show-field-list="showFieldList"
style="height: 811px"
class="work-sheet-list"
/>
<TaskList ref="taskListRef" :show-field-list="showFieldList" style="height: 811px" class="work-sheet-list" />
<!-- calc(100vh - 146px) -->
<CustomFieldModal
ref="CustomFieldModalRef"
:review-type="reviewType"
@on-ok="getshowFieldList"
/>
<CustomFieldModal ref="CustomFieldModalRef" :review-type="reviewType" @on-ok="getshowFieldList" />
<!-- 过滤列表 -->
<FilterModalVue
ref="filterModalRef"
:type="2"
@edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)"
@handleOk="handleOk"
/>
<FilterModalVue ref="filterModalRef" :type="2" @edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)" @handleOk="handleOk" />
<!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />
</div>

@ -76,7 +76,7 @@ async function fetchList() {
watch(
() => taskStore.activeId,
(newVal) => {
// activeId.value = newVal
activeId.value = newVal
},
)

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { ref, watch } from "vue";
import * as XLSX from 'xlsx';
import * as XLSX from "xlsx";
defineProps({
data: {
@ -37,14 +37,28 @@ function getrowvalue(row){
<th v-if="item && item[0]">
{{ item[0].label }}
</th>
<td v-if="item && item[0]" :class="item[0].blue ? 'blue' : ''" @click="getrowvalue(item[0])">
{{ item[0].value }}
<td
v-if="item && item[0]"
:class="item[0].blue ? 'blue' : ''"
@click="getrowvalue(item[0])"
>
<span :style="item[0].label == '定位信息'?{cursor:'pointer'}:{}" v-show="item[0].label == '定位信息'">
<SvgIcon class="icon" size="16" name="lctname"
/></span>
<span :style="item[0].label == '定位信息'?{cursor:'pointer'}:{}"> {{ item[0].value }}</span>
</td>
<th v-if="item && item.length > 1">
{{ item[1].label }}
</th>
<td v-if="item && item.length > 1" :class="item[1].blue ? 'blue' : ''" @click="getrowvalue(item[1])">
{{ item[1].value }}
<td
v-if="item && item.length > 1"
:class="item[1].blue ? 'blue' : ''"
@click="getrowvalue(item[1])"
>
<span :style="item[0].label == '定位信息'?{cursor:'pointer'}:{}" v-show="item[1].label == '定位信息'">
<SvgIcon class="icon" size="16" name="lctname" />
</span>
<span :style="item[1].label == '定位信息'?{cursor:'pointer'}:{}"> {{ item[1].value }}</span>
</td>
</tr>
</table>

@ -32,6 +32,9 @@ function setAsideItemName(text) {
:deep(.wrapper){
top:0
}
:deep(.ip_box){
z-index: 50;
}
.main {
display: flex;
flex-direction: row;

@ -1,10 +1,12 @@
<script lang="ts" setup>
import { cloneDeep, difference } from 'lodash-es'
import { computed, defineEmits, defineProps, onMounted, ref, watch } from 'vue'
import { VueDraggable } from 'vue-draggable-plus'
import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
import { workPackageMap } from '@/config/workorder'
import { useUser } from '@/store/modules/user'
import { cloneDeep, difference } from "lodash-es";
import { computed, defineEmits, defineProps, onMounted, ref, watch } from "vue";
import { VueDraggable } from "vue-draggable-plus";
import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter";
import { workPackageMap } from "@/config/workorder";
import { useUser } from "@/store/modules/user";
import { useMessage } from "naive-ui";
const message = useMessage();
const props = defineProps({
reviewType: {
@ -12,358 +14,352 @@ const props = defineProps({
default: () => 1,
require: true,
},
})
});
const emit = defineEmits(['onOk'])
const emit = defineEmits(["onOk"]);
//
const offList = ref<any[]>([])
const offList = ref<any[]>([]);
//
const onList = ref<any[]>([])
const onList = ref<any[]>([]);
//
const fixList = ref<any[]>([])
const fixList = ref<any[]>([]);
const offShowList = ref<any[]>([])
const onShowList = ref<any[]>([])
const fixShowList = ref<any[]>([])
const offShowList = ref<any[]>([]);
const onShowList = ref<any[]>([]);
const fixShowList = ref<any[]>([]);
const allCount = computed(() => {
return `全部字段(共${offList.value.length - 1}个)`
})
return `全部字段(共${offList.value.length - 1}个)`;
});
const selectCount = computed(() => {
return `显示字段(共${onList.value.length}个)`
})
return `显示字段(共${onList.value.length}个)`;
});
function generatList() {
const keys = Object.keys(workPackageMap)
let showList: object[] = []
const hideList: object[] = []
const showStr = 'status'
const showKeys = showStr.split(',').map((key: string) => key.toLowerCase())
const keys = Object.keys(workPackageMap);
let showList: object[] = [];
const hideList: object[] = [];
const showStr = "status";
const showKeys = showStr.split(",").map((key: string) => key.toLowerCase());
for (const key of keys) {
const name = workPackageMap[key]?.label
const isDefault = workPackageMap[key]?.isDefault
const name = workPackageMap[key]?.label;
const isDefault = workPackageMap[key]?.isDefault;
// Y
if (!isDefault) {
hideList.push({
id: key,
name: name || '未配置',
name: name || "未配置",
fix: isDefault,
checked: workPackageMap[key].isDefault,
})
});
}
}
showList = showKeys.reduce((acc, key) => {
const config = {
id: key,
name: workPackageMap[key].label || '未配置',
name: workPackageMap[key].label || "未配置",
fix: workPackageMap[key].isDefault,
}
return [...acc, config]
}, [])
};
return [...acc, config];
}, []);
const fixedList = generateDefaultList()
const fixedList = generateDefaultList();
hideList.unshift(...fixedList)
showList.unshift(...fixedList)
hideList.unshift(...fixedList);
showList.unshift(...fixedList);
onList.value = showList
offList.value = hideList
return { showList, hideList }
onList.value = showList;
offList.value = hideList;
return { showList, hideList };
}
function generateDefaultList() {
return Object.keys(workPackageMap).reduce((acc, key) => {
const { label, isDefault } = workPackageMap[key]
const { label, isDefault } = workPackageMap[key];
if (isDefault) {
const config = {
id: key,
name: label || '未配置',
name: label || "未配置",
fix: true,
checked: true,
};
return [...acc, config];
} else {
return acc;
}
return [...acc, config]
}
else {
return acc
}
}, [])
}, []);
}
const show = ref(false)
const show = ref(false);
const checkAll = computed(() => {
let baseNum = 0
let baseNum = 0;
offList.value.map((v) => {
if (v.fix)
baseNum += 1
})
return onList.value.length == offList.value.length - baseNum
})
if (v.fix) baseNum += 1;
});
return onList.value.length == offList.value.length - baseNum;
});
function showModal() {
show.value = true
show.value = true;
}
function closeModal() {
show.value = false
show.value = false;
}
async function handleSumbit(e: MouseEvent) {
const userStore = useUser()
const userInfo = userStore.getUserInfo
let userFieldFixed = ''
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let userFieldFixed = "";
fixList.value.map((v) => {
userFieldFixed += `${v.id},`
})
userFieldFixed += `${v.id},`;
});
onList.value.map((v) => {
userFieldFixed += `${v.id},`
})
userFieldFixed = userFieldFixed.slice(0, userFieldFixed.length - 1)
savefield(props.reviewType, userInfo.id, userFieldFixed)
e.preventDefault()
closeModal()
emit('onOk')
userFieldFixed += `${v.id},`;
});
userFieldFixed = userFieldFixed.slice(0, userFieldFixed.length - 1);
savefield(props.reviewType, userInfo.id, userFieldFixed);
e.preventDefault();
closeModal();
emit("onOk");
}
defineExpose({
showModal,
})
});
// generatList();
const selectIds = ref<string[]>([])
const selectIds = ref<string[]>([]);
function onCheckAllChange(value) {
const ids: string[] = []
const ids: string[] = [];
for (const item of offList.value) {
if (!item.fix) {
item.checked = value
ids.push(item.id)
item.checked = value;
ids.push(item.id);
}
}
for (const item of offShowList.value) {
if (!item.fix)
item.checked = value
if (!item.fix) item.checked = value;
}
selectIds.value = value ? ids : []
selectIds.value = value ? ids : [];
if (value) {
offList.value.map((v) => {
if (!v.checked)
onList.value.push(v)
})
onShowList.value = cloneDeep(onList.value)
}
else {
onList.value = []
onShowList.value = []
if (!v.checked) onList.value.push(v);
});
onShowList.value = cloneDeep(onList.value);
} else {
onList.value = [];
onShowList.value = [];
}
}
function onCheckChange(checked: any, item: any) {
const index = selectIds.value.indexOf(item.id)
item.checked = checked
const currentIndex = offList.value.findIndex(v => v.id == item.id)
offList.value[currentIndex].checked = checked
if (index === -1 && checked)
selectIds.value.push(item.id)
else
selectIds.value.splice(index, 1)
const index = selectIds.value.indexOf(item.id);
// TODO
// if (index == -1 && selectIds.value.length >= 6) {
// item.checked = false;
// message.error("6");
// return;
// }
item.checked = checked;
const currentIndex = offList.value.findIndex((v) => v.id == item.id);
offList.value[currentIndex].checked = checked;
if (index === -1 && checked) {
selectIds.value.push(item.id);
} else {
selectIds.value.splice(index, 1);
}
}
const showIds = computed(() => {
return onList.value.map((item) => {
return item.id
})
})
return item.id;
});
});
watch(
() => selectIds.value.length,
(newVal, oldVal) => {
if (newVal === oldVal)
return
if (newVal === oldVal) return;
const action = newVal > oldVal ? 'add' : 'remove'
const diff
= action === 'add'
const action = newVal > oldVal ? "add" : "remove";
const diff =
action === "add"
? difference(selectIds.value, showIds.value)
: difference(showIds.value, selectIds.value)
: difference(showIds.value, selectIds.value);
if (diff.length === 0)
return
if (diff.length === 0) return;
if (action === 'add') {
if (action === "add") {
for (const item of offList.value) {
if (!item.fix && diff.includes(item.id)) {
onList.value.push({
id: item.id,
name: item.name || '未配置',
name: item.name || "未配置",
fix: item.fix || false,
})
});
}
}
onShowList.value = cloneDeep(onList.value)
}
else {
const list = onList.value
onShowList.value = cloneDeep(onList.value);
} else {
const list = onList.value;
for (let index = 0; index < list.length; index++) {
const item = list[index]
const item = list[index];
if (!item.fix && diff.includes(item.id)) {
list.splice(index, 1)
onShowList.value.splice(index, 1)
index--
list.splice(index, 1);
onShowList.value.splice(index, 1);
index--;
}
}
console.log(onShowList.value, list, 'onShowList')
console.log(onShowList.value, list, "onShowList");
}
},
)
}
);
watch(
() => showIds.value.length,
(newVal, oldVal) => {
if (newVal === oldVal)
return
if (newVal === oldVal) return;
const diff = difference(selectIds.value, showIds.value)
const diff = difference(selectIds.value, showIds.value);
if (diff.length === 0)
return
if (diff.length === 0) return;
for (const item of offList.value) {
if (!item.fix && diff.includes(item.id)) {
const index = selectIds.value.indexOf(item.id)
item.checked = false
selectIds.value.splice(index, 1)
const index = selectIds.value.indexOf(item.id);
item.checked = false;
selectIds.value.splice(index, 1);
}
}
},
)
}
);
function clearDragSource() {
onList.value = onList.value.filter((item) => {
return item.fix === true
})
onShowList.value = cloneDeep(onList.value)
return item.fix === true;
});
onShowList.value = cloneDeep(onList.value);
}
function removeHandler(id: string) {
let index = onList.value.findIndex((item) => {
return item.id === id
})
return item.id === id;
});
if (index !== -1) {
onList.value.splice(index, 1)
onShowList.value.splice(index, 1)
onList.value.splice(index, 1);
onShowList.value.splice(index, 1);
}
index = offList.value.findIndex(v => v.id == id)
offList.value[index].checked = false
offShowList.value = cloneDeep(offList.value)
index = offList.value.findIndex((v) => v.id == id);
offList.value[index].checked = false;
offShowList.value = cloneDeep(offList.value);
}
function initData() {
offList.value = []
onList.value = []
fixList.value = []
offShowList.value = []
onShowList.value = []
fixShowList.value = []
selectIds.value = []
}
async function getData(type = '') {
initData()
const userStore = useUser()
const userInfo = userStore.getUserInfo
let res
res = await getAllfieldList(props.reviewType) //
const allList = res.data
res = await getfieldList(props.reviewType, userInfo.id) //
const useList = res.data
offList.value = [];
onList.value = [];
fixList.value = [];
offShowList.value = [];
onShowList.value = [];
fixShowList.value = [];
selectIds.value = [];
}
async function getData(type = "") {
initData();
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let res;
res = await getAllfieldList(props.reviewType); //
const allList = res.data;
res = await getfieldList(props.reviewType, userInfo.id); //
const useList = res.data;
/**
* name 标题
* id 键值
* fix 是否默认
* checked 是否选中
*/
const userFieldFixed = useList?.userFieldFixed?.split(',')
const userFieldUnFixed = useList?.userFieldUnFixed?.split(',')
if (!type || type == 'off') {
offList.value = []
const userFieldFixed = useList?.userFieldFixed?.split(",");
const userFieldUnFixed = useList?.userFieldUnFixed?.split(",");
if (!type || type == "off") {
offList.value = [];
allList?.map((v) => {
const item = {
name: v.fieldDesc,
id: v.name,
fix: v.isrequired == 2,
checked:
v.isrequired == 2
|| Boolean(userFieldFixed?.find(v2 => v2 == v.name))
|| Boolean(userFieldUnFixed?.find(v2 => v2 == v.name)),
}
if (item.fix)
fixList.value.push(item)
else
offList.value.push(item)
})
offList.value.unshift(...fixList.value)
}
if (!type || type == 'on') {
useList?.userFieldFixed?.split(',').map((v) => {
let item = allList.find(v2 => v2.name == v)
v.isrequired == 2 ||
Boolean(userFieldFixed?.find((v2) => v2 == v.name)) ||
Boolean(userFieldUnFixed?.find((v2) => v2 == v.name)),
};
if (item.fix) fixList.value.push(item);
else offList.value.push(item);
});
offList.value.unshift(...fixList.value);
}
if (!type || type == "on") {
useList?.userFieldFixed?.split(",").map((v) => {
let item = allList.find((v2) => v2.name == v);
if (item) {
item = {
name: item.fieldDesc,
id: item.name,
fix: item.isrequired == 2,
checked: true,
};
selectIds.value.push(item.id);
if (!item.fix) onList.value.push(item);
}
selectIds.value.push(item.id)
if (!item.fix)
onList.value.push(item)
});
}
})
}
offShowList.value = cloneDeep(offList.value)
fixShowList.value = cloneDeep(fixList.value)
onShowList.value = cloneDeep(onList.value)
offShowList.value = cloneDeep(offList.value);
fixShowList.value = cloneDeep(fixList.value);
onShowList.value = cloneDeep(onList.value);
}
onMounted(() => getData())
onMounted(() => getData());
const indeterminate = computed(() => {
let baseNum = 0
let baseNum = 0;
offList.value.map((v) => {
if (v.fix)
baseNum += 1
})
if (v.fix) baseNum += 1;
});
return (
onShowList.value.length > 0
&& offShowList.value.length - baseNum > onShowList.value.length
)
})
onShowList.value.length > 0 &&
offShowList.value.length - baseNum > onShowList.value.length
);
});
function queryData(value, type) {
if (value) {
if (type == 'off') {
offShowList.value = offList.value.filter(item => item.name.includes(value))
}
else {
onShowList.value = onList.value.filter(item => item.name.includes(value))
fixShowList.value = fixList.value.filter(item => item.name.includes(value))
}
if (type == "off") {
offShowList.value = offList.value.filter((item) => item.name.includes(value));
} else {
onShowList.value = onList.value.filter((item) => item.name.includes(value));
fixShowList.value = fixList.value.filter((item) => item.name.includes(value));
}
else {
} else {
// getData(type);
if (type == 'off') {
offShowList.value = cloneDeep(offList.value)
}
else {
onShowList.value = cloneDeep(onList.value)
fixShowList.value = cloneDeep(fixList.value)
if (type == "off") {
offShowList.value = cloneDeep(offList.value);
} else {
onShowList.value = cloneDeep(onList.value);
fixShowList.value = cloneDeep(fixList.value);
}
}
}
const moreThanSix = computed(() => {
return selectIds.value.length >= 6;
});
</script>
<template>
@ -420,7 +416,7 @@ function queryData(value, type) {
<n-checkbox
v-model:checked="item.checked"
:label="item.name"
:disabled="item.fix"
:disabled="item.fix || (!item.checked && moreThanSix)"
@update:checked="onCheckChange($event, item)"
/>
</div>
@ -449,9 +445,7 @@ function queryData(value, type) {
<SvgIcon size="14px" name="magnifying-1" />
</template>
</n-input>
<div class="draggable-title">
系统默认
</div>
<div class="draggable-title">系统默认</div>
<div class="draggable-ul" style="border-bottom: none">
<div
v-for="item in fixShowList"
@ -462,9 +456,7 @@ function queryData(value, type) {
<span class="ml-2">{{ item.name }}</span>
</div>
</div>
<div class="draggable-title" style="border-top: none">
自定义配置
</div>
<div class="draggable-title" style="border-top: none">自定义配置</div>
<VueDraggable
v-model="onList"
class="draggable-ul"
@ -495,10 +487,15 @@ function queryData(value, type) {
</div>
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="handleSumbit">
确定
</n-button>
<n-button secondary style="margin-left: 15px" @click="getData();closeModal()">
<n-button type="info" @click="handleSumbit"> </n-button>
<n-button
secondary
style="margin-left: 15px"
@click="
getData();
closeModal();
"
>
取消
</n-button>
</div>

@ -18,7 +18,11 @@ import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useUser } from '@/store/modules/user'
import { useWorkOrder } from '@/store/modules/workOrder'
import { getViewportOffset } from '@/utils/domUtils'
import { useRoute } from 'vue-router'
const route = useRoute()
const searchContent = route.query.searchContent;
console.log(searchContent);
defineOptions({ name: 'AsideContent' })
const emit = defineEmits(['ApprovalOver'])
@ -36,7 +40,7 @@ function collapseHandler() {
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
const searchKeyword = ref('')
const searchKeyword = ref(searchContent ? searchContent : '')
const asideWidth = computed(() => {
return collapse.value ? 0 : 308
@ -157,15 +161,15 @@ const inputHandler = debounce((word) => {
function ApprovalOver(packageId) {
emit('ApprovalOver', packageId)
}
if (searchContent) {
showSearch.value = true
inputHandler(searchContent)
}
</script>
<template>
<div
class="aside"
:style="asideStyle"
@mouseenter="asideEnter = true"
@mouseleave="asideEnter = false"
>
<div class="aside" :style="asideStyle" @mouseenter="asideEnter = true" @mouseleave="asideEnter = false">
<div v-show="showCollapse" class="aside-collapse">
<div class="aside-collapse-btn" @click="collapseHandler">
<SvgIcon :name="collapseIcon" size="40" />
@ -179,46 +183,23 @@ function ApprovalOver(packageId) {
<span style="margin-left: 8px; color: #333333">所有任务包</span>
</div>
<div class="right">
<SvgIcon
style="cursor: pointer; margin-left: 10px"
size="18"
name="magnifying-1"
@click="setShowSearch(true)"
/>
<SvgIcon
style="cursor: pointer; margin-left: 10px"
size="18"
name="filter"
@click="showFilter"
/>
<SvgIcon style="cursor: pointer; margin-left: 10px" size="18" name="magnifying-1"
@click="setShowSearch(true)" />
<SvgIcon style="cursor: pointer; margin-left: 10px" size="18" name="filter" @click="showFilter" />
</div>
</div>
<div v-show="showSearch" class="warpper">
<n-input
v-model:value="searchKeyword"
style="flex: 1; height: 32px"
placeholder="请输入你需要搜索的内容"
@input="inputHandler"
>
<n-input v-model:value="searchKeyword" style="flex: 1; height: 32px" placeholder="请输入你需要搜索的内容"
@input="inputHandler">
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" />
</template>
</n-input>
<SvgIcon
size="16px"
style="margin-left: 6px; cursor: pointer"
name="clear"
@click="setShowSearch(false)"
/>
<SvgIcon size="16px" style="margin-left: 6px; cursor: pointer" name="clear" @click="setShowSearch(false)" />
</div>
</div>
<WorkSheetList
ref="packageListRef"
class="work-sheet-list"
:show-field-list="showFieldList"
:dicts="dicts"
@approval-over="ApprovalOver"
/>
<WorkSheetList ref="packageListRef" class="work-sheet-list" :show-field-list="showFieldList" :dicts="dicts"
@approval-over="ApprovalOver" />
<CustomFieldModalVue ref="filterModalRef" :review-type="1" @on-ok="getshowFieldList" />
</div>
</template>
@ -237,6 +218,7 @@ function ApprovalOver(packageId) {
padding: 12px 16px;
width: 100%;
overflow: hidden;
.warpper {
display: flex;
justify-content: space-between;

@ -0,0 +1,209 @@
<script setup lang="ts">
import { ref } from 'vue'
const props = defineProps({
imgurl: String,
isFullScreen: Boolean,
imgbigshow: Boolean,
taskDetailInfo: Object,
batch: Boolean,
})
const imageRef = ref<ComponentElRef | null>()
const overTask = ref<any>(null)
const overTasktwo = ref<any>(null)
function overTaskHandle() {
const item = props.taskDetailInfo
if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
overTask.value = null
return
}
if (validate([item]) == null && props.batch === false)
overTask.value = item
}
// states:1234
function validate(items: any[]) {
if (items.length === 0)
return '至少选中一个任务'
// const useInfo = userStore.getUserInfo
// const username = useInfo.loginname
// for (const item of items) {
// const { iztrueorfalse, states, assignee } = item
// if (iztrueorfalse === null)
// return ''
// else if (states !== 2)
// return ''
// else if (assignee !== username)
// return ''
// }
return null
}
function leaveTaskHandler() {
overTask.value = null
overTasktwo.value = null
}
function previewHandler(event: MouseEvent) {
event.stopImmediatePropagation()
event.stopPropagation()
if (imageRef.value && (imageRef.value as any).src)
(imageRef.value as any).mergedOnClick()
}
</script>
<template>
<div
class="left"
:style="
isFullScreen
? imgbigshow
? {
'position': 'relative',
'flex': 2,
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
}
: {
'height': '92vh',
'flex': 2,
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
}
: {
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
}
"
@mouseover="overTaskHandle"
@mouseleave="leaveTaskHandler"
@click="previewHandler"
>
<div v-show="overTask" class="action">
<SvgIcon
style="cursor: pointer"
name="t1"
size="74.95"
@click.stop="approvalHandler"
/>
<SvgIcon
style="cursor: pointer; margin-left: 32px"
name="t2"
size="74.95"
@click.stop="singleRejectHandler"
/>
<SvgIcon
style="cursor: pointer; margin-left: 32px"
name="t9"
size="74.95"
@click.stop="addSuspicious"
/>
</div>
<div class="check">
<n-checkbox
v-show="batch && taskDetailInfo?.userapprove?.statshis === 1"
v-model:checked="taskDetailInfo?.checked"
@click.stop
@update:checked="onCheckChange($event, taskDetailInfo)"
/>
</div>
<div class="status">
<img
v-show="taskDetailInfo?.userapprove?.statshis === 2"
class="img-status"
src="@/assets/images/task/pass.png"
alt=""
>
<img
v-show="taskDetailInfo?.userapprove?.statshis === 3"
class="img-status"
src="@/assets/images/task/not_pass.png"
alt=""
>
</div>
<div class="mark">
<SvgIcon
v-show="taskDetailInfo?.iztrueorfalse === 0"
size="128"
name="jia"
/>
</div>
<div class="mark">
<SvgIcon
v-show="taskDetailInfo?.iztrueorfalse === 1"
size="128"
name="zhen"
/>
</div>
<div class="big-mark" />
<div class="preview" @click="previewHandler">
<SvgIcon size="16" name="zoom-out" />
</div>
<div class="info img-info">
<n-grid x-gap="12" y-gap="10" :cols="12">
<n-gi span="4" class="gi1">
<span>
<img
class="icon-status"
src="@/assets/images/task/status.png"
alt=""
>
</span>
</n-gi>
<n-gi span="8" class="gi2">
<span class="value">{{
TASK_STATUS_OBJ[taskDetailInfo?.userapprove?.statshis]
}}</span>
<span class="label">审批状态</span>
</n-gi>
<n-gi span="4" class="gi1">
<span>
<img
class="icon-status"
src="@/assets/images/task/similarity.png"
alt=""
>
</span>
</n-gi>
<n-gi span="8" class="gi2">
<span class="value num">{{ totalCount }}<span class="unit"></span>
</span>
<span class="label">相似匹配</span>
</n-gi>
</n-grid>
</div>
<div class="time">
<div class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="16" name="camera-time" />
<span>{{ taskDetailInfo?.ocrPicture?.photoDateTimestamp ?? "-" }}</span>
</div>
<div class="time-item time-item2">
<SvgIcon class="svg-time" color="#FFF" size="16" name="submit-time" />
<span>{{
taskDetailInfo?.ocrPicture?.submitDateTimestamp
? formatToDateHMS(
Number(taskDetailInfo.ocrPicture.submitDateTimestamp),
)
: "-"
}}</span>
</div>
</div>
<div style="display: none">
<n-image
ref="imageRef"
:img-props="{ onClick: hideDownload }"
:src="taskDetailInfo?.ocrPicture?.imgurl"
/>
</div>
<div class="leftback" />
</div>
</template>
<style>
</style>

@ -13,7 +13,16 @@ import { format } from 'date-fns'
import imagesloaded from 'imagesloaded'
import { clone, cloneDeep, debounce, pickBy } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { computed, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue'
import {
computed,
onMounted,
onUnmounted,
onUpdated,
reactive,
ref,
unref,
watch,
} from 'vue'
import PictureInfo from '../components/PictureInfo.vue'
import ConfrimModal from '../modal/ConfrimModal.vue'
import type { ApprovalParam, SimilarityPictureSortParam } from '/#/api'
@ -28,8 +37,7 @@ let _imagesload: any
function setBatch(value: boolean) {
if (value && batch.value)
batch.value = !value
else
batch.value = value
else batch.value = value
if (value === false) {
selectItems.value.forEach(item => (item.checked = false))
@ -263,15 +271,23 @@ function leaveTaskHandler() {
overTask.value = null
}
function onEsc() {
if (isFullScreen.value && !(document.querySelector('.n-modal-container')))
if (isFullScreen.value && !document.querySelector('.n-modal-container'))
isFullScreen.value = false
}
function resizeImage() {
const container = document.querySelector('.image-container')!
const containerWidth = container.offsetWidth
const containerHeight = container.offsetHeight
}
onUnmounted(() => {
workStore.reset()
document.removeEventListener('keydown', onEsc)
})
onMounted(() => {
document.addEventListener('keydown', onEsc)
window.addEventListener('resize', resizeImage)
})
function immersionHandler() {
// class="wrapper"
@ -282,8 +298,8 @@ function immersionHandler() {
function showAction() {
const item = taskDetailInfo.value
// if (item.historyStates === 2 || item.historyStates === 3)
// return
if (item.historyStates === 2 || item.historyStates === 3)
return
if (batch.value === false)
overTask.value = item
@ -379,7 +395,9 @@ function handleApproveMainImage(items?: any) {
const packageid = workStore.getActiveId
taskDetailInfo.value = await getTaskDetailInfo(packageid)
}
else { message.error(res.message) }
else {
message.error(res.message)
}
})
},
onNegativeClick: () => {},
@ -445,7 +463,9 @@ function doAudit(param: any) {
emitter.emit('refresh')
refreshHandler()
}
else { message.error(res.message) }
else {
message.error(res.message)
}
})
}
@ -467,7 +487,9 @@ function handleRejectdubiousfileyd() {
refreshHandler()
})
}
else { message.error(res.message) }
else {
message.error(res.message)
}
})
},
onNegativeClick: () => {},
@ -483,8 +505,18 @@ defineExpose({
<div class="wrapper-header">
<div class="left">
<span class="font">{{ packageName }}</span>
<SvgIcon size="22" class="forward" name="arrow-left" @click="backHandler" />
<SvgIcon size="22" class="back" name="arrow-right" @click="forwardHandler" />
<SvgIcon
size="22"
class="forward"
name="arrow-left"
@click="backHandler"
/>
<SvgIcon
size="22"
class="back"
name="arrow-right"
@click="forwardHandler"
/>
</div>
<div class="right">
<div v-show="!showActions" style="display: flex; align-items: center">
@ -517,7 +549,10 @@ defineExpose({
</template>
返回
</n-button>
<div style="cursor: pointer; margin-left: 16px" @click.stop="rejectHandler">
<div
style="cursor: pointer; margin-left: 16px"
@click.stop="rejectHandler"
>
<SvgIcon width="64" height="28" name="a1" />
</div>
<SvgIcon size="24" name="vs" />
@ -542,13 +577,17 @@ defineExpose({
<div class="footer-times">
<div class="time" style="margin-bottom: 4px">
<SvgIcon color="#FFF" size="16" name="camera" />
<span class="time-value">{{ taskDetailInfo?.photoDateTimestamp }} </span>
<span class="time-value">{{ taskDetailInfo?.photoDateTimestamp }}
</span>
</div>
<div class="time">
<SvgIcon color="#FFF" size="16" name="save" />
<span class="time-value">{{
taskDetailInfo?.submitDateTimestamp
? format(taskDetailInfo?.submitDateTimestamp, "yyyy-MM-dd HH:mm:ss")
? format(
taskDetailInfo?.submitDateTimestamp,
"yyyy-MM-dd HH:mm:ss",
)
: "-"
}}
</span>
@ -556,11 +595,15 @@ defineExpose({
</div>
<div class="status">
<img
v-show="taskDetailInfo?.historyStates === 2" class="img-status" src="@/assets/images/task/pass.png"
v-show="taskDetailInfo?.historyStates === 2"
class="img-status"
src="@/assets/images/task/pass.png"
alt=""
>
<img
v-show="taskDetailInfo?.historyStates === 3" class="img-status" src="@/assets/images/task/not_pass.png"
v-show="taskDetailInfo?.historyStates === 3"
class="img-status"
src="@/assets/images/task/not_pass.png"
alt=""
>
</div>
@ -599,7 +642,7 @@ defineExpose({
</n-grid>
</div>
<!-- 右上点击大图 -->
<div class="preview" style="z-index: 5;" @click="previewHandler">
<div class="preview" style="z-index: 5" @click="previewHandler">
<SvgIcon size="16" name="zoom-out" />
</div>
<!-- 预览大图组件 -->
@ -611,20 +654,48 @@ defineExpose({
/>
</div>
<!-- 操作 -->
<div v-show="overTask && overTask.id === taskDetailInfo.id" class="action" @click.stop="hideAction">
<SvgIcon v-if="[1].includes(taskDetailInfo.historyStates)" style="cursor: pointer" name="t1" @click.stop="handleApproveMainImage" />
<SvgIcon v-if="[1].includes(taskDetailInfo.historyStates)" style="cursor: pointer; margin-left: 30px" name="t2" @click.stop="handleRejectMainImage" />
<SvgIcon v-if="[1, 2, 3].includes(taskDetailInfo.historyStates)" style="cursor: pointer; margin-left: 30px" name="t9" @click.stop="handleRejectdubiousfileyd" />
<div
v-show="overTask && overTask.id === taskDetailInfo.id"
class="action"
@click.stop="hideAction"
>
<SvgIcon
v-if="[1].includes(taskDetailInfo.historyStates)"
style="cursor: pointer"
name="t1"
@click.stop="handleApproveMainImage"
/>
<SvgIcon
v-if="[1].includes(taskDetailInfo.historyStates)"
style="cursor: pointer; margin-left: 30px"
name="t2"
@click.stop="handleRejectMainImage"
/>
<SvgIcon
v-if="[1, 2, 3].includes(taskDetailInfo.historyStates)"
style="cursor: pointer; margin-left: 30px"
name="t9"
@click.stop="handleRejectdubiousfileyd"
/>
</div>
</div>
<PictureInfo :task-detail-info="taskDetailInfo" />
</div>
<div
style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0"
style="
display: flex;
justify-content: space-between;
padding: 12px 0px 3px 0;
"
>
<div>
<span
style="font-size: 18px; font-weight: Medium;color: #333333;font-family: PingFang SC, PingFang SC-Medium;"
style="
font-size: 18px;
font-weight: Medium;
color: #333333;
font-family: PingFang SC, PingFang SC-Medium;
"
>任务包图片</span>
</div>
<div
@ -705,16 +776,22 @@ defineExpose({
</div>
<div class="check">
<n-checkbox
v-show="batch && item.historyStates !== 2 && item.historyStates !== 3"
v-show="
batch && item.historyStates !== 2 && item.historyStates !== 3
"
v-model:checked="item.checked"
@click.stop
@update:checked="onCheckChange($event, item)"
/>
</div>
<div class="percent">
<SvgIcon size="42" :name="item.maxSimilarity == 100 ? 'error_tag' : 'tag'" />
<SvgIcon
size="42"
:name="item.maxSimilarity == 100 ? 'error_tag' : 'tag'"
/>
<div class="val">
{{ item?.maxSimilarity && Number(item?.maxSimilarity).toFixed(0)
{{
item?.maxSimilarity && Number(item?.maxSimilarity).toFixed(0)
}}<span class="percent-unit">%</span>
</div>
</div>
@ -726,17 +803,31 @@ defineExpose({
</div>
<div v-show="overTask && overTask.id === item.id" class="action">
<SvgIcon v-if="item.historyStates === 1" style="cursor: pointer" name="t1" @click.stop="approvalHandler" />
<SvgIcon
v-if="item.historyStates === 1"
style="cursor: pointer"
name="t1"
@click.stop="approvalHandler"
/>
<SvgIcon
v-if="[1].includes(item.historyStates)"
style="cursor: pointer; margin-left: 40px"
name="t2"
@click.stop="singleRejectHandler(item)"
/>
<SvgIcon style="cursor: pointer; margin-left: 30px" name="t9" @click.stop="handleRejectdubiousfileyd" />
<SvgIcon
style="cursor: pointer; margin-left: 30px"
name="t9"
@click.stop="handleRejectdubiousfileyd"
/>
</div>
</div>
<n-back-top :listen-to="wrapperListRef" :bottom="220" :visibility-height="10" style="height: 64px; width: 64px;border-radius: 32px;">
<n-back-top
:listen-to="wrapperListRef"
:bottom="220"
:visibility-height="10"
style="height: 64px; width: 64px; border-radius: 32px"
>
<div
style="
width: 64px;
@ -744,12 +835,19 @@ defineExpose({
/* line-height: 40px; */
text-align: center;
font-size: 14px;
position: relative
position: relative;
"
>
<svg-icon
name="top"
style="width:84px;height: 84px;position: absolute;left: 50%;top: 50%;transform: translate(-50%,-50%);"
style="
width: 84px;
height: 84px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
"
/>
</div>
</n-back-top>
@ -860,11 +958,14 @@ defineExpose({
.left {
flex: 0.6;
background-size: cover;
background-size: auto 346px;
background-position: center;
background-repeat: no-repeat;
border-radius: 8px;
position: relative;
width: 632px;
height: 346px;
.preview {
position: absolute;
@ -947,7 +1048,12 @@ defineExpose({
border-radius: 8px;
align-items: center;
justify-content: center;
background: linear-gradient(180deg,rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.00) 29%, rgba(3,0,0,0.73))
background: linear-gradient(
180deg,
rgba(0, 0, 0, 0) 0%,
rgba(0, 0, 0, 0) 29%,
rgba(3, 0, 0, 0.73)
);
}
.info {
@ -1253,7 +1359,11 @@ defineExpose({
border-radius: 8px;
align-items: center;
justify-content: center;
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%
);
}
}
}

Loading…
Cancel
Save