|
|
@ -1,87 +1,85 @@
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { useTaskStore } from "@/store/modules/task";
|
|
|
|
import { debounce } from 'lodash-es'
|
|
|
|
import { debounce } from "lodash-es";
|
|
|
|
import { computed, onMounted, ref, shallowRef, unref, watch } from 'vue'
|
|
|
|
import { computed, onMounted, ref, unref, watch, shallowRef } from "vue";
|
|
|
|
import CustomFieldModal from '../modal/CustomFieldModal.vue'
|
|
|
|
import CustomFieldModal from "../modal/CustomFieldModal.vue";
|
|
|
|
import AdvanceFilter from '../../home/aside/comp/AdvanceFilter.vue'
|
|
|
|
import type { AsideEntity } from "@/config/aside";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { useUser } from "@/store/modules/user";
|
|
|
|
|
|
|
|
import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import TaskList from "./TaskList.vue";
|
|
|
|
|
|
|
|
import AdvanceFilter from "../../home/aside/comp/AdvanceFilter.vue";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
CustomFilterModalVue,
|
|
|
|
|
|
|
|
FilterModalVue,
|
|
|
|
FilterModalVue,
|
|
|
|
NewFilterModalVue,
|
|
|
|
NewFilterModalVue,
|
|
|
|
} from "../../home/aside/comp/modals";
|
|
|
|
} from '../../home/aside/comp/modals'
|
|
|
|
|
|
|
|
import TaskList from './TaskList.vue'
|
|
|
|
|
|
|
|
import type { AsideEntity } from '@/config/aside'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { useUser } from '@/store/modules/user'
|
|
|
|
|
|
|
|
import { getAllfieldList, getfieldList } from '@/api/home/filter'
|
|
|
|
|
|
|
|
|
|
|
|
import emitter from "@/utils/mitt";
|
|
|
|
import { useTaskStore } from '@/store/modules/task'
|
|
|
|
|
|
|
|
|
|
|
|
const CustomFieldModalRef = ref(null);
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
const collapse = ref(false);
|
|
|
|
|
|
|
|
const taskStore = useTaskStore();
|
|
|
|
const CustomFieldModalRef = ref(null)
|
|
|
|
const taskListRef = ref<HTMLDivElement | null>(null);
|
|
|
|
const collapse = ref(false)
|
|
|
|
|
|
|
|
const taskStore = useTaskStore()
|
|
|
|
|
|
|
|
const taskListRef = ref<HTMLDivElement | null>(null)
|
|
|
|
// 展示字段
|
|
|
|
// 展示字段
|
|
|
|
const showFieldList = ref<any[]>([]);
|
|
|
|
const showFieldList = ref<any[]>([])
|
|
|
|
|
|
|
|
|
|
|
|
function collapseHandler() {
|
|
|
|
function collapseHandler() {
|
|
|
|
collapse.value = !collapse.value;
|
|
|
|
collapse.value = !collapse.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const asideWidth = computed(() => {
|
|
|
|
const asideWidth = computed(() => {
|
|
|
|
return collapse.value ? 0 : 308;
|
|
|
|
return collapse.value ? 0 : 308
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const asideStyle = computed(() => {
|
|
|
|
const asideStyle = computed(() => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
width: `${asideWidth.value}px`,
|
|
|
|
width: `${asideWidth.value}px`,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const collapseIcon = computed(() => {
|
|
|
|
const collapseIcon = computed(() => {
|
|
|
|
return collapse.value ? "expand-cir" : "collapse-cir";
|
|
|
|
return collapse.value ? 'expand-cir' : 'collapse-cir'
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const asideEnter = ref(false);
|
|
|
|
const asideEnter = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
const showCollapse = computed(() => {
|
|
|
|
const showCollapse = computed(() => {
|
|
|
|
return collapse.value ? true : asideEnter.value;
|
|
|
|
return collapse.value ? true : asideEnter.value
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
watch(
|
|
|
|
() => taskStore.immersion,
|
|
|
|
() => taskStore.immersion,
|
|
|
|
() => {
|
|
|
|
() => {
|
|
|
|
collapse.value = true;
|
|
|
|
collapse.value = true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
function showFilter() {
|
|
|
|
function showFilter() {
|
|
|
|
const modal = unref(CustomFieldModalRef)! as any;
|
|
|
|
const modal = unref(CustomFieldModalRef)! as any
|
|
|
|
modal.showModal();
|
|
|
|
modal.showModal()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const showSearch = ref(false);
|
|
|
|
const showSearch = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
function setShowSearch(value: boolean) {
|
|
|
|
function setShowSearch(value: boolean) {
|
|
|
|
showSearch.value = value;
|
|
|
|
showSearch.value = value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const inputHandler = debounce((word) => {
|
|
|
|
const inputHandler = debounce((word) => {
|
|
|
|
(taskListRef.value as any).search(word);
|
|
|
|
(taskListRef.value as any).search(word)
|
|
|
|
}, 500);
|
|
|
|
}, 500)
|
|
|
|
|
|
|
|
|
|
|
|
const reviewType = 2;
|
|
|
|
const reviewType = 2
|
|
|
|
async function getshowFieldList() {
|
|
|
|
async function getshowFieldList() {
|
|
|
|
showFieldList.value = [];
|
|
|
|
showFieldList.value = []
|
|
|
|
const userStore = useUser();
|
|
|
|
const userStore = useUser()
|
|
|
|
const userInfo = userStore.getUserInfo;
|
|
|
|
const userInfo = userStore.getUserInfo
|
|
|
|
let res;
|
|
|
|
let res
|
|
|
|
res = await getAllfieldList(reviewType); //所有筛选项目
|
|
|
|
res = await getAllfieldList(reviewType) // 所有筛选项目
|
|
|
|
const allList = res.data;
|
|
|
|
const allList = res.data
|
|
|
|
res = await getfieldList(reviewType, userInfo.id); //当前用户选择的项目
|
|
|
|
res = await getfieldList(reviewType, userInfo.id) // 当前用户选择的项目
|
|
|
|
const useList = res.data;
|
|
|
|
const useList = res.data
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* name 标题
|
|
|
|
* name 标题
|
|
|
|
* id 键值
|
|
|
|
* id 键值
|
|
|
@ -89,60 +87,61 @@ async function getshowFieldList() {
|
|
|
|
* checked 是否选中
|
|
|
|
* checked 是否选中
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (useList.userFieldFixed) {
|
|
|
|
if (useList.userFieldFixed) {
|
|
|
|
useList.userFieldFixed?.split(",").map((v) => {
|
|
|
|
useList.userFieldFixed?.split(',').map((v) => {
|
|
|
|
let item = allList.find((v2) => v2.name == v);
|
|
|
|
let item = allList.find(v2 => v2.name == v)
|
|
|
|
if (item) {
|
|
|
|
if (item) {
|
|
|
|
item = {
|
|
|
|
item = {
|
|
|
|
name: item.fieldDesc,
|
|
|
|
name: item.fieldDesc,
|
|
|
|
id: item.name,
|
|
|
|
id: item.name,
|
|
|
|
fix: item.isrequired == 2,
|
|
|
|
fix: item.isrequired == 2,
|
|
|
|
checked: true,
|
|
|
|
checked: true,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
showFieldList.value.push(item);
|
|
|
|
showFieldList.value.push(item)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
// 若为首次获取 则赋默认值
|
|
|
|
// 若为首次获取 则赋默认值
|
|
|
|
allList.map((v) => {
|
|
|
|
allList.map((v) => {
|
|
|
|
if (v.isrequired == 2) {
|
|
|
|
if (v.isrequired == 2) {
|
|
|
|
let item = {
|
|
|
|
const item = {
|
|
|
|
name: v.fieldDesc,
|
|
|
|
name: v.fieldDesc,
|
|
|
|
id: v.name,
|
|
|
|
id: v.name,
|
|
|
|
fix: v.isrequired == 2,
|
|
|
|
fix: v.isrequired == 2,
|
|
|
|
checked: true,
|
|
|
|
checked: true,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
showFieldList.value.push(item);
|
|
|
|
showFieldList.value.push(item)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getshowFieldList();
|
|
|
|
getshowFieldList()
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// 滚动容器,让key对应模块处于可视区域
|
|
|
|
// 滚动容器,让key对应模块处于可视区域
|
|
|
|
function scrollHandler(key: string) {
|
|
|
|
function scrollHandler(key: string) {
|
|
|
|
const element = document.querySelector(`#${key}`);
|
|
|
|
const element = document.querySelector(`#${key}`)
|
|
|
|
element?.scrollIntoView(true);
|
|
|
|
element?.scrollIntoView(true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 选择某个过滤配置,刷新图片墙
|
|
|
|
// 选择某个过滤配置,刷新图片墙
|
|
|
|
function filterHandler(searchId: string) {
|
|
|
|
function filterHandler(searchId: string) {
|
|
|
|
emitter.emit("filter", searchId);
|
|
|
|
emitter.emit('filter', searchId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function showModal(modalRef: any) {
|
|
|
|
function showModal(modalRef: any) {
|
|
|
|
const modal = unref(modalRef)! as any;
|
|
|
|
const modal = unref(modalRef)! as any
|
|
|
|
modal.showModal();
|
|
|
|
modal.showModal()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 当前显示的模块,按照数组顺序显示
|
|
|
|
// 当前显示的模块,按照数组顺序显示
|
|
|
|
const showItems = shallowRef<{ key: string; config: AsideEntity }[]>([]);
|
|
|
|
const showItems = shallowRef<{ key: string, config: AsideEntity }[]>([])
|
|
|
|
const filterModalRef = ref(null);
|
|
|
|
const filterModalRef = ref(null)
|
|
|
|
const newFilterModalRef = ref(null);
|
|
|
|
const newFilterModalRef = ref(null)
|
|
|
|
const customModalRef = ref(null);
|
|
|
|
const customModalRef = ref(null)
|
|
|
|
function editFilter(filter: any) {
|
|
|
|
function editFilter(filter: any) {
|
|
|
|
const modal = unref(newFilterModalRef)! as any;
|
|
|
|
const modal = unref(newFilterModalRef)! as any
|
|
|
|
modal.showModal();
|
|
|
|
modal.showModal()
|
|
|
|
modal.edit(filter);
|
|
|
|
modal.edit(filter)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
@ -209,14 +208,14 @@ function editFilter(filter: any) {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<TaskList
|
|
|
|
<TaskList
|
|
|
|
ref="taskListRef"
|
|
|
|
ref="taskListRef"
|
|
|
|
:showFieldList="showFieldList"
|
|
|
|
:show-field-list="showFieldList"
|
|
|
|
style="height: calc(100vh - 146px)"
|
|
|
|
style="height: calc(100vh - 146px)"
|
|
|
|
class="work-sheet-list"
|
|
|
|
class="work-sheet-list"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<CustomFieldModal
|
|
|
|
<CustomFieldModal
|
|
|
|
ref="CustomFieldModalRef"
|
|
|
|
ref="CustomFieldModalRef"
|
|
|
|
:reviewType="reviewType"
|
|
|
|
:review-type="reviewType"
|
|
|
|
@onOk="getshowFieldList"
|
|
|
|
@on-ok="getshowFieldList"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<!-- 过滤列表 -->
|
|
|
|
<!-- 过滤列表 -->
|
|
|
|
<FilterModalVue
|
|
|
|
<FilterModalVue
|
|
|
@ -243,6 +242,7 @@ function editFilter(filter: any) {
|
|
|
|
padding: 12px 16px;
|
|
|
|
padding: 12px 16px;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
border-bottom: 1px solid #e8e8e8;
|
|
|
|
|
|
|
|
|
|
|
|
.warpper {
|
|
|
|
.warpper {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|