Przeglądaj źródła

Merge branch 'wudi' of gitadmin/tuoheng_pilot_web into develop

tags/v1.0.0
吴迪 2 lat temu
rodzic
commit
1966627c3f
5 zmienionych plików z 53 dodań i 19 usunięć
  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 Wyświetl plik

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

return {

+ 14
- 4
src/views/system-manage/banner-manage/BannerModal.vue Wyświetl plik

@@ -90,18 +90,26 @@ export default defineComponent({
}
})

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

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

+ 6
- 1
src/views/system-manage/banner-manage/index.vue Wyświetl plik

@@ -50,10 +50,15 @@ export default {
data.modalShow = true
}

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

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

+ 25
- 11
src/views/task-manage/components/DrawComp.vue Wyświetl plik

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

@@ -148,7 +147,7 @@
:btn-name="'轨迹'"
:limit="1"
:default-list="data.srtUrl"
class="upload"
:class="{'uploads': remBtn}"
/>
<fileOss
v-if="data.photographyWay === 2"
@@ -158,7 +157,6 @@
:show-upload-btn="true"
:limit="9"
:default-list="data.orthoUrl"
class="upload"
@upload-status="statusfile"
/>
<fileOss
@@ -169,11 +167,17 @@
:btn-name="'倾斜影像'"
:limit="9"
:default-list="data.inclinedUrl"
class="upload"
@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>
<UploadOutlined />
</n-icon>
@@ -215,7 +219,7 @@ const current = data.pilotStatus / 5 // 当前状态

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

const formRef = ref() // 表格refs - 分配飞手
const formRefOrder = ref() // 表格refs - 飞手接单
@@ -331,6 +335,7 @@ const statusfile = async(status, list) => {
}
}

// 上传中取消
// watch(() => [videoRefs.value?.data?.fileList, srtRefs.value?.fileList], ([val1, val2]) => {
// if (data.flightHandId === roleId) {
// if (Object.keys(val1).length === 0 && Object.keys(val2).length === 0) {
@@ -340,8 +345,9 @@ const statusfile = async(status, list) => {
// })
const videoVal = 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) {
loading.value = false
const params = {
@@ -350,16 +356,24 @@ watch(() => [videoVal.value.videoId, srtVal.value], async([val1, val2]) => {
...srtVal.value
}
console.log(params)
await uploadFlightUrl(params)
uploadFlightUrl(params).then(({ code }) => {
if (code !== 0) {
remBtn.value = false
}
})
}
})

// 视频和文件上传
const submitFile = async() => {
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
remBtn.value = true
videoVal.value = videoRefs.value.handleUploadStart()
srtVal.value = await srtRefs.value?.startUpload()
}
@@ -432,7 +446,7 @@ const submitFile = async() => {
}
}

.upload {
.uploads {

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

+ 5
- 2
src/views/task-manage/index.vue Wyświetl plik

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

export default {
name: 'TaskManage',
@@ -64,6 +65,7 @@ export default {
}))
return temp
}
const roleType = useUserStore().userInfo.type // 1管理员,2飞手
// 新增
function handleModal() {
data.rowData = null
@@ -96,7 +98,8 @@ export default {
handleModal,
selectedIds,
// deleteComplex,
handleCheck
handleCheck,
roleType
}
},
methods: {

Ładowanie…
Anuluj
Zapisz