three-trees-ui 1.1.4 → 1.1.5
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/LICENSE +21 -21
- package/lib/three-trees-ui.common.js +236 -230
- package/lib/three-trees-ui.css +1 -1
- package/lib/three-trees-ui.umd.js +236 -230
- package/lib/three-trees-ui.umd.min.js +1 -1
- package/package.json +1 -1
- package/packages/OnlineForm/src/Form.vue +70 -65
package/package.json
CHANGED
|
@@ -158,83 +158,88 @@
|
|
|
158
158
|
resolve(true)
|
|
159
159
|
return
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
resolve(true)
|
|
165
|
-
return
|
|
166
|
-
}
|
|
167
|
-
const subTableList = expandList.list.filter((it) => {
|
|
168
|
-
return (
|
|
169
|
-
(this.isMobile && it.ctrlType == 'subDiv') ||
|
|
170
|
-
(!this.isMobile && it.ctrlType === 'subtable')
|
|
171
|
-
)
|
|
172
|
-
})
|
|
173
|
-
if (!this.isMobile) {
|
|
174
|
-
// pc端找到 分页的子表 校验
|
|
175
|
-
const havePageSub = subTableList.filter((k) => {
|
|
176
|
-
return k.subtablePagination
|
|
177
|
-
})
|
|
178
|
-
if (!havePageSub.length) {
|
|
161
|
+
try {
|
|
162
|
+
const expandList = JSON.parse(this.formExpand)
|
|
163
|
+
if (!expandList.list) {
|
|
179
164
|
resolve(true)
|
|
180
165
|
return
|
|
181
166
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
if (
|
|
189
|
-
|
|
190
|
-
|
|
167
|
+
const subTableList = expandList.list.filter((it) => {
|
|
168
|
+
return (
|
|
169
|
+
(this.isMobile && it.ctrlType == 'subDiv') ||
|
|
170
|
+
(!this.isMobile && it.ctrlType === 'subtable')
|
|
171
|
+
)
|
|
172
|
+
})
|
|
173
|
+
if (!this.isMobile) {
|
|
174
|
+
// pc端找到 分页的子表 校验
|
|
175
|
+
const havePageSub = subTableList.filter((k) => {
|
|
176
|
+
return k.subtablePagination
|
|
191
177
|
})
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
178
|
+
if (!havePageSub.length) {
|
|
179
|
+
resolve(true)
|
|
180
|
+
return
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const mainAlias = Object.keys(this.data)[0]
|
|
184
|
+
const mainData = this.data[mainAlias]
|
|
185
|
+
const errorResult = []
|
|
186
|
+
|
|
187
|
+
Object.keys(mainData).forEach((key) => {
|
|
188
|
+
if (key.startsWith('sub_')) {
|
|
189
|
+
const curSubConfig = subTableList.find((sub) => {
|
|
190
|
+
return sub.name == key.replace('sub_', '')
|
|
191
|
+
})
|
|
192
|
+
const subAlias = key.replace('sub_', '')
|
|
193
|
+
const subPermission = this.permission.fields[subAlias]
|
|
194
|
+
mainData[key].forEach((item, index) => {
|
|
195
|
+
Object.keys(item).forEach((subKey) => {
|
|
196
|
+
if (subPermission[subKey] == 'b' && !item[subKey]) {
|
|
197
|
+
const subItem = curSubConfig.list.find((l) => {
|
|
198
|
+
return l.name === subKey
|
|
211
199
|
})
|
|
200
|
+
let haveIndex = errorResult.findIndex((it) => {
|
|
201
|
+
return (
|
|
202
|
+
it.tableName === curSubConfig.desc &&
|
|
203
|
+
it.fieldName === subItem.desc
|
|
204
|
+
)
|
|
205
|
+
})
|
|
206
|
+
if (haveIndex === -1) {
|
|
207
|
+
errorResult.push({
|
|
208
|
+
tableName: curSubConfig.desc,
|
|
209
|
+
index: index + 1,
|
|
210
|
+
fieldName: subItem.desc,
|
|
211
|
+
})
|
|
212
|
+
}
|
|
212
213
|
}
|
|
213
|
-
}
|
|
214
|
+
})
|
|
214
215
|
})
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
})
|
|
218
|
-
if (errorResult.length > 0) {
|
|
219
|
-
const messages = errorResult.map((k) => {
|
|
220
|
-
return `${k.tableName},【${k.fieldName}】必填`
|
|
216
|
+
}
|
|
221
217
|
})
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
message: messages.join('\n'),
|
|
226
|
-
background: '#f25130',
|
|
218
|
+
if (errorResult.length > 0) {
|
|
219
|
+
const messages = errorResult.map((k) => {
|
|
220
|
+
return `${k.tableName},【${k.fieldName}】必填`
|
|
227
221
|
})
|
|
222
|
+
// 判断是移动端还是pc
|
|
223
|
+
if (utils.isMobile()) {
|
|
224
|
+
this.$notify({
|
|
225
|
+
message: messages.join('\n'),
|
|
226
|
+
background: '#f25130',
|
|
227
|
+
})
|
|
228
|
+
} else {
|
|
229
|
+
Notification.error({
|
|
230
|
+
title: this.$t('ht.common.warmTips'),
|
|
231
|
+
dangerouslyUseHTMLString: true,
|
|
232
|
+
message: messages.join('<br/>'),
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
resolve(false)
|
|
228
236
|
} else {
|
|
229
|
-
|
|
230
|
-
title: this.$t('ht.common.warmTips'),
|
|
231
|
-
dangerouslyUseHTMLString: true,
|
|
232
|
-
message: messages.join('<br/>'),
|
|
233
|
-
})
|
|
237
|
+
resolve(true)
|
|
234
238
|
}
|
|
235
|
-
|
|
236
|
-
} else {
|
|
239
|
+
} catch (e) {
|
|
237
240
|
resolve(true)
|
|
241
|
+
console.error('formExpand 格式错误')
|
|
242
|
+
return
|
|
238
243
|
}
|
|
239
244
|
})
|
|
240
245
|
},
|