Commit 97f216ac authored by zhouzihao's avatar zhouzihao

dev-添加配置页面的json支持

parent 81cb29c0
......@@ -54,8 +54,9 @@
<Input v-model="showData.path"></Input>
</FormItem>
<FormItem label="配置内容">
<Input v-model="showData.content" type="textarea" :rows="20"></Input>
<Input v-if="showData.type==2" v-model="showData.content" type="textarea" :rows="20"></Input>
</FormItem>
<vue-json-editor v-if="showData.type==1" v-model="json" exapndedOnStart="true" @json-change="onJsonChange"></vue-json-editor>
</Form>
</div>
<div class="demo-drawer-footer">
......@@ -70,9 +71,12 @@ import MasterPage from "@/components/Master";
import axios from "axios";
import config from "@/config/configs";
import _ from "lodash";
import vueJsonEditor from "vue-json-editor";
export default {
components: {
MasterPage
MasterPage,
vueJsonEditor
},
data() {
return {
......@@ -156,7 +160,8 @@ export default {
env_name: "",
p_id: 1,
envlist: [],
project_name: ""
project_name: "",
json:null,
};
},
methods: {
......@@ -205,6 +210,13 @@ export default {
this.env_name = (_.find(this.envlist, { env_id: this.env_id })).name;
this.isShow = true;
this.showData = this.data1[index];
if (this.showData.type == 1){
this.json = JSON.parse(this.showData.content);
}
},
onJsonChange: function(value) {
this.showData.content = JSON.stringify(value);
console.log(value);
},
build: function() {
//
......
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