Commit 93515534 authored by 何小勇's avatar 何小勇

个人中心

parents 15b38901 4d6d53a0
......@@ -4,12 +4,17 @@
<bg-menu :path="nowParent.path" v-if="menuShow" @openMsg="openMsg"></bg-menu>
<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" width="208px" :list="nowParent.children" v-show="navShow" class="con-nav" />
<bg-nav
:highlightParentRule="highlightParentRule"
width="208px"
:list="nowParent.children"
v-show="navShow"
class="con-nav" />
<div class="bg-main view">
<router-view />
</div>
</div>
<div class="container" v-else-if="$route.path=='/login'">
<div class="container" v-else-if="$route.path == '/login'">
<div class="bg-main view">
<login></login>
</div>
......@@ -41,25 +46,25 @@ import page404 from '@/page/404.vue'
import registe from '@/page/registe/index.vue'
import password from '@/page/password/index.vue'
export default {
components:{
bgMenu,
components: {
bgMenu,
login,
page404,
registe,
password
},
computed:{
msgBoxFlag(){
return this.$store.state.msgBoxFlag
computed: {
msgBoxFlag() {
return this.$store.state.msgBoxFlag;
},
userInfo() {
return this.$store.state.userInfo || {};
},
navMenu(){
return this.$store.state.menu
navMenu() {
return this.$store.state.menu;
},
menuObj(){
return this.$store.state.menuObj
menuObj() {
return this.$store.state.menuObj;
},
navShow(){
return false||!['/','/404','/login','/registe','/password'].includes(this.$route.path)
......@@ -67,103 +72,99 @@ export default {
pageShow(){
return false||!['/404','/login','/registe','/password'].includes(this.$route.path)
},
rowPath(){
if(this.pageShow&&this.$store.state.userInfo){
return this.menuObj[this.$route.path]&&this.menuObj[this.$route.path].rowPath
}else{
return ''
rowPath() {
if (this.pageShow && this.$store.state.userInfo) {
return this.menuObj[this.$route.path] && this.menuObj[this.$route.path].rowPath;
} else {
return "";
}
},
nowParent(){
if(this.pageShow&&this.$store.state.userInfo){
nowParent() {
if (this.pageShow && this.$store.state.userInfo) {
// console.log(2222222)
// console.log(this.navMenu)
// console.log(this.rowPath)
return this.rowPath?this.navMenu[this.rowPath.slice(1,2)]:''
}else{
return ''
return this.rowPath ? this.navMenu[this.rowPath.slice(1, 2)] : "";
} else {
return "";
}
},
menuShow() {
return false||!["/ui-example"].includes(this.$route.path)
}
return false || !["/ui-example"].includes(this.$route.path);
},
},
watch:{
msgBoxFlag(n,o){
this.readFlag = !this.readFlag
watch: {
msgBoxFlag(n, o) {
this.readFlag = !this.readFlag;
},
userInfo: {
handler() {
this.initMsg()
handler() {
this.initMsg();
},
deep: true,
}
},
},
data(){
return{
readFlag:false,
menuIndex:'',
}
data() {
return {
readFlag: false,
menuIndex: "",
};
},
created(){
created() {
// this.initMsg()
},
mounted() {
},
methods:{
mounted() {},
methods: {
openMsg(data) {
this.readFlag = !this.readFlag;
},
initMsg() {
if(this.userInfo && this.userInfo.system_id) {
this.$trace.setOptionValue('userId',this.userInfo.system_id)
if (this.userInfo && this.userInfo.system_id) {
this.$trace.setOptionValue("userId", this.userInfo.system_id);
// this.$trace.setOptionValue('userType',this.userInfo.userType)
// this.$trace.setOptionValue('roleId',this.userInfo.roleIds.join(','))
this.$trace.setOptionValue('organization',this.userInfo.organization_id)
this.$trace.setOptionValue("organization", this.userInfo.organization_id);
}
},
pathToData(data,path){
let arr = path.split('.')
let temp = null
let tempName = ''
let tempPath = ''
arr.forEach((e,idx) => {
if(idx==1){
temp = data[e]
tempName = data[e].menuName
tempPath = data[e].path
data = data[e]
pathToData(data, path) {
let arr = path.split(".");
let temp = null;
let tempName = "";
let tempPath = "";
arr.forEach((e, idx) => {
if (idx == 1) {
temp = data[e];
tempName = data[e].menuName;
tempPath = data[e].path;
data = data[e];
}
if(idx==2){
if(data.children&&data.children.length){
temp = data.children[e]
data = data.children[e]
if (idx == 2) {
if (data.children && data.children.length) {
temp = data.children[e];
data = data.children[e];
}
}
});
return {
menuName:tempName,
path:tempPath,
children:[temp]
}
menuName: tempName,
path: tempPath,
children: [temp],
};
},
highlightParentRule(pathArr){
return pathArr.includes(this.$route.path)
highlightParentRule(pathArr) {
return pathArr.includes(this.$route.path);
},
ada(){
ada() {
console.log(12312);
}
}
}
},
},
};
</script>
<style>
#app{
#app {
height: 100%;
}
.container{
.container {
width: 100%;
height: calc(100% - 56px);
overflow: hidden;
......@@ -174,10 +175,10 @@ export default {
.full_screen .bg-main {
overflow-x: hidden;
}
.con-nav{
.con-nav {
float: left;
}
.view{
.view {
height: 100%;
overflow-y: auto;
background-color: #ebedf2;
......
......@@ -82,7 +82,7 @@ const showMoreAction = (index) => {
const getChildrenPath = (arr, temp = []) => {
arr.forEach((e) => {
temp.push(e);
temp.push(e.path);
if (e.children && e.children.length) {
getChildrenPath(e.children, temp);
}
......
......@@ -864,7 +864,7 @@ a {
border-bottom: 1px solid #e6e9ef;
font-size: 20px;
line-height: 25px;
color: #404a62;
color: #616f94;
background: #f7f7f9;
cursor: pointer;
......
......@@ -74,7 +74,7 @@ import { generateRoutes } from "../router/index";
import { reactive, toRefs, ref, onBeforeMount, nextTick } from "vue";
import { ElMessage } from "element-plus";
import axios from "@/request/http.js";
import { Decrypt } from "@/services/secret.js"
import { Encrypt } from "@/services/secret.js"
import { useStore } from "vuex"
const state = reactive({
......@@ -127,7 +127,7 @@ const loginAction = () => {
const login = () => {
axios.post(`/apaas/system/v5/user/login`, {
system_account: state.loginForm.userid,
password: Decrypt(state.loginForm.password)
password: Encrypt(state.loginForm.password)
})
.then(({ data }) => {
if (data.code == 200) {
......
......@@ -44,7 +44,7 @@
</el-button>
</el-form-item>
<div>
<span class="fr forget_psd">忘记密码?</span>
<span class="fr forget_psd" @click.prevent="$emit('password')">忘记密码?</span>
</div>
</el-form>
</div>
......@@ -91,6 +91,8 @@
axios.post('/apaas/system/v5/sms/verifyCode',{phone: state.loginForm.mobile}).then(({ data }) => {
if (data.code == 200) {
countDownAction();
}else {
ElMessage.error(data.data);
}
});
}
......@@ -165,100 +167,6 @@
}
const { loginForm, loginFormRules, countDown, countDownTimer } = toRefs(state);
// export default {
// name: "LoginByCode", // 短信验证码登录
// data() {
// const validatePhone = (rule, value, callback) => {
// const reg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
// setTimeout(() => {
// if (!reg.test(value)) {
// callback(new Error("请输入正确的手机号码"));
// } else {
// callback();
// }
// });
// };
// return {
// loginForm: {
// mobile: "",
// code: "",
// },
// loginFormRules: {
// mobile: [
// { required: true, message: "请输入手机号码", trigger: "change" },
// { validator: validatePhone, trigger: "blur" },
// ],
// code: [{ required: true, message: "请输入验证码", trigger: "blur" }],
// },
// countDown: 0,
// countDownTimer: null,
// };
// },
// methods: {
// getMsgCode() {
// this.$refs.loginForm.validateField("mobile", (errMsg) => {
// if (!errMsg) {
// this.$api.general.getCode(this.loginForm.mobile).then(({ data }) => {
// if (data.success == 1) {
// this.countDownAction();
// }
// });
// }
// });
// }, // 获取验证码
// countDownAction() {
// this.countDown = 60;
// if (this.countDownTimer) {
// clearInterval(this.countDownTimer);
// }
// this.countDownTimer = setInterval(() => {
// if (this.countDown > 0) {
// this.countDown--;
// } else {
// clearInterval(this.countDownTimer);
// }
// }, 1000);
// },
// loginAction() {
// this.$refs.loginForm.validate((valid) => {
// if (valid) {
// this.$api.general
// .loginByCode(this.loginForm)
// .then(({ data }) => {
// if (data.success == 1) {
// let redirect = "/apaas/ui/#/index";
// // GIS重定向使用
// if (this.$route.query.ReturnUrl) {
// redirect = this.$route.query.ReturnUrl;
// }
// // 前端重定向使用
// else if (this.$route.query.redirect) {
// redirect = `/apaas/ui/#${this.$route.query.redirect}`;
// }
// window.location.href = redirect;
// } else {
// this.$message({
// message: data.errMsg || data.data || "登陆失败",
// type: "error",
// });
// }
// })
// .catch((error) => {
// console.log(error);
// });
// }
// });
// }, // 短信验证码登录
// },
// };
</script>
<style lang="scss" scoped>
......
<template>
<div class="login-container">
<div class="bg-warning">系统有效期剩余345 天,请管理员及时更换license!</div>
<div class="bg-main">
<!-- <div class="bg-logo">
<img class="logo" src="../../assets/imgs/login_img_logo.png" />
......@@ -16,7 +17,7 @@
<LoginByAccount @register="switchPageType('account')" @password="password"/>
</bg-tab>
<bg-tab label="验证码登录" name="register">
<LoginByCode @register="switchPageType('register')" />
<LoginByCode @register="switchPageType('register')" @password="password"/>
</bg-tab>
</bg-tabs>
</div>
......@@ -120,6 +121,14 @@
}
}
> .bg-warning {
text-align: center;
background-color: #fdf4e2;
color: #e56600;
font-size: 14px;
height: 32px;
line-height: 32px;
}
> .bg-msg {
position: absolute;
......
<template>
<div class="detail_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 配置管理 </el-breadcrumb-item>
<el-breadcrumb-item> 字典配置 </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="flex_row">
<div class="flex_left">
<div class="box">
......@@ -174,6 +169,7 @@ import { useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import axios from "../../../../request/http.js";
import { Search } from "@element-plus/icons-vue";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const bgForm = ref(null);
const state = reactive({
bgForm,
......
......@@ -51,22 +51,6 @@ const checkPhone = (rule, value, callback) => {
});
};
// const checkPhoneRepet = (rule, value, callback) => {
// let params = null;
// if (props.id){
// params = {id: parseInt(props.id),contact_phone: value,}
// }else {
// params = {id: 0,contact_phone: value}
// }
// $axios.post(`/apaas/system/v5/org/check`,params)
// .then((res) => {
// if (res.data.code == 200) {
// callback()
// }else {
// callback(new Error(res.data.data))
// }
// })
// }
const checkName = (rule, value, callback) => {
var reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
......@@ -86,7 +70,6 @@ const contactFormRules = reactive({
contact_phone: [
{ required: true, message: "请输入联系人手机号", trigger: "blur" },
{ validator: checkPhone, trigger: "blur" },
// { validator: checkPhoneRepet, trigger: 'blur' }
],
contact_email: [
{ type: "email", message: "请输入正确的邮箱", trigger: "blur" },
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 开发管理 </el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/develop/account' }"> 系统账号管理 </el-breadcrumb-item>
<el-breadcrumb-item> {{ route.query.id ? "编辑" : "新增" }} </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="page_content flex_cloumn">
<div class="content_top apaas_scroll">
<div class="content_process">
......@@ -106,6 +100,7 @@ import { reactive, ref, onBeforeMount, toRefs, computed, onBeforeUnmount, onMoun
import CryptoJS from "crypto-js";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const route = useRoute();
const router = useRouter();
const step = ref(1);
......@@ -119,6 +114,7 @@ const formData = reactive({
logo: "",
system_role_id: "",
system_account: "",
system_phone: "",
password: "",
confirm_password: "",
access_address: "",
......@@ -218,6 +214,7 @@ const getDetail = () => {
business_name: form.business_name,
business_desc: form.business_desc,
system_account: form.system_account,
system_phone: form.system_phone,
access_address: form.access_address,
develop_id: form.develop_id,
state: form.state,
......
......@@ -22,13 +22,24 @@
<el-input v-model="systemForm.business_name" />
</el-form-item>
<el-form-item label="AppId" prop="appid" v-if="formType">
<el-input v-model="systemForm.appid" :disabled="formType" style="width: 80%" />
<span class="pl-1"><el-button type="primary" @click="copyText(systemForm.appid)">复制</el-button></span>
<el-input v-model="systemForm.appid" :disabled="formType" >
<template #suffix>
<bg-icon icon="#bg-ic-copy" style="cursor: pointer;" @click="copyText(systemForm.appid)"></bg-icon>
</template>
</el-input>
<!-- <span class="pl-1"><el-button type="primary" @click="copyText(systemForm.appid)">复制</el-button></span> -->
</el-form-item>
<el-form-item label="AppSecret" prop="appsecret" v-if="formType">
<el-input v-model="systemForm.appsecret" :disabled="formType" style="width: 80%" />
<span class="pl-1"><el-button type="primary" @click="copyText(systemForm.appsecret)">复制</el-button></span>
<span class="pl-1"><el-button type="primary" @click="resetSecret">重置</el-button></span>
<div style="display: flex;width: 100%;">
<el-input v-model="systemForm.appsecret" :disabled="formType">
<template #suffix>
<bg-icon icon="#bg-ic-copy" style="cursor: pointer;" @click="copyText(systemForm.appsecret)"></bg-icon>
</template>
</el-input>
<span class="pl-1"><el-button type="primary" @click="resetSecret">重置</el-button></span>
</div>
</el-form-item>
<el-form-item label="系统LOGO" prop="logo">
<bg-upload-image
......@@ -52,6 +63,9 @@
<el-form-item label="账号" prop="system_account">
<el-input v-model="systemForm.system_account" />
</el-form-item>
<el-form-item label="手机号" prop="system_phone">
<el-input v-model="systemForm.system_phone" />
</el-form-item>
<el-form-item label="密码" prop="password" v-if="!formType">
<el-input :type="password_eye ? 'text' : 'password'" v-model="systemForm.password">
<template #suffix>
......@@ -84,6 +98,7 @@
import { reactive, ref, onBeforeMount, onMounted, computed } from "vue";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import { validatePhone } from "@/services/rules.js"
const props = defineProps({
formType: {
type: Boolean,
......@@ -102,6 +117,7 @@ const systemForm = reactive({
logo: [],
system_role_id: "",
system_account: "",
system_phone: "",
password: "",
confirm_password: "",
access_address: "",
......@@ -164,6 +180,23 @@ const validateSystemAccount = (rule, value, callback) => {
}
};
const checkPhoneRepet = (rule, value, callback) => {
let params = null;
if (props.id){
params = {id: parseInt(props.id),contact_phone: value,}
}else {
params = {id: 0,contact_phone: value}
}
axios.post(`/apaas/system/v5/org/check`,params)
.then((res) => {
if (res.data.code == 200) {
callback()
}else {
callback(new Error(res.data.data))
}
})
}
const formRules = reactive({
organization_id: [{ required: true, message: "请选择组织机构", trigger: "change" }],
business_name: [
......@@ -178,6 +211,11 @@ const formRules = reactive({
{ max: 20, message: "帐号最大长度为20个字符", trigger: "blur" },
{ validator: validateSystemAccount, trigger: "blur" },
],
system_phone: [
{ required: true, message: "请输入账号", trigger: "blur" },
{ validator: validatePhone, trigger: "blur" },
{ validator: checkPhoneRepet, trigger: "blur" },
],
password: [
{ required: true, message: "请输入密码", trigger: "blur" },
{ min: 8, message: "密码长度不得低于8位", trigger: "blur" },
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 开发管理 </el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/develop/account' }"> 系统账号管理 </el-breadcrumb-item>
<el-breadcrumb-item> 详情 </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="page_content apaas_scroll">
<div class="info_row">
<div class="title">
......@@ -48,6 +42,7 @@ import { reactive, toRefs, ref, onBeforeMount } from "vue";
import { useRoute, useRouter } from "vue-router";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const route = useRoute();
const baseInfo = reactive([
{
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 开发管理 </el-breadcrumb-item>
<el-breadcrumb-item> 系统账号管理 </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="flex_row">
<div class="flex_left bgc_white">
<div class="tree_header">政务机构</div>
......@@ -193,6 +188,7 @@ import { edit } from "ace-builds";
import CryptoJS from "crypto-js";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const dataTable = ref(null);
const headers = ref([
......@@ -429,7 +425,7 @@ const goDetail = (params) => {
const editAccount = (id) => {
router.push({
path: "/develop/account/add",
path: "/develop/account/edit",
query: {
id: id,
},
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 开发管理 </el-breadcrumb-item>
<el-breadcrumb-item> 菜单管理 </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="flex_row">
<div class="flex_left">
<div class="tree_content">
......@@ -104,6 +99,7 @@ import { useRouter } from "vue-router";
import { ElMessage } from "element-plus";
import axios from "../../../../request/http.js";
import menuForm from "./menu-form.vue";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const router = useRouter();
const menuTree = ref(null); // 树形
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 系统管理 </el-breadcrumb-item>
<el-breadcrumb-item> 组织管理 </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="flex_row">
<div class="flex_left bgc_white">
<div class="tree_header">政务机构</div>
......@@ -274,6 +269,7 @@ import { downloadFileFormatNew } from "@/services/helper";
import store from "@/store";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const dataTable = ref(null);
const toOrgDetail = () => {
......@@ -793,14 +789,15 @@ const deleteRowConfirm = () => {
const editAccount = (data) => {
if (selectTreeDataType.value === 1) {
router.push({
path: "/system/organization/org-user",
path: "/system/organization/org-user/edit",
query: {
id: data.id,
orgId: selectOrgNode.value.organization_id,
},
});
} else {
router.push({
path: "/system/organization/platform-user",
path: "/system/organization/platform-user/edit",
query: {
id: data.id,
},
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/system/organization' }"> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item> 组织详情 </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="page_content apaas_scroll">
<div class="info_row">
<div class="title">
......@@ -61,6 +55,7 @@ import { useRoute } from "vue-router";
import { downloadFileFormatNew } from "@/services/helper";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const route = useRoute();
const baseInfo = reactive([
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/system/organization' }"> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item> {{ route.query.id ? "编辑组织用户" : "新增组织管理员" }} </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="page_content flex_cloumn">
<div class="content_top apaas_scroll">
<div class="content_process">
......@@ -102,6 +96,7 @@ import { reactive, ref, onBeforeMount, toRefs, computed, onBeforeUnmount, onMoun
import CryptoJS from "crypto-js";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const route = useRoute();
const router = useRouter();
const step = ref(1);
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/system/organization' }"> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item> {{ route.query.id ? "编辑平台用户" : "新增平台用户" }} </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="page_content flex_cloumn">
<div class="content_top apaas_scroll">
<div class="content_process" v-if="!route.query.id">
......@@ -109,6 +103,7 @@ import CryptoJS from "crypto-js";
import { reactive, ref, onBeforeMount, toRefs, computed, onMounted } from "vue";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const route = useRoute();
const router = useRouter();
const step = ref(1);
......
<template>
<div class="page_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '/system/organization' }"> 组织管理 </el-breadcrumb-item>
<el-breadcrumb-item> 用户详情 </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="page_content apaas_scroll">
<div class="info_row">
<div class="title">
......@@ -49,6 +43,7 @@ import { reactive, toRefs, ref, computed, onBeforeMount } from "vue";
import { useRoute } from "vue-router";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const route = useRoute();
const accountInfo = reactive([
......
<!-- 角色管理 -->
<template>
<div class="detail_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 系统管理 </el-breadcrumb-item>
<el-breadcrumb-item to="/system/role"> 角色管理 </el-breadcrumb-item>
<el-breadcrumb-item> {{ route.query.id ? "编辑" : "新增" }} </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="main_container">
<div class="top_form bg-scroll">
<el-form ref="form" :rules="rules" :model="formData" class="role_form">
......@@ -65,6 +59,7 @@ import { reactive, toRefs, ref, onBeforeMount, nextTick } from "vue";
import axios from "../../../../../request/http.js";
import { ElMessage } from "element-plus";
import { useRouter, useRoute } from "vue-router";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const router = useRouter();
const route = useRoute();
const form = ref(null);
......
<!-- 角色管理 -->
<template>
<div class="detail_container">
<div class="bg-breadcrumb">
<el-breadcrumb separator="/">
<el-breadcrumb-item> 系统管理 </el-breadcrumb-item>
<el-breadcrumb-item> 角色管理 </el-breadcrumb-item>
</el-breadcrumb>
</div>
<bg-breadcrumb></bg-breadcrumb>
<div class="main_container">
<bg-filter-group @search="changeSearch" v-model="filter.search" placeholder="请输入角色名称">
<template v-slot:left_action>
......@@ -185,6 +180,7 @@ import { reactive, toRefs, ref, onBeforeMount, nextTick } from "vue";
import axios from "../../../../request/http.js";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
import bgBreadcrumb from "@/components/bg-breadcrumb.vue";
const router = useRouter();
const Bgtable = ref(null);
const userTable = ref(null);
......
......@@ -7,10 +7,10 @@
ref="accountRef"
style="max-width: 90%">
<el-form-item label="手机号" prop="phone">
<el-input v-model="accountForm.phone"/>
<el-input v-model="accountForm.phone" @input="phoneChange"/>
</el-form-item>
<el-form-item label="账号" prop="account">
<el-input v-model="accountForm.account" />
<el-form-item label="账号" prop="account" >
<el-input v-model="accountForm.account" disabled />
</el-form-item>
<el-form-item label="验证码" prop="code">
<div class="msg-code">
......@@ -21,8 +21,8 @@
>
</el-input>
<div class="yzm_img">
<el-button type="primary" @click="sendSms" style="width: 100%;height: 34px;">
发送验证码
<el-button type="primary" @click.prevent="getMsgCode()" style="width: 100%;height: 34px;">
{{countDown > 0 ? countDown + '秒后再次获取' : '发送验证码'}}
</el-button>
</div>
</div>
......@@ -34,6 +34,7 @@
import { reactive, ref, onBeforeMount, onMounted, computed } from "vue";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import { validatePhone } from "@/services/rules.js"
const props = defineProps({
});
......@@ -45,7 +46,10 @@ const accountForm = reactive({
const formRules = reactive({
phone: [{ required: true, message: "请输入手机号", trigger: "blur" }],
phone: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ validator: validatePhone, trigger: "blur" },
],
account: [
{ required: true, message: "请输入账号", trigger: "blur" },
],
......@@ -54,6 +58,9 @@ const formRules = reactive({
],
});
const countDown = ref(0)
const countDownTimer = ref(null)
const accountRef = ref(null);
const emit = defineEmits(["action"]);
const submitForm = async () => {
......@@ -76,8 +83,50 @@ const setForm = (data) => {
Object.assign(accountForm, data);
};
const sendSms = () => {
const getMsgCode = () => {
if (accountForm.account) {
axios.post('/apaas/system/v5/sms/verifyCode',{phone: accountForm.phone}).then(({ data }) => {
if (data.code == 200) {
countDownAction();
}else {
ElMessage.error(data.data);
}
});
}else {
ElMessage.error("该手机号未注册,请核对手机号!");
}
};// 获取验证码
const countDownAction = () => {
countDown.value = 60;
if (countDownTimer.value) {
clearInterval(countDownTimer.value);
}
countDownTimer.value = setInterval(() => {
if (countDown.value > 0) {
countDown.value--;
} else {
clearInterval(countDownTimer.value);
}
}, 1000);
}
const phoneChange = () => {
if(accountForm.phone.length > 10) {
accountRef.value.validateField('phone').then(valid => {
if(valid) {
axios.get(`/apaas/system/v5/user/phoneToAccount?phone=${accountForm.phone}`).then((res) => {
if (res.data.code == 200) {
accountForm.account = res.data.data || ''
} else {
ElMessage.error(res.data.data);
}
});
}
})
}
}
onBeforeMount(() => {
......
......@@ -73,7 +73,7 @@
}}
</div>
<el-button type="primary" @click="cancel">返回登录页</el-button>
<!-- <el-button v-if="!route.query.id" type="primary" @click="continueCreate">继续创建</el-button> -->
<el-button type="primary" @click="continueEdit">重新修改</el-button>
</div>
</div>
</div>
......@@ -86,7 +86,7 @@
<div v-show="step === 2">
<el-button @click="cancel">返回登录页</el-button>
<el-button type="primary" @click="previousStep">上一步</el-button>
<el-button type="primary" @click="submit">保存</el-button>
<el-button type="primary" @click="submit">提交</el-button>
</div>
</div>
</div>
......@@ -101,6 +101,7 @@ import { reactive, ref, onBeforeMount, toRefs, computed, onBeforeUnmount, onMoun
import CryptoJS from "crypto-js";
import axios from "@/request/http.js";
import { ElMessage } from "element-plus";
import { Encrypt } from "@/services/secret.js"
const route = useRoute();
const router = useRouter();
const step = ref(1);
......@@ -124,6 +125,8 @@ const getAccountFromData = (data) => {
if (data) {
Object.assign(formData, data);
step.value = 2;
//校验手机号验证码 未出接口
} else {
}
};
......@@ -131,36 +134,19 @@ const getAccountFromData = (data) => {
const getPasswordFormData = (data) => {
if (data) {
Object.assign(formData, data);
if (route.query.id) {
// console.log(formData);
// let params = {
// ...formData,
// id: parseInt(route.query.id),
// logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : "",
// };
// axios.post(`/apaas/system/v5/user/update`, params).then((res) => {
// if (res.data.code == 200) {
// successFlag.value = true;
// step.value = 3;
// } else {
// ElMessage.error(res.data.data);
// }
// });
} else {
// let params = {
// ...formData,
// logo: formData.logo && formData.logo.length > 0 ? formData.logo[0].url : "",
// password: CryptoJS.AES.encrypt(formData.password, "swuE9cmCZQwrkYRV").toString(),
// };
// axios.put(`/apaas/system/v5/user/create`, params).then((res) => {
// if (res.data.code == 200) {
// successFlag.value = true;
// step.value = 3;
// } else {
// ElMessage.error(res.data.data);
// }
// });
}
let params = {
phone: formData.phone,
password: Encrypt(formData.new_password)
};
axios.post(`/apaas/system/v5/user/update/pwd`, params).then((res) => {
if (res.data.code == 200) {
successFlag.value = true;
} else {
ElMessage.error(res.data.data);
}
step.value = 3;
});
}
};
//上一步
......@@ -172,59 +158,21 @@ const submit = () => {
passwordFormRef.value.submitForm();
};
//继续创建 清空表单
const continueCreate = () => {
// accountFromRef.value.clearForm();
// passwordFormRef.value.clearForm();
// step.value = 1;
// successFlag.value = false;
const continueEdit = () => {
accountFromRef.value.clearForm();
passwordFormRef.value.clearForm();
step.value = 1;
successFlag.value = false;
};
//取消
const cancel = () => {
router.go(-1);
// router.push({
// path: "/develop/account",
// query: {
// id: formData.organization_id,
// },
// });
};
const getDetail = () => {
// axios.get(`/apaas/system/v5/user/detail/${route.query.id}`).then((res) => {
// if (res.data.code == 200) {
// const form = res.data.data;
// accountFromRef.value.setForm({
// organization_id: form.organization_id,
// system_role_id: form.system_role_id,
// logo: form.logo ? [{ url: form.logo }] : [],
// business_code: form.business_code,
// business_name: form.business_name,
// business_desc: form.business_desc,
// system_account: form.system_account,
// access_address: form.access_address,
// develop_id: form.develop_id,
// state: form.state,
// appid: form.app_id,
// appsecret: form.app_secret,
// });
// passwordFormRef.value.setForm({
// password_name: form.password_name,
// password_phone: form.password_phone,
// password_email: form.password_email,
// remark: form.remark,
// });
// } else {
// ElMessage.error(res.data.data);
// }
// });
};
onBeforeUnmount(() => {});
onMounted(() => {
// if (route.query.id) {
// getDetail();
// }
});
</script>
......
......@@ -7,10 +7,10 @@
ref="passwordRef"
style="max-width: 90%">
<el-form-item label="新密码" prop="new_password">
<el-input v-model="passwordForm.new_password" />
<el-input type="password" v-model="passwordForm.new_password" />
</el-form-item>
<el-form-item label="确认密码" prop="confirm_password">
<el-input v-model="passwordForm.confirm_password" />
<el-input type="password" v-model="passwordForm.confirm_password" />
</el-form-item>
</el-form>
</template>
......@@ -24,12 +24,22 @@ const passwordForm = reactive({
const props = defineProps({
});
const validatePass = (rule, value, callback) => {
if (value !== passwordForm.new_password) {
callback(new Error("密码输入不一致"));
} else {
callback();
}
};
const passwordFormRules = reactive({
new_password: [
{ required: true, message: "请输入新密码", trigger: "blur" },
{ min: 8, message: "密码长度不得低于8位", trigger: "blur" },
],
confirm_password: [
{ required: true, message: "请确认密码", trigger: "blur" },
{ validator: validatePass, trigger: "blur" },
],
});
const passwordRef = ref(null);
......
......@@ -26,13 +26,13 @@
</div>
<div class="info-form">
<el-form-item prop="organization_id" label="所属机构">
<el-select
<el-tree-select
v-model="infoForm.organization_id"
placeholder="请选择"
style="width: 100%">
<el-option label="item.role_name" value="item.role_id" />
<!-- <el-option v-for="item in roleList" :key="item.role_id" :label="item.role_name" :value="item.role_id" /> -->
</el-select>
:data="orgData"
:props="treeProps"
:render-after-expand="false"
filterable
style="width: 100%" />
</el-form-item>
<el-form-item prop="business_name" label="业务系统名称">
<el-input
......@@ -47,16 +47,12 @@
v-model="infoForm.develop_id"
placeholder="请选择"
filterable
remote
remote-show-suffix
:remote-method="remoteMethod"
:loading="loading"
style="width: 100%">
<el-option
v-for="item in devOptions"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in developList"
:key="'develop_'+item.id"
:label="item.dict_name"
:value="item.id"
/>
<template #empty>
<div class="select-empty">
......@@ -74,12 +70,14 @@
</el-form-item>
<el-form-item prop="password" label="密码">
<el-input
type="password"
v-model="infoForm.password"
placeholder="请输入"
/>
</el-form-item>
<el-form-item prop="confirm_password" label="确认密码">
<el-input
type="password"
v-model="infoForm.confirm_password"
placeholder="请输入"
/>
......@@ -177,18 +175,13 @@ import { useRouter } from "vue-router";
import axios from "@/request/http.js";
import { Encrypt } from "@/services/secret.js"
import { ElMessage } from "element-plus";
import { validatePhone } from "@/services/rules.js"
const validateBusinessName = (rule, value, callback) => {
let reg = /^[a-zA-Z0-9\u4e00-\u9fa5]+$/;
if (!reg.test(value)) {
callback(new Error("只能输入字母、数字和汉字"));
} else {
// let params = null;
// if (props.id) {
// params = { id: parseInt(props.id), business_name: value, organization_id: systemForm.organization_id };
// } else {
// params = { business_name: value, organization_id: systemForm.organization_id };
// }
let params = { business_name: value };
axios.post(`/apaas/system/v5/user/checkBusiness`, params).then((res) => {
......@@ -206,12 +199,6 @@ const validateSystemAccount = (rule, value, callback) => {
if (!reg.test(value)) {
callback(new Error("只能输入字母和数字"));
} else {
// let params = null;
// if (props.id) {
// params = { id: parseInt(props.id), system_account: value };
// } else {
// params = { system_account: value };
// }
let params = { system_account: value };
axios.post(`/apaas/system/v5/user/checkAccount`, params).then((res) => {
......@@ -226,12 +213,7 @@ const validateSystemAccount = (rule, value, callback) => {
const checkPhoneRepet = (rule, value, callback) => {
let params = {phone: value};
// if (props.id){
// params = {id: parseInt(props.id),contact_phone: value,}
// }else {
// params = {id: 0,contact_phone: value}
// }
$axios.post(`/apaas/system/v5/user/checkPhone`,params)
axios.post(`/apaas/system/v5/user/checkPhone`,params)
.then((res) => {
if (res.data.code == 200) {
callback()
......@@ -241,6 +223,14 @@ const checkPhoneRepet = (rule, value, callback) => {
})
}
const validatePass = (rule, value, callback) => {
if (value !== state.infoForm.password) {
callback(new Error("密码输入不一致"));
} else {
callback();
}
};
const router = useRouter();
const state = reactive({
infoForm: {
......@@ -264,14 +254,25 @@ const state = reactive({
develop_id: [{ required: true, message: "请选择开发厂商", trigger: "blur" }],
system_account: [
{ required: true, message: "请输入账号", trigger: "blur" },
{ min: 4, message: "帐号长度不得低于4个字符", trigger: "blur" },
{ max: 20, message: "帐号最大长度为20个字符", trigger: "blur" },
{ validator: validateSystemAccount, trigger: "blur" },
],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
confirm_password: [{ required: true, message: "请确认密码", trigger: "blur" }],
phone: [{ required: true, message: "请输入手机号", trigger: "blur" }],
password: [
{ required: true, message: "请输入密码", trigger: "blur" },
{ min: 8, message: "密码长度不得低于8位", trigger: "blur" },
],
confirm_password: [
{ required: true, message: "请确认密码", trigger: "blur" },
{ validator: validatePass, trigger: "blur" },
],
phone: [{ required: true, message: "请输入手机号", trigger: "blur" },
{ validator: validatePhone, trigger: "blur" },
{ validator: checkPhoneRepet, trigger: "blur" },],
code: [{ required: true, message: "请输入验证码", trigger: "blur" }],
contact_name: [{ required: true, message: "请输入联系人", trigger: "blur" }],
contact_phone: [{ required: true, message: "请输入联系电话", trigger: "blur" }],
contact_phone: [{ required: true, message: "请输入联系电话", trigger: "blur" },
{ validator: validatePhone, trigger: "blur" }],
},
developForm: {
develop: ""
......@@ -279,29 +280,35 @@ const state = reactive({
developFormRules: {
develop: [{ required: true, message: "请输入开发厂商名称", trigger: "blur" }],
},
devOptions: [],
dialogVisit: false,
countDown: 0,
countDownTimer: null
countDownTimer: null,
orgData: [],
developList: []
})
const loading = ref(false)
const treeProps = {
label: "name",
children: "Child",
value: "organization_id",
};
// const loading = ref(false)
const list = ref([])
const infoFormRef = ref(null)
const developFormRef = ref(null)
const remoteMethod = (query) => {
if (query) {
loading.value = true
setTimeout(() => {
loading.value = false
state.devOptions = list.value.filter((item) => {
return item.label.toLowerCase().includes(query.toLowerCase())
})
}, 200)
} else {
state.devOptions = []
}
}
// const remoteMethod = (query) => {
// if (query) {
// loading.value = true
// setTimeout(() => {
// loading.value = false
// state.devOptions = state.developList.filter((item) => {
// return item.dict_name.includes(query)
// })
// }, 200)
// } else {
// state.devOptions = []
// }
// }
const submit = () => {
infoFormRef.value.validate((valid) => {
......@@ -312,7 +319,7 @@ const submit = () => {
business_desc: state.infoForm.business_desc,
system_account: state.infoForm.system_account,
password: Encrypt(state.infoForm.password),
develop_id: state.infoForm.develop_id,
develop_id: state.infoForm.develop_id.toString(),
contact_name: state.infoForm.contact_name,
contact_phone: state.infoForm.contact_phone,
phone: state.infoForm.phone,
......@@ -321,6 +328,8 @@ const submit = () => {
axios.post('/apaas/system/v5/user/register',params).then(({ data }) => {
if (data.code == 200) {
ElMessage.success('注册信息已提交!');
router.go(-1)
}else {
ElMessage.error(data.data);
}
......@@ -367,26 +376,49 @@ const handleCloseDialog = () => {
const confirmAdd = () => {
developFormRef.value.validate((valid) => {
if(valid) {
axios.post('/apaas/system/v5/user/dict/develop/add',{dict_name: state.developForm.develop}).then(({ data }) => {
if (data.code == 200) {
state.infoForm.develop_id = data.data;
getDevelopList()
}else {
ElMessage.error(data.data);
}
handleCloseDialog()
});
}
})
}
const states = [
'Alabama',
'Alaska',
'Arizona',
'Arkansas',
'California'
]
const getOrgData = () => {
axios.get('/apaas/system/v5/user/org/tree').then(({ data }) => {
if (data.code == 200) {
state.orgData = data.data || []
}
});
}
const getDevelopList = () => {
axios.get('/apaas/system/v5/user/dict/develop').then(({ data }) => {
if (data.code == 200) {
state.developList = data.data || []
}
});
}
onMounted(() => {
list.value = states.map((item) => {
return { value: `value:${item}`, label: `label:${item}` }
})
getOrgData()
getDevelopList()
})
const { infoForm, infoFormRules, devOptions, dialogVisit, developForm, developFormRules, countDown, countDownTimer } = toRefs(state)
const { infoForm,
infoFormRules,
dialogVisit,
developForm,
developFormRules,
countDown,
countDownTimer,
orgData,
developList } = toRefs(state)
</script>
<style lang="scss" scoped>
......
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
const path = require('path')
const path = require("path");
console.log(__dirname);
function resolve_path (dir) {
return path.join(__dirname, './', dir)
function resolve_path(dir) {
return path.join(__dirname, "./", dir);
}
export default {
plugins: [
vue()
],
plugins: [vue()],
//本地运行基础路径,如:http://localhost:5173/apaas/ui/
base: "/apaas/manage/ui/",
clearScreen:false,
resolve:{
clearScreen: false,
resolve: {
//别名,代码引入时方便引入
alias:{
'@':resolve_path('src'),
}
alias: {
"@": resolve_path("src"),
},
},
css:{
devSourcemap:true,//代码编排,调试时是否能看到源码
css: {
devSourcemap: true, //代码编排,调试时是否能看到源码
},
server:{
host:'0.0.0.0',//host配置,0.0.0.0会添加本地ip,开启局域网访问路径
hmr:true,//热更新
server: {
host: "0.0.0.0", //host配置,0.0.0.0会添加本地ip,开启局域网访问路径
hmr: true, //热更新
open: true,
proxy: {
// 选项写法
'/apaas/system':{
target: 'https://apaas5.wodcloud.com/apaas/system', // 所要代理的目标地址
rewrite: path => path.replace(/^\/apaas\/system/, ''), // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false,//解决证书缺失问题
"/apaas/system": {
target: "https://apaas5.wodcloud.com/apaas/system", // 所要代理的目标地址
rewrite: (path) => path.replace(/^\/apaas\/system/, ""), // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false, //解决证书缺失问题
},
'/apaas/portal/ui':{
target: 'https://apaas5.wodcloud.com/apaas/portal/ui', // 所要代理的目标地址
rewrite: path => path.replace(/^\/apaas\/portal\/ui/, ''), // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false,//解决证书缺失问题
"/apaas/portal/ui": {
target: "https://apaas5.wodcloud.com/apaas/portal/ui", // 所要代理的目标地址
rewrite: (path) => path.replace(/^\/apaas\/portal\/ui/, ""), // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false, //解决证书缺失问题
},
'/apaas/service':{
target: 'https://apaas5.wodcloud.com/apaas/service', // 所要代理的目标地址
rewrite: path => path.replace(/^\/apaas\/service/, ''), // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false,//解决证书缺失问题
"/apaas/service": {
target: "https://apaas5.wodcloud.com/apaas/service", // 所要代理的目标地址
rewrite: (path) => path.replace(/^\/apaas\/service/, ""), // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false, //解决证书缺失问题
},
'/apaas/common':{
target: 'https://apaas5.wodcloud.com/apaas/common', // 所要代理的目标地址
rewrite: path => path.replace(/^\/apaas\/common/, ''), // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false,//解决证书缺失问题
"/apaas/common": {
target: "https://apaas5.wodcloud.com/apaas/common", // 所要代理的目标地址
rewrite: (path) => path.replace(/^\/apaas\/common/, ""), // 重写传过来的path路径,比如 `/api/index/1?id=10&name=zs`(注意:path路径最前面有斜杠(/),因此,正则匹配的时候不要忘了是斜杠(/)开头的;选项的 key 也是斜杠(/)开头的)
changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL
secure: false, //解决证书缺失问题
},
}
},
},
build:{
outDir:'dist/apaas/manage/ui',//打包输出文件夹
assetsDir:'static',//打包输出静态文件
build: {
outDir: "dist/apaas/manage/ui", //打包输出文件夹
assetsDir: "static", //打包输出静态文件
},
}
};
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