diff --git a/.vscode/settings.json b/.vscode/settings.json index 947c6ee..29677da 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -39,5 +39,10 @@ "jsonc", "yaml" ], - "vue3snippets.enable-compile-vue-file-on-did-save-code": true + "vue3snippets.enable-compile-vue-file-on-did-save-code": true, + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint", + "[vue]": { + "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" + }, + "editor.formatOnSaveMode": "modifications" } diff --git a/components.d.ts b/components.d.ts index 6458938..ddd3db7 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,49 +10,17 @@ declare module 'vue' { Application: typeof import('./src/components/Application/Application.vue')['default'] BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] - NAvatar: typeof import('naive-ui')['NAvatar'] - NBackTop: typeof import('naive-ui')['NBackTop'] NButton: typeof import('naive-ui')['NButton'] - NCard: typeof import('naive-ui')['NCard'] NCheckbox: typeof import('naive-ui')['NCheckbox'] - NCollapse: typeof import('naive-ui')['NCollapse'] - NCollapseItem: typeof import('naive-ui')['NCollapseItem'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] - NDatePicker: typeof import('naive-ui')['NDatePicker'] NDialogProvider: typeof import('naive-ui')['NDialogProvider'] - NDivider: typeof import('naive-ui')['NDivider'] - NDropdown: typeof import('naive-ui')['NDropdown'] - NEllipsis: typeof import('naive-ui')['NEllipsis'] - NEmpty: typeof import('naive-ui')['NEmpty'] NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] - NGi: typeof import('naive-ui')['NGi'] - NGrid: typeof import('naive-ui')['NGrid'] - NGridItem: typeof import('naive-ui')['NGridItem'] - NImage: typeof import('naive-ui')['NImage'] NInput: typeof import('naive-ui')['NInput'] NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NModal: typeof import('naive-ui')['NModal'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NotPassed: typeof import('./src/components/NotPassed.vue')['default'] - NPopconfirm: typeof import('naive-ui')['NPopconfirm'] - NPopover: typeof import('naive-ui')['NPopover'] - NPopselect: typeof import('naive-ui')['NPopselect'] - NProgress: typeof import('naive-ui')['NProgress'] - NScrollbar: typeof import('naive-ui')['NScrollbar'] - NSelect: typeof import('naive-ui')['NSelect'] - NSlider: typeof import('naive-ui')['NSlider'] - NSpace: typeof import('naive-ui')['NSpace'] - NSpin: typeof import('naive-ui')['NSpin'] - NSwitch: typeof import('naive-ui')['NSwitch'] - NTabPane: typeof import('naive-ui')['NTabPane'] - NTabs: typeof import('naive-ui')['NTabs'] - NTag: typeof import('naive-ui')['NTag'] - NTimeline: typeof import('naive-ui')['NTimeline'] - NTimelineItem: typeof import('naive-ui')['NTimelineItem'] - NTooltip: typeof import('naive-ui')['NTooltip'] - NUpload: typeof import('naive-ui')['NUpload'] - NUploadDragger: typeof import('naive-ui')['NUploadDragger'] Quill: typeof import('./src/components/RichEditor/Quill.vue')['default'] Robot: typeof import('./src/components/Robot/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/src/assets/images/bg-loading.png b/src/assets/images/bg-loading.png new file mode 100644 index 0000000..839713f Binary files /dev/null and b/src/assets/images/bg-loading.png differ diff --git a/src/layout/components/Header/RecycleModal.vue b/src/layout/components/Header/RecycleModal.vue index 7122402..cd0f085 100644 --- a/src/layout/components/Header/RecycleModal.vue +++ b/src/layout/components/Header/RecycleModal.vue @@ -13,12 +13,14 @@ import { viewOptions } from '@/config/home' import NotPassed from '@/components/Approval/NotPassed.vue' import { formatToDateHMS } from '@/utils/dateUtil' import { off, on } from '@/utils/domUtils' +import bgLoading from '@/assets/images/bg-loading.png' const cardStyle = { '--n-padding-bottom': '40px', '--n-padding-left': '120px', } +const bgLoadingImg = ref(bgLoading) let startTime = 0 let endTime = 0 let startCalTime = false @@ -732,6 +734,7 @@ watch(() => pagination.pageNo, (newVal, oldVal) => { ref="imageRef" :src="item.imgUrl" :preview-src="item.imgUrl" + :fallback-src="bgLoadingImg" class="img " :class="{ 'img-fit': viewMode === 'horizontalVersion', diff --git a/src/views/final/content/ListContent.vue b/src/views/final/content/ListContent.vue index 8c588aa..c22489b 100644 --- a/src/views/final/content/ListContent.vue +++ b/src/views/final/content/ListContent.vue @@ -11,88 +11,90 @@ import { useMessage, useDialog } from "naive-ui"; import { audit } from "@/api/task/task"; import NotPassed from "@/components/Approval/NotPassed.vue"; import { RepeatModal, RepeatTaskTableModal } from "../comp"; -const dialog = useDialog(); -const message = useMessage(); -const router = useRouter(); -const notPassModalRef = ref(null); // 不通过弹窗 -const sortorder = ref("asc"); -const sortname = ref("states"); -const loading = ref(true); -const total = ref(0); -const scrollContainer = ref(null); -const tableData = ref([]); -const finalStore = useFinal(); - -let num = 1; + +const emit = defineEmits(['changeShow']) +const dialog = useDialog() +const message = useMessage() +const router = useRouter() +const notPassModalRef = ref(null) // 不通过弹窗 +const sortorder = ref('asc') +const sortname = ref('states') +const loading = ref(true) +const total = ref(0) +const scrollContainer = ref(null) +const tableData = ref([]) +const finalStore = useFinal() + +let num = 1 const pagination = reactive({ page: 1, pageCount: 20, pageSize: 20, -}); -const repeatModalRef = ref(null); -const repeatTaskTableModalRef = ref(null); -const selectionIds = ref([]); +}) +const repeatModalRef = ref(null) +const repeatTaskTableModalRef = ref(null) +const selectionIds = ref([]) const showActions = computed(() => { - return selectionIds.value.length; -}); -const emit = defineEmits(["changeShow"]); + return selectionIds.value.length +}) function handleCheck(row: any, showcheck: any) { if (showcheck == false) { - console.log(tableData.value); - tableData.value.map((item) => { + console.log(tableData.value) + tableData.value.forEach((item) => { if (item.length > 0) { - item.map((itemx, index) => { - if (row.id == itemx.id) { - itemx.showcheck = true; - } - //newlistx.push(itemx) - }); + item.forEach((itemx, index) => { + if (row.id == itemx.id) + itemx.showcheck = true + + // newlistx.push(itemx) + }) } - }); - selectionIds.value.push(row); - } else { - tableData.value.map((item) => { + }) + selectionIds.value.push(row) + } + else { + tableData.value.forEach((item) => { if (item.length > 0) { - item.map((itemx, index) => { - if (row.id == itemx.id) { - itemx.showcheck = false; - } - //newlistx.push(itemx) - }); + item.forEach((itemx, index) => { + if (row.id == itemx.id) + itemx.showcheck = false + + // newlistx.push(itemx) + }) } - }); - selectionIds.value.pop(row); + }) + selectionIds.value.pop(row) } } function switchBatch() { - tableData.value.map((item) => { - item.map((itemx, index) => { - itemx.showcheck = false; - }); - }); - selectionIds.value = []; + tableData.value.forEach((item) => { + item.forEach((itemx, index) => { + itemx.showcheck = false + }) + }) + selectionIds.value = [] } function changeContent() { - emit("changeShow"); + emit('changeShow') +} +function initRem() { + const designWidth = 1440 + const rempPx = 16 + const scale = window.innerWidth / designWidth + document.documentElement.style.fontSize = `${scale * rempPx}px` } -const initRem = () => { - const designWidth = 1440; - const rempPx = 16; - const scale = window.innerWidth / designWidth; - document.documentElement.style.fontSize = scale * rempPx + "px"; -}; async function initData( page: number, pageSize: number, filterId?: any, - taskName?: string + taskName?: string, ) { - const asideParmas = unref(finalStore.getAsideValue); + const asideParmas = unref(finalStore.getAsideValue) // 有过滤配置的时候优先使用过滤配置,不要使用左侧参数 // let params = filterId ? { userSearchId: filterId } : asideParmas - let params = asideParmas; - params = params?.izshowall ? {} : params; + let params = asideParmas + params = params?.izshowall ? {} : params const result = await getFinalList({ sortorder: sortorder.value, @@ -112,28 +114,28 @@ async function initData( pagination.page = page; pagination.pageCount = Math.ceil(totalCount / pageSize); loading.value = false; - tableData.value.map((item) => { + tableData.value.forEach((item) => { item.showcheck = false; if (isValidTimestamp(item.fromuptime)) { item.fromuptime = formatToDateHMS(item.fromuptime); } }); - tableData.value = chunk(tableData.value, 4); + tableData.value = chunk(tableData.value, 4) } async function query( page: number, pageSize: number, filterId?: any, - taskName?: string + taskName?: string, ) { - console.log("query", taskName); + console.log('query', taskName) - const asideParmas = unref(finalStore.getAsideValue); + const asideParmas = unref(finalStore.getAsideValue) // 有过滤配置的时候优先使用过滤配置,不要使用左侧参数 // let params = filterId ? { userSearchId: filterId } : asideParmas - let params = asideParmas; - params = params?.izshowall ? {} : params; + let params = asideParmas + params = params?.izshowall ? {} : params const result = await getFinalList({ sortorder: sortorder.value, @@ -143,151 +145,154 @@ async function query( taskName, isFail: true, ...params, - }); - const { data, pageCount, totalCount } = result; - //console.log(data, pageCount, totalCount); - let newlist = []; - let oldlist = tableData.value; + }) + const { data, pageCount, totalCount } = result + // console.log(data, pageCount, totalCount); + const newlist = [] + const oldlist = tableData.value if (oldlist.length > 0) { - oldlist.map((item) => { + oldlist.forEach((item) => { // console.log(item); if (item.length > 0) { - item.map((itemx: any) => { - itemx.showcheck = false; - newlist.push(itemx); - }); + item.forEach((itemx: any) => { + itemx.showcheck = false + newlist.push(itemx) + }) } - }); - data.map((item) => { - item.showcheck = false; - newlist.push(item); - }); - } else { - data.map((item) => { - item.showcheck = false; - newlist.push(item); - }); + }) + data.forEach((item) => { + item.showcheck = false + newlist.push(item) + }) } - //tableData.value = tableData.value.concat(data); - tableData.value = newlist; + else { + data.forEach((item) => { + item.showcheck = false + newlist.push(item) + }) + } + // tableData.value = tableData.value.concat(data); + tableData.value = newlist // console.log(tableData.value); total.value = totalCount; pagination.page = page; pagination.pageCount = Math.ceil(totalCount / pageSize); loading.value = false; - tableData.value.map((item) => { + tableData.value.forEach((item) => { if (isValidTimestamp(item.fromuptime)) { item.fromuptime = formatToDateHMS(item.fromuptime); } }); - tableData.value = chunk(tableData.value, 4); + tableData.value = chunk(tableData.value, 4) } function isValidTimestamp(value) { - if (typeof value !== "number" || !Number.isInteger(value)) { - return false; // 首先确保值是一个整数数字 - } - const date = new Date(value); - return !isNaN(date.getTime()); // 验证能否转换为有效日期 + if (typeof value !== 'number' || !Number.isInteger(value)) + return false // 首先确保值是一个整数数字 + + const date = new Date(value) + return !Number.isNaN(date.getTime()) // 验证能否转换为有效日期 } -//查看详情页 +// 查看详情页 function goDetail(row) { router.push({ - name: "final-detail", + name: 'final-detail', query: { id: row.id, packageid: row.packageid }, - }); + }) } // 小结批量不通过 function repeatBatchReject(items) { - console.log(items); - rejectHandler(items); + console.log(items) + rejectHandler(items) } // 审核不通过 function rejectHandler(list) { - console.log(list); - const msg = validate(list); + console.log(list) + const msg = validate(list) if (msg !== null) { - message.error(msg); - return; + message.error(msg) + return } function validate(items: any[]) { - if (items.length === 0) return "至少选中一个任务"; - return null; + if (items.length === 0) + return '至少选中一个任务' + return null } - console.log(notPassModalRef); - const modal = unref(notPassModalRef)! as any; - modal.showModal(list); + console.log(notPassModalRef) + const modal = unref(notPassModalRef)! as any + modal.showModal(list) } function showModal(modalRef: any) { - const modal = unref(modalRef)! as any; - modal.showModal(); + const modal = unref(modalRef)! as any + modal.showModal() } onMounted(() => { - initRem(); - initData(1, 20); -}); + initRem() + initData(1, 20) +}) const item = { img: testImg, checked: false, - title: "YP45678", - date: "2023-12-19 12:09:18", -}; -const data = ref([]); + title: 'YP45678', + date: '2023-12-19 12:09:18', +} +const data = ref([]) function actionHandler(action: any, row: any) { - const { key } = action; + const { key } = action switch (key) { - case "view": - goDetail(row); - break; - case "reset": + case 'view': + goDetail(row) + break + case 'reset': // resetHandler() - break; - case "approval": - singleApproval(row); - break; - case "reject": - rejectHandler(row); - break; + break + case 'approval': + singleApproval(row) + break + case 'reject': + rejectHandler(row) + break default: - break; + break } } // 审核通过 function doAudit(param: any, row: any) { dialog.info({ - title: "确认提示", - content: "确认给该任务审批为【通过】吗?", - positiveText: "确定", - negativeText: "取消", + title: '确认提示', + content: '确认给该任务审批为【通过】吗?', + positiveText: '确定', + negativeText: '取消', onPositiveClick: () => { audit(param).then((res) => { - const { code } = res; - if (code === "OK") { - message.success(res.message); - //changecardstatus(3, row); - initData(1, 20); - num = 1; - reload(); - } else { - message.error(res.message); + const { code } = res + if (code === 'OK') { + message.success(res.message) + // changecardstatus(3, row); + initData(1, 20) + num = 1 + reload() + } + else { + message.error(res.message) } - }); + }) }, onNegativeClick: () => {}, - }); + }) } // 单个审批通过 function singleApproval(row) { - console.log(row); + console.log(row) const param = { result: true, - comment: "", - disposeType: "", - disposeTypeId: "", - failCauseId: "", - failCauseName: "", + comment: '', + disposeType: '', + disposeTypeId: '', + failCauseId: '', + failCauseName: '', flowTaskInfoList: [ { formId: row.id, @@ -295,102 +300,104 @@ function singleApproval(row) { taskName: row.fromTaskName, }, ], - }; - doAudit(param, row); + } + doAudit(param, row) } // 批量通过 function batchApproval() { - const items: any = selectionIds.value; - const msg = validate(items); + const items: any = selectionIds.value + const msg = validate(items) function validate(items: any[]) { - if (items.length === 0) return "至少选中一个任务"; - return null; + if (items.length === 0) + return '至少选中一个任务' + return null } if (msg !== null) { - message.error(msg); - return; + message.error(msg) + return } - console.log(items); - const list: any = []; + console.log(items) + const list: any = [] items.forEach((item) => { list.push({ formId: item.id, taskId: item.taskId, taskName: item.fromtaskname, - }); - }); + }) + }) const param = { result: true, - comment: "", - disposeType: "", - disposeTypeId: "", - failCauseId: "", - failCauseName: "", + comment: '', + disposeType: '', + disposeTypeId: '', + failCauseId: '', + failCauseName: '', flowTaskInfoList: list, - }; + } - doAudit(param, {}); - selectionIds.value = []; - num = 1; + doAudit(param, {}) + selectionIds.value = [] + num = 1 } // 批量不通过 function batchReject() { - const items: any = selectionIds.value; - rejectHandler(items); - selectionIds.value = []; - num = 1; + const items: any = selectionIds.value + rejectHandler(items) + selectionIds.value = [] + num = 1 } -//修改卡片状态渲染效果 +// 修改卡片状态渲染效果 function changecardstatus(states, item) { - //let index = tableData.value.findIndex(itemx => itemx.id === item.id); - let newlist = []; - tableData.value.map((itemarr, indexarr) => { - itemarr.map((itemobj, indexobj) => { - if (item.id == itemobj.id) { - itemobj.states = states; - } - newlist.push(itemobj); - }); - }); - tableData.value = chunk(newlist, 4); + // let index = tableData.value.findIndex(itemx => itemx.id === item.id); + const newlist = [] + tableData.value.forEach((itemarr, indexarr) => { + itemarr.forEach((itemobj, indexobj) => { + if (item.id == itemobj.id) + itemobj.states = states + + newlist.push(itemobj) + }) + }) + tableData.value = chunk(newlist, 4) } function reload() { - //query(1, 20) - //num=1 - //selectionIds.value = [] - //checkedRowKeys.value = [] + // query(1, 20) + // num=1 + // selectionIds.value = [] + // checkedRowKeys.value = [] // const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps // query(page!, pageSize!) } -let debounceTimer; +let debounceTimer // 检查是否滚动到底部 function checkBottom() { - const container = scrollContainer.value; + const container = scrollContainer.value // console.log(1) - if (!container) return; + if (!container) + return // const { scrollTop, clientHeight, scrollHeight } = container; - const scrollTop = window.pageYOffset || document.documentElement.scrollTop; + const scrollTop = window.pageYOffset || document.documentElement.scrollTop // 获取视口的内部高度 - const clientHeight = - window.innerHeight || document.documentElement.clientHeight; + const clientHeight + = window.innerHeight || document.documentElement.clientHeight // 获取整个文档的高度 - const scrollHeight = document.documentElement.scrollHeight; + const scrollHeight = document.documentElement.scrollHeight - clearTimeout(debounceTimer); + clearTimeout(debounceTimer) debounceTimer = setTimeout(() => { if (scrollTop + clientHeight >= scrollHeight - 10) { - num = num + 1; - console.log(num); - query(num, 20); + num = num + 1 + console.log(num) + query(num, 20) // fetchData(); // 接近底部时加载更多数据 } - }, 500); + }, 500) } function changesort(sortnamex) { if (sortorder.value == "asc" && sortnamex == "submit_date_timestamp") { @@ -470,18 +477,17 @@ defineExpose({ src="@/assets/images/task/btn-not-pass.png" alt="" @click.stop="batchReject" - /> + > + >
  • - 批量导入数据 + 批量导入数据
  • 导出待审数据 + >导出待审数据
  • 导出全部数据 + >导出全部数据
  • - 查看导入记录 + 查看导入记录
@@ -522,7 +522,7 @@ defineExpose({
- +
@@ -551,49 +551,49 @@ defineExpose({
-
+ @click="goDetail(item)" + /> +
@@ -609,17 +609,17 @@ defineExpose({
{{ @@ -627,10 +627,10 @@ defineExpose({ ? item.states == 3 ? "通过" : item.states == 2 - ? "待审核" - : item.states == 5 - ? "未通过" - : "" + ? "待审核" + : item.states == 5 + ? "未通过" + : "" : item.fromusername }}
@@ -638,24 +638,24 @@ defineExpose({
- +
查看
通过
不通过 diff --git a/src/views/home/content/Content.vue b/src/views/home/content/Content.vue index 387d47d..7ec3a35 100644 --- a/src/views/home/content/Content.vue +++ b/src/views/home/content/Content.vue @@ -1,31 +1,14 @@ @@ -915,6 +930,14 @@ defineExpose({ position: relative; transition: 0.5s; + .tag-status { + width: 46px; + height: 22px; + position: absolute; + left: -1px; + top: 10px; + } + .glass { position: absolute; display: none !important; diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index 673556d..f507af0 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -33,6 +33,7 @@ import { useUser } from '@/store/modules/user' import { isEmpty } from '@/utils' import { formatToDateHMS } from '@/utils/dateUtil' import { hideDownload } from '@/utils/image' +import bgLoading from '@/assets/images/bg-loading.png' const emit = defineEmits(['setAsideItemName']) @@ -59,6 +60,8 @@ const sortBy: any = { orderName: 'similarityScore', } const el = ref(null) +const bgLoadingImg = ref(bgLoading) + const pagination = reactive({ pageNo: 0, pageSize: 30, @@ -411,7 +414,7 @@ async function getTableData() { '拜访项目类别', ] - fieldList.map((v) => { + fieldList.forEach((v) => { if (userFieldList.includes(v.name)) { let locationobj = { address: '' } if (v.name == 'location') { @@ -803,20 +806,23 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') { isFullScreen ? imgbigshow ? { - 'position': 'relative', + position: 'relative', //width: '70vw', - 'flex': 1, + flex: 1, // flex: 0.75, - 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, + // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, + background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`, } : { - 'height': '92vh', - 'flex': 1, + height: '92vh', + flex: 1, - 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, + // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, + background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`, } : { - 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, + // 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`, + background: `url(${taskDetailInfo?.ocrPicture?.imgurl}), url(${bgLoadingImg})`, } " @mouseover="overTaskHandle" @@ -993,7 +999,8 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
@@ -1218,7 +1225,8 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
{ show.value && addListeners() - window.addEventListener("keydown", handleKeydown); + window.addEventListener('keydown', handleKeydown) }) - // 键盘左右箭头快捷切换 function handleKeydown(event) { - // 在这里执行右箭头的逻辑 - if (event.keyCode === 67) { -show.value=false - // batchModalRef.value.closeModal() - } + if (event.keyCode === 67) + show.value = false + // batchModalRef.value.closeModal() } function showModal(value) { taskId.value = value @@ -408,7 +405,8 @@ const gridHeight = computed(() => { defineExpose({ showModal, - reload,closeModal + reload, + closeModal, }) @@ -544,40 +542,39 @@ defineExpose({ :style="{ height: gridHeight }" class="grid-item" > - -
-
-
- - {{ formatToDateHMS(Number(item.photoDateTimestamp) || 0) }} -
-
- - {{ formatToDateHMS(Number(item.submitDateTimestamp) || 0) }} -
+ :src="item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl" + /> +
+
+
+ + {{ formatToDateHMS(Number(item.photoDateTimestamp) || 0) }}
- - -
- +
+ + {{ formatToDateHMS(Number(item.submitDateTimestamp) || 0) }}
-
- {{ item.similarityScore }}% -
+
+ + +
+ +
+
+ {{ item.similarityScore }}% +
diff --git a/src/views/worksheet/components/pictureCard.vue b/src/views/worksheet/components/pictureCard.vue index 310c6b2..f3b37a2 100644 --- a/src/views/worksheet/components/pictureCard.vue +++ b/src/views/worksheet/components/pictureCard.vue @@ -1,5 +1,6 @@