|
@@ -77,6 +77,7 @@ export default {
|
|
|
dataCache: {
|
|
|
// 待更新列表
|
|
|
waitingRefreshValueList: [],
|
|
|
+ forceRefreshSchema: false, // 全量更新。恢复数据使用
|
|
|
},
|
|
|
schema: [
|
|
|
// {
|
|
@@ -227,7 +228,9 @@ export default {
|
|
|
this.changeLoading(true)
|
|
|
try {
|
|
|
await this.getUserPowerCheck(true)
|
|
|
- this.tryToRestoreForm()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.tryToRestoreForm()
|
|
|
+ }, 200)
|
|
|
} catch (error) {
|
|
|
console.log(error)
|
|
|
} finally {
|
|
@@ -237,7 +240,9 @@ export default {
|
|
|
tryToRestoreForm() {
|
|
|
const waitingRestoreForm = this.thisProductInfoListItem.productCardInfo?.waitingRestoreForm
|
|
|
if (waitingRestoreForm && Object.keys(waitingRestoreForm).length > 0) {
|
|
|
- this.refreshValue(waitingRestoreForm)
|
|
|
+ // 立即更新数据
|
|
|
+ this.emitInput(waitingRestoreForm)
|
|
|
+ this.dataCache.forceRefreshSchema = true
|
|
|
}
|
|
|
},
|
|
|
async getUserPowerCheck(ent = false) {
|
|
@@ -317,11 +322,16 @@ export default {
|
|
|
},
|
|
|
// 处理并分发各个产品卡片操作的限制
|
|
|
onValueChange: debounce(function(value) {
|
|
|
- // 修改某些字段时候才会更新schema
|
|
|
- const { needChange, changedFieldsArr } = this.needChangeSchema(value)
|
|
|
- this.onChangedFields(changedFieldsArr)
|
|
|
- if (!needChange) return
|
|
|
- this.dynamicChangeSchema(value)
|
|
|
+ if (this.dataCache.forceRefreshSchema) {
|
|
|
+ this.dynamicChangeSchema(value)
|
|
|
+ console.log('强制更新规则')
|
|
|
+ } else {
|
|
|
+ // 修改某些字段时候才会更新schema
|
|
|
+ const { needChange, changedFieldsArr } = this.needChangeSchema(value)
|
|
|
+ this.onChangedFields(changedFieldsArr)
|
|
|
+ if (!needChange) return
|
|
|
+ this.dynamicChangeSchema(value)
|
|
|
+ }
|
|
|
}, 100),
|
|
|
getPriceRequest: debounce(async function getPrice(p) {
|
|
|
if (this.readonly) return
|
|
@@ -728,6 +738,7 @@ export default {
|
|
|
console.log('未配置更新规则')
|
|
|
}
|
|
|
this.checkSchemaRule(value)
|
|
|
+ this.dataCache.forceRefreshSchema = false
|
|
|
})
|
|
|
},
|
|
|
commonGroupChangeSchema(value) {
|