vue2-client 1.8.76 → 1.8.78

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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.8.78 -2024-3-6 @江超**
5
+ - 修复json列在`XAddNativeForm`中的错误行为
6
+
7
+ **1.8.77 -2024-3-6 @张振宇**
8
+ - 兼容upload 在oa里使用得效果
9
+
4
10
  **1.8.76 -2024-3-6 @江超**
5
11
  - `XaddNativeForm`静默新增字段增加`operatorId`,即操作人id
6
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.76",
3
+ "version": "1.8.78",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -118,10 +118,12 @@ export default {
118
118
 
119
119
  upload(formData, this.serviceName, { headers, timeout: 600 * 1000 }).then(res => {
120
120
  // 根据服务端返回的结果判断成功与否,设置文件条目的状态
121
- if (res.success) {
121
+ if (res.success || res.id) {
122
122
  fileInfo.status = 'done'
123
123
  let dataObj
124
- if (typeof res.data === 'string') {
124
+ if (res.id) {
125
+ dataObj = res
126
+ } else if (typeof res.data === 'string') {
125
127
  dataObj = JSON.parse(res.data)
126
128
  } else {
127
129
  dataObj = res.data
@@ -188,10 +188,12 @@ export default {
188
188
  // 设置表单分组项目相关参数
189
189
  for (let i = 0; i < this.groupJsonData.length; i++) {
190
190
  const groupItem = this.groupJsonData[i]
191
- formData[groupItem.model] = {}
192
- for (let j = 0; j < groupItem.groupItems.length; j++) {
193
- const item = groupItem.groupItems[j]
194
- this.setFormProps(formData[groupItem.model], item)
191
+ if (groupItem.groupItems.length > 0) {
192
+ formData[groupItem.model] = {}
193
+ for (let j = 0; j < groupItem.groupItems.length; j++) {
194
+ const item = groupItem.groupItems[j]
195
+ this.setFormProps(formData[groupItem.model], item)
196
+ }
195
197
  }
196
198
  }
197
199
  // 设置动态简易表单项的相关参数
@@ -445,7 +447,7 @@ export default {
445
447
  for (let i = 0; i < this.groupJsonData.length; i++) {
446
448
  const item = this.groupJsonData[i]
447
449
  try {
448
- if (modifyModelData.data[item.model]) {
450
+ if (item.groupItems.length > 0 && modifyModelData.data[item.model]) {
449
451
  this.form[item.model] = JSON.parse(modifyModelData.data[item.model])
450
452
  }
451
453
  } catch (e) {
@@ -69,7 +69,7 @@ export default {
69
69
  const value = this.form[this.model]
70
70
  if (value) {
71
71
  // 如果数据源中值含'-',代表是由多个数据源组成的树,需要重新组织新增/编辑时的表单值
72
- if (this.option.length > 0 && this.option[0].value.indexOf('-') !== -1) {
72
+ if (this.option.length > 0 && this.option[0].value.toString().indexOf('-') !== -1) {
73
73
  this.value = model + '-' + value
74
74
  } else {
75
75
  this.value = value