Răsfoiți Sursa

Merge branch 'ch/eta_forum_3.0' of eta_forum/eta_forum_front into debug

leichen 3 săptămâni în urmă
părinte
comite
32cb46cc8d

+ 1 - 1
README.md

@@ -1,3 +1,3 @@
-# ETA社区项目
+# ETA投研资源库项目
 1. 测试访问地址:http://8.136.199.33:8901/
 

+ 1 - 1
index.html

@@ -4,7 +4,7 @@
     <meta charset="UTF-8" />
     <link rel="icon" type="image/x-icon" href="/fa.ico" id="icon"/>
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>ETA社区</title>
+    <title>ETA投研资源库 </title>
   </head>
   <body>
     <div id="app"></div>

+ 1 - 1
package.json

@@ -20,7 +20,7 @@
     "moment": "^2.30.1",
     "normalize.css": "^8.0.1",
     "tdesign-icons-vue-next": "^0.2.2",
-    "tdesign-vue-next": "^1.10.6",
+    "tdesign-vue-next": "^1.10.7",
     "vue": "^3.5.13",
     "vue-router": "^4.3.2"
   },

BIN
src/assets/imgs/logo.png


BIN
src/assets/imgs/logo_login.png


+ 6 - 3
src/layout/Index.vue

@@ -35,9 +35,9 @@ async function handleLoginOut(){
 								<span>|</span>
 								<span>{{userInfo?.Mobile}}</span>
 							</div>
-							<div class="flex">
+							<div class="business-name">
 								<span>{{userInfo?.BusinessName}}</span>
-								<span>|</span>
+								<span v-if="userInfo?.Position">|</span>
 								<span>{{userInfo?.Position}}</span>
 							</div>
 						</div>
@@ -68,7 +68,7 @@ async function handleLoginOut(){
 <style lang="scss">
 .header-userInfo-pop-wrap{
 	padding: 0;
-	width: 234px;
+	width: 300px;
 	border-radius: 8px;
 	border: 1px solid var(--border-color);
 	box-shadow: 0px 4px 12px 0px #0000001A;
@@ -86,6 +86,9 @@ async function handleLoginOut(){
 				gap: 0 5px;
 				margin-top: 5px;
 			}
+			.business-name > *  {
+				padding-right: 10px;
+			}
 		}
 		.my-fav-box{
 			border-bottom: 1px solid var(--border-color);

+ 1 - 1
src/router/index.js

@@ -20,7 +20,7 @@ const routes = [
     name:'Login',
     component:()=>import('@/views/Login.vue'),
     meta:{
-      title:'ETA社区'
+      title:'ETA投研资源库'
     },
   },
   {

+ 1 - 1
src/views/Login.vue

@@ -162,7 +162,7 @@ async function handleMobileVerifyCode(){
 					<t-button class="submit-btn" block shape="round" type="submit">登录</t-button>
 
         </t-form>
-				<p class="bottom-tips">共享社区资源,共创市场领先</p>
+				<p class="bottom-tips">共享投研资源,共创市场领先</p>
       </div>
     </div>
   </div>

+ 2 - 2
src/views/etaChart/Index.vue

@@ -84,7 +84,7 @@ function handleSelectChart(item) {
     <ClassifyWrap @filter="handleFilterList" @change="handleSelectChart" />
     <div class="center-wrap">
     <svg-icon name="show_arrow" class="show_chart_name_wrap_btn" v-if="!showChartNameWrap" @click="showChartNameWrap=true"></svg-icon>
-    <div :class="['flex chart-name-list-wrap',!showChartNameWrap?'chart-name-list-wrap_close':'']" v-loading="tableLoading">
+    <!-- <div :class="['flex chart-name-list-wrap',!showChartNameWrap?'chart-name-list-wrap_close':'']" v-loading="tableLoading">
       <div class="flex top-box">
         <span>所选图表</span>
         <t-icon name="chevron-left-double" style="font-size:20px;cursor: pointer;" @click="showChartNameWrap=false"></t-icon>
@@ -102,7 +102,7 @@ function handleSelectChart(item) {
         <span>共{{chartTotal}}张图表</span>
         <span class="clear-btn" @click="activeChartId=''">清除选择</span>
       </div>
-    </div>
+    </div> -->
     </div>
     <div class="right-wrap">
       <ChartList ref="chartListRef"/>

+ 69 - 37
src/views/etaChart/components/ClassifyWrap.vue

@@ -1,5 +1,5 @@
 <script setup>
-import { reactive, ref, watch } from 'vue'
+import { nextTick, reactive, ref, watch } from 'vue'
 import { SearchIcon, Icon } from 'tdesign-icons-vue-next';
 import { apiETAChart } from '@/api/etaChart'
 import { apiSystemCommon } from '@/api/system'
@@ -8,15 +8,12 @@ import { useClassify } from '../hooks/useClassify'
 const emits = defineEmits(['change', 'filter'])
 
 const { userVal } = useClassify()
-function handleUserChange(value,context) {
-  emits('filter')
-  getClassify()
-}
 
 const searchSelectKeys = {
   value: 'ChartInfoId',
   label: 'ChartName'
 }
+const expandedclassify = ref([])
 const searchVal = ref('')
 const searchOpts = ref([])
 const searchLoading = ref(false)
@@ -31,6 +28,7 @@ function handleSearchChart(keyword) {
 }
 async function handleGetSearchChartList(keyword) {
   searchLoading.value = true
+  showSuggestions.value = true
   const res = await apiETAChart.chartSearch({
     PageSize: searchPageSize,
     CurrentIndex: searchPage,
@@ -48,9 +46,22 @@ async function handleLoadMoreChart() {
   if (finished || searchLoading.value) return
   handleGetSearchChartList()
 }
-function handleSelectChart(value, context) {
+function handleSelectChart(value) {
   if (value) {
-    emits('change', {ChartInfoId:value})
+    emits('change', value)
+    showSuggestions.value = false
+    const array = value.ClassifyLevels || []
+    array.forEach((element, index) => {
+      setTimeout(() => {
+        expandedclassify.value.push(element)
+        // 如果是最后一个元素,执行nextTick
+        if (index === array.length - 1) {
+          nextTick(() => {
+            classifyActived.value = [value.UniqueCode];
+          });
+        }
+      }, index*500);
+    });
   }
 }
 
@@ -116,46 +127,56 @@ function handleClassifyActiveChange({ node }) {
 }
 
 
+
+const showSuggestions = ref(false)
+
+
+const handleBlur = (text) => {
+  if(!text){
+    clearMenu()
+  }
+}
+const clearMenu = () => {
+  searchOpts.value = []
+  showSuggestions.value = false
+}
+
+
 </script>
 
 <template>
   <div class="bg-white classify-wrap">
-    <div class="select-wrap">
-      <select-chart-creator v-model="userVal" @change="handleUserChange"/>
-    </div>
-    <t-select
-      v-model="searchVal"
-      placeholder="请输入图表名称"
-      clearable
-      filterable
-      :keys="searchSelectKeys"
-      :loading="searchLoading"
-      @search="handleSearchChart"
-      @change="handleSelectChart"
-      :popup-props="{ 'on-scroll-to-bottom': handleLoadMoreChart }"
+    <t-popup
+      placement="bottom-left"
+      trigger="context-menu"
+      :visible="showSuggestions"
+      @on-scroll-to-bottom="handleLoadMoreChart"
     >
-      <template #prefixIcon>
-        <search-icon />
-      </template>
-
-      <template #valueDisplay="{ value,label }">
-        <div style="max-width:180px" class="t-input__inner" v-html="label" v-if="value"></div>
-      </template>
-        
-      <t-option 
-        v-for="item in searchOpts" 
-        :key="item.ChartInfoId" 
-        :value="item.ChartInfoId"
-        :label="item.ChartName"
-        :title="null"
+      <t-input
+        v-model="searchVal"
+        placeholder="请输入图表名称"
+        @change="handleSearchChart"
+        @blur="handleBlur"
       >
+      </t-input>
+      <template #content>
+        <li
+          v-for="(item, index) in searchOpts"
+          :key="index"
+          class="suggestions-item"
+          @click="handleSelectChart(item)"
+        >
         <span v-html="item.ChartName"></span>
-      </t-option>
-    </t-select>
+        </li>
+      </template>
+    </t-popup>
+
+
     <div class="classify-list-box">
       <t-tree
         :actived="classifyActived"
         :data="classifyList"
+        v-model:expanded="expandedclassify"
         activable
         transition
         lazy
@@ -185,7 +206,6 @@ function handleClassifyActiveChange({ node }) {
   width: 300px;
   flex-shrink: 0;
   padding: 20px;
-
   .select-wrap {
     display: flex;
     gap: 0 10px;
@@ -197,4 +217,16 @@ function handleClassifyActiveChange({ node }) {
     overflow-y: auto;
   }
 }
+.suggestions-item {
+  width: 244px;
+  cursor:pointer;
+  margin: 4px;
+  padding: 5px 5px;
+  text-overflow: ellipsis;
+  overflow: hidden;
+  white-space: nowrap;
+  &:hover {
+    background-color: #ECF2FE; // 背景颜色变为浅灰色
+  }
+}
 </style>

+ 2 - 2
src/views/user/favorite/components/ClassifyWrap.vue

@@ -99,8 +99,8 @@ const showMoveChart=ref(false)
 
 <template>
   <div class="bg-white flex_col classify-wrap">
-    <h3 class="label-text">ETA社区图库</h3>
-    <div class="classify-tree">
+    <h3 class="label-text">ETA投研资源库</h3>
+    <div class="classify-tree"> 
       <t-tree
         ref="treeIns"
         :actived="[selecClassify]"

+ 1 - 1
src/views/user/favorite/components/CollectChart.vue

@@ -47,7 +47,7 @@ async function handleSave(){
   })
   if(res.Ret!==200) return
   show.value=false
-  if(res.Msg==='已收藏,可选择在ETA社区-我的收藏/ETA-我的图库中-ETA社区图库查看'){
+  if(res.Msg==='已收藏,可选择在ETA投研资源库-我的收藏/ETA-我的图库中-ETA投研资源库查看'){
     await $confirmDialog({
       header:'提示',
       body: res.Msg,

+ 1 - 1
src/views/user/favorite/components/MoveChart.vue

@@ -141,7 +141,7 @@ async function handleSave() {
     attach="body"
     width="850px"
     top="80px"
-    header="转移分类(ETA社区分类)"
+    header="转移分类(ETA投研资源库分类)" 
     closeOnOverlayClick
     destroyOnClose
     class="chart-move-pop"