@@ -67,27 +128,52 @@ const inputHandler = debounce((word) => {
-
+
-
+
-
-
+
+
@@ -96,7 +182,7 @@ const inputHandler = debounce((word) => {
display: flex;
position: relative;
flex-direction: column;
- background: #FFF;
+ background: #fff;
border: 1px solid rgb(239, 239, 245);
border-radius: 3px;
box-sizing: border-box;
@@ -139,7 +225,7 @@ const inputHandler = debounce((word) => {
background-color: #e8e8e8;
}
- &-collapse{
+ &-collapse {
width: 2px;
height: 100%;
background: #507afd;
diff --git a/src/views/task/aside/ListItem.vue b/src/views/task/aside/ListItem.vue
index cf73df8..bd0d1ee 100644
--- a/src/views/task/aside/ListItem.vue
+++ b/src/views/task/aside/ListItem.vue
@@ -13,16 +13,58 @@ const props = defineProps({
type: Object as PropType
,
required: true,
},
+ showFieldList: {
+ type: Array,
+ default: () => [],
+ },
});
const svgName = computed(() => {
return props.selected ? "task-select" : "task";
});
+
+
-
diff --git a/src/views/task/aside/TaskList.vue b/src/views/task/aside/TaskList.vue
index 1acb0b3..83028dd 100644
--- a/src/views/task/aside/TaskList.vue
+++ b/src/views/task/aside/TaskList.vue
@@ -1,102 +1,115 @@
diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue
index 440d585..4779b5f 100644
--- a/src/views/task/content/Content.vue
+++ b/src/views/task/content/Content.vue
@@ -215,7 +215,6 @@ async function getTableData() {
const fieldList = (res as any)?.data
res = await getfieldList(reviewType, useInfo.id)
const userFieldList = (res as any)?.data.userFieldFixed
- console.log(userFieldList, 'userFieldList')
fieldList.map((v) => {
if (userFieldList.includes(v.name)) {
const item = {
diff --git a/src/views/task/modal/CustomFieldModal.vue b/src/views/task/modal/CustomFieldModal.vue
index 6bc5681..4a3dd11 100644
--- a/src/views/task/modal/CustomFieldModal.vue
+++ b/src/views/task/modal/CustomFieldModal.vue
@@ -20,6 +20,8 @@ const emit = defineEmits(["onOk"]);
const offList = ref([]);
// 右侧显示列表
const onList = ref([]);
+// 固定默认列表
+const fixList = ref([]);
const allCount = computed(() => {
return `全部筛选(共${offList.value.length - 1}个)`;
@@ -103,6 +105,9 @@ async function handleSumbit(e: MouseEvent) {
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let userField = "";
+ fixList.value.map((v) => {
+ userField += `${v.id},`;
+ });
onList.value.map((v) => {
userField += `${v.id},`;
});
@@ -211,11 +216,13 @@ function clearDragSource() {
}
function removeHandler(id: string) {
- const index = onList.value.findIndex((item) => {
+ let index = onList.value.findIndex((item) => {
return item.id === id;
});
-
if (index !== -1) onList.value.splice(index, 1);
+
+ index = offList.value.findIndex(v=>v.id==id);
+ offList.value[index].checked = false;
}
onMounted(async () => {
@@ -226,17 +233,15 @@ onMounted(async () => {
const allList = res.data;
res = await getfieldList(props.reviewType, userInfo.id); //当前用户选择的项目
const useList = res.data;
- console.log(allList, "getAllfieldList", props.reviewType);
- console.log(useList, "getfieldList", props.reviewType);
-
/**
* name 标题
* id 键值
* fix 是否默认
* checked 是否选中
*/
+ const userFieldFixed = useList.userFieldFixed?.split(",");
+ const userFieldUnFixed = useList.userFieldUnFixed?.split(",");
- let fixList = [];
allList.map((v) => {
let item = {
name: v.fieldDesc,
@@ -244,16 +249,16 @@ onMounted(async () => {
fix: v.isrequired == 2,
checked:
v.isrequired == 2 ||
- Boolean(useList.userFieldFixed?.indexOf(v.name) > -1) ||
- Boolean(useList.userFieldUnFixed?.indexOf(v.name) > -1),
+ Boolean(userFieldFixed.find(v2=>v2==v.name)) ||
+ Boolean(userFieldUnFixed.find(v2=>v2==v.name))
};
if (item.fix) {
- fixList.push(item);
+ fixList.value.push(item);
} else {
offList.value.push(item);
}
});
- offList.value.unshift(...fixList);
+ offList.value.unshift(...fixList.value);
useList.userFieldFixed?.split(",").map((v) => {
let item = allList.find((v2) => v2.name == v);
if (item) {
@@ -263,9 +268,14 @@ onMounted(async () => {
fix: item.isrequired == 2,
checked: true,
};
- onList.value.push(item);
+ selectIds.value.push(item.id);
+ if (!item.fix) {
+ onList.value.push(item);
+ }
}
});
+ console.log(offList.value,'offList.value');
+ console.log(useList, 'useList');
});
@@ -345,6 +355,16 @@ onMounted(async () => {
+
([]);
// 右侧显示列表
const onList = ref([]);
+const fixList = ref([]);
+
const allCount = computed(() => {
return `全部筛选(共${offList.value.length - 1}个)`;
});
@@ -233,8 +235,8 @@ onMounted(async () => {
* fix 是否默认
* checked 是否选中
*/
-
- let fixList = [];
+ const userFieldFixed = useList.userFieldFixed?.split(",");
+ const userFieldUnFixed = useList.userFieldUnFixed?.split(",");
allList.map((v) => {
let item = {
name: v.fieldDesc,
@@ -242,16 +244,16 @@ onMounted(async () => {
fix: v.isrequired == 2,
checked:
v.isrequired == 2 ||
- Boolean(useList.userFieldFixed?.indexOf(v.name) > -1) ||
- Boolean(useList.userFieldUnFixed?.indexOf(v.name) > -1),
+ Boolean(userFieldFixed.find((v2) => v2 == v.name)) ||
+ Boolean(userFieldUnFixed.find((v2) => v2 == v.name)),
};
if (item.fix) {
- fixList.push(item);
+ fixList.value.push(item);
} else {
offList.value.push(item);
}
});
- offList.value.unshift(...fixList);
+ offList.value.unshift(...fixList.value);
useList.userFieldFixed?.split(",").map((v) => {
let item = allList.find((v2) => v2.name == v);
if (item) {
@@ -264,6 +266,9 @@ onMounted(async () => {
onList.value.push(item);
}
});
+ if (!onList.value.length) {
+ onList.value.push(...fixList.value);
+ }
});