Merge branch 'test' into jie

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

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

@ -4,9 +4,7 @@ import { useMessage } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { audit } from '@/api/task/task'
const emit = defineEmits<{
(e: 'success')
}>()
const emit = defineEmits(['success'])
const message = useMessage()
const loading = ref(false)
@ -104,7 +102,7 @@ async function handleSumbit(e: MouseEvent) {
const { code } = res
if (code === 'OK') {
message.success('审核成功')
emit('success')
emit('success', param)
closeModal()
}
else { message.error(res.message) }

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

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

@ -150,7 +150,7 @@ function unformatValue(searchfield: string, searchvalue: any) {
function createCondition() {
formValue.conditions.push({
type: null,
operator: null,
operator: 'eq',
result: null,
})
}
@ -227,7 +227,7 @@ function leaveHandler() {
formValue.conditions = [
{
type: null,
operator: null,
operator: 'eq',
result: null,
},
]
@ -269,7 +269,7 @@ defineExpose({
<n-form-item path="name" label="标题">
<n-input v-model:value="formValue.name" :style="{ width: '780px' }" @keydown.enter.prevent />
</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-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 == '任务名称')
if (index > -1) {
columnsRef.value[index] = {
@ -575,10 +588,10 @@ function actionHandler(action: any, row: any) {
resetHandler()
break
case 'approval':
approvalHandler(row)
singleApproval(row)
break
case 'reject':
rejectHandler(row)
rejectHandler([row])
break
default:
break
@ -630,26 +643,24 @@ function getSelectItems() {
return tableData.value.filter(item => selectionIds.value.includes(item.id))
}
function approvalHandler(row) {
// const items = getSelectItems()
const items = [row]
const msg = validate(items)
if (msg !== null) {
message.error(msg)
return
//
function singleApproval(row) {
const param = {
result: true,
comment: '',
disposeType: '',
disposeTypeId: '',
failCauseId: '',
failCauseName: '',
flowTaskInfoList: [
{
formId: row.id,
taskId: row.taskId,
taskName: row.fromTaskName,
},
],
}
dialog.info({
title: '确认提示',
content: '确认给该任务审批为【通过】吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
approval(items)
},
onNegativeClick: () => {},
})
doAudit(param)
}
function batchApproval() {
@ -673,26 +684,25 @@ function batchApproval() {
})
}
function approval(items) {
const formIds: string[] = items.map(item => item.id)
const taskIds: string[] = items.map(item => item.taskId)
const tasknames: string[] = items.map(item => item.taskname)
// function approval(items) {
// const formIds: string[] = items.map(item => item.id)
// const taskIds: string[] = items.map(item => item.taskId)
// const tasknames: string[] = items.map(item => item.taskname)
const param: ApprovalParam = {
formid: formIds,
taskId: taskIds,
approvd: true,
taskComment: 'approval',
taskname: tasknames,
}
// const param: ApprovalParam = {
// formid: formIds,
// taskId: taskIds,
// approvd: true,
// taskComment: 'approval',
// taskname: tasknames,
// }
doAudit(param)
}
// doAudit(param)
// }
function rejectHandler(row) {
// const items = getSelectItems()
const items = [row]
const msg = validate(items)
//
function rejectHandler(list) {
const msg = validate(list)
if (msg !== null) {
message.error(msg)
@ -700,7 +710,7 @@ function rejectHandler(row) {
}
const modal = unref(notPassModalRef)! as any
modal.showModal()
modal.showModal(list)
}
function reject(idOrDesc: string, backId: string, isOther: boolean) {
@ -720,15 +730,6 @@ function reject(idOrDesc: string, backId: string, isOther: boolean) {
doAudit(param)
}
function doAudit(param: any) {
audit(param).then((res) => {
const { code } = res
if (code === 'OK')
reload()
else message.error(res.message)
})
}
function reload() {
const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps
query(page!, pageSize!)
@ -751,6 +752,27 @@ async function refreshHandler(searchId?: any) {
reset()
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>
<template>
@ -837,7 +859,7 @@ async function refreshHandler(searchId?: any) {
:on-success="sucessHandler"
:header-config="headRules"
/>
<NotPassed ref="notPassModalRef" @success="reloadList" />
<NotPassed ref="notPassModalRef" @success="reload" />
<RepeatModal
ref="repeatModalRef"

@ -1,10 +1,10 @@
<script lang="ts" setup>
import type { DropdownMixedOption } from 'naive-ui/es/dropdown/src/interface'
import type { PropType } from 'vue'
import type { DropdownMixedOption } from "naive-ui/es/dropdown/src/interface";
import type { PropType } from "vue";
defineOptions({ name: 'Action' })
defineOptions({ name: "Action" });
defineProps({
const props = defineProps({
options: {
type: Array as PropType<DropdownMixedOption[]>,
default: null,
@ -12,18 +12,21 @@ defineProps({
},
select: {
type: Function as PropType<Function>,
default: () => { },
default: () => {},
},
id: {
type: String,
default: '',
default: "",
},
})
});
const fun = (key) => {
props.select(key, props.id);
};
</script>
<template>
<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" />
</n-dropdown>
</div>

@ -17,7 +17,10 @@ const props = defineProps({
required: true,
},
});
const ruleForm = reactive({
keyword: "",
});
const ruleformRef = ref();
const emit = defineEmits<{
(e: "show-filter"): void;
(e: "show-custom"): void;
@ -27,7 +30,7 @@ const emit = defineEmits<{
const data = ref<FilterEntity[]>([]);
const unData = ref<FilterEntity[]>([]);
const loading = ref(false);
const loading = ref(false);
const canloadMore = true;
const el = ref<HTMLDivElement | null>(null);
const popover = ref<ComponentRef | null>(null);
@ -74,8 +77,8 @@ useInfiniteScroll(
},
{ distance: 10, interval: 300, canLoadMore: () => false }
);
const showClick =async () => {
getSearchedList('')
const showClick = async () => {
getSearchedList("");
};
async function loadMore() {
@ -92,7 +95,7 @@ async function featchList() {
loading.value = true;
try {
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 { data } = result;
@ -121,11 +124,8 @@ function generateFilterEntityList(data) {
};
});
const reg = new RegExp(keyword.value, "gi");
const hilightText = searchname.replace(
reg,
`<span>${keyword.value}</span>`
);
const reg = new RegExp(ruleForm.keyword, "gi");
const hilightText = searchname.replace(reg, `<span>${ruleForm.keyword}</span>`);
return {
id,
@ -134,7 +134,7 @@ function generateFilterEntityList(data) {
isDefaultFilter: false,
filterList: list,
reorder,
searchname
searchname,
};
});
@ -143,12 +143,17 @@ function generateFilterEntityList(data) {
function selectHandler(item: FilterEntity) {
(popover.value as any).setShow(false);
currentlySelectedAdvanced.value = item.searchname
currentlySelectedAdvanced.value = item.searchname;
emit("select", item.id);
}
const inputHandler = debounce((word) => {
getSearchedList(word)
ruleForm.keyword = word;
ruleformRef.value.validate();
if (word.length < 2 && word) {
return;
}
getSearchedList(word);
}, 300);
function getSearchedList(word) {
@ -157,7 +162,7 @@ function getSearchedList(word) {
} else {
pagination.pageSize = 10;
}
keyword.value = word;
ruleForm.keyword = word;
featchList().then((list) => {
let dataArr: 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) {
event.stopImmediatePropagation();
event.stopPropagation();
@ -208,7 +229,7 @@ function unFavoriteHandler(event: MouseEvent, item) {
if (!isDefaultFilter) {
item.favorite = false;
unfavorite(id);
inputHandler(keyword.value);
inputHandler(ruleForm.keyword);
}
}
@ -233,29 +254,37 @@ const moveEnd = () => {
>
<template #trigger>
<div class="wrapper-left-dropdown" @click="showClick">
<span style="font-size: 20px;color: #333333;font-weight: Medium;">{{currentlySelectedAdvanced}}</span>
<SvgIcon :style="{ marginLeft: '5px' }" name="down" size="14" />
<span style="font-size: 20px; color: #333333; font-weight: Medium">{{
currentlySelectedAdvanced
}}</span>
<SvgIcon :style="{ marginLeft: '5px' }" name="down" size="14" color="#999999"/>
</div>
</template>
<n-spin :show="loading">
<div class="wrapper-left-popover">
<n-input
:style="{ '--n-border': '0px' }"
placeholder="请输入关键词"
@input="inputHandler"
>
<template #prefix>
<SvgIcon size="14px" name="magnifying-1" />
</template>
<template #suffix>
<SvgIcon
size="14px"
style="cursor: pointer"
name="setting"
@click="emit('show-filter')"
/>
</template>
</n-input>
<n-form :rules="rules" ref="ruleformRef" :model="ruleForm">
<n-form-item path="keyword">
<n-input
:style="{ '--n-border': '0px' }"
placeholder="请输入关键字"
@input="inputHandler"
:value="ruleForm.keyword"
:minlength="2"
>
<template #prefix>
<SvgIcon size="14px" name="magnifying-1" />
</template>
<template #suffix>
<SvgIcon
size="14px"
style="cursor: pointer"
name="setting"
@click="emit('show-filter')"
/>
</template>
</n-input>
</n-form-item>
</n-form>
<ul ref="el" class="wrapper-left-list">
<li
@ -264,23 +293,28 @@ const moveEnd = () => {
style="display: flex; align-items: center"
@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
v-if="item.favorite && !item.isDefaultFilter"
name="favorite-fill"
color="#fd9b0a"
size="18"
style="margin-right:3px"
style="margin-right: 3px"
@click="unFavoriteHandler($event, item)"
/>
<SvgIcon
v-else-if="!item.favorite && !item.isDefaultFilter"
name="favorite-unfill"
size="18"
style="margin-right:3px"
style="margin-right: 3px"
@click="favoriteHandler($event, item)"
/>
<div v-html="item.name" style="color: #333333;"/>
<div v-html="item.name" style="color: #333333" />
</li>
<!-- filter=".draggable-li[draggable='false']" -->
<VueDraggable
@ -298,14 +332,14 @@ const moveEnd = () => {
class="cursor-move draggable-li fix"
:draggable="true"
>
<SvgIcon name="drag" size="18" style="margin-right:3px"/>
<SvgIcon name="drag" size="18" style="margin-right: 3px" />
<SvgIcon
v-if="item.favorite && !item.isDefaultFilter"
name="favorite-fill"
color="#fd9b0a"
size="18"
fill="#666666"
style="cursor: pointer!important;margin-right:3px;"
style="cursor: pointer !important; margin-right: 3px"
@click="unFavoriteHandler($event, item)"
/>
<SvgIcon
@ -313,10 +347,10 @@ const moveEnd = () => {
name="favorite-unfill"
size="18"
fill="#666666"
style="cursor: pointer!important;margin-right:3px;"
style="cursor: pointer !important; margin-right: 3px"
@click="favoriteHandler($event, item)"
/>
<div v-html="item.name" style="color: #333333;"/>
<div v-html="item.name" style="color: #333333" />
</li>
</VueDraggable>
</ul>

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

@ -158,7 +158,7 @@ function unformatValue(searchfield: string, searchvalue: any) {
function createCondition() {
formValue.conditions.push({
type: null,
operator: null,
operator: 'eq',
result: null,
})
}
@ -260,7 +260,7 @@ function leaveHandler() {
formValue.conditions = [
{
type: null,
operator: null,
operator: 'eq',
result: null,
},
]
@ -302,7 +302,7 @@ defineExpose({
<n-form-item path="name" label="标题">
<n-input v-model:value="formValue.name" :style="{ width: '780px' }" @keydown.enter.prevent />
</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-form-item>
<n-form-item

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

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

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

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

@ -1,24 +1,30 @@
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from 'vue'
import { chunk, clone } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { useRoute } from 'vue-router'
import BatchModal from '../modal/BatchModal.vue'
import CustomSettingModal from '../modal/CustomSettingModal.vue'
import PictureTable from './PictureTable.vue'
import TaskTable from './TaskTable.vue'
import History from './History.vue'
import NotPassed from '@/components/Approval/NotPassed.vue'
import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { TASK_STATUS_OBJ } from '@/enums/index'
import { audit, dubiousfileyd, getSimilarityList, getTaskDetailInfo } 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'
import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from "vue";
import { chunk, clone } from "lodash-es";
import { useDialog, useMessage } from "naive-ui";
import { useRoute } from "vue-router";
import BatchModal from "../modal/BatchModal.vue";
import CustomSettingModal from "../modal/CustomSettingModal.vue";
import PictureTable from "./PictureTable.vue";
import TaskTable from "./TaskTable.vue";
import History from "./History.vue";
import NotPassed from "@/components/Approval/NotPassed.vue";
import { getAllfieldList, getfieldList } from "@/api/home/filter";
import { TASK_STATUS_OBJ } from "@/enums/index";
import {
audit,
dubiousfileyd,
getSimilarityList,
getTaskDetailInfo,
} 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 selectItems = ref<any[]>([])
const message = useMessage()
@ -33,71 +39,69 @@ const taskTableData = ref<any[]>([])
const route = useRoute()
const sortBy: any = {
orderType: 'desc',
orderName: 'similarityScore',
}
orderType: "desc",
orderName: "similarityScore",
};
function setBatch(value: boolean) {
if (totalCount.value === 0)
return
if (totalCount.value === 0) return;
batch.value = value
batch.value = value;
if (value === false) {
selectItems.value.forEach(item => (item.checked = false))
selectItems.value.length = 0
selectItems.value.length = 0
}
if (value === false)
selectItems.value = []
}
function onCheckChange(checked: any, item: any) {
const index = selectItems.value.indexOf(item)
item.checked = checked
const index = selectItems.value.indexOf(item);
item.checked = checked;
if (index === -1 && checked)
selectItems.value.push(item)
else selectItems.value.splice(index, 1)
if (index === -1 && checked) selectItems.value.push(item);
else selectItems.value.splice(index, 1);
}
const showActions = computed(() => {
return selectItems.value.length > 0 && batch
})
return selectItems.value.length > 0 && batch;
});
const taskpagination = reactive({
pageNo: 1,
pageSize: 10,
})
const taskStore = useTask()
const overTask = ref<any>(null)
const taskDetailInfo = ref<any>({})
const taskDetailPictureList = ref<any[]>([])
const userStore = useUser()
const imageRef = ref<ComponentElRef | null>()
let processItems: any[] = []
});
const taskStore = useTask();
const overTask = ref<any>(null);
const taskDetailInfo = ref<any>({});
const taskDetailPictureList = ref<any[]>([]);
const userStore = useUser();
const imageRef = ref<ComponentElRef | null>();
let processItems: any[] = [];
onMounted(() => {
window.addEventListener('keydown', handleKeydown)
window.addEventListener("keydown", handleKeydown);
if (route.query.id) {
taskId.value = route.query.id
packageId.value = route.query.packageid
getDetail()
taskId.value = route.query.id;
packageId.value = route.query.packageid;
getDetail();
}
})
});
//
function handleKeydown(event) {
if (event.key === 'ArrowLeft')
backHandler()
if (event.key === "ArrowLeft") backHandler();
//
else if (event.key === 'ArrowRight')
forwardHandler()
else if (event.key === "ArrowRight") forwardHandler();
//
}
// storeid
function currentTaskId() {
const index = taskStore.getCurrentIndex
return taskStore.getApprovalList[index]?.id || ''
}
// states:1234
function validate(items: any[]) {
if (items.length === 0)
return '至少选中一个任务'
if (items.length === 0) return "至少选中一个任务";
// const useInfo = userStore.getUserInfo
// const username = useInfo.loginname
@ -114,226 +118,215 @@ function validate(items: any[]) {
// return ''
// }
return null
return null;
}
function approvalHandler(items?: any) {
let cloneItem: any
let cloneItem: any;
if (batch.value) {
processItems = selectItems.value
}
else if (overTask.value) {
cloneItem = clone(overTask.value)
processItems = [cloneItem]
processItems = selectItems.value;
} else if (overTask.value) {
cloneItem = clone(overTask.value);
processItems = [cloneItem];
}
if (items !== undefined && !(items instanceof PointerEvent))
processItems = items
if (items !== undefined && !(items instanceof PointerEvent)) processItems = items;
const msg = validate(processItems)
const msg = validate(processItems);
if (msg !== null) {
message.error(msg)
return
message.error(msg);
return;
}
const list: any = []
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: '',
comment: "",
disposeType: "",
disposeTypeId: "",
failCauseId: "",
failCauseName: "",
flowTaskInfoList: list,
}
};
dialog.info({
title: '确认提示',
content: '确认给该任务审批为【通过】吗?',
positiveText: '确定',
negativeText: '取消',
title: "确认提示",
content: "确认给该任务审批为【通过】吗?",
positiveText: "确定",
negativeText: "取消",
onPositiveClick: () => {
doAudit(param)
doAudit(param);
},
onNegativeClick: () => {},
})
});
}
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
modal.showModal(selectItems.value)
}
function singleRejectHandler() {
const modal = unref(notPassModalRef)! as any
modal.showModal([taskDetailInfo.value])
}
function doAudit(param: any) {
audit(param).then((res) => {
const { code } = res
setBatch(false)
if (code === 'OK') {
message.success('审核成功')
reloadList()
setBatch(false)
reloadList(param, '通过')
}
else { message.error(res.message) }
})
});
}
function showModal(modalRef: any) {
const modal = unref(modalRef)! as any
modal.showModal()
const modal = unref(modalRef)! as any;
modal.showModal();
}
function forwardHandler() {
taskStore.forward()
taskStore.forward();
}
function backHandler() {
taskStore.back()
taskStore.back();
}
async function handleDragEnd(event, item) {
//
const flag = taskStore.getInFile
const flag = taskStore.getInFile;
if (flag) {
const res = await dubiousfileyd({ pictureid: item.pictureid })
if (res.code === 'OK') {
message.success('加入成功')
getTableData()
const res = await dubiousfileyd({ pictureid: item.pictureid });
if (res.code === "OK") {
message.success("加入成功");
getTableData();
} else {
message.error(res.message);
}
else {
message.error(res.message)
}
taskStore.setInFile(false)
taskStore.setInFile(false);
}
}
async function getTableData() {
const useInfo = userStore.getUserInfo
const listData = []
const reviewType = 3 //
let res = await getAllfieldList(reviewType)
const fieldList = (res as any)?.data
res = await getfieldList(reviewType, useInfo.id)
const userFieldList = (res as any)?.data.userFieldFixed
const useInfo = userStore.getUserInfo;
const listData = [];
const reviewType = 3; //
let res = await getAllfieldList(reviewType);
const fieldList = (res as any)?.data;
res = await getfieldList(reviewType, useInfo.id);
const userFieldList = (res as any)?.data.userFieldFixed;
const blueList = [
"拜访终端名称",
"定位信息",
"拜访日期",
"定位距离",
"拜访小结",
"拜访项目类别",
];
fieldList.map((v) => {
if (userFieldList.includes(v.name)) {
const item = {
label: v.fieldDesc,
value: taskDetailInfo.value.ocrPicture[v.name],
key: v.name,
}
listData.push(item)
blue: blueList.includes(v.fieldDesc),
};
listData.push(item);
}
})
taskTableData.value = chunk(listData, 2)
});
taskTableData.value = chunk(listData, 2);
}
async function getImgList() {
if (!isEmpty(taskDetailInfo.value.ocrPicture.id)) {
const { data, total } = await getSimilarityList(
{
...taskpagination,
...sortBy,
pictureId: taskDetailInfo.value.ocrPicture.id,
},
)
taskDetailPictureList.value = data
totalCount.value = total
}
else {
taskDetailPictureList.value.length = 0
totalCount.value = 0
const { data, total } = await getSimilarityList({
...taskpagination,
...sortBy,
pictureId: taskDetailInfo.value.ocrPicture.id,
});
taskDetailPictureList.value = data;
totalCount.value = total;
} else {
taskDetailPictureList.value.length = 0;
totalCount.value = 0;
}
}
// storeid
const currentTaskId = computed(() => {
const index = taskStore.getCurrentIndex
return taskStore.getApprovalList[index]?.id || ''
})
function overTaskHandle() {
const item = taskDetailInfo.value
const item = taskDetailInfo.value;
if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
overTask.value = null
return
overTask.value = null;
return;
}
if (validate([item]) == null && batch.value === false)
overTask.value = item
if (validate([item]) == null && batch.value === false) overTask.value = item;
}
function leaveTaskHandler() {
overTask.value = null
overTask.value = null;
}
function showActionsModal() {
const modal = unref(CustomSettingModalRef)! as any
modal.showModal()
const modal = unref(CustomSettingModalRef)! as any;
modal.showModal();
}
onUnmounted(() => {
taskStore.reset()
window.removeEventListener('keydown', handleKeydown)
})
taskStore.reset();
window.removeEventListener("keydown", handleKeydown);
});
function immersionHandler() {
taskStore.updateImmersion()
taskStore.updateImmersion();
}
function previewHandler(event: MouseEvent) {
event.stopImmediatePropagation()
event.stopPropagation()
event.stopImmediatePropagation();
event.stopPropagation();
if (imageRef.value && (imageRef.value as any).src)
(imageRef.value as any).mergedOnClick()
(imageRef.value as any).mergedOnClick();
}
watch(
() => [taskStore.activeId],
() => {
packageId.value = taskStore.getPackageid
taskId.value = taskStore.getActiveId
getDetail()
if (!isEmpty(taskStore.getActiveId)) {
packageId.value = taskStore.getPackageid
taskId.value = taskStore.getActiveId
getDetail()
}
},
)
//
async function getDetail() {
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value)
setBatch(false)
getTableData()
getImgList()
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value);
setBatch(false);
getTableData();
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()
}
</script>
@ -343,24 +336,11 @@ function reloadList() {
<div class="wrapper-header">
<div class="left">
<span class="font">任务ID{{ taskDetailInfo.fromtaskname }}</span>
<SvgIcon
size="22"
class="forward"
name="arrow-left"
@click="backHandler"
/>
<SvgIcon
size="22"
class="back"
name="arrow-right"
@click="forwardHandler"
/>
<SvgIcon size="22" class="forward" name="arrow-left" @click="backHandler" />
<SvgIcon size="22" class="back" name="arrow-right" @click="forwardHandler" />
</div>
<div class="right">
<div
v-show="!showActions"
style="display: flex; align-items: center"
>
<div v-show="!showActions" style="display: flex; align-items: center">
<div class="btn" @click="setBatch(true)">
<SvgIcon style="margin-right: 6px" size="22" name="batch" />
批量审批
@ -391,11 +371,7 @@ function reloadList() {
</ul>
</n-popover> -->
<div class="icon-wrap">
<SvgIcon
size="20"
name="immersion-model"
@click="immersionHandler"
/>
<SvgIcon size="20" name="immersion-model" @click="immersionHandler" />
</div>
</div>
<div v-show="showActions" class="batch">
@ -405,9 +381,19 @@ function reloadList() {
</template>
返回
</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" />
<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>
@ -434,7 +420,7 @@ function reloadList() {
width="168"
height="48"
name="r7"
@click.stop="rejectHandler"
@click.stop="singleRejectHandler"
/>
</div>
<div class="check">
@ -447,56 +433,65 @@ function reloadList() {
</div>
<div class="status">
<img 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="">
<img
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 class="mark">
<SvgIcon
v-show="taskDetailInfo?.iztrueorfalse === 0"
size="128"
name="jia"
/>
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" />
</div>
<div class="mark">
<SvgIcon
v-show="taskDetailInfo?.iztrueorfalse === 1"
size="128"
name="zhen"
/>
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 1" size="128" name="zhen" />
</div>
<div class="big-mark" />
<div class="preview" @click="previewHandler">
<SvgIcon size="16" name="zoom-out" />
</div>
<div class="info img-info">
<n-grid x-gap="12" y-gap="10" :cols="12">
<n-gi span="4" class="gi1">
<span>
<img class="icon-status" src="@/assets/images/task/status.png" alt="">
<img class="icon-status" src="@/assets/images/task/status.png" alt="" />
</span>
</n-gi>
<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>
</n-gi>
<n-gi span="4" class="gi1">
<span>
<img class="icon-status" src="@/assets/images/task/similarity.png" alt="">
<img
class="icon-status"
src="@/assets/images/task/similarity.png"
alt=""
/>
</span>
</n-gi>
<n-gi span="8" class="gi2">
<span class="value num">{{
totalCount
}}<span class="unit"></span> </span>
<span class="value num">{{ totalCount }}<span class="unit"></span> </span>
<span class="label">相似匹配</span>
</n-gi>
</n-grid>
</div>
<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" />
<span>{{ formatToDateHMS(Number(taskDetailInfo.ocrPicture.photoDateTimestamp) || 0) }}</span>
<span>{{ taskDetailInfo?.ocrPicture?.photoDateTimestamp ? formatToDateHMS(Number(taskDetailInfo.ocrPicture.photoDateTimestamp)) : '-' }}</span>
</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" />
<span>{{ formatToDateHMS(Number(taskDetailInfo.ocrPicture.submitDateTimestamp) || 0) }}</span>
<span>{{ taskDetailInfo?.ocrPicture?.submitDateTimestamp ? formatToDateHMS(Number(taskDetailInfo.ocrPicture.submitDateTimestamp)) : '-' }}</span>
</div>
</div>
<div style="display: none">
@ -520,16 +515,16 @@ function reloadList() {
/>
</div>
<div class="list">
<div
v-for="(item) in taskDetailPictureList"
:key="item.id"
class="item"
>
<div v-for="item in taskDetailPictureList" :key="item.id" class="item">
<div
draggable="true"
class="img-wrapper"
:style="{ 'background-image': `url(${item.imgUrl})` }"
@dragend="(event) => { handleDragEnd(event, item) }"
@dragend="
(event) => {
handleDragEnd(event, item);
}
"
/>
<div class="small-mark" />
<div class="check">
@ -541,19 +536,32 @@ function reloadList() {
/>
</div>
<img 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="">
<img
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 v-if="item.photoDateTimestamp" class="time-item">
<div class="time-item">
<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 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" />
<span>{{ formatToDateHMS(Number(item.submitDateTimestamp) || 0) }}</span>
<span>{{ item.submitDateTimestamp ? formatToDateHMS(Number(item.submitDateTimestamp)) : '-' }}</span>
</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>
</div>
</div>
@ -566,7 +574,11 @@ function reloadList() {
<n-tabs type="line" animated>
<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 name="picture-info" tab="图片信息">
<PictureTable :data="taskDetailInfo" />
@ -575,13 +587,12 @@ function reloadList() {
<History :data="taskDetailInfo" />
</n-tab-pane>
</n-tabs>
<NotPassed ref="notPassModalRef" @success="reloadList" />
<NotPassed ref="notPassModalRef" @success="(param) => reloadList(param, '不通过')" />
<BatchModal
ref="batchModalRef"
@reject="rejectHandler"
@approval="approvalHandler"
/>
<CustomSettingModal ref="CustomSettingModalRef" :review-type="3" @on-ok="getTableData" />
</div>
</template>
@ -593,7 +604,7 @@ function reloadList() {
color: #666666;
}
::v-deep(.n-tabs-tab--active .n-tabs-tab__label) {
color: #507AFD;
color: #507afd;
font-size: 16px;
font-weight: 500;
}
@ -612,49 +623,48 @@ function reloadList() {
}
}
.icon-wrap{
.icon-wrap {
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
background: rgba(80,122,253,.1);
background: rgba(80, 122, 253, 0.1);
border-radius: 8px;
margin-left: 10px;
cursor: pointer;
}
.img-info{
.icon-status{
.img-info {
.icon-status {
width: 32px;
height: 32px;
}
.label{
.label {
font-size: 11px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
color: #ffffff;
}
.value{
.value {
font-size: 15px;
font-family: PingFang SC, PingFang SC-Semibold;
font-weight: 600;
color: #ffffff;
}
.num{
.num {
font-size: 18px;
font-family: PingFang SC, PingFang SC-Semibold;
font-weight: 600;
color: #ffffff;
}
.unit{
.unit {
font-size: 11px;
}
}
.wrapper {
display: flex;
@ -717,13 +727,13 @@ function reloadList() {
display: flex;
align-items: center;
.btn-approval{
.btn-approval {
width: 68px;
height: 28px;
cursor: pointer;
}
.btn-left{
.btn-left {
margin-left: 16px;
}
}
@ -749,10 +759,31 @@ function reloadList() {
border-radius: 8px;
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{
width: 100%;
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;
left: 0;
bottom: 0;
@ -806,7 +837,7 @@ function reloadList() {
left: 16px;
bottom: 16px;
.time-item{
.time-item {
display: flex;
align-items: center;
font-size: 14px;
@ -816,12 +847,12 @@ function reloadList() {
margin-bottom: 4px;
}
.time-item2{
.time-item2 {
margin-bottom: 0;
}
.svg-time{
margin-right: 5px
.svg-time {
margin-right: 5px;
}
}
@ -837,20 +868,20 @@ function reloadList() {
justify-content: center;
}
.check{
.check {
position: absolute;
z-index: 3;
left: 2%;
top: 2%;
}
.status{
.status {
position: absolute;
z-index: 3;
left: 0;
top: 0;
.img-status{
.img-status {
width: 133px;
height: 129px;
}
@ -859,12 +890,12 @@ function reloadList() {
.right {
flex: 0.5;
background: #F6F9FD;
background: #f6f9fd;
border-radius: 8px;
margin-left: 20px;
padding: 24px;
.right-card{
.right-card {
padding: 3px;
}
@ -893,10 +924,14 @@ function reloadList() {
// overflow: hidden;
margin: 0px 16px 27px 0px;
.small-mark{
.small-mark {
width: 100%;
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;
position: absolute;
left: 0;
@ -904,7 +939,7 @@ function reloadList() {
z-index: 0;
}
.tag-status{
.tag-status {
width: 46px;
height: 22px;
position: absolute;
@ -917,7 +952,7 @@ function reloadList() {
z-index: 3;
left: 3px;
bottom: 3px;
.time-item{
.time-item {
display: flex;
align-items: center;
font-size: 10px;
@ -928,12 +963,12 @@ function reloadList() {
line-height: 12px;
}
.time-item2{
.time-item2 {
margin-bottom: 0;
}
.svg-time{
margin-right: 5px
.svg-time {
margin-right: 5px;
}
}
@ -973,12 +1008,12 @@ function reloadList() {
font-size: 14px;
}
.percent-unit{
.percent-unit {
font-size: 8px;
margin-top: 4px
margin-top: 4px;
}
.percent-red{
.percent-red {
background: #ff4e4f;
}
}

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

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

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

@ -251,7 +251,10 @@ function removeHandler(id: string) {
let index = onList.value.findIndex((item) => {
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);
offList.value[index].checked = false;

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

Loading…
Cancel
Save