pull/1/head
Dragon 1 year ago
parent e0283cc58d
commit f05a3fc78b

@ -61,3 +61,17 @@ export async function dubiousfilelist(params) {
return res return res
} }
/**
*
* @returns
*/
export async function removeFiles(params) {
const res = await http.request({
url: `/ocr/dubiousfile/dubiousfileyc`,
method: 'get',
params,
})
return res
}

@ -173,3 +173,16 @@ export async function aiApprovaltools(params): Promise<any> {
params, params,
}) })
} }
/**
* ai
* @param id
* @returns
*/
export async function aiApprovaltoolsClearmark(params): Promise<any> {
return await http.request({
url: `/ocr/aitools/aiApprovaltoolsClearmark`,
method: 'get',
params,
})
}

@ -1,13 +1,15 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeMount, onMounted, onUpdated, reactive, ref, watch } from 'vue' import { computed, onBeforeMount, onMounted, onUpdated, reactive, ref, watch } from 'vue'
import Masonry from 'masonry-layout' import Masonry from 'masonry-layout'
import { useDialog, useMessage } from 'naive-ui'
import { useInfiniteScroll } from '@vueuse/core' import { useInfiniteScroll } from '@vueuse/core'
import { debounce, throttle } from 'lodash-es' import { debounce, throttle } from 'lodash-es'
import imagesloaded from 'imagesloaded' import imagesloaded from 'imagesloaded'
import { randomInt } from '@/utils/index' import { randomInt } from '@/utils/index'
import { timeOptions, viewOptions } from '@/config/home' import { timeOptions, viewOptions } from '@/config/home'
import { getPictureList } from '@/api/home/main' import { getPictureList } from '@/api/home/main'
import { dubiousfilelist } from '@/api/task/task' import { dubiousfilelist, removeFiles } from '@/api/task/task'
import { off, on } from '@/utils/domUtils' import { off, on } from '@/utils/domUtils'
import img1 from '@/assets/images/1.jpg' import img1 from '@/assets/images/1.jpg'
@ -21,6 +23,7 @@ const cardStyle = {
'--n-padding-left': '120px', '--n-padding-left': '120px',
} }
const message = useMessage()
const timeRange = ref('all') const timeRange = ref('all')
const timeLabel = computed(() => { const timeLabel = computed(() => {
const item = timeOptions.find((option) => { const item = timeOptions.find((option) => {
@ -101,19 +104,19 @@ async function featchList() {
try { try {
const result = await dubiousfilelist({ ...pagination, search_month: '', search_history: '0' }) const result = await dubiousfilelist({ ...pagination, search_month: '', search_history: '0' })
// TODO // TODO
result.data = Array.from({ length: 30 }) // result.data = Array.from({ length: 30 })
result.pageCount = 1 result.pageCount = 1
const { data, pageCount } = result const { data, pageCount } = result
pagination.pageNo += 1 pagination.pageNo += 1
canloadMore = pageCount >= pagination.pageNo canloadMore = pageCount >= pagination.pageNo
return result.data.records
const list = data.map((item) => { // const list = data.map((item) => {
return { // return {
imgUrl: randomUrl(), // imgUrl: randomUrl(),
} // }
}) // })
// console.log(list)
return list // return list
} }
catch (error) { catch (error) {
return [] return []
@ -135,8 +138,8 @@ onUpdated(() => {
onBeforeMount(async () => { onBeforeMount(async () => {
console.log(888) console.log(888)
const list = await featchList() // const list = await featchList()
listData.value = list // listData.value = list
}) })
let start: { x: number, y: number } | null = null let start: { x: number, y: number } | null = null
@ -234,14 +237,31 @@ onMounted(() => {
show.value && addListeners() show.value && addListeners()
}) })
function showModal() { async function showModal() {
show.value = true show.value = true
pagination.pageNo = 1
const list = await featchList()
listData.value = list
} }
function closeModal(event: MouseEvent) { function closeModal(event: MouseEvent) {
show.value = false show.value = false
} }
async function remove() {
const arr = listData.value.filter((item) => {
return item.checked
})
if (arr.length === 0) {
message.error('至少选中一个')
return
}
const ids = arr.map(item => item.pictureid).join(',')
const res = await removeFiles({ pictureid: ids })
}
defineExpose({ defineExpose({
showModal, showModal,
}) })
@ -288,7 +308,9 @@ function onCheckChange(val: any, item: any) {
</n-popselect> </n-popselect>
</div> </div>
<div> <div>
<div>移除可疑文件夹</div> <div class="remove" @click="remove">
移除可疑文件夹
</div>
<div class="wrapper-content-form-button"> <div class="wrapper-content-form-button">
<SvgIcon style="margin-right: 6px;" size="14" name="tf" /> <SvgIcon style="margin-right: 6px;" size="14" name="tf" />
批量审批 批量审批
@ -308,7 +330,7 @@ function onCheckChange(val: any, item: any) {
:class="{ 'wrapper-content-item-img-fit': viewMode !== 'masonry' }" :src="item.imgUrl" :class="{ 'wrapper-content-item-img-fit': viewMode !== 'masonry' }" :src="item.imgUrl"
> --> > -->
<n-image <n-image
:src="item.imgUrl" :src="item.imgurl"
class="img " class="img "
:class="{ 'img-fit': viewMode === 'horizontalVersion', 'img-full': viewMode === '3:4' || viewMode === 'verticalVersion' }" :class="{ 'img-fit': viewMode === 'horizontalVersion', 'img-full': viewMode === '3:4' || viewMode === 'verticalVersion' }"
/> />
@ -340,6 +362,10 @@ function onCheckChange(val: any, item: any) {
/* Standard syntax */ /* Standard syntax */
} }
.remove{
cursor: pointer;
}
.close { .close {
position: absolute; position: absolute;
right: -90px; right: -90px;

@ -6,7 +6,7 @@ import { useRoute } from 'vue-router'
import BatchModal from '../modal/BatchModal.vue' import BatchModal from '../modal/BatchModal.vue'
import { getAllfieldList, getfieldList } from '@/api/home/filter' import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { audit } from '@/api/task/task' import { audit, dubiousfileyd } from '@/api/task/task'
import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work' import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work'
import { useTask } from '@/store/modules/task' import { useTask } from '@/store/modules/task'
import { useUser } from '@/store/modules/user' import { useUser } from '@/store/modules/user'
@ -234,6 +234,17 @@ function backHandler() {
taskStore.back() taskStore.back()
} }
function handleDragStart(event) {
console.log(888)
// event.dataTransfer.setData('text/plain', event.target.innerText)
}
async function handleDragEnd(event, item) {
//
console.log(event)
console.log(item)
await dubiousfileyd({ taskchildid: item.id })
}
async function getTableData() { async function getTableData() {
const useInfo = userStore.getUserInfo const useInfo = userStore.getUserInfo
const listData = [] const listData = []
@ -516,8 +527,11 @@ function getPercent(pictureid: string) {
class="item" class="item"
> >
<div <div
draggable="true"
class="img-wrapper" class="img-wrapper"
:style="{ 'background-image': `url(${item.thumburl})` }" :style="{ 'background-image': `url(${item.thumburl})` }"
@dragstart="handleDragStart"
@dragend="(event) => { handleDragEnd(event, item) }"
/> />
<div class="check"> <div class="check">
<n-checkbox <n-checkbox

@ -1,110 +1,127 @@
<script lang="ts" setup> <script lang="ts" setup>
import { useWorkOrder } from "@/store/modules/workOrder"; import { useInfiniteScroll } from '@vueuse/core'
import { isEmpty } from "@/utils"; import { reactive, ref, unref, watch } from 'vue'
import { useInfiniteScroll } from "@vueuse/core"; import ApprovalModal from '../modal/ApprovalModal.vue'
import { reactive, ref, watch } from "vue"; import ListItem from './ListItem.vue'
import ListItem from "./ListItem.vue"; import type { PackageListItem } from '/#/workorder'
import type { PackageListItem } from "/#/workorder"; import { isEmpty } from '@/utils'
import { useWorkOrder } from '@/store/modules/workOrder'
const workStore = useWorkOrder();
const data = ref<PackageListItem[]>([]);
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 workStore = useWorkOrder()
const data = ref<PackageListItem[]>([])
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: 10, pageSize: 10,
}); })
const approvalModalRef = ref(null)
function showModal(modalRef: any, id) {
const modal = unref(modalRef)! as any
modal.showModal(id)
}
function selectHandler(id: string, index: number) { function selectHandler(id: string, index: number) {
workStore.setActive(index); console.log(id)
console.log(777)
workStore.setActive(index)
showModal(approvalModalRef, id)
} }
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
loadMore(); loadMore()
}, },
{ {
distance: 10, distance: 10,
interval: 1500, interval: 1500,
canLoadMore: () => canloadMore.value canLoadMore: () => canloadMore.value,
} },
); )
async function loadMore() { async function loadMore() {
if (isLoading.value || el.value == null) return; if (isLoading.value || el.value == null)
isLoading.value = true; 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 workStore.fetchOrderList(pagination, keyword.value); const result = await workStore.fetchOrderList(pagination, keyword.value)
const { data, pageCount } = result; const { data, pageCount } = result
if(pageCount !== 0){ if (pageCount !== 0)
canloadMore.value = pageCount >= pagination.pageNo ; canloadMore.value = pageCount >= pagination.pageNo
}else{ else
canloadMore.value = false; canloadMore.value = false
}
return data || []; return data || []
} catch (error) { }
canloadMore.value = false; catch (error) {
return []; canloadMore.value = false
return []
} }
} }
watch( watch(
() => workStore.activeId, () => workStore.activeId,
(newVal) => { (newVal) => {
if (isEmpty(newVal)) return; if (isEmpty(newVal))
return
activeId.value = newVal; activeId.value = newVal
} },
); )
function reset() { function reset() {
pagination.pageNo = 0; pagination.pageNo = 0
pagination.pageSize = 10; pagination.pageSize = 10
canloadMore.value = true; canloadMore.value = true
data.value.length = 0; data.value.length = 0
workStore.reset(); workStore.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 },
); )
} }
defineExpose({ defineExpose({
search, search,
}); })
</script> </script>
<template> <template>
<ApprovalModal ref="approvalModalRef" />
<n-spin :show="isLoading"> <n-spin :show="isLoading">
<div ref="el" class="list"> <div ref="el" class="list">
<ListItem <ListItem
@ -112,7 +129,7 @@ defineExpose({
:key="item.id" :key="item.id"
:selected="activeId === item.id" :selected="activeId === item.id"
:list-item="item" :list-item="item"
:showFieldList="showFieldList" :show-field-list="showFieldList"
@click="selectHandler(item.id, index)" @click="selectHandler(item.id, index)"
/> />
</div> </div>

@ -1,41 +1,81 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; 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'
const emit = defineEmits<{ const emit = defineEmits<{
(e: "reject", params: any); (e: 'reject', params: any)
(e: "viewrepeat"); (e: 'viewrepeat')
}>(); }>()
const dialog = useDialog()
const state: any = reactive({
detail: {},
taskId: '',
})
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)
function showModal(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 show = ref(false); console.log(res)
}
function showModal() { async function clearMark() {
show.value = true; const res = await aiApprovaltoolsClearmark({ taskid: state.taskId })
if (res.code === 'OK')
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({
title: '确认提示',
content: '确认设置成假吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: async () => {
// TODO
// const result = await resetApproval()
clearMark()
},
onNegativeClick: () => {},
})
} }
async function viewRepeat(e: MouseEvent) { async function viewRepeat(e: MouseEvent) {
emit("viewrepeat"); emit('viewrepeat')
e.preventDefault(); e.preventDefault()
closeModal(); closeModal()
} }
defineExpose({ defineExpose({
showModal, showModal,
}); })
</script> </script>
<template> <template>
@ -50,25 +90,37 @@ defineExpose({
/> />
</div> </div>
<div class="wrapper-hearder"> <div class="wrapper-hearder">
<div class="wrapper-title">智能AI审批工具</div> <div class="wrapper-title">
<div class="wrapper-mark">某某有限公司-某某事业部-张小凡</div> 智能AI审批工具
</div>
<div class="wrapper-mark">
{{ detail.tenantusername }}
</div>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<n-scrollbar style="height: 200px"> <n-scrollbar style="height: 200px">
<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">任务IDYPW34567890-2995</div> <div class="task_id">
任务ID{{ detail.taskid }}
</div>
<div class="tag_box"> <div class="tag_box">
<div class="tag_item">基线任务</div> <div class="tag_item">
<div class="tag_item error">相似图片(16)</div> 基线任务
</div>
<div class="tag_item error">
相似图片({{ detail.similarcount }})
</div>
</div>
<div class="time_box">
{{ format(detail.createtime, 'yyyy-MM-dd HH:mm:ss') }}
</div> </div>
<div class="time_box">2023-09-17 13:09:10</div>
</div> </div>
</div> </div>
</n-scrollbar> </n-scrollbar>
<div class="mark_text"> <div class="mark_text">
智能识别12张图片来源于网络建议将图片标记为假 快速审批不通过 智能识别{{ detail.similarComplete }}张图片来源于网络建议将图片标记为假 快速审批不通过
</div> </div>
<div class="footer"> <div class="footer">
<SvgIcon <SvgIcon

Loading…
Cancel
Save