bi-element-ui 0.1.41 → 0.1.43

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.
Files changed (51) hide show
  1. package/.browserslistrc +3 -3
  2. package/.eslintrc.js +287 -287
  3. package/.prettierrc +7 -7
  4. package/README.md +148 -148
  5. package/cypress.json +3 -3
  6. package/dist/js/about.a5370aa0.js +1 -1
  7. package/dist/js/chunk-vendors.a9a38d93.js +317 -317
  8. package/dist/js/index.8837e62a.js +1 -1
  9. package/lib/bi-element-ui.common.js +29339 -25508
  10. package/lib/bi-element-ui.css +1 -1
  11. package/lib/bi-element-ui.umd.js +29339 -25508
  12. package/lib/bi-element-ui.umd.min.js +150 -150
  13. package/lib/static/img/swiperBg.png +0 -0
  14. package/package.json +57 -57
  15. package/src/App.vue +42 -41
  16. package/src/components/BiDatePicker/datePickerOption.js +229 -229
  17. package/src/components/BiDatePicker/index.vue +74 -74
  18. package/src/components/BiTable/columu.vue +104 -104
  19. package/src/components/BiTable/forced.js +76 -76
  20. package/src/components/BiTable/index.js +6 -6
  21. package/src/components/BiTable/render.vue +13 -13
  22. package/src/components/BiTable/table.vue +202 -202
  23. package/src/components/BiTableColumn/Group.vue +277 -277
  24. package/src/components/BiTableColumn/api.js +16 -16
  25. package/src/components/BiTableColumn/index.vue +614 -614
  26. package/src/components/BiTooltipIcon/index.vue +71 -71
  27. package/src/components/EditBtn.vue +15 -15
  28. package/src/components/FreeButton/index.vue +69 -69
  29. package/src/components/Pagination/index.vue +104 -104
  30. package/src/components/Pagination/scrollTo.js +69 -69
  31. package/src/main.js +18 -18
  32. package/src/router/index.js +39 -34
  33. package/src/store/index.js +11 -11
  34. package/src/table.js +463 -463
  35. package/src/views/Date.vue +132 -132
  36. package/src/views/Home.vue +330 -330
  37. package/src/views/Scene.vue +140 -140
  38. package/src/views/Table.vue +220 -220
  39. package/src/views/img/1.png +0 -0
  40. package/src/views/img/2.png +0 -0
  41. package/src/views/img/3.png +0 -0
  42. package/src/views/img/4.png +0 -0
  43. package/src/views/img/new.png +0 -0
  44. package/src/views/img/swiperBg.png +0 -0
  45. package/src/views/showData.vue +369 -0
  46. package/tests/e2e/.eslintrc.js +10 -10
  47. package/tests/e2e/plugins/index.js +25 -25
  48. package/tests/e2e/specs/test.js +8 -8
  49. package/tests/e2e/support/commands.js +25 -25
  50. package/tests/e2e/support/index.js +20 -20
  51. package/tests/unit/example.spec.js +13 -13
@@ -0,0 +1,369 @@
1
+ <template>
2
+ <div class="content">
3
+ <div class="swiper">
4
+ <el-carousel class="swiper_data" height="19.5vw" :autoplay="true">
5
+ <el-carousel-item v-for="(item, index) in swiperData" :key="index">
6
+ <div class="swiper_content" :style="'background: url(' + item.image_path + ') no-repeat;background-size: 100% 100%;'" @click="swiperClick(item)"></div>
7
+ </el-carousel-item>
8
+ </el-carousel>
9
+ </div>
10
+ <div class="data">
11
+ <div class="data_search">
12
+ <el-input placeholder="输入标题/关键字" v-model="searchData.combination" size="small" style="width:14vw;">
13
+ <el-button icon="el-icon-search" slot="append" style="width:3vw;height:32px;" @click="clickSearch"></el-button>
14
+ </el-input>
15
+ <div>
16
+ <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>
17
+ </div>
18
+ </div>
19
+ <div class="data_content">
20
+ <div v-for="(item, index) in messageData" :key="index" class="message_item" @click="getDataDetail(item)">
21
+ <div class="item_title">
22
+ <img :src="returnCategoryImg(item.category_id)" alt="" />
23
+ <p>{{ returnCategory(item.category_id) }}</p>
24
+ </div>
25
+ <div class="item_content">
26
+ <img :src="item.cover_image" alt="" />
27
+ <div class="content_content">
28
+ <div class="content_title">{{ item.title }}</div>
29
+ <div class="content_desc">{{ item.short_desc }}</div>
30
+ <div class="content_time">{{ item.create_time }}</div>
31
+ </div>
32
+ </div>
33
+ <img v-if="!item.is_read" class="is_read" src="./img/new.png" alt="" />
34
+ </div>
35
+ </div>
36
+ </div>
37
+ <el-drawer title="消息详情" :visible.sync="dataDetail.isShow" direction="rtl" :size="560" :before-close="handleClose">
38
+ <div class="detail">
39
+ <div class="detail_title">{{ dataDetail.data.title }}</div>
40
+ <div class="detail_time">{{ dataDetail.data.create_time }}</div>
41
+ <div class="detail_desc">{{ dataDetail.data.short_desc }}</div>
42
+ <div class="detail_content">
43
+ <div class="content_content" v-html="dataDetail.data.content"></div>
44
+ </div>
45
+ </div>
46
+ </el-drawer>
47
+ </div>
48
+ </template>
49
+
50
+ <script>
51
+ import moment from 'moment'
52
+ import axios from 'axios'
53
+ export default {
54
+ name: 'HomeData',
55
+ props: {
56
+ userId: {
57
+ type: String,
58
+ default: '1919'
59
+ }
60
+ },
61
+ data() {
62
+ return {
63
+ uid: '',
64
+ searchData: {
65
+ uid: '1919',
66
+ combination: '',
67
+ category_id: ''
68
+ },
69
+ url: 'http://applause.zwwlkj03.top/api',
70
+ options: {
71
+ buttonList: []
72
+ },
73
+ swiperData: [],
74
+ messageData: [],
75
+ dataDetail: {
76
+ isShow: false,
77
+ data: {}
78
+ }
79
+ }
80
+ },
81
+ mounted() {
82
+ this.uid = this.userId
83
+ this.searchData.uid = this.userId
84
+ this.init()
85
+ },
86
+ methods: {
87
+ init() {
88
+ this.Searchcondition()
89
+ this.getSwiper()
90
+ this.getMessage()
91
+ },
92
+ swiperClick(item) {
93
+ if (item.type === '1') {
94
+ window.open(item.jump_url, '_blank')
95
+ }
96
+ if (item.type === '2') {
97
+ this.getDetail(this.uid, item.notify_id)
98
+ }
99
+ },
100
+ clickSearch() {
101
+ this.searchData.category_id = ''
102
+ this.getMessage()
103
+ },
104
+ buttonClick(id) {
105
+ this.searchData.category_id = id
106
+ this.getMessage()
107
+ },
108
+ async Searchcondition() {
109
+ const res = await axios.post(this.url + '/home/Searchcondition/index', { uid: this.uid, notify_category: 1 })
110
+ if (res.data.status_code === 1) {
111
+ this.options.buttonList = res.data.data.notify_category
112
+ }
113
+ },
114
+ async getMessage() {
115
+ const res = await axios.post(this.url + '/home/notify/list', this.searchData)
116
+ if (res.data.status_code === 1) {
117
+ this.messageData = res.data.data.data
118
+ }
119
+ },
120
+ async getSwiper() {
121
+ const res = await axios.post(this.url + '/home/carousel/list', { uid: this.uid })
122
+ if (res.data.status_code === 1) {
123
+ this.swiperData = res.data.data.data
124
+ }
125
+ },
126
+ returnCategory(id) {
127
+ const list = this.options.buttonList.filter(data => {
128
+ return data.value === id
129
+ })
130
+ if (list.length) {
131
+ return list[0].label
132
+ } else {
133
+ return '掌资讯'
134
+ }
135
+ },
136
+ returnCategoryImg(id) {
137
+ switch (id) {
138
+ case '1':
139
+ return require('./img/1.png')
140
+ break
141
+ case '2':
142
+ return require('./img/2.png')
143
+ break
144
+ case '3':
145
+ return require('./img/3.png')
146
+ break
147
+ case '4':
148
+ return require('./img/4.png')
149
+ break
150
+ default:
151
+ return require('./img/1.png')
152
+ }
153
+ },
154
+ getDataDetail(data) {
155
+ this.sendRaed(data)
156
+ this.getDetail(this.uid, data.id)
157
+ },
158
+ // 数据已读
159
+ async sendRaed(data) {
160
+ const res = await axios.post(this.url + '/home/notify/read', { uid: this.uid, notify_id: data.id })
161
+ if (res.data.status_code === 1) {
162
+ data.is_read = true
163
+ }
164
+ },
165
+ // 数据详情
166
+ async getDetail(uid, notify_id) {
167
+ const res = await axios.post(this.url + '/home/notify/detail', { uid, notify_id })
168
+ if (res.data.status_code === 1) {
169
+ this.dataDetail.data = res.data.data.data
170
+ this.dataDetail.isShow = true
171
+ }
172
+ },
173
+ handleClose() {
174
+ this.dataDetail.isShow = false
175
+ }
176
+ }
177
+ }
178
+ </script>
179
+
180
+ <style lang="scss" scoped>
181
+ .content {
182
+ width: 100%;
183
+ background: #ffffff;
184
+ border-radius: 2px;
185
+ .swiper {
186
+ width: 100%;
187
+ height: 19.5vw;
188
+ .swiper_data {
189
+ .swiper_content {
190
+ width: 100%;
191
+ height: 19.5vw;
192
+ background: url(./img/swiperBg.png) no-repeat;
193
+ background-size: 100% 100%;
194
+ display: flex;
195
+ box-sizing: border-box;
196
+ padding: 1.5vw 6vw;
197
+ .swiper_message {
198
+ .title {
199
+ width: 31.5vw;
200
+ height: 3vw;
201
+ font-size: 2.1vw;
202
+ font-weight: 500;
203
+ color: #333333;
204
+ line-height: 3vw;
205
+ }
206
+ .desc {
207
+ width: 31.5vw;
208
+ height: 1.1vw;
209
+ font-size: 0.8vw;
210
+ font-weight: 400;
211
+ color: #333333;
212
+ line-height: 1.1vw;
213
+ margin-top: 1.5vw;
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ .data {
220
+ .data_search {
221
+ margin: 1vw 3.5vw;
222
+ display: flex;
223
+ justify-content: space-between;
224
+ }
225
+ .data_content {
226
+ margin: 0 3.5vw;
227
+ display: flex;
228
+ justify-content: space-between;
229
+ flex-wrap: wrap;
230
+ .message_item {
231
+ width: 37vw;
232
+ height: 9vw;
233
+ background: #f8f8fa;
234
+ box-shadow: 0px 0.1vw 0.45vw 0px rgba(168, 203, 255, 0.36);
235
+ border-radius: 0.2vw;
236
+ border: 0.1vw solid #ffffff;
237
+ margin-bottom: 1.5vw;
238
+ box-sizing: border-box;
239
+ padding: 1vw;
240
+ position: relative;
241
+ left: 0;
242
+ top: 0;
243
+ &:nth-child(3) {
244
+ margin-bottom: 0;
245
+ }
246
+ &:nth-child(4) {
247
+ margin-bottom: 0;
248
+ }
249
+ .item_title {
250
+ display: flex;
251
+ height: 1vw;
252
+ img {
253
+ width: 1vw;
254
+ height: 1vw;
255
+ }
256
+ p {
257
+ height: 1vw;
258
+ line-height: 1vw;
259
+ margin: 0 0 0 0.5vw;
260
+ }
261
+ }
262
+ .item_content {
263
+ margin-top: 1.6vw;
264
+ display: flex;
265
+ img {
266
+ width: 4vw;
267
+ height: 4vw;
268
+ margin-right: 1.2vw;
269
+ }
270
+ .content_content {
271
+ width: 31vw;
272
+ position: relative;
273
+ top: 0;
274
+ left: 0;
275
+ .content_title {
276
+ max-width: 20vw;
277
+ height: 1.1vw;
278
+ font-size: 0.8vw;
279
+ font-weight: 500;
280
+ color: #333333;
281
+ line-height: 1.1vw;
282
+ overflow: hidden;
283
+ white-space: nowrap;
284
+ text-overflow: ellipsis;
285
+ }
286
+ .content_desc {
287
+ max-width: 26vw;
288
+ height: 1vw;
289
+ margin-top: 0.8vw;
290
+ font-size: 0.7vw;
291
+ font-weight: 400;
292
+ color: #333333;
293
+ line-height: 1vw;
294
+ overflow: hidden;
295
+ white-space: nowrap;
296
+ text-overflow: ellipsis;
297
+ }
298
+ .content_time {
299
+ position: absolute;
300
+ left: 22vw;
301
+ top: 0.05vw;
302
+ width: 8vw;
303
+ height: 1vw;
304
+ font-size: 0.7vw;
305
+ font-weight: 400;
306
+ color: #333333;
307
+ line-height: 1vw;
308
+ overflow: hidden;
309
+ white-space: nowrap;
310
+ text-overflow: ellipsis;
311
+ }
312
+ }
313
+ }
314
+ .is_read {
315
+ position: absolute;
316
+ right: 0.1vw;
317
+ top: 0.3vw;
318
+ width: 1.5vw;
319
+ height: 0.8vw;
320
+ }
321
+ }
322
+ }
323
+ }
324
+ .detail {
325
+ width: 100%;
326
+ box-sizing: border-box;
327
+ padding: 0 20px;
328
+ .detail_title {
329
+ width: 440px;
330
+ height: 22px;
331
+ font-size: 16px;
332
+ font-weight: 500;
333
+ color: #333333;
334
+ line-height: 22px;
335
+ overflow: hidden;
336
+ white-space: nowrap;
337
+ text-overflow: ellipsis;
338
+ }
339
+ .detail_time {
340
+ width: 320px;
341
+ height: 16px;
342
+ margin-top: 12px;
343
+ font-size: 12px;
344
+ font-weight: 400;
345
+ color: #999999;
346
+ line-height: 16px;
347
+ overflow: hidden;
348
+ white-space: nowrap;
349
+ text-overflow: ellipsis;
350
+ }
351
+ .detail_desc {
352
+ margin-top: 24px;
353
+ width: 500px;
354
+ font-size: 14px;
355
+ font-weight: 400;
356
+ color: #333333;
357
+ line-height: 20px;
358
+ }
359
+ .detail_content {
360
+ width: 520px;
361
+ margin-top: 24px;
362
+ overflow-y: auto;
363
+ .content_content {
364
+ width: 500px;
365
+ }
366
+ }
367
+ }
368
+ }
369
+ </style>
@@ -1,10 +1,10 @@
1
- module.exports = {
2
- plugins: ['cypress'],
3
- env: {
4
- mocha: true,
5
- 'cypress/globals': true
6
- },
7
- rules: {
8
- strict: 'off'
9
- }
10
- }
1
+ module.exports = {
2
+ plugins: ['cypress'],
3
+ env: {
4
+ mocha: true,
5
+ 'cypress/globals': true
6
+ },
7
+ rules: {
8
+ strict: 'off'
9
+ }
10
+ }
@@ -1,25 +1,25 @@
1
- /* eslint-disable arrow-body-style */
2
- // https://docs.cypress.io/guides/guides/plugins-guide.html
3
-
4
- // if you need a custom webpack configuration you can uncomment the following import
5
- // and then use the `file:preprocessor` event
6
- // as explained in the cypress docs
7
- // https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
8
-
9
- // /* eslint-disable import/no-extraneous-dependencies, global-require */
10
- // const webpack = require('@cypress/webpack-preprocessor')
11
-
12
- module.exports = (on, config) => {
13
- // on('file:preprocessor', webpack({
14
- // webpackOptions: require('@vue/cli-service/webpack.config'),
15
- // watchOptions: {}
16
- // }))
17
-
18
- return Object.assign({}, config, {
19
- fixturesFolder: 'tests/e2e/fixtures',
20
- integrationFolder: 'tests/e2e/specs',
21
- screenshotsFolder: 'tests/e2e/screenshots',
22
- videosFolder: 'tests/e2e/videos',
23
- supportFile: 'tests/e2e/support/index.js'
24
- })
25
- }
1
+ /* eslint-disable arrow-body-style */
2
+ // https://docs.cypress.io/guides/guides/plugins-guide.html
3
+
4
+ // if you need a custom webpack configuration you can uncomment the following import
5
+ // and then use the `file:preprocessor` event
6
+ // as explained in the cypress docs
7
+ // https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
8
+
9
+ // /* eslint-disable import/no-extraneous-dependencies, global-require */
10
+ // const webpack = require('@cypress/webpack-preprocessor')
11
+
12
+ module.exports = (on, config) => {
13
+ // on('file:preprocessor', webpack({
14
+ // webpackOptions: require('@vue/cli-service/webpack.config'),
15
+ // watchOptions: {}
16
+ // }))
17
+
18
+ return Object.assign({}, config, {
19
+ fixturesFolder: 'tests/e2e/fixtures',
20
+ integrationFolder: 'tests/e2e/specs',
21
+ screenshotsFolder: 'tests/e2e/screenshots',
22
+ videosFolder: 'tests/e2e/videos',
23
+ supportFile: 'tests/e2e/support/index.js'
24
+ })
25
+ }
@@ -1,8 +1,8 @@
1
- // https://docs.cypress.io/api/introduction/api.html
2
-
3
- describe('My First Test', () => {
4
- it('Visits the app root url', () => {
5
- cy.visit('/')
6
- cy.contains('h1', 'Welcome to Your Vue.js App')
7
- })
8
- })
1
+ // https://docs.cypress.io/api/introduction/api.html
2
+
3
+ describe('My First Test', () => {
4
+ it('Visits the app root url', () => {
5
+ cy.visit('/')
6
+ cy.contains('h1', 'Welcome to Your Vue.js App')
7
+ })
8
+ })
@@ -1,25 +1,25 @@
1
- // ***********************************************
2
- // This example commands.js shows you how to
3
- // create various custom commands and overwrite
4
- // existing commands.
5
- //
6
- // For more comprehensive examples of custom
7
- // commands please read more here:
8
- // https://on.cypress.io/custom-commands
9
- // ***********************************************
10
- //
11
- //
12
- // -- This is a parent command --
13
- // Cypress.Commands.add("login", (email, password) => { ... })
14
- //
15
- //
16
- // -- This is a child command --
17
- // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18
- //
19
- //
20
- // -- This is a dual command --
21
- // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22
- //
23
- //
24
- // -- This is will overwrite an existing command --
25
- // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
1
+ // ***********************************************
2
+ // This example commands.js shows you how to
3
+ // create various custom commands and overwrite
4
+ // existing commands.
5
+ //
6
+ // For more comprehensive examples of custom
7
+ // commands please read more here:
8
+ // https://on.cypress.io/custom-commands
9
+ // ***********************************************
10
+ //
11
+ //
12
+ // -- This is a parent command --
13
+ // Cypress.Commands.add("login", (email, password) => { ... })
14
+ //
15
+ //
16
+ // -- This is a child command --
17
+ // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
18
+ //
19
+ //
20
+ // -- This is a dual command --
21
+ // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
22
+ //
23
+ //
24
+ // -- This is will overwrite an existing command --
25
+ // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
@@ -1,20 +1,20 @@
1
- // ***********************************************************
2
- // This example support/index.js is processed and
3
- // loaded automatically before your test files.
4
- //
5
- // This is a great place to put global configuration and
6
- // behavior that modifies Cypress.
7
- //
8
- // You can change the location of this file or turn off
9
- // automatically serving support files with the
10
- // 'supportFile' configuration option.
11
- //
12
- // You can read more here:
13
- // https://on.cypress.io/configuration
14
- // ***********************************************************
15
-
16
- // Import commands.js using ES2015 syntax:
17
- import './commands'
18
-
19
- // Alternatively you can use CommonJS syntax:
20
- // require('./commands')
1
+ // ***********************************************************
2
+ // This example support/index.js is processed and
3
+ // loaded automatically before your test files.
4
+ //
5
+ // This is a great place to put global configuration and
6
+ // behavior that modifies Cypress.
7
+ //
8
+ // You can change the location of this file or turn off
9
+ // automatically serving support files with the
10
+ // 'supportFile' configuration option.
11
+ //
12
+ // You can read more here:
13
+ // https://on.cypress.io/configuration
14
+ // ***********************************************************
15
+
16
+ // Import commands.js using ES2015 syntax:
17
+ import './commands'
18
+
19
+ // Alternatively you can use CommonJS syntax:
20
+ // require('./commands')
@@ -1,13 +1,13 @@
1
- import { expect } from 'chai'
2
- import { shallowMount } from '@vue/test-utils'
3
- import HelloWorld from '@/components/HelloWorld.vue'
4
-
5
- describe('HelloWorld.vue', () => {
6
- it('renders props.msg when passed', () => {
7
- const msg = 'new message'
8
- const wrapper = shallowMount(HelloWorld, {
9
- propsData: { msg }
10
- })
11
- expect(wrapper.text()).to.include(msg)
12
- })
13
- })
1
+ import { expect } from 'chai'
2
+ import { shallowMount } from '@vue/test-utils'
3
+ import HelloWorld from '@/components/HelloWorld.vue'
4
+
5
+ describe('HelloWorld.vue', () => {
6
+ it('renders props.msg when passed', () => {
7
+ const msg = 'new message'
8
+ const wrapper = shallowMount(HelloWorld, {
9
+ propsData: { msg }
10
+ })
11
+ expect(wrapper.text()).to.include(msg)
12
+ })
13
+ })