vue2-client 1.18.41 → 1.18.45

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/.eslintrc.js CHANGED
@@ -3,12 +3,10 @@ module.exports = {
3
3
  env: {
4
4
  node: true
5
5
  },
6
- extends: [
7
- 'plugin:vue/essential',
8
- 'plugin:vue/strongly-recommended',
9
- '@vue/standard'
10
- ],
6
+ // prettier 放最后,自动关闭所有与 Prettier 冲突的格式规则
7
+ extends: ['plugin:vue/essential', 'plugin:vue/strongly-recommended', '@vue/standard', 'prettier'],
11
8
  rules: {
9
+ camelcase: 'off',
12
10
  'comma-dangle': 'off',
13
11
  'no-console': 'off',
14
12
  'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
@@ -21,7 +19,7 @@ module.exports = {
21
19
  max: 5
22
20
  },
23
21
  multiline: {
24
- max: 1,
22
+ max: 1
25
23
  }
26
24
  }
27
25
  ],
@@ -37,10 +35,7 @@ module.exports = {
37
35
  'vue/no-parsing-error': 0,
38
36
  'vue/name-property-casing': 0,
39
37
  'vue/multi-word-component-names': 0,
40
- 'vue/require-valid-default-prop': 0,
41
- 'no-template-curly-in-string': 0,
42
38
  'vue/no-mutating-props': 0,
43
- 'no-useless-escape': 0,
44
39
  'no-tabs': 0,
45
40
  'multiline-ternary': 0,
46
41
  'object-shorthand': 0,
@@ -71,17 +66,16 @@ module.exports = {
71
66
  // 必须使用全等: false
72
67
  eqeqeq: 0,
73
68
  // 可以使用!! 双重否定
74
- 'no-extra-boolean-cast': 'off'
69
+ 'no-extra-boolean-cast': 'off',
70
+ // 关闭函数名后空格检查,跟随 Prettier 默认风格 function foo()
71
+ 'space-before-function-paren': 'off'
75
72
  },
76
73
  parserOptions: {
77
74
  parser: '@babel/eslint-parser'
78
75
  },
79
76
  overrides: [
80
77
  {
81
- files: [
82
- '**/__tests__/*.{j,t}s?(x)',
83
- '**/tests/unit/**/*.spec.{j,t}s?(x)'
84
- ],
78
+ files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
85
79
  env: {
86
80
  jest: true
87
81
  }
@@ -0,0 +1,6 @@
1
+ dist
2
+ node_modules
3
+ *.md
4
+ *.yml
5
+ *.yaml
6
+ public
package/.prettierrc ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "tabWidth": 2,
5
+ "useTabs": false,
6
+ "trailingComma": "none",
7
+ "printWidth": 120,
8
+ "bracketSpacing": true,
9
+ "arrowParens": "avoid",
10
+ "endOfLine": "lf",
11
+ "htmlWhitespaceSensitivity": "ignore",
12
+ "vueIndentScriptAndStyle": false
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.18.41",
3
+ "version": "1.18.45",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -87,6 +87,7 @@
87
87
  "css-minimizer-webpack-plugin": "^5.0.1",
88
88
  "deepmerge": "^4.3.1",
89
89
  "eslint": "^8.51.0",
90
+ "eslint-config-prettier": "^10.1.8",
90
91
  "eslint-plugin-vue": "^9.17.0",
91
92
  "fast-deep-equal": "^3.1.3",
92
93
  "ignore-loader": "^0.1.2",
@@ -27,6 +27,7 @@ const wrapperClassObject = computed(() => {
27
27
  'padding-50',
28
28
  'label-text-horizontal',
29
29
  'label-text-justify',
30
+ 'simple-inline',
30
31
  'label-justify',
31
32
  'charge-form'
32
33
  ]
@@ -132,6 +133,15 @@ defineExpose({
132
133
  }
133
134
  }
134
135
 
136
+ &.h-form-simple-inline {
137
+ :deep(.ant-form-item-label){
138
+ display: none !important;
139
+ }
140
+ :deep(.ant-form-item-control-wrapper){
141
+ width: 100%;
142
+ }
143
+ }
144
+
135
145
  &.h-form-padding-50 {
136
146
  // ant-row-flex 样式
137
147
  :deep(.ant-row-flex) {
@@ -4,12 +4,8 @@
4
4
  <template v-if="tabMode === 'left'">
5
5
  <a-col :span="4" v-if="realData.length">
6
6
  <a-tabs tab-position="left" v-model="activeTab" @change="scrollToGroup">
7
- <template v-for="(item,index) in realData">
8
- <a-tab-pane
9
- :tab="item.title"
10
- :key="index"
11
- v-if="item.title">
12
- </a-tab-pane>
7
+ <template v-for="(item, index) in realData">
8
+ <a-tab-pane :tab="item.title" :key="index" v-if="item.title"></a-tab-pane>
13
9
  </template>
14
10
  </a-tabs>
15
11
  </a-col>
@@ -18,45 +14,40 @@
18
14
  class="descriptions-item"
19
15
  :ref="`descriptions-item-${realDataIndex}`"
20
16
  :key="realDataIndex"
21
- v-for="(realDataItem, realDataIndex) in realData">
17
+ v-for="(realDataItem, realDataIndex) in realData"
18
+ >
22
19
  <!-- 渲染所有分组内容 -->
23
20
  <template v-if="!loadError">
24
21
  <!-- 带有子的详情 -->
25
- <template
26
- v-if="realDataItem.title && groups[realDataIndex]?.type ==='array'"
27
- >
22
+ <template v-if="realDataItem.title && groups[realDataIndex]?.type === 'array'">
28
23
  <div class="ant-descriptions-title">{{ realDataItem.title }}</div>
29
24
  <div class="descriptions-array-item">
30
25
  <a-descriptions
31
- v-for="(arrayItem,arrayIndex) in realDataItem.column"
26
+ v-for="(arrayItem, arrayIndex) in realDataItem.column"
32
27
  :column="isMobile ? 1 : column"
33
28
  size="small"
34
29
  :key="arrayIndex"
35
- :title="arrayItem.title">
30
+ :title="arrayItem.title"
31
+ >
36
32
  <template v-for="(item, index) in arrayItem.column">
37
33
  <!-- 大多数情况 循环下 空值省略不展示,todo 后期可能加配置处理 -->
38
- <a-descriptions-item
39
- :key="index"
40
- v-if="item.value"
41
- :label="item.key">
34
+ <a-descriptions-item :key="index" v-if="item.value" :label="item.key">
42
35
  {{ formatText(item.value) }}
43
36
  </a-descriptions-item>
44
37
  </template>
45
38
  </a-descriptions>
46
39
  </div>
47
40
  </template>
48
- <a-descriptions
49
- v-else-if="realDataItem.title"
50
- :column="isMobile ? 1 : column"
51
- :title="realDataItem.title">
41
+ <a-descriptions v-else-if="realDataItem.title" :column="isMobile ? 1 : column" :title="realDataItem.title">
52
42
  <a-descriptions-item
53
43
  v-for="(item, index) in realDataItem.column"
54
44
  :key="index"
55
45
  :span="item.span || 1"
56
- v-if="shouldShowField(item, data)">
46
+ v-if="shouldShowField(item, data)"
47
+ >
57
48
  <template #label>
58
49
  {{ item.key }}
59
- <span v-if="isFieldRequired(item, data)" style="color: red;"> *</span>
50
+ <span v-if="isFieldRequired(item, data)" style="color: red">*</span>
60
51
  </template>
61
52
  <span :style="getFieldStyle(item, data)">{{ formatFieldValue(item.value, item, data) || '--' }}</span>
62
53
  </a-descriptions-item>
@@ -70,27 +61,23 @@
70
61
  <template v-else-if="tabMode === 'top'">
71
62
  <a-col :span="24" v-if="realData.length">
72
63
  <a-tabs v-model="activeTab" size="small" :tabBarStyle="{ margin: 0, padding: '0 8px' }">
73
- <a-tab-pane v-for="(item,index) in realData" :key="index" :tab="item.title">
64
+ <a-tab-pane v-for="(item, index) in realData" :key="index" :tab="item.title">
74
65
  <div class="tab-content-scroll">
75
66
  <!-- 只渲染当前激活的分组内容 -->
76
67
  <template v-if="!loadError && realData[activeTab]">
77
68
  <!-- 带有子的详情 -->
78
- <template
79
- v-if="realData[activeTab].title && groups[activeTab]?.type ==='array'"
80
- >
69
+ <template v-if="realData[activeTab].title && groups[activeTab]?.type === 'array'">
81
70
  <div class="ant-descriptions-title" v-if="tabMode !== 'top'">{{ realData[activeTab].title }}</div>
82
71
  <div class="descriptions-array-item">
83
72
  <a-descriptions
84
- v-for="(arrayItem,arrayIndex) in realData[activeTab].column"
73
+ v-for="(arrayItem, arrayIndex) in realData[activeTab].column"
85
74
  :column="isMobile ? 1 : column"
86
75
  size="small"
87
76
  :key="arrayIndex"
88
- :title="arrayItem.title">
77
+ :title="arrayItem.title"
78
+ >
89
79
  <template v-for="(fieldItem, fieldIndex) in arrayItem.column">
90
- <a-descriptions-item
91
- :key="fieldIndex"
92
- v-if="fieldItem.value"
93
- :label="fieldItem.key">
80
+ <a-descriptions-item :key="fieldIndex" v-if="fieldItem.value" :label="fieldItem.key">
94
81
  {{ formatText(fieldItem.value) }}
95
82
  </a-descriptions-item>
96
83
  </template>
@@ -100,17 +87,21 @@
100
87
  <a-descriptions
101
88
  v-else-if="realData[activeTab].title"
102
89
  :column="isMobile ? 1 : column"
103
- :title="tabMode === 'top' ? undefined : realData[activeTab].title">
90
+ :title="tabMode === 'top' ? undefined : realData[activeTab].title"
91
+ >
104
92
  <a-descriptions-item
105
93
  v-for="(fieldItem, fieldIndex) in realData[activeTab].column"
106
94
  :key="fieldIndex"
107
95
  :span="fieldItem.span || 1"
108
- v-if="shouldShowField(fieldItem, data)">
96
+ v-if="shouldShowField(fieldItem, data)"
97
+ >
109
98
  <template #label>
110
99
  {{ fieldItem.key }}
111
- <span v-if="isFieldRequired(fieldItem, data)" style="color: red;"> *</span>
100
+ <span v-if="isFieldRequired(fieldItem, data)" style="color: red">*</span>
112
101
  </template>
113
- <span :style="getFieldStyle(fieldItem, fieldItem.value, data)">{{ formatFieldValue(fieldItem.value, fieldItem, data) || '--' }}</span>
102
+ <span :style="getFieldStyle(fieldItem, fieldItem.value, data)">
103
+ {{ formatFieldValue(fieldItem.value, fieldItem, data) || '--' }}
104
+ </span>
114
105
  </a-descriptions-item>
115
106
  </a-descriptions>
116
107
  </template>
@@ -123,49 +114,42 @@
123
114
  <!-- none 模式:无 tab,直接展示所有内容 -->
124
115
  <template v-else>
125
116
  <a-col :span="24" class="descriptionsGroupContext">
126
- <div
127
- class="descriptions-item"
128
- :key="realDataIndex"
129
- v-for="(realDataItem, realDataIndex) in realData">
117
+ <div class="descriptions-item" :key="realDataIndex" v-for="(realDataItem, realDataIndex) in realData">
130
118
  <!-- 渲染所有分组内容 -->
131
119
  <template v-if="!loadError">
132
120
  <!-- 带有子的详情 -->
133
- <template
134
- v-if="realDataItem.title && groups[realDataIndex]?.type ==='array'"
135
- >
121
+ <template v-if="realDataItem.title && groups[realDataIndex]?.type === 'array'">
136
122
  <div class="ant-descriptions-title">{{ realDataItem.title }}</div>
137
123
  <div class="descriptions-array-item">
138
124
  <a-descriptions
139
- v-for="(arrayItem,arrayIndex) in realDataItem.column"
125
+ v-for="(arrayItem, arrayIndex) in realDataItem.column"
140
126
  :column="isMobile ? 1 : column"
141
127
  size="small"
142
128
  :key="arrayIndex"
143
- :title="arrayItem.title">
129
+ :title="arrayItem.title"
130
+ >
144
131
  <template v-for="(item, index) in arrayItem.column">
145
- <a-descriptions-item
146
- :key="index"
147
- v-if="item.value"
148
- :label="item.key">
132
+ <a-descriptions-item :key="index" v-if="item.value" :label="item.key">
149
133
  {{ formatText(item.value) }}
150
134
  </a-descriptions-item>
151
135
  </template>
152
136
  </a-descriptions>
153
137
  </div>
154
138
  </template>
155
- <a-descriptions
156
- v-else-if="realDataItem.title"
157
- :column="isMobile ? 1 : column"
158
- :title="realDataItem.title">
139
+ <a-descriptions v-else-if="realDataItem.title" :column="isMobile ? 1 : column" :title="realDataItem.title">
159
140
  <a-descriptions-item
160
141
  v-for="(item, index) in realDataItem.column"
161
142
  :key="index"
162
143
  :span="item.span || 1"
163
- v-if="shouldShowField(item, data)">
144
+ v-if="shouldShowField(item, data)"
145
+ >
164
146
  <template #label>
165
147
  {{ item.key }}
166
- <span v-if="isFieldRequired(item, data)" style="color: red;"> *</span>
148
+ <span v-if="isFieldRequired(item, data)" style="color: red">*</span>
167
149
  </template>
168
- <span :style="getFieldStyle(item, item.value, data)">{{ formatFieldValue(item.value, item, data) || '--' }}</span>
150
+ <span :style="getFieldStyle(item, item.value, data)">
151
+ {{ formatFieldValue(item.value, item, data) || '--' }}
152
+ </span>
169
153
  </a-descriptions-item>
170
154
  </a-descriptions>
171
155
  </template>
@@ -175,7 +159,6 @@
175
159
  </a-row>
176
160
  </template>
177
161
  <script>
178
-
179
162
  import { mapState } from 'vuex'
180
163
  import { getRealKeyData } from '@vue2-client/utils/formatter'
181
164
  import { getConfigByName } from '@vue2-client/services/api/common'
@@ -203,20 +186,19 @@ export default {
203
186
  serviceName: {
204
187
  type: String,
205
188
  default: process.env.VUE_APP_SYSTEM_NAME
206
- },
207
- },
208
- mounted () {
189
+ }
209
190
  },
210
- beforeDestroy () {
191
+ mounted() {},
192
+ beforeDestroy() {
211
193
  const formGroupContext = this.$refs.formGroupContext?.$el
212
194
  if (formGroupContext && formGroupContext.removeEventListener) {
213
195
  formGroupContext.removeEventListener('scroll', this.onScroll)
214
196
  }
215
197
  },
216
- created () {
198
+ created() {
217
199
  this.initConfig()
218
200
  },
219
- data () {
201
+ data() {
220
202
  return {
221
203
  // 加载状态
222
204
  loading: false,
@@ -228,14 +210,14 @@ export default {
228
210
  // 从配置中获取的值
229
211
  column: 3, // 默认值
230
212
  getRealData: false, // 默认值
231
- tabMode: 'left', // 默认值
213
+ tabMode: 'left' // 默认值
232
214
  }
233
215
  },
234
216
  computed: {
235
217
  ...mapState('setting', { isMobile: 'isMobile' })
236
218
  },
237
219
  methods: {
238
- initConfig () {
220
+ initConfig() {
239
221
  this.loading = true
240
222
  if (this.configName) {
241
223
  this.getConfig()
@@ -253,14 +235,14 @@ export default {
253
235
  this.loadError = true
254
236
  }
255
237
  },
256
- scrollToGroup (index) {
238
+ scrollToGroup(index) {
257
239
  const groupElement = this.$refs[`descriptions-item-${index}`][0]
258
240
  if (groupElement) {
259
241
  groupElement.scrollIntoView({ behavior: 'smooth' })
260
242
  }
261
243
  },
262
- getConfig () {
263
- getConfigByName(this.configName, this.serviceName, (res) => {
244
+ getConfig() {
245
+ getConfigByName(this.configName, this.serviceName, res => {
264
246
  if (res.groups) {
265
247
  // 从配置中获取 column、getRealData 和 tabMode
266
248
  this.column = res.column !== undefined ? res.column : 3
@@ -270,34 +252,38 @@ export default {
270
252
  // 解析分组配置
271
253
  const groups = this.parseGroupsConfig(res.groups)
272
254
  this.groups = groups
273
- this.realData = groups.map(group => {
274
- const dataItem = { title: group.name }
255
+ this.realData = groups
256
+ .map(group => {
257
+ const dataItem = { title: group.name }
275
258
 
276
- if (group.type === 'array') {
277
- // 处理数组类型数据
278
- const arrayData = this.data[group.key] || []
279
- dataItem.column = arrayData.map((item, index) => ({
280
- title: `${group.name} ${index + 1}`,
281
- column: group.fields.map(field => ({
259
+ if (group.type === 'array') {
260
+ // 处理数组类型数据
261
+ const arrayData = this.data[group.key] || []
262
+ dataItem.column = arrayData
263
+ .map((item, index) => ({
264
+ title: `${group.name} ${index + 1}`,
265
+ column: group.fields.map(field => ({
266
+ key: field.name,
267
+ value: item[field.key]
268
+ }))
269
+ }))
270
+ .filter(Boolean)
271
+ } else {
272
+ dataItem.column = group.fields.map(field => ({
282
273
  key: field.name,
283
- value: item[field.key]
274
+ value: this.getRealKeyData(this.data, field.key),
275
+ span: field.span,
276
+ // 存储字段函数配置
277
+ showIf: field.showIf,
278
+ styleFunc: field.styleFunc,
279
+ formatFunc: field.formatFunc,
280
+ requireFunc: field.requireFunc
284
281
  }))
285
- })).filter(Boolean)
286
- } else {
287
- dataItem.column = group.fields.map(field => ({
288
- key: field.name,
289
- value: this.getRealKeyData(this.data, field.key),
290
- span: field.span,
291
- // 存储字段函数配置
292
- showIf: field.showIf,
293
- styleFunc: field.styleFunc,
294
- formatFunc: field.formatFunc,
295
- requireFunc: field.requireFunc
296
- }))
297
- }
282
+ }
298
283
 
299
- return dataItem.column.length > 0 ? dataItem : null
300
- }).filter(Boolean)
284
+ return dataItem.column.length > 0 ? dataItem : null
285
+ })
286
+ .filter(Boolean)
301
287
  }
302
288
  })
303
289
  },
@@ -357,7 +343,7 @@ export default {
357
343
  * ]
358
344
  * }]
359
345
  */
360
- parseGroupsConfig (groupsConfig) {
346
+ parseGroupsConfig(groupsConfig) {
361
347
  // 如果已经是数组格式,直接返回
362
348
  if (Array.isArray(groupsConfig)) {
363
349
  return groupsConfig
@@ -394,11 +380,11 @@ export default {
394
380
  })
395
381
  },
396
382
  // 文字格式化
397
- formatText (value) {
383
+ formatText(value) {
398
384
  return value ?? '--'
399
385
  },
400
386
  // 执行字段展示函数
401
- shouldShowField (field, data) {
387
+ shouldShowField(field, data) {
402
388
  if (!field.showIf) return true
403
389
  try {
404
390
  return executeStrFunctionByContext(this, field.showIf, [data, field.key])
@@ -408,7 +394,7 @@ export default {
408
394
  }
409
395
  },
410
396
  // 获取字段样式
411
- getFieldStyle (field, data) {
397
+ getFieldStyle(field, data) {
412
398
  if (!field.styleFunc) return {}
413
399
  try {
414
400
  return executeStrFunctionByContext(this, field.styleFunc, [data, field.key])
@@ -418,7 +404,7 @@ export default {
418
404
  }
419
405
  },
420
406
  // 格式化字段值
421
- formatFieldValue (value, field, data) {
407
+ formatFieldValue(value, field, data) {
422
408
  if (!field.formatFunc) return value
423
409
  try {
424
410
  return executeStrFunctionByContext(this, field.formatFunc, [data, field.key])
@@ -428,7 +414,7 @@ export default {
428
414
  }
429
415
  },
430
416
  // 判断字段是否必填(显示红色星号)
431
- isFieldRequired (field, data) {
417
+ isFieldRequired(field, data) {
432
418
  if (!field.requireFunc) return false
433
419
  try {
434
420
  return executeStrFunctionByContext(this, field.requireFunc, [data, field.key])
@@ -437,14 +423,14 @@ export default {
437
423
  return false
438
424
  }
439
425
  },
440
- getRealKeyData (data, key) {
426
+ getRealKeyData(data, key) {
441
427
  if (this.getRealData) {
442
428
  return getRealKeyData(data)[key] || ''
443
429
  } else {
444
430
  return this.data[key] || ''
445
431
  }
446
432
  },
447
- onScroll () {
433
+ onScroll() {
448
434
  // 只在 left 模式启用滚动联动
449
435
  if (this.tabMode !== 'left') return
450
436
 
@@ -466,17 +452,17 @@ export default {
466
452
  },
467
453
  watch: {
468
454
  content: {
469
- handler () {
455
+ handler() {
470
456
  this.initConfig()
471
457
  }
472
458
  },
473
459
  configName: {
474
- handler () {
460
+ handler() {
475
461
  this.initConfig()
476
462
  }
477
463
  },
478
464
  serviceName: {
479
- handler () {
465
+ handler() {
480
466
  this.initConfig()
481
467
  }
482
468
  }
@@ -502,6 +488,16 @@ export default {
502
488
  font-weight: 400;
503
489
  }
504
490
 
491
+ // 移除最后一行的 padding-bottom
492
+ :deep(.ant-descriptions-view) {
493
+ .ant-descriptions-row:last-child {
494
+ > th,
495
+ > td {
496
+ padding-bottom: 0;
497
+ }
498
+ }
499
+ }
500
+
505
501
  .descriptions-item {
506
502
  margin-bottom: 8px;
507
503
  }
@@ -1,14 +1,6 @@
1
1
  <template>
2
- <splitpanes
3
- class="default-theme"
4
- :horizontal="false"
5
- @resized="storePaneSize"
6
- >
7
- <pane
8
- :size="treeSize"
9
- :min-size="15"
10
- :max-size="40"
11
- v-if="xTreeConfigName">
2
+ <splitpanes class="default-theme" :horizontal="false" @resized="storePaneSize">
3
+ <pane :size="treeSize" :min-size="15" :max-size="40" v-if="xTreeConfigName">
12
4
  <x-tree-pro
13
5
  :config-name="xTreeConfigName"
14
6
  :env="env"
@@ -18,10 +10,8 @@
18
10
  ref="xtree"
19
11
  ></x-tree-pro>
20
12
  </pane>
21
- <pane
22
- :size="100 - treeSize"
23
- >
24
- <a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
13
+ <pane :size="100 - treeSize">
14
+ <a-skeleton :loading="loading" :paragraph="{ rows: 4 }" />
25
15
  <a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
26
16
  <div v-show="!loading">
27
17
  <template v-if="!loadError">
@@ -31,29 +21,27 @@
31
21
  @x-form-item-emit-func="emitFunc"
32
22
  @afterSubmit="onAddOrEditSubmitAfterSubmit"
33
23
  >
34
- <template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
24
+ <template slot="groupFormItems" slot-scope="{ form, model, rules, modifyModelData }">
35
25
  <slot
36
26
  name="groupFormItems"
37
27
  :form="form"
38
28
  :model="model"
39
29
  :rules="rules"
40
- :modifyModelData="modifyModelData"></slot>
30
+ :modifyModelData="modifyModelData"
31
+ ></slot>
41
32
  </template>
42
33
  </x-add-form>
43
- <x-add-report
44
- v-if="moveType"
45
- ref="xAddReport"
46
- >
47
- </x-add-report>
34
+ <x-add-report v-if="moveType" ref="xAddReport"></x-add-report>
48
35
  <div v-if="crudTitle" class="crud_title">
49
36
  {{ crudTitle }}
50
37
  </div>
51
- <a-spin :spinning="tableShowMode === 'popup' && formQueryLoading" tip="正在查询..." >
38
+ <a-spin :spinning="tableShowMode === 'popup' && formQueryLoading" tip="正在查询...">
52
39
  <x-form
53
40
  ref="xForm"
54
41
  @x-form-item-emit-func="emitFunc"
55
42
  @toggleAdvanced="toggleAdvanced"
56
- @onSubmit="onSearchSubmit">
43
+ @onSubmit="onSearchSubmit"
44
+ >
57
45
  <slot name="formBtnExpand"></slot>
58
46
  </x-form>
59
47
  </a-spin>
@@ -92,23 +80,24 @@
92
80
  @rowClick="handleRowClick"
93
81
  @rowDblClick="handleRowDblClick"
94
82
  @beforeDataChange="beforeDataChange"
95
- @expand="onExpand">
96
- <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
83
+ @expand="onExpand"
84
+ >
85
+ <template slot="leftButton" slot-scope="{ selectedRowKeys, selectedRows }">
97
86
  <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
98
87
  </template>
99
- <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
88
+ <template slot="button" slot-scope="{ selectedRowKeys, selectedRows }">
100
89
  <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
101
90
  </template>
102
- <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
91
+ <template slot="rightBtnExpand" slot-scope="{ selectedRowKeys, selectedRows }">
103
92
  <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
104
93
  <a-tooltip title="收起查询条件" placement="bottom">
105
94
  <a-button @click="toggleIsFormShow">
106
- <a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
95
+ <a-icon :style="iconStyle" :type="toggleIsFormIcon" />
107
96
  </a-button>
108
97
  </a-tooltip>
109
98
  </template>
110
99
  <!-- 底部插槽 -->
111
- <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
100
+ <template slot="footer" slot-scope="{ selectedRowKeys, selectedRows }">
112
101
  <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
113
102
  </template>
114
103
  <!-- excel导入说明插槽 -->
@@ -163,23 +152,24 @@
163
152
  @rowClick="handleRowClick"
164
153
  @rowDblClick="handleRowDblClick"
165
154
  @beforeDataChange="beforeDataChange"
166
- @expand="onExpand">
167
- <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
155
+ @expand="onExpand"
156
+ >
157
+ <template slot="leftButton" slot-scope="{ selectedRowKeys, selectedRows }">
168
158
  <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
169
159
  </template>
170
- <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
160
+ <template slot="button" slot-scope="{ selectedRowKeys, selectedRows }">
171
161
  <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
172
162
  </template>
173
- <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
163
+ <template slot="rightBtnExpand" slot-scope="{ selectedRowKeys, selectedRows }">
174
164
  <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
175
165
  <a-tooltip title="关闭弹窗" placement="bottom">
176
166
  <a-button @click="closeTableModal">
177
- <a-icon :style="iconStyle" type="close"/>
167
+ <a-icon :style="iconStyle" type="close" />
178
168
  </a-button>
179
169
  </a-tooltip>
180
170
  </template>
181
171
  <!-- 底部插槽 -->
182
- <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
172
+ <template slot="footer" slot-scope="{ selectedRowKeys, selectedRows }">
183
173
  <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
184
174
  </template>
185
175
  <!-- excel导入说明插槽 -->
@@ -197,12 +187,12 @@
197
187
  </template>
198
188
  <template v-else>
199
189
  <a-empty>
200
- <span slot="description"> 页面配置不存在,请联系系统管理员</span>
190
+ <span slot="description">页面配置不存在,请联系系统管理员</span>
201
191
  </a-empty>
202
192
  </template>
203
193
  </div>
204
194
  </pane>
205
- <UserInfoDetailManage ref="userInfo" @close="refresh(false)"/>
195
+ <UserInfoDetailManage ref="userInfo" @close="refresh(false)" />
206
196
  </splitpanes>
207
197
  </template>
208
198
  <script>
@@ -217,7 +207,9 @@ import 'splitpanes/dist/splitpanes.css'
217
207
  import {
218
208
  getConfigByName,
219
209
  getConfigByLogic,
220
- parseConfig, runLogic, getConfigByNameAsync,
210
+ parseConfig,
211
+ runLogic,
212
+ getConfigByNameAsync
221
213
  } from '@vue2-client/services/api/common'
222
214
  import { mapState } from 'vuex'
223
215
  import XTreePro from '@vue2-client/base-client/components/common/XTree/XTreePro.vue'
@@ -251,43 +243,43 @@ export default {
251
243
  default: () => () => {
252
244
  console.warn('getSelectedId is not provided.')
253
245
  return null
254
- },
246
+ }
255
247
  },
256
248
  setGlobalData: {
257
249
  default: () => () => {
258
250
  console.warn('setGlobalData is not provided.')
259
251
  return null
260
- },
252
+ }
261
253
  },
262
254
  getGlobalData: {
263
255
  default: () => () => {
264
256
  console.warn('getGlobalData is not provided.')
265
257
  return null
266
- },
258
+ }
267
259
  },
268
260
  getSelectedData: {
269
261
  default: () => () => {
270
262
  console.warn('getSelectedData is not provided.')
271
263
  return null
272
- },
264
+ }
273
265
  },
274
266
  getMixinData: {
275
267
  default: () => () => {
276
268
  console.warn('getMixinData is not provided.')
277
269
  return {}
278
- },
270
+ }
279
271
  },
280
272
  getOutEnv: {
281
273
  default: () => () => {
282
274
  console.warn('getOutEnv is not provided.')
283
275
  return {}
284
- },
276
+ }
285
277
  },
286
278
  currUser: {
287
279
  default: () => {
288
280
  console.warn('currUser is not provided.')
289
281
  return { id: null, name: 'Guest' }
290
- },
282
+ }
291
283
  },
292
284
 
293
285
  /**
@@ -383,8 +375,7 @@ export default {
383
375
  // 执行logic传递的参数
384
376
  logicParam: {
385
377
  type: Object,
386
- default: () => {
387
- }
378
+ default: () => {}
388
379
  },
389
380
  // 固定新增表单
390
381
  fixedAddForm: {
@@ -471,7 +462,7 @@ export default {
471
462
  },
472
463
  reportQueryName: {
473
464
  type: String,
474
- default: undefined,
465
+ default: undefined
475
466
  },
476
467
  // 是否自定义删除按钮的功能
477
468
  customDelete: {
@@ -531,7 +522,7 @@ export default {
531
522
  defaultPageSize: {
532
523
  type: Number,
533
524
  default: 10
534
- },
525
+ }
535
526
  },
536
527
  watch: {
537
528
  logicParam: {
@@ -642,14 +633,19 @@ export default {
642
633
  },
643
634
 
644
635
  getConfig () {
645
- getConfigByName(this.queryParamsName, this.serviceName, (res) => {
646
- if (!res) {
647
- this.loading = false
648
- this.loadError = true
649
- return
650
- }
651
- this.updateComponents(res)
652
- }, this.env === 'dev')
636
+ getConfigByName(
637
+ this.queryParamsName,
638
+ this.serviceName,
639
+ res => {
640
+ if (!res) {
641
+ this.loading = false
642
+ this.loadError = true
643
+ return
644
+ }
645
+ this.updateComponents(res)
646
+ },
647
+ this.env === 'dev'
648
+ )
653
649
  },
654
650
  getConfigBySource () {
655
651
  parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
@@ -662,14 +658,20 @@ export default {
662
658
  })
663
659
  },
664
660
  getColumnJsonByLogic () {
665
- getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
666
- if (!res) {
667
- this.loading = false
668
- this.loadError = true
669
- return
670
- }
671
- this.updateComponents(res, true)
672
- }, this.env === 'dev')
661
+ getConfigByLogic(
662
+ this.logicName,
663
+ this.logicParam,
664
+ this.serviceName,
665
+ res => {
666
+ if (!res) {
667
+ this.loading = false
668
+ this.loadError = true
669
+ return
670
+ }
671
+ this.updateComponents(res, true)
672
+ },
673
+ this.env === 'dev'
674
+ )
673
675
  },
674
676
 
675
677
  /**
@@ -683,9 +685,10 @@ export default {
683
685
  this.tableShowMode = res.tableShowMode || 'default'
684
686
 
685
687
  // 弹框模式下,xTable 可能还未渲染,需要特殊处理
686
- const hasRequiredRefs = this.tableShowMode === 'popup'
687
- ? (this.$refs.xForm && this.$refs.xAddForm)
688
- : (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm)
688
+ const hasRequiredRefs =
689
+ this.tableShowMode === 'popup'
690
+ ? this.$refs.xForm && this.$refs.xAddForm
691
+ : this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm
689
692
 
690
693
  if (hasRequiredRefs) {
691
694
  // 设置添加按钮对应的配置名
@@ -724,7 +727,11 @@ export default {
724
727
  ...res
725
728
  })
726
729
  if (this.realQueryConfig?.funcData?.pageMounted) {
727
- executeStrFunctionByContext(this, this.realQueryConfig.funcData.pageMounted, [util, runLogic, getConfigByNameAsync])
730
+ executeStrFunctionByContext(this, this.realQueryConfig.funcData.pageMounted, [
731
+ util,
732
+ runLogic,
733
+ getConfigByNameAsync
734
+ ])
728
735
  }
729
736
  this.$emit('afterTableInit')
730
737
  }
@@ -895,14 +902,12 @@ export default {
895
902
  */
896
903
  move () {
897
904
  this.moveType = true
898
- this.$nextTick(
899
- () => {
900
- this.$refs.xAddReport.init({
901
- configName: this.moveconfig,
902
- selectedId: this.fixedAddForm.selected_id
903
- })
904
- }
905
- )
905
+ this.$nextTick(() => {
906
+ this.$refs.xAddReport.init({
907
+ configName: this.moveconfig,
908
+ selectedId: this.fixedAddForm.selected_id
909
+ })
910
+ })
906
911
  },
907
912
  /**
908
913
  * 修改按钮事件
@@ -976,7 +981,8 @@ export default {
976
981
  * 查询表单部分显示/隐藏切换
977
982
  */
978
983
  toggleIsFormShow () {
979
- this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
984
+ this.toggleIsFormIcon =
985
+ this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
980
986
  this.$refs.xForm.toggleVisible()
981
987
  // 只有在非弹出模式下才需要调整表格滚动高度
982
988
  if (this.tableShowMode !== 'popup') {
@@ -1250,13 +1256,14 @@ export default {
1250
1256
  }
1251
1257
 
1252
1258
  // 默认选中状态(没有特殊行样式时)
1253
- .ant-table-row-selected:not(.ant-table-row-success):not(.ant-table-row-warning):not(.ant-table-row-error):not(.ant-table-row-magic) {
1259
+ .ant-table-row-selected:not(.ant-table-row-success):not(.ant-table-row-warning):not(.ant-table-row-error):not(
1260
+ .ant-table-row-magic
1261
+ ) {
1254
1262
  background-color: rgba(24, 144, 255, 0.1);
1255
1263
  }
1256
1264
  }
1257
1265
  </style>
1258
1266
  <style>
1259
-
1260
1267
  .splitpanes.default-theme .splitpanes__splitter {
1261
1268
  border: 0;
1262
1269
  width: 1rem;
@@ -1285,5 +1292,4 @@ export default {
1285
1292
  font-size: 12px;
1286
1293
  line-height: 1.5;
1287
1294
  }
1288
-
1289
1295
  </style>
@@ -3,4 +3,4 @@
3
3
  * 提供 Composition API 风格的可复用逻辑
4
4
  */
5
5
 
6
- export { usePost, createPost, useRunLogic, createRunLogic } from './usePost'
6
+ export { usePost, useRunLogic } from './usePost'
@@ -77,17 +77,20 @@ export default {
77
77
  },
78
78
  mutations: {
79
79
  setUser (state, user) {
80
+ const operInfo = {
81
+ f_operator: user?.name,
82
+ f_operatorid: user?.id,
83
+ f_orgid: user?.orgid,
84
+ f_orgname: user?.orgs,
85
+ f_depid: user?.depids,
86
+ f_depname: user?.deps,
87
+ f_zoneid: user?.zoneid,
88
+ f_zones: user?.zones
89
+ }
90
+ // 使用时请使用 operInfo, operaInfo后续可能移除
80
91
  state.user = Object.assign(user, {
81
- operaInfo: {
82
- f_operator: user?.name,
83
- f_operatorid: user?.id,
84
- f_orgid: user?.orgid,
85
- f_orgname: user?.orgs,
86
- f_depid: user?.depids,
87
- f_depname: user?.deps,
88
- f_zoneid: user?.zoneid,
89
- f_zones: user?.zones
90
- }
92
+ operaInfo: operInfo,
93
+ operInfo
91
94
  })
92
95
  // 组织组织机构信息
93
96
  localStorage.setItem(process.env.VUE_APP_USER_KEY, JSON.stringify(user))