@@ -6,6 +6,7 @@ | |||
:file-list="fileList" | |||
:default-upload="false" | |||
list-type="image-card" | |||
:show-remove-button="remBtn" | |||
@change="handleChange" | |||
@before-upload="beforeUpload" | |||
> | |||
@@ -28,6 +29,10 @@ export default defineComponent({ | |||
defaultList: { | |||
type: String, | |||
default: '' | |||
}, | |||
remBtn: { | |||
type: Boolean, | |||
default: false | |||
} | |||
}, | |||
emits: ['uploadStatus'], |
@@ -15,7 +15,7 @@ | |||
require-mark-placement="left" | |||
> | |||
<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 label="排序" path="sort"> | |||
<n-input-number v-model:value="form.sort" clearable /> | |||
@@ -73,7 +73,7 @@ export default defineComponent({ | |||
} else { | |||
data.initUpload = '' | |||
} | |||
}) | |||
}, { immediate: true }) | |||
const getModalOptions = computed(() => { | |||
return { | |||
@@ -85,12 +85,14 @@ export default defineComponent({ | |||
}) | |||
function handleUploadStatus(status) { | |||
console.log(status) | |||
data.form.cover = status | |||
} | |||
const formRef = ref() | |||
const ossRefs = ref() | |||
function handleConfirm() { | |||
console.log(ossRefs.value) | |||
if (props.type !== 'preview') { | |||
formRef.value?.validate((errors) => { | |||
if (!errors) { | |||
@@ -107,7 +109,7 @@ export default defineComponent({ | |||
const imageStr = response.join() | |||
const params = { | |||
...data.form, | |||
cover: imageStr[0] | |||
conver: imageStr[0] | |||
} | |||
if (params.id) { | |||
/* 编辑 */ |
@@ -50,6 +50,7 @@ const data = reactive({ | |||
{ | |||
title: '序号', | |||
key: 'key', | |||
width: 180, | |||
render: (_, index) => { | |||
return `${index + 1}` | |||
}, | |||
@@ -62,9 +63,10 @@ const data = reactive({ | |||
render(row) { | |||
return h(TableImage, { | |||
images: { | |||
width: 36, | |||
height: 36, | |||
width: 119, | |||
height: 51, | |||
src: row.cover | |||
// previewDisabled: true // 禁止点击预览 | |||
} | |||
}) | |||
} | |||
@@ -73,18 +75,18 @@ const data = reactive({ | |||
title: '上传人', | |||
key: 'updateUser', | |||
align: 'center', | |||
width: 160 | |||
width: 200 | |||
}, | |||
{ | |||
title: '上传时间', | |||
key: 'updateTime', | |||
align: 'center', | |||
width: 160 | |||
width: 220 | |||
}, | |||
{ | |||
title: '操作', | |||
align: 'center', | |||
width: 150, | |||
width: 220, | |||
fixed: 'right', | |||
render(row) { | |||
return h(TableAction, { |
@@ -40,7 +40,7 @@ | |||
<div v-if="current !== 1" class="cont"> | |||
<n-descriptions label-placement="left" label-align="right" :column="4" title="飞行信息"> | |||
<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 }} | |||
</n-descriptions-item> | |||
</template> |
@@ -26,7 +26,7 @@ | |||
<!-- 详情 - 抽屉 --> | |||
<n-drawer v-model:show="showDraw" :width="'calc(100vw - 210px)'" :placement="'right'" resizable> | |||
<n-drawer-content closable> | |||
<draw-comp :detail="detail" @close="showDraw = false" /> | |||
<draw-comp :detail="detail" @close="showDraw = false;handleSearch()" /> | |||
</n-drawer-content> | |||
</n-drawer> | |||
@@ -50,13 +50,19 @@ export default { | |||
...toRefs(table), | |||
...toRefs(search) | |||
}) | |||
const status = ['任务待分配', '任务已分配', '飞手已接单', '任务飞行中', '任务已完成'] | |||
const loadDataTable = async(res) => { | |||
const _params = { | |||
...unref(data.searchParams), | |||
...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() { |
@@ -89,7 +89,7 @@ const data = reactive({ | |||
}, | |||
{ | |||
title: '任务状态', | |||
key: 'status', | |||
key: 'statusName', | |||
align: 'center' | |||
}, | |||
{ | |||
@@ -121,7 +121,10 @@ const data = reactive({ | |||
props: { | |||
type: 'primary', | |||
text: true, | |||
onClick: editHandle.bind(null, row, 'update') | |||
onClick: editHandle.bind(null, row, 'update'), | |||
style: { | |||
display: row.status > 10 ? 'none' : '' | |||
} | |||
}, | |||
auth: 'basic_list' | |||
}, | |||
@@ -135,7 +138,10 @@ const data = reactive({ | |||
}, | |||
ButtonProps: { | |||
text: true, | |||
type: 'primary' | |||
type: 'primary', | |||
style: { | |||
display: row.status > 10 ? 'none' : '' | |||
} | |||
} | |||
} | |||
], |