浏览代码

mfmea新版特性自动标记前端代码提交

张少一 1 周之前
父节点
当前提交
dff7fbd7b7

+ 8 - 0
src/locales/lang/en-US/functionalAnalysis/topModal.js

@@ -76,6 +76,14 @@ export default {
   'functional-analysis.top-modal.current-default': 'Current Default',
   'functional-analysis.top-modal.disabled': 'Disabled',
   'functional-analysis.top-modal.enable': 'Enable',
+  'functional-analysis.top-modal.whether-enable-automatic-marking': 'Whether to enable automatic marking',
+  'functional-analysis.top-modal.yes': 'Yes',
+  'functional-analysis.top-modal.no': 'No',
+  'functional-analysis.top-modal.confirm': 'Confirm',
+  'functional-analysis.top-modal.cancel': 'Cancel',
+  'functional-analysis.top-modal.S-scope': 'S scope',
+  'functional-analysis.top-modal.O-scope': 'O scope',
+  'functional-analysis.top-modal.D-scope': 'D scope',
   'functional-analysis.top-modal.manual tagging': 'Manual Tagging',
   'functional-analysis.top-modal.automatic tagging': 'Automatic Tagging',
   'functional-analysis.top-modal.S start': 'S start',

+ 8 - 0
src/locales/lang/zh-CN/functionalAnalysis/topModal.js

@@ -76,6 +76,14 @@ export default {
   'functional-analysis.top-modal.current-default': '当前默认',
   'functional-analysis.top-modal.disabled': '禁用',
   'functional-analysis.top-modal.enable': '启动',
+  'functional-analysis.top-modal.whether-enable-automatic-marking': '是否开启自动标记',
+  'functional-analysis.top-modal.yes': '是',
+  'functional-analysis.top-modal.no': '否',
+  'functional-analysis.top-modal.confirm': '确定',
+  'functional-analysis.top-modal.cancel': '取消',
+  'functional-analysis.top-modal.S-scope': 'S范围',
+  'functional-analysis.top-modal.O-scope': 'O范围',
+  'functional-analysis.top-modal.D-scope': 'D范围',
   'functional-analysis.top-modal.manual tagging': '手动标记',
   'functional-analysis.top-modal.automatic tagging': '自动标记',
   'functional-analysis.top-modal.S start': '根节点失效有严重度(S)评分 最大值',

+ 8 - 0
src/locales/lang/zh-TW/functionalAnalysis/topModal.js

@@ -76,6 +76,14 @@ export default {
   'functional-analysis.top-modal.current-default': '當前預設',
   'functional-analysis.top-modal.disabled': '禁用',
   'functional-analysis.top-modal.enable': '啟動',
+  'functional-analysis.top-modal.whether-enable-automatic-marking': '是否開啟自動標記',
+  'functional-analysis.top-modal.yes': '是',
+  'functional-analysis.top-modal.no': '否',
+  'functional-analysis.top-modal.confirm': '確定',
+  'functional-analysis.top-modal.cancel': '取消',
+  'functional-analysis.top-modal.S-scope': 'S範圍',
+  'functional-analysis.top-modal.O-scope': 'O範圍',
+  'functional-analysis.top-modal.D-scope': 'D範圍',
   'functional-analysis.top-modal.manual tagging': '手動標記',
   'functional-analysis.top-modal.automatic tagging': '自動標記',
   'functional-analysis.top-modal.S start': '根節點失效有嚴重度(S)評分 最大值',

+ 92 - 74
src/views/fmeaTree/components/TopBtnModal/configuration/PropertyTagged.vue

@@ -1,13 +1,14 @@
 <template v-if="show">
 
   <div>
+    <a-spin :spinning="loading">
     <a-form layout="vertical" class="form">
       <a-row :gutter="24">
         <a-col :xl="24" :lg="24" :md="12" :sm="24" :xs="24">
-          <a-form-item class="formItem">
-            <a-radio-group v-model="flag.status" class="checkBoxGroup" @change="deleteRdfm" :disabled="!$api.btnPms">
-              <a-radio value="0">{{ $t('functional-analysis.top-modal.manual tagging') }}</a-radio>
-              <a-radio class="radio" value="1">{{ $t('functional-analysis.top-modal.automatic tagging') }}</a-radio>
+          <a-form-item class="formItem" :label="$t('functional-analysis.top-modal.whether-enable-automatic-marking')">
+            <a-radio-group v-model="flag.status" class="checkBoxGroup" :disabled="!$api.btnPms">
+              <a-radio class="radio" value="1">{{ $t('functional-analysis.top-modal.yes') }}</a-radio>
+              <a-radio value="0">{{ $t('functional-analysis.top-modal.no') }}</a-radio>
             </a-radio-group>
           </a-form-item>
         </a-col>
@@ -23,57 +24,42 @@
           :dataSource="tableData"
           :scroll="{ y: 'calc(88vh - 400px)' }"
           :pagination="false">
-
-        <!--        <template v-slot:picFlag='text, record'>-->
-        <!--          <span v-if="record.classifyType === '2'">{{ record.lexplain }}</span>-->
-        <!--          <img width='25' height='25' v-else :src=" this.$api.baseUrl + '/DFMEA/file/' + record.fileName" />-->
-        <!--        </template>-->
-        <!--       操作-->
-        <template v-slot:action='text, record'>
-          <a
-              href="javascript:;"
-              @click="update(record)"
-              :disabled="!$api.btnPms"
-              class="operate-btn"
-          >
-            <a-tooltip :title="$t('functional-analysis.top-modal.update')">
-              <i class="iconfont iconicon-bainji"></i>
-            </a-tooltip>
-          </a>
-
-        </template>
       </a-table>
       <div class="mt10 text-right">
         <a-button @click="mark" :disabled="!$api.btnPms">
           {{ $t('functional-analysis.top-modal.flush tagging') }}
         </a-button>
+        <!-- 确定-->
+        <a-button @click="ascertain" class="ml-2" type='primary' :disabled="!$api.btnPms">
+          {{ $t('functional-analysis.top-modal.confirm') }}
+        </a-button>
+        <!-- 取消-->
+        <a-button @click="countermand" class="ml-2">
+          {{ $t('functional-analysis.top-modal.cancel') }}
+        </a-button>
       </div>
     </a-form>
-
-    <EditPropertyTagged :queryParam="modalData" ref="visible"></EditPropertyTagged>
+    </a-spin>
   </div>
 
 </template>
 
 <script>
-import EditPropertyTagged from "@/views/fmeaTree/components/TopBtnModal/components/EditPropertyTagged";
 
 export default {
   inject: ['reload'],
   name: "PropertyTagged",
-  components: {EditPropertyTagged},
   data() {
     return {
       tableData: [],
       loading: false,
       show: true,
       flag: {
+        originalStatus: '',// 是否开启自动标记原始值
         status: ''
       },
       propDetailData: {},
       pductClassifyId: '',
-      //模态窗的值
-      modalData: [],
       // 表头
       tableColumns: [
         {
@@ -113,42 +99,47 @@ export default {
           width: 125,
           ellipsis: true,
         },
+        // s值范围
         {
-          title: () => this.$t('functional-analysis.top-modal.S start'),
-          dataIndex: 'severityMax',
-          width: 125,
+          title: () => this.$t('functional-analysis.top-modal.S-scope'),
+          customRender: (text, row, index) => {
+            if (row.sstart && row.send){
+              return row.sstart + '~' + row.send;
+            } else {
+              return '~';
+            }
+          },
           align: 'center',
-          // ellipsis: true,
-        },
-        {
-          title: () => this.$t('functional-analysis.top-modal.S end'),
-          dataIndex: 'severityMin',
           width: 125,
-          align: 'center',
-          // ellipsis: true,
+          ellipsis: true,
         },
+        // o值范围
         {
-          title: () => this.$t('functional-analysis.top-modal.O start'),
-          dataIndex: 'occurrenceMax',
-          width: 125,
+          title: () => this.$t('functional-analysis.top-modal.O-scope'),
+          customRender: (text, row, index) => {
+            if (row.ostart && row.oend){
+              return row.ostart + '~' + row.oend;
+            } else {
+              return '~';
+            }
+          },
           align: 'center',
-          // ellipsis: true,
-        },
-        {
-          title: () => this.$t('functional-analysis.top-modal.O end'),
-          dataIndex: 'occurrenceMin',
           width: 125,
-          align: 'center',
-          // ellipsis: true,
+          ellipsis: true,
         },
+        // d值范围
         {
-          title: () => this.$t('functional-analysis.top-modal.operate'),
-          // width: 100,
-          align: "center",
-          scopedSlots: {
-            customRender: "action"
+          title: () => this.$t('functional-analysis.top-modal.D-scope'),
+          customRender: (text, row, index) => {
+            if (row.dstart && row.dend){
+              return row.dstart + '~' + row.dend;
+            } else {
+              return '~';
+            }
           },
-          ellipsis: true
+          align: 'center',
+          width: 125,
+          ellipsis: true,
         }
       ],
     }
@@ -170,8 +161,10 @@ export default {
           this.$api.getRPClassifyState(data1).then(res => {
             if (res.flag) {
               this.flag.status = '0';
+              this.flag.originalStatus = '0';
               if (res.data && res.data.state == 1) {
                 this.flag.status = '1';
+                this.flag.originalStatus = '1';
               }
             } else {
               this.$notification.error({message: res.message});
@@ -183,16 +176,42 @@ export default {
               this.loading = false;
             } else {
               this.$notification.error({message: res.message});
+              this.loading = false;
             }
           });
         } else {
           this.$notification.error({message: res.message});
+          this.loading = false;
         }
       });
     },
-    update(record) {
-      this.$refs.visible.showModal = true;
-      this.$refs.visible.queryParam = record;
+    // 特性自动标记弹窗--确定
+    ascertain() {
+      // 判断是否开启自动标记是否更改
+      if (this.flag.status === this.flag.originalStatus) {
+        // 未作任何修改直接关闭弹窗
+        this.countermand();
+      } else {
+        // 开启警示弹窗
+        this.deleteRdfm();
+      }
+    },
+    // 特性自动标记弹窗--取消
+    countermand() {
+      // 数据恢复默认值
+      this.tableData = [];
+      this.loading = false;
+      this.show = true;
+      this.flag = {
+        originalStatus: '',// 是否开启自动标记原始值
+        status: ''
+      };
+      this.propDetailData = {};
+      this.pductClassifyId = '';
+      // 关闭弹窗
+      this.$emit("closeModal");
+      // 初始化右侧树
+      this.initRightTree();
     },
     //改为手动配置删除数据
     deleteRdfm() {
@@ -208,42 +227,36 @@ export default {
         okText: this.$t('global-btn.ok'),
         cancelText: this.$t('global-btn.cancel'),
         onOk() {
+          _that.loading = true;
           _that.$api.deleteRPClassifyState(data).then(res => {
             if (res.flag) {
               _that.confirm();
             } else {
               _that.$notification.error({message: res.message});
+              _that.loading = false;
             }
           });
         },
-        onCancel() {
-          if (_that.flag.status == '0') {
-            _that.flag.status = '1'
-          } else {
-            _that.flag.status = '0'
-          }
-        }
+        onCancel() {}
       });
     },
-    cancel() {
-      this.$refs.visible.showModal = false;
-    },
     closeModal() {
       this.$emit("closeModal");
     },
     //自动标记
     mark() {
+      this.loading = true;
       var data = {
         fmeaId: this.$route.query.rfmeaId
       };
       this.$api.markRPClassifyState(data).then(res => {
         if (res.flag) {
           this.$message.success(res.message, 1);
-          this.$emit("closeModal");
-          // 初始化右侧树
-          this.initRightTree();
+          // 关闭弹窗
+          this.countermand();
         } else {
           this.$notification.error({message: res.message});
+          this.loading = false;
         }
       })
     },
@@ -261,12 +274,12 @@ export default {
       };
       this.$api.saveRPClassifyState(data).then(res => {
         if (res.flag) {
-          this.$message.success(res.message, 1);
+          this.mark();
         } else {
           this.$notification.error({message: res.message});
+          this.loading = false;
         }
       });
-      this.initData();
     }
   },
   mounted() {
@@ -283,5 +296,10 @@ export default {
 .ml10 {
   margin-left: 500px;
 }
-
+/deep/ .ant-table-fixed-header .ant-table-scroll .ant-table-header {
+  overflow: hidden !important;
+  margin-bottom: 0 !important;
+  padding-right: 3px;
+  background: rgb(250, 250, 250);
+}
 </style>