提交 983c0c25 authored 作者: 邓文彬's avatar 邓文彬

fix(Pad): 数据读写完成

上级 613f9905
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
**/*.log
tests/**/coverage/
tests/e2e/reports
selenium-debug.log
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.local
package-lock.json
yarn.lock
...@@ -8,22 +8,125 @@ import { ...@@ -8,22 +8,125 @@ import {
createFileWithPlusIO, createFileWithPlusIO,
readFileContent, readFileContent,
USER_LiST, USER_LiST,
USER_FILE_NAME USER_FILE_NAME,
} from "./utils/systemCofig"; } from "./utils/systemCofig";
import { Base64 } from "js-base64"; import { Base64 } from "js-base64";
import {
readDirectoryData
} from "@/utils/IoReadingAndWriting.js";
export default { export default {
onLaunch: function () { onLaunch: function () {
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.screen.lockOrientation("landscape-primary"); //锁定横屏 plus.screen.lockOrientation("landscape-primary"); //锁定横屏
// #endif // #endif
this.init();
// #ifdef APP-PLUS
plus.android.requestPermissions(
["android.permission.WRITE_EXTERNAL_STORAGE"],
function (e) {
if (e.deniedAlways.length > 0) {
//权限被永久拒绝
// 弹出提示框解释为何需要读写手机储存权限,引导用户打开设置页面开启
uni.showModal({
title: "存储权限",
content: "您拒绝了存储权限,请去设置-应用开启存储权限。",
success: function (res) {
if (res.confirm) {
// console.log('用户点击确定');
} else if (res.cancel) {
// console.log('用户点击取消');
}
},
});
}
if (e.deniedPresent.length > 0) {
//权限被临时拒绝
// 弹出提示框解释为何需要读写手机储存权限,可再次调用plus.android.requestPermissions申请权限
plus.android.requestPermissions([
"android.permission.WRITE_EXTERNAL_STORAGE",
]);
}
if (e.granted.length > 0) {
//权限被允许
init();
}
},
function (e) {}
);
// #endif
// if (!uni.getStorageSync("all_data")) {
// uni.setStorageSync("all_data", []);
// } else {
// this.$store.state.all_data = uni.getStorageSync("all_data");
// }
// if (!uni.getStorageSync("last_time")) {
// uni.setStorageSync("last_time", "");
// } else {
// // console.log('有数据',2);
// this.$store.state.last_time = uni.getStorageSync("last_time");
// }
// if (!uni.getStorageSync("oper_record")) {
// uni.setStorageSync("oper_record", []);
// } else {
// // console.log('有数据',3);
// this.$store.state.oper_record = uni.getStorageSync("oper_record");
// }
// if (
// uni.getStorageSync("now_user") &&
// JSON.stringify(uni.getStorageSync("now_user")) !== "{}"
// ) {
// this.$store.commit("SET_USER", uni.getStorageSync("now_user"));
// } else {
// uni.navigateTo({
// url: "/pages/login/login",
// });
// }
},
onShow: function () {
// console.log(
// "-onShowonShowonShowonShowonShowonShowonShowonShowonShowonShow-----"
// );
// this.init();
const now_user = uni.getStorageSync("now_user") || {}
if(now_user.name){
this.$store.commit("SET_USER", now_user);
console.log('----------------------------------------------------')
readDirectoryData()
}
// this.$store.state.all_data = uni.getStorageSync("all_data") || []
// this.$store.state.darf_data = uni.getStorageSync("darf_data") || {}
// this.$store.state.last_time = uni.getStorageSync("last_time") || ""
},
onHide: function () {
// app关闭时将数据存储到本地缓存
// uni.setStorageSync("darf_data", this.$store.state.darf_data);
// uni.setStorageSync("all_data", this.$store.state.all_data);
uni.setStorageSync("now_user", this.$store.state.now_user);
// uni.setStorageSync("last_time", this.$store.state.last_time);
console.log("--onHideonHideonHideonHideonHideonHideonHideonHideonHideonHideonHideonHideonHideonHide---")
// uni.clearStorage(); //测试将所有缓存清除
},
onUnload() {},
methods: {
/** /**
* 第一步: 检查目录是否存在,如果没有就创建 * 第一步: 检查目录是否存在,如果没有就创建
* 第二步:检查指定文件是否存在,如果存在就读取内容;否则就创建文件,并写入初始化数据 * 第二步:检查指定文件是否存在,如果存在就读取内容;否则就创建文件,并写入初始化数据
* 第三步:存储读取到的数据 * 第三步:存储读取到的数据
*/ */
async function init() { async init() {
checkAndCreateDirectory(SYNCHRONIZE_DATA_PAD) checkAndCreateDirectory(SYNCHRONIZE_DATA_PAD)
.then(() => { .then(() => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -77,88 +180,8 @@ export default { ...@@ -77,88 +180,8 @@ export default {
.catch((error) => { .catch((error) => {
console.log("---目录创建失败", error); console.log("---目录创建失败", error);
}); });
} },
init();
// #ifdef APP-PLUS
plus.android.requestPermissions(
["android.permission.WRITE_EXTERNAL_STORAGE"],
function (e) {
if (e.deniedAlways.length > 0) {
//权限被永久拒绝
// 弹出提示框解释为何需要读写手机储存权限,引导用户打开设置页面开启
uni.showModal({
title: "存储权限",
content: "您拒绝了存储权限,请去设置-应用开启存储权限。",
success: function (res) {
if (res.confirm) {
// console.log('用户点击确定');
} else if (res.cancel) {
// console.log('用户点击取消');
}
},
});
}
if (e.deniedPresent.length > 0) {
//权限被临时拒绝
// 弹出提示框解释为何需要读写手机储存权限,可再次调用plus.android.requestPermissions申请权限
plus.android.requestPermissions([
"android.permission.WRITE_EXTERNAL_STORAGE",
]);
}
if (e.granted.length > 0) {
//权限被允许
init();
}
},
function (e) {}
);
// #endif
if (!uni.getStorageSync("all_data")) {
uni.setStorageSync("all_data", []);
} else {
this.$store.state.all_data = uni.getStorageSync("all_data");
}
if (!uni.getStorageSync("last_time")) {
uni.setStorageSync("last_time", "");
} else {
// console.log('有数据',2);
this.$store.state.last_time = uni.getStorageSync("last_time");
}
if (!uni.getStorageSync("oper_record")) {
uni.setStorageSync("oper_record", []);
} else {
// console.log('有数据',3);
this.$store.state.oper_record = uni.getStorageSync("oper_record");
}
if (
uni.getStorageSync("now_user") &&
JSON.stringify(uni.getStorageSync("now_user")) !== "{}"
) {
this.$store.commit("SET_USER", uni.getStorageSync("now_user"));
} else {
uni.navigateTo({
url: "/pages/login/login",
});
}
}, },
onShow: function () {},
onHide: function () {
// app关闭时将数据存储到本地缓存
uni.setStorageSync("oper_record", this.$store.state.oper_record);
uni.setStorageSync("all_data", this.$store.state.all_data);
uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync("last_time", this.$store.state.last_time);
// uni.clearStorage(); //测试将所有缓存清除
},
onUnload() {},
}; };
</script> </script>
...@@ -172,9 +195,9 @@ export default { ...@@ -172,9 +195,9 @@ export default {
} }
@font-face { @font-face {
font-family: "iconfont"; /* Project id 4374193 */ font-family: "iconfont"; /* Project id 4374193 */
src: url('~@/static/iconFont/iconfont.woff2?t=1725876968365') format('woff2'), src: url("~@/static/iconFont/iconfont.woff2?t=1725876968365") format("woff2"),
url('~@/static/iconFont/iconfont.woff?t=1725876968365') format('woff'), url("~@/static/iconFont/iconfont.woff?t=1725876968365") format("woff"),
url('~@/static/iconFont/iconfont.ttf?t=1725876968365') format('truetype'); url("~@/static/iconFont/iconfont.ttf?t=1725876968365") format("truetype");
} }
// @font-face { // @font-face {
......
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
"resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz", "resolved": "https://registry.npmmirror.com/jsbn/-/jsbn-1.1.0.tgz",
"integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A=="
}, },
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"moment": { "moment": {
"version": "2.30.1", "version": "2.30.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
}, },
"dependencies": { "dependencies": {
"js-base64": "^3.7.5", "js-base64": "^3.7.5",
"lodash": "^4.17.21",
"moment": "^2.30.1", "moment": "^2.30.1",
"sm-crypto": "^0.3.12" "sm-crypto": "^0.3.12"
} }
......
...@@ -42,15 +42,9 @@ ...@@ -42,15 +42,9 @@
<!-- 同步管理 --> <!-- 同步管理 -->
<SynchronousManagement v-if="activeTabIndex == 2" /> <SynchronousManagement v-if="activeTabIndex == 2" />
<RouterView /> <RouterView />
</view> </view>
<!-- 退出账号弹出 --> <!-- 退出账号弹出 -->
<uni-popup ref="inputDialog2" type="dialog"> <uni-popup ref="inputDialog2" type="dialog">
<uni-popup-dialog <uni-popup-dialog
...@@ -68,7 +62,7 @@ ...@@ -68,7 +62,7 @@
import InspectionItem from "@/components/inspectionItem/index.vue"; import InspectionItem from "@/components/inspectionItem/index.vue";
import InspectionManagement from "@/pages/inspectionManagement/index.vue"; import InspectionManagement from "@/pages/inspectionManagement/index.vue";
import SynchronousManagement from "@/pages/synchronousManagement/index.vue"; import SynchronousManagement from "@/pages/synchronousManagement/index.vue";
import OperLog from "@/pages/index/operLog.vue" import OperLog from "@/pages/index/operLog.vue";
import Content from "./content.vue"; import Content from "./content.vue";
...@@ -78,7 +72,7 @@ export default { ...@@ -78,7 +72,7 @@ export default {
Content, Content,
InspectionManagement, InspectionManagement,
SynchronousManagement, SynchronousManagement,
OperLog OperLog,
}, },
data() { data() {
return { return {
...@@ -100,8 +94,7 @@ export default { ...@@ -100,8 +94,7 @@ export default {
text: "同步管理", text: "同步管理",
}, },
], ],
userName: this.$store.state.now_user.user userName: this.$store.state.now_user.user,
}; };
}, },
methods: { methods: {
...@@ -128,6 +121,8 @@ export default { ...@@ -128,6 +121,8 @@ export default {
url: "/pages/login/login", url: "/pages/login/login",
success() { success() {
_this.$store.commit("SET_USER", {}); _this.$store.commit("SET_USER", {});
// uni.clearStorage(); //测试将所有缓存清除
}, },
}); });
}, },
......
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,7 @@
<script> <script>
import timeSelect from "@/components/global/timeSelect.vue"; import timeSelect from "@/components/global/timeSelect.vue";
import lodash from "lodash"
export default { export default {
components: { components: {
timeSelect, timeSelect,
...@@ -117,30 +118,7 @@ export default { ...@@ -117,30 +118,7 @@ export default {
text: "其他", text: "其他",
value: "其他", value: "其他",
}, },
// {
// text: "全部",
// value: "",
// },
// {
// text: "机房巡检",
// value: "巡检",
// },
// {
// text: "报修",
// value: "报修",
// },
// {
// text: "报告",
// value: "报告",
// },
// {
// text: "同步",
// value: "同步",
// },
// {
// text: "其他",
// value: "其他",
// },
], ],
searchForm: { searchForm: {
type: "", type: "",
...@@ -155,13 +133,12 @@ export default { ...@@ -155,13 +133,12 @@ export default {
uni.navigateBack(); uni.navigateBack();
}, },
onLoad() { onLoad() {
this.recordData = this.$store.state.oper_record; this.recordData = lodash.flattenDeep(this.$store.state.log_list);
this.getData(); this.getData();
}, },
methods: { methods: {
change(e) { change(e) {
this.searchForm.type = e; this.searchForm.type = e;
console.log("---", e);
this.getData(); this.getData();
}, },
...@@ -185,6 +162,7 @@ export default { ...@@ -185,6 +162,7 @@ export default {
getData() { getData() {
this.loading = true; this.loading = true;
const { type, startTime, endTime } = this.searchForm; const { type, startTime, endTime } = this.searchForm;
console.log("--this.recordData--", this.recordData)
this.tableData = this.recordData.filter((item) => { this.tableData = this.recordData.filter((item) => {
let matchType = true; // 类型筛选 let matchType = true; // 类型筛选
...@@ -203,7 +181,6 @@ export default { ...@@ -203,7 +181,6 @@ export default {
this.loading = false; this.loading = false;
console.log("-- this.tableData-", this.tableData);
}, },
}, },
}; };
......
...@@ -263,14 +263,12 @@ export default { ...@@ -263,14 +263,12 @@ export default {
const params = this.getParams(); const params = this.getParams();
const all_data = this.$store.state.all_data; const all_data = this.$store.state.all_data;
// const time = moment().format("yyyy-MM-DD");
// const tempItem = all_data[time] || [];
// console.log("ssss-", all_data)
all_data.push(params); all_data.push(params);
// all_data[time] = tempItem;
// all_data.push(params); // console.log("--params--",all_data, params)
// return
// 更新巡检list // 更新巡检list
this.$store.commit("SET_ALL_DATA", all_data); this.$store.commit("SET_ALL_DATA", all_data);
...@@ -281,6 +279,7 @@ export default { ...@@ -281,6 +279,7 @@ export default {
const log_list = this.$store.state.log_list; const log_list = this.$store.state.log_list;
log_list.push(logContent); log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list); this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list).then((res) => { addLog(log_list).then((res) => {
console.log("日志文件写入成功"); console.log("日志文件写入成功");
}); });
...@@ -301,6 +300,13 @@ export default { ...@@ -301,6 +300,13 @@ export default {
icon: `${vaild ? "success" : "error"}`, icon: `${vaild ? "success" : "error"}`,
title: `${vaild ? "校验通过" : "请完善填写内容"}`, title: `${vaild ? "校验通过" : "请完善填写内容"}`,
}); });
uni.redirectTo({
url: "/pages/home/home?tabIndex=1",
success() {
uni.hideLoading();
},
});
}); });
}, },
......
...@@ -37,6 +37,8 @@ import { ...@@ -37,6 +37,8 @@ import {
LOG_TYPE_ENUM, LOG_TYPE_ENUM,
getLogContent, getLogContent,
addLog, addLog,
readDirectoryData,
} from "@/utils/IoReadingAndWriting.js"; } from "@/utils/IoReadingAndWriting.js";
export default { export default {
...@@ -107,12 +109,12 @@ export default { ...@@ -107,12 +109,12 @@ export default {
key: "user_data", key: "user_data",
success: function (res) { success: function (res) {
this.personList = JSON.parse(res.data); this.personList = JSON.parse(res.data);
console.log("---this.personList", this.personList); // console.log("---this.personList", this.personList);
}, },
}); });
} }
} catch (e) {} } catch (e) {}
console.log(this.personList, "用户数据"); // console.log(this.personList, "用户数据");
}, },
// 点击登录 // 点击登录
...@@ -131,6 +133,11 @@ export default { ...@@ -131,6 +133,11 @@ export default {
return true; return true;
} }
}); });
uni.showLoading({
title: "加载中",
});
// 存在该账号 // 存在该账号
if (obj) { if (obj) {
// 判断账号密码是否正确 // 判断账号密码是否正确
...@@ -138,13 +145,10 @@ export default { ...@@ -138,13 +145,10 @@ export default {
this.person.user == this.personList[key].user && this.person.user == this.personList[key].user &&
this.person.pd == this.personList[key].passWord this.person.pd == this.personList[key].passWord
) { ) {
uni.showToast({
title: "登录成功",
icon: "none",
duration: 2000,
});
// this.$store.state.now_user = this.personList[key] // this.$store.state.now_user = this.personList[key]
this.$store.commit("SET_USER", this.personList[key]); this.$store.commit("SET_USER", this.personList[key]);
uni.setStorageSync("now_user", this.personList[key]);
// let timeStr = getDateTime.dateTimeStr("y-m-d h:i"); // let timeStr = getDateTime.dateTimeStr("y-m-d h:i");
// let operData = { // let operData = {
// name: this.$store.state.now_user.name, // name: this.$store.state.now_user.name,
...@@ -156,23 +160,50 @@ export default { ...@@ -156,23 +160,50 @@ export default {
// time: timeStr, // time: timeStr,
// }; // };
// 读取文件夹数据
readDirectoryData()
.then((res) => {
// 更新日志信息
const logContent = getLogContent(LOG_TYPE_ENUM.login);
const log_list = this.$store.state.log_list;
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list);
// uni.showToast({
// title: "登录成功",
// icon: "none",
// duration: 2000,
// });
uni.navigateTo({
url: "/pages/home/home",
});
uni.hideLoading();
})
.catch((error) => {
console.log("--login.vue--", error);
uni.hideLoading();
});
// return;
// this.$store.state.oper_record.unshift(operData); // this.$store.state.oper_record.unshift(operData);
console.log("--this.personList[key]-", this.personList[key]); // console.log("--this.personList[key]-", this.personList[key]);
// 检查文件夹是否创建 // 检查文件夹是否创建, 没有就创建
checkAndCreateDirectory( // checkAndCreateDirectory(
`${SYNCHRONIZE_DATA_PAD}/${this.$store.state.now_user.user}` // `${SYNCHRONIZE_DATA_PAD}/${this.$store.state.now_user.user}`
); // );
// 更新日志信息 // 更新日志信息
const logContent = getLogContent( // const logContent = getLogContent(LOG_TYPE_ENUM.login);
LOG_TYPE_ENUM.login // addLog(logContent);
);
addLog(logContent); // uni.navigateTo({
// url: "/pages/home/home",
// });
uni.navigateTo({
url: "/pages/home/home",
});
// 密码不正确 // 密码不正确
} else { } else {
uni.showToast({ uni.showToast({
...@@ -180,6 +211,7 @@ export default { ...@@ -180,6 +211,7 @@ export default {
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
uni.hideLoading();
} }
// 不存在该账号 // 不存在该账号
} else { } else {
...@@ -188,6 +220,7 @@ export default { ...@@ -188,6 +220,7 @@ export default {
icon: "none", icon: "none",
duration: 2000, duration: 2000,
}); });
uni.hideLoading();
} }
// 未输入账号或者密码 // 未输入账号或者密码
} else { } else {
......
...@@ -65,6 +65,17 @@ ...@@ -65,6 +65,17 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 退出账号弹出 -->
<uni-popup ref="inputDialog2" type="dialog">
<uni-popup-dialog
ref="inputClose2"
mode="base"
title="确定删除巡检内容?"
@confirm="dialogInputConfirm2"
>
</uni-popup-dialog>
</uni-popup>
</view> </view>
</template> </template>
...@@ -118,13 +129,27 @@ export default { ...@@ -118,13 +129,27 @@ export default {
}; };
}); });
}, },
//--弹出对话框
dialogInputConfirm2() {
uni.redirectTo({
url: "/pages/home/home?tabIndex=1",
success: () => {
// 清空草稿数据
this.$store.commit("SET_DARF_DATA", {}); // 缓存[巡检信息]
writeDarf("").then((res) => {
console.log("写入草稿文件成功");
});
// 删除 // 清空基础缓存信息
deleteClick() { this.$store.commit("SET_TEMP_DATA", {}); // 缓存[巡检信息]
uni.showToast({ },
title: "删除",
}); });
}, },
// 删除
deleteClick() {
this.$refs.inputDialog2.open();
},
// tab选中change 时间 // tab选中change 时间
changeTab(index, item) { changeTab(index, item) {
console.log("-index--", index); console.log("-index--", index);
...@@ -226,7 +251,6 @@ export default { ...@@ -226,7 +251,6 @@ export default {
}); });
// 清空草稿数据 // 清空草稿数据
this.$store.commit("SET_DARF_DATA", {}); // 缓存[巡检信息] this.$store.commit("SET_DARF_DATA", {}); // 缓存[巡检信息]
writeDarf("").then((res) => { writeDarf("").then((res) => {
console.log("写入草稿文件成功"); console.log("写入草稿文件成功");
...@@ -241,6 +265,13 @@ export default { ...@@ -241,6 +265,13 @@ export default {
icon: `${vaild ? "success" : "error"}`, icon: `${vaild ? "success" : "error"}`,
title: `${vaild ? "提交成功" : "请完善填写内容"}`, title: `${vaild ? "提交成功" : "请完善填写内容"}`,
}); });
uni.redirectTo({
url: "/pages/home/home?tabIndex=1",
success() {
uni.hideLoading();
},
});
}); });
}, },
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<text class="title">待打包数据</text> <text class="title">待打包数据</text>
</view> </view>
<view class="row-item count-num"> <view class="row-item count-num">
<text class="num">132</text> <text class="num">{{ all_data.length }}</text>
<text></text> <text></text>
</view> </view>
...@@ -53,8 +53,14 @@ export default { ...@@ -53,8 +53,14 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
all_data: []
}; };
}, },
mounted() {
// const all_data = this.$store.state.all_data;
this.all_data = this.$store.state.all_data || [];
},
methods: { methods: {
change(e) { change(e) {
console.log("----", e); console.log("----", e);
...@@ -65,11 +71,11 @@ export default { ...@@ -65,11 +71,11 @@ export default {
packedData() { packedData() {
this.loading = true; this.loading = true;
const userName = this.$store.state.now_user.name; const userName = this.$store.state.now_user.name;
const all_user_data = this.$store.state.all_user_data; const all_data = this.$store.state.all_data;
let timeStr = getDateTime.dateTimeStr("y-m-d h-i-s"); let timeStr = getDateTime.dateTimeStr("y-m-d h-i-s");
let fileName = `${userName}${timeStr}.txt`; let fileName = `${userName}${timeStr}.txt`;
const fileContent = setSm2( Base64.encode(JSON.stringify(all_user_data))); const fileContent = setSm2( Base64.encode(JSON.stringify(all_data)));
createFileWithPlusIO( createFileWithPlusIO(
`${SYNCHRONIZE_DATA_PAD}/同步数据`, `${SYNCHRONIZE_DATA_PAD}/同步数据`,
fileName, fileName,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<!-- 结果 --> <!-- 结果 -->
<view class="synchronous-management-content"> <view class="synchronous-management-content">
<view class="count-tatal"> <view class="count-tatal">
<text class="num">{{ list.length || 0 }}</text> <text class="num">{{ countNum|| 0 }}</text>
<text>查询结果</text> <text>查询结果</text>
</view> </view>
...@@ -57,6 +57,7 @@ export default { ...@@ -57,6 +57,7 @@ export default {
searchForm: { searchForm: {
// 搜索条件 // 搜索条件
}, },
countNum: 0, // 统计查询总数
}; };
}, },
mounted() { mounted() {
...@@ -97,20 +98,22 @@ export default { ...@@ -97,20 +98,22 @@ export default {
console.log("--timeFrame-", timeFrame); console.log("--timeFrame-", timeFrame);
const list = [];
// 第二步: 根据搜索条件过滤 // 第二步: 根据搜索条件过滤
timeFrame.forEach((key) => { const list = timeFrame.map((key) => {
list.push({ return {
time: key, time: key,
list: this.coverData(tempAllData[key]), list: this.coverData(tempAllData[key]),
}); };
}); });
// this.list = this.all_data // this.list = this.all_data
console.log("timeFramea", timeFrame); // console.log("timeFramea", timeFrame);
console.log("this.all_data", all_data); // console.log("this.all_data", all_data);
console.log("this.list", list); // console.log("this.list", list);
list.forEach((item) => {
this.countNum += item.list.length;
});
this.list = list; this.list = list;
}, },
......
...@@ -3,7 +3,7 @@ import Vuex from "vuex"; ...@@ -3,7 +3,7 @@ import Vuex from "vuex";
Vue.use(Vuex); Vue.use(Vuex);
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
oper_record: [], // 保存操作记录数据--日志数据 --弃用 // oper_record: [], // 保存操作记录数据--日志数据 --弃用
all_data: [], // 保存页面数据 -- 所有的巡检数据,list列表 all_data: [], // 保存页面数据 -- 所有的巡检数据,list列表
all_user_data: [], //所有用户信息 -- list列表, all_user_data: [], //所有用户信息 -- list列表,
...@@ -76,7 +76,7 @@ const store = new Vuex.Store({ ...@@ -76,7 +76,7 @@ const store = new Vuex.Store({
state.all_data = payload; state.all_data = payload;
}, },
SET_LOG_LIST(state, payload) { SET_LOG_LIST(state, payload) {
console.log("payload", payload); console.log("保存 日志文件----", payload);
// 保存 日志文件 // 保存 日志文件
state.log_list = payload; state.log_list = payload;
}, },
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<script>
var __UniViewStartTime__ = Date.now();
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title>View</title>
<link rel="stylesheet" href="view.css" />
</head>
<body>
<div id="app"></div>
<script src="__uniappes6.js"></script>
<script src="view.umd.min.js"></script>
<script src="app-view.js"></script>
</body>
</html>
var isReady=false;var onReadyCallbacks=[];
var isServiceReady=false;var onServiceReadyCallbacks=[];
var __uniConfig = {"pages":["pages/home/home","pages/index/index","pages/index/operLog","pages/synchronization/synchronization","pages/inspection/inspection","pages/inspection/inspFirst","pages/inspection/inspDetail","pages/inspection/sampleTable","pages/inspection/lookInsp","pages/inspection/inspProcess","pages/repair/repair","pages/repair/repairDetail","pages/repair/showRapair","pages/report/report","pages/report/lookReport","pages/report/reportInfo","pages/report/sampleTable","pages/repair/sampleTable","pages/login/login","pages/report/report-detail/deatil_first","pages/index/editPd","pages/home/home","pages/inspectionPage/inspectionPage","pages/inspectionContent/inspectionContent","pages/shaftInspection/shaftInspection"],"window":{"pageOrientation":"landscape","navigationStyle":"custom","rpxCalcMaxDeviceWidth":2000,"rpxCalcIncludeWidth":750},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"巡检管理","compilerVersion":"4.24","entryPagePath":"pages/home/home","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
var __uniRoutes = [{"path":"/pages/home/home","meta":{"isQuit":true},"window":{"navigationBarTitleText":""}},{"path":"/pages/index/index","meta":{},"window":{}},{"path":"/pages/index/operLog","meta":{},"window":{}},{"path":"/pages/synchronization/synchronization","meta":{},"window":{}},{"path":"/pages/inspection/inspection","meta":{},"window":{}},{"path":"/pages/inspection/inspFirst","meta":{},"window":{}},{"path":"/pages/inspection/inspDetail","meta":{},"window":{}},{"path":"/pages/inspection/sampleTable","meta":{},"window":{}},{"path":"/pages/inspection/lookInsp","meta":{},"window":{}},{"path":"/pages/inspection/inspProcess","meta":{},"window":{}},{"path":"/pages/repair/repair","meta":{},"window":{}},{"path":"/pages/repair/repairDetail","meta":{},"window":{}},{"path":"/pages/repair/showRapair","meta":{},"window":{}},{"path":"/pages/report/report","meta":{},"window":{}},{"path":"/pages/report/lookReport","meta":{},"window":{}},{"path":"/pages/report/reportInfo","meta":{},"window":{}},{"path":"/pages/report/sampleTable","meta":{},"window":{}},{"path":"/pages/repair/sampleTable","meta":{},"window":{}},{"path":"/pages/login/login","meta":{},"window":{}},{"path":"/pages/report/report-detail/deatil_first","meta":{},"window":{}},{"path":"/pages/index/editPd","meta":{},"window":{}},{"path":"/pages/inspectionPage/inspectionPage","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pages/inspectionContent/inspectionContent","meta":{},"window":{"navigationBarTitleText":""}},{"path":"/pages/shaftInspection/shaftInspection","meta":{},"window":{"navigationBarTitleText":""}}];
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/
/******/ return result;
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "app-config": 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "/";
/******/
/******/ var jsonpArray = this["webpackJsonp"] = this["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // run deferred modules from other chunks
/******/ checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ([]);
\ No newline at end of file
No preview for this file type
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论