فهرست منبع

+ 报名信息更新之后更新会话信息

chen.cheng 11 ماه پیش
والد
کامیت
d549cb7733
2فایلهای تغییر یافته به همراه24 افزوده شده و 11 حذف شده
  1. 1 1
      ruoyi-ui/package.json
  2. 23 10
      ruoyi-ui/src/views/cp/viewcfg/index.vue

+ 1 - 1
ruoyi-ui/package.json

@@ -38,7 +38,6 @@
   "dependencies": {
     "@riophae/vue-treeselect": "0.4.0",
     "axios": "0.28.1",
-    "bin-code-editor": "^0.9.0",
     "clipboard": "2.0.8",
     "core-js": "3.37.1",
     "echarts": "5.4.0",
@@ -56,6 +55,7 @@
     "vue": "2.6.12",
     "vue-count-to": "1.0.13",
     "vue-cropper": "0.5.5",
+    "vue-json-editor": "^1.4.3",
     "vue-meta": "2.4.0",
     "vue-router": "3.4.9",
     "vuedraggable": "2.24.3",

+ 23 - 10
ruoyi-ui/src/views/cp/viewcfg/index.vue

@@ -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 展示配置";
       });