Commit 81cb29c0 authored by zhouzihao's avatar zhouzihao

dev-添加Json编辑

parent faedebf7
......@@ -11596,6 +11596,14 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true
},
"vue-json-editor": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/vue-json-editor/-/vue-json-editor-1.4.0.tgz",
"integrity": "sha512-HejLwRk4TYpjehvEWVPpiwg+Wmh2E7XAtiT43PVKElTSaqdyytuyTNrzgJ1xRFhGCnYwyh1xyGsZulcpNF/wwg==",
"requires": {
"vue": "^2.2.6"
}
},
"vue-loader": {
"version": "15.4.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.4.2.tgz",
......
......@@ -14,6 +14,7 @@
"iview": "^3.1.5",
"lodash": "^4.17.15",
"vue": "^2.5.17",
"vue-json-editor": "^1.4.0",
"vue-router": "^3.0.1"
},
"devDependencies": {
......
......@@ -62,9 +62,10 @@
<Input v-model="showData.version"></Input>
</FormItem>
<FormItem label="项目源数据">
<Input v-model="showData.meta_data" type="textarea" :autosize="true"></Input>
<!-- <Input v-model="showData.meta_data" type="textarea" :autosize="true"></Input> -->
</FormItem>
</Form>
<vue-json-editor v-model="meta_data" exapndedOnStart="true" @json-change="onJsonChange"></vue-json-editor>
</div>
<div class="demo-drawer-footer">
<Button style="margin-right: 8px" @click="isShow= false">取消</Button>
......@@ -104,10 +105,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 {
......@@ -225,7 +228,8 @@ export default {
showBuild: false,
buildData: {},
envlist: [],
spinShow: false
spinShow: false,
meta_data: null
};
},
methods: {
......@@ -267,6 +271,7 @@ export default {
show: function(index) {
this.isShow = true;
this.showData = this.data1[index];
this.meta_data = JSON.parse(this.showData.meta_data);
},
goConfigs: function(index) {
this.$router.push({ path: "/configList", query: this.data1[index] });
......@@ -309,6 +314,10 @@ export default {
console.log(this.buildData);
this.showBuild = true;
},
onJsonChange: function(value) {
this.showData.meta_data = JSON.stringify(value);
console.log(value);
},
build: function() {
this.spinShow = true;
axios
......
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