vue2-client 1.8.261 → 1.8.263

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.261",
3
+ "version": "1.8.263",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -5,6 +5,7 @@
5
5
  defaultExpandAll
6
6
  show-icon
7
7
  @select="handleTreeSelect"
8
+ :selectedKeys="selectedKeys"
8
9
  style="overflow: hidden"
9
10
  :draggable="true"
10
11
  @drop="treeDrop"
@@ -17,6 +18,7 @@
17
18
  <a-menu @click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey)">
18
19
  <a-menu-item key="copy">复制</a-menu-item>
19
20
  <a-menu-item key="paste" :disabled="copyCache === undefined">粘贴</a-menu-item>
21
+ <a-menu-item key="split" :disabled="determineLevel(treeKey) !== 'item'">拆分</a-menu-item>
20
22
  <a-menu-item key="rename" :disabled="treeKey.length > 2 && treeKey.length <= 5">重命名</a-menu-item>
21
23
  <a-menu-item key="delete">删除</a-menu-item>
22
24
  </a-menu>
@@ -55,6 +57,10 @@ export default {
55
57
  config: {
56
58
  type: Object,
57
59
  required: true,
60
+ },
61
+ selectTreeNode: {
62
+ type: String,
63
+ default: undefined
58
64
  }
59
65
  },
60
66
  methods: {
@@ -145,134 +151,164 @@ export default {
145
151
  }
146
152
  this.$emit('componentMove', dragKey, dropKey, dropLevel, dropPosition)
147
153
  },
148
- // 树右键事件
149
- onContextMenuClick (treeKey, menuKey) {
150
- // 判断目标类型
151
- const targetType = this.determineLevel(treeKey)
154
+ handleDelete (targetType, originalKey) {
152
155
  const _this = this
156
+ if (targetType === 'item') {
157
+ this.$confirm({
158
+ title: `确认删除此组件?`,
159
+ content: `组件ID:${originalKey}`,
160
+ onOk () {
161
+ _this.$emit('deleteComponent', originalKey, 'component')
162
+ },
163
+ onCancel () {},
164
+ })
165
+ } else if (targetType === 'page') {
166
+ const page = lowcodeUtils.getPageConfigById(originalKey, this.config)
167
+ this.$confirm({
168
+ title: `确认删除此页面?`,
169
+ content: `所选页面:${page.title}[${lowcodeUtils.resolvePageType(page.type)}]`,
170
+ onOk () {
171
+ _this.$emit('deleteComponent', originalKey, 'page')
172
+ },
173
+ onCancel () {},
174
+ })
175
+ } else if (targetType === 'row') {
176
+ this.$confirm({
177
+ title: `确认删除此行?`,
178
+ content: `所选行:${originalKey}`,
179
+ onOk () {
180
+ _this.$emit('deleteComponent', originalKey, 'row')
181
+ },
182
+ onCancel () {},
183
+ })
184
+ } else if (targetType === 'container_page') {
185
+ this.$confirm({
186
+ title: `确认删除此容器页面?`,
187
+ content: `所选容器:${originalKey}`,
188
+ onOk () {
189
+ _this.$emit('deleteComponent', originalKey, 'container_page')
190
+ },
191
+ onCancel () {},
192
+ })
193
+ }
194
+ },
195
+ handleCopy (treeKey, targetType) {
153
196
  const originalKey = this.getOriginalKey(treeKey)
154
- // 点击右键菜单中删除的事件
155
- if (menuKey === 'delete') {
156
- if (targetType === 'item') {
157
- this.$confirm({
158
- title: `确认删除此组件?`,
159
- content: `组件ID:${originalKey}`,
160
- onOk () {
161
- _this.$emit('deleteComponent', originalKey, 'component')
162
- },
163
- onCancel () {},
164
- })
165
- } else if (targetType === 'page') {
166
- const page = lowcodeUtils.getPageConfigById(originalKey, this.config)
167
- this.$confirm({
168
- title: `确认删除此页面?`,
169
- content: `所选页面:${page.title}[${lowcodeUtils.resolvePageType(page.type)}]`,
170
- onOk () {
171
- _this.$emit('deleteComponent', originalKey, 'page')
172
- },
173
- onCancel () {},
174
- })
175
- } else if (targetType === 'row') {
176
- this.$confirm({
177
- title: `确认删除此行?`,
178
- content: `所选行:${originalKey}`,
179
- onOk () {
180
- _this.$emit('deleteComponent', originalKey, 'row')
181
- },
182
- onCancel () {},
197
+ let temp
198
+ if (targetType === 'container_page') {
199
+ temp = lowcodeUtils.getContainerPageOuterByContainerPageId(originalKey, this.config)
200
+ } else {
201
+ temp = lowcodeUtils.getConfig(originalKey, this.config)
202
+ }
203
+ // 复制
204
+ let copy = JSON.parse(JSON.stringify(temp))
205
+ console.warn('copy', copy)
206
+ if (targetType === 'page') {
207
+ // 重新修改id和title
208
+ copy.id = 'page_' + lowcodeUtils.nanoidWithoutSymbol(6)
209
+ copy.title = copy.title + '_副本'
210
+ // 复制页面自动粘贴
211
+ this.$emit('pasteItem', originalKey, copy, 'page')
212
+ } else {
213
+ if (targetType === 'row') {
214
+ // 将行内每个组件重新修改id
215
+ const copyKeys = Object.keys(copy)
216
+ copyKeys.forEach(key => {
217
+ const prefix = copy[key].id.split('_')[0]
218
+ copy[key].id = prefix + '_' + lowcodeUtils.nanoidWithoutSymbol(6)
183
219
  })
220
+ } else if (targetType === 'item') {
221
+ // 重新修改id
222
+ const prefix = copy.id.split('_')[0]
223
+ copy.id = prefix + '_' + lowcodeUtils.nanoidWithoutSymbol(6)
184
224
  } else if (targetType === 'container_page') {
185
- this.$confirm({
186
- title: `确认删除此容器页面?`,
187
- content: `所选容器:${originalKey}`,
188
- onOk () {
189
- _this.$emit('deleteComponent', originalKey, 'container_page')
190
- },
191
- onCancel () {},
192
- })
225
+ // 重新修改id
226
+ copy.id = 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
227
+ copy = lowcodeUtils.reRandomComponentId(copy)
193
228
  }
194
- } else if (menuKey === 'copy') {
195
- const originalKey = this.getOriginalKey(treeKey)
196
- let temp
197
- if (targetType === 'container_page') {
198
- temp = lowcodeUtils.getContainerPageOuterByContainerPageId(originalKey, this.config)
199
- } else {
200
- temp = lowcodeUtils.getConfig(originalKey, this.config)
201
- }
202
- // 复制
203
- let copy = JSON.parse(JSON.stringify(temp))
204
- console.warn('copy', copy)
205
- if (targetType === 'page') {
206
- // 重新修改id和title
207
- copy.id = 'page_' + lowcodeUtils.nanoidWithoutSymbol(6)
208
- copy.title = copy.title + '_副本'
209
- // 复制页面自动粘贴
210
- this.$emit('pasteItem', originalKey, copy, 'page')
211
- } else {
212
- if (targetType === 'row') {
213
- // 将行内每个组件重新修改id
214
- const copyKeys = Object.keys(copy)
215
- copyKeys.forEach(key => {
216
- const prefix = copy[key].id.split('_')[0]
217
- copy[key].id = prefix + '_' + lowcodeUtils.nanoidWithoutSymbol(6)
218
- })
219
- } else if (targetType === 'item') {
220
- // 重新修改id
221
- const prefix = copy.id.split('_')[0]
222
- copy.id = prefix + '_' + lowcodeUtils.nanoidWithoutSymbol(6)
223
- } else if (targetType === 'container_page') {
224
- // 重新修改id
225
- copy.id = 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
226
- copy = lowcodeUtils.reRandomComponentId(copy)
227
- }
228
- this.copyCache = {
229
- type: targetType,
230
- content: copy
231
- }
232
- this.$message.success('复制成功!')
233
- }
234
- } else if (menuKey === 'paste') {
235
- // 同级别内容不能粘贴到另一个中
236
- if (targetType === this.copyCache.type) {
237
- this.$message.error('该操作不合法!')
238
- return
229
+ this.copyCache = {
230
+ type: targetType,
231
+ content: copy
239
232
  }
233
+ this.$message.success('复制成功!')
234
+ }
235
+ },
236
+ handlePaste (targetType, originalKey) {
237
+ // 同级别内容不能粘贴到另一个中
238
+ if (targetType === this.copyCache.type) {
239
+ this.$message.error('该操作不合法!')
240
+ return
241
+ }
240
242
 
241
- // 行只能复制到容器页面和页面中
242
- if (this.copyCache.type === 'row') {
243
- if (targetType === 'page' || targetType === 'container_page') {
244
- this.$emit('pasteItem', originalKey, this.copyCache, 'page-row')
245
- return
246
- }
243
+ // 行只能复制到容器页面和页面中
244
+ if (this.copyCache.type === 'row') {
245
+ if (targetType === 'page' || targetType === 'container_page') {
246
+ this.$emit('pasteItem', originalKey, this.copyCache, 'page-row')
247
+ return
247
248
  }
249
+ }
248
250
 
249
- // 模块,容器页面只能复制到行
250
- if (this.copyCache.type === 'item' || this.copyCache.type === 'container_page') {
251
- if (targetType === 'row') {
252
- this.$emit('pasteItem', originalKey, this.copyCache, 'row-item')
253
- return
254
- }
251
+ // 模块,容器页面只能复制到行
252
+ if (this.copyCache.type === 'item' || this.copyCache.type === 'container_page') {
253
+ if (targetType === 'row') {
254
+ this.$emit('pasteItem', originalKey, this.copyCache, 'row-item')
255
+ return
255
256
  }
257
+ }
256
258
 
257
- // 其余操作均不合法
258
- this.$message.error('该操作不合法!')
259
- } else if (menuKey === 'rename') {
260
- const target = lowcodeUtils.getConfig(treeKey, this.config)
261
- this.renameId = target.id
262
- if (treeKey.length <= 2) {
263
- this.pageNewName = target.title
264
- } else {
265
- if (target.name) {
266
- this.pageNewName = target.name
267
- } else {
268
- this.pageNewName = target.id
269
- }
270
- }
271
- this.showRenameModal = true
259
+ // 其余操作均不合法
260
+ this.$message.error('该操作不合法!')
261
+ },
262
+ handleRename (originalKey) {
263
+ const target = lowcodeUtils.getConfig(originalKey, this.config)
264
+ this.renameId = target.id
265
+ if (target.title) {
266
+ this.pageNewName = target.title
267
+ } else if (target.name) {
268
+ this.pageNewName = target.name
269
+ } else {
270
+ this.pageNewName = target.id
271
+ }
272
+ this.showRenameModal = true
273
+ },
274
+ handleSplit (originalKey) {
275
+ const _this = this
276
+ this.$confirm({
277
+ title: `是否垂直拆分?`,
278
+ onOk () {
279
+ _this.$emit('split', originalKey, true)
280
+ },
281
+ onCancel () {
282
+ _this.$emit('split', originalKey, false)
283
+ },
284
+ })
285
+ },
286
+ // 树右键事件
287
+ onContextMenuClick (treeKey, menuKey) {
288
+ // 判断目标类型
289
+ const targetType = this.determineLevel(treeKey)
290
+ const originalKey = this.getOriginalKey(treeKey)
291
+ // 点击右键菜单中删除的事件
292
+ switch (menuKey) {
293
+ case 'delete':
294
+ this.handleDelete(targetType, originalKey)
295
+ return
296
+ case 'copy':
297
+ this.handleCopy(treeKey, targetType)
298
+ return
299
+ case 'paste':
300
+ this.handlePaste(targetType, originalKey)
301
+ return
302
+ case 'rename':
303
+ this.handleRename(originalKey)
304
+ return
305
+ case 'split':
306
+ this.handleSplit(originalKey)
272
307
  }
273
308
  },
274
309
  // 处理架构树点击事件
275
310
  handleTreeSelect (value) {
311
+ this.selectedKeys = value
276
312
  this.$emit('treeOrganizationClick', value[0])
277
313
  // 如果选中的id只有两位证明是页面容器
278
314
  // let isPage = false
@@ -383,7 +419,17 @@ export default {
383
419
  showRenameModal: false,
384
420
  copyCache: undefined,
385
421
  pageNewName: undefined,
386
- renameId: undefined
422
+ renameId: undefined,
423
+ selectedKeys: []
424
+ }
425
+ },
426
+ watch: {
427
+ selectTreeNode: {
428
+ handler (newVal) {
429
+ if (newVal) {
430
+ this.selectedKeys = [newVal]
431
+ }
432
+ }
387
433
  }
388
434
  }
389
435
  }
@@ -57,17 +57,18 @@
57
57
  </div>
58
58
  </div>
59
59
  <!-- 页面渲染 / 编辑模式中,将弹框或抽屉中的内容渲染为页面 -->
60
- <div
61
- @click="clickComponentInEditor(item)"
62
- :class=" editMode ? 'componentInEditor' : '' "
63
- v-else-if="editMode || (page.type !== 'modal' && page.type !== 'draw')">
64
- <component
65
- :lifeCycleFunction="resolveLifeCycleEvent(item)"
66
- :is="resolveComponentType(item.type, item.id)"
67
- :propsData="{...item.props}"
68
- @componentDidMounted="componentDidMounted"
69
- @onEvent="handleEvent"
70
- :mixinComponentId="item.id"/>
60
+ <div :ref="item.id" v-else-if="editMode || (page.type !== 'modal' && page.type !== 'draw')">
61
+ <div
62
+ @click="clickComponentInEditor(item)"
63
+ :class=" editMode ? 'componentInEditor' : '' ">
64
+ <component
65
+ :lifeCycleFunction="resolveLifeCycleEvent(item)"
66
+ :is="resolveComponentType(item.type, item.id)"
67
+ :propsData="{...item.props}"
68
+ @componentDidMounted="componentDidMounted"
69
+ @onEvent="handleEvent"
70
+ :mixinComponentId="item.id"/>
71
+ </div>
71
72
  </div>
72
73
  </a-col>
73
74
  </template>
@@ -169,7 +170,8 @@ export default {
169
170
  // 抽屉显示集合
170
171
  drawVisible: {},
171
172
  // 控制递归渲染
172
- renderSub: true
173
+ renderSub: true,
174
+ colClassName: ''
173
175
  }
174
176
  },
175
177
  inject: [
@@ -478,6 +480,9 @@ export default {
478
480
  }
479
481
  }
480
482
  })
483
+ },
484
+ twink (id) {
485
+
481
486
  }
482
487
  },
483
488
  watch: {
@@ -498,6 +503,9 @@ export default {
498
503
  .componentInEditor:hover{
499
504
  border: 2px rgb( 24,144,255) solid;
500
505
  }
506
+ .colWithBorder{
507
+ border: 2px rgb( 24,144,255) solid;
508
+ }
501
509
  .container{
502
510
  display: flex;
503
511
  flex-direction: column;
@@ -85,6 +85,11 @@ export default {
85
85
  outerContainerIndex: {
86
86
  type: [String, Number],
87
87
  default: undefined
88
+ },
89
+ // 图片上传后添加前缀
90
+ imgPrefix: {
91
+ type: String,
92
+ default: undefined
88
93
  }
89
94
  },
90
95
  computed: {
@@ -154,7 +159,12 @@ export default {
154
159
  }
155
160
  fileInfo.response = dataObj
156
161
  fileInfo.id = dataObj.id
157
- fileInfo.url = dataObj.f_downloadpath
162
+ // 如果新上传的图片是V4,需要携带serviceName前缀,但是同时也要回显老系统图片
163
+ if (this.imgPrefix) {
164
+ fileInfo.url = this.imgPrefix + dataObj.f_downloadpath
165
+ } else {
166
+ fileInfo.url = dataObj.f_downloadpath
167
+ }
158
168
  if (this.outerContainerIndex !== undefined) {
159
169
  this.$emit('setFiles', this.uploadedFileList.filter(item => item.status === 'done'), this.outerContainerIndex)
160
170
  } else {
@@ -9,6 +9,7 @@
9
9
  <XReportDesign
10
10
  @updateImg="updateImg"
11
11
  v-if="scanFinish"
12
+ :img-prefix="imgPrefix"
12
13
  :use-oss-for-img="useOssForImg"
13
14
  :display-only="displayOnly"
14
15
  :config="type === 'display' ? originalConfig : activeConfig"
@@ -16,6 +17,7 @@
16
17
  :for-display="type === 'display'"
17
18
  ref="XReportDesign"
18
19
  id="printReady"
20
+ :server-name="serverName"
19
21
  :show-title="showTitle"
20
22
  :no-padding="noPadding"
21
23
  :no-top-border="noTopBorder"
@@ -42,6 +44,7 @@
42
44
  <XReportDesign
43
45
  v-if="scanFinish"
44
46
  @updateImg="updateImg"
47
+ :img-prefix="imgPrefix"
45
48
  :use-oss-for-img="useOssForImg"
46
49
  :display-only="displayOnly"
47
50
  :config="type === 'display' ? originalConfig : activeConfig"
@@ -52,6 +55,7 @@
52
55
  :show-title="showTitle"
53
56
  ref="XReportDesign"
54
57
  id="printReady"
58
+ :server-name="serverName"
55
59
  :show-images="hasImages"
56
60
  :image-list="imageList">
57
61
  </XReportDesign>
@@ -159,6 +163,11 @@ export default {
159
163
  useOssForImg: {
160
164
  type: Boolean,
161
165
  default: true
166
+ },
167
+ // 图片上传后添加前缀
168
+ imgPrefix: {
169
+ type: String,
170
+ default: undefined
162
171
  }
163
172
  },
164
173
  components: {
@@ -2,6 +2,8 @@
2
2
  <div>
3
3
  <template v-if="this.activatedConfig.designMode === 'json'">
4
4
  <XReportJsonRender
5
+ :img-prefix="imgPrefix"
6
+ :server-name="serverName"
5
7
  :display-only="displayOnly"
6
8
  :show-title="showTitle"
7
9
  :no-padding="noPadding"
@@ -52,6 +54,8 @@
52
54
  <template v-if="!forDisplay">
53
55
  <x-report-tr-group
54
56
  @updateImg="updateImg"
57
+ :img-prefix="imgPrefix"
58
+ :server-name="serverName"
55
59
  :use-oss-for-img="useOssForImg"
56
60
  :key="rowIndex"
57
61
  :columns="row"
@@ -63,6 +67,8 @@
63
67
  <template v-else>
64
68
  <x-report-tr-group
65
69
  @updateImg="updateImg"
70
+ :img-prefix="imgPrefix"
71
+ :server-name="serverName"
66
72
  :use-oss-for-img="useOssForImg"
67
73
  :config="activatedConfig"
68
74
  :key="rowIndex"
@@ -79,6 +85,8 @@
79
85
  <template v-if="!forDisplay">
80
86
  <x-report-tr-group
81
87
  @updateImg="updateImg"
88
+ :img-prefix="imgPrefix"
89
+ :server-name="serverName"
82
90
  :use-oss-for-img="useOssForImg"
83
91
  :config="activatedConfig"
84
92
  :key="rowIndex + listIndex"
@@ -91,6 +99,8 @@
91
99
  <template v-else>
92
100
  <x-report-tr-group
93
101
  @updateImg="updateImg"
102
+ :img-prefix="imgPrefix"
103
+ :server-name="serverName"
94
104
  :use-oss-for-img="useOssForImg"
95
105
  :config="activatedConfig"
96
106
  :key="rowIndex + listIndex"
@@ -108,6 +118,8 @@
108
118
  <template v-if="forDisplay">
109
119
  <x-report-tr-group
110
120
  @updateImg="updateImg"
121
+ :img-prefix="imgPrefix"
122
+ :server-name="serverName"
111
123
  :use-oss-for-img="useOssForImg"
112
124
  :config="activatedConfig"
113
125
  :columns="row[0].definition"
@@ -122,6 +134,8 @@
122
134
  <template v-if="!forDisplay">
123
135
  <x-report-tr-group
124
136
  @updateImg="updateImg"
137
+ :img-prefix="imgPrefix"
138
+ :server-name="serverName"
125
139
  :use-oss-for-img="useOssForImg"
126
140
  :config="activatedConfig"
127
141
  :columns="row[0].definition"
@@ -134,6 +148,8 @@
134
148
  <!-- 动态行交互按钮 -->
135
149
  <x-report-tr-group
136
150
  @updateImg="updateImg"
151
+ :img-prefix="imgPrefix"
152
+ :server-name="serverName"
137
153
  :use-oss-for-img="useOssForImg"
138
154
  :config="activatedConfig"
139
155
  :key="rowIndex"
@@ -181,6 +197,11 @@ export default {
181
197
  type: Boolean,
182
198
  default: false
183
199
  },
200
+ // 命名空间
201
+ serverName: {
202
+ type: String,
203
+ default: 'af-system'
204
+ },
184
205
  // 是否只能展示不可编辑
185
206
  displayOnly: {
186
207
  type: Boolean,
@@ -220,6 +241,11 @@ export default {
220
241
  useOssForImg: {
221
242
  type: Boolean,
222
243
  default: true
244
+ },
245
+ // 图片上传后添加前缀
246
+ imgPrefix: {
247
+ type: String,
248
+ default: undefined
223
249
  }
224
250
  },
225
251
  components: {
@@ -130,6 +130,11 @@ export default {
130
130
  type: Boolean,
131
131
  default: false
132
132
  },
133
+ // 命名空间
134
+ serverName: {
135
+ type: String,
136
+ default: 'af-system'
137
+ },
133
138
  // 是否展示标题
134
139
  showTitle: {
135
140
  type: Boolean,
@@ -139,6 +144,11 @@ export default {
139
144
  displayOnly: {
140
145
  type: Boolean,
141
146
  default: true
147
+ },
148
+ // 图片上传后添加前缀
149
+ imgPrefix: {
150
+ type: String,
151
+ default: undefined
142
152
  }
143
153
  },
144
154
  data () {
@@ -242,7 +242,8 @@
242
242
  <template v-if="configData.images[cell.dataIndex]?.length > 0">
243
243
  <upload
244
244
  :model="uploadParams"
245
- service-name="af-system"
245
+ :img-prefix="imgPrefix"
246
+ :service-name="serverName"
246
247
  :images="checkImg(cell.dataIndex, 'configData')"
247
248
  :outer-container-index="cell.dataIndex"
248
249
  @setFiles="(...args) => {setImages(args, 'configData')}"
@@ -252,7 +253,8 @@
252
253
  <template v-else>
253
254
  <upload
254
255
  :model="uploadParams"
255
- service-name="af-system"
256
+ :img-prefix="imgPrefix"
257
+ :service-name="serverName"
256
258
  :images="checkImg(cell.dataIndex, 'config')"
257
259
  :outer-container-index="cell.dataIndex"
258
260
  @setFiles="(...args) => {setImages(args, 'config', cell.dataIndex)}"
@@ -357,6 +359,11 @@ export default {
357
359
  return {}
358
360
  }
359
361
  },
362
+ // 命名空间
363
+ serverName: {
364
+ type: String,
365
+ default: 'af-system'
366
+ },
360
367
  // 原始配置
361
368
  configData: {
362
369
  type: Object,
@@ -396,6 +403,11 @@ export default {
396
403
  useOssForImg: {
397
404
  type: Boolean,
398
405
  default: true
406
+ },
407
+ // 图片上传后添加前缀
408
+ imgPrefix: {
409
+ type: String,
410
+ default: undefined
399
411
  }
400
412
  },
401
413
  data () {
@@ -47,7 +47,9 @@
47
47
  <LowCodePageOrganization
48
48
  :config="config"
49
49
  v-if="showPageOrganization"
50
+ :select-tree-node="selectTreeNode"
50
51
  @rename="rename"
52
+ @split="handleSplit"
51
53
  @pasteItem="handlePasteItem"
52
54
  @componentMove="handleTreeDrag"
53
55
  @deleteComponent="deleteComponentInTree"
@@ -610,7 +612,8 @@ export default {
610
612
  addComponentTemp: { type: 'page' },
611
613
  // 控制添加页面容器弹框显隐
612
614
  showPageContainerAddModal: false,
613
- showLifeCycleFunctionEditor: false
615
+ showLifeCycleFunctionEditor: false,
616
+ selectTreeNode: undefined
614
617
  }
615
618
  },
616
619
  provide () {
@@ -620,6 +623,54 @@ export default {
620
623
  }
621
624
  },
622
625
  methods: {
626
+ handleSplit (id, isVertical) {
627
+ const target = lowcodeUtils.getComponentConfig(id, this.config)
628
+ const row = lowcodeUtils.getRowConfigByComponentId(id, this.config)
629
+ let index
630
+ for (let i = 0; i < row.length; i++) {
631
+ if (row[i].id === id) {
632
+ index = i
633
+ break
634
+ }
635
+ }
636
+ const cache = JSON.parse(JSON.stringify(target))
637
+ if (isVertical) {
638
+ const temp = {
639
+ type: 'container_page',
640
+ span: cache.span,
641
+ id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6),
642
+ page: [
643
+ {
644
+ id: 'container_page_' + lowcodeUtils.nanoidWithoutSymbol(2),
645
+ type: 'page',
646
+ body: [
647
+ []
648
+ ]
649
+ }
650
+ ]
651
+ }
652
+ cache.span = 24
653
+ temp.page[0].body[0].push(cache)
654
+ temp.page[0].body[1] = []
655
+ temp.page[0].body[1].push({
656
+ type: 'container',
657
+ span: 24,
658
+ id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
659
+ })
660
+ row.splice(index, 1, temp)
661
+ } else {
662
+ const outerSpan = cache.span
663
+ const firstSpan = Math.round(outerSpan / 2)
664
+ const secondSpan = outerSpan - firstSpan
665
+ cache.span = firstSpan
666
+ row.splice(index, 1, cache, {
667
+ type: 'container',
668
+ span: secondSpan,
669
+ id: 'container_' + lowcodeUtils.nanoidWithoutSymbol(6)
670
+ })
671
+ }
672
+ this.refreshOrganization()
673
+ },
623
674
  refreshRender () {
624
675
  this.renderPreview = false
625
676
  this.renderModalPreview = false
@@ -1262,6 +1313,8 @@ export default {
1262
1313
  },
1263
1314
  // 选中某个组件
1264
1315
  clickComponentInEditor (configItem) {
1316
+ // 同步选中架构
1317
+ this.selectTreeNode = configItem.id
1265
1318
  this.editorPropertiesConfig = {}
1266
1319
  // 如果选中的是容器
1267
1320
  if (configItem.type === 'container') {
@@ -1330,148 +1383,148 @@ export default {
1330
1383
  this.supportedEventType = [...lowcodeComponentMixin.supportedEventType]
1331
1384
  // 深拷贝外侧传来的配置
1332
1385
  this.config = JSON.parse(JSON.stringify(this.originalConfig))
1333
- // this.config = {
1334
- // page: [
1335
- // {
1336
- // id: 'page_KBjw2i',
1337
- // type: 'page',
1338
- // title: '111',
1339
- // body: [
1340
- // [
1341
- // {
1342
- // type: 'XFormTable',
1343
- // span: 12,
1344
- // id: 'XFormTable_BV6Nwk',
1345
- // selected: false,
1346
- // props: {
1347
- // queryParamsName: '',
1348
- // serviceName: ''
1349
- // },
1350
- // selfEvent: [
1351
- // 'action'
1352
- // ]
1353
- // },
1354
- // {
1355
- // type: 'XAddNativeForm',
1356
- // span: 12,
1357
- // id: 'XAddNativeForm_ekihTp',
1358
- // selected: false,
1359
- // props: {
1360
- // configNameForLowCode: '',
1361
- // systemNameForLowCode: ''
1362
- // },
1363
- // selfEvent: [
1364
- // 'onSubmit'
1365
- // ]
1366
- // }
1367
- // ],
1368
- // [
1369
- // {
1370
- // type: 'XTreeOne',
1371
- // span: 12,
1372
- // id: 'XTreeOne_szu7Al',
1373
- // selected: false
1374
- // },
1375
- // {
1376
- // type: 'XDescriptions',
1377
- // span: 12,
1378
- // id: 'XDescriptions_DTkbEg',
1379
- // selected: false,
1380
- // props: {
1381
- // title: '111',
1382
- // content: {
1383
- // c_f_user_phone: '2323',
1384
- // c_f_total_fee: 33356,
1385
- // c_f_address: '22',
1386
- // c_f_meterlen: 2,
1387
- // c_f_bank_card_number: '23',
1388
- // c_f_create_user: '超级管理员',
1389
- // c_f_customer: '23',
1390
- // c_f_balance: 33356,
1391
- // c_f_create_date: '2024-06-23 21:31:24',
1392
- // c_f_operator_date: '2024-06-23 21:31:24',
1393
- // c_f_total_times: 2,
1394
- // c_f_user_name: '23',
1395
- // c_f_comments: '323',
1396
- // c_id: 39,
1397
- // c_f_operatorid: '15',
1398
- // c_f_operator: '超级管理员',
1399
- // c_f_orgid: '9'
1400
- // },
1401
- // configName: 'Unit_Desc_Config',
1402
- // serviceName: 'af-revenue',
1403
- // getRealData: true
1404
- // },
1405
- // selfEvent: []
1406
- // }
1407
- // ]
1408
- // ]
1409
- // },
1410
- // {
1411
- // id: 'page_FgItf6',
1412
- // type: 'page',
1413
- // title: '22',
1414
- // body: [
1415
- // [
1416
- // {
1417
- // type: 'container',
1418
- // span: 4,
1419
- // id: 'container_ir2gR2',
1420
- // selected: false
1421
- // },
1422
- // {
1423
- // type: 'container_page',
1424
- // span: 10,
1425
- // id: 'container_xIRHGg',
1426
- // selected: true,
1427
- // page: [
1428
- // {
1429
- // id: 'container_page_IgYw9u',
1430
- // type: 'page',
1431
- // body: [
1432
- // [
1433
- // {
1434
- // type: 'container',
1435
- // span: 24,
1436
- // id: 'container_tqVFCL'
1437
- // }
1438
- // ],
1439
- // [
1440
- // {
1441
- // type: 'container',
1442
- // span: 24,
1443
- // id: 'container_i8VXCZ'
1444
- // }
1445
- // ]
1446
- // ]
1447
- // }
1448
- // ]
1449
- // },
1450
- // {
1451
- // type: 'container',
1452
- // span: 10,
1453
- // id: 'container_PT9n3Q',
1454
- // selected: false
1455
- // }
1456
- // ],
1457
- // [
1458
- // {
1459
- // type: 'container',
1460
- // span: 18,
1461
- // id: 'container_q04vQr',
1462
- // selected: false
1463
- // },
1464
- // {
1465
- // type: 'container',
1466
- // span: 6,
1467
- // id: 'container_MKwNvz',
1468
- // selected: false
1469
- // }
1470
- // ]
1471
- // ]
1472
- // }
1473
- // ]
1474
- // }
1386
+ this.config = {
1387
+ page: [
1388
+ {
1389
+ id: 'page_KBjw2i',
1390
+ type: 'page',
1391
+ title: '111',
1392
+ body: [
1393
+ [
1394
+ {
1395
+ type: 'XFormTable',
1396
+ span: 12,
1397
+ id: 'XFormTable_BV6Nwk',
1398
+ selected: false,
1399
+ props: {
1400
+ queryParamsName: '',
1401
+ serviceName: ''
1402
+ },
1403
+ selfEvent: [
1404
+ 'action'
1405
+ ]
1406
+ },
1407
+ {
1408
+ type: 'XAddNativeForm',
1409
+ span: 12,
1410
+ id: 'XAddNativeForm_ekihTp',
1411
+ selected: false,
1412
+ props: {
1413
+ configNameForLowCode: '',
1414
+ systemNameForLowCode: ''
1415
+ },
1416
+ selfEvent: [
1417
+ 'onSubmit'
1418
+ ]
1419
+ }
1420
+ ],
1421
+ [
1422
+ {
1423
+ type: 'XTreeOne',
1424
+ span: 12,
1425
+ id: 'XTreeOne_szu7Al',
1426
+ selected: false
1427
+ },
1428
+ {
1429
+ type: 'XDescriptions',
1430
+ span: 12,
1431
+ id: 'XDescriptions_DTkbEg',
1432
+ selected: false,
1433
+ props: {
1434
+ title: '111',
1435
+ content: {
1436
+ c_f_user_phone: '2323',
1437
+ c_f_total_fee: 33356,
1438
+ c_f_address: '22',
1439
+ c_f_meterlen: 2,
1440
+ c_f_bank_card_number: '23',
1441
+ c_f_create_user: '超级管理员',
1442
+ c_f_customer: '23',
1443
+ c_f_balance: 33356,
1444
+ c_f_create_date: '2024-06-23 21:31:24',
1445
+ c_f_operator_date: '2024-06-23 21:31:24',
1446
+ c_f_total_times: 2,
1447
+ c_f_user_name: '23',
1448
+ c_f_comments: '323',
1449
+ c_id: 39,
1450
+ c_f_operatorid: '15',
1451
+ c_f_operator: '超级管理员',
1452
+ c_f_orgid: '9'
1453
+ },
1454
+ configName: 'Unit_Desc_Config',
1455
+ serviceName: 'af-revenue',
1456
+ getRealData: true
1457
+ },
1458
+ selfEvent: []
1459
+ }
1460
+ ]
1461
+ ]
1462
+ },
1463
+ {
1464
+ id: 'page_FgItf6',
1465
+ type: 'page',
1466
+ title: '22',
1467
+ body: [
1468
+ [
1469
+ {
1470
+ type: 'container',
1471
+ span: 4,
1472
+ id: 'container_ir2gR2',
1473
+ selected: false
1474
+ },
1475
+ {
1476
+ type: 'container_page',
1477
+ span: 10,
1478
+ id: 'container_xIRHGg',
1479
+ selected: true,
1480
+ page: [
1481
+ {
1482
+ id: 'container_page_IgYw9u',
1483
+ type: 'page',
1484
+ body: [
1485
+ [
1486
+ {
1487
+ type: 'container',
1488
+ span: 24,
1489
+ id: 'container_tqVFCL'
1490
+ }
1491
+ ],
1492
+ [
1493
+ {
1494
+ type: 'container',
1495
+ span: 24,
1496
+ id: 'container_i8VXCZ'
1497
+ }
1498
+ ]
1499
+ ]
1500
+ }
1501
+ ]
1502
+ },
1503
+ {
1504
+ type: 'container',
1505
+ span: 10,
1506
+ id: 'container_PT9n3Q',
1507
+ selected: false
1508
+ }
1509
+ ],
1510
+ [
1511
+ {
1512
+ type: 'container',
1513
+ span: 18,
1514
+ id: 'container_q04vQr',
1515
+ selected: false
1516
+ },
1517
+ {
1518
+ type: 'container',
1519
+ span: 6,
1520
+ id: 'container_MKwNvz',
1521
+ selected: false
1522
+ }
1523
+ ]
1524
+ ]
1525
+ }
1526
+ ]
1527
+ }
1475
1528
  this.refreshOrganization()
1476
1529
  }
1477
1530
  }