提交 691cf0cd authored 作者: JaxBBLL's avatar JaxBBLL

FIX

上级 fad51e78
......@@ -90,6 +90,7 @@ export default {
createBy,
createTime,
updateTime,
signImg,
inspectionData
) values(
'${data.inspectionType}',
......@@ -103,12 +104,9 @@ export default {
'${data.createBy}',
'${data.createTime}',
'${data.updateTime}',
'${data.signImg}',
'${JSON.stringify(data.inspectionData)}'
)`;
// let has = await this.info(data.id);
// if (has && has.id) {
// await this.remove(data.id);
// }
await sqllitedb.executeSQL(sql);
} catch (e) {
console.log(e.message);
......@@ -130,7 +128,6 @@ export default {
recordName = '${data.recordName}',
inspectionTime = '${data.inspectionTime}',
isException = ${data.isException},
inspectionNumber = ${data.inspectionNumber},
userId = '${data.userId}',
userName = '${data.userName}',
synFlag = ${data.synFlag},
......@@ -138,7 +135,7 @@ export default {
createBy = '${data.createBy}',
createTime = '${data.createTime}',
updateTime = '${data.updateTime}',
inspectionData = '${data.inspectionData}'
inspectionData = '${JSON.stringify(data.inspectionData)}'
WHERE id = ${data.id}`;
await sqllitedb.executeSQL(sql);
} catch (e) {
......
<template>
<!-- 首页 -->
<view class="container">
<navigator url="/pages/test/index" hover-class="navigator-hover">
<button type="default">跳转到新页面</button>
</navigator>
<view class="flex">
<navigator url="/pages/test/index" hover-class="navigator-hover">
<button type="default" class="uni-btn">跳转TEST</button>
</navigator>
<navigator
url="/pages/inspectionContent/inspectionContentList?uid=1"
hover-class="navigator-hover"
>
<button type="default" class="uni-btn">测试巡检</button>
</navigator>
</view>
<!-- 第一个模块 -->
<view class="header">
<view class="title">杭州内网监管在线-运维在线</view>
......@@ -74,92 +82,91 @@
<script>
export default {
data() {
return {
cards: [{
image: '../../static/img/jf.png',
text: '机房巡检',
url:"/pages/inspectionContent/inspectionContentList?backValue=home"
},
{
image: '../../static/img/jd.png',
text: '井道巡检',
url:"/pages/shaftInspection/shaftInspectionList?backValue=home"
},
{
image: '../../static/img/sj.png',
text: '设备上架',
url: "/pages/listingManagement/index?backValue=home"
}
],
userName: this.$store.state.now_user.user,
};
},
computed: {
isAdmin() {
return this.$store.state.now_user.isAdmin;
},
},
created() {
console.log(this.$store.state)
},
methods: {
// 修改密码
updatePassword() {
uni.navigateTo({
url: "/pages/index/editPd",
});
},
//退出
logOut() {
this.$refs.inputDialog2.open();
},
// 查看操作日志
lookLog() {
uni.navigateTo({
url: "/pages/index/operLog",
});
},
// 三模块卡片跳转页面
toList(url){
uni.navigateTo({
url: url,
});
},
// 巡检管理
toInspectionManagement() {
uni.navigateTo({
url: "/pages/inspectionManagement/index?backValue=home",
});
},
toListingManagement() {
uni.navigateTo({
url: "/pages/listingManagement/index?backValue=home",
});
},
// 井道巡检
toShaftInspection() {
uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew?backValue=home",
});
},
//退出--弹出对话框
dialogInputConfirm2() {
uni.redirectTo({
url: "/pages/login/login",
success: () => {
// uni.clearStorage(); //测试将所有缓存清除
uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync(
"last_time",
this.$store.state.now_user.LastSynchronizationTime || ""
);
},
});
},
}
data() {
return {
cards: [
{
image: "../../static/img/jf.png",
text: "机房巡检",
url: "/pages/inspectionContent/inspectionContentList?backValue=home",
},
{
image: "../../static/img/jd.png",
text: "井道巡检",
url: "/pages/shaftInspection/shaftInspectionList?backValue=home",
},
{
image: "../../static/img/sj.png",
text: "设备上架",
url: "/pages/listingManagement/index?backValue=home",
},
],
userName: this.$store.state.now_user.user,
};
},
computed: {
isAdmin() {
return this.$store.state.now_user.isAdmin;
},
},
created() {
console.log(this.$store.state);
},
methods: {
// 修改密码
updatePassword() {
uni.navigateTo({
url: "/pages/index/editPd",
});
},
//退出
logOut() {
this.$refs.inputDialog2.open();
},
// 查看操作日志
lookLog() {
uni.navigateTo({
url: "/pages/index/operLog",
});
},
// 三模块卡片跳转页面
toList(url) {
uni.navigateTo({
url: url,
});
},
// 巡检管理
toInspectionManagement() {
uni.navigateTo({
url: "/pages/inspectionManagement/index?backValue=home",
});
},
toListingManagement() {
uni.navigateTo({
url: "/pages/listingManagement/index?backValue=home",
});
},
// 井道巡检
toShaftInspection() {
uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew?backValue=home",
});
},
//退出--弹出对话框
dialogInputConfirm2() {
uni.redirectTo({
url: "/pages/login/login",
success: () => {
// uni.clearStorage(); //测试将所有缓存清除
uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync(
"last_time",
this.$store.state.now_user.LastSynchronizationTime || ""
);
},
});
},
},
};
</script>
......
......@@ -279,32 +279,36 @@ export default {
return res;
});
},
listFormat(baseList) {
const roomFeatureMap = {
1: "1",
2: "0",
3: "2",
};
let list = baseList.map((item, index) => {
const jfType = roomFeatureMap[item.roomFeature];
return {
id: item.id,
name: item.roomName,
value: item.dictValue,
/** 只是为了映射jfType,为了兼容之前的逻辑
* 前端用的:jfType 机房类型 0屏蔽  1汇聚  2电池间(1) 3电池间(2)
* roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房
*/
jfType: item.dictValue == "11" ? "3" : jfType,
isVaild: item.isVaild || false, // 校验通过
status: item.status || 0,
statusLable: item.statusLable || "未巡检",
};
});
return list;
},
init(baseList) {
this.value = baseList[0].dictValue;
return new Promise((resolve, reject) => {
const roomFeatureMap = {
1: "1",
2: "0",
3: "2",
};
let list = baseList.map((item, index) => {
const jfType = roomFeatureMap[item.roomFeature];
return {
id: item.id,
name: item.roomName,
value: item.dictValue,
/** 只是为了映射jfType,为了兼容之前的逻辑
* 前端用的:jfType 机房类型 0屏蔽  1汇聚  2电池间(1) 3电池间(2)
* roomFeature 机房类型枚举:1.汇聚机房,2.屏蔽机房,3.UPS机房,4.数据机房
*/
jfType: item.dictValue == "11" ? "3" : jfType,
isVaild: item.isVaild || false, // 校验通过
status: item.status || 0,
statusLable: item.statusLable || "未巡检",
};
});
let list = this.listFormat(baseList);
this.listData = this.deepClone(list);
console.log("this.listData", this.listData);
const group1 = list.slice(0, 5);
......@@ -364,10 +368,12 @@ export default {
return inspectApi
.info(uid)
.then((res) => {
console.log("before sqlToData", res);
const detailsInfo = sqlToData(res);
console.log("getDetails", detailsInfo);
this.listData = this.deepClone(detailsInfo.originData);
// this.listData = this.deepClone(detailsInfo.originData);
this.listData = this.listFormat(detailsInfo.originData);
this.detailsInfo = detailsInfo;
this.inspectionNumber = detailsInfo.inspectionNumber;
......
......@@ -140,7 +140,7 @@
<script>
import assRoomApi from "@/api/assRoom.js";
import inspectApi from "@/api/inspect.js";
import { dataToSql } from "./shared";
import { dataToSql, sqlToData } from "./shared";
import {
pad_all_inspection_position,
......@@ -243,6 +243,7 @@ export default {
this.inspectionCode = options.inspectionCode;
this.backValue = options.backValue || "";
this.imgSrc = `../../static/img/jf/jf${this.value}.png`;
this.tabs =
this.jfType === "2" || this.jfType === "3"
? this.deepClone(tabsInfo2)
......@@ -299,12 +300,12 @@ export default {
// 回显数据
getDetails(uid) {
uni.showLoading();
getInspectionDetails(uid)
inspectApi
.info(uid)
.then((res) => {
const detailsInfo = res;
console.log("查看tabs", this.tabs);
const detailsInfo = sqlToData(res);
this.list = detailsInfo.originData[this.value - 1].details;
console.log("查看list", this.list);
this.tabs.forEach((item) => {
if (
this.list[item.value] &&
......@@ -314,8 +315,6 @@ export default {
}
});
console.log("查看tabs2", this.tabs);
// this.inspectionResult = list[0].inspectionResult;
this.detailsInfo = detailsInfo;
console.log("detailsInfo", detailsInfo);
......@@ -343,6 +342,7 @@ export default {
// 处理提交数据
getParams(isSubmit) {
console.log("this.getParams", this.uid, this.value);
console.log("originData", this.detailsInfo.originData);
if (this.uid) {
let posItem = this.detailsInfo.originData[this.value - 1];
let paramsObj = this.getAllChildFormData(); //获取所有数据
......@@ -493,8 +493,9 @@ export default {
},
realSave(data) {
const send = dataToSql(data);
inspectApi.save(send).then((res) => {
console.log(res);
const api = this.uid ? inspectApi.update : inspectApi.save;
api(this.uid ? { id: this.uid, ...send } : send).then((res) => {
console.log("保存成功");
});
},
// 提交
......
......@@ -10,16 +10,15 @@ export function dataToSql(data) {
synFlag = data.synchronization;
}
const send = {
id: Math.random().toString(36).substring(2, 15),
inspectionType: data.inspectionType,
inspectionCode: data.inspectionCode,
recordName: `${moment().format("yyyyMMDD")}-机房巡检`,
inspectionTime: moment().format("yyyy-MM-DD HH:mm"),
isException: data.isException,
isException: data.isException, // 是否异常:0 否 1 是 2 巡检中
userId: store.state.now_user.userId,
userName: store.state.now_user.user,
synFlag: synFlag, // 0.未同步,1.已同步,2.编辑
signImg: data.signImg,
signImg: data.signImg || "",
createBy: store.state.now_user.userId,
createTime: data.id ? data.createTime : `${new Date().getTime()}`,
updateTime: `${new Date().getTime()}`,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论