Merge branch 'test' into jie

pull/21/head
lizijiee 1 year ago
commit 5454c7e3f6

@ -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

@ -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)
@ -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) }

@ -1,20 +1,29 @@
<script lang="ts"> <script lang="ts">
import { useDialog, useMessage } from 'naive-ui' import { useDialog, useMessage } from "naive-ui";
import { defineComponent, inject, onMounted, reactive, ref, toRefs, unref, watch } from 'vue' import {
import { useRoute, useRouter } from 'vue-router' defineComponent,
import QuillModal from './QuillModal.vue' inject,
import RecycleModal from './RecycleModal.vue' onMounted,
import SearchModal from './SearchModal.vue' reactive,
import ShortcutModal from './ShortcutModal.vue' ref,
import UserSettings from './UserSettings.vue' toRefs,
import { msgPolling } from '@/api/message/message' unref,
import { getImgUrl } from '@/utils/urlUtils' watch,
import { useUser } from '@/store/modules/user' } from "vue";
import { useTaskStore } from '@/store/modules/task' import { useRoute, useRouter } from "vue-router";
import QuillModal from "./QuillModal.vue";
const taskStore = useTaskStore() import RecycleModal from "./RecycleModal.vue";
import SearchModal from "./SearchModal.vue";
import ShortcutModal from "./ShortcutModal.vue";
import UserSettings from "./UserSettings.vue";
import { msgPolling } from "@/api/message/message";
import { getImgUrl } from "@/utils/urlUtils";
import { useUser } from "@/store/modules/user";
import { useTaskStore } from "@/store/modules/task";
const taskStore = useTaskStore();
export default defineComponent({ export default defineComponent({
name: 'PageHeader', name: "PageHeader",
components: { components: {
UserSettings, UserSettings,
QuillModal, QuillModal,
@ -30,139 +39,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);
});
return { return {
...toRefs(state), ...toRefs(state),
@ -183,9 +190,9 @@ export default defineComponent({
getMessage, getMessage,
handleDragOver, handleDragOver,
handleDragLeave, handleDragLeave,
} };
}, },
}) });
</script> </script>
<template> <template>
@ -207,8 +214,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" />
@ -326,9 +341,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;
} }
} }

@ -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;
} }
@ -335,12 +336,19 @@ const showSearch = computed(() => {
<div class="del_btn"> <div class="del_btn">
<n-button icon-placement="left" size="medium"> <n-button icon-placement="left" size="medium">
<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>
@ -400,11 +408,10 @@ const showSearch = computed(() => {
width: 300px; width: 300px;
border: 1px solid gray; border: 1px solid gray;
} }
.del_btn{ .del_btn {
} }
.msg{ .msg {
a{ a {
margin-left: 30px; margin-left: 30px;
cursor: pointer; cursor: pointer;
color: #507afd; color: #507afd;

@ -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

@ -248,6 +248,19 @@ async function formatColumns() {
} }
} }
index = columnsRef.value.findIndex(v => v.title == '所属项目')
if (index > -1) {
columnsRef.value[index] = {
title: '所属项目',
key: columnsRef.value[index].key, // "fromtaskname"
fixed: columnsRef.value[index].fixed || undefined,
width: 200,
ellipsis: {
tooltip: true,
},
}
}
index = columnsRef.value.findIndex(v => v.title == '任务名称') index = columnsRef.value.findIndex(v => v.title == '任务名称')
if (index > -1) { if (index > -1) {
columnsRef.value[index] = { columnsRef.value[index] = {
@ -575,10 +588,10 @@ function actionHandler(action: any, row: any) {
resetHandler() resetHandler()
break break
case 'approval': case 'approval':
approvalHandler(row) singleApproval(row)
break break
case 'reject': case 'reject':
rejectHandler(row) rejectHandler([row])
break break
default: default:
break break
@ -630,26 +643,24 @@ function getSelectItems() {
return tableData.value.filter(item => selectionIds.value.includes(item.id)) return tableData.value.filter(item => selectionIds.value.includes(item.id))
} }
function approvalHandler(row) { //
// const items = getSelectItems() function singleApproval(row) {
const items = [row] const param = {
const msg = validate(items) result: true,
comment: '',
if (msg !== null) { disposeType: '',
message.error(msg) disposeTypeId: '',
return failCauseId: '',
failCauseName: '',
flowTaskInfoList: [
{
formId: row.id,
taskId: row.taskId,
taskName: row.fromTaskName,
},
],
} }
doAudit(param)
dialog.info({
title: '确认提示',
content: '确认给该任务审批为【通过】吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
approval(items)
},
onNegativeClick: () => {},
})
} }
function batchApproval() { function batchApproval() {
@ -673,26 +684,25 @@ function batchApproval() {
}) })
} }
function approval(items) { // function approval(items) {
const formIds: string[] = items.map(item => item.id) // const formIds: string[] = items.map(item => item.id)
const taskIds: string[] = items.map(item => item.taskId) // const taskIds: string[] = items.map(item => item.taskId)
const tasknames: string[] = items.map(item => item.taskname) // const tasknames: string[] = items.map(item => item.taskname)
const param: ApprovalParam = { // const param: ApprovalParam = {
formid: formIds, // formid: formIds,
taskId: taskIds, // taskId: taskIds,
approvd: true, // approvd: true,
taskComment: 'approval', // taskComment: 'approval',
taskname: tasknames, // taskname: tasknames,
} // }
doAudit(param) // doAudit(param)
} // }
function rejectHandler(row) { //
// const items = getSelectItems() function rejectHandler(list) {
const items = [row] const msg = validate(list)
const msg = validate(items)
if (msg !== null) { if (msg !== null) {
message.error(msg) message.error(msg)
@ -700,7 +710,7 @@ function rejectHandler(row) {
} }
const modal = unref(notPassModalRef)! as any const modal = unref(notPassModalRef)! as any
modal.showModal() modal.showModal(list)
} }
function reject(idOrDesc: string, backId: string, isOther: boolean) { function reject(idOrDesc: string, backId: string, isOther: boolean) {
@ -720,15 +730,6 @@ function reject(idOrDesc: string, backId: string, isOther: boolean) {
doAudit(param) doAudit(param)
} }
function doAudit(param: any) {
audit(param).then((res) => {
const { code } = res
if (code === 'OK')
reload()
else message.error(res.message)
})
}
function reload() { function reload() {
const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps
query(page!, pageSize!) query(page!, pageSize!)
@ -751,6 +752,27 @@ async function refreshHandler(searchId?: any) {
reset() reset()
query(pagination.page, pagination.pageSize, searchId) query(pagination.page, pagination.pageSize, searchId)
} }
//
function doAudit(param: any) {
dialog.info({
title: '确认提示',
content: '确认给该任务审批为【通过】吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
audit(param).then((res) => {
const { code } = res
if (code === 'OK') {
message.success('审核成功')
reload()
}
else { message.error(res.message) }
})
},
onNegativeClick: () => {},
})
}
</script> </script>
<template> <template>
@ -837,7 +859,7 @@ async function refreshHandler(searchId?: any) {
:on-success="sucessHandler" :on-success="sucessHandler"
:header-config="headRules" :header-config="headRules"
/> />
<NotPassed ref="notPassModalRef" @success="reloadList" /> <NotPassed ref="notPassModalRef" @success="reload" />
<RepeatModal <RepeatModal
ref="repeatModalRef" ref="repeatModalRef"

@ -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,
@ -12,18 +12,21 @@ defineProps({
}, },
select: { select: {
type: Function as PropType<Function>, type: Function as PropType<Function>,
default: () => { }, default: () => {},
}, },
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;
@ -27,7 +30,7 @@ const emit = defineEmits<{
const data = ref<FilterEntity[]>([]); const data = ref<FilterEntity[]>([]);
const unData = ref<FilterEntity[]>([]); const unData = ref<FilterEntity[]>([]);
const loading = ref(false); const loading = ref(false);
const canloadMore = true; const canloadMore = true;
const el = ref<HTMLDivElement | null>(null); const el = ref<HTMLDivElement | null>(null);
const popover = ref<ComponentRef | null>(null); const popover = ref<ComponentRef | null>(null);
@ -74,8 +77,8 @@ 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,29 +254,37 @@ 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-input <n-form :rules="rules" ref="ruleformRef" :model="ruleForm">
:style="{ '--n-border': '0px' }" <n-form-item path="keyword">
placeholder="请输入关键词" <n-input
@input="inputHandler" :style="{ '--n-border': '0px' }"
> placeholder="请输入关键字"
<template #prefix> @input="inputHandler"
<SvgIcon size="14px" name="magnifying-1" /> :value="ruleForm.keyword"
</template> :minlength="2"
<template #suffix> >
<SvgIcon <template #prefix>
size="14px" <SvgIcon size="14px" name="magnifying-1" />
style="cursor: pointer" </template>
name="setting" <template #suffix>
@click="emit('show-filter')" <SvgIcon
/> size="14px"
</template> style="cursor: pointer"
</n-input> name="setting"
@click="emit('show-filter')"
/>
</template>
</n-input>
</n-form-item>
</n-form>
<ul ref="el" class="wrapper-left-list"> <ul ref="el" class="wrapper-left-list">
<li <li
@ -264,23 +293,28 @@ 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"
color="#fd9b0a" color="#fd9b0a"
size="18" size="18"
style="margin-right:3px" style="margin-right: 3px"
@click="unFavoriteHandler($event, item)" @click="unFavoriteHandler($event, item)"
/> />
<SvgIcon <SvgIcon
v-else-if="!item.favorite && !item.isDefaultFilter" v-else-if="!item.favorite && !item.isDefaultFilter"
name="favorite-unfill" name="favorite-unfill"
size="18" size="18"
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
@ -298,14 +332,14 @@ const moveEnd = () => {
class="cursor-move draggable-li fix" class="cursor-move draggable-li fix"
:draggable="true" :draggable="true"
> >
<SvgIcon name="drag" size="18" style="margin-right:3px"/> <SvgIcon name="drag" size="18" style="margin-right: 3px" />
<SvgIcon <SvgIcon
v-if="item.favorite && !item.isDefaultFilter" v-if="item.favorite && !item.isDefaultFilter"
name="favorite-fill" name="favorite-fill"
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

@ -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)"

@ -1,24 +1,30 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from 'vue' import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from "vue";
import { chunk, clone } from 'lodash-es' import { chunk, clone } from "lodash-es";
import { useDialog, useMessage } from 'naive-ui' import { useDialog, useMessage } from "naive-ui";
import { useRoute } from 'vue-router' import { useRoute } from "vue-router";
import BatchModal from '../modal/BatchModal.vue' import BatchModal from "../modal/BatchModal.vue";
import CustomSettingModal from '../modal/CustomSettingModal.vue' import CustomSettingModal from "../modal/CustomSettingModal.vue";
import PictureTable from './PictureTable.vue' import PictureTable from "./PictureTable.vue";
import TaskTable from './TaskTable.vue' import TaskTable from "./TaskTable.vue";
import History from './History.vue' import History from "./History.vue";
import NotPassed from '@/components/Approval/NotPassed.vue' 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 {
import { useTask } from '@/store/modules/task' audit,
import { useUser } from '@/store/modules/user' dubiousfileyd,
import { isEmpty } from '@/utils' getSimilarityList,
import { formatToDateHMS } from '@/utils/dateUtil' getTaskDetailInfo,
import { hideDownload } from '@/utils/image' } from "@/api/task/task";
import { useTask } from "@/store/modules/task";
import { useUser } from "@/store/modules/user";
import { isEmpty } from "@/utils";
import { formatToDateHMS } from "@/utils/dateUtil";
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()
@ -33,71 +39,69 @@ const taskTableData = ref<any[]>([])
const route = useRoute() const route = useRoute()
const sortBy: any = { const sortBy: any = {
orderType: 'desc', orderType: "desc",
orderName: 'similarityScore', orderName: "similarityScore",
} };
function setBatch(value: boolean) { function setBatch(value: boolean) {
if (totalCount.value === 0) if (totalCount.value === 0) return;
return
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) {
const index = selectItems.value.indexOf(item) const index = selectItems.value.indexOf(item);
item.checked = checked item.checked = checked;
if (index === -1 && checked) if (index === -1 && checked) selectItems.value.push(item);
selectItems.value.push(item) else selectItems.value.splice(index, 1);
else selectItems.value.splice(index, 1)
} }
const showActions = computed(() => { const showActions = computed(() => {
return selectItems.value.length > 0 && batch return selectItems.value.length > 0 && batch;
}) });
const taskpagination = reactive({ const taskpagination = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
}) });
const taskStore = useTask() const taskStore = useTask();
const overTask = ref<any>(null) const overTask = ref<any>(null);
const taskDetailInfo = ref<any>({}) const taskDetailInfo = ref<any>({});
const taskDetailPictureList = ref<any[]>([]) const taskDetailPictureList = ref<any[]>([]);
const userStore = useUser() const userStore = useUser();
const imageRef = ref<ComponentElRef | null>() const imageRef = ref<ComponentElRef | null>();
let processItems: any[] = [] let processItems: any[] = [];
onMounted(() => { onMounted(() => {
window.addEventListener('keydown', handleKeydown) window.addEventListener("keydown", handleKeydown);
if (route.query.id) { if (route.query.id) {
taskId.value = route.query.id taskId.value = route.query.id;
packageId.value = route.query.packageid packageId.value = route.query.packageid;
getDetail() getDetail();
} }
}) });
// //
function handleKeydown(event) { function handleKeydown(event) {
if (event.key === 'ArrowLeft') if (event.key === "ArrowLeft") backHandler();
backHandler()
// //
else if (event.key === 'ArrowRight') else if (event.key === "ArrowRight") forwardHandler();
forwardHandler()
// //
} }
// 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) return "至少选中一个任务";
return '至少选中一个任务'
// const useInfo = userStore.getUserInfo // const useInfo = userStore.getUserInfo
// const username = useInfo.loginname // const username = useInfo.loginname
@ -114,226 +118,215 @@ function validate(items: any[]) {
// return '' // return ''
// } // }
return null return null;
} }
function approvalHandler(items?: any) { function approvalHandler(items?: any) {
let cloneItem: any let cloneItem: any;
if (batch.value) { if (batch.value) {
processItems = selectItems.value processItems = selectItems.value;
} } else if (overTask.value) {
else if (overTask.value) { cloneItem = clone(overTask.value);
cloneItem = clone(overTask.value) processItems = [cloneItem];
processItems = [cloneItem]
} }
if (items !== undefined && !(items instanceof PointerEvent)) if (items !== undefined && !(items instanceof PointerEvent)) processItems = items;
processItems = items
const msg = validate(processItems) const msg = validate(processItems);
if (msg !== null) { if (msg !== null) {
message.error(msg) message.error(msg);
return return;
} }
const list: any = [] const list: any = [];
processItems.forEach((item) => { processItems.forEach((item) => {
list.push({ list.push({
formId: item.id, formId: item.id,
taskId: item.taskId, taskId: item.taskId,
taskName: item.fromTaskName, taskName: item.fromTaskName,
}) });
}) });
const param = { const param = {
result: true, result: true,
comment: '', comment: "",
disposeType: '', disposeType: "",
disposeTypeId: '', disposeTypeId: "",
failCauseId: '', failCauseId: "",
failCauseName: '', failCauseName: "",
flowTaskInfoList: list, flowTaskInfoList: list,
} };
dialog.info({ dialog.info({
title: '确认提示', title: "确认提示",
content: '确认给该任务审批为【通过】吗?', content: "确认给该任务审批为【通过】吗?",
positiveText: '确定', positiveText: "确定",
negativeText: '取消', negativeText: "取消",
onPositiveClick: () => { onPositiveClick: () => {
doAudit(param) doAudit(param);
}, },
onNegativeClick: () => {}, onNegativeClick: () => {},
}) });
} }
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) }
})
} }
function showModal(modalRef: any) { function showModal(modalRef: any) {
const modal = unref(modalRef)! as any const modal = unref(modalRef)! as any;
modal.showModal() modal.showModal();
} }
function forwardHandler() { function forwardHandler() {
taskStore.forward() taskStore.forward();
} }
function backHandler() { function backHandler() {
taskStore.back() taskStore.back();
} }
async function handleDragEnd(event, item) { 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();
} else {
message.error(res.message);
} }
else { taskStore.setInFile(false);
message.error(res.message)
}
taskStore.setInFile(false)
} }
} }
async function getTableData() { async function getTableData() {
const useInfo = userStore.getUserInfo const useInfo = userStore.getUserInfo;
const listData = [] const listData = [];
const reviewType = 3 // const reviewType = 3; //
let res = await getAllfieldList(reviewType) let res = await getAllfieldList(reviewType);
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);
} }
}) });
taskTableData.value = chunk(listData, 2) taskTableData.value = chunk(listData, 2);
} }
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;
) totalCount.value = total;
taskDetailPictureList.value = data } else {
totalCount.value = total taskDetailPictureList.value.length = 0;
} totalCount.value = 0;
else {
taskDetailPictureList.value.length = 0
totalCount.value = 0
} }
} }
// 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) {
overTask.value = null overTask.value = null;
return return;
} }
if (validate([item]) == null && batch.value === false) if (validate([item]) == null && batch.value === false) overTask.value = item;
overTask.value = item
} }
function leaveTaskHandler() { function leaveTaskHandler() {
overTask.value = null overTask.value = null;
} }
function showActionsModal() { function showActionsModal() {
const modal = unref(CustomSettingModalRef)! as any const modal = unref(CustomSettingModalRef)! as any;
modal.showModal() modal.showModal();
} }
onUnmounted(() => { onUnmounted(() => {
taskStore.reset() taskStore.reset();
window.removeEventListener('keydown', handleKeydown) window.removeEventListener("keydown", handleKeydown);
}) });
function immersionHandler() { function immersionHandler() {
taskStore.updateImmersion() taskStore.updateImmersion();
} }
function previewHandler(event: MouseEvent) { function previewHandler(event: MouseEvent) {
event.stopImmediatePropagation() event.stopImmediatePropagation();
event.stopPropagation() event.stopPropagation();
if (imageRef.value && (imageRef.value as any).src) if (imageRef.value && (imageRef.value as any).src)
(imageRef.value as any).mergedOnClick() (imageRef.value as any).mergedOnClick();
} }
watch( watch(
() => [taskStore.activeId], () => [taskStore.activeId],
() => { () => {
packageId.value = taskStore.getPackageid if (!isEmpty(taskStore.getActiveId)) {
taskId.value = taskStore.getActiveId packageId.value = taskStore.getPackageid
getDetail() taskId.value = taskStore.getActiveId
getDetail()
}
}, },
) )
// //
async function getDetail() { async function getDetail() {
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value) taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value);
setBatch(false) setBatch(false);
getTableData() getTableData();
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>
@ -343,24 +336,11 @@ function reloadList() {
<div class="wrapper-header"> <div class="wrapper-header">
<div class="left"> <div class="left">
<span class="font">任务ID{{ taskDetailInfo.fromtaskname }}</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 +371,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 +381,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 +420,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,56 +433,65 @@ 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">
<span> <span>
<img class="icon-status" src="@/assets/images/task/status.png" alt=""> <img class="icon-status" src="@/assets/images/task/status.png" alt="" />
</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 +515,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 +536,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 +574,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 +587,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 +604,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;
} }
@ -612,49 +623,48 @@ function reloadList() {
} }
} }
.icon-wrap{ .icon-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
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;
} }
.img-info{ .img-info {
.icon-status{ .icon-status {
width: 32px; width: 32px;
height: 32px; height: 32px;
} }
.label{ .label {
font-size: 11px; font-size: 11px;
font-family: PingFang SC, PingFang SC-Medium; font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
} }
.value{ .value {
font-size: 15px; font-size: 15px;
font-family: PingFang SC, PingFang SC-Semibold; font-family: PingFang SC, PingFang SC-Semibold;
font-weight: 600; font-weight: 600;
color: #ffffff; color: #ffffff;
} }
.num{ .num {
font-size: 18px; font-size: 18px;
font-family: PingFang SC, PingFang SC-Semibold; font-family: PingFang SC, PingFang SC-Semibold;
font-weight: 600; font-weight: 600;
color: #ffffff; color: #ffffff;
} }
.unit{ .unit {
font-size: 11px; font-size: 11px;
} }
} }
.wrapper { .wrapper {
display: flex; display: flex;
@ -717,13 +727,13 @@ function reloadList() {
display: flex; display: flex;
align-items: center; align-items: center;
.btn-approval{ .btn-approval {
width: 68px; width: 68px;
height: 28px; height: 28px;
cursor: pointer; cursor: pointer;
} }
.btn-left{ .btn-left {
margin-left: 16px; margin-left: 16px;
} }
} }
@ -749,10 +759,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;
@ -806,7 +837,7 @@ function reloadList() {
left: 16px; left: 16px;
bottom: 16px; bottom: 16px;
.time-item{ .time-item {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 14px; font-size: 14px;
@ -816,12 +847,12 @@ function reloadList() {
margin-bottom: 4px; margin-bottom: 4px;
} }
.time-item2{ .time-item2 {
margin-bottom: 0; margin-bottom: 0;
} }
.svg-time{ .svg-time {
margin-right: 5px margin-right: 5px;
} }
} }
@ -837,20 +868,20 @@ function reloadList() {
justify-content: center; justify-content: center;
} }
.check{ .check {
position: absolute; position: absolute;
z-index: 3; z-index: 3;
left: 2%; left: 2%;
top: 2%; top: 2%;
} }
.status{ .status {
position: absolute; position: absolute;
z-index: 3; z-index: 3;
left: 0; left: 0;
top: 0; top: 0;
.img-status{ .img-status {
width: 133px; width: 133px;
height: 129px; height: 129px;
} }
@ -859,12 +890,12 @@ 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;
.right-card{ .right-card {
padding: 3px; padding: 3px;
} }
@ -893,10 +924,14 @@ function reloadList() {
// overflow: hidden; // overflow: hidden;
margin: 0px 16px 27px 0px; margin: 0px 16px 27px 0px;
.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;
@ -904,7 +939,7 @@ function reloadList() {
z-index: 0; z-index: 0;
} }
.tag-status{ .tag-status {
width: 46px; width: 46px;
height: 22px; height: 22px;
position: absolute; position: absolute;
@ -917,7 +952,7 @@ function reloadList() {
z-index: 3; z-index: 3;
left: 3px; left: 3px;
bottom: 3px; bottom: 3px;
.time-item{ .time-item {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 10px; font-size: 10px;
@ -928,12 +963,12 @@ function reloadList() {
line-height: 12px; line-height: 12px;
} }
.time-item2{ .time-item2 {
margin-bottom: 0; margin-bottom: 0;
} }
.svg-time{ .svg-time {
margin-right: 5px margin-right: 5px;
} }
} }
@ -973,12 +1008,12 @@ function reloadList() {
font-size: 14px; font-size: 14px;
} }
.percent-unit{ .percent-unit {
font-size: 8px; font-size: 8px;
margin-top: 4px margin-top: 4px;
} }
.percent-red{ .percent-red {
background: #ff4e4f; background: #ff4e4f;
} }
} }

@ -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>
@ -81,8 +81,8 @@ function showActionsModal() {
font-family: PingFang SC, PingFang SC-Regular; font-family: PingFang SC, PingFang SC-Regular;
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,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