Merge pull request 'shen' (#65) from shen into test

Reviewed-on: #65
pull/69/head
shenhailong 1 year ago
commit 8518e70649

@ -74,10 +74,10 @@ export async function getRepeatList(params: FinalParam) {
params,
})
const { data: { records, totalPage, totalCount } } = res
const { data: { records, total, pages } } = res
return {
pageCount: 3,
pageCount: pages,
data: records,
totalCount: 20,
totalCount: total,
}
}

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { debounce } from "lodash-es";
import { debounce } from 'lodash-es'
import {
computed,
inject,
@ -9,89 +9,89 @@ import {
shallowRef,
unref,
watch,
} from "vue";
import CustomFieldModal from "../modal/CustomFieldModal.vue";
import AdvanceFilter from "../../home/aside/comp/AdvanceFilter.vue";
import { FilterModalVue } from "../../home/aside/comp/modals";
import NewFilterModalVue from "../modal/NewFilterModal.vue";
import TaskList from "./TaskList.vue";
import type { AsideEntity } from "@/config/aside";
import { useUser } from "@/store/modules/user";
import { getAllfieldList, getfieldList } from "@/api/home/filter";
import { useTaskStore } from "@/store/modules/task";
import emitter from "@/utils/mitt";
import { useConfig } from "@/store/modules/asideConfig";
} from 'vue'
import CustomFieldModal from '../modal/CustomFieldModal.vue'
import AdvanceFilter from '../../home/aside/comp/AdvanceFilter.vue'
import { FilterModalVue } from '../../home/aside/comp/modals'
import NewFilterModalVue from '../modal/NewFilterModal.vue'
import TaskList from './TaskList.vue'
import type { AsideEntity } from '@/config/aside'
import { useUser } from '@/store/modules/user'
import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { useTaskStore } from '@/store/modules/task'
import emitter from '@/utils/mitt'
import { useConfig } from '@/store/modules/asideConfig'
const CustomFieldModalRef = ref(null);
const collapse = ref(false);
const taskStore = useTaskStore();
const taskListRef: any = ref(null);
const CustomFieldModalRef = ref(null)
const collapse = ref(false)
const taskStore = useTaskStore()
const taskListRef: any = ref(null)
//
const showFieldList = ref<any[]>([]);
const search = ref("");
const showFieldList = ref<any[]>([])
const search = ref('')
function collapseHandler() {
collapse.value = !collapse.value;
collapse.value = !collapse.value
}
const mousetrap = inject("mousetrap") as any;
mousetrap.bind("[", collapseHandler);
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
const asideWidth = computed(() => {
return collapse.value ? 0 : 308;
});
return collapse.value ? 0 : 308
})
const asideStyle = computed(() => {
return {
width: `${asideWidth.value}px`,
};
});
}
})
const collapseIcon = computed(() => {
return collapse.value ? "expand-cir" : "collapse-cir";
});
return collapse.value ? 'expand-cir' : 'collapse-cir'
})
const asideEnter = ref(false);
const asideEnter = ref(false)
const showCollapse = computed(() => {
return collapse.value ? true : asideEnter.value;
});
return collapse.value ? true : asideEnter.value
})
watch(
() => taskStore.immersion,
() => {
collapse.value = true;
}
);
collapse.value = true
},
)
function showFilter() {
const modal = unref(CustomFieldModalRef)! as any;
modal.showModal();
const modal = unref(CustomFieldModalRef)! as any
modal.showModal()
}
const showSearch = ref(false);
const showSearch = ref(false)
function setShowSearch(value: boolean) {
if (!value) {
console.log("setShowSearch", value);
search.value = "";
taskListRef.value.search("");
return;
console.log('setShowSearch', value)
search.value = ''
taskListRef.value.search('')
return
}
showSearch.value = value;
showSearch.value = value
}
const inputHandler = debounce((word) => {
(taskListRef.value as any).search(word);
}, 500);
(taskListRef.value as any).search(word)
}, 500)
const reviewType = 2;
const reviewType = 2
async function getshowFieldList() {
showFieldList.value = [];
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let res;
res = await getAllfieldList(reviewType); //
const allList = res.data;
res = await getfieldList(reviewType, userInfo.id); //
const useList = res.data;
showFieldList.value = []
const userStore = useUser()
const userInfo = userStore.getUserInfo
let res
res = await getAllfieldList(reviewType) //
const allList = res.data
res = await getfieldList(reviewType, userInfo.id) //
const useList = res.data
/**
* name 标题
* id 键值
@ -99,19 +99,20 @@ async function getshowFieldList() {
* checked 是否选中
*/
if (useList?.userFieldFixed) {
useList?.userFieldFixed?.split(",").map((v) => {
let item = allList.find((v2) => v2.name == v);
useList?.userFieldFixed?.split(',').map((v) => {
let item = allList.find(v2 => v2.name == v)
if (item) {
item = {
name: item.fieldDesc,
id: item.name,
fix: item.isrequired == 2,
checked: true,
};
showFieldList.value.push(item);
}
showFieldList.value.push(item)
}
});
} else {
})
}
else {
//
allList?.map((v) => {
if (v.isrequired == 2) {
@ -120,58 +121,58 @@ async function getshowFieldList() {
id: v.name,
fix: v.isrequired == 2,
checked: true,
};
showFieldList.value.push(item);
}
showFieldList.value.push(item)
}
});
})
}
}
onMounted(() => {
getshowFieldList();
});
getshowFieldList()
})
// key
function scrollHandler(key: string) {
const element = document.querySelector(`#${key}`);
element?.scrollIntoView(true);
const element = document.querySelector(`#${key}`)
element?.scrollIntoView(true)
}
//
function filterHandler(searchId: string) {
emitter.emit("filter", searchId);
emitter.emit('filter', searchId)
}
function showModal(modalRef: any) {
const modal = unref(modalRef)! as any;
modal.showModal();
const modal = unref(modalRef)! as any
modal.showModal()
}
//
const showItems = shallowRef<{ key: string; config: AsideEntity }[]>([]);
const filterModalRef: any = ref(null);
const newFilterModalRef = ref(null);
const customModalRef = ref(null);
const showItems = shallowRef<{ key: string, config: AsideEntity }[]>([])
const filterModalRef: any = ref(null)
const newFilterModalRef = ref(null)
const customModalRef = ref(null)
function editFilter(filter: any) {
const modal = unref(newFilterModalRef)! as any;
modal.showModal();
modal.edit(filter);
const modal = unref(newFilterModalRef)! as any
modal.showModal()
modal.edit(filter)
}
const configStore = useConfig();
const newFilterOk = () => {
const configStore = useConfig()
function newFilterOk() {
filterModalRef.value.query(
filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize
);
};
filterModalRef.value.pagination.pageSize,
)
}
onBeforeMount(async () => {
configStore.fetchConfig();
configStore.fetchCustomConfig();
});
configStore.fetchConfig()
configStore.fetchCustomConfig()
})
function setAsideItemName(text) {
taskListRef.value.setStatusName(text);
taskListRef.value.setStatusName(text)
}
defineExpose({
setAsideItemName,
});
})
</script>
<template>
@ -255,7 +256,7 @@ defineExpose({
@show-new-filter="showModal(newFilterModalRef)"
/>
<!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @onOk="newFilterOk" />
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />
</div>
</template>

@ -33,7 +33,7 @@ const selectItems = ref<any[]>([])
const message = useMessage()
const dialog = useDialog()
const notPassModalRef = ref(null)
const batchModalRef = ref(null)
const batchModalRef: any = ref(null)
const totalCount = ref(0)
const taskId: any = ref('') // id
const packageId: any = ref('') // id
@ -61,7 +61,7 @@ const showActions = computed(() => {
const taskpagination = reactive({
pageNo: 1,
pageSize: 10,
pageSize: 30,
})
const taskStore = useTask()
const overTask = ref<any>(null)
@ -165,6 +165,8 @@ function approvalHandler(items?: any) {
return
}
console.log(processItems)
const list: any = []
processItems.forEach((item) => {
list.push({
@ -198,7 +200,7 @@ function approvalHandler(items?: any) {
function rejectHandler(items?: any) {
const modal = unref(notPassModalRef)! as any
modal.showModal(selectItems.value)
modal.showModal(items)
}
function singleRejectHandler() {
@ -213,13 +215,14 @@ function doAudit(param: any) {
message.success(res.message)
setBatch(false)
reloadList(param, '通过')
batchModalRef.value.reload()
}
})
}
function showModal(modalRef: any) {
const modal = unref(modalRef)! as any
modal.showModal()
modal.showModal(taskId.value)
}
function forwardHandler() {
@ -429,7 +432,7 @@ function switchBatch() {
class="btn-approval btn-left"
src="@/assets/images/task/btn-not-pass.png"
alt=""
@click.stop="rejectHandler"
@click.stop="rejectHandler(selectItems)"
>
<SvgIcon size="24" name="vs" />
<img
@ -639,13 +642,18 @@ function switchBatch() {
<History :data="taskDetailInfo" />
</n-tab-pane>
</n-tabs>
<NotPassed ref="notPassModalRef" @success="(param) => reloadList(param, '不通过')" />
<NotPassed
ref="notPassModalRef" @success="(param) => {
batchModalRef.value.reload()
reloadList(param, '不通过')
}"
/>
<BatchModal
ref="batchModalRef"
@reject="rejectHandler"
@approval="approvalHandler"
/>
<CustomSettingModal ref="CustomSettingModalRef" @onOk="getDetail"/>
<CustomSettingModal ref="CustomSettingModalRef" @on-ok="getDetail" />
</div>
</template>

@ -25,6 +25,7 @@ const cardStyle = {
const totalCount = ref(0)
const timeRange = ref('all')
const taskId = ref('')
const timeLabel = computed(() => {
const item = timeOptions.find((option) => {
return option.value === timeRange.value
@ -110,9 +111,8 @@ useInfiniteScroll(
async function loadMore() {
if (loading.value || el.value == null)
return
const taskId = taskStore.getActiveId
if (!taskId)
if (!taskId.value)
return
const more = await fetchList()
@ -241,7 +241,9 @@ onMounted(() => {
show.value && addListeners()
})
function showModal() {
function showModal(value) {
taskId.value = value
refreshHandler()
show.value = true
}
@ -249,10 +251,6 @@ function closeModal(event: MouseEvent) {
show.value = false
}
defineExpose({
showModal,
})
function forwardHandler() {
taskStore.forward()
}
@ -312,13 +310,15 @@ function reset() {
layout()
}
function onChange() {
reload()
}
async function refreshHandler() {
reset()
const taskId = taskStore.getActiveId
if (!taskId)
if (!taskId.value)
return
taskDetailInfo.value = await getTaskDetailInfo(taskId, '')
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, '')
nextTick(() => {
useInfiniteScroll(
@ -332,12 +332,23 @@ async function refreshHandler() {
}
watch(() => taskStore.activeId, async (newValue, oldValue) => {
taskId.value = taskStore.activeId
selectIds.value = []
refreshHandler()
})
function switchBatch() {
setBatch(!batch.value)
}
function reload() {
selectIds.value = []
refreshHandler()
}
defineExpose({
showModal,
reload,
})
</script>
<template>
@ -356,7 +367,7 @@ function switchBatch() {
<span style="margin-left: 8px;">任务审批</span>
</div>
<div class="wrapper-title wrapper-m32">
<span>任务ID:{{ taskStore.getActiveId }}</span>
<span>任务ID:{{ taskDetailInfo.fromtaskname }}</span>
<SvgIcon size="22" class="forward" name="arrow-left" @click="backHandler" />
<SvgIcon size="22" class="back" name="arrow-right" @click="forwardHandler" />
</div>
@ -386,19 +397,32 @@ function switchBatch() {
<td>
{{ taskDetailInfo?.createusername }}
</td>
<td>{{ TASK_STATUS_OBJ[taskDetailInfo?.states] }}</td>
<td>
<div
class="status-tag"
:class="{
'status-tag-red': taskDetailInfo?.userapprove?.statshis === 3,
'status-tag-green': taskDetailInfo?.userapprove?.statshis === 2,
}"
>
{{ TASK_STATUS_OBJ[taskDetailInfo?.userapprove?.statshis] }}
</div>
</td>
<td>{{ taskDetailInfo?.ocrPicture?.createTime }}</td>
<td>{{ taskDetailInfo?.fromsourceid }}</td>
<td>{{ taskDetailInfo?.pictureInfo?.source }}</td>
<td>{{ totalCount }}</td>
</tr>
</tbody>
</table>
</div>
<div class="title wrapper-m32">
相似图片
</div>
<div class="wrapper-content">
<div class="wrapper-content-form wrapper-m32">
<div>
<n-popselect v-model:value="timeRange" :options="timeOptions" trigger="click">
<n-popselect v-model:value="timeRange" :options="timeOptions" trigger="click" @change="onChange">
<div class="wrapper-content-form-dropdown">
<span>{{ timeLabel || '时间模式' }}</span>
<SvgIcon class="wrapper-content-form-dropdown-gap" name="arrow-botton" size="14" />
@ -500,6 +524,16 @@ function switchBatch() {
position: relative;
}
.title{
font-size: 18px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
text-align: left;
color: #333333;
margin-top: 14px;
margin-bottom: 24px;
}
.small-mark{
width: 100%;
height: 36px;
@ -544,6 +578,29 @@ function switchBatch() {
}
}
.status-tag{
display: inline-block;
padding: 0 12px;
height: 22px;
background: #ffc671;
border-radius: 12px;
align-items: center;
justify-content: center;
font-size: 13px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
text-align: left;
color: #ffffff;
}
.status-tag-green{
background: #53c21d;
}
.status-tag-red{
background: #e45656;
}
.close {
position: absolute;
right: -90px;
@ -610,11 +667,16 @@ function switchBatch() {
text-align: center;
font-weight: bold;
text-align: left;
font-size: 14px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
text-align: left;
color: #333333;
}
}
&-m32 {
margin-left: 32px;
margin-left: 19px;
}
&-content {

Loading…
Cancel
Save