Commit 81cb29c0 authored by zhouzihao's avatar zhouzihao

dev-添加Json编辑

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