瀏覽代碼

搜索页开发

duwendi 2 年之前
父節點
當前提交
b6fc410d0e

+ 1 - 1
src/assets/css/global.css

@@ -4,7 +4,7 @@ body,
4 4
 #app {
5 5
   width: 100%;
6 6
   height: 100%;
7
-  background-color: #f1f2f5;
7
+  background-color: #fff;
8 8
   margin: 0;
9 9
   padding: 0;
10 10
   font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;

+ 3 - 4
src/pages/homepage/components/cardWrap.vue

@@ -18,13 +18,12 @@
18 18
       <div style="height: 72px; text-align: center; background: #fff; padding-top: 10px;">
19 19
         <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
20 20
           <el-button slot="append" class="searchbtn" @click="jumpToSearchPage">
21
-<!--            <i class="el-icon-search"></i>-->
22 21
             <img src="../../../../static/homepage/u432.svg" alt="">
23 22
           </el-button>
24
-          <!-- <template slot="append">搜索</template> -->
25 23
         </el-input>
26 24
       </div>
27 25
     </div>
26
+    <div style="background: #f1f2f5; height: 10px; width: 100%;"></div>
28 27
     <div class="chart-wrap">
29 28
       <div class="chart-card">
30 29
         <div class="title">各主题域资产数量统计</div>
@@ -134,7 +133,7 @@ export default {
134 133
   }
135 134
 
136 135
   .input-wrapper {
137
-    width: 47%;
136
+    width: 36%;
138 137
     height: 53px;
139 138
 
140 139
     /deep/ .el-input__inner {
@@ -196,7 +195,7 @@ export default {
196 195
   }
197 196
 
198 197
   .chart-wrap {
199
-    margin-top: 10px;
198
+    //margin-top: 10px;
200 199
     padding: 20px;
201 200
     height: 700px;
202 201
     background: #fff;

+ 164 - 17
src/pages/homepage/components/searchPage.vue

@@ -1,41 +1,188 @@
1 1
 // 详情页
2 2
 <template>
3 3
   <div class="detailPage">
4
-    <div class="left">
5
-      <!-- 左侧列表 -->
6
-      <article-detail></article-detail>
4
+    <div class="search-card">
5
+      <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
6
+        <el-button slot="append" class="searchbtn" @click="jumpToSearchPage">
7
+          <img src="../../../../static/homepage/u432.svg" alt="">
8
+        </el-button>
9
+      </el-input>
7 10
     </div>
11
+    <el-tabs class="bottom-card" v-model="activeName" @tab-click="handleClick">
12
+      <el-tab-pane :key="item.id" v-for="item in tabList" :label="item.name" :name="item.id">
13
+        <div class="flex">
14
+          <div class="tree-wrap">
15
+            <div>{{item.name}}</div>
16
+            <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
17
+          </div>
18
+          <div class="list-wrap">
19
+            <div class="entity-card" v-for="(item, idx) in list" :key="idx">
20
+              <p class="title">实体名称{{item.logicTbName}}</p>
21
+              <el-row style="color: rgb(91,91,91);line-height: 40px;">
22
+                <el-col :span="12">
23
+                  英文名称:{{item.tbName}}
24
+                </el-col>
25
+                <el-col :span="12">
26
+                  更新时间:{{item.updateTime}}
27
+                </el-col>
28
+                <el-col :span="12">
29
+                  所属主题:{{item.topic}}
30
+                </el-col>
31
+              </el-row>
32
+            </div>
33
+            <el-pagination
34
+              style="float: right;margin-bottom: 10px;"
35
+              @size-change="handleSizeChange"
36
+              @current-change="handleCurrentChange"
37
+              :current-page.sync="currentPage"
38
+              :page-size="pageSize"
39
+              layout="total, prev, pager, next"
40
+              :total="total">
41
+            </el-pagination>
42
+            <div style="clear: both;"></div>
43
+          </div>
44
+        </div>
45
+      </el-tab-pane>
46
+    </el-tabs>
8 47
   </div>
9 48
 </template>
10 49
 
11 50
 <script>
12
-import articleDetail from "./entityDetail.vue";
13 51
 export default {
14
-  components: {
15
-    articleDetail
16
-  },
17 52
   data() {
18
-    return {};
53
+    return {
54
+      activeName: 'first',
55
+      tabList: [
56
+        {
57
+          name: '主题库',
58
+          id: 'first',
59
+          num: 0
60
+        },
61
+        {
62
+          name: '专题库',
63
+          id: 'second',
64
+          num: 0},
65
+        {
66
+          name: '指标',
67
+          id: 'third',
68
+          num: 0},
69
+        {
70
+          name: '服务',
71
+          id: 'fourth',
72
+          num: 0}
73
+      ],
74
+      data: [{
75
+        label: '一级 1',
76
+        children: [{
77
+          label: '二级 1-1',
78
+          children: [{
79
+            label: '三级 1-1-1'
80
+          }]
81
+        }]
82
+      }, {
83
+        label: '一级 2',
84
+        children: [{
85
+          label: '二级 2-1',
86
+          children: [{
87
+            label: '三级 2-1-1'
88
+          }]
89
+        }, {
90
+          label: '二级 2-2',
91
+          children: [{
92
+            label: '三级 2-2-1'
93
+          }]
94
+        }]
95
+      }, {
96
+        label: '一级 3',
97
+        children: [{
98
+          label: '二级 3-1',
99
+          children: [{
100
+            label: '三级 3-1-1'
101
+          }]
102
+        }, {
103
+          label: '二级 3-2',
104
+          children: [{
105
+            label: '三级 3-2-1'
106
+          }]
107
+        }]
108
+      }],
109
+      defaultProps: {
110
+        children: 'children',
111
+        label: 'label'
112
+      },
113
+      list: [],
114
+      currentPage: 1,
115
+      pageSize: 5,
116
+      total: 1000
117
+    };
19 118
   },
20 119
   created() {},
21 120
   mounted() {
22 121
     document.documentElement.scrollTop = 0;
23 122
   },
24
-  methods: {}
123
+  methods: {
124
+    handleClick(tab, event) {
125
+      this.activeName = tab.name;
126
+    },
127
+    handleNodeClick(data) {
128
+      console.log(data);
129
+    },
130
+    handleSizeChange(val) {
131
+      console.log(`每页 ${val} 条`);
132
+    },
133
+    handleCurrentChange(val) {
134
+      console.log(`当前页: ${val}`);
135
+    }
136
+  }
25 137
 };
26 138
 </script>
27 139
 
28 140
 <style lang="scss" scoped>
29 141
 .detailPage {
30
-  display: flex;
31
-  justify-content: space-between;
32
-  margin-bottom: 15px;
33
-  .left {
34
-    width: calc(68% - 15px);
142
+  width: 100%;
143
+  height: 100%;
144
+  box-sizing: border-box;
145
+  background: #fff;
146
+  .search-card {
147
+    height: 100px;
148
+    text-align: center;
149
+    padding-top: 30px;
150
+    border-bottom: 1px solid #ddd;
151
+    .input-wrapper {
152
+      width: 36%;
153
+      height: 53px;
154
+
155
+      /deep/ .el-input__inner {
156
+        height: 53px;
157
+      }
158
+
159
+      /deep/ .el-input-group__append {
160
+        background-color: #fff;
161
+        color: #80c2f7;
162
+        font-size: 18px;
163
+        font-weight: bold;
164
+      }
165
+    }
35 166
   }
36
-  .right {
37
-    display: inline-block;
38
-    width: calc(32%);
167
+  .bottom-card {
168
+    padding: 0 10%;
169
+    .tree-wrap {
170
+      width: 25%;
171
+    }
172
+    .list-wrap {
173
+      width: 75%;
174
+      .entity-card {
175
+        width: 100%;
176
+        height: 100px;
177
+        border: 1px solid #ddd;
178
+        padding: 20px;
179
+        margin-bottom: 10px;
180
+        .title {
181
+          font-size: 18px;
182
+          line-height: 30px;
183
+        }
184
+      }
185
+    }
39 186
   }
40 187
 }
41 188
 </style>

+ 2 - 2
src/pages/homepage/layouts/homeLayout.vue

@@ -70,10 +70,10 @@ export default {
70 70
 
71 71
 <style lang="scss" scoped>
72 72
 .home-wrapper {
73
-  position: absolute;
73
+  //position: absolute;
74 74
   // top: 60px;
75 75
   width: 100%;
76
-  height: 100%;
76
+  //height: 100%;
77 77
   background-size: cover;
78 78
   box-sizing: border-box;
79 79
 }