lambo-design-bi 0.0.1

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 (39) hide show
  1. package/bi/widget/README.md +18 -0
  2. package/bi/widget/api/data.js +48 -0
  3. package/bi/widget/atom/index.vue +36 -0
  4. package/bi/widget/atom/test.vue +36 -0
  5. package/bi/widget/config/config.js +7 -0
  6. package/bi/widget/container/card/card-widget.vue +46 -0
  7. package/bi/widget/container/card/comps/indicator-card/index.js +7 -0
  8. package/bi/widget/container/card/comps/indicator-card/src/indicator-card-bi-search.vue +132 -0
  9. package/bi/widget/container/card/comps/indicator-card/src/indicator-card-bi.vue +129 -0
  10. package/bi/widget/container/card/comps/indicator-card/src/indicator-card-item-bi.vue +97 -0
  11. package/bi/widget/container/card/comps/indicator-card/src/styles/css/card-search.less +108 -0
  12. package/bi/widget/container/card/comps/indicator-card/src/styles/css/card.less +114 -0
  13. package/bi/widget/layout/col.vue +35 -0
  14. package/bi/widget/layout/row.vue +40 -0
  15. package/bi/widget/num/index.vue +101 -0
  16. package/bi/widget/page/index.vue +38 -0
  17. package/bi/widget/search/search-form.vue +85 -0
  18. package/bi/widget/search/search-item.vue +205 -0
  19. package/bi/widget/table/detail-table.vue +65 -0
  20. package/bi/widget/table/paging-table.vue +188 -0
  21. package/bi/widget/util/widget-map.js +41 -0
  22. package/package.json +39 -0
  23. package/pub/charts/echarts.vue +57 -0
  24. package/pub/charts/factory/charts-factory.vue +58 -0
  25. package/pub/charts/factory/options.js +2351 -0
  26. package/pub/empty/index.vue +33 -0
  27. package/pub/helpbox/README.md +6 -0
  28. package/pub/helpbox/index.vue +363 -0
  29. package/pub/num-index/num-index.vue +120 -0
  30. package/pub/table/detail-table/index.vue +41 -0
  31. package/pub/table/paging-table/README.md +4 -0
  32. package/pub/table/paging-table/comps/export-data.vue +390 -0
  33. package/pub/table/paging-table/comps/export-drawer.vue +429 -0
  34. package/pub/table/paging-table/index.js +3 -0
  35. package/pub/table/paging-table/index.vue +1577 -0
  36. package/pub/table/paging-table/styles/css/index.less +190 -0
  37. package/pub/theme/color.js +3 -0
  38. package/util/math-util.js +71 -0
  39. package/util/num-util.js +16 -0
@@ -0,0 +1,33 @@
1
+ <template>
2
+ <div>
3
+ <el-empty :description="desc"></el-empty>
4
+ </div>
5
+ </template>
6
+ <script>
7
+
8
+ export default {
9
+ name: 'BiEmpty',
10
+ components: {},
11
+ props: {
12
+ desc: {
13
+ type: String,
14
+ default: ' '
15
+ }
16
+ },
17
+ data() {
18
+ return {
19
+
20
+ }
21
+ },
22
+ methods: {
23
+
24
+ },
25
+ created() {
26
+ console.log("未获取到内容,显示空白组件")
27
+ },
28
+ mounted() {
29
+
30
+ }
31
+ }
32
+ </script>
33
+ <style scoped></style>
@@ -0,0 +1,6 @@
1
+ ## @lambo-design/help-box复制修改版本,主要为自定义报表使用
2
+ ## !!!!注意,常规组件,请优先使用@lambo-design/help-box
3
+ - 多余地方删除,watch监听的地方,去掉了
4
+ selectedKey: function () {
5
+ this.init();
6
+ }
@@ -0,0 +1,363 @@
1
+ <template>
2
+ <Modal v-model="boxShow" :title="boxTitle" :width="width" :styles="{ top: '60px' }"
3
+ @on-visible-change="onVisibleChange" @on-cancel="onCancel">
4
+ <div v-show="boxShow" style="max-height: 530px;overflow-y:auto;overflow-x:hidden;">
5
+ <LamboPagingTableBi ref="helpBoxTable" :columns="tableColumnsClone" :dataUrl="tableUrl"
6
+ :searchParams="searchParams" :showTableOption="false" :transformResponse="transformResponse" size="small"
7
+ @on-row-click="onRowClick" @on-selection-change="onSelectionChange" @on-select="onSelect"
8
+ @on-select-cancel="onSelectCancel" @on-select-all="onSelectAll" @on-select-all-cancel="onSelectAllCancel">
9
+ <slot slot="search" name="search-extend">
10
+ <span v-if='searchName != 1' style="margin:0px 10px ">{{ searchName }}</span>
11
+ <Input v-model="searchText" maxlength="50" placeholder="搜索" style="width: 200px" />
12
+ <Button icon="ios-search" style="margin-left:10px;" type="primary" @click="doSearch">查询</Button>
13
+ <div v-if="rowName && multiSelect" class="tags">
14
+ <Tag v-for="item in selectTags" :key="item.key" :name="item.key" closable @on-close="tagClose">
15
+ {{ item.value }}
16
+ </Tag>
17
+ </div>
18
+ </slot>
19
+ </LamboPagingTableBi>
20
+ </div>
21
+ <div slot="footer">
22
+ <Button ghost type="primary" @click="onClear">{{ clearText }}</Button>
23
+ <Button type="primary" @click="onOk">确定</Button>
24
+ </div>
25
+ </Modal>
26
+ </template>
27
+ <script>
28
+ import LamboPagingTableBi from "../table/paging-table"
29
+ import { deepCopy } from "@lambo-design/shared/utils/assist"
30
+
31
+ export default {
32
+ name: "LamboHelpBoxBi",
33
+ components: {
34
+ LamboPagingTableBi
35
+ },
36
+ props: {
37
+ value: Boolean,
38
+ url: String,
39
+ columns: Array,
40
+ title: {
41
+ type: String,
42
+ default: "帮助框"
43
+ },
44
+ width: {
45
+ type: Number,
46
+ default: 520
47
+ },
48
+ multiSelect: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ //外部查询条件
53
+ helpBoxSearchParams: {
54
+ type: Object,
55
+ default: function () {
56
+ return {}
57
+ }
58
+ },
59
+ clearText: {
60
+ type: String,
61
+ require: false,
62
+ default: "清空"
63
+ },
64
+ rowKey: {
65
+ type: String,
66
+ require: false,
67
+ default: ""
68
+ },
69
+ rowName: {
70
+ type: String,
71
+ require: false,
72
+ default: ""
73
+ },
74
+ //父组件回填已选中的值
75
+ selectedKey: {
76
+ type: Array,
77
+ require: false,
78
+ default: () => { return [] }
79
+ },
80
+ searchKey: {
81
+ type: String,
82
+ require: false,
83
+ default: "search"
84
+ },
85
+ searchName: {
86
+ type: String,
87
+ require: false,
88
+ default: "1"
89
+ },
90
+ padding: {
91
+ type: [String, Number],
92
+ require: false,
93
+ default: "0"
94
+ }
95
+ },
96
+ data() {
97
+ return {
98
+ boxShow: this.value,
99
+ searchText: "",
100
+ reSetPages: false,
101
+ selection: [],
102
+ selectStore: [],
103
+ selectTags: [],
104
+ selectRows: [],
105
+ selectedKeys: [],
106
+ searchParams: {},
107
+ tableColumnsClone: [],
108
+ timer: {}
109
+ }
110
+ },
111
+ computed: {
112
+ tableUrl: function () {
113
+ return this.url
114
+ },
115
+ boxTitle: function () {
116
+ return this.title
117
+ }
118
+ },
119
+ methods: {
120
+ init: function () {
121
+ this.clearSelectData()
122
+ this.selectedKeys = this.selectedKey
123
+ if (this.rowKey) {
124
+ for (let item of this.selectedKeys) {
125
+ this.selectRows[item[this.rowKey]] = item;
126
+ let tagItem = { "key": item[this.rowKey], "value": item[this.rowName] }
127
+ this.selectTags.push(tagItem);
128
+ }
129
+ }
130
+ let self = this;
131
+ self.selectStore = [];
132
+ let selectColumn = {
133
+ width: 80,
134
+ align: 'center',
135
+ title: "选择"
136
+ };
137
+ if (this.multiSelect) {
138
+ selectColumn.type = "selection"
139
+ } else {
140
+ //当前iView版本单选要自己实现
141
+ selectColumn.render = function (h, params) {
142
+ let index = params.index;
143
+ let value = false;
144
+ if (self.selectRows && self.rowKey && self.selectRows[params.row[self.rowKey]]) {
145
+ value = true;
146
+ } else {
147
+ value = self.selection[index] === undefined ? false : self.selection[index]
148
+ }
149
+ return h("Radio", {
150
+ props: {
151
+ "value": value
152
+ },
153
+ on: {
154
+ "on-change": function () {
155
+ self.selectOnChange(params.row, index);
156
+ }
157
+ }
158
+ })
159
+ }
160
+ }
161
+ this.tableColumnsClone = deepCopy(this.columns)
162
+ this.tableColumnsClone.unshift(selectColumn);
163
+ this.searchParams = Object.assign({}, {
164
+ search: self.searchText
165
+ }, self.helpBoxSearchParams);
166
+ },
167
+ onOk: function () {
168
+ let result = null;
169
+ if (this.rowKey) {
170
+ let selectStore = [];
171
+ for (let item in this.selectRows) {
172
+ selectStore.push(this.selectRows[item]);
173
+ }
174
+ result = selectStore;
175
+ this.selectStore = selectStore;
176
+ }
177
+ if (this.selectStore.length > 0) {
178
+ if (this.multiSelect) {
179
+ result = this.selectStore
180
+ } else {
181
+ result = this.selectStore[0]
182
+ }
183
+ this.$emit("on-ok", result);
184
+ this.$emit("input", false);
185
+ this.clearSelectData();
186
+ this.boxShow = false;
187
+ } else {
188
+ this.$Message.error("请选择一条记录");
189
+ }
190
+ },
191
+ onClear: function () {
192
+ this.clearSelectData();
193
+ this.$emit("onClear");
194
+ this.$emit("input", false);
195
+ this.boxShow = false;
196
+ },
197
+ onVisibleChange: function (value) {
198
+ this.$emit("on-visible-change", value);
199
+ },
200
+ onCancel: function () {
201
+ this.clearSelectData();
202
+ this.$emit("input", false);
203
+ this.boxShow = false;
204
+ },
205
+ doSearch: function () {
206
+ //this.clearSelectData();
207
+ this.searchParams = Object.assign({}, {
208
+ [this.searchKey]: this.searchText
209
+ }, this.helpBoxSearchParams);
210
+ },
211
+ /**
212
+ *
213
+ * @param row
214
+ * @param index
215
+ */
216
+ onRowClick: function (row, index) {
217
+ if (this.multiSelect) {
218
+ this.$refs.helpBoxTable.$refs.tableRef.toggleSelect(index);
219
+ } else {
220
+ this.selectOnChange(row, index);
221
+ }
222
+ },
223
+ //单选
224
+ selectOnChange: function (row, index) {
225
+ this.selection = Array(index).fill(false);
226
+ this.selection.splice(index, 1, true);
227
+ this.selectStore = [row];
228
+ if (!this.rowKey) {
229
+ this.selectStore = [row];
230
+ } else {
231
+ this.selectStore = [row];
232
+ this.selectRows = {}
233
+ this.selectRows[row[this.rowKey]] = row;
234
+ let tagItem = { "key": row[this.rowKey], "value": row[this.rowName] }
235
+ this.selectTags = [tagItem]
236
+ }
237
+ },
238
+ //多选
239
+ onSelectionChange: function (rows) {
240
+ if (!this.rowKey) {
241
+ this.selectStore = rows;
242
+ } else {
243
+ this.selectStore = rows;
244
+ if (rows && rows.length > 0) {
245
+ for (let i = 0; i < rows.length; i++) {
246
+ let row = rows[i];
247
+ if (!this.selectTags.some(item => item.key === row[this.rowKey])) {
248
+ this.selectRows[row[this.rowKey]] = row;
249
+ let tagItem = { "key": row[this.rowKey], "value": row[this.rowName] }
250
+ this.selectTags.push(tagItem);
251
+ }
252
+ }
253
+ }
254
+ }
255
+ },
256
+ onSelect: function (selection, row) {
257
+ if (this.rowKey) {
258
+ this.selectRows[row[this.rowKey]] = row;
259
+ }
260
+ },
261
+ onSelectCancel: function (selection, row) {
262
+ if (this.rowKey) {
263
+ delete this.selectRows[row[this.rowKey]];
264
+ const selectIndex = (this.selectTags || []).findIndex((selectItem) => selectItem.key === row[this.rowKey])
265
+ if (selectIndex > -1) {
266
+ this.selectTags.splice(selectIndex, 1);
267
+ }
268
+ }
269
+ },
270
+ onSelectAll: function (selection) {
271
+ if (this.rowKey) {
272
+ for (let item of selection) {
273
+ this.selectRows[item[this.rowKey]] = item;
274
+ }
275
+ }
276
+ },
277
+ onSelectAllCancel: function () {
278
+ if (this.rowKey) {
279
+ let currentTableData = this.$refs.helpBoxTable.$data.tableData;
280
+ for (let i = 0; i < currentTableData.length; i++) {
281
+ let tempData = currentTableData[i][this.rowKey];
282
+ delete this.selectRows[tempData];
283
+ const selectIndex = (this.selectTags || []).findIndex((selectItem) => selectItem.key === tempData)
284
+ if (selectIndex > -1) {
285
+ this.selectTags.splice(selectIndex, 1);
286
+ }
287
+ }
288
+ }
289
+ },
290
+ transformResponse: function (resp) {
291
+ if (this.rowKey) {
292
+ let self = this;
293
+ if (resp.code === 1 || resp.code === "000") {
294
+ let tableData = resp.data.rows;
295
+ for (let i = 0; i < tableData.length; i++) {
296
+ if (self.selectRows[tableData[i][self.rowKey]]) {
297
+ tableData[i]._checked = true;
298
+ }
299
+ }
300
+ resp.data.rows = tableData;
301
+ }
302
+ }
303
+ return resp;
304
+ },
305
+ clearSelectData: function () {
306
+ this.selection = [];//清空已选项
307
+ this.selectStore = [];//清空已选数据
308
+ this.selectRows = [];//清空已选数据
309
+ this.selectTags = [];//清空所选标签
310
+ this.selectedKeys = [];//清空默认选择
311
+ },
312
+ tagClose: function (event, name) {
313
+ const selectIndex = (this.selectTags || []).findIndex((selectItem) => selectItem.key === name)
314
+ const dataIndex = (this.$refs.helpBoxTable.$data.tableData || []).findIndex((selectItem) => selectItem[this.rowKey] === name)
315
+ if (selectIndex > -1) {
316
+ this.selectTags.splice(selectIndex, 1);
317
+ this.selectStore.splice(selectIndex, 1);
318
+ }
319
+ delete this.selectRows[name];
320
+ if (dataIndex > -1) {
321
+ this.$refs.helpBoxTable.$refs.tableRef.toggleSelect(dataIndex);
322
+ }
323
+ }
324
+ },
325
+ watch: {
326
+ value: function () {
327
+ if (this.value) {
328
+ this.boxShow = true;
329
+ this.searchText = "";
330
+ this.searchParams = Object.assign({}, {
331
+ search: this.searchText
332
+ }, this.helpBoxSearchParams);
333
+ }
334
+ },
335
+ multiSelect: function () {
336
+ this.init();
337
+ },
338
+ columns: function () {
339
+ this.init();
340
+ },
341
+ helpBoxSearchParams: function () {
342
+ this.init();
343
+ },
344
+ searchText: function () {
345
+ let self = this;
346
+ clearTimeout(self.timer);
347
+ self.timer = setTimeout(() => {
348
+ self.searchParams = Object.assign({}, {
349
+ search: self.searchText
350
+ }, self.helpBoxSearchParams);
351
+ }, 750);
352
+ }
353
+ },
354
+ created() {
355
+ this.init();
356
+ }
357
+ }
358
+ </script>
359
+ <style lang="less" scoped>
360
+ .tags {
361
+ margin: 10px auto;
362
+ }
363
+ </style>
@@ -0,0 +1,120 @@
1
+ <template>
2
+ <div class="num-index">
3
+ <div class="title">
4
+ <span class="title-text">{{ title }}</span>
5
+ <Poptip v-if="note" trigger="hover" placement="right-end" transfer word-wrap width="250" :content="note"
6
+ class="title-icon">
7
+ <Icon type="ios-information-circle-outline" />
8
+ </Poptip>
9
+ </div>
10
+ <div class="content">
11
+ <span class="value">{{ val }}</span>
12
+ <span v-if="unit" class="unit">{{ unit }}</span>
13
+ </div>
14
+ <div class="extends">
15
+ <div v-for="(item, index) in items" :key="index" class="extends-item">
16
+ <p><span>{{ item.k_name }}&nbsp;</span><span>{{ item.val }}</span></p>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </template>
21
+ <script>
22
+
23
+ export default {
24
+ name: "NumIndex",
25
+ components: {},
26
+ props: {
27
+ title: {
28
+ type: String,
29
+ default: ''
30
+ },
31
+ val: {
32
+ type: [String, Number],
33
+ default: ''
34
+ },
35
+ unit: {
36
+ type: String,
37
+ default: ''
38
+ },
39
+ items: {
40
+ type: Array,
41
+ default: () => []
42
+ },
43
+ note: {
44
+ type: String,
45
+ default: ''
46
+ }
47
+ },
48
+ data() {
49
+ return {
50
+
51
+ }
52
+ },
53
+ methods: {
54
+
55
+ },
56
+ created() {
57
+
58
+ },
59
+ mounted() {
60
+
61
+ }
62
+ }
63
+ </script>
64
+ <style scoped lang="less">
65
+ .num-index {
66
+ width: 257px;
67
+
68
+ .title {
69
+ font-size: 16px;
70
+ position: relative;
71
+ text-align: center;
72
+
73
+ .title-text {
74
+ display: inline-block;
75
+ position: relative;
76
+ z-index: 1
77
+ }
78
+
79
+ .title-icon {
80
+ position: absolute;
81
+ right: 0;
82
+ width: 16px;
83
+ height: 16px;
84
+ line-height: 24px;
85
+ }
86
+ }
87
+
88
+ .content {
89
+ display: flex;
90
+ flex-direction: row;
91
+ justify-content: center;
92
+ line-height: 50px;
93
+ position: relative;
94
+
95
+ .value {
96
+ font-size: 35px;
97
+ }
98
+
99
+ .unit {
100
+ font-size: 12px;
101
+ position: absolute;
102
+ right: 0;
103
+ }
104
+ }
105
+
106
+ .extends {
107
+ margin-left: 10px;
108
+ display: flex;
109
+ justify-content: center;
110
+ flex-direction: row;
111
+ flex-wrap: wrap;
112
+ gap: 0 10px;
113
+
114
+ .extends-item {
115
+ font-size: 14px;
116
+ color: #888;
117
+ }
118
+ }
119
+ }
120
+ </style>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <LamboDetailTable ref="detailTable" bordered size="default">
3
+ <template v-for="(item, index) in data">
4
+ <LamboDetailTableItem :key="index" :label="item.label">{{ item.val }}</LamboDetailTableItem>
5
+ </template>
6
+ </LamboDetailTable>
7
+ </template>
8
+ <script>
9
+ import { LamboDetailTable, LamboDetailTableItem } from "@lambo-design/detail-table"
10
+
11
+ export default {
12
+ name: "DetailTableBi",
13
+ components: { LamboDetailTable, LamboDetailTableItem },
14
+ props: {
15
+ data: {
16
+ type: Array,
17
+ default: () => ([])
18
+ }
19
+ },
20
+ data() {
21
+ return {
22
+
23
+ }
24
+ },
25
+ methods: {
26
+
27
+ },
28
+ created() {
29
+
30
+ },
31
+ updated() {
32
+ this.$nextTick(() => {
33
+ this.$refs.detailTable.refreshTable()
34
+ })
35
+ },
36
+ mounted() {
37
+
38
+ }
39
+ }
40
+ </script>
41
+ <style scoped></style>
@@ -0,0 +1,4 @@
1
+ ## @lambo-design/paging-table复制修改版本,主要为自定义报表使用
2
+ ## !!!!注意,常规组件,请优先使用@lambo-design/paging-table
3
+ - 多余地方删除,一些小的地方修改
4
+ - 后期可能会做一些修改