浏览代码

chore(1-30)

bzkf3 2 年之前
父节点
当前提交
66746d4154

+ 2 - 1
package.json

@@ -6,7 +6,8 @@
   "scripts": {
     "dev": "vite --open",
     "dev:t": "vite --port 5300",
-    "dev:s": "vite --port 5301",
+    "dev:s1": "vite --port 5301",
+    "dev:s2": "vite --port 5302",
     "build": "vite build",
     "preview": "vite preview",
     "check": "vue-tsc --noEmit",

+ 89 - 0
src/components/archives-card/index.vue

@@ -0,0 +1,89 @@
+<script setup lang="ts">
+import { type_archives_item } from '~/types';
+
+const props = defineProps<{
+  d: type_archives_item;
+  disabled?: boolean;
+}>()
+console.log('props.d :>> ', props.d);
+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))
+
+defineExpose({
+  form
+})
+</script>
+
+<template>
+  <div class="border border-dark-100 divide-y divide-dark-100 w-full text-xs">
+
+    <div class="flex justify-between items-end">
+      <div class="p-1 text-base font-bold">咨询记录</div>
+      <div class="p-1">{{ form.dxxd_date }}</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_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="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>
+    <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>
+      <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="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>
+
+    <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 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 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 class="p-1">
+      <div>危机等级:</div>
+      <el-radio-group v-model="form.dxxd_wxdj" size="small" :disabled="disabled">
+        <el-radio label="1">一般</el-radio>
+        <el-radio label="2">严重</el-radio>
+        <el-radio label="3">重大</el-radio>
+      </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>
+</template>

+ 8 - 3
src/components/chat-stu-card/index.vue

@@ -18,9 +18,14 @@ const showMsg = $computed(() => {
         <div class="font-medium">{{ d.dxz_stu_user_realname }}</div>
         <div class="opacity-40 text-sm">{{ d.dxz_last_msg_datetime }}</div>
       </div>
-      <div class="flex justify-between">
-        <div class="opacity-40 text-sm text_wrapper max-w-50 h-20px overflow-hidden" v-html="showMsg"></div>
-        <el-tag type="danger" effect="dark" round size="small">{{ d.dxz_unread_msg_num }}</el-tag>
+      <div class="flex justify-between h-20px">
+        <template v-if="d.dxz_last_msg_datetime">
+          <div class="opacity-40 text-sm text_wrapper max-w-50 h-20px overflow-hidden" v-html="showMsg"></div>
+          <el-tag type="danger" effect="dark" round size="small" v-show="Number(d.dxz_unread_msg_num) > 0">{{
+            Number(d.dxz_unread_msg_num) > 99 ? '99+' : d.dxz_unread_msg_num
+          }}</el-tag>
+        </template>
+
       </div>
     </div>
   </div>

+ 2 - 5
src/components/info-item/index.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import type { type_dyaw_xlfw_zxhd_log } from '~/types';
-import { getDatabaseTime } from '~/utils/time';
+import { formatTimestamp } from '~/utils/time';
 const props = defineProps<{
   left: boolean,
   d: type_dyaw_xlfw_zxhd_log
@@ -11,9 +11,6 @@ const id2name = {
   [props.d.dxzl_tea_user_id]: props.d.dxzl_tea_user_realname,
 }
 
-function formatTimestamp(t: string) {
-  return getDatabaseTime(1000 * parseInt(t))
-}
 
 const showMsg = decodeURIComponent(props.d.dxzl_last_msg_content!)
 </script>
@@ -21,7 +18,7 @@ const showMsg = decodeURIComponent(props.d.dxzl_last_msg_content!)
 <template>
   <div class="w-full" :class="left ? 'left' : 'right'">
     <div class="flex items-end r_flex-row-reverse gap-4">
-      <div>{{ id2name[d.create_user_id] }}</div>
+      <div>{{ id2name[d.create_user_id] }} {{ d.dxzl_id }}</div>
       <div class="text-sm text-hex-AFB2B6">{{ formatTimestamp(d.create_dateline) }}</div>
     </div>
     <div class="flex mt-2 r_flex-row-reverse">

+ 62 - 10
src/pages/student/consult.vue

@@ -3,6 +3,7 @@ import type { type_dyaw_xlfw_zxhd, type_dyaw_xlfw_zxhd_log } from '~/types';
 import user from '~/store/user';
 import { createSocket, socketSend } from '~/utils/ws';
 import type { TSocketRes } from '~/utils/ws';
+import { formatTimestamp } from '~/utils/time'
 
 const router = useRouter()
 let teacher
@@ -24,13 +25,40 @@ const dyaw_xlfw_zxhd: type_dyaw_xlfw_zxhd = (await request({
 })).data.one_info
 
 const ChatAudioRef = $ref<typeof import('~/components/chat-audio/index.vue')['default']>()
+let rateDialogVisible = $ref(false)
+let endTime = $ref<string>()
+let rateNum = $ref(5)
 function handleClickEnd() {
   // ChatAudioRef && ChatAudioRef.open()
+  endTime = getDatabaseTime(new Date())
+  rateDialogVisible = true
 }
+function handleConfirmRate() {
+  request({
+    url: '/dyaw/xlfw_zxhd/edit',
+    data: {
+      dxz_id: dyaw_xlfw_zxhd.dxz_id,
+      dyaw_xlfw_zxhd: {
+        dxz_star: rateNum,
+        dxz_star_datetime: endTime,
+        dxz_status: '1'
+      }
+    }
+  }).then(res => {
+    if (res.code === '1') {
+      rateDialogVisible = false
+      router.back()
+    }
+  })
+}
+
 let infoList = $ref<Array<type_dyaw_xlfw_zxhd_log>>([])
 let inputValue = $ref('')
+let isSending = $ref(false)
 let TinyRef = $ref<typeof import('~/components/tinymce-area/index.vue')['default']>()
 async function handleClickSend() {
+  if (isSending) return;
+  isSending = true
   const reqDate = {
     dxz_id: dyaw_xlfw_zxhd.dxz_id,
     dxzl_stu_user_id: dyaw_xlfw_zxhd.dxz_stu_user_id,
@@ -41,12 +69,12 @@ async function handleClickSend() {
     dxzl_type: inputValue.includes('><img') ? '2' : '1'
   }
 
-  infoList.push({
-    create_user_id: user.user_id,
-    create_dateline: Date.now().toString().slice(0, 10),
+  // infoList.push({
+  //   create_user_id: user.user_id,
+  //   create_dateline: Date.now().toString().slice(0, 10),
 
-    ...reqDate
-  })
+  //   ...reqDate
+  // })
   TinyRef?.clear()
   // console.log('inputValue :>> ', inputValue);
   request({
@@ -56,11 +84,15 @@ async function handleClickSend() {
     }
   }).then(res => {
     if (res.code === '1') {
-      socketSend(ws, {
+      const fullSendData = {
         create_user_id: user.user_id,
         create_dateline: Date.now().toString().slice(0, 10),
-        ...reqDate
-      })
+        ...reqDate,
+        dxzl_id: `${res.data.insert_id}`
+      }
+      infoList.push(fullSendData)
+      socketSend(ws, fullSendData)
+      isSending = false
     }
   })
 }
@@ -69,6 +101,7 @@ request({
   url: '/dyaw/xlfw_zxhd_log/index',
   data: {
     dxz_id: dyaw_xlfw_zxhd.dxz_id,
+    limit: 100
   }
 }).then(res => {
   if (res.code === '1') {
@@ -115,8 +148,10 @@ watch(
           @click="handleClickEnd">结束会话</div>
       </div>
       <div ref="scrollbarRef"
-        class="bg-hex-fff8fb space-y-2 h-410px p-6 scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
-        <info-item v-for="item in infoList" :left="item.create_user_id === user.user_id" :d="item"></info-item>
+        class="bg-hex-fff8fb space-y-2 h-410px py-2 px-6 scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
+        <div class="w-full text-center text-sm">{{ formatTimestamp(dyaw_xlfw_zxhd.create_dateline) }} 开始沟通</div>
+        <info-item v-for="item in infoList" :key="item.dxzl_id" :left="item.create_user_id === user.user_id"
+          :d="item"></info-item>
       </div>
       <div class="bg-white h-180px p-5px flex flex-col justify-between">
         <!-- <div class="h-48px"></div>
@@ -137,6 +172,23 @@ watch(
     </div>
   </div>
 
+  <el-dialog v-model="rateDialogVisible" title="请评价" align-center width="405px">
+    <p>于 {{ endTime }} 结束沟通</p>
+    <div class="flex items-center my-4">
+      <div>评价:</div>
+      <el-rate size="large" v-model="rateNum"></el-rate>
+    </div>
+    <template #footer>
+      <div class="flex_center">
+        <el-button round type="primary" @click="handleConfirmRate">
+          确认
+        </el-button>
+        <el-button round @click="rateDialogVisible = false">取消</el-button>
+      </div>
+    </template>
+
+  </el-dialog>
+
   <chat-audio ref="ChatAudioRef"></chat-audio>
 </template>
 

+ 118 - 21
src/pages/teacher/consult.vue

@@ -1,10 +1,11 @@
 <script setup lang="ts">
-import type { type_dyaw_xlfw_zxhd, type_dyaw_xlfw_zxhd_log } from '~/types';
+import type { type_dyaw_xlfw_zxhd, type_dyaw_xlfw_zxhd_log, type_archives_item } from '~/types';
 import { Search } from '@element-plus/icons-vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
 import user from '~/store/user';
 import { createSocket, socketSend } from '~/utils/ws';
 import type { TSocketRes } from '~/utils/ws';
-
+import { formatTimestamp } from '~/utils/time';
 let dyaw_xlfw_zxhd = $ref<type_dyaw_xlfw_zxhd | undefined>()
 let dyaw_xlfw_zxhd_list = $ref<type_dyaw_xlfw_zxhd[] | undefined>()
 
@@ -23,12 +24,28 @@ let timer: NodeJS.Timeout;
 })();
 
 const searchValue = $ref('')
+watch(
+  () => searchValue,
+  async () => {
+    dyaw_xlfw_zxhd_list = (await request({
+      url: '/dyaw/xlfw_zxhd/index',
+      data: {
+        dxz_tea_user_id: user.user_id,
+        dxz_stu_user_realname: searchValue,
+        limit: 20,
+      }
+    })).data.page_data
+  }
+)
 
 let infoList = $ref<Array<type_dyaw_xlfw_zxhd_log>>([])
 let inputValue = $ref('')
+let isSending = $ref(false)
 let TinyRef = $ref<typeof import('~/components/tinymce-area/index.vue')['default']>()
 async function handleClickSend() {
   if (!dyaw_xlfw_zxhd) return;
+  if (isSending) return;
+  isSending = true
   const reqDate = {
     dxz_id: dyaw_xlfw_zxhd.dxz_id,
     dxzl_stu_user_id: dyaw_xlfw_zxhd.dxz_stu_user_id,
@@ -39,12 +56,12 @@ async function handleClickSend() {
     dxzl_type: inputValue.includes('><img') ? '2' : '1'
   }
 
-  infoList.push({
-    create_user_id: user.user_id,
-    create_dateline: Date.now().toString().slice(0, 10),
+  // infoList.push({
+  //   create_user_id: user.user_id,
+  //   create_dateline: Date.now().toString().slice(0, 10),
 
-    ...reqDate
-  })
+  //   ...reqDate
+  // })
   TinyRef?.clear()
   // console.log('inputValue :>> ', inputValue);
   request({
@@ -54,19 +71,24 @@ async function handleClickSend() {
     }
   }).then(res => {
     if (res.code === '1') {
-      socketSend(ws!, {
+      const fullSendData = {
         create_user_id: user.user_id,
         create_dateline: Date.now().toString().slice(0, 10),
-        ...reqDate
-      })
+        ...reqDate,
+        dxzl_id: `${res.data.insert_id}`
+      }
+      infoList.push(fullSendData)
+      socketSend(ws!, fullSendData)
+      isSending = false
     }
   })
 }
 
 let ws = $ref<WebSocket>()
 
-
+let cardLoading = $ref(false)
 function handleClickStuCard(stu: type_dyaw_xlfw_zxhd) {
+  cardLoading = true
   dyaw_xlfw_zxhd = stu
   stu.dxz_unread_msg_num = "0"
   ws?.close()
@@ -79,6 +101,7 @@ function handleClickStuCard(stu: type_dyaw_xlfw_zxhd) {
   }).then(res => {
     if (res.code === '1') {
       infoList = res.data.page_data.reverse()
+      cardLoading = false
       ws = createSocket(
         { teacher: user.user_id, student: stu.dxz_stu_user_id },
         {
@@ -89,9 +112,28 @@ function handleClickStuCard(stu: type_dyaw_xlfw_zxhd) {
           }
         }
       )
+
+      handleQueryArchives()
     }
   })
+}
 
+let ifScroll = $ref(true)
+function handleLoadMoreInfo() {
+  request({
+    url: '/dyaw/xlfw_zxhd_log/index',
+    data: {
+      dxzl_stu_user_id: dyaw_xlfw_zxhd?.dxz_stu_user_id,
+      dxzl_tea_user_id: user.user_id,
+      zxhd_log_id: infoList[0].dxzl_id
+    }
+  }).then(res => {
+    if (res.code === '1') {
+      ifScroll = false
+      if (res.data.page_data.length === 0) return ElMessage.info('暂无更多消息');
+      infoList.unshift(...res.data.page_data.reverse())
+    }
+  })
 }
 
 const scrollbarRef = $ref<HTMLElement>()
@@ -104,7 +146,8 @@ watch(
   () => (infoList),
   () => {
     nextTick(() => {
-      scrollToBottom()
+      ifScroll && scrollToBottom();
+      ifScroll = true
     })
   },
   {
@@ -116,14 +159,52 @@ watch(
 onBeforeUnmount(() => {
   clearInterval(timer)
 })
+
+const ArchivesCardRef = $ref<typeof import('~/components/archives-card/index.vue')['default']>()
+function handleSubmitArchives() {
+  ElMessageBox.confirm('一次咨询只能提交一次档案,请确认完毕后点击提交', '提示')
+    .then(() => {
+      request({
+        url: '/dyaw/xlfw_xsda_dajl/add',
+        data: {
+          dyaw_xlfw_xsda_dajl: ArchivesCardRef!.form
+        }
+      }).then(res => {
+        if (res.code === '1') {
+
+          handleQueryArchives()
+        }
+      })
+    })
+    .catch(() => {
+      ElMessage({
+        type: 'info',
+        message: '取消提交',
+      })
+    })
+}
+
+let archivesList = $ref<type_archives_item[]>([])
+function handleQueryArchives() {
+  request({
+    url: '/dyaw/xlfw_xsda_dajl/index',
+    data: {
+      user_id: dyaw_xlfw_zxhd!.dxz_stu_user_id
+    }
+  }).then(res => {
+    if (res.code === '1') {
+      archivesList = res.data.page_data
+    }
+  })
+}
 </script>
 
 <template>
   <div class="h-640px bg-hex-f2f2f295 flex justify-center divide-x">
-    <div class="w-320px p-10px h-full flex flex-col justify-between bg-white">
-      <el-input v-model="searchValue" size="large" :prefix-icon="Search"></el-input>
+    <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
-        class="h-580px flex flex-col  divide scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
+        class="max-h-520px flex flex-col flex-none divide-y scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
         <chat-stu-card v-for="item in dyaw_xlfw_zxhd_list" :d="item" @click="handleClickStuCard(item)"
           class="h-68px"></chat-stu-card>
       </div>
@@ -135,8 +216,12 @@ onBeforeUnmount(() => {
             {{ dyaw_xlfw_zxhd.dxz_stu_school_name }} {{ dyaw_xlfw_zxhd.dxz_class_name }}</span>
         </div>
         <div ref="scrollbarRef"
-          class="bg-hex-fff8fb space-y-2 h-410px p-6 scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
-          <info-item v-for="item in infoList" :left="item.create_user_id === user.user_id" :d="item"></info-item>
+          class="bg-hex-fff8fb space-y-2 h-410px py-2 px-6 scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
+          <div v-show="!cardLoading" @click="handleLoadMoreInfo"
+            class="w-full text-center text-sm text-blue-400 hover:underline underline-blue-400 cursor-pointer">查看更多
+          </div>
+          <info-item v-for="item in infoList" :key="item.dxzl_id" :left="item.create_user_id === user.user_id"
+            :d="item"></info-item>
         </div>
         <div class="bg-white h-180px p-5px flex flex-col justify-between">
           <tinymce-area v-model="inputValue" ref="TinyRef"></tinymce-area>
@@ -155,11 +240,23 @@ onBeforeUnmount(() => {
 
     </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 bg-white overflow-y-auto flex flex-col items-center px-2 py-2 divide-y scrollbar scrollbar-thin scrollbar-thumb-rounded-md scrollbar-thumb-gray-200 scrollbar-track-transparent">
+      <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"
+            :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>
+          </div>
+        </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>
+          <archives-card disabled v-for="item in archivesList" :d="item" :key="item.dxz_id"></archives-card>
+        </div>
       </div>
+
     </div>
   </div>
 

+ 2 - 337
src/store/user.ts

@@ -1,346 +1,11 @@
 import { IUser } from './user.d';
 // #ifdef DEV
+import dictionary from './user.store';
 console.log('port :>> ', location.port);
 localStorage.setItem(
   "userInfo",
   JSON.stringify(
-    location.port === '5301'
-      ? {
-        "user_id": "213496",
-        "user_name": "liwen1",
-        "email": "无",
-        "lastlogintime": "2023-01-05 16:37:30",
-        "regdate": "2020-03-12 10:08:37",
-        "status": "0",
-        "user_role_id": "76",
-        "user_role_name": "学生",
-        "user_avatar": {
-          "big": "https://oss.dev.bozedu.net/data/upload/month_202102/202102031348306166_L37a.png",
-          "middle": "https://oss.dev.bozedu.net/data/upload/month_202102/202102031348306166_L37a.png",
-          "small": "https://oss.dev.bozedu.net/data/upload/month_202102/202102031348306166_L37a.png"
-        },
-        "user_no": {
-          "no_title": "学号",
-          "no": "267213496"
-        },
-        "token": "eadaFJCOVPVbii9VfCFZwUpmsFdARjFH1_avjALFWPApRhpACHXrKHTrrUzY8rpYFH9g9d7JLN6qDQv5xdmaiTkgZYRw",
-        "user_realname": "李文1",
-        "user_phone": "15645654234",
-        "idcard": "",
-        "gender": "1",
-        "gender_char": "男",
-        "qq": "无",
-        "nationality": "汉族",
-        "address": "江苏省苏州市",
-        "education": "大专",
-        "area_info": {
-          "area_id1": "10",
-          "area_id2": "166",
-          "area_id3": "2074",
-          "area_id4": "14296",
-          "area_id1_char": "江苏省",
-          "area_id2_char": "苏州市",
-          "area_id3_char": "相城区",
-          "area_id4_char": "元和街道",
-          "area_code1": "320000000000",
-          "area_code2": "320500000000",
-          "area_code3": "320507000000",
-          "area_code4": "",
-          "area_code_dist": "320507000000"
-        },
-        "sm_info": {
-          "sm_id": "267",
-          "adminid": "155033",
-          "sm_name": "博智测试学校",
-          "is_org": "0",
-          "up_org": "381",
-          "area_id1": "10",
-          "area_id2": "166",
-          "area_id3": "2074",
-          "area_id4": "14296",
-          "major_mode": "1",
-          "powers": {
-            "vip_shiti": "0",
-            "vip_sucai": "1",
-            "vip_aicheck": "1"
-          }
-        },
-        "cm_info": [
-          {
-            "cm_id": "5768",
-            "sm_id": "267",
-            "pre": "zj",
-            "cm_name": "中职一(1)班",
-            "grade": "17",
-            "gradeClass": "1",
-            "major_id": "77",
-            "creatorid": "213495",
-            "subjectid": "0",
-            "is_manage": 0,
-            "major_name": "汉语言文学11",
-            "grade_name": "中职一",
-            "subject_name": "",
-            "sm_name": "博智测试学校"
-          }
-        ],
-        "first_cm_id": "5768",
-        "first_cm_name": "汉语言文学11zj中职一(1)班",
-        "related_desc": "中职一",
-        "bind3rd": {
-          "wechat": "1"
-        },
-        "my_org": [],
-        "org_info": {
-          "org": null,
-          "org_id": null,
-          "telephone": "",
-          "telephone_short": "",
-          "is_org": "1",
-          "up_org": null,
-          "up_org_name": null,
-          "up_org_info": {
-            "sm_id": "",
-            "sm_name": ""
-          }
-        },
-        "pan": {
-          "unit": "G",
-          "size": "0",
-          "used": "0.00",
-          "desc": "无限制"
-        },
-        "safe_tips": [
-          "您的密码安全程度较低,请立即修改",
-          "必须包含数字、字母大小写或者特殊字符,长度8位及以上"
-        ],
-        "update_center": "https://openapi.dev.bozedu.net",
-        "base_url": {
-          "aboutus": "https://openapi.dev.bozedu.net/aboutus",
-          "file": "https://openapi.dev.bozedu.net",
-          "vpn": "http://vpn.dev.bozedu.net",
-          "uc": "https://uc.dev.bozedu.net",
-          "yzy": "https://yzy.dev.bozedu.net",
-          "kzkt": "https://kzkt.dev.bozedu.net",
-          "openapi": "https://openapi.dev.bozedu.net",
-          "site_zhkt_api": "http://120.26.51.195:8008",
-          "yxxt": "https://yxxt.dev.bozedu.net"
-        },
-        "role_system": [
-          {
-            "code": "kzkt",
-            "name": "空中课堂",
-            "icon": "",
-            "cate": "1",
-            "type": "1",
-            "url": "https://kzkt.dev.bozedu.net"
-          },
-          {
-            "code": "yzy",
-            "name": "作业系统",
-            "icon": "",
-            "cate": "1",
-            "type": "1",
-            "url": "https://yzy.dev.bozedu.net"
-          },
-          {
-            "code": "zhkt",
-            "name": "智慧课堂",
-            "icon": "",
-            "cate": "1",
-            "type": "2",
-            "url": "http://120.26.51.195:8008/desadmin.php"
-          }
-        ],
-        "user_score": "1279",
-        "product": [
-          "课堂",
-          "直播",
-          "作业"
-        ],
-        "app_url": {
-          "A119": "https://qqyxt.m.dev.bozedu.net/page/course/tskc_more.html",
-          "A120": "https://qqyxt.m.dev.bozedu.net/page/my/msg_hybrid.html?id=31",
-          "A121": "https://qqyxt.m.dev.bozedu.net/page/parent/msg.html",
-          "A122": "https://qqyxt.m.dev.bozedu.net/page/my/integral_hybrid.html",
-          "A123": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html",
-          "A124": "https://qqyxt.m.dev.bozedu.net/page/my/footPrint.html",
-          "A125": "https://qqyxt.m.dev.bozedu.net/page/my/intergralMall.html",
-          "A126": "https://openapi.dev.bozedu.net/component/ebook_main/public",
-          "A127": "https://qqyxt.m.dev.bozedu.net/Course_registration/transfer.html?v=1",
-          "A128": "https://qqyxt.m.dev.bozedu.net/Course_registration/transfer.html?type=course_after_service",
-          "A129": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html?tab=1",
-          "A130": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html?tab=2",
-          "A131": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html?tab=3",
-          "A132": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html?tab=4"
-        },
-        "cpm_access_level": "6"
-      }
-      : {
-        "user_id": "213595",
-        "user_name": "lwteacher2",
-        "email": "",
-        "lastlogintime": "2023-01-10 16:11:17",
-        "regdate": "2020-05-29 16:49:02",
-        "status": "0",
-        "user_role_id": "75",
-        "user_role_name": "学校教师",
-        "user_avatar": {
-          "big": "https://openapi.dev.bozedu.net/template/default/static/img/avatar_teacher_big.png",
-          "middle": "https://openapi.dev.bozedu.net/template/default/static/img/avatar_teacher_middle.png",
-          "small": "https://openapi.dev.bozedu.net/template/default/static/img/avatar_teacher_small.png"
-        },
-        "user_no": {
-          "no_title": "工号",
-          "no": ""
-        },
-        "token": "37d3bcvYioCF7ecm6oq_aj2HuNqUPPzgBwcqN2hXjjSYwvH4ERyRKcvQNrwKUMZvraihJt1y1CBer92_aQ7MGjufoof4E",
-        "user_realname": "lwteacher2",
-        "user_phone": "",
-        "idcard": "",
-        "gender": "1",
-        "gender_char": "男",
-        "qq": "",
-        "nationality": "",
-        "address": "",
-        "education": "",
-        "area_info": {
-          "area_id1": "10",
-          "area_id2": "166",
-          "area_id3": "2074",
-          "area_id4": "14296",
-          "area_id1_char": "江苏省",
-          "area_id2_char": "苏州市",
-          "area_id3_char": "相城区",
-          "area_id4_char": "元和街道",
-          "area_code1": "320000000000",
-          "area_code2": "320500000000",
-          "area_code3": "320507000000",
-          "area_code4": "",
-          "area_code_dist": "320507000000"
-        },
-        "sm_info": {
-          "sm_id": "267",
-          "adminid": "155033",
-          "sm_name": "博智测试学校",
-          "is_org": "0",
-          "up_org": "381",
-          "area_id1": "10",
-          "area_id2": "166",
-          "area_id3": "2074",
-          "area_id4": "14296",
-          "major_mode": "1",
-          "powers": {
-            "vip_shiti": "0",
-            "vip_sucai": "1",
-            "vip_aicheck": "1"
-          }
-        },
-        "cm_info": [],
-        "first_cm_id": "",
-        "first_cm_name": "",
-        "renke_grade": [
-          {
-            "grade": "17",
-            "subject": "1",
-            "grade_char": "中职一",
-            "subject_char": "语文"
-          }
-        ],
-        "renke_subject": {
-          "1": {
-            "subject": "1",
-            "subject_char": "语文"
-          }
-        },
-        "related_desc": "语文",
-        "bind3rd": {
-          "wechat": "0"
-        },
-        "my_org": [],
-        "org_info": {
-          "org": null,
-          "org_id": null,
-          "telephone": "",
-          "telephone_short": "",
-          "is_org": "1",
-          "up_org": null,
-          "up_org_name": null,
-          "up_org_info": {
-            "sm_id": "",
-            "sm_name": ""
-          }
-        },
-        "pan": {
-          "unit": "G",
-          "size": "0",
-          "used": "0.00",
-          "desc": "无限制"
-        },
-        "safe_tips": [
-          "您的密码安全程度较低,请立即修改",
-          "必须包含数字、字母大小写或者特殊字符,长度8位及以上"
-        ],
-        "update_center": "https://openapi.dev.bozedu.net",
-        "base_url": {
-          "aboutus": "https://openapi.dev.bozedu.net/aboutus",
-          "file": "https://openapi.dev.bozedu.net",
-          "vpn": "http://vpn.dev.bozedu.net",
-          "uc": "https://uc.dev.bozedu.net",
-          "yzy": "https://yzy.dev.bozedu.net",
-          "kzkt": "https://kzkt.dev.bozedu.net",
-          "openapi": "https://openapi.dev.bozedu.net",
-          "site_zhkt_api": "http://120.26.51.195:8008"
-        },
-        "role_system": [
-          {
-            "code": "kzkt",
-            "name": "空中课堂",
-            "icon": "",
-            "cate": "1",
-            "type": "1",
-            "url": "https://kzkt.dev.bozedu.net"
-          },
-          {
-            "code": "yzy",
-            "name": "作业系统",
-            "icon": "",
-            "cate": "1",
-            "type": "1",
-            "url": "https://yzy.dev.bozedu.net"
-          },
-          {
-            "code": "zhkt",
-            "name": "智慧课堂",
-            "icon": "",
-            "cate": "1",
-            "type": "2",
-            "url": "http://120.26.51.195:8008/stuadmin.php"
-          }
-        ],
-        "user_score": "70",
-        "product": [
-          "课堂",
-          "直播",
-          "作业"
-        ],
-        "app_url": {
-          "A119": "https://qqyxt.m.dev.bozedu.net/page/course/tskc_more.html",
-          "A120": "https://qqyxt.m.dev.bozedu.net/page/my/msg_hybrid.html?id=31",
-          "A121": "https://qqyxt.m.dev.bozedu.net/page/parent/msg.html",
-          "A122": "https://qqyxt.m.dev.bozedu.net/page/my/integral_hybrid.html",
-          "A123": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html",
-          "A124": "https://qqyxt.m.dev.bozedu.net/page/my/footPrint.html",
-          "A125": "https://qqyxt.m.dev.bozedu.net/page/my/intergralMall.html",
-          "A126": "https://openapi.dev.bozedu.net/component/ebook_main/public",
-          "A127": "https://qqyxt.m.dev.bozedu.net/Course_registration/transfer.html?v=1",
-          "A128": "https://qqyxt.m.dev.bozedu.net/Course_registration/transfer.html?type=course_after_service",
-          "A129": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html?tab=1",
-          "A130": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html?tab=2",
-          "A131": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html?tab=3",
-          "A132": "https://qqyxt.m.dev.bozedu.net/ktfx/xqbg.html?tab=4"
-        },
-        "cpm_access_level": "5"
-      }
+    dictionary[location.port]
   )
 )
 // #endif

+ 20 - 0
src/types.ts

@@ -12,10 +12,13 @@ export type type_dyaw_xlfw_zxhd = {
   dxz_stu_school_name: string;
   dxz_class_name: string;
   dxz_id: string;
+  create_user_id: string;
+  create_dateline: string;
 }
 
 
 export type type_dyaw_xlfw_zxhd_log = {
+  dxzl_id?:string;
   dxz_id: string;
   dxzl_stu_user_id: string;
   dxzl_stu_user_realname: string;
@@ -26,3 +29,20 @@ export type type_dyaw_xlfw_zxhd_log = {
   create_user_id: string;
   create_dateline: string
 }
+
+export type type_archives_item = {
+  dxz_id: string,
+  user_id: string;
+  dxxd_date?: string;
+  dxxd_lfzxm: string;
+  dxxd_school_name?: string;
+  dxxd_class_name?: string;
+  dxxd_jfls: string;
+  dxxd_address?: string;
+  dxxd_phone?: string;
+  dxxd_zxyy?: string;
+  dxxd_lfzzs?: string;
+  dxxd_clfs?: string;
+  dxxd_wxdj?: string;
+  dxxd_cbfx?: string;
+}

+ 4 - 0
src/utils/time.ts

@@ -2,6 +2,10 @@ export function getDatabaseTime(t: string | number | Date) {
   return formatDate2String(new Date(t))
 }
 
+export function formatTimestamp(t: string) {
+  return getDatabaseTime(1000 * parseInt(t))
+}
+
 export function formatDate2String(d: Date) {
   return d.toLocaleString().replace(/\//g, '-')
 }