南昌市物联网技防平台-前端
shuishen
2021-04-08 a4e06ccd3cd976fbe4eef99e188d42ec9f3ad054
src/views/healthcode/healthcode.vue
@@ -8,6 +8,8 @@
               :before-open="beforeOpen"
               v-model="form"
               ref="crud"
               :row-style="rowStyle"
               :search.sync="search"
               @row-update="rowUpdate"
               @row-save="rowSave"
               @row-del="rowDel"
@@ -38,7 +40,7 @@
            >本月
          </el-button>
        </template>
    </avue-crud>
  </basic-container>
</template>
@@ -52,6 +54,7 @@
      return {
        form: {},
        query: {},
        search:{},
        loading: true,
        page: {
          pageSize: 10,
@@ -63,11 +66,12 @@
          menu:false,
          height:'auto',
          calcHeight: 30,
          border: false,
          stripe:true,
          tip: false,
          searchShow: true,
          searchMenuSpan: 6,
          activeClass: 3,
          border: true,
          activeClass: 0,
          index: true,
          viewBtn: true,
          selection: true,
@@ -159,9 +163,10 @@
            {
              label: "健康码颜色",
              search: true,
              searchLabelWidth:100,
              searchLabelWidth:120,
              prop: "type",
              searchSpan: 3,
              searchSpan: 4,
              searchValue: this.getHealthcodeType(),
              width:210,
              type: "select",
              dicData: [
@@ -181,8 +186,13 @@
            }
          ]
        },
        data: []
        data: [],
        isActive: false,
        recorder: null,
      };
    },
    mounted:{
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -202,7 +212,6 @@
        return ids.join(",");
      }
    },
    methods: {
      beforeOpen(done, type) {
      },
@@ -232,8 +241,23 @@
      refreshChange() {
        this.onLoad(this.page, this.query);
      },
      rowStyle({row, column, rowIndex}){
         if(row.type=="3"){
           return {
             color:"#fe1515"
           }
         }
      },
      getHealthcodeType(){
          if (this.$route.query.type != undefined) {
              var type = this.$route.query.type+"";
              this.$route.query = {};
              return type;
          }
      },
      getHealthcodeData(e) {
        this.activeClass = e;
        var that = this;
        that.activeClass = e;
        //status 0:本日  1:本月  2:本年   type: 1:绿色   2:黄色  3:红色
        var params = {
          status: e
@@ -248,8 +272,8 @@
          ...params,
        };
        if (this.$route.query.status && this.$route.query != undefined && this.$route.query != null && this.$route.query != "" ) {
            if (this.$route.query.type != undefined && this.$route.query.type != null && this.$route.query.type != "" ) {
        if (this.$route.query.status!=undefined && this.$route.query != undefined && this.$route.query != null && this.$route.query != "" ) {
            if (this.$route.query.type != undefined) {
              this.activeClass = this.$route.query.status;
              this.page.currentPage = 1;
              params = {
@@ -263,10 +287,10 @@
                type:this.$route.query.status
              };
            }
        }else if(this.$route.query.type != undefined && this.$route.query.type != null && this.$route.query.type != "" ){
        }else if(this.$route.query.type != undefined){
          params = {
            type: this.$route.query.type,
            beginTime: this.$route.query.startTime,
            begTime: this.$route.query.startTime,
            endTime: this.$route.query.endTime
          }
        }else{
@@ -274,6 +298,7 @@
                status:this.$route.query.status,
                type:this.$route.query.type
            }
        }
        if (dateTime) {
@@ -303,3 +328,10 @@
    }
  };
</script>
<style scoped>
  .el-button.btn-color {
    color: rgb(255, 255, 255);
    background-color: rgb(64, 158, 255);
    border-color: rgb(64, 158, 255);
  }
</style>