Explorar o código

删除规范条件修改

duy hai 2 meses
pai
achega
d5b0ab50d6
Modificáronse 2 ficheiros con 89 adicións e 20 borrados
  1. 2 0
      src/views/codeRule/ConditionsSet.vue
  2. 87 20
      src/views/codeRule/ruleManage.vue

+ 2 - 0
src/views/codeRule/ConditionsSet.vue

@@ -253,6 +253,8 @@ export default {
   },
   methods: {
     show(val) {
+      console.log(val,'val');
+      
       this.visible = true
       if(val.length > 0&&val[0].name) {
         console.log(val,'val');

+ 87 - 20
src/views/codeRule/ruleManage.vue

@@ -194,7 +194,7 @@
                                     </div>
                                     <div class="operation-icons">
                                       <i class="el-icon-edit" @click.stop="handleEdit(item, index)"></i>
-                                      <i class="el-icon-delete" @click.stop="handleDelete(index)"></i>
+                                      <i class="el-icon-delete" @click.stop="handleDelete(item,index)"></i>
                                     </div>
                                 </div>
                         </div>
@@ -219,12 +219,12 @@
                         <div class="box-card-content2-list-item-list">
                                 <span class="basic-info">内容</span>
                                 <div class="box-card-content2-list-item-list-basic">
-                                    <div class="basic-item-info" v-for="(item1,index1) in item.basic":key="index1" >
-                                      {{ item1.name }}
+                                    <div class="basic-item-info" v-for="(item1,index1) in item.info":key="index1" >
+                                      {{ item1.symbolName }}
                                     </div>
                                     <div class="operation-icons">
                                       <i class="el-icon-edit" @click.stop="handleEditJs1(item, index)"></i>
-                                      <i class="el-icon-delete" @click.stop="handleDelete(index)"></i>
+                                      <i class="el-icon-delete" @click.stop="handleDelete1(item,index)"></i>
                                     </div>
                                 </div>
                         </div>
@@ -240,8 +240,10 @@
               <el-card class="box-card  h-100" v-if="!isShowYpList&&!isShowJsList">
                 <template >
                   <div slot="header" class="clearfix" >
-                    <i class="el-icon-arrow-left" style="margin-right: 5px; cursor: pointer;"  @click="showYpList"></i>
-                    <span  @click="showYpList">退出</span>
+                   <el-link type="primary"  @click="showYpList">
+                       <i class="el-icon-arrow-left" style="margin-right: 5px; cursor: pointer;" ></i>
+                      <span  >退出</span>
+                    </el-link>
                 </div>
                 <div class="add-yp-title">
                   <span>{{ isEditYp?'编辑':'新增' }}</span>
@@ -255,7 +257,7 @@
                       <div class="input-with-icon"  v-for="(item, index) in ypDetail.info" :key="index">
                         <el-input v-model="item.name"></el-input>
                         <i class="el-icon-circle-plus-outline" @click="addBasicInfo(index)" ></i>
-                        <i class="el-icon-remove-outline" @click="removeBasicInfo(index)"  v-if="index!==0"></i>
+                        <i class="el-icon-remove-outline" @click="removeBasicInfo(item,index)"  v-if="index!==0"></i>
                       </div>
                     </el-form-item>
                     
@@ -295,7 +297,7 @@
                           
                         </el-input>
                         <i class="el-icon-circle-plus-outline" @click="addBasicInfo1(index)"  ></i>
-                        <i class="el-icon-remove-outline" @click="removeBasicInfo1(index)" v-if="index!==0"></i>
+                        <i class="el-icon-remove-outline" @click="removeBasicInfo1(item,index)" v-if="index!==0"></i>
                       </div>
                     </el-form-item>
                     
@@ -411,7 +413,7 @@ import {getLazytree} from "@/api/manager/wbsprivate";
 import ConditionsSet from './ConditionsSet.vue'
 import LinkEle from "./LinkEle.vue";
 import PreviewResult from './PreviewResult.vue'
-import {getPage,edit,add,deleteItem,getById, addInfo,editInfo,getInfoPage } from "@/api/ruleManage/fileRule.js";
+import {getPage,edit,add,deleteItem,getById, addInfo,editInfo,getInfoPage,deleteItemInfo } from "@/api/ruleManage/fileRule.js";
 import { getStore, setStore } from "@/util/store";
  import { getDictionary } from "@/api/system/dict";
   export default {
@@ -707,7 +709,7 @@ import { getStore, setStore } from "@/util/store";
               }).then((res) => {
                 this.ruleLoading = false;
                 if (res.data.code === 200) {
-                  console.log(res.data.data.records,'res.data.data.records');
+            
                   // 
                   if(type===1){
                     this.ypList = res.data.data.records;
@@ -811,8 +813,31 @@ import { getStore, setStore } from "@/util/store";
     },
 
     // 删除基础信息行
-    removeBasicInfo(index) {
-      this.ypDetail.basic.splice(index, 1);
+    removeBasicInfo(item,index) {
+     if(item.id==''){
+        this.ypDetail.info.splice(index, 1);
+     }else{
+        this.$confirm('删除后,数据将无法恢复,是否确认删除!', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+         
+            deleteItemInfo({id:item.id}).then((res) => {
+              if(res.data.code==200){
+                this.$message.success(res.data.msg);
+                this.getRuleDataDetail(this.ruleItemDetail);
+                this.getRuleDataDetail1(this.ruleItemDetail,1);
+                    this.ypDetail.info.splice(index, 1);
+              }else{
+                this.$message.error(res.data.msg);
+              }
+            });
+          }).catch(() => {
+            this.$message.info('已取消删除');
+          })
+     }
+
     },
   async  saveYpForm(){
         const isValid = await this.$refs.ypFormRef.validate()
@@ -928,14 +953,23 @@ import { getStore, setStore } from "@/util/store";
         this.isEditYp = true;
       },
 
-      handleDelete(index) {
+      handleDelete(item,index) {
         this.$confirm('删除后,数据无法恢复,是否确认删除?', '删除确认', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          this.ypList.splice(index, 1);
-          this.$message.success('删除成功');
+          // this.ypList.splice(index, 1);
+          deleteItemInfo({ id: item.id }).then((res) => {
+            if(res.data.code==200){
+                this.$message.success(res.data.msg)
+                 this.getRuleDataDetail(this.ruleItemDetail);
+                  this.getRuleDataDetail1(this.ruleItemDetail,1);
+            }else{
+                this.$message.error(res.data.msg)
+            }
+          });
+         
         }).catch(() => {});
       },
        handleEdit1(item, index) {
@@ -943,14 +977,23 @@ import { getStore, setStore } from "@/util/store";
         console.log('编辑项目:', item, index);
       },
 
-      handleDelete1(index) {
+      handleDelete1(item,index) {
         this.$confirm('删除后,数据无法恢复,是否确认删除?', '删除确认', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         }).then(() => {
-          this.jsList.splice(index, 1);
-          this.$message.success('删除成功');
+          // this.jsList.splice(index, 1);
+       deleteItemInfo({ id: item.id }).then((res) => {
+            if(res.data.code==200){
+                this.$message.success(res.data.msg)
+                 this.getRuleDataDetail(this.ruleItemDetail);
+                  this.getRuleDataDetail1(this.ruleItemDetail,2);
+            }else{
+                this.$message.error(res.data.msg)
+            }
+          });
+       
         }).catch(() => {});
       },
       //新增技术指标
@@ -1029,8 +1072,32 @@ import { getStore, setStore } from "@/util/store";
       },
     
     // 删除基础信息行
-    removeBasicInfo1(index) {
-      this.jsDetail.basic.splice(index, 1);
+    removeBasicInfo1(item,index) {
+
+       if(item.id==''){
+        this.jsDetail.info.splice(index, 1);
+     }else{
+        this.$confirm('删除后,数据将无法恢复,是否确认删除!', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+         
+            deleteItemInfo({id:item.id}).then((res) => {
+              if(res.data.code==200){
+                this.$message.success(res.data.msg);
+                      this.jsDetail.info.splice(index, 1);
+                this.getRuleDataDetail(this.ruleItemDetail);
+                this.getRuleDataDetail1(this.ruleItemDetail,1);
+                    this.ypDetail.info.splice(index, 2);
+              }else{
+                this.$message.error(res.data.msg);
+              }
+            });
+          }).catch(() => {
+            this.$message.info('已取消删除');
+          })
+     }
     },
     //条件设置
     conditionsSet(){