@@ -300,15 +346,24 @@ function removeHandler(id: string, type: 'fix' | 'unfix') {
-
+
@@ -319,7 +374,10 @@ function removeHandler(id: string, type: 'fix' | 'unfix') {
@@ -333,28 +391,56 @@ function removeHandler(id: string, type: 'fix' | 'unfix') {
固定在左侧
-
+
- {{ item.title }}
+ {{ item.name }}
不固定
-
+
- {{ item.title }}
+ {{ item.name }}
@@ -367,10 +453,8 @@ function removeHandler(id: string, type: 'fix' | 'unfix') {
@@ -406,7 +490,7 @@ function removeHandler(id: string, type: 'fix' | 'unfix') {
&:before {
background-color: #1980ff;
- content: '';
+ content: "";
width: 5px;
border-radius: 2px;
top: 0;
@@ -467,7 +551,9 @@ function removeHandler(id: string, type: 'fix' | 'unfix') {
}
}
-::v-deep(.n-card.n-card--content-segmented > .n-card__content:not(:first-child)) {
+::v-deep(
+ .n-card.n-card--content-segmented > .n-card__content:not(:first-child)
+ ) {
border: 0px;
}
diff --git a/src/views/final/content/Content.vue b/src/views/final/content/Content.vue
index 15b6fdc..429f307 100644
--- a/src/views/final/content/Content.vue
+++ b/src/views/final/content/Content.vue
@@ -1,312 +1,510 @@
@@ -455,25 +656,35 @@ async function refreshHandler(searchId?: any) {
小结查重
-
+
批量审批
-
+
@@ -493,20 +704,41 @@ async function refreshHandler(searchId?: any) {
-->
-
+
-
+
-
+
@@ -520,7 +752,7 @@ async function refreshHandler(searchId?: any) {
box-sizing: border-box;
margin-left: 16px;
width: 100%;
- background: #FFF;
+ background: #fff;
padding: 0px 24px 24px 24px;
&-header {
@@ -536,9 +768,9 @@ async function refreshHandler(searchId?: any) {
align-items: center;
}
- .xjcc{
+ .xjcc {
font-weight: bold;
- color: #6a80fc;
+ color: #6a80fc;
margin-right: 20px;
}
@@ -554,11 +786,11 @@ async function refreshHandler(searchId?: any) {
height: 36px;
background: linear-gradient(135deg, #5b85f8, #3c6cf0);
border-radius: 17px;
- box-shadow: 0px 2px 6px 0px rgba(116, 153, 253, 0.30);
+ box-shadow: 0px 2px 6px 0px rgba(116, 153, 253, 0.3);
display: flex;
align-items: center;
justify-content: center;
- color: #FFF;
+ color: #fff;
margin-right: 6px;
cursor: pointer;
}
@@ -654,7 +886,7 @@ async function refreshHandler(searchId?: any) {
&-content {
flex: auto;
- background: #FFF;
+ background: #fff;
}
}
diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue
index e8eb250..a6acb86 100644
--- a/src/views/home/content/Content.vue
+++ b/src/views/home/content/Content.vue
@@ -242,7 +242,7 @@ async function refreshHandler(filtersearchId?: any) {
},
{ distance: 10, canLoadMore: () => canloadMore },
)
- }, 500)
+ }, 300)
})
}
diff --git a/src/views/task/aside/Aside.vue b/src/views/task/aside/Aside.vue
index 3065f7b..1753057 100644
--- a/src/views/task/aside/Aside.vue
+++ b/src/views/task/aside/Aside.vue
@@ -1,63 +1,124 @@
-
+
@@ -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..621a00f 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..d8300e8 100644
--- a/src/views/task/content/Content.vue
+++ b/src/views/task/content/Content.vue
@@ -29,7 +29,7 @@ const CustomSettingModalRef = ref(null)
const taskTableData = ref([])
const sortBy: PictureSortParam = {
- orderbyname: 'desc',
+ orderbyname: 'asc',
orderbyvalue: 'pictureResult',
}
@@ -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 = {
@@ -268,6 +267,10 @@ watch(
taskDetailPictureList.value = data
totalCount.value = total
}
+ else {
+ taskDetailPictureList.value.length = 0
+ totalCount.value = 0
+ }
},
)
@@ -314,8 +317,9 @@ function previewHandler(event: MouseEvent) {
function getPercent(pictureid: string) {
const { ocpictureid, pictureresult } = taskDetailInfo.value
- const index = ocpictureid.split(',').indexOf(String(pictureid))
- const results = pictureresult.split(',')
+ const splitId = ocpictureid || ''
+ const index = splitId.split(',').indexOf(String(pictureid))
+ const results = (pictureresult || '').split(',')
const percent = results[index] || '0'
const val = Number.parseFloat(percent)
return `${val}%`
@@ -412,8 +416,8 @@ function getPercent(pictureid: string) {
/>
-
-
+
+
([]);
// 右侧显示列表
const onList = ref([]);
+// 固定默认列表
+const fixList = ref([]);
const allCount = computed(() => {
return `全部筛选(共${offList.value.length - 1}个)`;
@@ -102,12 +104,15 @@ function closeModal() {
async function handleSumbit(e: MouseEvent) {
const userStore = useUser();
const userInfo = userStore.getUserInfo;
- let userField = "";
+ let userFieldFixed = "";
+ fixList.value.map((v) => {
+ userFieldFixed += `${v.id},`;
+ });
onList.value.map((v) => {
- userField += `${v.id},`;
+ userFieldFixed += `${v.id},`;
});
- userField = userField.slice(0, userField.length - 1);
- savefield(props.reviewType, userInfo.id, userField);
+ userFieldFixed = userFieldFixed.slice(0, userFieldFixed.length - 1);
+ savefield(props.reviewType, userInfo.id, userFieldFixed);
e.preventDefault();
closeModal();
emit("onOk");
@@ -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 () => {
+
3,
require: true,
},
-})
+});
onMounted(async () => {
const userStore = useUser();
const userInfo = userStore.getUserInfo;
@@ -25,7 +25,8 @@ onMounted(async () => {
* fix 是否默认
* checked 是否选中
*/
-
+ const userFieldFixed = useList.userFieldFixed?.split(",");
+ const userFieldUnFixed = useList.userFieldUnFixed?.split(",");
allList.map((v) => {
let item = {
name: v.fieldDesc,
@@ -33,10 +34,10 @@ 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))
};
- offList.value.push(item)
+ offList.value.push(item);
});
});
@@ -64,7 +65,7 @@ function generatList() {
hideList.unshift(...fixedList);
offList.value = hideList;
- return { hideList };
+ return { hideList };
}
function generateDefaultList() {
@@ -95,23 +96,22 @@ function showModal() {
function closeModal() {
show.value = false;
}
-const emit = defineEmits(['onOk'])
+const emit = defineEmits(["onOk"]);
async function handleSumbit(e: MouseEvent) {
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let userField = "";
offList.value.map((v) => {
- if(v.checked){
+ if (v.checked) {
userField += `${v.id},`;
}
});
- userField = userField.slice(0,userField.length-1);
+ userField = userField.slice(0, userField.length - 1);
savefield(props.reviewType, userInfo.id, userField);
e.preventDefault();
closeModal();
- emit('onOk')
-
+ emit("onOk");
}
defineExpose({
@@ -143,11 +143,6 @@ function onCheckChange(checked: any, item: any) {
if (index === -1 && checked) selectIds.value.push(item.id);
else selectIds.value.splice(index, 1);
}
-
-
-
-
-
@@ -172,7 +167,7 @@ function onCheckChange(checked: any, item: any) {
>
-
+
-import { debounce } from 'lodash-es'
-import { computed, defineOptions, nextTick, onMounted, ref, unref, watch } from 'vue'
-import CustomFieldModalVue from '../modal/CustomFieldModal.vue'
-import WorkSheetList from './WorkSheetList.vue'
-import { getViewportOffset } from '@/utils/domUtils'
-import { useWorkOrder } from '@/store/modules/workOrder'
-import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
+import { debounce } from "lodash-es";
+import {
+ computed,
+ defineOptions,
+ nextTick,
+ onMounted,
+ ref,
+ unref,
+ watch,
+} from "vue";
+import CustomFieldModalVue from "../modal/CustomFieldModal.vue";
+import WorkSheetList from "./WorkSheetList.vue";
+import { getViewportOffset } from "@/utils/domUtils";
+import { useWorkOrder } from "@/store/modules/workOrder";
+import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn";
+import { useUser } from "@/store/modules/user";
+import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter";
+defineOptions({ name: "AsideContent" });
-defineOptions({ name: 'AsideContent' })
-
-const collapse = ref(false)
-const workStore = useWorkOrder()
-const filterModalRef = ref(null)
-const packageListRef = ref(null)
+const collapse = ref(false);
+const workStore = useWorkOrder();
+const filterModalRef = ref(null);
+const packageListRef = ref(null);
+// 展示字段
+const showFieldList = ref([]);
+const reviewType = 1;
function collapseHandler() {
- collapse.value = !collapse.value
+ collapse.value = !collapse.value;
}
const asideWidth = computed(() => {
- return collapse.value ? 0 : 308
-})
+ return collapse.value ? 0 : 308;
+});
const asideStyle = computed(() => {
return {
width: `${asideWidth.value}px`,
- }
-})
+ };
+});
const collapseIcon = computed(() => {
- return collapse.value ? 'expand-cir' : 'collapse-cir'
-})
+ return collapse.value ? "expand-cir" : "collapse-cir";
+});
-const listHeight = ref(700)
+const listHeight = ref(700);
function computeListHeight() {
- const listEl = document.querySelector('.work-sheet-list')!
- const { bottomIncludeBody } = getViewportOffset(listEl)
- const height = bottomIncludeBody
- listHeight.value = height - 25
+ const listEl = document.querySelector(".work-sheet-list")!;
+ const { bottomIncludeBody } = getViewportOffset(listEl);
+ const height = bottomIncludeBody;
+ listHeight.value = height - 25;
}
const listStyle = computed(() => {
return {
height: `${listHeight.value}px`,
- }
-})
+ };
+});
-useWindowSizeFn(computeListHeight, 280)
+useWindowSizeFn(computeListHeight, 280);
+
+async function getshowFieldList() {
+ showFieldList.value = [];
+ const userStore = useUser();
+ const userInfo = userStore.getUserInfo;
+ let res;
+ res = await getAllfieldList(reviewType); //所有筛选项目
+ const allList = res.data;
+ res = await getfieldList(reviewType, userInfo.id); //当前用户选择的项目
+ const useList = res.data;
+ /**
+ * name 标题
+ * id 键值
+ * fix 是否默认
+ * checked 是否选中
+ */
+ if (useList.userFieldFixed) {
+ 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,
+ };
+ showFieldList.value.push(item);
+ }
+ });
+ } else {
+ // 若为首次获取 则赋默认值
+ allList.map((v) => {
+ if (v.isrequired == 2) {
+ let item = {
+ name: v.fieldDesc,
+ id: v.name,
+ fix: v.isrequired == 2,
+ checked: true,
+ };
+ showFieldList.value.push(item);
+ }
+ });
+ }
+}
onMounted(() => {
nextTick(() => {
- computeListHeight()
- })
-})
-
-const asideEnter = ref(false)
+ computeListHeight();
+ getshowFieldList();
+ });
+});
+const asideEnter = ref(false);
const showCollapse = computed(() => {
- return collapse.value ? true : asideEnter.value
-})
+ return collapse.value ? true : asideEnter.value;
+});
function showFilter() {
- const modal = unref(filterModalRef)! as any
- modal.showModal()
+ const modal = unref(filterModalRef)! as any;
+ modal.showModal();
}
-watch(() => workStore.immersion, () => {
- collapse.value = true
-})
+watch(
+ () => workStore.immersion,
+ () => {
+ collapse.value = true;
+ }
+);
-const showSearch = ref(false)
+const showSearch = ref(false);
function setShowSearch(value: boolean) {
- showSearch.value = value
+ showSearch.value = value;
- if (value === false)
- (packageListRef.value as any).search('')
+ if (value === false) (packageListRef.value as any).search("");
}
const inputHandler = debounce((word) => {
- (packageListRef.value as any).search(word)
-}, 500)
+ (packageListRef.value as any).search(word);
+}, 500);
-
+
@@ -95,27 +158,51 @@ const inputHandler = debounce((word) => {
-
+
-
+
-
-
+
+
@@ -124,7 +211,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;
diff --git a/src/views/worksheet/aside/ListItem.vue b/src/views/worksheet/aside/ListItem.vue
index 78c4ee6..2cc5351 100644
--- a/src/views/worksheet/aside/ListItem.vue
+++ b/src/views/worksheet/aside/ListItem.vue
@@ -1,8 +1,8 @@
-
@@ -58,7 +83,7 @@ const svgName = computed(() => {
}
&-selected {
- color: #507AFD;
+ color: #507afd;
}
}
@@ -84,7 +109,6 @@ const svgName = computed(() => {
position: absolute;
bottom: 0px;
}
-
}
../types
diff --git a/src/views/worksheet/aside/WorkSheetList.vue b/src/views/worksheet/aside/WorkSheetList.vue
index 9717eb0..a755ad0 100644
--- a/src/views/worksheet/aside/WorkSheetList.vue
+++ b/src/views/worksheet/aside/WorkSheetList.vue
@@ -1,99 +1,113 @@
diff --git a/src/views/worksheet/content/Content.vue b/src/views/worksheet/content/Content.vue
index e88f089..caa4195 100644
--- a/src/views/worksheet/content/Content.vue
+++ b/src/views/worksheet/content/Content.vue
@@ -51,7 +51,7 @@ const taskpagination = reactive({
pageSize: 10,
})
const sortBy: PictureSortParam = {
- orderbyname: 'desc',
+ orderbyname: 'asc',
orderbyvalue: 'pictureResult',
}
const workStore = useWorkOrder()
@@ -264,8 +264,11 @@ onUpdated(() => {
watch(() => workStore.activeId, async (newValue, oldValue) => {
const packageid = workStore.getActiveId
- if (isEmpty(packageid))
+ if (isEmpty(packageid)) {
+ listData.value.length = 0
+ totalCount.value = 0
return
+ }
const res = await getPackageTaskList(newValue, packagepagination)
const { data } = res
@@ -286,8 +289,11 @@ async function handleSelect(item: any) {
const packageid = workStore.getActiveId
- if (isEmpty(packageid))
+ if (isEmpty(packageid)) {
+ listData.value.length = 0
+ totalCount.value = 0
return
+ }
refreshHandler()
}
diff --git a/src/views/worksheet/modal/CustomFieldModal copy.vue b/src/views/worksheet/modal/CustomFieldModal copy.vue
new file mode 100644
index 0000000..4a5ba29
--- /dev/null
+++ b/src/views/worksheet/modal/CustomFieldModal copy.vue
@@ -0,0 +1,486 @@
+// 原页面备份 逻辑无问题后可删除
+
+
+
+
+
+
+
+
+
自定义任务包字段
+
+
+
+
+
+
+
+
+
+
+ 清空
+
+
+
+
+
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/worksheet/modal/CustomFieldModal.vue b/src/views/worksheet/modal/CustomFieldModal.vue
index 9c0dcee..bd8ad51 100644
--- a/src/views/worksheet/modal/CustomFieldModal.vue
+++ b/src/views/worksheet/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,15 +233,15 @@ onMounted(async () => {
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(",");
- let fixList = [];
allList.map((v) => {
let item = {
name: v.fieldDesc,
@@ -242,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) {
@@ -261,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');
});
@@ -343,6 +355,16 @@ onMounted(async () => {
+