Commit 97f216ac authored by zhouzihao's avatar zhouzihao

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

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