Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Revert "Optimization: 导入数据 功能优化"
Browse files Browse the repository at this point in the history
This reverts commit 63e8ddc.
  • Loading branch information
Wisenl committed Feb 6, 2020
1 parent 63e8ddc commit 573dd3c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/components/app-main/components/main-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
append-to-body>
<el-card shadow="hover" class="box-card">
<ele-form
v-if="innerDialogShow"
:form-desc="jsonFormDesc"
:formData="{}"
:request-fn="handleRequest"
Expand All @@ -73,9 +74,9 @@
<el-button @click="(innerDialogShow = false)">返回编辑</el-button>
</div>
</el-dialog>
<json-editor @input="jsonInput" :value="jsonData"></json-editor>
<json-editor @input="jsonInput" :value="jsonPenData"></json-editor>
<div style="text-align: center;margin-top: 20px">
<el-button @click="handleJson" :disabled="importDisabled" type="primary">导入数据</el-button>
<el-button @click="handleJson" type="primary">导入数据</el-button>
</div>
</el-dialog>

Expand Down Expand Up @@ -175,9 +176,6 @@ export default {
return Object.assign({}, this.filterFormAttr, {
formDesc: this.formDesc
})
},
importDisabled() {
return !this.jsonData || Object.keys(this.jsonData).length === 0
}
},
data() {
Expand All @@ -189,10 +187,9 @@ export default {
isPreview: false,
isShowCodePen: false,
innerDialogShow: false,
// jsonPenData: {},
jsonPenData: {},
jsonFormDesc: {},
jsonTempFormAttr: {},
jsonData: {}
jsonTempFormAttr: {}
}
},
methods: {
Expand Down Expand Up @@ -245,7 +242,6 @@ export default {
if (this.jsonData && this.jsonData.formDesc) {
let keys = Object.keys(formAttrDefault)
this.jsonTempFormAttr = Object.assign(formAttrDefault, _.pick(this.jsonData, keys)) // 临时预览的 formAttr
console.log(this.jsonTempFormAttr)
this.innerDialogShow = true
} else {
this.$message.error('数据必须有 "formDesc" 属性!')
Expand Down

0 comments on commit 573dd3c

Please sign in to comment.