|
@@ -148,7 +148,17 @@
|
|
|
<br>
|
|
|
<span>{{ scope.row.type }}</span>
|
|
|
</span>
|
|
|
- <el-link v-if="scope.row.levelFlag === 3" type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.attachmentName}}</el-link>
|
|
|
+ <div v-if="ifName(scope.row) === true">
|
|
|
+ <el-image
|
|
|
+ style="width: 30px; height: 30px;padding-top: 4px;"
|
|
|
+ :src="scope.row.lsUrl"
|
|
|
+ :preview-src-list="[scope.row.lsUrl]"
|
|
|
+ :preview-teleported="true"
|
|
|
+ ></el-image>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <el-link v-if="scope.row.levelFlag === 3" type="primary" :underline="false" @click="showFile(scope.row)">{{scope.row.attachmentName}}</el-link>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
<vxe-column field="workAttachmentType" width="100px" title="文件类型"></vxe-column>
|
|
@@ -197,6 +207,14 @@
|
|
|
import UserSelectSignatory from '../workClientInfo/clientUserSelect'
|
|
|
import FileForm from './FileForm'
|
|
|
import UpLoadComponent from '@/views/common/JyArchiveUpLoadComponent'
|
|
|
+ import OSSSerivce, {
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ beforeAvatarUpload,
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ openWindowOnUrl,
|
|
|
+ // eslint-disable-next-line no-unused-vars
|
|
|
+ toHref
|
|
|
+ } from '@/api/sys/OSSService'
|
|
|
export default {
|
|
|
props: {
|
|
|
businessId: {
|
|
@@ -246,6 +264,7 @@
|
|
|
|
|
|
created () {
|
|
|
this.projectInfoService=new ProjectInfoService()
|
|
|
+ this.ossService = new OSSSerivce()
|
|
|
|
|
|
},
|
|
|
computed: {
|
|
@@ -287,6 +306,7 @@
|
|
|
UserSelectSignatory,
|
|
|
UpLoadComponent,
|
|
|
FileForm,
|
|
|
+ OSSSerivce,
|
|
|
},
|
|
|
methods: {
|
|
|
getKeyWatch (keyWatch) {
|
|
@@ -354,7 +374,6 @@
|
|
|
|
|
|
this.projectInfoService.getAttachmentList(data.projectId,this.inputForm.id).then((data) => {
|
|
|
this.tableData = data
|
|
|
- console.log("getAttachmentList",this.tableData)
|
|
|
})
|
|
|
|
|
|
// this.$refs.uploadComponent.newUpload(method, this.inputForm.fileList, 'jyProjectArchive', null, '附件', null, null, null)
|
|
@@ -589,7 +608,7 @@
|
|
|
},
|
|
|
//测试按钮
|
|
|
openFileForm(id,typeId){
|
|
|
- this.$refs.fileForm.init("add", id,typeId)
|
|
|
+ this.$refs.fileForm.init("add", id,this.inputForm.projectId)
|
|
|
},
|
|
|
showFile (row) {
|
|
|
console.log("showFile",row)
|
|
@@ -603,7 +622,6 @@
|
|
|
getFiles(){
|
|
|
this.projectInfoService.getAttachmentList(this.inputForm.projectId,this.inputForm.id).then((data) => {
|
|
|
this.tableData = data
|
|
|
- console.log('data',data)
|
|
|
})
|
|
|
|
|
|
},
|
|
@@ -620,6 +638,18 @@
|
|
|
return kb + '' + sizes[i]
|
|
|
}
|
|
|
},
|
|
|
+ ifName (row) {
|
|
|
+ if (this.commonJS.isEmpty(row.attachmentName)) {
|
|
|
+ row.attachmentName = '---'
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let suffix = row.attachmentName.substring(row.attachmentName.lastIndexOf('.') + 1)
|
|
|
+ if (suffix === 'jpg' || suffix === 'png' || suffix === 'gif' || suffix === 'bmp' || suffix === 'jpeg') {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|