vue2-client 1.10.33 → 1.11.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 (29) hide show
  1. package/package.json +107 -107
  2. package/src/App.vue +196 -196
  3. package/src/base-client/components/common/XAddNativeForm/demo.vue +43 -43
  4. package/src/base-client/components/common/XAddReport/XAddReport.vue +207 -207
  5. package/src/base-client/components/common/XConversation/XConversation.vue +275 -263
  6. package/src/base-client/components/common/XForm/XForm.vue +393 -393
  7. package/src/base-client/components/common/XForm/XFormItem.vue +1248 -1248
  8. package/src/base-client/components/common/XFormCol/XFormCol.vue +157 -157
  9. package/src/base-client/components/common/XFormTable/XFormTable.vue +868 -856
  10. package/src/base-client/components/common/XIntervalPicker/XIntervalPicker.vue +121 -121
  11. package/src/base-client/components/common/XReportDrawer/XReportDrawer.vue +201 -201
  12. package/src/base-client/components/common/XReportGrid/XReport.vue +1079 -1070
  13. package/src/base-client/components/common/XReportGrid/XReportDemo.vue +46 -47
  14. package/src/base-client/components/common/XReportGrid/XReportDesign.vue +628 -628
  15. package/src/base-client/components/common/XReportGrid/XReportJsonRender.vue +380 -380
  16. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1104 -1104
  17. package/src/base-client/components/common/XReportGrid/print.js +184 -184
  18. package/src/base-client/components/common/XTab/XTab.vue +233 -201
  19. package/src/base-client/components/common/XTable/XTable.vue +114 -195
  20. package/src/base-client/components/common/XTable/XTableWrapper.vue +240 -0
  21. package/src/base-client/components/layout/XPageView/RenderRow.vue +12 -11
  22. package/src/components/STable/index.js +12 -12
  23. package/src/components/cache/AKeepAlive.js +179 -179
  24. package/src/layouts/BlankView.vue +78 -78
  25. package/src/pages/ReportGrid/index.vue +76 -76
  26. package/src/router/async/router.map.js +148 -95
  27. package/src/utils/indexedDB.js +167 -216
  28. package/src/utils/microAppUtils.js +49 -49
  29. package/vue.config.js +6 -5
@@ -1,157 +1,157 @@
1
- <template>
2
- <a-col :style="computedStyles">
3
- <div
4
- class="x-form-col-wrapper"
5
- :style="computedWrapperStyles"
6
- >
7
- <slot></slot>
8
- </div>
9
- </a-col>
10
- </template>
11
-
12
- <script>
13
- const BREAKPOINTS = {
14
- xs: 576,
15
- sm: 768,
16
- md: 992,
17
- lg: 1200,
18
- xl: 1600,
19
- }
20
-
21
- const defaultFlex = {
22
- xs: 24,
23
- sm: 24,
24
- md: 8,
25
- lg: 8,
26
- xl: 6,
27
- xxl: 6,
28
- }
29
-
30
- function debounce (fn, delay) {
31
- let timeout = null
32
- return function (...args) {
33
- if (timeout) clearTimeout(timeout)
34
- timeout = setTimeout(() => {
35
- fn.apply(this, args)
36
- }, delay)
37
- }
38
- }
39
-
40
- export default {
41
- name: 'XFormCol',
42
- props: {
43
- flex: {
44
- type: Object,
45
- default: () => ({
46
- xs: 24,
47
- sm: 24,
48
- md: 8,
49
- lg: 6,
50
- xl: 6,
51
- xxl: 6,
52
- }),
53
- },
54
- occupyCol: {
55
- type: Number,
56
- default: 1,
57
- },
58
- layout: {
59
- type: String,
60
- default: 'horizontal',
61
- },
62
- labelCol: {
63
- type: Object,
64
- default: () => { return { span: 8 } }
65
- }
66
- },
67
- computed: {
68
- computedFlex () {
69
- const parentWidth = this.parentWidth
70
- return this.getFlex(parentWidth, this.flex)
71
- },
72
- computedWrapperStyles () {
73
- const realFlex = this.flex.fullWidth ? this.getFlex(this.parentWidth) : this.computedFlex
74
- // 1. 计算列数
75
- const columnsCount = 24 / realFlex
76
- // 2. 计算基准列宽
77
- const baseColumnWidth = (this.parentWidth / columnsCount) - ((columnsCount - 1) * 16)
78
- // 3. 计算label宽度
79
- const labelWidth = Math.max(baseColumnWidth / (24 / this.labelCol.span), 80)
80
- // 计算左右偏移量
81
- const offset = this.labelCol.offset ? (this.labelCol.offset / 24) * 100 : 0
82
- if (this.layout === 'vertical') {
83
- return {
84
- '--form-label-width': '',
85
- '--form-offset': '',
86
- }
87
- }
88
- return {
89
- '--form-label-width': `${labelWidth}px`,
90
- '--form-offset': `${offset}%`,
91
- }
92
- },
93
- computedStyles () {
94
- const realFlex = Math.min(this.computedFlex * this.occupyCol, 24)
95
- const flexValue = (realFlex / 24) * 100
96
-
97
- return {
98
- flex: `0 0 ${flexValue}%`,
99
- maxWidth: `${flexValue}%`,
100
- }
101
- },
102
- },
103
- data () {
104
- return {
105
- parentWidth: 0,
106
- }
107
- },
108
- methods: {
109
- getFlex (parentWidth, flex = defaultFlex) {
110
- if (parentWidth === 0) {
111
- return flex.md
112
- }
113
- if (parentWidth < BREAKPOINTS.xs) return flex.xs
114
- if (parentWidth < BREAKPOINTS.sm) return flex.sm
115
- if (parentWidth < BREAKPOINTS.md) return flex.md
116
- if (parentWidth < BREAKPOINTS.lg) return flex.lg
117
- if (parentWidth < BREAKPOINTS.xl) return flex.xl
118
- return flex.xxl
119
- },
120
- },
121
- mounted () {
122
- // 根据父容器宽度响应式
123
- this.$nextTick(() => {
124
- const container = this.$el.parentNode
125
- this.parentWidth = container.offsetWidth
126
- const updateWidth = debounce((width) => {
127
- this.parentWidth = width
128
- }, 100)
129
-
130
- this.resizeObserver = new ResizeObserver((entries) => {
131
- for (const entry of entries) {
132
- updateWidth(entry.contentRect.width)
133
- }
134
- })
135
- this.resizeObserver.observe(container)
136
- })
137
- },
138
- beforeUnmount () {
139
- if (this.resizeObserver) {
140
- this.resizeObserver.disconnect()
141
- }
142
- },
143
- }
144
- </script>
145
-
146
- <style lang="less" scoped>
147
- .x-form-col-wrapper {
148
- :deep(.ant-form-item) {
149
- .ant-form-item-label {
150
- max-width: var(--form-label-width);
151
- }
152
- .ant-form-item-control-wrapper {
153
- width: calc(100% - var(--form-label-width) - var(--form-offset) - var(--form-offset));
154
- }
155
- }
156
- }
157
- </style>
1
+ <template>
2
+ <a-col :style="computedStyles">
3
+ <div
4
+ class="x-form-col-wrapper"
5
+ :style="computedWrapperStyles"
6
+ >
7
+ <slot></slot>
8
+ </div>
9
+ </a-col>
10
+ </template>
11
+
12
+ <script>
13
+ const BREAKPOINTS = {
14
+ xs: 576,
15
+ sm: 768,
16
+ md: 992,
17
+ lg: 1200,
18
+ xl: 1600,
19
+ }
20
+
21
+ const defaultFlex = {
22
+ xs: 24,
23
+ sm: 24,
24
+ md: 8,
25
+ lg: 8,
26
+ xl: 6,
27
+ xxl: 6,
28
+ }
29
+
30
+ function debounce (fn, delay) {
31
+ let timeout = null
32
+ return function (...args) {
33
+ if (timeout) clearTimeout(timeout)
34
+ timeout = setTimeout(() => {
35
+ fn.apply(this, args)
36
+ }, delay)
37
+ }
38
+ }
39
+
40
+ export default {
41
+ name: 'XFormCol',
42
+ props: {
43
+ flex: {
44
+ type: Object,
45
+ default: () => ({
46
+ xs: 24,
47
+ sm: 24,
48
+ md: 8,
49
+ lg: 6,
50
+ xl: 6,
51
+ xxl: 6,
52
+ }),
53
+ },
54
+ occupyCol: {
55
+ type: Number,
56
+ default: 1,
57
+ },
58
+ layout: {
59
+ type: String,
60
+ default: 'horizontal',
61
+ },
62
+ labelCol: {
63
+ type: Object,
64
+ default: () => { return { span: 8 } }
65
+ }
66
+ },
67
+ computed: {
68
+ computedFlex () {
69
+ const parentWidth = this.parentWidth
70
+ return this.getFlex(parentWidth, this.flex)
71
+ },
72
+ computedWrapperStyles () {
73
+ const realFlex = this.flex.fullWidth ? this.getFlex(this.parentWidth) : this.computedFlex
74
+ // 1. 计算列数
75
+ const columnsCount = 24 / realFlex
76
+ // 2. 计算基准列宽
77
+ const baseColumnWidth = (this.parentWidth / columnsCount) - ((columnsCount - 1) * 16)
78
+ // 3. 计算label宽度
79
+ const labelWidth = Math.max(baseColumnWidth / (24 / this.labelCol.span), 80)
80
+ // 计算左右偏移量
81
+ const offset = this.labelCol.offset ? (this.labelCol.offset / 24) * 100 : 0
82
+ if (this.layout === 'vertical') {
83
+ return {
84
+ '--form-label-width': '',
85
+ '--form-offset': '',
86
+ }
87
+ }
88
+ return {
89
+ '--form-label-width': `${labelWidth}px`,
90
+ '--form-offset': `${offset}%`,
91
+ }
92
+ },
93
+ computedStyles () {
94
+ const realFlex = Math.min(this.computedFlex * this.occupyCol, 24)
95
+ const flexValue = (realFlex / 24) * 100
96
+
97
+ return {
98
+ flex: `0 0 ${flexValue}%`,
99
+ maxWidth: `${flexValue}%`,
100
+ }
101
+ },
102
+ },
103
+ data () {
104
+ return {
105
+ parentWidth: 0,
106
+ }
107
+ },
108
+ methods: {
109
+ getFlex (parentWidth, flex = defaultFlex) {
110
+ if (parentWidth === 0) {
111
+ return flex.md
112
+ }
113
+ if (parentWidth < BREAKPOINTS.xs) return flex.xs
114
+ if (parentWidth < BREAKPOINTS.sm) return flex.sm
115
+ if (parentWidth < BREAKPOINTS.md) return flex.md
116
+ if (parentWidth < BREAKPOINTS.lg) return flex.lg
117
+ if (parentWidth < BREAKPOINTS.xl) return flex.xl
118
+ return flex.xxl
119
+ },
120
+ },
121
+ mounted () {
122
+ // 根据父容器宽度响应式
123
+ this.$nextTick(() => {
124
+ const container = this.$el.parentNode
125
+ this.parentWidth = container.offsetWidth
126
+ const updateWidth = debounce((width) => {
127
+ this.parentWidth = width
128
+ }, 100)
129
+
130
+ this.resizeObserver = new ResizeObserver((entries) => {
131
+ for (const entry of entries) {
132
+ updateWidth(entry.contentRect.width)
133
+ }
134
+ })
135
+ this.resizeObserver.observe(container)
136
+ })
137
+ },
138
+ beforeUnmount () {
139
+ if (this.resizeObserver) {
140
+ this.resizeObserver.disconnect()
141
+ }
142
+ },
143
+ }
144
+ </script>
145
+
146
+ <style lang="less" scoped>
147
+ .x-form-col-wrapper {
148
+ :deep(.ant-form-item) {
149
+ .ant-form-item-label {
150
+ max-width: var(--form-label-width);
151
+ }
152
+ .ant-form-item-control-wrapper {
153
+ width: calc(100% - var(--form-label-width) - var(--form-offset) - var(--form-offset));
154
+ }
155
+ }
156
+ }
157
+ </style>