| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524 | <template>  <view class="gas-detail">    <u-tabs      class="devic-box-tab"      :current="PageCur"      :list="tabList"      @click="NavChange"    ></u-tabs>    <view class="gas-content" v-if="PageCur == 0">      <view class="search-area">        <view class="search-l">          <view class="search-item" @click="getChangeJcd">            <text class="search-label">监测点:</text>            <u--input              inputAlign="center"              v-model="searchText"              placeholder="请选择监测点"              suffixIcon="arrow-right"              suffixIconStyle="color: #909399"            ></u--input>            <u-action-sheet              :show="showJcd"              :actions="selectList"              title="请选择监测点"              @close="showJcd = false"              @select="selectChangeJcd"            >            </u-action-sheet>          </view>        </view>        <view class="search-r">          <!-- <image src="/static/model/alarmTrue.svg" alt="" class="icon-style" /> -->          <u-icon name="warning-fill" color="#0eb4fc" size="18"></u-icon>          <text class="icon-text">低风险</text>        </view>      </view>      <view class="top-area" v-if="topContentList.length > 0">        <view class="top-title">          <view style="font-weight: bold">瓦斯抽采泵信息</view>        </view>        <view          class="top-content"          v-for="(item, index) in topContentList"          :key="index"        >          <view class="content-title">{{ item.strinstallpos }}</view>          <view class="content-item-box">            <view class="content-item">              <view class="item-l">                <view class="item-value">{{ item.warnLevel }}</view>                <view class="item-label">报警状态</view>              </view>              <view class="item-c"></view>              <view class="item-r">                <view class="item-value">{{                  item.readData.coVal || "--"                }}</view>                <view class="item-label">输入管道内一氧化碳(ppm)</view>              </view>            </view>            <view class="content-item">              <view class="item-l">                <view class="item-value">{{ item.readData.gas1 || "--" }}</view>                <view class="item-label">管路出口处瓦斯</view>              </view>              <view class="item-c"></view>              <view class="item-r">                <view class="item-value">{{ item.readData.gas2 || "--" }}</view>                <view class="item-label">泵站内瓦斯</view>              </view>            </view>            <view class="content-item">              <view class="item-l">                <view class="item-value">{{ item.readData.gas3 || "--" }}</view>                <view class="item-label">输入管道内瓦斯</view>              </view>              <view class="item-c"></view>              <view class="item-r">                <view class="item-value">{{ item.readData.gas4 || "--" }}</view>                <view class="item-label">管道输出瓦斯</view>              </view>            </view>            <view class="content-item">              <view class="item-l">                <view class="item-value">{{                  item.readData.mixedTraffic || "--"                }}</view>                <view class="item-label">输入管道内工混流量</view>              </view>              <view class="item-c"></view>              <view class="item-r">                <view class="item-value">{{                  item.readData.standardTraffic || "--"                }}</view>                <view class="item-label">输入管道内标况流量</view>              </view>            </view>            <view class="content-item">              <view class="item-l">                <view class="item-value">{{                  item.readData.totalGasDrainage || "--"                }}</view>                <view class="item-label">瓦斯抽放量</view>              </view>              <view class="item-c"></view>              <view class="item-r">                <!-- <view class="item-value">{{ item.coVal }}</view>                <view class="item-label">输入管道内一氧化碳(ppm)</view> -->              </view>            </view>          </view>        </view>      </view>      <view class="bot-area">        <view class="top-title">          <view style="font-weight: bold">安全监测点信息</view>        </view>        <view          class="top-content"          v-for="(item, index) in botContentList"          :key="index"        >          <view class="content-title">{{ item.strinstallpos || "--" }}</view>          <view class="content-item-box">            <view class="content-item">              <view class="item-l">                <view class="item-value">瓦斯</view>                <view class="item-label">测点类型</view>              </view>              <view class="item-c"></view>              <view class="item-r">                <view class="item-value">{{ item.readData.gasC || "--" }}</view>                <view class="item-label">甲烷</view>              </view>            </view>            <view class="content-item">              <view class="item-l">                <view class="item-value">{{ item.readTime || "--" }}</view>                <view class="item-label">数据时间</view>              </view>            </view>          </view>        </view>      </view>    </view>  </view></template><script>import api from "@/api/api";import moment from "moment";export default {  name: "gasDetail",  props: {},  watch: {},  data() {    return {      timeRan: Number(new Date()),      timer: "",      PageCur: "0",      tabList: [{ name: "预警监测" }],      // isShowSelect: true,      showJcd: false,      searchText: "",      selectList: [],      topContentList: [],      botContentList: [],    };  },  beforeDestroy() {    this.timer = null;    clearTimeout(this.timer);  },  mounted() {    this.getTabList();  },  methods: {    NavChange: function (item) {      clearTimeout(this.timer);      this.PageCur = item.index;      if (this.PageCur == 0) {        this.getMonitor(this.selectList[this.PageCur].deviceID, true);      }    },    getChangeJcd() {      this.showJcd = true;    },    selectChangeJcd(e) {      clearTimeout(this.timer);      this.searchText = e.name;      this.getMonitor(e.deviceID, true);    },    getMonitor(deviceID, flag) {      let than = this;      than.timer = setTimeout(        async () => {          await than.getSysWarnList(deviceID, "gas");          if (than.timer) {            than.timer = null;          }          than.getMonitor(deviceID);        },        flag ? 0 : 3000      );    },    //获取顶部tab选项数据    getTabList() {      new Promise((resolve, reject) => {        api          .sysTypeWarn({ type: "gas" })          .then((response) => {            if (response.data.code == 200 && response.data.result.length != 0) {              let result = response.data.result;              this.selectList = result.map((el) => {                //lxh                return {                  name: el.systemname,                  deviceID: el.id,                };              });              this.searchText = this.selectList[0].name;              this.getMonitor(this.selectList[0].deviceID, true);            } else {              reject(response);            }          })          .catch((error) => {            console.log("catch===>response", response);            reject(error);          });      });    },    //获取瓦斯详情数据    getSysWarnList(id, type) {      new Promise((resolve, reject) => {        api          .sysWarn({ sysid: id, type: type })          .then((response) => {            if (response.data.code == 200) {              let data = response.data.result;              this.topContentList = data.pump;              this.botContentList = data.gas;            } else {              reject(response);            }          })          .catch((error) => {            console.log("catch===>response", response);            reject(error);          });      });    },  },  computed: {},};</script><style lang="scss" scoped>.gas-detail {  position: relative;  box-sizing: border-box;  .devic-box-tab {    padding: 0px 10px !important;  }  .gas-content {    height: 100%;    box-sizing: border-box;    overflow-y: auto;    .search-area {      width: 100%;      padding: 10px 20px;      display: flex;      justify-content: center;      align-items: center;      box-sizing: border-box;      background-color: #fff;      margin-bottom: 2px;      .search-l {        width: calc(100% - 100px);        position: relative;        display: flex;        align-items: center;        margin-right: 10px;        .search-item {          display: flex;          align-items: center;          .search-label {            text-align: right;          }        }      }      .search-r {        display: flex;        justify-content: space-between;        align-items: center;        width: 80px;        padding: 4px 10px;        border-radius: 5px;        background: #d4ecff;        .icon-style {          width: 14px;          height: 14px;        }        .icon-text {          font-size: 14px;          font-weight: bold;          color: #0eb4fc;        }      }    }    .top-area {      width: 100%;      padding: 0px 10px;      background-color: #fff;      margin-bottom: 2px;      box-sizing: border-box;    }    .bot-area {      width: 100%;      padding: 0px 10px;      background-color: #fff;      margin-bottom: 2px;      box-sizing: border-box;    }    .top-title {      height: 28px;      margin-bottom: 5px;      display: flex;      justify-content: space-between;      align-items: center;    }    .top-content {      .content-title {        height: 26px;        line-height: 26px;        padding: 0px 20px;        font-size: 12px;        background: url("/static/warndata/title.png") no-repeat;        background-size: 100% 100%;      }      .content-item-box {        padding: 10px 0px;        .content-item {          height: 50px;          display: flex;          justify-content: space-between;          align-items: center;          background: linear-gradient(            to right,            rgba(55, 135, 254, 0.08),            rgba(4, 184, 255, 0.08),            rgba(60, 161, 237, 0.08)          );          border-radius: 10px;          margin-bottom: 5px;          .item-l {            width: calc(50% - 2px);            height: 100%;            display: flex;            flex-direction: column;            justify-content: center;            align-items: center;          }          .item-c {            width: 4px;            height: 70%;            border-left: 2px solid;            border-image: linear-gradient(                to bottom,                transparent,                rgba(140, 203, 254, 1),                transparent              )              1 1 1;          }          .item-r {            width: calc(50% - 2px);            height: 100%;            display: flex;            flex-direction: column;            justify-content: center;            align-items: center;          }        }      }    }    .item-value {      height: 20px;      line-height: 20px;      color: #0eb4fc;      font-weight: bold;    }    .item-label {      font-size: 12px;    }    .top-dialog-area,    .center-dialog-area,    .bottom-dialog-area {      width: 100%;      padding: 10px;      box-sizing: border-box;      background-color: #fff;      margin-bottom: 2px;    }    .top-gas-list {      width: 100%;      padding: 10px 40px;      box-sizing: border-box;      background-color: #fff;      margin-bottom: 2px;    }    .bot-gas-list {      width: 100%;      padding: 10px;      box-sizing: border-box;      background-color: #fff;      margin-bottom: 2px;    }    .dialog-btn {      display: flex;      width: 100%;      padding: 8px 10px;      box-sizing: border-box;      background-color: #fff;      // margin-bottom: 2px;      .u-button {        margin: 0px 10px;      }    }    .dialog-title {      height: 26px;      line-height: 26px;      padding: 0px 20px;      margin-bottom: 10px;      font-size: 12px;      background: url("/static/warndata/title.png") no-repeat;      background-size: 100% 100%;    }    .dialog-item {      display: flex;      align-items: center;      justify-content: center;      margin-bottom: 10px;      .dialog-label {        width: 120px;        text-align: right;      }    }    .search-box {      display: flex;      align-items: center;      justify-content: center;      margin-bottom: 10px;      .dialog-label {        width: 80px;        text-align: right;      }    }    .content-title-gas {      position: relative;      height: 26px;      line-height: 26px;      padding-left: 20px;      font-size: 12px;      background: url("/static/warndata/title.png") no-repeat;      background-size: 100% 100%;    }    .icon-gas-edit {      position: absolute;      right: 35px;      top: 0;      cursor: pointer;    }    .icon-gas-del {      position: absolute;      right: 10px;      top: 0;      cursor: pointer;    }  }}::v-deep .u-input {  padding: 2px 6px !important;}::v-deep .u-popup {  flex: 0;}</style>
 |