vue2-client 1.10.32 → 1.10.35

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 (27) hide show
  1. package/package.json +1 -1
  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 +1 -1
  5. package/src/base-client/components/common/XConversation/XConversation.vue +12 -0
  6. package/src/base-client/components/common/XDataCard/XDataCard.vue +17 -16
  7. package/src/base-client/components/common/XForm/XFormItem.vue +1248 -1286
  8. package/src/base-client/components/common/XFormCol/XFormCol.vue +157 -157
  9. package/src/base-client/components/common/XFormGroup/XFormGroup.vue +301 -301
  10. package/src/base-client/components/common/XFormTable/XFormTable.vue +12 -0
  11. package/src/base-client/components/common/XFormTable/demo.vue +2 -2
  12. package/src/base-client/components/common/XIntervalPicker/XIntervalPicker.vue +121 -0
  13. package/src/base-client/components/common/XReportDrawer/XReportDrawer.vue +1 -1
  14. package/src/base-client/components/common/XReportGrid/XReport.vue +1079 -1070
  15. package/src/base-client/components/common/XReportGrid/XReportDemo.vue +46 -47
  16. package/src/base-client/components/common/XReportGrid/XReportDesign.vue +628 -628
  17. package/src/base-client/components/common/XReportGrid/XReportJsonRender.vue +380 -380
  18. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1104 -1104
  19. package/src/base-client/components/common/XReportGrid/print.js +184 -184
  20. package/src/base-client/components/common/XTab/XTab.vue +57 -25
  21. package/src/components/cache/AKeepAlive.js +11 -4
  22. package/src/layouts/BlankView.vue +59 -3
  23. package/src/pages/ReportGrid/index.vue +76 -76
  24. package/src/router/async/router.map.js +95 -148
  25. package/src/router/guards.js +260 -263
  26. package/src/utils/microAppUtils.js +49 -40
  27. package/src/utils/routerUtil.js +526 -450
@@ -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.xs
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>