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

Merge remote-tracking branch 'origin/master'

parents 9526ac8b a68e7a4b
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<!-- <title><%= process.env.VUE_APP_NAME %></title> -->
<title></title>
<!-- require cdn assets css -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
<% } %>
<style>
@font-face {
font-family: Source Han Sans CN;
src: url("./SourceHanSansSC-Regular-2.otf");
}
</style>
</head>
</head>
<body>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="popContainer">
<div id="app"></div>
......@@ -25,5 +34,6 @@
<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
<!-- built files will be auto injected -->
</body>
</body>
</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 @@
<div class="sitetree">
<!-- <span style="font-weight: 600">站点结构</span> -->
<div class="box">
<a-spin :spinning="loading">
<a-tree
:load-data="onLoadData"
:tree-data="treeData"
:expandedKeys.sync="expandedKeys"
:replaceFields="{ title: 'label', key: 'id' }"
@select="onSelect"
>
</a-tree>
</a-spin>
</div>
</div>
</template>
......@@ -18,6 +19,7 @@
// api
import {
getListByParentId,
authAreaTree,
// areaList,
// getSiteList
} from "@/services/basicsetFun";
......@@ -28,43 +30,73 @@ export default {
treeData: [], //树结构
id: "",
expandedKeys: [],
loading: false,
};
},
created() {
this.getAreaList();
this.authAreaTree();
this.getTopArea();
},
methods: {
// 获取区域
async getAreaList() {
editLeaf(arr) {
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 });
const { data, code } = res.data;
if (code === 1) {
this.treeData = data.data;
// let obj = {
// dataRef: {
// id: data.data[0].id,
// },
// };
// this.onLoadData(obj);
this.expandedKeys = [data.data[0].id];
return data.data[0];
} else {
return {};
}
},
// 异步获取子区域
onLoadData(treeNode) {
return new Promise((resolve) => {
getListByParentId({
parentId: treeNode.dataRef.id,
}).then((res) => {
const { data } = res.data;
treeNode.dataRef.children = data.data;
this.treeData = [...this.treeData];
resolve();
});
});
},
// onLoadData(treeNode) {
// return new Promise((resolve) => {
// getListByParentId({
// parentId: treeNode.dataRef.id,
// }).then((res) => {
// const { data } = res.data;
// treeNode.dataRef.children = data.data;
// this.treeData = [...this.treeData];
// resolve();
// });
// });
// },
// 选中区域
onSelect(num, node) {
if (num && node.selectedNodes.length > 0) {
......
......@@ -134,7 +134,7 @@ export default {
const { siteTree } = data;
this.sitelist = siteTree;
let arr = [];
const treeFn = function (e) {
const treeFn = function(e) {
e.forEach((element) => {
arr.push(element);
if (element.children && element.children.length > 0) {
......
import Vue from "vue";
import App from "./App.vue";
import { initRouter } from "./router";
import "./theme/index.less";
import Antd from "ant-design-vue";
import store from "./store";
......@@ -9,7 +8,8 @@ import "./assets/css/common.less";
import "./assets/css/relas.less";
import "./assets/css/use.less";
import Plugins from "@/plugins";
import { initI18n } from "@/utils/i18n";
import { router } from "@/router";
import { i18n } from "@/utils/i18n";
import bootstrap from "@/bootstrap";
import "moment/locale/zh-cn";
import VueResource from "vue-resource";
......@@ -56,14 +56,11 @@ Vue.prototype.$nanoid = nanoid;
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
export const router = initRouter(store.state.setting.asyncRoutes);
const i18n = initI18n("CN", "US");
Vue.use(Antd);
Vue.config.productionTip = false;
// Vue.use(Viser)
Vue.use(Plugins);
Vue.use(VueResource);
bootstrap({ router, store, i18n, message: Vue.prototype.$message });
new Vue({
......
......@@ -59,9 +59,7 @@
</div>
</div>
<div>
<div class="department_span">
简称:{{ v.deptAbb ? v.deptAbb : "--" }}
</div>
<div>简称:{{ v.deptAbb ? v.deptAbb : "--" }}</div>
<div>
联系电话:{{ v.deptTelphone ? v.deptTelphone : "--" }}
</div>
......@@ -687,7 +685,6 @@ export default {
}
.department_span {
margin-right: 3px;
font-size: 5px;
}
.department_off {
// margin-left: 20px;
......
......@@ -36,7 +36,8 @@
</div>
</template>
<script>
<script>
import local from "@/utils/local";
import {
// saveWindowHall,
batchSaveWindowHall,
......@@ -60,6 +61,7 @@ export default {
data() {
return {
selectInfo: undefined,
siteId: local.getLocal("siteId"), // 站点id
form: {
windowId: "", // 窗口id
windowName: "", // 窗口名称
......@@ -115,6 +117,7 @@ export default {
windowName: v.name, // 窗口名称
hallId: this.form.hallId, // 大厅id
hallName: this.form.hallName, // 大厅名称
siteId: this.siteId,
};
});
let res = await batchSaveWindowHall(arr);
......@@ -136,5 +139,4 @@ export default {
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
<style lang="less" scoped></style>
......@@ -7,6 +7,7 @@
<script>
import local from "@/utils/local";
import { mapMutations } from "vuex";
import { createMenus } from "@/router";
export default {
data() {
return {};
......@@ -26,8 +27,15 @@ export default {
]),
// 获取token
getToken() {
let { token, userInfo, siteid, siteName, sysName, sysLogo, path } =
this.$route.query;
let {
token,
userInfo,
siteid,
siteName,
sysName,
sysLogo,
path,
} = this.$route.query;
if (token && userInfo) {
userInfo = JSON.parse(userInfo);
this.SET_userInfo(userInfo);
......@@ -39,6 +47,8 @@ export default {
this.SET_path(path);
local.setLocal("siteId", siteid);
local.setLocal("siteName", siteName);
// 动态菜单
createMenus();
this.$router.push("/website");
} else {
this.$message.warning("跳转失败,请重新登录");
......
<template>
<div class="configurat">
<div class="title">短信全局配置</div>
<div class="set-configurat">
<y-switch
v-model="setInfo.messageoff"
checkedChildren="开"
unCheckedChildren="关"
@change="changeClose"
></y-switch>
<div class="des">
全局配置,一键控制
</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>
</template>
<script>
import YSwitch from "@/components/yswitch/YSwitch.vue";
import YButton from "@/components/YButton";
import { getSmssetList, saveSmssetList } from "@/services/configurat";
import local from "@/utils/local";
export default {
components: {
YSwitch,
YButton,
},
data() {
return {
tagList: ["全局管控", "精准到达", "远程监管", "贴心服务"],
setInfo: {
siteId: local.getLocal("siteId"),
messageoff: "",
......@@ -53,6 +58,8 @@ export default {
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
} else {
this.getSmssetList();
}
},
},
......@@ -63,36 +70,41 @@ export default {
.configurat {
width: 100%;
height: 100%;
padding: 20px;
.main {
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;
padding: 115px 80px;
background: url("~@/assets/img/sms_bg.jpg") no-repeat center/100% 100%;
.title {
margin-bottom: 35px;
font-size: 44px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #0857e8;
}
.des {
font-size: 20px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #365182;
line-height: 35px;
}
.title {
margin-left: 15px;
position: relative;
margin-bottom: 15px;
&::before {
content: "";
width: 4px;
height: 20px;
position: absolute;
top: 1px;
left: -16px;
background-color: rgba(5, 149, 253, 1);
.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;
}
}
}
......
......@@ -6,21 +6,6 @@ import Layouts from "@/layouts/Layouts";
// 路由配置
const options = {
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",
name: "预览页面",
......@@ -33,7 +18,7 @@ const options = {
redirect: "/website",
children: [
{
path: "website",
path: "/website",
name: "站点管理",
meta: {
icon: "bank",
......@@ -41,7 +26,7 @@ const options = {
component: () => import("@/pages/basicset/site/website"),
},
{
path: "business",
path: "/business",
meta: {
icon: "book",
},
......@@ -118,7 +103,7 @@ const options = {
],
},
{
path: "department",
path: "/department",
meta: {
icon: "audit",
},
......@@ -141,7 +126,7 @@ const options = {
],
},
{
path: "personnel",
path: "/personnel",
name: "工作人员管理",
meta: {
icon: "idcard",
......@@ -149,7 +134,7 @@ const options = {
component: () => import("@/pages/basicset/workman/personnel"),
},
{
path: "festival",
path: "/festival",
name: "节假日管理",
meta: {
icon: "carry-out",
......@@ -157,16 +142,17 @@ const options = {
component: () => import("@/pages/basicset/holiday/festival"),
},
{
path: "deploy",
path: "/deploy",
name: "部署模块管理",
meta: {
icon: "appstore",
roles: ["admin"],
},
component: () => import("@/pages/basicset/deploy/deploy"),
},
{
path: "hall",
path: "/hall",
name: "大厅管理",
meta: {
icon: "gateway",
......@@ -196,7 +182,7 @@ const options = {
},
{
path: "surface",
path: "/surface",
component: () => import("@/pages/basicset/surface/index"),
meta: {
icon: "skin",
......@@ -210,7 +196,7 @@ const options = {
},
{
path: "addsurfacetemplate",
name: "新增皮肤m模板",
name: "新增皮肤模板",
component: () =>
import("@/pages/basicset/surface/AddSurfaceTemplate"),
meta: { invisible: true },
......@@ -218,7 +204,7 @@ const options = {
],
},
{
path: "configurat",
path: "/configurat",
name: "短信配置",
meta: {
icon: "mail",
......@@ -227,7 +213,7 @@ const options = {
},
{
path: "appmarket",
path: "/appmarket",
component: () => import("@/pages/basicset/appmarket/Index"),
meta: {
icon: "shop",
......@@ -314,7 +300,7 @@ const options = {
],
},
{
path: "system",
path: "/system",
name: "系统设置",
component: () => import("@/pages/basicset/system/System"),
meta: {
......
import Vue from 'vue'
import Router from 'vue-router'
import {formatRoutes} from '@/utils/routerUtil'
Vue.use(Router)
import Vue from "vue";
import VueRouter from "vue-router";
import { formatRoutes } from "@/utils/routerUtil";
import { i18n } from "@/utils/i18n";
import store from "@/store";
import { mergeI18nFromRoutes } from "@/utils/i18n";
Vue.use(VueRouter);
//解决重复路由报错
const originalPush = Router.prototype.push
const originalPush = VueRouter.prototype.push;
// 修改原型对象中的push方法
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
VueRouter.prototype.push = function push(location) {
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 = {
names: ['404', '403'], //根据路由名称匹配
paths: ['/login'], //根据路由fullPath匹配
names: ["404", "403"], //根据路由名称匹配
paths: ["/login", "/jump"], //根据路由fullPath匹配
/**
* 判断路由是否包含在该配置中
* @param route vue-router 的 route 对象
* @returns {boolean}
*/
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}
*/
function initRouter(isAsync) {
const options = isAsync ? require('./async/config.async').default : require('./config').default
formatRoutes(options.routes)
return new Router(options)
function initRouter() {
// 是否异步路由模式
const options = store.state.setting.asyncRoutes
? 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 = {
treeselect: `${BASE_URL}/base/area/treeselect`,
save: `${BASE_URL}/base/area/save`,
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: {
......
......@@ -19,6 +19,10 @@ export async function getListByParentId(data) {
export async function treeselect(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) {
return request(site.list, METHOD.POST, data);
......
import config from '@/config'
import { ADMIN } from '@/config/default'
import { formatFullPath } from '@/utils/i18n'
import { filterMenu } from '@/utils/authority-utils'
import { getLocalSetting } from '@/utils/themeUtil'
import deepClone from 'lodash.clonedeep'
const localSetting = getLocalSetting(true)
import config from "@/config";
import { ADMIN } from "@/config/default";
import { formatFullPath } from "@/utils/i18n";
import { filterMenu } from "@/utils/authority-utils";
import { getLocalSetting } from "@/utils/themeUtil";
import deepClone from "lodash.clonedeep";
const localSetting = getLocalSetting(true);
// console.log(localSetting)
const customTitlesStr = sessionStorage.getItem(process.env.VUE_APP_TBAS_TITLES_KEY)
const customTitles = (customTitlesStr && JSON.parse(customTitlesStr)) || []
const customTitlesStr = sessionStorage.getItem(
process.env.VUE_APP_TBAS_TITLES_KEY
);
const customTitles = (customTitlesStr && JSON.parse(customTitlesStr)) || [];
export default {
namespaced: true,
......@@ -20,96 +22,99 @@ export default {
activatedFirst: undefined,
customTitles,
...config,
...localSetting
...localSetting,
},
getters: {
menuData (state, getters, rootState) {
menuData(state, getters, rootState) {
if (state.filterMenu) {
const { permissions, roles } = rootState.account
return filterMenu(deepClone(state.menuData), permissions, roles)
const { permissions, roles } = rootState.account;
return filterMenu(deepClone(state.menuData), permissions, roles);
}
return state.menuData
return state.menuData;
},
firstMenu (state, getters) {
const { menuData } = getters
firstMenu(state, getters) {
const { menuData } = getters;
if (menuData.length > 0 && !menuData[0].fullPath) {
formatFullPath(menuData)
formatFullPath(menuData);
}
return menuData.map(item => {
const menuItem = { ...item }
delete menuItem.children
return menuItem
})
},
subMenu (state) {
const { menuData, activatedFirst } = state
return menuData.map((item) => {
const menuItem = { ...item };
delete menuItem.children;
return menuItem;
});
},
subMenu(state) {
const { menuData, activatedFirst } = state;
if (menuData.length > 0 && !menuData[0].fullPath) {
formatFullPath(menuData)
}
const current = menuData.find(menu => menu.fullPath === activatedFirst)
return current && current.children || []
formatFullPath(menuData);
}
const current = menuData.find((menu) => menu.fullPath === activatedFirst);
return (current && current.children) || [];
},
},
mutations: {
setDevice (state, isMobile) {
state.isMobile = isMobile
setDevice(state, isMobile) {
state.isMobile = isMobile;
},
setTheme (state, theme) {
setTheme(state, theme) {
// console.log(theme)
state.theme = theme
state.theme = theme;
},
setLayout (state, layout) {
state.layout = layout
setLayout(state, layout) {
state.layout = layout;
},
setMultiPage (state, multiPage) {
state.multiPage = multiPage
setMultiPage(state, multiPage) {
state.multiPage = multiPage;
},
setAnimate (state, animate) {
state.animate = animate
setAnimate(state, animate) {
state.animate = animate;
},
setWeekMode (state, weekMode) {
state.weekMode = weekMode
setWeekMode(state, weekMode) {
state.weekMode = weekMode;
},
setFixedHeader (state, fixedHeader) {
state.fixedHeader = fixedHeader
setFixedHeader(state, fixedHeader) {
state.fixedHeader = fixedHeader;
},
setFixedSideBar (state, fixedSideBar) {
state.fixedSideBar = fixedSideBar
setFixedSideBar(state, fixedSideBar) {
state.fixedSideBar = fixedSideBar;
},
setLang (state, lang) {
state.lang = lang
setLang(state, lang) {
state.lang = lang;
},
setHideSetting (state, hideSetting) {
state.hideSetting = hideSetting
setHideSetting(state, hideSetting) {
state.hideSetting = hideSetting;
},
correctPageMinHeight (state, minHeight) {
state.pageMinHeight += minHeight
correctPageMinHeight(state, minHeight) {
state.pageMinHeight += minHeight;
},
setMenuData (state, menuData) {
state.menuData = menuData
setMenuData(state, menuData) {
state.menuData = menuData;
},
setAsyncRoutes (state, asyncRoutes) {
state.asyncRoutes = asyncRoutes
setAsyncRoutes(state, asyncRoutes) {
state.asyncRoutes = asyncRoutes;
},
setPageWidth (state, pageWidth) {
state.pageWidth = pageWidth
setPageWidth(state, pageWidth) {
state.pageWidth = pageWidth;
},
setActivatedFirst (state, activatedFirst) {
state.activatedFirst = activatedFirst
setActivatedFirst(state, activatedFirst) {
state.activatedFirst = activatedFirst;
},
setFixedTabs (state, fixedTabs) {
state.fixedTabs = fixedTabs
setFixedTabs(state, fixedTabs) {
state.fixedTabs = fixedTabs;
},
setCustomTitle (state, { path, title }) {
setCustomTitle(state, { path, title }) {
if (title) {
const obj = state.customTitles.find(item => item.path === path)
const obj = state.customTitles.find((item) => item.path === path);
if (obj) {
obj.title = title
obj.title = title;
} else {
state.customTitles.push({ path, title })
}
sessionStorage.setItem(process.env.VUE_APP_TBAS_TITLES_KEY, JSON.stringify(state.customTitles))
state.customTitles.push({ path, title });
}
sessionStorage.setItem(
process.env.VUE_APP_TBAS_TITLES_KEY,
JSON.stringify(state.customTitles)
);
}
}
}
},
},
};
import Vue from 'vue'
import VueI18n from 'vue-i18n'
import routesI18n from '@/router/i18n'
import './Objects'
import { getI18nKey } from '@/utils/routerUtil'
import Vue from "vue";
import VueI18n from "vue-i18n";
import routesI18n from "@/router/i18n";
import "./Objects";
import { getI18nKey } from "@/utils/routerUtil";
/**
* 创建 i18n 配置
......@@ -10,16 +10,18 @@ import { getI18nKey } from '@/utils/routerUtil'
* @param fallback 回退语言
* @returns {VueI18n}
*/
function initI18n (locale, fallback) {
Vue.use(VueI18n)
function initI18n(locale, fallback) {
Vue.use(VueI18n);
let i18nOptions = {
locale,
fallbackLocale: fallback,
silentFallbackWarn: true,
}
return new VueI18n(i18nOptions)
};
return new VueI18n(i18nOptions);
}
const i18n = initI18n("CN", "US");
/**
* 根据 router options 配置生成 国际化语言
* @param lang
......@@ -27,16 +29,22 @@ function initI18n (locale, fallback) {
* @param valueKey
* @returns {*}
*/
function generateI18n (lang, routes, valueKey) {
routes.forEach(route => {
let keys = getI18nKey(route.fullPath).split('.')
let value = valueKey === 'path' ? route[valueKey].split('/').filter(item => !item.startsWith(':') && item != '').join('.') : route[valueKey]
lang.assignProps(keys, value)
function generateI18n(lang, routes, valueKey) {
routes.forEach((route) => {
let keys = getI18nKey(route.fullPath).split(".");
let value =
valueKey === "path"
? route[valueKey]
.split("/")
.filter((item) => !item.startsWith(":") && item != "")
.join(".")
: route[valueKey];
lang.assignProps(keys, value);
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) {
* @param routes
* @param parentPath
*/
function formatFullPath (routes, parentPath = '') {
routes.forEach(route => {
let isFullPath = route.path.substring(0, 1) === '/'
route.fullPath = isFullPath ? route.path : (parentPath === '/' ? parentPath + route.path : parentPath + '/' + route.path)
function formatFullPath(routes, parentPath = "") {
routes.forEach((route) => {
let isFullPath = route.path.substring(0, 1) === "/";
route.fullPath = isFullPath
? route.path
: parentPath === "/"
? parentPath + route.path
: parentPath + "/" + route.path;
if (route.children) {
formatFullPath(route.children, route.fullPath)
formatFullPath(route.children, route.fullPath);
}
})
});
}
/**
......@@ -59,20 +71,16 @@ function formatFullPath (routes, parentPath = '') {
* @param i18n
* @param routes
*/
function mergeI18nFromRoutes (i18n, routes) {
formatFullPath(routes)
const CN = generateI18n(new Object(), routes, 'name')
const US = generateI18n(new Object(), routes, 'path')
i18n.mergeLocaleMessage('CN', CN)
i18n.mergeLocaleMessage('US', US)
const messages = routesI18n.messages
Object.keys(messages).forEach(lang => {
i18n.mergeLocaleMessage(lang, messages[lang])
})
function mergeI18nFromRoutes(i18n, routes) {
formatFullPath(routes);
const CN = generateI18n(new Object(), routes, "name");
const US = generateI18n(new Object(), routes, "path");
i18n.mergeLocaleMessage("CN", CN);
i18n.mergeLocaleMessage("US", US);
const messages = routesI18n.messages;
Object.keys(messages).forEach((lang) => {
i18n.mergeLocaleMessage(lang, messages[lang]);
});
}
export {
initI18n,
mergeI18nFromRoutes,
formatFullPath
}
export { initI18n, mergeI18nFromRoutes, formatFullPath, i18n };
......@@ -136,11 +136,11 @@ function loadRoutes(routesConfig) {
// 提取路由国际化数据
mergeI18nFromRoutes(i18n, router.options.routes);
// 初始化Admin后台菜单数据
const rootRoute = router.options.routes.find((item) => item.path === "/");
const menuRoutes = rootRoute && rootRoute.children;
if (menuRoutes) {
store.commit("setting/setMenuData", menuRoutes);
}
// const rootRoute = router.options.routes.find((item) => item.path === "/");
// const menuRoutes = rootRoute && rootRoute.children;
// if (menuRoutes) {
// store.commit("setting/setMenuData", menuRoutes);
// }
}
/**
......
......@@ -20,7 +20,6 @@ ALTER TABLE mortals_sys_workman ADD COLUMN `operatorId` varchar (128) default "
-- ----------------------------
2023-3-28
-- ----------------------------
......@@ -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 `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 {
private List<ModelEntity> modleList;
/**
* 所属区域code,多个逗号分隔
*/
private String areaCodes;
}
\ No newline at end of file
......@@ -45,7 +45,6 @@ public class SyncTreeSiteThread implements Runnable {
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> {
List<AreaTreeSelect> buildAreaTreeSelect(List<AreaEntity> areaList);
List<AreaTreeSelect> buildCustomAreaTreeSelect(List<AreaEntity> areaList);
/**
* 根据父id查询子节点
* @param parentId
......@@ -55,6 +58,7 @@ public interface AreaService extends ICRUDCacheService<AreaEntity,Long> {
/**
* 获取当前节点所有子节点
* @param rootId
......
......@@ -42,7 +42,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
//加载孩子关系
if ("True".equalsIgnoreCase(data.getHaveSonArea())) {
String childKey = super.getCacheName() + ":" + data.getIid();
//cacheService.del(childKey);
cacheService.del(childKey);
this.find(new AreaQuery().pid(data.getIid())).stream().forEach(item -> {
cacheService.lpush(childKey, item);
});
......@@ -164,6 +164,39 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
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
public List<AreaTreeSelect> getListByParentId(String parentId, Context context) {
if (ObjectUtils.isEmpty(parentId)) {
......@@ -186,6 +219,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
return collect;
}
@Override
public List<AreaTreeSelect> getListByRootId(String rootId, Context context) {
if (ObjectUtils.isEmpty(rootId)) {
......@@ -207,11 +241,13 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
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());
if(!ObjectUtils.isEmpty(list)){
list.stream().forEach(item -> {
rebuildList(item);
});
areaTreeSelect.setChildren(list);
}
}
......@@ -280,7 +316,7 @@ public class AreaServiceImpl extends AbstractCRUDCacheServiceImpl<AreaDao, AreaE
@Override
public Rest<String> removeAll() {
HashMap condition = new HashMap();
condition.put("1",1);
condition.put("1", 1);
int delete = this.dao.delete(condition);
//删除所有缓存数据
this.removeAllCache();
......
......@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -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查询子信息
*/
......@@ -122,5 +150,4 @@ public class AreaController extends BaseCRUDJsonBodyMappingController<AreaServic
return ret.toJSONString();
}
}
\ No newline at end of file
......@@ -97,15 +97,17 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = this.getModuleDesc() + "构建站点树";
Context context = getContext();
try {
List<SiteTreeSelect> siteTree = this.service.getSiteTree(getContext());
List<SiteTreeSelect> siteTree = this.service.getSiteTree(context);
if (ObjectUtils.isEmpty(siteTree)) {
log.info("为初始化站点树,重新构建!");
siteTree = this.service.siteTree(getContext());
siteTree = this.service.siteTree(context);
siteService.setSiteTree(siteTree, context);
}
model.put("siteTree", siteTree);
this.init(model, getContext());
if (!ObjectUtils.isEmpty(getContext()) && !ObjectUtils.isEmpty(getContext().getUser())) {
this.init(model, context);
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
recordSysLog(request, busiDesc + " 【成功】");
}
jsonObject.put(KEY_RESULT_DATA, model);
......
package com.mortals.xhx.module.window.model;
import java.util.List;
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.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.window.model.vo.WindowHallVo;
import lombok.Data;
/**
* 大厅窗口实体对象
*
* @author zxfei
* @date 2023-04-25
*/
* 大厅窗口实体对象
*
* @author zxfei
* @date 2023-10-17
*/
@Data
public class WindowHallEntity extends WindowHallVo {
private static final long serialVersionUID = 1L;
/**
* 站点Id
*/
private Long siteId;
/**
* 窗口ID
*/
......@@ -57,17 +64,12 @@ public class WindowHallEntity extends WindowHallVo {
}
public void initAttrValue(){
this.siteId = null;
this.windowId = null;
this.windowName = "";
this.hallId = null;
this.hallName = "";
this.sort = 0;
this.remark = "";
}
}
\ No newline at end of file
......@@ -3,11 +3,11 @@ package com.mortals.xhx.module.window.model;
import java.util.List;
import com.mortals.xhx.module.window.model.WindowHallEntity;
/**
* 大厅窗口查询对象
*
* @author zxfei
* @date 2023-04-25
*/
* 大厅窗口查询对象
*
* @author zxfei
* @date 2023-10-17
*/
public class WindowHallQuery extends WindowHallEntity {
/** 开始 序号,主键,自增长 */
private Long idStart;
......@@ -24,6 +24,21 @@ public class WindowHallQuery extends WindowHallEntity {
/** 序号,主键,自增长排除列表 */
private List <Long> idNotList;
/** 开始 站点Id */
private Long siteIdStart;
/** 结束 站点Id */
private Long siteIdEnd;
/** 增加 站点Id */
private Long siteIdIncrement;
/** 站点Id列表 */
private List <Long> siteIdList;
/** 站点Id排除列表 */
private List <Long> siteIdNotList;
/** 开始 窗口ID */
private Long windowIdStart;
......@@ -200,6 +215,87 @@ public class WindowHallQuery extends WindowHallEntity {
}
/**
* 获取 开始 站点Id
* @return siteIdStart
*/
public Long getSiteIdStart(){
return this.siteIdStart;
}
/**
* 设置 开始 站点Id
* @param siteIdStart
*/
public void setSiteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
}
/**
* 获取 结束 站点Id
* @return $siteIdEnd
*/
public Long getSiteIdEnd(){
return this.siteIdEnd;
}
/**
* 设置 结束 站点Id
* @param siteIdEnd
*/
public void setSiteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
}
/**
* 获取 增加 站点Id
* @return siteIdIncrement
*/
public Long getSiteIdIncrement(){
return this.siteIdIncrement;
}
/**
* 设置 增加 站点Id
* @param siteIdIncrement
*/
public void setSiteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
}
/**
* 获取 站点Id
* @return siteIdList
*/
public List<Long> getSiteIdList(){
return this.siteIdList;
}
/**
* 设置 站点Id
* @param siteIdList
*/
public void setSiteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
}
/**
* 获取 站点Id
* @return siteIdNotList
*/
public List<Long> getSiteIdNotList(){
return this.siteIdNotList;
}
/**
* 设置 站点Id
* @param siteIdNotList
*/
public void setSiteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
}
/**
* 获取 开始 窗口ID
* @return windowIdStart
......@@ -738,6 +834,60 @@ public class WindowHallQuery extends WindowHallEntity {
return this;
}
/**
* 设置 站点Id
* @param siteId
*/
public WindowHallQuery siteId(Long siteId){
setSiteId(siteId);
return this;
}
/**
* 设置 开始 站点Id
* @param siteIdStart
*/
public WindowHallQuery siteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
return this;
}
/**
* 设置 结束 站点Id
* @param siteIdEnd
*/
public WindowHallQuery siteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
return this;
}
/**
* 设置 增加 站点Id
* @param siteIdIncrement
*/
public WindowHallQuery siteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
return this;
}
/**
* 设置 站点Id
* @param siteIdList
*/
public WindowHallQuery siteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
return this;
}
/**
* 设置 站点Id
* @param siteIdNotList
*/
public WindowHallQuery siteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
return this;
}
/**
* 设置 窗口ID
* @param windowId
......
......@@ -65,7 +65,7 @@ Accept: application/json
###构建站点树
GET {{baseUrl}}/site/siteTree
#Authorization: {{authToken}}
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJsb2dpbl91c2VyX2tleSI6IjE6NTgyNzRlMWM1MDlhNDQ2YzhmYjVlMDRkNjNlM2JmOTAifQ.dLq6-GLVOPvxq66pbqpj0K5qx1y3FzbKzbKq-wCxOr4
Authorization: eyJhbGciOiJIUzI1NiJ9.eyJsb2dpbl91c2VyX2tleSI6IjIwNjY6MTM1OWYxYTQzZDNkNDljMmJkMDI5YzE5NThiNmFiZDAifQ.OQtNgxm9AH_TOuvAbbabJV0iMIbP3tj9pm6wofFqSis
Accept: application/json
......
......@@ -4,9 +4,9 @@ POST {{baseUrl}}/login/login
Content-Type: application/json
{
"loginName":"admin",
"password":"admin",
"securityCode":"8888"
"loginName":"banana",
"password":"gxjG123!@#",
"securityCode":"admin"
}
> {%
......@@ -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
......
......@@ -44,6 +44,11 @@ public class AreaTreeSelect implements Serializable {
*/
private String icon;
/**
* 区域等级(1.省,2.地市州,3.区县,4.街道,5.社区)
*/
private Integer areaLevel;
/**
* 子节点
*/
......@@ -59,6 +64,7 @@ public class AreaTreeSelect implements Serializable {
this.isLeaf = false;
}
this.areaCode=entity.getAreaCode();
this.areaLevel=entity.getAreaLevel();
this.type = "area";
this.icon = "el-icon-folder";
}
......
......@@ -49,8 +49,8 @@ MYSQL_SERVICE="${SERVICE_PATH}/mysql.service"
RABBITMQ="rabbitmq"
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"
RABBITMQ_USER="root"
RABBITMQ_PASSWORD="xhx@2022"
RABBITMQ_USER="taxi_mq"
RABBITMQ_PASSWORD="admin@2020"
RABBITMQ_CONF_PATH="/etc/rabbitmq/"
#redis
......@@ -341,6 +341,10 @@ setup_rabbitmq() {
else
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
}
......
......@@ -142,7 +142,9 @@ export default {
methods: {
// 获取用户常用站点列表
async getCollect() {
let res = await getCollect();
let res = await getCollect({
siteId: this.siteId,
});
if (res.code == 1) {
this.collectList = res.data;
}
......@@ -196,6 +198,7 @@ export default {
async saveCollect() {
let modelIds = this.collectList.map((v) => v.id).join(",");
let res = await saveCollect({
siteId: this.siteId,
modelIds,
});
// if (res.data.code == 1) {
......
......@@ -46,10 +46,10 @@
<a-form-model-item label="用户角色" prop="roleId">
<a-select v-model="form.roleId" placeholder="请选择角色">
<a-select-option
v-for="v in userDict"
:key="v.key"
:value="v.key"
>{{ v.value }}</a-select-option
v-for="(v, key) in userDict"
:key="key"
:value="key"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
......@@ -105,9 +105,9 @@ export default {
},
props: {
userDict: {
type: Array,
type: Object,
default: () => {
return [];
return {};
},
},
visibleUserEdit: {
......@@ -153,12 +153,22 @@ export default {
// 编辑
onEdit(row) {
this.form = { ...row };
try {
this.form.areaNames = JSON.parse(this.form.areaNames);
} 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 {
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.loginPwd && this.$delete(this.form, "loginPwd");
},
......@@ -216,5 +226,4 @@ export default {
};
</script>
<style>
</style>
\ No newline at end of file
<style></style>
......@@ -70,10 +70,10 @@
<a-form-model-item label="用户角色" prop="roleId">
<a-select v-model="form.roleId" placeholder="请选择角色">
<a-select-option
v-for="v in userDict"
:key="v.key"
:value="v.key"
>{{ v.value }}</a-select-option
v-for="(v, key) in userDict"
:key="key"
:value="key"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
......@@ -135,9 +135,9 @@ export default {
},
props: {
userDict: {
type: Array,
type: Object,
default: () => {
return [];
return {};
},
},
visibleUser: {
......@@ -229,5 +229,4 @@ export default {
};
</script>
<style>
</style>
\ No newline at end of file
<style></style>
......@@ -170,7 +170,7 @@ export default {
},
formTitle: undefined, //表单title
sourceInfoForm: {},
userDict: [], // 角色数据
userDict: {}, // 角色数据
userform: {
roleId: 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