vue2-client 1.8.228 → 1.8.229

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.228",
3
+ "version": "1.8.229",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -376,7 +376,8 @@ export default {
376
376
  false,
377
377
  true
378
378
  )
379
- runLogic(eachEvent.logicName, param, eachEvent.serviceName).then(logicCallBackFunction(this.componentsMap))
379
+ runLogic(eachEvent.logicName, param, eachEvent.serviceName)
380
+ .then(res => { logicCallBackFunction(this.componentsMap, res) })
380
381
  } else if (eachEvent.eventType === 'changeProps') {
381
382
  const targetConfig = lowcodeUtils.getComponentConfig(eachEvent.target, this.pageConfig.page)
382
383
  targetConfig.props[eachEvent.targetKey] = data
@@ -1,34 +1,36 @@
1
1
  <template>
2
2
  <div :class="groups.length ? 'XFormGroupClass' : ''">
3
- <a-empty v-if="groups.length === 0" description="配置走丢了"/>
4
- <a-row :gutter="24" v-else style="height:100%">
5
- <a-col :span="3" v-if="showLeftTab && groups.length">
6
- <a-tabs tab-position="left" @change="scrollToGroup">
7
- <template v-for="(item,index) in groups">
8
- <a-tab-pane
9
- :tab="item.describe"
10
- :key="index"
11
- v-if="item.describe">
12
- </a-tab-pane>
13
- </template>
14
- </a-tabs>
15
- </a-col>
16
- <a-col :span="showLeftTab ? 21 : 24" class="formGroupContext">
17
- <div class="group-item" :ref="`group-${index}`" :key="index" v-for="(item, index) in groups">
18
- <a-row :style="{marginTop: index === 0 ? '':'8px'}">
19
- <a-col :span="5">
20
- <span class="xFormGroupTitle">{{ item.describe }}</span>
21
- </a-col>
22
- </a-row>
23
- <template v-if="item.formGroupType === 'slot'">
24
- <slot :name="item.slotName" :data="allFormData" :index="index">
25
- <a-empty :description="`[${item.describe}:${item.slotName}]插槽没有使用`"/>
26
- </slot>
27
- </template>
28
- <x-add-native-form @x-form-item-emit-func="emitFunc" v-else :ref="`nativeForm-${index}`"/>
29
- </div>
30
- </a-col>
31
- </a-row>
3
+ <a-empty v-if="loadingErr" description="配置走丢了"/>
4
+ <a-spin v-else tip="正在努力加载。。。" :spinning="spinning" wrapperClassName="heigth100">
5
+ <a-row :gutter="24" style="height:100%">
6
+ <a-col :span="3" v-if="showLeftTab && groups.length">
7
+ <a-tabs tab-position="left" @change="scrollToGroup">
8
+ <template v-for="(item,index) in groups">
9
+ <a-tab-pane
10
+ :tab="item.describe"
11
+ :key="index"
12
+ v-if="item.describe">
13
+ </a-tab-pane>
14
+ </template>
15
+ </a-tabs>
16
+ </a-col>
17
+ <a-col :span="showLeftTab ? 21 : 24" class="formGroupContext">
18
+ <div class="group-item" :ref="`group-${index}`" :key="index" v-for="(item, index) in groups">
19
+ <a-row :style="{marginTop: index === 0 ? '':'8px'}">
20
+ <a-col :span="5">
21
+ <span class="xFormGroupTitle">{{ item.describe }}</span>
22
+ </a-col>
23
+ </a-row>
24
+ <template v-if="item.formGroupType === 'slot'">
25
+ <slot :name="item.slotName" :data="allFormData" :index="index">
26
+ <a-empty :description="`[${item.describe}:${item.slotName}]插槽没有使用`"/>
27
+ </slot>
28
+ </template>
29
+ <x-add-native-form @x-form-item-emit-func="emitFunc" v-else :ref="`nativeForm-${index}`"/>
30
+ </div>
31
+ </a-col>
32
+ </a-row>
33
+ </a-spin>
32
34
  </div>
33
35
  </template>
34
36
 
@@ -53,11 +55,13 @@ export default {
53
55
  showSubmitBtn: false,
54
56
  loading: false,
55
57
  allFormData: {},
58
+ businessType: {},
56
59
  env: 'prod',
60
+ spinning: true,
61
+ loadingErr: false
57
62
  }
58
63
  },
59
64
  mounted () {
60
- this.initView()
61
65
  },
62
66
  props: {},
63
67
  watch: {},
@@ -75,22 +79,32 @@ export default {
75
79
  * @param serviceName 服务名
76
80
  * @param env 环境
77
81
  * @param showLeftTab 是否展示左侧索引页
82
+ * @param businessType 新增还是修改
78
83
  */
79
84
  init ({
80
85
  groups,
81
86
  modifyModelData = {},
82
87
  serviceName = process.env.VUE_APP_SYSTEM_NAME,
83
88
  env = 'prod',
84
- showLeftTab = false
89
+ showLeftTab = false,
90
+ businessType = '新增'
85
91
  }) {
86
- Object.assign(this, { groups, modifyModelData, serviceName, env, showLeftTab })
92
+ Object.assign(this, { groups, modifyModelData, serviceName, env, showLeftTab, businessType })
87
93
  this.initView()
88
94
  },
89
95
  // 初始化组件
90
96
  initView () {
97
+ this.spinning = true
98
+ const promises = []
91
99
  for (let i = 0; i < this.groups.length; i++) {
92
- this.initData(i)
100
+ promises.push(this.initData(i))
93
101
  }
102
+ Promise.all(promises).then(() => {
103
+ this.spinning = false
104
+ }).catch(() => {
105
+ this.loadingErr = true
106
+ this.spinning = false
107
+ })
94
108
  },
95
109
  getNativeFormRef (group) {
96
110
  return this.groups.map((item, index) => {
@@ -123,7 +137,8 @@ export default {
123
137
  showSubmitBtn: false,
124
138
  serviceName: this.serviceName,
125
139
  modifyModelData: modifyModelData,
126
- businessType: '新增',
140
+ fixedAddForm: modifyModelData.data,
141
+ businessType: this.businessType,
127
142
  ...res
128
143
  }
129
144
  params.showSubmitBtn = false
@@ -184,6 +199,14 @@ export default {
184
199
  .XFormGroupClass {
185
200
  height: 100%;
186
201
 
202
+ .heigth100 {
203
+ height: 100%;
204
+
205
+ :deep(.ant-spin-container) {
206
+ height: 100%;
207
+ }
208
+ }
209
+
187
210
  .xFormGroupTitle {
188
211
  font-size: 15px;
189
212
  font-weight: bold;
@@ -394,10 +394,11 @@
394
394
  @ok="() => { showLogicCallBackEditor = false}"
395
395
  @cancel="() => { showLogicCallBackEditor = false}"
396
396
  :visible="showLogicCallBackEditor">
397
- <a-popover title="参数说明" style="margin-right: 5%">
397
+ <a-popover title="参数说明" style="margin-bottom: 5%">
398
398
  <template slot="content">
399
399
  <p>该方法有以下几个参数:</p>
400
400
  <p>componentsMap:所有组件注册的Map</p>
401
+ <p>responseData:后端的返回值</p>
401
402
  </template>
402
403
  <a-button type="primary">
403
404
  参数说明
@@ -427,7 +428,7 @@ import LowCodePageOrganization from '@vue2-client/base-client/components/common/
427
428
  // 函数编辑器显示的模板
428
429
  const JSEventFunctionTemplate = 'function(eventType, data, targetKey, sourceVM, targetVM) {\n \n return {\n "eventType": eventType,\n "data": data,\n "targetKey": targetKey\n }\n}'
429
430
  const LogicParamFunctionTemplate = 'function(componentData, data) {\n \n return {\n \n }\n}'
430
- const LogicCallBackFunctionTemplate = 'function(componentsMap) {\n \n}'
431
+ const LogicCallBackFunctionTemplate = 'function(componentsMap, responseData) {\n \n}'
431
432
 
432
433
  export default {
433
434
  components: {
@@ -877,6 +878,7 @@ export default {
877
878
  // 事件编辑器中,事件类型改变
878
879
  handleEventEditorEventTypeChange (type) {
879
880
  this.eventEditorContent.eventType = type
881
+ this.logicParamTransferDataSource = []
880
882
  // 如果事件为运行Logic将组件加入穿梭框
881
883
  if (type === 'runLogic') {
882
884
  this.config.page.forEach(page => {
@@ -1136,6 +1138,124 @@ export default {
1136
1138
  this.supportedEventType = [...lowcodeComponentMixin.supportedEventType]
1137
1139
  // 深拷贝外侧传来的配置
1138
1140
  this.config = JSON.parse(JSON.stringify(this.originalConfig))
1141
+ // this.config = {
1142
+ // page: [
1143
+ // {
1144
+ // id: 'KB',
1145
+ // type: 'page',
1146
+ // title: '111',
1147
+ // body: [
1148
+ // [
1149
+ // {
1150
+ // type: 'XFormTable',
1151
+ // span: 12,
1152
+ // id: 'XFormTable_BV6Nwk',
1153
+ // selected: false,
1154
+ // props: {
1155
+ // queryParamsName: '',
1156
+ // serviceName: ''
1157
+ // },
1158
+ // selfEvent: [
1159
+ // 'action'
1160
+ // ]
1161
+ // },
1162
+ // {
1163
+ // type: 'XAddNativeForm',
1164
+ // span: 12,
1165
+ // id: 'XAddNativeForm_ekihTp',
1166
+ // selected: false,
1167
+ // props: {
1168
+ // configNameForLowCode: '',
1169
+ // systemNameForLowCode: ''
1170
+ // },
1171
+ // selfEvent: [
1172
+ // 'onSubmit'
1173
+ // ]
1174
+ // }
1175
+ // ],
1176
+ // [
1177
+ // {
1178
+ // type: 'XTreeOne',
1179
+ // span: 12,
1180
+ // id: 'XTreeOne_szu7Al',
1181
+ // selected: false
1182
+ // },
1183
+ // {
1184
+ // type: 'XDescriptions',
1185
+ // span: 12,
1186
+ // id: 'XDescriptions_DTkbEg',
1187
+ // selected: false,
1188
+ // props: {
1189
+ // title: '111',
1190
+ // content: {
1191
+ // c_f_user_phone: '2323',
1192
+ // c_f_total_fee: 33356,
1193
+ // c_f_address: '22',
1194
+ // c_f_meterlen: 2,
1195
+ // c_f_bank_card_number: '23',
1196
+ // c_f_create_user: '超级管理员',
1197
+ // c_f_customer: '23',
1198
+ // c_f_balance: 33356,
1199
+ // c_f_create_date: '2024-06-23 21:31:24',
1200
+ // c_f_operator_date: '2024-06-23 21:31:24',
1201
+ // c_f_total_times: 2,
1202
+ // c_f_user_name: '23',
1203
+ // c_f_comments: '323',
1204
+ // c_id: 39,
1205
+ // c_f_operatorid: '15',
1206
+ // c_f_operator: '超级管理员',
1207
+ // c_f_orgid: '9'
1208
+ // },
1209
+ // configName: 'Unit_Desc_Config',
1210
+ // serviceName: 'af-revenue',
1211
+ // getRealData: true
1212
+ // },
1213
+ // selfEvent: []
1214
+ // }
1215
+ // ]
1216
+ // ]
1217
+ // },
1218
+ // {
1219
+ // id: 'Fg',
1220
+ // type: 'page',
1221
+ // title: '22',
1222
+ // body: [
1223
+ // [
1224
+ // {
1225
+ // type: 'container',
1226
+ // span: 4,
1227
+ // id: 'container_ir2gR2',
1228
+ // selected: false
1229
+ // },
1230
+ // {
1231
+ // type: 'container',
1232
+ // span: 10,
1233
+ // id: 'container_xIRHGg'
1234
+ // },
1235
+ // {
1236
+ // type: 'container',
1237
+ // span: 10,
1238
+ // id: 'container_PT9n3Q'
1239
+ // }
1240
+ // ],
1241
+ // [
1242
+ // {
1243
+ // type: 'container',
1244
+ // span: 18,
1245
+ // id: 'container_q04vQr',
1246
+ // selected: false
1247
+ // },
1248
+ // {
1249
+ // type: 'container',
1250
+ // span: 6,
1251
+ // id: 'container_MKwNvz',
1252
+ // selected: false
1253
+ // }
1254
+ // ]
1255
+ // ]
1256
+ // }
1257
+ // ]
1258
+ // }
1139
1259
  this.refreshOrganization()
1140
1260
  }
1141
1261
  }