|
@@ -19,7 +19,7 @@
|
|
|
(`api/framework/v1/task-form-process/download-attachments/` + item.code)
|
|
|
| sdResource
|
|
|
"
|
|
|
- class="ant-upload-list-item-image"/></a
|
|
|
+ class="ant-upload-list-item-image" /></a
|
|
|
></div>
|
|
|
<span class="ant-upload-list-item-actions"
|
|
|
><a class="prebtnatt" @click="showEye">
|
|
@@ -175,9 +175,9 @@
|
|
|
<a-tooltip
|
|
|
v-if="
|
|
|
['0', '-4'].includes(item.CatNum) &&
|
|
|
- computedFjList.length > 1 &&
|
|
|
- _sortable &&
|
|
|
- !formReadOnly
|
|
|
+ computedFjList.length > 1 &&
|
|
|
+ _sortable &&
|
|
|
+ !formReadOnly
|
|
|
"
|
|
|
placement="right"
|
|
|
title="拖拽排序"
|
|
@@ -186,6 +186,9 @@
|
|
|
<a-icon type="sd-swap"
|
|
|
/></a>
|
|
|
</a-tooltip>
|
|
|
+ <a-tooltip v-if="item.Completed && item.deletable" placement="top" title="预览">
|
|
|
+ <a-button icon="sd-desktop" type="link" @click="preview(item)" />
|
|
|
+ </a-tooltip>
|
|
|
</div>
|
|
|
</a-list-item>
|
|
|
</sd-draggable>
|
|
@@ -339,7 +342,7 @@ export default {
|
|
|
*/
|
|
|
uploadable: {
|
|
|
type: [Boolean, String],
|
|
|
- default: function() {
|
|
|
+ default: function () {
|
|
|
return !this.readOnly
|
|
|
},
|
|
|
},
|
|
@@ -348,7 +351,7 @@ export default {
|
|
|
*/
|
|
|
zwUploadable: {
|
|
|
type: [Boolean, String],
|
|
|
- default: function() {
|
|
|
+ default: function () {
|
|
|
return !this.readOnly
|
|
|
},
|
|
|
},
|
|
@@ -357,7 +360,7 @@ export default {
|
|
|
*/
|
|
|
sortable: {
|
|
|
type: [Boolean, String],
|
|
|
- default: function() {
|
|
|
+ default: function () {
|
|
|
return !this.readOnly
|
|
|
},
|
|
|
},
|
|
@@ -366,7 +369,7 @@ export default {
|
|
|
*/
|
|
|
initValue: {
|
|
|
type: Array,
|
|
|
- default: function() {
|
|
|
+ default: function () {
|
|
|
return this.webflow.FlowData?.processFormData.processFormPropertyValues.find((item) => {
|
|
|
return item.value?.indexOf?.(this.groupId) > -1
|
|
|
})?.attr?.attachments
|
|
@@ -377,7 +380,7 @@ export default {
|
|
|
*/
|
|
|
infoProperties: {
|
|
|
type: Object,
|
|
|
- default: function() {
|
|
|
+ default: function () {
|
|
|
return (
|
|
|
this.webflow.FlowData?.processFormData.processFormPropertyValues.find((item) => {
|
|
|
return item.value?.indexOf?.(this.groupId) > -1
|
|
@@ -430,12 +433,12 @@ export default {
|
|
|
},
|
|
|
computedFjList: {
|
|
|
// 附件
|
|
|
- get: function() {
|
|
|
+ get: function () {
|
|
|
return this.attachmentsList.filter((item) =>
|
|
|
['0', '-5', '-6'].includes(item.CatNum.toString())
|
|
|
)
|
|
|
},
|
|
|
- set: function(newValue) {
|
|
|
+ set: function (newValue) {
|
|
|
this.attachments = [
|
|
|
...this.computedZwList,
|
|
|
...newValue,
|
|
@@ -542,10 +545,7 @@ export default {
|
|
|
},
|
|
|
// 选择文件后上传、附件图标颜色
|
|
|
getIcon(fname) {
|
|
|
- const suffix = fname
|
|
|
- .split('.')
|
|
|
- .pop()
|
|
|
- .toLowerCase()
|
|
|
+ const suffix = fname.split('.').pop().toLowerCase()
|
|
|
if (['doc', 'docx'].includes(suffix)) {
|
|
|
return 'file-word'
|
|
|
}
|
|
@@ -693,6 +693,25 @@ export default {
|
|
|
filesChanged() {
|
|
|
this.$emit('change', this.attachments)
|
|
|
},
|
|
|
+ preview(file) {
|
|
|
+ const storeName = 'iamAttachment'
|
|
|
+ const fileId = file.Unid
|
|
|
+ axios
|
|
|
+ .get(`api/xcoa-mobile/v1/wps/preview/url/${storeName}/${fileId}`)
|
|
|
+ .then((_) => {
|
|
|
+ const data = _.data
|
|
|
+ console.log(data)
|
|
|
+ if (data.status === 'error') {
|
|
|
+ alert(data.message)
|
|
|
+ } else {
|
|
|
+ window.open(data.previewLink, '_blank')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ console.log('get preview url error', e)
|
|
|
+ alert('预览功能错误')
|
|
|
+ })
|
|
|
+ },
|
|
|
DelFile(file) {
|
|
|
Modal.confirm({
|
|
|
title: `确认删除附件《${file.FileName}》?`,
|