develop #1

Merged
dashixiong merged 37 commits from develop into main 2026-02-11 02:07:35 +00:00
38 changed files with 14640 additions and 319 deletions
Showing only changes of commit 4a2d3de48b - Show all commits

14
main.js
View File

@ -2,19 +2,23 @@ import Vue from 'vue'
import App from './App'
import store from './store' // store
import plugins from './plugins' // plugins
import {
formatNumber
} from './utils/filters.js' //数据过滤
import './permission' // permission
import { getDicts } from "@/api/system/dict/data"
import {
getDicts
} from "@/api/system/dict/data"
Vue.use(plugins)
Vue.config.productionTip = false
Vue.prototype.$store = store
Vue.prototype.getDicts = getDicts
Vue.filter('formatNumber', formatNumber)
App.mpType = 'app'
const app = new Vue({
...App
...App
})
app.$mount()
app.$mount()

View File

@ -34,7 +34,7 @@
:key="infoDataIndex+'infoData'">
<view class="grid-item-box">
<view class="title">{{infoDataItem.label}}</view>
<text class="text">{{item[infoDataItem.attr]}}
<text class="text">{{item[infoDataItem.attr] | formatNumber}}
<text v-if="infoDataItem.unit" v-html="infoDataItem.unit"></text>
</text>
</view>

View File

@ -34,7 +34,7 @@
:key="infoDataIndex+'infoData'">
<view class="grid-item-box">
<view class="title">{{infoDataItem.label}}</view>
<text class="text">{{item[infoDataItem.attr]}}
<text class="text">{{item[infoDataItem.attr] | formatNumber}}
<text v-if="infoDataItem.unit" v-html="infoDataItem.unit"></text>
</text>
</view>

View File

@ -188,6 +188,10 @@
// 运行状态颜色区分
.running {
.uni-group__title {
background-color: #05AEA3;
}
.uni-collapse-item__title-text {
color: #05AEA3;
}
@ -199,6 +203,10 @@
}
.danger {
.uni-group__title {
background-color: #FC6B69;
}
.uni-collapse-item__title-text {
color: #FC6B69;
}

View File

@ -5,7 +5,7 @@
<uni-grid-item v-for="(item,index) in runningHeadData" :key="index+'head'">
<view class="grid-item-box">
<view class="title">{{item.title}}</view>
<text class="text">{{runningHeadInfo[item.attr] || '-'}}</text>
<text class="text">{{runningHeadInfo[item.attr] | formatNumber}}</text>
</view>
</uni-grid-item>
</uni-grid>
@ -61,7 +61,7 @@
:key="infoDataIndex+'infoData'">
<view class="grid-item-box">
<view class="title">{{infoDataItem.label}}</view>
<text class="text">{{item[infoDataItem.attr]}}
<text class="text">{{item[infoDataItem.attr] | formatNumber}}
<text v-if="infoDataItem.unit" v-html="infoDataItem.unit"></text>
</text>
</view>

27
utils/filters.js Normal file
View File

@ -0,0 +1,27 @@
export const formatNumber = (val) => {
if (val || [0, '0'].includes(val)) {
return val
} else {
return '-'
}
}
export const formatDate = (val, toSeconds = false, onlyTime = false) => {
if (!val) return ''
const date = new Date(val)
const month = date.getMonth() + 1,
day = date.getDate()
const hours = date.getHours(),
minuets = date.getMinutes(),
seconds = date.getSeconds();
const front = `${date.getFullYear()}-${month<10?'0'+month : month}-${day<10 ? '0'+day : day}`
const back =
`${hours<10 ? '0'+hours : hours}:${minuets<10 ? '0'+minuets : minuets}:${seconds<10 ? '0'+seconds : seconds}`
if (onlyTime) return back
if (!toSeconds) {
return front
} else {
return front + '' + back
}
}