Commit 8d65d5bb by yuwei

项目初始化

parent 60e1527c
...@@ -20,7 +20,7 @@ public class ModelDataController extends BaseController { ...@@ -20,7 +20,7 @@ public class ModelDataController extends BaseController {
private ModelDataService modelDataService; private ModelDataService modelDataService;
@GetMapping("/{id}") @GetMapping("/{id}")
public R getModelDataById(@PathVariable String id, @RequestBody ModelDataEntity modelDataEntity) { public R getModelDataById(@PathVariable String id, ModelDataEntity modelDataEntity) {
Map<String, Object> data = modelDataService.getModelDataById(modelDataEntity); Map<String, Object> data = modelDataService.getModelDataById(modelDataEntity);
return R.ok().setData(data); return R.ok().setData(data);
} }
......
...@@ -113,24 +113,21 @@ export default { ...@@ -113,24 +113,21 @@ export default {
}, },
created() { created() {
console.log('data:' + this.data) console.log('data:' + this.data)
getFormParam(this.data.modelId).then(response => { this.getFormData()
if (response.success) {
const { data } = response
this.tableName = data.tableName
this.columnList = data.columnList.filter(item => item.isDetail === '1')
}
})
},
mounted() {
this.getData(this.data.id)
}, },
methods: { methods: {
showCard() { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ async getFormData() {
getData: function(id) { const data = await getFormParam(this.data.modelId).then(response => {
getData({ id: id, tableName: this.tableName }).then(response => { if (response.success) {
return response.data
}
})
this.tableName = data.tableName
this.columnList = data.columnList.filter(item => item.isDetail === '1')
await getData({ id: this.data.id, tableName: this.tableName }).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
} }
......
...@@ -120,24 +120,21 @@ export default { ...@@ -120,24 +120,21 @@ export default {
}, },
created() { created() {
console.log('data:' + this.data) console.log('data:' + this.data)
getFormParam(this.data.modelId).then(response => { this.getFormData()
if (response.success) {
const { data } = response
this.tableName = data.tableName
this.columnList = data.columnList.filter(item => item.isEdit === '1')
}
})
},
mounted() {
this.getData(this.data.id)
}, },
methods: { methods: {
showCard() { showCard() {
this.$emit('showCard', this.showOptions) this.$emit('showCard', this.showOptions)
}, },
/** 获取详情 */ async getFormData() {
getData: function(id) { const data = await getFormParam(this.data.modelId).then(response => {
getData({ id: id, tableName: this.tableName }).then(response => { if (response.success) {
return response.data
}
})
this.tableName = data.tableName
this.columnList = data.columnList.filter(item => item.isDetail === '1')
await getData({ id: this.data.id, tableName: this.tableName }).then(response => {
if (response.success) { if (response.success) {
this.form = response.data this.form = response.data
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment