支持多图片上传

This commit is contained in:
wuxw 2025-03-30 18:00:23 +08:00
parent 0f68bec2ff
commit da64db403d
7 changed files with 50 additions and 25 deletions

View File

@ -56,20 +56,19 @@
{{event.staffName}}
</td>
<td class="text-center" v-if="event.fileType != 'S'">
<a :href="event.pathUrl" target="_blank">下载</a>
<div v-if="event.pathUrl.endsWith('jpg') || event.pathUrl.endsWith('png')">
<img style="width: 60px; height: 60px;" class="border-radius" v-bind:src="event.pathUrl"
v-on:click="_viewTaskFileImg(event.pathUrl)" />
</div>
<div v-else>
<a :href="event.pathUrl" target="_blank">下载</a>
</div>
</td>
<td class="text-center" v-else>
--
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="2">
<ul class="pagination float-right"></ul>
</td>
</tr>
</tfoot>
</table>
<!-- 分页 -->
<div class="text-right">

View File

@ -54,8 +54,8 @@
<tbody>
<tr v-for="item in workDetailTaskItemInfo.items">
<td class="text-left" style="width: 400px;">
<div >
{{item.content}}
<div>
{{item.content}}
</div>
</td>
<td class="text-center">
@ -70,8 +70,14 @@
{{item.remark}}
</td>
<td class="text-center">
<div v-if="item.pathUrl">
<a :href="item.pathUrl" target="_blank">下载</a>
<div v-if="item.pathUrls" v-for="(url,index) in item.pathUrls">
<div v-if="url.endsWith('jpg') || url.endsWith('png')">
<img style="width: 60px; height: 60px;" class="border-radius" v-bind:src="url"
v-on:click="_viewTaskFileImg(url)" />
</div>
<div v-else>
<a :href="url" target="_blank">下载</a>
</div>
</div>
<div v-else> - </div>
</td>

View File

@ -75,6 +75,11 @@
$that.workDetailTaskItemInfo.taskId = _task.taskId;
$that._loadWorkDetailTaskItemData();
},
_viewTaskFileImg: function (_url) {
vc.emit('viewImage', 'showImage', {
url: _url
});
},
}
});
})(window.vc);

View File

@ -10,7 +10,7 @@
endTime:'',
staffs:[],
copyStaffs:[],
pathUrl:'',
pathUrls:[],
contents:[],
period:'',
months: [],
@ -40,8 +40,9 @@
vc.emit('textarea','init',$that.addWorkInfo);
},
_initEvent: function () {
vc.on('addWorkInfo', 'notifyFile', function (_param) {
$that.addWorkInfo.pathUrl = _param.realFileName;
vc.on('addWork', 'notifyFile', function (_param) {
$that.addWorkInfo.pathUrls = [];
$that.addWorkInfo.pathUrls.push(_param.realFileName);
})
},
methods: {

View File

@ -11,7 +11,7 @@
endTime: '',
staffs: [],
copyStaffs: [],
pathUrl: '',
pathUrls: [],
contents:[],
period: '',
months: [],
@ -38,8 +38,9 @@
vc.emit('textarea', 'init', $that.editWorkInfo);
},
_initEvent: function () {
vc.on('editWorkInfo', 'notifyFile', function (_param) {
$that.editWorkInfo.pathUrl = _param.realFileName;
vc.on('editWork', 'notifyFile', function (_param) {
$that.editWorkInfo.pathUrls = [];
$that.editWorkInfo.pathUrls.push(_param.realFileName);
})
},
methods: {
@ -179,8 +180,8 @@
function (json, res) {
let _json = JSON.parse(json);
vc.copyObject(_json.data[0], $that.editWorkInfo);
if(_json.data[0].pathUrl){
vc.emit('uploadFile', 'notifyVedio',_json.data[0].pathUrl);
if(_json.data[0].pathUrls){
vc.emit('uploadFile', 'notifyVedio',_json.data[0].pathUrls[0]);
}
$that.editWorkInfo.contents.forEach(_c=>{
_c.id = vc.uuid();

View File

@ -103,13 +103,21 @@
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<div class="form-group flex justify-start">
<label class="col-form-label">
<vc:i18n name="附件:" namespace="workDetailInfo"></vc:i18n>
</label>
<label class="">
<a :href="workDetailInfo.pathUrl" v-if="workDetailInfo.pathUrl">下载</a>
</label>
<div class="flex justify-start">
<div class="" v-if="workDetailInfo.pathUrls" v-for="(url,index) in workDetailInfo.pathUrls">
<div v-if="url.endsWith('jpg') || url.endsWith('png')">
<img style="width: 60px; height: 60px;" class="border-radius" v-bind:src="url"
v-on:click="_viewTaskFileImg(url)" />
</div>
<div v-else>
<a :href="url" target="_blank">下载</a>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -19,7 +19,7 @@
stateName: "",
createTime: '',
content: '',
pathUrl: '',
pathUrls: [],
_currentTab: 'workDetailContent',
contents:[]
}
@ -72,6 +72,11 @@
contents:$that.workDetailInfo.contents
})
},
_viewTaskFileImg: function (_url) {
vc.emit('viewImage', 'showImage', {
url: _url
});
},
}
});
})(window.vc);