提交 5833726b authored 作者: 邓文彬's avatar 邓文彬

fix(功能走查): 上次登录时间逻辑, 待完善

上级 5520d488
......@@ -116,7 +116,6 @@ export default {
.then((res) => {
// 获取文件数据
let userData = Base64.decode(res);
console.log("---读取用户数据", res);
uni.setStorage({
key: "user_data",
......
<template>
<view class="empty-components">
暂无数据
<image
class="bg-img"
mode="aspectFill"
src="@/static/img/add-img/empty.png"
alt=""
>
</image>
</view>
</template>
<script>
export default {
name: 'Empty',
props: {
text: {
type: String,
default: ''
}
}
}
export default {
name: "Empty",
props: {
text: {
type: String,
default: "",
},
},
};
</script>
<style scoped lang="less">
.empty-components{
.empty-components {
width: 100%;
height: 80%;
display: flex;
align-items: center;
justify-content: center;
// border: 1px solid;
// text-align: center;
.bg-img {
width: 200px;
height: 200px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -92,9 +92,9 @@ export default {
height: 84px;
box-sizing: border-box;
position: relative;
background-image: linear-gradient(-67deg, #ffab2487, #ffab2425 50%);
background-image: linear-gradient(-67deg, #ffab2423, #ffab2411 50%);
.name {
background: #ffab2471;
background: #ffab2423;
border-radius: 12px;
width: 54px;
height: 54px;
......@@ -163,14 +163,14 @@ export default {
}
.synchronization {
background-image: linear-gradient(-67deg, #9c9c9c, #9c9c9c 50%);
background-image: linear-gradient(-67deg, #9c9c9c16, #9c9c9c09 50%);
.name {
background: #7c7c7ca0;
background: #9c9c9c16;
border-radius: 12px;
color: #4a4a4a;
}
.status {
background: #e0e0e0 !important;
background: #9c9c9c16 !important;
color: #4a4a4a !important;
}
}
......
......@@ -2,6 +2,7 @@
<view class="search-com">
<view class="search-com-left">
<uni-data-select
v-if="!hiddenSearch.includes('inspectionType')"
class="uni-search-item"
v-model="searchFrom.inspectionType"
:localdata="inspectArr"
......@@ -11,27 +12,30 @@
></uni-data-select>
<uni-data-select
v-if="!hiddenSearch.includes('synchronization')"
class="uni-search-item"
v-model="searchFrom.synchronization"
:localdata="synchronization"
placeholder="全部"
@change="(e) => change(e, 'synchronization')"
:clear="true"
></uni-data-select>
<uni-data-select
v-if="!hiddenSearch.includes('isException')"
class="uni-search-item"
v-model="searchFrom.isException"
:localdata="exceptionArr"
placeholder="有无异常"
@change="(e) => change(e, 'isException')"
:clear="true"
></uni-data-select>
</view>
<view class="search-com-right">
<view
class="search-com-right"
v-if="!hiddenSearch.includes('inspectionTime')"
>
<uni-datetime-picker
class="uni-datetime-picker"
type="daterange"
......@@ -44,6 +48,15 @@
</template>
<script>
export default {
props: {
hiddenSearch: {
// 隐藏搜索项
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
searchFrom: {
......
......@@ -63,7 +63,7 @@
<view class="inspect-list">
<InspectionItem
v-for="ele in item.list"
:key="ele.inspectionCode"
:key="ele.uid"
:details="ele"
/>
</view>
......
......@@ -59,7 +59,6 @@
</template>
<script>
import InspectionItem from "@/components/inspectionItem/index.vue";
import InspectionManagement from "@/pages/inspectionManagement/index.vue";
import SynchronousManagement from "@/pages/synchronousManagement/index.vue";
import OperLog from "@/pages/index/operLog.vue";
......@@ -68,7 +67,6 @@ import Content from "./content.vue";
export default {
components: {
InspectionItem,
Content,
InspectionManagement,
SynchronousManagement,
......
......@@ -98,8 +98,9 @@ export default {
typeList: [
{ value: "", text: "全部" },
{ value: 1, text: "机房巡检" },
{ value: 2, text: "井道巡检" },
{ value: "1", text: "巡检" },
{ value: "2", text: "同步" },
{
text: "其他",
value: "-1",
......@@ -163,16 +164,23 @@ export default {
getData() {
this.loading = true;
const { type, startTime, endTime } = this.searchForm;
console.log("--this.recordData--", this.recordData);
this.tableData = this.recordData.filter((item) => {
let matchType = true; // 类型筛选
let matchTime = true; // 时间筛选
if (type) {
if (type == -1) {
matchType = Object.values(LOG_TYPE_ENUM).indexOf(item.type) > -1;
} else {
matchType = item.inspectionType == type || item.inspectionType == type;
// [其他]搜索项
matchType =
Object.values(LOG_TYPE_ENUM).indexOf(item.type) > -1 &&
!item.inspectionType &&
item.module.indexOf("同步") < 0;
} else if (type == 1) {
// [巡检]搜索项
matchType = (item.inspectionType || 0) > 0;
} else if (type == 2) {
// [同步]搜索项
matchType = item.module.indexOf("同步") > -1;
}
}
......
......@@ -103,8 +103,8 @@ export default {
init() {
this.formData = {
inspectionType: "1",
inspectionCode: `JFXJ${moment().format("yyyyMMDDhhmm")}`,
recordName: `${moment().format("yyyyMMDDhhmm")}-机房巡检记录`,
inspectionCode: `JFXJ${moment().format("yyyyMMDDhhmmss")}`,
recordName: `${moment().format("yyyyMMDDhhmmss")}-机房巡检记录`,
inspectionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
inspectionBy: this.$store.state.now_user.name,
inspectionById: this.$store.state.now_user.id,
......@@ -126,14 +126,14 @@ export default {
},
change(val) {
this.formData.recordName = `${moment().format("yyyyMMDDhhmm")}-${
this.formData.recordName = `${moment().format("yyyyMMDDhhmmss")}-${
val.detail.data.text
}`;
this.formData.inspectionType = val.detail.value;
const inspectionCode = `${
val.detail.value == 1 ? "JFXJ" : "JDXJ"
}${moment().format("yyyyMMDDhhmm")}`;
}${moment().format("yyyyMMDDhhmmss")}`;
this.formData.inspectionCode = inspectionCode;
},
......
......@@ -24,7 +24,7 @@
<view class="inspect-list">
<InspectionItem
v-for="ele in item.list"
:key="ele.inspectionCode"
:key="ele.uid"
:details="ele"
/>
</view>
......
......@@ -33,7 +33,6 @@ import {
TEST,
TEST_2X,
USER_FILE_NAME,
} from "@/utils/systemCofig";
import {
......@@ -46,7 +45,6 @@ import {
import moment from "moment";
import { Base64 } from "js-base64";
export default {
components: {
hintInput,
......@@ -127,7 +125,7 @@ export default {
// 是否输入账号密码
if (this.person.user && this.person.pd) {
let key = null;
console.log("-this.personList--",this.personList)
console.log("-this.personList--", this.personList);
const obj = this.personList.some((item, index) => {
if (item.user == this.person.user) {
key = index;
......@@ -169,10 +167,16 @@ export default {
duration: 2000,
});
let log_list = [];
readLogData()
.then((res) => {
log_list = res;
const log_list = res;
// 更新日志信息
const logContent = getLogContent(LOG_TYPE_ENUM.login);
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list);
uni.hideLoading();
})
.catch((error) => {
if (error.code == 0) {
......@@ -184,14 +188,6 @@ export default {
return;
}
});
// 更新日志信息
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.hideLoading();
// 密码不正确
} else {
......
<template>
<view class="synchronous-management">
<!-- 搜索项 -->
<SearchCom @change="change" />
<SearchCom @change="change" :hiddenSearch="['synchronization']" />
<!-- 结果 -->
<view class="synchronous-management-content">
......@@ -24,7 +24,7 @@
<view class="inspect-list">
<InspectionItem
v-for="ele in item.list"
:key="ele.inspectionCode"
:key="ele.uid"
:details="ele"
:isDisable="true"
/>
......@@ -84,7 +84,8 @@ export default {
getAllInspections()
.then((res) => {
this.all_data = res;
this.all_data = res.filter(item => item.synchronization == 0);
this.getList();
uni.hideLoading();
})
......
......@@ -186,7 +186,6 @@ export const readInspectionData = () => {
const temp = res.map((element) => {
return JSON.parse(Base64.decode(element));
});
// console.log("读取【巡检数据】文件--", lodash.flattenDeep(temp));
resolve(lodash.flattenDeep(temp));
})
......
......@@ -332,84 +332,7 @@ export async function checkFileExists(directoryPath, fileName) {
});
}
// 读取文件夹下面所有的文件
export const readFilesInDirectory11= async (directoryPath) => {
const promiseArr = [];
return new Promise((resolve, reject) => {
plus.io.requestFileSystem(
plus.io.PRIVATE_DOC,
function (fs) {
// 获取指定文件夹路径的目录条目
fs.root.getDirectory(
directoryPath,
{ create: false },
function (dirEntry) {
// 创建一个空的目录读取器
let directoryReader = dirEntry.createReader();
// 读取目录中的所有文件和子目录
directoryReader.readEntries(
function (entries) {
// 遍历文件和子目录
for (let i = 0; i < entries.length; i++) {
let entry = entries[i];
if (entry.isFile) {
promiseArr.push(readFileContent(entry));
// 确保是文件 执行读取文件内容的操作
// readFileContent(entry).then(res => {
// console.log("读取的文件内容", Base64.decode(res))
// promiseArr.push(JSON.parse( Base64.decode(res)) )
// }).catch((error) => {
// reject(error)
// })
}
}
Promise.all(promiseArr)
.then((res) => {
resolve(res);
})
.catch((error) => {
console.log("readFilesInDirectory:", error);
reject({
...FILE_ENUM.getFileError
// "读取文件内容失败:" + error.message
});
});
},
function (error) {
console.log("readFilesInDirectory:", error);
reject({
...FILE_ENUM.readDirectoryError
// "读取目录条目失败:" + error.message
});
}
);
},
function (error) {
console.log("readFilesInDirectory:", error, directoryPath);
reject({
...FILE_ENUM.getDirectoryError
// "获取目录失败:" + error.message
});
}
);
},
function (error) {
console.log("readFilesInDirectory:", error);
reject({
...FILE_ENUM.fileSystemError
// "请求文件系统失败:" + error.message
});
}
);
});
};
export const readFilesInDirectory = async (directoryPath) => {
const promiseArr = [];
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论