he wei
2024-01-08 a125df511a766bc5aa608fd9b5fc6bf666bf7011
U 添加批量取消功能
8个文件已修改
333 ■■■■ 已修改文件
src/components/panel.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hrControl/components/card.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hrControl/components/cardBatt.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hrControl/index.vue 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/powerCabinetControl/components/card.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/powerCabinetControl/components/card2.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/powerCabinetControl/index.vue 121 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/powerTestRecord/details.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/panel.vue
@@ -5,6 +5,9 @@
      <div class="tools">
        <slot name="tools"></slot>
      </div>
      <div class="tools-left">
        <slot name="leftTools"></slot>
      </div>
      <!-- 标题 -->
      <div v-if="title" class="title">{{ title }}</div>
      <!-- 内容 -->
@@ -192,6 +195,11 @@
      top: 0;
      right: 0;
    }
    .tools-left {
      position: absolute;
      top: 0;
      left: 0;
    }
  }
}
</style>
src/views/hrControl/components/card.vue
@@ -137,13 +137,13 @@
          // console.log('调用结定接口', this.num, this.option.key1);
          let loading = this.$layer.loading();
          let params = { logList: [] };
          params[this.option.key1] = num;
          params[this.option.key1] = flag ? num : undefined;
          params[this.option.flag] = flag;
          params["battIndex"] = 0;
          params["logList"].push({
            param: this.option.flag,
            paramCn: this.title,
            value: num,
            value: flag ? num : undefined,
            st: flag,
          });
          updateGroup(params)
src/views/hrControl/components/cardBatt.vue
@@ -126,7 +126,7 @@
          let loading = this.$layer.loading();
          let params = { logList: [] };
          let params2 = {};
          params2[this.option.key1] = num;
          params2[this.option.key1] = flag ? num : undefined;
          params2[this.option.flag] = flag;
          params2["battIndex"] = 0;
          const monNum = this.option.monNum;
@@ -135,7 +135,7 @@
          params["logList"].push({
            param: this.option.flag,
            paramCn: this.title,
            value: num,
            value: flag ? num : undefined,
            st: flag,
            monNum,
            battIndex: 0
src/views/hrControl/index.vue
@@ -3,15 +3,26 @@
    <div class="p-content flex-r">
      <div class="p-left flex-c">
        <panel class="panel group" title="遥测量模拟(组端)">
          <div slot="tools" class="btn-grp">
          <div slot="leftTools" class="btn-grp">
            <gradient-btn size="xs" @click="selectAll('checkList1')"
              >全选</gradient-btn
            >
            <gradient-btn size="xs" @click="cancelSelectAll('checkList1')"
              >取消全选</gradient-btn
            >
          </div>
          <div slot="tools" class="btn-grp">
            <gradient-btn
              size="xs"
              :disabled="!checkList1.some((v) => v == true) || !hasPermission"
              @click="batchGroupSet(1)"
              >批量给定</gradient-btn
            >
            <gradient-btn
              size="xs"
              :disabled="!checkList1.some((v) => v == true) || !hasPermission"
              @click="batchGroupSet"
              >批量给定</gradient-btn
              @click="batchGroupSet(0)"
              >批量取消</gradient-btn
            >
          </div>
          <div class="content">
@@ -42,44 +53,95 @@
            </el-radio-group>
          </div>
          <div class="content flex-c">
            <div class="banner btn-grp" v-show="0 == battInfoType">
              <gradient-btn size="xs" @click="selectAll('checkListMon', 0)"
                >全选</gradient-btn
              >
              <gradient-btn
                size="xs"
                :disabled="
                  !checkListMon[0].some((v) => v == true) || !hasPermission
                "
                @click="batchMonSet(0)"
                >批量给定</gradient-btn
              >
            <div class="banner" v-show="0 == battInfoType">
              <div class="btn-grp">
                <gradient-btn size="xs" @click="selectAll('checkListMon', 0)"
                  >全选</gradient-btn
                >
                <gradient-btn
                  size="xs"
                  @click="cancelSelectAll('checkListMon', 0)"
                  >取消全选</gradient-btn
                >
              </div>
              <div class="btn-grp">
                <gradient-btn
                  size="xs"
                  :disabled="
                    !checkListMon[0].some((v) => v == true) || !hasPermission
                  "
                  @click="batchMonSet(0, 1)"
                  >批量给定</gradient-btn
                >
                <gradient-btn
                  size="xs"
                  :disabled="
                    !checkListMon[0].some((v) => v == true) || !hasPermission
                  "
                  @click="batchMonSet(0, 0)"
                  >批量取消</gradient-btn
                >
              </div>
            </div>
            <div class="banner btn-grp" v-show="1 == battInfoType">
              <gradient-btn size="xs" @click="selectAll('checkListMon', 1)"
                >全选</gradient-btn
              >
              <gradient-btn
                size="xs"
                :disabled="
                  !checkListMon[1].some((v) => v == true) || !hasPermission
                "
                @click="batchMonSet(1)"
                >批量给定</gradient-btn
              >
            <div class="banner" v-show="1 == battInfoType">
              <div class="btn-grp">
                <gradient-btn size="xs" @click="selectAll('checkListMon', 1)"
                  >全选</gradient-btn
                >
                <gradient-btn
                  size="xs"
                  @click="cancelSelectAll('checkListMon', 1)"
                  >取消全选</gradient-btn
                >
              </div>
              <div class="btn-grp">
                <gradient-btn
                  size="xs"
                  :disabled="
                    !checkListMon[1].some((v) => v == true) || !hasPermission
                  "
                  @click="batchMonSet(1, 1)"
                  >批量给定</gradient-btn
                >
                <gradient-btn
                  size="xs"
                  :disabled="
                    !checkListMon[1].some((v) => v == true) || !hasPermission
                  "
                  @click="batchMonSet(1, 0)"
                  >批量取消</gradient-btn
                >
              </div>
            </div>
            <div class="banner btn-grp" v-show="2 == battInfoType">
              <gradient-btn size="xs" @click="selectAll('checkListMon', 2)"
                >全选</gradient-btn
              >
              <gradient-btn
                size="xs"
                :disabled="
                  !checkListMon[2].some((v) => v == true) || !hasPermission
                "
                @click="batchMonSet(2)"
                >批量给定</gradient-btn
              >
            <div class="banner" v-show="2 == battInfoType">
              <div class="btn-grp">
                <gradient-btn size="xs" @click="selectAll('checkListMon', 2)"
                  >全选</gradient-btn
                >
                <gradient-btn
                  size="xs"
                  @click="cancelSelectAll('checkListMon', 2)"
                  >取消全选</gradient-btn
                >
              </div>
              <div class="btn-grp">
                <gradient-btn
                  size="xs"
                  :disabled="
                    !checkListMon[2].some((v) => v == true) || !hasPermission
                  "
                  @click="batchMonSet(2, 1)"
                  >批量给定</gradient-btn
                >
                <gradient-btn
                  size="xs"
                  :disabled="
                    !checkListMon[2].some((v) => v == true) || !hasPermission
                  "
                  @click="batchMonSet(2, 0)"
                  >批量取消</gradient-btn
                >
              </div>
            </div>
            <div class="grid1 scroller" v-show="0 == battInfoType">
              <yc-grid :count="monCount" :config="monProps[0]">
@@ -238,7 +300,9 @@
                <div class="card-content">
                  <div class="item-row">
                    <div class="label">停止原因:</div>
                    <div class="value">{{ stopReason[testStopTypeReal] || '未知' }}</div>
                    <div class="value">
                      {{ stopReason[testStopTypeReal] || "未知" }}
                    </div>
                  </div>
                  <div class="item-row">
                    <div class="label">状态码:</div>
@@ -500,7 +564,7 @@
      if (!this.isWSOpen1) {
        return false;
      }
      this.SOCKET1.send('');
      this.SOCKET1.send("");
    },
    onWSMessage1(res) {
      let { data, data2, data3, data4 } = JSON.parse(res.data);
@@ -520,11 +584,19 @@
      } else {
        let arr = this[list][idx].map(() => true);
        this.$set(this[list], idx, arr);
        // this[list][idx] = this[list][idx].map(() => true);
      }
    },
    batchGroupSet(type) {
      this.$confirm("确认批量给定?", "提示", {
    cancelSelectAll(list, idx) {
      if (idx == undefined) {
        this[list] = this[list].map(() => false);
      } else {
        let arr = this[list][idx].map(() => false);
        this.$set(this[list], idx, arr);
      }
    },
    batchGroupSet(setFlag) {
      let title = setFlag ? "确认批量给定?" : "确认批量取消给定?";
      this.$confirm(title, "提示", {
        type: "warning",
      })
        .then(() => {
@@ -539,13 +611,13 @@
              let $el = this.$refs[refName];
              // console.log($el);
              params["battIndex"] = 0;
              params[$el.option.key1] = $el.num;
              params[$el.option.flag] = 1;
              params[$el.option.key1] = setFlag ? $el.num : undefined;
              params[$el.option.flag] = setFlag ? 1 : 0;
              params["logList"].push({
                param: $el.option.flag,
                paramCn: $el.title,
                value: $el.num,
                st: 1,
                value: setFlag ? $el.num : undefined,
                st: setFlag ? 1 : 0,
              });
            });
@@ -562,8 +634,9 @@
        })
        .catch(() => {});
    },
    batchMonSet(type) {
      this.$confirm("确认批量执行?", "提示", {
    batchMonSet(type, setFlag) {
      let title = setFlag ? "确认批量给定?" : "确认批量取消给定?";
      this.$confirm(title, "提示", {
        type: "warning",
      })
        .then(() => {
@@ -579,8 +652,8 @@
              let $el = this.$refs[refName];
              let params2 = {};
              params2[$el.option.key1] = $el.num;
              params2[$el.option.flag] = 1;
              params2[$el.option.key1] = setFlag ? $el.num : undefined;
              params2[$el.option.flag] = setFlag ? 1 : 0;
              params2["battIndex"] = 0;
              params2["monNum"] = $el.option.monNum;
@@ -588,8 +661,8 @@
              params["logList"].push({
                param: $el.option.flag,
                paramCn: $el.title,
                value: $el.num,
                st: 1,
                value: setFlag ? $el.num : undefined,
                st: setFlag ? 1 : 0,
                monNum: $el.option.monNum,
                battIndex: 0,
              });
@@ -705,8 +778,8 @@
}
.banner {
  display: flex;
  justify-content: flex-end;
  margin: -10px -10px 0 0;
  justify-content: space-between;
  margin: -10px -10px 0 -10px;
}
.grid1 {
  flex: 1;
src/views/powerCabinetControl/components/card.vue
@@ -120,12 +120,12 @@
          // console.log('调用结定接口', this.num, this.option.key1);
          let loading = this.$layer.loading();
          let params = { logList: [] };
          params[this.option.key1] = num;
          params[this.option.key1] = flag ? num : undefined;
          params[this.option.flag] = flag;
          params["logList"].push({
            param: this.option.flag,
            paramCn: this.title,
            fake: num,
            fake: flag ? num : undefined,
            st: flag,
          });
          updateYC(params)
src/views/powerCabinetControl/components/card2.vue
@@ -146,8 +146,8 @@
            params["logList"].push({
              param: prop_flag + "_" + (index % 25),
              paramCn: this.title,
              fake: 1,
              st: pflag1,
              fake: pflag || undefined,
              st: pflag,
            });
          } else {
            params[key1] = 1;
@@ -155,7 +155,7 @@
            params["logList"].push({
              param: flag,
              paramCn: this.title,
              fake: 1,
              fake: pflag || undefined,
              st: pflag,
            });
          }
src/views/powerCabinetControl/index.vue
@@ -4,17 +4,32 @@
      <el-tab-pane label="交流/直流配电柜">
        <div class="tab-content content1 flex-r">
          <panel class="panel left" title="遥测量模拟">
            <div slot="tools" class="btn-grp">
            <div slot="leftTools" class="btn-grp">
              <gradient-btn size="xs" @click="selectAll('checkList1_acdc')"
                >全选</gradient-btn
              >
              <gradient-btn
                size="xs"
                @click="cancelSelectAll('checkList1_acdc')"
                >取消全选</gradient-btn
              >
            </div>
            <div slot="tools" class="btn-grp">
              <gradient-btn
                size="xs"
                :disabled="
                  !checkList1_acdc.some((v) => v == true) || !hasPermission
                "
                @click="batchYCSet('acdc', 1)"
                >批量给定</gradient-btn
              >
              <gradient-btn
                size="xs"
                :disabled="
                  !checkList1_acdc.some((v) => v == true) || !hasPermission
                "
                @click="batchYCSet('acdc')"
                >批量给定</gradient-btn
                @click="batchYCSet('acdc', 0)"
                >批量取消</gradient-btn
              >
            </div>
            <div class="content flex-c">
@@ -35,17 +50,32 @@
            </div>
          </panel>
          <panel class="panel right" title="遥信量模拟">
            <div slot="tools" class="btn-grp">
            <div slot="leftTools" class="btn-grp">
              <gradient-btn size="xs" @click="selectAll('checkList2_acdc')"
                >全选</gradient-btn
              >
              <gradient-btn
                size="xs"
                @click="cancelSelectAll('checkList2_acdc')"
                >取消全选</gradient-btn
              >
            </div>
            <div slot="tools" class="btn-grp">
              <gradient-btn
                size="xs"
                :disabled="
                  !checkList2_acdc.some((v) => v == true) || !hasPermission
                "
                @click="batchYXSet('acdc', 1)"
                >批量执行</gradient-btn
              >
              <gradient-btn
                size="xs"
                :disabled="
                  !checkList2_acdc.some((v) => v == true) || !hasPermission
                "
                @click="batchYXSet('acdc')"
                >批量执行</gradient-btn
                @click="batchYXSet('acdc', 0)"
                >批量取消</gradient-btn
              >
            </div>
            <div class="content">
@@ -71,17 +101,30 @@
      <el-tab-pane label="高频开关整流柜">
        <div class="tab-content content2 flex-r">
          <panel class="panel left" title="遥测量模拟">
            <div slot="tools" class="btn-grp">
            <div slot="leftTools" class="btn-grp">
              <gradient-btn size="xs" @click="selectAll('checkList1_gp')"
                >全选</gradient-btn
              >
              <gradient-btn size="xs" @click="cancelSelectAll('checkList1_gp')"
                >取消全选</gradient-btn
              >
            </div>
            <div slot="tools" class="btn-grp">
              <gradient-btn
                size="xs"
                :disabled="
                  !checkList1_gp.some((v) => v == true) || !hasPermission
                "
                @click="batchYCSet('gp', 1)"
                >批量给定</gradient-btn
              >
              <gradient-btn
                size="xs"
                :disabled="
                  !checkList1_gp.some((v) => v == true) || !hasPermission
                "
                @click="batchYCSet('gp')"
                >批量给定</gradient-btn
                @click="batchYCSet('gp', 0)"
                >批量取消</gradient-btn
              >
            </div>
            <div class="content flex-c">
@@ -103,17 +146,30 @@
            </div>
          </panel>
          <panel class="panel right" title="遥信量模拟">
            <div slot="tools" class="btn-grp">
            <div slot="leftTools" class="btn-grp">
              <gradient-btn size="xs" @click="selectAll('checkList2_gp')"
                >全选</gradient-btn
              >
              <gradient-btn size="xs" @click="cancelSelectAll('checkList2_gp')"
                >取消全选</gradient-btn
              >
            </div>
            <div slot="tools" class="btn-grp">
              <gradient-btn
                size="xs"
                :disabled="
                  !checkList2_gp.some((v) => v == true) || !hasPermission
                "
                @click="batchYXSet('gp', 1)"
                >批量执行</gradient-btn
              >
              <gradient-btn
                size="xs"
                :disabled="
                  !checkList2_gp.some((v) => v == true) || !hasPermission
                "
                @click="batchYXSet('gp')"
                >批量执行</gradient-btn
                @click="batchYXSet('gp', 0)"
                >批量取消</gradient-btn
              >
            </div>
            <div class="content">
@@ -257,7 +313,7 @@
      if (!this.isWSOpen1) {
        return false;
      }
      this.SOCKET1.send('');
      this.SOCKET1.send("");
    },
    onWSMessage1(res) {
      let { data, data2, data3, data4 } = JSON.parse(res.data);
@@ -274,8 +330,12 @@
    selectAll(list) {
      this[list] = this[list].map(() => true);
    },
    batchYCSet(type) {
      this.$confirm("确认批量给定?", "提示", {
    cancelSelectAll(list) {
      this[list] = this[list].map(() => false);
    },
    batchYCSet(type, setFlag) {
      let title = setFlag ? "确认批量给定?" : "确认批量取消给定?";
      this.$confirm(title, "提示", {
        type: "warning",
      })
        .then(() => {
@@ -289,13 +349,13 @@
              let refName = type + "_param_" + v.i;
              let $el = this.$refs[refName];
              // console.log($el);
              params[$el.option.key1] = $el.num;
              params[$el.option.flag] = 1;
              params[$el.option.key1] = setFlag ? $el.num : undefined;
              params[$el.option.flag] = setFlag ? 1 : 0;
              params["logList"].push({
                param: $el.option.flag,
                paramCn: $el.title,
                fake: $el.num,
                st: 1,
                fake: setFlag ? $el.num : undefined,
                st: setFlag ? 1 : 0,
              });
            });
@@ -312,8 +372,9 @@
        })
        .catch(() => {});
    },
    batchYXSet(type) {
      this.$confirm("确认批量执行?", "提示", {
    batchYXSet(type, setFlag) {
      let title = setFlag ? "确认批量执行?" : "确认批量取消执行?";
      this.$confirm(title, "提示", {
        type: "warning",
      })
        .then(() => {
@@ -360,29 +421,29 @@
              params[prop_key1] = setBitAtPositions(
                _key1,
                v.indexs.map((vv) => vv % 25),
                1
                setFlag ? 1 : 0
              );
              params[prop_flag] = setBitAtPositions(
                _flag,
                v.indexs.map((vv) => vv % 25),
                1
                setFlag ? 1 : 0
              );
              v.indexs.forEach((vv) => {
                params["logList"].push({
                  param: prop_flag + "_" + (vv % 25),
                  paramCn: v.$el.option.label0.replace("N", vv),
                  fake: 1,
                  st: 1,
                  paramCn: v.$el.option.label0.replace("N", vv + 1),
                  fake: setFlag ? 1 : undefined,
                  st: setFlag ? 1 : 0,
                });
              });
            } else {
              params[v.$el.option.key1] = 1;
              params[v.$el.option.flag] = 1;
              params[v.$el.option.key1] = setFlag ? 1 : undefined;
              params[v.$el.option.flag] = setFlag ? 1 : 0;
              params["logList"].push({
                param: v.$el.option.flag,
                paramCn: v.$el.title,
                fake: 1,
                st: 1,
                fake: setFlag ? 1 : undefined,
                st: setFlag ? 1 : 0,
              });
            }
          });
src/views/powerTestRecord/details.vue
@@ -326,6 +326,7 @@
      if (date) {
        this.date = date;
      }
      this.search();
    },
    typeChange() {
      this.param = [];