Browse Source

删除默认密码 修改判断 修改回显

wangqin
Joe 1 year ago
parent
commit
f68d33003f
  1. 13
      ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue
  2. 23
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue
  3. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js
  4. 153
      ruoyi-ui/src/views/login.vue

13
ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue

@ -4,7 +4,8 @@
<ElFormItem class="formItem" :rules="getRules(item)" v-if="formItemVisible(item)" :key="item.key" <ElFormItem class="formItem" :rules="getRules(item)" v-if="formItemVisible(item)" :key="item.key"
:label="item.label" :style="gridStyle(item, index)"> :label="item.label" :style="gridStyle(item, index)">
<slot :name="item.key" :data="item" :formData="formData"> <slot :name="item.key" :data="item" :formData="formData">
<component :is="getComponent(item.type)" v-bind="getBindData(item)" v-model="formData[item.key]" /> <component :is="getComponent(item.type)" v-bind="getBindData(item)" v-model="formData[item.key]"
v-on="resolveListeners(item.ons)" />
</slot> </slot>
</ElFormItem> </ElFormItem>
</template> </template>
@ -94,6 +95,16 @@ export default {
} }
}, },
methods: { methods: {
resolveListeners(callbacks) {
const result = {};
for (const key in callbacks) {
result[key] = (...args) => callbacks[key](...args, this.formData, this)
}
return result
},
reset() { reset() {
return this.formData = reduceDefaultValue(this.formList); return this.formData = reduceDefaultValue(this.formList);
}, },

23
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue

@ -113,13 +113,13 @@ export default {
{ {
label: "选择时间:", label: "选择时间:",
key: "displayTime", key: "displayTime",
type: "datePicker", type: "timePicker",
required: true, required: true,
visible: (data) => data.controlType == "automatic", visible: (data) => data.controlType == "automatic",
options: { options: {
type: "datetimerange", isRange: true,
angeSeparator: "至", rangeSeparator: "至",
valueFormat: "yyyy-MM-dd HH:mm:ss", valueFormat: "HH:mm",
startPlaceholder: "开始时间", startPlaceholder: "开始时间",
endPlaceholder: "结束时间", endPlaceholder: "结束时间",
}, },
@ -143,6 +143,12 @@ export default {
handler(bool) { handler(bool) {
if (!bool) return; if (!bool) return;
this.reDisplay();
}
}
},
methods: {
reDisplay() {
request.post(`business/device/functions/${this.deviceId}/${52}`, {}) request.post(`business/device/functions/${this.deviceId}/${52}`, {})
.then(async (result) => { .then(async (result) => {
if (result.code != 200) return; if (result.code != 200) return;
@ -152,6 +158,7 @@ export default {
const formData = this.$refs.FormConfigRef?.formData; const formData = this.$refs.FormConfigRef?.formData;
const data = result.data[0]; const data = result.data[0];
console.log("%c [ data ]-155-「DeviceControlDialog.vue」", "font-size:15px; background:#66352f; color:#aa7973;", data);
switch (data.mode) { switch (data.mode) {
case "00": case "00":
@ -163,14 +170,14 @@ export default {
case "01": case "01":
formData.controlType = "automatic"; formData.controlType = "automatic";
formData.datePicker = [data.startDisplay, data.endDisplay]; formData.displayTime = [data.startDisplay, data.endDisplay];
break; break;
} }
this.oldFormData = cloneDeep(formData);
}) })
}
}
}, },
methods: {
handleSubmit() { handleSubmit() {
const result = cloneDeep(this.$refs.FormConfigRef?.formData); const result = cloneDeep(this.$refs.FormConfigRef?.formData);

6
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -132,9 +132,7 @@ export async function setMarkToMap(item, data, _markerClick, content) {
content: content:
content || content ||
`<div style=" `<div style="
background-image: url(${ background-image: url(${item.deviceState == 1 ? normalBg : faultBg});
item.deviceState !== "0" ? faultBg : normalBg
});
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
width: 42px; width: 42px;
@ -148,7 +146,7 @@ export async function setMarkToMap(item, data, _markerClick, content) {
height: 18px; height: 18px;
margin-left: 3px; margin-left: 3px;
margin-bottom: 6px; margin-bottom: 6px;
" src='${item.deviceState !== "0" ? fault : normal}'> " src='${item.deviceState == 1 ? normal : fault}'>
</div>`, </div>`,
}; };
}), }),

153
ruoyi-ui/src/views/login.vue

@ -1,77 +1,39 @@
<template> <template>
<div class="login"> <div class="login">
<el-form <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
ref="loginForm" <div style="
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<div
style="
width: 100%; width: 100%;
text-align: center; text-align: center;
padding-right: 20px; padding-right: 20px;
padding-bottom: 10px; padding-bottom: 10px;
" ">
>
<!-- <img src="../assets/image/login-logo.png" width="120px;" /> --> <!-- <img src="../assets/image/login-logo.png" width="120px;" /> -->
<div class="loginTitle" >欢迎登录</div> <div class="loginTitle">欢迎登录</div>
</div> </div>
<div class="title">{{ '' }}</div> <div class="title">{{ '' }}</div>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="请输入用户名">
v-model="loginForm.username" <img slot="prefix" src="../assets/images/Vector.png" class="el-input__icon input-icon" />
type="text"
auto-complete="off"
placeholder="请输入用户名"
>
<img
slot="prefix"
src="../assets/images/Vector.png"
class="el-input__icon input-icon"
/>
</el-input> </el-input>
<!-- <div style="border-bottom: 1px solid #cfcfcf; margin-top: 5px"></div> --> <!-- <div style="border-bottom: 1px solid #cfcfcf; margin-top: 5px"></div> -->
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="请输入密码"
v-model="loginForm.password" @keyup.enter.native="handleLogin">
type="password" <img slot="prefix" src="../assets/images/locked.png" class="el-input__icon input-icon" />
auto-complete="off"
placeholder="请输入密码"
@keyup.enter.native="handleLogin"
>
<img
slot="prefix"
src="../assets/images/locked.png"
class="el-input__icon input-icon"
/>
</el-input> </el-input>
<!-- <div style="border-bottom: 1px solid #cfcfcf; margin-top: 5px"></div> --> <!-- <div style="border-bottom: 1px solid #cfcfcf; margin-top: 5px"></div> -->
</el-form-item> </el-form-item>
<Verify <Verify @success="capctchaCheckSuccess" :mode="'pop'" :captchaType="'blockPuzzle'"
@success="capctchaCheckSuccess" :imgSize="{ width: '330px', height: '155px' }" ref="verify"></Verify>
:mode="'pop'"
:captchaType="'blockPuzzle'"
:imgSize="{ width: '330px', height: '155px' }"
ref="verify"
></Verify>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 20px 0px;">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 20px 0px;">记住密码</el-checkbox>
<el-form-item style="width: 100%; text-align: center"> <el-form-item style="width: 100%; text-align: center">
<el-button <el-button :loading="loading" size="medium" type="goon" style="width: 100%" @click.native.prevent="handleLogin">
:loading="loading"
size="medium"
type="goon"
style="width: 100%"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
<span v-else> 中...</span> <span v-else> 中...</span>
</el-button> </el-button>
<div style="float: right" v-if="register"> <div style="float: right" v-if="register">
<router-link class="link-type" :to="'/register'" <router-link class="link-type" :to="'/register'">立即注册</router-link>
>立即注册</router-link
>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -101,8 +63,10 @@ export default {
title: "", // title: "", //
cookiePassword: "", cookiePassword: "",
loginForm: { loginForm: {
username: "admin", // username: "admin",
password: "dxc123!@#", // password: "dxc123!@#",
username: "",
password: "",
rememberMe: false, rememberMe: false,
code: "", code: "",
uuid: "", uuid: "",
@ -147,7 +111,7 @@ export default {
capctchaCheckSuccess(params) { capctchaCheckSuccess(params) {
this.loginForm.code = params.captchaVerification; this.loginForm.code = params.captchaVerification;
this.loading = true; this.loading = true;
console.log(this.loginForm.rememberMe,"======================="); console.log(this.loginForm.rememberMe, "=======================");
if (this.loginForm.rememberMe == true) { if (this.loginForm.rememberMe == true) {
Cookies.set("username", this.loginForm.username, { expires: 30 }); Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { Cookies.set("password", encrypt(this.loginForm.password), {
@ -162,7 +126,7 @@ export default {
this.$store this.$store
.dispatch("Login", this.loginForm) .dispatch("Login", this.loginForm)
.then(() => { .then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {}); this.$router.push({ path: this.redirect || "/" }).catch(() => { });
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false;
@ -172,7 +136,7 @@ export default {
const username = Cookies.get("username"); const username = Cookies.get("username");
const password = Cookies.get("password"); const password = Cookies.get("password");
const rememberMe = Cookies.get("rememberMe"); const rememberMe = Cookies.get("rememberMe");
console.log("rem",rememberMe); console.log("rem", rememberMe);
this.loginForm = { this.loginForm = {
username: username === undefined ? this.loginForm.username : username, username: username === undefined ? this.loginForm.username : username,
password: password:
@ -204,7 +168,7 @@ export default {
this.$store this.$store
.dispatch("Login", this.loginForm) .dispatch("Login", this.loginForm)
.then(() => { .then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {}); this.$router.push({ path: this.redirect || "/" }).catch(() => { });
this.getManageStation(); this.getManageStation();
}) })
.catch(() => { .catch(() => {
@ -218,7 +182,7 @@ export default {
this.$cache.local.set("manageStation", res.msg); this.$cache.local.set("manageStation", res.msg);
}); });
getConfigKey("sd.navigationBar").then((res) => { getConfigKey("sd.navigationBar").then((res) => {
console.log(res,"res") console.log(res, "res")
let sideTheme = "theme-blue"; let sideTheme = "theme-blue";
if (res.msg == "0") { if (res.msg == "0") {
sideTheme = "theme-dark"; sideTheme = "theme-dark";
@ -253,33 +217,32 @@ export default {
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-input__inner { ::v-deep .el-input__inner {
background-color: transparent !important; background-color: transparent !important;
height:100%; height: 100%;
font-size: 22px; font-size: 22px;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #07CAF6; color: #07CAF6;
margin-left:68px; margin-left: 68px;
} }
::v-deep .el-checkbox__label { ::v-deep .el-checkbox__label {
color:#fff; color: #fff;
font-size: 18px !important; font-size: 18px !important;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;
color: #FFFFFF !important; color: #FFFFFF !important;
margin-bottom: 10px; margin-bottom: 10px;
} }
::v-deep .el-form-item__error { ::v-deep .el-form-item__error {
position: absolute; position: absolute;
top:75px; top: 75px;
} }
::v-deep .el-input__inner::placeholder { ::v-deep .el-input__inner::placeholder {
color: #07CAF6; color: #07CAF6;
} }
@ -293,12 +256,13 @@ export default {
.login::after { .login::after {
content: ""; content: "";
position: absolute; position: absolute;
width:100%; width: 100%;
height: 120px; height: 120px;
background-image: url('../assets/images/login-head.png'); background-image: url('../assets/images/login-head.png');
background-size: auto 100%; background-size: auto 100%;
background-position: center center; background-position: center center;
} }
.title { .title {
margin: 0px auto 10px auto; margin: 0px auto 10px auto;
font-size: 24px; font-size: 24px;
@ -307,25 +271,27 @@ export default {
letter-spacing: 2px; letter-spacing: 2px;
} }
.login-form::after { .login-form::after {
content: ""; content: "";
position: absolute; position: absolute;
left:-4px; left: -4px;
top:0px; top: 0px;
width:4px; width: 4px;
height:100%; height: 100%;
background:linear-gradient(180deg, #BDFFF600 0%, #BDFFF6 50%, #BDFFF600 100%); ; background: linear-gradient(180deg, #BDFFF600 0%, #BDFFF6 50%, #BDFFF600 100%);
} ;
}
.login-form::before { .login-form::before {
content: ""; content: "";
position: absolute; position: absolute;
right:-4px; right: -4px;
top:0px; top: 0px;
width:4px; width: 4px;
height:100%; height: 100%;
background:linear-gradient(180deg, #BDFFF600 0%, #BDFFF6 50%, #BDFFF600 100%); ; background: linear-gradient(180deg, #BDFFF600 0%, #BDFFF6 50%, #BDFFF600 100%);
} ;
}
.login-form { .login-form {
position: absolute; position: absolute;
@ -338,7 +304,7 @@ export default {
border-radius: 0px 0px 0px 0px; border-radius: 0px 0px 0px 0px;
opacity: 1; opacity: 1;
border: 4px solid #0C5963; border: 4px solid #0C5963;
padding:50px; padding: 50px;
// margin-left: 50%; // margin-left: 50%;
.loginTitle { .loginTitle {
@ -360,7 +326,8 @@ export default {
opacity: 1; opacity: 1;
border: 1px solid #01CFFE; border: 1px solid #01CFFE;
background-color: transparent; background-color: transparent;
margin-bottom: 12px;; margin-bottom: 12px;
;
input { input {
@ -368,29 +335,34 @@ export default {
height: 35px; height: 35px;
} }
} }
.input-icon { .input-icon {
height: 28px; height: 28px;
width: 28px; width: 28px;
margin-left: 2px; margin-left: 2px;
position: relative; position: relative;
left:14px; left: 14px;
top:18px; top: 18px;
} }
} }
.login-tip { .login-tip {
font-size: 13px; font-size: 13px;
text-align: center; text-align: center;
color: #bfbfbf; color: #bfbfbf;
} }
.login-code { .login-code {
width: 37%; width: 37%;
height: 35px; height: 35px;
float: right; float: right;
img { img {
cursor: pointer; cursor: pointer;
vertical-align: middle; vertical-align: middle;
} }
} }
.el-login-footer { .el-login-footer {
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
@ -403,6 +375,7 @@ export default {
font-size: 12px; font-size: 12px;
letter-spacing: 1px; letter-spacing: 1px;
} }
.login-code-img { .login-code-img {
height: 35px; height: 35px;
} }
@ -420,7 +393,5 @@ export default {
opacity: 1; opacity: 1;
} }
.el-button--goon:hover { .el-button--goon:hover {}
}
</style> </style>

Loading…
Cancel
Save