ソースを参照

🎨 修改投稿页面

快乐的梦鱼 2 週間 前
コミット
dbbd2adde6
共有2 個のファイルを変更した18 個の追加4 個の削除を含む
  1. 13 0
      src/api/CommonContent.ts
  2. 5 4
      src/pages/user/contribute/submit.vue

+ 13 - 0
src/api/CommonContent.ts

@@ -498,6 +498,19 @@ export class CommonContentApi extends AppServerRequestModule<DataModel> {
     }, modelClassCreator);
     return res.data as T;
   }
+  /**
+   * 获取可投稿栏目
+   * @returns 
+   */
+  async getContributeColumnList(querys?: QueryParams) {
+    const res = await this.get('/content/main_body_column/getColumnList', `获取可投稿栏目`, {
+      main_body_id: this.mainBodyId,
+      model_id: 11,
+      iscontribute: 1,
+      ...querys,
+    }, undefined);
+    return res.data as unknown as GetColumContentList[];
+  }
 
   
   /**

+ 5 - 4
src/pages/user/contribute/submit.vue

@@ -24,6 +24,7 @@ import type { FormProps } from '@/components/form/Form.vue';
 import type { PickerIdFieldProps } from '@/components/dynamic/wrappers/PickerIdField';
 import type { UploaderFieldProps } from '@/components/form/UploaderField.vue';
 import { useImageSimpleUploadCo } from '@/common/components/upload/ImageUploadCo';
+import CommonContent from '@/api/CommonContent';
 
 const loading = ref(false);
 
@@ -45,12 +46,11 @@ const formDefine : IDynamicFormOptions = {
           type: 'select-id', 
           additionalProps: {
             loadData: async () => {
-              /* (await ContributeApi.getCanClaimVallageList())
+              return (await CommonContent.getContributeColumnList())
                 .map((p) => ({
                   value: p.id,
-                  text: p.villageName,
-                })) */
-              return []
+                  text: p.name,
+                }));
             },
           },
           rules: [{
@@ -236,6 +236,7 @@ async function submit() {
       title: '有必填项未填写,请检查',
       icon: 'none',
     });
+    return;
   }
   try { 
     loading.value = true;