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

fix(功能走查): 功能走查60%

上级 5833726b
......@@ -68,7 +68,7 @@ export default {
onHide: function () {
// app关闭时将数据存储到本地缓存
uni.setStorageSync("now_user", this.$store.state.now_user);
// uni.setStorageSync("last_time", this.$store.state.last_time);
uni.setStorageSync("last_time", this.$store.state.now_user.loginTime);
},
onUnload() {},
......@@ -114,6 +114,7 @@ export default {
});
})
.then((res) => {
// console.log("-xxxxxxxxxxx---", res)
// 获取文件数据
let userData = Base64.decode(res);
......
......@@ -68,8 +68,6 @@ export default {
this.isDisable ? 1 : 0
}`;
console.log(" this.details",url, this.details);
uni.navigateTo({
url: `${url}&uid=${this.details.uid}`,
});
......
......@@ -7,7 +7,7 @@
>HI,欢迎回来{{ userInfo.name }}{{ userInfo.user }}</view
>
<view class="unit">所属单位:{{ userInfo.unitName || "--" }}</view>
<view class="time">上次登录时间:{{ userInfo.last_time || "--" }}</view>
<view class="time">上次登录时间:{{ lastTime || "--" }}</view>
<image
class="bg-img"
......@@ -86,7 +86,6 @@ export default {
},
data() {
return {
isDialog: false, //
list: [], // 展示数据
all_data: [], // 所有数据
......@@ -96,11 +95,12 @@ export default {
countNum: 0, // 统计查询总数
syncCount: 0, // 待同步条数
// lastTime: "", // 上次登陆时间
lastTime: "", // 上次登陆时间
};
},
created() {
// this.lastTime = uni.getStorageSync("last_time") || "";
this.lastTime = uni.getStorageSync("last_time") || "";
// uni.getStorageSync("last_time", this.$store.state.now_user.loginTime || "");
},
mounted() {
this.init();
......@@ -110,6 +110,7 @@ export default {
userInfo() {
return this.$store.state.now_user || {};
},
},
methods: {
init() {
......@@ -135,7 +136,7 @@ export default {
});
},
toSyncPage() {
this.$emit("changeTab", {}, 2)
this.$emit("changeTab", {}, 2);
},
// 待同步数据
......@@ -217,8 +218,6 @@ export default {
this.init();
},
toIndex() {
uni.navigateTo({
url: "/pages/index/index",
......@@ -226,13 +225,7 @@ export default {
},
toPage() {
// if (this.userInfo.isAdmin) {
// uni.showToast({
// title: "暂无权限",
// icon: "none",
// });
// return;
// }
uni.showLoading();
......
......@@ -119,15 +119,16 @@ export default {
//退出--弹出对话框
dialogInputConfirm2() {
let _this = this;
uni.redirectTo({
url: "/pages/login/login",
success() {
_this.$store.commit("SET_USER", {});
success: () =>{
// uni.clearStorage(); //测试将所有缓存清除
// console.log("-退出---",this.$store.state.now_user.loginTime)
uni.setStorageSync("now_user", this.$store.state.now_user);
// uni.setStorageSync("last_time", this.$store.state.last_time);
uni.setStorageSync("last_time", this.$store.state.now_user.loginTime || "");
uni.clearStorage(); //测试将所有缓存清除
},
});
},
......
......@@ -108,6 +108,7 @@ export default {
inspectionTime: moment().format("yyyy-MM-DD HH:mm:ss"),
inspectionBy: this.$store.state.now_user.name,
inspectionById: this.$store.state.now_user.id,
cureatByName: this.$store.state.now_user.user,
isException: "", // 是否有异常
position: "", // 位置
isSubmit: "", // 0 是草稿态; 1 是正式提交
......
......@@ -15,7 +15,7 @@
<block slot="right">
<view class="nav-right">
<view class="uni-nav-bar-text" @click="deleteClick">
<view v-if="isOperationPermissions" class="uni-nav-bar-text" @click="deleteClick">
<text class="iconfont icon-delete"></text
></view>
......@@ -82,7 +82,7 @@
></DutyHandover>
</view>
<view v-if="!isDisable" class="fixed-btns">
<view v-if=" isOperationPermissions && !isDisable" class="fixed-btns">
<view class="button-group">
<!-- isSubmit 标识: 0 是草稿态; 1 是正式提交 -->
<view
......@@ -187,10 +187,18 @@ export default {
isDisable: false, // 禁用
};
},
computed: {
userInfo() {
return this.$store.state.now_user || {};
},
isOperationPermissions(){ // 是否有操作权限
const {uid, cureatByName} = this.detailsInfo;
return !uid || (uid && cureatByName == this.userInfo.user)
}
},
onLoad(options) {
this.isDisable = options.isDisable == 1 ? true : false;
this.init();
if (options.uid) {
// 获取详情
this.getDetails(options.uid);
......@@ -206,6 +214,7 @@ export default {
this.tempForm = darf_data.originData.tempForm;
console.log("获取草稿数据---", darf_data);
this.detailsInfo = darf_data;
this.init()
uni.hideLoading();
})
......@@ -220,6 +229,15 @@ export default {
}
},
mounted() {
this.init()
},
methods: {
init() {
pad_room_type.rows.forEach((item, index) => {
this.tabList[index].value = item.dictValue;
});
if (this.detailsInfo.inspectionType) {
const fillCheck = this.detailsInfo.fillCheck.split(",");
this.tabList.forEach((item, index) => {
......@@ -232,13 +250,6 @@ export default {
this.baseInfo = this.$store.state.temp_data;
}
},
methods: {
init() {
pad_room_type.rows.forEach((item, index) => {
this.tabList[index].value = item.dictValue;
});
},
// 回显数据
getDetails(uid) {
uni.showLoading();
......@@ -254,6 +265,9 @@ export default {
this.isDisable = this.isDisable || detailsInfo.synchronization == 1;
uni.hideLoading();
this.init()
})
.catch((error) => {
uni.showToast({
......
......@@ -35,7 +35,9 @@
</view>
<!-- 开始巡检 -->
<view class="inspection-button" @click="toPage">开始巡检</view>
<view class="inspection-button" @click="toPage"
>开始巡检</view
>
</view>
</template>
......@@ -84,6 +86,12 @@ export default {
uni.hideLoading();
});
},
computed: {
userInfo() {
return this.$store.state.now_user || {};
},
},
methods: {
init() {
const all_data = this.all_data || [];
......@@ -141,7 +149,6 @@ export default {
} = this.searchForm;
return arr.filter((item) => {
return (
(!isException || item.isException == isException) &&
(!inspectionType || item.inspectionType == inspectionType) &&
......
......@@ -63,9 +63,7 @@ export default {
};
},
created() {},
onShow() {
this.setUser();
},
onShow() {},
mounted() {},
// 定义返回退出
onBackPress(options) {
......@@ -74,7 +72,7 @@ export default {
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.setStorageSync("last_time", this.$store.state.now_user.loginTime);
plus.runtime.quit();
} else {
plus.nativeUI.toast("再划一次退出应用");
......@@ -85,47 +83,39 @@ export default {
return true;
},
methods: {
setSm2(data) {
const sm2 = require("sm-crypto").sm2; // 获取sm2对象
const cipherMode = 1; // 选择加密策略,1 - C1C3C2,0 - C1C2C3,默认为1
const sysPublicKey =
"042580b43bad40cc813a032ef3a4c3c38fc58796e0684dd9b5087195a305f4241f9bbefcc92a10e7296ffc167d22a921c164b8cbbbdbcf91ddc3f15202b993f03b"; // 系统后台公钥
if (data) {
return sm2.doEncrypt(JSON.stringify(data), sysPublicKey, cipherMode);
} else {
return null;
}
},
setUser() {
return new Promise((resolve, reject) => {
try {
const value = uni.getStorageSync("user_data");
if (value) {
this.personList = JSON.parse(value);
// this.personList = JSON.parse(value);
// console.log("---this.personList", this.personList);
resolve(eval(value));
} else {
uni.getStorage({
key: "user_data",
success: function (res) {
this.personList = JSON.parse(res.data);
// this.personList =;
// console.log("---this.personList", this.personList);
resolve(eval(value));
},
});
}
} catch (e) {}
// console.log(this.personList, "用户数据");
} catch (e) {
console.log("setUser--", e);
}
});
},
// 点击登录
login() {
// uni.navigateTo({
// url: "/pages/home/home",
// });
// return;
this.setUser().then((personList) => {
this.personList = personList;
console.log("111", personList);
// 是否输入账号密码
if (this.person.user && this.person.pd) {
let key = null;
console.log("-this.personList--", this.personList);
const obj = this.personList.some((item, index) => {
if (item.user == this.person.user) {
key = index;
......@@ -144,19 +134,38 @@ export default {
this.person.user == this.personList[key].user &&
this.person.pd == this.personList[key].passWord
) {
const last_time = moment().format("yyyy-MM-DD HH:mm:ss");
this.personList[key].last_time = last_time;
// 存储最近一次登陆时间
const userInfo = this.personList[key];
uni.setStorageSync("last_time", userInfo.loginTime || "");
// console.log("--last_time----",userInfo.loginTime)
// 更新用户登陆时间
const loginTime = moment().format("yyyy-MM-DD HH:mm:ss");
this.personList[key].loginTime = loginTime;
userInfo.loginTime = loginTime;
this.$store.commit("SET_USER", userInfo);
uni.setStorageSync("now_user", userInfo);
// const fileContent = JSON.stringify(Base64.encode(this.personList));
// createFileWithPlusIO(
// SYNCHRONIZE_DATA_PAD,
// USER_FILE_NAME,
// fileContent
// );
// console.log("--userInfo---", userInfo);
// console.log("写入用户数据内容---", this.personList);
// 更新用户数据
const fileContent = JSON.stringify(
Base64.encode(JSON.stringify(personList))
);
uni.setStorage({
key: "user_data",
data: JSON.stringify(personList),
fail: (error) => {
console.log("APP.vue 存储数据失败", error);
},
});
createFileWithPlusIO(
SYNCHRONIZE_DATA_PAD,
USER_FILE_NAME,
fileContent
);
uni.navigateTo({
url: "/pages/home/home",
......@@ -187,6 +196,14 @@ export default {
});
return;
}
const log_list = [];
// 更新日志信息
const logContent = getLogContent(LOG_TYPE_ENUM.login);
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list);
});
// 密码不正确
......@@ -215,6 +232,7 @@ export default {
duration: 2000,
});
}
});
},
},
};
......
......@@ -15,7 +15,7 @@
<block slot="right">
<view class="nav-right">
<view class="uni-nav-bar-text" @click="deleteClick">
<view v-if="isOperationPermissions" class="uni-nav-bar-text" @click="deleteClick">
<text class="iconfont icon-delete"></text
></view>
......@@ -63,7 +63,7 @@
></TabContentItem>
</view>
<view v-if="!isDisable" class="fixed-btns">
<view v-if="isOperationPermissions && !isDisable" class="fixed-btns">
<view class="button-group">
<!-- 保存草稿 0:草稿 1:提交 -->
<view
......@@ -123,6 +123,16 @@ export default {
isDisable: false, // 禁用
};
},
computed: {
userInfo() {
return this.$store.state.now_user || {};
},
isOperationPermissions(){ // 是否有操作权限
const {uid, cureatByName} = this.detailsInfo;
return !uid || (uid && cureatByName == this.userInfo.user)
}
},
onLoad(options) {
this.isDisable = options.isDisable == 1 ? true : false;
......@@ -139,6 +149,8 @@ export default {
console.log("获取草稿数据---", darf_data);
this.detailsInfo = darf_data;
uni.hideLoading();
this.init();
})
.catch((error) => {
uni.showToast({
......@@ -152,21 +164,7 @@ export default {
}
},
mounted() {
this.init().then(() => {
if (this.detailsInfo.inspectionType) {
const fillCheck = this.detailsInfo.fillCheck.split(",");
setTimeout(() => {
this.tabList.forEach((item, index) => {
item.isVaild = fillCheck.includes(item.value);
this.tempForm[index] &&
this.setComponentData(item.refName, this.tempForm[index]);
});
}, 500);
} else {
this.baseInfo = this.$store.state.temp_data;
}
});
this.init();
},
methods: {
......@@ -182,6 +180,21 @@ export default {
refName: `TabContentItem_${index}`,
};
});
if (this.detailsInfo.inspectionType) {
const fillCheck = this.detailsInfo.fillCheck.split(",");
setTimeout(() => {
this.tabList.forEach((item, index) => {
item.isVaild = fillCheck.includes(item.value);
this.tempForm[index] &&
this.setComponentData(item.refName, this.tempForm[index]);
});
}, 500);
} else {
this.baseInfo = this.$store.state.temp_data;
}
resolve();
});
},
......@@ -200,6 +213,8 @@ export default {
this.isDisable = this.isDisable || detailsInfo.synchronization == 1; // 是否禁用 1:已同步数据 0: 未同步数据
uni.hideLoading();
this.init();
})
.catch((error) => {
uni.showToast({
......
......@@ -37,7 +37,7 @@
<!-- 数据打包 -->
<view
v-show="isPackedDataBtn"
v-show="isPackedDataBtn "
class="synchronous-button"
@click="openDialog(true)"
>数据打包</view
......@@ -77,6 +77,12 @@ export default {
mounted() {
this.init();
},
computed: {
userInfo() {
return this.$store.state.now_user || {};
},
},
methods: {
init() {
......@@ -84,7 +90,7 @@ export default {
getAllInspections()
.then((res) => {
this.all_data = res.filter(item => item.synchronization == 0);
this.all_data = res.filter((item) => item.synchronization == 0);
this.getList();
uni.hideLoading();
......
......@@ -61,7 +61,7 @@ export const USER_LiST = [
{
id: 1, // 有用
user: "hzsgjy", // 有用
user: "hzsgjy", // 有用 谁创建,谁有权限编辑和删除
passWord: "JFXJ85250920", // 有用
areaName: "市本级", // 有用
permission: 1,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论