|
@@ -133,9 +133,9 @@ export default {
|
|
|
//老数据
|
|
|
this.formData = JSON.parse(this.formData.primaryTable.data)
|
|
|
this.fillFormData(this.oldformConf, oldData)
|
|
|
- this.fillFormData(this.formConf, this.formData)
|
|
|
+ this.fillFormData(this.formConf, this.formData,{},)
|
|
|
} else {
|
|
|
- this.fillFormData(this.formConf, this.formData)
|
|
|
+ this.fillFormData(this.formConf, this.formData,{},)
|
|
|
}
|
|
|
this.$nextTick(() => {
|
|
|
this.loading = false
|
|
@@ -155,8 +155,8 @@ export default {
|
|
|
this.key = +new Date()
|
|
|
})
|
|
|
},
|
|
|
- fillFormData(form, data, columnDict) {
|
|
|
- if (this.opType != '-1') form.disabled = true // this.setting.readonly
|
|
|
+ fillFormData(form, data, columnDict,editFlg) {
|
|
|
+ // this.setting.readonly
|
|
|
const loop = (list) => {
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
let item = list[i]
|
|
@@ -191,23 +191,31 @@ export default {
|
|
|
if (item.__config__ && item.__config__.jnpfKey === 'uploadFz') {
|
|
|
item.__config__.defaultValue = item.__config__.defaultValue.length ? item.__config__.defaultValue.split(';') : []
|
|
|
}
|
|
|
- let noShow = false,
|
|
|
- isDisabled = true
|
|
|
- if (this.setting.formOperates && this.setting.formOperates.length) {
|
|
|
- let arr = this.setting.formOperates.filter((o) => o.id === item.__vModel__) || []
|
|
|
- if (arr.length) {
|
|
|
- let obj = arr[0]
|
|
|
- noShow = !obj.read
|
|
|
- isDisabled = !obj.write
|
|
|
+ if (editFlg && editFlg === 1){
|
|
|
+ let noShow = false,
|
|
|
+ isDisabled = true,
|
|
|
+ isRequired = true
|
|
|
+ if (this.setting.formOperates && this.setting.formOperates.length) {
|
|
|
+ let arr = this.setting.formOperates.filter((o) => o.id == item.__vModel__) || []
|
|
|
+ if (arr.length) {
|
|
|
+ let obj = arr[0]
|
|
|
+ noShow = !obj.read
|
|
|
+ isDisabled = !obj.write
|
|
|
+ isRequired = obj.required
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ isDisabled = false
|
|
|
}
|
|
|
- } else {
|
|
|
- isDisabled = false
|
|
|
+ isDisabled = item.disabled ? item.disabled : isDisabled
|
|
|
+ noShow = item.__config__.displayNone ? item.__config__.displayNone : noShow
|
|
|
+ isRequired = item.__config__.required ? item.__config__.required : isRequired
|
|
|
+ if (this.setting.readonly) isDisabled = true
|
|
|
+ this.$set(item, 'disabled', isDisabled)
|
|
|
+ this.$set(item, 'displayNone', noShow)
|
|
|
+ this.$set(item.__config__, 'required', isRequired)
|
|
|
+ }else {
|
|
|
+ if (this.opType != '-1') form.disabled = true
|
|
|
}
|
|
|
- isDisabled = item.disabled ? item.disabled : isDisabled
|
|
|
- noShow = item.__config__.noShow ? item.__config__.noShow : noShow
|
|
|
- if (this.setting.readonly) isDisabled = true
|
|
|
- this.$set(item, 'disabled', isDisabled)
|
|
|
- this.$set(item.__config__, 'noShow', noShow)
|
|
|
}
|
|
|
}
|
|
|
if (item.__config__ && item.__config__.jnpfKey !== 'table' && item.__config__.children && Array.isArray(item.__config__.children)) {
|
|
@@ -265,7 +273,7 @@ export default {
|
|
|
dataFormSubmit(eventType) {
|
|
|
if (this.setting.isPreview) return this.$message({ message: '功能预览不支持数据保存', type: 'warning' })
|
|
|
this.eventType = eventType
|
|
|
- this.$refs.dynamicForm && this.$refs.dynamicForm.submitForm('flow')
|
|
|
+ this.$refs.dynamicForm && this.$refs.dynamicForm.submitForm()
|
|
|
}
|
|
|
}
|
|
|
}
|