|  |  |  | 
|---|
|  |  |  | <view class="box_list1_club_list_item" v-for="(item, index) in form.files" :key="index" | 
|---|
|  |  |  | @click="seeBigFile(index)"> | 
|---|
|  |  |  | <image class="close" src="@/static/ic_delete@2x.png" @click.stop="dele(index)" /> | 
|---|
|  |  |  | <image class="play" src="@/static/ic_play@2x.png" v-if="item.typec === 1" /> | 
|---|
|  |  |  | <image class="play" src="@/static/ic_play@2x.png" v-if="item.type === 1" /> | 
|---|
|  |  |  | <view class="type"> | 
|---|
|  |  |  | <video :src="item.url" v-if="item.typec === 1"></video> | 
|---|
|  |  |  | <video :src="item.url" v-if="item.type === 1"></video> | 
|---|
|  |  |  | <image v-else class="type_img" :src="item.url" mode="widthFix" /> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="box_list2"> | 
|---|
|  |  |  | <view class="box_list2_label">备注</view> | 
|---|
|  |  |  | <textarea v-model="form.remarks" cols="20" rows="5" maxlength="300" placeholder="请详细描述巡检情况"></textarea> | 
|---|
|  |  |  | <textarea name="" id="" v-model="form.remarks" cols="20" rows="5" maxlength="300" | 
|---|
|  |  |  | placeholder="请详细描述巡检情况"></textarea> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="box_footer"> | 
|---|
|  |  |  | <button class="box_footer_submit" v-preventReClick @click="submit">提交</button> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <!-- 查看大图 --> | 
|---|
|  |  |  | <Preview :list="form.files.map(item => item.url)" :current="current" @close="isOpen = false" v-if="isOpen" /> | 
|---|
|  |  |  | <Preview :list="form.files" :current="current" v-if="isOpen" /> | 
|---|
|  |  |  | <!-- 选择设备 --> | 
|---|
|  |  |  | <ytyDataPicker :show="show" :dataList="columns" @select="handleSelect" @search="handleSearch" @close="show = false" /> | 
|---|
|  |  |  | <!-- 选择时间 --> | 
|---|
|  |  |  | 
|---|
|  |  |  | import { setTime, judgmentType } from '@/util/utils.js' | 
|---|
|  |  |  | import { mapState } from 'vuex' | 
|---|
|  |  |  | import ytyDataPicker from '@/components/yty-data-picker/yty-data-picker.vue' | 
|---|
|  |  |  | import Preview from '@/components/Preview.vue' | 
|---|
|  |  |  | import Preview from '@/components/Preview/Preview.vue' | 
|---|
|  |  |  |  | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | list1: [ | 
|---|
|  |  |  | 'https://cloudfactory.oss-cn-hangzhou.aliyuncs.com/deviceCheck/20230911/e228a809-0a6b-443c-9a2c-78d5c1b1b633.mp4', | 
|---|
|  |  |  | 'https://cdn.uviewui.com/uview/swiper/swiper2.png', | 
|---|
|  |  |  | 'https://cdn.uviewui.com/uview/swiper/swiper3.png', | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | status: [{ | 
|---|
|  |  |  | name: '正常', | 
|---|
|  |  |  | active: true, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | columns: [], | 
|---|
|  |  |  | isOpen: false, | 
|---|
|  |  |  | path: '', | 
|---|
|  |  |  | show: false, | 
|---|
|  |  |  | showTime: false, | 
|---|
|  |  |  | 
|---|
|  |  |  | ...mapState(['session']) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | // 查看大图/视频 | 
|---|
|  |  |  | seeBigFile(i) { | 
|---|
|  |  |  | this.current = i | 
|---|
|  |  |  | this.isOpen = true | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // 删除指定文件 | 
|---|
|  |  |  | dele(i) { | 
|---|
|  |  |  | this.form.files.splice(i, 1) | 
|---|
|  |  |  | 
|---|
|  |  |  | // 点击上传 | 
|---|
|  |  |  | uploadFile() { | 
|---|
|  |  |  | var that = this | 
|---|
|  |  |  | uni.chooseMedia({ | 
|---|
|  |  |  | mediaType: ['image', 'video'], | 
|---|
|  |  |  | sourceType: ['album', 'camera'], | 
|---|
|  |  |  | uni.chooseImage({ | 
|---|
|  |  |  | success: (chooseImageRes) => { | 
|---|
|  |  |  | uni.showLoading({ title: '上传中' }); | 
|---|
|  |  |  | const tempFilePaths = chooseImageRes.tempFiles; | 
|---|
|  |  |  | for (let i = 0; i < tempFilePaths.length; i++) { | 
|---|
|  |  |  | const tempFilePaths = chooseImageRes.tempFilePaths; | 
|---|
|  |  |  | console.log(tempFilePaths) | 
|---|
|  |  |  | uni.uploadFile({ | 
|---|
|  |  |  | url: baseUrl + '/ext/routeCardExt/upload', | 
|---|
|  |  |  | filePath: tempFilePaths[i].tempFilePath, | 
|---|
|  |  |  | filePath: tempFilePaths[0], | 
|---|
|  |  |  | name: 'file', | 
|---|
|  |  |  | header: { | 
|---|
|  |  |  | 'Cookie': 'eva-auth-token=' + that.session | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | success: (uploadFileRes) => { | 
|---|
|  |  |  | let res = JSON.parse(uploadFileRes.data) | 
|---|
|  |  |  | let typec = '' | 
|---|
|  |  |  | for (let s = 0; s < fileType.length; s++) { | 
|---|
|  |  |  | if (tempFilePaths[i].tempFilePath.indexOf(fileType[s].name) !== -1) { | 
|---|
|  |  |  | typec = fileType[s].type | 
|---|
|  |  |  | let type = '' | 
|---|
|  |  |  | for (let i = 0; i < fileType.length; i++) { | 
|---|
|  |  |  | if (tempFilePaths[0].indexOf(fileType[i].name) !== -1) { | 
|---|
|  |  |  | type = fileType[i].type | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | that.form.files.push({ | 
|---|
|  |  |  | fileUrl: res.data.imgaddr, | 
|---|
|  |  |  | filename: res.data.imgname, | 
|---|
|  |  |  | typec, | 
|---|
|  |  |  | type, | 
|---|
|  |  |  | url: res.data.url | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | uni.hideLoading(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|