Browse Source

bug

tags/v1.0.0
吴迪 1 year ago
parent
commit
b6f5cb48a4
6 changed files with 36 additions and 15 deletions
  1. +5
    -0
      src/components/UploadOss/index.vue
  2. +5
    -3
      src/views/system-manage/banner-manage/BannerModal.vue
  3. +7
    -5
      src/views/system-manage/banner-manage/tool/table.js
  4. +1
    -1
      src/views/task-manage/components/DrawComp.vue
  5. +9
    -3
      src/views/task-manage/index.vue
  6. +9
    -3
      src/views/task-manage/tools/table.js

+ 5
- 0
src/components/UploadOss/index.vue View File

:file-list="fileList" :file-list="fileList"
:default-upload="false" :default-upload="false"
list-type="image-card" list-type="image-card"
:show-remove-button="remBtn"
@change="handleChange" @change="handleChange"
@before-upload="beforeUpload" @before-upload="beforeUpload"
> >
defaultList: { defaultList: {
type: String, type: String,
default: '' default: ''
},
remBtn: {
type: Boolean,
default: false
} }
}, },
emits: ['uploadStatus'], emits: ['uploadStatus'],

+ 5
- 3
src/views/system-manage/banner-manage/BannerModal.vue View File

require-mark-placement="left" require-mark-placement="left"
> >
<n-form-item label="横幅图片" path="cover"> <n-form-item label="横幅图片" path="cover">
<UploadOss ref="ossRefs" :default-list="initUpload" @upload-status="handleUploadStatus" />
<UploadOss ref="ossRefs" :rem-btn="type !== 'preview'" :default-list="initUpload" @upload-status="handleUploadStatus" />
</n-form-item> </n-form-item>
<!-- <n-form-item label="排序" path="sort"> <!-- <n-form-item label="排序" path="sort">
<n-input-number v-model:value="form.sort" clearable /> <n-input-number v-model:value="form.sort" clearable />
} else { } else {
data.initUpload = '' data.initUpload = ''
} }
})
}, { immediate: true })


const getModalOptions = computed(() => { const getModalOptions = computed(() => {
return { return {
}) })


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


const formRef = ref() const formRef = ref()
const ossRefs = ref() const ossRefs = ref()
function handleConfirm() { function handleConfirm() {
console.log(ossRefs.value)
if (props.type !== 'preview') { if (props.type !== 'preview') {
formRef.value?.validate((errors) => { formRef.value?.validate((errors) => {
if (!errors) { if (!errors) {
const imageStr = response.join() const imageStr = response.join()
const params = { const params = {
...data.form, ...data.form,
cover: imageStr[0]
conver: imageStr[0]
} }
if (params.id) { if (params.id) {
/* 编辑 */ /* 编辑 */

+ 7
- 5
src/views/system-manage/banner-manage/tool/table.js View File

{ {
title: '序号', title: '序号',
key: 'key', key: 'key',
width: 180,
render: (_, index) => { render: (_, index) => {
return `${index + 1}` return `${index + 1}`
}, },
render(row) { render(row) {
return h(TableImage, { return h(TableImage, {
images: { images: {
width: 36,
height: 36,
width: 119,
height: 51,
src: row.cover src: row.cover
// previewDisabled: true // 禁止点击预览
} }
}) })
} }
title: '上传人', title: '上传人',
key: 'updateUser', key: 'updateUser',
align: 'center', align: 'center',
width: 160
width: 200
}, },
{ {
title: '上传时间', title: '上传时间',
key: 'updateTime', key: 'updateTime',
align: 'center', align: 'center',
width: 160
width: 220
}, },
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
width: 150,
width: 220,
fixed: 'right', fixed: 'right',
render(row) { render(row) {
return h(TableAction, { return h(TableAction, {

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

<div v-if="current !== 1" class="cont"> <div v-if="current !== 1" class="cont">
<n-descriptions label-placement="left" label-align="right" :column="4" title="飞行信息"> <n-descriptions label-placement="left" label-align="right" :column="4" title="飞行信息">
<template v-for="(it, i) in flyInfo" :key="i + it.label"> <template v-for="(it, i) in flyInfo" :key="i + it.label">
<n-descriptions-item v-if="current !== it?.current" :label="it.label">
<n-descriptions-item v-if="!it?.current || current >= it?.current" :label="it.label">
{{ it.value }} {{ it.value }}
</n-descriptions-item> </n-descriptions-item>
</template> </template>

+ 9
- 3
src/views/task-manage/index.vue View File

<!-- 详情 - 抽屉 --> <!-- 详情 - 抽屉 -->
<n-drawer v-model:show="showDraw" :width="'calc(100vw - 210px)'" :placement="'right'" resizable> <n-drawer v-model:show="showDraw" :width="'calc(100vw - 210px)'" :placement="'right'" resizable>
<n-drawer-content closable> <n-drawer-content closable>
<draw-comp :detail="detail" @close="showDraw = false" />
<draw-comp :detail="detail" @close="showDraw = false;handleSearch()" />
</n-drawer-content> </n-drawer-content>
</n-drawer> </n-drawer>


...toRefs(table), ...toRefs(table),
...toRefs(search) ...toRefs(search)
}) })
const status = ['任务待分配', '任务已分配', '飞手已接单', '任务飞行中', '任务已完成']
const loadDataTable = async(res) => { const loadDataTable = async(res) => {
const _params = { const _params = {
...unref(data.searchParams), ...unref(data.searchParams),
...res ...res
} }
return await getTaskList(_params)
const temp = await getTaskList(_params)
// 将状态由数字改成文字
temp.data.records = temp.data.records.map(it => ({
...it,
statusName: status[(it.status / 5) - 1]
}))
return temp
} }
// 新增 // 新增
function handleModal() { function handleModal() {

+ 9
- 3
src/views/task-manage/tools/table.js View File

}, },
{ {
title: '任务状态', title: '任务状态',
key: 'status',
key: 'statusName',
align: 'center' align: 'center'
}, },
{ {
props: { props: {
type: 'primary', type: 'primary',
text: true, text: true,
onClick: editHandle.bind(null, row, 'update')
onClick: editHandle.bind(null, row, 'update'),
style: {
display: row.status > 10 ? 'none' : ''
}
}, },
auth: 'basic_list' auth: 'basic_list'
}, },
}, },
ButtonProps: { ButtonProps: {
text: true, text: true,
type: 'primary'
type: 'primary',
style: {
display: row.status > 10 ? 'none' : ''
}
} }
} }
], ],

Loading…
Cancel
Save