稽查查看图片功能修复

uat_us
caiyiling 2024-04-12 11:42:42 +08:00
parent 3283f7f5f2
commit db1d2cc4e1
1 changed files with 63 additions and 17 deletions

View File

@ -334,13 +334,13 @@
<a v-else-if="scope.row.DataType === 'Link' || scope.row.DataType === 'Router'" target="_blank" :href="scope.row.oldValue">
{{$t('trials:auditRecord:title:viewDetail')}}
</a>
<viewer v-else-if="(scope.row.DataType === 'Image' || scope.row.DataType === 'ImageList') && scope.row.oldValue" :ref="scope.row.oldValue" :images="imagesList">
<viewer v-else-if="(scope.row.DataType === 'Image' || scope.row.DataType === 'ImageList') && scope.row.oldValue && scope.row.oldValue !== '--'" :ref="scope.row.oldValue" :images="imagesList">
<!-- 查看图片 -->
<span style="color:#409eff;cursor: pointer" @click="openImage(scope.row.oldValue)">{{$t('trials:auditRecord:title:viewImage')}}{{scope.row.oldValue instanceof Array ? `(${scope.row.oldValue.length})` : ''}}</span>
<template v-for="item of scope.row.oldValue">
<img v-if="scope.row.DataType === 'ImageList'" :key="item" :src="item" v-show="false" crossorigin="anonymous" alt="">
<img v-if="scope.row.DataType === 'ImageList'" :key="item" :src="OSSclientConfig.basePath + item" v-show="false" crossorigin="anonymous" alt="">
</template>
<img v-if="scope.row.DataType === 'Image'" :src="scope.row.oldValue" v-show="false" crossorigin="anonymous" alt="">
<img v-if="scope.row.DataType === 'Image'" :src="OSSclientConfig.basePath + scope.row.oldValue" v-show="false" crossorigin="anonymous" alt="">
</viewer>
<span v-else>
{{ scope.row.oldValue }}
@ -363,7 +363,7 @@
<a v-else-if="scope.row.DataType === 'Link' || scope.row.DataType === 'Router'" target="_blank" :href="scope.row.newValue">
{{$t('trials:auditRecord:title:viewDetail')}}
</a>
<viewer v-else-if="(scope.row.DataType === 'Image' || scope.row.DataType === 'ImageList') && scope.row.newValue" :ref="scope.row.newValue" :images="imagesList">
<viewer v-else-if="(scope.row.DataType === 'Image' || scope.row.DataType === 'ImageList') && scope.row.newValue && scope.row.newValue !== '--'" :ref="scope.row.newValue" :images="imagesList">
<!-- 查看图片 -->
<span style="color:#409eff;cursor: pointer" @click="openImage(scope.row.newValue)">{{$t('trials:auditRecord:title:viewImage')}}{{scope.row.newValue instanceof Array ? `(${scope.row.newValue.length})` : ''}}</span>
<template v-for="item of scope.row.newValue">
@ -633,13 +633,35 @@
:label="OptType === 'Add' ? $t('trials:auditRecord:title:fieldValue') : OptType === 'Delete' ? $t('trials:auditRecord:title:beforeDeletion') : $t('trials:auditRecord:title:beforeModification')"
show-overflow-tooltip
>
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<span>
<a v-if="scope.row.DataType === 'Link' || scope.row.DataType === 'Router'" target="_blank" :href="scope.row.oldValue">{{scope.row.oldValue}}</a>
<span v-else>
{{ scope.row.oldValue }}
</span>
</span>
</template> -->
<template slot-scope="scope">
<span>
<!-- 查看详情 -->
<a v-if="scope.row.DataType === 'OSS'" target="_blank" :href="OSSclientConfig.basePath + scope.row.oldValue">
{{$t('common:button:download')}}
</a>
<a v-else-if="scope.row.DataType === 'Link' || scope.row.DataType === 'Router'" target="_blank" :href="scope.row.oldValue">
{{$t('trials:auditRecord:title:viewDetail')}}
</a>
<viewer v-else-if="(scope.row.DataType === 'Image' || scope.row.DataType === 'ImageList') && scope.row.oldValue && scope.row.oldValue !== '--'" :ref="scope.row.oldValue" :images="imagesList">
<!-- 查看图片 -->
<span style="color:#409eff;cursor: pointer" @click="openImage(scope.row.oldValue)">{{$t('trials:auditRecord:title:viewImage')}}{{scope.row.oldValue instanceof Array ? `(${scope.row.oldValue.length})` : ''}}</span>
<template v-for="item of scope.row.oldValue">
<img v-if="scope.row.DataType === 'ImageList'" :key="item" :src="OSSclientConfig.basePath + item" v-show="false" crossorigin="anonymous" alt="">
</template>
<img v-if="scope.row.DataType === 'Image'" :src="OSSclientConfig.basePath + scope.row.oldValue" v-show="false" crossorigin="anonymous" alt="">
</viewer>
<span v-else>
{{ scope.row.oldValue }}
</span>
</span>
</template>
</el-table-column>
<!-- OptType === 'Add' || OptType === 'Init' ? '值' : OptType === 'Delete' ? '删除后' : '修改后' -->
@ -648,11 +670,32 @@
:label="OptType === 'Add' || OptType === 'Init' ? $t('trials:auditRecord:title:fieldValue') : OptType === 'Delete' ? $t('trials:auditRecord:title:afterDeletion') : $t('trials:auditRecord:title:afterModification')"
show-overflow-tooltip
>
<template slot-scope="scope">
<!-- <template slot-scope="scope">
<span :style="{ color: scope.row.newValue !== scope.row.oldValue ? '#f66' : null }">
<a v-if="scope.row.DataType === 'Link' || scope.row.DataType === 'Router'" target="_blank" :href="scope.row.newValue">{{scope.row.newValue}}</a>
<span v-else>{{ scope.row.newValue }}</span>
</span>
</template> -->
<template slot-scope="scope">
<span :style="{ color: scope.row.newValue !== scope.row.oldValue ? '#f66' : null }">
<!-- 查看详情 -->
<a v-if="scope.row.DataType === 'OSS'" target="_blank" :href="OSSclientConfig.basePath + scope.row.newValue">
{{$t('common:button:download')}}
</a>
<a v-else-if="scope.row.DataType === 'Link' || scope.row.DataType === 'Router'" target="_blank" :href="scope.row.newValue">
{{$t('trials:auditRecord:title:viewDetail')}}
</a>
<viewer v-else-if="(scope.row.DataType === 'Image' || scope.row.DataType === 'ImageList') && scope.row.newValue && scope.row.newValue !== '--'" :ref="scope.row.newValue" :images="imagesList">
<!-- 查看图片 -->
<span style="color:#409eff;cursor: pointer" @click="openImage(scope.row.newValue)">{{$t('trials:auditRecord:title:viewImage')}}{{scope.row.newValue instanceof Array ? `(${scope.row.newValue.length})` : ''}}</span>
<template v-for="item of scope.row.newValue">
<img v-if="scope.row.DataType === 'ImageList'" :key="item" :src="OSSclientConfig.basePath + item" v-show="false" crossorigin="anonymous" alt="">
</template>
<img v-if="scope.row.DataType === 'Image'" :src="OSSclientConfig.basePath + scope.row.newValue" v-show="false" crossorigin="anonymous" alt="">
<!-- <img :src="scope.row.newValue" v-show="false" crossorigin="anonymous" alt="">-->
</viewer>
<span v-else>{{ scope.row.newValue }}</span>
</span>
</template>
</el-table-column>
</el-table>
@ -817,6 +860,8 @@ export default {
methods: {
openImage(url) {
console.log(url)
this.$nextTick(()=>{
if (url instanceof Array) {
this.imagesList = url.map(v => this.OSSclientConfig.basePath + v)
} else {
@ -827,6 +872,7 @@ export default {
} else {
this.$refs[url].$viewer.show()
}
})
},
getTrialCriterionList() {
getTrialCriterionList(this.trialId, false).then(res => {
@ -1135,6 +1181,7 @@ export default {
item.Enum = this.$i18n.locale === 'zh' ? v.ValueCN : v.Value
this[auditData].push(item)
})
console.log(this[auditData])
},
getJSON(row) {
return new Promise(resolve => {
@ -1175,7 +1222,6 @@ export default {
console.log(res)
var configList2 = res.Result
this.formatting(configList2, JsonDetail.Data, ParentJson ? ParentJson.Data : null, JsonDetail.CommonData, row, 'auditData2')
console.log(this.auditData2)
this.otherData2 = []
if (row.IsSign) {
//