# Conflicts:
#	src/views/task/aside/ListItem.vue
pull/1/head
Dragon 1 year ago
commit f9dd003074

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="64px" height="64px" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>排序</title>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="PrevailCloud-Design-图标集" transform="translate(-664.000000, -7071.000000)" fill-rule="nonzero">
<g id="排序" transform="translate(664.000000, 7071.000000)">
<rect id="矩形" fill="#000000" opacity="0" x="0" y="0" width="64" height="64"></rect>
<path d="M26.7875,57.7625 L6,38.71875 L10.2375,34.09375 L20.5125,43.5 L20.5125,6.89375 L26.7875,6.89375 L26.7875,57.7625 Z M43.4875,57.10625 L37.2125,57.10625 L37.2125,6.2375 L58,25.28125 L53.7625,29.90625 L43.4875,20.5 L43.4875,57.10625 Z" id="形状" fill="#507AFD"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 927 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.2 KiB

@ -118,7 +118,7 @@ const options = computed(() => {
</div> </div>
<div class="trigger"> <div class="trigger">
<span>{{ currentCompanyName }}</span> <span>{{ currentCompanyName }}</span>
<span @click="changeFlag = !changeFlag" style="cursor: pointer">icon</span> <span @click="changeFlag = !changeFlag" style="cursor: pointer"><SvgIcon name="switchCompany" size="24" /></span>
</div> </div>
<div class="item"> <div class="item">
<span>AI设置开关</span> <span>AI设置开关</span>

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, nextTick, onBeforeMount, onMounted, reactive, ref, shallowRef, unref, watch } from 'vue' import { computed, inject, nextTick, onBeforeMount, onMounted, reactive, ref, shallowRef, unref, watch } from 'vue'
import { CustomFilterModalVue, FilterModal, NewFilterModal } from '@/views/final/comp' import { CustomFilterModalVue, FilterModal, NewFilterModal } from '@/views/final/comp'
import Search from '@/views/home/aside/comp/Search.vue' import Search from '@/views/home/aside/comp/Search.vue'
import AdvanceFilter from '@/views/home/aside/comp/AdvanceFilter.vue' import AdvanceFilter from '@/views/home/aside/comp/AdvanceFilter.vue'
@ -35,6 +35,8 @@ function showModal(modalRef: any) {
const modal = unref(modalRef)! as any const modal = unref(modalRef)! as any
modal.showModal() modal.showModal()
} }
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {

@ -137,13 +137,16 @@ function onCheckAllChange(value) {
} }
selectIds.value = value ? ids : []; selectIds.value = value ? ids : [];
} }
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
const index = selectIds.value.indexOf(item.id); const index = selectIds.value.indexOf(item.id);
item.checked = checked; item.checked = checked;
let currentIndex = offList.value.findIndex(v=>v.id == item.id)
offList.value[currentIndex].checked = item.checked;
if (index === -1 && checked) selectIds.value.push(item.id); if (index === -1 && checked) selectIds.value.push(item.id);
else selectIds.value.splice(index, 1); else selectIds.value.splice(index, 1);
} }

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, nextTick, onBeforeMount, onMounted, reactive, ref, shallowRef, unref, watch } from 'vue' import { computed, inject, nextTick, onBeforeMount, onMounted, reactive, ref, shallowRef, unref, watch } from 'vue'
import { CustomFilterModalVue, FilterModalVue, NewFilterModalVue } from './comp/modals' import { CustomFilterModalVue, FilterModalVue, NewFilterModalVue } from './comp/modals'
import Search from './comp/Search.vue' import Search from './comp/Search.vue'
import AdvanceFilter from './comp/AdvanceFilter.vue' import AdvanceFilter from './comp/AdvanceFilter.vue'
@ -43,6 +43,8 @@ onMounted(() => {
}) })
const collapse = ref(false) const collapse = ref(false)
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
function collapseHandler() { function collapseHandler() {
collapse.value = !collapse.value collapse.value = !collapse.value

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import { computed, onMounted, ref, shallowRef, unref, watch } from 'vue' import { computed, inject, onMounted, ref, shallowRef, unref, watch } from 'vue'
import CustomFieldModal from '../modal/CustomFieldModal.vue' import CustomFieldModal from '../modal/CustomFieldModal.vue'
import AdvanceFilter from '../../home/aside/comp/AdvanceFilter.vue' import AdvanceFilter from '../../home/aside/comp/AdvanceFilter.vue'
import { import {
@ -27,7 +27,8 @@ const showFieldList = ref<any[]>([])
function collapseHandler() { function collapseHandler() {
collapse.value = !collapse.value collapse.value = !collapse.value
} }
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
const asideWidth = computed(() => { const asideWidth = computed(() => {
return collapse.value ? 0 : 308 return collapse.value ? 0 : 308
}) })

@ -18,7 +18,6 @@ const props = defineProps({
default: () => [], default: () => [],
}, },
}) })
const svgName = computed(() => { const svgName = computed(() => {
return props.selected ? 'task-select' : 'task' return props.selected ? 'task-select' : 'task'
}) })

@ -94,7 +94,15 @@ function generateDefaultList() {
} }
const show = ref(false); const show = ref(false);
const checkAll = ref(false); const checkAll = computed(()=>{
let baseNum = 0;
offList.value.map((v) => {
if (v.fix) {
baseNum += 1;
}
});
return onList.value.length == offList.value.length-baseNum
});
function showModal() { function showModal() {
show.value = true; show.value = true;
@ -140,7 +148,6 @@ function onCheckAllChange(value) {
for (const item of offShowList.value) { for (const item of offShowList.value) {
if (!item.fix) { if (!item.fix) {
item.checked = value; item.checked = value;
ids.push(item.id);
} }
} }
selectIds.value = value ? ids : []; selectIds.value = value ? ids : [];
@ -150,7 +157,7 @@ function onCheckAllChange(value) {
onList.value.push(v); onList.value.push(v);
} }
}); });
onShowList.value = cloneDeep(onList.value) onShowList.value = cloneDeep(onList.value);
} else { } else {
onList.value = []; onList.value = [];
onShowList.value = []; onShowList.value = [];
@ -159,12 +166,14 @@ function onCheckAllChange(value) {
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
const index = selectIds.value.indexOf(item.id); const index = selectIds.value.indexOf(item.id);
item.checked = checked; item.checked = checked;
let currentIndex = offList.value.findIndex(v=>v.id == item.id) let currentIndex = offList.value.findIndex((v) => v.id == item.id);
offList.value[currentIndex].checked = item.checked; offList.value[currentIndex].checked = checked;
if (index === -1 && checked) selectIds.value.push(item.id); if (index === -1 && checked) {
else selectIds.value.splice(index, 1); selectIds.value.push(item.id);
} else {
selectIds.value.splice(index, 1);
}
} }
const showIds = computed(() => { const showIds = computed(() => {
@ -207,6 +216,7 @@ watch(
index--; index--;
} }
} }
console.log(onShowList.value, list, "onShowList");
} }
} }
); );
@ -245,7 +255,7 @@ function removeHandler(id: string) {
index = offList.value.findIndex((v) => v.id == id); index = offList.value.findIndex((v) => v.id == id);
offList.value[index].checked = false; offList.value[index].checked = false;
offShowList.value = cloneDeep(offList.value) offShowList.value = cloneDeep(offList.value);
} }
const getData = async (type = "") => { const getData = async (type = "") => {
const userStore = useUser(); const userStore = useUser();
@ -314,7 +324,7 @@ const indeterminate = computed(() => {
baseNum += 1; baseNum += 1;
} }
}); });
return onList.value.length > 0 && offList.value.length - baseNum > onList.value.length; return onShowList.value.length > 0 && offShowList.value.length - baseNum > onShowList.value.length;
}); });
const queryData = (value, type) => { const queryData = (value, type) => {
if (value) { if (value) {
@ -326,11 +336,11 @@ const queryData = (value, type) => {
} }
} else { } else {
// getData(type); // getData(type);
if(type == "off") { if (type == "off") {
offShowList.value = cloneDeep(offList.value); offShowList.value = cloneDeep(offList.value);
}else{ } else {
onShowList.value = cloneDeep(onList.value); onShowList.value = cloneDeep(onList.value);
fixShowList.value = cloneDeep(fixList.value) fixShowList.value = cloneDeep(fixList.value);
} }
} }
}; };

@ -8,6 +8,7 @@ import { debounce } from "lodash-es";
import { import {
computed, computed,
defineOptions, defineOptions,
inject,
nextTick, nextTick,
onMounted, onMounted,
ref, ref,
@ -29,7 +30,8 @@ const dicts = ref<any>([]);
function collapseHandler() { function collapseHandler() {
collapse.value = !collapse.value; collapse.value = !collapse.value;
} }
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
const asideWidth = computed(() => { const asideWidth = computed(() => {
return collapse.value ? 0 : 308; return collapse.value ? 0 : 308;
}); });

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { format } from 'date-fns';
import { computed, onMounted } from "vue"; import { computed, onMounted } from "vue";
import type { PackageListItem } from "/#/workorder"; import type { PackageListItem } from "/#/workorder";
defineOptions({ name: "ListItem" }); defineOptions({ name: "ListItem" });
const props = defineProps({ const props = defineProps({
@ -14,7 +14,7 @@ const props = defineProps({
required: true, required: true,
}, },
showFieldList: { showFieldList: {
type: Array, type: Array as any,
default: () => [], default: () => [],
}, },
dicts: { dicts: {
@ -40,29 +40,33 @@ onMounted(async () => {
<template> <template>
<div class="list-item" :class="{ 'list-item-selected': selected }"> <div class="list-item" :class="{ 'list-item-selected': selected }">
<div> <div v-for="(item, index) in showFieldList" :key="index">
<div class="list-item-header"> <div v-if="item.id === 'name'" class="list-item-header">
<div style="display: flex"> <div class="id-wrap">
<SvgIcon :name="svgName" size="28" /> <SvgIcon :name="svgName" size="28" />
<span class="list-item-header-name" :class="{ 'list-item-header-selected': selected }"> <span class="list-item-header-name" :class="{ 'list-item-header-selected': selected }">
{{ listItem.name }} {{ listItem.name }}
</span> </span>
<span class="list-item-header-selected">({{ listItem.pictureCount }})</span>
</div> </div>
<!-- <SvgIcon v-show="selected" size="14" name="more-ver" /> -->
</div> </div>
<ul class="list-item-detail"> <ul v-else class="list-item-detail">
<li v-for="(key, index) in Object.keys(listItem.search)" :key="index" v-if="listItem.search"> <li v-if="item.id === 'statshisText'">
<div v-if="getValueByLabel(key)"> 审批状态<span class="list-item-status" :class="listItem.statshisText === ''
{{ ? 'list-item-success'
getValueByLabel(key) : listItem.statshisText === '不通过'
}}{{ ? 'list-item-error'
listItem.search[key] : 'list-item-watting'
}} ">{{ listItem.statshisText }}</span>
</div> </li>
<li v-else-if="item.id === 'createdate'">
提交时间{{ format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") }}
</li>
<li v-else-if="item.id === 'createTime'">
生成时间{{ format(listItem.createTime, "yyyy-MM-dd HH:mm:ss") }}
</li>
<li v-else class="ellipsis">
<span class="label">{{ item.name }}</span>{{ listItem[item.id] }}
</li> </li>
<!-- <li>筛选时间{{ listItem.createTime }}</li>
<li>执行人{{ listItem.createBy }}</li> -->
</ul> </ul>
</div> </div>
<!-- <div class="list-item-header"> <!-- <div class="list-item-header">
@ -92,6 +96,24 @@ onMounted(async () => {
display: flex; display: flex;
align-items: center; align-items: center;
.id-wrap {
display: flex;
align-items: center;
margin-bottom: 6px
}
.list-item-header-name {
width: 226px;
font-size: 16px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 700;
color: #333333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-bottom: 0 0 8px 8px;
}
&-name { &-name {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;

@ -64,7 +64,7 @@ async function loadMore() {
const more = await fetchList() const more = await fetchList()
more.forEach(ele=>{ more.forEach(ele=>{
ele.search = JSON.parse(ele.search) ele.search = JSON.parse(ele.search)
ele.search.createTime = ele.search.submit_date_timestamp // ele.search.createTime = ele.search.submit_date_timestamp
}) })
data.value.push(...more) data.value.push(...more)
} }

@ -1,4 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { audit } from '@/api/task/task';
import { import {
clearTF, getTaskDetailInfo, clearTF, getTaskDetailInfo,
getTaskDetailPictureList, getTaskDetailPictureList,
@ -10,6 +11,7 @@ import { useWorkOrder } from "@/store/modules/workOrder";
import { isEmpty } from "@/utils"; import { isEmpty } from "@/utils";
import { formatToDateHMS } from "@/utils/dateUtil"; import { formatToDateHMS } from "@/utils/dateUtil";
import { hideDownload } from "@/utils/image"; import { hideDownload } from "@/utils/image";
import emitter from '@/utils/mitt';
import { useInfiniteScroll } from "@vueuse/core"; import { useInfiniteScroll } from "@vueuse/core";
import { format } from 'date-fns'; import { format } from 'date-fns';
import imagesloaded from "imagesloaded"; import imagesloaded from "imagesloaded";
@ -17,7 +19,7 @@ import { clone, debounce, pickBy } from "lodash-es";
import { useDialog, useMessage } from "naive-ui"; import { useDialog, useMessage } from "naive-ui";
import { computed, onUnmounted, onUpdated, reactive, ref, unref, watch } from "vue"; import { computed, onUnmounted, onUpdated, reactive, ref, unref, watch } from "vue";
import ConfrimModal from "../modal/ConfrimModal.vue"; import ConfrimModal from "../modal/ConfrimModal.vue";
import type { SetTFParam, SimilarityPictureSortParam } from "/#/api"; import type { ApprovalParam, SetTFParam, SimilarityPictureSortParam } from "/#/api";
const batch = ref(false); const batch = ref(false);
const selectItems = ref<any[]>([]); const selectItems = ref<any[]>([]);
@ -68,7 +70,7 @@ const imageRef = ref<ComponentElRef | null>();
const listData = ref<any[]>([]); const listData = ref<any[]>([]);
const loading = ref(false); const loading = ref(false);
const el = ref<HTMLDivElement | null>(null); const el = ref<HTMLDivElement | null>(null);
const selectedSortName = ref('');
let canloadMore = true; let canloadMore = true;
let processItems: any[] = []; let processItems: any[] = [];
@ -312,7 +314,7 @@ async function handleSelect(item: any) {
} }
async function sortHandler(orderby: "similarityScore" | "createdate") { async function sortHandler(orderby: "similarityScore" | "createdate") {
selectedSortName.value = orderby;
sortBy.orderName = orderby; sortBy.orderName = orderby;
sortBy.orderType = sortBy.orderType === "asc" ? "desc" : "asc"; sortBy.orderType = sortBy.orderType === "asc" ? "desc" : "asc";
refreshHandler(); refreshHandler();
@ -399,6 +401,102 @@ function previewHandler(event: MouseEvent) {
if (imageRef.value && (imageRef.value as any).src) if (imageRef.value && (imageRef.value as any).src)
(imageRef.value as any).mergedOnClick(); (imageRef.value as any).mergedOnClick();
} }
function rejectHandler(items?: any) {
let cloneItem: any
if (batch.value) {
processItems = selectItems.value
}
else if (overTask.value) {
cloneItem = clone(overTask.value)
processItems = [cloneItem]
}
if (items !== undefined && !(items instanceof PointerEvent))
processItems = items
const msg = validate(processItems)
if (msg !== null) {
message.error(msg)
return
}
const modal = unref(confrimModalRef)! as any
modal.showModal()
}
function reject(idOrDesc: string, backId: string, isOther: boolean) {
const formIds: string[] = processItems.map(item => item.id)
const taskIds: string[] = processItems.map(item => item.taskId)
const tasknames: string[] = processItems.map(item => item.taskname)
const param: ApprovalParam = {
formid: formIds,
taskId: taskIds,
approvd: false,
taskComment: idOrDesc,
taskname: isOther ? tasknames : ['其他'],
}
doAudit(param)
}
function doAudit(param: any) {
audit(param).then((res) => {
const { code } = res
setBatch(false)
if (code === 'OK'){
emitter.emit('refresh')
refreshHandler()
}
else message.error(res.message)
})
}
function approvalHandler(items?: any) {
let cloneItem: any
if (batch.value) {
processItems = selectItems.value
}
else if (overTask.value) {
cloneItem = clone(overTask.value)
processItems = [cloneItem]
}
if (items !== undefined && !(items instanceof PointerEvent))
processItems = items
const msg = validate(processItems)
if (msg !== null) {
message.error(msg)
return
}
dialog.info({
title: '确认提示',
content: '确认给该任务审批为【通过】吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
approval()
},
onNegativeClick: () => {},
})
}
function approval() {
const formIds: string[] = processItems.map(item => item.id)
const taskIds: string[] = processItems.map(item => item.taskId)
const tasknames: string[] = processItems.map(item => item.taskname)
const param: ApprovalParam = {
formid: formIds,
taskId: taskIds,
approvd: true,
taskComment: 'approval',
taskname: tasknames,
}
doAudit(param)
}
</script> </script>
<template> <template>
@ -411,15 +509,17 @@ function previewHandler(event: MouseEvent) {
</div> </div>
<div class="right"> <div class="right">
<div v-show="!showActions" style="display: flex; align-items: center"> <div v-show="!showActions" style="display: flex; align-items: center">
<n-button text @click="clearHandler">
<SvgIcon size="12" name="delete" />
清除标记
</n-button>
<div class="btn" style="margin: 0px 10px" @click="setBatch(true)"> <div class="btn" style="margin: 0px 10px" @click="setBatch(true)">
<SvgIcon style="margin-right: 6px" size="14" name="tf" /> <SvgIcon style="margin-right: 6px" size="14" name="tf" />
辨别真假 批量审批
</div>
<div class="icon-wrap">
<SvgIcon
size="20"
name="immersion-model"
@click="immersionHandler"
/>
</div> </div>
<SvgIcon style="cursor: pointer" size="20" name="immersion-model" @click="immersionHandler" />
</div> </div>
<div v-show="showActions" class="batch"> <div v-show="showActions" class="batch">
@ -429,12 +529,15 @@ function previewHandler(event: MouseEvent) {
</template> </template>
返回 返回
</n-button> </n-button>
<div style="cursor: pointer; margin-left: 16px" @click="falseHandler"> <div
<SvgIcon width="64" height="28" name="t4" /> style="cursor: pointer; margin-left: 16px"
@click.stop="rejectHandler"
>
<SvgIcon width="64" height="28" name="a1" />
</div> </div>
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
<div style="cursor: pointer" @click="trueHandler"> <div style="cursor: pointer" @click.stop="approvalHandler">
<SvgIcon width="64" height="28" name="t3" /> <SvgIcon width="64" height="28" name="a2" />
</div> </div>
</div> </div>
</div> </div>
@ -446,21 +549,18 @@ function previewHandler(event: MouseEvent) {
<!-- 左侧大图 图片信息 --> <!-- 左侧大图 图片信息 -->
<div class="left" :style="{ 'background-image': `url(${taskDetailInfo?.imgurl})` }" @click="showAction" <div class="left" :style="{ 'background-image': `url(${taskDetailInfo?.imgurl})` }" @click="showAction"
@mouseleave="leaveTaskHandler"> @mouseleave="leaveTaskHandler">
<!-- 真假标记 -->
<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="footer-times"> <div class="footer-times">
<div class="time" style="margin-bottom: 4px;"> <div class="time" style="margin-bottom: 4px;">
<SvgIcon color="#FFF" size="16" name="camera" /> <SvgIcon color="#FFF" size="16" name="camera" />
<span class="time-value">{{ taskDetailInfo.createTime }} </span> <span class="time-value">{{ taskDetailInfo?.submitDateTimestamp ? format(
taskDetailInfo.submitDateTimestamp, 'yyyy-MM-dd HH:mm:ss') : '-' }} </span>
</div> </div>
<div class="time"> <div class="time">
<SvgIcon color="#FFF" size="16" name="save" /> <SvgIcon color="#FFF" size="16" name="save" />
<span class="time-value">{{ taskDetailInfo.createTime }} </span> <span class="time-value">{{
taskDetailInfo?.photoDateTimestamp ? format(taskDetailInfo?.photoDateTimestamp, 'yyyy-MM-dd HH:mm:ss') :
'-'
}} </span>
</div> </div>
</div> </div>
<div class="status"> <div class="status">
@ -503,8 +603,8 @@ function previewHandler(event: MouseEvent) {
</div> </div>
<!-- 操作 --> <!-- 操作 -->
<div v-show="overTask && overTask.id === taskDetailInfo.id" class="action" @click.stop="hideAction"> <div v-show="overTask && overTask.id === taskDetailInfo.id" class="action" @click.stop="hideAction">
<SvgIcon style="cursor: pointer" name="t1" @click.stop="trueHandler" /> <SvgIcon style="cursor: pointer" name="t1" @click.stop="approvalHandler" />
<SvgIcon style="cursor: pointer; margin-left: 30px" name="t2" @click.stop="falseHandler" /> <SvgIcon style="cursor: pointer; margin-left: 30px" name="t2" @click.stop="rejectHandler" />
</div> </div>
</div> </div>
<!-- 右侧任务 标题信息 --> <!-- 右侧任务 标题信息 -->
@ -512,8 +612,10 @@ function previewHandler(event: MouseEvent) {
<n-scrollbar style="max-height: 100%"> <n-scrollbar style="max-height: 100%">
<span class="task-name">任务ID{{ taskDetailInfo.taskname }}</span> <span class="task-name">任务ID{{ taskDetailInfo.taskname }}</span>
<div class="tags"> <div class="tags">
<div class="tag tag-approved">已审批</div> <div class="tag tag-submiting" v-if="taskDetailInfo.states==1">{{ TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
<div class="tag tag-passed">通过</div> <div class="tag tag-approve" v-else-if="taskDetailInfo.states==2">{{ TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
<div class="tag tag-passed" v-else-if="taskDetailInfo.states==3">{{ TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
<div class="tag tag-approved" v-else-if="taskDetailInfo.states==4">{{ TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
</div> </div>
<n-divider class="divider-line" /> <n-divider class="divider-line" />
<div class="property"> <div class="property">
@ -561,20 +663,23 @@ function previewHandler(event: MouseEvent) {
</n-scrollbar> </n-scrollbar>
</div> </div>
</div> </div>
<div style="display: flex; justify-content: space-between; padding: 12px 0px"> <div style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0">
<div> <div>
<!-- <span style="font-size: 21px; font-weight: bold">任务包图片</span><span>({{ totalCount }})</span> --> <!-- <span style="font-size: 21px; font-weight: bold">任务包图片</span><span>({{ totalCount }})</span> -->
<span <span
style="font-size: 18px; font-weight: Medium;color: #333333;font-family: PingFang SC, PingFang SC-Medium;">任务包图片</span> style="font-size: 18px; font-weight: Medium;color: #333333;font-family: PingFang SC, PingFang SC-Medium;">任务包图片</span>
</div> </div>
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center;font-size: 14px;margin-right: 25px;color:#323233">
<div style="cursor: pointer" @click="sortHandler('createdate')"> <div style="cursor: pointer" @click="sortHandler('createdate')">
<span>时间排序</span> <span>时间排序</span>
<SvgIcon style="margin-left: 8px" name="sort" size="12" /> <SvgIcon style="margin-left: 5px" name="sort" size="12" v-show="selectedSortName !== 'createdate'" />
<SvgIcon style="margin-left: 5px" name="active-sort" size="12" v-show="selectedSortName === 'createdate'" />
</div> </div>
<div style="margin-left: 15px; cursor: pointer" @click="sortHandler('similarityScore')"> <div style="margin-left: 15px; cursor: pointer" @click="sortHandler('similarityScore')">
<span>相似度排序</span> <span>相似度排序</span>
<SvgIcon style="margin-left: 8px" name="sort" size="12" /> <SvgIcon style="margin-left: 5px" name="sort" size="12" v-show="selectedSortName !== 'similarityScore'" />
<SvgIcon style="margin-left: 5px" name="active-sort" size="12"
v-show="selectedSortName === 'similarityScore'" />
</div> </div>
</div> </div>
</div> </div>
@ -586,12 +691,14 @@ function previewHandler(event: MouseEvent) {
<div class="time-wrapper"> <div class="time-wrapper">
<div class="time"> <div class="time">
<SvgIcon color="#FFF" size="16" name="camera" /> <SvgIcon color="#FFF" size="16" name="camera" />
<span class="current-time" >{{ item.photoDateTimestamp ? formatToDateHMS(Number(item.photoDateTimestamp) || 0) : '-' <span class="current-time">{{ item.photoDateTimestamp ? formatToDateHMS(Number(item.photoDateTimestamp) ||
0) : '-'
}}</span> }}</span>
</div> </div>
<div class="time"> <div class="time">
<SvgIcon color="#FFF" size="16" name="save" /> <SvgIcon color="#FFF" size="16" name="save" />
<span class="current-time">{{ item.submitDateTimestamp ? formatToDateHMS(Number(item.submitDateTimestamp) || 0) : '-' <span class="current-time">{{ item.submitDateTimestamp ? formatToDateHMS(Number(item.submitDateTimestamp)
|| 0) : '-'
}}</span> }}</span>
</div> </div>
</div> </div>
@ -605,30 +712,27 @@ function previewHandler(event: MouseEvent) {
{{ item?.maxSimilarity && Number(item?.maxSimilarity).toFixed(0) }}% {{ item?.maxSimilarity && Number(item?.maxSimilarity).toFixed(0) }}%
</div> </div>
</div> </div>
<div class="pass-status" v-if="item.historyStates === 1">
<SvgIcon name="repeat-icon" style="width:52;height:24px" /> <div class="pass-status" v-if="item.historyStates === 2">
</div>
<div class="pass-status" v-else-if="item.historyStates === 2">
<SvgIcon name="pass-icon" style="width:52;height:24px" /> <SvgIcon name="pass-icon" style="width:52;height:24px" />
</div> </div>
<div class="pass-status" v-else-if="item.historyStates === 3"> <div class="pass-status" v-else-if="item.historyStates === 3">
<SvgIcon name="no-pass-icon" style="width:52;height:24px" /> <SvgIcon name="no-pass-icon" style="width:52;height:24px" />
</div> </div>
<!-- <div class="mark"> <!--
<SvgIcon name="jia" /> 重复标签
</div> <div class="pass-status" v-if="item.historyStates === 1">
<div class="mark"> <SvgIcon name="repeat-icon" style="width:52;height:24px" />
<SvgIcon name="zhen" />
</div> --> </div> -->
<div v-show="overTask && overTask.id === item.id" class="action"> <div v-show="overTask && overTask.id === item.id" class="action">
<SvgIcon style="cursor: pointer" name="t1" @click.stop="trueHandler" /> <SvgIcon style="cursor: pointer" name="t1" @click.stop="approvalHandler" />
<SvgIcon style="cursor: pointer" name="t2" @click.stop="falseHandler" /> <SvgIcon style="cursor: pointer;margin-left: 40px;" name="t2" @click.stop="rejectHandler" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</n-spin> </n-spin>
<ConfrimModal ref="confrimModalRef" @commit="setFalse" /> <ConfrimModal ref="confrimModalRef" @commit="reject" />
</div> </div>
</template> </template>
@ -795,7 +899,7 @@ function previewHandler(event: MouseEvent) {
border-radius: 8px; border-radius: 8px;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: rgba(102, 102, 102, 0.5); background-color: rgba(0,0,0,0.48);
} }
.info { .info {
@ -810,6 +914,17 @@ function previewHandler(event: MouseEvent) {
padding: 16px 0 0 23px; padding: 16px 0 0 23px;
color: #fff; color: #fff;
} }
.icon-wrap{
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
background: rgba(80,122,253,.1);
border-radius: 8px;
margin-left: 10px;
cursor: pointer;
}
.img-info { .img-info {
color: lime !important; color: lime !important;
@ -905,7 +1020,14 @@ function previewHandler(event: MouseEvent) {
font-size: 12px; font-size: 12px;
line-height: 16px; line-height: 16px;
} }
.tag-submiting{
color: #feaf2d;
border: 1px solid #feaf2d;
}
.tag-approve{
color: #398ade;
border: 1px solid #398ade;
}
.tag-passed { .tag-passed {
color: #02C984; color: #02C984;
border: 1px solid #02C984; border: 1px solid #02C984;
@ -1055,8 +1177,8 @@ function previewHandler(event: MouseEvent) {
display: flex; display: flex;
border-radius: 8px; border-radius: 8px;
align-items: center; align-items: center;
justify-content: space-around; justify-content: center;
background-color: #666666; background-color: rgba(0,0,0,0.48);
} }

@ -1,9 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeMount, ref } from 'vue' import { useDictionary } from '@/store/modules/dictonary';
import { useDictionary } from '@/store/modules/dictonary' import { computed, onBeforeMount, ref, unref } from 'vue';
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'commit', id: any, desc: null | string) (e: 'commit', rejectId: any, backId: any, isOther: boolean)
}>() }>()
const dictonaryStore = useDictionary() const dictonaryStore = useDictionary()
@ -27,29 +27,49 @@ defineExpose({
showModal, showModal,
}) })
const options = ref<any[]>([]) const backOptions = ref<any[]>([])
const reasonOptions = ref<any[]>([])
const selectId = ref(null) const selectBackId = ref(null)
const selectRejectId = ref(null)
const selectItem = ref(null)
const otherValue = ref(null) const otherValue = ref(null)
const showOther = computed(() => { const showOther = computed(() => {
for (const item of options.value) { return (selectItem.value as any)?.label === '其他'
if (item.value === selectId.value && item.label === '其他') })
return true
}
return false const comomitValue = computed(() => {
return (selectItem.value as any)?.label === '其他' ? otherValue.value : selectRejectId.value
}) })
async function handleSumbit(e: MouseEvent) { async function handleSumbit(e: MouseEvent) {
e.preventDefault() e.preventDefault()
closeModal() closeModal()
emit('commit', selectId.value, otherValue.value) // selectRejectId.value === 'other'
emit('commit', unref(comomitValue), unref(selectBackId), showOther.value)
} }
onBeforeMount(async () => { onBeforeMount(async () => {
const tfList = await dictonaryStore.fetchTFList() const rejectList = await dictonaryStore.fetchTFList()
options.value = tfList const backList = await dictonaryStore.fetchBackList()
reasonOptions.value = rejectList
backOptions.value = backList
// TODO name=
//
// reasonOptions.value.push({
// label: '',
// value: 'other',
// })
}) })
async function selectChange(id){
console.log(id,'selectChange')
selectItem.value = reasonOptions.value.find(v=>v.id == id);
}
</script> </script>
<template> <template>
@ -57,7 +77,7 @@ onBeforeMount(async () => {
<n-card :style="cardStyle" :bordered="false" size="huge" role="dialog" aria-modal="true"> <n-card :style="cardStyle" :bordered="false" size="huge" role="dialog" aria-modal="true">
<div class="wrapper"> <div class="wrapper">
<div class="wrapper-header"> <div class="wrapper-header">
<span class="wrapper-left">选择判假原因</span> <span class="wrapper-left">选择不通过原因</span>
<div class="wrapper-right"> <div class="wrapper-right">
<div class="wrapper-right-close" @pointerdown="closeModal"> <div class="wrapper-right-close" @pointerdown="closeModal">
<div class="wrapper-right-icon" /> <div class="wrapper-right-icon" />
@ -65,10 +85,23 @@ onBeforeMount(async () => {
</div> </div>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<span>判假原因</span> <span>处理方式</span>
<n-select filterable v-model:value="selectId" style="margin-top: 10px;" :options="options" /> <n-select filterable v-model:value="selectBackId" style="margin-top: 10px;" :options="backOptions" />
<n-input v-show="showOther" v-model:value="otherValue" style="margin-top: 10px;" type="textarea" /> </div>
<div class="wrapper-content">
<span>不通过原因</span>
<n-select filterable v-model:value="selectRejectId" @change="selectChange" style="margin-top: 10px;" :options="reasonOptions" />
<n-input v-show="showOther" v-model:value="otherValue" type="textarea" placeholder="备注内容" style="margin-top: 10px;" />
</div> </div>
<!-- <div class="wrapper-content">
<n-input
type="textarea"
placeholder="备注内容" v-model="showOther"></n-input>
</div> -->
</div> </div>
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">

Loading…
Cancel
Save