zmc
2023-12-01 5244fdb5f7932f2cbce43f4bfaa9dc06c9dd4c95
src/sfc/ExceptionType.vue
@@ -8,6 +8,7 @@
-->
<script>
import exceptionApi from '@/api/exceptionApi.js'
export default {
  props: {
    // 禁用
@@ -37,7 +38,6 @@
  mounted() {
    this.$watch(() => [this.exception], () => {
      if (this.exception != -1) {
        console.log('异常类型:',this.exception)
        this.checkedList.push(this.exception) 
      }
      
@@ -47,19 +47,23 @@
  methods: {
    // 获取不同的异常名称
    getExceptionType() {
      this.$http.get('/dust/exceptiontype').then((response) => {
        // this.exceptionType = response.data.data
        response.data.data.forEach((item) => {
          this.exceptionType.push(item.exceptionType)
        })
        // console.log('获取到的异常类型:',this.exceptionType);
      // exceptionApi.queryExceptionType().then((response) => {
      //   response.data.data.forEach((item) => {
      //     this.exceptionType.push(item.exceptionType)
      //   })
      //   let a = ['0', '1', '2', '3', '4', '5', '6', '7','8']
      //   a.forEach((item) => {
      //     if (this.exceptionType.indexOf(item) == -1) {
      //       this.exceptionType.push(item)
      //     }
      //   })
      // })
        let a = ['0', '1', '2', '3', '4', '5', '6', '7','8']
        a.forEach((item) => {
          if (this.exceptionType.indexOf(item) == -1) {
            this.exceptionType.push(item)
          }
        })
      })
    },
    handleCheckAllChange(val) {
      this.checkedList = val ? this.exceptionType : []