提交 4781a716 authored 作者: 刘守彩's avatar 刘守彩

fix: bugs

上级 a4ebaaec
...@@ -19,23 +19,57 @@ export default { ...@@ -19,23 +19,57 @@ export default {
} }
}, },
async pageSelect(data){ // async pageSelect(data){
// let sqllitedb = await SqlliteDbUtil.initSqlliteDB()
// let pre = (data.page -1) * data.size
// let nxt = data.size
// try {
// let count = await sqllitedb.selectSQL(`select count(*) as total from ${table.logListName} limit 1 `)
// let sql = `select * from ${table.logListName} ORDER BY time desc limit ${nxt} offset ${pre} `
// let rs = await sqllitedb.selectSQL(sql)
// console.log('sql',sql, rs)
// return {
// data:rs || [],
// total:count[0].total || 0
// }
// } catch (e) {
// console.log(e.message)
// } finally {
// await sqllitedb.closeDB();
// }
// },
async pageSelect(data) {
let sqllitedb = await SqlliteDbUtil.initSqlliteDB() let sqllitedb = await SqlliteDbUtil.initSqlliteDB()
let pre = (data.page -1) * data.size let pre = (data.page - 1) * data.size
let nxt = data.size let nxt = data.size
// 拼接时间范围条件
let whereClause = "1=1"
if (data.startTime && data.endTime) {
whereClause += ` AND time BETWEEN '${data.startTime} 00:00:00' AND '${data.endTime} 23:59:59'`
}
try { try {
let count = await sqllitedb.selectSQL(`select count(*) as total from ${table.logListName} limit 1 `) // 获取总数
let sql = `select * from ${table.logListName} ORDER BY time desc limit ${nxt} offset ${pre} ` let countSql = `SELECT count(*) as total FROM ${table.logListName} WHERE ${whereClause} LIMIT 1`
let count = await sqllitedb.selectSQL(countSql)
// 获取分页数据
let sql =
`SELECT * FROM ${table.logListName} WHERE ${whereClause} ORDER BY time DESC LIMIT ${nxt} OFFSET ${pre}`
let rs = await sqllitedb.selectSQL(sql) let rs = await sqllitedb.selectSQL(sql)
console.log('sql',sql)
console.log('sql', sql, rs)
return { return {
data:rs || [], data: rs || [],
total:count[0].total || 0 total: count[0]?.total || 0
} }
} catch (e) { } catch (e) {
console.log(e.message) console.log(e.message)
} finally { } finally {
await sqllitedb.closeDB(); await sqllitedb.closeDB()
} }
}, },
async addlog(data) { async addlog(data) {
......
...@@ -114,6 +114,10 @@ module.exports = { ...@@ -114,6 +114,10 @@ module.exports = {
field: "signImg", field: "signImg",
format: "TEXT", format: "TEXT",
}, },
{
field: "dataSource",
format: "INTEGER DEFAULT 1"
}
], ],
// 机房、井道信息表 // 机房、井道信息表
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="container"> <view class="container">
<!-- 第一个模块 --> <!-- 第一个模块 -->
<view class="header"> <view class="header">
<view class="title">杭州内网监管在线-运维在线</view> <view class="title">杭州内网监管在线-山南数据中心运维在线</view>
<view class="header-buttons"> <view class="header-buttons">
<view class="log-button" @click="lookLog" v-if="isAdmin">操作日志</view> <view class="log-button" @click="lookLog" v-if="isAdmin">操作日志</view>
<div class="exit-button" @click="logOut"> <div class="exit-button" @click="logOut">
...@@ -188,12 +188,13 @@ export default { ...@@ -188,12 +188,13 @@ export default {
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
ont-family: PingFangSC-Medium; ont-family: PingFangSC-Medium;
font-size: 32px; font-size: 30px;
color: #000000; color: #000000;
text-align: center; text-align: center;
line-height: 40px; line-height: 40px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.16); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
font-weight: 500; font-weight: 500;
white-space: nowrap;
} }
.header-buttons { .header-buttons {
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
<!-- 搜索区域 --> <!-- 搜索区域 -->
<view class="search-com"> <view class="search-com">
<view class="search-com-left"> <view class="search-com-left">
<uni-data-select class="uni-search-item" v-model="searchFrom.type" :localdata="typeList" <!-- <uni-data-select class="uni-search-item" v-model="searchFrom.type" :localdata="typeList"
@change="change" placeholder="操作类型:全部" :key="new Date().getTime()"></uni-data-select> @change="change" placeholder="操作类型:全部" :key="new Date().getTime()"></uni-data-select> -->
<view class="search-com-right"> <view class="search-com-right">
<uni-datetime-picker class="uni-datetime-picker" type="daterange" <uni-datetime-picker class="uni-datetime-picker" type="daterange"
...@@ -148,13 +148,8 @@ ...@@ -148,13 +148,8 @@
}, },
timeChange(val) { timeChange(val) {
let temp = [...val]; this.searchForm.startTime = val[0] || "";
if (val.length && val[0] == val[1]) { this.searchForm.endTime = val[1] || "";
temp[1] = `${temp[1]} 23:59:59`;
}
this.searchForm.startTime = temp[0] || "";
this.searchForm.endTime = temp[1] || "";
this.getData(); this.getData();
}, },
...@@ -173,11 +168,13 @@ ...@@ -173,11 +168,13 @@
} = this.searchForm; } = this.searchForm;
let data = { let data = {
page: 2, page: 2,
size: 10 size: 10,
} }
let res = await this.$logApi.pageSelect({ let res = await this.$logApi.pageSelect({
page: this.pageCurrent, page: this.pageCurrent,
size: this.pageSize size: this.pageSize,
startTime,
endTime
}) })
if (res) { if (res) {
this.total = res.total this.total = res.total
......
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
conclusion: "", conclusion: "",
settingLabel: "设定电池电压", settingLabel: "设定电池电压",
settingLabelShow: "设定电压", settingLabelShow: "设定电压",
setting: this.jfType === "3" ? "2V-2.35V" : "2V-2.35V", //设定温度值 setting: "10V-15V", //设定温度值
// value: "", //输入温度 // value: "", //输入温度
unit: "V", //单位 unit: "V", //单位
photos: [], photos: [],
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
conclusion: "", conclusion: "",
settingLabel: "设定电池温度", settingLabel: "设定电池温度",
settingLabelShow: "设定温度", settingLabelShow: "设定温度",
setting: "10℃-40℃", //设定湿度值 setting: "10℃-35℃", //设定湿度值
// value: "", //输入湿度 // value: "", //输入湿度
unit: "℃", //单位 unit: "℃", //单位
photos: [], photos: [],
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
conclusion: "", conclusion: "",
settingLabel: "设定电池内阻", settingLabel: "设定电池内阻",
settingLabelShow: "设定内阻", settingLabelShow: "设定内阻",
setting: this.jfType === "3" ? "<50mΩ" : "<50mΩ", //设定湿度值 setting: this.jfType === "3" ? "<10mΩ" : "<10mΩ", //设定湿度值
// value: "", //输入湿度 // value: "", //输入湿度
unit: "mΩ", //单位 unit: "mΩ", //单位
photos: [], photos: [],
......
...@@ -282,7 +282,7 @@ export default { ...@@ -282,7 +282,7 @@ export default {
options: {}, //存储数据 options: {}, //存储数据
backValue: "", backValue: "",
all_data: [], //所有数据 all_data: [], //所有数据
jfType: "0", //机房类型 jfType: "2", //机房类型
allIsSubmitOne: false, allIsSubmitOne: false,
startDialogData: { startDialogData: {
text: [], text: [],
...@@ -547,7 +547,7 @@ export default { ...@@ -547,7 +547,7 @@ export default {
} }
console.log("this.detailsItem", this.detailsItem); console.log("this.detailsItem", this.detailsItem);
}, },
startDialogBtn(name = "山南UPS间", jfType = "0", value = "1") { startDialogBtn(name = "山南UPS间", jfType = "2", value = "1") {
let item = this.findTargetObject(this.listData); let item = this.findTargetObject(this.listData);
console.log("即将操作的机房", item); console.log("即将操作的机房", item);
...@@ -563,7 +563,7 @@ export default { ...@@ -563,7 +563,7 @@ export default {
this.value = value; this.value = value;
this.$refs.startDialog.open(); this.$refs.startDialog.open();
}, },
startDialog(name = "山南UPS间", jfType = "0", value = "1") { startDialog(name = "山南UPS间", jfType = "2", value = "1") {
this.name = name; this.name = name;
this.jfType = jfType; this.jfType = jfType;
this.value = value; this.value = value;
......
...@@ -210,7 +210,7 @@ export default { ...@@ -210,7 +210,7 @@ export default {
}, //弹窗文案 }, //弹窗文案
listData: [], listData: [],
name: "", name: "",
jfType: "0", jfType: "2",
value: "1", value: "1",
paramsObjFirst: {}, paramsObjFirst: {},
all_data: [], all_data: [],
......
...@@ -34,6 +34,7 @@ export function dataToSql(data) { ...@@ -34,6 +34,7 @@ export function dataToSql(data) {
createTime: data.id ? data.createTime : `${new Date().getTime()}`, createTime: data.id ? data.createTime : `${new Date().getTime()}`,
updateTime: `${new Date().getTime()}`, updateTime: `${new Date().getTime()}`,
inspectionData: data.originData, inspectionData: data.originData,
dataSource: data.dataSource
}; };
console.log("dataToSql", send); console.log("dataToSql", send);
return send; return send;
...@@ -85,6 +86,7 @@ export function sqlToData(sqlData) { ...@@ -85,6 +86,7 @@ export function sqlToData(sqlData) {
inspectionNumber, // 已巡检数量 inspectionNumber, // 已巡检数量
allIsSubmitOne, // 是否全部填写完成 allIsSubmitOne, // 是否全部填写完成
isSign: !!sqlData.signImg, // 是否有签名 isSign: !!sqlData.signImg, // 是否有签名
dataSource: sqlData.dataSource
}; };
return ret; return ret;
......
...@@ -4,15 +4,17 @@ ...@@ -4,15 +4,17 @@
<view class="login_wrap"> <view class="login_wrap">
<view class="top-module"> <view class="top-module">
<image src="@/static/logo.png" mode="aspectFit" alt="" /> <image src="@/static/logo.png" mode="aspectFit" alt="" />
<view class="title">杭州内网监管在线-运维在线</view> <view class="title">
杭州内网监管在线-山南数据中心运维在线
</view>
</view> </view>
<view class="form_wrap"> <view class="form_wrap">
<view class="input_wrap"> <view class="input_wrap">
<uni-easyinput class="log-input" clearSize="0" v-model="person.account" prefixIcon="person" <uni-easyinput class="log-input" clearSize="0" v-model="person.account" prefixIcon="person"
placeholder="用户名"></uni-easyinput> placeholder="用户名"></uni-easyinput>
<uni-easyinput v-if="passwordVisible" class="log-input" prefixIcon="locked" clearSize="0" <uni-easyinput v-if="passwordVisible" class="log-input" prefixIcon="locked" clearSize="0" v-model="person.pwd"
v-model="person.pwd" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false"
:passwordIcon="false" :type="passwordVisible ? 'text' : 'password'"></uni-easyinput> :type="passwordVisible ? 'text' : 'password'"></uni-easyinput>
<uni-easyinput v-else class="log-input" prefixIcon="locked-filled" clearSize="0" v-model="person.pwd" <uni-easyinput v-else class="log-input" prefixIcon="locked-filled" clearSize="0" v-model="person.pwd"
@iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false" @iconClick="togglePasswordVisible" :placeholder="passwordPlaceholder" :passwordIcon="false"
:type="passwordVisible ? 'text' : 'password'"></uni-easyinput> :type="passwordVisible ? 'text' : 'password'"></uni-easyinput>
...@@ -139,7 +141,7 @@ ...@@ -139,7 +141,7 @@
.top-module { .top-module {
width: 350px; width: 350px;
margin-bottom: 48px; margin-bottom: 20px;
text-align: center; text-align: center;
image { image {
...@@ -148,7 +150,7 @@ ...@@ -148,7 +150,7 @@
} }
.title { .title {
font-size: 26px; font-size: 18px;
color: #000000; color: #000000;
line-height: 34px; line-height: 34px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.16); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
......
<template> <template>
<view class="sampleTable"> <view class="sampleTable">
<uni-nav-bar <uni-nav-bar :fixed="true" background-color="rgba(214, 240, 255, 0.0)" status-bar rightWidth="300">
:fixed="true"
background-color="rgba(214, 240, 255, 0.0)"
status-bar
rightWidth="300"
>
<block slot="left"> <block slot="left">
<view class="" @click="back"> <view class="" @click="back">
<text class="iconfont icon-fanhui"></text <text class="iconfont icon-fanhui"></text>
></view> </view>
</block> </block>
</uni-nav-bar> </uni-nav-bar>
...@@ -19,17 +14,11 @@ ...@@ -19,17 +14,11 @@
<view class="container box-shaow-box"> <view class="container box-shaow-box">
<view v-if="isJF" class="image-item top-image"> <view v-if="isJF" class="image-item top-image">
<image <image src="@/static/img/add-img/jf_table_new.png" mode="widthFix"></image>
src="@/static/img/add-img/jf_table.png"
mode="widthFix"
></image>
</view> </view>
<view v-else class="image-item top-image"> <view v-else class="image-item top-image">
<image <image src="@/static/img/add-img/jd_table.png" mode="widthFix"></image>
src="@/static/img/add-img/jd_table.png"
mode="widthFix"
></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -37,7 +26,7 @@ ...@@ -37,7 +26,7 @@
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
isJF: false, isJF: false,
...@@ -59,20 +48,19 @@ export default { ...@@ -59,20 +48,19 @@ export default {
uni.navigateBack(); uni.navigateBack();
}, },
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.sampleTable { .sampleTable {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: linear-gradient( background-image: linear-gradient(90deg,
90deg,
#e9f7fe 0%, #e9f7fe 0%,
#dceffe 40%, #dceffe 40%,
#d5ebfd 66%, #d5ebfd 66%,
#c9e8fe 100% #c9e8fe 100%);
);
.main { .main {
margin-top: -44px; margin-top: -44px;
width: 100%; width: 100%;
...@@ -82,12 +70,9 @@ export default { ...@@ -82,12 +70,9 @@ export default {
.container { .container {
margin: 0 auto; margin: 0 auto;
width: 730rpx;
height: calc(100vh - 44px - var(--status-bar-height) - 20px); height: calc(100vh - 44px - var(--status-bar-height) - 20px);
padding: 23.53rpx 17.65rpx; padding: 23.53rpx 17.65rpx;
padding-bottom: 0; padding-bottom: 0;
// width: 341.18rpx;
overflow: auto; overflow: auto;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -95,7 +80,7 @@ export default { ...@@ -95,7 +80,7 @@ export default {
.image-item { .image-item {
text-align: center; text-align: center;
width: 60%; width: 80%;
height: 100%; height: 100%;
background-color: #ffffff; background-color: #ffffff;
border-radius: 4px; border-radius: 4px;
...@@ -109,7 +94,6 @@ export default { ...@@ -109,7 +94,6 @@ export default {
image { image {
width: 100%; width: 100%;
box-shadow: 0px 0px 9.41rpx 0px rgba(84, 116, 232, 0.2); box-shadow: 0px 0px 9.41rpx 0px rgba(84, 116, 232, 0.2);
// object-fit: contain;
} }
} }
} }
...@@ -117,14 +101,13 @@ export default { ...@@ -117,14 +101,13 @@ export default {
.seize-seat { .seize-seat {
height: 50px; height: 50px;
width: 100%; width: 100%;
background-image: linear-gradient( background-image: linear-gradient(90deg,
90deg,
#e9f7fe 0%, #e9f7fe 0%,
#dceffe 40%, #dceffe 40%,
#d5ebfd 66%, #d5ebfd 66%,
#c9e8fe 100% #c9e8fe 100%);
);
} }
// 导航栏样式 // 导航栏样式
.uni-nav-bar-text { .uni-nav-bar-text {
height: 36px; height: 36px;
...@@ -135,10 +118,11 @@ export default { ...@@ -135,10 +118,11 @@ export default {
border-radius: 50%; border-radius: 50%;
color: #333; color: #333;
text-align: center; text-align: center;
.iconfont { .iconfont {
font-size: 20px; font-size: 20px;
line-height: 36px; line-height: 36px;
} }
} }
} }
</style> </style>
\ No newline at end of file
zI7Z5z3b 别名:__uni__a11bfd5
\ No newline at end of file 密码:zI7Z5z3b
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论