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

@ -61,3 +61,17 @@ export async function dubiousfilelist(params) {
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,
})
}
/**
* 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>
import { computed, onBeforeMount, onMounted, onUpdated, reactive, ref, watch } from 'vue'
import Masonry from 'masonry-layout'
import { useDialog, useMessage } from 'naive-ui'
import { useInfiniteScroll } from '@vueuse/core'
import { debounce, throttle } from 'lodash-es'
import imagesloaded from 'imagesloaded'
import { randomInt } from '@/utils/index'
import { timeOptions, viewOptions } from '@/config/home'
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 img1 from '@/assets/images/1.jpg'
@ -21,6 +23,7 @@ const cardStyle = {
'--n-padding-left': '120px',
}
const message = useMessage()
const timeRange = ref('all')
const timeLabel = computed(() => {
const item = timeOptions.find((option) => {
@ -101,19 +104,19 @@ async function featchList() {
try {
const result = await dubiousfilelist({ ...pagination, search_month: '', search_history: '0' })
// TODO
result.data = Array.from({ length: 30 })
// result.data = Array.from({ length: 30 })
result.pageCount = 1
const { data, pageCount } = result
pagination.pageNo += 1
canloadMore = pageCount >= pagination.pageNo
const list = data.map((item) => {
return {
imgUrl: randomUrl(),
}
})
return list
return result.data.records
// const list = data.map((item) => {
// return {
// imgUrl: randomUrl(),
// }
// })
// console.log(list)
// return list
}
catch (error) {
return []
@ -135,8 +138,8 @@ onUpdated(() => {
onBeforeMount(async () => {
console.log(888)
const list = await featchList()
listData.value = list
// const list = await featchList()
// listData.value = list
})
let start: { x: number, y: number } | null = null
@ -234,14 +237,31 @@ onMounted(() => {
show.value && addListeners()
})
function showModal() {
async function showModal() {
show.value = true
pagination.pageNo = 1
const list = await featchList()
listData.value = list
}
function closeModal(event: MouseEvent) {
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({
showModal,
})
@ -288,7 +308,9 @@ function onCheckChange(val: any, item: any) {
</n-popselect>
</div>
<div>
<div>移除可疑文件夹</div>
<div class="remove" @click="remove">
移除可疑文件夹
</div>
<div class="wrapper-content-form-button">
<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"
> -->
<n-image
:src="item.imgUrl"
:src="item.imgurl"
class="img "
:class="{ 'img-fit': viewMode === 'horizontalVersion', 'img-full': viewMode === '3:4' || viewMode === 'verticalVersion' }"
/>
@ -340,6 +362,10 @@ function onCheckChange(val: any, item: any) {
/* Standard syntax */
}
.remove{
cursor: pointer;
}
.close {
position: absolute;
right: -90px;

@ -6,7 +6,7 @@ import { useRoute } from 'vue-router'
import BatchModal from '../modal/BatchModal.vue'
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 { useTask } from '@/store/modules/task'
import { useUser } from '@/store/modules/user'
@ -234,6 +234,17 @@ function backHandler() {
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() {
const useInfo = userStore.getUserInfo
const listData = []
@ -516,8 +527,11 @@ function getPercent(pictureid: string) {
class="item"
>
<div
draggable="true"
class="img-wrapper"
:style="{ 'background-image': `url(${item.thumburl})` }"
@dragstart="handleDragStart"
@dragend="(event) => { handleDragEnd(event, item) }"
/>
<div class="check">
<n-checkbox

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

@ -1,41 +1,81 @@
<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<{
(e: "reject", params: any);
(e: "viewrepeat");
}>();
(e: 'reject', params: any)
(e: 'viewrepeat')
}>()
const dialog = useDialog()
const state: any = reactive({
detail: {},
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)
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() {
show.value = true;
async function clearMark() {
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();
// emit('reject', { a: 'todo' })
// closeModal()
dialog.info({
title: '确认提示',
content: '确认设置成假吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: async () => {
// TODO
// const result = await resetApproval()
clearMark()
},
onNegativeClick: () => {},
})
}
async function viewRepeat(e: MouseEvent) {
emit("viewrepeat");
e.preventDefault();
closeModal();
emit('viewrepeat')
e.preventDefault()
closeModal()
}
defineExpose({
showModal,
});
})
</script>
<template>
@ -50,25 +90,37 @@ defineExpose({
/>
</div>
<div class="wrapper-hearder">
<div class="wrapper-title">智能AI审批工具</div>
<div class="wrapper-mark">某某有限公司-某某事业部-张小凡</div>
<div class="wrapper-title">
智能AI审批工具
</div>
<div class="wrapper-mark">
{{ detail.tenantusername }}
</div>
</div>
<div class="wrapper-content">
<n-scrollbar style="height: 200px">
<div v-for="i in 1" :key="i" class="item">
<div class="imgwrapper" />
<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_item">基线任务</div>
<div class="tag_item error">相似图片(16)</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') }}
</div>
<div class="time_box">2023-09-17 13:09:10</div>
</div>
</div>
</n-scrollbar>
<div class="mark_text">
智能识别12张图片来源于网络建议将图片标记为假 快速审批不通过
智能识别{{ detail.similarComplete }}张图片来源于网络建议将图片标记为假 快速审批不通过
</div>
<div class="footer">
<SvgIcon

Loading…
Cancel
Save