fix: some bug

bak
elseif 1 year ago
parent f11fc716d8
commit 6f54f2d569

@ -87,7 +87,7 @@ export async function getTaskDetailPictureList(packageid: string, taskchildpictu
assignee: item.assignee, assignee: item.assignee,
pictureid: item.pictureid, pictureid: item.pictureid,
imgurl: item.ocrPicture.imgurl, imgurl: item.ocrPicture.imgurl,
thumburl: item.serverThumbnailUrl || item.ocrPicture.imgurl, thumburl: item.ocrPicture.serverThumbnailUrl || item.ocrPicture.imgurl,
iztrueorfalse: item.iztrueorfalse, iztrueorfalse: item.iztrueorfalse,
states: item.states, states: item.states,
history: hasHistory(item.ocpictureid, item.picturecompare), history: hasHistory(item.ocpictureid, item.picturecompare),

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择拜访客户级别')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择拜访客户名称')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择拜访客户类型')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择产品名称')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择所属项目')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择拜访项目类别')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择分类')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择发布地区')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择厂商')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onBeforeMount, ref } from 'vue' import { onBeforeMount, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui' import { type FormItemRule, type FormRules, faIR } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary' import { useDictionary } from '@/store/modules/dictonary'
const props = defineProps<{ const props = defineProps<{
@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择任务来源')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择任务状态')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择省份')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择计划')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -19,14 +19,8 @@ const formValue = ref({
const rules: FormRules = { const rules: FormRules = {
users: [ users: [
{ {
required: true, required: false,
type: 'array', type: 'array',
validator(rule: FormItemRule, value: string[]) {
if (value == null || value.length === 0)
return new Error('请选择提报人')
return true
},
trigger: ['blur', 'change'], trigger: ['blur', 'change'],
}, },
], ],

@ -74,10 +74,10 @@ const layout = debounce(() => {
(_masonry as any).layout() (_masonry as any).layout()
if (!el.value) if (!el.value)
return return
const scrollHeight = el.value!.scrollHeight // const scrollHeight = el.value!.scrollHeight
const clientHeight = el.value!.clientHeight // const clientHeight = el.value!.clientHeight
const top = scrollHeight - clientHeight - 100 // const top = scrollHeight - clientHeight - 100
el.value!.scrollTo({ top, behavior: 'instant' }) // el.value!.scrollTo({ top, behavior: 'instant' })
loading.value = false loading.value = false
}) })
@ -224,6 +224,7 @@ function reset() {
loading.value = false loading.value = false
canloadMore = true canloadMore = true
filterId = null filterId = null
layout()
} }
async function refreshHandler(filtersearchId?: any) { async function refreshHandler(filtersearchId?: any) {
@ -232,13 +233,15 @@ async function refreshHandler(filtersearchId?: any) {
if (filtersearchId) if (filtersearchId)
filterId = filtersearchId filterId = filtersearchId
useInfiniteScroll( nextTick(() => {
el as any, useInfiniteScroll(
() => { el as any,
loadMore() () => {
}, loadMore()
{ distance: 10, canLoadMore: () => canloadMore }, },
) { distance: 10, canLoadMore: () => canloadMore },
)
})
} }
function getAvatar(url: string): string { function getAvatar(url: string): string {
@ -284,8 +287,8 @@ function getAvatar(url: string): string {
:src="item.imgUrl" :src="item.imgUrl"
> --> > -->
<n-image <n-image
class="img" :img-props="{ onClick: hideDownload }" class="img" :img-props="{ onClick: hideDownload }" :class="{ 'img-fit': viewMode !== 'masonry' }"
:class="{ 'img-fit': viewMode !== 'masonry' }" :src="item.thumburl" :src="item.thumburl"
/> />
<div class="info"> <div class="info">
<div class="left"> <div class="left">

@ -253,7 +253,7 @@ function previewHandler(event: MouseEvent) {
event.stopImmediatePropagation() event.stopImmediatePropagation()
event.stopPropagation() event.stopPropagation()
if (imageRef.value) if (imageRef.value && (imageRef.value as any).src)
(imageRef.value as any).mergedOnClick() (imageRef.value as any).mergedOnClick()
} }

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue' import { computed, onUnmounted, onUpdated, reactive, ref, unref, watch } from 'vue'
import { useDialog, useMessage } from 'naive-ui' import { useDialog, useMessage } from 'naive-ui'
import { clone, debounce, pickBy } from 'lodash-es' import { clone, debounce, pickBy } from 'lodash-es'
import { useInfiniteScroll } from '@vueuse/core' import { useInfiniteScroll } from '@vueuse/core'
@ -51,15 +51,14 @@ const taskpagination = reactive({
pageSize: 10, pageSize: 10,
}) })
const sortBy: PictureSortParam = { const sortBy: PictureSortParam = {
orderbyname: 'desc', orderbyname: 'asc',
orderbyvalue: 'fromuptime', orderbyvalue: 'pictureResult',
} }
const workStore = useWorkOrder() const workStore = useWorkOrder()
const selectTask = ref<any>(null) const selectTask = ref<any>(null)
const overTask = ref<any>(null) const overTask = ref<any>(null)
const taskList = ref<any[]>([]) const taskList = ref<any[]>([])
const taskDetailInfo = ref<any>({}) const taskDetailInfo = ref<any>({})
const taskDetailPictureList = ref<any[]>([])
const confrimModalRef = ref(null) const confrimModalRef = ref(null)
const imageRef = ref<ComponentElRef | null>() const imageRef = ref<ComponentElRef | null>()
const listData = ref<any[]>([]) const listData = ref<any[]>([])
@ -175,13 +174,16 @@ function doSetTF(param: SetTFParam) {
} }
function updateList(param: SetTFParam) { function updateList(param: SetTFParam) {
const list = taskDetailPictureList.value const list = listData.value
const ids = param.taskchildpictureids.split(',') const ids = param.taskchildpictureids.split(',')
for (const item of list) { for (const item of list) {
if (ids.includes(item.id)) if (ids.includes(item.id))
item.iztrueorfalse = param.iztrueorfalse item.iztrueorfalse = param.iztrueorfalse
} }
if (ids.includes(taskDetailInfo.value.id))
taskDetailInfo.value.iztrueorfalse = param.iztrueorfalse
} }
function forwardHandler() { function forwardHandler() {
@ -246,10 +248,10 @@ const layout = debounce(() => {
_imagesload.on('done', (instance) => { _imagesload.on('done', (instance) => {
if (!el.value) if (!el.value)
return return
const scrollHeight = el.value!.scrollHeight // const scrollHeight = el.value!.scrollHeight
const clientHeight = el.value!.clientHeight // const clientHeight = el.value!.clientHeight
const top = scrollHeight - clientHeight - 100 // const top = scrollHeight - clientHeight - 100
el.value!.scrollTo({ top, behavior: 'instant' }) // el.value!.scrollTo({ top, behavior: 'instant' })
loading.value = false loading.value = false
}) })
@ -299,6 +301,7 @@ async function sortHandler(orderby: 'pictureResult' | 'fromuptime') {
return return
sortBy.orderbyvalue = orderby sortBy.orderbyvalue = orderby
sortBy.orderbyname = sortBy.orderbyname === 'asc' ? 'desc' : 'asc'
refreshHandler() refreshHandler()
} }
@ -362,11 +365,21 @@ function immersionHandler() {
workStore.updateImmersion() workStore.updateImmersion()
} }
function showAction() {
const item = taskDetailInfo.value
if (batch.value === false)
overTask.value = item
}
function hideAction() {
overTask.value = null
}
function previewHandler(event: MouseEvent) { function previewHandler(event: MouseEvent) {
event.stopImmediatePropagation() event.stopImmediatePropagation()
event.stopPropagation() event.stopPropagation()
if (imageRef.value) if (imageRef.value && (imageRef.value as any).src)
(imageRef.value as any).mergedOnClick() (imageRef.value as any).mergedOnClick()
} }
</script> </script>
@ -414,14 +427,16 @@ function previewHandler(event: MouseEvent) {
<div class="wrapper-detail"> <div class="wrapper-detail">
<div <div
class="left" :style="{ 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})` }" class="left" :style="{ 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})` }"
@click="previewHandler" @click="showAction" @mouseleave="leaveTaskHandler"
> >
<!-- 真假标记 -->
<div class="mark"> <div class="mark">
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" /> <SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" />
</div> </div>
<div class="mark"> <div class="mark">
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 1" size="128" name="zhen" /> <SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 1" size="128" name="zhen" />
</div> </div>
<!-- 右下信息 -->
<div class="info"> <div class="info">
<n-grid x-gap="16" y-gap="0" :cols="12"> <n-grid x-gap="16" y-gap="0" :cols="12">
<n-gi span="4"> <n-gi span="4">
@ -444,8 +459,21 @@ function previewHandler(event: MouseEvent) {
</n-gi> </n-gi>
</n-grid> </n-grid>
</div> </div>
<!-- 右上点击大图 -->
<div class="preview" @click="previewHandler">
<SvgIcon size="30" name="zoom-out" />
</div>
<!-- 预览大图组件 -->
<div style="display: none;"> <div style="display: none;">
<n-image ref="imageRef" :img-props="{ onClick: hideDownload }" :src="taskDetailInfo?.ocrPicture?.imgurl" /> <n-image
ref="imageRef" :img-props="{ onClick: hideDownload }"
:src="taskDetailInfo?.ocrPicture?.imgurl"
/>
</div>
<!-- 操作 -->
<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;margin-left: 30px;" name="t2" @click.stop="falseHandler" />
</div> </div>
</div> </div>
<div class="right"> <div class="right">
@ -609,6 +637,21 @@ function previewHandler(event: MouseEvent) {
border-radius: 8px; border-radius: 8px;
position: relative; position: relative;
.preview {
position: absolute;
z-index: 3;
right: 10px;
top: 10px;
width: 50px;
height: 50px;
background-color: rgba(255, 255, 255, 0.6);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.mark { .mark {
position: absolute; position: absolute;
z-index: 3; z-index: 3;
@ -636,6 +679,18 @@ function previewHandler(event: MouseEvent) {
background: rgba(216, 216, 216, 0.4); background: rgba(216, 216, 216, 0.4);
border-radius: 7px; border-radius: 7px;
} }
.action {
position: absolute;
z-index: 3;
width: 100%;
height: 100%;
display: flex;
border-radius: 8px;
align-items: center;
justify-content: center;
background-color: rgba(102, 102, 102, 0.5);
}
} }
.right { .right {

Loading…
Cancel
Save