feat: 修改冲突

pull/25/head
raofuzi 2 years ago
commit 1154bcf325

@ -23,7 +23,7 @@ const adminInfo = {
value: 'task-main', value: 'task-main',
}, },
{ {
label: 'AI工单', label: '图审审批管理',
value: 'worksheet-main', value: 'worksheet-main',
}, },
], ],

@ -180,6 +180,19 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
params params
}) })
} }
/**
*
* @param
* @returns
*/
export async function deletePackage(params) {
return http.request({
url: `/ocr/ocrTaskPackage/deletePackage`,
method: 'get',
params
})
}
/** /**
* *
* @param * @param

@ -7,11 +7,15 @@ import { ContentTypeEnum } from '@/enums/httpEnum'
* *
* @returns * @returns
*/ */
export async function getApprovalList(page: PageParam) { export async function getApprovalList(page: any) {
const res = await http.request({ const res = await http.request({
url: `/flow/task/listalldata`, url: `/flow/task/listalldata`,
method: 'get', method: 'get',
params: { pageSize: page.pageSize, currPage: page.pageNo }, params: {
pageSize: page.pageSize,
currPage: page.pageNo,
keyword: page.keyword,
},
}) })
const { data: { list, totalCount } } = res const { data: { list, totalCount } } = res

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="64px" height="64px" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>自定义列</title>
<defs>
<rect id="path-1" x="0" y="0" width="64" height="64"></rect>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="PrevailCloud-Design-图标集" transform="translate(-1986.000000, -6758.000000)">
<g id="自定义列" transform="translate(1986.000000, 6758.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="蒙版"></g>
<path d="M36.9854854,42.6064492 C37.5377701,42.6064492 37.9854854,43.0541645 37.9854854,43.6064492 L37.9854854,56 C37.9854854,56.5522847 37.5377701,57 36.9854854,57 L33.9854854,57 C33.4332006,57 32.9854854,56.5522847 32.9854854,56 L32.985,52.303 L7,52.3032246 C6.44771525,52.3032246 6,51.8555094 6,51.3032246 L6,48.3032246 C6,47.7509399 6.44771525,47.3032246 7,47.3032246 L32.985,47.303 L32.9854854,43.6064492 C32.9854854,43.0541645 33.4332006,42.6064492 33.9854854,42.6064492 L36.9854854,42.6064492 Z M54.4637884,47.3032246 C55.0160731,47.3032246 55.4637884,47.7509399 55.4637884,48.3032246 L55.4637884,51.3032246 C55.4637884,51.8555094 55.0160731,52.3032246 54.4637884,52.3032246 L44.6371044,52.3032246 C44.0848196,52.3032246 43.6371044,51.8555094 43.6371044,51.3032246 L43.6371044,48.3032246 C43.6371044,47.7509399 44.0848196,47.3032246 44.6371044,47.3032246 L54.4637884,47.3032246 Z M29.8824782,24.8032246 C30.4347629,24.8032246 30.8824782,25.2509399 30.8824782,25.8032246 L30.882,29.5 L57,29.5 C57.5522847,29.5 58,29.9477153 58,30.5 L58,33.5 C58,34.0522847 57.5522847,34.5 57,34.5 L30.882,34.5 L30.8824782,38.1967754 C30.8824782,38.7490601 30.4347629,39.1967754 29.8824782,39.1967754 L26.8824782,39.1967754 C26.3301934,39.1967754 25.8824782,38.7490601 25.8824782,38.1967754 L25.8824782,25.8032246 C25.8824782,25.2509399 26.3301934,24.8032246 26.8824782,24.8032246 L29.8824782,24.8032246 Z M19.2308592,29.5 C19.7831439,29.5 20.2308592,29.9477153 20.2308592,30.5 L20.2308592,33.5 C20.2308592,34.0522847 19.7831439,34.5 19.2308592,34.5 L7,34.5 C6.44771525,34.5 6,34.0522847 6,33.5 L6,30.5 C6,29.9477153 6.44771525,29.5 7,29.5 L19.2308592,29.5 Z M36.9854854,7 C37.5377701,7 37.9854854,7.44771525 37.9854854,8 L37.9854854,20.3935508 C37.9854854,20.9458355 37.5377701,21.3935508 36.9854854,21.3935508 L33.9854854,21.3935508 C33.4332006,21.3935508 32.9854854,20.9458355 32.9854854,20.3935508 L32.985,16.696 L7,16.6967754 C6.44771525,16.6967754 6,16.2490601 6,15.6967754 L6,12.6967754 C6,12.1444906 6.44771525,11.6967754 7,11.6967754 L32.985,11.696 L32.9854854,8 C32.9854854,7.44771525 33.4332006,7 33.9854854,7 L36.9854854,7 Z M54.4637884,11.6967754 C55.0160731,11.6967754 55.4637884,12.1444906 55.4637884,12.6967754 L55.4637884,15.6967754 C55.4637884,16.2490601 55.0160731,16.6967754 54.4637884,16.6967754 L44.6371044,16.6967754 C44.0848196,16.6967754 43.6371044,16.2490601 43.6371044,15.6967754 L43.6371044,12.6967754 C43.6371044,12.1444906 44.0848196,11.6967754 44.6371044,11.6967754 L54.4637884,11.6967754 Z" id="形状结合" fill="#666666" fill-rule="nonzero" mask="url(#mask-2)"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>沉浸模式-开启</title>
<g id="图审审批" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="沉浸模式1.1" transform="translate(-1375.000000, -32.000000)" fill-rule="nonzero">
<g id="更多操作" transform="translate(1370.000000, 27.000000)">
<g id="沉浸模式-开启" transform="translate(5.000000, 5.000000)">
<polygon id="路径" fill-opacity="0" fill="#FFFFFF" points="0 0 20 0 20 20 0 20"></polygon>
<g id="编组" transform="translate(2.000000, 2.000000)" fill="#507AFD">
<path d="M8,16 C3.59999999,16 0,12.4444444 0,8.09876544 C0,6.22222223 0.700000007,4.34567902 2,2.86419753 C2.40000001,2.4691358 3,2.37037037 3.4,2.76543209 C3.8,3.16049383 3.89999999,3.75308642 3.5,4.14814814 C2.5,5.23456791 2,6.61728395 2,8.09876544 C2,11.3580247 4.70000001,14.0246914 8,14.0246914 C11.3,14.0246914 14,11.3580247 14,8.09876544 C14,6.61728395 13.5,5.23456791 12.5,4.14814816 C12.1,3.75308642 12.2,3.16049383 12.6,2.76543211 C13,2.37037037 13.6,2.46913581 14,2.86419755 C15.3,4.34567903 16,6.12345681 16,8.09876545 C16,12.4444444 12.4,16 8,16 Z" id="路径"></path>
<path d="M8.99999999,5.92592592 C8.99999999,6.41975308 8.6,6.91358025 7.99999999,6.91358025 L7.99999999,6.91358025 C7.4,6.91358025 6.99999999,6.51851852 6.99999999,5.92592592 L6.99999999,0.987654328 C6.99999999,0.493827172 7.4,0 7.99999999,0 L7.99999999,0 C8.49999999,0 8.99999999,0.395061734 8.99999999,0.987654328 L8.99999999,5.92592592 Z" id="路径"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -4,9 +4,7 @@ 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<{ const emit = defineEmits(['success'])
(e: 'success')
}>()
const message = useMessage() const message = useMessage()
const loading = ref(false) const loading = ref(false)
@ -32,8 +30,8 @@ const rules = {
} }
const formData = reactive({ const formData = reactive({
disposeTypeId: '', disposeTypeId: '262403670085013522',
failCauseId: '', failCauseId: '260402999231251188',
comment: '', comment: '',
}) })
@ -104,7 +102,7 @@ async function handleSumbit(e: MouseEvent) {
const { code } = res const { code } = res
if (code === 'OK') { if (code === 'OK') {
message.success('审核成功') message.success('审核成功')
emit('success') emit('success', param)
closeModal() closeModal()
} }
else { message.error(res.message) } else { message.error(res.message) }
@ -151,7 +149,7 @@ async function selectChange(id) {
<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" 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>
@ -159,9 +157,9 @@ async function selectChange(id) {
<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 class="btn" style="margin-left:15px" @click="closeModal">
取消 取消
</n-button> </n-button>
</div> </div>
@ -221,6 +219,7 @@ 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) {
@ -236,4 +235,13 @@ async function selectChange(id) {
margin-top: 0px; margin-top: 0px;
margin-bottom: 0px; margin-bottom: 0px;
} }
::v-deep(.n-input__placeholder) {
color: #333333!important;
}
.btn{
border: 1px solid #cad2dd;
background-color: #fff;
}
</style> </style>

@ -13,9 +13,9 @@ import { useUser } from '@/store/modules/user'
import { useTaskStore } from '@/store/modules/task' import { useTaskStore } from '@/store/modules/task'
import defaultAvatar from '@/assets/icons/avatar.svg'; import defaultAvatar from '@/assets/icons/avatar.svg';
const taskStore = useTaskStore() const taskStore = useTaskStore();
export default defineComponent({ export default defineComponent({
name: 'PageHeader', name: "PageHeader",
components: { components: {
UserSettings, UserSettings,
QuillModal, QuillModal,
@ -31,139 +31,137 @@ export default defineComponent({
type: Boolean, type: Boolean,
}, },
}, },
emits: ['update:collapsed'], emits: ["update:collapsed"],
setup() { setup() {
const message = useMessage() const message = useMessage();
const dialog = useDialog() const dialog = useDialog();
const userStore = useUser() const userStore = useUser();
const useInfo = userStore.getUserInfo const useInfo = userStore.getUserInfo;
const name = '' const name = "";
const state = reactive({ const state = reactive({
username: name ?? '', username: name ?? "",
fullscreenIcon: 'FullscreenOutlined', fullscreenIcon: "FullscreenOutlined",
}) });
const router = useRouter() const router = useRouter();
const route = useRoute() const route = useRoute();
const routename = ref(route.meta.title) const routename = ref(route.meta.title);
// mm // mm
const iconList = ref([ const iconList = ref([
{ {
icon: 'magnifying-1', icon: "magnifying-1",
handle: searchHandler, handle: searchHandler,
}, },
{ {
icon: 'shortcut-keys', icon: "shortcut-keys",
handle: shortcutHandler, handle: shortcutHandler,
}, },
{ {
icon: 'suspicious-folder', icon: "suspicious-folder",
handle: recycleHandler, handle: recycleHandler,
}, },
{ {
icon: 'memo', icon: "memo",
handle: quillHandler, handle: quillHandler,
}, },
{ {
icon: 'nomessage', icon: "nomessage",
handle: goMessage, handle: goMessage,
}, },
]) ]);
watch( watch(
() => route.fullPath, () => route.fullPath,
() => { () => {
routename.value = route.meta.title routename.value = route.meta.title;
}, }
) );
const handleDragOver = (event, item) => { const handleDragOver = (event, item) => {
taskStore.setInFile(true) taskStore.setInFile(true);
} };
const handleDragLeave = (event, item) => { const handleDragLeave = (event, item) => {
taskStore.setInFile(false) taskStore.setInFile(false);
} };
const dropdownSelect = (key) => { const dropdownSelect = (key) => {
router.push({ name: key }) router.push({ name: key });
} };
// 退 // 退
const doLogout = () => { const doLogout = () => {
dialog.info({ dialog.info({
title: '提示', title: "提示",
content: '您确定要退出登录吗', content: "您确定要退出登录吗",
positiveText: '确定', positiveText: "确定",
negativeText: '取消', negativeText: "取消",
onPositiveClick: () => { onPositiveClick: () => {
userStore.logout().then(() => { userStore.logout().then(() => {
message.success('成功退出登录') message.success("成功退出登录");
router router
.replace({ .replace({
name: 'Login', name: "Login",
query: { query: {
// redirect: route.fullPath, // redirect: route.fullPath,
}, },
}) })
.finally(() => location.reload()) .finally(() => location.reload());
}) });
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}) });
} };
const quillModalRef = ref(null) const quillModalRef = ref(null);
const shortcutModal = ref(null) const shortcutModal = ref(null);
const recycleModalRef = ref(null) const recycleModalRef = ref(null);
const SearchModalRef = ref(null) const SearchModalRef = ref(null);
function quillHandler() { function quillHandler() {
const modal = unref(quillModalRef)! as any const modal = unref(quillModalRef)! as any;
modal.showModal() modal.showModal();
} }
function shortcutHandler() { function shortcutHandler() {
const modal = unref(shortcutModal)! as any const modal = unref(shortcutModal)! as any;
modal.showModal() modal.showModal();
} }
function recycleHandler() { function recycleHandler() {
const modal = unref(recycleModalRef)! as any const modal = unref(recycleModalRef)! as any;
modal.showModal() modal.showModal();
} }
function searchHandler() { function searchHandler() {
const modal = unref(SearchModalRef)! as any const modal = unref(SearchModalRef)! as any;
modal.showModal() modal.showModal();
} }
function goMessage() { function goMessage() {
router.push({ name: 'message-main' }) router.push({ name: "message-main" });
} }
async function getMessage() { async function getMessage() {
const res = await msgPolling() const res = await msgPolling();
if (res.data) if (res.data) iconList.value[4].icon = "hasmessage";
iconList.value[4].icon = 'hasmessage' else iconList.value[4].icon = "nomessage";
else
iconList.value[4].icon = 'nomessage'
} }
setInterval(() => { setInterval(() => {
getMessage() getMessage();
}, 5000) }, 5000);
const mousetrap = inject('mousetrap') as any const mousetrap = inject("mousetrap") as any;
onMounted(() => { onMounted(() => {
mousetrap.bind('n r', quillHandler) getMessage();
mousetrap.bind('n t', quillHandler) mousetrap.bind("n r", quillHandler);
mousetrap.bind('n n', recycleHandler) mousetrap.bind("n t", quillHandler);
mousetrap.bind('m m', searchHandler) mousetrap.bind("n n", recycleHandler);
}) mousetrap.bind("m m", searchHandler);
});
const defaultAvatarSrc = ref(defaultAvatar); const defaultAvatarSrc = ref(defaultAvatar);
@ -189,7 +187,7 @@ export default defineComponent({
defaultAvatarSrc, defaultAvatarSrc,
} }
}, },
}) });
</script> </script>
<template> <template>
@ -211,8 +209,16 @@ export default defineComponent({
v-for="item in iconList" v-for="item in iconList"
:key="item.icon" :key="item.icon"
class="layout-header-trigger layout-header-trigger-min" class="layout-header-trigger layout-header-trigger-min"
@dragover.prevent="(e) => { handleDragOver(e, item) }" @dragover.prevent="
@dragleave.prevent="(e) => { handleDragLeave(e, item) }" (e) => {
handleDragOver(e, item);
}
"
@dragleave.prevent="
(e) => {
handleDragLeave(e, item);
}
"
> >
<div class="back" @click="item.handle"> <div class="back" @click="item.handle">
<SvgIcon :name="item.icon" size="18" /> <SvgIcon :name="item.icon" size="18" />
@ -331,9 +337,7 @@ export default defineComponent({
} }
.layout-header-left { .layout-header-left {
::v-deep( ::v-deep(.n-breadcrumb .n-breadcrumb-item:last-child .n-breadcrumb-item__link) {
.n-breadcrumb .n-breadcrumb-item:last-child .n-breadcrumb-item__link
) {
color: #515a6e; color: #515a6e;
} }
} }

@ -1,5 +1,5 @@
import type { RouteRecordRaw } from 'vue-router'
import { Layout } from '@/router/constant' import { Layout } from '@/router/constant'
import type { RouteRecordRaw } from 'vue-router'
/** /**
* @param name , , * @param name , ,
@ -19,7 +19,7 @@ const routes: Array<RouteRecordRaw> = [
redirect: '/worksheet', redirect: '/worksheet',
component: Layout, component: Layout,
meta: { meta: {
title: 'AI工单', 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: 'AI工单', title: '图审审批管理',
}, },
component: () => import('@/views/worksheet/index.vue'), component: () => import('@/views/worksheet/index.vue'),
}, },

@ -74,6 +74,7 @@ const columns: DataTableColumns<RowData> = [
{ {
title: "创建时间", title: "创建时间",
key: "createtime", key: "createtime",
sorter: (row1, row2) => new Date(row1?.createtime).getTime() - new Date(row2?.createtime).getTime()
}, },
{ {
title: "更新者", title: "更新者",
@ -146,32 +147,32 @@ function rowProps(row: RowData) {
} }
function handleCheck(rowKeys: DataTableRowKey[]) { function handleCheck(rowKeys: DataTableRowKey[]) {
console.log(rowKeys, selectionIds.value, "handleCheck");
selectionIds.value = rowKeys; selectionIds.value = rowKeys;
} }
function select(key: number) { function select(key: number, id: string) {
switch (key) { switch (key) {
case 1: case 1:
editSelection(); editSelection(id);
break; break;
case 2: case 2:
deleteSelection(); deleteSelection(id);
break; break;
default: default:
break; break;
} }
} }
function editSelection() { function editSelection(id = "") {
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
const $message = window["$message"]; // const $message = window["$message"];
// if (selectionIds.value.length === 0 || selectionIds.value.length > 1) {
// $message.error("");
// return;
// }
if (selectionIds.value.length === 0 || selectionIds.value.length > 1) { const selectedId = id;
$message.error("请选中一条过滤");
return;
}
const selectedId = selectionIds.value[0];
const selectedFilter = tableData.value.find((item: any) => { const selectedFilter = tableData.value.find((item: any) => {
return item.id === selectedId; return item.id === selectedId;
}); });
@ -180,12 +181,12 @@ function editSelection() {
closeModal(); closeModal();
} }
function deleteSelection() { function deleteSelection(id = "") {
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
const $message = window["$message"];
if (selectionIds.value.length === 0) { if (selectionIds.value.length === 0) {
$message.error("至少选中一条过滤"); deleteCondition({ ids: id }).then(() => {
query(pagination.page, pagination.pageSize);
});
return; return;
} }
@ -337,10 +338,17 @@ const showSearch = computed(() => {
<template #icon> <template #icon>
<SvgIcon name="delete-history" size="16" /> <SvgIcon name="delete-history" size="16" />
</template> </template>
删除</n-button> 删除</n-button
>
</div> </div>
<div class="msg"> <div class="msg">
<span>已选中 <span style="color:#507afd;font-size:16px">{{ selectionIds.length }}</span> </span> <span
>已选中
<span style="color: #507afd; font-size: 16px">{{
selectionIds.length
}}</span>
</span
>
<a @click="selectionIds = []">清空</a> <a @click="selectionIds = []">清空</a>
</div> </div>
</div> </div>
@ -401,7 +409,6 @@ const showSearch = computed(() => {
border: 1px solid gray; border: 1px solid gray;
} }
.del_btn { .del_btn {
} }
.msg { .msg {
a { a {

@ -150,7 +150,7 @@ function unformatValue(searchfield: string, searchvalue: any) {
function createCondition() { function createCondition() {
formValue.conditions.push({ formValue.conditions.push({
type: null, type: null,
operator: null, operator: 'eq',
result: null, result: null,
}) })
} }
@ -227,7 +227,7 @@ function leaveHandler() {
formValue.conditions = [ formValue.conditions = [
{ {
type: null, type: null,
operator: null, operator: 'eq',
result: null, result: null,
}, },
] ]
@ -269,7 +269,7 @@ defineExpose({
<n-form-item path="name" label="标题"> <n-form-item path="name" label="标题">
<n-input v-model:value="formValue.name" :style="{ width: '780px' }" @keydown.enter.prevent /> <n-input v-model:value="formValue.name" :style="{ width: '780px' }" @keydown.enter.prevent />
</n-form-item> </n-form-item>
<n-form-item path="logic" label="逻辑关系"> <n-form-item path="logic" label="逻辑关系" v-show="false">
<n-select filterable v-model:value="formValue.logic" placeholder="请选择逻辑关系" :options="logicOptions" /> <n-select filterable v-model:value="formValue.logic" placeholder="请选择逻辑关系" :options="logicOptions" />
</n-form-item> </n-form-item>
<n-form-item <n-form-item

File diff suppressed because it is too large Load Diff

@ -1,10 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { DropdownMixedOption } from 'naive-ui/es/dropdown/src/interface' import type { DropdownMixedOption } from "naive-ui/es/dropdown/src/interface";
import type { PropType } from 'vue' import type { PropType } from "vue";
defineOptions({ name: 'Action' }) defineOptions({ name: "Action" });
defineProps({ const props = defineProps({
options: { options: {
type: Array as PropType<DropdownMixedOption[]>, type: Array as PropType<DropdownMixedOption[]>,
default: null, default: null,
@ -16,14 +16,17 @@ defineProps({
}, },
id: { id: {
type: String, type: String,
default: '', default: "",
}, },
}) });
const fun = (key) => {
props.select(key, props.id);
};
</script> </script>
<template> <template>
<div :data-id="id"> <div :data-id="id">
<n-dropdown trigger="hover" :options="options" @select="(select as any)"> <n-dropdown trigger="hover" :options="options" @select="fun">
<SvgIcon name="more-hor" size="20" /> <SvgIcon name="more-hor" size="20" />
</n-dropdown> </n-dropdown>
</div> </div>

@ -17,7 +17,10 @@ const props = defineProps({
required: true, required: true,
}, },
}); });
const ruleForm = reactive({
keyword: "",
});
const ruleformRef = ref();
const emit = defineEmits<{ const emit = defineEmits<{
(e: "show-filter"): void; (e: "show-filter"): void;
(e: "show-custom"): void; (e: "show-custom"): void;
@ -75,7 +78,7 @@ useInfiniteScroll(
{ distance: 10, interval: 300, canLoadMore: () => false } { distance: 10, interval: 300, canLoadMore: () => false }
); );
const showClick = async () => { const showClick = async () => {
getSearchedList('') getSearchedList("");
}; };
async function loadMore() { async function loadMore() {
@ -92,7 +95,7 @@ async function featchList() {
loading.value = true; loading.value = true;
try { try {
const searchParam: FilterSearchParam = { const searchParam: FilterSearchParam = {
search_searchname: { value: keyword.value, op: "like", type: "string" }, search_searchname: { value: ruleForm.keyword, op: "like", type: "string" },
}; };
const result = await getConditionList(pagination, searchParam, props.type); const result = await getConditionList(pagination, searchParam, props.type);
const { data } = result; const { data } = result;
@ -121,11 +124,8 @@ function generateFilterEntityList(data) {
}; };
}); });
const reg = new RegExp(keyword.value, "gi"); const reg = new RegExp(ruleForm.keyword, "gi");
const hilightText = searchname.replace( const hilightText = searchname.replace(reg, `<span>${ruleForm.keyword}</span>`);
reg,
`<span>${keyword.value}</span>`
);
return { return {
id, id,
@ -134,7 +134,7 @@ function generateFilterEntityList(data) {
isDefaultFilter: false, isDefaultFilter: false,
filterList: list, filterList: list,
reorder, reorder,
searchname searchname,
}; };
}); });
@ -143,12 +143,17 @@ function generateFilterEntityList(data) {
function selectHandler(item: FilterEntity) { function selectHandler(item: FilterEntity) {
(popover.value as any).setShow(false); (popover.value as any).setShow(false);
currentlySelectedAdvanced.value = item.searchname currentlySelectedAdvanced.value = item.searchname;
emit("select", item.id); emit("select", item.id);
} }
const inputHandler = debounce((word) => { const inputHandler = debounce((word) => {
getSearchedList(word) ruleForm.keyword = word;
ruleformRef.value.validate();
if (word.length < 2 && word) {
return;
}
getSearchedList(word);
}, 300); }, 300);
function getSearchedList(word) { function getSearchedList(word) {
@ -157,7 +162,7 @@ function getSearchedList(word) {
} else { } else {
pagination.pageSize = 10; pagination.pageSize = 10;
} }
keyword.value = word; ruleForm.keyword = word;
featchList().then((list) => { featchList().then((list) => {
let dataArr: FilterEntity[] = []; let dataArr: FilterEntity[] = [];
let unDataArr: FilterEntity[] = []; let unDataArr: FilterEntity[] = [];
@ -195,10 +200,26 @@ function favoriteHandler(event: MouseEvent, item: any) {
} }
}); });
inputHandler(keyword.value); inputHandler(ruleForm.keyword);
} }
} }
const rules = {
keyword: [
{
trigger: ["blur", "input", "change"],
level: "error",
validator(_rule, value) {
if (value.length >= 2) {
return true;
} else {
return new Error("搜索关键字最少为两个");
}
},
},
],
};
function unFavoriteHandler(event: MouseEvent, item) { function unFavoriteHandler(event: MouseEvent, item) {
event.stopImmediatePropagation(); event.stopImmediatePropagation();
event.stopPropagation(); event.stopPropagation();
@ -208,7 +229,7 @@ function unFavoriteHandler(event: MouseEvent, item) {
if (!isDefaultFilter) { if (!isDefaultFilter) {
item.favorite = false; item.favorite = false;
unfavorite(id); unfavorite(id);
inputHandler(keyword.value); inputHandler(ruleForm.keyword);
} }
} }
@ -233,16 +254,22 @@ const moveEnd = () => {
> >
<template #trigger> <template #trigger>
<div class="wrapper-left-dropdown" @click="showClick"> <div class="wrapper-left-dropdown" @click="showClick">
<span style="font-size: 20px;color: #333333;font-weight: Medium;">{{currentlySelectedAdvanced}}</span> <span style="font-size: 20px; color: #333333; font-weight: Medium">{{
<SvgIcon :style="{ marginLeft: '5px' }" name="down" size="14" /> currentlySelectedAdvanced
}}</span>
<SvgIcon :style="{ marginLeft: '5px' }" name="down" size="14" color="#999999"/>
</div> </div>
</template> </template>
<n-spin :show="loading"> <n-spin :show="loading">
<div class="wrapper-left-popover"> <div class="wrapper-left-popover">
<n-form :rules="rules" ref="ruleformRef" :model="ruleForm">
<n-form-item path="keyword">
<n-input <n-input
:style="{ '--n-border': '0px' }" :style="{ '--n-border': '0px' }"
placeholder="请输入关键" placeholder="请输入关键"
@input="inputHandler" @input="inputHandler"
:value="ruleForm.keyword"
:minlength="2"
> >
<template #prefix> <template #prefix>
<SvgIcon size="14px" name="magnifying-1" /> <SvgIcon size="14px" name="magnifying-1" />
@ -256,6 +283,8 @@ const moveEnd = () => {
/> />
</template> </template>
</n-input> </n-input>
</n-form-item>
</n-form>
<ul ref="el" class="wrapper-left-list"> <ul ref="el" class="wrapper-left-list">
<li <li
@ -264,7 +293,12 @@ const moveEnd = () => {
style="display: flex; align-items: center" style="display: flex; align-items: center"
@click="selectHandler(item)" @click="selectHandler(item)"
> >
<SvgIcon name="drag" size="18" color="#333333" style="margin-right:3px"/> <SvgIcon
name="drag"
size="18"
color="#333333"
style="margin-right: 3px"
/>
<SvgIcon <SvgIcon
v-if="item.favorite && !item.isDefaultFilter" v-if="item.favorite && !item.isDefaultFilter"
name="favorite-fill" name="favorite-fill"
@ -280,7 +314,7 @@ const moveEnd = () => {
style="margin-right: 3px" style="margin-right: 3px"
@click="favoriteHandler($event, item)" @click="favoriteHandler($event, item)"
/> />
<div v-html="item.name" style="color: #333333;"/> <div v-html="item.name" style="color: #333333" />
</li> </li>
<!-- filter=".draggable-li[draggable='false']" --> <!-- filter=".draggable-li[draggable='false']" -->
<VueDraggable <VueDraggable
@ -305,7 +339,7 @@ const moveEnd = () => {
color="#fd9b0a" color="#fd9b0a"
size="18" size="18"
fill="#666666" fill="#666666"
style="cursor: pointer!important;margin-right:3px;" style="cursor: pointer !important; margin-right: 3px"
@click="unFavoriteHandler($event, item)" @click="unFavoriteHandler($event, item)"
/> />
<SvgIcon <SvgIcon
@ -313,10 +347,10 @@ const moveEnd = () => {
name="favorite-unfill" name="favorite-unfill"
size="18" size="18"
fill="#666666" fill="#666666"
style="cursor: pointer!important;margin-right:3px;" style="cursor: pointer !important; margin-right: 3px"
@click="favoriteHandler($event, item)" @click="favoriteHandler($event, item)"
/> />
<div v-html="item.name" style="color: #333333;"/> <div v-html="item.name" style="color: #333333" />
</li> </li>
</VueDraggable> </VueDraggable>
</ul> </ul>

@ -43,6 +43,23 @@ interface RowData {
updatetime: string; updatetime: string;
} }
const sortData = (row) => {
console.log("sortData", row);
if (row.order == "descend") {
tableData.value.sort(
(a, b) =>
new Date(a[row.columnKey]).getTime() - new Date(b[row.columnKey]).getTime()
);
} else if (row.order == "ascend") {
tableData.value.sort(
(a, b) =>
new Date(b[row.columnKey]).getTime() - new Date(a[row.columnKey]).getTime()
);
} else {
tableData.value.sort((a, b) => Number((a as any).reorder) - Number((b as any).reorder));
}
};
const columns: DataTableColumns<RowData> = [ const columns: DataTableColumns<RowData> = [
{ {
type: "selection", type: "selection",
@ -73,6 +90,12 @@ const columns: DataTableColumns<RowData> = [
title: "创建时间", title: "创建时间",
key: "createtime", key: "createtime",
width: 180, width: 180,
sorter: (row1, row2) => {
// tableData.value.sort(
// (a, b) => new Date(a?.createtime).getTime() - new Date(b?.createtime).getTime()
// );
return new Date(row1?.createtime).getTime() - new Date(row2?.createtime).getTime();
},
}, },
{ {
title: "更新者", title: "更新者",
@ -148,43 +171,41 @@ function handleCheck(rowKeys: DataTableRowKey[]) {
selectionIds.value = rowKeys; selectionIds.value = rowKeys;
} }
function select(key: number) { function select(key: number, id: string) {
switch (key) { switch (key) {
case 1: case 1:
editSelection(); editSelection(id);
break; break;
case 2: case 2:
deleteSelection(); deleteSelection(id);
break; break;
default: default:
break; break;
} }
} }
function editSelection() { function editSelection(id) {
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
const $message = window["$message"]; // const $message = window["$message"];
// if (selectionIds.value.length === 0 || selectionIds.value.length > 1) {
if (selectionIds.value.length === 0 || selectionIds.value.length > 1) { // $message.error("");
$message.error("请选中一条过滤"); // return;
return; // }
} const selectedId = id;
const selectedId = selectionIds.value[0];
const selectedFilter = tableData.value.find((item: any) => { const selectedFilter = tableData.value.find((item: any) => {
return item.id === selectedId; return item.id === selectedId;
}); });
emit("editFilter", selectedFilter); emit("editFilter", selectedFilter);
closeModal(); // closeModal();
} }
function deleteSelection() { function deleteSelection(id = "") {
// eslint-disable-next-line dot-notation // eslint-disable-next-line dot-notation
const $message = window["$message"];
if (selectionIds.value.length === 0) { if (selectionIds.value.length === 0) {
$message.error("至少选中一条过滤"); deleteCondition({ ids: id }).then(() => {
query(pagination.page, pagination.pageSize);
});
return; return;
} }
@ -274,7 +295,6 @@ defineExpose({
showModal, showModal,
}); });
const inputHandler = debounce((word) => { const inputHandler = debounce((word) => {
keyword.value = word; keyword.value = word;
query(1, 5); query(1, 5);
@ -342,7 +362,7 @@ const inputHandler = debounce((word) => {
@update:page="handlePageChange" @update:page="handlePageChange"
@update-page-size="handlePageSizeChange" @update-page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck" @update:checked-row-keys="handleCheck"
@update:sorter="sortData"
/> />
</div> </div>
</div> </div>
@ -420,4 +440,7 @@ const inputHandler = debounce((word) => {
} }
} }
} }
::v-deep(.n-data-table .n-data-table-th){
font-weight: bold !important;
}
</style> </style>

@ -158,7 +158,7 @@ function unformatValue(searchfield: string, searchvalue: any) {
function createCondition() { function createCondition() {
formValue.conditions.push({ formValue.conditions.push({
type: null, type: null,
operator: null, operator: 'eq',
result: null, result: null,
}) })
} }
@ -260,7 +260,7 @@ function leaveHandler() {
formValue.conditions = [ formValue.conditions = [
{ {
type: null, type: null,
operator: null, operator: 'eq',
result: null, result: null,
}, },
] ]
@ -302,7 +302,7 @@ defineExpose({
<n-form-item path="name" label="标题"> <n-form-item path="name" label="标题">
<n-input v-model:value="formValue.name" :style="{ width: '780px' }" @keydown.enter.prevent /> <n-input v-model:value="formValue.name" :style="{ width: '780px' }" @keydown.enter.prevent />
</n-form-item> </n-form-item>
<n-form-item path="logic" label="逻辑关系"> <n-form-item path="logic" label="逻辑关系" v-show="false">
<n-select filterable v-model:value="formValue.logic" placeholder="请选择逻辑关系" :options="logicOptions" /> <n-select filterable v-model:value="formValue.logic" placeholder="请选择逻辑关系" :options="logicOptions" />
</n-form-item> </n-form-item>
<n-form-item <n-form-item

@ -565,14 +565,14 @@ const dropdownOptions = ref([
<SvgIcon class="gap" name="arrow-botton" size="14" /> <SvgIcon class="gap" name="arrow-botton" size="14" />
</div> </div>
</n-popselect> </n-popselect>
<div style="margin-left: 15px;cursor: pointer;color:#323233" @click="sortHandler('pictureResult')">
<span>相似度排序</span>
<SvgIcon style="margin-left: 8px;" name="sort" size="12" />
</div>
<div style="margin-left: 15px;cursor: pointer;color:#323233" @click="sortHandler('fromuptime')"> <div style="margin-left: 15px;cursor: pointer;color:#323233" @click="sortHandler('fromuptime')">
<span>时间排序</span> <span>时间排序</span>
<SvgIcon style="margin-left: 8px;" name="sort" size="12" /> <SvgIcon style="margin-left: 8px;" name="sort" size="12" />
</div> </div>
<div style="margin-left: 15px;cursor: pointer;color:#323233" @click="sortHandler('pictureResult')">
<span>相似度排序</span>
<SvgIcon style="margin-left: 8px;" name="sort" size="12" />
</div>
</div> </div>
<span style="font-size: 16px;color: #333"> <span style="color: #507AFD;font-weight: 500;">{{ totalCount <span style="font-size: 16px;color: #333"> <span style="color: #507AFD;font-weight: 500;">{{ totalCount
}}</span> </span> }}</span> </span>

@ -93,7 +93,7 @@ const rules = {
if (loginSuccess.value || !value) { if (loginSuccess.value || !value) {
return true; return true;
} }
if (loginRejectMessge.value.indexOf("用户名") > -1) { if (loginRejectMessge.value.indexOf("用户名") > -1||loginRejectMessge.value.indexOf("账号") > -1) {
return new Error(loginRejectMessge.value); return new Error(loginRejectMessge.value);
} }
}, },

@ -20,7 +20,7 @@ import emitter from '@/utils/mitt'
const CustomFieldModalRef = ref(null) const CustomFieldModalRef = ref(null)
const collapse = ref(false) const collapse = ref(false)
const taskStore = useTaskStore() const taskStore = useTaskStore()
const taskListRef = ref<HTMLDivElement | null>(null) const taskListRef: any = ref(null)
// //
const showFieldList = ref<any[]>([]) const showFieldList = ref<any[]>([])
@ -144,6 +144,14 @@ function editFilter(filter: any) {
modal.showModal() modal.showModal()
modal.edit(filter) modal.edit(filter)
} }
function setAsideItemName(text) {
taskListRef.value.setStatusName(text)
}
defineExpose({
setAsideItemName,
})
</script> </script>
<template> <template>

@ -53,7 +53,7 @@ const svgName = computed(() => {
" "
>{{ listItem.statshisText }}</span> >{{ listItem.statshisText }}</span>
</li> </li>
<li v-else-if="item.id === 'createdate'"> <li v-else-if="item.id === ''">
提交时间{{ format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") }} 提交时间{{ format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") }}
</li> </li>
<li v-else class="ellipsis"> <li v-else class="ellipsis">

@ -1,119 +1,131 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useInfiniteScroll } from "@vueuse/core"; import { useInfiniteScroll } from '@vueuse/core'
import { onMounted, onUnmounted, reactive, ref, watch, defineProps } from "vue"; import { defineProps, onMounted, onUnmounted, reactive, ref, watch } from 'vue'
import ListItem from "./ListItem.vue"; import ListItem from './ListItem.vue'
import emitter from "@/utils/mitt"; import emitter from '@/utils/mitt'
import { useTaskStore } from "@/store/modules/task"; import { useTaskStore } from '@/store/modules/task'
const taskStore = useTaskStore();
const data = ref<any[]>([]);
const activeId = ref("");
const el = ref<HTMLDivElement | null>(null);
const keyword = ref("");
const canloadMore = ref(true);
const isLoading = ref(false);
defineProps({ defineProps({
showFieldList: { showFieldList: {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
}); })
const taskStore = useTaskStore()
const data = ref<any[]>([])
const activeId = ref('')
const el = ref<HTMLDivElement | null>(null)
const keyword = ref('')
const canloadMore = ref(true)
const isLoading = ref(false)
const pagination = reactive({ const pagination = reactive({
pageNo: 0, pageNo: 0,
pageSize: 100, pageSize: 30,
}); })
function selectHandler(id: string, index: number) { function selectHandler(id: string, index: number) {
taskStore.setActive(index); taskStore.setActive(index)
} }
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
loadMore(); loadMore()
}, },
{ distance: 10, interval: 1500, canLoadMore: () => canloadMore.value } { distance: 10, interval: 1500, canLoadMore: () => canloadMore.value },
); )
async function loadMore() { async function loadMore() {
if (isLoading.value || el.value == null) return; console.log(77888)
isLoading.value = true; if (isLoading.value || el.value == null)
return
isLoading.value = true
try { try {
const more = await fetchList(); const more = await fetchList()
data.value.push(...more); data.value.push(...more)
} finally { }
isLoading.value = false; finally {
isLoading.value = false
} }
} }
//
async function fetchList() { async function fetchList() {
try { try {
pagination.pageNo += 1; pagination.pageNo += 1
const result = await taskStore.fetchApprovalList(pagination); const result = await taskStore.fetchApprovalList({
const { data, pageCount } = result; ...pagination,
canloadMore.value = pageCount >= pagination.pageNo; keyword: keyword.value,
return data || []; })
} catch (error) { const { data, pageCount } = result
canloadMore.value = false; canloadMore.value = pageCount >= pagination.pageNo
return []; return data || []
}
catch (error) {
canloadMore.value = false
return []
} }
} }
watch( watch(
() => taskStore.activeId, () => taskStore.activeId,
(newVal) => { (newVal) => {
activeId.value = newVal; activeId.value = newVal
} },
); )
function reset() { function reset() {
pagination.pageNo = 0; pagination.pageNo = 0
pagination.pageSize = 100; pagination.pageSize = 30
canloadMore.value = true; canloadMore.value = true
data.value.length = 0; data.value.length = 0
taskStore.reset(); taskStore.reset()
} }
async function search(word: string) { async function search(word: string) {
keyword.value = word; keyword.value = word
reset(); reset()
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
loadMore(); loadMore()
}, },
{ distance: 10, canLoadMore: () => canloadMore.value } { distance: 10, canLoadMore: () => canloadMore.value },
); )
} }
onMounted(() => { onMounted(() => {
emitter.on("refresh", refreshHandler); emitter.on('refresh', refreshHandler)
}); })
onUnmounted(() => { onUnmounted(() => {
emitter.off("refresh", refreshHandler); emitter.off('refresh', refreshHandler)
}); })
async function refreshHandler() { async function refreshHandler() {
search(""); search('')
}
function setStatusName(text) {
const index = taskStore.getCurrentIndex
data.value[index].statshisText = text
} }
defineExpose({ defineExpose({
search, search,
}); setStatusName,
})
</script> </script>
<template> <template>
<n-spin :show="isLoading"> <n-spin :show="isLoading">
<div ref="el" class="list"> <div ref="el" class="list">
<ListItem <ListItem
:showFieldList="showFieldList"
v-for="(item, index) in data" v-for="(item, index) in data"
:key="item.id" :key="item.id"
:show-field-list="showFieldList"
:selected="activeId === item.id" :selected="activeId === item.id"
:list-item="item" :list-item="item"
@click="selectHandler(item.id, index)" @click="selectHandler(item.id, index)"

@ -12,13 +12,19 @@ import NotPassed from '@/components/Approval/NotPassed.vue'
import { getAllfieldList, getfieldList } from '@/api/home/filter' import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { TASK_STATUS_OBJ } from '@/enums/index' import { TASK_STATUS_OBJ } from '@/enums/index'
import { audit, dubiousfileyd, getSimilarityList, getTaskDetailInfo } from '@/api/task/task' import {
audit,
dubiousfileyd,
getSimilarityList,
getTaskDetailInfo,
} from '@/api/task/task'
import { useTask } from '@/store/modules/task' import { useTask } from '@/store/modules/task'
import { useUser } from '@/store/modules/user' import { useUser } from '@/store/modules/user'
import { isEmpty } from '@/utils' import { isEmpty } from '@/utils'
import { formatToDateHMS } from '@/utils/dateUtil' import { formatToDateHMS } from '@/utils/dateUtil'
import { hideDownload } from '@/utils/image' import { hideDownload } from '@/utils/image'
const emit = defineEmits(['setAsideItemName'])
const batch = ref(false) const batch = ref(false)
const selectItems = ref<any[]>([]) const selectItems = ref<any[]>([])
const message = useMessage() const message = useMessage()
@ -43,11 +49,8 @@ function setBatch(value: boolean) {
batch.value = value batch.value = value
if (value === false) { if (value === false)
selectItems.value.forEach(item => (item.checked = false)) selectItems.value = []
selectItems.value.length = 0
selectItems.value.length = 0
}
} }
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
@ -94,6 +97,12 @@ function handleKeydown(event) {
// //
} }
// storeid
function currentTaskId() {
const index = taskStore.getCurrentIndex
return taskStore.getApprovalList[index]?.id || ''
}
// states:1234 // states:1234
function validate(items: any[]) { function validate(items: any[]) {
if (items.length === 0) if (items.length === 0)
@ -169,39 +178,23 @@ function approvalHandler(items?: any) {
} }
function rejectHandler(items?: any) { function rejectHandler(items?: any) {
// let cloneItem: any
// if (batch.value) {
// processItems = selectItems.value
// }
// else if (overTask.value) {
// cloneItem = clone(overTask.value)
// processItems = [cloneItem]
// }
// if (items !== undefined && !(items instanceof PointerEvent))
// processItems = items
// const msg = validate(processItems)
// if (msg !== null) {
// message.error(msg)
// return
// }
const modal = unref(notPassModalRef)! as any const modal = unref(notPassModalRef)! as any
modal.showModal(selectItems.value) modal.showModal(selectItems.value)
} }
function singleRejectHandler() {
const modal = unref(notPassModalRef)! as any
modal.showModal([taskDetailInfo.value])
}
function doAudit(param: any) { function doAudit(param: any) {
audit(param).then((res) => { audit(param).then((res) => {
const { code } = res const { code } = res
setBatch(false)
if (code === 'OK') { if (code === 'OK') {
message.success('审核成功') message.success('审核成功')
reloadList() setBatch(false)
reloadList(param, '通过')
} }
else { message.error(res.message) }
}) })
} }
@ -222,7 +215,7 @@ async function handleDragEnd(event, item) {
// //
const flag = taskStore.getInFile const flag = taskStore.getInFile
if (flag) { if (flag) {
const res = await dubiousfileyd({ pictureid: item.pictureid }) const res = await dubiousfileyd({ pictureid: item.pictureId })
if (res.code === 'OK') { if (res.code === 'OK') {
message.success('加入成功') message.success('加入成功')
getTableData() getTableData()
@ -242,12 +235,21 @@ async function getTableData() {
const fieldList = (res as any)?.data const fieldList = (res as any)?.data
res = await getfieldList(reviewType, useInfo.id) res = await getfieldList(reviewType, useInfo.id)
const userFieldList = (res as any)?.data.userFieldFixed const userFieldList = (res as any)?.data.userFieldFixed
const blueList = [
'拜访终端名称',
'定位信息',
'拜访日期',
'定位距离',
'拜访小结',
'拜访项目类别',
]
fieldList.map((v) => { fieldList.map((v) => {
if (userFieldList.includes(v.name)) { if (userFieldList.includes(v.name)) {
const item = { const item = {
label: v.fieldDesc, label: v.fieldDesc,
value: taskDetailInfo.value.ocrPicture[v.name], value: taskDetailInfo.value.ocrPicture[v.name],
key: v.name, key: v.name,
blue: blueList.includes(v.fieldDesc),
} }
listData.push(item) listData.push(item)
} }
@ -257,13 +259,11 @@ async function getTableData() {
async function getImgList() { async function getImgList() {
if (!isEmpty(taskDetailInfo.value.ocrPicture.id)) { if (!isEmpty(taskDetailInfo.value.ocrPicture.id)) {
const { data, total } = await getSimilarityList( const { data, total } = await getSimilarityList({
{
...taskpagination, ...taskpagination,
...sortBy, ...sortBy,
pictureId: taskDetailInfo.value.ocrPicture.id, pictureId: taskDetailInfo.value.ocrPicture.id,
}, })
)
taskDetailPictureList.value = data taskDetailPictureList.value = data
totalCount.value = total totalCount.value = total
} }
@ -273,12 +273,6 @@ async function getImgList() {
} }
} }
// storeid
const currentTaskId = computed(() => {
const index = taskStore.getCurrentIndex
return taskStore.getApprovalList[index]?.id || ''
})
function overTaskHandle() { function overTaskHandle() {
const item = taskDetailInfo.value const item = taskDetailInfo.value
if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) { if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
@ -319,9 +313,11 @@ function previewHandler(event: MouseEvent) {
watch( watch(
() => [taskStore.activeId], () => [taskStore.activeId],
() => { () => {
if (!isEmpty(taskStore.getActiveId)) {
packageId.value = taskStore.getPackageid packageId.value = taskStore.getPackageid
taskId.value = taskStore.getActiveId taskId.value = taskStore.getActiveId
getDetail() getDetail()
}
}, },
) )
@ -333,7 +329,14 @@ async function getDetail() {
getImgList() getImgList()
} }
function reloadList() { function reloadList(param, text) {
//
const id = currentTaskId()
const hasCurrentId = param.flowTaskInfoList.find(item => item.formId === id)
if (hasCurrentId)
emit('setAsideItemName', text)
getDetail() getDetail()
} }
</script> </script>
@ -342,25 +345,12 @@ function reloadList() {
<div class="wrapper"> <div class="wrapper">
<div class="wrapper-header"> <div class="wrapper-header">
<div class="left"> <div class="left">
<span class="font">任务ID{{ currentTaskId }}</span> <span class="font">任务ID{{ taskDetailInfo.fromtaskname }}</span>
<SvgIcon <SvgIcon size="22" class="forward" name="arrow-left" @click="backHandler" />
size="22" <SvgIcon size="22" class="back" name="arrow-right" @click="forwardHandler" />
class="forward"
name="arrow-left"
@click="backHandler"
/>
<SvgIcon
size="22"
class="back"
name="arrow-right"
@click="forwardHandler"
/>
</div> </div>
<div class="right"> <div class="right">
<div <div v-show="!showActions" style="display: flex; align-items: center">
v-show="!showActions"
style="display: flex; align-items: center"
>
<div class="btn" @click="setBatch(true)"> <div class="btn" @click="setBatch(true)">
<SvgIcon style="margin-right: 6px" size="22" name="batch" /> <SvgIcon style="margin-right: 6px" size="22" name="batch" />
批量审批 批量审批
@ -391,11 +381,7 @@ function reloadList() {
</ul> </ul>
</n-popover> --> </n-popover> -->
<div class="icon-wrap"> <div class="icon-wrap">
<SvgIcon <SvgIcon size="20" name="immersion-model" @click="immersionHandler" />
size="20"
name="immersion-model"
@click="immersionHandler"
/>
</div> </div>
</div> </div>
<div v-show="showActions" class="batch"> <div v-show="showActions" class="batch">
@ -405,9 +391,19 @@ function reloadList() {
</template> </template>
返回 返回
</n-button> </n-button>
<img class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt="" @click.stop="rejectHandler"> <img
class="btn-approval btn-left"
src="@/assets/images/task/btn-not-pass.png"
alt=""
@click.stop="rejectHandler"
>
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
<img class="btn-approval" src="@/assets/images/task/btn-pass.png" alt="" @click.stop="approvalHandler"> <img
class="btn-approval"
src="@/assets/images/task/btn-pass.png"
alt=""
@click.stop="approvalHandler"
>
</div> </div>
</div> </div>
</div> </div>
@ -434,7 +430,7 @@ function reloadList() {
width="168" width="168"
height="48" height="48"
name="r7" name="r7"
@click.stop="rejectHandler" @click.stop="singleRejectHandler"
/> />
</div> </div>
<div class="check"> <div class="check">
@ -447,24 +443,29 @@ function reloadList() {
</div> </div>
<div class="status"> <div class="status">
<img v-show="taskDetailInfo?.userapprove?.statshis === 2" class="img-status" src="@/assets/images/task/pass.png" alt=""> <img
<img v-show="taskDetailInfo?.userapprove?.statshis === 3" class="img-status" src="@/assets/images/task/not_pass.png" alt=""> v-show="taskDetailInfo?.userapprove?.statshis === 2"
class="img-status"
src="@/assets/images/task/pass.png"
alt=""
>
<img
v-show="taskDetailInfo?.userapprove?.statshis === 3"
class="img-status"
src="@/assets/images/task/not_pass.png"
alt=""
>
</div> </div>
<div class="mark"> <div class="mark">
<SvgIcon <SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" />
v-show="taskDetailInfo?.iztrueorfalse === 0"
size="128"
name="jia"
/>
</div> </div>
<div class="mark"> <div class="mark">
<SvgIcon <SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 1" size="128" name="zhen" />
v-show="taskDetailInfo?.iztrueorfalse === 1"
size="128"
name="zhen"
/>
</div> </div>
<div class="big-mark" /> <div class="big-mark" />
<div class="preview" @click="previewHandler">
<SvgIcon size="16" name="zoom-out" />
</div>
<div class="info img-info"> <div class="info img-info">
<n-grid x-gap="12" y-gap="10" :cols="12"> <n-grid x-gap="12" y-gap="10" :cols="12">
<n-gi span="4" class="gi1"> <n-gi span="4" class="gi1">
@ -473,30 +474,34 @@ function reloadList() {
</span> </span>
</n-gi> </n-gi>
<n-gi span="8" class="gi2"> <n-gi span="8" class="gi2">
<span class="value">{{ TASK_STATUS_OBJ[taskDetailInfo?.userapprove?.statshis] }}</span> <span class="value">{{
TASK_STATUS_OBJ[taskDetailInfo?.userapprove?.statshis]
}}</span>
<span class="label">审批状态</span> <span class="label">审批状态</span>
</n-gi> </n-gi>
<n-gi span="4" class="gi1"> <n-gi span="4" class="gi1">
<span> <span>
<img class="icon-status" src="@/assets/images/task/similarity.png" alt=""> <img
class="icon-status"
src="@/assets/images/task/similarity.png"
alt=""
>
</span> </span>
</n-gi> </n-gi>
<n-gi span="8" class="gi2"> <n-gi span="8" class="gi2">
<span class="value num">{{ <span class="value num">{{ totalCount }}<span class="unit"></span> </span>
totalCount
}}<span class="unit"></span> </span>
<span class="label">相似匹配</span> <span class="label">相似匹配</span>
</n-gi> </n-gi>
</n-grid> </n-grid>
</div> </div>
<div class="time"> <div class="time">
<div v-if="taskDetailInfo?.ocrPicture?.photoDateTimestamp" class="time-item"> <div class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="16" name="camera-time" /> <SvgIcon class="svg-time" color="#FFF" size="16" name="camera-time" />
<span>{{ formatToDateHMS(Number(taskDetailInfo.ocrPicture.photoDateTimestamp) || 0) }}</span> <span>{{ taskDetailInfo?.ocrPicture?.photoDateTimestamp ? formatToDateHMS(Number(taskDetailInfo.ocrPicture.photoDateTimestamp)) : '-' }}</span>
</div> </div>
<div v-if="taskDetailInfo?.ocrPicture?.submitDateTimestamp" class="time-item time-item2"> <div class="time-item time-item2">
<SvgIcon class="svg-time" color="#FFF" size="16" name="submit-time" /> <SvgIcon class="svg-time" color="#FFF" size="16" name="submit-time" />
<span>{{ formatToDateHMS(Number(taskDetailInfo.ocrPicture.submitDateTimestamp) || 0) }}</span> <span>{{ taskDetailInfo?.ocrPicture?.submitDateTimestamp ? formatToDateHMS(Number(taskDetailInfo.ocrPicture.submitDateTimestamp)) : '-' }}</span>
</div> </div>
</div> </div>
<div style="display: none"> <div style="display: none">
@ -520,16 +525,16 @@ function reloadList() {
/> />
</div> </div>
<div class="list"> <div class="list">
<div <div v-for="item in taskDetailPictureList" :key="item.id" class="item">
v-for="(item) in taskDetailPictureList"
:key="item.id"
class="item"
>
<div <div
draggable="true" draggable="true"
class="img-wrapper" class="img-wrapper"
:style="{ 'background-image': `url(${item.imgUrl})` }" :style="{ 'background-image': `url(${item.imgUrl})` }"
@dragend="(event) => { handleDragEnd(event, item) }" @dragend="
(event) => {
handleDragEnd(event, item);
}
"
/> />
<div class="small-mark" /> <div class="small-mark" />
<div class="check"> <div class="check">
@ -541,19 +546,32 @@ function reloadList() {
/> />
</div> </div>
<img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt=""> <img
<img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt=""> v-if="item.historyStates === 2"
class="tag-status"
src="@/assets/images/task/tag-pass.png"
alt=""
>
<img
v-if="item.historyStates === 3"
class="tag-status"
src="@/assets/images/task/tag-not-pass.png"
alt=""
>
<div class="time"> <div class="time">
<div v-if="item.photoDateTimestamp" class="time-item"> <div class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="8" name="camera-time" /> <SvgIcon class="svg-time" color="#FFF" size="8" name="camera-time" />
<span>{{ formatToDateHMS(Number(item.photoDateTimestamp) || 0) }}</span> <span>{{ item.photoDateTimestamp ? formatToDateHMS(Number(item.photoDateTimestamp)) : '-' }}</span>
</div> </div>
<div v-if="item.submitDateTimestamp" class="time-item time-item2"> <div class="time-item time-item2">
<SvgIcon class="svg-time" color="#FFF" size="8" name="submit-time" /> <SvgIcon class="svg-time" color="#FFF" size="8" name="submit-time" />
<span>{{ formatToDateHMS(Number(item.submitDateTimestamp) || 0) }}</span> <span>{{ item.submitDateTimestamp ? formatToDateHMS(Number(item.submitDateTimestamp)) : '-' }}</span>
</div> </div>
</div> </div>
<div :class="{ 'percent-red': item.similarityScore === 100 }" class="percent"> <div
:class="{ 'percent-red': item.similarityScore === 100 }"
class="percent"
>
{{ item.similarityScore }}<span class="percent-unit">%</span> {{ item.similarityScore }}<span class="percent-unit">%</span>
</div> </div>
</div> </div>
@ -566,7 +584,11 @@ function reloadList() {
<n-tabs type="line" animated> <n-tabs type="line" animated>
<n-tab-pane name="task-info" tab="任务信息"> <n-tab-pane name="task-info" tab="任务信息">
<TaskTable :data="taskDetailInfo" :task-table-data="taskTableData" @show-modal="showActionsModal" /> <TaskTable
:data="taskDetailInfo"
:task-table-data="taskTableData"
@show-modal="showActionsModal"
/>
</n-tab-pane> </n-tab-pane>
<n-tab-pane name="picture-info" tab="图片信息"> <n-tab-pane name="picture-info" tab="图片信息">
<PictureTable :data="taskDetailInfo" /> <PictureTable :data="taskDetailInfo" />
@ -575,13 +597,12 @@ function reloadList() {
<History :data="taskDetailInfo" /> <History :data="taskDetailInfo" />
</n-tab-pane> </n-tab-pane>
</n-tabs> </n-tabs>
<NotPassed ref="notPassModalRef" @success="reloadList" /> <NotPassed ref="notPassModalRef" @success="(param) => reloadList(param, '不通过')" />
<BatchModal <BatchModal
ref="batchModalRef" ref="batchModalRef"
@reject="rejectHandler" @reject="rejectHandler"
@approval="approvalHandler" @approval="approvalHandler"
/> />
<CustomSettingModal ref="CustomSettingModalRef" :review-type="3" @on-ok="getTableData" />
</div> </div>
</template> </template>
@ -593,7 +614,7 @@ function reloadList() {
color: #666666; color: #666666;
} }
::v-deep(.n-tabs-tab--active .n-tabs-tab__label) { ::v-deep(.n-tabs-tab--active .n-tabs-tab__label) {
color: #507AFD; color: #507afd;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
} }
@ -618,7 +639,7 @@ function reloadList() {
justify-content: center; justify-content: center;
width: 30px; width: 30px;
height: 30px; height: 30px;
background: rgba(80,122,253,.1); background: rgba(80, 122, 253, 0.1);
border-radius: 8px; border-radius: 8px;
margin-left: 10px; margin-left: 10px;
cursor: pointer; cursor: pointer;
@ -654,7 +675,6 @@ function reloadList() {
.unit { .unit {
font-size: 11px; font-size: 11px;
} }
} }
.wrapper { .wrapper {
display: flex; display: flex;
@ -749,10 +769,31 @@ function reloadList() {
border-radius: 8px; border-radius: 8px;
position: relative; position: relative;
.preview {
position: absolute;
right: 10px;
top: 10px;
z-index: 3;
width: 30px;
height: 30px;
background: rgba(255, 255, 255, 0.20);
border-radius: 6px;
backdrop-filter: blur(10px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.big-mark{ .big-mark{
width: 100%; width: 100%;
height: 151px; height: 151px;
background: linear-gradient(180deg,rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.00) 29%, rgba(3,0,0,0.73)); background: linear-gradient(
180deg,
rgba(0, 0, 0, 0) 0%,
rgba(0, 0, 0, 0) 29%,
rgba(3, 0, 0, 0.73)
);
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;
@ -821,7 +862,7 @@ function reloadList() {
} }
.svg-time { .svg-time {
margin-right: 5px margin-right: 5px;
} }
} }
@ -859,7 +900,7 @@ function reloadList() {
.right { .right {
flex: 0.5; flex: 0.5;
background: #F6F9FD; background: #f6f9fd;
border-radius: 8px; border-radius: 8px;
margin-left: 20px; margin-left: 20px;
padding: 24px; padding: 24px;
@ -896,7 +937,11 @@ function reloadList() {
.small-mark { .small-mark {
width: 100%; width: 100%;
height: 36px; height: 36px;
background: linear-gradient(180deg,rgba(0,0,0,0.01), rgba(0,0,0,0.44) 88%); background: linear-gradient(
180deg,
rgba(0, 0, 0, 0.01),
rgba(0, 0, 0, 0.44) 88%
);
border-radius: 0px 8px 8px 8px; border-radius: 0px 8px 8px 8px;
position: absolute; position: absolute;
left: 0; left: 0;
@ -933,7 +978,7 @@ function reloadList() {
} }
.svg-time { .svg-time {
margin-right: 5px margin-right: 5px;
} }
} }
@ -975,7 +1020,7 @@ function reloadList() {
.percent-unit { .percent-unit {
font-size: 8px; font-size: 8px;
margin-top: 4px margin-top: 4px;
} }
.percent-red { .percent-red {

@ -19,35 +19,42 @@ defineProps({
<tr> <tr>
<th>图片名称</th> <th>图片名称</th>
<td class="blue"> <td class="blue">
{{ data?.ocrPicture?.imgname }} {{ data?.pictureInfo?.imgName }}
</td> </td>
<th>图片格式</th> <th>图片格式</th>
<td class="blue" /> <td class="blue">
{{ data?.pictureInfo?.imgFormat }}
</td>
</tr> </tr>
<tr> <tr>
<th>图片大小</th> <th>图片大小</th>
<td /> <td class="blue">
{{ (data?.pictureInfo?.imgSize / 1024).toFixed(2) }}kb
</td>
<th>图片尺寸</th> <th>图片尺寸</th>
<td /> <td class="blue">
{{ data?.pictureInfo?.imgMeasure }}
</td>
</tr> </tr>
<tr> <tr>
<th>上传时间</th> <th>上传时间</th>
<td> {{ data?.ocrPicture?.uptime }}</td> <td> {{ data?.pictureInfo?.uploadTime }}</td>
<th>生成时间</th> <th>生成时间</th>
<td> {{ data?.ocrPicture?.gentime }}</td> <td> {{ data?.pictureInfo?.createTime }}</td>
</tr> </tr>
<tr> <tr>
<th>标记时间</th> <th>标记时间</th>
<td /> <td> {{ data?.pictureInfo?.tagTime }}</td>
<th>色彩空间</th> <th>色彩空间</th>
<td>{{ data?.ocrPicture?.space }}</td> <td>{{ data?.pictureInfo?.imgSpace }}</td>
</tr> </tr>
<tr> <tr>
<th> <th>
来源 来源
</th> </th>
<td colspan="3"> <td colspan="3">
{{ data?.ocrPicture?.source }} {{ data?.pictureInfo?.source }}
</td> </td>
</tr> </tr>
</table> </table>
@ -125,7 +132,7 @@ td {
} }
.blue { .blue {
color: #507afd; // color: #507afd;
} }
.black { .black {

@ -1,4 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch } from "vue";
defineProps({ defineProps({
data: { data: {
type: Object as PropType<any>, type: Object as PropType<any>,
@ -8,19 +10,17 @@ defineProps({
type: Array as any, type: Array as any,
default: () => [[]], default: () => [[]],
}, },
}) });
const emit = defineEmits(['showModal']) const emit = defineEmits(["showModal"]);
function showActionsModal() { function showActionsModal() {
emit('showModal') emit("showModal");
} }
</script> </script>
<template> <template>
<div class="info-header"> <div class="info-header">
<div class="left_box"> <div class="left_box">
<div class="title"> <div class="title">填报信息</div>
填报信息
</div>
</div> </div>
<div class="right_box" @click="showActionsModal"> <div class="right_box" @click="showActionsModal">
自定义设置 自定义设置
@ -32,13 +32,13 @@ function showActionsModal() {
<th v-if="item && item[0]"> <th v-if="item && item[0]">
{{ item[0].label }} {{ item[0].label }}
</th> </th>
<td v-if="item && item[0]" :class="item.blue ? 'blue' : ''"> <td v-if="item && item[0]" :class="item[0].blue ? 'blue' : ''">
{{ item[0].value }} {{ item[0].value }}
</td> </td>
<th v-if="item && item.length > 1"> <th v-if="item && item.length > 1">
{{ item[1].label }} {{ item[1].label }}
</th> </th>
<td v-if="item && item.length > 1" :class="item.blue ? 'blue' : ''"> <td v-if="item && item.length > 1" :class="item[1].blue ? 'blue' : ''">
{{ item[1].value }} {{ item[1].value }}
</td> </td>
</tr> </tr>
@ -82,7 +82,7 @@ function showActionsModal() {
color: #666666; color: #666666;
.icon { .icon {
margin-left: 7px margin-left: 7px;
} }
} }
} }

@ -1,15 +1,22 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'
import Aside from './aside/Aside.vue' import Aside from './aside/Aside.vue'
import Content from './content/Content.vue' import Content from './content/Content.vue'
const asideRef: any = ref(null)
function setAsideItemName(text) {
asideRef.value.setAsideItemName(text)
}
</script> </script>
<template> <template>
<div class="main"> <div class="main">
<!-- 侧边 --> <!-- 侧边 -->
<Aside /> <Aside ref="asideRef" />
<!-- 内容 --> <!-- 内容 -->
<Content /> <Content @set-aside-item-name="setAsideItemName" />
</div> </div>
</template> </template>

@ -251,7 +251,10 @@ 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) onList.value.splice(index, 1); if (index !== -1) {
onList.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;

@ -1,8 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { format } from 'date-fns'; import { format } from 'date-fns';
import { computed, onMounted } from "vue"; import { computed, onMounted, ref } from "vue";
import type { PackageListItem } from "/#/workorder"; import type { PackageListItem } from "/#/workorder";
defineOptions({ name: "ListItem" }); defineOptions({ name: "ListItem" });
const emit = defineEmits(['dismisClick'])
const props = defineProps({ const props = defineProps({
selected: { selected: {
@ -21,19 +23,22 @@ const props = defineProps({
type: Array, type: Array,
default: () => [], default: () => [],
}, },
mouseOverTask: {
type: Array,
default: () => [],
},
}); });
console.log(props.dicts, "dicts"); const isDismissTask = ref(false)
const svgName = computed(() => { const svgName = computed(() => {
return props.selected ? "taskpack-select" : "taskpack"; return props.selected ? "taskpack-select" : "taskpack";
}); });
function getValueByLabel(label) {
const result = props.dicts.filter(item => item.name === label)
if (result.length === 0) { function handleDismissTask() {
return "" isDismissTask.value = true
} else { emit('dismisClick', props.mouseOverTask.id)
return props.dicts.filter(item => item.name === label)[0].fieldDesc
}
} }
onMounted(async () => { onMounted(async () => {
}) })
</script> </script>
@ -45,8 +50,16 @@ onMounted(async () => {
<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 class="list-item-header-name" :class="{ 'list-item-header-selected': selected }">
<n-ellipsis style="max-width: 180px">
{{ listItem.name }} {{ listItem.name }}
</n-ellipsis>
<span class="list-item-header-selected">({{ listItem.pictureCount }})</span> <span class="list-item-header-selected">({{ listItem.pictureCount }})</span>
<n-popover placement="bottom" trigger="hover" >
<template #trigger>
<span class="dismiss-task-pack" v-show="mouseOverTask?.id" style="cursor: pointer;" @click.stop="handleDismissTask">...</span>
</template>
<span>解散任务包</span>
</n-popover>
</span> </span>
</div> </div>
</div> </div>
@ -63,7 +76,7 @@ onMounted(async () => {
提交时间{{ format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") }} 提交时间{{ format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") }}
</li> </li>
<li v-else-if="item.id === 'createTime'"> <li v-else-if="item.id === 'createTime'">
生成时间{{ format(listItem.createTime, "yyyy-MM-dd HH:mm:ss") }} 生成时间{{ listItem.createTime && format(listItem.createTime, "yyyy-MM-dd HH:mm:ss") }}
</li> </li>
<li v-else class="ellipsis" v-if="listItem[item.id]"> <li v-else class="ellipsis" v-if="listItem[item.id]">
<span class="label">{{ item.name }}</span>{{ listItem[item.id] }} <span class="label">{{ item.name }}</span>{{ listItem[item.id] }}
@ -103,16 +116,29 @@ onMounted(async () => {
margin-bottom: 6px margin-bottom: 6px
} }
.dismiss-task-pack {
position: absolute;
right: 15px;
}
.list-item-header-name { .list-item-header-name {
width: 226px; width: 250px;
font-size: 16px; font-size: 16px;
font-family: PingFang SC, PingFang SC-Medium; font-family: PingFang SC, PingFang SC-Medium;
font-weight: 700; font-weight: 700;
color: #333333; color: #333333;
margin-bottom: 0 0 8px 8px;
display: flex;
justify-content: flex-start;
align-items: center;
.list-item-title {
width: 200px;
display: inline-block;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-bottom: 0 0 8px 8px; }
} }
&-name { &-name {

@ -1,9 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import { deletePackage } from '@/api/home/main'
import NotPassed from '@/components/NotPassed.vue' import NotPassed from '@/components/NotPassed.vue'
import { useWorkOrder } from '@/store/modules/workOrder' import { useWorkOrder } from '@/store/modules/workOrder'
import { isEmpty } from '@/utils' import { isEmpty } from '@/utils'
import { useInfiniteScroll } from '@vueuse/core' import { useInfiniteScroll } from '@vueuse/core'
import { reactive, ref, unref, watch } from 'vue' import { useMessage } from 'naive-ui'
import { reactive, ref, watch } from 'vue'
import ApprovalModal from '../modal/ApprovalModal.vue' import ApprovalModal from '../modal/ApprovalModal.vue'
import ListItem from './ListItem.vue' import ListItem from './ListItem.vue'
import type { PackageListItem } from '/#/workorder' import type { PackageListItem } from '/#/workorder'
@ -33,11 +35,7 @@ const pagination = reactive({
const approvalModalRef = ref(null) const approvalModalRef = ref(null)
const notPassedRef: any = ref(null) const notPassedRef: any = ref(null)
const overTask = ref<any>(null);
function showModal(modalRef: any, id) {
const modal = unref(modalRef)! as any
modal.showModal(id)
}
function selectHandler(id: string, index: number) { function selectHandler(id: string, index: number) {
workStore.setActive(index) workStore.setActive(index)
@ -125,7 +123,21 @@ async function search(word: string) {
{ distance: 10, canLoadMore: () => canloadMore.value }, { distance: 10, canLoadMore: () => canloadMore.value },
) )
} }
function overTaskHandelr(item: any) {
overTask.value = item
}
function leaveTaskHandler() {
overTask.value = null;
}
const message = useMessage()
function dismisClick(packageId:string) {
deletePackage({packageId: packageId}).then((res) => {
if(res.code==="OK"){
message.success("解散任务包成功")
loadMore()
}
})
}
defineExpose({ defineExpose({
search, search,
}) })
@ -143,7 +155,11 @@ defineExpose({
:list-item="item" :list-item="item"
:show-field-list="showFieldList" :show-field-list="showFieldList"
:dicts="dicts" :dicts="dicts"
:mouse-over-task="overTask"
@click="selectHandler(item.id, index)" @click="selectHandler(item.id, index)"
@mouseover="overTaskHandelr(item)"
@mouseleave="leaveTaskHandler"
@dismisClick="dismisClick"
/> />
</div> </div>
</n-spin> </n-spin>

@ -21,7 +21,7 @@ import { computed, onUnmounted, onUpdated, reactive, ref, unref, watch } from "v
import ConfrimModal from "../modal/ConfrimModal.vue"; import ConfrimModal from "../modal/ConfrimModal.vue";
import type { ApprovalParam, SimilarityPictureSortParam } from "/#/api"; import type { ApprovalParam, SimilarityPictureSortParam } from "/#/api";
const batch = ref(false); const batch = ref(false); //
const selectItems = ref<any[]>([]); const selectItems = ref<any[]>([]);
const message = useMessage(); const message = useMessage();
const dialog = useDialog(); const dialog = useDialog();
@ -29,7 +29,11 @@ const totalCount = ref(0);
let _imagesload: any; let _imagesload: any;
function setBatch(value: boolean) { function setBatch(value: boolean) {
if (value && batch.value) {
batch.value = !value;
} else {
batch.value = value; batch.value = value;
}
if (value === false) { if (value === false) {
selectItems.value.forEach((item) => (item.checked = false)); selectItems.value.forEach((item) => (item.checked = false));
selectItems.value.length = 0; selectItems.value.length = 0;
@ -53,7 +57,7 @@ const taskpagination = reactive({
pageSize: 10, pageSize: 10,
}); });
const sortBy: SimilarityPictureSortParam = { const sortBy: SimilarityPictureSortParam = {
orderType: "asc", orderType: "desc",
orderName: "similarityScore", orderName: "similarityScore",
}; };
const workStore = useWorkOrder(); const workStore = useWorkOrder();
@ -234,7 +238,7 @@ async function handleSelect(item: any) {
async function sortHandler(orderby: "similarityScore" | "createdate") { async function sortHandler(orderby: "similarityScore" | "createdate") {
selectedSortName.value = orderby; selectedSortName.value = orderby;
sortBy.orderName = orderby; sortBy.orderName = orderby;
sortBy.orderType = sortBy.orderType === "asc" ? "desc" : "asc"; sortBy.orderType = sortBy.orderType === "desc" ? "desc" : "asc";
refreshHandler(); refreshHandler();
} }
@ -270,6 +274,9 @@ function immersionHandler() {
function showAction() { function showAction() {
const item = taskDetailInfo.value; const item = taskDetailInfo.value;
if (item.states === 2 || item.states === 3) {
return
}
if (batch.value === false) overTask.value = item; if (batch.value === false) overTask.value = item;
} }
@ -309,12 +316,7 @@ function approvalHandler(items?: any) {
processItems = selectItems.value processItems = selectItems.value
} }
else if (overTask.value) { else if (overTask.value) {
// => => /
cloneItem = clone(overTask.value) cloneItem = clone(overTask.value)
//
// if (!cloneItem.taskId) {
// cloneItem.taskId = "taskIdtaskIdtaskIdtaskIdtaskId"
// }
processItems = [cloneItem] processItems = [cloneItem]
} }
// => => / // => => /
@ -328,31 +330,37 @@ function approvalHandler(items?: any) {
return return
} }
const list: any = []
processItems.forEach((item) => {
list.push({
formId: item.id,
taskId: item.taskId,
taskName: item.fromTaskName,
})
})
const param = {
result: true,
comment: '',
disposeType: '',
disposeTypeId: '',
failCauseId: '',
failCauseName: '',
flowTaskInfoList: list,
}
dialog.info({ dialog.info({
title: '确认提示', title: '确认提示',
content: '确认给该任务审批为【通过】吗?', content: '确认给该任务审批为【通过】吗?',
positiveText: '确定', positiveText: '确定',
negativeText: '取消', negativeText: '取消',
onPositiveClick: () => { onPositiveClick: () => {
approval() doAudit(param)
}, },
onNegativeClick: () => { }, onNegativeClick: () => { },
}) })
} }
function approval() {
const formIds: string[] = processItems.map(item => item.id)
const taskIds: string[] = processItems.map(item => item.taskId)
const tasknames: string[] = processItems.map(item => item.taskname)
const param: ApprovalParam = {
formid: formIds,
taskId: taskIds,
approvd: true,
taskComment: 'approval',
taskname: tasknames,
}
doAudit(param)
}
function doAudit(param: any) { function doAudit(param: any) {
audit(param).then((res) => { audit(param).then((res) => {
const { code } = res const { code } = res
@ -366,7 +374,8 @@ function doAudit(param: any) {
} }
function reloadList() { function reloadList() {
loadMore() setBatch(false)
refreshHandler()
} }
</script> </script>
@ -385,7 +394,8 @@ function reloadList() {
批量审批 批量审批
</div> </div>
<div class="icon-wrap"> <div class="icon-wrap">
<SvgIcon size="20" name="immersion-model" @click="immersionHandler" /> <SvgIcon size="20" v-if="isFullScreen" name="power-off" @click="immersionHandler" style="cursor: pointer;"/>
<SvgIcon size="20" v-else name="immersion-model" @click="immersionHandler" style="cursor: pointer;"/>
</div> </div>
</div> </div>
@ -428,8 +438,8 @@ function reloadList() {
</div> </div>
</div> </div>
<div class="status"> <div class="status">
<img v-show="taskDetailInfo?.states === 3" class="img-status" src="@/assets/images/task/pass.png" alt=""> <img v-show="taskDetailInfo?.states === 2" class="img-status" src="@/assets/images/task/pass.png" alt="">
<img v-show="taskDetailInfo?.states === 5" class="img-status" src="@/assets/images/task/not_pass.png" <img v-show="taskDetailInfo?.states === 3" class="img-status" src="@/assets/images/task/not_pass.png"
alt=""> alt="">
</div> </div>
<!-- 右下信息 --> <!-- 右下信息 -->
@ -474,7 +484,7 @@ function reloadList() {
<!-- 右侧任务 标题信息 --> <!-- 右侧任务 标题信息 -->
<div class="right"> <div class="right">
<n-scrollbar style="max-height: 100%"> <n-scrollbar style="max-height: 100%">
<span class="task-name">任务ID{{ taskDetailInfo.taskname }}</span> <n-ellipsis style="max-width: 350px">任务ID{{ taskDetailInfo.taskname }}</n-ellipsis>
<div class="tags"> <div class="tags">
<div class="tag tag-submiting" v-if="taskDetailInfo.states == 1">{{ TASK_STATUS_OBJ[taskDetailInfo.states] <div class="tag tag-submiting" v-if="taskDetailInfo.states == 1">{{ TASK_STATUS_OBJ[taskDetailInfo.states]
}}</div> }}</div>
@ -490,7 +500,7 @@ function reloadList() {
<div class="property"> <div class="property">
<span class="property-name top" style=" color: #666666">图片大小 <span class="property-name top" style=" color: #666666">图片大小
</span> </span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo && <span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo && taskDetailInfo?.pictureInfo?.imgSize&&
(taskDetailInfo?.pictureInfo?.imgSize / 1000).toFixed(2) }}KB</span> (taskDetailInfo?.pictureInfo?.imgSize / 1000).toFixed(2) }}KB</span>
</div> </div>
<div class="property"> <div class="property">
@ -511,19 +521,18 @@ function reloadList() {
<div class="property"> <div class="property">
<span class="property-name top" style=" color: #666666">提报人 <span class="property-name top" style=" color: #666666">提报人
</span> </span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo?.source || "-" }}</span> <span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.upname || "-" }}</span>
</div> </div>
<div class="property"> <div class="property">
<span class="property-name top" style=" color: #666666">创建时间 <span class="property-name top" style=" color: #666666">创建时间
</span> </span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo && <span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo && taskDetailInfo?.pictureInfo.createTime }}</span>
format(taskDetailInfo?.pictureInfo?.createTime, 'yyyy-MM-dd HH:mm:ss') }}</span>
</div> </div>
<div class="property"> <div class="property">
<span class="property-name top" style=" color: #666666">提报时间 <span class="property-name top" style=" color: #666666">提报时间
</span> </span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.uploadTime && <span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.submitDateTimestamp &&
format(taskDetailInfo?.pictureInfo?.uploadTime, 'yyyy-MM-dd HH:mm:ss') || '-' }}</span> format(taskDetailInfo?.submitDateTimestamp, 'yyyy-MM-dd HH:mm:ss') || '-' }}</span>
</div> </div>
<div v-for="key in Object.keys(propertys)" :key="key" class="property"> <div v-for="key in Object.keys(propertys)" :key="key" class="property">
<span class="property-name">{{ fieldMap[key] }}</span> <span class="property-name">{{ fieldMap[key] }}</span>
@ -571,7 +580,7 @@ function reloadList() {
</div> </div>
</div> </div>
<div class="check"> <div class="check">
<n-checkbox v-show="batch" v-model:checked="item.checked" @click.stop <n-checkbox v-show="batch && item.historyStates !== 2 && item.historyStates !== 3" v-model:checked="item.checked" @click.stop
@update:checked="onCheckChange($event, item)" /> @update:checked="onCheckChange($event, item)" />
</div> </div>
<div class="percent"> <div class="percent">
@ -909,8 +918,8 @@ function reloadList() {
} }
.tag-passed { .tag-passed {
color: #02C984; color: #ff7575;
border: 1px solid #02C984; border: 1px solid #ff7575;
} }
.tag-approved { .tag-approved {

@ -1,101 +1,104 @@
<script lang="ts" setup> <script lang="ts" setup>
import { reactive, ref, toRefs } from 'vue' import { onMounted, reactive, ref, toRefs } from "vue";
import { format } from 'date-fns' import { format } from "date-fns";
import { NButton, NDataTable, useDialog, useMessage } from 'naive-ui' import { NButton, NDataTable, useDialog, useMessage } from "naive-ui";
import { aiApprovaltools, aiApprovaltoolsClearmark } from '@/api/work/work' import { aiApprovaltools, aiApprovaltoolsClearmark } from "@/api/work/work";
import { getToolsCount } from "@/api/home/main";
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'reject', params: any) (e: "reject", params: any);
(e: 'notPass', params: any) (e: "notPass", params: any);
}>() }>();
const dialog = useDialog() const dialog = useDialog();
const state: any = reactive({ const state: any = reactive({
detail: {}, detail: {},
taskId: '', taskId: "",
}) });
const { detail } = toRefs(state) const { detail } = toRefs(state);
const cardStyle = { const cardStyle = {
'width': '450px', width: "450px",
'--n-padding-bottom': '10px', "--n-padding-bottom": "10px",
'--n-padding-left': '0px', "--n-padding-left": "0px",
} };
const show = ref(false) const show = ref(false);
function showModal(id) { function showModal(id) {
console.log(id) console.log(id);
state.taskId = id state.taskId = id;
getDetail(id) getDetail(id);
} }
async function getDetail(id) { async function getDetail(id) {
const res = await aiApprovaltools({ taskid: id }) const res = await aiApprovaltools({ taskid: id });
if (res.code === 'OK') { if (res.code === "OK") {
state.detail = res.data state.detail = res.data;
show.value = true show.value = true;
} }
console.log(res) console.log(res);
} }
async function clearMark() { async function clearMark() {
const res = await aiApprovaltoolsClearmark({ taskid: state.taskId }) const res = await aiApprovaltoolsClearmark({ taskid: state.taskId });
if (res.code === 'OK') if (res.code === "OK") closeModal();
closeModal()
} }
function closeModal() { function closeModal() {
show.value = false show.value = false;
} }
async function reject() { async function reject() {
// emit('reject', { a: 'todo' }) // emit('reject', { a: 'todo' })
// closeModal() // closeModal()
dialog.info({ dialog.info({
title: '确认提示', title: "确认提示",
content: '确认设置成假吗?', content: "确认设置成假吗?",
positiveText: '确定', positiveText: "确定",
negativeText: '取消', negativeText: "取消",
onPositiveClick: async () => { onPositiveClick: async () => {
// TODO // TODO
// const result = await resetApproval() // const result = await resetApproval()
clearMark() clearMark();
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}) });
} }
async function viewRepeat(e: MouseEvent) { async function viewRepeat(e: MouseEvent) {
emit('notPass', { emit("notPass", {
id: state.taskId, id: state.taskId,
detail: state.detail, detail: state.detail,
}) });
e.preventDefault() e.preventDefault();
closeModal() closeModal();
}
async function getShowStatus() {
const res = await getToolsCount();
if (!JSON.parse(res.message)) {
show.value = true;
} }
}
onMounted(() => {
getShowStatus();
});
defineExpose({ defineExpose({
showModal, showModal,
}) });
</script> </script>
<template> <template>
<n-modal v-model:show="show" transform-origin="center" class="modal_wrap"> <n-modal v-model:show="show" transform-origin="center" class="modal_wrap">
<div class="wrapper"> <div class="wrapper">
<div class="closed"> <div class="closed">
<SvgIcon <SvgIcon style="cursor: pointer" name="cut-down" width="32" @click="closeModal" />
style="cursor: pointer"
name="cut-down"
width="32"
@click="closeModal"
/>
</div> </div>
<div class="wrapper-hearder"> <div class="wrapper-hearder">
<div class="wrapper-title"> <div class="wrapper-title">智能AI审批工具</div>
智能AI审批工具
</div>
<div class="wrapper-mark"> <div class="wrapper-mark">
{{ detail.tenantusername }} {{ detail.tenantusername }}
</div> </div>
@ -105,25 +108,20 @@ defineExpose({
<div v-for="i in 1" :key="i" class="item"> <div v-for="i in 1" :key="i" class="item">
<div class="imgwrapper" /> <div class="imgwrapper" />
<div class="content"> <div class="content">
<div class="task_id"> <div class="task_id">任务ID{{ detail.taskid }}</div>
任务ID{{ detail.taskid }}
</div>
<div class="tag_box"> <div class="tag_box">
<div class="tag_item"> <div class="tag_item">基线任务</div>
基线任务 <div class="tag_item error">相似图片({{ detail.similarcount }})</div>
</div>
<div class="tag_item error">
相似图片({{ detail.similarcount }})
</div>
</div> </div>
<div class="time_box"> <div class="time_box">
{{ format(detail.createtime, 'yyyy-MM-dd HH:mm:ss') }} {{ format(detail.createtime, "yyyy-MM-dd HH:mm:ss") }}
</div> </div>
</div> </div>
</div> </div>
</n-scrollbar> </n-scrollbar>
<div class="mark_text"> <div class="mark_text">
智能识别{{ detail.similarComplete }}张图片来源于网络建议将图片标记为假 快速审批不通过 智能识别{{ detail.similarComplete }}张图片来源于网络建议将图片标记为假
快速审批不通过
</div> </div>
<div class="footer"> <div class="footer">
<SvgIcon <SvgIcon

Loading…
Cancel
Save