Commit 9d7aa81c authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 9526ac8b a68e7a4b
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="utf-8"> <head>
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!-- <title><%= process.env.VUE_APP_NAME %></title> --> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title></title> <!-- <title><%= process.env.VUE_APP_NAME %></title> -->
<!-- require cdn assets css --> <title></title>
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %> <!-- require cdn assets css -->
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" /> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
<% } %> <% } %>
<style>
</head> @font-face {
<body> font-family: Source Han Sans CN;
<noscript> src: url("./SourceHanSansSC-Regular-2.otf");
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> }
</noscript> </style>
<div id="popContainer"> </head>
<div id="app"></div>
</div> <body>
<!-- require cdn assets js --> <noscript>
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %> <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="popContainer">
<div id="app"></div>
</div>
<!-- require cdn assets js -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %> <% } %>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html>
</html>
\ No newline at end of file
<template>
<div class="y-button" :style="{ '--w': width + 'px' }">
<button
type="button"
:style="{ '--w': width + 'px' }"
:class="{ animating: active, active: value }"
@click="clickHandler"
@animationend="animationend"
>
<span>
<b></b>
<svg viewBox="-5.5 -5.5 71 71" id="circle">
<circle
cx="30"
cy="30"
r="30"
stroke="white"
stroke-width="11"
fill="transparent"
></circle>
</svg>
</span>
</button>
<div :class="['text', { active: value }]">
<!-- <span class="on">
<span>
{{ activeText }}
</span>
</span>
<span class="off">
<span>
{{ unActiveText }}
</span>
</span> -->
{{ value ? activeText : unActiveText }}
</div>
</div>
</template>
<script>
export default {
model: {
prop: "checked",
event: "change",
},
props: {
width: {
type: Number,
default: 84,
},
checked: {
required: true,
},
activeText: {
default: "ON",
},
unActiveText: {
default: "OFF",
},
},
data() {
return {
active: false,
};
},
computed: {
value() {
return this.checked === 1 || this.checked === "1";
},
},
methods: {
clickHandler() {
this.active = true;
},
animationend() {
this.active = false;
this.$emit("change", this.checked ? 0 : 1);
},
},
};
</script>
<style lang="less" scoped>
@keyframes c {
to {
transform: none;
}
}
.y-button {
--timing: cubic-bezier(0.645, 0.045, 0.355, 1);
--primary: #f4f7f5;
width: var(--w);
button {
--bg: rgb(var(--rgb));
--bga: rgba(var(--rgb), 0.4);
/* Safari fix */
-webkit-appearance: none;
border: none;
font-size: 100%;
width: var(--w);
height: var(--w);
background: var(--bg);
box-shadow: 0 3px 12px 2px var(--bga);
border-radius: 50%;
position: relative;
overflow: hidden;
cursor: pointer;
transition: 0.1s transform, 0.3s box-shadow;
will-change: transform, box-shadow;
backface-visibility: hidden;
}
button > * {
pointer-events: none;
}
button:focus {
outline: none;
}
button:active {
transform: scale(0.97);
}
button:after {
--bg: rgb(var(--rgb));
content: "";
position: absolute;
top: -15%;
left: -15%;
width: 200%;
height: 200%;
background: var(--bg);
border-radius: inherit;
transform: translate(5%, 5%) scale(0.03);
pointer-events: none;
}
button.animating:after {
animation: c 0.5s cubic-bezier(0.5, 0, 0.5, 1) backwards;
}
button.active,
button:not(.active):after {
--rgb: 64, 227, 120;
}
button:not(.active),
button.active:after {
--rgb: 229, 55, 94;
}
button span {
display: inline-block;
position: relative;
margin-top: 5px;
}
button b {
--w: 7px;
overflow: hidden;
border-radius: var(--w);
display: grid;
width: var(--w);
height: 35px;
top: 0;
left: 50%;
position: absolute;
transform: translateX(-50%);
z-index: 3;
will-change: transform;
}
button b:before {
content: "";
background: #fff;
width: 100%;
height: 100%;
border-radius: var(--w);
transform: translateY(-15px);
transition-timing-function: var(--timing);
transition: 0.5s;
}
button.active b:before {
transform: translateY(12px);
transition-delay: 0.27s;
transition-timing-function: cubic-bezier(0.25, 0.25, 0.25, 1.25);
}
button svg {
--dash: 190;
stroke-linecap: round;
stroke-dasharray: var(--dash);
stroke-dashoffset: var(--dash);
width: 46px;
height: 46px;
transform: scaleX(-1) rotate(-89deg);
transition: 0.4s;
transition-timing-function: var(--timing);
margin: auto;
position: relative;
z-index: 1;
will-change: transform, stroke-dashoffset;
}
button:not(.active) svg {
stroke-dashoffset: 40;
transform: scaleX(-1) rotate(-52deg);
transition: 0.5s 0.25s;
}
aside {
position: absolute;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
text-align: center;
width: 100%;
padding: 0 2em 2em;
font-family: "Pacifico", cursive;
}
aside a {
text-decoration: underline;
color: #e65289;
display: flex;
align-items: center;
}
aside a:hover,
aside a:focus {
color: #000;
text-decoration: none;
}
.dribbble-logo {
width: 18px;
height: 18px;
margin-right: 5px;
}
.text {
width: 100%;
margin-top: 10px;
font-size: 22px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #c9c9c9;
text-align: center;
}
}
</style>
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
<div class="sitetree"> <div class="sitetree">
<!-- <span style="font-weight: 600">站点结构</span> --> <!-- <span style="font-weight: 600">站点结构</span> -->
<div class="box"> <div class="box">
<a-tree <a-spin :spinning="loading">
:load-data="onLoadData" <a-tree
:tree-data="treeData" :tree-data="treeData"
:expandedKeys.sync="expandedKeys" :expandedKeys.sync="expandedKeys"
:replaceFields="{ title: 'label', key: 'id' }" :replaceFields="{ title: 'label', key: 'id' }"
@select="onSelect" @select="onSelect"
> >
</a-tree> </a-tree>
</a-spin>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,6 +19,7 @@ ...@@ -18,6 +19,7 @@
// api // api
import { import {
getListByParentId, getListByParentId,
authAreaTree,
// areaList, // areaList,
// getSiteList // getSiteList
} from "@/services/basicsetFun"; } from "@/services/basicsetFun";
...@@ -28,43 +30,73 @@ export default { ...@@ -28,43 +30,73 @@ export default {
treeData: [], //树结构 treeData: [], //树结构
id: "", id: "",
expandedKeys: [], expandedKeys: [],
loading: false,
}; };
}, },
created() { created() {
this.getAreaList(); this.authAreaTree();
this.getTopArea();
}, },
methods: { methods: {
// 获取区域 editLeaf(arr) {
async getAreaList() { return arr.map((v) => {
if (v.children && v.children.length > 0) {
this.editLeaf(v.children);
} else {
v.isLeaf = true;
}
return v;
});
},
// 获取个人区域数据
async authAreaTree() {
this.loading = true;
let res = await authAreaTree();
if (res.data.code == 1) {
let { data } = res.data.data;
if (data.length) {
let firstData = data[0];
if (firstData.areaLevel > 2 || data.length > 1) {
let TopParent = await this.getTopArea();
TopParent.selectable = false;
TopParent.children = this.editLeaf(data);
this.treeData = [TopParent];
} else {
this.treeData = this.editLeaf(data);
}
this.expandedKeys = [this.treeData[0].id];
}
}
this.loading = false;
},
// 获取顶层区域
async getTopArea() {
let res = await getListByParentId({ parentId: 0 }); let res = await getListByParentId({ parentId: 0 });
const { data, code } = res.data; const { data, code } = res.data;
if (code === 1) { if (code === 1) {
this.treeData = data.data; return data.data[0];
// let obj = { } else {
// dataRef: { return {};
// id: data.data[0].id,
// },
// };
// this.onLoadData(obj);
this.expandedKeys = [data.data[0].id];
} }
}, },
// 异步获取子区域 // 异步获取子区域
onLoadData(treeNode) { // onLoadData(treeNode) {
return new Promise((resolve) => { // return new Promise((resolve) => {
getListByParentId({ // getListByParentId({
parentId: treeNode.dataRef.id, // parentId: treeNode.dataRef.id,
}).then((res) => { // }).then((res) => {
const { data } = res.data; // const { data } = res.data;
treeNode.dataRef.children = data.data; // treeNode.dataRef.children = data.data;
this.treeData = [...this.treeData]; // this.treeData = [...this.treeData];
resolve(); // resolve();
}); // });
}); // });
}, // },
// 选中区域 // 选中区域
onSelect(num, node) { onSelect(num, node) {
if (num && node.selectedNodes.length > 0) { if (num && node.selectedNodes.length > 0) {
...@@ -94,4 +126,4 @@ export default { ...@@ -94,4 +126,4 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -133,4 +133,4 @@ export default { ...@@ -133,4 +133,4 @@ export default {
background: #fff; background: #fff;
border-radius: 4px; border-radius: 4px;
} }
</style> </style>
\ No newline at end of file
...@@ -134,7 +134,7 @@ export default { ...@@ -134,7 +134,7 @@ export default {
const { siteTree } = data; const { siteTree } = data;
this.sitelist = siteTree; this.sitelist = siteTree;
let arr = []; let arr = [];
const treeFn = function (e) { const treeFn = function(e) {
e.forEach((element) => { e.forEach((element) => {
arr.push(element); arr.push(element);
if (element.children && element.children.length > 0) { if (element.children && element.children.length > 0) {
......
import Vue from "vue"; import Vue from "vue";
import App from "./App.vue"; import App from "./App.vue";
import { initRouter } from "./router";
import "./theme/index.less"; import "./theme/index.less";
import Antd from "ant-design-vue"; import Antd from "ant-design-vue";
import store from "./store"; import store from "./store";
...@@ -9,7 +8,8 @@ import "./assets/css/common.less"; ...@@ -9,7 +8,8 @@ import "./assets/css/common.less";
import "./assets/css/relas.less"; import "./assets/css/relas.less";
import "./assets/css/use.less"; import "./assets/css/use.less";
import Plugins from "@/plugins"; import Plugins from "@/plugins";
import { initI18n } from "@/utils/i18n"; import { router } from "@/router";
import { i18n } from "@/utils/i18n";
import bootstrap from "@/bootstrap"; import bootstrap from "@/bootstrap";
import "moment/locale/zh-cn"; import "moment/locale/zh-cn";
import VueResource from "vue-resource"; import VueResource from "vue-resource";
...@@ -56,14 +56,11 @@ Vue.prototype.$nanoid = nanoid; ...@@ -56,14 +56,11 @@ Vue.prototype.$nanoid = nanoid;
import * as echarts from "echarts"; import * as echarts from "echarts";
Vue.prototype.$echarts = echarts; Vue.prototype.$echarts = echarts;
export const router = initRouter(store.state.setting.asyncRoutes);
const i18n = initI18n("CN", "US");
Vue.use(Antd); Vue.use(Antd);
Vue.config.productionTip = false; Vue.config.productionTip = false;
// Vue.use(Viser) // Vue.use(Viser)
Vue.use(Plugins); Vue.use(Plugins);
Vue.use(VueResource); Vue.use(VueResource);
bootstrap({ router, store, i18n, message: Vue.prototype.$message }); bootstrap({ router, store, i18n, message: Vue.prototype.$message });
new Vue({ new Vue({
......
...@@ -59,9 +59,7 @@ ...@@ -59,9 +59,7 @@
</div> </div>
</div> </div>
<div> <div>
<div class="department_span"> <div>简称:{{ v.deptAbb ? v.deptAbb : "--" }}</div>
简称:{{ v.deptAbb ? v.deptAbb : "--" }}
</div>
<div> <div>
联系电话:{{ v.deptTelphone ? v.deptTelphone : "--" }} 联系电话:{{ v.deptTelphone ? v.deptTelphone : "--" }}
</div> </div>
...@@ -687,7 +685,6 @@ export default { ...@@ -687,7 +685,6 @@ export default {
} }
.department_span { .department_span {
margin-right: 3px; margin-right: 3px;
font-size: 5px;
} }
.department_off { .department_off {
// margin-left: 20px; // margin-left: 20px;
......
...@@ -35,8 +35,9 @@ ...@@ -35,8 +35,9 @@
</a-modal> </a-modal>
</div> </div>
</template> </template>
<script> <script>
import local from "@/utils/local";
import { import {
// saveWindowHall, // saveWindowHall,
batchSaveWindowHall, batchSaveWindowHall,
...@@ -60,6 +61,7 @@ export default { ...@@ -60,6 +61,7 @@ export default {
data() { data() {
return { return {
selectInfo: undefined, selectInfo: undefined,
siteId: local.getLocal("siteId"), // 站点id
form: { form: {
windowId: "", // 窗口id windowId: "", // 窗口id
windowName: "", // 窗口名称 windowName: "", // 窗口名称
...@@ -115,6 +117,7 @@ export default { ...@@ -115,6 +117,7 @@ export default {
windowName: v.name, // 窗口名称 windowName: v.name, // 窗口名称
hallId: this.form.hallId, // 大厅id hallId: this.form.hallId, // 大厅id
hallName: this.form.hallName, // 大厅名称 hallName: this.form.hallName, // 大厅名称
siteId: this.siteId,
}; };
}); });
let res = await batchSaveWindowHall(arr); let res = await batchSaveWindowHall(arr);
...@@ -135,6 +138,5 @@ export default { ...@@ -135,6 +138,5 @@ export default {
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped></style>
</style>
\ No newline at end of file
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<script> <script>
import local from "@/utils/local"; import local from "@/utils/local";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import { createMenus } from "@/router";
export default { export default {
data() { data() {
return {}; return {};
...@@ -26,8 +27,15 @@ export default { ...@@ -26,8 +27,15 @@ export default {
]), ]),
// 获取token // 获取token
getToken() { getToken() {
let { token, userInfo, siteid, siteName, sysName, sysLogo, path } = let {
this.$route.query; token,
userInfo,
siteid,
siteName,
sysName,
sysLogo,
path,
} = this.$route.query;
if (token && userInfo) { if (token && userInfo) {
userInfo = JSON.parse(userInfo); userInfo = JSON.parse(userInfo);
this.SET_userInfo(userInfo); this.SET_userInfo(userInfo);
...@@ -39,6 +47,8 @@ export default { ...@@ -39,6 +47,8 @@ export default {
this.SET_path(path); this.SET_path(path);
local.setLocal("siteId", siteid); local.setLocal("siteId", siteid);
local.setLocal("siteName", siteName); local.setLocal("siteName", siteName);
// 动态菜单
createMenus();
this.$router.push("/website"); this.$router.push("/website");
} else { } else {
this.$message.warning("跳转失败,请重新登录"); this.$message.warning("跳转失败,请重新登录");
......
<template> <template>
<div class="configurat"> <div class="configurat">
<div class="title">短信全局配置</div> <div class="title">短信全局配置</div>
<div class="set-configurat"> <div class="des">
<y-switch 全局配置,一键控制
v-model="setInfo.messageoff"
checkedChildren="开"
unCheckedChildren="关"
@change="changeClose"
></y-switch>
</div> </div>
<div class="des">
轻松管理政务短信通知的全局设置,确保信息的准确传递
</div>
<div class="tag-list">
<div class="tag-item" v-for="v in tagList" :key="v">
{{ v }}
</div>
</div>
<YButton v-model="setInfo.messageoff" @change="changeClose"></YButton>
</div> </div>
</template> </template>
<script> <script>
import YSwitch from "@/components/yswitch/YSwitch.vue"; import YButton from "@/components/YButton";
import { getSmssetList, saveSmssetList } from "@/services/configurat"; import { getSmssetList, saveSmssetList } from "@/services/configurat";
import local from "@/utils/local"; import local from "@/utils/local";
export default { export default {
components: { components: {
YSwitch, YButton,
}, },
data() { data() {
return { return {
tagList: ["全局管控", "精准到达", "远程监管", "贴心服务"],
setInfo: { setInfo: {
siteId: local.getLocal("siteId"), siteId: local.getLocal("siteId"),
messageoff: "", messageoff: "",
...@@ -53,6 +58,8 @@ export default { ...@@ -53,6 +58,8 @@ export default {
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
} else {
this.getSmssetList();
} }
}, },
}, },
...@@ -63,37 +70,42 @@ export default { ...@@ -63,37 +70,42 @@ export default {
.configurat { .configurat {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 20px; padding: 115px 80px;
.main { background: url("~@/assets/img/sms_bg.jpg") no-repeat center/100% 100%;
height: 100%;
display: flex;
.set-configurat {
margin-left: 20px;
}
.left {
width: 224px;
margin-right: 20px;
}
.right {
height: 200px;
padding: 15px;
flex: 1;
background-color: #fff;
}
}
.title { .title {
margin-left: 15px; margin-bottom: 35px;
position: relative; font-size: 44px;
margin-bottom: 15px; font-family: Source Han Sans CN;
&::before { font-weight: bold;
content: ""; color: #0857e8;
width: 4px; }
height: 20px; .des {
position: absolute; font-size: 20px;
top: 1px; font-family: Source Han Sans CN;
left: -16px; font-weight: 500;
background-color: rgba(5, 149, 253, 1); color: #365182;
line-height: 35px;
}
.tag-list {
margin-top: 38px;
margin-bottom: 40px;
display: flex;
align-items: center;
gap: 26px;
.tag-item {
width: 138px;
height: 50px;
background: rgba(8, 87, 232, 0.05);
border-radius: 24px;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #232323;
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -6,21 +6,6 @@ import Layouts from "@/layouts/Layouts"; ...@@ -6,21 +6,6 @@ import Layouts from "@/layouts/Layouts";
// 路由配置 // 路由配置
const options = { const options = {
routes: [ routes: [
{
path: "/jump",
name: "跳转页面",
component: () => import("@/pages/basicset/jump/jump"),
},
{
path: "*",
name: "404",
component: () => import("@/pages/exception/404"),
},
{
path: "/403",
name: "403",
component: () => import("@/pages/exception/403"),
},
{ {
path: "/apppreview", path: "/apppreview",
name: "预览页面", name: "预览页面",
...@@ -33,7 +18,7 @@ const options = { ...@@ -33,7 +18,7 @@ const options = {
redirect: "/website", redirect: "/website",
children: [ children: [
{ {
path: "website", path: "/website",
name: "站点管理", name: "站点管理",
meta: { meta: {
icon: "bank", icon: "bank",
...@@ -41,7 +26,7 @@ const options = { ...@@ -41,7 +26,7 @@ const options = {
component: () => import("@/pages/basicset/site/website"), component: () => import("@/pages/basicset/site/website"),
}, },
{ {
path: "business", path: "/business",
meta: { meta: {
icon: "book", icon: "book",
}, },
...@@ -118,7 +103,7 @@ const options = { ...@@ -118,7 +103,7 @@ const options = {
], ],
}, },
{ {
path: "department", path: "/department",
meta: { meta: {
icon: "audit", icon: "audit",
}, },
...@@ -141,7 +126,7 @@ const options = { ...@@ -141,7 +126,7 @@ const options = {
], ],
}, },
{ {
path: "personnel", path: "/personnel",
name: "工作人员管理", name: "工作人员管理",
meta: { meta: {
icon: "idcard", icon: "idcard",
...@@ -149,7 +134,7 @@ const options = { ...@@ -149,7 +134,7 @@ const options = {
component: () => import("@/pages/basicset/workman/personnel"), component: () => import("@/pages/basicset/workman/personnel"),
}, },
{ {
path: "festival", path: "/festival",
name: "节假日管理", name: "节假日管理",
meta: { meta: {
icon: "carry-out", icon: "carry-out",
...@@ -157,16 +142,17 @@ const options = { ...@@ -157,16 +142,17 @@ const options = {
component: () => import("@/pages/basicset/holiday/festival"), component: () => import("@/pages/basicset/holiday/festival"),
}, },
{ {
path: "deploy", path: "/deploy",
name: "部署模块管理", name: "部署模块管理",
meta: { meta: {
icon: "appstore", icon: "appstore",
roles: ["admin"],
}, },
component: () => import("@/pages/basicset/deploy/deploy"), component: () => import("@/pages/basicset/deploy/deploy"),
}, },
{ {
path: "hall", path: "/hall",
name: "大厅管理", name: "大厅管理",
meta: { meta: {
icon: "gateway", icon: "gateway",
...@@ -196,7 +182,7 @@ const options = { ...@@ -196,7 +182,7 @@ const options = {
}, },
{ {
path: "surface", path: "/surface",
component: () => import("@/pages/basicset/surface/index"), component: () => import("@/pages/basicset/surface/index"),
meta: { meta: {
icon: "skin", icon: "skin",
...@@ -210,7 +196,7 @@ const options = { ...@@ -210,7 +196,7 @@ const options = {
}, },
{ {
path: "addsurfacetemplate", path: "addsurfacetemplate",
name: "新增皮肤m模板", name: "新增皮肤模板",
component: () => component: () =>
import("@/pages/basicset/surface/AddSurfaceTemplate"), import("@/pages/basicset/surface/AddSurfaceTemplate"),
meta: { invisible: true }, meta: { invisible: true },
...@@ -218,7 +204,7 @@ const options = { ...@@ -218,7 +204,7 @@ const options = {
], ],
}, },
{ {
path: "configurat", path: "/configurat",
name: "短信配置", name: "短信配置",
meta: { meta: {
icon: "mail", icon: "mail",
...@@ -227,7 +213,7 @@ const options = { ...@@ -227,7 +213,7 @@ const options = {
}, },
{ {
path: "appmarket", path: "/appmarket",
component: () => import("@/pages/basicset/appmarket/Index"), component: () => import("@/pages/basicset/appmarket/Index"),
meta: { meta: {
icon: "shop", icon: "shop",
...@@ -314,7 +300,7 @@ const options = { ...@@ -314,7 +300,7 @@ const options = {
], ],
}, },
{ {
path: "system", path: "/system",
name: "系统设置", name: "系统设置",
component: () => import("@/pages/basicset/system/System"), component: () => import("@/pages/basicset/system/System"),
meta: { meta: {
......
import Vue from 'vue' import Vue from "vue";
import Router from 'vue-router' import VueRouter from "vue-router";
import {formatRoutes} from '@/utils/routerUtil' import { formatRoutes } from "@/utils/routerUtil";
import { i18n } from "@/utils/i18n";
Vue.use(Router) import store from "@/store";
import { mergeI18nFromRoutes } from "@/utils/i18n";
Vue.use(VueRouter);
//解决重复路由报错 //解决重复路由报错
const originalPush = Router.prototype.push const originalPush = VueRouter.prototype.push;
// 修改原型对象中的push方法 // 修改原型对象中的push方法
Router.prototype.push = function push(location) { VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err) return originalPush.call(this, location).catch((err) => err);
} };
const routes = [
{
path: "/jump",
name: "跳转页面",
component: () => import("@/pages/basicset/jump/jump"),
},
{
path: "*",
name: "404",
component: () => import("@/pages/exception/404"),
},
{
path: "/403",
name: "403",
component: () => import("@/pages/exception/403"),
},
];
formatRoutes(routes);
const router = new VueRouter({
routes,
});
// 不需要登录拦截的路由配置 // 不需要登录拦截的路由配置
const loginIgnore = { const loginIgnore = {
names: ['404', '403'], //根据路由名称匹配 names: ["404", "403"], //根据路由名称匹配
paths: ['/login'], //根据路由fullPath匹配 paths: ["/login", "/jump"], //根据路由fullPath匹配
/** /**
* 判断路由是否包含在该配置中 * 判断路由是否包含在该配置中
* @param route vue-router 的 route 对象 * @param route vue-router 的 route 对象
* @returns {boolean} * @returns {boolean}
*/ */
includes(route) { includes(route) {
return this.names.includes(route.name) || this.paths.includes(route.path) return this.names.includes(route.name) || this.paths.includes(route.path);
} },
} };
/** /**
* 初始化路由实例 * 初始化路由实例
* @param isAsync 是否异步路由模式
* @returns {VueRouter} * @returns {VueRouter}
*/ */
function initRouter(isAsync) { function initRouter() {
const options = isAsync ? require('./async/config.async').default : require('./config').default // 是否异步路由模式
formatRoutes(options.routes) const options = store.state.setting.asyncRoutes
return new Router(options) ? require("./async/config.async").default
: require("./config").default;
formatRoutes(options.routes);
return options;
}
// 判断权限
function permission(router, role) {
if (router.meta && router.meta.roles) {
return router.meta.roles.includes(role);
} else {
return true;
}
}
// 计算动态路由
function calcRouters(dynamicRouter, role) {
// 过滤
let res = dynamicRouter.filter((v) => {
// 判断是否有权限访问此路由
if (permission(v, role)) {
// 判断有没有子路由
if (v.children) {
// 递归
v.children = calcRouters(v.children, role);
}
return true;
} else {
return false;
}
});
return res;
}
// 动态菜单
function createMenus() {
let role = store.getters["site/userInfo"].name;
if (!role) return;
let options = initRouter();
let routesArr = calcRouters(options.routes, role);
const rootRoute = routesArr.find((item) => item.path === "/");
const menuRoutes = rootRoute && rootRoute.children;
mergeI18nFromRoutes(i18n, menuRoutes);
if (menuRoutes) {
routesArr.forEach((v) => {
router.addRoute(v);
});
store.commit("setting/setMenuData", menuRoutes);
}
} }
export {loginIgnore, initRouter} createMenus();
export { loginIgnore, initRouter, createMenus, router };
...@@ -30,7 +30,8 @@ module.exports = { ...@@ -30,7 +30,8 @@ module.exports = {
treeselect: `${BASE_URL}/base/area/treeselect`, treeselect: `${BASE_URL}/base/area/treeselect`,
save: `${BASE_URL}/base/area/save`, save: `${BASE_URL}/base/area/save`,
delete: `${BASE_URL}/base/area/delete`, delete: `${BASE_URL}/base/area/delete`,
init: `${BASE_URL}/base/base/area/genSubAreaByAreaName `, init: `${BASE_URL}/base/area/genSubAreaByAreaName`,
authAreaTree: `${BASE_URL}/base/area/authAreaTree`,
}, },
// 站点 // 站点
site: { site: {
......
...@@ -19,6 +19,10 @@ export async function getListByParentId(data) { ...@@ -19,6 +19,10 @@ export async function getListByParentId(data) {
export async function treeselect(data) { export async function treeselect(data) {
return request(area.treeselect, METHOD.POST, data); return request(area.treeselect, METHOD.POST, data);
} }
// 查看个人区域列表
export async function authAreaTree(data) {
return request(area.authAreaTree, METHOD.POST, data);
}
// 查看站点列表 // 查看站点列表
export async function getSiteList(data) { export async function getSiteList(data) {
return request(site.list, METHOD.POST, data); return request(site.list, METHOD.POST, data);
......
import config from '@/config' import config from "@/config";
import { ADMIN } from '@/config/default' import { ADMIN } from "@/config/default";
import { formatFullPath } from '@/utils/i18n' import { formatFullPath } from "@/utils/i18n";
import { filterMenu } from '@/utils/authority-utils' import { filterMenu } from "@/utils/authority-utils";
import { getLocalSetting } from '@/utils/themeUtil' import { getLocalSetting } from "@/utils/themeUtil";
import deepClone from 'lodash.clonedeep' import deepClone from "lodash.clonedeep";
const localSetting = getLocalSetting(true) const localSetting = getLocalSetting(true);
// console.log(localSetting) // console.log(localSetting)
const customTitlesStr = sessionStorage.getItem(process.env.VUE_APP_TBAS_TITLES_KEY) const customTitlesStr = sessionStorage.getItem(
const customTitles = (customTitlesStr && JSON.parse(customTitlesStr)) || [] process.env.VUE_APP_TBAS_TITLES_KEY
);
const customTitles = (customTitlesStr && JSON.parse(customTitlesStr)) || [];
export default { export default {
namespaced: true, namespaced: true,
...@@ -20,96 +22,99 @@ export default { ...@@ -20,96 +22,99 @@ export default {
activatedFirst: undefined, activatedFirst: undefined,
customTitles, customTitles,
...config, ...config,
...localSetting ...localSetting,
}, },
getters: { getters: {
menuData (state, getters, rootState) { menuData(state, getters, rootState) {
if (state.filterMenu) { if (state.filterMenu) {
const { permissions, roles } = rootState.account const { permissions, roles } = rootState.account;
return filterMenu(deepClone(state.menuData), permissions, roles) return filterMenu(deepClone(state.menuData), permissions, roles);
} }
return state.menuData return state.menuData;
}, },
firstMenu (state, getters) { firstMenu(state, getters) {
const { menuData } = getters const { menuData } = getters;
if (menuData.length > 0 && !menuData[0].fullPath) { if (menuData.length > 0 && !menuData[0].fullPath) {
formatFullPath(menuData) formatFullPath(menuData);
} }
return menuData.map(item => { return menuData.map((item) => {
const menuItem = { ...item } const menuItem = { ...item };
delete menuItem.children delete menuItem.children;
return menuItem return menuItem;
}) });
}, },
subMenu (state) { subMenu(state) {
const { menuData, activatedFirst } = state const { menuData, activatedFirst } = state;
if (menuData.length > 0 && !menuData[0].fullPath) { if (menuData.length > 0 && !menuData[0].fullPath) {
formatFullPath(menuData) formatFullPath(menuData);
} }
const current = menuData.find(menu => menu.fullPath === activatedFirst) const current = menuData.find((menu) => menu.fullPath === activatedFirst);
return current && current.children || [] return (current && current.children) || [];
} },
}, },
mutations: { mutations: {
setDevice (state, isMobile) { setDevice(state, isMobile) {
state.isMobile = isMobile state.isMobile = isMobile;
}, },
setTheme (state, theme) { setTheme(state, theme) {
// console.log(theme) // console.log(theme)
state.theme = theme state.theme = theme;
}, },
setLayout (state, layout) { setLayout(state, layout) {
state.layout = layout state.layout = layout;
}, },
setMultiPage (state, multiPage) { setMultiPage(state, multiPage) {
state.multiPage = multiPage state.multiPage = multiPage;
}, },
setAnimate (state, animate) { setAnimate(state, animate) {
state.animate = animate state.animate = animate;
}, },
setWeekMode (state, weekMode) { setWeekMode(state, weekMode) {
state.weekMode = weekMode state.weekMode = weekMode;
}, },
setFixedHeader (state, fixedHeader) { setFixedHeader(state, fixedHeader) {
state.fixedHeader = fixedHeader state.fixedHeader = fixedHeader;
}, },
setFixedSideBar (state, fixedSideBar) { setFixedSideBar(state, fixedSideBar) {
state.fixedSideBar = fixedSideBar state.fixedSideBar = fixedSideBar;
}, },
setLang (state, lang) { setLang(state, lang) {
state.lang = lang state.lang = lang;
}, },
setHideSetting (state, hideSetting) { setHideSetting(state, hideSetting) {
state.hideSetting = hideSetting state.hideSetting = hideSetting;
}, },
correctPageMinHeight (state, minHeight) { correctPageMinHeight(state, minHeight) {
state.pageMinHeight += minHeight state.pageMinHeight += minHeight;
}, },
setMenuData (state, menuData) { setMenuData(state, menuData) {
state.menuData = menuData state.menuData = menuData;
}, },
setAsyncRoutes (state, asyncRoutes) { setAsyncRoutes(state, asyncRoutes) {
state.asyncRoutes = asyncRoutes state.asyncRoutes = asyncRoutes;
}, },
setPageWidth (state, pageWidth) { setPageWidth(state, pageWidth) {
state.pageWidth = pageWidth state.pageWidth = pageWidth;
}, },
setActivatedFirst (state, activatedFirst) { setActivatedFirst(state, activatedFirst) {
state.activatedFirst = activatedFirst state.activatedFirst = activatedFirst;
}, },
setFixedTabs (state, fixedTabs) { setFixedTabs(state, fixedTabs) {
state.fixedTabs = fixedTabs state.fixedTabs = fixedTabs;
}, },
setCustomTitle (state, { path, title }) { setCustomTitle(state, { path, title }) {
if (title) { if (title) {
const obj = state.customTitles.find(item => item.path === path) const obj = state.customTitles.find((item) => item.path === path);
if (obj) { if (obj) {
obj.title = title obj.title = title;
} else { } else {
state.customTitles.push({ path, title }) state.customTitles.push({ path, title });
} }
sessionStorage.setItem(process.env.VUE_APP_TBAS_TITLES_KEY, JSON.stringify(state.customTitles)) sessionStorage.setItem(
process.env.VUE_APP_TBAS_TITLES_KEY,
JSON.stringify(state.customTitles)
);
} }
} },
} },
} };
import Vue from 'vue' import Vue from "vue";
import VueI18n from 'vue-i18n' import VueI18n from "vue-i18n";
import routesI18n from '@/router/i18n' import routesI18n from "@/router/i18n";
import './Objects' import "./Objects";
import { getI18nKey } from '@/utils/routerUtil' import { getI18nKey } from "@/utils/routerUtil";
/** /**
* 创建 i18n 配置 * 创建 i18n 配置
...@@ -10,16 +10,18 @@ import { getI18nKey } from '@/utils/routerUtil' ...@@ -10,16 +10,18 @@ import { getI18nKey } from '@/utils/routerUtil'
* @param fallback 回退语言 * @param fallback 回退语言
* @returns {VueI18n} * @returns {VueI18n}
*/ */
function initI18n (locale, fallback) { function initI18n(locale, fallback) {
Vue.use(VueI18n) Vue.use(VueI18n);
let i18nOptions = { let i18nOptions = {
locale, locale,
fallbackLocale: fallback, fallbackLocale: fallback,
silentFallbackWarn: true, silentFallbackWarn: true,
} };
return new VueI18n(i18nOptions) return new VueI18n(i18nOptions);
} }
const i18n = initI18n("CN", "US");
/** /**
* 根据 router options 配置生成 国际化语言 * 根据 router options 配置生成 国际化语言
* @param lang * @param lang
...@@ -27,16 +29,22 @@ function initI18n (locale, fallback) { ...@@ -27,16 +29,22 @@ function initI18n (locale, fallback) {
* @param valueKey * @param valueKey
* @returns {*} * @returns {*}
*/ */
function generateI18n (lang, routes, valueKey) { function generateI18n(lang, routes, valueKey) {
routes.forEach(route => { routes.forEach((route) => {
let keys = getI18nKey(route.fullPath).split('.') let keys = getI18nKey(route.fullPath).split(".");
let value = valueKey === 'path' ? route[valueKey].split('/').filter(item => !item.startsWith(':') && item != '').join('.') : route[valueKey] let value =
lang.assignProps(keys, value) valueKey === "path"
? route[valueKey]
.split("/")
.filter((item) => !item.startsWith(":") && item != "")
.join(".")
: route[valueKey];
lang.assignProps(keys, value);
if (route.children) { if (route.children) {
generateI18n(lang, route.children, valueKey) generateI18n(lang, route.children, valueKey);
} }
}) });
return lang return lang;
} }
/** /**
...@@ -44,14 +52,18 @@ function generateI18n (lang, routes, valueKey) { ...@@ -44,14 +52,18 @@ function generateI18n (lang, routes, valueKey) {
* @param routes * @param routes
* @param parentPath * @param parentPath
*/ */
function formatFullPath (routes, parentPath = '') { function formatFullPath(routes, parentPath = "") {
routes.forEach(route => { routes.forEach((route) => {
let isFullPath = route.path.substring(0, 1) === '/' let isFullPath = route.path.substring(0, 1) === "/";
route.fullPath = isFullPath ? route.path : (parentPath === '/' ? parentPath + route.path : parentPath + '/' + route.path) route.fullPath = isFullPath
? route.path
: parentPath === "/"
? parentPath + route.path
: parentPath + "/" + route.path;
if (route.children) { if (route.children) {
formatFullPath(route.children, route.fullPath) formatFullPath(route.children, route.fullPath);
} }
}) });
} }
/** /**
...@@ -59,20 +71,16 @@ function formatFullPath (routes, parentPath = '') { ...@@ -59,20 +71,16 @@ function formatFullPath (routes, parentPath = '') {
* @param i18n * @param i18n
* @param routes * @param routes
*/ */
function mergeI18nFromRoutes (i18n, routes) { function mergeI18nFromRoutes(i18n, routes) {
formatFullPath(routes) formatFullPath(routes);
const CN = generateI18n(new Object(), routes, 'name') const CN = generateI18n(new Object(), routes, "name");
const US = generateI18n(new Object(), routes, 'path') const US = generateI18n(new Object(), routes, "path");
i18n.mergeLocaleMessage('CN', CN) i18n.mergeLocaleMessage("CN", CN);
i18n.mergeLocaleMessage('US', US) i18n.mergeLocaleMessage("US", US);
const messages = routesI18n.messages const messages = routesI18n.messages;
Object.keys(messages).forEach(lang => { Object.keys(messages).forEach((lang) => {
i18n.mergeLocaleMessage(lang, messages[lang]) i18n.mergeLocaleMessage(lang, messages[lang]);
}) });
} }
export { export { initI18n, mergeI18nFromRoutes, formatFullPath, i18n };
initI18n,
mergeI18nFromRoutes,
formatFullPath
}
...@@ -136,11 +136,11 @@ function loadRoutes(routesConfig) { ...@@ -136,11 +136,11 @@ function loadRoutes(routesConfig) {
// 提取路由国际化数据 // 提取路由国际化数据
mergeI18nFromRoutes(i18n, router.options.routes); mergeI18nFromRoutes(i18n, router.options.routes);
// 初始化Admin后台菜单数据 // 初始化Admin后台菜单数据
const rootRoute = router.options.routes.find((item) => item.path === "/"); // const rootRoute = router.options.routes.find((item) => item.path === "/");
const menuRoutes = rootRoute && rootRoute.children; // const menuRoutes = rootRoute && rootRoute.children;
if (menuRoutes) { // if (menuRoutes) {
store.commit("setting/setMenuData", menuRoutes); // store.commit("setting/setMenuData", menuRoutes);
} // }
} }
/** /**
......
...@@ -20,7 +20,6 @@ ALTER TABLE mortals_sys_workman ADD COLUMN `operatorId` varchar (128) default " ...@@ -20,7 +20,6 @@ ALTER TABLE mortals_sys_workman ADD COLUMN `operatorId` varchar (128) default "
-- ---------------------------- -- ----------------------------
2023-3-28 2023-3-28
-- ---------------------------- -- ----------------------------
...@@ -211,3 +210,11 @@ ALTER TABLE mortals_sys_app_info_field ADD COLUMN `serviceApiParams` varchar(10 ...@@ -211,3 +210,11 @@ ALTER TABLE mortals_sys_app_info_field ADD COLUMN `serviceApiParams` varchar(10
ALTER TABLE mortals_sys_app_info_templete_field ADD COLUMN `serviceApi` varchar(255) default '' COMMENT '事件服务接口请求地址'; ALTER TABLE mortals_sys_app_info_templete_field ADD COLUMN `serviceApi` varchar(255) default '' COMMENT '事件服务接口请求地址';
ALTER TABLE mortals_sys_app_info_templete_field ADD COLUMN `serviceApiParams` varchar(1024) default '' COMMENT '事件服务接口请求参数'; ALTER TABLE mortals_sys_app_info_templete_field ADD COLUMN `serviceApiParams` varchar(1024) default '' COMMENT '事件服务接口请求参数';
-- ----------------------------
2023-10-17
-- ----------------------------
ALTER TABLE mortals_sys_window_hall ADD COLUMN `siteId` bigint(20) default '1' COMMENT '站点Id';
...@@ -38,7 +38,9 @@ public class UserEntityExt extends BaseEntityLong { ...@@ -38,7 +38,9 @@ public class UserEntityExt extends BaseEntityLong {
private List<ModelEntity> modleList; private List<ModelEntity> modleList;
/**
* 所属区域code,多个逗号分隔
*/
private String areaCodes;
} }
\ No newline at end of file
...@@ -45,7 +45,6 @@ public class SyncTreeSiteThread implements Runnable { ...@@ -45,7 +45,6 @@ public class SyncTreeSiteThread implements Runnable {
siteService.setSiteTree(siteTreeSelects, contextTemp); siteService.setSiteTree(siteTreeSelects, contextTemp);
} }
} }
// log.info("刷新用户站点树=》userID:{} siteIds:{} siteTree:{}",context.getUser().getId(),context.getUser().getSiteIds(), JSON.toJSONString(siteService.getSiteTree(context)));
} }
} }
...@@ -45,6 +45,9 @@ public interface AreaService extends ICRUDCacheService<AreaEntity,Long> { ...@@ -45,6 +45,9 @@ public interface AreaService extends ICRUDCacheService<AreaEntity,Long> {
List<AreaTreeSelect> buildAreaTreeSelect(List<AreaEntity> areaList); List<AreaTreeSelect> buildAreaTreeSelect(List<AreaEntity> areaList);
List<AreaTreeSelect> buildCustomAreaTreeSelect(List<AreaEntity> areaList);
/** /**
* 根据父id查询子节点 * 根据父id查询子节点
* @param parentId * @param parentId
...@@ -55,6 +58,7 @@ public interface AreaService extends ICRUDCacheService<AreaEntity,Long> { ...@@ -55,6 +58,7 @@ public interface AreaService extends ICRUDCacheService<AreaEntity,Long> {
/** /**
* 获取当前节点所有子节点 * 获取当前节点所有子节点
* @param rootId * @param rootId
......
...@@ -42,7 +42,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE ...@@ -42,7 +42,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
//加载孩子关系 //加载孩子关系
if ("True".equalsIgnoreCase(data.getHaveSonArea())) { if ("True".equalsIgnoreCase(data.getHaveSonArea())) {
String childKey = super.getCacheName() + ":" + data.getIid(); String childKey = super.getCacheName() + ":" + data.getIid();
//cacheService.del(childKey); cacheService.del(childKey);
this.find(new AreaQuery().pid(data.getIid())).stream().forEach(item -> { this.find(new AreaQuery().pid(data.getIid())).stream().forEach(item -> {
cacheService.lpush(childKey, item); cacheService.lpush(childKey, item);
}); });
...@@ -164,6 +164,39 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE ...@@ -164,6 +164,39 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
return returnList.stream().map(AreaTreeSelect::new).collect(Collectors.toList()); return returnList.stream().map(AreaTreeSelect::new).collect(Collectors.toList());
} }
/**
* @param areaList
* @return
*/
@Override
public List<AreaTreeSelect> buildCustomAreaTreeSelect(List<AreaEntity> areaList) {
List<AreaTreeSelect> returnList = new ArrayList<>();
List<Long> tempList = areaList.stream().map(AreaEntity::getId).collect(Collectors.toList());
for (AreaEntity areaEntity : areaList) {
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(areaEntity.getPid())) {
//recursionFn(list, areaEntity);
AreaTreeSelect areaTreeSelect = new AreaTreeSelect(areaEntity);
rebuildList(areaTreeSelect);
// List<AreaTreeSelect> areaTreeSelectList = new ArrayList<>();
// areaTreeSelectList.add(areaTreeSelect);
// List<AreaTreeSelect> listTree = getListByRootId(areaEntity.getIid(), null);
// AreaTreeSelect areaTreeSelect = new AreaTreeSelect(areaEntity);
// areaTreeSelect.setChildren(areaTreeSelectList);
// areaEntity.setChildren();
returnList.add(areaTreeSelect);
}
}
return returnList;
}
@Override @Override
public List<AreaTreeSelect> getListByParentId(String parentId, Context context) { public List<AreaTreeSelect> getListByParentId(String parentId, Context context) {
if (ObjectUtils.isEmpty(parentId)) { if (ObjectUtils.isEmpty(parentId)) {
...@@ -186,6 +219,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE ...@@ -186,6 +219,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
return collect; return collect;
} }
@Override @Override
public List<AreaTreeSelect> getListByRootId(String rootId, Context context) { public List<AreaTreeSelect> getListByRootId(String rootId, Context context) {
if (ObjectUtils.isEmpty(rootId)) { if (ObjectUtils.isEmpty(rootId)) {
...@@ -207,11 +241,13 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE ...@@ -207,11 +241,13 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
private void rebuildList(AreaTreeSelect areaTreeSelect) { private void rebuildList(AreaTreeSelect areaTreeSelect) {
List<AreaTreeSelect> list = this.cacheService.lrange(super.getCacheName() + ":" + areaTreeSelect.getId(), AreaEntity.class).stream().map(item -> new AreaTreeSelect(item)).collect(Collectors.toList()); List<AreaTreeSelect> list = this.cacheService.lrange(super.getCacheName() + ":" + areaTreeSelect.getId(), AreaEntity.class).stream().map(item -> new AreaTreeSelect(item)).collect(Collectors.toList());
list.stream().forEach(item -> {
rebuildList(item);
});
areaTreeSelect.setChildren(list);
if(!ObjectUtils.isEmpty(list)){
list.stream().forEach(item -> {
rebuildList(item);
});
areaTreeSelect.setChildren(list);
}
} }
...@@ -280,7 +316,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE ...@@ -280,7 +316,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
@Override @Override
public Rest<String> removeAll() { public Rest<String> removeAll() {
HashMap condition = new HashMap(); HashMap condition = new HashMap();
condition.put("1",1); condition.put("1", 1);
int delete = this.dao.delete(condition); int delete = this.dao.delete(condition);
//删除所有缓存数据 //删除所有缓存数据
this.removeAllCache(); this.removeAllCache();
......
...@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -73,6 +74,33 @@ public class AreaController extends BaseCRUDJsonBodyMappingController<AreaServic ...@@ -73,6 +74,33 @@ public class AreaController extends BaseCRUDJsonBodyMappingController<AreaServic
} }
/**
* 获取站点下拉树列表
*/
@PostMapping("authAreaTree")
public String authAreaTree() {
Map<String, Object> model = new HashMap<>();
JSONObject ret = new JSONObject();
String busiDesc = "查询" + this.getModuleDesc();
int code = VALUE_RESULT_SUCCESS;
try {
List<String> areaCodeList = Arrays.asList(this.getContext().getUser().getAreaCodes().split(","));
AreaQuery areaQuery = new AreaQuery();
areaQuery.setAreaCodeList(areaCodeList);
List<AreaEntity> list = this.service.find(areaQuery);
List<AreaTreeSelect> treeSelects = this.service.buildCustomAreaTreeSelect(list);
model.put(KEY_RESULT_DATA, treeSelects);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e);
}
ret.put(KEY_RESULT_DATA, model);
ret.put(KEY_RESULT_CODE, code);
return ret.toJSONString();
}
/** /**
* 根据parentId查询子信息 * 根据parentId查询子信息
*/ */
...@@ -122,5 +150,4 @@ public class AreaController extends BaseCRUDJsonBodyMappingController<AreaServic ...@@ -122,5 +150,4 @@ public class AreaController extends BaseCRUDJsonBodyMappingController<AreaServic
return ret.toJSONString(); return ret.toJSONString();
} }
} }
\ No newline at end of file
...@@ -97,15 +97,17 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic ...@@ -97,15 +97,17 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>(); Map<String, Object> model = new HashMap<>();
String busiDesc = this.getModuleDesc() + "构建站点树"; String busiDesc = this.getModuleDesc() + "构建站点树";
Context context = getContext();
try { try {
List<SiteTreeSelect> siteTree = this.service.getSiteTree(getContext()); List<SiteTreeSelect> siteTree = this.service.getSiteTree(context);
if (ObjectUtils.isEmpty(siteTree)) { if (ObjectUtils.isEmpty(siteTree)) {
log.info("为初始化站点树,重新构建!"); log.info("为初始化站点树,重新构建!");
siteTree = this.service.siteTree(getContext()); siteTree = this.service.siteTree(context);
siteService.setSiteTree(siteTree, context);
} }
model.put("siteTree", siteTree); model.put("siteTree", siteTree);
this.init(model, getContext()); this.init(model, context);
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) { if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} }
jsonObject.put(KEY_RESULT_DATA, model); jsonObject.put(KEY_RESULT_DATA, model);
......
package com.mortals.xhx.module.window.model; package com.mortals.xhx.module.window.model;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.window.model.vo.WindowHallVo; import com.mortals.xhx.module.window.model.vo.WindowHallVo;
import lombok.Data; import lombok.Data;
/** /**
* 大厅窗口实体对象 * 大厅窗口实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-04-25 * @date 2023-10-17
*/ */
@Data @Data
public class WindowHallEntity extends WindowHallVo { public class WindowHallEntity extends WindowHallVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 窗口ID * 站点Id
*/ */
private Long siteId;
/**
* 窗口ID
*/
private Long windowId; private Long windowId;
/** /**
* 窗口名称 * 窗口名称
*/ */
private String windowName; private String windowName;
/** /**
* 大厅ID * 大厅ID
*/ */
private Long hallId; private Long hallId;
/** /**
* 大厅名称 * 大厅名称
*/ */
private String hallName; private String hallName;
/** /**
* 排序 * 排序
*/ */
private Integer sort; private Integer sort;
/** /**
* 备注 * 备注
*/ */
private String remark; private String remark;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
} }
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
...@@ -50,24 +57,19 @@ public class WindowHallEntity extends WindowHallVo { ...@@ -50,24 +57,19 @@ public class WindowHallEntity extends WindowHallVo {
if (obj instanceof WindowHallEntity) { if (obj instanceof WindowHallEntity) {
WindowHallEntity tmp = (WindowHallEntity) obj; WindowHallEntity tmp = (WindowHallEntity) obj;
if (this.getId() == tmp.getId()) { if (this.getId() == tmp.getId()) {
return true; return true;
} }
} }
return false; return false;
} }
public void initAttrValue(){ public void initAttrValue(){
this.siteId = null;
this.windowId = null; this.windowId = null;
this.windowName = "";
this.windowName = ""; this.hallId = null;
this.hallName = "";
this.hallId = null; this.sort = 0;
this.remark = "";
this.hallName = "";
this.sort = 0;
this.remark = "";
} }
} }
\ No newline at end of file
...@@ -65,7 +65,7 @@ Accept: application/json ...@@ -65,7 +65,7 @@ Accept: application/json
###构建站点树 ###构建站点树
GET {{baseUrl}}/site/siteTree GET {{baseUrl}}/site/siteTree
#Authorization: {{authToken}} #Authorization: {{authToken}}
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJsb2dpbl91c2VyX2tleSI6IjE6NTgyNzRlMWM1MDlhNDQ2YzhmYjVlMDRkNjNlM2JmOTAifQ.dLq6-GLVOPvxq66pbqpj0K5qx1y3FzbKzbKq-wCxOr4 Authorization: eyJhbGciOiJIUzI1NiJ9.eyJsb2dpbl91c2VyX2tleSI6IjIwNjY6MTM1OWYxYTQzZDNkNDljMmJkMDI5YzE5NThiNmFiZDAifQ.OQtNgxm9AH_TOuvAbbabJV0iMIbP3tj9pm6wofFqSis
Accept: application/json Accept: application/json
......
...@@ -4,9 +4,9 @@ POST {{baseUrl}}/login/login ...@@ -4,9 +4,9 @@ POST {{baseUrl}}/login/login
Content-Type: application/json Content-Type: application/json
{ {
"loginName":"admin", "loginName":"banana",
"password":"admin", "password":"gxjG123!@#",
"securityCode":"8888" "securityCode":"admin"
} }
> {% > {%
...@@ -15,6 +15,17 @@ client.global.set("authToken", JSON.parse(response.body).data.token); ...@@ -15,6 +15,17 @@ client.global.set("authToken", JSON.parse(response.body).data.token);
%} %}
###构建站点树
POST {{baseUrl}}/area/authAreaTree
Authorization: {{authToken}}
Accept: application/json
###构建站点树
POST {{baseUrl}}/area/treeselect
Authorization: {{authToken}}
Accept: application/json
###首页 ###首页
POST {{baseUrl}}/login/index POST {{baseUrl}}/login/index
......
...@@ -44,6 +44,11 @@ public class AreaTreeSelect implements Serializable { ...@@ -44,6 +44,11 @@ public class AreaTreeSelect implements Serializable {
*/ */
private String icon; private String icon;
/**
* 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
*/
private Integer areaLevel;
/** /**
* 子节点 * 子节点
*/ */
...@@ -59,6 +64,7 @@ public class AreaTreeSelect implements Serializable { ...@@ -59,6 +64,7 @@ public class AreaTreeSelect implements Serializable {
this.isLeaf = false; this.isLeaf = false;
} }
this.areaCode=entity.getAreaCode(); this.areaCode=entity.getAreaCode();
this.areaLevel=entity.getAreaLevel();
this.type = "area"; this.type = "area";
this.icon = "el-icon-folder"; this.icon = "el-icon-folder";
} }
......
...@@ -49,8 +49,8 @@ MYSQL_SERVICE="${SERVICE_PATH}/mysql.service" ...@@ -49,8 +49,8 @@ MYSQL_SERVICE="${SERVICE_PATH}/mysql.service"
RABBITMQ="rabbitmq" RABBITMQ="rabbitmq"
RABBIT_CENTOS_FILENAME="rabbitmq-server-3.9.16-1.el7.noarch.rpm" RABBIT_CENTOS_FILENAME="rabbitmq-server-3.9.16-1.el7.noarch.rpm"
ELANG_CENTOS_FILENAME="erlang-23.3.4.11-1.el7.x86_64.rpm" ELANG_CENTOS_FILENAME="erlang-23.3.4.11-1.el7.x86_64.rpm"
RABBITMQ_USER="root" RABBITMQ_USER="taxi_mq"
RABBITMQ_PASSWORD="xhx@2022" RABBITMQ_PASSWORD="admin@2020"
RABBITMQ_CONF_PATH="/etc/rabbitmq/" RABBITMQ_CONF_PATH="/etc/rabbitmq/"
#redis #redis
...@@ -341,6 +341,10 @@ setup_rabbitmq() { ...@@ -341,6 +341,10 @@ setup_rabbitmq() {
else else
writelog "ubuntu erlang and rabbitmq clear" writelog "ubuntu erlang and rabbitmq clear"
apt-get remove rabbitmq-server -y
rm -rf /var/lib/rabbitmq
rm -rf /usr/lib64/erlang
apt-get remove erlang -y
fi fi
} }
......
...@@ -142,7 +142,9 @@ export default { ...@@ -142,7 +142,9 @@ export default {
methods: { methods: {
// 获取用户常用站点列表 // 获取用户常用站点列表
async getCollect() { async getCollect() {
let res = await getCollect(); let res = await getCollect({
siteId: this.siteId,
});
if (res.code == 1) { if (res.code == 1) {
this.collectList = res.data; this.collectList = res.data;
} }
...@@ -196,6 +198,7 @@ export default { ...@@ -196,6 +198,7 @@ export default {
async saveCollect() { async saveCollect() {
let modelIds = this.collectList.map((v) => v.id).join(","); let modelIds = this.collectList.map((v) => v.id).join(",");
let res = await saveCollect({ let res = await saveCollect({
siteId: this.siteId,
modelIds, modelIds,
}); });
// if (res.data.code == 1) { // if (res.data.code == 1) {
......
...@@ -46,10 +46,10 @@ ...@@ -46,10 +46,10 @@
<a-form-model-item label="用户角色" prop="roleId"> <a-form-model-item label="用户角色" prop="roleId">
<a-select v-model="form.roleId" placeholder="请选择角色"> <a-select v-model="form.roleId" placeholder="请选择角色">
<a-select-option <a-select-option
v-for="v in userDict" v-for="(v, key) in userDict"
:key="v.key" :key="key"
:value="v.key" :value="key"
>{{ v.value }}</a-select-option >{{ v }}</a-select-option
> >
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
...@@ -105,9 +105,9 @@ export default { ...@@ -105,9 +105,9 @@ export default {
}, },
props: { props: {
userDict: { userDict: {
type: Array, type: Object,
default: () => { default: () => {
return []; return {};
}, },
}, },
visibleUserEdit: { visibleUserEdit: {
...@@ -153,12 +153,22 @@ export default { ...@@ -153,12 +153,22 @@ export default {
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
this.form = { ...row }; this.form = { ...row };
this.form.areaNames = JSON.parse(this.form.areaNames); try {
if (this.form.areaNames.length) { this.form.areaNames = JSON.parse(this.form.areaNames);
this.selectAreaList = this.form.areaNames.map((v) => v.label); } catch (err) {
this.form.areaNames = this.form.areaNames;
console.log(typeof this.form.areaNames);
}
if (typeof this.form.areaNames == "string") {
this.selectAreaList = [this.form.areaNames];
} else { } else {
this.selectAreaList = []; if (this.form.areaNames.length) {
this.selectAreaList = this.form.areaNames.map((v) => v.label);
} else {
this.selectAreaList = [];
}
} }
// this.form.areaCodes = this.form.areaCodes.split(","); // this.form.areaCodes = this.form.areaCodes.split(",");
this.form.loginPwd && this.$delete(this.form, "loginPwd"); this.form.loginPwd && this.$delete(this.form, "loginPwd");
}, },
...@@ -216,5 +226,4 @@ export default { ...@@ -216,5 +226,4 @@ export default {
}; };
</script> </script>
<style> <style></style>
</style>
\ No newline at end of file
...@@ -70,10 +70,10 @@ ...@@ -70,10 +70,10 @@
<a-form-model-item label="用户角色" prop="roleId"> <a-form-model-item label="用户角色" prop="roleId">
<a-select v-model="form.roleId" placeholder="请选择角色"> <a-select v-model="form.roleId" placeholder="请选择角色">
<a-select-option <a-select-option
v-for="v in userDict" v-for="(v, key) in userDict"
:key="v.key" :key="key"
:value="v.key" :value="key"
>{{ v.value }}</a-select-option >{{ v }}</a-select-option
> >
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
...@@ -135,9 +135,9 @@ export default { ...@@ -135,9 +135,9 @@ export default {
}, },
props: { props: {
userDict: { userDict: {
type: Array, type: Object,
default: () => { default: () => {
return []; return {};
}, },
}, },
visibleUser: { visibleUser: {
...@@ -229,5 +229,4 @@ export default { ...@@ -229,5 +229,4 @@ export default {
}; };
</script> </script>
<style> <style></style>
</style>
\ No newline at end of file
...@@ -170,7 +170,7 @@ export default { ...@@ -170,7 +170,7 @@ export default {
}, },
formTitle: undefined, //表单title formTitle: undefined, //表单title
sourceInfoForm: {}, sourceInfoForm: {},
userDict: [], // 角色数据 userDict: {}, // 角色数据
userform: { userform: {
roleId: undefined, roleId: undefined,
searchVal: undefined, searchVal: undefined,
......
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