zs преди 1 година
родител
ревизия
826a4cf534
променени са 1 файла, в които са добавени 8 реда и са изтрити 2 реда
  1. 8 2
      src/views/problem/opinion/index.vue

+ 8 - 2
src/views/problem/opinion/index.vue

@@ -15,7 +15,8 @@
         <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
           <cForm :span="24" :fields="formFields" :form="form" :rules="{}" :isSave="true" :disabled="true">
             <template #file>
-              <cUpload :model="`${'file'}`" :limit="1" listType="picture-card" url="/files/travel/opinion/upload" accept="*" :list="form.file"></cUpload>
+              <cUpload :model="`${'file'}`" :limit="1" listType="picture-card" url="/files/travel/opinion/upload"
+                accept="*" :list="form.file"></cUpload>
             </template>
           </cForm>
         </el-col>
@@ -30,8 +31,10 @@ import type { Ref } from 'vue';
 import { ref, onMounted, getCurrentInstance } from 'vue';
 // 接口
 import { OpinionStore } from '@/stores/problem/opinion';
+import { UserStore } from '@/stores/users/user';
 import type { IQueryResult } from '@/util/types.util';
 const opinionAxios = OpinionStore();
+const userAxios = UserStore();
 const { proxy } = getCurrentInstance() as any;
 // 加载中
 const loading: Ref<any> = ref(false);
@@ -52,6 +55,7 @@ let searchForm: Ref<any> = ref({});
 const dialog: Ref<any> = ref({ title: '信息管理', show: false, type: '1' });
 const form: Ref<any> = ref({ file: [] });
 const formFields: Ref<any> = ref([
+  { label: '用户', model: 'user_name' },
   { label: '手机号', model: 'phone' },
   { label: '图片', model: 'file', custom: true },
   { label: '内容', model: 'content', type: 'textarea' }
@@ -76,8 +80,10 @@ const toSearch = (query: any) => {
 };
 // 查看
 const toView = async (data: any) => {
-  let res: IQueryResult = await opinionAxios.fetch(data._id);
+  let res: any = await opinionAxios.fetch(data._id);
   if (res.errcode == '0') {
+    const arr: any = await userAxios.fetch(res.data.user._id);
+    if (arr.errcode == '0') res.data.user_name = arr.data.nick_name;
     form.value = res.data;
     dialog.value = { title: '信息管理', show: true, type: '1' };
   }