3.9.2 VUE打包报错 #9595

This commit is contained in:
JEECG 2026-04-30 17:27:01 +08:00
parent 0941ed6fa1
commit 6f00250239
4 changed files with 1 additions and 1013 deletions

View File

@ -53,7 +53,7 @@
import { useListPage } from '/@/hooks/system/useListPage';
import { useMessage } from '/@/hooks/web/useMessage';
import { defHttp } from '/@/utils/http/axios';
import { useTableColumns } from '../hooks/useTableColumns';
import { useTableColumns } from '@/views/super/online/cgform/hooks/auto/useTableColumns';
import { createAsyncComponent } from '@/utils/factory/createAsyncComponent';
import { useFixedHeightModal } from '../hooks/useLinkTable';

View File

@ -1,648 +0,0 @@
import type { Ref } from 'vue';
import type { ExtConfigType } from '../../types';
import { HrefSlots, OnlineColumn } from '/@/components/jeecg/OnLine/types/onlineConfig';
import { filterMultiDictObjs } from '/@/utils/dict/JDictSelectUtil';
import { computed, defineAsyncComponent, h, reactive, ref, toRaw, unref, watch, markRaw } from 'vue';
import { useRouter } from 'vue-router';
import { Tag as ATag } from 'ant-design-vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { getAreaTextByCodeAnyLevel } from '/@/components/Form/src/utils/Area';
import { createImgPreview } from '@/components/Preview';
import { importViewsFile, _eval } from '/@/utils';
import { useModal } from '/@/components/Modal';
import LinkTableListPiece from '../../extend/linkTable/LinkTableListPiece.vue'
import { getToken } from "/@/utils/auth";
import { downloadFile } from '/@/api/common/api';
import { getWeekMonthQuarterYear, split } from '/@/utils';
import { getItemColor } from "@/utils/dict/DictColors";
/**
* 获取实际列表需要的column配置
* @param onlineTableContext 从数据库中查出来的数据
* @param extConfigJson 扩展配置JSON
*/
export function useTableColumns(onlineTableContext, extConfigJson: Ref<ExtConfigType | undefined>) {
// href
let router = useRouter();
//
const columns = ref<Array<OnlineColumn>>([]);
/**
* 20260309
* liaozhiyang
* issues/9336列宽拖动不了
* */
function applyResizableColumns(cols: OnlineColumn[]) {
cols.forEach((column) => {
if (!column.width) {
if (column.fieldType === 'date' || column.fieldType === 'Date') {
column.width = 120;
} else if (column.fieldType === 'link_table') {
column.width = 180;
} else {
column.width = 150;
}
}
column.resizable = true;
});
}
// bpm_status
//const hasBpmStatus = ref<boolean>(false)
//
const dictOptionInfo = ref<any>({});
//
const selectedKeys = ref<any[]>([]);
//
//const selectRows = ref<Array<any>>([]);
// --computed
const rowSelection = ref<any>(null);
//
let enableScrollBar = ref(true);
// tablescroll
let tableScroll = computed(() => {
if (enableScrollBar.value == true) {
return undefined;
} else {
// X
return { x: false };
}
});
// online -
const [registerOnlineHrefModal, { openModal: openOnlineHrefModal }] = useModal();
const hrefMainTableId = ref('')
// online
const [registerPopModal, { openModal: openPopModal }] = useModal();
const popTableId = ref('')
//
function handleColumnResult(result, type = 'checkbox') {
//
dictOptionInfo.value = result.dictOptions;
// rowSelection
if (result.checkboxFlag == 'Y') {
rowSelection.value = {
selectedRowKeys: selectedKeys,
onChange: onSelectChange,
type,
};
} else {
rowSelection.value = null;
}
//
enableScrollBar.value = result.scrollFlag == 1;
let dataColumns = result.columns;
dataColumns.forEach((column) => {
if (extConfigJson?.value?.canResizeColumn === 1) {
// update-begin--author:liaozhiyang---date:20260309---for:issues/9336
applyResizableColumns([column]);
// update-end--author:liaozhiyang---date:20260309---for:issues/9336
}
// update-begin--author:liaozhiyang---date:20230818---forQQYUN-4161
if (column.fieldExtendJson) {
const json = JSON.parse(column.fieldExtendJson);
if (!!json.isFixed) {
column.fixed = 'left';
}
}
// update-end--author:liaozhiyang---date:20230818---forQQYUN-4161
// update-begin--author:liaozhiyang---date:20240517---forTV360X-129href
if (column.hrefSlotName && column.scopedSlots) {
const obj = result.fieldHrefSlots?.find((item) => item.slotName === column.hrefSlotName);
if (obj) {
column.fieldHref = obj;
}
}
// update-end--author:liaozhiyang---date:20240517---forTV360X-129href
Object.keys(column).map((key) => {
// ('') 0
if (column[key] == null) {
delete column[key];
}
});
});
// href
let fieldHrefSlots: HrefSlots[] = result.fieldHrefSlots;
const fieldHrefSlotKeysMap = {};
fieldHrefSlots.forEach((item) => (fieldHrefSlotKeysMap[item.slotName] = item));
let tableColumns: OnlineColumn[] = [];
// href dict 使
tableColumns = handleColumnHrefAndDict(dataColumns, fieldHrefSlotKeysMap);
// bpm_status
bpmStatusFilter(tableColumns);
console.log('-----列表列配置----', tableColumns);
// align
if (onlineTableContext.isTree() === true) {
//
let firstField = result.textField;
let index = -1;
for (let i = 0; i < tableColumns.length; i++) {
if (tableColumns[i].dataIndex == firstField) {
index = i;
break;
}
}
if (index > 0) {
//0-1
let deleteColumns = tableColumns.splice(index, 1);
tableColumns.unshift(deleteColumns[0]);
}
//
if (tableColumns.length > 0) {
tableColumns[0].align = 'left';
}
}
columns.value = tableColumns;
//
onlineTableContext.reloadTable();
}
/**
* 表格选择事件 [expose]
* @param selectedRowKeys
* @param selectRow
*/
function onSelectChange(selectedRowKeys, selectedRows) {
selectedKeys.value = selectedRowKeys;
onlineTableContext['selectedRows'] = toRaw(selectedRows);
onlineTableContext['selectedRowKeys'] = toRaw(selectedRowKeys);
}
/**
* 处理列的href和字典翻译
*/
function handleColumnHrefAndDict(columns: OnlineColumn[], fieldHrefSlotKeysMap: {}): OnlineColumn[] {
for (let column of columns) {
let { customRender, hrefSlotName, fieldType } = column;
// online yyyy-MM-dd (yyyy-MM-dd HH:mm:ss) issues/3042
if (fieldType == 'date' || fieldType == 'Date') {
column.customRender = ({ text }) => {
if (!text) {
return '';
}
if (text.length > 10) {
return text.substring(0, 10);
}
return text;
};
} else if (fieldType == 'link_table') {
//
// update-begin--author:liaozhiyang---date:20250318---forissues/7930
const fieldExtendJson = column.fieldExtendJson ?? '{}';
const json = JSON.parse(fieldExtendJson);
// update-end--author:liaozhiyang---date:20250318---forissues/7930
column.customRender = ({ text, record }) => {
if (!text) {
return '';
}
if(onlineTableContext.isPopList===true){
//
return record[column.dataIndex+"_dictText"]
}else{
let tempIdArray = (text+'').split(',');
//update-begin-author:taoyan date:2023-2-15 for: QQYUN-4286online
let tempLabelArray = [];
if(record[column.dataIndex+"_dictText"]){
tempLabelArray = record[column.dataIndex+"_dictText"].split(',');
}
//update-end-author:taoyan date:2023-2-15 for: QQYUN-4286online
let renderResult:any = []
for(let i=0;i<tempIdArray.length;i++){
let renderObj = h(
LinkTableListPiece,
{
id: tempIdArray[i],
text: tempLabelArray[i],
onTab:(id)=>handleClickLinkTable(id, hrefSlotName, json.isListReadOnly)
}
);
renderResult.push(renderObj)
}
if(renderResult.length==0){
return ''
}
//display: flex;width: 100%;flex-wrap: wrap;flex-direction: row;
return h('div',{style:{'overflow':'hidden'}}, renderResult);
}
};
} else if (fieldType === 'popup_dict') {
// update-begin--author:liaozhiyang---date:20240402---forQQYUN-8833JPopupDict
column.customRender = ({ text, record }) => {
const dict = record[column.dataIndex + '_dictText'];
if (dict != undefined) {
return record[column.dataIndex + '_dictText'];
}
return text;
};
// update-end--author:liaozhiyang---date:20240402---forQQYUN-8833JPopupDict
} else {
if (!hrefSlotName && column.scopedSlots && column.scopedSlots.customRender) {
//Onlinehref fieldHrefSlotKeysMap href
if (fieldHrefSlotKeysMap.hasOwnProperty(column.scopedSlots.customRender)) {
hrefSlotName = column.scopedSlots.customRender;
}
}
// customRender 使
// hrefSlotName 使href
// href
if (customRender || hrefSlotName) {
let dictCode = customRender as string;
let replaceFlag = '_replace_text_';
// ellipsis
column.ellipsis = true;
column.customRender = ({ text, record }) => {
let value = text;
const valueSpan: any[] = [];
const getValue = () => valueSpan.length ? valueSpan : value;
// dictCode
if (dictCode) {
if (dictCode.startsWith(replaceFlag)) {
let textFieldName = dictCode.replace(replaceFlag, '');
value = record[textFieldName];
} else {
const dictItems = filterMultiDictObjs(unref(dictOptionInfo)[dictCode], text);
value = dictItems.map((item) => {
if (item.hasColor) {
//
const fontColor = getItemColor(item.color);
valueSpan.push(h(ATag, {
color: item.color,
style: {
'color': fontColor,
'margin-left': '5px',
},
}, () => item.text))
}
return item.text;
}).join(',');
}
}
//
if (column.showLength) {
if (value && value.length > column.showLength) {
value = value.substr(0, column.showLength) + '...';
}
}
// hrefSlotName a
if (hrefSlotName) {
let field = fieldHrefSlotKeysMap[hrefSlotName];
if (field) {
return h(
'a',
{
onClick: () => handleClickFieldHref(field, record),
},
getValue(),
);
}
}
return h('span', {}, getValue());
};
}
// scopedSlots slots
if (column.scopedSlots) {
// slot ellipsis
column.ellipsis = true;
let slots = column.scopedSlots;
column['slots'] = slots;
delete column.scopedSlots;
}
}
}
return columns;
}
/**
* href 点击事件
* @param field
* @param record
*/
function handleClickFieldHref(field, record) {
let href = field.href;
let urlPattern = /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?/;
let compPattern = /\.vue(\?.*)?$/;
let jsPattern = /{{([^}]+)}}/g; // {{ xxx }}
if (typeof href === 'string') {
if(href.startsWith('ONLINE:')){
// ONLINE:tableId:fieldName
let arr = href.split(':')
hrefMainTableId.value = arr[1];
let fieldName = arr[2];
openOnlineHrefModal(true, {
isUpdate: true,
disableSubmit: true,
hideSub: true,
record:{id: record[fieldName]},
})
}else{
href = href.trim().replace(/\${([^}]+)?}/g, (_s1, s2) => record[s2]);
// {{...}} JS
if (jsPattern.test(href)) {
href = href.replace(jsPattern, function (text, s0) {
try {
// {{ ACCESS_TOKEN }}
if (s0.trim() === 'ACCESS_TOKEN') {
return getToken()
}
// update-begin--author:liaozhiyang---date:20230904---forQQYUN-6390evalnew Functionbuild
return _eval(s0);
// update-end--author:liaozhiyang---date:20230904---forQQYUN-6390evalnew Functionbuild
} catch (e) {
console.error(e);
return text;
}
});
}
if (urlPattern.test(href)) {
window.open(href, '_blank');
} else if (compPattern.test(href)) {
//
openHrefCompModal(href);
} else {
router.push(href);
}
}
}
}
//
const dialogStyle = {
top: 0,
left: 0,
height: '100%',
margin: 0,
padding: 0,
};
// update-begin--author:liaozhiyang---date:20231218---forQQYUN-6366antd4.x
//
const hrefComponent = reactive({
model: {
title: '',
okText: '关闭',
width: '100%',
open: false,
destroyOnClose: true,
style: dialogStyle,
// dialogStyle: dialogStyle,
bodyStyle: { padding: '8px', height: 'calc(100vh - 108px)', overflow: 'auto', overflowX: 'hidden' },
//
cancelButtonProps: { style: { display: 'none' } },
},
on: {
ok: () => (hrefComponent.model.open = false),
cancel: () => (hrefComponent.model.open = false),
},
is: <any>null,
params: {},
});
// update-end--author:liaozhiyang---date:20231218---forQQYUN-6366antd4.x
// --> modal
function openHrefCompModal(href) {
// href
let index = href.indexOf('?');
let path = href;
if (index !== -1) {
path = href.substring(0, index);
let paramString = href.substring(index + 1, href.length);
let paramArray = paramString.split('&');
let params = {};
paramArray.forEach((paramObject) => {
let paramItem = paramObject.split('=');
params[paramItem[0]] = paramItem[1];
});
hrefComponent.params = params;
} else {
hrefComponent.params = {};
}
// update-begin--author:liaozhiyang---date:20231218---forQQYUN-6366antd4.x
hrefComponent.model.open = true;
// update-end--author:liaozhiyang---date:20231218---forQQYUN-6366antd4.x
hrefComponent.model.title = '操作';
hrefComponent.is = markRaw(defineAsyncComponent(() => importViewsFile(path)));
}
//
let fixedAction:any = 'right';
if(onlineTableContext.isTree()){
fixedAction = 'right'
}
const actionColumn = reactive<OnlineColumn>({
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: fixedAction,
align: 'center',
width: 150,
});
//
watch(() => extConfigJson?.value, () => {
if (extConfigJson?.value?.tableFixedAction === 1) {
actionColumn.fixed = extConfigJson?.value?.tableFixedActionType || 'right';
if (onlineTableContext.isTree()) {
actionColumn.fixed = 'right';
}
}
// update-begin--author:liaozhiyang---date:20260309---for:issues/9336
if (extConfigJson?.value?.canResizeColumn === 1 && columns.value.length > 0) {
applyResizableColumns(columns.value);
onlineTableContext.reloadTable();
}
// update-end--author:liaozhiyang---date:20260309---for:issues/9336
});
//
function bpmStatusFilter(tableColumns: OnlineColumn[]): boolean {
let flag = false;
for (let i = 0; i < tableColumns.length; i++) {
let item = tableColumns[i];
let fieldName = item.dataIndex;
if (fieldName!.toLowerCase() == 'bpm_status') {
flag = true;
break;
}
}
onlineTableContext['hasBpmStatus'] = flag;
return flag;
}
/**
* 文件
* @param text
*/
function downloadRowFile(text, record, column, id) {
if (!text) {
return;
}
// update-begin--author:liaozhiyang---date:20240124---forQQYUN-8020online
if (text.indexOf(',') > 0) {
downloadFile(`/online/cgform/field/download/${id}/${record.id}/${column.dataIndex}`, `文件_${record.id}.zip`);
} else {
const url = getFileAccessHttpUrl(text);
window.open(url);
}
// update-end--author:liaozhiyang---date:20240124---forQQYUN-8020online
}
/**
* 图片
* @param text
*/
function getImgView(text) {
if (text && text.indexOf(',') > 0) {
// update-begin--author:liaozhiyang---date:20250325---forissues/7990
text = split(text)[0];
// update-end--author:liaozhiyang---date:20250325---forissues/7990
}
return getFileAccessHttpUrl(text);
}
/**
* 根据编码获取省市区文本
* @param code
*/
function getPcaText(code, column) {
if (!code) {
return '';
}
// update-begin--author:liaozhiyang---date:20260204---for:QQYUN-14694online
let includeParent = true;
let fieldExtendJson = column?.fieldExtendJson;
let level = 3;
if (fieldExtendJson) {
fieldExtendJson = JSON.parse(fieldExtendJson);
if (['province', 'city', 'region'].includes(fieldExtendJson.displayLevel)) {
if (fieldExtendJson.displayLevel === 'province') {
level = 1;
} else if (fieldExtendJson.displayLevel === 'city') {
level = 2;
} else if (fieldExtendJson.displayLevel === 'region') {
level = 3;
}
includeParent = false;
}
}
return getAreaTextByCodeAnyLevel(code, includeParent, level as 1 | 2 | 3);
// update-end--author:liaozhiyang---date:20260204---for:QQYUN-14694online
}
/**
* 日期格式化
* @param text
*/
function getFormatDate(text, column) {
if (!text) {
return '';
}
let a = text;
if (a.length > 10) {
a = a.substring(0, 10);
}
// update-begin--author:liaozhiyang---date:20240430---forissues/6094online ()
let fieldExtendJson = column?.fieldExtendJson;
if (fieldExtendJson) {
fieldExtendJson = JSON.parse(fieldExtendJson);
if (fieldExtendJson.picker && fieldExtendJson.picker != 'default') {
const result = getWeekMonthQuarterYear(a);
return result[fieldExtendJson.picker];
}
}
// update-end--author:liaozhiyang---date:20240430---forissues/6094online ()
return a;
}
watch(selectedKeys, () => {
onlineTableContext['selectedRowKeys'] = toRaw(selectedKeys.value);
});
onlineTableContext['clearSelectedRow'] = () => {
selectedKeys.value = [];
onlineTableContext['selectedRows'] = [];
onlineTableContext['selectedRowKeys'] = [];
};
/**
* 预览列表 cell 图片
* @param text
*/
function viewOnlineCellImage(text) {
if (text) {
let imgList: any = [];
// update-begin--author:liaozhiyang---date:20250325---forissues/7990
const arr = split(text);
// update-end--author:liaozhiyang---date:20250325---forissues/7990
for (let str of arr) {
if (str) {
imgList.push(getFileAccessHttpUrl(str));
}
}
createImgPreview({ imageList: imgList });
}
}
/**
* link table控件在列表上显示 支持点击跳转表单
* @param id
* @param hrefTableName
*/
const onlinePopModalRef = ref();
async function handleClickLinkTable(id, hrefTableName, isListReadOnly){
popTableId.value = hrefTableName;
let formStatus = await onlinePopModalRef.value.getFormStatus();
//
if(formStatus==true){
hrefMainTableId.value = hrefTableName;
openOnlineHrefModal(true, {
isUpdate: true,
disableSubmit: true,
hideSub: true,
record:{id: id},
})
}else{
openPopModal(true, {
isUpdate: true,
// update-begin--author:liaozhiyang---date:20250318---forissues/7930
disableSubmit: isListReadOnly ? true : false,
// update-end--author:liaozhiyang---date:20250318---forissues/7930
record: {
id: id
}
});
}
}
return {
columns,
actionColumn,
selectedKeys,
rowSelection,
enableScrollBar,
tableScroll,
downloadRowFile,
getImgView,
getPcaText,
getFormatDate,
handleColumnResult,
onSelectChange,
hrefComponent,
viewOnlineCellImage,
hrefMainTableId,
registerOnlineHrefModal,
registerPopModal,
openPopModal,
openOnlineHrefModal,
onlinePopModalRef,
popTableId,
handleClickFieldHref,
};
}

View File

@ -1,187 +0,0 @@
<template>
<div class="cust-onl-form">
<a-spin :spinning="spinLoading">
<online-form
ref="onlineFormCompRef"
:id="formId"
:disabled="disabled"
:form-template="formTemplate"
:isTree="isTreeForm"
:pidField="pidFieldName"
:taskId="taskId"
@rendered="renderSuccess"
@success="handleSuccess"
@validate="validateBack"
@close="handleClose"
>
<template #bottom>
<div style="width: 100%; text-align: center; margin-top: 5px" v-if="!disabled && !spinLoading && showSubmitButton">
<a-button preIcon="ant-design:check" style="width: 126px" type="primary" @click="handleSubmit" :loading="buttonLoading"> </a-button>
</div>
<!-- 任务办理意见 -->
<TaskOpinionList class="task-opinion" :taskId="taskOriginalId" :procInsId="procInsId" :processTabType="processTabType" />
</template>
</online-form>
</a-spin>
</div>
</template>
<script>
/**
* 工作流online表单调--中转的意义在于在此查询表单信息
*/
import OnlineForm from './OnlineForm.vue';
import { defineComponent, ref, watch, nextTick, computed } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { getRefPromise } from '../../hooks/auto/useAutoForm';
import TaskOpinionList from "@/views/super/online/cgform/auto/comp/TaskOpinionList.vue";
import {useGlobSetting} from "@/hooks/setting";
export default defineComponent({
name: 'ProcessOnlineForm',
inheritAttrs: false,
components: {
TaskOpinionList,
OnlineForm,
},
props: {
dataId: {
type: String,
default: '',
},
tableName: {
type: String,
default: '',
},
taskId: {
type: String,
default: '',
},
taskOriginalId: {
type: String,
default: '',
},
procInsId: {
type: String,
default: '',
},
processTabType: {
type: String,
default: '',
},
disabled: {
type: Boolean,
default: false,
},
},
emits: ['success','validate'],
setup(props, { emit }) {
const onlineFormCompRef = ref();
const formId = ref('');
const formTemplate = ref(1);
const isTreeForm = ref(false);
const pidFieldName = ref('');
const spinLoading = ref(false);
//
watch(
() => props.tableName,
(val) => {
if (!val) {
return;
}
loadFormItems();
},
{ immediate: true }
);
//update-begin-author:liusq---date:2026-01-20--for: online
const showSubmitButton = computed(() => {
return !useGlobSetting().useNewTaskModal;
});
//update-end-author:liusq---date:2026-01-20--for: online
//
async function loadFormItems() {
spinLoading.value = true;
const url = `/online/cgform/api/getFormItemBytbname/${props.tableName}`;
const params = { taskId: props.taskId };
try {
let result = await defHttp.get({ url, params });
console.log('动态表单查询结果是:', result);
formId.value = result.head.id;
formTemplate.value = Number(result.head.formTemplate || 1);
isTreeForm.value = result.head.isTree === 'Y';
pidFieldName.value = result.head.treeParentIdField || '';
await nextTick(async () => {
let myForm = await getRefPromise(onlineFormCompRef);
myForm.createRootProperties(result);
});
} catch (e) {
console.error('流程表单查询异常', e);
}
}
//
async function renderSuccess() {
let myForm = await getRefPromise(onlineFormCompRef);
spinLoading.value = false;
myForm.show(true, {
id: props.dataId,
});
}
//
const buttonLoading = ref(false);
async function handleSubmit(showTip = true) {
buttonLoading.value = true;
onlineFormCompRef.value.handleSubmit(showTip);
}
function handleSuccess(data = null) {
buttonLoading.value = false;
emit('success', data);
}
//
function handleValidate() {
onlineFormCompRef.value.handleValidate();
}
//
function validateBack(data = null) {
emit('validate', data);
}
function handleClose() {
buttonLoading.value = false;
}
return {
onlineFormCompRef,
formId,
formTemplate,
isTreeForm,
pidFieldName,
renderSuccess,
handleSuccess,
handleClose,
handleSubmit,
handleValidate,
validateBack,
buttonLoading,
spinLoading,
showSubmitButton,
};
},
});
</script>
<style scoped>
.cust-onl-form .ant-input-disabled {
background-color: #fff;
color: #000;
}
.cust-onl-form .ant-select-disabled .ant-select-selection {
background: #fff;
color: #000;
}
.cust-onl-form .ant-input-number-disabled {
background-color: #fff;
color: #000;
}
</style>

View File

@ -1,177 +0,0 @@
<template>
<!-- 意见区域 -->
<div class="opinion-area" v-if="opinionPrint">
<!-- 标题头 -->
<div class="opinion-header">
<h3>审批意见</h3>
<div class="header-line"></div>
</div>
<!-- 意见列表 -->
<div class="opinion-list">
<a-list itemLayout="vertical" :split="false">
<template v-for="(item, index) in bpmLogList" :key="index">
<a-list-item class="opinion-item">
<a-list-item-meta :description="item.remarks">
<template #title>
<div class="opinion-meta">
<span class="user-name">{{ item.opUserName }}</span>
<span class="task-tag">[{{ item.taskName }}]</span>
<span class="op-time">{{ formatTime(item.opTime) }}</span>
</div>
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
</div>
</div>
</template>
<script lang="ts" setup>
//
import {inject, ref, watchEffect} from 'vue';
import { taskTransInfo } from '@/views/super/bpm/process/personalOffice/myHandleTask/task.handle.api';
import dayjs from 'dayjs';
//
const props = defineProps({
taskId: {
type: String,
default: '',
},
procInsId: {
type: String,
default: '',
},
processTabType: {
type: String,
default: '',
}
});
const opinionPrint = inject('opinionPrint');
// /
const bpmLogList = ref([]);
//
watchEffect(() => {
props.procInsId && getTaskTransInfo();
});
//
async function getTaskTransInfo() {
let taskType = props.processTabType || 'history';
//-runtaskId historyprocInstId
let params = { taskId: props.taskId, procInstId: props.procInsId };
let data = await taskTransInfo(params, taskType);
bpmLogList.value = data.bpmLogList;
}
//
function formatTime(time) {
if (!time) return '';
return dayjs(time).format('YYYY-MM-DD HH:mm');
}
</script>
<style lang="less" scoped>
/* 意见区域整体样式 */
.opinion-area {
margin-top: 24px;
margin-bottom: 24px;
padding: 16px;
background-color: #f9f9f9;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* 标题头样式 */
.opinion-header {
margin-bottom: 16px;
position: relative;
}
.opinion-header h3 {
color: #333;
font-size: 18px;
font-weight: 600;
margin-bottom: 8px;
}
.header-line {
height: 2px;
background: linear-gradient(to right, #1890ff, transparent);
width: 100%;
}
/* 意见列表样式 */
.opinion-list {
overflow-y: auto;
padding-right: 8px;
}
/* 单个意见项样式 */
.opinion-item {
padding: 12px 16px;
margin-bottom: 12px;
background-color: #fff;
border-radius: 6px;
transition: all 0.3s;
}
.opinion-item:hover {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transform: translateY(-2px);
}
/* 用户信息样式 */
.opinion-meta {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
.user-name {
font-weight: 500;
color: #333;
}
.task-tag {
color: #ff6d75;
font-size: 12px;
}
.op-time {
color: #999;
font-size: 12px;
}
/* 意见内容样式 */
:deep(.ant-list-item-meta-description) {
padding-left: 42px;
color: #555;
line-height: 1.6;
}
@media print {
body * {
visibility: hidden;
}
.daily-opinion,
.daily-opinion * {
visibility: visible;
}
.daily-opinion {
position: absolute;
left: 0;
top: 0;
width: 100%;
}
}
table {
page-break-inside: avoid;
}
ul,
ol {
page-break-inside: avoid;
}
</style>