|
|
@ -117,12 +117,19 @@
|
|
|
|
width="50%"
|
|
|
|
width="50%"
|
|
|
|
:before-close="handleClose"
|
|
|
|
:before-close="handleClose"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<codemirror
|
|
|
|
<!-- <codemirror-->
|
|
|
|
v-model.trim="formData[item.name]"
|
|
|
|
<!-- v-model.trim="formData[item.name]"-->
|
|
|
|
class="code-mirror"
|
|
|
|
<!-- class="code-mirror"-->
|
|
|
|
:options="optionsJavascript"
|
|
|
|
<!-- :options="optionsJavascript"-->
|
|
|
|
style="height: 190px"
|
|
|
|
<!-- style="height: 190px"-->
|
|
|
|
/>
|
|
|
|
<!-- />-->
|
|
|
|
|
|
|
|
<vue-json-editor v-model="formData[item.name]"
|
|
|
|
|
|
|
|
:show-btns="false"
|
|
|
|
|
|
|
|
:mode="'code'"
|
|
|
|
|
|
|
|
lang="zh"
|
|
|
|
|
|
|
|
class="my-editor"
|
|
|
|
|
|
|
|
@json-change="onJsonChange"
|
|
|
|
|
|
|
|
@json-save="onJsonSave" />
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
<el-button @click="dialogVisibleStaticData = false"
|
|
|
|
<el-button @click="dialogVisibleStaticData = false"
|
|
|
|
>取 消</el-button
|
|
|
|
>取 消</el-button
|
|
|
@ -255,7 +262,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import ColorPicker from "./colorPicker.vue";
|
|
|
|
import ColorPicker from "./colorPicker.vue";
|
|
|
|
import { codemirror } from "vue-codemirror"; // 引入codeMirror全局实例
|
|
|
|
import vueJsonEditor from 'vue-json-editor'
|
|
|
|
import "codemirror/lib/codemirror.css"; // 核心样式
|
|
|
|
import "codemirror/lib/codemirror.css"; // 核心样式
|
|
|
|
import "codemirror/theme/cobalt.css"; // 引入主题后还需要在 options 中指定主题才会生效
|
|
|
|
import "codemirror/theme/cobalt.css"; // 引入主题后还需要在 options 中指定主题才会生效
|
|
|
|
// language
|
|
|
|
// language
|
|
|
@ -269,7 +276,7 @@ export default {
|
|
|
|
name: "DynamicForm",
|
|
|
|
name: "DynamicForm",
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
ColorPicker,
|
|
|
|
ColorPicker,
|
|
|
|
codemirror,
|
|
|
|
vueJsonEditor,
|
|
|
|
dynamicComponents,
|
|
|
|
dynamicComponents,
|
|
|
|
customColorComponents
|
|
|
|
customColorComponents
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -336,6 +343,8 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
onJsonChange (value) { },
|
|
|
|
|
|
|
|
onJsonSave (value) { },
|
|
|
|
saveData() {
|
|
|
|
saveData() {
|
|
|
|
this.$emit("onChanged", this.formData);
|
|
|
|
this.$emit("onChanged", this.formData);
|
|
|
|
this.dialogVisibleStaticData = false;
|
|
|
|
this.dialogVisibleStaticData = false;
|
|
|
|