Bläddra i källkod

搜索页面开发

chaihaorui 1 år sedan
förälder
incheckning
5c7f515348

BIN
src/assets/collect.png


+ 8 - 0
src/assets/css/global.css

@@ -20,6 +20,14 @@ body,
20 20
   display: flex;
21 21
 }
22 22
 
23
+html {
24
+    box-sizing: border-box;
25
+}
26
+
27
+*,*::before,*::after {
28
+    box-sizing: inherit;
29
+}
30
+
23 31
 /*
24 32
 @media screen and (min-width:700px) {
25 33
 

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 6 - 0
src/assets/image/u652.svg


+ 12 - 7
src/pages/homepage/components/cardWrap.vue

@@ -8,7 +8,7 @@
8 8
             数据资源库
9 9
           </div>
10 10
           <div class="data-repo-wrap">
11
-            <div v-for="(item, index) in menus" :key="index"  class="menu-btn" style="width: 16%" @click="jumpToSearchPage(item)">
11
+            <div v-for="(item, index) in menus" :key="index"  class="menu-btn" style="width: 20%" @click="jumpToSearchPage(item.pageType)">
12 12
               <p>{{ item.title }}</p>
13 13
               <div class="flex" style="padding-top: 10px;">
14 14
                 <div style="width: 26%;" class="middle-flex">
@@ -23,13 +23,13 @@
23 23
           </div>
24 24
         </div>
25 25
         <div class="my-collect clearfix">
26
-          <div  class="menu-btn" style="width: 80%" @click="jumpToSearchPage()">
26
+          <div  class="menu-btn" style="width: 80%" @click="jumpToSearchPage('collect')">
27 27
             <p>我的收藏</p>
28 28
             <div class="flex" style="padding-top: 10px;">
29 29
               <div style="width: 26%;" class="middle-flex">
30
-                <img style="width: 50px; height: 50px;" src="../../../assets/image/u448.svg"/>
30
+                <img style="width: 50px; height: 50px;" src="../../../assets/collect.png"/>
31 31
               </div>
32
-              <div style="width: 74%; line-height: 30px;">
32
+              <div style="width: 74%; line-height: 50px;">
33 33
                 <p class="sub-title"><span/>收藏总量<span style="margin-left: 5px;" :class="`font-collect`">1553</span></p>
34 34
               </div>
35 35
             </div>
@@ -146,18 +146,22 @@ export default {
146 146
             title: '主题库资源',
147 147
             new: 312,
148 148
             history: 42353,
149
+            pageType: 'theme'
149 150
           },{
150 151
             title: '专题库资源',
151 152
             new: 234,
152 153
             history: 6234,
154
+            pageType: 'topic'
153 155
           },{
154 156
             title: '指标库资源',
155 157
             new: 553,
156 158
             history: 553,
159
+            pageType: 'index'
157 160
           },{
158 161
             title: '总线服务',
159 162
             new: 35,
160 163
             history: 1553,
164
+            pageType: 'service'
161 165
           }],
162 166
           barData: [{qyjc: '2023-01', hs: 100, hs1: 200}, {qyjc: '2023-02', hs: 10, hs1: 20}, {qyjc: '2023-03', hs: 10, hs1: 20}, {qyjc: '2023-04', hs: 10, hs1: 20}, {qyjc: '2023-05', hs: 10, hs1: 20},],
163 167
           specialAssetsData: [{qyjc: '专题1', hs: 100, hs1: 200}, {qyjc: '2023-02', hs: 10, hs1: 20}, {qyjc: '2023-03', hs: 10, hs1: 20}, {qyjc: '2023-04', hs: 10, hs1: 20}, {qyjc: '2023-05', hs: 10, hs1: 20},],
@@ -180,12 +184,13 @@ export default {
180 184
 
181 185
     },
182 186
     methods: {
183
-      jumpToSearchPage(item) {
187
+      jumpToSearchPage(pageType) {
184 188
         this.$router.push({
185 189
           name: "searchPage",
186 190
           path: "/searchPage",
187 191
           query: {
188
-            searchword: this.searchWords
192
+            searchword: this.searchWords,
193
+            pageType: pageType ? pageType : 'all'
189 194
           }
190 195
         });
191 196
       },
@@ -272,7 +277,7 @@ export default {
272 277
       }
273 278
     }
274 279
     .menu-btn {
275
-        height: 98px;
280
+        height: 138px;
276 281
         width: 100%;
277 282
         padding: 20px;
278 283
         box-shadow: 2px 5px 10px #ddd;

+ 156 - 11
src/pages/homepage/components/searchPage.vue

@@ -3,7 +3,7 @@
3 3
   <div class="detailPage">
4 4
     <div class="search-card">
5 5
       <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
6
-        <el-button slot="append" class="searchbtn" @click="jumpToSearchPage">
6
+        <el-button slot="append" class="searchbtn" @click="handleSearch">
7 7
           <img src="../../../../static/homepage/u432.svg" alt="">
8 8
         </el-button>
9 9
       </el-input>
@@ -12,13 +12,29 @@
12 12
       <el-tab-pane :key="item.id" v-for="item in tabList" :label="item.name" :name="item.id">
13 13
         <div class="flex">
14 14
           <div class="tree-wrap">
15
+            <el-button-group v-if="activeName === 'fourth'">
16
+              <el-button :type="serviceType === 'API' ? 'primary' : ''" @click="serviceType = 'API'" size="small">API服务</el-button>
17
+              <el-button :type="serviceType === 'MQ' ? 'primary' : ''" @click="serviceType = 'MQ'" size="small">消息队列</el-button>
18
+            </el-button-group>
15 19
             <div>{{item.name}}</div>
16 20
             <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
17 21
           </div>
18 22
           <div class="list-wrap">
19
-            <div class="entity-card" v-for="(item, idx) in list" :key="idx" @click="jumpToDetailPage(item.id)">
20
-              <p class="title">实体名称{{item.logicTbName}}</p>
21
-              <el-row style="color: rgb(91,91,91);line-height: 40px;">
23
+            <div v-if="pageType === 'collect'" ><el-button :type="'primary'" @click="batchCancelCollect" size="small">批量取消收藏</el-button></div>
24
+            <div v-if="pageType === 'background'">
25
+              <el-button :type="'primary'" @click="batchListing" size="small">批量上架</el-button>
26
+              <el-button :type="'primary'" @click="batchOffShelf" size="small">批量下架</el-button>
27
+            </div>
28
+            <div :class="getCardClass()" v-for="(item, idx) in list" :key="idx" @click="jumpToDetailPage(item.id)">
29
+              <!-- 主题库和专题库块 -->
30
+              <p v-if="activeName === 'first' || activeName === 'second'" class="title">
31
+                <span  @click.stop="">
32
+                  <el-checkbox v-if="pageType === 'collect' || pageType === 'background'" class="checkbox" v-model="item.checked" @change="(e) => checkboxChange(e, item.id)"></el-checkbox>
33
+                </span>
34
+                <img src="../../../assets/image/u652.svg" alt="">
35
+                实体名称:{{item.logicTbName}}
36
+              </p>
37
+              <el-row v-if="activeName === 'first' || activeName === 'second'" style="color: rgb(91,91,91);line-height: 40px;">
22 38
                 <el-col :span="12">
23 39
                   英文名称:{{item.tbName}}
24 40
                 </el-col>
@@ -29,6 +45,69 @@
29 45
                   所属主题:{{item.topic}}
30 46
                 </el-col>
31 47
               </el-row>
48
+              <!-- 指标编码块 -->
49
+              <p v-if="activeName === 'third'" class="title">
50
+                <span  @click.stop="">
51
+                  <el-checkbox v-if="pageType === 'collect' || pageType === 'background'" class="checkbox" v-model="item.checked" @click.stop="" @change="(e) => checkboxChange(e, item.id)"></el-checkbox>
52
+                </span>
53
+                <img src="../../../assets/image/u652.svg" alt="">
54
+                指标名称:{{item.logicTbName}}
55
+              </p>
56
+              <el-row v-if="activeName === 'third'" style="color: rgb(91,91,91);line-height: 40px;">
57
+                <el-col :span="12">
58
+                  所属目录:{{item.tbName}}
59
+                </el-col>
60
+                <el-col :span="12">
61
+                  更新时间:{{item.updateTime}}
62
+                </el-col>
63
+              </el-row>
64
+              <el-row v-if="activeName === 'third'" style="color: rgb(91,91,91);line-height: 40px;">
65
+                <el-col :span="12">
66
+                  所属部门:{{item.depart}}
67
+                </el-col>
68
+              </el-row>
69
+              <el-row v-if="activeName === 'third'" style="color: rgb(91,91,91);line-height: 40px;">
70
+                <el-col :span="12">
71
+                  指标编码:{{item.indexCode}}
72
+                </el-col>
73
+              </el-row>
74
+              <!-- 服务块 -->
75
+              <p v-if="activeName === 'fourth'" class="title">
76
+                <span  @click.stop="">
77
+                  <el-checkbox v-if="pageType === 'collect' || pageType === 'background'"  class="checkbox" v-model="item.checked" @click.stop="" @change="(e) => checkboxChange(e, item.id)"></el-checkbox>
78
+                </span>
79
+                <img src="../../../assets/image/u652.svg" alt="">
80
+                {{ serviceType === 'API' ? '序号:' : 'Topic名称:'}}{{item.logicTbName}}
81
+              </p>
82
+              <el-row v-if="activeName === 'fourth'" style="color: rgb(91,91,91);line-height: 40px;">
83
+                <el-col :span="12">
84
+                  {{ serviceType === 'API' ? 'API名称:' : '集成应用:'}}{{item.tbName}}
85
+                </el-col>
86
+                <el-col :span="12">
87
+                  {{ serviceType === 'API' ? '更新时间:' : '提供部门:'}}{{item.updateTime}}
88
+                </el-col>
89
+              </el-row>
90
+              <el-row v-if="activeName === 'fourth'" style="color: rgb(91,91,91);line-height: 40px;">
91
+                <el-col :span="12">
92
+                  {{ serviceType === 'API' ? 'API描述:' : 'topic分区数:'}}{{item.apiDesc}}
93
+                </el-col>
94
+                <el-col :span="12">
95
+                  {{ serviceType === 'API' ? '提供部门:' : '使用部门:'}}{{item.depart}}
96
+                </el-col>
97
+              </el-row>
98
+              <el-row v-if="activeName === 'fourth'" style="color: rgb(91,91,91);line-height: 40px;">
99
+                <el-col :span="12">
100
+                  {{ serviceType === 'API' ? '服务归属系统名称:' : '副本数:'}}{{item.sysName}}
101
+                </el-col>
102
+                <el-col :span="12">
103
+                  {{ serviceType === 'API' ? '使用部门:' : '老化时间(小时):'}}{{item.useDepart}}
104
+                </el-col>
105
+              </el-row>
106
+              <el-row v-if="activeName === 'fourth' && serviceType === 'MQ'" style="color: rgb(91,91,91);line-height: 40px;">
107
+                <el-col :span="12">
108
+                  描述:{{item.desc}}
109
+                </el-col>
110
+              </el-row>
32 111
             </div>
33 112
             <el-pagination
34 113
               style="float: right;margin-bottom: 10px;"
@@ -52,6 +131,7 @@ export default {
52 131
   data() {
53 132
     return {
54 133
       activeName: 'first',
134
+      searchWords: this.$route.query.searchword || '',
55 135
       tabList: [
56 136
         {
57 137
           name: '主题库',
@@ -116,40 +196,72 @@ export default {
116 196
           logicTbName: '周期性维护计划注销信息',
117 197
           tbName: 'periodic_maintenance_plan_cancel',
118 198
           updateTime: '2022-07-06 09:23:44',
119
-          topic: '人力资源管理'
199
+          topic: '人力资源管理',
200
+          indexCode: 'ZB001080',
201
+          depart: 'sunpu',
202
+          apiDesc: 'degegwgwgwg',
203
+          useDepart: '部门XXX',
204
+          sysName: 'app-tfs',
205
+          desc: '暂无'
120 206
         },
121 207
         {
122 208
           id: '222',
123 209
           logicTbName: '周期性维护计划注销信息',
124 210
           tbName: 'periodic_maintenance_plan_cancel',
125 211
           updateTime: '2022-07-06 09:23:44',
126
-          topic: '人力资源管理'
212
+          topic: '人力资源管理',
213
+          indexCode: 'ZB001080',
214
+          depart: 'sunpu',
215
+          apiDesc: 'degegwgwgwg',
216
+          useDepart: '部门XXX',
217
+          sysName: 'app-tfs',
218
+          desc: '暂无'
127 219
         },
128 220
         {
129 221
           id: '333',
130 222
           logicTbName: '周期性维护计划注销信息',
131 223
           tbName: 'periodic_maintenance_plan_cancel',
132 224
           updateTime: '2022-07-06 09:23:44',
133
-          topic: '人力资源管理'
225
+          topic: '人力资源管理',
226
+          indexCode: 'ZB001080',
227
+          depart: 'sunpu',
228
+          apiDesc: 'degegwgwgwg',
229
+          useDepart: '部门XXX',
230
+          sysName: 'app-tfs',
231
+          desc: '暂无'
134 232
         },
135 233
         {
136 234
           id: '444',
137 235
           logicTbName: '周期性维护计划注销信息',
138 236
           tbName: 'periodic_maintenance_plan_cancel',
139 237
           updateTime: '2022-07-06 09:23:44',
140
-          topic: '人力资源管理'
238
+          topic: '人力资源管理',
239
+          indexCode: 'ZB001080',
240
+          depart: 'sunpu',
241
+          apiDesc: 'degegwgwgwg',
242
+          useDepart: '部门XXX',
243
+          sysName: 'app-tfs',
244
+          desc: '暂无'
141 245
         },
142 246
         {
143 247
           id: '555',
144 248
           logicTbName: '周期性维护计划注销信息',
145 249
           tbName: 'periodic_maintenance_plan_cancel',
146 250
           updateTime: '2022-07-06 09:23:44',
147
-          topic: '人力资源管理'
251
+          topic: '人力资源管理',
252
+          indexCode: 'ZB001080',
253
+          depart: 'sunpu',
254
+          apiDesc: 'degegwgwgwg',
255
+          useDepart: '部门XXX',
256
+          sysName: 'app-tfs',
257
+          desc: '暂无'
148 258
         },
149 259
       ],
150 260
       currentPage: 1,
151 261
       pageSize: 5,
152
-      total: 1000
262
+      total: 1000,
263
+      serviceType: 'API', // API-API服务,MQ-消息队列
264
+      pageType: this.$route.query.pageType || 'all', // all-全量搜索,theme-只有主题库搜索,topic-只有专题库搜索,index-只有指标搜索,service-只有服务搜索,collect-我的收藏全量搜索,background-后台管理搜索
153 265
     };
154 266
   },
155 267
   created() {},
@@ -178,6 +290,30 @@ export default {
178 290
         }
179 291
       });
180 292
     },
293
+    handleSearch() {
294
+      
295
+    },
296
+    getCardClass() {
297
+      let ret = 'entity-card'
298
+      if (this.activeName === 'third') {
299
+        ret = 'entity-card heighten'
300
+      }
301
+      if (this.activeName === 'fourth') {
302
+        ret = this.serviceType === 'API' ? 'entity-card heighten' : 'entity-card mq-heighten'
303
+      }
304
+      return ret
305
+    },
306
+    // 批量取消收藏
307
+    batchCancelCollect() {
308
+
309
+    },
310
+    // 批量上架
311
+    batchListing() {},
312
+    // 批量下架
313
+    batchOffShelf() {},
314
+    checkboxChange(e, id) {
315
+      console.log('e', e, 'id', id)
316
+    }
181 317
   }
182 318
 };
183 319
 </script>
@@ -219,7 +355,7 @@ export default {
219 355
       .entity-card {
220 356
         cursor: pointer;
221 357
         width: 100%;
222
-        height: 100px;
358
+        height: 140px;
223 359
         border: 1px solid #ddd;
224 360
         padding: 20px;
225 361
         margin-bottom: 10px;
@@ -228,6 +364,15 @@ export default {
228 364
           line-height: 30px;
229 365
         }
230 366
       }
367
+      .heighten{
368
+        height: 190px;
369
+      }
370
+      .mq-heighten{
371
+        height: 220px;
372
+      }
373
+      .checkbox{
374
+        z-index: 10;
375
+      }
231 376
     }
232 377
   }
233 378
 }