feat: 修改bug

pull/187/head
zhouxiaoan 1 year ago
parent 9d6d0b2de8
commit 8edc6d14ea

@ -110,7 +110,7 @@ export async function getPictureSimilarityList(params: PageParam & PictureSortPa
taskId: item.taskId, taskId: item.taskId,
taskname: item.fromTaskName, taskname: item.fromTaskName,
assignee: item.assignee, assignee: item.assignee,
pictureid: item.pictureid, pictureid: item.pictureid || item.pictureId,
imgurl: item.serverThumbnailUrl, imgurl: item.serverThumbnailUrl,
maxSimilarity: item.maxSimilarity, maxSimilarity: item.maxSimilarity,
thumburl: item.ocrPicture?.serverThumbnailUrl || item.ocrPicture?.imgurl, thumburl: item.ocrPicture?.serverThumbnailUrl || item.ocrPicture?.imgurl,

@ -1,10 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeMount, reactive, ref } from 'vue' import { computed, onBeforeMount, reactive, ref, watch } from 'vue'
import { useMessage } from 'naive-ui' import { useMessage } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary' import { useDictionary } from '@/store/modules/dictonary'
import { audit } from '@/api/task/task' import { audit } from '@/api/task/task'
const emit = defineEmits(['success','close']) const emit = defineEmits(['success', 'close', 'show'])
const message = useMessage() const message = useMessage()
const loading = ref(false) const loading = ref(false)
@ -21,12 +21,8 @@ const cardStyle = {
} }
const rules = { const rules = {
disposeTypeId: [ disposeTypeId: [{ required: true, message: '请选择处理方式', trigger: 'blur' }],
{ required: true, message: '请选择处理方式', trigger: 'blur' }, failCauseId: [{ required: true, message: '请选择不通过原因', trigger: 'blur' }],
],
failCauseId: [
{ required: true, message: '请选择不通过原因', trigger: 'blur' },
],
} }
const formData = reactive({ const formData = reactive({
@ -42,17 +38,21 @@ function showModal(value) {
function closeModal() { function closeModal() {
show.value = false show.value = false
emit('close') emit('close')
formData.disposeTypeId='262403670085013522' formData.disposeTypeId = '262403670085013522'
formData.failCauseId= '260402999231251188' formData.failCauseId = '260402999231251188'
formData.comment= '' formData.comment = ''
} }
defineExpose({ defineExpose({
showModal, showModal,
closeModal,
})
watch(show, (value) => {
// console.log(value)
emit('show', value)
}) })
const disposeOptions = ref<any[]>([]) // const disposeOptions = ref<any[]>([]) //
const failCauseOptions = ref<any[]>([]) // const failCauseOptions = ref<any[]>([]) //
const selectItem = ref(null) const selectItem = ref(null)
@ -66,7 +66,9 @@ onBeforeMount(async () => {
}) })
const showOther = computed(() => { const showOther = computed(() => {
const failCauseItem = failCauseOptions.value.find(item => item.value === formData.failCauseId) const failCauseItem = failCauseOptions.value.find(
item => item.value === formData.failCauseId,
)
return failCauseItem?.label === '其他' return failCauseItem?.label === '其他'
}) })
/* /*
@ -75,8 +77,8 @@ const showOther = computed(() => {
* id: '' * id: ''
* taskId:'' * taskId:''
* fromTaskName: '' * fromTaskName: ''
* }] * }]
*/ */
async function handleSumbit(e: MouseEvent) { async function handleSumbit(e: MouseEvent) {
e.preventDefault() e.preventDefault()
formRef.value.validate(async (errors) => { formRef.value.validate(async (errors) => {
@ -90,8 +92,12 @@ async function handleSumbit(e: MouseEvent) {
taskName: item.fromTaskName, taskName: item.fromTaskName,
}) })
}) })
const disposeTypeItem = disposeOptions.value.find(item => item.value === formData.disposeTypeId) const disposeTypeItem = disposeOptions.value.find(
const failCauseItem = failCauseOptions.value.find(item => item.value === formData.failCauseId) item => item.value === formData.disposeTypeId,
)
const failCauseItem = failCauseOptions.value.find(
item => item.value === formData.failCauseId,
)
const param = { const param = {
result: false, result: false,
@ -110,7 +116,9 @@ async function handleSumbit(e: MouseEvent) {
emit('success', param) emit('success', param)
closeModal() closeModal()
} }
else { message.error(res.message) } else {
message.error(res.message)
}
}) })
} }
finally { finally {
@ -118,9 +126,9 @@ async function handleSumbit(e: MouseEvent) {
} }
} }
}) })
formData.disposeTypeId='262403670085013522' formData.disposeTypeId = '262403670085013522'
formData.failCauseId= '260402999231251188' formData.failCauseId = '260402999231251188'
formData.comment= '' formData.comment = ''
} }
async function selectChange(id) { async function selectChange(id) {
@ -130,16 +138,17 @@ async function selectChange(id) {
<template> <template>
<n-modal v-model:show="show" transform-origin="center"> <n-modal v-model:show="show" transform-origin="center">
<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>
<SvgIcon <SvgIcon size="22" class="icon" name="close-none-border" @click="closeModal" />
size="22"
class="icon"
name="close-none-border"
@click="closeModal"
/>
</div> </div>
<n-form <n-form
ref="formRef" ref="formRef"
@ -150,14 +159,28 @@ async function selectChange(id) {
> >
<div class="wrapper-content"> <div class="wrapper-content">
<n-form-item class="form-item" label="处理方式" path="disposeTypeId"> <n-form-item class="form-item" label="处理方式" path="disposeTypeId">
<n-select v-model:value="formData.disposeTypeId" filterable :options="disposeOptions" /> <n-select
v-model:value="formData.disposeTypeId"
filterable
:options="disposeOptions"
/>
</n-form-item> </n-form-item>
<n-form-item class="form-item" label="不通过原因" path="failCauseId"> <n-form-item class="form-item" label="不通过原因" path="failCauseId">
<n-select v-model:value="formData.failCauseId" filterable :options="failCauseOptions" @change="selectChange" /> <n-select
v-model:value="formData.failCauseId"
filterable
:options="failCauseOptions"
@change="selectChange"
/>
</n-form-item> </n-form-item>
<n-form-item v-show="showOther" class="form-item-area" label="" path=""> <n-form-item v-show="showOther" class="form-item-area" label="" path="">
<n-input v-model:value="formData.comment" placeholder-class="pl" type="textarea" placeholder="备注内容" /> <n-input
v-model:value="formData.comment"
placeholder-class="pl"
type="textarea"
placeholder="备注内容"
/>
</n-form-item> </n-form-item>
</div> </div>
</n-form> </n-form>
@ -167,7 +190,7 @@ async function selectChange(id) {
<n-button type="info" @click="handleSumbit"> <n-button type="info" @click="handleSumbit">
确定 确定
</n-button> </n-button>
<n-button secondary class="btn" style="margin-left:15px" @click="closeModal"> <n-button secondary class="btn" style="margin-left: 15px" @click="closeModal">
取消 取消
</n-button> </n-button>
</div> </div>
@ -184,7 +207,7 @@ async function selectChange(id) {
align-items: center; align-items: center;
height: 56px; height: 56px;
border-bottom: 0.5px solid #d9d9d9; border-bottom: 0.5px solid #d9d9d9;
padding: 0 24px padding: 0 24px;
} }
&-left { &-left {
@ -194,7 +217,7 @@ async function selectChange(id) {
color: #333333; color: #333333;
} }
.icon{ .icon {
cursor: pointer; cursor: pointer;
} }
@ -217,7 +240,7 @@ async function selectChange(id) {
&:before { &:before {
background-color: #1980ff; background-color: #1980ff;
content: ''; content: "";
width: 5px; width: 5px;
border-radius: 2px; border-radius: 2px;
top: 0; top: 0;
@ -226,14 +249,13 @@ async function selectChange(id) {
} }
} }
.form-item-area{ .form-item-area {
margin-top: -30px; margin-top: -30px;
} }
} }
::v-deep(.n-card__content) { ::v-deep(.n-card__content) {
padding: 0!important; padding: 0 !important;
} }
::v-deep(.n-card > .n-card-header) { ::v-deep(.n-card > .n-card-header) {
@ -251,10 +273,10 @@ async function selectChange(id) {
} }
::v-deep(.n-input__placeholder) { ::v-deep(.n-input__placeholder) {
color: #333333!important; color: #333333 !important;
} }
.btn{ .btn {
border: 1px solid #cad2dd; border: 1px solid #cad2dd;
background-color: #fff; background-color: #fff;
} }

@ -33,6 +33,7 @@ function closeModal() {
defineExpose({ defineExpose({
showModal, showModal,
closeModal,
}) })
const backOptions = ref<any[]>([]) const backOptions = ref<any[]>([])
@ -46,7 +47,9 @@ const showOther = computed(() => {
}) })
const comomitValue = computed(() => { const comomitValue = computed(() => {
return (selectItem.value as any)?.label === '其他' ? otherValue.value : selectRejectId.value return (selectItem.value as any)?.label === '其他'
? otherValue.value
: selectRejectId.value
}) })
async function handleSumbit(e: MouseEvent) { async function handleSumbit(e: MouseEvent) {
@ -94,7 +97,13 @@ async function selectChange(id) {
<template> <template>
<n-modal v-model:show="show" transform-origin="center"> <n-modal v-model:show="show" transform-origin="center">
<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>
@ -106,12 +115,29 @@ async function selectChange(id) {
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<span>处理方式</span> <span>处理方式</span>
<n-select v-model:value="selectBackId" filterable style="margin-top: 10px;" :options="backOptions" /> <n-select
v-model:value="selectBackId"
filterable
style="margin-top: 10px"
:options="backOptions"
/>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<span>不通过原因</span> <span>不通过原因</span>
<n-select v-model:value="selectRejectId" filterable style="margin-top: 10px;" :options="reasonOptions" @change="selectChange" /> <n-select
<n-input v-show="showOther" v-model:value="otherValue" type="textarea" placeholder="备注内容" style="margin-top: 10px;" /> v-model:value="selectRejectId"
filterable
style="margin-top: 10px"
:options="reasonOptions"
@change="selectChange"
/>
<n-input
v-show="showOther"
v-model:value="otherValue"
type="textarea"
placeholder="备注内容"
style="margin-top: 10px"
/>
</div> </div>
<!-- <div class="wrapper-content"> <!-- <div class="wrapper-content">
@ -125,7 +151,7 @@ async function selectChange(id) {
<n-button type="info" @click="handleSumbit"> <n-button type="info" @click="handleSumbit">
确认 确认
</n-button> </n-button>
<n-button secondary style="margin-left:15px" @click="closeModal"> <n-button secondary style="margin-left: 15px" @click="closeModal">
取消 取消
</n-button> </n-button>
</div> </div>
@ -165,7 +191,7 @@ async function selectChange(id) {
margin-bottom: 8px; margin-bottom: 8px;
&:after { &:after {
content: ''; content: "";
display: block; display: block;
width: 18px; width: 18px;
height: 1px; height: 1px;
@ -191,7 +217,7 @@ async function selectChange(id) {
&:before { &:before {
background-color: #1980ff; background-color: #1980ff;
content: ''; content: "";
width: 5px; width: 5px;
border-radius: 2px; border-radius: 2px;
top: 0; top: 0;

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, toRefs } from 'vue' import { nextTick, onMounted, onUnmounted, reactive, ref, toRefs } from 'vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { deleteSearch, getSearchList, historySearch } from '@/api/search/search' import { deleteSearch, getSearchList, historySearch } from '@/api/search/search'
@ -56,25 +56,23 @@ function handlerHistory(name) {
// //
async function deleteHistory() { async function deleteHistory() {
const res = await deleteSearch({ const res = await deleteSearch({})
})
if (res.code === 'OK') if (res.code === 'OK')
historyList.value = [] historyList.value = []
} }
// //
async function getHistory() { async function getHistory() {
const res = await historySearch({ const res = await historySearch({})
})
if (res.code === 'OK') if (res.code === 'OK')
historyList.value = res.data historyList.value = res.data
} }
getHistory() getHistory()
function goPath(item, id) { function goPath(item, id) {
const desiredObject = item.data.find(function (item) { const desiredObject = item.data.find((item) => {
return item.id === id; return item.id === id
}); })
router.push({ name: item.path, query: { id, searchContent: desiredObject.name } }) router.push({ name: item.path, query: { id, searchContent: desiredObject.name } })
emit('close') emit('close')
} }
@ -89,6 +87,9 @@ function highlightText(text, query) {
return highlightedText return highlightedText
} }
onMounted(() => {
setTimeout(() => (value.value = ''))
})
</script> </script>
<template> <template>
@ -97,34 +98,61 @@ function highlightText(text, query) {
<img src="../../assets/images/IP.png" alt=""> <img src="../../assets/images/IP.png" alt="">
</div> </div>
<div class="input_box"> <div class="input_box">
<n-input v-model:value="value" placeholder="搜索任务ID、任务名称、提报人、拜访终端" type="text" @input="inputHandler" <n-input
@mousedown="handlerShowList"> v-model:value="value"
placeholder="搜索任务ID、任务名称、提报人、拜访终端"
type="text"
@input="inputHandler"
@mousedown="handlerShowList"
>
<template #prefix> <template #prefix>
<SvgIcon name="magnifying-1" size="18" /> <SvgIcon name="magnifying-1" size="18" />
</template> </template>
</n-input> </n-input>
</div> </div>
<div v-show="showList && (historyList.length || resultList.length)" class="list_box"> <div v-show="showList && (historyList.length || resultList.length)" class="list_box">
<div v-if="historyList.length" class="list_classfiy_item" style="border-bottom:1px solid #e4e4e4"> <div
v-if="historyList.length"
class="list_classfiy_item"
style="border-bottom: 1px solid #e4e4e4"
>
<div class="list_title"> <div class="list_title">
历史搜索 历史搜索
</div> </div>
<div class="flex history-list"> <div class="flex history-list">
<div class="tag-wrap"> <div class="tag-wrap">
<div v-for="(item, index) of historyList" :key="index" class="tag" <div
@click="handlerHistory(item.historyname)"> v-for="(item, index) of historyList"
:key="index"
class="tag"
@click="handlerHistory(item.historyname)"
>
{{ item.historyname }} {{ item.historyname }}
</div> </div>
</div> </div>
<SvgIcon class="icon-delete" name="delete-history" size="16" @click="deleteHistory" /> <SvgIcon
class="icon-delete"
name="delete-history"
size="16"
@click="deleteHistory"
/>
</div> </div>
</div> </div>
<div v-for="(item, index) in resultList" :key="index" class="list_classfiy_item" <div
:style="(index === resultList.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'"> v-for="(item, index) in resultList"
:key="index"
class="list_classfiy_item"
:style="index === resultList.length - 1 ? '' : 'border-bottom:1px solid #e4e4e4'"
>
<div class="list_title"> <div class="list_title">
{{ item.title }} {{ item.title }}
</div> </div>
<div v-for="(sitem, sindex) in item.data" :key="sindex" class="list_item" @click="goPath(item, sitem.id)"> <div
v-for="(sitem, sindex) in item.data"
:key="sindex"
class="list_item"
@click="goPath(item, sitem.id)"
>
<SvgIcon name="task-icon" size="16" /> <SvgIcon name="task-icon" size="16" />
<span class="name" v-html="highlightText(sitem.name, value)" /> <span class="name" v-html="highlightText(sitem.name, value)" />
</div> </div>
@ -159,8 +187,7 @@ function highlightText(text, query) {
border: 1px solid #507afd; border: 1px solid #507afd;
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
box-shadow: 0px 12px 12px 0px rgba(80, 122, 253, 0.15), box-shadow: 0px 12px 12px 0px rgba(80, 122, 253, 0.15), 0px 0px 0px 0.5px #d4e3fc;
0px 0px 0px 0.5px #d4e3fc;
} }
.list_box { .list_box {
@ -232,6 +259,6 @@ function highlightText(text, query) {
} }
.highlight { .highlight {
color: #507AFD; color: #507afd;
} }
</style> </style>

@ -14,11 +14,15 @@ defineExpose({
<template> <template>
<div> <div>
<n-modal v-model:show="show" :mask="false" :showMask="false" transform-origin="center"> <n-modal
v-model:show="show"
:mask="false"
:show-mask="false"
transform-origin="center"
>
<Search @close="show = false" /> <Search @close="show = false" />
</n-modal> </n-modal>
</div> </div>
</template> </template>
<style scoped lang="less"> <style scoped lang="less"></style>
</style>

@ -19,7 +19,7 @@ const routes: Array<RouteRecordRaw> = [
redirect: '/worksheet', redirect: '/worksheet',
component: Layout, component: Layout,
meta: { meta: {
title: '图审批', title: '图审批',
permissions: ['worksheet-main'], permissions: ['worksheet-main'],
svgname: 'worksheet', svgname: 'worksheet',
svgsize: 22, svgsize: 22,
@ -30,7 +30,7 @@ const routes: Array<RouteRecordRaw> = [
path: 'worksheet', path: 'worksheet',
name: 'worksheet-main', name: 'worksheet-main',
meta: { meta: {
title: '图审批', title: '图审批',
}, },
component: () => import('@/views/worksheet/index.vue'), component: () => import('@/views/worksheet/index.vue'),
}, },

@ -126,7 +126,7 @@ export const useUserStore = defineStore({
const tenantId = firstTenant ? firstTenant.deptno : '' const tenantId = firstTenant ? firstTenant.deptno : ''
data.frontmenuTList.forEach((ele) => { data.frontmenuTList.forEach((ele) => {
if (ele.description === 'AI工单') if (ele.description === 'AI工单')
ele.description = '图审批' ele.description = '图审批'
}) })
storage.set(CURRENT_USER, data, ex) storage.set(CURRENT_USER, data, ex)
storage.set(TENANT_ID, tenantId) storage.set(TENANT_ID, tenantId)

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { defineOptions, ref } from 'vue'; import { defineOptions, ref } from 'vue'
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router'
defineOptions({ name: 'ShortcutModal' }) defineOptions({ name: 'ShortcutModal' })
@ -9,7 +9,7 @@ const props = defineProps({
type: String, type: String,
default: '', default: '',
}, },
}); })
const show = ref(false) const show = ref(false)
const router = useRouter() const router = useRouter()
@ -26,11 +26,10 @@ function showModal() {
function closeModal(path) { function closeModal(path) {
show.value = false show.value = false
if(props.id) { if (props.id)
router.push(path + '?id=' + props.id) router.push(`${path}?id=${props.id}`)
}else { else
router.push(path) router.push(path)
}
} }
function closeIconModal() { function closeIconModal() {
@ -43,7 +42,7 @@ defineExpose({
</script> </script>
<template> <template>
<div class="finish-package-modal" v-if="show"> <div v-if="show" class="finish-package-modal">
<!-- <n-modal v-model:show="show" :mask-closable="false" transform-origin="center" style="padding: 8px;"> <!-- <n-modal v-model:show="show" :mask-closable="false" transform-origin="center" style="padding: 8px;">
<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 style="display: flex;"> <div style="display: flex;">
@ -67,10 +66,16 @@ defineExpose({
</n-card> </n-card>
</n-modal> --> </n-modal> -->
<div class="header-box"> <div class="header-box">
<div class="robot-box"><svg-icon size="80" name="robot-two" /></div> <div class="robot-box">
<svg-icon size="80" name="robot-two" />
</div>
<div class="text-box"> <div class="text-box">
<div class="msg-title">生成成功提示</div> <div class="msg-title">
<div class="msg-text">AI助手已根据您的配置要求生成任务包</div> 生成成功提示
</div>
<div class="msg-text">
AI助手已根据您的配置要求生成任务包
</div>
</div> </div>
<div class="close-box" @click="closeIconModal"> <div class="close-box" @click="closeIconModal">
<svg-icon size="30" name="close-none-border" /> <svg-icon size="30" name="close-none-border" />
@ -80,7 +85,7 @@ defineExpose({
<div @click="closeModal('/worksheet')"> <div @click="closeModal('/worksheet')">
<svg-icon size="65" name="ai-approve" /> <svg-icon size="65" name="ai-approve" />
<div class="footer-text"> <div class="footer-text">
审批 审批
</div> </div>
</div> </div>
<div @click="closeModal('/task')"> <div @click="closeModal('/task')">
@ -112,7 +117,7 @@ defineExpose({
margin-top: 10px; margin-top: 10px;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
>div { > div {
cursor: pointer; cursor: pointer;
} }
} }
@ -167,6 +172,6 @@ defineExpose({
.footer-text { .footer-text {
font-size: 18px; font-size: 18px;
color: #507AFD; color: #507afd;
} }
</style> </style>

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeMount, ref, unref } from 'vue' import { computed, onBeforeMount, ref, unref, watch } from 'vue'
import { useDictionary } from '@/store/modules/dictonary' import { useDictionary } from '@/store/modules/dictonary'
const emit = defineEmits<{ const emit = defineEmits<{
@ -25,6 +25,7 @@ function closeModal() {
defineExpose({ defineExpose({
showModal, showModal,
closeModal,
}) })
const backOptions = ref<any[]>([]) const backOptions = ref<any[]>([])
@ -38,7 +39,9 @@ const showOther = computed(() => {
}) })
const comomitValue = computed(() => { const comomitValue = computed(() => {
return (selectItem.value as any)?.label === '其他' ? otherValue.value : selectRejectId.value return (selectItem.value as any)?.label === '其他'
? otherValue.value
: selectRejectId.value
}) })
async function handleSumbit(e: MouseEvent) { async function handleSumbit(e: MouseEvent) {
@ -62,19 +65,27 @@ onBeforeMount(async () => {
// value: 'other', // value: 'other',
// }) // })
}) })
watch(
async function selectChange(id){ () => show,
console.log(id,'selectChange') (value) => {
selectItem.value = reasonOptions.value.find(v=>v.id == id); console.log(value)
},
)
async function selectChange(id) {
console.log(id, 'selectChange')
selectItem.value = reasonOptions.value.find(v => v.id == id)
} }
</script> </script>
<template> <template>
<n-modal v-model:show="show" transform-origin="center"> <n-modal v-model:show="show" transform-origin="center">
<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>
@ -86,29 +97,43 @@ async function selectChange(id){
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<span>处理方式</span> <span>处理方式</span>
<n-select filterable v-model:value="selectBackId" style="margin-top: 10px;" :options="backOptions" /> <n-select
v-model:value="selectBackId"
filterable
style="margin-top: 10px"
:options="backOptions"
/>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<span>不通过原因</span> <span>不通过原因</span>
<n-select filterable v-model:value="selectRejectId" @change="selectChange" style="margin-top: 10px;" :options="reasonOptions" /> <n-select
<n-input v-show="showOther" v-model:value="otherValue" type="textarea" placeholder="备注内容" style="margin-top: 10px;" /> v-model:value="selectRejectId"
filterable
style="margin-top: 10px"
:options="reasonOptions"
@change="selectChange"
/>
<n-input
v-show="showOther"
v-model:value="otherValue"
type="textarea"
placeholder="备注内容"
style="margin-top: 10px"
/>
</div> </div>
<!-- <div class="wrapper-content"> <!-- <div class="wrapper-content">
<n-input <n-input
type="textarea" type="textarea"
placeholder="备注内容" v-model="showOther"></n-input> placeholder="备注内容" v-model="showOther"></n-input>
</div> --> </div> -->
</div> </div>
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">
<n-button type="info" @click="handleSumbit"> <n-button type="info" @click="handleSumbit">
确认 确认
</n-button> </n-button>
<n-button secondary style="margin-left:15px" @click="closeModal"> <n-button secondary style="margin-left: 15px" @click="closeModal">
取消 取消
</n-button> </n-button>
</div> </div>
@ -148,7 +173,7 @@ async function selectChange(id){
margin-bottom: 8px; margin-bottom: 8px;
&:after { &:after {
content: ''; content: "";
display: block; display: block;
width: 18px; width: 18px;
height: 1px; height: 1px;
@ -174,7 +199,7 @@ async function selectChange(id){
&:before { &:before {
background-color: #1980ff; background-color: #1980ff;
content: ''; content: "";
width: 5px; width: 5px;
border-radius: 2px; border-radius: 2px;
top: 0; top: 0;

@ -1,12 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import { cloneDeep, difference } from "lodash-es"; import { cloneDeep, difference } from 'lodash-es'
import { computed, defineEmits, defineProps, onMounted, ref, watch } from "vue"; import { computed, defineEmits, defineProps, onMounted, ref, watch } from 'vue'
import { VueDraggable } from "vue-draggable-plus"; import { VueDraggable } from 'vue-draggable-plus'
import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter"; import { useMessage } from 'naive-ui'
import { workPackageMap } from "@/config/workorder"; import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
import { useUser } from "@/store/modules/user"; import { workPackageMap } from '@/config/workorder'
import { useMessage } from "naive-ui"; import { useUser } from '@/store/modules/user'
const message = useMessage();
const props = defineProps({ const props = defineProps({
reviewType: { reviewType: {
@ -14,352 +13,370 @@ const props = defineProps({
default: () => 1, default: () => 1,
require: true, require: true,
}, },
}); })
const emit = defineEmits(["onOk"]); const emit = defineEmits(['onOk'])
const message = useMessage()
// //
const offList = ref<any[]>([]); const offList = ref<any[]>([])
// //
const onList = ref<any[]>([]); const onList = ref<any[]>([])
// //
const fixList = ref<any[]>([]); const fixList = ref<any[]>([])
const offShowList = ref<any[]>([]); const offShowList = ref<any[]>([])
const onShowList = ref<any[]>([]); const onShowList = ref<any[]>([])
const fixShowList = ref<any[]>([]); const fixShowList = ref<any[]>([])
const allCount = computed(() => { const allCount = computed(() => {
return `全部字段(共${offList.value.length - 1}个)`; return `全部字段(共${offList.value.length - 1}个)`
}); })
const selectCount = computed(() => { const selectCount = computed(() => {
return `显示字段(共${onList.value.length}个)`; return `显示字段(共${onList.value.length}个)`
}); })
function generatList() { function generatList() {
const keys = Object.keys(workPackageMap); const keys = Object.keys(workPackageMap)
let showList: object[] = []; let showList: object[] = []
const hideList: object[] = []; const hideList: object[] = []
const showStr = "status"; const showStr = 'status'
const showKeys = showStr.split(",").map((key: string) => key.toLowerCase()); const showKeys = showStr.split(',').map((key: string) => key.toLowerCase())
for (const key of keys) { for (const key of keys) {
const name = workPackageMap[key]?.label; const name = workPackageMap[key]?.label
const isDefault = workPackageMap[key]?.isDefault; const isDefault = workPackageMap[key]?.isDefault
// Y // Y
if (!isDefault) { if (!isDefault) {
hideList.push({ hideList.push({
id: key, id: key,
name: name || "未配置", name: name || '未配置',
fix: isDefault, fix: isDefault,
checked: workPackageMap[key].isDefault, checked: workPackageMap[key].isDefault,
}); })
} }
} }
showList = showKeys.reduce((acc, key) => { showList = showKeys.reduce((acc, key) => {
const config = { const config = {
id: key, id: key,
name: workPackageMap[key].label || "未配置", name: workPackageMap[key].label || '未配置',
fix: workPackageMap[key].isDefault, fix: workPackageMap[key].isDefault,
}; }
return [...acc, config]; return [...acc, config]
}, []); }, [])
const fixedList = generateDefaultList(); const fixedList = generateDefaultList()
hideList.unshift(...fixedList); hideList.unshift(...fixedList)
showList.unshift(...fixedList); showList.unshift(...fixedList)
onList.value = showList; onList.value = showList
offList.value = hideList; offList.value = hideList
return { showList, hideList }; return { showList, hideList }
} }
function generateDefaultList() { function generateDefaultList() {
return Object.keys(workPackageMap).reduce((acc, key) => { return Object.keys(workPackageMap).reduce((acc, key) => {
const { label, isDefault } = workPackageMap[key]; const { label, isDefault } = workPackageMap[key]
if (isDefault) { if (isDefault) {
const config = { const config = {
id: key, id: key,
name: label || "未配置", name: label || '未配置',
fix: true, fix: true,
checked: true, checked: true,
}; }
return [...acc, config]; return [...acc, config]
} else {
return acc;
} }
}, []); else {
return acc
}
}, [])
} }
const show = ref(false); const show = ref(false)
const checkAll = computed(() => { const checkAll = computed(() => {
let baseNum = 0; let baseNum = 0
offList.value.map((v) => { offList.value.map((v) => {
if (v.fix) baseNum += 1; if (v.fix)
}); baseNum += 1
return onList.value.length == offList.value.length - baseNum; })
}); return onList.value.length == offList.value.length - baseNum
})
function showModal() { function showModal() {
show.value = true; show.value = true
} }
function closeModal() { function closeModal() {
show.value = false; show.value = false
} }
async function handleSumbit(e: MouseEvent) { async function handleSumbit(e: MouseEvent) {
const userStore = useUser(); const userStore = useUser()
const userInfo = userStore.getUserInfo; const userInfo = userStore.getUserInfo
let userFieldFixed = ""; let userFieldFixed = ''
fixList.value.map((v) => { fixList.value.map((v) => {
userFieldFixed += `${v.id},`; userFieldFixed += `${v.id},`
}); })
onList.value.map((v) => { onList.value.map((v) => {
userFieldFixed += `${v.id},`; userFieldFixed += `${v.id},`
}); })
userFieldFixed = userFieldFixed.slice(0, userFieldFixed.length - 1); userFieldFixed = userFieldFixed.slice(0, userFieldFixed.length - 1)
savefield(props.reviewType, userInfo.id, userFieldFixed); savefield(props.reviewType, userInfo.id, userFieldFixed)
e.preventDefault(); e.preventDefault()
closeModal(); closeModal()
emit("onOk"); emit('onOk')
} }
defineExpose({ defineExpose({
showModal, showModal,
}); })
// generatList(); // generatList();
const selectIds = ref<string[]>([]); const selectIds = ref<string[]>([])
function onCheckAllChange(value) { function onCheckAllChange(value) {
const ids: string[] = []; const ids: string[] = []
for (const item of offList.value) { for (const item of offList.value) {
if (!item.fix) { if (!item.fix) {
item.checked = value; item.checked = value
ids.push(item.id); ids.push(item.id)
} }
} }
for (const item of offShowList.value) { for (const item of offShowList.value) {
if (!item.fix) item.checked = value; if (!item.fix)
item.checked = value
} }
selectIds.value = value ? ids : [];
selectIds.value = value ? ids : []
if (value) { if (value) {
offList.value.map((v) => { offList.value.map((v) => {
if (!v.checked) onList.value.push(v); if (!v.checked)
}); onList.value.push(v)
onShowList.value = cloneDeep(onList.value); })
} else { onShowList.value = cloneDeep(onList.value)
onList.value = []; }
onShowList.value = []; else {
onList.value = []
onShowList.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)
// TODO // TODO
// if (index == -1 && selectIds.value.length >= 6) { // if (index == -1 && selectIds.value.length >= 6) {
// item.checked = false; // item.checked = false;
// message.error("6"); // message.error("6");
// return; // return;
// } // }
item.checked = checked; item.checked = checked
const currentIndex = offList.value.findIndex((v) => v.id == item.id); const currentIndex = offList.value.findIndex(v => v.id == item.id)
offList.value[currentIndex].checked = checked; offList.value[currentIndex].checked = checked
if (index === -1 && checked) { if (index === -1 && checked)
selectIds.value.push(item.id); selectIds.value.push(item.id)
} else { else
selectIds.value.splice(index, 1); selectIds.value.splice(index, 1)
}
} }
const showIds = computed(() => { const showIds = computed(() => {
return onList.value.map((item) => { return onList.value.map((item) => {
return item.id; return item.id
}); })
}); })
watch( watch(
() => selectIds.value.length, () => selectIds.value.length,
(newVal, oldVal) => { (newVal, oldVal) => {
if (newVal === oldVal) return; if (newVal === oldVal)
return
const action = newVal > oldVal ? "add" : "remove"; const action = newVal > oldVal ? 'add' : 'remove'
const diff = const diff
action === "add" = action === 'add'
? difference(selectIds.value, showIds.value) ? difference(selectIds.value, showIds.value)
: difference(showIds.value, selectIds.value); : difference(showIds.value, selectIds.value)
if (diff.length === 0) return; if (diff.length === 0)
return
if (action === "add") { if (action === 'add') {
for (const item of offList.value) { for (const item of offList.value) {
if (!item.fix && diff.includes(item.id)) { if (!item.fix && diff.includes(item.id)) {
onList.value.push({ onList.value.push({
id: item.id, id: item.id,
name: item.name || "未配置", name: item.name || '未配置',
fix: item.fix || false, fix: item.fix || false,
}); })
} }
} }
onShowList.value = cloneDeep(onList.value); onShowList.value = cloneDeep(onList.value)
} else { }
const list = onList.value; else {
const list = onList.value
for (let index = 0; index < list.length; index++) { for (let index = 0; index < list.length; index++) {
const item = list[index]; const item = list[index]
if (!item.fix && diff.includes(item.id)) { if (!item.fix && diff.includes(item.id)) {
list.splice(index, 1); list.splice(index, 1)
onShowList.value.splice(index, 1); onShowList.value.splice(index, 1)
index--; index--
} }
} }
console.log(onShowList.value, list, "onShowList"); console.log(onShowList.value, list, 'onShowList')
} }
} },
); )
watch( watch(
() => showIds.value.length, () => showIds.value.length,
(newVal, oldVal) => { (newVal, oldVal) => {
if (newVal === oldVal) return; if (newVal === oldVal)
return
const diff = difference(selectIds.value, showIds.value); const diff = difference(selectIds.value, showIds.value)
if (diff.length === 0) return; if (diff.length === 0)
return
for (const item of offList.value) { for (const item of offList.value) {
if (!item.fix && diff.includes(item.id)) { if (!item.fix && diff.includes(item.id)) {
const index = selectIds.value.indexOf(item.id); const index = selectIds.value.indexOf(item.id)
item.checked = false; item.checked = false
selectIds.value.splice(index, 1); selectIds.value.splice(index, 1)
} }
} }
} },
); )
function clearDragSource() { function clearDragSource() {
onList.value = onList.value.filter((item) => { onList.value = onList.value.filter((item) => {
return item.fix === true; return item.fix === true
}); })
onShowList.value = cloneDeep(onList.value); onShowList.value = cloneDeep(onList.value)
} }
function removeHandler(id: string) { function removeHandler(id: string) {
let index = onList.value.findIndex((item) => { let index = onList.value.findIndex((item) => {
return item.id === id; return item.id === id
}); })
if (index !== -1) { if (index !== -1) {
onList.value.splice(index, 1); onList.value.splice(index, 1)
onShowList.value.splice(index, 1); onShowList.value.splice(index, 1)
} }
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)
} }
function initData() { function initData() {
offList.value = []; offList.value = []
onList.value = []; onList.value = []
fixList.value = []; fixList.value = []
offShowList.value = []; offShowList.value = []
onShowList.value = []; onShowList.value = []
fixShowList.value = []; fixShowList.value = []
selectIds.value = []; selectIds.value = []
} }
async function getData(type = "") { async function getData(type = '') {
initData(); initData()
const userStore = useUser(); const userStore = useUser()
const userInfo = userStore.getUserInfo; const userInfo = userStore.getUserInfo
let res; let res
res = await getAllfieldList(props.reviewType); // res = await getAllfieldList(props.reviewType) //
const allList = res.data; const allList = res.data
res = await getfieldList(props.reviewType, userInfo.id); // res = await getfieldList(props.reviewType, userInfo.id) //
const useList = res.data; const useList = res.data
/** /**
* name 标题 * name 标题
* id 键值 * id 键值
* fix 是否默认 * fix 是否默认
* checked 是否选中 * checked 是否选中
*/ */
const userFieldFixed = useList?.userFieldFixed?.split(","); const userFieldFixed = useList?.userFieldFixed?.split(',')
const userFieldUnFixed = useList?.userFieldUnFixed?.split(","); const userFieldUnFixed = useList?.userFieldUnFixed?.split(',')
if (!type || type == "off") { if (!type || type == 'off') {
offList.value = []; offList.value = []
allList?.map((v) => { allList?.map((v) => {
const item = { const item = {
name: v.fieldDesc, name: v.fieldDesc,
id: v.name, id: v.name,
fix: v.isrequired == 2, fix: v.isrequired == 2,
checked: checked:
v.isrequired == 2 || v.isrequired == 2
Boolean(userFieldFixed?.find((v2) => v2 == v.name)) || || Boolean(userFieldFixed?.find(v2 => v2 == v.name))
Boolean(userFieldUnFixed?.find((v2) => v2 == v.name)), || Boolean(userFieldUnFixed?.find(v2 => v2 == v.name)),
}; }
if (item.fix) fixList.value.push(item); if (item.fix)
else offList.value.push(item); fixList.value.push(item)
}); else offList.value.push(item)
offList.value.unshift(...fixList.value); })
offList.value.unshift(...fixList.value)
} }
if (!type || type == "on") { if (!type || type == 'on') {
useList?.userFieldFixed?.split(",").map((v) => { useList?.userFieldFixed?.split(',').map((v) => {
let item = allList.find((v2) => v2.name == v); let item = allList.find(v2 => v2.name == v)
if (item) { if (item) {
item = { item = {
name: item.fieldDesc, name: item.fieldDesc,
id: item.name, id: item.name,
fix: item.isrequired == 2, fix: item.isrequired == 2,
checked: true, checked: true,
}; }
selectIds.value.push(item.id); selectIds.value.push(item.id)
if (!item.fix) onList.value.push(item); if (!item.fix)
onList.value.push(item)
} }
}); })
} }
offShowList.value = cloneDeep(offList.value); offShowList.value = cloneDeep(offList.value)
fixShowList.value = cloneDeep(fixList.value); fixShowList.value = cloneDeep(fixList.value)
onShowList.value = cloneDeep(onList.value); onShowList.value = cloneDeep(onList.value)
} }
onMounted(() => getData()); onMounted(() => getData())
const indeterminate = computed(() => { const indeterminate = computed(() => {
let baseNum = 0; let baseNum = 0
offList.value.map((v) => { offList.value.map((v) => {
if (v.fix) baseNum += 1; if (v.fix)
}); baseNum += 1
})
return ( return (
onShowList.value.length > 0 && onShowList.value.length > 0
offShowList.value.length - baseNum > onShowList.value.length && offShowList.value.length - baseNum > onShowList.value.length
); )
}); })
function queryData(value, type) { function queryData(value, type) {
if (value) { if (value) {
if (type == "off") { if (type == 'off') {
offShowList.value = offList.value.filter((item) => item.name.includes(value)); offShowList.value = offList.value.filter(item => item.name.includes(value))
} else { }
onShowList.value = onList.value.filter((item) => item.name.includes(value)); else {
fixShowList.value = fixList.value.filter((item) => item.name.includes(value)); onShowList.value = onList.value.filter(item => item.name.includes(value))
fixShowList.value = fixList.value.filter(item => item.name.includes(value))
} }
} else { }
else {
// getData(type); // getData(type);
if (type == "off") { if (type == 'off') {
offShowList.value = cloneDeep(offList.value); offShowList.value = cloneDeep(offList.value)
} else { }
onShowList.value = cloneDeep(onList.value); else {
fixShowList.value = cloneDeep(fixList.value); onShowList.value = cloneDeep(onList.value)
fixShowList.value = cloneDeep(fixList.value)
} }
} }
} }
const moreThanSix = computed(() => { const moreThanSix = computed(() => {
return selectIds.value.length >= 6; return selectIds.value.length >= 6
}); })
</script> </script>
<template> <template>
@ -445,7 +462,9 @@ const moreThanSix = computed(() => {
<SvgIcon size="14px" name="magnifying-1" /> <SvgIcon size="14px" name="magnifying-1" />
</template> </template>
</n-input> </n-input>
<div class="draggable-title">系统默认</div> <div class="draggable-title">
系统默认
</div>
<div class="draggable-ul" style="border-bottom: none"> <div class="draggable-ul" style="border-bottom: none">
<div <div
v-for="item in fixShowList" v-for="item in fixShowList"
@ -456,7 +475,9 @@ const moreThanSix = computed(() => {
<span class="ml-2">{{ item.name }}</span> <span class="ml-2">{{ item.name }}</span>
</div> </div>
</div> </div>
<div class="draggable-title" style="border-top: none">自定义配置</div> <div class="draggable-title" style="border-top: none">
自定义配置
</div>
<VueDraggable <VueDraggable
v-model="onList" v-model="onList"
class="draggable-ul" class="draggable-ul"
@ -487,7 +508,9 @@ const moreThanSix = computed(() => {
</div> </div>
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">
<n-button type="info" @click="handleSumbit"> </n-button> <n-button type="info" @click="handleSumbit">
确定
</n-button>
<n-button <n-button
secondary secondary
style="margin-left: 15px" style="margin-left: 15px"

@ -7,10 +7,12 @@ import {
inject, inject,
nextTick, nextTick,
onMounted, onMounted,
onUnmounted,
ref, ref,
unref, unref,
watch, watch,
} from 'vue' } from 'vue'
import { useRoute } from 'vue-router'
import CustomFieldModalVue from '../modal/CustomFieldModal.vue' import CustomFieldModalVue from '../modal/CustomFieldModal.vue'
import WorkSheetList from './WorkSheetList.vue' import WorkSheetList from './WorkSheetList.vue'
import { getAllfieldList, getfieldList } from '@/api/home/filter' import { getAllfieldList, getfieldList } from '@/api/home/filter'
@ -18,20 +20,19 @@ import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useUser } from '@/store/modules/user' import { useUser } from '@/store/modules/user'
import { useWorkOrder } from '@/store/modules/workOrder' import { useWorkOrder } from '@/store/modules/workOrder'
import { getViewportOffset } from '@/utils/domUtils' import { getViewportOffset } from '@/utils/domUtils'
import { useRoute } from 'vue-router'
const route = useRoute()
const searchContent = route.query.searchContent;
console.log(searchContent);
defineOptions({ name: 'AsideContent' }) defineOptions({ name: 'AsideContent' })
const emit = defineEmits(['ApprovalOver']) const emit = defineEmits(['ApprovalOver'])
const route = useRoute()
const searchContent = route.query.searchContent
console.log(searchContent)
const collapse = ref(false) const collapse = ref(false)
const workStore = useWorkOrder() const workStore = useWorkOrder()
const filterModalRef = ref(null) const filterModalRef = ref(null)
const packageListRef = ref<HTMLDivElement | null>(null) const packageListRef = ref<HTMLDivElement | null>(null)
// //
const showFieldList = ref<any[]>([]) const showFieldList = ref<any[]>([])
const searchInputRef = ref<HTMLInputElement>()
const reviewType = 1 const reviewType = 1
const dicts = ref<any>([]) const dicts = ref<any>([])
function collapseHandler() { function collapseHandler() {
@ -40,7 +41,7 @@ function collapseHandler() {
const mousetrap = inject('mousetrap') as any const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler) mousetrap.bind('[', collapseHandler)
const searchKeyword = ref(searchContent ? searchContent : '') const searchKeyword = ref(searchContent || '')
const asideWidth = computed(() => { const asideWidth = computed(() => {
return collapse.value ? 0 : 308 return collapse.value ? 0 : 308
@ -72,6 +73,10 @@ const listStyle = computed(() => {
}) })
useWindowSizeFn(computeListHeight, 280) useWindowSizeFn(computeListHeight, 280)
function handleKeydown(event) {
if (event.key === 's')
setShowSearch(true)
}
async function getshowFieldList() { async function getshowFieldList() {
showFieldList.value = [] showFieldList.value = []
@ -122,9 +127,14 @@ async function getshowFieldList() {
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
computeListHeight() computeListHeight()
window.addEventListener('keydown', handleKeydown)
getshowFieldList() getshowFieldList()
}) })
}) })
onUnmounted(() => {
window.removeEventListener('keydown', handleKeydown)
})
const asideEnter = ref(false) const asideEnter = ref(false)
const showCollapse = computed(() => { const showCollapse = computed(() => {
@ -150,6 +160,9 @@ function setShowSearch(value: boolean) {
if (value === false) { if (value === false) {
(packageListRef.value as any).search('') (packageListRef.value as any).search('')
searchKeyword.value = '' searchKeyword.value = ''
nextTick(() => {
searchInputRef.value?.focus()
})
} }
} }
@ -169,7 +182,12 @@ if (searchContent) {
</script> </script>
<template> <template>
<div class="aside" :style="asideStyle" @mouseenter="asideEnter = true" @mouseleave="asideEnter = false"> <div
class="aside"
:style="asideStyle"
@mouseenter="asideEnter = true"
@mouseleave="asideEnter = false"
>
<div v-show="showCollapse" class="aside-collapse"> <div v-show="showCollapse" class="aside-collapse">
<div class="aside-collapse-btn" @click="collapseHandler"> <div class="aside-collapse-btn" @click="collapseHandler">
<SvgIcon :name="collapseIcon" size="40" /> <SvgIcon :name="collapseIcon" size="40" />
@ -183,24 +201,52 @@ if (searchContent) {
<span style="margin-left: 8px; color: #333333">所有任务包</span> <span style="margin-left: 8px; color: #333333">所有任务包</span>
</div> </div>
<div class="right"> <div class="right">
<SvgIcon style="cursor: pointer; margin-left: 10px" size="18" name="magnifying-1" <SvgIcon
@click="setShowSearch(true)" /> style="cursor: pointer; margin-left: 10px"
<SvgIcon style="cursor: pointer; margin-left: 10px" size="18" name="filter" @click="showFilter" /> size="18"
name="magnifying-1"
@click="setShowSearch(true)"
/>
<SvgIcon
style="cursor: pointer; margin-left: 10px"
size="18"
name="filter"
@click="showFilter"
/>
</div> </div>
</div> </div>
<div v-show="showSearch" class="warpper"> <div v-show="showSearch" class="warpper">
<n-input v-model:value="searchKeyword" style="flex: 1; height: 32px" placeholder="请输入你需要搜索的内容" <n-input
@input="inputHandler"> ref="searchInputRef"
v-model:value="searchKeyword"
style="flex: 1; height: 32px"
placeholder="请输入你需要搜索的内容"
@input="inputHandler"
>
<template #suffix> <template #suffix>
<SvgIcon size="14px" name="magnifying-1" /> <SvgIcon size="14px" name="magnifying-1" />
</template> </template>
</n-input> </n-input>
<SvgIcon size="16px" style="margin-left: 6px; cursor: pointer" name="clear" @click="setShowSearch(false)" /> <SvgIcon
size="16px"
style="margin-left: 6px; cursor: pointer"
name="clear"
@click="setShowSearch(false)"
/>
</div> </div>
</div> </div>
<WorkSheetList ref="packageListRef" class="work-sheet-list" :show-field-list="showFieldList" :dicts="dicts" <WorkSheetList
@approval-over="ApprovalOver" /> ref="packageListRef"
<CustomFieldModalVue ref="filterModalRef" :review-type="1" @on-ok="getshowFieldList" /> class="work-sheet-list"
:show-field-list="showFieldList"
:dicts="dicts"
@approval-over="ApprovalOver"
/>
<CustomFieldModalVue
ref="filterModalRef"
:review-type="1"
@on-ok="getshowFieldList"
/>
</div> </div>
</template> </template>

@ -49,43 +49,53 @@ function handleDismissTask() {
positiveButtonProps: { positiveButtonProps: {
type: 'default', type: 'default',
}, },
onPositiveClick: () => { onPositiveClick: () => {},
},
onNegativeClick: () => { onNegativeClick: () => {
emit('dismisClick', props.mouseOverTask.id) emit('dismisClick', props.mouseOverTask.id)
}, },
}) })
popconfirmRef.value[0]?.setShow(false) // popconfirm popconfirmRef.value[0]?.setShow(false) // popconfirm
} }
watch(() => props.mouseOverTask, (value) => {
console.log(props)
})
onMounted(async () => { onMounted(async () => {})
})
</script> </script>
<template> <template>
<div ref="popconfirmTarget" class="list-item relative" :class="{ 'list-item-selected': selected, 'h200': showFieldList?.length > 5 && !showFull }"> <div
ref="popconfirmTarget"
class="list-item relative"
:class="{
'list-item-selected': selected,
'h200': showFieldList?.length > 5 && !showFull,
}"
>
<div v-for="(item, index) in showFieldList" :key="index"> <div v-for="(item, index) in showFieldList" :key="index">
<div v-if="item.id === 'name'" class="list-item-header"> <div v-if="item.id === 'name'" class="list-item-header">
<div class="id-wrap"> <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
<n-ellipsis style="max-width: 180px"> class="list-item-header-name"
#{{ listItem.name }} :class="{ 'list-item-header-selected': selected }"
</n-ellipsis> >
<n-ellipsis style="max-width: 180px"> #{{ listItem.name }} </n-ellipsis>
<span class="list-item-header-selected">({{ listItem.pictureCount }})</span> <span class="list-item-header-selected">({{ listItem.pictureCount }})</span>
<n-popconfirm <n-popconfirm
id="taskPopconfirmRef" ref="popconfirmRef" :show-icon="false" :show-arrow="false" id="taskPopconfirmRef"
placement="bottom" trigger="click" ref="popconfirmRef"
:show-icon="false"
:show-arrow="false"
placement="bottom"
trigger="click"
> >
<template #trigger> <template #trigger>
<span
<span v-show="mouseOverTask?.id === listItem.id" class="dismiss-task-pack" style="cursor: pointer;">...</span> v-show="mouseOverTask?.id === listItem.id"
class="dismiss-task-pack"
style="cursor: pointer"
>...</span>
</template> </template>
<template #action> <template #action>
<span style="cursor: pointer;" @click="handleDismissTask"></span> <span style="cursor: pointer" @click="handleDismissTask"></span>
</template> </template>
</n-popconfirm> </n-popconfirm>
</span> </span>
@ -95,48 +105,68 @@ onMounted(async () => {
<li v-if="item.id === 'statshisText'"> <li v-if="item.id === 'statshisText'">
审批状态<n-ellipsis style="max-width: 170px"> 审批状态<n-ellipsis style="max-width: 170px">
<span <span
class="list-item-status" :class="listItem.statshisText === '通过' class="list-item-status"
? 'list-item-success' :class="
: listItem.statshisText === '不通过' listItem.statshisText === '通过'
? 'list-item-error' ? 'list-item-success'
: 'list-item-watting' : listItem.statshisText === '不通过'
? 'list-item-error'
: 'list-item-watting'
" "
>{{ listItem.statshisText }}</span> >{{ listItem.statshisText }}</span>
</n-ellipsis> </n-ellipsis>
</li> </li>
<li v-else-if="item.id === 'createdate'"> <li v-else-if="item.id === 'createdate'">
提交时间<n-ellipsis style="max-width: 170px"> 提交时间<n-ellipsis style="max-width: 170px">
{{ listItem.createdate && format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") || '全部' }} {{
(listItem.createdate
&& format(listItem.createdate, "yyyy-MM-dd HH:mm:ss"))
|| "全部"
}}
</n-ellipsis> </n-ellipsis>
</li> </li>
<li v-else-if="item.id === 'createTime'"> <li v-else-if="item.id === 'createTime'">
生成时间<n-ellipsis style="max-width: 170px"> 生成时间<n-ellipsis style="max-width: 170px">
{{ listItem.createTime && format(listItem.createTime, "yyyy-MM-dd HH:mm:ss") || '全部' }} {{
(listItem.createTime
&& format(listItem.createTime, "yyyy-MM-dd HH:mm:ss"))
|| "全部"
}}
</n-ellipsis> </n-ellipsis>
</li> </li>
<li v-else-if="item.id === 'submit_date_timestamp'"> <li v-else-if="item.id === 'submit_date_timestamp'">
筛选日期<n-ellipsis style="max-width: 170px"> 筛选日期<n-ellipsis style="max-width: 170px">
<!-- {{ listItem.submit_date_timestamp && format(listItem.submit_date_timestamp.split('-')[0], "yyyy年MM月dd日") || '全部' }} --> <!-- {{ listItem.submit_date_timestamp && format(listItem.submit_date_timestamp.split('-')[0], "yyyy年MM月dd日") || '全部' }} -->
{{ listItem.submit_date_timestamp && format(new Date(listItem.submit_date_timestamp?.split('-')[0]), "yyyy年MM月dd日") }} {{
listItem.submit_date_timestamp
&& format(
new Date(listItem.submit_date_timestamp?.split("-")[0]),
"yyyy年MM月dd日",
)
}}
{{ listItem.submit_date_timestamp && format(new Date(listItem.submit_date_timestamp?.split('-')[1]), "yyyy年MM月dd日") }} {{
listItem.submit_date_timestamp
&& format(
new Date(listItem.submit_date_timestamp?.split("-")[1]),
"yyyy年MM月dd日",
)
}}
</n-ellipsis> </n-ellipsis>
</li> </li>
<li v-else class="ellipsis"> <li v-else class="ellipsis">
<span class="label">{{ item.name }}</span><n-ellipsis style="max-width: 170px"> <span class="label">{{ item.name }}</span><n-ellipsis style="max-width: 170px">
{{ listItem[item.id] || '全部' }} {{ listItem[item.id] || "全部" }}
</n-ellipsis> </n-ellipsis>
</li> </li>
</ul> </ul>
</div> </div>
<template <template v-if="showFieldList?.length > 5">
v-if="showFieldList?.length > 5"
>
<div class="absolute bottom-0 py-[8px] pl-[36px] text-[#666] item-action"> <div class="absolute bottom-0 py-[8px] pl-[36px] text-[#666] item-action">
<span class="cursor-pointer" @click.stop="showFull = !showFull"> <span class="cursor-pointer" @click.stop="showFull = !showFull">
<SvgIcon style="margin-left: 6px" name="expand" size="16" /> <SvgIcon v-if="showFull" style="margin-left: 6px" name="expand" size="16" />
<SvgIcon style="margin-left: 6px" name="collapse" size="16" /> <SvgIcon v-else style="margin-left: 6px" name="collapse" size="16" />
{{ showFull ? '收起' : '展开' }} {{ showFull ? "收起" : "展开" }}
</span> </span>
</div> </div>
</template> </template>
@ -162,8 +192,8 @@ onMounted(async () => {
padding: 10px 0px 10px 8px; padding: 10px 0px 10px 8px;
position: relative; position: relative;
border-bottom: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8;
// · transition: height: 0.2s ease-out; // · transition: height: 0.2s ease-out;
// transform: ; // transform: ;
&.h200 { &.h200 {
height: 206px; height: 206px;
overflow: hidden; overflow: hidden;
@ -175,7 +205,7 @@ onMounted(async () => {
.id-wrap { .id-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 6px margin-bottom: 6px;
} }
.dismiss-task-pack { .dismiss-task-pack {
@ -210,7 +240,7 @@ onMounted(async () => {
line-height: 22px; line-height: 22px;
margin: 0px 0px 8px 8px; margin: 0px 0px 8px 8px;
} }
/*j*/ /*j*/
&-selected { &-selected {
color: #507afd !important; color: #507afd !important;
} }
@ -223,7 +253,6 @@ onMounted(async () => {
background-color: #f2f5fe; background-color: #f2f5fe;
.item-action { .item-action {
background-color: #f2f5fe; background-color: #f2f5fe;
} }
} }

@ -1,6 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { audit } from '@/api/task/task' import { audit } from '@/api/task/task'
import { getPictureSimilarityList, getTaskDetailInfo } from '@/api/work/work' import {
dubiousfileyd,
getPictureSimilarityList,
getTaskDetailInfo,
} from '@/api/work/work'
import NotPassed from '@/components/Approval/NotPassed.vue' import NotPassed from '@/components/Approval/NotPassed.vue'
import { TASK_STATUS_OBJ } from '@/enums/index' import { TASK_STATUS_OBJ } from '@/enums/index'
import { useWorkOrder } from '@/store/modules/workOrder' import { useWorkOrder } from '@/store/modules/workOrder'
@ -12,7 +16,7 @@ import { useInfiniteScroll } from '@vueuse/core'
import { format } from 'date-fns' import { format } from 'date-fns'
import imagesloaded from 'imagesloaded' import imagesloaded from 'imagesloaded'
import { clone, cloneDeep, debounce, pickBy } from 'lodash-es' import { clone, cloneDeep, debounce, pickBy } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui' import { useDialog, useMessage, useModal } from 'naive-ui'
import { import {
computed, computed,
onMounted, onMounted,
@ -33,6 +37,7 @@ const message = useMessage()
const dialog = useDialog() const dialog = useDialog()
const totalCount = ref(0) const totalCount = ref(0)
let _imagesload: any let _imagesload: any
const modal = useModal()
function setBatch(value: boolean) { function setBatch(value: boolean) {
if (value && batch.value) if (value && batch.value)
@ -82,7 +87,13 @@ const mainImageModalRef = ref(null)
const wrapperListRef = ref<HTMLElement | undefined>(undefined) const wrapperListRef = ref<HTMLElement | undefined>(undefined)
let canloadMore = true let canloadMore = true
let processItems: any[] = [] let processItems: any[] = []
//
const passDialog = ref(false)
//
const rejectDialog = ref(false)
let keyPlastKeyTime = 0
let keyXLastTime = 0
// let keyPressTimer
function validate(items: any[]) { function validate(items: any[]) {
if (items.length === 0) if (items.length === 0)
return '至少选中一个任务' return '至少选中一个任务'
@ -150,7 +161,7 @@ async function featchList() {
totalCount.value = total totalCount.value = total
canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0 canloadMore = pageCount >= taskpagination.pageNo && pageCount > 0
console.log(data, 'dataaaaaaaaaa')
return data return data
} }
catch (error) { catch (error) {
@ -270,9 +281,52 @@ function overTaskHandelr(item: any) {
function leaveTaskHandler() { function leaveTaskHandler() {
overTask.value = null overTask.value = null
} }
function onEsc() { function onEsc(event) {
if (isFullScreen.value && !document.querySelector('.n-modal-container')) const eles = ['INPUT', 'TEXTAREA']
isFullScreen.value = false const keys = ['KeyC', 'KeyP', 'KeyX']
const code = event.code
if (eles.includes(event.target.targName))
return
if (!keys.includes(event.code))
return
if (event.code === 'KeyC') {
if (isFullScreen.value && !document.querySelector('.n-modal-container')) {
isFullScreen.value = false
}
else {
const notPassModal = unref(notPassModalRef)! as any
const mainImageModal = unref(mainImageModalRef)! as any
const confrimModal = unref(confrimModalRef)! as any
mainImageModal.closeModal(false)
confrimModal.closeModal(false)
notPassModal.closeModal(false)
}
}
//
if (rejectDialog.value || passDialog.value)
return
// p
if (code === 'KeyP') {
const currentTime = Date.now()
if (currentTime - keyPlastKeyTime < 500) {
handleApproveMainImage()
keyPlastKeyTime = 0
}
else {
keyPlastKeyTime = currentTime
}
}
// x
if (code === 'KeyX') {
console.log('keyx')
const currentKTime = Date.now()
console.log(currentKTime - keyXLastTime)
if (currentKTime - keyXLastTime < 500)
handleRejectMainImage()
else keyXLastTime = currentKTime
}
// console.log('keyp')
} }
function resizeImage() { function resizeImage() {
@ -298,8 +352,8 @@ function immersionHandler() {
function showAction() { function showAction() {
const item = taskDetailInfo.value const item = taskDetailInfo.value
if (item.historyStates === 2 || item.historyStates === 3) // if (item.historyStates === 2 || item.historyStates === 3)
return // return
if (batch.value === false) if (batch.value === false)
overTask.value = item overTask.value = item
@ -351,9 +405,12 @@ async function reloadDetailInfo() {
taskDetailInfo.value = await getTaskDetailInfo(packageid) taskDetailInfo.value = await getTaskDetailInfo(packageid)
} }
function handleApproveMainImage(items?: any) { function handleApproveMainImage(items?: any) {
const currentValue = overTask.value || taskDetailInfo.value
if (currentValue.historyStates !== 1)
return
let cloneItem: any let cloneItem: any
if (overTask.value) { if (currentValue) {
cloneItem = clone(overTask.value) cloneItem = clone(currentValue)
cloneItem.id = cloneItem.taskchildpictureid cloneItem.id = cloneItem.taskchildpictureid
processItems = [cloneItem] processItems = [cloneItem]
} }
@ -381,13 +438,14 @@ function handleApproveMainImage(items?: any) {
failCauseName: '', failCauseName: '',
flowTaskInfoList: list, flowTaskInfoList: list,
} }
passDialog.value = true
dialog.info({ dialog.info({
title: '确认提示', title: '确认提示',
content: '确认给该任务审批为【通过】吗?', content: '确认给该任务审批为【通过】吗?',
positiveText: '确定', positiveText: '确定',
negativeText: '取消', negativeText: '取消',
onPositiveClick: () => { onPositiveClick: () => {
passDialog.value = false
audit(param).then(async (res) => { audit(param).then(async (res) => {
const { code } = res const { code } = res
if (code === 'OK') { if (code === 'OK') {
@ -400,7 +458,9 @@ function handleApproveMainImage(items?: any) {
} }
}) })
}, },
onNegativeClick: () => {}, onNegativeClick: () => {
passDialog.value = false
},
}) })
} }
function approvalHandler(items?: any) { function approvalHandler(items?: any) {
@ -473,28 +533,24 @@ function reloadList() {
setBatch(false) setBatch(false)
refreshHandler() refreshHandler()
} }
function handleRejectdubiousfileyd() { function handleRejectdubiousfileyd(pictureid) {
dialog.info({ dialog.info({
title: '确认提示', title: '确认提示',
content: '确认将图片移入可疑文件夹吗?', content: '确认将图片移入可疑文件夹吗?',
positiveText: '确定', positiveText: '确定',
negativeText: '取消', negativeText: '取消',
onPositiveClick: () => { onPositiveClick: () => {
audit(param).then(async (res) => { dubiousfileyd(pictureid).then(() => {
const { code } = res refreshHandler()
if (code === 'OK') {
dubiousfileyd(taskDetailInfo.value.pictureId).then(() => {
refreshHandler()
})
}
else {
message.error(res.message)
}
}) })
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}) })
} }
//
function onRejectDialog(visible) {
rejectDialog.value = visible
}
defineExpose({ defineExpose({
queryDetail, queryDetail,
}) })
@ -655,10 +711,9 @@ defineExpose({
@click.stop="handleRejectMainImage" @click.stop="handleRejectMainImage"
/> />
<SvgIcon <SvgIcon
v-if="[1, 2, 3].includes(taskDetailInfo.historyStates)"
style="cursor: pointer; margin-left: 30px" style="cursor: pointer; margin-left: 30px"
name="t9" name="t9"
@click.stop="handleRejectdubiousfileyd" @click.stop="handleRejectdubiousfileyd(taskDetailInfo.id)"
/> />
</div> </div>
</div> </div>
@ -761,7 +816,7 @@ defineExpose({
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
</div> </div>
<div class="percent" :class="{ 'percent-red': item?.maxSimilarity >= 100 }"> <div class="percent">
<SvgIcon <SvgIcon
size="42" size="42"
:name="Number(item.maxSimilarity) === 100 ? 'error_tag' : 'tag'" :name="Number(item.maxSimilarity) === 100 ? 'error_tag' : 'tag'"
@ -794,45 +849,31 @@ defineExpose({
<SvgIcon <SvgIcon
style="cursor: pointer; margin-left: 30px" style="cursor: pointer; margin-left: 30px"
name="t9" name="t9"
@click.stop="handleRejectdubiousfileyd" @click.stop="handleRejectdubiousfileyd(item.pictureid)"
/> />
</div> </div>
<n-back-top
:listen-to="wrapperListRef"
:bottom="220"
:visibility-height="10"
style="height: 64px; width: 64px; border-radius: 32px"
>
<div
style="
width: 64px;
height: 64px;
/* line-height: 40px; */
text-align: center;
font-size: 14px;
position: relative;
"
>
<svg-icon
name="top"
style="
width: 84px;
height: 84px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
"
/>
</div>
</n-back-top>
</div> </div>
<n-back-top :listen-to="wrapperListRef" :bottom="220" :visibility-height="10">
<svg-icon
name="top"
style="
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
"
/>
</n-back-top>
</div> </div>
</div> </div>
</n-spin> </n-spin>
<ConfrimModal ref="confrimModalRef" @commit="reject" /> <ConfrimModal ref="confrimModalRef" @commit="reject" />
<NotPassed ref="notPassModalRef" @success="reloadList" /> <NotPassed ref="notPassModalRef" @success="reloadList" />
<NotPassed ref="mainImageModalRef" @success="reloadDetailInfo" /> <NotPassed
ref="mainImageModalRef"
@show="onRejectDialog"
@success="reloadDetailInfo"
/>
</div> </div>
</template> </template>

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useDictionary } from '@/store/modules/dictonary'; import { computed, onBeforeMount, ref, unref } from 'vue'
import { computed, onBeforeMount, ref, unref } from 'vue'; import { useDictionary } from '@/store/modules/dictonary'
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'commit', rejectId: any, backId: any, isOther: boolean) (e: 'commit', rejectId: any, backId: any, isOther: boolean)
@ -25,6 +25,7 @@ function closeModal() {
defineExpose({ defineExpose({
showModal, showModal,
closeModal,
}) })
const backOptions = ref<any[]>([]) const backOptions = ref<any[]>([])
@ -38,7 +39,9 @@ const showOther = computed(() => {
}) })
const comomitValue = computed(() => { const comomitValue = computed(() => {
return (selectItem.value as any)?.label === '其他' ? otherValue.value : selectRejectId.value return (selectItem.value as any)?.label === '其他'
? otherValue.value
: selectRejectId.value
}) })
async function handleSumbit(e: MouseEvent) { async function handleSumbit(e: MouseEvent) {
@ -63,18 +66,21 @@ onBeforeMount(async () => {
// }) // })
}) })
async function selectChange(id){ async function selectChange(id) {
console.log(id,'selectChange') console.log(id, 'selectChange')
selectItem.value = reasonOptions.value.find(v=>v.id == id); selectItem.value = reasonOptions.value.find(v => v.id == id)
} }
</script> </script>
<template> <template>
<n-modal v-model:show="show" transform-origin="center"> <n-modal v-model:show="show" transform-origin="center">
<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>
@ -86,29 +92,43 @@ async function selectChange(id){
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<span>处理方式</span> <span>处理方式</span>
<n-select filterable v-model:value="selectBackId" style="margin-top: 10px;" :options="backOptions" /> <n-select
v-model:value="selectBackId"
filterable
style="margin-top: 10px"
:options="backOptions"
/>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<span>不通过原因</span> <span>不通过原因</span>
<n-select filterable v-model:value="selectRejectId" @change="selectChange" style="margin-top: 10px;" :options="reasonOptions" /> <n-select
<n-input v-show="showOther" v-model:value="otherValue" type="textarea" placeholder="备注内容" style="margin-top: 10px;" /> v-model:value="selectRejectId"
filterable
style="margin-top: 10px"
:options="reasonOptions"
@change="selectChange"
/>
<n-input
v-show="showOther"
v-model:value="otherValue"
type="textarea"
placeholder="备注内容"
style="margin-top: 10px"
/>
</div> </div>
<!-- <div class="wrapper-content"> <!-- <div class="wrapper-content">
<n-input <n-input
type="textarea" type="textarea"
placeholder="备注内容" v-model="showOther"></n-input> placeholder="备注内容" v-model="showOther"></n-input>
</div> --> </div> -->
</div> </div>
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">
<n-button type="info" @click="handleSumbit"> <n-button type="info" @click="handleSumbit">
确认 确认
</n-button> </n-button>
<n-button secondary style="margin-left:15px" @click="closeModal"> <n-button secondary style="margin-left: 15px" @click="closeModal">
取消 取消
</n-button> </n-button>
</div> </div>
@ -148,7 +168,7 @@ async function selectChange(id){
margin-bottom: 8px; margin-bottom: 8px;
&:after { &:after {
content: ''; content: "";
display: block; display: block;
width: 18px; width: 18px;
height: 1px; height: 1px;
@ -174,7 +194,7 @@ async function selectChange(id){
&:before { &:before {
background-color: #1980ff; background-color: #1980ff;
content: ''; content: "";
width: 5px; width: 5px;
border-radius: 2px; border-radius: 2px;
top: 0; top: 0;

@ -26,11 +26,10 @@ const fixList = ref<any[]>([])
const searchKey = ref('') const searchKey = ref('')
const searchFixVal = ref('') const searchFixVal = ref('')
const allCount = computed(() => { const allCount = computed(() => {
return `全部字段(共${offList.value.length - 1}个)` return `全部字段(共${offList.value.length}个)`
}) })
const showOffList = computed(() => { const showOffList = computed(() => {
return offList.value.filter((i) => { return offList.value.filter((i) => {
console.log(i.name, searchKey.value, 'i.name.includes(searchKey.value)')
return i.name.includes(searchKey.value) return i.name.includes(searchKey.value)
}) })
}) })
@ -79,7 +78,6 @@ function generatList() {
onList.value = showList onList.value = showList
offList.value = hideList offList.value = hideList
console.log(offList.value, 'console.log(offList.value)')
return { showList, hideList } return { showList, hideList }
} }
@ -172,7 +170,16 @@ const showIds = computed(() => {
return item.id return item.id
}) })
}) })
//
watch(
() => show,
(val) => {
if (!val) {
searchKey.value = ''
searchFixVal.value = ''
}
},
)
watch( watch(
() => selectIds.value.length, () => selectIds.value.length,
(newVal, oldVal) => { (newVal, oldVal) => {
@ -290,8 +297,7 @@ async function getData() {
} }
if (item.fix) if (item.fix)
fixList.value.push(item) fixList.value.push(item)
else else offList.value.push(item)
offList.value.push(item)
}) })
offList.value.unshift(...fixList.value) offList.value.unshift(...fixList.value)
useList.userFieldFixed?.split(',').map((v) => { useList.userFieldFixed?.split(',').map((v) => {
@ -320,10 +326,7 @@ const indeterminate = computed(() => {
if (v.fix) if (v.fix)
baseNum += 1 baseNum += 1
}) })
return ( return onList.value.length > 0 && offList.value.length - baseNum > onList.value.length
onList.value.length > 0
&& offList.value.length - baseNum > onList.value.length
)
}) })
</script> </script>
@ -337,7 +340,7 @@ const indeterminate = computed(() => {
aria-modal="true" aria-modal="true"
> >
<div class="wrapper"> <div class="wrapper">
<span class="wrapper-title" style="color: #333;">自定义任务包字段</span> <span class="wrapper-title" style="color: #333">自定义任务包字段</span>
<div class="wrapper-bar"> <div class="wrapper-bar">
<div class="wrapper-info"> <div class="wrapper-info">
<span :style="{ 'margin-left': '18px' }">字段信息</span> <span :style="{ 'margin-left': '18px' }">字段信息</span>
@ -411,7 +414,7 @@ const indeterminate = computed(() => {
:class="{ fix: item.fix }" :class="{ fix: item.fix }"
class="cursor-move draggable-item" class="cursor-move draggable-item"
> >
<span class="ml-2" style="color: #666;">{{ item.name }}</span> <span class="ml-2" style="color: #666">{{ item.name }}</span>
</div> </div>
</div> </div>
<VueDraggable <VueDraggable
@ -444,10 +447,17 @@ const indeterminate = computed(() => {
</div> </div>
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">
<n-button type="info" style="background-color: #507AFD;" @click="handleSumbit"> <n-button type="info" style="background-color: #507afd" @click="handleSumbit">
确定 确定
</n-button> </n-button>
<n-button secondary style="margin-left: 15px" @click="getData();closeModal();"> <n-button
secondary
style="margin-left: 15px"
@click="
getData();
closeModal();
"
>
取消 取消
</n-button> </n-button>
</div> </div>
@ -485,7 +495,7 @@ const indeterminate = computed(() => {
font-size: 14px; font-size: 14px;
&:before { &:before {
background-color: #507AFD; background-color: #507afd;
content: ""; content: "";
width: 5px; width: 5px;
border-radius: 2px; border-radius: 2px;
@ -575,7 +585,7 @@ const indeterminate = computed(() => {
::v-deep(.checkAll .n-checkbox-icon svg) { ::v-deep(.checkAll .n-checkbox-icon svg) {
display: none !important; display: none !important;
} }
::v-deep(.n-card-header__main){ ::v-deep(.n-card-header__main) {
color: #666 !important; color: #666 !important;
} }
::v-deep(.n-button--secondary) { ::v-deep(.n-button--secondary) {

Loading…
Cancel
Save