agilebuilder-ui 1.1.2-tmp8 → 1.1.2-tmp9

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": "agilebuilder-ui",
3
- "version": "1.1.2-tmp8",
3
+ "version": "1.1.2-tmp9",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -179,6 +179,11 @@ export default {
179
179
  openTree: {
180
180
  type: Boolean,
181
181
  default: true
182
+ },
183
+ // 当前表单变量数据信息
184
+ pageModels: {
185
+ type: Object,
186
+ default: null
182
187
  }
183
188
  },
184
189
  data() {
@@ -214,8 +219,20 @@ export default {
214
219
  }
215
220
  },
216
221
  getPropName(prop, isJoinTable, tableName) {
222
+ if (prop && prop.startsWith('${')) {
223
+ // 格式是:${page.xxx} 或 ${data.xxx}
224
+ prop = prop.substring(prop.indexOf('.')+1, prop.length - 1)
225
+ }
217
226
  return getPropNameWhenJoinTable(prop, isJoinTable, tableName)
218
227
  },
228
+ getPropType(prop) {
229
+ let type = 'data'
230
+ if (prop && prop.startsWith('${')) {
231
+ // 格式是:${page.xxx} 或 ${data.xxx}
232
+ type = prop.substring(2, prop.indexOf('.'))
233
+ }
234
+ return type
235
+ },
219
236
  // 清空已选的结果
220
237
  emptyOrganizationResult() {
221
238
  const orgFields = this.fields
@@ -225,7 +242,8 @@ export default {
225
242
  // 人员时:id、name、loginName、email、telephone
226
243
  // 部门或工作组时:id、name
227
244
  const model = this.getPropName(orgField.model)
228
- this.setValue(model, null)
245
+ const propType = this.getPropType(orgField.model)
246
+ this.setValue(model, null, propType)
229
247
  })
230
248
  this.selectOrganizationAllInfo = {}
231
249
  this.selectOrganizationInfo = null
@@ -255,34 +273,43 @@ export default {
255
273
  const orgDataType = orgField.type
256
274
  const orgSelectData = this.getOrgSelectData(orgDataType, orgData, this.isUserTree(treeType), isMulti)
257
275
  const model = this.getPropName(orgField.model)
258
- this.getOrgDataModel(model, orgSelectData, isMulti, orgDataType, isRemove, removeItems)
276
+ const propType = this.getPropType(orgField.model)
277
+ this.getOrgDataModel(model, orgSelectData, isMulti, orgDataType, isRemove, removeItems, propType)
259
278
  })
260
279
  }
261
280
  },
262
281
  /**
263
282
  * @param orgDataType 字段属性:id、name、loginName、code、email、telephone
264
283
  */
265
- getOrgDataModel(model, orgSelectData, isMulti, orgDataType, isRemove, removeItems) {
284
+ getOrgDataModel(model, orgSelectData, isMulti, orgDataType, isRemove, removeItems, propType) {
266
285
  if (isMulti) {
267
286
  // 表示是替换或添加操作
268
- const orgResult = this.getModelValue(model)
287
+ const orgResult = this.getModelValue(model, propType)
269
288
  // 表示替换结果
270
289
  this.selectOrganizationAllInfo[orgDataType] = orgSelectData
271
- this.setValue(model, orgSelectData)
290
+ this.setValue(model, orgSelectData, propType)
272
291
  // 参数分别为:属性名、原来的值、新替换的值
273
292
  this.$emit('replace', model, orgResult, orgSelectData)
274
293
  } else {
275
- this.setValue(model, orgSelectData)
294
+ this.setValue(model, orgSelectData, propType)
276
295
  }
277
296
  },
278
- getModelValue(model) {
297
+ getModelValue(model, propType) {
298
+ let models = this.models
299
+ if(propType && propType === 'page') {
300
+ models = this.pageModels
301
+ }
279
302
  let modelValue = ''
280
303
  if (this.isJoinTable === false && model && model.indexOf('.') > 0) {
281
- const parentObj = this.getParentObject(model, this.models)
304
+ const parentObj = this.getParentObject(model, models)
282
305
  modelValue = parentObj[model.substring(model.lastIndexOf('.') + 1)]
283
306
  } else {
284
- model = this.getPropName(model)
285
- modelValue = this.models[model]
307
+ const name = this.getPropName(model)
308
+ if(propType && propType === 'page') {
309
+ modelValue = models?models[name]: null
310
+ } else {
311
+ modelValue = models[name]
312
+ }
286
313
  }
287
314
  return modelValue
288
315
  },
@@ -469,7 +496,8 @@ export default {
469
496
  const fieldSetting = fieldSettings[0]
470
497
  if (fieldSetting) {
471
498
  const model = this.getPropName(fieldSetting.model)
472
- const selectInfo = this.getModelValue(model)
499
+ const propType = this.getPropType(fieldSetting.model)
500
+ const selectInfo = this.getModelValue(model, propType)
473
501
  if (selectInfo && selectInfo !== null && selectInfo !== '') {
474
502
  this.selectOrganizationInfo = selectInfo
475
503
  this.searchField = prop
@@ -491,20 +519,28 @@ export default {
491
519
  }
492
520
  }
493
521
  },
494
- setValue(model, finallyOrgResult) {
495
- if (this.models) {
522
+ setValue(model, finallyOrgResult, propType) {
523
+ if(!propType) {
524
+ propType = this.getPropType(model)
525
+ }
526
+ let models = this.models
527
+ if(propType && propType === 'page') {
528
+ models = this.pageModels
529
+ }
530
+ this.setEntityValue(model, finallyOrgResult, models)
531
+ },
532
+ setEntityValue(model, finallyOrgResult, models) {
533
+ if (models) {
496
534
  if (this.isJoinTable === false && model && model.indexOf('.') > 0) {
497
- const parentObj = this.getParentObject(model, this.models)
535
+ const parentObj = this.getParentObject(model, models)
498
536
  if (parentObj) {
499
537
  setEntityFieldValue(parentObj, model.substring(model.lastIndexOf('.') + 1), finallyOrgResult)
500
- // Vue.set(parentObj, model.substring(model.lastIndexOf('.') + 1), finallyOrgResult)
501
538
  }
502
539
  } else {
503
- model = this.getPropName(model)
504
- setEntityFieldValue(this.models, model, finallyOrgResult)
505
- // Vue.set(this.models, model, finallyOrgResult)
540
+ const name = this.getPropName(model)
541
+ setEntityFieldValue(models, name, finallyOrgResult)
506
542
  }
507
- console.log('this.value', this.models)
543
+ console.log('this.value===models=', models)
508
544
  // 调用setValue事件
509
545
  this.$emit('setValue', model, finallyOrgResult)
510
546
  if (finallyOrgResult === undefined || finallyOrgResult === null || finallyOrgResult === '') {
@@ -425,8 +425,6 @@
425
425
  :disabled="disabled"
426
426
  :inactive-text="getSwitchConfig('inactiveText')"
427
427
  :inactive-value="getSwitchConfig('inactiveValue')"
428
- :active-color="getSwitchConfig('onColor')"
429
- :inactive-color="getSwitchConfig('offColor')"
430
428
  @change="cellEvent('change', $event)"
431
429
  @input="cellEvent('input', $event, true)"
432
430
  />
@@ -1884,11 +1882,12 @@ export default {
1884
1882
  } else {
1885
1883
  return 0
1886
1884
  }
1887
- } else if (switchProp === 'offColor') {
1888
- return '#ff4949'
1889
- } else if (switchProp === 'onColor') {
1890
- return '#13ce66'
1891
1885
  }
1886
+ // else if (switchProp === 'offColor') {
1887
+ // return '#ff4949'
1888
+ // } else if (switchProp === 'onColor') {
1889
+ // return '#13ce66'
1890
+ // }
1892
1891
  }
1893
1892
  },
1894
1893
  scanClick() {
@@ -160,3 +160,35 @@ body .el-table colgroup.gutter {
160
160
  margin-left: 10px;
161
161
  }
162
162
 
163
+ // v10图表样式
164
+ .amb-widget-chart {
165
+ --el-card-border-color: var(--el-border-color-light);
166
+ --el-card-border-radius: 4px;
167
+ --el-card-padding: 20px;
168
+ --el-card-bg-color: var(--el-fill-color-blank);
169
+ background-color: var(--el-card-bg-color);
170
+ border: 1px solid var(--el-card-border-color);
171
+ border-radius: var(--el-card-border-radius);
172
+ color: var(--el-text-color-primary);
173
+ overflow: hidden;
174
+ transition: var(--el-transition-duration);
175
+ box-shadow: var(--el-box-shadow-light);
176
+ margin-bottom: 18px;
177
+ }
178
+
179
+ .amb-widget-chart-header {
180
+ border-bottom: 1px solid var(--el-card-border-color);
181
+ padding: 6px 10px;
182
+ display: flex;
183
+ min-height: 36px;
184
+ }
185
+ .amb-widget-chart-header-item {
186
+ display: flex;
187
+ align-items: center;
188
+ }
189
+ .amb-widget-chart-header-center {
190
+ flex-grow: 1;
191
+ text-align: center;
192
+ vertical-align: middle;
193
+ justify-content: center;
194
+ }