vue2-client 1.8.366 → 1.8.368

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.8.366",
3
+ "version": "1.8.368",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -17,7 +17,7 @@
17
17
  <!-- 详情区域 -->
18
18
  <div class="row">
19
19
  <div class="content">
20
- <a-descriptions :column="desColumn" size="small">
20
+ <a-descriptions :column="desColumn" style="padding-left: 2%">
21
21
  <slot name="descriptionsContent" :details="details"/>
22
22
  </a-descriptions>
23
23
  </div>
@@ -5,7 +5,7 @@
5
5
  <a-col span="16" :offset="2">
6
6
  <span>{{ config.title }}</span>
7
7
  </a-col>
8
- <a-col span="4" :offset="2" v-if="treeDisplaySwitch">
8
+ <a-col span="1" :offset="2" v-if="treeDisplaySwitch">
9
9
  <a-icon :type="treeDisplayConfig.showTree? 'caret-down':'caret-left'" :style="{color: treeDisplayConfig.buttonColor}" @click="treeDisplayConfig.showTree=!treeDisplayConfig.showTree"/>
10
10
  </a-col>
11
11
  </a-row>
@@ -50,6 +50,7 @@
50
50
  :item-size="40"
51
51
  :auto-expand-parent="true"
52
52
  @check-change="handleCheckChange"
53
+ @node-click="handleNodeClick"
53
54
  :filter-node-method="filterNode"
54
55
  :props="props"
55
56
  >
@@ -129,7 +129,7 @@ export default {
129
129
  // 只做展示
130
130
  displayOnly: {
131
131
  type: Boolean,
132
- default: false
132
+ default: true
133
133
  },
134
134
  // 表格没有边距
135
135
  noPadding: {
@@ -149,7 +149,7 @@ export default {
149
149
  // 是否展示保存按钮
150
150
  showSaveButton: {
151
151
  type: Boolean,
152
- default: true
152
+ default: false
153
153
  },
154
154
  // 是否将组件注册到外层提供的容器中,方便外侧统一保存
155
155
  registerMap: {
@@ -4,7 +4,7 @@
4
4
  @updateImg="updateImg"
5
5
  ref="main"
6
6
  :use-oss-for-img="false"
7
- config-name="ceshi"
7
+ config-name="cs1"
8
8
  server-name="af-system"
9
9
  :show-img-in-cell="true"
10
10
  :display-only="displayOnly"
@@ -12,7 +12,15 @@
12
12
  :span="cell.colSpan ? cell.colSpan * 2 : undefined">
13
13
  <!-- 插槽渲染 -->
14
14
  <template v-if="cell.type === 'slot'">
15
- <component :is="getComponentName(cell.slotConfig, cell.serviceName)" :key="cellIndex" :serviceName="cell.serviceName" :queryParamsName="cell.slotConfig" />
15
+ <template v-if="cell.slotType === 'x-form-table'">
16
+ <component :is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)" :key="cellIndex" :serviceName="cell.serviceName" :queryParamsName="cell.slotConfig" />
17
+ </template>
18
+ </template>
19
+ <!-- button 按钮渲染 -->
20
+ <template v-else-if="cell.type === 'button'">
21
+ <a-button @[cell.eventType]="() => executeCustomFunction(cell.customFunction)">
22
+ {{ cell.buttonName }}
23
+ </a-button>
16
24
  </template>
17
25
  <template v-else-if="cell.type === 'column'">
18
26
  <template v-if="cell.customFunction">
@@ -459,10 +467,21 @@ export default {
459
467
  }
460
468
  },
461
469
  methods: {
462
- async getComponentName (queryParamsName, serviceName) {
470
+ executeCustomFunction (funcStr) {
471
+ try {
472
+ // 使用 Function 构造器创建函数
473
+ // eslint-disable-next-line no-new-func
474
+ const func = new Function('return ' + funcStr)()
475
+ // 执行函数
476
+ func.call(this)
477
+ } catch (error) {
478
+ console.error('Error executing custom function:', error)
479
+ }
480
+ },
481
+ getComponentName (queryParamsName, serviceName, componentName) {
463
482
  // const config = await getConfigByName(queryParamsName, serviceName)
464
483
  // const componentName = config.$globalProp.type
465
- return 'x-form-table'
484
+ return componentName
466
485
  },
467
486
  updateImg (data) {
468
487
  this.$emit('updateImg', data)
@@ -1,11 +1,10 @@
1
1
  <template>
2
2
  <div>
3
- <a-tabs v-model="activeKey">
3
+ <a-tabs default-active-key="0">
4
4
  <a-tab-pane
5
5
  v-for="(tab, index) in config"
6
6
  :key="index"
7
7
  :tab="tab.title"
8
- :keyProp="'key'"
9
8
  >
10
9
  <component :is="tab.slotType" :key="index" :serviceName="tab.serviceName" :queryParamsName="tab.slotConfig" />
11
10
  </a-tab-pane>
@@ -14,49 +13,68 @@
14
13
  </template>
15
14
 
16
15
  <script>
17
- import { Tabs, Button } from 'ant-design-vue'
18
16
  import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
19
17
  import { getConfigByName } from '@vue2-client/services/api/common'
20
18
 
21
19
  export default {
22
20
  name: 'XTab',
21
+ components: {
22
+ XFormTable,
23
+ },
24
+ data () {
25
+ return {
26
+ activeKey: 0,
27
+ // 配置
28
+ config: undefined,
29
+ }
30
+ },
31
+ methods: {
32
+ initConfig () {
33
+ if (this.configName) {
34
+ this.getConfig()
35
+ } else if (this.localConfig) {
36
+ this.config = this.localConfig.data
37
+ console.log('>>>> this.config: ', JSON.stringify(this.config))
38
+ }
39
+ },
40
+ getConfig () {
41
+ getConfigByName(this.configName, this.serverName, res => {
42
+ this.config = res.data
43
+ })
44
+ }
45
+ },
23
46
  props: {
24
47
  // 配置名
25
48
  configName: {
26
49
  type: String,
27
- required: true
50
+ default: undefined
28
51
  },
29
52
  serverName: {
30
53
  type: String,
31
- required: true
32
- }
54
+ default: undefined
55
+ },
56
+ // 本地配置,调试用
57
+ localConfig: {
58
+ type: Object,
59
+ default: undefined
60
+ },
33
61
  },
34
62
  watch: {
35
63
  configName: {
36
64
  deep: true,
37
65
  immediate: true,
38
66
  handler (val) {
39
- if (val) {
40
- getConfigByName(this.configName, this.serverName, res => {
41
- this.config = res.data
42
- })
43
- }
67
+ this.initConfig()
44
68
  }
45
- }
46
- },
47
- components: {
48
- XFormTable,
49
- 'a-tabs': Tabs,
50
- 'a-tab-pane': Tabs.TabPane,
51
- 'a-button': Button,
52
- },
53
- data () {
54
- return {
55
- activeKey: '1',
56
- // 配置
57
- config: undefined,
58
- }
69
+ },
70
+ // 如果本地配置更改了,重新初始化
71
+ localConfig: {
72
+ deep: true,
73
+ immediate: true,
74
+ handler (val) {
75
+ this.initConfig()
76
+ }
77
+ },
59
78
  },
60
- methods: {},
61
79
  }
62
80
  </script>