bzkf3 2 gadi atpakaļ
vecāks
revīzija
4ddbbc2a9c

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 1
public/vite.svg


+ 53 - 36
src/components/archives-card/index.vue

@@ -4,28 +4,45 @@ import { type_archives_item } from '~/types';
 const props = defineProps<{
   d: type_archives_item;
   disabled?: boolean;
+  storage?: boolean;
 }>()
-console.log('props.d :>> ', props.d);
+const archivesStorage = sessionStorage.getItem(`a_${new Date().toLocaleDateString()}_${props.d.dxz_id}`)
 const form = reactive<type_archives_item>(
-  Object.assign({
-    user_id: '',
-    dxxd_date: '',
-    dxxd_lfzxm: '',
-    dxxd_school_name: '',
-    dxxd_class_name: '',
-    dxxd_jfls: '',
-    dxxd_address: '',
-    dxxd_phone: '',
-    dxxd_zxyy: '',
-    dxxd_lfzzs: '',
-    dxxd_clfs: '',
-    dxxd_wxdj: '',
-    dxxd_cbfx: '',
-  }, props.d))
+  (props.storage && archivesStorage)
+    ? JSON.parse(archivesStorage)
+    : Object.assign(
+      {
+        user_id: '',
+        dxxd_date: '',
+        dxxd_lfzxm: '',
+        dxxd_school_name: '',
+        dxxd_class_name: '',
+        dxxd_jfls: '',
+        dxxd_address: '',
+        dxxd_phone: '',
+        dxxd_zxyy: '',
+        dxxd_lfzzs: '',
+        dxxd_clfs: '',
+        dxxd_wxdj: '',
+        dxxd_cbfx: '',
+      },
+      props.d
+    )
+)
 
 defineExpose({
   form
 })
+
+watch(
+  form,
+  (val) => {
+    props.storage && sessionStorage.setItem(`a_${new Date().toLocaleDateString()}_${form.dxz_id}`, JSON.stringify(val))
+  },
+  {
+    deep: true,
+    immediate: true
+  })
 </script>
 
 <template>
@@ -37,40 +54,40 @@ defineExpose({
     </div>
     <div class="divide-x divide-dark-100 flex justify-start">
       <div class="flex-none px-2px w-66px leading-7">来访者姓名</div>
-      <div class="px-2px flex-auto leading-7 max-w-56px"><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
-          v-model="form.dxxd_lfzxm" size="small"></el-input>
+      <div class="px-2px flex-auto leading-7 max-w-56px"><el-input :disabled="disabled"
+          input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_lfzxm" size="small"></el-input>
       </div>
       <div class="flex-none px-2px w-30px leading-7">学校</div>
-      <div class="px-2px flex-auto leading-7"><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
-          v-model="form.dxxd_school_name" size="small"></el-input></div>
+      <div class="px-2px flex-auto leading-7"><el-input :disabled="disabled"
+          input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_school_name" size="small"></el-input></div>
       <div class="flex-none px-2px w-30px leading-7">班级</div>
-      <div class="px-2px flex-auto leading-7"><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
-          v-model="form.dxxd_class_name" size="small"></el-input></div>
+      <div class="px-2px flex-auto leading-7"><el-input :disabled="disabled"
+          input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_class_name" size="small"></el-input></div>
     </div>
     <div class="divide-x divide-dark-100 flex justify-start">
       <div class="flex-none px-2px w-66px leading-7">接访教师</div>
-      <div class="px-2px flex-auto leading-7 max-w-56px"><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
-          v-model="form.dxxd_jfls" size="small"></el-input>
+      <div class="px-2px flex-auto leading-7 max-w-56px"><el-input :disabled="disabled"
+          input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_jfls" size="small"></el-input>
       </div>
       <div class="flex-none px-2px w-30px leading-7">住址</div>
-      <div class="px-2px flex-auto leading-7"><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
-          v-model="form.dxxd_address" size="small"></el-input></div>
+      <div class="px-2px flex-auto leading-7"><el-input :disabled="disabled"
+          input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_address" size="small"></el-input></div>
       <div class="flex-none px-2px w-30px leading-7">电话</div>
-      <div class="px-2px flex-auto leading-7"><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
-          v-model="form.dxxd_phone" size="small"></el-input></div>
+      <div class="px-2px flex-auto leading-7"><el-input :disabled="disabled"
+          input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_phone" size="small"></el-input></div>
     </div>
 
     <div class="p-1">
-      <div>咨询缘由: </div><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_zxyy" type="textarea"
-        resize="none" :rows="2"></el-input>
+      <div>咨询缘由: </div><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
+        v-model="form.dxxd_zxyy" type="textarea" resize="none" :rows="2"></el-input>
     </div>
     <div class="p-1">
-      <div>来访者自述:</div><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_lfzzs"
-        type="textarea" resize="none" :rows="2"></el-input>
+      <div>来访者自述:</div><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
+        v-model="form.dxxd_lfzzs" type="textarea" resize="none" :rows="2"></el-input>
     </div>
     <div class="p-1">
-      <div>初步分析:</div><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_cbfx" type="textarea"
-        resize="none" :rows="2"></el-input>
+      <div>初步分析:</div><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
+        v-model="form.dxxd_cbfx" type="textarea" resize="none" :rows="2"></el-input>
     </div>
     <div class="p-1">
       <div>危机等级:</div>
@@ -81,8 +98,8 @@ defineExpose({
       </el-radio-group>
     </div>
     <div class="p-1">
-      <div>处理方式:</div><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;" v-model="form.dxxd_clfs" type="textarea"
-        resize="none" :rows="2"></el-input>
+      <div>处理方式:</div><el-input :disabled="disabled" input-style="font-size:12px;line-height:14px;"
+        v-model="form.dxxd_clfs" type="textarea" resize="none" :rows="2"></el-input>
     </div>
 
   </div>

+ 2 - 2
src/components/teacher-card/index.vue

@@ -19,9 +19,9 @@ function handleClickConsult() {
 
       <el-button type="primary" round @click="handleClickConsult">咨询</el-button>
     </div>
-    <div class="text-hex-5B9FF0">联系电话:{{ d.phone }}</div>
+    <div class="text-hex-5B9FF0">联系电话:{{ d.dxp_user_phone }}</div>
     <div class="line-clamp-2 overflow-ellipsis text-hex-00000041 h-10 leading-5">
-      {{ d.jj }}
+      {{ d.dxp_jj }}
     </div>
   </div>
 </template>

+ 32 - 5
src/pages/student/consult.vue

@@ -14,6 +14,23 @@ if (SessionConsultTeacher !== null) {
   router.back()
 }
 
+let teacherInfo = $ref<{
+  dxp_user_realname: string;
+  dxp_user_phone: string;
+  dxp_wx_qrcode: string;
+  dxp_jj: string;
+}>()
+request({
+  url: '/dyaw/xlfw_pbgl/detail',
+  data: {
+    user_id: teacher.user_id
+  }
+}).then(res => {
+  if (res.code === '1') {
+    teacherInfo = res.data.one_info
+  }
+})
+
 const dyaw_xlfw_zxhd: type_dyaw_xlfw_zxhd = (await request({
   url: '/dyaw/xlfw_zxhd/add',
   data: {
@@ -41,6 +58,7 @@ function handleConfirmRate() {
       dyaw_xlfw_zxhd: {
         dxz_star: rateNum,
         dxz_star_datetime: endTime,
+        // 下行代码【可能】导致使用问题
         dxz_status: '1'
       }
     }
@@ -164,11 +182,20 @@ watch(
       </div>
     </div>
     <div
-      class="w-400px h-full bg-white overflow-y-auto flex flex-col items-center px-30px py-4 divide-y scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
-      <div class="w-full"></div>
-      <div>
+      class="w-400px h-full space-y-4 bg-white overflow-y-auto flex flex-col items-stretch px-30px py-4 divide-y scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
 
-      </div>
+      <template v-if="teacherInfo">
+        <div class="w-full">
+          <img :src="teacherInfo.dxp_wx_qrcode" alt="">
+        </div>
+        <div class="py-4">
+          <div class="text-lg font-bold max-w-24 truncate">{{ teacherInfo.dxp_user_realname }}</div>
+          <div class="text-hex-5B9FF0">联系电话:{{ teacherInfo.dxp_user_phone }}</div>
+          <div class=" text-hex-00000041 h-10 leading-5 mt-1">
+            {{ teacherInfo.dxp_jj }}
+          </div>
+        </div>
+      </template>
     </div>
   </div>
 
@@ -189,7 +216,7 @@ watch(
 
   </el-dialog>
 
-  <chat-audio ref="ChatAudioRef"></chat-audio>
+  <!-- <chat-audio ref="ChatAudioRef"></chat-audio> -->
 </template>
 
 <style scoped lang="scss">

+ 31 - 20
src/pages/student/home.vue

@@ -1,31 +1,42 @@
 <script setup lang="ts">
-console.log('student');
-// request({
-//   url: '/dyaw/xlfw_pbgl_pb/index',
-//   data: {
-//     // dxpp_date: (new Date()).toLocaleDateString().replace(/\//g, '-')
-//   }
-// })
-const teacherList = $ref([
-  {
-    user_id:'213595',
-    dxp_user_realname: 'lwteacher2',
-    dxp_user_avatar:'https://openapi.dev.bozedu.net/template/default/static/img/avatar_teacher_middle.png',
-    jj: '玉阳中学熊家山校区教导主任,国家二级心理咨询师,高级家庭教育指导师,宜昌市家庭教育讲师团成员,宜昌市E教能手,当阳市优秀教师、师德模范、学科带头人。'
-  },
-])
+const imgSrc = (await request({
+  url: '/dyaw/xlfw_hbgl/index',
+  data: {
+    limit: 1
+  }
+})).data?.page_data?.[0]?.dxh_path
+const teacherList = (await request({
+  url: '/dyaw/xlfw_pbgl_pb/index',
+  data: {
+    dxpp_date: Date.now()
+  }
+})).data?.page_data
+// const teacherList = $ref([
+//   {
+//     user_id: '213595',
+//     dxp_user_realname: 'lwteacher2',
+//     dxp_user_avatar: 'https://openapi.dev.bozedu.net/template/default/static/img/avatar_teacher_middle.png',
+//     "dxp_jj": "我真的是简介",
+//     "dxp_user_phone": "18876564587",
+//   },
+//   {
+//     user_id: '213596',
+//     dxp_user_realname: 'lwteacher3',
+//     dxp_user_avatar: 'https://openapi.dev.bozedu.net/template/default/static/img/avatar_teacher_middle.png',
+//     "dxp_jj": "我真的是简介",
+//     "dxp_user_phone": "18876564587",
+//   },
+// ])
 </script>
 
 <template>
   <div class="h-640px bg-hex-f2f2f295 flex justify-center">
-    <div class="w-1000px h-full"></div>
+    <div class="w-1000px h-full">
+      <img v-show="imgSrc" :src="imgSrc" class="w-full h-full object-contain">
+    </div>
     <div
       class="w-400px h-full overflow-y-auto flex flex-col items-center space-y-4 py-4 scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
       <teacher-card v-for="item in teacherList" class="flex-none" :d="item"></teacher-card>
     </div>
   </div>
 </template>
-
-<style scoped>
-
-</style>

+ 18 - 4
src/pages/teacher/consult.vue

@@ -15,7 +15,9 @@ let timer: NodeJS.Timeout;
   dyaw_xlfw_zxhd_list = (await request({
     url: '/dyaw/xlfw_zxhd/index',
     data: {
-      dxz_tea_user_id: user.user_id
+      dxz_tea_user_id: user.user_id,
+      limit: 20,
+      last_msg: 1
     }
   })).data.page_data
   timer = setTimeout(async () => {
@@ -33,6 +35,7 @@ watch(
         dxz_tea_user_id: user.user_id,
         dxz_stu_user_realname: searchValue,
         limit: 20,
+        last_msg: 1
       }
     })).data.page_data
   }
@@ -91,6 +94,8 @@ function handleClickStuCard(stu: type_dyaw_xlfw_zxhd) {
   cardLoading = true
   dyaw_xlfw_zxhd = stu
   stu.dxz_unread_msg_num = "0"
+  archivesList = []
+
   ws?.close()
   request({
     url: '/dyaw/xlfw_zxhd_log/index',
@@ -108,6 +113,15 @@ function handleClickStuCard(stu: type_dyaw_xlfw_zxhd) {
           message(socketRes: TSocketRes<type_dyaw_xlfw_zxhd_log>) {
             if (socketRes.from_client_name.endsWith('student')) {
               infoList.push(socketRes.content)
+              request({
+                url: '/dyaw/xlfw_zxhd_log/index',
+                data: {
+                  dxzl_stu_user_id: stu.dxz_stu_user_id,
+                  dxzl_tea_user_id: user.user_id,
+                  limit: 0
+                }
+              })
+
             }
           }
         }
@@ -200,7 +214,7 @@ function handleQueryArchives() {
 </script>
 
 <template>
-  <div class="h-640px bg-hex-f2f2f295 flex justify-center divide-x">
+  <div class="h-590px bg-hex-f2f2f295 flex justify-center divide-x">
     <div class="w-320px p-10px h-full flex flex-col justify-start bg-white space-y-4">
       <el-input v-model="searchValue" size="large" :prefix-icon="Search" clearable></el-input>
       <div
@@ -244,7 +258,7 @@ function handleQueryArchives() {
       <div v-if="dyaw_xlfw_zxhd" :key="dyaw_xlfw_zxhd.dxz_stu_user_id">
         <div class="w-full"
           v-if="archivesList && (archivesList.length === 0 || dyaw_xlfw_zxhd.dxz_id !== archivesList[0].dxz_id)">
-          <archives-card ref="ArchivesCardRef"
+          <archives-card storage ref="ArchivesCardRef"
             :d="{ dxz_id: dyaw_xlfw_zxhd.dxz_id, user_id: dyaw_xlfw_zxhd.dxz_stu_user_id, dxxd_lfzxm: dyaw_xlfw_zxhd.dxz_stu_user_realname, dxxd_jfls: dyaw_xlfw_zxhd.dxz_tea_user_realname, dxxd_school_name: dyaw_xlfw_zxhd.dxz_stu_school_name, dxxd_class_name: dyaw_xlfw_zxhd.dxz_class_name, dxxd_date: formatTimestamp(dyaw_xlfw_zxhd.create_dateline) }"></archives-card>
           <div class="flex_center py-2">
             <el-button @click="handleSubmitArchives" type="primary" size="small">提交</el-button>
@@ -252,7 +266,7 @@ function handleQueryArchives() {
         </div>
         <div class="bg-hex-FFF7FA py-2">
           <div class="flex_center text-lg">历史档案</div>
-          <el-empty v-show="archivesList.length === 0" :image-size="60" description="暂无历史档案" ></el-empty>
+          <el-empty v-show="archivesList.length === 0" :image-size="60" description="暂无历史档案"></el-empty>
           <archives-card disabled v-for="item in archivesList" :d="item" :key="item.dxz_id"></archives-card>
         </div>
       </div>

+ 9 - 2
src/pages/teacher/home.vue

@@ -1,9 +1,16 @@
 <script setup lang="ts">
-
+const imgSrc = (await request({
+  url: '/dyaw/xlfw_hbgl/index',
+  data: {
+    limit: 1
+  }
+})).data?.page_data?.[0]?.dxh_path
 </script>
 
 <template>
-  <div class="h-full w-full">home</div>
+  <div class="w-full max-h-590px flex_center">
+    <img v-show="imgSrc" :src="imgSrc" class="w-full h-full object-contain">
+  </div>
 </template>
 
 <style scoped>

+ 17 - 5
src/pages/teacher/index.vue

@@ -1,11 +1,23 @@
 <script setup lang="ts">
+import user from '~/store/user';
 const router = useRouter()
 const route = useRoute()
-const list = [
-  { title: '首页', route: 'teacher_home' },
-  { title: '咨询页面', route: 'teacher_consult' },
-  { title: '学生档案', route: 'teacher_archives' },
-]
+let list = $ref([{ title: '首页', route: 'teacher_home' }]);
+await request({
+  url: '/dyaw/xlfw_pbgl/index',
+  data: {
+    user_id: user.user_id
+  }
+}).then(res => {
+  if (res.code === '1') {
+    if (res.data.page_data?.length === 1) {
+      list.push(
+        { title: '咨询页面', route: 'teacher_consult' },
+        { title: '学生档案', route: 'teacher_archives' })
+    }
+  }
+})
+
 function routerPush(name: string) {
   router.push({ name })
 }

+ 2 - 0
src/utils/request.ts

@@ -29,11 +29,13 @@ instance.interceptors.request.use(
         {
           token,
           client: 'web',
+          site: 'dyaw',
           api: 'json',
           issubmit: (config.url?.endsWith('add') || config.url?.endsWith('edit')) ? '1' : undefined,
         },
         config.data)
     }
+    // console.log('request config :>> ', config);
     return config
   },
   (error) => {

+ 7 - 7
vite.config.ts

@@ -79,12 +79,12 @@ export default defineConfig({
     port: 5230
   },
   build: {
-    rollupOptions: {
-      output: {
-        manualChunks: {
-          axios: ['axios'],
-        },
-      },
-    },
+    // rollupOptions: {
+    //   output: {
+    //     manualChunks: {
+    //       axios: ['axios'],
+    //     },
+    //   },
+    // },
   },
 })