diff --git a/src/modules/other/information/InformationListView.vue b/src/modules/other/information/InformationListView.vue index e2f7e81..fa5c33f 100644 --- a/src/modules/other/information/InformationListView.vue +++ b/src/modules/other/information/InformationListView.vue @@ -24,6 +24,7 @@ interface Info { content: string images: string createTime: string + status?: number } const list = ref([]) @@ -54,6 +55,7 @@ const columns = [ { prop: 'id', label: 'ID', width: 90 }, { prop: 'title', label: '资讯标题', minWidth: 260 }, { prop: 'categoryName', label: '分类', width: 120, formatter: (r: Info) => r.categoryName || '--' }, + { prop: 'status', label: '状态', width: 90, formatter: (r: Info) => r.status === 0 ? '草稿' : '已发布' }, { prop: 'createTime', label: '发布时间', width: 170 }, ] @@ -67,7 +69,7 @@ const imgStyle = computed(() => ({ async function load() { loading.value = true try { - const params: any = { page: query.page, limit: query.limit } + const params: any = { page: query.page, limit: query.limit, status: 'all' } if (search.title.trim()) params.title = search.title.trim() const resp: any = await httpGet('/other/information/page', params) list.value = resp?.list || [] @@ -113,7 +115,7 @@ function onCategoryChange(id: string) { const c = categories.value.find(x => x.id === id) editForm.categoryName = c?.name || '' } -async function submit() { +async function submit(status: number) { if (!editForm.title.trim()) { ElMessage.warning('请填写标题'); return } if (!editForm.categoryId) { ElMessage.warning('请选择分类'); return } saving.value = true @@ -124,6 +126,7 @@ async function submit() { categoryName: editForm.categoryName, content: richEditorRef.value?.getContent?.() ?? editForm.content, images: editForm.images, + status, } if (editMode.value === 'create') { await httpPost('/other/information/save', payload) @@ -217,7 +220,7 @@ async function customUpload(opt: any) { - + @@ -246,7 +249,8 @@ async function customUpload(opt: any) {