11 changed files with 3340 additions and 1 deletions
@ -0,0 +1,60 @@ |
|||||
|
import { defHttp } from '@/utils/http/axios'; |
||||
|
import { ID, IDS, commonExport } from '@/api/base'; |
||||
|
import { SjjDocumentTasksVO, SjjDocumentTasksForm, SjjDocumentTasksQuery } from './model'; |
||||
|
|
||||
|
/** |
||||
|
* 查询审计局标书任务列表 |
||||
|
* @param params |
||||
|
* @returns |
||||
|
*/ |
||||
|
export function SjjDocumentTasksList(params?: SjjDocumentTasksQuery) { |
||||
|
return defHttp.get<SjjDocumentTasksVO[]>({ url: '/productManagement/SjjDocumentTasks/list', params }); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出审计局标书任务列表 |
||||
|
* @param params |
||||
|
* @returns |
||||
|
*/ |
||||
|
export function SjjDocumentTasksExport(params?: SjjDocumentTasksQuery) { |
||||
|
return commonExport('/productManagement/SjjDocumentTasks/export', params ?? {}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询审计局标书任务详细 |
||||
|
* @param id id |
||||
|
* @returns |
||||
|
*/ |
||||
|
export function SjjDocumentTasksInfo(id: ID) { |
||||
|
return defHttp.get<SjjDocumentTasksVO>({ url: '/productManagement/SjjDocumentTasks/' + id }); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增审计局标书任务 |
||||
|
* @param data |
||||
|
* @returns |
||||
|
*/ |
||||
|
export function SjjDocumentTasksAdd(data: SjjDocumentTasksForm) { |
||||
|
return defHttp.postWithMsg<void>({ url: '/productManagement/SjjDocumentTasks', data }); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 更新审计局标书任务 |
||||
|
* @param data |
||||
|
* @returns |
||||
|
*/ |
||||
|
export function SjjDocumentTasksUpdate(data: SjjDocumentTasksForm) { |
||||
|
return defHttp.putWithMsg<void>({ url: '/productManagement/SjjDocumentTasks', data }); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除审计局标书任务 |
||||
|
* @param id id |
||||
|
* @returns |
||||
|
*/ |
||||
|
export function SjjDocumentTasksRemove(id: ID | IDS) { |
||||
|
return defHttp.deleteWithMsg<void>({ url: '/productManagement/SjjDocumentTasks/' + id },); |
||||
|
} |
||||
|
export function SjjDocumentTasksOssRemoveById(id: ID|IDS) { |
||||
|
return defHttp.deleteWithMsg<void>({ url: '/productManagement/SjjDocumentTasks/ossRemoveById/' + id },); |
||||
|
} |
@ -0,0 +1,80 @@ |
|||||
|
import { BaseEntity, PageQuery } from '@/api/base'; |
||||
|
|
||||
|
export interface SjjDocumentTasksVO { |
||||
|
/** |
||||
|
* 任务名称 |
||||
|
*/ |
||||
|
taskName: string; |
||||
|
|
||||
|
/** |
||||
|
* 招标文件名称 |
||||
|
*/ |
||||
|
tenderDocumentName: string; |
||||
|
|
||||
|
/** |
||||
|
* 投标文件名称 |
||||
|
*/ |
||||
|
bidDocumentName: string | number; |
||||
|
|
||||
|
/** |
||||
|
* 进度状态 |
||||
|
*/ |
||||
|
progressStatus: string; |
||||
|
|
||||
|
/** |
||||
|
* 审核结果 |
||||
|
*/ |
||||
|
resultType: string; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
export interface SjjDocumentTasksForm extends BaseEntity { |
||||
|
/** |
||||
|
* 任务名称 |
||||
|
*/ |
||||
|
taskName?: string; |
||||
|
|
||||
|
/** |
||||
|
* 招标文件名称 |
||||
|
*/ |
||||
|
tenderDocumentName?: string; |
||||
|
|
||||
|
/** |
||||
|
* 投标文件名称 |
||||
|
*/ |
||||
|
bidDocumentName?: string | number; |
||||
|
|
||||
|
/** |
||||
|
* 进度状态 |
||||
|
*/ |
||||
|
progressStatus?: string; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
export interface SjjDocumentTasksQuery extends PageQuery { |
||||
|
|
||||
|
/** |
||||
|
* 任务名称 |
||||
|
*/ |
||||
|
taskName?: string; |
||||
|
|
||||
|
/** |
||||
|
* 招标文件名称 |
||||
|
*/ |
||||
|
tenderDocumentName?: string; |
||||
|
|
||||
|
/** |
||||
|
* 投标文件名称 |
||||
|
*/ |
||||
|
bidDocumentName?: string | number; |
||||
|
|
||||
|
/** |
||||
|
* 进度状态 |
||||
|
*/ |
||||
|
progressStatus?: string; |
||||
|
|
||||
|
/** |
||||
|
* 日期范围参数 |
||||
|
*/ |
||||
|
params?: any; |
||||
|
} |
@ -0,0 +1,55 @@ |
|||||
|
<template> |
||||
|
<BasicDrawer v-bind="$attrs" title="结果详情" :width="drawerWidth" @register="registerDrawer"> |
||||
|
<!-- <MarkdownViewer :value="value" v-if="type != 'html'" /> --> |
||||
|
<!-- 纯预览 --> |
||||
|
<MdPreview |
||||
|
:modelValue="value" |
||||
|
:theme="theme" |
||||
|
previewTheme="github" |
||||
|
codeTheme="github" |
||||
|
:showCodeRowNumber="true" |
||||
|
:previewOnly="true" |
||||
|
/> |
||||
|
<!-- <div style="width: 100%; height: 100%" v-html="value" ></div> --> |
||||
|
<template #footer> </template> |
||||
|
</BasicDrawer> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import text from './caozuomiaoshu.md?raw'; |
||||
|
// import { MarkdownViewer } from '@/components/Markdown'; |
||||
|
import { MdPreview } from 'md-editor-v3'; |
||||
|
import 'md-editor-v3/lib/style.css'; |
||||
|
import { ref, onMounted } from 'vue'; |
||||
|
import { BasicDrawer, useDrawer, useDrawerInner } from '@/components/Drawer'; |
||||
|
import { useMaxWidthOrDefault } from '@/hooks/web/useSize'; |
||||
|
const value = ref<string>(''); |
||||
|
const type = ref<string>('markdown'); |
||||
|
const MarkdownViewerkeynum = ref<number>(0); |
||||
|
const iframeKey = ref<number>(10); |
||||
|
const drawerWidth = useMaxWidthOrDefault(1000); |
||||
|
const textvalue = ref<string>(text); |
||||
|
const [registerDrawer] = useDrawerInner(init); |
||||
|
// 主题设置:'light' | 'dark' |
||||
|
const theme = ref('light'); |
||||
|
onMounted(() => {}); |
||||
|
function init(data) { |
||||
|
console.log('DocsDrawer', data, document.documentElement.clientHeight); |
||||
|
if (data) { |
||||
|
value.value = data.value; |
||||
|
type.value = data.type; |
||||
|
MarkdownViewerkeynum.value += 1; |
||||
|
iframeKey.value += 1; |
||||
|
if (type.value == 'def') { |
||||
|
console.log(textvalue.value); |
||||
|
value.value = textvalue.value; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
iframe { |
||||
|
width: 100%; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,135 @@ |
|||||
|
import { BasicColumn } from '@/components/Table'; |
||||
|
import { FormSchema } from '@/components/Form'; |
||||
|
import { getDictOptions } from '@/utils/dict'; |
||||
|
import { useRender } from '@/hooks/component/useRender'; |
||||
|
import { uploadDocument } from '@/api/documentReview/DocumentTasks'; |
||||
|
import { useUserStore } from '@/store/modules/user'; |
||||
|
import { RoleEnum } from '@/enums/roleEnum'; |
||||
|
|
||||
|
const { roleList } = useUserStore(); |
||||
|
|
||||
|
export const formSchemas: FormSchema[] = [ |
||||
|
{ |
||||
|
label: '任务名称', |
||||
|
field: 'taskNameList', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: getDictOptions('scheme_review'), |
||||
|
mode: 'multiple', |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '文档名称', |
||||
|
field: 'documentName', |
||||
|
component: 'Input', |
||||
|
}, |
||||
|
// {
|
||||
|
// label: '预计时间',
|
||||
|
// field: 'estimatedCompletionTime',
|
||||
|
// component: 'DatePicker',
|
||||
|
// componentProps: {
|
||||
|
// showTime: true,
|
||||
|
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
|
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
|
// },
|
||||
|
// },
|
||||
|
{ |
||||
|
label: '状态', |
||||
|
field: 'progressStatus', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: getDictOptions('document_task_status'), |
||||
|
}, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
const { renderDict } = useRender(); |
||||
|
export const columns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: '文档名称', |
||||
|
dataIndex: 'documentName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '模型所属区域', |
||||
|
dataIndex: 'taskRegion', |
||||
|
customRender: ({ value }) => renderDict(value, 'model_region'), |
||||
|
}, |
||||
|
{ |
||||
|
title: '模型所属行业', |
||||
|
dataIndex: 'taskIndustry', |
||||
|
customRender: ({ value }) => renderDict(value, 'model_industry'), |
||||
|
}, |
||||
|
{ |
||||
|
title: '上传时间', |
||||
|
dataIndex: 'createTime', |
||||
|
}, |
||||
|
{ |
||||
|
title: '提交人', |
||||
|
dataIndex: 'createUser', |
||||
|
auth: 'documentReview:DocumentTasks:tableShow', |
||||
|
}, |
||||
|
{ |
||||
|
title: '进度', |
||||
|
dataIndex: 'progress', |
||||
|
}, |
||||
|
]; |
||||
|
export const childColumns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: '任务名称', |
||||
|
dataIndex: 'taskName', |
||||
|
customRender: ({ value,record }) => renderDict(value, record.taskType), |
||||
|
}, |
||||
|
{ |
||||
|
title: '任务类型', |
||||
|
dataIndex: 'taskType', |
||||
|
ifShow: false, |
||||
|
customRender: ({ value }) => renderDict(value, 'task_type'), |
||||
|
}, |
||||
|
{ |
||||
|
title: '任务耗时', |
||||
|
dataIndex: 'taskDuration', |
||||
|
}, |
||||
|
{ |
||||
|
title: '状态', |
||||
|
dataIndex: 'progressStatus', |
||||
|
customRender: ({ value }) => renderDict(value, 'document_task_status'), |
||||
|
}, |
||||
|
]; |
||||
|
export const modalSchemas: FormSchema[] = [ |
||||
|
|
||||
|
{ |
||||
|
label: '任务名称', |
||||
|
field: 'taskNameList', |
||||
|
required: true, |
||||
|
component: 'Select', |
||||
|
componentProps: () => { |
||||
|
const isSuperAdmin = roleList.includes(RoleEnum.SUPER_ADMIN); |
||||
|
let options = getDictOptions('scheme_review'); |
||||
|
return { |
||||
|
options: options, |
||||
|
mode: 'multiple', |
||||
|
}; |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
// {
|
||||
|
// label: '预计时间',
|
||||
|
// field: 'estimatedCompletionTime',
|
||||
|
// required: true,
|
||||
|
// component: 'DatePicker',
|
||||
|
// componentProps: {
|
||||
|
// showTime: true,
|
||||
|
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
|
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
|
// },
|
||||
|
// },
|
||||
|
// {
|
||||
|
// label: '状态',
|
||||
|
// field: 'progressStatus',
|
||||
|
// required: true,
|
||||
|
// component: 'Select',
|
||||
|
// componentProps: {
|
||||
|
// options: getDictOptions('document_task_status')
|
||||
|
// },
|
||||
|
// },
|
||||
|
]; |
@ -0,0 +1,76 @@ |
|||||
|
<template> |
||||
|
<PageWrapper dense> |
||||
|
<BasicModal |
||||
|
v-bind="$attrs" |
||||
|
:title="title" |
||||
|
@register="registerInnerModal" |
||||
|
@ok="handleSubmit" |
||||
|
@cancel="resetForm" |
||||
|
> |
||||
|
<BasicForm @register="registerForm" /> |
||||
|
</BasicModal> |
||||
|
</PageWrapper> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { PageWrapper } from '@/components/Page'; |
||||
|
import { BasicModal, useModalInner } from '@/components/Modal'; |
||||
|
import { BasicForm, useForm } from '@/components/Form'; |
||||
|
import { computed, ref, unref } from 'vue'; |
||||
|
import { |
||||
|
DocumentTasksInfo, |
||||
|
DocumentTasksAdd, |
||||
|
DocumentTasksUpdate, |
||||
|
} from '@/api/documentReview/DocumentTasks'; |
||||
|
import { ModelUserPromptssettingInfoByUserId } from '@/api/modelConfiguration/ModelUserPromptssetting/index'; |
||||
|
import { modalSchemas } from './DocumentTasks.data'; |
||||
|
import { TaskType } from '@/enums/taskEnum'; |
||||
|
|
||||
|
defineOptions({ name: 'DocumentTasksModal' }); |
||||
|
|
||||
|
const emit = defineEmits(['register', 'reload']); |
||||
|
|
||||
|
const isUpdate = ref<boolean>(false); |
||||
|
const title = computed<string>(() => { |
||||
|
return isUpdate.value ? '新增方案审核任务' : '新增方案审核任务'; |
||||
|
}); |
||||
|
|
||||
|
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
||||
|
async (data: { record?: Recordable; update: boolean }) => { |
||||
|
modalLoading(true); |
||||
|
const settings = await ModelUserPromptssettingInfoByUserId({taskType: TaskType.SCHEME_REVIEW.value}); |
||||
|
await setFieldsValue(settings); |
||||
|
//不需要修改 |
||||
|
const { record, update } = data; |
||||
|
isUpdate.value = update; |
||||
|
if (update && record) { |
||||
|
// const ret = await DocumentTasksInfo(record.id); |
||||
|
await setFieldsValue(record); |
||||
|
} |
||||
|
modalLoading(false); |
||||
|
}, |
||||
|
); |
||||
|
|
||||
|
const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({ |
||||
|
labelWidth: 100, |
||||
|
showActionButtonGroup: false, |
||||
|
baseColProps: { span: 24 }, |
||||
|
schemas: modalSchemas, |
||||
|
}); |
||||
|
async function handleSubmit() { |
||||
|
try { |
||||
|
modalLoading(true); |
||||
|
const data = await validate(); |
||||
|
data['ossId'] = data['ossId'][0]; |
||||
|
await DocumentTasksAdd(data); |
||||
|
emit('reload'); |
||||
|
closeModal(); |
||||
|
await resetForm(); |
||||
|
} catch (e) { |
||||
|
} finally { |
||||
|
modalLoading(false); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
@ -0,0 +1,286 @@ |
|||||
|
<template> |
||||
|
<BasicTable @register="registerTable" @expand="tabelexpand"> |
||||
|
<template #toolbar v-if="props.showToolbar"> |
||||
|
<div > |
||||
|
<a-button |
||||
|
id="how-to-edit" |
||||
|
class="font-bold" |
||||
|
type="link" |
||||
|
@click="openDrawer(true, { value: '', type: 'def' })" |
||||
|
>👉如何新增任务? |
||||
|
</a-button> |
||||
|
<a-button type="primary" @click="handleAdd">新增</a-button> |
||||
|
</div> |
||||
|
</template> |
||||
|
<template #bodyCell="{ column, record }"> |
||||
|
<template v-if="column.key === 'action'"> |
||||
|
<TableAction |
||||
|
stopButtonPropagation |
||||
|
:actions="[ |
||||
|
{ |
||||
|
label: record.childrenTasks.length > 1 ? '下载全部' : '下载', |
||||
|
icon: IconEnum.DOWNLOAD, |
||||
|
type: 'primary', |
||||
|
color: 'success', |
||||
|
ghost: true, |
||||
|
ifShow: () => { |
||||
|
if (record.progress.includes('100%')) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
onClick: handleDownload.bind(null, record), |
||||
|
}, |
||||
|
]" |
||||
|
/> |
||||
|
</template> |
||||
|
</template> |
||||
|
<template #expandedRowRender> |
||||
|
<BasicTable @register="registerChildTable"> |
||||
|
<template #bodyCell="{ column, record }"> |
||||
|
<template v-if="column.key === 'action'"> |
||||
|
<TableAction |
||||
|
stopButtonPropagation |
||||
|
:actions="[ |
||||
|
{ |
||||
|
label: '详情', |
||||
|
icon: IconEnum.EDIT, |
||||
|
type: 'primary', |
||||
|
ghost: true, |
||||
|
ifShow: () => { |
||||
|
if ( |
||||
|
record.progressStatus != 'PENDING' && |
||||
|
record.progressStatus != 'STARTED' && |
||||
|
record.progressStatus != 'REVOKED' |
||||
|
) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
onClick: handleDetail.bind(null, record), |
||||
|
}, |
||||
|
{ |
||||
|
label: '下载', |
||||
|
icon: IconEnum.DOWNLOAD, |
||||
|
type: 'primary', |
||||
|
color: 'success', |
||||
|
ghost: true, |
||||
|
ifShow: () => { |
||||
|
if ( |
||||
|
record.progressStatus != 'PENDING' && |
||||
|
record.progressStatus != 'STARTED' && |
||||
|
record.progressStatus != 'REVOKED' |
||||
|
) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
onClick: handleDownload.bind(null, record), |
||||
|
}, |
||||
|
{ |
||||
|
label: '终止任务', |
||||
|
icon: IconEnum.DELETE, |
||||
|
type: 'primary', |
||||
|
danger: true, |
||||
|
ghost: true, |
||||
|
ifShow: () => { |
||||
|
if (record.progressStatus == 'PENDING') { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
popConfirm: { |
||||
|
placement: 'left', |
||||
|
title: '是否终止当前任务?', |
||||
|
confirm: handleStop.bind(null, record), |
||||
|
}, |
||||
|
}, |
||||
|
]" |
||||
|
/> |
||||
|
</template> |
||||
|
</template> |
||||
|
</BasicTable> |
||||
|
</template> |
||||
|
</BasicTable> |
||||
|
<DocumentTasksModal @register="registerModal" @reload="reload" /> |
||||
|
<DocsDrawer @register="registerDrawer" /> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
||||
|
import { DocumentTasksList, DocumentTasksStop } from '@/api/documentReview/DocumentTasks'; |
||||
|
import { getTasksPermissionsByUserId } from '@/api/taskPermissions/DocumentTasksPermissions'; |
||||
|
import { |
||||
|
DocumentTaskResultsInfoByTaskId, |
||||
|
DocumentTaskResultDownload, |
||||
|
} from '@/api/documentReview/DocumentTaskResults'; |
||||
|
import { useModal } from '@/components/Modal'; |
||||
|
import DocumentTasksModal from './DocumentTasksModal.vue'; |
||||
|
import { formSchemas, columns, childColumns } from './DocumentTasks.data'; |
||||
|
import { IconEnum } from '@/enums/appEnum'; |
||||
|
import { useDrawer } from '@/components/Drawer'; |
||||
|
import DocsDrawer from '@/views/documentReview/DocumentTasks/DocsDrawer.vue'; |
||||
|
import { onMounted, ref } from 'vue'; |
||||
|
import { DocumentTasksPermissionsVO } from '@/api/taskPermissions/DocumentTasksPermissions/model'; |
||||
|
let props = defineProps(['useSearchForm', 'showTableSetting', 'showToolbar', 'pagination']); |
||||
|
defineOptions({ name: 'DocumentTasks' }); |
||||
|
const documentData = ref<DocumentTasksPermissionsVO>(); |
||||
|
const [registerDrawer, { openDrawer }] = useDrawer(); |
||||
|
const childTableData = ref([]); |
||||
|
const [registerTable, { reload }] = useTable({ |
||||
|
api: DocumentTasksList, |
||||
|
showIndexColumn: false, |
||||
|
clickToRowSelect: false, |
||||
|
rowKey: 'id', |
||||
|
title: props.showTableSetting?"方案审核任务列表":'', |
||||
|
expandRowByClick: false, |
||||
|
useSearchForm: props.useSearchForm, |
||||
|
showTableSetting: props.showTableSetting, |
||||
|
beforeFetch: async (record) => { |
||||
|
if (props.pagination == false) { |
||||
|
(record.pageNum = 1), (record.pageSize = 5); |
||||
|
} |
||||
|
}, |
||||
|
pagination: props.pagination, |
||||
|
formConfig: { |
||||
|
schemas: formSchemas, |
||||
|
baseColProps: { |
||||
|
xs: 24, |
||||
|
sm: 24, |
||||
|
md: 24, |
||||
|
lg: 6, |
||||
|
}, |
||||
|
}, |
||||
|
columns: columns, |
||||
|
actionColumn: { |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
key: 'action', |
||||
|
fixed: 'right', |
||||
|
}, |
||||
|
}); |
||||
|
const [registerChildTable, { setProps: setChildProps }] = useTable({ |
||||
|
size: 'small', //紧凑型表格 |
||||
|
api: getchildTableData, |
||||
|
columns: childColumns, |
||||
|
rowKey: 'id', |
||||
|
useSearchForm: false, |
||||
|
showIndexColumn: false, |
||||
|
showTableSetting: false, |
||||
|
pagination: false, |
||||
|
maxHeight: 50, |
||||
|
actionColumn: { |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
key: 'action', |
||||
|
fixed: 'right', |
||||
|
}, |
||||
|
}); |
||||
|
// //定时器变量 方便在页面销毁的时候清楚定时器 |
||||
|
// const timer = ref<any>(null); |
||||
|
// //页面在刷新的时候可以加loading显示 方便页面展示 |
||||
|
// const loading = ref(false); |
||||
|
// //使countdown定时增加 如果增加到我们想要的时间 也就是变量autoRefreshTime 执行刷新 |
||||
|
// const countdown = ref(0); |
||||
|
// //定时刷新的时间 现在设置的为6 也就是6秒刷新一次数据 |
||||
|
// const autoRefreshTime = ref(30); |
||||
|
const [registerModal, { openModal }] = useModal(); |
||||
|
onMounted(async () => { |
||||
|
documentData.value = await getTasksPermissionsByUserId(); |
||||
|
// timer.value = window.setInterval(() => { |
||||
|
// //不loading的时候才会执行 |
||||
|
// if (!loading.value) { |
||||
|
// //countdown小于我们想要的定时时间的时候 定时器也是一秒执行一次 就继续+1 |
||||
|
// if (countdown.value < autoRefreshTime.value) { |
||||
|
// countdown.value = countdown.value + 1; |
||||
|
// //当定时器到时间的时候 去干我们想干的事情 refresh() |
||||
|
// if (countdown.value === autoRefreshTime.value) { |
||||
|
// countdown.value = 0; |
||||
|
// reload(); |
||||
|
// } |
||||
|
// } |
||||
|
// } |
||||
|
// }, 1000); |
||||
|
}); |
||||
|
const cleanHtml = (content) => { |
||||
|
// 移除DOCTYPE和html标签 |
||||
|
content = content.replace(/<!DOCTYPE[^>]*>/i, ''); |
||||
|
content = content.replace(/<html[^>]*>/i, ''); |
||||
|
content = content.replace(/<\/html>/i, ''); |
||||
|
|
||||
|
// 移除head部分 |
||||
|
content = content.replace(/<head>[\s\S]*?<\/head>/i, ''); |
||||
|
|
||||
|
// 移除body标签 |
||||
|
content = content.replace(/<body[^>]*>/i, ''); |
||||
|
content = content.replace(/<\/body>/i, ''); |
||||
|
|
||||
|
return content.trim(); |
||||
|
}; |
||||
|
async function handleDetail(record: Recordable) { |
||||
|
try { |
||||
|
let res = await DocumentTaskResultsInfoByTaskId(record.id); |
||||
|
if (record.taskName == 'schemEvaluation') { |
||||
|
// res.result=generateTable(JSON.parse(res.result as string)) |
||||
|
const updatedHtmlText = res.result?.replace( |
||||
|
/文件名称:\S+/g, |
||||
|
`文件名称:${record.documentName}`, |
||||
|
); |
||||
|
|
||||
|
openDrawer(true, { value: cleanHtml(updatedHtmlText), type: 'markdown' }); |
||||
|
} else if (record.taskName == 'checkDocumentError') { |
||||
|
openDrawer(true, { value: res.result, type: 'markdown' }); |
||||
|
} else { |
||||
|
openDrawer(true, { value: res.result, type: 'markdown' }); |
||||
|
} |
||||
|
console.log('res', res); |
||||
|
} catch (ex) { |
||||
|
openDrawer(true, { value: '加载失败,请刷新页面', type: 'markdown' }); |
||||
|
} |
||||
|
//根据record.id查询结果详情 |
||||
|
} |
||||
|
|
||||
|
async function handleStop(record: Recordable) { |
||||
|
await DocumentTasksStop(record.id); |
||||
|
await reload(); |
||||
|
} |
||||
|
|
||||
|
function handleAdd() { |
||||
|
openModal(true, { update: false }); |
||||
|
} |
||||
|
function tabelexpand(expanded, record) { |
||||
|
if (expanded) { |
||||
|
childTableData.value = record.childrenTasks; |
||||
|
// reloadChildTable() |
||||
|
console.log('expanded, record', expanded, record); |
||||
|
} |
||||
|
} |
||||
|
// 修改后的 getchildTableData 函数 |
||||
|
function getchildTableData() { |
||||
|
console.log('childTableData', childTableData.value); |
||||
|
const height = 50 * childTableData.value.length; |
||||
|
setChildProps({ maxHeight: height }); |
||||
|
|
||||
|
// 返回一个 Promise 对象,包含预期的数据结构 |
||||
|
return Promise.resolve(childTableData.value); |
||||
|
} |
||||
|
async function handleDownload(record: Recordable) { |
||||
|
if (record.childrenTasks?.length > 1) { |
||||
|
await DocumentTaskResultDownload(record.childrenTasks.map((item) => item.id)); |
||||
|
await reload(); |
||||
|
} else if (record.childrenTasks?.length == 1) { |
||||
|
await DocumentTaskResultDownload([record.childrenTasks[0].id]); |
||||
|
|
||||
|
await reload(); |
||||
|
} else { |
||||
|
await DocumentTaskResultDownload([record.id]); |
||||
|
await reload(); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
@ -0,0 +1,119 @@ |
|||||
|
import { BasicColumn } from '@/components/Table'; |
||||
|
import { FormSchema } from '@/components/Form'; |
||||
|
import { getDictOptions } from '@/utils/dict'; |
||||
|
import { useRender } from '@/hooks/component/useRender'; |
||||
|
import { uploadDocument } from '@/api/documentReview/DocumentTasks'; |
||||
|
export const formSchemas: FormSchema[] = [ |
||||
|
{ |
||||
|
label: '任务名称', |
||||
|
field: 'taskName', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: [{ |
||||
|
label: '招标文件审核', |
||||
|
value: 'sjjbidAnalysis', |
||||
|
}] |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '招标文件名称', |
||||
|
field: 'tenderDocumentName', |
||||
|
component: 'Input', |
||||
|
}, |
||||
|
{ |
||||
|
label: '投标文件名称', |
||||
|
field: 'bidDocumentName', |
||||
|
component: 'Input', |
||||
|
}, |
||||
|
{ |
||||
|
label: '进度状态', |
||||
|
field: 'progressStatus', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: getDictOptions('document_task_status') |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '文件是否已删除', |
||||
|
field: 'deleteFlag', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: getDictOptions('sys_yes_no') |
||||
|
}, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
const { renderDict } = useRender(); |
||||
|
export const columns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: '任务ID', |
||||
|
dataIndex: 'id', |
||||
|
ifShow: false, |
||||
|
}, |
||||
|
{ |
||||
|
title: '任务名称', |
||||
|
dataIndex: 'taskName', |
||||
|
customRender: ({ value }) => "招标文件审核", |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
title: '招标文件名称', |
||||
|
dataIndex: 'tenderDocumentName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '投标文件名称', |
||||
|
dataIndex: 'bidDocumentName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '进度状态', |
||||
|
dataIndex: 'progressStatus', |
||||
|
customRender: ({ value }) => renderDict(value, 'document_task_status'), |
||||
|
}, |
||||
|
{ |
||||
|
title: '文件是否已删除', |
||||
|
dataIndex: 'deleteFlag', |
||||
|
customRender: ({ value }) => renderDict(value, 'sys_yes_no'), |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
export const modalSchemas: FormSchema[] = [ |
||||
|
{ |
||||
|
label: '任务名称', |
||||
|
field: 'taskName', |
||||
|
required: true, |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: [{ |
||||
|
label: '招标文件审核', |
||||
|
value: 'sjjbidAnalysis', |
||||
|
}] |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '招标文件', |
||||
|
field: 'tenderDocOssId', |
||||
|
component: 'Upload', |
||||
|
componentProps: { |
||||
|
accept: ['.docx', '.pdf'], |
||||
|
maxSize: 500, |
||||
|
multiple: false, |
||||
|
resultField: 'ossId', |
||||
|
api: uploadDocument, |
||||
|
beforeUploadPrompt:"严禁在本互联网非涉密平台处理、传输国家秘密。请再次确认您上传的文件资料不涉及国家秘密。" |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '投标文件集', |
||||
|
field: 'bidDocOssId', |
||||
|
required: true, |
||||
|
component: 'Upload', |
||||
|
componentProps: { |
||||
|
accept: ['.zip'], |
||||
|
maxSize: 500, |
||||
|
multiple: false, |
||||
|
resultField: 'ossId', |
||||
|
api: uploadDocument, |
||||
|
beforeUploadPrompt:"严禁在本互联网非涉密平台处理、传输国家秘密。请再次确认您上传的文件资料不涉及国家秘密。" |
||||
|
}, |
||||
|
}, |
||||
|
]; |
@ -0,0 +1,74 @@ |
|||||
|
<template> |
||||
|
<BasicModal |
||||
|
v-bind="$attrs" |
||||
|
:title="title" |
||||
|
@register="registerInnerModal" |
||||
|
@ok="handleSubmit" |
||||
|
@cancel="resetForm" |
||||
|
> |
||||
|
<BasicForm @register="registerForm" /> |
||||
|
</BasicModal> |
||||
|
|
||||
|
|
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { BasicModal, useModalInner } from '@/components/Modal'; |
||||
|
import { BasicForm, useForm } from '@/components/Form'; |
||||
|
import { computed, ref, unref } from 'vue'; |
||||
|
import { SjjDocumentTasksInfo, SjjDocumentTasksAdd, SjjDocumentTasksUpdate } from '@/api/documentReview/SjjDocumentTasks'; |
||||
|
import { modalSchemas } from './SjjDocumentTasks.data'; |
||||
|
|
||||
|
|
||||
|
defineOptions({ name: 'SjjDocumentTasksModal' }); |
||||
|
|
||||
|
const emit = defineEmits(['register', 'reload']); |
||||
|
|
||||
|
const isUpdate = ref<boolean>(false); |
||||
|
const title = computed<string>(() => { |
||||
|
return isUpdate.value ? '编辑审计局标书任务' : '新增审计局标书任务'; |
||||
|
}); |
||||
|
|
||||
|
const [registerInnerModal, { modalLoading, closeModal }] = useModalInner( |
||||
|
async (data: { record?: Recordable; update: boolean }) => { |
||||
|
modalLoading(true); |
||||
|
const { record, update } = data; |
||||
|
isUpdate.value = update; |
||||
|
if (update && record) { |
||||
|
const ret = await SjjDocumentTasksInfo(record.id); |
||||
|
await setFieldsValue(ret); |
||||
|
} |
||||
|
modalLoading(false); |
||||
|
}, |
||||
|
); |
||||
|
|
||||
|
const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({ |
||||
|
labelWidth: 100, |
||||
|
showActionButtonGroup: false, |
||||
|
baseColProps: { span: 24 }, |
||||
|
schemas: modalSchemas, |
||||
|
}); |
||||
|
|
||||
|
async function handleSubmit() { |
||||
|
try { |
||||
|
modalLoading(true); |
||||
|
const data = await validate(); |
||||
|
if (unref(isUpdate)) { |
||||
|
await SjjDocumentTasksUpdate(data); |
||||
|
} else { |
||||
|
data['tenderDocOssId'] = data['tenderDocOssId'][0]; |
||||
|
data['bidDocOssId'] = data['bidDocOssId'][0]; |
||||
|
await SjjDocumentTasksAdd(data); |
||||
|
} |
||||
|
emit('reload'); |
||||
|
closeModal(); |
||||
|
await resetForm(); |
||||
|
} catch (e) { |
||||
|
} finally { |
||||
|
modalLoading(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
File diff suppressed because it is too large
@ -0,0 +1,206 @@ |
|||||
|
<template> |
||||
|
<PageWrapper dense> |
||||
|
<BasicTable @register="registerTable"> |
||||
|
<template #toolbar> |
||||
|
<!-- <a-button |
||||
|
@click="downloadExcel(SjjDocumentTasksExport, '审计局标书任务数据', getForm().getFieldsValue())" |
||||
|
v-auth="'productManagement:SjjDocumentTasks:export'" |
||||
|
>导出</a-button |
||||
|
> |
||||
|
<a-button |
||||
|
type="primary" |
||||
|
danger |
||||
|
@click="multipleRemove(SjjDocumentTasksRemove)" |
||||
|
:disabled="!selected" |
||||
|
v-auth="'productManagement:SjjDocumentTasks:remove'" |
||||
|
>删除</a-button |
||||
|
> --> |
||||
|
<a-button |
||||
|
type="primary" |
||||
|
@click="handleAdd" |
||||
|
v-auth="'productManagement:SjjDocumentTasks:add'" |
||||
|
>新增</a-button |
||||
|
> |
||||
|
</template> |
||||
|
<template #bodyCell="{ column, record }"> |
||||
|
<template v-if="column.key === 'action'"> |
||||
|
<TableAction |
||||
|
stopButtonPropagation |
||||
|
:actions="[ |
||||
|
{ |
||||
|
label: '详情', |
||||
|
icon: IconEnum.EDIT, |
||||
|
type: 'primary', |
||||
|
ghost: true, |
||||
|
ifShow: () => { |
||||
|
if ( |
||||
|
record.progressStatus != 'PENDING' && |
||||
|
record.progressStatus != 'STARTED' && |
||||
|
record.progressStatus != 'REVOKED' |
||||
|
) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
onClick: handleDetail.bind(null, record), |
||||
|
}, |
||||
|
{ |
||||
|
label: '删除', |
||||
|
icon: IconEnum.DELETE, |
||||
|
type: 'primary', |
||||
|
ifShow: () => { |
||||
|
return record.deleteFlag == 'N'; |
||||
|
}, |
||||
|
danger: true, |
||||
|
ghost: true, |
||||
|
popConfirm: { |
||||
|
placement: 'left', |
||||
|
title: `是否删除文件?`, |
||||
|
confirm: handleDeleteOss.bind(null, record), |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '下载', |
||||
|
icon: IconEnum.DOWNLOAD, |
||||
|
type: 'primary', |
||||
|
color: 'success', |
||||
|
ghost: true, |
||||
|
ifShow: () => { |
||||
|
if ( |
||||
|
record.progressStatus != 'PENDING' && |
||||
|
record.progressStatus != 'STARTED' && |
||||
|
record.progressStatus != 'REVOKED' |
||||
|
) { |
||||
|
return true; |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
}, |
||||
|
onClick: handleDownload.bind(null, record), |
||||
|
}, |
||||
|
]" |
||||
|
/> |
||||
|
</template> |
||||
|
</template> |
||||
|
</BasicTable> |
||||
|
<SjjDocumentTasksModal @register="registerModal" @reload="reload" /> |
||||
|
<DocsDrawer @register="registerDrawer" /> |
||||
|
</PageWrapper> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { PageWrapper } from '@/components/Page'; |
||||
|
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
||||
|
import { SjjDocumentTasksList, SjjDocumentTasksExport, SjjDocumentTasksRemove,SjjDocumentTasksOssRemoveById } from '@/api/documentReview/SjjDocumentTasks'; |
||||
|
import { downloadExcel } from '@/utils/file/download'; |
||||
|
import { useModal } from '@/components/Modal'; |
||||
|
import SjjDocumentTasksModal from './SjjDocumentTasksModal.vue'; |
||||
|
import { formSchemas, columns } from './SjjDocumentTasks.data'; |
||||
|
import { IconEnum } from '@/enums/appEnum'; |
||||
|
import { |
||||
|
DocumentTaskResultsInfoByTaskId, |
||||
|
DocumentTaskResultDownload, |
||||
|
} from '@/api/documentReview/DocumentTaskResults'; |
||||
|
import { useDrawer } from '@/components/Drawer'; |
||||
|
import DocsDrawer from '@/views/documentReview/DocumentTasks/DocsDrawer.vue'; |
||||
|
import {ossRemove } from '@/api/system/oss'; |
||||
|
|
||||
|
const [registerDrawer, { openDrawer }] = useDrawer(); |
||||
|
defineOptions({ name: 'SjjDocumentTasks' }); |
||||
|
|
||||
|
const [registerTable, { reload, multipleRemove, selected, getForm }] = useTable({ |
||||
|
rowSelection: { |
||||
|
type: 'checkbox', |
||||
|
}, |
||||
|
title: '审计局标书任务列表', |
||||
|
api: SjjDocumentTasksList, |
||||
|
showIndexColumn: false, |
||||
|
rowKey: 'id', |
||||
|
useSearchForm: true, |
||||
|
formConfig: { |
||||
|
schemas: formSchemas, |
||||
|
baseColProps: { |
||||
|
xs: 24, |
||||
|
sm: 24, |
||||
|
md: 24, |
||||
|
lg: 6, |
||||
|
}, |
||||
|
}, |
||||
|
columns: columns, |
||||
|
actionColumn: { |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
key: 'action', |
||||
|
fixed: 'right', |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
const [registerModal, { openModal }] = useModal(); |
||||
|
|
||||
|
function handleEdit(record: Recordable) { |
||||
|
openModal(true, { record, update: true }); |
||||
|
} |
||||
|
|
||||
|
function handleAdd() { |
||||
|
openModal(true, { update: false }); |
||||
|
} |
||||
|
|
||||
|
async function handleDelete(record: Recordable) { |
||||
|
await SjjDocumentTasksRemove([record.id]); |
||||
|
await reload(); |
||||
|
} |
||||
|
async function handleDownload(record: Recordable) { |
||||
|
if (record.childrenTasks?.length > 1) { |
||||
|
await DocumentTaskResultDownload(record.childrenTasks.map((item) => item.id)); |
||||
|
} else if (record.childrenTasks?.length == 1) { |
||||
|
await DocumentTaskResultDownload([record.childrenTasks[0].id]); |
||||
|
|
||||
|
} else { |
||||
|
await DocumentTaskResultDownload([record.id]); |
||||
|
} |
||||
|
} |
||||
|
async function handleDeleteOss(record: Recordable) { |
||||
|
await SjjDocumentTasksOssRemoveById([record.id]); |
||||
|
await reload(); |
||||
|
} |
||||
|
async function handleDetail(record: Recordable) { |
||||
|
try { |
||||
|
let res = await DocumentTaskResultsInfoByTaskId(record.id); |
||||
|
if (record.taskName == 'schemEvaluation') { |
||||
|
// res.result=generateTable(JSON.parse(res.result as string)) |
||||
|
const updatedHtmlText = res.result?.replace( |
||||
|
/文件名称:\S+/g, |
||||
|
`文件名称:${record.documentName}`, |
||||
|
); |
||||
|
|
||||
|
openDrawer(true, { value: cleanHtml(updatedHtmlText), type: 'markdown' }); |
||||
|
} else if (record.taskName == 'checkDocumentError') { |
||||
|
openDrawer(true, { value: res.result, type: 'markdown' }); |
||||
|
} else { |
||||
|
openDrawer(true, { value: res.result, type: 'markdown' }); |
||||
|
} |
||||
|
console.log('res', res); |
||||
|
} catch (ex) { |
||||
|
openDrawer(true, { value: '加载失败,请刷新页面', type: 'markdown' }); |
||||
|
} |
||||
|
//根据record.id查询结果详情 |
||||
|
} |
||||
|
const cleanHtml = (content) => { |
||||
|
// 移除DOCTYPE和html标签 |
||||
|
content = content.replace(/<!DOCTYPE[^>]*>/i, ''); |
||||
|
content = content.replace(/<html[^>]*>/i, ''); |
||||
|
content = content.replace(/<\/html>/i, ''); |
||||
|
|
||||
|
// 移除head部分 |
||||
|
content = content.replace(/<head>[\s\S]*?<\/head>/i, ''); |
||||
|
|
||||
|
// 移除body标签 |
||||
|
content = content.replace(/<body[^>]*>/i, ''); |
||||
|
content = content.replace(/<\/body>/i, ''); |
||||
|
|
||||
|
return content.trim(); |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
Loading…
Reference in new issue