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,
taskname: item.fromTaskName,
assignee: item.assignee,
pictureid: item.pictureid,
pictureid: item.pictureid || item.pictureId,
imgurl: item.serverThumbnailUrl,
maxSimilarity: item.maxSimilarity,
thumburl: item.ocrPicture?.serverThumbnailUrl || item.ocrPicture?.imgurl,

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

@ -33,6 +33,7 @@ function closeModal() {
defineExpose({
showModal,
closeModal,
})
const backOptions = ref<any[]>([])
@ -46,7 +47,9 @@ const showOther = 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) {
@ -94,7 +97,13 @@ async function selectChange(id) {
<template>
<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-header">
<span class="wrapper-left">选择不通过原因</span>
@ -106,12 +115,29 @@ async function selectChange(id) {
</div>
<div class="wrapper-content">
<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 class="wrapper-content">
<span>不通过原因</span>
<n-select 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;" />
<n-select
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 class="wrapper-content">
@ -125,7 +151,7 @@ async function selectChange(id) {
<n-button type="info" @click="handleSumbit">
确认
</n-button>
<n-button secondary style="margin-left:15px" @click="closeModal">
<n-button secondary style="margin-left: 15px" @click="closeModal">
取消
</n-button>
</div>
@ -165,7 +191,7 @@ async function selectChange(id) {
margin-bottom: 8px;
&:after {
content: '';
content: "";
display: block;
width: 18px;
height: 1px;
@ -191,7 +217,7 @@ async function selectChange(id) {
&:before {
background-color: #1980ff;
content: '';
content: "";
width: 5px;
border-radius: 2px;
top: 0;

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

@ -14,11 +14,15 @@ defineExpose({
<template>
<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" />
</n-modal>
</div>
</template>
<style scoped lang="less">
</style>
<style scoped lang="less"></style>

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

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

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

@ -1,5 +1,5 @@
<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'
const emit = defineEmits<{
@ -25,6 +25,7 @@ function closeModal() {
defineExpose({
showModal,
closeModal,
})
const backOptions = ref<any[]>([])
@ -38,7 +39,9 @@ const showOther = 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) {
@ -62,19 +65,27 @@ onBeforeMount(async () => {
// value: 'other',
// })
})
async function selectChange(id){
console.log(id,'selectChange')
selectItem.value = reasonOptions.value.find(v=>v.id == id);
watch(
() => show,
(value) => {
console.log(value)
},
)
async function selectChange(id) {
console.log(id, 'selectChange')
selectItem.value = reasonOptions.value.find(v => v.id == id)
}
</script>
<template>
<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-header">
<span class="wrapper-left">选择不通过原因</span>
@ -86,29 +97,43 @@ async function selectChange(id){
</div>
<div class="wrapper-content">
<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 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;" />
<n-select
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 class="wrapper-content">
<n-input
type="textarea"
placeholder="备注内容" v-model="showOther"></n-input>
</div> -->
</div>
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="handleSumbit">
确认
</n-button>
<n-button secondary style="margin-left:15px" @click="closeModal">
<n-button secondary style="margin-left: 15px" @click="closeModal">
取消
</n-button>
</div>
@ -148,7 +173,7 @@ async function selectChange(id){
margin-bottom: 8px;
&:after {
content: '';
content: "";
display: block;
width: 18px;
height: 1px;
@ -174,7 +199,7 @@ async function selectChange(id){
&:before {
background-color: #1980ff;
content: '';
content: "";
width: 5px;
border-radius: 2px;
top: 0;

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

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

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

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

@ -1,6 +1,6 @@
<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<{
(e: 'commit', rejectId: any, backId: any, isOther: boolean)
@ -25,6 +25,7 @@ function closeModal() {
defineExpose({
showModal,
closeModal,
})
const backOptions = ref<any[]>([])
@ -38,7 +39,9 @@ const showOther = 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) {
@ -63,18 +66,21 @@ onBeforeMount(async () => {
// })
})
async function selectChange(id){
console.log(id,'selectChange')
selectItem.value = reasonOptions.value.find(v=>v.id == id);
async function selectChange(id) {
console.log(id, 'selectChange')
selectItem.value = reasonOptions.value.find(v => v.id == id)
}
</script>
<template>
<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-header">
<span class="wrapper-left">选择不通过原因</span>
@ -86,29 +92,43 @@ async function selectChange(id){
</div>
<div class="wrapper-content">
<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 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;" />
<n-select
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 class="wrapper-content">
<n-input
type="textarea"
placeholder="备注内容" v-model="showOther"></n-input>
</div> -->
</div>
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="handleSumbit">
确认
</n-button>
<n-button secondary style="margin-left:15px" @click="closeModal">
<n-button secondary style="margin-left: 15px" @click="closeModal">
取消
</n-button>
</div>
@ -148,7 +168,7 @@ async function selectChange(id){
margin-bottom: 8px;
&:after {
content: '';
content: "";
display: block;
width: 18px;
height: 1px;
@ -174,7 +194,7 @@ async function selectChange(id){
&:before {
background-color: #1980ff;
content: '';
content: "";
width: 5px;
border-radius: 2px;
top: 0;

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

Loading…
Cancel
Save