bi-element-ui 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/main.js CHANGED
@@ -10,8 +10,9 @@ Vue.use(ElementUI)
10
10
  Vue.use(BiUi, {
11
11
  dev: process.env.NODE_ENV !== 'production',
12
12
  env: process.env.NODE_ENV,
13
- system: 'compass'
14
- })
13
+ system: 'pigeon'
14
+ }
15
+ )
15
16
 
16
17
  Vue.config.productionTip = false
17
18
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  <div class="example-table-box">
10
10
  <p>基础表格</p>
11
- <BiCustomColumn
11
+ <!-- <BiCustomColumn
12
12
  column-name="test"
13
13
  :table-column="basicColumn"
14
14
  :default-list="defaultColumnList"
@@ -18,7 +18,7 @@
18
18
  right:['other']
19
19
  }"
20
20
  @handleTableColumn="setTableColumn"
21
- />
21
+ /> -->
22
22
  <bi-table
23
23
  :loading="tableLoading"
24
24
  border
@@ -197,7 +197,7 @@
197
197
  stripe
198
198
  fixed="sticky"
199
199
  :data="data"
200
- :column="renderColumn"
200
+ :column="fullscreenColumn"
201
201
  :summary-method="getSummaries"
202
202
  show-summary
203
203
  ></bi-table>
@@ -5,6 +5,8 @@
5
5
  <BiNavbarTool
6
6
  :token="token"
7
7
  :avatar="avatar"
8
+ task-center
9
+ user-id="67"
8
10
  />
9
11
  </header>
10
12
  </div>
@@ -14,7 +16,7 @@
14
16
  export default {
15
17
  data() {
16
18
  return {
17
- token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxNTc1NzE4NTMyMiIsImxvZ2luX2VudiI6IiIsImlhdCI6MTY5NzExNTUzMCwiZXhwIjoxNjk3NzIwMzMwLCJuYmYiOjE2OTcxMTU1MzAsInN1YiI6InRva2Vu6K6k6K-BIiwianRpIjoiYzMzYTMzZDQyMTcyMWRmNzVhNWUzYjIwYzY3NGRlMGMifQ.Oc14XCMuGjQLVPzxp3QNnlzty28f_TmQhbjMEvV6GNE',
19
+ token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIxNTc1NzE4NTMyMiIsImxvZ2luX2VudiI6IiIsImlhdCI6MTcwNTA1ODgwOSwiZXhwIjoxNzA1NjYzNjA5LCJuYmYiOjE3MDUwNTg4MDksInN1YiI6InRva2Vu6K6k6K-BIiwianRpIjoiNmM3ODMzNjlhNDcyODg1YTRhNTFjNGIzYmQ3ZjNmMmQifQ.I6CB6nKNoibs-yVqmclcybApNy1e0WU4tRcy3_7l-WA',
18
20
  avatar: 'https://static-legacy.dingtalk.com/media/lADPBbCc1SE7SD7NAuzNAug_744_748.jpg?imageView2/1/w/80/h/80'
19
21
  }
20
22
  },
@@ -1,82 +1,9 @@
1
1
  <template>
2
2
  <div>
3
-
4
- <div
5
- class="example-table-box"
6
- style="padding-top: 20px"
7
- >
8
- <p>测试表格</p>
9
- <div class="test">
10
- <el-table
11
- v-sticky-header="{offsetTop:0}"
12
- v-sticky-footer
13
- :data="data"
14
- show-summary
15
- >
16
- <el-table-column
17
- label="日期"
18
- prop="date"
19
- width="160"
20
- ></el-table-column>
21
- <el-table-column
22
- label="姓名"
23
- prop="name"
24
- ></el-table-column>
25
- <el-table-column
26
- label="省份"
27
- prop="province"
28
- ></el-table-column>
29
- <el-table-column
30
- label="市区"
31
- prop="city"
32
- ></el-table-column>
33
- <el-table-column
34
- label="地址"
35
- prop="address"
36
- min-width="200"
37
- ></el-table-column>
38
- <el-table-column
39
- label="地址"
40
- prop="address2"
41
- min-width="200"
42
- ></el-table-column>
43
- <el-table-column
44
- label="邮编"
45
- prop="zip"
46
- fixed="right"
47
- ></el-table-column>
48
- </el-table>
49
- </div>
50
-
51
- <bi-table
52
- border
53
- stripe
54
- :data="data"
55
- :column="basicColumn"
56
- show-summary
57
- :summary-method="getSummaries"
58
- ></bi-table>
59
- </div>
60
- <el-button
61
- type=""
62
- @click="search"
63
- >搜索</el-button>
64
-
65
- <div
66
- class="example-table-box"
67
- style="padding-top: 20px"
68
- >
3
+ <el-button type="" @click="search">搜索</el-button>
4
+ <div class="example-table-box" style="padding-top: 20px">
69
5
  <p>sticky表格</p>
70
- <bi-table
71
- ref="table"
72
- border
73
- stripe
74
- fixed="sticky"
75
- :data="data"
76
- :column="basicColumn"
77
- show-summary
78
- :summary-method="getSummaries"
79
- ></bi-table>
6
+ <bi-table ref="table" border stripe fixed="sticky" :data="data" :column="basicColumn" show-summary :summary-method="getSummaries"></bi-table>
80
7
  </div>
81
8
 
82
9
  <!-- <div style="padding-bottom:600px"></div>
@@ -154,7 +81,7 @@
154
81
  </template>
155
82
 
156
83
  <script>
157
- // import CryptoJS from 'crypto-js/md5'
84
+ // import BiTable from '@/components/BiTable'
158
85
  import TableData from '@/table.js'
159
86
  // import BiTableColumn from '@/components/BiTableColumn'
160
87
  // import BiTooltipIcon from '@/components/BiTooltipIcon'
@@ -269,7 +196,6 @@ export default {
269
196
  <style lang="scss" scoped>
270
197
  .example-table-box {
271
198
  margin: 25px 50px;
272
- position: relative;
273
199
 
274
200
  p {
275
201
  text-align: left;
@@ -1,3 +1,455 @@
1
1
  <template>
2
- <bi-home-data />
3
- </template>
2
+ <div class="bi_home_data">
3
+ <el-scrollbar>
4
+ <div class="content">
5
+ <div class="swiper">
6
+ <el-carousel class="swiper_data" height="19.5vw" :autoplay="true">
7
+ <el-carousel-item v-for="(item, index) in swiperData" :key="index">
8
+ <div class="swiper_content" :style="'background: url(' + item.image_path + ') no-repeat;background-size: 100% 100%;'" @click="swiperClick(item)"></div>
9
+ </el-carousel-item>
10
+ </el-carousel>
11
+ </div>
12
+ <div class="data">
13
+ <div class="data_search">
14
+ <el-input v-model="searchData.combination" placeholder="输入标题/关键字" size="small" style="width: 14vw">
15
+ <el-button slot="append" icon="el-icon-search" style="width: 3vw; height: 32px" @click="clickSearch"></el-button>
16
+ </el-input>
17
+ <div>
18
+ <el-button v-for="(item, index) in options.buttonList" :key="index" size="small" style="width: 84px; height: 32px" @click="buttonClick(item.value)">{{ item.label }}</el-button>
19
+ </div>
20
+ </div>
21
+ <div class="data_content">
22
+ <div v-for="(item, index) in messageData" :key="index" class="message_item" @click="getDataDetail(item)">
23
+ <div class="item_title">
24
+ <img :src="returnCategoryImg(item.category_id)" alt="" />
25
+ <p>{{ returnCategory(item.category_id) }}</p>
26
+ </div>
27
+ <div class="item_content">
28
+ <img :src="item.cover_image" alt="" />
29
+ <div class="content_content">
30
+ <div class="content_title">{{ item.title }}</div>
31
+ <div class="content_desc">{{ item.short_desc }}</div>
32
+ <div class="content_time">{{ item.create_time }}</div>
33
+ </div>
34
+ </div>
35
+ <img v-if="!item.is_read" class="is_read" src="./img/new.png" alt="" />
36
+ </div>
37
+ <div class="left_page" @click="pageClick('left')">
38
+ <img src="./img/left_page.png" :style="canLeftClick ? 'opacity:1' : 'opacity:0.5'" alt="" />
39
+ </div>
40
+ <div class="right_page" @click="pageClick('right')">
41
+ <img src="./img/right_page.png" :style="canRightClick ? 'opacity:1' : 'opacity:0.5'" alt="" />
42
+ </div>
43
+ </div>
44
+ </div>
45
+ <el-drawer title="消息详情" :visible.sync="dataDetail.isShow" direction="rtl" size="560" :before-close="handleClose">
46
+ <el-scrollbar>
47
+ <div class="detail">
48
+ <div class="detail_title">{{ dataDetail.data.title }}</div>
49
+ <div class="detail_time">{{ dataDetail.data.create_time }}</div>
50
+ <div class="detail_desc">{{ dataDetail.data.short_desc }}</div>
51
+ <div class="detail_content">
52
+ <div class="content_content" v-html="dataDetail.data.content"></div>
53
+ </div>
54
+ </div>
55
+ </el-scrollbar>
56
+ </el-drawer>
57
+ </div>
58
+ </el-scrollbar>
59
+ </div>
60
+ </template>
61
+
62
+ <script>
63
+ import moment from 'moment'
64
+ import axios from 'axios'
65
+ export default {
66
+ name: 'BiHomeData',
67
+ props: {
68
+ userId: {
69
+ type: String,
70
+ default: '1919'
71
+ }
72
+ },
73
+ data() {
74
+ return {
75
+ uid: '',
76
+ searchData: {
77
+ uid: '1919',
78
+ combination: '',
79
+ category_id: '',
80
+ page: 1,
81
+ page_size: 4,
82
+ total: 0
83
+ },
84
+ url: 'http://applause.zwwlkj03.top/api',
85
+ options: {
86
+ buttonList: []
87
+ },
88
+ swiperData: [],
89
+ messageData: [],
90
+ dataDetail: {
91
+ isShow: false,
92
+ data: {}
93
+ }
94
+ }
95
+ },
96
+ computed: {
97
+ canLeftClick() {
98
+ if (this.searchData.page <= 1) {
99
+ return false
100
+ } else {
101
+ return true
102
+ }
103
+ },
104
+ canRightClick() {
105
+ const allPage = Math.ceil(this.searchData.total / this.searchData.page_size)
106
+ if (this.searchData.page >= allPage) {
107
+ return false
108
+ } else {
109
+ return true
110
+ }
111
+ }
112
+ },
113
+ mounted() {
114
+ this.uid = this.userId
115
+ this.searchData.uid = this.userId
116
+ this.init()
117
+ },
118
+ methods: {
119
+ init() {
120
+ this.Searchcondition()
121
+ this.getSwiper()
122
+ this.getMessage()
123
+ },
124
+ swiperClick(item) {
125
+ if (item.type === '1') {
126
+ window.open(item.jump_url, '_blank')
127
+ }
128
+ if (item.type === '2') {
129
+ this.getDetail(this.uid, item.notify_id)
130
+ }
131
+ },
132
+ clickSearch() {
133
+ this.searchData.page = 1
134
+ this.searchData.category_id = ''
135
+ this.getMessage()
136
+ },
137
+ buttonClick(id) {
138
+ this.searchData.page = 1
139
+ this.searchData.category_id = id
140
+ this.getMessage()
141
+ },
142
+ pageClick(type) {
143
+ if (type === 'left' && this.canLeftClick) {
144
+ this.searchData.page--
145
+ this.getMessage()
146
+ }
147
+ if (type === 'right' && this.canRightClick) {
148
+ this.searchData.page++
149
+ this.getMessage()
150
+ }
151
+ },
152
+
153
+ async getMessage() {
154
+ const res = await axios.post(this.url + '/home/notify/list', this.searchData)
155
+ if (res.data.status_code === 1) {
156
+ this.messageData = res.data.data.data
157
+ this.searchData.page = res.data.data.page_info.page
158
+ this.searchData.total = res.data.data.page_info.total
159
+ }
160
+ },
161
+ async getSwiper() {
162
+ const res = await axios.post(this.url + '/home/carousel/list', { uid: this.uid })
163
+ if (res.data.status_code === 1) {
164
+ this.swiperData = res.data.data.data
165
+ }
166
+ },
167
+ async Searchcondition() {
168
+ const res = await axios.post(this.url + '/home/Searchcondition/index', { uid: this.uid, notify_category: 1 })
169
+ if (res.data.status_code === 1) {
170
+ this.options.buttonList = res.data.data.notify_category
171
+ }
172
+ },
173
+ returnCategory(id) {
174
+ const list = this.options.buttonList.filter((data) => {
175
+ return data.value === id
176
+ })
177
+ if (list.length) {
178
+ return list[0].label
179
+ } else {
180
+ return '掌资讯'
181
+ }
182
+ },
183
+ returnCategoryImg(id) {
184
+ switch (id) {
185
+ case '1':
186
+ return require('./img/1.png')
187
+ break
188
+ case '2':
189
+ return require('./img/2.png')
190
+ break
191
+ case '3':
192
+ return require('./img/3.png')
193
+ break
194
+ case '4':
195
+ return require('./img/4.png')
196
+ break
197
+ default:
198
+ return require('./img/1.png')
199
+ }
200
+ },
201
+ getDataDetail(data) {
202
+ this.sendRaed(data)
203
+ this.getDetail(this.uid, data.id)
204
+ },
205
+ // 数据已读
206
+ async sendRaed(data) {
207
+ const res = await axios.post(this.url + '/home/notify/read', { uid: this.uid, notify_id: data.id })
208
+ if (res.data.status_code === 1) {
209
+ data.is_read = true
210
+ }
211
+ },
212
+ // 数据详情
213
+ async getDetail(uid, notify_id) {
214
+ const res = await axios.post(this.url + '/home/notify/detail', { uid, notify_id })
215
+ if (res.data.status_code === 1) {
216
+ this.dataDetail.data = res.data.data.data
217
+ this.dataDetail.isShow = true
218
+ }
219
+ },
220
+ handleClose() {
221
+ this.dataDetail.isShow = false
222
+ }
223
+ }
224
+ }
225
+ </script>
226
+
227
+ <style lang="scss" scoped>
228
+ .bi_home_data {
229
+ .content {
230
+ width: 100%;
231
+ height: calc(100vh - 115px);
232
+ background: #ffffff;
233
+ border-radius: 2px;
234
+ .swiper {
235
+ width: 100%;
236
+ height: 19.5vw;
237
+ .swiper_data {
238
+ .swiper_content {
239
+ width: 100%;
240
+ height: 19.5vw;
241
+ background: url(./img/swiperBg.png) no-repeat;
242
+ background-size: 100% 100%;
243
+ display: flex;
244
+ box-sizing: border-box;
245
+ padding: 1.5vw 6vw;
246
+ .swiper_message {
247
+ .title {
248
+ width: 31.5vw;
249
+ height: 3vw;
250
+ font-size: 2.1vw;
251
+ font-weight: 500;
252
+ color: #333333;
253
+ line-height: 3vw;
254
+ }
255
+ .desc {
256
+ width: 31.5vw;
257
+ height: 1.1vw;
258
+ font-size: 0.8vw;
259
+ font-weight: 400;
260
+ color: #333333;
261
+ line-height: 1.1vw;
262
+ margin-top: 1.5vw;
263
+ }
264
+ }
265
+ }
266
+ }
267
+ }
268
+ .data {
269
+ .data_search {
270
+ margin: 1vw 3.5vw;
271
+ display: flex;
272
+ justify-content: space-between;
273
+ }
274
+ .data_content {
275
+ margin: 0 3.5vw;
276
+ display: flex;
277
+ justify-content: space-between;
278
+ flex-wrap: wrap;
279
+ position: relative;
280
+ left: 0;
281
+ top: 0;
282
+ height: 19.5vw;
283
+ .left_page {
284
+ position: absolute;
285
+ left: -2.8vw;
286
+ top: 45%;
287
+ width: 2.25vw;
288
+ height: 2.25vw;
289
+ cursor: pointer;
290
+ img {
291
+ width: 2.25vw;
292
+ height: 2.25vw;
293
+ }
294
+ }
295
+ .right_page {
296
+ position: absolute;
297
+ right: -2.8vw;
298
+ top: 45%;
299
+ width: 2.25vw;
300
+ height: 2.25vw;
301
+ cursor: pointer;
302
+ img {
303
+ width: 2.25vw;
304
+ height: 2.25vw;
305
+ }
306
+ }
307
+ .message_item {
308
+ width: 37vw;
309
+ height: 9vw;
310
+ background: #f8f8fa;
311
+ box-shadow: 0px 0.1vw 0.45vw 0px rgba(168, 203, 255, 0.36);
312
+ border-radius: 0.2vw;
313
+ border: 0.1vw solid #ffffff;
314
+ margin-bottom: 1.5vw;
315
+ box-sizing: border-box;
316
+ padding: 1vw;
317
+ position: relative;
318
+ left: 0;
319
+ top: 0;
320
+ cursor: pointer;
321
+ &:nth-child(3) {
322
+ margin-bottom: 0;
323
+ }
324
+ &:nth-child(4) {
325
+ margin-bottom: 0;
326
+ }
327
+ .item_title {
328
+ display: flex;
329
+ height: 1vw;
330
+ img {
331
+ width: 1vw;
332
+ height: 1vw;
333
+ }
334
+ p {
335
+ height: 1vw;
336
+ line-height: 1vw;
337
+ margin: 0 0 0 0.5vw;
338
+ }
339
+ }
340
+ .item_content {
341
+ margin-top: 1.6vw;
342
+ display: flex;
343
+ img {
344
+ width: 4vw;
345
+ height: 4vw;
346
+ margin-right: 1.2vw;
347
+ }
348
+ .content_content {
349
+ width: 31vw;
350
+ position: relative;
351
+ top: 0;
352
+ left: 0;
353
+ .content_title {
354
+ max-width: 20vw;
355
+ height: 1.1vw;
356
+ font-size: 0.8vw;
357
+ font-weight: 500;
358
+ color: #333333;
359
+ line-height: 1.1vw;
360
+ overflow: hidden;
361
+ white-space: nowrap;
362
+ text-overflow: ellipsis;
363
+ }
364
+ .content_desc {
365
+ max-width: 26vw;
366
+ height: 1vw;
367
+ margin-top: 0.8vw;
368
+ font-size: 0.7vw;
369
+ font-weight: 400;
370
+ color: #333333;
371
+ line-height: 1vw;
372
+ overflow: hidden;
373
+ white-space: nowrap;
374
+ text-overflow: ellipsis;
375
+ }
376
+ .content_time {
377
+ position: absolute;
378
+ left: 22vw;
379
+ top: 0.05vw;
380
+ width: 8vw;
381
+ height: 1vw;
382
+ font-size: 0.7vw;
383
+ font-weight: 400;
384
+ color: #333333;
385
+ line-height: 1vw;
386
+ overflow: hidden;
387
+ white-space: nowrap;
388
+ text-overflow: ellipsis;
389
+ }
390
+ }
391
+ }
392
+ .is_read {
393
+ position: absolute;
394
+ right: 0.1vw;
395
+ top: 0.3vw;
396
+ width: 1.5vw;
397
+ height: 0.8vw;
398
+ }
399
+ }
400
+ }
401
+ }
402
+ .detail {
403
+ width: 100%;
404
+ box-sizing: border-box;
405
+ padding: 0 20px;
406
+ height: calc(100vh - 80px);
407
+ .detail_title {
408
+ width: 440px;
409
+ height: 22px;
410
+ font-size: 16px;
411
+ font-weight: 500;
412
+ color: #333333;
413
+ line-height: 22px;
414
+ overflow: hidden;
415
+ white-space: nowrap;
416
+ text-overflow: ellipsis;
417
+ }
418
+ .detail_time {
419
+ width: 320px;
420
+ height: 16px;
421
+ margin-top: 12px;
422
+ font-size: 12px;
423
+ font-weight: 400;
424
+ color: #999999;
425
+ line-height: 16px;
426
+ overflow: hidden;
427
+ white-space: nowrap;
428
+ text-overflow: ellipsis;
429
+ }
430
+ .detail_desc {
431
+ margin-top: 24px;
432
+ width: 500px;
433
+ font-size: 14px;
434
+ font-weight: 400;
435
+ color: #333333;
436
+ line-height: 20px;
437
+ }
438
+ .detail_content {
439
+ width: 520px;
440
+ margin-top: 24px;
441
+ overflow-y: auto;
442
+ .content_content {
443
+ width: 500px;
444
+ }
445
+ }
446
+ }
447
+ }
448
+ }
449
+ </style>
450
+ <style>
451
+ .el-carousel__indicator.is-active button {
452
+ opacity: 1;
453
+ background-color: #38ce81;
454
+ }
455
+ </style>
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
-
2
- packages/TableSticky/*
@@ -1,3 +0,0 @@
1
- {
2
- "editor.inlineSuggest.showToolbar": "onHover"
3
- }