1
This commit is contained in:
@@ -15,8 +15,7 @@
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="opinion-input">
|
||||
<el-input v-model="opinionText" type="textarea" :rows="4"
|
||||
:placeholder="t('workbench.approval.opinion.inputPlaceholder')" resize="vertical" />
|
||||
<el-input v-model="opinionText" type="textarea" :rows="4" :placeholder="t('workbench.approval.opinion.inputPlaceholder')" resize="vertical" />
|
||||
</div>
|
||||
<!-- <div class="opinion-attachment">
|
||||
<el-icon class="attachment-icon">
|
||||
@@ -31,8 +30,7 @@
|
||||
<!-- 撤回区域(可撤回状态显示) -->
|
||||
<div v-if="status === 'withdrawable'" class="withdraw-section">
|
||||
<div class="withdraw-input">
|
||||
<el-input v-model="opinionText" type="textarea" :rows="4"
|
||||
:placeholder="t('workbench.approval.opinion.inputPlaceholder')" resize="vertical" />
|
||||
<el-input v-model="opinionText" type="textarea" :rows="4" :placeholder="t('workbench.approval.opinion.inputPlaceholder')" resize="vertical" />
|
||||
</div>
|
||||
<div class="withdraw-action">
|
||||
<el-button type="primary" @click="handleWithdraw">
|
||||
@@ -60,15 +58,14 @@
|
||||
</div>
|
||||
<div class="record-time">{{ item.showTime || '待审核' }}</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <div v-if="record.action" class="record-action">{{ record.action }}</div> -->
|
||||
<template v-if="record.id !== 'root' && item.status === 2">
|
||||
<div class="record-status"
|
||||
:class="getStatusClass(item.approveDesc?.startsWith('拒绝原因:') ? 'rejected' : 'approved')">
|
||||
<div class="record-status" :class="getStatusClass(item.approveDesc?.startsWith('拒绝原因:') ? 'rejected' : 'approved')">
|
||||
{{ getStatusLabel(item.approveDesc?.startsWith('拒绝原因:') ? 'rejected' : 'approved') }}
|
||||
</div>
|
||||
<div class="record-opinion">
|
||||
{{ item.approveDesc }}
|
||||
<span>{{ item.approveDesc }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="record-opinion" v-else>
|
||||
@@ -82,8 +79,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="selectUser">
|
||||
<EmployeesDialog :visible="selectUserDialog" :data="[]" type="user" @change="changeUser"
|
||||
@update:visible="(e: boolean) => selectUserDialog = e" />
|
||||
<EmployeesDialog :visible="selectUserDialog" :data="[]" type="user" @change="changeUser" @update:visible="(e:boolean) => selectUserDialog = e"/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -104,37 +100,37 @@ const selectUserDialog = ref<boolean>(false);
|
||||
const nextNodeId = ref<string>('');
|
||||
const isApprovalUser = computed(() => {
|
||||
const currentUserId = userInfo.userInfos.user?.userId
|
||||
const currentNode = hierarchicalLookup(nodeList.value, taskDetails.value?.nodeId)
|
||||
const currentNodeUser = currentNode?.userVoList?.find((item: any) => item.id === currentUserId)
|
||||
selectUser.value = nextNodeIsSelectUser(nodeList.value, currentNode?.id)
|
||||
const currentNode = hierarchicalLookup(nodeList.value,taskDetails.value?.nodeId)
|
||||
const currentNodeUser = currentNode ?.userVoList?.find((item:any) => item.id === currentUserId)
|
||||
selectUser.value = nextNodeIsSelectUser(nodeList.value,currentNode?.id)
|
||||
return currentNodeUser?.status === 1
|
||||
})
|
||||
function hierarchicalLookup(nodeList: any[], nodeId: string): any {
|
||||
function hierarchicalLookup(nodeList:any[],nodeId:string):any {
|
||||
for (const nodeItem of nodeList) {
|
||||
if (nodeItem.id === nodeId) {
|
||||
if (nodeItem.id === nodeId){
|
||||
return nodeItem
|
||||
}
|
||||
|
||||
if (nodeItem.children && nodeItem.children.length > 0) {
|
||||
const children = hierarchicalLookup(nodeItem.children, nodeId)
|
||||
if (children) {
|
||||
if (nodeItem.children && nodeItem.children.length > 0){
|
||||
const children = hierarchicalLookup(nodeItem.children,nodeId)
|
||||
if (children){
|
||||
return children
|
||||
}
|
||||
}
|
||||
if (nodeItem.branch && nodeItem.branch.length > 0) {
|
||||
const branch = hierarchicalLookup(nodeItem.branch, nodeId)
|
||||
if (branch) {
|
||||
if (nodeItem.branch && nodeItem.branch.length > 0){
|
||||
const branch = hierarchicalLookup(nodeItem.branch,nodeId)
|
||||
if (branch){
|
||||
return branch
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function nextNodeIsSelectUser(nodeList: any[], currentNodeId: any): boolean {
|
||||
if (!nodeList || nodeList.length === 0) {
|
||||
function nextNodeIsSelectUser(nodeList:any[],currentNodeId:any):boolean{
|
||||
if (!nodeList || nodeList.length === 0){
|
||||
return false
|
||||
}
|
||||
const index = nodeList.findIndex(item => item.id === currentNodeId)
|
||||
if (index === -1) {
|
||||
if (index === -1){
|
||||
return false
|
||||
}
|
||||
const node = nodeList[index + 1]
|
||||
@@ -142,25 +138,25 @@ function nextNodeIsSelectUser(nodeList: any[], currentNodeId: any): boolean {
|
||||
return node?.selectUser || false
|
||||
}
|
||||
interface UserVoList {
|
||||
id: string;
|
||||
name: string;
|
||||
showTime?: string;
|
||||
avatar: string;
|
||||
approveDesc?: string;
|
||||
operType?: string;
|
||||
status: number;
|
||||
id: string;
|
||||
name: string;
|
||||
showTime?: string;
|
||||
avatar: string;
|
||||
approveDesc?: string;
|
||||
operType?: string;
|
||||
status: number;
|
||||
}
|
||||
interface ApprovalRecord {
|
||||
id: string;
|
||||
userVoList: UserVoList[];
|
||||
placeholder: string;
|
||||
status: number;
|
||||
name: string;
|
||||
type: number;
|
||||
selectUser: boolean;
|
||||
multiple?: null;
|
||||
children?: ApprovalRecord[];
|
||||
branch: { children: ApprovalRecord[] }[];
|
||||
id: string;
|
||||
userVoList: UserVoList[];
|
||||
placeholder: string;
|
||||
status: number;
|
||||
name: string;
|
||||
type: number;
|
||||
selectUser: boolean;
|
||||
multiple?: null;
|
||||
children?: ApprovalRecord[];
|
||||
branch: { children: ApprovalRecord[] }[];
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -198,7 +194,7 @@ const emit = defineEmits<{
|
||||
(e: 'add-attachment'): void;
|
||||
}>();
|
||||
const obj = ref<any>({})
|
||||
const changeUser = (checkedList: any[]) => {
|
||||
const changeUser = (checkedList: any[]) =>{
|
||||
obj.value[`${nextNodeId.value}_assignee_select`] = checkedList;
|
||||
selectUser.value = false;
|
||||
selectUserDialog.value = false;
|
||||
@@ -215,7 +211,7 @@ const handleApprove = async () => {
|
||||
}
|
||||
approving.value = true
|
||||
try {
|
||||
if (selectUser.value && nextNodeId.value) {
|
||||
if (selectUser.value && nextNodeId.value){
|
||||
selectUserDialog.value = true;
|
||||
return;
|
||||
}
|
||||
@@ -378,7 +374,6 @@ onMounted(() => {
|
||||
display: flex;
|
||||
/* gap: 8px; */
|
||||
margin-bottom: 16px;
|
||||
|
||||
.el-button {
|
||||
flex: 1;
|
||||
}
|
||||
@@ -508,7 +503,13 @@ onMounted(() => {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.record-status {
|
||||
.record-item .record-content .record-status {
|
||||
max-width: 100%;
|
||||
text-wrap: wrap;
|
||||
word-wrap: break-word; /* 允许长单词换行 */
|
||||
word-break: break-all; /* 打断所有单词 */
|
||||
white-space: pre-wrap; /* 保留空白符和换行符 */
|
||||
overflow-wrap: break-word; /* 确保超长内容能换行 */
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
@@ -526,7 +527,15 @@ onMounted(() => {
|
||||
color: var(--el-text-color-regular);
|
||||
}
|
||||
|
||||
.record-opinion {
|
||||
.record-item .record-content .record-opinion {
|
||||
max-width: 100%;
|
||||
text-wrap: wrap;
|
||||
word-wrap: break-word; /* 允许长单词换行 */
|
||||
word-break: break-all; /* 打断所有单词 */
|
||||
white-space: pre-wrap; /* 保留空白符和换行符 */
|
||||
overflow-wrap: break-word; /* 确保超长内容能换行 */
|
||||
overflow-x: hidden;
|
||||
height: auto;
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
|
||||
Reference in New Issue
Block a user