| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608 |
- <template>
- <view class="content">
- <view class="top">
- <image class="top_logo" src="../../static/logo.png" mode=""></image>
- <image class="tite" :src="$t('MainTitle')" mode=""></image>
- <!-- <view class="tite">
- {{ $t('MainTitle') }}
- </view> -->
- <view class="time">
- <view class="time_top">
- {{formattedTime}}
- </view>
- <view class="time_bottom">
- <view>
-
- </view>
- <view class="time_bottom1">
- {{$t('status')}}
- <view class="time_state" v-if="status=='ok'">
- {{$t('online')}}
- </view>
- <view class="time_state1" v-else>
- {{$t('offline')}}
- </view>
- </view>
-
- </view>
-
- </view>
- </view>
- <view class="parameter">
- <view class="parameter_xian">
- <view class="parameter_xian1">
- {{$t('formNO')}}
- </view>
- <view class="parameter_xian2">
- {{$t('formUnit')}}
- </view>
- <view class="parameter_xian3">
- {{$t('formDescription')}}
- </view>
- <view class="parameter_xian4">
- {{$t('formFailure')}}
- </view>
- <!-- <view class="parameter_xian5">
- 发生时间
- </view> -->
- <view class="parameter_xian6" v-if="event!='事件'">
- {{$t('formRecover')}}
- </view>
- </view>
- <view class="parameter_box">
- <view v-for="(item,index) in faultsList" :class="item.RESETTIME==''&&event!='事件'?'parameter_divred':'parameter_div'"
- :key="index">
- <view class="parameter_xian1">
- {{item.ID}}
- </view>
- <!-- <view class="parameter_xian2">
- {{item.TYPE}}
- </view> -->
- <!-- <zb-tooltip @click.top="close" :content="item.DEVICE" placement="top" :ref="'tooltip'+index"> -->
- <view class="parameter_xian2" v-if="item.DEVICE=='亿能BMS-1'">
- BMS
- </view>
- <view class="parameter_xian2" v-if="item.DEVICE=='英博电气pcs-1'">
- PCS
- </view>
- <view class="parameter_xian2" v-if="item.DEVICE=='virtual'">
- MCS
- </view>
- <view class="parameter_xian2" v-if="item.DEVICE=='充电桩ccu-1-1'">
- CCU
- </view>
- <view class="parameter_xian2" v-if="item.DEVICE=='innerIO-1'">
- IO
- </view>
- <!-- </zb-tooltip> -->
- <zb-tooltip @click.top="closedevice" :content="item.CONTENT" placement="top" :ref="'device'+index">
- <view class="parameter_xian3">
- {{item.CONTENT}}
- </view>
- </zb-tooltip>
-
- <view class="parameter_xian4">
- {{item.FAULTTIME.substring(0, 19)}}
- </view>
- <view class="parameter_xian6" v-if="event!='事件'">
- {{item.RESETTIME.substring(0, 19)}}
- </view>
- </view>
-
- </view>
-
- <view class="parameter_bottom">
- <view style="display: flex;align-items: center;">
- <view class="parameter_bottom1" @click="onclick">
- <image src="../../static/home.png" mode=""></image><text class="parameter_bottom2">{{$t('ReturnModeSelection')}}</text>
-
- </view>
- <view class="parameter_bottom11" @click="onReturn">
- <image src="../../static/Return.png" mode=""></image><text class="parameter_bottom2">{{$t('Return')}}</text>
- </view>
- </view>
-
- <!-- <view class="parameter_bottom3">
- <view :class="faulttaps=='实时'?'parameter_bottom31':'parameter_bottom32'" @click="taps('实时')">
- 实时
- </view>
-
- <view v-if="event=='故障'" :class="faulttaps=='故障'?'parameter_bottom31':'parameter_bottom32'" @click="taps('故障')">
- 故障
- </view>
- <view v-if="event=='告警'" :class="faulttaps=='告警'?'parameter_bottom31':'parameter_bottom32'" @click="taps('告警')">
- 告警
- </view>
- <view v-if="event=='事件'" :class="faulttaps=='事件'?'parameter_bottom31':'parameter_bottom32'" @click="taps('事件')">
- 事件
- </view>
- </view> -->
-
- <view class="parameter_bottom4">
- <view class="eliminate" @click="onFaultclearing">
- {{$t('FaultClearing')}}
- </view>
- <uni-pagination :total="total" :current="current" title="标题文字" :show-icon="true" @change="change" />
- </view>
- </view>
-
- </view>
- </view>
- </template>
- <!-- -->
- <script>
- import {
- getTime
- } from "../../utils/index.js"
- import {
- getfaultsList,
- control
- } from "../../api/api.js"
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- current: 1,
- total: 0,
- pageSize: 10,
- faulttaps: '故障',
- faultsList: [],
- }
- },
- onLoad() {
- this.faulttaps = this.$store.state.event
-
- this.onfaultsList();
- },
- computed: {
- // 使用 mapState 映射多个状态到组件的计算属性
- ...mapState(['formattedTime', 'status',"event"]),
-
- },
- beforeUnmount() {},
- methods: {
- onfaultsList() {
- // let data1 =[
- // {
- // ID:1,
- // DEVICE:'亿能BMS-1',
- // CONTENT:'CONTENT',
- // FAULTTIME:'2024-10-30',
- // RESETTIME:'2024-10-30',
-
- // },{
- // ID:1,
- // DEVICE:'亿能BMS-1',
- // CONTENT:'CONTENT',
- // FAULTTIME:'2024-10-30',
- // RESETTIME:'',
-
- // }
- // ]
- // this.faultsList = data1
- // this.total =10
- // return
- let data = {
- page: this.current,
- rows: this.pageSize,
- device: '',
- starttime: '',
- endtime: '',
- rt:0,
- type:this.faulttaps
- }
- getfaultsList(data).then(res => {
- console.log(res);
- if (res.status == 'ok') {
-
- this.faultsList = res.data.list
- this.total = res.data.pagination.total
-
- } else {
-
- }
- });
-
-
- },
- onclick() {
- uni.redirectTo({
- url: '/pages/index/index'
- });
- },
- onReturn() {
- uni.redirectTo({
- url: '/pages/faultlist/index'
- });
- },
- change(e) {
- console.log(e);
- this.current = e.current
- this.onfaultsList()
- },
- // taps(e) {
- // this.faulttaps = e
- // this.current = 1
- // console.log(e);
- // this.onfaultsList()
- // },
- // 文字提示
- closedevice() {
- for (let i = 1; i < this.total; i++) {
- this.$refs[('device' + i)].close()
- }
- },
- onFaultclearing(){
- // 清除故障
- let data = {
- id: "201c23d5-f460-44d5-8dde-8adb46cd00f7",
- issaveinitvalue: false,
- value: '1'
- }
- console.log(data);
- control(data).then(res => {
- console.log(res);
- if (res.status == 'ok') {
- setTimeout(() => {
- let info = {
- id: "201c23d5-f460-44d5-8dde-8adb46cd00f7",
- issaveinitvalue: false,
- value: '0'
- }
- control(info).then(ress => {
- console.log(ress);
- if (ress.status == 'ok') {
-
- uni.showToast({
- title: this.$t('OperationSuccessful'),
- icon: 'none',
- duration: 2000, // 显示时长,单位为毫秒
- });
-
-
-
- } else {
- uni.showToast({
- title: this.$t('operationFailed'),
- icon: 'none', // 使用 'none' 图标来表示失败
- duration: 2000, // 显示时长,单位为毫秒
- });
- }
- });
- }, 1000); // 1秒后重新获取数据
-
-
- } else {
- uni.showToast({
- title: this.$t('operationFailed'),
- icon: 'none', // 使用 'none' 图标来表示失败
- duration: 2000, // 显示时长,单位为毫秒
- });
- }
- });
- }
- // close() {
- // for (let i = 1; i < this.total; i++) {
- // this.$refs[('tooltip' + i)].close()
- // }
- // }
- }
- }
- </script>
- <!-- -->
- <style lang="scss" scoped>
- .content {
- width: 100%;
- height: 100vh;
- opacity: 1;
- background: linear-gradient(180deg, rgba(215, 230, 245, 0) 0%, rgba(196, 229, 255, 1) 100%);
- box-sizing: border-box;
- }
-
- .top {
- width: 100%;
- height: 100px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- background-size: 100% 100%;
- background-repeat: no-repeat;
- background-color: #fff;
- padding: 0px 46px;
- box-sizing: border-box;
- }
-
- .top_logo{
- width:327px;
- height: 56px;
- }
- .tite{
- width: 325px;
- height: 50px;
- }
- .time{
- width:277px;
- text-align: right;
- }
-
- .time_top {
- font-size: 17px;
- }
-
- .time_bottom {
- display: flex;
- font-size: 17px;
- justify-content: space-between;
- }
-
- .time_bottom1 {
- display: flex;
- }
-
- .time_state {
- font-size: 17px;
- font-weight: 600;
- color: rgba(22, 68, 144, 1);
- }
-
- .parameter {
- width: 100%;
- /* padding-bottom: 20px; */
- display: flex;
- padding: 0px 20px 20px 20px;
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- }
-
- .parameter_xian {
- width: 100%;
- height: 55px;
- background: linear-gradient(180deg, rgba(30, 131, 189, 1) 0%, rgba(69, 168, 230, 0.92) 100%);
- box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
- display: flex;
- align-items: center;
- color: #fff;
- // justify-content: space-around;1237
- justify-content: space-between;
- font-size: 28px;
- font-weight: 600;
- padding: 0px 20px;
- box-sizing: border-box;
-
- .parameter_xian1 {
- width: 160px;
- }
-
- .parameter_xian2 {
- width: 160px;
- }
-
- .parameter_xian3 {
- width: 430px;
- }
-
- .parameter_xian4 {
- width: 220px;
- margin-right: 10px;
- white-space: nowrap;
- /* 禁止换行 */
- overflow: hidden;
- /* 超出部分隐藏 */
- text-overflow: ellipsis;
- /* 显示省略号 */
- }
-
- .parameter_xian5 {
- width: 240px;
- margin-right: 10px;
- }
-
- .parameter_xian6 {
- width: 240px;
- }
- }
-
- .parameter_box {
- width: 100%;
- overflow: auto;
- }
-
- .parameter_div {
- width: 100%;
- height: 46px;
- background: rgba(255, 255, 255, 1);
- box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
- margin-top: 10px;
- display: flex;
- align-items: center;
- // justify-content: space-around;
- justify-content: space-between;
- font-weight: 500;
- padding: 0px 20px;
- box-sizing: border-box;
-
-
- .parameter_xian1 {
- width: 160px;
- }
-
- .parameter_xian2 {
- width: 160px;
- }
-
- .parameter_xian3 {
- width: 430px;
- }
-
- .parameter_xian4 {
- width: 220px;
- white-space: nowrap;
- /* 禁止换行 */
- overflow: hidden;
- /* 超出部分隐藏 */
- text-overflow: ellipsis;
- /* 显示省略号 */
- margin-right: 10px;
- }
-
- .parameter_xian5 {
- width: 240px;
- margin-right: 10px;
- }
-
- .parameter_xian6 {
- width: 240px;
- }
- }
-
- .parameter_divred {
- width: 100%;
- height: 46px;
- background: rgba(245, 99, 83, 1);
- box-shadow: inset 0px 0px 9.79px rgba(0, 0, 0, 0.1);
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- color: #fff;
- font-weight: 500;
- // justify-content: space-around;
- justify-content: space-between;
- padding: 0px 20px;
- box-sizing: border-box;
-
-
- .parameter_xian1 {
- width: 160px;
- }
-
- .parameter_xian2 {
- width: 160px;
- }
-
- .parameter_xian3 {
- width: 430px;
- }
-
- .parameter_xian4 {
- width: 220px;
- margin-right: 10px;
- white-space: nowrap;
- /* 禁止换行 */
- overflow: hidden;
- /* 超出部分隐藏 */
- text-overflow: ellipsis;
- /* 显示省略号 */
- }
-
- .parameter_xian5 {
- width: 240px;
- margin-right: 10px;
- }
-
- .parameter_xian6 {
- width: 240px;
- }
- }
-
- .parameter_bottom {
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
- padding: 0px 16px;
- position: fixed;
- left: 10px;
- bottom: 10px;
- width: 100%;
- box-sizing: border-box;
- }
-
- .parameter_bottom1 {
- display: flex;
- align-items: center;
-
- image {
- width: 32px;
- height: 32px;
- display: flex;
- }
-
- }
- .parameter_bottom11 {
- display: flex;
- align-items: center;
- margin-left: 100px;
- image {
- width: 32px;
- height: 32px;
- display: flex;
- }
- }
- .parameter_bottom2 {
- font-size: 19.58px;
- font-weight: 400;
- color: rgba(0, 0, 0, 1);
- margin-left: 10px;
- }
-
- .parameter_bottom3 {
- display: flex;
- }
-
- .parameter_bottom31 {
- width: 48px;
- height: 48px;
- background: linear-gradient(180deg, rgba(74, 167, 224, 1) 0%, rgba(36, 134, 192, 1) 100%);
- border-radius: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 19px;
- font-weight: 700;
- margin-right: 20px;
- color: rgba(255, 255, 255, 1);
- }
-
- .parameter_bottom32 {
- width: 48px;
- height: 48px;
- background: linear-gradient(180deg, rgba(224, 218, 218, 1) 0%, rgba(130, 121, 121, 1) 100%);
- border-radius: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 19px;
- font-weight: 700;
- color: #222222;
- margin-right: 20px;
- }
-
- .parameter_bottom4 {
- display: flex;
- align-items: center;
- }
-
- .eliminate {
- width: 107.69px;
- height: 44.05px;
- opacity: 1;
- border-radius: 2.45px;
- background: linear-gradient(180deg, rgba(119, 163, 230, 1) 0%, rgba(25, 85, 176, 1) 10.42%, rgba(6, 53, 94, 1) 88.89%, rgba(119, 163, 230, 1) 100%);
- margin-right: 20px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 23.5px;
- font-weight: 400;
- color: rgba(255, 255, 255, 1);
- box-sizing: border-box;
- }
-
- .time_state1 {
- font-size: 17px;
- font-weight: 600;
- color: rgba(217, 22, 22, 1);
- }
- </style>
|