Selaa lähdekoodia

账号管理模式修改

kyoyue 7 kuukautta sitten
vanhempi
commit
a38e98e1ec

+ 1 - 1
index.html

@@ -133,7 +133,7 @@
       </style>
       <div class="app-loading">
         <div class="app-loading-wrap">
-          <img src="/resource/img/logo.png" class="app-loading-logo" alt="Logo" />
+          <img src="/resource/img/gooki.ico" class="app-loading-logo" alt="Logo" />
           <div class="app-loading-dots">
             <span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
           </div>

BIN
public/resource/img/gooki.ico


+ 1 - 0
src/api/model/baseModel.ts

@@ -46,6 +46,7 @@ export interface BaseNodeReq{
 
 export interface BaseIDsReq {
   ids: number[];
+  departmentName: string;
 }
 
 export interface BaseUUIDReq {

BIN
src/assets/images/record.png


+ 3 - 2
src/components/Application/src/AppLogo.vue

@@ -41,8 +41,9 @@
   });
   const title = ref('');
   onMounted(async () => {
-     let res = await getSysInfo()
-     title.value = res.data.departmentName
+    let res = await getSysInfo();
+    title.value = res.data.departmentName;
+    localStorage.setItem('departmentName', res.data.departmentName);
      document.title = title.value;
   }) 
   const { prefixCls } = useDesign('app-logo');

+ 28 - 14
src/components/SimpleMenu/src/SimpleMenu.vue

@@ -7,20 +7,34 @@
     :activeSubMenuNames="activeSubMenuNames"
     @select="handleSelect"
   >
-  <!-- <div class="switch" v-show="!collapse">
-    <div class="switch__text">
-      <span class="switch__text__span" :style="{ opacity: isScrm == 'SCRM' ? 0 : 1 }" @click="toggleSwitch('SCRM')">SCRM</span>
-      <span class="switch__text__span" :style="{ opacity: isScrm == 'CHAT' ? 0 : 1, width: '92px' }" @click="toggleSwitch('CHAT')">聚合聊天</span>
-      <div class="switch__slider" :style="{ left: isScrm == 'SCRM' ? '6px' : '92px' }">{{ isScrm == 'SCRM' ? 'SCRM' : '聚合聊天' }}</div>
-    </div>
-  </div> -->
+    <!-- <div class="switch" v-show="!collapse">
+      <div class="switch__text">
+        <span
+          class="switch__text__span"
+          :style="{ opacity: isScrm == 'SCRM' ? 0 : 1 }"
+          @click="toggleSwitch('SCRM')"
+        >
+          SCRM
+        </span>
+        <span
+          class="switch__text__span"
+          :style="{ opacity: isScrm == 'CHAT' ? 0 : 1, width: '92px' }"
+          @click="toggleSwitch('CHAT')"
+        >
+          聚合聊天
+        </span>
+        <div class="switch__slider" :style="{ left: isScrm == 'SCRM' ? '6px' : '92px' }">
+          {{ isScrm == 'SCRM' ? 'SCRM' : '聚合聊天' }}
+        </div>
+      </div>
+    </div> -->
     <template v-for="item in items" :key="item.path">
       <SimpleSubMenu
         :item="item"
         :parent="true"
         :collapsedShowTitle="collapsedShowTitle"
         :collapse="collapse"
-        style="display: flex;flex-wrap: wrap;"
+        style="display: flex; flex-wrap: wrap"
       />
     </template>
   </Menu>
@@ -40,8 +54,8 @@
   import { isFunction, isHttpUrl } from '@/utils/is';
   import { openWindow } from '@/utils';
 
-  import { useGo } from "/@/hooks/web/usePage";
-import { PageEnum } from '@/enums/pageEnum';
+  import { useGo } from '/@/hooks/web/usePage';
+  import { PageEnum } from '@/enums/pageEnum';
   import { useOpenKeys } from './useOpenKeys';
 
   export default defineComponent({
@@ -115,14 +129,14 @@ import { PageEnum } from '@/enums/pageEnum';
         { flush: 'post' },
       );
 
-      function toggleSwitch(value){
+      function toggleSwitch(value) {
         isScrm.value = value;
         if (value == 'SCRM') {
           go(PageEnum.BASE_HOME);
         } else {
-          go(PageEnum.WECHAT_MAIN)
+          go(PageEnum.WECHAT_MAIN);
         }
-      };
+      }
       listenerRouteChange((route) => {
         if (route.name === REDIRECT_NAME) return;
 
@@ -180,7 +194,7 @@ import { PageEnum } from '@/enums/pageEnum';
 <style lang="less">
   @import url('./index.less');
   .switch {
-    margin:10px auto;
+    margin: 10px auto;
     height: 40px;
     border-radius: 50px;
     background: #f2f2f2;

+ 4 - 3
src/views/dashboard/workbench/components/WorkbenchHeader.vue

@@ -2,7 +2,7 @@
   <div class="lg:flex">
     <Avatar :src="userinfo.avatar || headerImg" :size="72" class="!mx-auto !block" />
     <div class="md:ml-6 flex flex-col justify-center md:mt-0 mt-2">
-      <h1 class="md:text-lg text-md bench-header">{{ '欢迎使用' +  title}}</h1>
+      <h1 class="md:text-lg text-md bench-header">{{ '欢迎使用  ' +  title}}</h1>
       <!-- <span class="text-secondary"> 今日晴,20℃ - 32℃! </span> -->
     </div>
     <div class="flex flex-1 justify-end md:mt-0 mt-4">
@@ -35,8 +35,9 @@
   const userinfo = computed(() => userStore.getUserInfo);
   const title = ref('')
   onMounted(async () => {
-     let res = await getSysInfo()
-     title.value = res.data.departmentName
+    //  let res = await getSysInfo()
+    //  title.value = res.data.departmentName
+   title.value = localStorage.getItem('departmentName');
   }) 
 </script>
 

+ 154 - 25
src/views/wechat/wechat_main/components/split_wrapper.vue

@@ -30,7 +30,7 @@
       <!-- 聊天对话区域 -->
       <div class="room-container-body">
         <div v-show="false" class="chat-roomings-tip-box">
-          <span style="color: #307ef2;font-size14px;">当前用户正在被人工接待...</span>
+          <span style="color: #307ef2, font-size14px">当前用户正在被人工接待...</span>
           <Button class="chat-roomings-tip-btn" size="small">自动回复</Button>
         </div>
         <div v-show="false" class="room-container-body-messages">
@@ -45,36 +45,100 @@
       <div class="chat-roomings__message">
         <div class="send-message">
           <div class="editor">
+            <!-- 聊天框上部表情区域 -->
             <div class="header">
               <div class="left-part">
-                <div class="img-emo"></div>
+                <div class="img-emoji"></div>
                 <div class="img-file"></div>
                 <div class="img-link"></div>
                 <div class="img-text"></div>
-                <!-- <SmileOutlined />
-                <FolderOutlined />
-                <LayoutOutlined /> -->
               </div>
-              <div class="right-part"></div>
+              <div class="right-part" @click="handleShowHistory">
+                <div class="img-record"></div>
+                <div style="font-size: 14px; color: #666">聊天记录</div>
+              </div>
+            </div>
+            <!-- 聊天框中部输入内容区域 -->
+            <!-- @focus="handleFocus"
+            @blur="handleBlur" -->
+            <Textarea
+              class="textarea"
+              v-model:value="area.content"
+              :rows="8"
+              :maxlength="1000"
+              placeholder="在这里输入文字"
+            ></Textarea>
+            <!-- 底部区域 -->
+            <div class="footer">
+              <span>按下ctrl+enter换行</span>
+              <Button size="small" type="primary" class="send-msg">发送</Button>
             </div>
           </div>
         </div>
       </div>
     </div>
   </div>
+  <!-- 聊天记录弹窗 -->
+  <Modal
+    width="550px"
+    v-model:open="visible"
+    title="的聊天记录(99)"
+    @ok="handleConfigOk"
+    @cancel="handleConfigCancel"
+    class="custom-modal"
+  >
+    <Input placeholder="搜索文件" v-model="searchQuery" @input="filterFiles" />
+    <List item-layout="horizontal" :dataSource="filteredFiles" bordered>
+      <template #item="{ item }">
+        <ListItem>
+          <ListItemMeta :title="item.title" :description="`最后修改日期:${item.date}`" />
+          <div>{{ emoji(item.status) }}</div>
+        </ListItem>
+      </template>
+    </List>
+  </Modal>
 </template>
 
 <script lang="ts" setup>
-  import { onMounted, ref, reactive } from 'vue';
+  import { onMounted, ref, reactive,computed } from 'vue';
   import Split from 'split.js';
-  import { Popover, Switch, Badge, Button } from 'ant-design-vue';
-  import { EllipsisOutlined, FileSearchOutlined, LoadingOutlined ,SmileOutlined,FolderOutlined,LayoutOutlined} from '@ant-design/icons-vue';
+  import {
+    Popover,
+    Switch,
+    Badge,
+    Button,
+    Textarea,
+    Modal,
+    ListItem,
+    List,
+    Input,
+    ListItemMeta,
+  } from 'ant-design-vue';
+  import { EllipsisOutlined, FileSearchOutlined, LoadingOutlined } from '@ant-design/icons-vue';
+
+  import { useDebounce } from '@vueuse/core';
+  const visible = ref(false);
+  const searchQuery = ref('');
+  const debouncedSearchQuery = useDebounce(searchQuery, 300);
 
+  const filteredFiles = computed(() => {
+    if (!debouncedSearchQuery.value) {
+      return files.value;
+    }
+    return files.value.filter((file) => file.title.includes(debouncedSearchQuery.value));
+  });
   const splitContainer = ref(null);
   const state = reactive({
     aiChecked: true,
   });
-
+  const area = reactive({
+    content: '',
+  });
+  const files = ref([
+    { title: '北京市场报告.doc', status: '😄', date: '2024/07/24' },
+    { title: '上海市场报告.doc', status: '😞', date: '2024/07/24' },
+    // 更多文件...
+  ]);
   onMounted(() => {
     Split([splitContainer.value.children[0], splitContainer.value.children[1]], {
       sizes: [55, 45], // 初始高度百分比
@@ -89,6 +153,19 @@
       },
     });
   });
+  function handleShowHistory() {
+    visible.value = true;
+    console.log('show history');
+  }
+  function handleConfigOk() {
+    console.log('config ok');
+  }
+  function handleConfigCancel() {
+    console.log('config cancel');
+  }
+  const emoji = (status: string) => {
+  return status;
+};
 </script>
 
 <style scoped lang="less">
@@ -99,17 +176,9 @@
   }
 
   .panel {
-    overflow: auto;
+    // overflow: auto;
+    overflow: hidden;
     background-color: #fcfcfc;
-    // padding: 16px;
-  }
-
-  .top-panel {
-    // border-bottom: 1px solid #d9d9d9;
-  }
-
-  .bottom-panel {
-    // border-top: 1px solid #d9d9d9;
   }
 
   ::v-deep .gutter {
@@ -250,10 +319,10 @@
     height: 100%;
     background: #fcfcfc;
   }
-  .editor{
+  .editor {
     position: static;
   }
-  .header{
+  .header {
     display: flex;
     justify-content: space-between;
     align-items: flex-start;
@@ -261,14 +330,74 @@
     background: #fcfcfc;
     margin-top: 15px;
   }
-  .left-part{
+  .left-part {
+    display: flex;
+    cursor: pointer;
+  }
+  .img-emoji {
+    width: 18px;
+    height: 18px;
+    background-size: 100% 100%;
+    margin: 0 10px;
+    background-image: url('@/assets/images/emoj.png');
+  }
+  .img-file {
+    width: 18px;
+    height: 18px;
+    background-size: 100% 100%;
+    margin: 0 10px;
+    background-image: url('@/assets/images/file.png');
+  }
+  .img-link {
+    width: 18px;
+    height: 18px;
+    background-size: 100% 100%;
+    margin: 0 10px;
+    background-image: url('@/assets/images/link.png');
+  }
+  .img-text {
+    width: 18px;
+    height: 18px;
+    background-size: 100% 100%;
+    margin: 0 10px;
+    background-image: url('@/assets/images/text.png');
+  }
+  .right-part {
     display: flex;
+    cursor: pointer;
   }
-  .img-emo{
+  .img-record {
     width: 18px;
     height: 18px;
     background-size: contain;
     margin: 0 10px;
-    background-image: url('@/assets/images/icon-emoji.png');
+    background-size: 100% 100%;
+    background-image: url('@/assets/images/record.png');
+  }
+  ::v-deep .ant-input {
+    border: none;
+    border-radius: 0px;
+    background: #f8f8f8 !important;
+  }
+  .footer {
+    position: absolute;
+    bottom: 115px;
+    right: 0;
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    padding-right: 16px;
+    background: #fcfcfc;
+  }
+  .footer span {
+    font-size: 12px;
+    color: #999;
+    display: inline-block;
+    margin-right: 12px;
+  }
+  .send-msg {
+    color: #fff;
+    background-color: #98bff9;
+    border-color: #98bff9;
   }
 </style>

+ 3 - 11
src/views/wechat/wx/WxDrawer.vue

@@ -55,7 +55,6 @@
       let modalContent = ref('');
       const modeList = ref([]);
       const drawerTitle = ref('');
-      let recordAgentId = ref(undefined);
 
       let recordId = ref(undefined);
       const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
@@ -93,12 +92,11 @@
         isUpdate.value = !!data?.isUpdate;
 
         if (unref(isUpdate)) {
-          recordAgentId.value = data?.record?.agentId;
 
           recordId.value = data?.record?.id;
           const formValues = {
             ...data.record,
-            mode: data.record.agentInfo.name, // 确保正确提取和映射值
+            mode: data.record.agentInfo.id ?? 0,
           };
 
           setFieldsValue(formValues);
@@ -118,13 +116,8 @@
 
       async function handleSuccess() {
         const values = await validate();
-        console.log(values)
-        let agentId;
-        if (values.mode === 0) {
-           agentId = 0;
-        } else {
-           agentId = recordAgentId.value;
-        }
+        console.log(values,)
+        let agentId = values.mode;
         const { callback, serverId, port } = values;
         const id = recordId.value;
         let res = await updateWx({ callback, serverId, port, agentId, id });
@@ -181,7 +174,6 @@
         handleSuccess,
         handleCancel,
         modeList,
-        recordAgentId,
         recordId,
       };
     },

+ 5 - 1
src/views/wechat/wx/wx.data.ts

@@ -159,7 +159,11 @@ export const formSchema: FormSchema[] = [
           id: 0,
           name: '知识库',
         };
-        return [fixedOption, ...response.data.data];
+        const processedData = response.data.data.map(item => ({
+          id: item.id ?? 0,
+          name: item.name || '知识库', // 如果 name 为 null,使用 '知识库'
+        }));
+        return [fixedOption, ...processedData];
       },
       resultField: '', // 因为我们直接在 API 中返回处理过的数据,所以这里可以设置为空字符串
       labelField: 'name',