From 3009c04d0aacf537778f000e948df91aa11c3401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Evol=E9=83=91=E5=A4=A9?= Date: Wed, 29 Nov 2023 01:24:42 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=AC=E4=BC=97=E5=8F=B7-?= =?UTF-8?q?=E7=B4=A0=E6=9D=90=E7=AE=A1=E7=90=86=20=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=97=B6=E7=BC=BA=E5=B0=91accountId=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Evol郑天 --- src/views/mp/material/components/UploadFile.vue | 5 ++++- src/views/mp/material/components/UploadVideo.vue | 5 ++++- src/views/mp/material/components/upload.ts | 1 + src/views/mp/material/index.vue | 7 ++++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/views/mp/material/components/UploadFile.vue b/src/views/mp/material/components/UploadFile.vue index 1476917a..276a798c 100644 --- a/src/views/mp/material/components/UploadFile.vue +++ b/src/views/mp/material/components/UploadFile.vue @@ -33,6 +33,8 @@ const message = useMessage() const props = defineProps<{ type: UploadType }>() +const accountId = inject('accountId') + const fileList = ref([]) const emit = defineEmits<{ (e: 'uploaded', v: void) @@ -41,7 +43,8 @@ const emit = defineEmits<{ const uploadData: UploadData = reactive({ type: UploadType.Image, title: '', - introduction: '' + introduction: '', + accountId: accountId! }) /** 上传前检查 */ diff --git a/src/views/mp/material/components/UploadVideo.vue b/src/views/mp/material/components/UploadVideo.vue index 28f050c0..0eda1cef 100644 --- a/src/views/mp/material/components/UploadVideo.vue +++ b/src/views/mp/material/components/UploadVideo.vue @@ -59,6 +59,8 @@ import { HEADERS, UploadData, UPLOAD_URL, UploadType, beforeVideoUpload } from ' const message = useMessage() +const accountId = inject('accountId') + const uploadRules: FormRules = { title: [{ required: true, message: '请输入标题', trigger: 'blur' }], introduction: [{ required: true, message: '请输入描述', trigger: 'blur' }] @@ -89,7 +91,8 @@ const fileList = ref([]) const uploadData: UploadData = reactive({ type: UploadType.Video, title: '', - introduction: '' + introduction: '', + accountId: accountId! }) const uploadFormRef = ref(null) diff --git a/src/views/mp/material/components/upload.ts b/src/views/mp/material/components/upload.ts index 7158ab12..e732fe70 100644 --- a/src/views/mp/material/components/upload.ts +++ b/src/views/mp/material/components/upload.ts @@ -9,6 +9,7 @@ interface UploadData { type: UploadType title: string introduction: string + accountId: number } const beforeImageUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => diff --git a/src/views/mp/material/index.vue b/src/views/mp/material/index.vue index b72c9ad6..de060429 100644 --- a/src/views/mp/material/index.vue +++ b/src/views/mp/material/index.vue @@ -99,17 +99,22 @@ const type = ref(UploadType.Image) // 素材类型 const loading = ref(false) // 遮罩层 const list = ref([]) // 总条数 const total = ref(0) // 数据列表 + +const accountId = ref(-1) +provide('accountId', accountId) + // 查询参数 const queryParams = reactive({ pageNo: 1, pageSize: 10, - accountId: -1, + accountId: accountId, permanent: true }) const showCreateVideo = ref(false) // 是否新建视频的弹窗 /** 侦听公众号变化 **/ const onAccountChanged = (id: number) => { + accountId.value = id queryParams.accountId = id queryParams.pageNo = 1 getList()