Commit 617cb9ff authored by 何鹏程's avatar 何鹏程

修改搜素

parent ed8854ee
...@@ -8,6 +8,41 @@ ...@@ -8,6 +8,41 @@
ref="searchForm" ref="searchForm"
size="small" size="small"
> >
<el-form-item
label="车辆使用单位:"
prop="vehicleUsingUnit"
>
<el-input
placeholder="请输入车辆使用单位"
v-model="searchForm.vehicleUsingUnit"
/>
</el-form-item>
<el-form-item
label="辖区:"
prop="area"
>
<el-select
v-model="searchForm.area"
placeholder="请选择辖区"
style="width: 100%"
>
<el-option
v-for="item in areaList"
:label="item.name"
:key="item.id"
:value="item.val"
/>
</el-select>
</el-form-item>
<el-form-item
label="车牌号:"
prop="licensePlateNumber"
>
<el-input
placeholder="请输入车牌号"
v-model="searchForm.licensePlateNumber"
/>
</el-form-item>
<el-form-item <el-form-item
prop="vechieType" prop="vechieType"
label="车辆类型" label="车辆类型"
...@@ -151,6 +186,9 @@ export default { ...@@ -151,6 +186,9 @@ export default {
data() { data() {
return { return {
searchForm: { searchForm: {
vehicleUsingUnit: '',
area: '',
licensePlateNumber: '',
vechieUseStatus: '', vechieUseStatus: '',
vechieType: '' vechieType: ''
}, },
......
...@@ -45,8 +45,18 @@ export default { ...@@ -45,8 +45,18 @@ export default {
const myChart = this.chart || echarts.init(this.$refs.chart); const myChart = this.chart || echarts.init(this.$refs.chart);
let option = { let option = {
xAxis: { xAxis: {
type: 'category', type: 'time',
boundaryGap: false, // boundaryGap: false,
axisLabel: {
show: true,
formatter: (value, index) => {
return this.dateFormat('HH:MM', new Date(value))
}
}
},
tooltip: {
trigger: 'axis',
formatter: '{c}%'
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
...@@ -74,6 +84,25 @@ export default { ...@@ -74,6 +84,25 @@ export default {
myChart.setOption(option); myChart.setOption(option);
this.chart = myChart this.chart = myChart
},
dateFormat(fmt, date) {
let ret;
const opt = {
"Y+": date.getFullYear().toString(), // 年
"m+": (date.getMonth() + 1).toString(), // 月
"d+": date.getDate().toString(), // 日
"H+": date.getHours().toString(), // 时
"M+": date.getMinutes().toString(), // 分
"S+": date.getSeconds().toString() // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (let k in opt) {
ret = new RegExp("(" + k + ")").exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
};
};
return fmt;
} }
} }
} }
......
...@@ -115,22 +115,33 @@ export default { ...@@ -115,22 +115,33 @@ export default {
selectTime1: 1, selectTime1: 1,
selectTime2: 1, selectTime2: 1,
cpuList: [], cpuList: [],
ncList: [] ncList: [],
timer: ''
} }
}, },
beforeDestroy() {
clearTimeout(this.timer);
},
mounted() { mounted() {
this.init() this.init()
}, },
methods: { methods: {
init() { init() {
if (this.timer) {
clearTimeout(this.timer);
}
this.timer = setInterval(this.getTopData, 1000 * 60 * 5)
this.getTopData()
this.getBarData('cpu')
this.getBarData('内存')
},
getTopData() {
getServerInfo().then(res => { getServerInfo().then(res => {
const { cpu, ciPanlist, neicun } = res.respData const { cpu, ciPanlist, neicun } = res.respData
this.cpu = cpu this.cpu = cpu
this.neicun = neicun this.neicun = neicun
this.ciPanlist = ciPanlist this.ciPanlist = ciPanlist
}) })
this.getBarData('cpu')
this.getBarData('内存')
}, },
getBarData(type) { getBarData(type) {
const params = {} const params = {}
...@@ -142,7 +153,7 @@ export default { ...@@ -142,7 +153,7 @@ export default {
params.hour = this.selectTime2 params.hour = this.selectTime2
} }
queryResourceList(params).then(res => { queryResourceList(params).then(res => {
const list = res.respData.map(item => [item.timeStr, this.toNum(item.utilizationRate)]) const list = res.respData.map(item => [item.updateTime, this.toNum(item.utilizationRate)])
if (type === 'cpu') { if (type === 'cpu') {
this.cpuList = list this.cpuList = list
} else if (type === '内存') { } else if (type === '内存') {
......
...@@ -8,13 +8,22 @@ ...@@ -8,13 +8,22 @@
ref="searchForm" ref="searchForm"
size="small" size="small"
> >
<el-form-item
label="站点名称"
prop="siteName"
>
<el-input
placeholder="请输入站点名称"
v-model="searchForm.siteName"
/>
</el-form-item>
<el-form-item <el-form-item
prop="area" prop="area"
label="辖区" label="辖区"
> >
<el-select <el-select
v-model="searchForm.area" v-model="searchForm.area"
placeholder="请选择车辆类型" placeholder="请选择辖区"
style="width: 100%" style="width: 100%"
:clearable="true" :clearable="true"
> >
...@@ -26,6 +35,24 @@ ...@@ -26,6 +35,24 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item
label="上级医院名称"
prop="hospitalCode"
>
<el-select
v-model="searchForm.hospitalCode"
placeholder="请选择上级医院"
style="width: 100%"
:clearable="true"
>
<el-option
v-for="item in hospitalList"
:label="item.hospitalName"
:key="item.id"
:value="item.hospitalCode"
/>
</el-select>
</el-form-item>
<el-form-item <el-form-item
prop="siteStatus" prop="siteStatus"
label="启用状态" label="启用状态"
...@@ -138,6 +165,7 @@ ...@@ -138,6 +165,7 @@
import { tableDataMixin } from '../../common/js/mixin' import { tableDataMixin } from '../../common/js/mixin'
import { queryEmergencySitePageList, deleteEmergencySite, auditEmergencySite } from '@/api/site' import { queryEmergencySitePageList, deleteEmergencySite, auditEmergencySite } from '@/api/site'
import { getDic } from '../../util/dict' import { getDic } from '../../util/dict'
import { queryEmergencyHospitalList } from '@/api/common'
import SiteDialog from './components/siteDialog.vue' import SiteDialog from './components/siteDialog.vue'
export default { export default {
name: 'sitePage', name: 'sitePage',
...@@ -152,6 +180,7 @@ export default { ...@@ -152,6 +180,7 @@ export default {
siteStatus: '' siteStatus: ''
}, },
areaList: [], areaList: [],
hospitalList: [],
tableData: { tableData: {
loading: false, loading: false,
head: [ head: [
...@@ -210,6 +239,10 @@ export default { ...@@ -210,6 +239,10 @@ export default {
getDic(['area']).then(res => { getDic(['area']).then(res => {
this.areaList = res.area this.areaList = res.area
}) })
//获取可选择的医院
queryEmergencyHospitalList().then(res => {
this.hospitalList = res.respData
})
this.search() this.search()
}, },
methods: { methods: {
......
...@@ -48,7 +48,6 @@ export const LoginByToken = function({ ...@@ -48,7 +48,6 @@ export const LoginByToken = function({
await commit(types.SET_MENUMAP, Cache.setMenuMap(parentMenuList)) await commit(types.SET_MENUMAP, Cache.setMenuMap(parentMenuList))
await commit(types.SET_USERINFO, Cache.setUserInfo(userDto)) await commit(types.SET_USERINFO, Cache.setUserInfo(userDto))
Auth.setLoginInfo(token) Auth.setLoginInfo(token)
console.log(111)
router.addRoutes(routeHandle(parentMenuList)) router.addRoutes(routeHandle(parentMenuList))
resolve() resolve()
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment