zhangkunling 2 anni fa
parent
commit
06bb3e7dd6

+ 24 - 7
src/components/StatisticsList.vue

@@ -5,8 +5,8 @@
         <div class="tabs-list">
           <img :src="tabsIcon[index].imgSrc" >
           <div>
-            <p class="">{{ item.text }}</p>
-            <p :style="'color:'+tabsTitleColor[index]" class="tabs-list-value">{{ item.value }}<span class="tabs-list-company">{{ item.company }}</span></p>
+            <p>{{ item.name }}</p>
+            <p :style="'color:'+tabsTitleColor[index]" class="tabs-list-value">{{ item.value }}<span class="tabs-list-company">{{unitArr[index]}}</span></p>
           </div>
         </div>
       </Col>
@@ -35,9 +35,19 @@ export default {
         return [];
       },
     },
+    unitArr: {
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
     spanNum: {
       type: Number,
       default: 6
+    },
+     url: {
+      type: String,
+      default: ''
     }
   },
   components:{
@@ -48,14 +58,21 @@ export default {
     };
   },
   mounted() {
-    // this.$nextTick(()=> {
-    //   this.tabsData = this.tabsInitData
-    // })
     this.tabsData = this.tabsInitData
-    console.log(this.tabsData)
+    this.getStatisList()
   },
   methods: {
-   
+   getStatisList () {
+     this.$get(this.url).then(res=>{
+        if (res.httpCode == 1){
+          this.tabsData = res.data.data
+          console.log(this.tabsData)
+        } else {
+          this.tabsData = this.tabsInitData
+          this.$Message.info(res.msg)
+        }
+      })  
+   }
   }
 };
 </script>

+ 197 - 110
src/views/homecomponents/DataManagement/DataRules.vue

@@ -3,13 +3,13 @@
     <div class="content-main">
      <div class="content-body-wrap">
        <div class="content-body">
-         <statistics-list :tabsInitData="tabsInitData" :tabsTitleColor="tabsTitleColor" :tabsIcon="tabsIcon"></statistics-list>
+         <statistics-list :tabsInitData="tabsInitData" :tabsTitleColor="tabsTitleColor" :unitArr="unitArr" :tabsIcon="tabsIcon" url="metroapi/datarule/summary" ref="statistics"></statistics-list>
           <div class="search-list">
             <div class="search-left">
               <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
-                 <FormItem label="" prop="roleId">
-                  <Select v-model="tableParams.roleId" placeholder="指标类型">
-                    <Option v-for="item in indexTypeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+                 <FormItem label="" prop="targetTypeId">
+                  <Select v-model="tableParams.targetTypeId" placeholder="指标类型">
+                    <Option v-for="item in targetTypeNameList" :value="item.id" :key="item.id">{{ item.value}}</Option>
                   </Select>
                 </FormItem>
                 <FormItem label="" prop="businessTypeId">
@@ -20,11 +20,11 @@
                  <FormItem label="">
                   <DatePicker type="datetimerange" :value="dateRange" format="yyyy-MM-dd HH:mm:ss" placeholder="更新时间范围" class="common-date-picker date-picker-main" :clearable="false" :editable="false" @on-change="changePicker"></DatePicker>
                 </FormItem>
-                <FormItem label="" prop="moduleName">
-                  <Input placeholder="输入规则名称关键词查询" clearable search v-model="tableParams.moduleName" />
+                <FormItem label="" prop="ruleName">
+                  <Input placeholder="输入规则名称关键词查询" clearable search v-model="tableParams.ruleName" />
                 </FormItem>
-                <FormItem label="" prop="operationName">
-                  <Input placeholder="输入字段关键词查询" clearable search v-model="tableParams.operationName" />
+                <FormItem label="" prop="field">
+                  <Input placeholder="输入字段关键词查询" clearable search v-model="tableParams.field" />
                 </FormItem> 
                 <FormItem label="" >
                   <Button type="primary" class="common-btn-search" @click="searchClick">
@@ -39,15 +39,15 @@
             <div class="btn-container">
               <Button icon="ios-add" class="common-add-btn" @click="addClick">新增规则</Button>
             </div>
-            </div>
+            </div> 
             <div class="manage-main-center">
               <Table :columns="columns" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading">
                 <template slot="loading">
                     <Loading-animation></Loading-animation>
                 </template>
-                <template slot-scope="{ row }" slot="operationUser">
+                <!-- <template slot-scope="{ row }" slot="operationUser">
                   {{row.operationUser}}
-                </template>
+                </template> -->
                  <template slot-scope="{ row }" slot="action">
                   <Tooltip content="编辑" placement="top">
                       <i class="iconfont icon-bianji" style="cursor:pointer;color:#64ACFE;fontSize:20px;marginRight:6px" @click="editClick(row)"></i>
@@ -82,34 +82,33 @@
         <div class="modal-content" v-show="currentStep==1">
           <div class="modal-content-top-title">基础信息</div>
           <Form class="common-form" ref="formOption" :model="formOption" :rules="ruleValidate" :label-width="120">
-            <FormItem label="规则名称:" prop="appName">
-              <Input v-model.trim="formOption.appName" maxlength="20" show-word-limit />
+            <FormItem label="规则名称:" prop="ruleName">
+              <Input v-model.trim="formOption.ruleName" maxlength="20" show-word-limit />
             </FormItem>
-            <FormItem label="指标类型:" prop="businessTypeId">
-              <Select v-model="formOption.businessTypeId" placeholder="指标类型" label-in-value @on-change="selectModalBusiness">
-                <Option v-for="item in indexTypeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+            <FormItem label="指标类型:" prop="targetType">
+              <Select v-model="formOption.targetType" placeholder="指标类型" label-in-value @on-change="selectModalBusiness">
+                <Option v-for="item in targetTypeNameModalList" :value="item.id" :key="item.id">{{ item.value}}</Option>
               </Select>
-              <!-- <Select v-model="formOption.businessTypeId" placeholder="指标类型" label-in-value @on-change="selectModalBusiness">
-                <Option v-for="item in indexTypeList" :value="item.id" :key="item.id">{{ item.businessTypeName }}</Option>
-              </Select> -->
             </FormItem>
-            <FormItem label="规则描述:" prop="appName">
-              <Input v-model.trim="formOption.appName" type="textarea" :rows="6" maxlength="100" show-word-limit />
+            <FormItem label="规则描述:" prop="ruleDesc">
+              <Input v-model.trim="formOption.ruleDesc" type="textarea" :rows="6" maxlength="100" show-word-limit />
             </FormItem>
           </Form>
         </div>
         <div class="modal-content" v-show="currentStep==2">
-          <rule-step-two :businessData="businessData" v-if="showModal" ref="ruleStep2" @selectTableChange="selectTableChange"></rule-step-two>
+          <rule-step-two :businessModalData="businessModalData" :currentObj="formOption" :modalTitle="title" v-if="showModal" ref="ruleStep2" @selectTableChange="selectTableChange"></rule-step-two>
         </div>
         <div class="modal-content" v-show="currentStep==3">
-          <rule-step-three :currentObj="formOption" v-if="showModal"></rule-step-three>
+          <rule-step-three :currentObj="formOption" v-if="showModal" ref="ruleStep3"></rule-step-three>
+        </div>
+        <div class="modal-content" v-show="currentStep==4">
+          <rule-step-four :currentObj="formOption" v-if="showModal" ref="ruleStep4"></rule-step-four>
         </div>
-        <div class="modal-content" v-show="currentStep==4"></div>
       </div>
       <div slot="footer" class="custom-footer">
           <Button type="primary" @click="previousStep" :style="{visibility:currentStep>1 ? 'visible': 'hidden'}">上一步</Button>
           <Button type="primary" @click="nextStep('formOption',1)" v-show="currentStep<4">下一步</Button>
-          <Button type="primary" v-show="currentStep==4">保存</Button>
+          <Button type="primary" v-show="currentStep==4" @click="saveRule">保存</Button>
         </div>
     </Modal>
     <Modal
@@ -135,10 +134,12 @@ import StatisticsList from '../../../components/StatisticsList.vue'
 import TabsList from '../../../components/TabsList.vue'
 import RuleStepTwo from './QualityRules/RuleStepTwo.vue'
 import RuleStepThree from './QualityRules/RuleStepThree.vue'
+import RuleStepFour from './QualityRules/RuleStepFour.vue'
+const defaultFrom = {ruleName:'',targetType:'',targetName: '',ruleDesc:'',applicationId:'',applicationName: '',equipmentTypeCode:'',field:'',expr: '',dataType:'all',dataValue:'',logicalValueDTOList:[],exprDesc: ''}
 export default {
   name: "DataRules",
   components: {
-      StatisticsList,TabsList,RuleStepTwo,RuleStepThree
+      StatisticsList,TabsList,RuleStepTwo,RuleStepThree,RuleStepFour
     },
   data() {
     return {
@@ -149,94 +150,105 @@ export default {
         { imgSrc: require('@/assets/images/dataQuality4.png') },
       ],
       tabsTitleColor:['#45F2FD', '#EBF310', '#54D593', '#FD7545'],
+      unitArr: ['条','条','条','条'],
       tabsInitData: [
-        { text: '准确性规则', value: 0, company: '条' },
-        { text: '及时性规则', value: 0, company: '条' },
-        { text: '一致性规则', value: 0, company: '条' },
-        { text: '完整性规则', value: 0, company: '条' }
+        { name: '准确性规则', value: 0},
+        { name: '及时性规则', value: 0},
+        { name: '一致性规则', value: 0},
+        { name: '完整性规则', value: 0}
       ],
       loading: true,
       businessData: [],
       businessModalData: [],
-      indexTypeList: [{label:"及时性",value:'及时性'}, {label:"一致性",value:'一致性'}, {label:"准确性",value:'准确性'}, {label:"完整性",value:'完整性'}],
+      targetTypeNameList: [],
+      targetTypeNameModalList: [],
+      // targetTypeNameList: [{label:"及时性",value:'及时性'}, {label:"一致性",value:'一致性'}, {label:"准确性",value:'准确性'}, {label:"完整性",value:'完整性'}],
       dateRange: [],
       tableParams: {
-        roleId: '',
-        beginOperateTime: '',
+        targetTypeId: '',
+        businessTypeId: '',
+        beginUpdateTime: '',
         endOperateTime: '',
-        moduleName: '',
-        operationName: '',
+        ruleName: '',
+        field: '',
         pageNum: 1,
-        pageSize: 50
+        pageSize: 10
       },
       tableData: [],
       tableTotal: 0,
       tablePage: 0,
       columns: [
-           {
+          {
             title: '序号',
             type: 'index',
             align: 'center',
             ellipsis: true,
             tooltip: true
           },
-          {
+           {
             title: '规则名称',
-            // key: 'operationUser',
-            slot: 'operationUser',
+            key: 'ruleName',
             align: 'center',
-            // ellipsis: true,
-            // tooltip: true
+            ellipsis: true,
+            tooltip: true
           },
+          // {
+          //   title: '',
+          //   // key: 'operationUser',
+          //   slot: 'operationUser',
+          //   align: 'center',
+          //   // ellipsis: true,
+          //   // tooltip: true
+          // },
           {
             title: '规则描述',
-            key: 'roleName',
+            key: 'ruleDesc',
             align: 'center',
             ellipsis: true,
             tooltip: true
           },
           {
             title: '规则类型',
-            key: 'operator',
+            key: 'targetName',
             align: 'center',
             ellipsis: true,
             tooltip: true
           },
           {
             title: '应用',
-            key: 'moduleName',
+            key: 'applicationName',
+            align: 'center',
+            ellipsis: true,
+            tooltip: true
+          },
+          {
+            title: '应用业务类型',
+            key: 'businessTypeName',
+            align: 'center',
+            ellipsis: true,
+            tooltip: true
+          },
+          {
+            title: '字段',
+            key: 'field',
+            align: 'center',
+            ellipsis: true,
+            tooltip: true
+          },
+          {
+            title: '计算方法',
+            key: 'expr',
+            align: 'center',
+            ellipsis: true,
+            tooltip: true
+          },
+          {
+            title: '更新时间',
+            key: 'updateTime',
             align: 'center',
             ellipsis: true,
             tooltip: true
           },
-          // {
-          //   title: '应用业务类型',
-          //   key: 'moduleName',
-          //   align: 'center',
-          //   ellipsis: true,
-          //   tooltip: true
-          // },
-          // {
-          //   title: '字段',
-          //   key: 'moduleName',
-          //   align: 'center',
-          //   ellipsis: true,
-          //   tooltip: true
-          // },
-          // {
-          //   title: '计算方法',
-          //   key: 'moduleName',
-          //   align: 'center',
-          //   ellipsis: true,
-          //   tooltip: true
-          // },
-          // {
-          //   title: '更新时间',
-          //   key: 'operationName',
-          //   align: 'center',
-          //   ellipsis: true,
-          //   tooltip: true
-          // },
           {
             title: '操作',
             align: 'center',
@@ -253,19 +265,25 @@ export default {
       activeClass: '',
       modalTitle: '',
       currentStep: 1,
-      formOption: {appName:'',businessTypeId: '',remark: '',businessTypeName:'',fieldName:''},
+      formOption: {ruleName:'',targetType:'',targetName: '',ruleDesc:'',applicationId:'',applicationName: '',equipmentTypeCode:'',field:'',expr: '',dataType:'all',dataValue: '',logicalValueDTOList:[],exprDesc: ''},
+      // formOption: {"name":"","ruleType":"","moduleName":"","targetTypeNameId":'',"targetTypeName":"","businessTypeId":'',"ruleDescription":"","field":"","unit":" ","formulaJsonMap":{}},
       ruleValidate: {
-        // appName: [{
-        //   required: true,
-        //   message: '请输入应用名称',
-        //   trigger: 'blur'
-        // }],
-        businessTypeId: [{
+        ruleName: [{
+          required: true,
+          message: '请输入规则名称',
+          trigger: 'blur'
+        }],
+        targetType: [{
           required: true,
-          // type: 'number',
-          message: '请选择业务类型',
+          type: 'number',
+          message: '请选择指标类型',
           trigger: 'change'
-        }]
+        }],
+        ruleDesc: [{
+          required: true,
+          message: '请输入规则描述',
+          trigger: 'blur'
+        }],
       }, 
       // columnsModal: [
       //   {
@@ -292,6 +310,7 @@ export default {
       // ],
       // modalAppData: [],
       index: 0,
+      appModalId: null,
     };
   },
   mounted() {
@@ -301,7 +320,7 @@ export default {
   },
   methods: {
     changePicker (date) {
-      this.tableParams.beginOperateTime = date[0]
+      this.tableParams.beginUpdateTime = date[0]
       this.tableParams.endOperateTime = date[1]
     },
     rowClassName(row, index) {
@@ -322,12 +341,22 @@ export default {
       this.getTableData()
     },
     getType  () {
+      // 指标类型数据
+       this.$get('metroapi/dic/queryDictionary', {name:'指标类型'}).then(res=>{
+        if (res.httpCode == 1 ){
+          this.targetTypeNameModalList = JSON.parse(JSON.stringify(res.data))
+          this.targetTypeNameList = res.data
+          this.targetTypeNameList.unshift({ id: '-1', value: '指标类型' })
+        } else {
+          this.targetTypeNameList = []
+        }
+      })
       // 业务类型数据
       this.$get('metroapi/businessType/box').then(res=>{
         if (res.httpCode == 1 ){
-          this.businessModalData = JSON.parse(JSON.stringify(res.data))
           this.businessData = res.data
           this.businessData.unshift({ id: '-1', businessTypeName: '业务类型' })
+          this.businessModalData = this.businessData
         } else {
           this.businessData = []
           this.businessModalData = []
@@ -337,9 +366,10 @@ export default {
     // 获取表格数据
     getTableData () {
       let params = JSON.parse(JSON.stringify(this.tableParams))
-      params.roleId= params.roleId == '-1'?'':params.roleId
+      params.targetTypeId= params.targetTypeId == '-1'?'':params.targetTypeId
+      params.businessTypeId= params.businessTypeId == '-1'?'':params.businessTypeId
       this.loading = true
-      this.$get('metroapi/log/querySysLogPage', params).then(res=>{
+      this.$get('metroapi/datarule/queryDataRulePage', params).then(res=>{
         this.loading = false
           if (res.httpCode == 1 ){
             this.tableData = res.data.data
@@ -366,7 +396,7 @@ export default {
     },
     resetClick (name) {
      this.dateRange = []
-     this.tableParams.beginOperateTime = ''
+     this.tableParams.beginUpdateTime = ''
      this.tableParams.endOperateTime = ''
      this.$refs[name].resetFields()
      this.tableParams.pageNum = 1
@@ -377,31 +407,28 @@ export default {
       // this.$get('metroapi/role/box').then(res=>{
       //   if (res.httpCode == 1 ){
       //     this.roleModalData = JSON.parse(JSON.stringify(res.data))
-      //     this.indexTypeList = res.data
-      //     this.indexTypeList.unshift({ value: '-1', label: '指标类型' })
+      //     this.targetTypeNameList = res.data
+      //     this.targetTypeNameList.unshift({ value: '-1', label: '指标类型' })
       //   } else {
-      //     this.indexTypeList = []
+      //     this.targetTypeNameList = []
       //   }
       // })
     }, 
     addClick () {
+      this.formOption = JSON.parse(JSON.stringify(defaultFrom))
+      // this.appModalId = 172
       this.currentStep = 1
       this.title = '新增规则'
       this.showModal = true
     },
      editClick (row) {
-      console.log(this.modalAppData)
       this.currentStep = 1
       this.rowObj = row
-      this.formOption = JSON.parse(JSON.stringify(row));
-      // this.modalAppData[this.index]._highlight = true
-      // this.formOption.lineId = this.formOption.lineId ? String(this.formOption.lineId) : '-1'
-      // this.formOption.stationId = this.formOption.stationId ? String(this.formOption.stationId) : '-1'
-      // this.formOption.level = String(this.formOption.level)
-      // this.getStationData(this.formOption.lineId)
-      // this.levelModalData = this.getCurrentLevel()
+      // this.formOption = JSON.parse(JSON.stringify(row));
       this.title = '编辑规则'
       this.showModal = true
+      this.formOption = JSON.parse(JSON.stringify(row));
+      this.formOption.equipmentTypeCode = !this.formOption.equipmentTypeCode ? 0 : this.formOption.equipmentTypeCode
     },
     delClick (row) {
       this.rowObj = row
@@ -416,7 +443,7 @@ export default {
       this.$refs.formOption.resetFields();
      }
     },
-    nextStep (formName,num) {
+    nextStep (formName,num) {    
     if (this.currentStep ==1) {
        this.$refs[formName].validate((valid) => {
         if (valid) {
@@ -430,13 +457,35 @@ export default {
         this.currentStep = this.currentStep + num
       }
     } else if (this.currentStep == 3) {
-
-    }
-     console.log(this.currentStep)
+      if (this.$refs.ruleStep3.saveValid()) {
+        if (this.formOption.targetName == '及时性(数据采集)') {
+          this.formOption.dataValue = this.$refs.ruleStep3.formCustom.timelinArry1[0].dataValue
+        } else if (this.formOption.targetName == '及时性(数据入库)') {
+          this.formOption.dataValue = this.$refs.ruleStep3.formCustom.timelinArry2[0].dataValue
+        } else if (this.formOption.targetName == '准确性') {
+          this.formOption.logicalValueDTOList = this.$refs.ruleStep3.formCustomAcc.accuracyArr
+          this.formOption.exprDesc = this.$refs.ruleStep3.formCustomAcc.exprDesc
+        }
+        if (this.$refs.ruleStep3.ruleObj.dataType) {
+          this.formOption.dataType = this.$refs.ruleStep3.ruleObj.dataType
+        } else {
+          if (this.formOption.targetName == '一致性') {
+            delete this.formOption.dataType
+          }
+        }
+        this.currentStep = this.currentStep + num
+      } 
+    } 
     },
     previousStep () {
       this.currentStep--
     },
+    saveRule () {
+      let params = JSON.parse(JSON.stringify(this.formOption))
+      params.equipmentTypeCode = params.equipmentTypeCode== '展示全部字段' ? '': params.equipmentTypeCode
+      console.log('params',params)
+      this.saveData(params)
+    },
     commonOk () {
       let params = {
         id: this.rowObj.id
@@ -446,10 +495,29 @@ export default {
     commonCancel () {
       this.modalStatus = false
     },
+    saveData (params) {
+      let url = ''
+      if (this.title == '新增规则') {
+        url = 'metroapi/datarule/addDataRule'
+      } else {
+        url = 'metroapi/datarule/editDataRule'
+      }
+      this.$post(url, params).then(res=>{
+          if (res.httpCode == 1 ){
+            this.$refs.statistics.getStatisList()
+            this.showModal = false
+            this.$Message.info(res.msg)
+            this.getTableData()
+          } else {
+            this.$Message.info(res.msg)
+          }
+        })
+    },
     // 删除接口
     delData (params) {
-      this.$get('metroapi/equipment/delEquipmentType',params).then(res=>{
+      this.$get('metroapi/datarule/delDataRule',params).then(res=>{
         if (res.httpCode == 1 ){
+          this.$refs.statistics.getStatisList()
           this.modalStatus = false
           this.$Message.info(res.msg)
           this.getTableData()
@@ -458,16 +526,22 @@ export default {
         }
       })
     },
-    selectTableChange (id) {
-     this.formOption.fieldName = id
-     console.log('selectTableChange',this.formOption)
+    selectTableChange (obj) {
+      if (obj.text == 'applicationId') {
+        this.formOption.applicationId = obj.id
+        this.formOption.applicationName = obj.applicationName
+        this.formOption.equipmentTypeCode = ''
+      } else if (obj.text == 'equipmentTypeCode') {
+        this.formOption.equipmentTypeCode = obj.id
+      } else {
+        this.formOption.field = obj.id
+      }
+      console.log('formOption', this.formOption)
     },
     selectModalBusiness (option) {
       if (option) {
-       this.formOption.businessTypeName = option.label
-       console.log('selectModalBusiness',this.formOption)
+       this.formOption.targetName = option.label
       }
-      console.log(option)
     }
   }
 };
@@ -579,4 +653,17 @@ export default {
 .modal-content {
   margin-top: 20px;
 }
+/* 对话框里的input里的placeholder样式修改 */
+/deep/ .ivu-input::-webkit-input-placeholder , /deep/ .ivu-input-number-input::-webkit-input-placeholder{
+  color: #718EBD;
+}
+/deep/ .ivu-input::-moz-placeholder, /deep/ .ivu-input-number-input::-webkit-input-placeholder{   /* Mozilla Firefox 19+ */
+  color: #718EBD;
+}
+/deep/ .ivu-input::-moz-placeholde, /deep/ .ivu-input-number-input::-webkit-input-placeholderr{    /* Mozilla Firefox 4 to 18 */
+ color: #718EBD;
+}
+/deep/ .ivu-input::-ms-input-placeholder, /deep/ .ivu-input-number-input::-webkit-input-placeholder{  /* Internet Explorer 10-11 */
+  color: #718EBD;
+}
 </style>

+ 139 - 0
src/views/homecomponents/DataManagement/QualityRules/RuleStepFour.vue

@@ -0,0 +1,139 @@
+<template>
+  <Row :gutter="16">
+    <Col :span="12">
+      <div class="modal-step2-title"><span class="modal-step2-star">* </span>基础信息&来源信息</div>
+      <div class="modal-step2-body">
+         <Form class="common-form common-form-modal" :model="ruleObj" :label-width="120">
+          <FormItem label="规则名称:"> 
+            <div class="common-form-detail-text">{{ruleObj.ruleName}}</div> 
+          </FormItem>
+          <FormItem label="指标类型:">
+            <div class="common-form-detail-text">{{ruleObj.targetName}}</div> 
+          </FormItem>
+          <FormItem label="规则描述:">
+            <div class="common-form-detail-text">{{ruleObj.ruleDesc}}</div> 
+          </FormItem>
+          <FormItem label="来源应用:">
+            <div class="common-form-detail-text">{{ruleObj.applicationName}}</div> 
+          </FormItem>
+          <FormItem label="字段:">
+            <div class="common-form-detail-text">{{ruleObj.field}}</div> 
+          </FormItem>
+        </Form>
+      </div>
+    </Col>
+    <Col :span="12">
+    <div class="modal-step2-title modal-rule-detail"><span class="modal-step2-star">* </span>配置规则</div>
+       <div class="modal-step2-body modal-step2-body-fixed common-scroll">
+         <div v-show="ruleObj.targetName=='完整性'" class="common-form-detail-text">
+          不能是字符串null、NULL、无、空格,不能是空
+         </div>
+         <div v-show="ruleObj.targetName=='一致性'" class="common-form-detail-text">
+          <div class="common-form-detail-row">数据处理前字段值 = 数据处理后字段</div>
+          <div class="common-form-detail-row">数据类型为 {{ruleObj.dataType == 'all' ? '任意': ruleObj.dataType}}</div>
+         </div>
+         <div v-show="ruleObj.targetName=='及时性(数据采集)' || ruleObj.targetName=='及时性(数据入库)'" class="common-form-detail-text">
+           <Row class="common-form-detail-row">
+            <Col span="3">{{ruleObj.targetName=='及时性(数据采集)' ? '数据采集' : '数据入库'}}</Col>
+            <Col span="1" class="timeliness-form-col timeliness-form-col-select">
+              <=
+            </Col>
+            <Col span="20" class="timeliness-form-col"> 
+            {{ruleObj.dataValue}}
+            </Col>
+          </Row>
+         </div>
+         <div v-show="ruleObj.targetName=='准确性'" class="common-form-detail-text"> 
+          <Row v-for="(item, index) in accuracyArr" :key="index" class="common-form-detail-row">
+            <Col span="4">条件{{index+1}}:</Col>
+            <Col span="3">{{item.fieldName}}</Col>
+            <Col span="4" class="timeliness-form-col timeliness-form-col-select">
+              {{item.logical}}
+            </Col>
+            <Col span="13" class="timeliness-form-col">
+            {{item.reation}}
+            </Col>
+          </Row>
+          <Row v-if="accuracyArr.length>1" class="common-form-detail-row">
+            <Col span="7">各条件间关系表达式:</Col>
+            <Col span="17">
+              fffffff
+            </Col>
+          </Row>
+         </div>
+       </div>
+    </Col>
+  </Row>
+</template>
+<script>
+export default {
+  name: "RuleStepFour",
+  components:{
+  },
+  props: {
+    currentObj: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      ruleObj: {},
+      accuracyArr: [{fieldName: 'lat',logical:'<',reation: '10'},{fieldName: 'lat',logical:'>',reation: '0'}]
+    };
+  },
+  watch: {
+    currentObj: {
+     handler(newValue) {
+      this.ruleObj = newValue
+      console.log('RuleStepFour',newValue)
+      },
+      // deep: true
+    }
+   },
+  mounted() {
+    this.ruleObj = this.currentObj
+     console.log('RuleStepFourmounted',this.ruleObj)
+  },
+  methods: {
+   
+  }
+};
+</script>
+<style scoped lang="stylus">
+.modal-step2-title {
+  height: 42px;
+  background: #0B2959;
+  border: 1px solid #0D2853;
+  line-height: 42px;  
+  color: #fff; 
+  font-size: 16px;
+}
+.modal-step2-star {
+  color: #ed4014;
+  padding-left: 6px;
+}
+.modal-step2-body {
+ padding: 15px;
+ border: 1px solid #204A8F;
+ border-top: none;
+}
+.modal-step2-body-fixed {
+  height: 290px;
+  overflow: hidden;
+  overflow-y: auto;
+}
+.common-form-detail-text {
+  color: #fff;
+  font-size: 14PX;
+}
+.common-form-detail-row {
+  margin-bottom: 20px;
+  line-height: 32px;
+  height: 32px;
+  padding: 0;
+  padding-left: 20px;
+}
+</style> 

+ 286 - 36
src/views/homecomponents/DataManagement/QualityRules/RuleStepThree.vue

@@ -4,7 +4,7 @@
       <div>计算方式通过多个条件(运算符)和逻辑符组合表达,符号代表含义如下所示:</div>
       <div> 
         <p>1.运算符:等于“=”、不等于“!=”、大于“>”、大于等于“>=”、小于“<”、小于等于“<=”、大于等于且小于等于“[ ]”、大于等于且小于“[ )”、大于且小于等于“( ]”、大于且小于“( )”;</p>
-        <p>2.逻辑符:且“&”、或“|”,例:&{条件1;条件2} 表示满足条件1且满足条件2;| {条件1;条件2}表示满足条件1或条件2;</p>
+        <p>2.逻辑符:且“&&”、或“||”,例:条件1&&条件2 表示满足条件1且满足条件2;| 条件1||条件2表示满足条件1或条件2;</p>
         <p>3.所有的符号必须是英文符号。</p>
     </div>
     </div>
@@ -14,40 +14,94 @@
         <div class="modal-rule-top">
           <div>已选择:</div>
           <div class="modal-rule-top-item">
-            字段:{{ruleObj.fieldName}}
+            字段:{{ruleObj.field}}
           </div>
           <div class="modal-rule-top-item">
-            指标类型:{{ruleObj.businessTypeName}}
+            指标类型:{{ruleObj.targetName}}
           </div>
         </div>
         <div class="add-rule">
-          <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;padding-right: 10px" @click="handleAdd(ruleObj.businessTypeName)"></i>点击"+"以添加运算条件
+          <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;padding-right: 10px" @click="handleAdd(ruleObj.targetName)"></i>点击"+"以添加运算条件
         </div>
-        <div class="rule integrity-rule" v-show="ruleObj.businessTypeName=='完整性'">
-          {{inText}} <i v-show="inText" class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px" @click="removeIntegrity"></i>
+        <div class="rule integrity-rule" v-show="ruleObj.targetName=='完整性'">
+          <div v-show="showIntegrity">
+            {{inText}} 
+            <!-- <i v-show="inText" class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px" @click="removeIntegrity"></i> -->
+          </div>
         </div>      
-        <div class="rule uniformity-rule" v-show="ruleObj.businessTypeName=='一致性'">
-          <div v-show="showUniformity1">数据处理前字段值 = 数据处理后字段值<i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px" @click="removeUniformity(1)"></i></div>
-          <div class="uniformity-rule-mode" v-show="showUniformity2">数据类型为
-            <Select v-model="dataType" placeholder="指标类型" style="width: 166px">
+        <div class="rule uniformity-rule" v-show="ruleObj.targetName=='一致性'">
+          <div v-show="showUniformity1">数据处理前字段值 = 数据处理后字段值
+            <!-- <i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px" @click="removeUniformity(1)"></i> -->
+          </div>
+          <div class="uniformity-rule-mode" v-show="showUniformity2">
+            数据类型为&nbsp;
+            <Select v-model="ruleObj.dataType" placeholder="数据类型" style="width: 166px">
               <Option v-for="item in dataTypeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
             </Select>
-            <i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px" @click="removeUniformity(2)"></i>
+            <!-- <i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px" @click="removeUniformity(2)"></i> -->
           </div>
         </div>
-        <div class="rule integrity-rule" v-show="ruleObj.businessTypeName=='及时性'">
-          <p class="operating" >输入字段对应条件值</p >
-          <div v-for="(item,index) in timelinArry" :key="index">
-            <span class="fieldshow" >
-              <span >{{ item.indexMode + item.name + ':' + item.pretfield }} 
-                <span class="fuhao" v-text="fuhao"></span> 
-                <span>
-                  <span v-if="item.numShow" class="tebie" >{{item.value}}</span>
-                  <span class="tebie" v-else v-text="tebie"></span>
-                </span>
-              </span>
-            </span>
-          </div>
+        <div class="rule timeliness-rule" v-show="ruleObj.targetName=='及时性(数据采集)'">
+          <Form ref="formDynamicTime1" :model="formCustom" :label-width="0" class="timeliness-form" v-show="showTimeliness1">
+            <Row v-for="(item, index) in formCustom.timelinArry1" :key="index">
+              <!-- <Col span="1">{{item.indexMode}}</Col> -->
+              <Col span="2">数据采集</Col>
+              <Col span="1">{{item.logical}}</Col>
+              <Col span="4" class="timeliness-form-col">
+                <FormItem :prop="'timelinArry1.'+index+'.dataValue'" :rules="{required: true,message: '请输入判断条件',trigger: 'blur'}">
+                  <Input placeholder="判断条件" clearable v-model="item.dataValue" />
+                </FormItem>
+              </Col>
+              <!-- <Col span="2"><i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px"  @click="removeTimeliness(index)"></i></Col> -->
+            </Row>
+          </Form>
+        </div>
+        <div class="rule timeliness-rule" v-show="ruleObj.targetName=='及时性(数据入库)'">
+          <Form ref="formDynamicTime2" :model="formCustom" :label-width="0" class="timeliness-form" v-show="showTimeliness2">
+            <Row v-for="(item, index) in formCustom.timelinArry2" :key="index">
+              <!-- <Col span="1">{{item.indexMode}}</Col> -->
+              <Col span="2">数据入库</Col>
+              <Col span="1">{{item.logical}}</Col>
+              <Col span="4" class="timeliness-form-col">
+                <FormItem :prop="'timelinArry2.'+index+'.dataValue'" :rules="{required: true,message: '请输入判断条件',trigger: 'blur'}">
+                  <Input placeholder="判断条件" clearable v-model="item.dataValue" />
+                </FormItem>
+              </Col>
+              <!-- <Col span="2"><i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px"  @click="removeTimeliness(index)"></i></Col> -->
+            </Row>
+          </Form>
+        </div>
+        <div class="rule timeliness-rule common-scroll" v-show="ruleObj.targetName=='准确性'">
+          <Form ref="formDynamic" :model="formCustomAcc" :label-width="0" class="timeliness-form" v-show="showAccuracy">
+            <Row v-for="(item, index) in formCustomAcc.accuracyArr" :key="index">
+              <Col span="1">条件{{index+1}}</Col>
+              <Col span="3">{{ruleObj.field}}</Col>
+              <Col span="4" class="timeliness-form-col timeliness-form-col-select">
+                <FormItem :prop="'accuracyArr.' + index + '.logical'" :rules="{required: clickbtn==1 ? true: false,message: '请选择逻辑关系',trigger: 'change',}">
+                  <Select v-model="item.logical" style="width: 100%" placeholder="逻辑关系" ref="logical" transfer>
+                    <Option v-for="item in symbloList" :value="item.value" :key="item.value">{{ item.label }}</Option>
+                  </Select>
+                </FormItem>
+              </Col>
+              <Col span="4" class="timeliness-form-col">
+                <FormItem :prop="'accuracyArr.'+index+'.value'" :rules="{required: clickbtn==1 ? true: false,message: '请输入判断条件',trigger: 'blur'}">
+                  <Input placeholder="判断条件" clearable v-model="item.value" />
+                </FormItem>
+              </Col>
+              <Col span="2">
+                <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;;padding-left:10px" @click="handleAddAcc('formDynamic')"></i>
+                <i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px"  @click="removeAccliness(index)"></i>
+              </Col>
+            </Row>
+            <Row v-if="formCustomAcc.accuracyArr && formCustomAcc.accuracyArr.length>1">
+              <Col span="3">各条件间关系表达式</Col>
+              <Col span="21">
+               <FormItem prop="exprDesc" :rules="{required: clickdel ? true: false,message: '请输入各条件间关系表达式',trigger: 'blur'}">
+                 <Input placeholder="条件1&&条件2" clearable v-model="formCustomAcc.exprDesc" />
+                </FormItem>    
+             </Col>
+            </Row>
+          </Form>       
         </div>
       </div>
     </div>
@@ -69,50 +123,214 @@ export default {
   data() {
     return {
       ruleObj: {},
+      defaulTtimelinArry:[
+        { indexMode: '条件1',name: '数据采集',logical: '<='},
+        { indexMode: '条件2',name: '数据入库',logical: '<='},
+      ],
+      formCustom: {
+        timelinArry1: [
+          {name: '数据采集',logical: '<=',dataValue:''},
+        ],
+        timelinArry2:[
+          {name: '数据入库',logical: '<=',dataValue:''}
+        ],
+      },
       inText: '',
-      dataTypeList: [{label:"任意",value:'任意'}, {label:"byte",value:'byte'}],
-      dataType: '',
-      UniformityData: [0,1],
+      dataTypeList: [{label:'任意',value:'all'},{label:'short',value:'short'},{label:'int',value:'int'},{label:'long',value:'long'},{label:'float',value:'float'},{label:'double',value:'double'},{label:'char',value:'char'},{label:'boolean',value:'boolean'},{label:'BigDecimal',value:'BigDecimal'},{label:'String',value:'String'}],
+      // dataType: 'all',
+      showIntegrity: false,
       // UniformityIndex: 0,
       showUniformity1: false,
       showUniformity2: false,
-      timelinArry: [
-        { indexMode: '条件1',name: '数据采集', pretfield: 111, value: '', numShow: false, },
-        { indexMode: '条件2',name: '数据入库', pretfield: 222, value: '', numShow: false, },
+      showTimeliness1: false,
+      showTimeliness2: false,
+      showAccuracy: false,
+      symbloList: [
+        { value: '=', label: '=' },
+        { value: '!=', label: '!=' },
+        { value: '>', label: '>' },
+        { value: '<', label: '<' },
+        { value: '>=', label: '>=' },
+        { value: '<=', label: '<=' },
+        { value: '[,]', label: '[,]' },
+        { value: '[,)', label: '[,)' },
+        { value: '(,]', label: '(,]' },
+        { value: '(,)', label: '(,)' }
       ],
+      formCustomAcc: {
+        accuracyArr: [{
+          logical: '',value:''
+        }],
+        exprDesc:''
+      },
+      clickbtn: 1, // 1新增 2删除 
+      clickdel: false,
     };
   },
   watch: {
     currentObj: {
      handler(newValue) {
-       console.log(newValue)
+      //  console.log(newValue)
        this.ruleObj = newValue
+       console.log(this.ruleObj.dataType)
+       this.showRule()
       },
       // deep: true
     }
    },
   mounted() {
     this.ruleObj = this.currentObj
-    console.log(this.ruleObj)
+    this.formCustom.timelinArry1 = [{name: '数据采集',logical: '<=',dataValue:this.ruleObj.dataValue}]
+    this.formCustom.timelinArry2 = [{name: '数据入库',logical: '<=',dataValue:this.ruleObj.dataValue}]
+    this.formCustomAcc.accuracyArr = this.ruleObj.logicalValueDTOList
+    this.formCustomAcc.exprDesc = this.ruleObj.exprDesc
+    this.showRule()
   },
   methods: {
-    handleAdd (indexTypeName) {
-      if (indexTypeName == '完整性') {
+    showRule () {
+     if (this.ruleObj.targetName == '完整性') {
+       this.inText = '不能是字符串null、NULL、无、空格,不能是空'
+        this.showIntegrity = true
+      } else if (this.ruleObj.targetName == '一致性') {
+        // console.log()
+        // if (this.ruleObj.dataType) {
+        //   this.showUniformity2 = true
+        // }
+        this.showUniformity1 = true
+        this.showUniformity2 = true
+      } else if (this.ruleObj.targetName == '及时性(数据采集)') {
+        this.showTimeliness1 = true
+      } else if (this.ruleObj.targetName == '及时性(数据入库)') {
+        this.showTimeliness2 = true
+      } else if (this.ruleObj.targetName == '准确性') {
+        this.showAccuracy = true
+      }
+    },
+    handleAdd (targetNameName) {
+      this.inText = ''
+      this.showUniformity1 = false
+      this.showUniformity2 = false
+      this.showTimeliness1 = false
+      this.showTimeliness2 = false
+      this.showAccuracy = false
+      if (targetNameName == '完整性') {
        this.inText = '不能是字符串null、NULL、无、空格,不能是空'
-      } else if (indexTypeName == '一致性') {
+       this.showIntegrity = true
+      } else if (targetNameName == '一致性') {
        this.showUniformity1 = true
        this.showUniformity2 = true
+      } else if (this.ruleObj.targetName == '及时性(数据采集)') {
+        // this.formCustom.timelinArry = JSON.parse(JSON.stringify(this.defaulTtimelinArry))
+        this.showTimeliness1 = true
+      } else if (this.ruleObj.targetName == '及时性(数据入库)') {
+        // this.formCustom.timelinArry = JSON.parse(JSON.stringify(this.defaulTtimelinArry))
+        this.showTimeliness2 = true
+      } else if (targetNameName == '准确性') {
+        this.clickbtn = 1
+        this.formCustomAcc.accuracyArr = [{
+          logical: '',value:''
+        }]
+        this.showAccuracy = true
+        console.log(this.showAccuracy)
       }
     },
     removeIntegrity () { 
+      this.showIntegrity = false
     },
+    //删除一致性
    removeUniformity (i) {
      if (i == 1) {
        this.showUniformity1 = false
      } else {
        this.showUniformity2 = false
+       this.ruleObj.dataType = ''
      }
-   }
+   },
+   removeTimeliness (i) {
+    this.formCustom.timelinArry.splice(i,1)
+    if (i == 0) {
+     this.showTimeliness1 = false 
+    } else if (i == 1) {
+      this.showTimeliness2 = false
+    }
+   },
+   handleAddAcc (name) {
+     this.clickdel = false
+     this.clickbtn = 1
+     this.$nextTick(()=> {
+       this.$refs[name].validate((valid) => {
+        if(valid) {
+          this.formCustomAcc.accuracyArr.push({
+            logical: '',
+            value: '',
+          });
+        }
+      })
+     })
+   },
+   // 删除完整性
+   removeAccliness (index) {
+     this.clickbtn = 2
+     this.formCustomAcc.accuracyArr.splice(index,1)
+     if (this.formCustomAcc.accuracyArr.length ==0) {
+       this.showAccuracy = false
+    }
+   },
+   // 当前步骤校验方法
+    saveValid () {
+      if (this.ruleObj.targetName == '完整性') {
+        if (!this.showIntegrity) {
+          this.$Message.info('请配置完整性规则')
+          return false
+        } else {
+         return true
+       }
+      } else if (this.ruleObj.targetName == '一致性') {
+        if (!this.showUniformity1 && !this.showUniformity2) {
+          this.$Message.info('请配置一致性规则')
+          return false
+        } else {
+          return true
+        }
+      } else if (this.ruleObj.targetName == '及时性(数据采集)') {
+        if (!this.showTimeliness1) {
+          this.$Message.info('请配置及时性(数据采集)规则')
+          return false
+          } else {
+            let validType = false
+            this.$refs.formDynamicTime1.validate((valid) => {
+              validType = valid
+            })
+            return validType
+        }
+      } else if (this.ruleObj.targetName == '及时性(数据入库)') {
+        if (!this.showTimeliness2) {
+          this.$Message.info('请配置及时性(数据入库)规则')
+          return false
+          } else {
+            let validType = false
+            this.$refs.formDynamicTime2.validate((valid) => {
+              validType = valid
+            })
+            console.log('入库',validType)
+            return validType
+        }
+      } else if (this.ruleObj.targetName == '准确性') {
+         // 前两行是为了检验准确性
+        this.clickbtn = 1
+        this.clickdel = true
+        if (!this.showAccuracy) {
+          this.$Message.info('请配置准确性规则')
+          return false
+          } else {
+            let validType = false
+            this.$refs.formDynamic.validate((valid) => {
+              validType = valid
+            })
+            return validType
+        }
+      }
+    },
   }
 };
 </script>
@@ -156,6 +374,7 @@ export default {
   border-radius: 4px;
   color: #2b8ee2;
   margin-left: 10px;
+  background: #113a7b;
 }
 .add-rule {
   font-size: 14PX;
@@ -170,4 +389,35 @@ export default {
 .uniformity-rule-mode {
  margin-top: 10px;
 }
+>>> .timeliness-form .ivu-row{
+  display: flex;
+  align-items: center;
+  margin-bottom: 20px;
+  height: 100%;
+  // border: 1px solid red;
+}
+>>> .timeliness-form .ivu-col{
+  height: 100%;
+}
+>>> .timeliness-form .timeliness-form-col {
+  // display: flex;
+  // align-items: center;
+}
+>>> .timeliness-form-col .ivu-form-item{
+  width: 100%;
+  height: 100%;
+  margin-bottom: 0;
+  .ivu-form-item-content {
+    width: 100%;
+    // padding: 10px 5px;
+  }
+}
+.timeliness-form-col-select {
+  padding-right: 10px;
+}
+.common-scroll {
+  max-height: 300px;
+  overflow: hidden;
+  overflow-y: auto;
+}
 </style>

+ 194 - 50
src/views/homecomponents/DataManagement/QualityRules/RuleStepTwo.vue

@@ -4,9 +4,9 @@
       <div class="modal-step2-title"><span class="modal-step2-star">* </span>选择来源应用</div>
       <div class="modal-step2-body">
           <Select v-model="businessParams.businessTypeId" placeholder="业务类型" @on-change="selectBusinessType">
-            <Option v-for="item in businessData" :value="item.id" :key="item.id">{{ item.businessTypeName }}</Option>
+            <Option v-for="item in businessModalData" :value="item.id" :key="item.id">{{ item.businessTypeName }}</Option>
           </Select>
-        <Table ref="tableSource1" :columns="columnsAppModal" :data="appModalData" class="common-table modal-table modal-table1 modal-table-first" no-data-text="" :row-class-name="rowClassName" :show-header="false" highlight-row @on-row-click="rowClick1">
+        <Table :class="{'modal-no-table': appModalData.length == 0}" ref="tableSource1" :columns="columnsAppModal" :data="appModalData" class="common-table modal-table modal-table1 modal-table-first" no-data-text="暂无数据" :row-class-name="rowClassName" :show-header="false" highlight-row @on-row-click="rowClick1">
         </Table>
       </div>
     </Col>
@@ -15,9 +15,9 @@
     </Col>
     <Col :span="7">
     <div class="modal-step2-title"><span class="modal-step2-star">* </span>字段类型</div>
-      <div class="modal-step2-body" :class="{'modal-step2-body-else': equipModalData.length<=0}">
-        <div v-if="equipModalData.length<=0" class="modal-step2-body-nodata" @click="selectEquip" :class="{'modal-no-data-status': showClickTable2}">展示全部字段</div>
-        <Table ref="tableSource2" v-else :columns="columnsEquipModal" :data="equipModalData" class="common-table modal-table modal-table2" no-data-text="" :row-class-name="rowClassName" :show-header="false" highlight-row @on-row-click="rowClick2"></Table>
+      <div class="modal-step2-body" :class="{'modal-step2-body-else': codeModalData.length<=0}">
+        <!-- <div v-show="appModalData.length>0 && codeModalData.length<=0" class="modal-step2-body-nodata" @click="selectCode" :class="{'modal-no-data-status': showClickTable2}">展示全部字段</div> -->
+        <Table ref="tableSource2" v-show="codeModalData.length>0" :columns="columnsCodeModal" :data="codeModalData" class="common-table modal-table modal-table2" no-data-text="" :row-class-name="rowClassName" :show-header="false" highlight-row @on-row-click="rowClick2"></Table>
       </div>
     </Col>
     <Col :span="1" class-name="triangle-right-wrap">
@@ -26,8 +26,7 @@
     <Col :span="7">
     <div class="modal-step2-title"><span class="modal-step2-star">* </span>选择字段</div>
       <div class="modal-step2-body" :class="{'modal-step2-body-else': fieldModalData.length<=0}">
-         <!-- <Radio v-model="row.operationId"></Radio>{{row.operationUser}} -->
-        <Table ref="tableSource3" :columns="columnsAppModal" :data="fieldModalData" class="common-table modal-table modal-table3" no-data-text="" :row-class-name="rowClassName" :show-header="false" highlight-row @on-row-click="rowClick3"></Table>
+        <Table ref="tableSource3" :columns="columnsFieldModal" :data="fieldModalData" class="common-table modal-table modal-table3" no-data-text="" :row-class-name="rowClassName" :show-header="false" highlight-row @on-row-click="rowClick3"></Table>
       </div>
     </Col>
   </Row>
@@ -38,12 +37,21 @@ export default {
   components:{
   },
   props: {
-    businessData: {
+    businessModalData: {
       type: Array,
       default: () => {
         return [];
       },
-    }
+    },
+    modalTitle: { 
+      type:[String],
+    },
+    currentObj: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
   },
   data() {
     return {
@@ -55,13 +63,10 @@ export default {
         pageNum: 1,
         pageSize: 9999
       },
-      appParams: {
-        applicationId: '',
-        equipmentTypeId: '',
-        keywords: '',
-        pageNum: 1,
-        pageSize: 9999
-      },
+      applicationId: '',
+      equipmentTypeCode: '',
+      fieldCode: '',
+      // highlightIndex:1,
       appModalData: [],
       columnsAppModal: [
         {
@@ -86,11 +91,20 @@ export default {
             tooltip: true
           },
       ],
-      equipModalData: [],
-      columnsEquipModal:[
+      codeModalData: [],
+      columnsCodeModal:[
+        {
+          title: '字段类型',
+          key: 'equipmentTypeCode',
+          align: 'left',
+          ellipsis: true,
+          tooltip: true
+        },
+      ],
+      columnsFieldModal:[
         {
-          title: '设备类型',
-          key: 'equipmentName',
+          title: '字段类型',
+          key: 'fieldCode',
           align: 'left',
           ellipsis: true,
           tooltip: true
@@ -100,7 +114,17 @@ export default {
       showClickTable2: false
     };
   },
+  watch: {
+    currentObj: {
+     handler(newValue) {
+       this.businessParams.businessTypeId = newValue.businessTypeId
+       this.getAppList()
+      },
+      // deep: true
+    }
+   },
   mounted() {
+    this.businessParams.businessTypeId = this.currentObj.businessTypeId
     this.getAppList()
   },
   methods: {
@@ -112,49 +136,161 @@ export default {
       }
     },
     // 根据业务类型获取应用
-   getAppList () {
-     this.$get('metroapi/application/info/list', this.businessParams).then(res=>{
+   getAppList (status) {
+    let params = JSON.parse(JSON.stringify(this.businessParams))
+    params.businessTypeId= params.businessTypeId == '-1' ?'': params.businessTypeId
+     this.$get('metroapi/application/info/list', params).then(res=>{
         if (res.httpCode == 1 ){
-          this.appModalData = res.data.data   
+          this.appModalData = res.data.data
+          if (status == 'changeState') { //当status等于changeState时(选择业务类型清空表格数据及选中效果)
+            this.$refs.tableSource1.clearCurrentRow()
+            this.$refs.tableSource2.clearCurrentRow()
+            this.showClickTable2 = false
+          } else {
+            this.appModalData.forEach((item,index)=> {
+              this.appModalData[index]._highlight = false
+              if(item.id == this.currentObj.applicationId) {
+                this.appModalData[index]._highlight = true
+                this.applicationId = item.id
+                this.getAddCodeType('edit')
+              }
+            })
+          }
+          // console.log(this.appModalData)
         } else {
           this.appModalData = []
         }
       })
    },
-   // 根据应用获取新增设备类型 
-    getAddEquipType (params) {
-      this.$get('metroapi/application/equipmentTypeInfo', params).then(res=>{
+   // 根据应用获取字段类型 
+    getAddCodeType (status) {
+      this.$get('metroapi/datarule/queryEquTypeByAppId', {applicationId:this.applicationId}).then(res=>{
+        if (res.httpCode == 1 ){
+          this.codeModalData = res.data
+           if (status == 'changeState') { //当status等于changeState时(选择来源应用清空表格数据及选中效果)
+            this.$refs.tableSource2.clearCurrentRow()
+          } else {
+            if (this.codeModalData && this.codeModalData.length>0) {
+              this.codeModalData.forEach((item,index)=> {
+                if(item.equipmentTypeCode == this.currentObj.equipmentTypeCode) {
+                  this.codeModalData[index]._highlight = true
+                  this.equipmentTypeCode = item.equipmentTypeCode
+                  this.getAddField()
+                }
+              })
+            }
+          }
+        } else {
+          this.codeModalData = []
+          this.$refs.tableSource2.clearCurrentRow()
+          if (status == 'edit') {
+            this.codeModalData = [{equipmentTypeCode: '展示全部字段'}]
+            this.codeModalData[0]._highlight = true
+            this.equipmentTypeCode = '展示全部字段'
+            this.getAddField()
+          }
+          if(status == 'clickTable1') {
+            this.codeModalData = [{equipmentTypeCode: '展示全部字段'}]
+            this.codeModalData[0]._highlight = false
+          }
+        }
+      })
+    },
+    // 根据字段类型选择字段 
+     getAddField (status) {
+      let equipmentTypeCode = this.equipmentTypeCode== '展示全部字段' ? '': this.equipmentTypeCode
+      this.$get('metroapi/datarule/queryFieldByEquTypeCode', {applicationId:this.applicationId,equipmentTypeCode:equipmentTypeCode}).then(res=>{
         if (res.httpCode == 1 ){
-          this.equipModalData = res.data.data
+          this.fieldModalData = res.data
+           if (status == 'changeState') { //当status等于changeState时(选择字段类型清空选择字段表格数据及选中效果)
+            this.$refs.tableSource3.clearCurrentRow()
+          } else {
+            this.$refs.tableSource3.clearCurrentRow()
+            if (this.fieldModalData && this.fieldModalData.length>0) {
+              this.fieldModalData.forEach((item,index)=> {
+                if(item.fieldCode == this.currentObj.field) {
+                  this.fieldModalData[index]._highlight = true
+                  this.fieldCode = item.fieldCode
+                }
+              })
+            }
+          }
         } else {
-          this.equipModalData = []
+          this.fieldModalData = []
         }
       })
     },
    selectBusinessType (value) {
-     this.businessParams.businessTypeId = value == '-1' ? '' : value
-     this.getAppList()
-     console.log(option)
+     this.businessParams.businessTypeId = value
+     this.getAppList('changeState')
+     this.codeModalData = []
+     this.fieldModalData = []
     },
     rowClick1 (currentRow,index) {
-      this.appParams.applicationId = currentRow.id
-    //   this.index = index
-      this.getAddEquipType(this.appParams)
-      this.$emit('selectTableChange',this.appParams.applicationId)
+      this.codeModalData = []
+      this.$refs.tableSource2.clearCurrentRow()
+      this.fieldModalData = []
+      this.$refs.tableSource3.clearCurrentRow()
+      this.applicationId = currentRow.id
+      this.equipmentTypeCode = ''
+      this.fieldCode = ''
+      this.getAddCodeType('clickTable1')
+      let obj = {
+        id: currentRow.id,
+        applicationName: currentRow.appName,
+        text: 'applicationId'
+      }
+      this.$emit('selectTableChange',obj)
     },
     rowClick2 (currentRow,index) {
+      this.fieldModalData = []
+      this.$refs.tableSource3.clearCurrentRow()
+      this.equipmentTypeCode = currentRow.equipmentTypeCode
+      this.fieldCode = ''
+      this.getAddField('changeState')
+      let obj = {
+        id: currentRow.equipmentTypeCode,
+        text: 'equipmentTypeCode'
+      }
+      this.$emit('selectTableChange',obj)
     },
     rowClick3 (currentRow,index) {
+      this.fieldCode = currentRow.fieldCode
+      let obj = {
+        id: currentRow.fieldCode,
+        text: 'fieldCode'
+      }
+      this.$emit('selectTableChange',obj)
     },
-    selectEquip () {
+    selectCode () {
+      this.getAddField()
+      this.fieldModalData = []
+      this.$refs.tableSource3.clearCurrentRow()
+      let obj = {
+        id: 0,
+        text: 'equipmentTypeCode'
+      }
      this.showClickTable2 = true
+     this.$emit('selectTableChange',obj)
     },
     // 当前步骤校验方法
     saveValid () {
-      if (!this.appParams.applicationId) {
+      console.log(this.equipmentTypeCode)
+      // console.log(this.fieldModalData)
+      console.log(this.fieldModalData.length>0)
+      console.log(!this.fieldCode)
+      // console.log(this.currentObj.equipmentTypeCode)
+      if (!this.applicationId) {
         this.$Message.info('请选择来源应用')
         return false
-      } else {
+      } else if (!this.equipmentTypeCode){
+        this.$Message.info('请选择字段类型')
+        return false
+      } else if (this.fieldCode == ''){
+        this.$Message.info('请选择字段')
+        return false
+      } 
+      else {
         return true
       }
     }
@@ -178,6 +314,8 @@ export default {
  padding: 15px;
  border: 1px solid #204A8F;
  border-top: none;
+ height: 432PX;
+ overflow: hidden;
 }
 .modal-step2-body-else {
   height: 432PX;
@@ -185,8 +323,11 @@ export default {
 .modal-table-first {
   margin-top: 10px;
 }
+>>> .modal-no-table {
+  height: 360PX;
+} 
 >>> .modal-table .ivu-table-body {
-    height: 360PX;
+    height: 346PX;
     overflow: hidden;
     overflow-y: auto;
     table {
@@ -204,17 +345,20 @@ export default {
 >>> .ivu-table-row-highlight td, >>> .ivu-table-stripe .ivu-table-body tr.ivu-table-row-highlight:nth-child(2n) td, >>> .ivu-table-stripe .ivu-table-fixed-body tr.ivu-table-row-highlight:nth-child(2n) td, >>> tr.ivu-table-row-highlight.ivu-table-row-hover td {
  background-color:#0185EA;
 }
-.modal-step2-body-nodata {
-  background-color: #081C43;
-  height: 36px;
-  line-height: 36px;
-  padding-left: 10px;
-  color: #FFFFFF;
-  font-size: 14PX;
-}
-.modal-no-data-status {
-  background-color: #0185EA;
-}
+// >>> .modal-table .ivu-table-tip {
+//    height: 360PX;
+//  }
+// .modal-step2-body-nodata {
+//   background-color: #081C43;
+//   height: 36px;
+//   line-height: 36px;
+//   padding-left: 10px;
+//   color: #FFFFFF;
+//   font-size: 14PX;
+// }
+// .modal-no-data-status {
+//   background-color: #0185EA;
+// }
 .triangle-right-wrap {
   display: flex;
   justify-content: center;

+ 0 - 1
src/views/homecomponents/Nav.vue

@@ -121,7 +121,6 @@ export default {
   font-size: 16px;
 }
 >>> .ivu-menu .menuli{
-   height: 55px;
 }
 >>> .ivu-menu .ivu-menu-item {
   font-size: 16px;

+ 1 - 1
vue.config.js

@@ -7,7 +7,7 @@ module.exports = {
       open: false,//配置自动启动浏览器 
       proxy: { // 设置代理
       '/metroapi': {
-        target: 'http://192.168.20.58:8088',// http://192.168.20.58:8086 http://192.168.20.188:8088
+        target: 'http://192.168.20.188:8088',// http://192.168.20.58:8086 http://192.168.20.188:8088
         changeOrigin: true, //允许跨域
         pathRewrite: {
             '^/metroapi': ''