d64cd58f
wesley88
上传验收小程序
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
<el-form-item label="规划图纸" prop="planningDrawing">
<upimg filePath="cd" inputtype="planningDrawing" :value="ruleForm.planningDrawing" @changimg="e=>changimg(e,'planningDrawing')"></upimg>
<!-- <upimg filePath="cd" :value="ruleForm.planningDrawing" @changimg="e=>changimg(e,'planningDrawing')" :limit="5" :fileSize="1"></upimg> -->
</el-form-item>
<el-form-item label="场地描述" prop="description">
<el-input type="textarea" v-model="ruleForm.description" style="margin-top:5px;"
placeholder="请输入" maxlength="200"></el-input>
</el-form-item>
<el-form-item label="展示主图" prop="displayImage">
<upimg filePath="cd" inputtype="displayImage" :value="ruleForm.displayImage" @changimg="e=>changimg(e,'displayImage')"></upimg>
<!-- <upimg filePath="cd" :value="ruleForm.displayImage" @changimg="e=>changimg(e,'displayImage')" :limit="1" :fileSize="1"></upimg> -->
</el-form-item>
<el-form-item label="其他视频" prop="otherImageVideos">
<upfile filePath="cd" :value="ruleForm.otherImageVideos" :fileType="'.mp4'" @changimg="e=>changimg(e,'otherImageVideos')"></upfile>
</el-form-item>
|
4373acf5
wesley88
1
|
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
},
data() {
return {
ontype:'线上广告位',
typelist:[
{
name:'线上广告位',
vaule:'线上广告位'
},
{
name:'实体广告位',
vaule:'实体广告位'
},
],
//地图标点的经纬度
mapData: {},
uploadFileUrl: uploadUrl, // 请求地址
ruleForm: {
venueName: '',
venueType: '',
actualArea: '',
district: '',
department: '',
responsiblePerson: '',
detailedLocation: '',//详细位置
mapMarker: '',//地图标点
description: '',//场地描述
planningDrawing: '',//规划图纸
displayImage: '',//展示主图
otherMedia: '', //其他图片视频
},
rulesSt: {
venueName: [{
required: true,
message: '请输入场地名称',
trigger: 'blur'
}, ],
venueType: [{
required: true,
message: '请选择场地类型',
trigger: 'change'
}, ],
actualArea: [{
required: true,
message: '请输入实际使用面积',
trigger: 'blur'
}, ],
district: [{
required: true,
message: '请选择所属区域',
trigger: 'change'
}],
detailedLocation: [{
required: true,
message: '请输入详细位置',
trigger: 'blur'
}, ]
},
uploadFiles: [],
filesLength: 1,
gongyuanList: [],
fileData: [],
parentMessage: {},
edit: true
};
},
props: {
info: {
type: Object,
default: {}
},
},
async created() {
if (this.info && this.info.id) {
this.ruleForm = this.info
} else {
}
},
methods: {
|
4373acf5
wesley88
1
|
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
|
changeadvertisingType(e){
console.error(e)
this.ontype = e
},
//获取当前时间
updateCurrentTime() {
const now = new Date();
const year = now.getFullYear();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const day = now.getDate().toString().padStart(2, '0');
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
const seconds = now.getSeconds().toString().padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
},
//获取地图点击的经纬度
getChildDate(mapData) {
this.mapData = mapData
},
lvdaoSel(vaule) {
this.ruleForm.belongingParkTrail = ''
this.gongyuan(vaule)
},
async gongyuan(value) {
const gongyaun = await gongyuan()
this.gongyuanList = gongyaun.data.filter(item => item.superior == value);
},
add() {
if (this.ruleForm.id) {
this.$refs.ruleForm.validate((valid) => {
console.log(valid)
if (valid) {
this.ruleForm.updateDate = this.updateCurrentTime()
if (this.fileData.length != 0) {
this.ruleForm.otherImageVideos = this.fileData[0].url
}
this.ruleForm.mapMarker = JSON.stringify(this.mapData)
changedit(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message({
message: '修改成功',
type: 'success'
})
this.$emit('removeonaction', '1')
} else {
this.$message({
message: res.msg,
type: 'error'
})
}
})
} else {
this.$message({
message: '请填写完整信息',
type: 'error'
})
return false;
}
})
} else {
this.$refs.ruleForm.validate((valid) => {
console.log(valid)
if (valid) {
if (this.fileData.length != 0) {
this.ruleForm.otherImageVideos = this.fileData[0].url
}
this.ruleForm.createDate = this.updateCurrentTime()
this.ruleForm.mapMarker = JSON.stringify(this.mapData)
this.ruleForm.rentalStatus = 0
this.ruleForm.publishStatus = 0
changadd(this.ruleForm).then(res => {
if (res.code == 200) {
this.$message({
message: '添加成功',
type: 'success'
})
this.$emit('removeonaction', '1')
} else {
this.$message({
message: res.msg,
type: 'error'
})
}
})
} else {
this.$message({
message: '请填写完整信息',
type: 'error'
})
return false;
}
})
}
},
close() {
this.$emit('removeonaction', '1')
},
hefuRemove() {
this.hefuData = []
},
hefuSuccess(response, file, fileList) {
this.fileData = []
console.error(response)
let fd = new FormData()
fd.append('file', response.raw)
fd.append('filePath', 'hetong')
miniioupload(fd).then(res => {
console.error(res)
const fileMsg = {
name: response.name,
url: res.data,
}
this.fileData.push(fileMsg)
})
},
},
};
</script>
<style lang="scss">
.el-upload {
display: block;
/* text-align: left; */
}
.video-uploader {
.el-upload {
text-align: left;
}
}
.el-dialog__header {
background-color: #F2F3F5;
text-align: left;
}
.el-dialog__title {
line-height: 30px;
font-size: 15px;
color: #303133;
}
</style>
|