Commit 62db9c41 authored by kaitly205422@163.com's avatar kaitly205422@163.com

添加记住密码功能

parent ce972888
var server = require('pushstate-server'); var server = require('pushstate-server');
server.start({ server.start({
port: 5000, port: 5001,
directory: './dist' directory: './dist'
}); });
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> <meta
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
/>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
<meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT" />
<meta http-equiv="expires" content="0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title>融通危险源辨识系统</title> <title>融通危险源辨识系统</title>
<link rel="stylesheet" href="//at.alicdn.com/t/font_1623819_3g3arzgtlmk.css"> <link
rel="stylesheet"
href="//at.alicdn.com/t/font_1623819_3g3arzgtlmk.css"
/>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but vue-newbee-shop doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong
>We're sorry but vue-newbee-shop doesn't work properly without
JavaScript enabled. Please enable it to continue.</strong
>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
......
...@@ -130,7 +130,6 @@ export default { ...@@ -130,7 +130,6 @@ export default {
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
console.log(this.cachePage);
// 列表操作去除缓存,刷新列表页 // 列表操作去除缓存,刷新列表页
if (from.name == "confirme-danger" || to.name == "confirme-danger") { if (from.name == "confirme-danger" || to.name == "confirme-danger") {
// 隐患整改页面缓存处理 // 隐患整改页面缓存处理
...@@ -151,6 +150,8 @@ export default { ...@@ -151,6 +150,8 @@ export default {
this.handleCache("riskTaskList", to.name, "taskLedger"); this.handleCache("riskTaskList", to.name, "taskLedger");
} else if ((from.name == 'riskInherent' && to.name === 'addInherent') || (to.name == 'riskInherent' && from.name == 'addInherent')) { } else if ((from.name == 'riskInherent' && to.name === 'addInherent') || (to.name == 'riskInherent' && from.name == 'addInherent')) {
this.handleCache('addInherent', to.name, 'riskInherent') this.handleCache('addInherent', to.name, 'riskInherent')
} else if ((from.name == 'riskInherent' && to.name === 'addCurrent') || (to.name == 'riskInherent' && from.name == 'addCurrent')) {
this.handleCache('addCurrent', to.name, 'riskInherent')
} }
// else if (to.name == 'riskView' || from.name == 'riskInherent') { // else if (to.name == 'riskView' || from.name == 'riskInherent') {
// this.handleCache("addInherent", to.name, "riskInherent"); // this.handleCache("addInherent", to.name, "riskInherent");
......
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
<div class="login" :style="{ backgroundImage: `url(${bg})` }"> <div class="login" :style="{ backgroundImage: `url(${bg})` }">
<div class="title"> <div class="title">
<div class="login-logo"> <div class="login-logo">
<van-image <van-image width="48" height="48" :src="require('@/assets/imgs/logo.png')" />
width="48"
height="48"
:src="require('@/assets/imgs/logo.png')"
/>
<span style="margin-left: 6px">融通危险源辨识系统</span> <span style="margin-left: 6px">融通危险源辨识系统</span>
</div> </div>
<!-- <div class="login-name">Enterprise Business Data Monitoring</div> --> <!-- <div class="login-name">Enterprise Business Data Monitoring</div> -->
...@@ -16,44 +12,26 @@ ...@@ -16,44 +12,26 @@
<div class="hello">Hello!</div> <div class="hello">Hello!</div>
<div class="welcome">欢迎登录<span></span>!</div> <div class="welcome">欢迎登录<span></span>!</div>
<div class="login-form"> <div class="login-form">
<van-form <van-form @submit="onSubmit" :show-error-message="false" validate-trigger="onSubmit">
@submit="onSubmit"
:show-error-message="false"
validate-trigger="onSubmit"
>
<div class="username-wrap"> <div class="username-wrap">
<div class="username-icon"> <div class="username-icon">
<van-image :src="require('@/assets/login/login-username.png')" /> <van-image :src="require('@/assets/login/login-username.png')" />
</div> </div>
<van-field <van-field v-model="username" name="username" label="" placeholder="账号"
v-model="username" :rules="[{ required: true, message: '请填写账号' }]" />
name="username"
label=""
placeholder="账号"
:rules="[{ required: true, message: '请填写账号' }]"
/>
</div> </div>
<div class="passworld-wrap"> <div class="passworld-wrap">
<div class="passworld-icon"> <div class="passworld-icon">
<van-image :src="require('@/assets/login/login-passworld.png')" /> <van-image :src="require('@/assets/login/login-passworld.png')" />
</div> </div>
<van-field <van-field v-model="password" type="password" name="password" placeholder="密码"
v-model="password" :rules="[{ required: true, message: '请填写密码' }]" />
type="password"
name="password"
placeholder="密码"
:rules="[{ required: true, message: '请填写密码' }]"
/>
</div> </div>
<div style="margin: 16px 0"> <div style="margin: 16px 0">
<van-checkbox v-model="remember" shape="square" <van-checkbox v-model="remember" shape="square">记住密码</van-checkbox>
>记住密码</van-checkbox
>
</div> </div>
<div style="margin: 16px"> <div style="margin: 16px">
<van-button round block type="info" native-type="submit" <van-button round block type="info" native-type="submit">登录</van-button>
>登录</van-button
>
</div> </div>
</van-form> </van-form>
</div> </div>
...@@ -126,10 +104,11 @@ export default { ...@@ -126,10 +104,11 @@ export default {
postFun("/login", values).then((Response) => { postFun("/login", values).then((Response) => {
if (Response.code == 200) { if (Response.code == 200) {
this.$toast.clear(); this.$toast.clear();
setLocalUserInfo({ const localUserInfo = {
loginName: values.username, loginName: values.username,
loginPassword: Base64.encode(values.password), loginPassword: Base64.encode(values.password),
}); }
// setLocalUserInfo(localUserInfo);
setToken(Response.token); setToken(Response.token);
getFun("/getInfo").then((Response2) => { getFun("/getInfo").then((Response2) => {
console.log( console.log(
...@@ -139,6 +118,7 @@ export default { ...@@ -139,6 +118,7 @@ export default {
); );
var userInfo = { var userInfo = {
...Response2.user, ...Response2.user,
...localUserInfo
}; };
/* 存储用户信息 */ /* 存储用户信息 */
setUserInfo(userInfo); setUserInfo(userInfo);
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
</div> </div>
<van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" /> <van-field readonly required name="userName" :value="form.userName" label="评估人" placeholder="请输入" />
<van-field readonly required name="projectName" :value="form.projectName" label="所属项目" placeholder="请输入" /> <van-field readonly required name="projectName" :value="form.projectName" label="所属项目" placeholder="请输入" />
<van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物" placeholder="请输入 " /> <van-field readonly required name="buildingName" :value="form.buildingName" label="所属建筑物"
placeholder="请输入 " />
<div style="display: flex"> <div style="display: flex">
<van-field required clickable name="floorName" :value="form.floorName" label="所属楼层" placeholder="请选择" <van-field required clickable name="floorName" :value="form.floorName" label="所属楼层" placeholder="请选择"
...@@ -34,8 +35,9 @@ ...@@ -34,8 +35,9 @@
<van-field required clickable name="name" v-model="form.name" label="危险源名称" placeholder="请输入" <van-field required clickable name="name" v-model="form.name" label="危险源名称" placeholder="请输入"
:rules="[{ required: true, message: '危险源名称不能为空' }]" /> :rules="[{ required: true, message: '危险源名称不能为空' }]" />
<!-- 单选 --> <!-- 单选 -->
<van-field readonly required clickable name="pointType" v-model="form.pointType" label="风险点类型" placeholder="请选择" <van-field readonly required clickable name="pointType" v-model="form.pointType" label="风险点类型"
@click="selectData('pointType', true)" :rules="[{ required: true, message: '风险点类型不能为空' }]" /> placeholder="请选择" @click="selectData('pointType', true)"
:rules="[{ required: true, message: '风险点类型不能为空' }]" />
<van-field required label="是否为特种设备" v-show="form.pointType == '设备设施类'"> <van-field required label="是否为特种设备" v-show="form.pointType == '设备设施类'">
<template #input> <template #input>
<van-radio-group v-model="form.specialEquipment" direction="horizontal"> <van-radio-group v-model="form.specialEquipment" direction="horizontal">
...@@ -76,8 +78,8 @@ ...@@ -76,8 +78,8 @@
</div> </div>
<van-field name="hdPicture1" label="风险图片"> <van-field name="hdPicture1" label="风险图片">
<template #input> <template #input>
<van-uploader @delete="deleteFile(...arguments, 'pictureFile')" multiple :max-count="5" upload-text="最多上传五个" <van-uploader @delete="deleteFile(...arguments, 'pictureFile')" multiple :max-count="5"
v-model="uploaderImg"> upload-text="最多上传五个" v-model="uploaderImg">
<template slot="default"> <template slot="default">
<!-- 11111111111 --> <!-- 11111111111 -->
<div style=" <div style="
...@@ -108,8 +110,8 @@ ...@@ -108,8 +110,8 @@
</div> </div>
<van-field label="技术措施"> <van-field label="技术措施">
<template #input> <template #input>
<van-field v-model="form.measuresProject" name="measuresProject" label="" type="textarea" rows="3" autosize <van-field v-model="form.measuresProject" name="measuresProject" label="" type="textarea" rows="3"
placeholder="请输入" style="padding-left: 0; padding-top: 0" /> autosize placeholder="请输入" style="padding-left: 0; padding-top: 0" />
</template> </template>
</van-field> </van-field>
<van-field name="measuresProjectFile[]" label="技术措施附件"> <van-field name="measuresProjectFile[]" label="技术措施附件">
...@@ -192,12 +194,14 @@ ...@@ -192,12 +194,14 @@
<van-field v-model="form.measuresDeptName" name="measuresDeptName" label="管控责任单位 " type="input" rows="1" <van-field v-model="form.measuresDeptName" name="measuresDeptName" label="管控责任单位 " type="input" rows="1"
autosize placeholder="请输入" list="measure-deptname" @input="measuresDeptNameChange" /> autosize placeholder="请输入" list="measure-deptname" @input="measuresDeptNameChange" />
<datalist id="measure-deptname"> <datalist id="measure-deptname">
<option :value="item.measuresDeptName" v-for="item in measureDeptList" :key="item.measuresDeptName"></option> <option :value="item.measuresDeptName" v-for="item in measureDeptList" :key="item.measuresDeptName">
</option>
</datalist> </datalist>
<van-field v-model="form.measuresUserName" name="measuresUserName" label="管控责任人 " type="input" rows="1" autosize <van-field v-model="form.measuresUserName" name="measuresUserName" label="管控责任人 " type="input" rows="1"
placeholder="请输入" list="measure-name" @input="measuresUserNameChange" /> autosize placeholder="请输入" list="measure-name" @input="measuresUserNameChange" />
<datalist id="measure-name"> <datalist id="measure-name">
<option v-for="item in measureNameList" :key="item.measuresUserName" :value="item.measuresUserName"></option> <option v-for="item in measureNameList" :key="item.measuresUserName" :value="item.measuresUserName">
</option>
</datalist> </datalist>
<van-field v-model="form.measuresUserPhone" name="measuresUserPhone" label="管控责任人联系方式" type="input" rows="1" <van-field v-model="form.measuresUserPhone" name="measuresUserPhone" label="管控责任人联系方式" type="input" rows="1"
autosize placeholder="请输入" maxlength="11" /> autosize placeholder="请输入" maxlength="11" />
...@@ -291,13 +295,14 @@ ...@@ -291,13 +295,14 @@
<!-- 楼层弹出层 --> <!-- 楼层弹出层 -->
<van-popup v-model="ShowfloorList" position="bottom" :style="{ height: '100%' }"> <van-popup v-model="ShowfloorList" position="bottom" :style="{ height: '100%' }">
<selectFloor v-if="ShowfloorList" :listdata="floorSource" @closeSlect="closeSlectfloor" <selectFloor v-if="ShowfloorList" :listdata="floorSource" @closeSlect="closeSlectfloor"
@saveSlect="saveSlectfloor"></selectFloor> @saveSlect="saveSlectfloor">
</selectFloor>
</van-popup> </van-popup>
<!-- 单选弹出层 --> <!-- 单选弹出层 -->
<van-popup v-model="showSelect" position="bottom"> <van-popup v-model="showSelect" position="bottom">
<van-picker v-if="showSelect" show-toolbar value-key="dictValue" :columns="columnsData" @confirm="saveSelect" <van-picker v-if="showSelect" show-toolbar value-key="dictValue" :columns="columnsData"
@cancel="showSelect = false" /> @confirm="saveSelect" @cancel="showSelect = false" />
</van-popup> </van-popup>
<!-- 复选弹出层 --> <!-- 复选弹出层 -->
<van-popup v-model="showCheckSelect" position="bottom" :style="{ height: '100%' }"> <van-popup v-model="showCheckSelect" position="bottom" :style="{ height: '100%' }">
...@@ -479,7 +484,6 @@ export default { ...@@ -479,7 +484,6 @@ export default {
activated() { activated() {
console.log('activated') console.log('activated')
this.showSetRank = false; // 再次关闭弹出层 以防万一 this.showSetRank = false; // 再次关闭弹出层 以防万一
debugger;
this.showGradeDialog = false; this.showGradeDialog = false;
this.$set(this.form, 'level', sessionStorage.getItem("level")); this.$set(this.form, 'level', sessionStorage.getItem("level"));
}, },
......
...@@ -8,32 +8,12 @@ ...@@ -8,32 +8,12 @@
<van-tabs v-model="active" @change="tabList" color="#2980f7" animated> <van-tabs v-model="active" @change="tabList" color="#2980f7" animated>
<van-tab :title="buildingName"> <van-tab :title="buildingName">
<van-dropdown-menu z-index="1000"> <van-dropdown-menu z-index="1000">
<van-dropdown-item <van-dropdown-item v-model="value0" @change="changeBuild" :options="option0" get-container="body" />
v-model="value0" <van-dropdown-item v-model="value1" @change="changeFloor" :options="option1" get-container="body" />
@change="changeBuild" <van-dropdown-item v-model="value2" @change="changeRoom" :options="option2" get-container="body" />
:options="option0"
get-container="body"
/>
<van-dropdown-item
v-model="value1"
@change="changeFloor"
:options="option1"
get-container="body"
/>
<van-dropdown-item
v-model="value2"
@change="changeRoom"
:options="option2"
get-container="body"
/>
</van-dropdown-menu> </van-dropdown-menu>
<div class="con-list"> <div class="con-list">
<van-cell-group <van-cell-group inset v-for="(item, index) in messageList" :key="index" @click="touchstart(index, item)">
inset
v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"
>
<div style="font-size: 0.45rem; padding: 5px 0"> <div style="font-size: 0.45rem; padding: 5px 0">
{{ item.name }} {{ item.name }}
</div> </div>
...@@ -60,37 +40,25 @@ ...@@ -60,37 +40,25 @@
</van-row> </van-row>
<van-overlay :show="showIndex == index"> <van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null"> <div class="wrapper" @click.stop="showIndex = null">
<van-button round type="primary" @click="goDetail(item)" <van-button round type="primary" @click="goDetail(item)">编辑</van-button>
>编辑</van-button <van-button round type="danger" @click="delInherent(item)" v-show="active == 0">删除</van-button>
>
<van-button
round
type="danger"
@click="delInherent(item)"
v-show="active == 0"
>删除</van-button
>
</div> </div>
</van-overlay> </van-overlay>
</van-cell-group> </van-cell-group>
<div <div style="
style="
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 0.48rem; font-size: 0.48rem;
position: fixed; position: fixed;
top: 30%; top: 30%;
" " v-if="messageList['length'] == 0">
v-if="messageList['length'] == 0"
>
暂无数据 暂无数据
</div> </div>
</div> </div>
</van-tab> </van-tab>
</van-tabs> </van-tabs>
</div> </div>
<div <div style="
style="
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
background-color: #fff; background-color: #fff;
...@@ -100,26 +68,16 @@ ...@@ -100,26 +68,16 @@
text-align: center; text-align: center;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
" ">
> <div @click="copyFloor" style="color: #4bced0; font-size: 14px; font-weight: 600">
<div
@click="copyFloor"
style="color: #4bced0; font-size: 14px; font-weight: 600"
>
<div style="font-size: 22px"><van-icon name="coupon-o" /></div> <div style="font-size: 22px"><van-icon name="coupon-o" /></div>
<div>复制楼层</div> <div>复制楼层</div>
</div> </div>
<div <div @click="performTasks" style="color: #4bced0; font-size: 14px; font-weight: 600">
@click="performTasks"
style="color: #4bced0; font-size: 14px; font-weight: 600"
>
<div style="font-size: 22px"><van-icon name="plus" /></div> <div style="font-size: 22px"><van-icon name="plus" /></div>
<div>新增固有风险</div> <div>新增固有风险</div>
</div> </div>
<div <div @click="endTasks" style="color: #d9001b; font-size: 14px; font-weight: 600">
@click="endTasks"
style="color: #d9001b; font-size: 14px; font-weight: 600"
>
<div style="font-size: 22px"><van-icon name="cross" /></div> <div style="font-size: 22px"><van-icon name="cross" /></div>
<div>任务执行结束</div> <div>任务执行结束</div>
</div> </div>
...@@ -354,7 +312,6 @@ export default { ...@@ -354,7 +312,6 @@ export default {
let arr = this.floorListData.filter( let arr = this.floorListData.filter(
(item) => item.name == this.value0 (item) => item.name == this.value0
)[0].children; )[0].children;
console.log(arr);
if (!arr) arr = []; if (!arr) arr = [];
arr = [{ id: "-1", name: "全部" }, ...arr]; arr = [{ id: "-1", name: "全部" }, ...arr];
this.option1 = this.changeData(arr); this.option1 = this.changeData(arr);
......
const Timestamp = new Date().getTime();
module.exports = { module.exports = {
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment