vue2-client 1.12.100 → 1.12.101

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.12.100",
3
+ "version": "1.12.101",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -1,3 +1,3 @@
1
- import XReport from './XReport'
2
-
3
- export default XReport
1
+ import XReport from './XReport'
2
+
3
+ export default XReport
@@ -10,7 +10,7 @@
10
10
  {{ isOpen ? '›' : '‹' }}
11
11
  </div>
12
12
  </div>
13
- <div class="drawer-content" v-if="isOpen">
13
+ <div class="drawer-content" v-show="isOpen">
14
14
  <x-report
15
15
  ref="x_report"
16
16
  :configName="queryParamsName"
@@ -56,12 +56,38 @@ export default {
56
56
  mounted () {
57
57
  // 在挂载后调整父元素宽度
58
58
  this.updateLayout(this.isOpen)
59
+ // 如果抽屉初始状态为打开,设置padding
60
+ if (this.isOpen) {
61
+ this.updateCardBodyPadding()
62
+ }
59
63
  },
60
64
  methods: {
61
65
  toggleDrawer () {
62
66
  this.isOpen = !this.isOpen
63
67
  this.$emit('on-drawer-change', this.isOpen)
64
68
  this.updateLayout(this.isOpen)
69
+ if (this.isOpen) {
70
+ this.$nextTick(() => {
71
+ this.updateCardBodyPadding()
72
+ })
73
+ }
74
+ },
75
+ // 更新card-body的padding
76
+ updateCardBodyPadding () {
77
+ this.$nextTick(() => {
78
+ const cardBody = this.$el.querySelector('.ant-card-body')
79
+ if (cardBody) {
80
+ cardBody.style.padding = '3%'
81
+ } else {
82
+ // 如果找不到元素,可能需要等待XReport完全渲染
83
+ setTimeout(() => {
84
+ const cardBody = this.$el.querySelector('.ant-card-body')
85
+ if (cardBody) {
86
+ cardBody.style.padding = '3%'
87
+ }
88
+ }, 500)
89
+ }
90
+ })
65
91
  },
66
92
  // 获取同级的其他所有a-col元素
67
93
  getSiblingCols () {
@@ -101,14 +127,14 @@ export default {
101
127
  currentCol = currentCol.parentNode
102
128
  }
103
129
  if (currentCol) {
104
- // 更新当前列的宽度
130
+ // 更新当前列的宽度
105
131
  const drawerWidth = isOpen ? 33.3 : 2
106
132
  // 强制更新样式
107
133
  currentCol.style.cssText = `
108
134
  flex: 0 0 ${drawerWidth}% !important;
109
135
  max-width: ${drawerWidth}% !important;
110
136
  transition: all 0.3s;`
111
- // 触发XTab组件重新计算宽度
137
+ // 触发XTab组件重新计算宽度
112
138
  this.$nextTick(() => {
113
139
  const tabComponent = this.$el.querySelector('.ant-tabs')
114
140
  if (tabComponent) {
@@ -116,7 +142,7 @@ export default {
116
142
  window.dispatchEvent(new Event('resize'))
117
143
  }
118
144
  })
119
- // 更新其他列宽度
145
+ // 更新其他列宽度
120
146
  otherCols.forEach((col, index) => {
121
147
  if (index < this.mainWithData.length) {
122
148
  const widthValue = isOpen ? this.mainWithData[index].min : this.mainWithData[index].max
@@ -1,26 +1,26 @@
1
- import Program from './core/Program'
2
-
3
- export default class ExpressionRunner {
4
- /**
5
- * Runs an expression with parameters
6
- *
7
- * @param source Expression source
8
- * @param params Expression parameters
9
- * @returns The result of the expression
10
- */
11
- static async run (source, params) {
12
- const delegate = this.getDelegate(source)
13
- return await delegate.invoke(params)
14
- }
15
-
16
- /**
17
- * Gets the delegate for the expression
18
- *
19
- * @param source Expression source
20
- * @returns A delegate to invoke
21
- */
22
- static getDelegate (source) {
23
- // Parse the source and return a delegate
24
- return new Program(source).parse()
25
- }
26
- }
1
+ import Program from './core/Program'
2
+
3
+ export default class ExpressionRunner {
4
+ /**
5
+ * Runs an expression with parameters
6
+ *
7
+ * @param source Expression source
8
+ * @param params Expression parameters
9
+ * @returns The result of the expression
10
+ */
11
+ static async run (source, params) {
12
+ const delegate = this.getDelegate(source)
13
+ return await delegate.invoke(params)
14
+ }
15
+
16
+ /**
17
+ * Gets the delegate for the expression
18
+ *
19
+ * @param source Expression source
20
+ * @returns A delegate to invoke
21
+ */
22
+ static getDelegate (source) {
23
+ // Parse the source and return a delegate
24
+ return new Program(source).parse()
25
+ }
26
+ }