feat: 修改为xtUpload调用
This commit is contained in:
parent
71dca19db3
commit
a268549e03
|
|
@ -8,7 +8,7 @@
|
||||||
<uni-easyinput v-model="form.title" placeholder="请输入送审稿件标题" :disabled="mode=='show'"/>
|
<uni-easyinput v-model="form.title" placeholder="请输入送审稿件标题" :disabled="mode=='show'"/>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="文件内容" required>
|
<uni-forms-item label="文件内容" required>
|
||||||
<uni-file-picker v-model="form.pfile" limit="1" return-type="object" file-mediatype="all" @select="fileSelect" @success="fileSuccess" ></uni-file-picker>
|
<xtUpload v-model="form.pfile" xtype="path" :disabled="mode=='show'"></xtUpload>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="所有撰稿人" required>
|
<uni-forms-item label="所有撰稿人" required>
|
||||||
<uni-easyinput v-model="form.participants" placeholder="请输入所有撰稿人" :disabled="mode=='show'"/>
|
<uni-easyinput v-model="form.participants" placeholder="请输入所有撰稿人" :disabled="mode=='show'"/>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<uni-easyinput v-model="form.note" :disabled="mode=='show'"/>
|
<uni-easyinput v-model="form.note" :disabled="mode=='show'"/>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="文件内容" required>
|
<uni-forms-item label="文件内容" required>
|
||||||
<uni-file-picker v-model="form.file" limit="1" return-type="object" file-mediatype="all" @select="fileSelect" @success="fileSuccess"></uni-file-picker>
|
<xtUpload v-model="form.file" xtype="path" :disabled="mode=='show'"></xtUpload>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
<uni-forms-item label="用印份数" required>
|
<uni-forms-item label="用印份数" required>
|
||||||
<uni-number-box v-model="form.file_count" :disabled="mode=='show'"></uni-number-box>
|
<uni-number-box v-model="form.file_count" :disabled="mode=='show'"></uni-number-box>
|
||||||
|
|
@ -111,51 +111,9 @@ import {actStateEnum} from "@/utils/enum.js"
|
||||||
maskClick(e){
|
maskClick(e){
|
||||||
console.log('maskClick事件:', e);
|
console.log('maskClick事件:', e);
|
||||||
},
|
},
|
||||||
fileSelect(e){
|
|
||||||
console.log('fileSelect',e);
|
|
||||||
this.uploadFile(e)
|
|
||||||
},
|
|
||||||
fileSuccess(e){
|
|
||||||
console.log('fileSuccess',e)
|
|
||||||
},
|
|
||||||
sealTypeChange(){
|
sealTypeChange(){
|
||||||
console.log('this.form.seal',this.form.seal)
|
console.log('this.form.seal',this.form.seal)
|
||||||
},
|
},
|
||||||
uploadFile(e) {
|
|
||||||
if (e.tempFiles.length === 0) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '请先选择文件',
|
|
||||||
icon: 'none',
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 获取第一个选择的文件
|
|
||||||
const file = e.tempFiles[0];
|
|
||||||
console.log(this.$api.sealCreate)
|
|
||||||
let fieldName = 'file';
|
|
||||||
let filePath = file.url;
|
|
||||||
// 上传文件
|
|
||||||
uni.uploadFile({
|
|
||||||
url: `${config.baseUrl}/file/`,
|
|
||||||
filePath: filePath,
|
|
||||||
name: fieldName,
|
|
||||||
formData: {},
|
|
||||||
header: this.header,
|
|
||||||
success: (uploadRes) => {
|
|
||||||
console.log('uploadRes',uploadRes)
|
|
||||||
// 上传成功后的回调
|
|
||||||
const data = JSON.parse(uploadRes.data);
|
|
||||||
console.log('上传返回数据:', data);
|
|
||||||
if(data){
|
|
||||||
this.form.file = data.path;
|
|
||||||
uni.showToast({
|
|
||||||
title: '上传成功',
|
|
||||||
icon: 'success',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//选择会议室和日期后查询有无预定
|
//选择会议室和日期后查询有无预定
|
||||||
async submit_b_func(id){
|
async submit_b_func(id){
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue