Browse Source

Merge branch 'wudi' of gitadmin/tuoheng_pilot_web into develop

tags/v1.0.0
吴迪 1 year ago
parent
commit
1966627c3f
5 changed files with 53 additions and 19 deletions
  1. +3
    -1
      src/components/UploadOss/index.vue
  2. +14
    -4
      src/views/system-manage/banner-manage/BannerModal.vue
  3. +6
    -1
      src/views/system-manage/banner-manage/index.vue
  4. +25
    -11
      src/views/task-manage/components/DrawComp.vue
  5. +5
    -2
      src/views/task-manage/index.vue

+ 3
- 1
src/components/UploadOss/index.vue View File

}) })
const objectList = data.fileList.map((item) => item.objectName || 'error') const objectList = data.fileList.map((item) => item.objectName || 'error')
resolve(objectList) resolve(objectList)
emit('uploadStatus', 'success', objectList)
}) })
.catch((error) => { .catch((error) => {
console.log('error', error) console.log('error', error)
* @param {Array} fileList * @param {Array} fileList
* @return {*} * @return {*}
*/ */
function handleChange({ fileList }) {
async function handleChange({ fileList }) {
data.fileList = fileList.map((item) => { data.fileList = fileList.map((item) => {
if (Object.keys(data.hasUploadInfo).includes(item.id)) { if (Object.keys(data.hasUploadInfo).includes(item.id)) {
item.objectName = data.hasUploadInfo[item.id].objectName item.objectName = data.hasUploadInfo[item.id].objectName
/* 判断是否存在文件 */ /* 判断是否存在文件 */
const status = fileList.length ? 'ready' : 'no-file' const status = fileList.length ? 'ready' : 'no-file'
emit('uploadStatus', status) emit('uploadStatus', status)
await startUpload()
} }


return { return {

+ 14
- 4
src/views/system-manage/banner-manage/BannerModal.vue View File

} }
}) })


function handleUploadStatus(status) {
function handleUploadStatus(status, list) {
console.log('status', status, list)
data.form.cover = status data.form.cover = status
data.form.list = list
} }


const formRef = ref() const formRef = ref()
const ossRefs = ref() const ossRefs = ref()
function handleConfirm() { function handleConfirm() {
// if (data.form.cover === 'upload') {
// $message.error('未上传或正在上传')
// handleClose()
// return
// }
// if (data.form.cover === 'success') {
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
ossRefs.value.startUpload().then(res => {
if (data.form.cover === 'success') {
const params = { const params = {
...data.form, ...data.form,
cover: res[0]
cover: data.form.list[0]
} }
if (params.id) { if (params.id) {
/* 编辑 */ /* 编辑 */
} }
}) })
} }
})
} else {
handleClose()
}
}).catch(e => { }).catch(e => {
console.log('e:', e) console.log('e:', e)
}) })

+ 6
- 1
src/views/system-manage/banner-manage/index.vue View File

data.modalShow = true data.modalShow = true
} }


const handleCheck = (e) => {
console.log('eee', e)
}

return { return {
...toRefs(data), ...toRefs(data),
loadDataTable, loadDataTable,
handleModal
handleModal,
handleCheck
} }
} }
} }

+ 25
- 11
src/views/task-manage/components/DrawComp.vue View File

ref="videoRefs" ref="videoRefs"
:upload-name="'视频'" :upload-name="'视频'"
:limit="1" :limit="1"
class="upload"
:class="{'uploads': remBtn}"
@upload-status="vodStatusVideo" @upload-status="vodStatusVideo"
/> />
<fileOss <fileOss
:btn-name="'视频'" :btn-name="'视频'"
:limit="1" :limit="1"
:default-list="data.videoUrl" :default-list="data.videoUrl"
class="upload"
@upload-status="vodStatusVideo" @upload-status="vodStatusVideo"
/> />


:btn-name="'轨迹'" :btn-name="'轨迹'"
:limit="1" :limit="1"
:default-list="data.srtUrl" :default-list="data.srtUrl"
class="upload"
:class="{'uploads': remBtn}"
/> />
<fileOss <fileOss
v-if="data.photographyWay === 2" v-if="data.photographyWay === 2"
:show-upload-btn="true" :show-upload-btn="true"
:limit="9" :limit="9"
:default-list="data.orthoUrl" :default-list="data.orthoUrl"
class="upload"
@upload-status="statusfile" @upload-status="statusfile"
/> />
<fileOss <fileOss
:btn-name="'倾斜影像'" :btn-name="'倾斜影像'"
:limit="9" :limit="9"
:default-list="data.inclinedUrl" :default-list="data.inclinedUrl"
class="upload"
@upload-status="statusfile" @upload-status="statusfile"
/> />


<n-button v-if="data.photographyWay === 1 && roleId === data.flightHandId" type="primary" class="btn" :loading="loading" @click="submitFile">
<n-button
v-if="data.photographyWay === 1 && !data.videoUrl"
type="primary"
class="btn"
:loading="loading"
:disabled="remBtn"
@click="submitFile"
>
<n-icon> <n-icon>
<UploadOutlined /> <UploadOutlined />
</n-icon> </n-icon>


const roleId = useUserStore().userInfo.id || '00a5a13322fc088cc1c4ba4c40d22fcs' // 默认为管理员id const roleId = useUserStore().userInfo.id || '00a5a13322fc088cc1c4ba4c40d22fcs' // 默认为管理员id
// const roleId = '00a5a13322fc088cc1c4ba4c40d22fcs' // 调试id // const roleId = '00a5a13322fc088cc1c4ba4c40d22fcs' // 调试id
console.log(roleId, data.flightHandId) // 调试id
// console.log(roleId, data.flightHandId) // 调试id


const formRef = ref() // 表格refs - 分配飞手 const formRef = ref() // 表格refs - 分配飞手
const formRefOrder = ref() // 表格refs - 飞手接单 const formRefOrder = ref() // 表格refs - 飞手接单
} }
} }


// 上传中取消
// watch(() => [videoRefs.value?.data?.fileList, srtRefs.value?.fileList], ([val1, val2]) => { // watch(() => [videoRefs.value?.data?.fileList, srtRefs.value?.fileList], ([val1, val2]) => {
// if (data.flightHandId === roleId) { // if (data.flightHandId === roleId) {
// if (Object.keys(val1).length === 0 && Object.keys(val2).length === 0) { // if (Object.keys(val1).length === 0 && Object.keys(val2).length === 0) {
// }) // })
const videoVal = ref({}) const videoVal = ref({})
const srtVal = ref({}) const srtVal = ref({})
const remBtn = ref(false)


watch(() => [videoVal.value.videoId, srtVal.value], async([val1, val2]) => {
watch(() => [videoVal.value.videoId, srtVal.value], ([val1, val2]) => {
if (val1 && Object.keys(val2).length !== 0) { if (val1 && Object.keys(val2).length !== 0) {
loading.value = false loading.value = false
const params = { const params = {
...srtVal.value ...srtVal.value
} }
console.log(params) console.log(params)
await uploadFlightUrl(params)
uploadFlightUrl(params).then(({ code }) => {
if (code !== 0) {
remBtn.value = false
}
})
} }
}) })


// 视频和文件上传 // 视频和文件上传
const submitFile = async() => { const submitFile = async() => {
if (Object.keys(videoRefs.value.data.fileList).length === 0 || if (Object.keys(videoRefs.value.data.fileList).length === 0 ||
Object.keys(srtRefs.value.fileList).length === 0) return
Object.keys(srtRefs.value.fileList).length === 0) {
$message.warning('请选择视频和轨迹后再上传')
return
}


loading.value = true loading.value = true
remBtn.value = true
videoVal.value = videoRefs.value.handleUploadStart() videoVal.value = videoRefs.value.handleUploadStart()
srtVal.value = await srtRefs.value?.startUpload() srtVal.value = await srtRefs.value?.startUpload()
} }
} }
} }


.upload {
.uploads {


:deep(.n-button__icon) { :deep(.n-button__icon) {
display: none; // 隐藏删除按钮 display: none; // 隐藏删除按钮

+ 5
- 2
src/views/task-manage/index.vue View File

size="large" size="large"
@update:checked-row-keys="handleCheck" @update:checked-row-keys="handleCheck"
> >
<template #tableTitle>
<template v-if="roleType === 1" #tableTitle>
<n-button type="primary" @click="handleModal"> 新建 </n-button> <n-button type="primary" @click="handleModal"> 新建 </n-button>
</template> </template>
</data-table> </data-table>
import UserModal from './components/UserModal.vue' import UserModal from './components/UserModal.vue'
import { getTaskList } from '@/api/task/index' import { getTaskList } from '@/api/task/index'
import { unref, ref, toRefs, reactive, onUnmounted } from 'vue' import { unref, ref, toRefs, reactive, onUnmounted } from 'vue'
import { useUserStore } from '@/store/modules/user'


export default { export default {
name: 'TaskManage', name: 'TaskManage',
})) }))
return temp return temp
} }
const roleType = useUserStore().userInfo.type // 1管理员,2飞手
// 新增 // 新增
function handleModal() { function handleModal() {
data.rowData = null data.rowData = null
handleModal, handleModal,
selectedIds, selectedIds,
// deleteComplex, // deleteComplex,
handleCheck
handleCheck,
roleType
} }
}, },
methods: { methods: {

Loading…
Cancel
Save