Commit 5df31795 authored by 赵伟庚's avatar 赵伟庚

[fix]: 部分代码格式化;修复控制台出现的warning;替换::v-deep为:deep()

parent 5bcb7b08
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<div class="container" :class="menuShow ? '' : 'full_screen'" v-if="pageShow"> <div class="container" :class="menuShow ? '' : 'full_screen'" v-if="pageShow">
<!-- <bg-nav :highlightParentRule="highlightParentRule" :title="nowParent.menuName" width="208px" :list="nowParent.children" v-show="navShow" class="con-nav" /> --> <!-- <bg-nav :highlightParentRule="highlightParentRule" :title="nowParent.menuName" width="208px" :list="nowParent.children" v-show="navShow" class="con-nav" /> -->
<bg-nav <bg-nav
v-if="nowParent.children"
:highlightParentRule="highlightParentRule" :highlightParentRule="highlightParentRule"
width="208px" width="208px"
:list="nowParent.children" :list="nowParent.children"
......
<template> <template>
<div class="login-by-account"> <div class="login-by-account">
<el-form <el-form ref="loginFormRef" label-position="top" :model="loginForm" :rules="steploginFormRules">
ref="loginFormRef"
label-position="top"
:model="loginForm"
:rules="steploginFormRules"
>
<el-form-item prop="userid"> <el-form-item prop="userid">
<el-input <el-input v-model="loginForm.userid" placeholder="请输入账号" @keyup.enter.native="loginAction()" />
v-model="loginForm.userid"
placeholder="请输入账号"
@keyup.enter.native="loginAction()"
/>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input
:type="hidePassword ? 'password' : 'text'" :type="hidePassword ? 'password' : 'text'"
v-model="loginForm.password" v-model="loginForm.password"
placeholder="请输入密码" placeholder="请输入密码"
@keyup.enter.native="loginAction()" @keyup.enter.native="loginAction()">
>
<span <span
slot="suffix" slot="suffix"
:title="hidePassword ? '显示密码' : '隐藏密码'" :title="hidePassword ? '显示密码' : '隐藏密码'"
:class="hidePassword ? 'hide-password' : 'show-password'" :class="hidePassword ? 'hide-password' : 'show-password'"
@click="hidePassword = !hidePassword" @click="hidePassword = !hidePassword"
style="cursor: pointer" style="cursor: pointer"></span>
></span>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="yzm"> <el-form-item prop="yzm">
...@@ -35,27 +24,19 @@ ...@@ -35,27 +24,19 @@
v-model="loginForm.yzm" v-model="loginForm.yzm"
placeholder="请输入验证码" placeholder="请输入验证码"
@keyup.enter.native="loginAction()" @keyup.enter.native="loginAction()"
style="width: 240px" style="width: 240px" />
/>
<div class="yzm_img"> <div class="yzm_img">
<img <img title="看不清?换一张" :src="imgSrc" @click="getImg()" style="width: 100%" />
title="看不清?换一张"
:src="imgSrc"
@click="getImg()"
style="width: 100%"
/>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="loginAction()" style="width: 100%"> <el-button type="primary" @click="loginAction()" style="width: 100%"> 登 录 </el-button>
登 录
</el-button>
</el-form-item> </el-form-item>
<el-form-item style="margin-top: 24px;"> <el-form-item style="margin-top: 24px">
<el-button class="register_btn" @click.prevent="$emit('register')" style="width: 100%"> <el-button class="register_btn" @click.prevent="$emit('register')" style="width: 100%">
还没有账号?前往注册&emsp; <bg-icon style="font-size: 12px;margin-right: 8px" icon="#bg-ic-arrow-right"></bg-icon> 还没有账号?前往注册&emsp;
<bg-icon style="font-size: 12px; margin-right: 8px" icon="#bg-ic-arrow-right"></bg-icon>
</el-button> </el-button>
</el-form-item> </el-form-item>
<div class="regist_bottom"> <div class="regist_bottom">
...@@ -74,8 +55,8 @@ import { generateRoutes } from "../router/index"; ...@@ -74,8 +55,8 @@ import { generateRoutes } from "../router/index";
import { reactive, toRefs, ref, onBeforeMount, nextTick } from "vue"; import { reactive, toRefs, ref, onBeforeMount, nextTick } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import axios from "@/request/http.js"; import axios from "@/request/http.js";
import { Encrypt } from "@/services/secret.js" import { Encrypt } from "@/services/secret.js";
import { useStore } from "vuex" import { useStore } from "vuex";
const state = reactive({ const state = reactive({
loginForm: { loginForm: {
...@@ -93,17 +74,15 @@ const state = reactive({ ...@@ -93,17 +74,15 @@ const state = reactive({
identifyCode: "", identifyCode: "",
hidePassword: true, hidePassword: true,
rememberPassword: false, rememberPassword: false,
}) });
const store = useStore() const store = useStore();
const loginFormRef = ref(null) const loginFormRef = ref(null);
const loginAction = () => { const loginAction = () => {
if (state.rememberPassword) { if (state.rememberPassword) {
let userinfo = window.btoa( let userinfo = window.btoa(encodeURI(`${state.loginForm.userid},${state.loginForm.password}`));
encodeURI(`${state.loginForm.userid},${state.loginForm.password}`)
);
setCookie("userinfo", userinfo); setCookie("userinfo", userinfo);
} else { } else {
clearCookie("userinfo"); clearCookie("userinfo");
...@@ -111,10 +90,7 @@ const loginAction = () => { ...@@ -111,10 +90,7 @@ const loginAction = () => {
loginFormRef.value.validate((valid) => { loginFormRef.value.validate((valid) => {
if (valid) { if (valid) {
axios.get( axios.get(`/apaas/system/v5/user/verifyCaptcha?id=${state.imgId}&value=${state.loginForm.yzm}`).then((res) => {
`/apaas/system/v5/user/verifyCaptcha?id=${state.imgId}&value=${state.loginForm.yzm}`
)
.then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
login(); login();
} else { } else {
...@@ -123,11 +99,12 @@ const loginAction = () => { ...@@ -123,11 +99,12 @@ const loginAction = () => {
}); });
} }
}); });
} };
const login = () => { const login = () => {
axios.post(`/apaas/system/v5/user/login`, { axios
.post(`/apaas/system/v5/user/login`, {
system_account: state.loginForm.userid, system_account: state.loginForm.userid,
password: Encrypt(state.loginForm.password) password: Encrypt(state.loginForm.password),
}) })
.then(({ data }) => { .then(({ data }) => {
if (data.code == 200) { if (data.code == 200) {
...@@ -140,17 +117,17 @@ const login = () => { ...@@ -140,17 +117,17 @@ const login = () => {
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
}); });
} };
const getUserInfo = () => { const getUserInfo = () => {
return axios.get(`/apaas/system/v5/user/getUserInfo`); return axios.get(`/apaas/system/v5/user/getUserInfo`);
} };
const getMenu = (search) => { const getMenu = (search) => {
return axios.get(`/apaas/system/v5/menu/user/tree?search=${search}`); return axios.get(`/apaas/system/v5/menu/user/tree?search=${search}`);
} };
const getUser = () => { const getUser = () => {
Promise.all([getUserInfo(), getMenu('dadb2d3f-e263-48d1-9389-42acb9ea49f8')]).then((res) => { Promise.all([getUserInfo(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")]).then((res) => {
if (res[0].data.code == 200 && res[1].data.code == 200) { if (res[0].data.code == 200 && res[1].data.code == 200) {
let data = res[1].data.data&&res[1].data.data[0].children || []; let data = (res[1].data.data && res[1].data.data[0].children) || [];
store.commit("setUserInfo", res[0].data.data); store.commit("setUserInfo", res[0].data.data);
// if (res.data.data.userType == 1) { // if (res.data.data.userType == 1) {
//超管 //超管
...@@ -171,7 +148,7 @@ const getUser = () => { ...@@ -171,7 +148,7 @@ const getUser = () => {
window.location.href = "/apaas/portal/ui/#/"; window.location.href = "/apaas/portal/ui/#/";
} }
}); });
} };
const getMenuObj = (menu, parentRowPath, menuObj) => { const getMenuObj = (menu, parentRowPath, menuObj) => {
menu.forEach((e, idx) => { menu.forEach((e, idx) => {
e.rowPath = parentRowPath + "." + idx; e.rowPath = parentRowPath + "." + idx;
...@@ -180,10 +157,9 @@ const getMenuObj = (menu, parentRowPath, menuObj) => { ...@@ -180,10 +157,9 @@ const getMenuObj = (menu, parentRowPath, menuObj) => {
getMenuObj(e.children, e.rowPath, menuObj); getMenuObj(e.children, e.rowPath, menuObj);
} }
}); });
} };
const getImg = (clearInput = false) => { const getImg = (clearInput = false) => {
axios.get(`/apaas/system/v5/user/getCaptcha??width=240&height=32`) axios.get(`/apaas/system/v5/user/getCaptcha??width=240&height=32`).then((res) => {
.then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
state.imgId = res.data.data.id; state.imgId = res.data.data.id;
state.imgSrc = res.data.data.captcha; state.imgSrc = res.data.data.captcha;
...@@ -192,7 +168,7 @@ const getImg = (clearInput = false) => { ...@@ -192,7 +168,7 @@ const getImg = (clearInput = false) => {
if (clearInput) { if (clearInput) {
state.loginForm.yzm = ""; state.loginForm.yzm = "";
} }
} };
onBeforeMount(() => { onBeforeMount(() => {
getImg(); getImg();
if (getCookie("userinfo")) { if (getCookie("userinfo")) {
...@@ -206,13 +182,12 @@ onBeforeMount(() => { ...@@ -206,13 +182,12 @@ onBeforeMount(() => {
} else { } else {
state.checked = false; state.checked = false;
} }
}) });
const {loginForm, steploginFormRules, imgId, imgSrc, identifyCode, hidePassword, rememberPassword} = toRefs(state) const { loginForm, steploginFormRules, imgId, imgSrc, identifyCode, hidePassword, rememberPassword } = toRefs(state);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.login-by-account { .login-by-account {
.msg-code { .msg-code {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -233,5 +208,4 @@ const {loginForm, steploginFormRules, imgId, imgSrc, identifyCode, hidePassword, ...@@ -233,5 +208,4 @@ const {loginForm, steploginFormRules, imgId, imgSrc, identifyCode, hidePassword,
line-height: 34px; line-height: 34px;
} }
} }
</style> </style>
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
v-model="loginForm.mobile" v-model="loginForm.mobile"
autofocus="autofocus" autofocus="autofocus"
placeholder="请输入手机号码" placeholder="请输入手机号码"
@keyup.enter.native="loginAction()" @keyup.enter.native="loginAction()" />
/>
</el-form-item> </el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<div class="msg-code"> <div class="msg-code">
...@@ -15,13 +14,15 @@ ...@@ -15,13 +14,15 @@
v-model="loginForm.code" v-model="loginForm.code"
placeholder="请输入验证码" placeholder="请输入验证码"
@keyup.enter.native="loginAction()" @keyup.enter.native="loginAction()"
style="width: 280px" style="width: 280px">
>
</el-input> </el-input>
<div class="yzm_img"> <div class="yzm_img">
<el-button type="primary" @click.prevent="getMsgCode()" style="width: 100%;height: 34px;"> <el-button
{{countDown > 0 ? countDown + '秒后再次获取' : '发送验证码'}} type="primary"
:disabled="countDown > 0"
@click.prevent="getMsgCode()"
style="width: 100%; height: 34px">
{{ countDown > 0 ? countDown + "秒后再次获取" : "发送验证码" }}
</el-button> </el-button>
<!-- <a class="input-append disabled" v-if="false && countDown > 0"> <!-- <a class="input-append disabled" v-if="false && countDown > 0">
{{ countDown }}秒后再次获取 {{ countDown }}秒后再次获取
...@@ -31,16 +32,14 @@ ...@@ -31,16 +32,14 @@
</a> --> </a> -->
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="margin-top: 54px;"> <el-form-item style="margin-top: 54px">
<el-button type="primary" @click.prevent="loginAction()" style="width: 100%"> <el-button type="primary" @click.prevent="loginAction()" style="width: 100%"> 登 录 </el-button>
登 录
</el-button>
</el-form-item> </el-form-item>
<el-form-item style="margin-top: 24px;"> <el-form-item style="margin-top: 24px">
<el-button class="register_btn" @click.prevent="$emit('register')" style="width: 100%"> <el-button class="register_btn" @click.prevent="$emit('register')" style="width: 100%">
还没有账号?前往注册&emsp; <bg-icon style="font-size: 12px; margin-right: 8px" icon="#bg-ic-arrow-right"></bg-icon> 还没有账号?前往注册&emsp;
<bg-icon style="font-size: 12px; margin-right: 8px" icon="#bg-ic-arrow-right"></bg-icon>
</el-button> </el-button>
</el-form-item> </el-form-item>
<div> <div>
...@@ -48,14 +47,14 @@ ...@@ -48,14 +47,14 @@
</div> </div>
</el-form> </el-form>
</div> </div>
</template> </template>
<script setup> <script setup>
import { reactive, toRefs, ref, onBeforeMount, nextTick } from "vue"; import { reactive, toRefs, ref, onBeforeMount, nextTick } from "vue";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import axios from "@/request/http.js"; import axios from "@/request/http.js";
const validatePhone = (rule, value, callback) => { const validatePhone = (rule, value, callback) => {
const reg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/; const reg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
setTimeout(() => { setTimeout(() => {
...@@ -65,9 +64,9 @@ ...@@ -65,9 +64,9 @@
callback(); callback();
} }
}); });
}; };
const state = reactive({ const state = reactive({
loginForm: { loginForm: {
mobile: "", mobile: "",
code: "", code: "",
...@@ -81,24 +80,24 @@ ...@@ -81,24 +80,24 @@
}, },
countDown: 0, countDown: 0,
countDownTimer: null, countDownTimer: null,
}) });
const loginFormRef = ref(null) const loginFormRef = ref(null);
const getMsgCode = () => { const getMsgCode = () => {
loginFormRef.value.validateField("mobile", (valid) => { loginFormRef.value.validateField("mobile", (valid) => {
if (valid) { if (valid) {
axios.post('/apaas/system/v5/sms/verifyCode',{phone: state.loginForm.mobile}).then(({ data }) => { axios.post("/apaas/system/v5/sms/verifyCode", { phone: state.loginForm.mobile }).then(({ data }) => {
if (data.code == 200) { if (data.code == 200) {
countDownAction(); countDownAction();
}else { } else {
ElMessage.error(data.data); ElMessage.error(data.data);
} }
}); });
} }
}); });
};// 获取验证码 }; // 获取验证码
const countDownAction = () => { const countDownAction = () => {
state.countDown = 60; state.countDown = 60;
if (state.countDownTimer) { if (state.countDownTimer) {
...@@ -112,11 +111,12 @@ ...@@ -112,11 +111,12 @@
clearInterval(state.countDownTimer); clearInterval(state.countDownTimer);
} }
}, 1000); }, 1000);
} };
const loginAction = () => { const loginAction = () => {
loginFormRef.value.validate((valid) => { loginFormRef.value.validate((valid) => {
if (valid) { if (valid) {
axios.post(`/apaas/system/v5/user/phone/login`, { axios
.post(`/apaas/system/v5/user/phone/login`, {
phone: state.loginForm.mobile, phone: state.loginForm.mobile,
code: state.loginForm.code, code: state.loginForm.code,
}) })
...@@ -132,18 +132,18 @@ ...@@ -132,18 +132,18 @@
}); });
} }
}); });
} // 短信验证码登录 }; // 短信验证码登录
const getUserInfo = () => { const getUserInfo = () => {
return axios.get(`/apaas/system/v5/user/getUserInfo`); return axios.get(`/apaas/system/v5/user/getUserInfo`);
} };
const getMenu = (search) => { const getMenu = (search) => {
return axios.get(`/apaas/system/v5/menu/user/tree?search=${search}`); return axios.get(`/apaas/system/v5/menu/user/tree?search=${search}`);
} };
const getUser = () => { const getUser = () => {
Promise.all([getUserInfo(), getMenu('dadb2d3f-e263-48d1-9389-42acb9ea49f8')]).then((res) => { Promise.all([getUserInfo(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")]).then((res) => {
if (res[0].data.code == 200 && res[1].data.code == 200) { if (res[0].data.code == 200 && res[1].data.code == 200) {
let data = res[1].data.data&&res[1].data.data[0].children || []; let data = (res[1].data.data && res[1].data.data[0].children) || [];
store.commit("setUserInfo", res[0].data.data); store.commit("setUserInfo", res[0].data.data);
// if (res.data.data.userType == 1) { // if (res.data.data.userType == 1) {
//超管 //超管
...@@ -164,13 +164,13 @@ ...@@ -164,13 +164,13 @@
window.location.href = "/apaas/portal/ui/#/"; window.location.href = "/apaas/portal/ui/#/";
} }
}); });
} };
const { loginForm, loginFormRules, countDown, countDownTimer } = toRefs(state); const { loginForm, loginFormRules, countDown, countDownTimer } = toRefs(state);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.login-by-code { .login-by-code {
.msg-code { .msg-code {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -194,6 +194,5 @@ ...@@ -194,6 +194,5 @@
} }
} }
} }
} }
</style> </style>
\ No newline at end of file
import {createI18n} from 'vue-i18n' import {createI18n} from 'vue-i18n/index'
import lang from './index' import lang from './index'
const i18n = createI18n({ const i18n = createI18n({
......
...@@ -27,7 +27,7 @@ import i18n from "./i18n/i18n.js"; ...@@ -27,7 +27,7 @@ import i18n from "./i18n/i18n.js";
import axios from "./request/http.js"; import axios from "./request/http.js";
const createVue = createApp(App); const createVue = createApp(App);
createVue.use(ElementPlus, { locale }); // createVue.use(ElementPlus, { locale });
function getMsgAppid() { function getMsgAppid() {
axios.get(`/apaas/system/v5/message/account`).then((res) => { axios.get(`/apaas/system/v5/message/account`).then((res) => {
...@@ -96,12 +96,11 @@ Promise.all([getUser(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")]) ...@@ -96,12 +96,11 @@ Promise.all([getUser(), getMenu("dadb2d3f-e263-48d1-9389-42acb9ea49f8")])
// } // }
} }
generateRoutes(); generateRoutes();
createVue.use(ElementPlus).use(store).use(router).use(i18n).use(bgui);
createVue.mount("#app");
}) })
.catch(() => { .catch((e) => {
createVue.use(ElementPlus).use(store).use(router).use(i18n).use(bgui); console.error(e)
}).finally(() => {
createVue.use(ElementPlus, { locale }).use(store).use(router).use(i18n).use(bgui);
createVue.mount("#app"); createVue.mount("#app");
}); });
......
...@@ -10,63 +10,52 @@ ...@@ -10,63 +10,52 @@
<bg-tabs <bg-tabs
class="login-tab" class="login-tab"
v-model="loginTab" v-model="loginTab"
style="min-height: 450px;width: 480px" style="min-height: 450px; width: 480px"
v-if="pageType === 'login'" v-if="pageType === 'login'">
>
<bg-tab label="账号密码登录" name="account"> <bg-tab label="账号密码登录" name="account">
<LoginByAccount @register="switchPageType('account')" @password="password"/> <LoginByAccount @register="switchPageType('account')" @password="password" />
</bg-tab> </bg-tab>
<bg-tab label="验证码登录" name="register"> <bg-tab label="验证码登录" name="register">
<LoginByCode @register="switchPageType('register')" @password="password"/> <LoginByCode @register="switchPageType('register')" @password="password" />
</bg-tab> </bg-tab>
</bg-tabs> </bg-tabs>
</div> </div>
</div> </div>
<!-- v-if="pageType !== 'register'" --> <!-- v-if="pageType !== 'register'" -->
<div class="bg-msg"> <div class="bg-msg">
<p> <p>Copyright © 比格大数据, All Rights Reserved.</p>
Copyright © 比格大数据, All Rights Reserved. <p>ICP备案序号:晋ICP备12000773号 | 晋公网安备 14010602060307号</p>
</p> <p>法律声明 | 隐私政策</p>
<p>
ICP备案序号:晋ICP备12000773号 | 晋公网安备 14010602060307号
</p>
<p>
法律声明 | 隐私政策
</p>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import LoginByAccount from "@/components/login-by-account.vue"; import LoginByAccount from "@/components/login-by-account.vue";
import LoginByCode from "@/components/login-by-code.vue"; import LoginByCode from "@/components/login-by-code.vue";
// import RegisterPersonalUser from "@/components/register-personal-user.vue"; // import RegisterPersonalUser from "@/components/register-personal-user.vue";
// import RegisterFrimUser from "@/components/register-firm-user.vue"; // import RegisterFrimUser from "@/components/register-firm-user.vue";
// import RegisterOrgUser from "@/components/register-org-user.vue"; // import RegisterOrgUser from "@/components/register-org-user.vue";
// import RegisterSuccess from "@/components/register-success.vue"; // import RegisterSuccess from "@/components/register-success.vue";
import { ref, computed, onMounted } from "vue"; import { ref, computed, onMounted } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
const router = useRouter(); const router = useRouter();
const pageType = ref('login') const pageType = ref("login");
const loginTab = ref('account') const loginTab = ref("account");
const registerTab = ref('registerTab') const registerTab = ref("registerTab");
const switchPageType = (type) => { const switchPageType = (type) => {
// pageType.value = type // pageType.value = type
router.push('/registe') router.push("/registe");
};
} const password = () => {
const password = () => { router.push("/password");
router.push('/password') };
} </script>
</script> <style lang="scss" scoped>
.login-container {
<style lang="scss" scoped>
.login-container {
width: 100vw; width: 100vw;
height: calc(100vh - 56px); height: calc(100vh - 56px);
background-image: url("@/assets/imgs/bg_zhuce.png"); background-image: url("@/assets/imgs/bg_zhuce.png");
...@@ -106,7 +95,7 @@ ...@@ -106,7 +95,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.logo{ .logo {
width: 450px; width: 450px;
} }
...@@ -118,7 +107,6 @@ ...@@ -118,7 +107,6 @@
} }
> .bg-content { > .bg-content {
} }
} }
> .bg-warning { > .bg-warning {
...@@ -142,8 +130,6 @@ ...@@ -142,8 +130,6 @@
> p { > p {
padding: 8px 0; padding: 8px 0;
} }
}
} }
</style> }
</style>
\ No newline at end of file
...@@ -445,10 +445,10 @@ onBeforeMount(() => { ...@@ -445,10 +445,10 @@ onBeforeMount(() => {
border-radius: 3px; border-radius: 3px;
border: solid 1px #b0bee8; border: solid 1px #b0bee8;
} }
::v-deep td { :deep() td {
padding: 9px 0 !important; padding: 9px 0 !important;
} }
::v-deep .el-switch { :deep() .el-switch {
height: 20px; height: 20px;
width: 44px; width: 44px;
.el-switch__core { .el-switch__core {
...@@ -460,7 +460,7 @@ onBeforeMount(() => { ...@@ -460,7 +460,7 @@ onBeforeMount(() => {
} }
} }
::v-deep .dialog_box_detail { :deep() .dialog_box_detail {
.el-dialog__body { .el-dialog__body {
padding: 0 0 18px 0; padding: 0 0 18px 0;
height: 580px; height: 580px;
......
...@@ -97,7 +97,7 @@ const rules = reactive({}); ...@@ -97,7 +97,7 @@ const rules = reactive({});
padding-left: 24px; padding-left: 24px;
.el-form { .el-form {
width: 60%; width: 60%;
::v-deep .el-form-item { :deep() .el-form-item {
&:nth-of-type(1) { &:nth-of-type(1) {
.el-upload--picture-card { .el-upload--picture-card {
width: 120px; width: 120px;
...@@ -112,7 +112,7 @@ const rules = reactive({}); ...@@ -112,7 +112,7 @@ const rules = reactive({});
} }
} }
} }
::v-deep .gap-title { :deep() .gap-title {
font-size: 16px; font-size: 16px;
color: #202531; color: #202531;
} }
......
...@@ -254,7 +254,7 @@ const save = () => {}; ...@@ -254,7 +254,7 @@ const save = () => {};
.authorizeForm, .authorizeForm,
.secureForm, .secureForm,
.registerForm { .registerForm {
::v-deep .el-form-item { :deep() .el-form-item {
margin-bottom: 24px; margin-bottom: 24px;
width: 750px; width: 750px;
font-size: 14px; font-size: 14px;
......
...@@ -248,11 +248,11 @@ const save = () => { ...@@ -248,11 +248,11 @@ const save = () => {
} }
.approveForm { .approveForm {
padding: 24px 24px 0 24px; padding: 24px 24px 0 24px;
::v-deep .el-form-item { :deep() .el-form-item {
margin-bottom: 24px; margin-bottom: 24px;
} }
::v-deep .el-form-item__label, :deep() .el-form-item__label,
::v-deep .el-radio__label { :deep() .el-radio__label {
color: var(--el-text-color-primary); color: var(--el-text-color-primary);
} }
} }
......
...@@ -482,10 +482,10 @@ onBeforeMount(() => { ...@@ -482,10 +482,10 @@ onBeforeMount(() => {
border-radius: 3px; border-radius: 3px;
border: solid 1px #b0bee8; border: solid 1px #b0bee8;
} }
::v-deep td { :deep() td {
padding: 9px 0 !important; padding: 9px 0 !important;
} }
::v-deep .el-switch { :deep() .el-switch {
height: 20px; height: 20px;
width: 44px; width: 44px;
.el-switch__core { .el-switch__core {
...@@ -497,7 +497,7 @@ onBeforeMount(() => { ...@@ -497,7 +497,7 @@ onBeforeMount(() => {
} }
} }
::v-deep .dialog_box_detail { :deep() .dialog_box_detail {
.el-dialog__body { .el-dialog__body {
padding: 0 0 18px 0; padding: 0 0 18px 0;
height: 580px; height: 580px;
......
...@@ -482,10 +482,10 @@ onBeforeMount(() => { ...@@ -482,10 +482,10 @@ onBeforeMount(() => {
border-radius: 3px; border-radius: 3px;
border: solid 1px #b0bee8; border: solid 1px #b0bee8;
} }
::v-deep td { :deep() td {
padding: 9px 0 !important; padding: 9px 0 !important;
} }
::v-deep .el-switch { :deep() .el-switch {
height: 20px; height: 20px;
width: 44px; width: 44px;
.el-switch__core { .el-switch__core {
...@@ -497,7 +497,7 @@ onBeforeMount(() => { ...@@ -497,7 +497,7 @@ onBeforeMount(() => {
} }
} }
::v-deep .dialog_box_detail { :deep() .dialog_box_detail {
.el-dialog__body { .el-dialog__body {
padding: 0 0 18px 0; padding: 0 0 18px 0;
height: 580px; height: 580px;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="bg-breadcrumb"> <div class="bg-breadcrumb">
<el-breadcrumb separator="/"> <el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '/login' }"> 登录 </el-breadcrumb-item> <el-breadcrumb-item :to="{ path: '/login' }"> 登录 </el-breadcrumb-item>
<el-breadcrumb-item > 注册 </el-breadcrumb-item> <el-breadcrumb-item> 注册 </el-breadcrumb-item>
</el-breadcrumb> </el-breadcrumb>
</div> </div>
<div class="registe-content"> <div class="registe-content">
...@@ -12,13 +12,7 @@ ...@@ -12,13 +12,7 @@
<div class="registe-heade-sub">注册信息提示审批后即可登录</div> <div class="registe-heade-sub">注册信息提示审批后即可登录</div>
</div> </div>
<div class="registe-form"> <div class="registe-form">
<el-form <el-form ref="infoFormRef" :model="infoForm" label-width="120px" :rules="infoFormRules" style="width: 90%">
ref="infoFormRef"
:model="infoForm"
label-width="120px"
:rules="infoFormRules"
style="width: 90%"
>
<div class="registe-info"> <div class="registe-info">
<div class="title"> <div class="title">
<div><span class="icon_box"></span> 基础信息</div> <div><span class="icon_box"></span> 基础信息</div>
...@@ -35,70 +29,41 @@ ...@@ -35,70 +29,41 @@
style="width: 100%" /> style="width: 100%" />
</el-form-item> </el-form-item>
<el-form-item prop="business_name" label="业务系统名称"> <el-form-item prop="business_name" label="业务系统名称">
<el-input <el-input v-model="infoForm.business_name" placeholder="请输入" maxlength="20" show-word-limit />
v-model="infoForm.business_name"
placeholder="请输入"
maxlength="20"
show-word-limit
/>
</el-form-item> </el-form-item>
<el-form-item prop="develop_id" label="开发厂商名称"> <el-form-item prop="develop_id" label="开发厂商名称">
<el-select <el-select v-model="infoForm.develop_id" placeholder="请选择" filterable style="width: 100%">
v-model="infoForm.develop_id"
placeholder="请选择"
filterable
style="width: 100%">
<el-option <el-option
v-for="item in developList" v-for="item in developList"
:key="'develop_'+item.id" :key="'develop_' + item.id"
:label="item.dict_name" :label="item.dict_name"
:value="item.id" :value="item.id" />
/>
<template #empty> <template #empty>
<div class="select-empty"> <div class="select-empty">
<div>无匹配数据</div> <div>无匹配数据</div>
<el-button style="height: 32px;margin-top: 10px;" @click="addDevelop"> 新增</el-button> <el-button style="height: 32px; margin-top: 10px" @click="addDevelop"> 新增</el-button>
</div> </div>
</template> </template>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="system_account" label="账号"> <el-form-item prop="system_account" label="账号">
<el-input <el-input v-model="infoForm.system_account" placeholder="请输入" />
v-model="infoForm.system_account"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
<el-form-item prop="password" label="密码"> <el-form-item prop="password" label="密码">
<el-input <el-input type="password" v-model="infoForm.password" placeholder="请输入" />
type="password"
v-model="infoForm.password"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
<el-form-item prop="confirm_password" label="确认密码"> <el-form-item prop="confirm_password" label="确认密码">
<el-input <el-input type="password" v-model="infoForm.confirm_password" placeholder="请输入" />
type="password"
v-model="infoForm.confirm_password"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
<el-form-item prop="phone" label="手机号"> <el-form-item prop="phone" label="手机号">
<el-input <el-input v-model="infoForm.phone" placeholder="请输入" />
v-model="infoForm.phone"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
<el-form-item prop="code" label="验证码"> <el-form-item prop="code" label="验证码">
<div class="msg-code"> <div class="msg-code">
<el-input <el-input v-model="infoForm.code" placeholder="请输入" style="860px"> </el-input>
v-model="infoForm.code"
placeholder="请输入"
style="860px"
>
</el-input>
<div class="yzm_img"> <div class="yzm_img">
<el-button type="primary" style="width: 100%;height: 34px;" @click="sendSms" :disabled="countDown"> <el-button type="primary" style="width: 100%; height: 34px" @click="sendSms" :disabled="countDown">
{{countDown > 0 ? countDown + '秒后再次获取' : '发送验证码'}} {{ countDown > 0 ? countDown + "秒后再次获取" : "发送验证码" }}
</el-button> </el-button>
</div> </div>
</div> </div>
...@@ -110,8 +75,7 @@ ...@@ -110,8 +75,7 @@
v-model="infoForm.business_desc" v-model="infoForm.business_desc"
placeholder="请输入" placeholder="请输入"
maxlength="200" maxlength="200"
show-word-limit show-word-limit />
/>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
...@@ -122,16 +86,10 @@ ...@@ -122,16 +86,10 @@
</div> </div>
<div class="info-form"> <div class="info-form">
<el-form-item prop="contact_name" label="联系人"> <el-form-item prop="contact_name" label="联系人">
<el-input <el-input v-model="infoForm.contact_name" placeholder="请输入" />
v-model="infoForm.contact_name"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
<el-form-item prop="contact_phone" label="联系电话"> <el-form-item prop="contact_phone" label="联系电话">
<el-input <el-input v-model="infoForm.contact_phone" placeholder="请输入" />
v-model="infoForm.contact_phone"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
...@@ -149,13 +107,9 @@ ...@@ -149,13 +107,9 @@
:model="developForm" :model="developForm"
label-width="120px" label-width="120px"
:rules="developFormRules" :rules="developFormRules"
style="width: 90%" style="width: 90%">
>
<el-form-item prop="develop" label="开发厂商名称"> <el-form-item prop="develop" label="开发厂商名称">
<el-input <el-input v-model="developForm.develop" placeholder="请输入" />
v-model="developForm.develop"
placeholder="请输入"
/>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -173,9 +127,9 @@ ...@@ -173,9 +127,9 @@
import { ref, computed, onMounted, reactive, toRefs } from "vue"; import { ref, computed, onMounted, reactive, toRefs } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import axios from "@/request/http.js"; import axios from "@/request/http.js";
import { Encrypt } from "@/services/secret.js" import { Encrypt } from "@/services/secret.js";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { validatePhone } from "@/services/rules.js" import { validatePhone } from "@/services/rules.js";
const validateBusinessName = (rule, value, callback) => { const validateBusinessName = (rule, value, callback) => {
let reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/; let reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
...@@ -212,16 +166,15 @@ const validateSystemAccount = (rule, value, callback) => { ...@@ -212,16 +166,15 @@ const validateSystemAccount = (rule, value, callback) => {
}; };
const checkPhoneRepet = (rule, value, callback) => { const checkPhoneRepet = (rule, value, callback) => {
let params = {phone: value}; let params = { phone: value };
axios.post(`/apaas/system/v5/user/checkPhone`,params) axios.post(`/apaas/system/v5/user/checkPhone`, params).then((res) => {
.then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
callback() callback();
}else { } else {
callback(new Error(res.data.data)) callback(new Error(res.data.data));
} }
}) });
} };
const validatePass = (rule, value, callback) => { const validatePass = (rule, value, callback) => {
if (value !== state.infoForm.password) { if (value !== state.infoForm.password) {
...@@ -244,13 +197,14 @@ const state = reactive({ ...@@ -244,13 +197,14 @@ const state = reactive({
code: "", code: "",
business_desc: "", business_desc: "",
contact_name: "", contact_name: "",
contact_phone: "" contact_phone: "",
}, },
infoFormRules: { infoFormRules: {
organization_id: [{ required: true, message: "请选择开发厂商", trigger: "blur" }], organization_id: [{ required: true, message: "请选择开发厂商", trigger: "blur" }],
business_name: [ business_name: [
{ required: true, message: "请输入业务系统名称", trigger: "blur" }, { required: true, message: "请输入业务系统名称", trigger: "blur" },
{ validator: validateBusinessName, trigger: "blur" },], { validator: validateBusinessName, trigger: "blur" },
],
develop_id: [{ required: true, message: "请选择开发厂商", trigger: "blur" }], develop_id: [{ required: true, message: "请选择开发厂商", trigger: "blur" }],
system_account: [ system_account: [
{ required: true, message: "请输入账号", trigger: "blur" }, { required: true, message: "请输入账号", trigger: "blur" },
...@@ -266,16 +220,20 @@ const state = reactive({ ...@@ -266,16 +220,20 @@ const state = reactive({
{ required: true, message: "请确认密码", trigger: "blur" }, { required: true, message: "请确认密码", trigger: "blur" },
{ validator: validatePass, trigger: "blur" }, { validator: validatePass, trigger: "blur" },
], ],
phone: [{ required: true, message: "请输入手机号", trigger: "blur" }, phone: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ validator: validatePhone, trigger: "blur" }, { validator: validatePhone, trigger: "blur" },
{ validator: checkPhoneRepet, trigger: "blur" },], { validator: checkPhoneRepet, trigger: "blur" },
],
code: [{ required: true, message: "请输入验证码", trigger: "blur" }], code: [{ required: true, message: "请输入验证码", trigger: "blur" }],
contact_name: [{ required: true, message: "请输入联系人", trigger: "blur" }], contact_name: [{ required: true, message: "请输入联系人", trigger: "blur" }],
contact_phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }, contact_phone: [
{ validator: validatePhone, trigger: "blur" }], { required: true, message: "请输入联系电话", trigger: "blur" },
{ validator: validatePhone, trigger: "blur" },
],
}, },
developForm: { developForm: {
develop: "" develop: "",
}, },
developFormRules: { developFormRules: {
develop: [{ required: true, message: "请输入开发厂商名称", trigger: "blur" }], develop: [{ required: true, message: "请输入开发厂商名称", trigger: "blur" }],
...@@ -284,17 +242,17 @@ const state = reactive({ ...@@ -284,17 +242,17 @@ const state = reactive({
countDown: 0, countDown: 0,
countDownTimer: null, countDownTimer: null,
orgData: [], orgData: [],
developList: [] developList: [],
}) });
const treeProps = { const treeProps = {
label: "name", label: "name",
children: "Child", children: "Child",
value: "organization_id", value: "organization_id",
}; };
// const loading = ref(false) // const loading = ref(false)
const list = ref([]) const list = ref([]);
const infoFormRef = ref(null) const infoFormRef = ref(null);
const developFormRef = ref(null) const developFormRef = ref(null);
// const remoteMethod = (query) => { // const remoteMethod = (query) => {
// if (query) { // if (query) {
...@@ -312,7 +270,7 @@ const developFormRef = ref(null) ...@@ -312,7 +270,7 @@ const developFormRef = ref(null)
const submit = () => { const submit = () => {
infoFormRef.value.validate((valid) => { infoFormRef.value.validate((valid) => {
if(valid) { if (valid) {
const params = { const params = {
organization_id: state.infoForm.organization_id, organization_id: state.infoForm.organization_id,
business_name: state.infoForm.business_name, business_name: state.infoForm.business_name,
...@@ -323,32 +281,31 @@ const submit = () => { ...@@ -323,32 +281,31 @@ const submit = () => {
contact_name: state.infoForm.contact_name, contact_name: state.infoForm.contact_name,
contact_phone: state.infoForm.contact_phone, contact_phone: state.infoForm.contact_phone,
phone: state.infoForm.phone, phone: state.infoForm.phone,
code: state.infoForm.code code: state.infoForm.code,
} };
axios.post('/apaas/system/v5/user/register',params).then(({ data }) => { axios.post("/apaas/system/v5/user/register", params).then(({ data }) => {
if (data.code == 200) { if (data.code == 200) {
ElMessage.success("注册信息已提交!");
ElMessage.success('注册信息已提交!'); router.go(-1);
router.go(-1) } else {
}else {
ElMessage.error(data.data); ElMessage.error(data.data);
} }
}); });
} }
}) });
} };
const sendSms = () => { const sendSms = () => {
infoFormRef.value.validateField("phone", (valid) => { infoFormRef.value.validateField("phone", (valid) => {
if (valid) { if (valid) {
axios.post('/apaas/system/v5/sms/verifyCode',{phone: state.infoForm.phone}).then(({ data }) => { axios.post("/apaas/system/v5/sms/verifyCode", { phone: state.infoForm.phone }).then(({ data }) => {
if (data.code == 200) { if (data.code == 200) {
countDownAction(); countDownAction();
} }
}); });
} }
}); });
} };
const countDownAction = () => { const countDownAction = () => {
state.countDown = 60; state.countDown = 60;
...@@ -363,54 +320,57 @@ const countDownAction = () => { ...@@ -363,54 +320,57 @@ const countDownAction = () => {
clearInterval(state.countDownTimer); clearInterval(state.countDownTimer);
} }
}, 1000); }, 1000);
} };
const addDevelop = () => { const addDevelop = () => {
state.dialogVisit = true; state.dialogVisit = true;
} };
const handleCloseDialog = () => { const handleCloseDialog = () => {
state.dialogVisit = false; state.dialogVisit = false;
} };
const confirmAdd = () => { const confirmAdd = () => {
developFormRef.value.validate((valid) => { developFormRef.value.validate((valid) => {
if(valid) { if (valid) {
axios.post('/apaas/system/v5/user/dict/develop/add',{dict_name: state.developForm.develop}).then(({ data }) => { axios
.post("/apaas/system/v5/user/dict/develop/add", { dict_name: state.developForm.develop })
.then(({ data }) => {
if (data.code == 200) { if (data.code == 200) {
state.infoForm.develop_id = data.data; state.infoForm.develop_id = data.data;
getDevelopList() getDevelopList();
}else { } else {
ElMessage.error(data.data); ElMessage.error(data.data);
} }
handleCloseDialog() handleCloseDialog();
}); });
} }
}) });
} };
const getOrgData = () => { const getOrgData = () => {
axios.get('/apaas/system/v5/user/org/tree').then(({ data }) => { axios.get("/apaas/system/v5/user/org/tree").then(({ data }) => {
if (data.code == 200) { if (data.code == 200) {
state.orgData = data.data || [] state.orgData = data.data || [];
} }
}); });
} };
const getDevelopList = () => { const getDevelopList = () => {
axios.get('/apaas/system/v5/user/dict/develop').then(({ data }) => { axios.get("/apaas/system/v5/user/dict/develop").then(({ data }) => {
if (data.code == 200) { if (data.code == 200) {
state.developList = data.data || [] state.developList = data.data || [];
} }
}); });
} };
onMounted(() => { onMounted(() => {
getOrgData() getOrgData();
getDevelopList() getDevelopList();
}) });
const { infoForm, const {
infoForm,
infoFormRules, infoFormRules,
dialogVisit, dialogVisit,
developForm, developForm,
...@@ -418,19 +378,19 @@ const { infoForm, ...@@ -418,19 +378,19 @@ const { infoForm,
countDown, countDown,
countDownTimer, countDownTimer,
orgData, orgData,
developList } = toRefs(state) developList,
} = toRefs(state);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.registe-container { .registe-container {
margin: 0 auto; margin: 0 auto;
width: 1200px; width: 1200px;
height: 100%; height: 100%;
.registe-content { .registe-content {
background-color: #ffffff; background-color: #ffffff;
box-shadow: 0px 1px 4px 0px box-shadow: 0px 1px 4px 0px rgba(0, 7, 101, 0.15);
rgba(0, 7, 101, 0.15);
border-radius: 6px; border-radius: 6px;
// height: calc(100% - 100px); // height: calc(100% - 100px);
.registe-header { .registe-header {
...@@ -480,7 +440,6 @@ const { infoForm, ...@@ -480,7 +440,6 @@ const { infoForm,
margin-left: 20px; margin-left: 20px;
} }
} }
} }
.registe-footer { .registe-footer {
border-top: solid 1px #e6e9ef; border-top: solid 1px #e6e9ef;
...@@ -491,6 +450,5 @@ const { infoForm, ...@@ -491,6 +450,5 @@ const { infoForm,
.dialog_form { .dialog_form {
margin: 20px 0; margin: 20px 0;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -69,7 +69,7 @@ router.beforeEach((to, from, next) => { ...@@ -69,7 +69,7 @@ router.beforeEach((to, from, next) => {
// 检查to.path是否存在于免登陆白名单 // 检查to.path是否存在于免登陆白名单
if (inWhiteList(to.path)) { if (inWhiteList(to.path)) {
next(); return next();
} else { } else {
// 判断是否已经登录,未登录则重定向到首页或其他页面(通过query传参记录原来的路径) // 判断是否已经登录,未登录则重定向到首页或其他页面(通过query传参记录原来的路径)
// 根据配置判断是否跳转第三方登录,跳转第三方登录则不跳login // 根据配置判断是否跳转第三方登录,跳转第三方登录则不跳login
......
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