|
@@ -169,13 +169,13 @@
|
|
|
<el-input v-model="form.labelTxt" placeholder="请输入名称" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="style" prop="style">
|
|
|
- <CodeEditor v-model="form.style"
|
|
|
- :auto-format="true"
|
|
|
- :smart-indent="true"
|
|
|
- theme="dracula"
|
|
|
- :indent-unit="4"
|
|
|
- :line-wrap="false"
|
|
|
- ref="editor"></CodeEditor>
|
|
|
+ <vue-json-editor
|
|
|
+ v-model="style"
|
|
|
+ :showBtns="false"
|
|
|
+ mode="code"
|
|
|
+ lang="zh"
|
|
|
+ :expanded-on-start="true"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="跳转页面路由" prop="url">
|
|
|
<el-input v-model="form.url" type="textarea" placeholder="请输入内容" />
|
|
@@ -212,14 +212,25 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listViewcfg, getViewcfg, delViewcfg, addViewcfg, updateViewcfg } from "@/api/cp/viewcfg";
|
|
|
-import { CodeEditor } from 'bin-code-editor'
|
|
|
+import { addViewcfg, delViewcfg, getViewcfg, listViewcfg, updateViewcfg } from '@/api/cp/viewcfg';
|
|
|
+import vueJsonEditor from 'vue-json-editor';
|
|
|
+
|
|
|
export default {
|
|
|
- components: { CodeEditor },
|
|
|
+ components: { vueJsonEditor },
|
|
|
name: "Viewcfg",
|
|
|
dicts: ['comp_code', 'sys_yes_no'],
|
|
|
+ watch: {
|
|
|
+ style: {
|
|
|
+ handler(val) {
|
|
|
+ debugger
|
|
|
+ this.form.style = JSON.stringify(val);
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ style: {},
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
@@ -293,6 +304,7 @@ export default {
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
+ this.style = {};
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
iconUri: null,
|
|
@@ -337,6 +349,7 @@ export default {
|
|
|
const id = row.id || this.ids
|
|
|
getViewcfg(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
+ this.style = JSON.parse(this.form.style);
|
|
|
this.open = true;
|
|
|
this.title = "修改cps_glb_view_cfg 展示配置";
|
|
|
});
|