hrp-ui-base 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.cjs +1 -1
- package/dist/components.es.js +4 -4
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +83 -67
- package/dist/style.css +1 -1
- package/package.json +15 -4
- package/packages/approval-process/.eslintrc +7 -0
- package/packages/approval-process/README.md +130 -0
- package/packages/approval-process/index.ts +65 -0
- package/packages/approval-process/package.json +17 -0
- package/packages/approval-process/packages/components/choose-member/BO/departBo.ts +8 -0
- package/packages/approval-process/packages/components/choose-member/BO/memberBo.ts +14 -0
- package/packages/approval-process/packages/components/choose-member/BO/role.svg +1 -0
- package/packages/approval-process/packages/components/choose-member/BO/roleBo.ts +16 -0
- package/packages/approval-process/packages/components/choose-member/index.vue +497 -0
- package/packages/approval-process/packages/components/choose-member/styles/common.scss +134 -0
- package/packages/approval-process/packages/components/comment/assets/avatar.svg +1 -0
- package/packages/approval-process/packages/components/comment/assets/download.svg +4 -0
- package/packages/approval-process/packages/components/comment/assets/mp3.svg +11 -0
- package/packages/approval-process/packages/components/comment/assets/mp4.svg +11 -0
- package/packages/approval-process/packages/components/comment/assets/other.svg +11 -0
- package/packages/approval-process/packages/components/comment/assets/pdf.svg +11 -0
- package/packages/approval-process/packages/components/comment/assets/ppt.svg +11 -0
- package/packages/approval-process/packages/components/comment/assets/preview.svg +4 -0
- package/packages/approval-process/packages/components/comment/assets/remove.png +0 -0
- package/packages/approval-process/packages/components/comment/assets/word.svg +11 -0
- package/packages/approval-process/packages/components/comment/assets/xls.svg +11 -0
- package/packages/approval-process/packages/components/comment/index.vue +843 -0
- package/packages/approval-process/packages/components/comment/modules/previewMp.vue +54 -0
- package/packages/approval-process/packages/components/comment/styles/comment-style.scss +304 -0
- package/packages/approval-process/packages/components/image-cropper/index.vue +202 -0
- package/packages/approval-process/packages/components/sign/index.vue +766 -0
- package/packages/approval-process/packages/components/sign/modules/full-screen-sign.vue +20 -0
- package/packages/approval-process/packages/components/urge-dialog/index.vue +121 -0
- package/packages/approval-process/packages/components/vue-esign/index.vue +289 -0
- package/packages/approval-process/packages/flow/approve-component/approve-success.vue +82 -0
- package/packages/approval-process/packages/flow/approve-component/route-params-error.vue +49 -0
- package/packages/approval-process/packages/flow/approve-component/submit-success.vue +59 -0
- package/packages/approval-process/packages/flow/examine-approve-itr.vue +978 -0
- package/packages/approval-process/packages/flow/examine-approve.vue +1065 -0
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/README.md +38 -0
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/assets/avatar.svg +1 -0
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/index.vue +159 -0
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/modules/associated-approval-form-mobile.vue +297 -0
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/modules/associated-approval-form-pc.vue +314 -0
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/curd-area-mobile.scss +110 -0
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/curd-area.scss +96 -0
- package/packages/approval-process/packages/flow/form-component/associated-approval-form/style/out-put.scss +48 -0
- package/packages/approval-process/packages/flow/form-component/show-sign.vue +27 -0
- package/packages/approval-process/packages/flow/styles/common.scss +134 -0
- package/packages/approval-process/packages/flow/styles/examine-approve-pc.scss +465 -0
- package/packages/approval-process/packages/flow/styles/examine-approve-phone.scss +293 -0
- package/packages/approval-process/packages/flow/styles/submit-approve-pc.scss +379 -0
- package/packages/approval-process/packages/flow/styles/submit-approve-phone.scss +337 -0
- package/packages/approval-process/packages/flow/submit-approve-itr.vue +623 -0
- package/packages/approval-process/packages/flow/submit-approve.vue +628 -0
- package/packages/approval-process/packages/flow/systemCom/BO/departBo.ts +8 -0
- package/packages/approval-process/packages/flow/systemCom/BO/memberBo.ts +14 -0
- package/packages/approval-process/packages/flow/systemCom/BO/role.svg +1 -0
- package/packages/approval-process/packages/flow/systemCom/BO/roleBo.ts +16 -0
- package/packages/approval-process/packages/flow/systemCom/choose-depart.vue +399 -0
- package/packages/approval-process/packages/flow/systemCom/choose-member-phone.vue +515 -0
- package/packages/approval-process/packages/flow/systemCom/choose-member.vue +565 -0
- package/packages/approval-process/packages/flow/systemCom/choose-role.vue +301 -0
- package/packages/approval-process/packages/styles/common.scss +134 -0
- package/packages/approval-process/packages/styles/flex-common.scss +118 -0
- package/packages/approval-process/packages/styles/flexCommon.scss +73 -0
- package/packages/approval-process/packages/styles/main.css +216 -0
- package/packages/approval-process/packages/styles/router-page.scss +371 -0
- package/packages/approval-process/packages/styles/style-set.ts +207 -0
- package/packages/approval-process/packages/types.d.ts +4 -0
- package/packages/approval-process/packages/utils/base.ts +15 -0
- package/packages/approval-process/packages/utils/crypto.ts +67 -0
- package/packages/approval-process/packages/utils/ddUtils.ts +56 -0
- package/packages/approval-process/packages/utils/debounce.ts +36 -0
- package/packages/approval-process/packages/utils/des.js +1107 -0
- package/packages/approval-process/packages/utils/download.ts +38 -0
- package/packages/approval-process/packages/utils/editor.ts +37 -0
- package/packages/approval-process/packages/utils/getEnv.ts +36 -0
- package/packages/approval-process/packages/utils/os.ts +20 -0
- package/packages/approval-process/packages/utils/path-util.ts +31 -0
- package/packages/approval-process/packages/utils/routerUtil.ts +304 -0
- package/packages/approval-process/packages/utils/string-utils.ts +13 -0
- package/packages/approval-process/packages/utils/throttle.ts +44 -0
- package/packages/approval-process/packages/utils/validate.ts +92 -0
- package/packages/approval-process/packages/utils/ws.ts +218 -0
- package/packages/approval-process/tsconfig.json +72 -0
- package/packages/approval-process/vite.config.ts +56 -0
- package/src/api/bms/flow/FlowCommentController.ts +50 -0
- package/src/api/bms/flow/FlowInstanceController.ts +167 -0
- package/src/api/bms/flow/FlowProcessController.ts +55 -0
- package/src/api/bms/flow/FlowSheetController.ts +27 -0
- package/src/api/bms/flow/FlowSignController.ts +76 -0
- package/src/api/bms/flow/bo/AssociatedApprovalBO.ts +15 -0
- package/src/api/bms/flow/bo/AssociatedApprovalVO.ts +35 -0
- package/src/api/bms/flow/bo/AuditBaseInfo.ts +39 -0
- package/src/api/bms/flow/bo/ButtonVo.ts +7 -0
- package/src/api/bms/flow/bo/DingCallbackBo.ts +13 -0
- package/src/api/bms/flow/bo/FlowCommentBO.ts +12 -0
- package/src/api/bms/flow/bo/FlowCommentVO.ts +23 -0
- package/src/api/bms/flow/bo/FlowInstanceBO.ts +14 -0
- package/src/api/bms/flow/bo/FlowNodeVO.ts +24 -0
- package/src/api/bms/flow/bo/FlowNoticeBO.ts +17 -0
- package/src/api/bms/flow/bo/FlowProcessBO.ts +13 -0
- package/src/api/bms/flow/bo/FlowProcessVO.ts +9 -0
- package/src/api/bms/flow/bo/FlowReplyVO.ts +23 -0
- package/src/api/bms/flow/bo/FlowSheetVO.ts +16 -0
- package/src/api/bms/flow/bo/InstanceBackBO.ts +9 -0
- package/src/api/bms/flow/bo/InstanceNodeBO.ts +13 -0
- package/src/api/bms/flow/bo/InstanceNodeVO.ts +21 -0
- package/src/api/bms/flow/bo/NodeShowVo.ts +19 -0
- package/src/api/bms/flow/bo/ReviewBO.ts +11 -0
- package/src/api/bms/flow/bo/SheetSearchBO.ts +11 -0
- package/src/api/bms/flow/bo/SystemVO.ts +7 -0
- package/src/api/bms/flow/bo/TransmitBO.ts +9 -0
- package/src/api/bms/flow/bo/UrgeFlowBO.ts +7 -0
- package/src/api/bms/flow/bo/UserBaseInfoVo.ts +13 -0
- package/src/api/bms/flow/bo/UserInfoVo.ts +44 -0
- package/src/api/bms/flow/bo/UserResultVo.ts +17 -0
- package/src/api/bms/flow/bo/ValueMapBo.ts +7 -0
- package/src/api/bms/home/HomeController.ts +106 -0
- package/src/api/bms/home/bo/CollectedMenuBo.ts +9 -0
- package/src/api/bms/home/bo/DeptBaseVo.ts +9 -0
- package/src/api/bms/home/bo/DomainVO.ts +13 -0
- package/src/api/bms/home/bo/FunPermission.ts +17 -0
- package/src/api/bms/home/bo/GroupVO.ts +10 -0
- package/src/api/bms/home/bo/HomeMenu.ts +22 -0
- package/src/api/bms/home/bo/HomeMenuVo.ts +11 -0
- package/src/api/bms/home/bo/PersonalizationBo.ts +17 -0
- package/src/api/bms/home/bo/PersonalizationVo.ts +19 -0
- package/src/api/bms/home/bo/PhoneMenu.ts +14 -0
- package/src/api/bms/home/bo/SearchMenuVo.ts +10 -0
- package/src/api/bms/home/bo/UserBaseInfoVo.ts +11 -0
- package/src/api/hrms/dept/bo/DeptBaseVo.ts +6 -0
- package/src/api/hrms/dept/bo/DeptTreeVo.ts +23 -0
- package/src/api/hrms/dept/bo/DeptUserVo.ts +9 -0
- package/src/api/hrms/dept/bo/DeptUsersVo.ts +10 -0
- package/src/api/hrms/dept/bo/DeptVo.ts +19 -0
- package/src/api/hrms/dept/bo/UserBaseInfoVo.ts +8 -0
- package/src/api/hrms/dept/deptController.ts +100 -0
- package/src/api/hrms/role/bo/RoleBaseVo.ts +6 -0
- package/src/api/hrms/role/bo/RoleGroupVo.ts +11 -0
- package/src/api/hrms/role/bo/RoleVo.ts +22 -0
- package/src/api/hrms/role/roleController.ts +19 -0
- package/src/api/hrms/user/bo/UserBaseInfoVo.ts +11 -0
- package/src/api/hrms/user/bo/UserCardVO.ts +14 -0
- package/src/api/hrms/user/bo/UserDeptBO.ts +13 -0
- package/src/api/hrms/user/bo/UserRoleBO.ts +11 -0
- package/src/api/hrms/user/bo/UserVO.ts +23 -0
- package/src/api/hrms/user/userController.ts +86 -0
- package/src/api/work-order-pc/flow/Bo/ValueMapBo.ts +7 -0
- package/src/api/work-order-pc/flow/ItrFlowProcessController.ts +42 -0
- package/src/api/work-order-pc/flow/Vo/FlowNodeVO.ts +24 -0
- package/src/api/work-order-pc/flow/Vo/UserInfoVo.ts +44 -0
- package/src/assets/process/agree.png +0 -0
- package/src/assets/process/defaultAvatar.png +0 -0
- package/src/assets/process/drawer/departManagerJump.png +0 -0
- package/src/assets/process/drawer/manyLevel1close.svg +10 -0
- package/src/assets/process/drawer/manyLevel1open.svg +7 -0
- package/src/assets/process/drawer/manyLevel2close.svg +7 -0
- package/src/assets/process/drawer/manyLevel2open.svg +7 -0
- package/src/assets/process/inProcess.png +0 -0
- package/src/assets/process/manyPeople.png +0 -0
- package/src/assets/process/manyPeople2.png +0 -0
- package/src/assets/process/reject.png +0 -0
- package/src/assets/process/revoke.png +0 -0
- package/src/components/annex-img-upload/index.vue +4 -4
- package/src/components/annex-img-upload/modules/previewMp.vue +1 -1
- package/src/components/annex-upload/index.vue +4 -4
- package/src/components/annex-upload/modules/previewMp.vue +1 -1
- package/src/components/annex-upload-weijian/index.vue +4 -4
- package/src/components/annex-upload-weijian/modules/previewMp.vue +1 -1
- package/src/components/list-search-content/components/search-date-range.vue +1 -1
- package/src/components/list-search-content/components/search-date-time-range.vue +1 -1
- package/src/components/list-search-content/components/search-date.vue +1 -1
- package/src/components/list-search-content/components/search-input-number.vue +1 -1
- package/src/components/list-search-content/components/search-input.vue +1 -1
- package/src/components/list-search-content/components/search-multiple_select.vue +1 -1
- package/src/components/list-search-content/components/search-select.vue +1 -1
- package/src/components/list-search-content/index.vue +6 -6
- package/src/components/list-search-content/modules/add-views-package-dialog.vue +3 -3
- package/src/components/list-search-content/modules/search-condition-area.vue +2 -2
- package/src/components/list-search-content/modules/views-package-manage-dialog.vue +5 -5
- package/src/index.ts +1 -0
- package/src/utils/dd-utils.ts +1 -1
- package/src/utils/get-dict.ts +2 -2
- package/src/utils/permit-utils.ts +2 -2
- package/src/api/bms/dict/bo/TotalDictSearchBO.ts +0 -8
- package/src/api/bms/file/FileExportController.ts +0 -18
- package/src/api/bms/file/bo/FileExportVO.ts +0 -17
|
@@ -0,0 +1,843 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @description:
|
|
3
|
+
* @fileName: index.vue
|
|
4
|
+
!-->
|
|
5
|
+
<template>
|
|
6
|
+
<!-- 其他 - 评论和变更记录 -->
|
|
7
|
+
<div class="process-box" style="margin-top: 8px">
|
|
8
|
+
<div class="inner-page-item-header">评论</div>
|
|
9
|
+
<div class="comment-box">
|
|
10
|
+
<el-input
|
|
11
|
+
v-model="commentValue"
|
|
12
|
+
placeholder="点击输入评论"
|
|
13
|
+
autosize
|
|
14
|
+
maxlength="2000"
|
|
15
|
+
show-word-limit
|
|
16
|
+
v-if="!isCommentSendStatus"
|
|
17
|
+
@click="changeCommentSendStatus"
|
|
18
|
+
class="comment-input-box"
|
|
19
|
+
readonly
|
|
20
|
+
/>
|
|
21
|
+
<el-input
|
|
22
|
+
v-model="commentValue"
|
|
23
|
+
:autosize="{ minRows: 2 }"
|
|
24
|
+
type="textarea"
|
|
25
|
+
placeholder="请输入..."
|
|
26
|
+
maxlength="2000"
|
|
27
|
+
show-word-limit
|
|
28
|
+
v-if="isCommentSendStatus"
|
|
29
|
+
@click="isCommentSendStatus = true"
|
|
30
|
+
ref="sendCommentInputRef"
|
|
31
|
+
class="comment-input-box"
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<div class="comment-button-box" v-if="isCommentSendStatus">
|
|
35
|
+
<div style="margin-right: 18px">
|
|
36
|
+
<el-button type="primary" @click="openAtDialog" color="#d7d7d7"
|
|
37
|
+
>@提醒谁关注</el-button
|
|
38
|
+
>
|
|
39
|
+
</div>
|
|
40
|
+
<!-- 上传文件组件 :limit="3"-->
|
|
41
|
+
<el-upload
|
|
42
|
+
v-model:file-list="fileList"
|
|
43
|
+
class="upload-demo"
|
|
44
|
+
action="#"
|
|
45
|
+
multiple
|
|
46
|
+
:http-request="uploadFileCommonUtil"
|
|
47
|
+
:on-exceed="handleExceed"
|
|
48
|
+
ref="commonUploadFileRef1"
|
|
49
|
+
:show-file-list="false"
|
|
50
|
+
accept=".jpg,.png,.bmp,.jpeg,.tiff,.raw,.heif,.gif,.JPG,.PNG,.BMP,.JPEG,.TIFF,.RAW,.HEIF,.GIF"
|
|
51
|
+
:before-upload="beforeUploadOSS"
|
|
52
|
+
>
|
|
53
|
+
<el-button
|
|
54
|
+
type="primary"
|
|
55
|
+
@click="uploadImg"
|
|
56
|
+
color="#d7d7d7"
|
|
57
|
+
style="margin-right: 18px"
|
|
58
|
+
|
|
59
|
+
>图片</el-button
|
|
60
|
+
>
|
|
61
|
+
</el-upload>
|
|
62
|
+
<el-upload
|
|
63
|
+
v-model:file-list="fileList"
|
|
64
|
+
class="upload-demo"
|
|
65
|
+
action="#"
|
|
66
|
+
multiple
|
|
67
|
+
:http-request="uploadFileCommonUtil"
|
|
68
|
+
:on-exceed="handleExceed"
|
|
69
|
+
ref="commonUploadFileRef2"
|
|
70
|
+
:show-file-list="false"
|
|
71
|
+
accept=".docx,.doc,.xls,.xlsx,.pdf,.ppt,.pptx,.mp3,.mp4,.DOCX,.DOC,.XLS,.XLSX,.PDF,.PPT,.PPTX,.MP3,.MP4,.dcm,.DCM"
|
|
72
|
+
:before-upload="beforeUploadOSS"
|
|
73
|
+
>
|
|
74
|
+
<el-button
|
|
75
|
+
type="primary"
|
|
76
|
+
@click="uploadFile"
|
|
77
|
+
color="#d7d7d7"
|
|
78
|
+
style="margin-right: 18px"
|
|
79
|
+
>附件</el-button
|
|
80
|
+
>
|
|
81
|
+
</el-upload>
|
|
82
|
+
</div>
|
|
83
|
+
<div
|
|
84
|
+
v-if="
|
|
85
|
+
isCommentSendStatus &&
|
|
86
|
+
Array.isArray(atMemberList) &&
|
|
87
|
+
atMemberList.length > 0
|
|
88
|
+
"
|
|
89
|
+
class="at-member-box"
|
|
90
|
+
>
|
|
91
|
+
<div
|
|
92
|
+
v-for="(item, index) in atMemberList"
|
|
93
|
+
:key="index"
|
|
94
|
+
class="at-member-item"
|
|
95
|
+
>
|
|
96
|
+
<img
|
|
97
|
+
:src="item.avatar"
|
|
98
|
+
alt=""
|
|
99
|
+
class="at-member-avatar"
|
|
100
|
+
v-if="item.avatar"
|
|
101
|
+
/>
|
|
102
|
+
<img
|
|
103
|
+
src="./assets/avatar.svg"
|
|
104
|
+
alt=""
|
|
105
|
+
class="at-member-avatar"
|
|
106
|
+
v-else
|
|
107
|
+
/>
|
|
108
|
+
<div class="at-member-name">{{ item.userName }}</div>
|
|
109
|
+
<!-- <el-icon class="at-member-close" @click="deleteAtMember(index)">
|
|
110
|
+
<CircleClose />
|
|
111
|
+
</el-icon> -->
|
|
112
|
+
<img
|
|
113
|
+
src="./assets/remove.png"
|
|
114
|
+
alt=""
|
|
115
|
+
class="at-member-close"
|
|
116
|
+
@click="deleteAtMember(index)"
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="file-list-box flex-row-start">
|
|
121
|
+
<div
|
|
122
|
+
class="file-out-box"
|
|
123
|
+
v-for="(item, index) in sendFileList"
|
|
124
|
+
:key="index"
|
|
125
|
+
>
|
|
126
|
+
<div class="file-list-item flex-row-between">
|
|
127
|
+
<div class="flex-row-start file-list-item-left">
|
|
128
|
+
<el-image
|
|
129
|
+
class="file-list-item-icon"
|
|
130
|
+
:src="item.url"
|
|
131
|
+
:zoom-rate="1.2"
|
|
132
|
+
:initial-index="0"
|
|
133
|
+
fit="cover"
|
|
134
|
+
:preview-src-list="[item.url]"
|
|
135
|
+
preview-teleported="true"
|
|
136
|
+
@error="handleImageError"
|
|
137
|
+
@load="handleImageLoad"
|
|
138
|
+
v-loading="submitLoading"
|
|
139
|
+
v-if="
|
|
140
|
+
getFileType(item.url) === 'jpg' ||
|
|
141
|
+
getFileType(item.url) === 'png' ||
|
|
142
|
+
getFileType(item.url) === 'bmp' ||
|
|
143
|
+
getFileType(item.url) === 'jpeg' ||
|
|
144
|
+
getFileType(item.url) === 'raw' ||
|
|
145
|
+
getFileType(item.url) === 'heif' ||
|
|
146
|
+
getFileType(item.url) === 'tiff' ||
|
|
147
|
+
getFileType(item.url) === 'gif'
|
|
148
|
+
"
|
|
149
|
+
>
|
|
150
|
+
<template #error>
|
|
151
|
+
<img src="./assets/other.svg" class="file-icon" />
|
|
152
|
+
</template>
|
|
153
|
+
</el-image>
|
|
154
|
+
<div v-else class="file-list-item-icon">
|
|
155
|
+
<img
|
|
156
|
+
src="./assets/pdf.svg"
|
|
157
|
+
v-if="getFileType(item.url) === 'pdf'"
|
|
158
|
+
class="file-icon"
|
|
159
|
+
/>
|
|
160
|
+
<img
|
|
161
|
+
src="./assets/word.svg"
|
|
162
|
+
v-else-if="
|
|
163
|
+
getFileType(item.url) === 'docx' ||
|
|
164
|
+
getFileType(item.url) === 'doc'
|
|
165
|
+
"
|
|
166
|
+
class="file-icon"
|
|
167
|
+
/>
|
|
168
|
+
<img
|
|
169
|
+
src="./assets/mp3.svg"
|
|
170
|
+
v-else-if="getFileType(item.url) === 'mp3'"
|
|
171
|
+
class="file-icon"
|
|
172
|
+
/>
|
|
173
|
+
<img
|
|
174
|
+
src="./assets/mp4.svg"
|
|
175
|
+
v-else-if="getFileType(item.url) === 'mp4'"
|
|
176
|
+
class="file-icon"
|
|
177
|
+
/>
|
|
178
|
+
<img
|
|
179
|
+
src="./assets/xls.svg"
|
|
180
|
+
v-else-if="
|
|
181
|
+
getFileType(item.url) === 'xls' ||
|
|
182
|
+
getFileType(item.url) === 'xlsx'
|
|
183
|
+
"
|
|
184
|
+
class="file-icon"
|
|
185
|
+
/>
|
|
186
|
+
<img
|
|
187
|
+
src="./assets/ppt.svg"
|
|
188
|
+
v-else-if="
|
|
189
|
+
getFileType(item.url) === 'ppt' ||
|
|
190
|
+
getFileType(item.url) === 'pptx'
|
|
191
|
+
"
|
|
192
|
+
class="file-icon"
|
|
193
|
+
/>
|
|
194
|
+
<img src="./assets/other.svg" v-else class="file-icon" />
|
|
195
|
+
</div>
|
|
196
|
+
<div
|
|
197
|
+
class="flex-column-around file-name-box"
|
|
198
|
+
style="align-items: flex-start"
|
|
199
|
+
>
|
|
200
|
+
<el-tooltip effect="dark" :content="item.fileName">
|
|
201
|
+
<div class="file-name">{{ item.fileName }}</div>
|
|
202
|
+
</el-tooltip>
|
|
203
|
+
<div class="file-size">{{ item.fileSize || "--" }}</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
<div class="flex-column-around file-list-item-right">
|
|
207
|
+
<img
|
|
208
|
+
src="./assets/preview.svg"
|
|
209
|
+
alt=""
|
|
210
|
+
class="file-preview"
|
|
211
|
+
@click="previewFile(item, index)"
|
|
212
|
+
/>
|
|
213
|
+
|
|
214
|
+
<img
|
|
215
|
+
src="./assets/download.svg"
|
|
216
|
+
alt=""
|
|
217
|
+
class="file-download"
|
|
218
|
+
@click="downloadFile(item)"
|
|
219
|
+
/>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
<div class="table-delete" @click="deleteUploadItem(item, index)">
|
|
223
|
+
<img
|
|
224
|
+
src="hrp-ui-base/assets/table-delete/table-delete.svg"
|
|
225
|
+
alt="删除"
|
|
226
|
+
width="25"
|
|
227
|
+
height="25"
|
|
228
|
+
/>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
<div
|
|
233
|
+
style="
|
|
234
|
+
height: 70px;
|
|
235
|
+
display: flex;
|
|
236
|
+
flex-direction: row;
|
|
237
|
+
justify-content: flex-end;
|
|
238
|
+
align-items: center;
|
|
239
|
+
"
|
|
240
|
+
v-if="isCommentSendStatus"
|
|
241
|
+
>
|
|
242
|
+
<el-button @click="sendComment" size="large" type="primary"
|
|
243
|
+
>发送</el-button
|
|
244
|
+
>
|
|
245
|
+
</div>
|
|
246
|
+
|
|
247
|
+
<div
|
|
248
|
+
v-for="(item, index) in commentList"
|
|
249
|
+
:key="index"
|
|
250
|
+
class="flexRowStart comment-item"
|
|
251
|
+
>
|
|
252
|
+
<img
|
|
253
|
+
:src="item.sender.avatar"
|
|
254
|
+
alt="头像"
|
|
255
|
+
class="imgbox"
|
|
256
|
+
style="margin-right: 12px"
|
|
257
|
+
v-if="item.sender && item.sender.avatar"
|
|
258
|
+
/>
|
|
259
|
+
<img
|
|
260
|
+
src="./assets/avatar.svg"
|
|
261
|
+
alt="头像"
|
|
262
|
+
class="imgbox"
|
|
263
|
+
style="margin-right: 12px"
|
|
264
|
+
v-else
|
|
265
|
+
/>
|
|
266
|
+
<div class="flexColumnStart comment-show-box">
|
|
267
|
+
<div class="comment-show-name-box flexRowStartCenter">
|
|
268
|
+
<div class="comment-show-name-box-name flexRowStart">
|
|
269
|
+
{{ item.sender.userName || "-" }}
|
|
270
|
+
</div>
|
|
271
|
+
<div class="comment-show-name-box-time">
|
|
272
|
+
{{ item.sendTime || "" }}
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
<div class="comment-show-content-box">{{ item.message || "" }}</div>
|
|
276
|
+
<div
|
|
277
|
+
class="comment-show-at-box"
|
|
278
|
+
v-if="
|
|
279
|
+
Array.isArray(item.mentionUsers) && item.mentionUsers.length > 0
|
|
280
|
+
"
|
|
281
|
+
>
|
|
282
|
+
<div
|
|
283
|
+
class="comment-show-at-item"
|
|
284
|
+
v-for="(atItem, atIndex) in item.mentionUsers"
|
|
285
|
+
:key="atIndex"
|
|
286
|
+
>
|
|
287
|
+
{{ "@" + atItem.userName }}
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
<div class="file-list-box flex-row-start">
|
|
291
|
+
<div
|
|
292
|
+
class="file-out-box"
|
|
293
|
+
v-for="(fileItem, fileIndex) in item.fileBaseInfoList"
|
|
294
|
+
:key="fileIndex"
|
|
295
|
+
>
|
|
296
|
+
<div class="file-list-item flex-row-between">
|
|
297
|
+
<div class="flex-row-start file-list-item-left">
|
|
298
|
+
<el-image
|
|
299
|
+
class="file-list-item-icon"
|
|
300
|
+
:src="fileItem.url"
|
|
301
|
+
:zoom-rate="1.2"
|
|
302
|
+
:initial-index="0"
|
|
303
|
+
fit="cover"
|
|
304
|
+
:preview-src-list="[fileItem.url]"
|
|
305
|
+
preview-teleported="true"
|
|
306
|
+
@error="handleImageError"
|
|
307
|
+
@load="handleImageLoad"
|
|
308
|
+
v-loading="submitLoading"
|
|
309
|
+
v-if="
|
|
310
|
+
getFileType(fileItem.url) === 'jpg' ||
|
|
311
|
+
getFileType(fileItem.url) === 'png' ||
|
|
312
|
+
getFileType(fileItem.url) === 'bmp' ||
|
|
313
|
+
getFileType(fileItem.url) === 'jpeg' ||
|
|
314
|
+
getFileType(fileItem.url) === 'raw' ||
|
|
315
|
+
getFileType(fileItem.url) === 'heif' ||
|
|
316
|
+
getFileType(fileItem.url) === 'tiff' ||
|
|
317
|
+
getFileType(fileItem.url) === 'gif'
|
|
318
|
+
"
|
|
319
|
+
>
|
|
320
|
+
<template #error>
|
|
321
|
+
<img src="./assets/other.svg" class="file-icon" />
|
|
322
|
+
</template>
|
|
323
|
+
</el-image>
|
|
324
|
+
<div v-else class="file-list-item-icon">
|
|
325
|
+
<img
|
|
326
|
+
src="./assets/pdf.svg"
|
|
327
|
+
v-if="getFileType(fileItem.url) === 'pdf'"
|
|
328
|
+
class="file-icon"
|
|
329
|
+
/>
|
|
330
|
+
<img
|
|
331
|
+
src="./assets/word.svg"
|
|
332
|
+
v-else-if="
|
|
333
|
+
getFileType(fileItem.url) === 'docx' ||
|
|
334
|
+
getFileType(fileItem.url) === 'doc'
|
|
335
|
+
"
|
|
336
|
+
class="file-icon"
|
|
337
|
+
/>
|
|
338
|
+
<img
|
|
339
|
+
src="./assets/mp3.svg"
|
|
340
|
+
v-else-if="getFileType(fileItem.url) === 'mp3'"
|
|
341
|
+
class="file-icon"
|
|
342
|
+
/>
|
|
343
|
+
<img
|
|
344
|
+
src="./assets/mp4.svg"
|
|
345
|
+
v-else-if="getFileType(fileItem.url) === 'mp4'"
|
|
346
|
+
class="file-icon"
|
|
347
|
+
/>
|
|
348
|
+
<img
|
|
349
|
+
src="./assets/xls.svg"
|
|
350
|
+
v-else-if="
|
|
351
|
+
getFileType(fileItem.url) === 'xls' ||
|
|
352
|
+
getFileType(fileItem.url) === 'xlsx'
|
|
353
|
+
"
|
|
354
|
+
class="file-icon"
|
|
355
|
+
/>
|
|
356
|
+
<img
|
|
357
|
+
src="./assets/ppt.svg"
|
|
358
|
+
v-else-if="
|
|
359
|
+
getFileType(fileItem.url) === 'ppt' ||
|
|
360
|
+
getFileType(fileItem.url) === 'pptx'
|
|
361
|
+
"
|
|
362
|
+
class="file-icon"
|
|
363
|
+
/>
|
|
364
|
+
<img src="./assets/other.svg" v-else class="file-icon" />
|
|
365
|
+
</div>
|
|
366
|
+
<div
|
|
367
|
+
class="flex-column-around file-name-box"
|
|
368
|
+
style="align-items: flex-start"
|
|
369
|
+
>
|
|
370
|
+
<el-tooltip effect="dark" :content="fileItem.fileName">
|
|
371
|
+
<div class="file-name">{{ fileItem.fileName }}</div>
|
|
372
|
+
</el-tooltip>
|
|
373
|
+
<div class="file-size">{{ fileItem.fileSize || "--" }}</div>
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
<div class="flex-column-around file-list-item-right">
|
|
377
|
+
<img
|
|
378
|
+
src="./assets/preview.svg"
|
|
379
|
+
alt=""
|
|
380
|
+
class="file-preview"
|
|
381
|
+
@click="previewFile(fileItem, index)"
|
|
382
|
+
/>
|
|
383
|
+
<img
|
|
384
|
+
src="./assets/download.svg"
|
|
385
|
+
alt=""
|
|
386
|
+
class="file-download"
|
|
387
|
+
@click="downloadFile(fileItem)"
|
|
388
|
+
/>
|
|
389
|
+
</div>
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
|
|
394
|
+
<div class="comment-button-list">
|
|
395
|
+
<el-button
|
|
396
|
+
type="primary"
|
|
397
|
+
text
|
|
398
|
+
@click="addReplyToComment(item, index)"
|
|
399
|
+
>回复</el-button
|
|
400
|
+
>
|
|
401
|
+
<el-button
|
|
402
|
+
type="warning"
|
|
403
|
+
text
|
|
404
|
+
@click="deleteComment(item, index)"
|
|
405
|
+
v-if="item.isMyComment"
|
|
406
|
+
>删除</el-button
|
|
407
|
+
>
|
|
408
|
+
</div>
|
|
409
|
+
<div class="comment-to-reply" v-if="commentIndex === index">
|
|
410
|
+
<el-input
|
|
411
|
+
v-model="replyMessage"
|
|
412
|
+
:autosize="{ minRows: 2 }"
|
|
413
|
+
type="textarea"
|
|
414
|
+
placeholder="请输入..."
|
|
415
|
+
maxlength="2000"
|
|
416
|
+
show-word-limit
|
|
417
|
+
class="comment-input-box"
|
|
418
|
+
/>
|
|
419
|
+
<div class="comment-to-reply-button">
|
|
420
|
+
<el-button type="info" @click="cancelReply">取消</el-button>
|
|
421
|
+
<el-button type="primary" @click="sendReply">回复</el-button>
|
|
422
|
+
</div>
|
|
423
|
+
</div>
|
|
424
|
+
<!-- 回复列表 -->
|
|
425
|
+
<div
|
|
426
|
+
class="reply-box"
|
|
427
|
+
v-if="Array.isArray(item.replyList) && item.replyList.length > 0"
|
|
428
|
+
>
|
|
429
|
+
<div
|
|
430
|
+
class="reply-item"
|
|
431
|
+
v-for="(replyItem, replyIndex) in item.replyList"
|
|
432
|
+
:key="replyIndex"
|
|
433
|
+
>
|
|
434
|
+
<div class="reply-item-left">
|
|
435
|
+
<span class="reply-box-name">{{
|
|
436
|
+
replyItem.sender.userName || "-"
|
|
437
|
+
}}</span>
|
|
438
|
+
<span>回复</span>
|
|
439
|
+
<span class="reply-box-name">{{
|
|
440
|
+
replyItem.receiver.userName || "-"
|
|
441
|
+
}}</span>
|
|
442
|
+
<span>:</span>
|
|
443
|
+
<span>{{ replyItem.message || "-" }}</span>
|
|
444
|
+
<span
|
|
445
|
+
class="reply-item-button"
|
|
446
|
+
@click="addReplyToReply(replyItem, replyIndex, item, index)"
|
|
447
|
+
>回复</span
|
|
448
|
+
>
|
|
449
|
+
<span
|
|
450
|
+
class="reply-item-button"
|
|
451
|
+
v-if="replyItem.isMyComment"
|
|
452
|
+
@click="deleteComment(replyItem, replyIndex)"
|
|
453
|
+
>删除</span
|
|
454
|
+
>
|
|
455
|
+
</div>
|
|
456
|
+
<div class="reply-item-time">
|
|
457
|
+
{{ replyItem.sendTime || "-" }}
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
</div>
|
|
461
|
+
</div>
|
|
462
|
+
</div>
|
|
463
|
+
</div>
|
|
464
|
+
<!-- 专门用来预览的组件 -->
|
|
465
|
+
<el-image
|
|
466
|
+
style="display: none"
|
|
467
|
+
ref="previewImgRef"
|
|
468
|
+
:src="perviewImg.url"
|
|
469
|
+
:preview-src-list="perviewImg.srcList"
|
|
470
|
+
preview-teleported="true"
|
|
471
|
+
id="previewImgId"
|
|
472
|
+
>
|
|
473
|
+
</el-image>
|
|
474
|
+
<!-- 预览mp3,mp4 -->
|
|
475
|
+
<PreviewMp ref="previewMpRef"></PreviewMp>
|
|
476
|
+
<ChooseMemberNew ref="chooseMemberNewRef" @success="changeChooseMemberNew">
|
|
477
|
+
</ChooseMemberNew>
|
|
478
|
+
</div>
|
|
479
|
+
</template>
|
|
480
|
+
|
|
481
|
+
<script setup lang="ts">
|
|
482
|
+
import { ref, reactive, nextTick, onMounted } from "vue";
|
|
483
|
+
import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
|
|
484
|
+
import { IsPhone } from "../../utils/getEnv";
|
|
485
|
+
import ChooseMemberNew from "../choose-member/index.vue";
|
|
486
|
+
import PreviewMp from "./modules/previewMp.vue";
|
|
487
|
+
|
|
488
|
+
import type {
|
|
489
|
+
UploadProps,
|
|
490
|
+
UploadUserFile,
|
|
491
|
+
UploadRequestOptions,
|
|
492
|
+
} from "element-plus";
|
|
493
|
+
import { getFileType, ddWindowOpen } from "hrp-ui-base";
|
|
494
|
+
import FileBaseInfo from "hrp-ui-base/api/bms/file/bo/FileBaseInfo";
|
|
495
|
+
import FileUploadController from "hrp-ui-base/api/bms/file/FileUploadController";
|
|
496
|
+
import FlowCommentController from "hrp-ui-base/api/bms/flow/FlowCommentController";
|
|
497
|
+
|
|
498
|
+
import FlowCommentVO from "hrp-ui-base/api/bms/flow/bo/FlowCommentVO";
|
|
499
|
+
import FlowReplyVO from "hrp-ui-base/api/bms/flow/bo/FlowReplyVO";
|
|
500
|
+
import FlowCommentBO from "hrp-ui-base/api/bms/flow/bo/FlowCommentBO";
|
|
501
|
+
import dd from "dingtalk-jsapi";
|
|
502
|
+
import { downloadFile } from "hrp-ui-base";
|
|
503
|
+
|
|
504
|
+
const chooseMemberNewRef = ref();
|
|
505
|
+
const props = defineProps({
|
|
506
|
+
// 页面id
|
|
507
|
+
pageId: {
|
|
508
|
+
type: String,
|
|
509
|
+
default: "",
|
|
510
|
+
require: true,
|
|
511
|
+
},
|
|
512
|
+
formId: {
|
|
513
|
+
type: String,
|
|
514
|
+
default: "",
|
|
515
|
+
require: true,
|
|
516
|
+
},
|
|
517
|
+
});
|
|
518
|
+
const commentValue = ref();
|
|
519
|
+
// 是否是发送状态
|
|
520
|
+
const isCommentSendStatus = ref<boolean>(false);
|
|
521
|
+
const sendCommentInputRef = ref();
|
|
522
|
+
|
|
523
|
+
// @的人员列表
|
|
524
|
+
const atMemberList = ref<
|
|
525
|
+
{ avatar: string; userId: string; userName: string }[]
|
|
526
|
+
>([]);
|
|
527
|
+
const openAtDialog = () => {
|
|
528
|
+
chooseMemberNewRef.value?.open([], true, "all", []);
|
|
529
|
+
};
|
|
530
|
+
const changeChooseMemberNew = (list: any[]) => {
|
|
531
|
+
list.forEach((item) => {
|
|
532
|
+
// 检查是否已存在相同用户
|
|
533
|
+
const exist = atMemberList.value.some(
|
|
534
|
+
(member) => member.userId === item.userId
|
|
535
|
+
);
|
|
536
|
+
if (!exist) {
|
|
537
|
+
atMemberList.value.push({
|
|
538
|
+
avatar: item.avatar,
|
|
539
|
+
userId: item.userId,
|
|
540
|
+
userName: item.userName,
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
// 修改评论发送状态
|
|
546
|
+
const changeCommentSendStatus = (val: boolean) => {
|
|
547
|
+
isCommentSendStatus.value = val;
|
|
548
|
+
if (val) {
|
|
549
|
+
setTimeout(() => {
|
|
550
|
+
sendCommentInputRef.value?.focus();
|
|
551
|
+
}, 100);
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
const sendComment = () => {
|
|
555
|
+
if (!commentValue.value) {
|
|
556
|
+
ElMessage({
|
|
557
|
+
message: "请输入内容后发送",
|
|
558
|
+
type: "warning",
|
|
559
|
+
});
|
|
560
|
+
} else {
|
|
561
|
+
let submitObj: FlowCommentBO = {
|
|
562
|
+
sourceId: props.formId,
|
|
563
|
+
message: commentValue.value,
|
|
564
|
+
mentionUserIds: atMemberList.value.map((item) => {
|
|
565
|
+
return item.userId;
|
|
566
|
+
}),
|
|
567
|
+
fileIds: sendFileList.value.map((item) => {
|
|
568
|
+
return item.fileId;
|
|
569
|
+
}),
|
|
570
|
+
};
|
|
571
|
+
FlowCommentController.submitComment(submitObj).then((data) => {
|
|
572
|
+
if (data.code == 200) {
|
|
573
|
+
ElMessage.success("评论成功!");
|
|
574
|
+
clearSendMessage();
|
|
575
|
+
getSendList();
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
// 评论数据列表 - 二层
|
|
582
|
+
const commentList = ref<FlowCommentVO[]>([]);
|
|
583
|
+
// 删除at选择的成员
|
|
584
|
+
const deleteAtMember = (index: number) => {
|
|
585
|
+
atMemberList.value.splice(index, 1);
|
|
586
|
+
};
|
|
587
|
+
/** 上传文件方法 */
|
|
588
|
+
const uploadFileCommonUtil = async (options: UploadRequestOptions) => {
|
|
589
|
+
try {
|
|
590
|
+
console.log(options);
|
|
591
|
+
const fileOBJ = options.file;
|
|
592
|
+
await FileUploadController.upload(
|
|
593
|
+
fileOBJ,
|
|
594
|
+
props.pageId ? props.pageId : "01-01-04-001"
|
|
595
|
+
)
|
|
596
|
+
.then((data) => {
|
|
597
|
+
if (data.code === 200 && data.res) {
|
|
598
|
+
sendFileList.value.push(data.res);
|
|
599
|
+
} else {
|
|
600
|
+
ElMessage.error("数据发生错误,请重新上传!");
|
|
601
|
+
}
|
|
602
|
+
})
|
|
603
|
+
.catch((err) => {
|
|
604
|
+
ElMessage.error("数据发生错误,请重试!");
|
|
605
|
+
})
|
|
606
|
+
.finally(() => {
|
|
607
|
+
submitLoading.value = false;
|
|
608
|
+
});
|
|
609
|
+
} catch (err) {
|
|
610
|
+
console.debug(err);
|
|
611
|
+
}
|
|
612
|
+
};
|
|
613
|
+
const handleExceed: UploadProps["onExceed"] = (files, uploadFiles) => {
|
|
614
|
+
ElMessage.warning("上传超出限制!");
|
|
615
|
+
};
|
|
616
|
+
const commonUploadFileRef = ref();
|
|
617
|
+
// 文件列表
|
|
618
|
+
const fileList = ref<UploadUserFile[]>([]);
|
|
619
|
+
// 上传图片
|
|
620
|
+
const uploadImg = () => {
|
|
621
|
+
commonUploadFileRef.value?.handleStart();
|
|
622
|
+
};
|
|
623
|
+
const imgFileList = ref<any[]>([]);
|
|
624
|
+
// 上传文件
|
|
625
|
+
const uploadFile = () => {
|
|
626
|
+
commonUploadFileRef.value?.handleStart();
|
|
627
|
+
};
|
|
628
|
+
const otherFileList = ref<any[]>([]);
|
|
629
|
+
const submitLoading = ref(false);
|
|
630
|
+
const handleImageLoad = () => {
|
|
631
|
+
submitLoading.value = false;
|
|
632
|
+
};
|
|
633
|
+
const handleImageError = () => {
|
|
634
|
+
submitLoading.value = false;
|
|
635
|
+
};
|
|
636
|
+
const sendFileList = ref<Array<FileBaseInfo>>([]);
|
|
637
|
+
/** 专门用来预览的组件 */
|
|
638
|
+
const previewImgRef = ref();
|
|
639
|
+
const perviewImg = ref<{ url: string; srcList: string[] }>({
|
|
640
|
+
url: "",
|
|
641
|
+
srcList: [],
|
|
642
|
+
});
|
|
643
|
+
/** mp3,mp4 预览 */
|
|
644
|
+
const previewMpRef = ref();
|
|
645
|
+
|
|
646
|
+
/** 预览文件 */
|
|
647
|
+
const previewFile = async (item: FileBaseInfo, index: number) => {
|
|
648
|
+
if (
|
|
649
|
+
getFileType(item.url) === "jpg" ||
|
|
650
|
+
getFileType(item.url) === "png" ||
|
|
651
|
+
getFileType(item.url) === "bmp" ||
|
|
652
|
+
getFileType(item.url) === "jpeg" ||
|
|
653
|
+
getFileType(item.url) === "raw" ||
|
|
654
|
+
getFileType(item.url) === "heif" ||
|
|
655
|
+
getFileType(item.url) === "tiff" ||
|
|
656
|
+
getFileType(item.url) === "gif"
|
|
657
|
+
) {
|
|
658
|
+
// 图片的情况
|
|
659
|
+
perviewImg.value.url = item.url;
|
|
660
|
+
perviewImg.value.srcList = [item.url];
|
|
661
|
+
nextTick(() => {
|
|
662
|
+
previewImgRef.value?.showPreview();
|
|
663
|
+
});
|
|
664
|
+
} else if (getFileType(item.url) === "mp3") {
|
|
665
|
+
// mp3的情况
|
|
666
|
+
previewMpRef.value?.open("mp3", item);
|
|
667
|
+
} else if (getFileType(item.url) === "mp4") {
|
|
668
|
+
// mp4的情况
|
|
669
|
+
previewMpRef.value?.open("mp4", item);
|
|
670
|
+
} else {
|
|
671
|
+
try {
|
|
672
|
+
let currentUserConfig = sessionStorage.getItem("userConfig")
|
|
673
|
+
? JSON.parse(sessionStorage.getItem("userConfig") as string)
|
|
674
|
+
: null;
|
|
675
|
+
if (currentUserConfig && currentUserConfig.fileUploadType === "oss") {
|
|
676
|
+
// 文档的情况
|
|
677
|
+
await FileUploadController.getFilePreview(item.fileId).then((data) => {
|
|
678
|
+
if (data.code == 200 && data.res) {
|
|
679
|
+
ddWindowOpen(
|
|
680
|
+
window.location.origin +
|
|
681
|
+
window.location.pathname +
|
|
682
|
+
"ay-doc/index.html?url=" +
|
|
683
|
+
data.res.webOfficeUrl +
|
|
684
|
+
"&token=" +
|
|
685
|
+
data.res.accessToken
|
|
686
|
+
);
|
|
687
|
+
} else {
|
|
688
|
+
ElMessage.error("预览失败,请稍后再试!");
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
} else if (
|
|
692
|
+
currentUserConfig &&
|
|
693
|
+
currentUserConfig.fileUploadType === "minio"
|
|
694
|
+
) {
|
|
695
|
+
// minio 的预览 需要第三方工具,暂时没有,先定义成下载
|
|
696
|
+
FileUploadController.getMinioFilePreview(item.fileId).then((data) => {
|
|
697
|
+
if (data.code == 200 && data.res) {
|
|
698
|
+
window.open(
|
|
699
|
+
window.location.origin +
|
|
700
|
+
window.location.pathname +
|
|
701
|
+
"preview/onlinePreview?url=" +
|
|
702
|
+
data.res
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
} catch (error) {
|
|
708
|
+
alert("读取本地用户信息失败!");
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
/** 删除 */
|
|
713
|
+
const deleteUploadItem = (item: any, index: any) => {
|
|
714
|
+
sendFileList.value.splice(index, 1);
|
|
715
|
+
fileList.value = JSON.parse(JSON.stringify(sendFileList.value));
|
|
716
|
+
};
|
|
717
|
+
const fileName = ref<string>("");
|
|
718
|
+
|
|
719
|
+
const beforeUploadOSS = async (e: any) => {
|
|
720
|
+
submitLoading.value = true;
|
|
721
|
+
|
|
722
|
+
const is20M = e.size / 1024 / 1024 < 20;
|
|
723
|
+
if (!is20M) {
|
|
724
|
+
submitLoading.value = false;
|
|
725
|
+
|
|
726
|
+
ElMessage.error("上传文件大小不能超过 20MB!");
|
|
727
|
+
return false;
|
|
728
|
+
}
|
|
729
|
+
fileName.value = e.name;
|
|
730
|
+
// if (props.type === 'oss') {
|
|
731
|
+
|
|
732
|
+
// await getOSSOption(e.name)
|
|
733
|
+
// }
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
onMounted(async () => {});
|
|
737
|
+
const formId = ref<string>("");
|
|
738
|
+
const setCommentProps = async (data: { formId: string }) => {
|
|
739
|
+
formId.value = data.formId;
|
|
740
|
+
getSendList();
|
|
741
|
+
};
|
|
742
|
+
const getSendList = async () => {
|
|
743
|
+
await FlowCommentController.getCommentList(formId.value).then((data) => {
|
|
744
|
+
if (data.code === 200 && data.res) {
|
|
745
|
+
commentList.value = data.res;
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
};
|
|
749
|
+
/** 清空输入内容 */
|
|
750
|
+
const clearSendMessage = () => {
|
|
751
|
+
fileList.value = [];
|
|
752
|
+
sendFileList.value = [];
|
|
753
|
+
commentValue.value = "";
|
|
754
|
+
atMemberList.value = [];
|
|
755
|
+
};
|
|
756
|
+
/** 回复评论 */
|
|
757
|
+
const replyType = ref<"reply" | "comment">("comment");
|
|
758
|
+
const commentItem = ref<FlowCommentVO>(new FlowCommentVO());
|
|
759
|
+
const commentIndex = ref<number>(-1);
|
|
760
|
+
const replyItem = ref<FlowReplyVO>(new FlowReplyVO());
|
|
761
|
+
const replyIndex = ref<number>(-1);
|
|
762
|
+
/** 回复评论 */
|
|
763
|
+
const addReplyToComment = async (item: FlowCommentVO, index: number) => {
|
|
764
|
+
replyType.value = "comment";
|
|
765
|
+
replyMessage.value = "";
|
|
766
|
+
commentItem.value = item;
|
|
767
|
+
commentIndex.value = index;
|
|
768
|
+
};
|
|
769
|
+
const addReplyToReply = async (
|
|
770
|
+
aimReplyItem: FlowReplyVO,
|
|
771
|
+
aimReplyIndex: number,
|
|
772
|
+
item: FlowCommentVO,
|
|
773
|
+
index: number
|
|
774
|
+
) => {
|
|
775
|
+
replyType.value = "reply";
|
|
776
|
+
replyMessage.value = "";
|
|
777
|
+
commentItem.value = item;
|
|
778
|
+
commentIndex.value = index;
|
|
779
|
+
replyItem.value = aimReplyItem;
|
|
780
|
+
replyIndex.value = aimReplyIndex;
|
|
781
|
+
};
|
|
782
|
+
const cancelReply = () => {
|
|
783
|
+
replyType.value = "comment";
|
|
784
|
+
replyMessage.value = "";
|
|
785
|
+
commentItem.value = new FlowCommentVO();
|
|
786
|
+
commentIndex.value = -1;
|
|
787
|
+
replyItem.value = new FlowReplyVO();
|
|
788
|
+
replyIndex.value = -1;
|
|
789
|
+
};
|
|
790
|
+
const replyMessage = ref("");
|
|
791
|
+
const sendReply = async () => {
|
|
792
|
+
if (!replyMessage.value) {
|
|
793
|
+
ElMessage({
|
|
794
|
+
message: "请输入内容后发送",
|
|
795
|
+
type: "warning",
|
|
796
|
+
});
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
let submitObj: FlowCommentBO = {
|
|
800
|
+
sourceId:
|
|
801
|
+
replyType.value === "comment"
|
|
802
|
+
? commentItem.value.sourceId
|
|
803
|
+
: replyItem.value.sourceId,
|
|
804
|
+
message: replyMessage.value,
|
|
805
|
+
mentionUserIds: [],
|
|
806
|
+
fileIds: [],
|
|
807
|
+
};
|
|
808
|
+
await FlowCommentController.replyComment(submitObj).then((data) => {
|
|
809
|
+
if (data.code === 200) {
|
|
810
|
+
ElMessage.success("回复成功!");
|
|
811
|
+
cancelReply();
|
|
812
|
+
getSendList();
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
};
|
|
816
|
+
// 删除评论
|
|
817
|
+
const deleteComment = async (
|
|
818
|
+
item: FlowCommentVO | FlowReplyVO,
|
|
819
|
+
index: number
|
|
820
|
+
) => {
|
|
821
|
+
ElMessageBox.confirm("确认删除选中的数据?", "提示", {
|
|
822
|
+
confirmButtonText: "确定",
|
|
823
|
+
cancelButtonText: "取消",
|
|
824
|
+
type: "warning",
|
|
825
|
+
}).then(async () => {
|
|
826
|
+
await FlowCommentController.deleteComment(item.sourceId).then((data) => {
|
|
827
|
+
if (data.code === 200) {
|
|
828
|
+
ElMessage.success("删除成功!");
|
|
829
|
+
getSendList();
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
});
|
|
833
|
+
};
|
|
834
|
+
|
|
835
|
+
defineExpose({
|
|
836
|
+
setCommentProps,
|
|
837
|
+
});
|
|
838
|
+
</script>
|
|
839
|
+
|
|
840
|
+
<style scoped lang="scss">
|
|
841
|
+
@use "../../flow/styles/examine-approve-pc.scss";
|
|
842
|
+
@use "./styles/comment-style.scss";
|
|
843
|
+
</style>
|