Skip to content

Commit c1a7b2b

Browse files
authored
Merge pull request #1996 from tesun/main
有公共函数onDownloadFile,去掉downloadFile
2 parents 9fa866b + 671e669 commit c1a7b2b

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

Diff for: server/resource/package/web/view/table.vue.tpl

+2-7
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="200">
132132
<template #default="scope">
133133
<div class="file-list">
134-
<el-tag v-for="file in scope.row.{{.FieldJson}}" :key="file.uid" @click="downloadFile(file.url)">{{"{{"}}file.name{{"}}"}}</el-tag>
134+
<el-tag v-for="file in scope.row.{{.FieldJson}}" :key="file.uid" @click="onDownloadFile(file.url)">{{"{{"}}file.name{{"}}"}}</el-tag>
135135
</div>
136136
</template>
137137
</el-table-column>
@@ -607,7 +607,7 @@ getDataSourceFunc()
607607
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="200">
608608
<template #default="scope">
609609
<div class="file-list">
610-
<el-tag v-for="file in scope.row.{{.FieldJson}}" :key="file.uid" @click="downloadFile(file.url)">{{"{{"}}file.name{{"}}"}}</el-tag>
610+
<el-tag v-for="file in scope.row.{{.FieldJson}}" :key="file.uid" @click="onDownloadFile(file.url)">{{"{{"}}file.name{{"}}"}}</el-tag>
611611
</div>
612612
</template>
613613
</el-table-column>
@@ -1297,11 +1297,6 @@ const enterDialog = async () => {
12971297
}
12981298
})
12991299
}
1300-
{{if .HasFile }}
1301-
const downloadFile = (url) => {
1302-
window.open(getUrl(url), '_blank')
1303-
}
1304-
{{end}}
13051300
13061301
const detailFrom = ref({})
13071302

Diff for: server/resource/plugin/web/view/view.vue.template

+2-7
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="200">
132132
<template #default="scope">
133133
<div class="file-list">
134-
<el-tag v-for="file in scope.row.{{.FieldJson}}" :key="file.uid" @click="downloadFile(file.url)">{{"{{"}}file.name{{"}}"}}</el-tag>
134+
<el-tag v-for="file in scope.row.{{.FieldJson}}" :key="file.uid" @click="onDownloadFile(file.url)">{{"{{"}}file.name{{"}}"}}</el-tag>
135135
</div>
136136
</template>
137137
</el-table-column>
@@ -607,7 +607,7 @@ getDataSourceFunc()
607607
<el-table-column label="{{.FieldDesc}}" prop="{{.FieldJson}}" width="200">
608608
<template #default="scope">
609609
<div class="file-list">
610-
<el-tag v-for="file in scope.row.{{.FieldJson}}" :key="file.uid" @click="downloadFile(file.url)">{{"{{"}}file.name{{"}}"}}</el-tag>
610+
<el-tag v-for="file in scope.row.{{.FieldJson}}" :key="file.uid" @click="onDownloadFile(file.url)">{{"{{"}}file.name{{"}}"}}</el-tag>
611611
</div>
612612
</template>
613613
</el-table-column>
@@ -1295,11 +1295,6 @@ const enterDialog = async () => {
12951295
}
12961296
})
12971297
}
1298-
{{if .HasFile }}
1299-
const downloadFile = (url) => {
1300-
window.open(getUrl(url), '_blank')
1301-
}
1302-
{{end}}
13031298

13041299
const detailFrom = ref({})
13051300

0 commit comments

Comments
 (0)