Procházet zdrojové kódy

修改检查手册管理,查看和管理检查内容时检查内容序号不一致问题

xujie před 1 rokem
rodič
revize
6d024165d8

+ 6 - 4
src/views/safetycheck/rule/index.vue

@@ -176,7 +176,7 @@
                     size="mini"
                     type="text"
                     icon="el-icon-edit-outline"
-                    @click="onManageContent(r.row.id)"
+                    @click="onManageContent(r.row.id,'edit')"
                     v-if="r.row.status == 0 && orgId == r.row.orgId"
                     v-hasPermi="['safetycheck:rule:contentmanage']"
                     >管理检查内容</el-button
@@ -185,7 +185,7 @@
                     size="mini"
                     type="text"
                     icon="el-icon-view"
-                    @click="onManageContent(r.row.id)"
+                    @click="onManageContent(r.row.id,'view')"
                     v-if="r.row.status != 0 || orgId != r.row.orgId"
                     v-hasPermi="['safetycheck:rule:contentmanage']"
                     >查看检查内容</el-button
@@ -313,9 +313,11 @@ export default {
     onEdit(id, other = {}) {
       this.$refs.editDialog.show(id, other);
     },
-    onManageContent(id) {
+    onManageContent(id,type) {
       let path = `/core/safetycheck/rule/content/${id}`;
-      this.$router.push(path);
+      //路由名称:safetycheckRuleManager
+      this.$router.push({ name:"safetycheckRuleManager",params:{id:id,showType:type}});
+      //this.$router.push(path);
     },
     onDel(id) {
       this.$modal

+ 9 - 1
src/views/safetycheck/ruleManager/index.vue

@@ -210,6 +210,7 @@ export default {
   dicts: ["point_data_source"],
   data() {
     return {
+      showType: 'view',
       queryParams: {
         ruleId: null,
         itemName: null,
@@ -273,6 +274,7 @@ export default {
 
   mounted() {
     let id = this.$route.params.id;
+    this.showType = this.$route.params.showType;
     if (!id) {
       this.$tab.closePageAndPushPrev();
       return;
@@ -317,6 +319,7 @@ export default {
       }
       page(this.queryParams)
         .then((data) => {
+          console.log("112233445566")
           // debugger
           this.loading=false;
           let d = [];
@@ -439,7 +442,12 @@ export default {
       return "";
     },
     spanMethod({ row, column, rowIndex, columnIndex }) {
-      if (columnIndex < 3) {
+      let compareColumnIndex = 3;
+      if(this.showType === 'view'){
+        compareColumnIndex = 2;
+      }
+
+      if (columnIndex < compareColumnIndex) {
         if (row.rowSpan > 0) {
           return [row.rowSpan, 1];
         } else {