소스 검색

未绑定表单的表格的新增和修改的拦截

lph 1 년 전
부모
커밋
4a3db5bce8
2개의 변경된 파일58개의 추가작업 그리고 57개의 파일을 삭제
  1. 50 57
      ruoyi-ui/src/views/system/processModeling/flow-x6/index.vue
  2. 8 0
      ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

+ 50 - 57
ruoyi-ui/src/views/system/processModeling/flow-x6/index.vue

@@ -38,7 +38,7 @@ export default {
       isReady: false,
       destroyFn: null,
       drawer: false,
-      direction: 'rtl',
+      direction: "rtl",
     };
   },
   components: { ToolBar, ConfigPanel },
@@ -57,18 +57,18 @@ export default {
     //       })
     //       .catch(_ => {});
     //   },
-      // closeDrawer() {
-      //   this.$refs.drawer.close();
-      // },
+    // closeDrawer() {
+    //   this.$refs.drawer.close();
+    // },
     initGraph() {
       const graph = FlowGraph.init(
         $("#container"),
         $("#container").getBoundingClientRect().width,
         $("#container").getBoundingClientRect().height
       );
-      const graphJson = JSON.parse(window.localStorage.getItem('graphJson'))
-      if(graphJson){
-        graph.fromJSON(graphJson)
+      const graphJson = JSON.parse(window.localStorage.getItem("graphJson"));
+      if (graphJson) {
+        graph.fromJSON(graphJson);
       }
       this.isReady = true;
       const resizeFn = () => {
@@ -81,15 +81,9 @@ export default {
         window.removeEventListener("resize", resizeFn);
         graph.dispose();
       };
-   
-
     },
-    
-
-
   },
-}
-
+};
 </script>
 <style lang="scss">
 .x6-widget-snapline-vertical {
@@ -136,67 +130,66 @@ export default {
   animation-delay: -3s;
 }
 
- .x6-widget-stencil {
-   color: rgba(34, 38, 83, 1);
-   background: #fff;
- }  
- .x6-widget-stencil-title {  
+.x6-widget-stencil {
+  color: rgba(34, 38, 83, 1);
+  background: #fff;
+}
+.x6-widget-stencil-title {
   background: rgba(7, 68, 138, 1);
   color: #fff;
 }
 .x6-widget-stencil-search-text {
-   color: #fff;
-   background: rgba(7, 68, 138, 1);
- }
- .x6-widget-stencil-group > .x6-widget-stencil-group-title {
-   /* background: #7daee3; */
-   color: #000;
-   height: 40px;
-   font-size: 18px;
-   line-height: 40px;
-   font-weight: normal;
-
- }
-
+  color: #fff;
+  background: rgba(7, 68, 138, 1);
+}
+.x6-widget-stencil-group > .x6-widget-stencil-group-title {
+  /* background: #7daee3; */
+  color: #000;
+  height: 40px;
+  font-size: 18px;
+  line-height: 40px;
+  font-weight: normal;
+}
 
- .x6-widget-stencil.collapsable > .x6-widget-stencil-title::before, .x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {
-    background-image: url('');
-    opacity: 0.4;
-    transition: all 0.3s;
+.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,
+.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {
+  // background-image: url('');
+  opacity: 0.4;
+  transition: all 0.3s;
 }
-.x6-widget-stencil-title{
+.x6-widget-stencil-title {
   visibility: hidden;
 }
-.x6-widget-stencil-search{
+.x6-widget-stencil-search {
   visibility: hidden;
 }
 .x6-widget-stencil {
-    position: absolute;
-    top: -80px;
-    right: 0;
-    bottom: 0;
-    left: 0;
+  position: absolute;
+  top: -80px;
+  right: 0;
+  bottom: 0;
+  left: 0;
 }
 
-.config{
+.config {
   width: 20%;
   padding: 0 0;
 }
-#stencil{
+#stencil {
   width: 10%;
 }
 .el-tabs__header {
   background: rgba(229, 229, 229);
-   /* height: 40px; */
+  /* height: 40px; */
 }
 .el-tabs__item {
-    height: 40px;
-    line-height: 40px;
-    font-size: 18px;
-    font-weight: normal;
-    /* color: #fff; */
-    position: relative;
-    margin-left: 10px !important;
+  height: 40px;
+  line-height: 40px;
+  font-size: 18px;
+  font-weight: normal;
+  /* color: #fff; */
+  position: relative;
+  margin-left: 10px !important;
 }
 /* .el-tabs__item:hover {
     color: #fff;
@@ -205,16 +198,16 @@ export default {
 /* .el-tabs__item.is-active {
     color: #fff;
 } */
-.el-tab-pane{
+.el-tab-pane {
   margin-left: 10px !important;
 }
-.x6-graph-svg-stag{
+.x6-graph-svg-stag {
   margin-left: -10px;
 }
-.x6-graph{
+.x6-graph {
   height: 800px !important;
 }
-.bar{
+.bar {
   z-index: 1 !important;
 }
 </style>

+ 8 - 0
ruoyi-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -389,6 +389,10 @@ export default {
       getInfoBySqlKey(this.sqlkey).then(({ data }) => {
         // const htmlCode = data.dfHtmlTemplate;
         // this.iframeUrl = "data:text/html;charset=utf-8," + encodeURI(htmlCode);
+        if (!data || !data.dfVueTemplate) {
+          this.$message.error("当前表格未绑定表单!");
+          return;
+        }
         this.jsonData = JSON.parse(data.dfVueTemplate);
         this.open = true;
         this.title = "添加信息";
@@ -403,6 +407,10 @@ export default {
       getInfoBySqlKey(this.sqlkey).then(({ data }) => {
         // const htmlCode = data.dfHtmlTemplate;
         // this.iframeUrl = "data:text/html;charset=utf-8," + encodeURI(htmlCode);
+        if (!data || !data.dfVueTemplate) {
+          this.$message.error("当前表格未绑定表单!");
+          return;
+        }
         Object.assign(this.defaultValue, row);
         this.jsonData = JSON.parse(data.dfVueTemplate);
         this.open = true;