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

Reviewed-on: #6
pull/9/head
shenhailong 1 year ago
commit 814839f092

1
components.d.ts vendored

@ -21,6 +21,7 @@ declare module 'vue' {
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NEmpty: typeof import('naive-ui')['NEmpty']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -33,7 +33,9 @@ const svgName = computed(() => {
class="list-item-header-name"
:class="{ 'list-item-header-selected': selected }"
>
任务ID:{{ listItem.fromtaskname }}
<n-ellipsis style="max-width: 226px">
任务ID:{{ listItem.fromtaskname }}
</n-ellipsis>
</span>
</div>
<!-- <SvgIcon v-show="selected" size="14" name="more-ver" /> -->
@ -55,7 +57,9 @@ const svgName = computed(() => {
提交时间{{ format(listItem.createdate, "yyyy-MM-dd HH:mm:ss") }}
</li>
<li v-else class="ellipsis">
<span class="label">{{ item.name }}</span>{{ listItem[item.id] }}
<n-ellipsis style="max-width: 226px">
<span class="label">{{ item.name }}</span>{{ listItem[item.id] }}
</n-ellipsis>
</li>
</ul>
</div>
@ -145,14 +149,6 @@ const svgName = computed(() => {
line-height: 18px;
}
.ellipsis{
display: block;
width: 226px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&-selected {
background: rgba(68,113,232,0.07);
}

@ -3,8 +3,12 @@ import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from 'v
import { chunk, clone } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { useRoute } from 'vue-router'
import NotPassed from '@/components/Approval/NotPassed.vue'
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'
@ -14,12 +18,6 @@ import { useUser } from '@/store/modules/user'
import { isEmpty } from '@/utils'
import { formatToDateHMS } from '@/utils/dateUtil'
import { hideDownload } from '@/utils/image'
import emitter from '@/utils/mitt'
import CustomSettingModal from '../modal/CustomSettingModal.vue'
import PictureTable from './PictureTable.vue'
import TaskTable from './TaskTable.vue'
import History from './History.vue'
import type { ApprovalParam } from '/#/api'
const batch = ref(false)
const selectItems = ref<any[]>([])
@ -28,12 +26,14 @@ const dialog = useDialog()
const notPassModalRef = ref(null)
const batchModalRef = ref(null)
const totalCount = ref(0)
const taskId: any = ref('') // id
const packageId: any = ref('') // id
const CustomSettingModalRef = ref(null)
const taskTableData = ref<any[]>([])
const route = useRoute()
const sortBy: any = {
orderType: 'asc',
orderType: 'desc',
orderName: 'similarityScore',
}
@ -77,8 +77,11 @@ let processItems: any[] = []
onMounted(() => {
window.addEventListener('keydown', handleKeydown)
if (route.query.id)
getDetail(route.query.id, route.query.packageid)
if (route.query.id) {
taskId.value = route.query.id
packageId.value = route.query.packageid
getDetail()
}
})
//
@ -91,12 +94,6 @@ function handleKeydown(event) {
//
}
//
async function getDetail(taskId, packageid) {
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
getTableData()
getImgList()
}
// states:1234
function validate(items: any[]) {
if (items.length === 0)
@ -140,13 +137,32 @@ function approvalHandler(items?: any) {
return
}
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: '',
flowTaskInfoList: list,
}
dialog.info({
title: '确认提示',
content: '确认给该任务审批为【通过】吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
approval()
doAudit(param)
},
onNegativeClick: () => {},
})
@ -176,46 +192,17 @@ function rejectHandler(items?: any) {
modal.showModal(selectItems.value)
}
function approval() {
const formIds: string[] = processItems.map(item => item.id)
const taskIds: string[] = processItems.map(item => item.taskId)
const tasknames: string[] = processItems.map(item => item.taskname)
const param: ApprovalParam = {
formid: formIds,
taskId: taskIds,
approvd: true,
taskComment: 'approval',
taskname: tasknames,
}
doAudit(param)
}
function doAudit(param: any) {
audit(param).then((res) => {
const { code } = res
setBatch(false)
if (code === 'OK')
emitter.emit('refresh')
else message.error(res.message)
})
}
function reject(idOrDesc: string, backId: string, isOther: boolean) {
const formIds: string[] = processItems.map(item => item.id)
const taskIds: string[] = processItems.map(item => item.taskId)
const tasknames: string[] = processItems.map(item => item.taskname)
const param: ApprovalParam = {
formid: formIds,
taskId: taskIds,
approvd: false,
taskComment: idOrDesc,
taskname: isOther ? tasknames : ['其他'],
}
if (code === 'OK') {
message.success('审核成功')
reloadList()
}
doAudit(param)
else { message.error(res.message) }
})
}
function showModal(modalRef: any) {
@ -286,20 +273,6 @@ async function getImgList() {
}
}
watch(
() => [taskStore.activeId],
async () => {
const packageid = taskStore.getPackageid
const taskId = taskStore.getActiveId
setBatch(false)
if (isEmpty(taskId))
return
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
getTableData()
getImgList()
},
)
// storeid
const currentTaskId = computed(() => {
const index = taskStore.getCurrentIndex
@ -343,9 +316,26 @@ function previewHandler(event: MouseEvent) {
(imageRef.value as any).mergedOnClick()
}
function reloadList() {
watch(
() => [taskStore.activeId],
() => {
packageId.value = taskStore.getPackageid
taskId.value = taskStore.getActiveId
getDetail()
},
)
//
async function getDetail() {
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value)
setBatch(false)
getTableData()
getImgList()
}
function reloadList() {
getDetail()
}
</script>
<template>
@ -415,16 +405,9 @@ function reloadList() {
</template>
返回
</n-button>
<div
style="cursor: pointer; margin-left: 16px"
@click.stop="rejectHandler"
>
<SvgIcon width="64" height="28" name="a1" />
</div>
<img class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt="" @click.stop="rejectHandler">
<SvgIcon size="24" name="vs" />
<div style="cursor: pointer" @click.stop="approvalHandler">
<SvgIcon width="64" height="28" name="a2" />
</div>
<img class="btn-approval" src="@/assets/images/task/btn-pass.png" alt="" @click.stop="approvalHandler">
</div>
</div>
</div>
@ -733,6 +716,16 @@ function reloadList() {
.batch {
display: flex;
align-items: center;
.btn-approval{
width: 68px;
height: 28px;
cursor: pointer;
}
.btn-left{
margin-left: 16px;
}
}
}

@ -57,7 +57,7 @@ let _masonry: null | Masonry = null
const show = ref(false)
const sortBy: any = {
orderType: 'asc',
orderType: 'desc',
orderName: 'similarityScore',
}
const batch = ref(false)

Loading…
Cancel
Save