bi-element-ui 0.1.41 → 0.1.42

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 (53) 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/css/about.e70f66ed.css +1 -0
  7. package/dist/css/chunk-vendors.5ad50e34.css +1 -0
  8. package/dist/css/index.6f2c0574.css +1 -0
  9. package/dist/index.html +1 -1
  10. package/dist/js/about.62e2a880.js +2 -0
  11. package/dist/js/chunk-vendors.7136a723.js +41 -0
  12. package/dist/js/index.af0dae4e.js +2 -0
  13. package/lib/bi-element-ui.common.js +23129 -22942
  14. package/lib/bi-element-ui.css +1 -1
  15. package/lib/bi-element-ui.umd.js +23129 -22942
  16. package/lib/bi-element-ui.umd.min.js +2 -279
  17. package/package.json +57 -57
  18. package/src/App.vue +41 -41
  19. package/src/components/BiDatePicker/datePickerOption.js +229 -229
  20. package/src/components/BiDatePicker/index.vue +74 -74
  21. package/src/components/BiTable/columu.vue +104 -104
  22. package/src/components/BiTable/forced.js +76 -76
  23. package/src/components/BiTable/index.js +6 -6
  24. package/src/components/BiTable/render.vue +13 -13
  25. package/src/components/BiTable/table.vue +202 -202
  26. package/src/components/BiTableColumn/Group.vue +277 -277
  27. package/src/components/BiTableColumn/api.js +16 -16
  28. package/src/components/BiTableColumn/index.vue +614 -614
  29. package/src/components/BiTooltipIcon/index.vue +71 -71
  30. package/src/components/EditBtn.vue +15 -15
  31. package/src/components/FreeButton/index.vue +69 -69
  32. package/src/components/Pagination/index.vue +104 -104
  33. package/src/components/Pagination/scrollTo.js +69 -69
  34. package/src/main.js +18 -18
  35. package/src/router/index.js +34 -34
  36. package/src/store/index.js +11 -11
  37. package/src/table.js +463 -463
  38. package/src/views/Date.vue +132 -132
  39. package/src/views/Home.vue +330 -330
  40. package/src/views/Scene.vue +140 -140
  41. package/src/views/Table.vue +220 -220
  42. package/tests/e2e/.eslintrc.js +10 -10
  43. package/tests/e2e/plugins/index.js +25 -25
  44. package/tests/e2e/specs/test.js +8 -8
  45. package/tests/e2e/support/commands.js +25 -25
  46. package/tests/e2e/support/index.js +20 -20
  47. package/tests/unit/example.spec.js +13 -13
  48. package/dist/css/about.6cfcc147.css +0 -1
  49. package/dist/css/chunk-vendors.8140bef9.css +0 -1
  50. package/dist/css/index.59a106c6.css +0 -1
  51. package/dist/js/about.a5370aa0.js +0 -2
  52. package/dist/js/chunk-vendors.a9a38d93.js +0 -318
  53. package/dist/js/index.8837e62a.js +0 -2
@@ -1,277 +1,277 @@
1
- <template>
2
- <el-dialog custom-class="dialog-class dialog-width" title="自定义列" :visible.sync="dialogVisible" width="620px">
3
- <div class="dialog-body" style="min-height: 160px">
4
- <div class="checkbox-container" style="width: auto; margin: 0 auto">
5
- <div v-for="(item, index) in colList" :key="index" class="checkbox-item">
6
- <p>
7
- <el-checkbox
8
- v-model="item.status"
9
- @change="
10
- val => {
11
- return handleCheckAllChange(val, item)
12
- }
13
- "
14
- >{{ item.content }}</el-checkbox
15
- >
16
- </p>
17
- <p style="padding: 0 20px">
18
- <el-checkbox-group
19
- v-model="checkList"
20
- :true-label="1"
21
- :false-label="0"
22
- @change="
23
- val => {
24
- return handleCheckedColChange(val, item)
25
- }
26
- "
27
- >
28
- <el-checkbox
29
- v-for="(city, childrenIndex) in item.children"
30
- :key="childrenIndex"
31
- :label="city.name"
32
- style="width:120px;margin:0 15px 15px 0;"
33
- @change="
34
- val => {
35
- return handleChange(val, city)
36
- }
37
- "
38
- >
39
- {{ city.content }}
40
- </el-checkbox>
41
- </el-checkbox-group>
42
- </p>
43
- </div>
44
- <!-- <span
45
- v-for="(item, index) in colList"
46
- :key="index"
47
- style="
48
- display: inline-block;
49
- width: 80px;
50
- margin: 0 25px;
51
- line-height: 35px;
52
- "
53
- >
54
- <el-checkbox @change="checkChange($event,item)"
55
- v-model="item.check" :label="item.name">
56
- {{item.content}}
57
- </el-checkbox>
58
- </span> -->
59
- </div>
60
- </div>
61
- <span slot="footer" class="dialog-footer" style="display: flex; justify-content: space-between">
62
- <span style="display: inline-block; line-height: 32px">
63
- <el-checkbox v-model="checkAllData" label="全选" @change="checkAll">
64
- 全选
65
- </el-checkbox>
66
- </span>
67
- <el-button @click="dialogVisible = false">关闭</el-button>
68
- </span>
69
- </el-dialog>
70
- </template>
71
-
72
- <script>
73
- import { saveOperate, getList } from './api'
74
- export default {
75
- props: {
76
- value: {
77
- type: Boolean,
78
- default: false
79
- },
80
- listType: {
81
- type: String,
82
- require: true,
83
- default: ''
84
- },
85
- granularity: {
86
- type: String,
87
- default: 'day'
88
- },
89
- checkData: {
90
- type: Array,
91
- require: true,
92
- default: () => {
93
- return []
94
- }
95
- },
96
- viewsColumn: {
97
- type: Array,
98
- default: () => {
99
- return []
100
- }
101
- }
102
- },
103
- data() {
104
- return {
105
- colList: [],
106
- checkList: [], // 存放勾选数据
107
- checkAllData: false
108
- }
109
- },
110
- computed: {
111
- dialogVisible: {
112
- get() {
113
- return this.value
114
- },
115
- set(val) {
116
- this.$emit('input', val)
117
- }
118
- },
119
- tableColumnList() {
120
- const obj = {}
121
- this.colList.map(group => {
122
- if (group.children && group.children.length) {
123
- group.children.map(item => {
124
- obj[item.name] = Boolean(item.status)
125
- })
126
- } else {
127
- obj[group.name] = Boolean(group.status)
128
- }
129
- })
130
- return obj
131
- }
132
- },
133
- watch: {
134
- viewsColumn() {
135
- if (this.viewsColumn.length > 0 && this.viewsColumn !== this.colList) {
136
- this.colList = this.viewsColumn
137
- this.defaultCheck()
138
- this.$emit('handleTableColumnList', this.tableColumnList)
139
- }
140
- },
141
- colList: {
142
- handler(now, old) {
143
- let i = true
144
- now.forEach((item, index) => {
145
- item.status = Boolean(item.status)
146
- if (item.status) {
147
- this.checkAllData = item.status
148
- } else {
149
- i = false
150
- }
151
- this.checkAllData = i
152
- })
153
- },
154
-
155
- deep: true
156
- },
157
- granularity() {
158
- this.granularityLabel()
159
- },
160
- checkList: {
161
- handler(now, old) {
162
- this.$emit('showTableColumn', { colList: now })
163
- this.saveOperate()
164
- },
165
- deep: true
166
- }
167
- },
168
-
169
- mounted() {
170
- this.getList(this.listType)
171
- },
172
- beforeDestroy() {
173
- this.visible = false
174
- this.checkList = []
175
- },
176
- methods: {
177
- granularityLabel() {
178
- this.colList[0].children.map(item => {
179
- if (this.granularity === 'week') {
180
- item.name === 'today_roi' && (item.content = '当周回本')
181
- item.name === 'date_num' && (item.content = '回本周数')
182
- } else if (this.granularity === 'month') {
183
- item.name === 'today_roi' && (item.content = '当月回本')
184
- item.name === 'date_num' && (item.content = '回本月数')
185
- }
186
- })
187
- },
188
- // 获取列表
189
- async getList(params) {
190
- const res = await getList(params)
191
- if (res.status_code === 1) {
192
- this.colList = res.data
193
- this.defaultCheck()
194
- this.$emit('handleTableColumnList', this.tableColumnList)
195
- }
196
- },
197
- // 全选
198
- checkAll(val) {
199
- this.colList.forEach((item, index) => {
200
- this.handleCheckAllChange(val, item)
201
- item.status = val
202
- // item.children.forEach((em) => {
203
- // if (em.check) {
204
- // this.checkList.push(em.label);
205
- // }
206
- // });
207
- })
208
- if (!val) {
209
- this.checkList = []
210
- }
211
- },
212
- // 默认勾选
213
- defaultCheck() {
214
- this.checkList = []
215
- this.colList.forEach((item, index) => {
216
- item.children.forEach(em => {
217
- if (em.status) {
218
- this.checkList.push(em.name)
219
- }
220
- })
221
- })
222
- },
223
- // 分类全选
224
- handleCheckAllChange(val, item) {
225
- item.children.forEach((em, inx) => {
226
- em.status = val ? 1 : 0
227
- if (em.status) {
228
- if (this.checkList.indexOf(em.name) === -1) {
229
- this.checkList.push(em.name)
230
- }
231
- } else {
232
- this.checkAllData = false
233
- const index = this.checkList.indexOf(em.name)
234
- this.checkList.splice(index, 1)
235
- }
236
- })
237
- // this.saveOperate()
238
- },
239
- // 勾选框组监听选中数组
240
- handleCheckedColChange(array, item) {
241
- let flag = true
242
- item.children.forEach(em => {
243
- if (em.status) {
244
- item.status = true
245
- } else {
246
- flag = false
247
- }
248
- })
249
- item.status = flag
250
- // this.saveOperate()
251
- },
252
- // 勾选框单个变化
253
- handleChange(val, item) {
254
- item.status = val ? 1 : 0
255
- if (!val) {
256
- this.checkAllData = false
257
- }
258
- },
259
- // 发送数据
260
- async saveOperate() {
261
- // 数组变化调用接口保存全部数据
262
- const params = JSON.parse(JSON.stringify(this.colList))
263
- var arr = []
264
- params.forEach((item, index) => {
265
- item.status = item.status ? 1 : 0
266
- arr.push(...item.children)
267
- })
268
- const data = JSON.stringify(arr)
269
- await saveOperate(data)
270
- this.$emit('handleTableColumnList', this.tableColumnList)
271
- this.$emit('viewsColumn', this.colList)
272
- }
273
- }
274
- }
275
- </script>
276
-
277
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <el-dialog custom-class="dialog-class dialog-width" title="自定义列" :visible.sync="dialogVisible" width="620px">
3
+ <div class="dialog-body" style="min-height: 160px">
4
+ <div class="checkbox-container" style="width: auto; margin: 0 auto">
5
+ <div v-for="(item, index) in colList" :key="index" class="checkbox-item">
6
+ <p>
7
+ <el-checkbox
8
+ v-model="item.status"
9
+ @change="
10
+ val => {
11
+ return handleCheckAllChange(val, item)
12
+ }
13
+ "
14
+ >{{ item.content }}</el-checkbox
15
+ >
16
+ </p>
17
+ <p style="padding: 0 20px">
18
+ <el-checkbox-group
19
+ v-model="checkList"
20
+ :true-label="1"
21
+ :false-label="0"
22
+ @change="
23
+ val => {
24
+ return handleCheckedColChange(val, item)
25
+ }
26
+ "
27
+ >
28
+ <el-checkbox
29
+ v-for="(city, childrenIndex) in item.children"
30
+ :key="childrenIndex"
31
+ :label="city.name"
32
+ style="width:120px;margin:0 15px 15px 0;"
33
+ @change="
34
+ val => {
35
+ return handleChange(val, city)
36
+ }
37
+ "
38
+ >
39
+ {{ city.content }}
40
+ </el-checkbox>
41
+ </el-checkbox-group>
42
+ </p>
43
+ </div>
44
+ <!-- <span
45
+ v-for="(item, index) in colList"
46
+ :key="index"
47
+ style="
48
+ display: inline-block;
49
+ width: 80px;
50
+ margin: 0 25px;
51
+ line-height: 35px;
52
+ "
53
+ >
54
+ <el-checkbox @change="checkChange($event,item)"
55
+ v-model="item.check" :label="item.name">
56
+ {{item.content}}
57
+ </el-checkbox>
58
+ </span> -->
59
+ </div>
60
+ </div>
61
+ <span slot="footer" class="dialog-footer" style="display: flex; justify-content: space-between">
62
+ <span style="display: inline-block; line-height: 32px">
63
+ <el-checkbox v-model="checkAllData" label="全选" @change="checkAll">
64
+ 全选
65
+ </el-checkbox>
66
+ </span>
67
+ <el-button @click="dialogVisible = false">关闭</el-button>
68
+ </span>
69
+ </el-dialog>
70
+ </template>
71
+
72
+ <script>
73
+ import { saveOperate, getList } from './api'
74
+ export default {
75
+ props: {
76
+ value: {
77
+ type: Boolean,
78
+ default: false
79
+ },
80
+ listType: {
81
+ type: String,
82
+ require: true,
83
+ default: ''
84
+ },
85
+ granularity: {
86
+ type: String,
87
+ default: 'day'
88
+ },
89
+ checkData: {
90
+ type: Array,
91
+ require: true,
92
+ default: () => {
93
+ return []
94
+ }
95
+ },
96
+ viewsColumn: {
97
+ type: Array,
98
+ default: () => {
99
+ return []
100
+ }
101
+ }
102
+ },
103
+ data() {
104
+ return {
105
+ colList: [],
106
+ checkList: [], // 存放勾选数据
107
+ checkAllData: false
108
+ }
109
+ },
110
+ computed: {
111
+ dialogVisible: {
112
+ get() {
113
+ return this.value
114
+ },
115
+ set(val) {
116
+ this.$emit('input', val)
117
+ }
118
+ },
119
+ tableColumnList() {
120
+ const obj = {}
121
+ this.colList.map(group => {
122
+ if (group.children && group.children.length) {
123
+ group.children.map(item => {
124
+ obj[item.name] = Boolean(item.status)
125
+ })
126
+ } else {
127
+ obj[group.name] = Boolean(group.status)
128
+ }
129
+ })
130
+ return obj
131
+ }
132
+ },
133
+ watch: {
134
+ viewsColumn() {
135
+ if (this.viewsColumn.length > 0 && this.viewsColumn !== this.colList) {
136
+ this.colList = this.viewsColumn
137
+ this.defaultCheck()
138
+ this.$emit('handleTableColumnList', this.tableColumnList)
139
+ }
140
+ },
141
+ colList: {
142
+ handler(now, old) {
143
+ let i = true
144
+ now.forEach((item, index) => {
145
+ item.status = Boolean(item.status)
146
+ if (item.status) {
147
+ this.checkAllData = item.status
148
+ } else {
149
+ i = false
150
+ }
151
+ this.checkAllData = i
152
+ })
153
+ },
154
+
155
+ deep: true
156
+ },
157
+ granularity() {
158
+ this.granularityLabel()
159
+ },
160
+ checkList: {
161
+ handler(now, old) {
162
+ this.$emit('showTableColumn', { colList: now })
163
+ this.saveOperate()
164
+ },
165
+ deep: true
166
+ }
167
+ },
168
+
169
+ mounted() {
170
+ this.getList(this.listType)
171
+ },
172
+ beforeDestroy() {
173
+ this.visible = false
174
+ this.checkList = []
175
+ },
176
+ methods: {
177
+ granularityLabel() {
178
+ this.colList[0].children.map(item => {
179
+ if (this.granularity === 'week') {
180
+ item.name === 'today_roi' && (item.content = '当周回本')
181
+ item.name === 'date_num' && (item.content = '回本周数')
182
+ } else if (this.granularity === 'month') {
183
+ item.name === 'today_roi' && (item.content = '当月回本')
184
+ item.name === 'date_num' && (item.content = '回本月数')
185
+ }
186
+ })
187
+ },
188
+ // 获取列表
189
+ async getList(params) {
190
+ const res = await getList(params)
191
+ if (res.status_code === 1) {
192
+ this.colList = res.data
193
+ this.defaultCheck()
194
+ this.$emit('handleTableColumnList', this.tableColumnList)
195
+ }
196
+ },
197
+ // 全选
198
+ checkAll(val) {
199
+ this.colList.forEach((item, index) => {
200
+ this.handleCheckAllChange(val, item)
201
+ item.status = val
202
+ // item.children.forEach((em) => {
203
+ // if (em.check) {
204
+ // this.checkList.push(em.label);
205
+ // }
206
+ // });
207
+ })
208
+ if (!val) {
209
+ this.checkList = []
210
+ }
211
+ },
212
+ // 默认勾选
213
+ defaultCheck() {
214
+ this.checkList = []
215
+ this.colList.forEach((item, index) => {
216
+ item.children.forEach(em => {
217
+ if (em.status) {
218
+ this.checkList.push(em.name)
219
+ }
220
+ })
221
+ })
222
+ },
223
+ // 分类全选
224
+ handleCheckAllChange(val, item) {
225
+ item.children.forEach((em, inx) => {
226
+ em.status = val ? 1 : 0
227
+ if (em.status) {
228
+ if (this.checkList.indexOf(em.name) === -1) {
229
+ this.checkList.push(em.name)
230
+ }
231
+ } else {
232
+ this.checkAllData = false
233
+ const index = this.checkList.indexOf(em.name)
234
+ this.checkList.splice(index, 1)
235
+ }
236
+ })
237
+ // this.saveOperate()
238
+ },
239
+ // 勾选框组监听选中数组
240
+ handleCheckedColChange(array, item) {
241
+ let flag = true
242
+ item.children.forEach(em => {
243
+ if (em.status) {
244
+ item.status = true
245
+ } else {
246
+ flag = false
247
+ }
248
+ })
249
+ item.status = flag
250
+ // this.saveOperate()
251
+ },
252
+ // 勾选框单个变化
253
+ handleChange(val, item) {
254
+ item.status = val ? 1 : 0
255
+ if (!val) {
256
+ this.checkAllData = false
257
+ }
258
+ },
259
+ // 发送数据
260
+ async saveOperate() {
261
+ // 数组变化调用接口保存全部数据
262
+ const params = JSON.parse(JSON.stringify(this.colList))
263
+ var arr = []
264
+ params.forEach((item, index) => {
265
+ item.status = item.status ? 1 : 0
266
+ arr.push(...item.children)
267
+ })
268
+ const data = JSON.stringify(arr)
269
+ await saveOperate(data)
270
+ this.$emit('handleTableColumnList', this.tableColumnList)
271
+ this.$emit('viewsColumn', this.colList)
272
+ }
273
+ }
274
+ }
275
+ </script>
276
+
277
+ <style scoped lang="scss"></style>
@@ -1,16 +1,16 @@
1
- import request from '@/utils/request'
2
-
3
- export function getList(type) {
4
- return request({
5
- url: '/admin/tablehead/list',
6
- method: 'get',
7
- params: { type }
8
- })
9
- }
10
- export function saveOperate(head_info) {
11
- return request({
12
- url: '/admin/tablehead/operate',
13
- method: 'post',
14
- data: { head_info }
15
- })
16
- }
1
+ import request from '@/utils/request'
2
+
3
+ export function getList(type) {
4
+ return request({
5
+ url: '/admin/tablehead/list',
6
+ method: 'get',
7
+ params: { type }
8
+ })
9
+ }
10
+ export function saveOperate(head_info) {
11
+ return request({
12
+ url: '/admin/tablehead/operate',
13
+ method: 'post',
14
+ data: { head_info }
15
+ })
16
+ }