Commit c19bbdd9 authored by “yiyousong”'s avatar “yiyousong”

pref:版面修改、新增工作人员添加身份证

parent 9462a2ef
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" class="beauty-scroll"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<noscript> <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> </noscript>
<div id="popContainer" class="beauty-scroll" style="height: 100vh; overflow-y: scroll"> <div id="popContainer">
<div id="app"></div> <div id="app"></div>
</div> </div>
<!-- require cdn assets js --> <!-- require cdn assets js -->
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 6px; width: 6px;
height:6px;
overflow-y: auto; overflow-y: auto;
} }
......
// 此配置为系统默认设置,需修改的设置项,在src/config/config.js中添加修改项即可。也可直接在此文件中修改。 // 此配置为系统默认设置,需修改的设置项,在src/config/config.js中添加修改项即可。也可直接在此文件中修改。
module.exports = { module.exports = {
lang: 'CN', //语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言 lang: "CN", //语言,可选 CN(简体)、HK(繁体)、US(英语),也可扩展其它语言
theme: { //主题 theme: {
color: '#1890ff', //主题色 //主题
mode: 'dark', //主题模式 可选 dark、 light 和 night color: "#1890ff", //主题色
success: '#52c41a', //成功色 mode: "dark", //主题模式 可选 dark、 light 和 night
warning: '#faad14', //警告色 success: "#52c41a", //成功色
error: '#f5222f', //错误色 warning: "#faad14", //警告色
error: "#f5222f", //错误色
}, },
layout: 'side', //导航布局,可选 side 和 head,分别为侧边导航和顶部导航 layout: "side", //导航布局,可选 side 和 head,分别为侧边导航和顶部导航
fixedHeader: false, //固定头部状态栏,true:固定,false:不固定 fixedHeader: false, //固定头部状态栏,true:固定,false:不固定
fixedSideBar: true, //固定侧边栏,true:固定,false:不固定 fixedSideBar: true, //固定侧边栏,true:固定,false:不固定
fixedTabs: false, //固定页签头,true:固定,false:不固定 fixedTabs: false, //固定页签头,true:固定,false:不固定
pageWidth: 'fixed', //内容区域宽度,fixed:固定宽度,fluid:流式宽度 pageWidth: "fixed", //内容区域宽度,fixed:固定宽度,fluid:流式宽度
weekMode: false, //色弱模式,true:开启,false:不开启 weekMode: false, //色弱模式,true:开启,false:不开启
multiPage: true, //多页签模式,true:开启,false:不开启 multiPage: true, //多页签模式,true:开启,false:不开启
cachePage: true, //是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存 cachePage: true, //是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏 hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏
systemName: '智慧政务一体化综 合 管 理 平 台', //系统名称 systemName: "智慧政务一体化综合管理平台", //系统名称
copyright: '2021 ICZER 信宏翔科技有限公司', //copyright copyright: "2021 ICZER 信宏翔科技有限公司", //copyright
asyncRoutes: false, //异步加载路由,true:开启,false:不开启 asyncRoutes: false, //异步加载路由,true:开启,false:不开启
showPageTitle: true, //是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示 showPageTitle: true, //是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
filterMenu: true, //根据权限过滤菜单,true:过滤,false:不过滤 filterMenu: true, //根据权限过滤菜单,true:过滤,false:不过滤
animate: { //动画设置 animate: {
//动画设置
disabled: true, //禁用动画,true:禁用,false:启用 disabled: true, //禁用动画,true:禁用,false:启用
name: 'bounce', //动画效果,支持的动画效果可参考 ./animate.config.js name: "bounce", //动画效果,支持的动画效果可参考 ./animate.config.js
direction: 'left' //动画方向,切换页面时动画的方向,参考 ./animate.config.js direction: "left", //动画方向,切换页面时动画的方向,参考 ./animate.config.js
}, },
footerLinks: [ //页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'} footerLinks: [
{link: 'https://pro.ant.design', name: 'Pro首页'}, //页面底部链接,{link: '链接地址', name: '名称/显示文字', icon: '图标,支持 ant design vue 图标库'}
{link: 'https://github.com/iczer/vue-antd-admin', icon: 'github'}, { link: "https://pro.ant.design", name: "Pro首页" },
{link: 'https://ant.design', name: 'Ant Design'} { link: "https://github.com/iczer/vue-antd-admin", icon: "github" },
{ link: "https://ant.design", name: "Ant Design" },
], ],
} };
<template>
<a-layout>
<!-- 头部 -->
<a-layout-header class="header">
<div class="flex aic">
<router-link to="/" class="flex aic">
<img width="32" src="@/assets/img/logo.png" />
<h1 style="padding-left: 10px">{{ systemName }}</h1>
</router-link>
<HeaderSite class="ml20"></HeaderSite>
</div>
<div>
<a-space size="middle">
<a v-permission="[1]" @click="visibleInit = true">
<a-icon type="redo" />
初始化区域数据
</a>
<a-tooltip class="header-item" title="返回门户" placement="bottom">
<a :href="portalUrl + '/#/home/siteArrange'">
<a-icon type="home" /> 返回门户
</a>
</a-tooltip>
</a-space>
</div>
</a-layout-header>
<a-layout>
<!-- 边栏菜单 -->
<a-layout-sider width="200" style="background: #fff">
<i-menu theme="light" :options="menuData" class="menu" />
</a-layout-sider>
<a-layout class="main" style="padding: 0 24px 24px">
<a-layout-content>
<router-view></router-view>
</a-layout-content>
</a-layout>
</a-layout>
<!-- 初始化区域数据弹窗 -->
<InitArea :visibleInit.sync="visibleInit"></InitArea>
</a-layout>
</template>
<script>
import { mapState } from "vuex";
import HeaderSite from "./header/HeaderSite.vue";
import InitArea from "@/components/initarea/InitArea.vue";
import IMenu from "@/components/menu/menu";
export default {
components: {
HeaderSite,
InitArea,
IMenu,
},
data() {
return {
portalUrl: process.env.VUE_APP_API_portal_URL, // 门户地址
visibleInit: false,
};
},
computed: {
...mapState("setting", ["systemName", "menuData"]),
},
created() {},
methods: {},
};
</script>
<style lang="less" scoped>
.ant-layout-header {
padding: 0px 24px;
background-color: #2681e8;
font-size: 14px;
display: flex;
align-items: center;
justify-content: space-between;
h1 {
color: #fff;
font-size: 16px;
margin: 0px;
}
a {
color: #fff;
}
}
.main {
height: calc(100vh - 64px);
overflow-y: auto;
}
.ant-layout-content {
height: 100%;
margin-top: 24px;
background: #fff;
border-radius: 4px;
}
</style>
\ No newline at end of file
<template> <template>
<a-dropdown> <div class="header-site">
<slot> <a-popover trigger="click" placement="bottomLeft" v-model="visible">
<a class="ant-dropdown-link" @click="(e) => e.preventDefault()"> <a class="ant-dropdown-link" @click="visible = true">
{{ user.site_name }} <a-icon type="down" /> {{ siteName }} <a-icon type="down" />
</a> </a>
</slot> <template slot="content">
<a-menu slot="overlay"> <div class="content" style="min-width: 50vw; min-height: 200px">
<a-menu-item v-for="(item, index) in sitelist" :key="index"> <div class="flex_row flex_align_c primary-color name">
<a href="javascript:;" @click="clickSite(item.id, item.name)">{{ <a-icon type="environment" style="margin-right: 10px" />
item.name <span style="">{{ siteName }}</span>
}}</a> </div>
</a-menu-item> <div class="site-list">
</a-menu> <span
</a-dropdown> v-for="(item, index) in sitelist"
:key="index"
:class="{ 'primary-color': item.id == checkid }"
@click="setSite(item)"
>{{ item.label }}</span
>
</div>
<div class="check-site">
<span>您的选择是:</span>
<span
v-for="(item, index) in checkarr"
:key="index"
@click="updataSite(item)"
>{{ index > 0 ? ">" : "" }}{{ item.label }}</span
>
</div>
<div class="site-btn">
<a-button
type="primary"
style="margin-right: 10px"
@click="onSucessSite"
:disabled="isSite"
>确定</a-button
>
<a-button @click="visible = false">取消</a-button>
</div>
</div>
</template>
</a-popover>
</div>
</template> </template>
<script> <script>
import { waitedListdata, waitedSavesite } from "@/services/default"; import { getSiteTree } from "@/services/basicsetFun";
// import { setAuthorization } from "@/utils/request"; import local from "@/utils/local";
import { mapGetters, mapMutations } from "vuex"; // import Cookie from "js-cookie";
export default { export default {
data() { data() {
return { return {
sitelist: [], sitelist: [],
visible: false,
offsetLeft: 0,
checkarr: [], //选中站点
checkid: undefined, //最终选中站点
siteName: "",
isSite: true,
}; };
}, },
computed: { computed: {},
...mapGetters("account", ["user"]),
},
created() { created() {
this.getwaitedListdata(); this.getwaitedListdata();
}, },
mounted() {},
methods: { methods: {
...mapMutations("account", ["setUser"]), // 确认站点
getwaitedListdata() { onSucessSite() {
waitedListdata({}).then((res) => { if (this.checkarr.length == 0) return;
const { code, data, msg } = res.data; let obj = this.checkarr[this.checkarr.length - 1];
if (code == 0) { this.clickSite(obj);
this.sitelist = data; },
// 选中
setSite(obj) {
this.checkid = undefined;
// 为子节点不添加数据
let data = this.checkarr[this.checkarr.length - 1];
if (data && (data.isLeaf || data.children.length == 0)) {
// 如果为子节点更新最后一个数据
this.checkid = obj.id;
this.checkarr[this.checkarr.length - 1] = obj;
} else { } else {
this.$message.error(`站点错误:${msg}`); this.checkarr.push(obj);
if (obj.children && obj.children.length > 0) {
this.sitelist = obj.children;
}
}
if (obj && obj.type == "site") {
this.isSite = false;
} else {
this.isSite = true;
} }
});
}, },
clickSite(siteid, site_name) { // 更新选中
waitedSavesite({ siteid: siteid }).then((res) => { updataSite(row) {
const { code, data, msg } = res.data; const { id } = row;
if (code == 0) { this.checkid = undefined;
let user = JSON.parse( let index = this.checkarr.findIndex((v) => v.id == id);
localStorage.getItem(process.env.VUE_APP_USER_KEY) this.checkarr.length = index + 1;
); this.sitelist = row.children;
user.siteid = siteid;
user.site_name = site_name; if (row && row.type == "site") {
this.setUser(user); this.isSite = false;
// setAuthorization(data);
} else { } else {
this.$message.error(msg); this.isSite = true;
}
// this.getwaitedListdata(id);
},
getwaitedListdata() {
getSiteTree().then((res) => {
const { code, data } = res.data;
if (code == 1) {
const { siteTree } = data;
this.sitelist = siteTree;
let arr = [];
const treeFn = function (e) {
e.forEach((element) => {
arr.push(element);
if (element.children && element.children.length > 0) {
treeFn(element.children);
}
});
};
const siteid = local.getLocal("siteId");
treeFn(siteTree);
const siteObj = arr.find((v) => v.id == siteid);
this.siteName = siteObj ? siteObj.label : "请选择站点";
} }
}); });
}, },
clickSite(obj) {
// Cookie.set("siteid", obj.id);
// let siteInfo = {
// siteName: obj.label,
// siteid: obj.id,
// };
local.setLocal("siteId", obj.id);
local.setLocal("siteName", obj.label);
this.show = false;
if (location.href.search(/token/gi) >= 0) {
setTimeout(() => {
location.reload();
});
} else {
location.reload();
}
},
ontrigger(e) {
if (e.target && e.target.nodeName == "A") {
this.show = !this.show;
}
},
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-dropdown-link { .ant-dropdown-link {
padding: 0 20px;
font-size: 14px;
min-width: 200px;
display: inline-block;
color: #fff; color: #fff;
}
.content {
display: flex;
flex-direction: column;
justify-content: space-around;
.name {
font-size: 20px;
}
.site-list {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
display: flex;
flex-wrap: wrap;
span {
line-height: 1.5;
padding: 10px 20px;
cursor: pointer;
&:hover {
color: #1890ff;
}
}
}
.check-site,
.site-btn {
padding: 0 20px; padding: 0 20px;
}
.check-site {
cursor: pointer;
}
} }
</style> </style>
...@@ -46,9 +46,6 @@ export default { ...@@ -46,9 +46,6 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.app-details { .app-details {
width: 100%; width: 100%;
padding: 15px;
height: 89vh;
position: absolute;
} }
/deep/.ant-tabs { /deep/.ant-tabs {
height: 100%; height: 100%;
......
...@@ -27,7 +27,6 @@ export default { ...@@ -27,7 +27,6 @@ export default {
.app-market { .app-market {
width: 100%; width: 100%;
padding: 15px; padding: 15px;
height: 89vh;
} }
/deep/.ant-tabs { /deep/.ant-tabs {
height: 100%; height: 100%;
......
...@@ -47,5 +47,6 @@ export default { ...@@ -47,5 +47,6 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.index { .index {
width: 100%; width: 100%;
background-color: #fff;
} }
</style> </style>
\ No newline at end of file
...@@ -106,7 +106,7 @@ import YSwitch from "../../../../components/yswitch/YSwitch.vue"; ...@@ -106,7 +106,7 @@ import YSwitch from "../../../../components/yswitch/YSwitch.vue";
import AddApp from "../modal/AddApp.vue"; import AddApp from "../modal/AddApp.vue";
import CheckSite from "../modal/CheckSite.vue"; import CheckSite from "../modal/CheckSite.vue";
import { getAppList, deleteApp, saveApp } from "@/services/market"; import { getAppList, deleteApp, saveApp } from "@/services/market";
import local from "@/utils/local";
export default { export default {
components: { components: {
YSwitch, YSwitch,
...@@ -169,6 +169,7 @@ export default { ...@@ -169,6 +169,7 @@ export default {
? process.env.VUE_APP_API_BASE_URL.replace("base", "") ? process.env.VUE_APP_API_BASE_URL.replace("base", "")
: process.env.VUE_APP_API_BASE_URL, : process.env.VUE_APP_API_BASE_URL,
columns, columns,
siteId: local.getLocal("siteId"),
tableData: [], // 表格数据 tableData: [], // 表格数据
loading: false, loading: false,
searchVal: "", // 搜索 searchVal: "", // 搜索
...@@ -192,6 +193,7 @@ export default { ...@@ -192,6 +193,7 @@ export default {
let res = await getAppList({ let res = await getAppList({
page: this.current, page: this.current,
size: this.size, size: this.size,
siteId: this.siteId,
appName: `%${this.searchVal}%`, appName: `%${this.searchVal}%`,
type: 1, type: 1,
}); });
...@@ -203,7 +205,6 @@ export default { ...@@ -203,7 +205,6 @@ export default {
this.getAppList(); this.getAppList();
} }
this.tableData = data; this.tableData = data;
console.log(data);
this.total = total; this.total = total;
} }
}, },
...@@ -250,7 +251,7 @@ export default { ...@@ -250,7 +251,7 @@ export default {
// 查看 // 查看
handleCheck(id) { handleCheck(id) {
this.$router.push({ this.$router.push({
path: "/basicset/appmarket/appdetails", path: "/appmarket/appdetails",
query: { query: {
id, id,
}, },
......
<template> <template>
<div class="business p15"> <div class="business">
<sitetree @getSite="handleClick" @clickArea="clickArea" /> <a-tabs v-model="active">
<!-- <div class="line"></div> --> <a-tab-pane :key="1" tab="业务管理">
<div class="right ff"> <BusinessTabs1 v-if="active === 1" ref="BusinessTabs1" />
<a-tabs :default-active-key="1" @change="handleChange">
<a-tab-pane forceRender :key="1" tab="业务管理">
<BusinessTabs1 ref="BusinessTabs1" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane forceRender :key="2" tab="事项管理"> <a-tab-pane :key="2" tab="事项管理">
<BusinessTabs2 ref="BusinessTabs2" /> <BusinessTabs2 v-if="active === 2" ref="BusinessTabs2" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane forceRender :key="3" tab="业务事项关联"> <a-tab-pane :key="3" tab="业务事项关联">
<BusinessTabs3 ref="BusinessTabs3" /> <BusinessTabs3 v-if="active === 3" ref="BusinessTabs3" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</div> </div>
</div>
</template> </template>
<script> <script>
import BusinessTabs1 from "./components/businessTabs1.vue"; import BusinessTabs1 from "./components/businessTabs1.vue";
import BusinessTabs2 from "./components/businessTabs2.vue"; import BusinessTabs2 from "./components/businessTabs2.vue";
import BusinessTabs3 from "./components/businessTabs3.vue"; import BusinessTabs3 from "./components/businessTabs3.vue";
import sitetree from "@/components/sitetree/siteTree.vue";
export default { export default {
components: { components: {
sitetree,
BusinessTabs1, BusinessTabs1,
BusinessTabs2, BusinessTabs2,
BusinessTabs3, BusinessTabs3,
...@@ -37,83 +31,31 @@ export default { ...@@ -37,83 +31,31 @@ export default {
data() { data() {
return { return {
siteId: "", // 站点id siteId: "", // 站点id
active: 1,
}; };
}, },
methods: { methods: {},
// 选择站点
handleClick(siteInfo) {
this.siteId = siteInfo.id;
if (this.$refs.BusinessTabs1) {
this.$refs.BusinessTabs1.getSiteInfo(siteInfo.id);
}
if (this.$refs.BusinessTabs2) {
this.$refs.BusinessTabs2.getSiteInfo(siteInfo.id);
}
if (this.$refs.BusinessTabs3) {
this.$refs.BusinessTabs3.getSiteInfo(siteInfo.id);
}
},
// 点击区域
clickArea() {
this.siteId = "";
this.$refs.BusinessTabs1.getEmpty();
this.$refs.BusinessTabs2.getEmpty();
this.$refs.BusinessTabs3.getEmpty();
},
// 切开tab
handleChange(key) {
if (this.siteId) {
switch (key) {
case 1:
this.$refs.BusinessTabs1.getSiteInfo(this.siteId);
break;
case 2:
this.$refs.BusinessTabs2.getSiteInfo(this.siteId);
break;
case 3:
this.$refs.BusinessTabs3.getSiteInfo(this.siteId);
break;
}
}
},
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.business { .business {
width: 100%; width: 100%;
height: 89vh;
display: flex; display: flex;
position: relative;
background-color: #fff;
/deep/.ant-tabs-nav-container { /deep/.ant-tabs-nav-container {
border-bottom: 1px solid rgb(224, 224, 224) !important; border-bottom: 1px solid rgb(224, 224, 224) !important;
} }
.right {
width: 85%;
position: relative;
margin-left: 18px;
&::after { &::after {
content: ""; content: "";
width: 1px; width: 1px;
min-height: 82vh; height: 82vh;
position: absolute; position: absolute;
background-color: #eeeeee; background-color: #eeeeee;
top: 44px; top: 44px;
left: 50%; left: 50%;
} }
.del_btn {
color: #f94545;
cursor: pointer;
}
.center_line {
height: 100px;
width: 1px;
margin: auto;
color: pink;
}
}
} }
</style> </style>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
bordered bordered
:loading="leftLoading" :loading="leftLoading"
size="middle" size="middle"
:scroll="{ y: 540 }" :scroll="{ y: 550 }"
:pagination="{ :pagination="{
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: leftCurrent, current: leftCurrent,
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<!-- 表格 --> <!-- 表格 -->
<a-table <a-table
bordered bordered
:scroll="{ y: 540 }" :scroll="{ y: 550 }"
:loading="rightLoading" :loading="rightLoading"
:pagination="{ :pagination="{
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
...@@ -142,12 +142,14 @@ ...@@ -142,12 +142,14 @@
ref="addprofession" ref="addprofession"
:visible.sync="visible" :visible.sync="visible"
:title="title" :title="title"
@newBusiness="AddSuccess"
></addprofession> ></addprofession>
</div> </div>
</template> </template>
<script> <script>
import addprofession from "../group/addprofession.vue"; import addprofession from "../group/addprofession.vue";
import local from "@/utils/local";
import { import {
getBusinessList, getBusinessList,
delSiteBusiness, delSiteBusiness,
...@@ -155,16 +157,17 @@ import { ...@@ -155,16 +157,17 @@ import {
getSiteBusinessList, getSiteBusinessList,
businessDel, businessDel,
getBusinessInfo, getBusinessInfo,
getBusinessMatterList,
delBusinessMatter,
} from "@/services/business"; } from "@/services/business";
const leftColumns = [ const leftColumns = [
{ {
title: "序号", title: "序号",
width: "12%", width: "50px",
scopedSlots: { customRender: "num" }, scopedSlots: { customRender: "num" },
}, },
{ {
title: "业务名称", title: "业务名称",
width: "70%",
align: "left", align: "left",
scopedSlots: { scopedSlots: {
customRender: "businessName", customRender: "businessName",
...@@ -182,7 +185,7 @@ const rightColumns = [ ...@@ -182,7 +185,7 @@ const rightColumns = [
{ {
title: "序号", title: "序号",
key: "id", key: "id",
width: "12%", width: "50px",
scopedSlots: { customRender: "num" }, scopedSlots: { customRender: "num" },
}, },
{ {
...@@ -191,7 +194,6 @@ const rightColumns = [ ...@@ -191,7 +194,6 @@ const rightColumns = [
scopedSlots: { scopedSlots: {
customRender: "name", customRender: "name",
}, },
width: "70%",
}, },
{ {
title: "操作", title: "操作",
...@@ -227,24 +229,21 @@ export default { ...@@ -227,24 +229,21 @@ export default {
rightSize: 10, rightSize: 10,
pageSizeOptions: ["10", "30", "50", "100"], pageSizeOptions: ["10", "30", "50", "100"],
serchData: "", serchData: "",
siteId: "", // 站点id siteId: local.getLocal("siteId"), // 站点id
businessIds: "", // 业务id businessIds: "", // 业务id
serchSiteBusiness: "", // 左边站点业务名称搜索 serchSiteBusiness: "", // 左边站点业务名称搜索
}; };
}, },
created() {}, created() {
methods: {
// 获取站点
getSiteInfo(siteId) {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态
this.siteId = siteId;
this.getSiteBusinessData(); this.getSiteBusinessData();
this.getBusinessListData(); this.getBusinessListData();
}, },
getEmpty() { methods: {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态 // 现在业务成功
AddSuccess() {
this.getSiteBusinessData();
this.getBusinessListData();
}, },
// 去掉空children // 去掉空children
delChildren(arr) { delChildren(arr) {
return arr.map((v) => { return arr.map((v) => {
...@@ -314,8 +313,7 @@ export default { ...@@ -314,8 +313,7 @@ export default {
_this.getSiteBusinessData(); _this.getSiteBusinessData();
_this.$refs.addprofession.getBusinessData(); _this.$refs.addprofession.getBusinessData();
_this.deleteData = []; _this.deleteData = [];
_this.$bus.$emit("delBusiness"); _this.delBusinessMatterLinkage(data);
_this.$bus.$emit("delBusinessMatter", data);
} }
}, },
onCancel() { onCancel() {
...@@ -323,7 +321,6 @@ export default { ...@@ -323,7 +321,6 @@ export default {
}, },
}); });
}, },
//新增业务 //新增业务
showModal() { showModal() {
if (!this.siteId) { if (!this.siteId) {
...@@ -331,14 +328,13 @@ export default { ...@@ -331,14 +328,13 @@ export default {
return; return;
} }
this.title = "新增业务"; this.title = "新增业务";
this.$refs.addprofession.onAdd();
this.visible = true; this.visible = true;
this.$refs.addprofession.onAdd(this.siteId);
}, },
// 批量删除id // 批量删除id
onSelectChange(key, data) { onSelectChange(key, data) {
this.deleteData = data; this.deleteData = data;
}, },
// 批量删除 // 批量删除
handleDelAll() { handleDelAll() {
if (this.deleteData.length <= 0) { if (this.deleteData.length <= 0) {
...@@ -414,7 +410,6 @@ export default { ...@@ -414,7 +410,6 @@ export default {
this.$message.success(msg); this.$message.success(msg);
this.getSiteBusinessData(); this.getSiteBusinessData();
this.selectedRowKeys = []; this.selectedRowKeys = [];
this.$bus.$emit("addBusiness");
this.businessIds = ""; this.businessIds = "";
} }
}, },
...@@ -443,6 +438,52 @@ export default { ...@@ -443,6 +438,52 @@ export default {
}, },
}); });
}, },
// 删除业务事项关联
async businessLinkage(matterId) {
let result = await delBusinessMatter({
id: matterId,
});
let { code } = result.data;
if (code === 1) {
console.log("删除成功");
}
},
// 删除业务联动删除业务事项关联
async delBusinessMatterLinkage(row) {
let str = [];
if (Array.isArray(row)) {
let arr = row.map((v) => v.businessId);
let num = 0;
let delData = async () => {
if (num > arr.length - 1) {
str = str.map((v) => v.id).join(",");
this.businessLinkage(str);
return;
}
let res = await getBusinessMatterList({
siteBusinessId: arr[num],
siteId: this.siteId,
});
let { code, data } = res.data;
if (code === 1) {
num++;
str = [...str, ...data.data];
}
delData();
};
delData();
} else {
let res = await getBusinessMatterList({
siteBusinessId: row.businessId,
siteId: this.siteId,
});
let { code, data } = res.data;
if (code === 1 && data.data.length) {
str = data.data.map((v) => v.id).join(",");
this.businessLinkage(str);
}
}
},
}, },
}; };
</script> </script>
...@@ -450,6 +491,7 @@ export default { ...@@ -450,6 +491,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.basicset-tab1 { .basicset-tab1 {
width: 100%; width: 100%;
height: 100%;
display: flex; display: flex;
.left, .left,
.right { .right {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
onChange: changeLeft, onChange: changeLeft,
onShowSizeChange: showSizeChange, onShowSizeChange: showSizeChange,
}" }"
:scroll="{ y: 530 }" :scroll="{ y: 550 }"
:columns="leftColumns" :columns="leftColumns"
:data-source="matterSiteData" :data-source="matterSiteData"
:row-selection="{ onChange: onSelectChange }" :row-selection="{ onChange: onSelectChange }"
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<!-- 表格 --> <!-- 表格 -->
<a-table <a-table
bordered bordered
:scroll="{ y: 530 }" :scroll="{ y: 550 }"
:loading="rightLoading" :loading="rightLoading"
:pagination="{ :pagination="{
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
...@@ -166,12 +166,13 @@ import { ...@@ -166,12 +166,13 @@ import {
delSiteMatter, delSiteMatter,
delMatter, delMatter,
} from "@/services/matter"; } from "@/services/matter";
import { getBusinessMatterList, delBusinessMatter } from "@/services/business";
// import { getDeptList } from "@/services/dept"; // import { getDeptList } from "@/services/dept";
// import local from "@/utils/local"; import local from "@/utils/local";
const leftColumns = [ const leftColumns = [
{ {
title: "序号", title: "序号",
width: "12%", width: "50px",
scopedSlots: { customRender: "index" }, scopedSlots: { customRender: "index" },
}, },
{ {
...@@ -184,7 +185,6 @@ const leftColumns = [ ...@@ -184,7 +185,6 @@ const leftColumns = [
{ {
title: "事项名称", title: "事项名称",
ellipsis: true, ellipsis: true,
width: "30%",
dataIndex: "matterName", dataIndex: "matterName",
}, },
{ {
...@@ -205,8 +205,7 @@ const leftColumns = [ ...@@ -205,8 +205,7 @@ const leftColumns = [
const rightColumns = [ const rightColumns = [
{ {
title: "序号", title: "序号",
dataIndex: "id", width: "50px",
width: "12%",
scopedSlots: { customRender: "num" }, scopedSlots: { customRender: "num" },
}, },
{ {
...@@ -219,7 +218,6 @@ const rightColumns = [ ...@@ -219,7 +218,6 @@ const rightColumns = [
{ {
title: "事项名称", title: "事项名称",
ellipsis: true, ellipsis: true,
width: "40%",
dataIndex: "matterName", dataIndex: "matterName",
}, },
{ {
...@@ -251,7 +249,7 @@ export default { ...@@ -251,7 +249,7 @@ export default {
leftSize: 10, leftSize: 10,
rightSize: 10, rightSize: 10,
pageSizeOptions: ["10", "30", "50", "100"], pageSizeOptions: ["10", "30", "50", "100"],
siteId: "", // 站点id siteId: local.getLocal("siteId"), // 站点id
matterIds: "", // 事项id matterIds: "", // 事项id
deptList: [], // 站点部门 deptList: [], // 站点部门
windowToTheSceneNum: "", // 窗口到现场次数 windowToTheSceneNum: "", // 窗口到现场次数
...@@ -261,20 +259,11 @@ export default { ...@@ -261,20 +259,11 @@ export default {
}; };
}, },
created() { created() {
// this.getMatterSiteData();
},
methods: {
// 获取站点
getSiteInfo(siteId) {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态
this.siteId = siteId;
this.getMatterSiteData(); this.getMatterSiteData();
this.getMatterListData(); this.getMatterListData();
}, },
getEmpty() {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态 methods: {
},
// 获取站点事项 // 获取站点事项
async getMatterSiteData(search = {}) { async getMatterSiteData(search = {}) {
this.leftLoading = true; this.leftLoading = true;
...@@ -338,8 +327,7 @@ export default { ...@@ -338,8 +327,7 @@ export default {
_this.getMatterSiteData(); _this.getMatterSiteData();
_this.getMatterListData(); _this.getMatterListData();
_this.deleteData = ""; _this.deleteData = "";
_this.$bus.$emit("delMatterSiteData"); _this.deleteMatterSiteRelevance(row);
_this.$bus.$emit("delMatterSiteRelevance", row);
} }
}, },
onCancel() { onCancel() {
...@@ -347,7 +335,6 @@ export default { ...@@ -347,7 +335,6 @@ export default {
}, },
}); });
}, },
//新增事项 //新增事项
addItems() { addItems() {
if (!this.siteId) { if (!this.siteId) {
...@@ -359,11 +346,9 @@ export default { ...@@ -359,11 +346,9 @@ export default {
query: { siteId: this.siteId }, query: { siteId: this.siteId },
}); });
}, },
onSelectChange(key, data) { onSelectChange(key, data) {
this.deleteData = data; this.deleteData = data;
}, },
// 批量移除站点事项 // 批量移除站点事项
handleDelAll() { handleDelAll() {
if (this.deleteData.length <= 0) { if (this.deleteData.length <= 0) {
...@@ -409,7 +394,6 @@ export default { ...@@ -409,7 +394,6 @@ export default {
this.rightSize = size; this.rightSize = size;
this.getMatterListData(); this.getMatterListData();
}, },
// 右搜索 // 右搜索
onSearchRight() { onSearchRight() {
this.rightCurrent = 1; this.rightCurrent = 1;
...@@ -459,6 +443,52 @@ export default { ...@@ -459,6 +443,52 @@ export default {
}, },
}); });
}, },
// 删除业务事项关联
async businessLinkage(matterId) {
let result = await delBusinessMatter({
id: matterId,
});
let { code } = result.data;
if (code === 1) {
console.log("删除成功");
}
},
// 站点事项删除联动
async deleteMatterSiteRelevance(row) {
let str = [];
if (Array.isArray(row)) {
let arr = row.map((v) => v.matterId);
let num = 0;
let delData = async () => {
if (num > arr.length - 1) {
str = str.map((v) => v.id).join(",");
this.businessLinkage(str);
return;
}
let res = await getBusinessMatterList({
matterId: arr[num],
siteId: this.siteId,
});
let { code, data } = res.data;
if (code === 1) {
num++;
str = [...str, ...data.data];
}
delData();
};
delData();
} else {
let res = await getBusinessMatterList({
matterId: row.matterId,
siteId: this.siteId,
});
let { code, data } = res.data;
if (code === 1 && data.data.length) {
str = data.data.map((v) => v.id).join(",");
this.businessLinkage(str);
}
}
},
}, },
}; };
</script> </script>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
onChange: changeLeft, onChange: changeLeft,
onShowSizeChange: showSizeChange, onShowSizeChange: showSizeChange,
}" }"
:scroll="{ y: 530 }" :scroll="{ y: 550 }"
:columns="leftColumns" :columns="leftColumns"
:data-source="businessMatterData" :data-source="businessMatterData"
:row-selection="{ onChange: onSelectChange }" :row-selection="{ onChange: onSelectChange }"
...@@ -58,20 +58,6 @@ ...@@ -58,20 +58,6 @@
</template> </template>
</a-table> </a-table>
</div> </div>
<!-- 分页 -->
<!-- <div class="pagination" v-if="leftTotal">
<a-pagination
v-model="leftCurrent"
:show-total="(total) => `共 ${total} 条`"
:total="leftTotal"
@change="changeLeft"
show-less-items
show-size-changer
show-quick-jumper
:pageSizeOptions="pageSizeOptions"
@showSizeChange="showSizeChange"
/>
</div> -->
</div> </div>
<!-- 右 --> <!-- 右 -->
<div class="right"> <div class="right">
...@@ -105,7 +91,7 @@ ...@@ -105,7 +91,7 @@
onChange: changeRight, onChange: changeRight,
onShowSizeChange: showSizeChangeRight, onShowSizeChange: showSizeChangeRight,
}" }"
:scroll="{ y: 530 }" :scroll="{ y: 550 }"
:loading="rightloading" :loading="rightloading"
size="middle" size="middle"
:row-selection="{ :row-selection="{
...@@ -130,20 +116,6 @@ ...@@ -130,20 +116,6 @@
</template> </template>
</a-table> </a-table>
</div> </div>
<!-- 分页 -->
<!-- <div class="pagination" v-if="rightTotal">
<a-pagination
v-model="rightCurrent"
:show-total="(total) => `共 ${total} 条`"
:total="rightTotal"
@change="changeRight"
show-less-items
show-size-changer
show-quick-jumper
:pageSizeOptions="pageSizeOptions"
@showSizeChange="showSizeChangeRight"
/>
</div> -->
</div> </div>
<!-- 关联 --> <!-- 关联 -->
<a-modal <a-modal
...@@ -155,7 +127,12 @@ ...@@ -155,7 +127,12 @@
@ok="handleOk" @ok="handleOk"
> >
<p>此操作将关联</p> <p>此操作将关联</p>
<a-form-model :model="siteBusiness" ref="formData" :rules="rules"> <a-form-model
:model="siteBusiness"
:wrapper-col="{ span: 24 }"
ref="formData"
:rules="rules"
>
<a-form-model-item prop="siteBusinessId"> <a-form-model-item prop="siteBusinessId">
<div class="business"> <div class="business">
<a-tag color="#f50"> 业务 </a-tag> <a-tag color="#f50"> 业务 </a-tag>
...@@ -199,7 +176,7 @@ ...@@ -199,7 +176,7 @@
@cancel="handleCloseUnbound" @cancel="handleCloseUnbound"
> >
<p>此操作将解除</p> <p>此操作将解除</p>
<a-form-model> <a-form-model :wrapper-col="{ span: 24 }">
<a-form-model-item> <a-form-model-item>
<div class="business"> <div class="business">
<a-tag color="#f50"> 业务 </a-tag> <a-tag color="#f50"> 业务 </a-tag>
...@@ -240,7 +217,7 @@ ...@@ -240,7 +217,7 @@
@ok="handleAllColse" @ok="handleAllColse"
> >
<p>此操作将解除</p> <p>此操作将解除</p>
<a-form-model> <a-form-model :wrapper-col="{ span: 24 }">
<a-form-model-item <a-form-model-item
class="site-business" class="site-business"
v-for="v in businessMatterAll" v-for="v in businessMatterAll"
...@@ -269,18 +246,17 @@ import { ...@@ -269,18 +246,17 @@ import {
// getMatterlistData, // getMatterlistData,
} from "@/services/business"; } from "@/services/business";
// import { getDeptList } from "@/services/dept"; // import { getDeptList } from "@/services/dept";
// import local from "@/utils/local"; import local from "@/utils/local";
const leftColumns = [ const leftColumns = [
{ {
title: "序号", title: "序号",
dataIndex: "id", dataIndex: "id",
key: "id", key: "id",
width: "12%", width: "50px",
scopedSlots: { customRender: "num" }, scopedSlots: { customRender: "num" },
}, },
{ {
title: "业务名称", title: "业务名称",
width: "60%",
ellipsis: true, ellipsis: true,
dataIndex: "siteBusinessName", dataIndex: "siteBusinessName",
}, },
...@@ -297,7 +273,7 @@ const rightColumns = [ ...@@ -297,7 +273,7 @@ const rightColumns = [
{ {
title: "序号", title: "序号",
dataIndex: "id", dataIndex: "id",
width: "12%", width: "50px",
scopedSlots: { customRender: "num" }, scopedSlots: { customRender: "num" },
}, },
{ {
...@@ -310,7 +286,6 @@ const rightColumns = [ ...@@ -310,7 +286,6 @@ const rightColumns = [
{ {
title: "事项名称", title: "事项名称",
ellipsis: true, ellipsis: true,
width: "40%",
dataIndex: "matterName", dataIndex: "matterName",
}, },
{ {
...@@ -346,7 +321,7 @@ export default { ...@@ -346,7 +321,7 @@ export default {
leftSize: 10, leftSize: 10,
rightSize: 10, rightSize: 10,
pageSizeOptions: ["10", "30", "50", "100"], pageSizeOptions: ["10", "30", "50", "100"],
siteId: "", // 站点id siteId: local.getLocal("siteId"), // 站点id
matterIds: "", // 业务id matterIds: "", // 业务id
// deptList: [], // 站点部门 // deptList: [], // 站点部门
rightSearch: "", // 事项搜索 rightSearch: "", // 事项搜索
...@@ -370,50 +345,13 @@ export default { ...@@ -370,50 +345,13 @@ export default {
}; };
}, },
created() { created() {
this.$bus.$off([ this.getBusinessMatterData();
"addBusiness", this.getMatterlistData();
"newBusiness",
"delBusiness",
"delMatterSiteData",
"addMatterSiteData",
"delBusinessMatter",
"delMatterSiteRelevance",
]);
this.$bus.$on("addBusiness", () => {
this.getSiteBusinessData();
});
this.$bus.$on("newBusiness", () => {
this.getSiteBusinessData();
});
this.$bus.$on("delBusiness", () => {
this.getSiteBusinessData(); this.getSiteBusinessData();
});
this.$bus.$on("delMatterSiteData", () => {
this.getMatterSiteData(); this.getMatterSiteData();
});
this.$bus.$on("addMatterSiteData", () => {
this.getMatterSiteData();
});
this.$bus.$on("delBusinessMatter", (row) => {
this.delBusinessMatterLinkage(row);
});
this.$bus.$on("delMatterSiteRelevance", (row) => {
this.deleteMatterSiteRelevance(row);
});
}, },
methods: { methods: {
// 获取站点
getSiteInfo(siteId) {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态
this.siteId = siteId;
this.getSiteBusinessData({ siteId });
this.getMatterSiteData({ siteId });
this.getBusinessMatterData({ siteId });
},
getEmpty() {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态
},
// 获取站点业务关联列表 // 获取站点业务关联列表
async getBusinessMatterData(search = {}) { async getBusinessMatterData(search = {}) {
this.Leftloading = true; this.Leftloading = true;
...@@ -702,96 +640,14 @@ export default { ...@@ -702,96 +640,14 @@ export default {
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
this.isCorrelation = false; this.isCorrelation = false;
}, },
async businessLinkage(matterId) {
let result = await delBusinessMatter({
id: matterId,
});
let { code } = result.data;
if (code === 1) {
this.getBusinessMatterData();
}
},
// 站点业务删除联动
async delBusinessMatterLinkage(row) {
let str = [];
if (Array.isArray(row)) {
let arr = row.map((v) => v.businessId);
let num = 0;
let delData = async () => {
if (num > arr.length - 1) {
str = str.map((v) => v.id).join(",");
this.businessLinkage(str);
return;
}
let res = await getBusinessMatterList({
siteBusinessId: arr[num],
siteId: this.siteId,
});
let { code, data } = res.data;
if (code === 1) {
num++;
str = [...str, ...data.data];
}
delData();
};
delData();
} else {
let res = await getBusinessMatterList({
siteBusinessId: row.businessId,
siteId: this.siteId,
});
let { code, data } = res.data;
if (code === 1 && data.data.length) {
str = data.data.map((v) => v.id).join(",");
this.businessLinkage(str);
}
}
},
// 站点事项删除联动
async deleteMatterSiteRelevance(row) {
let str = [];
if (Array.isArray(row)) {
let arr = row.map((v) => v.matterId);
let num = 0;
let delData = async () => {
if (num > arr.length - 1) {
str = str.map((v) => v.id).join(",");
this.businessLinkage(str);
return;
}
let res = await getBusinessMatterList({
matterId: arr[num],
siteId: this.siteId,
});
let { code, data } = res.data;
if (code === 1) {
num++;
str = [...str, ...data.data];
}
delData();
};
delData();
} else {
let res = await getBusinessMatterList({
matterId: row.matterId,
siteId: this.siteId,
});
let { code, data } = res.data;
if (code === 1 && data.data.length) {
str = data.data.map((v) => v.id).join(",");
this.businessLinkage(str);
}
}
},
}, },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.basicset-tab3 { .basicset-tab3 {
display: flex;
width: 100%; width: 100%;
display: flex;
.left, .left,
.right { .right {
width: 50%; width: 50%;
......
...@@ -71,6 +71,7 @@ ...@@ -71,6 +71,7 @@
<script> <script>
import { checkEn, checkBusinessName } from "@/utils/validate"; import { checkEn, checkBusinessName } from "@/utils/validate";
import local from "@/utils/local";
// import YSwitch from "@/components/yswitch/YSwitch.vue"; // import YSwitch from "@/components/yswitch/YSwitch.vue";
import { import {
saveBusiness, saveBusiness,
...@@ -84,7 +85,7 @@ export default { ...@@ -84,7 +85,7 @@ export default {
}, },
data() { data() {
return { return {
siteId: "", siteId: local.getLocal("siteId"),
form: { form: {
isBusiness: "", isBusiness: "",
parentId: undefined, parentId: undefined,
...@@ -141,15 +142,13 @@ export default { ...@@ -141,15 +142,13 @@ export default {
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
}, },
// 新增 // 新增
onAdd(id) { onAdd() {
this.siteId = id;
this.getBusinessData(); this.getBusinessData();
Object.assign(this.form, this.$options.data().form); Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id"); this.form.id && this.$delete(this.form, "id");
}, },
// 编辑 // 编辑
onEdit(data, siteId) { onEdit(data) {
this.siteId = siteId;
this.getBusinessData(); this.getBusinessData();
this.form = { ...data }; this.form = { ...data };
}, },
...@@ -183,9 +182,7 @@ export default { ...@@ -183,9 +182,7 @@ export default {
this.$message.success(msg); this.$message.success(msg);
this.getBusinessData(); this.getBusinessData();
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
this.$parent.getSiteBusinessData(); this.$emit("newBusiness");
this.$parent.getBusinessListData();
this.$bus.$emit("newBusiness");
} }
} else { } else {
this.visibleAll = false; this.visibleAll = false;
...@@ -194,7 +191,7 @@ export default { ...@@ -194,7 +191,7 @@ export default {
this.$refs.formData.resetFields(); this.$refs.formData.resetFields();
this.$parent.getSiteBusinessData(); this.$parent.getSiteBusinessData();
this.$parent.getBusinessListData(); this.$parent.getBusinessListData();
this.$bus.$emit("newBusiness"); this.$emit("newBusiness");
} }
this.confirmLoading = false; this.confirmLoading = false;
} }
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<a-button type="primary" style="margin-right: 10px" @click="handleAdd" <a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增模块</a-button >新增模块</a-button
> >
<a-button type="danger" @click="handleDelAll">批量删除模块</a-button> <a-button type="danger" @click="handleDelAll">批量删除模块</a-button>
</div> </div>
<div class="search-box"> <div class="search-box">
...@@ -28,7 +27,7 @@ ...@@ -28,7 +27,7 @@
}" }"
:loading="loading" :loading="loading"
bordered bordered
:scroll="{ y: 550 }" :scroll="{ y: 560 }"
:columns="columns" :columns="columns"
:pagination="{ :pagination="{
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
...@@ -454,7 +453,8 @@ export default { ...@@ -454,7 +453,8 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.deploy { .deploy {
width: 100%; width: 100%;
padding: 15px; height: 100%;
background-color: #fff;
.control { .control {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -462,7 +462,6 @@ export default { ...@@ -462,7 +462,6 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
.search-box { .search-box {
width: 260px; width: 260px;
margin-right: 60px;
} }
} }
// .table-content { // .table-content {
...@@ -482,9 +481,6 @@ export default { ...@@ -482,9 +481,6 @@ export default {
} }
/deep/.ant-card { /deep/.ant-card {
width: 100% !important; width: 100% !important;
.ant-card-body {
height: 750px;
}
} }
.svg-box { .svg-box {
background-color: #54788c; background-color: #54788c;
......
<template>
<div class="index">
<keep-alive>
<!-- 需要缓存的视图组件 -->
<router-view v-if="$route.meta.keepAlive"> </router-view>
</keep-alive>
<!-- 不需要缓存的视图组件 -->
<router-view v-if="!$route.meta.keepAlive"> </router-view>
</div>
</template>
<script>
export default {};
</script>
<style lang="less" scoped>
.index {
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file
<template> <template>
<div class="addwindowmatter" :class="{ isShow: Visible }"> <div class="addwindowmatter" :class="{ isShow: Visible }">
<a-card <a-card
:title="windowInfo.windowName" :title="windowInfo.name"
:bordered="false" :bordered="false"
:headStyle="{ color: '#0595FD' }" :headStyle="{ color: '#0595FD' }"
> >
...@@ -181,8 +181,9 @@ import { ...@@ -181,8 +181,9 @@ import {
saveWindowmatter, saveWindowmatter,
getWindowmatterList, getWindowmatterList,
delWindowmatter, delWindowmatter,
getWindowInfo,
} from "@/services/dept"; } from "@/services/dept";
import YSwitch from "../../../../components/yswitch/YSwitch.vue"; import YSwitch from "@/components/yswitch/YSwitch.vue";
const leftColumns = [ const leftColumns = [
{ {
title: "序号", title: "序号",
...@@ -243,13 +244,6 @@ export default { ...@@ -243,13 +244,6 @@ export default {
components: { components: {
YSwitch, YSwitch,
}, },
props: {
isShow: {
typeof: Boolean,
required: true,
default: false,
},
},
data() { data() {
return { return {
leftColumns, leftColumns,
...@@ -272,8 +266,6 @@ export default { ...@@ -272,8 +266,6 @@ export default {
allDel: "", // 批量删除id allDel: "", // 批量删除id
windowInfo: {}, windowInfo: {},
formData: { formData: {
siteMatterId: "",
matterName: "",
isShow: 0, isShow: 0,
sort: 0, sort: 0,
}, },
...@@ -284,7 +276,10 @@ export default { ...@@ -284,7 +276,10 @@ export default {
// }, // },
}; };
}, },
created() {}, created() {
this.getWindowInfo();
this.getWindowmatterData();
},
computed: { computed: {
Visible: { Visible: {
get() { get() {
...@@ -297,10 +292,11 @@ export default { ...@@ -297,10 +292,11 @@ export default {
}, },
methods: { methods: {
// 获取窗口信息 // 获取窗口信息
getDeptInfo(info) { async getWindowInfo() {
this.windowInfo = info; let res = await getWindowInfo({ id: this.$route.query.windowId });
// this.getSiteMatterData(); if (res.data.code === 1) {
this.getWindowmatterData(); this.windowInfo = res.data.data;
}
}, },
// 获取站点事项 // 获取站点事项
async getSiteMatterData() { async getSiteMatterData() {
...@@ -310,6 +306,7 @@ export default { ...@@ -310,6 +306,7 @@ export default {
size: 10, size: 10,
siteId: this.windowInfo.siteId, siteId: this.windowInfo.siteId,
matterName: `%${this.matterNameSearch}%`, matterName: `%${this.matterNameSearch}%`,
// deptId: this.windowInfo.deptId,
}); });
let { data, total } = res.data.data; let { data, total } = res.data.data;
this.siteMatterData = data; this.siteMatterData = data;
...@@ -332,7 +329,7 @@ export default { ...@@ -332,7 +329,7 @@ export default {
let res = await getWindowmatterList({ let res = await getWindowmatterList({
page: this.Current, page: this.Current,
size: this.size, size: this.size,
windowId: this.windowInfo.windowId, windowId: this.$route.query.windowId,
...search, ...search,
}); });
let { total, data } = res.data.data; let { total, data } = res.data.data;
...@@ -376,13 +373,17 @@ export default { ...@@ -376,13 +373,17 @@ export default {
// 保存 // 保存
async handleOk() { async handleOk() {
if (this.matterKeys.length) { if (this.matterKeys.length) {
let res = await saveWindowmatter({ let obj = {
...this.formData, windowId: this.windowInfo.id,
...this.windowInfo, windowName: this.windowInfo.name,
siteMatterId: this.matterKeys.join(","), siteMatterId: this.matterKeys.join(","),
matterName: this.matterRows[0].matterName, matterName: this.matterRows[0].matterName,
deptId: this.matterRows[0].deptId, deptId: this.matterRows[0].deptId,
deptName: this.matterRows[0].deptName, deptName: this.matterRows[0].deptName,
};
let res = await saveWindowmatter({
...this.formData,
...obj,
}); });
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
...@@ -429,8 +430,7 @@ export default { ...@@ -429,8 +430,7 @@ export default {
}, },
// 返回 // 返回
handleBack() { handleBack() {
this.tableData = []; this.$router.back();
this.Visible = false;
}, },
// 删除 // 删除
handleDel(num) { handleDel(num) {
...@@ -491,16 +491,8 @@ export default { ...@@ -491,16 +491,8 @@ export default {
.addwindowmatter { .addwindowmatter {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute;
display: none;
z-index: 10;
}
.isShow {
display: block;
}
/deep/.ant-card {
height: 97%;
} }
.title { .title {
font-size: 16px; font-size: 16px;
} }
......
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
<script> <script>
import { saveDept } from "@/services/dept"; import { saveDept } from "@/services/dept";
import YSwitch from "@/components/yswitch/YSwitch.vue"; import YSwitch from "@/components/yswitch/YSwitch.vue";
import local from "@/utils/local";
// import DataSet from "@antv/data-set"; // import DataSet from "@antv/data-set";
export default { export default {
components: { YSwitch }, components: { YSwitch },
...@@ -119,8 +120,8 @@ export default { ...@@ -119,8 +120,8 @@ export default {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 14 }, wrapperCol: { span: 14 },
siteInfo: { siteInfo: {
siteName: "", // 站点名称 siteName: local.getLocal("siteName"), // 站点名称
siteId: "", // 站点id siteId: local.getLocal("siteId"), // 站点id
}, },
form: { form: {
name: "", //部门名称 name: "", //部门名称
...@@ -174,11 +175,6 @@ export default { ...@@ -174,11 +175,6 @@ export default {
}, },
}, },
methods: { methods: {
// 获取站点名称和id
getSiteInfo(info) {
this.siteInfo.siteName = info.label;
this.siteInfo.siteId = info.id;
},
// 新增 // 新增
onAdd() { onAdd() {
Object.assign(this.form, this.$options.data().form); Object.assign(this.form, this.$options.data().form);
......
...@@ -164,6 +164,7 @@ ...@@ -164,6 +164,7 @@
import { addWindow } from "@/services/dept"; import { addWindow } from "@/services/dept";
import YSwitch from "@/components/yswitch/YSwitch.vue"; import YSwitch from "@/components/yswitch/YSwitch.vue";
import { changeWindowNumber } from "@/utils/validate"; import { changeWindowNumber } from "@/utils/validate";
import local from "@/utils/local";
export default { export default {
components: { components: {
YSwitch, YSwitch,
...@@ -173,8 +174,8 @@ export default { ...@@ -173,8 +174,8 @@ export default {
labelCol: { span: 6 }, labelCol: { span: 6 },
wrapperCol: { span: 14 }, wrapperCol: { span: 14 },
siteInfo: { siteInfo: {
siteName: "", siteName: local.getLocal("siteName"), // 站点名称
siteId: "", siteId: local.getLocal("siteId"), // 站点id
}, },
form: { form: {
deptId: undefined, // 部门id deptId: undefined, // 部门id
...@@ -250,12 +251,6 @@ export default { ...@@ -250,12 +251,6 @@ export default {
// }); // });
}, },
methods: { methods: {
// 获取站点名称和id
getSiteInfo(info) {
this.siteInfo.siteName = info.label;
this.siteInfo.siteId = info.id;
},
// 部门下拉选项 // 部门下拉选项
handleChange(val, event) { handleChange(val, event) {
let { text } = event.componentOptions.children[0]; let { text } = event.componentOptions.children[0];
...@@ -288,8 +283,6 @@ export default { ...@@ -288,8 +283,6 @@ export default {
this.$parent.getWindowListData(); this.$parent.getWindowListData();
this.$message.success(msg); this.$message.success(msg);
this.handleClose(); this.handleClose();
} else {
this.$message.error(msg);
} }
} }
}); });
......
<template> <template>
<div class="department p15"> <div class="department">
<!-- 左边 -->
<div class="left ff">
<sitetree @getSite="handleClick" @clickArea="clickArea" />
</div>
<!-- 右边 --> <!-- 右边 -->
<div class="department_tab ff"> <div class="department_tab ff">
<!-- 部门管理 --> <!-- 部门管理 -->
<div class="department_left"> <div class="department_left">
<div class="department_on"> <div class="department_on">
<div class="department_manage">部门管理</div> <div class="department_manage">部门管理{{ deptTotal }}</div>
<a-button type="primary" @click="showModalAdd" class="department_add" <a-button type="primary" @click="showModalAdd" class="department_add"
>新增部门</a-button >新增部门</a-button
...@@ -24,7 +19,6 @@ ...@@ -24,7 +19,6 @@
/> />
</div> </div>
</div> </div>
<!-- 部门管理 --> <!-- 部门管理 -->
<div class="department-list"> <div class="department-list">
<div v-if="department.length"> <div v-if="department.length">
...@@ -77,6 +71,7 @@ ...@@ -77,6 +71,7 @@
<div class="ff window-box"> <div class="ff window-box">
<div class="department_right_add"> <div class="department_right_add">
<div>窗口管理</div> <div>窗口管理</div>
<div class="flex aic jcb">
<a-button type="primary" @click="addModal" class="department_btnadd" <a-button type="primary" @click="addModal" class="department_btnadd"
>新增窗口</a-button >新增窗口</a-button
> >
...@@ -89,6 +84,7 @@ ...@@ -89,6 +84,7 @@
@search="onSearchRight" @search="onSearchRight"
/> />
</div> </div>
</div>
<div class="department_right_tab"> <div class="department_right_tab">
<div class="table-content"> <div class="table-content">
<!-- 表格 --> <!-- 表格 -->
...@@ -215,11 +211,6 @@ ...@@ -215,11 +211,6 @@
@addDept="getDeptListData" @addDept="getDeptListData"
ref="adddepartment" ref="adddepartment"
></adddepartment> ></adddepartment>
<!-- 新增窗口事项弹窗 -->
<addWindowMatter
ref="addWindowMatter"
:isShow.sync="isShow"
></addWindowMatter>
<!-- 新增窗口弹窗 --> <!-- 新增窗口弹窗 -->
<addwindow <addwindow
:visibleAdd.sync="visibleAdd" :visibleAdd.sync="visibleAdd"
...@@ -232,11 +223,10 @@ ...@@ -232,11 +223,10 @@
<script> <script>
import { Empty } from "ant-design-vue"; import { Empty } from "ant-design-vue";
import sitetree from "@/components/sitetree/siteTree";
import adddepartment from "./components/adddepartment.vue"; import adddepartment from "./components/adddepartment.vue";
import addwindow from "./components/addwindow.vue"; import addwindow from "./components/addwindow.vue";
import addWindowMatter from "./components/addWindowMatter.vue";
import { getSiteBusinessList } from "@/services/business"; import { getSiteBusinessList } from "@/services/business";
import local from "@/utils/local";
import { import {
getDeptList, getDeptList,
delDept, delDept,
...@@ -291,6 +281,7 @@ const columns = [ ...@@ -291,6 +281,7 @@ const columns = [
}, },
{ {
title: "备注", title: "备注",
ellipsis: true,
scopedSlots: { scopedSlots: {
customRender: "summary", customRender: "summary",
}, },
...@@ -303,7 +294,7 @@ const columns = [ ...@@ -303,7 +294,7 @@ const columns = [
}, },
{ {
title: "操作", title: "操作",
width: "10%", width: "100px",
scopedSlots: { scopedSlots: {
customRender: "action", customRender: "action",
}, },
...@@ -312,19 +303,16 @@ const columns = [ ...@@ -312,19 +303,16 @@ const columns = [
export default { export default {
components: { components: {
sitetree,
adddepartment, adddepartment,
addwindow, addwindow,
addWindowMatter,
}, },
data() { data() {
return { return {
isShow: false,
loading: false, loading: false,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
title: "新增部门", title: "新增部门",
WindowTitle: "新增窗口", WindowTitle: "新增窗口",
siteId: "", // 站点id siteId: local.getLocal("siteId"), // 站点id
business: [], // 站点业务数据 business: [], // 站点业务数据
windowSearch: "", // 窗口搜索 windowSearch: "", // 窗口搜索
deptSearchVal: "", // 部门搜索 deptSearchVal: "", // 部门搜索
...@@ -342,6 +330,7 @@ export default { ...@@ -342,6 +330,7 @@ export default {
visibleWork: false, visibleWork: false,
visibleAdd: false, visibleAdd: false,
department: [], // 部门列表 department: [], // 部门列表
deptTotal: 0, // 部门总数
windowData: [], // 窗口列表数据 windowData: [], // 窗口列表数据
page: 1, page: 1,
size: 10, size: 10,
...@@ -375,23 +364,28 @@ export default { ...@@ -375,23 +364,28 @@ export default {
} }
}, },
}, },
methods: { // 进入路由前
handleClick(val) { beforeRouteEnter(to, from, next) {
Object.assign(this.$data, this.$options.data()); if (from.path === "/department/adddepartment") {
this.siteId = val.id; // 新增事项路由
this.getDeptListData({ siteId: val.id }); to.meta.isBack = true;
this.getWindowListData({ siteId: val.id }); } else {
this.getBusinessData({ siteId: val.id }); to.meta.isBack = false;
if (this.$refs.adddepartment) {
this.$refs.adddepartment.getSiteInfo(val);
}
if (this.$refs.addwindow) {
this.$refs.addwindow.getSiteInfo(val);
} }
next();
}, },
clickArea() { // 新增事项页面返回不刷新页面
Object.assign(this.$data, this.$options.data()); activated() {
if (!this.$route.meta.isBack) {
this.getDeptListData();
this.getBusinessData();
this.getWindowListData();
} else {
this.$route.meta.isBack = false;
}
}, },
created() {},
methods: {
// 去掉空children // 去掉空children
delChildren(arr) { delChildren(arr) {
return arr.map((v) => { return arr.map((v) => {
...@@ -414,6 +408,7 @@ export default { ...@@ -414,6 +408,7 @@ export default {
let { code, data } = res.data; let { code, data } = res.data;
if (code === 1) { if (code === 1) {
this.department = data.data; this.department = data.data;
this.deptTotal = data.total;
} }
}, },
// 获取站点业务数据 // 获取站点业务数据
...@@ -608,16 +603,12 @@ export default { ...@@ -608,16 +603,12 @@ export default {
}, },
// 新增窗口事项 // 新增窗口事项
addWindowMatter(data) { addWindowMatter(data) {
this.isShow = true; this.$router.push({
let obj = { path: "department/adddepartment",
query: {
windowId: data.id, windowId: data.id,
windowName: data.name, },
deptId: data.deptId, });
deptName: data.deptName,
siteId: data.siteId,
windowMatterList: data.windowMatterList,
};
this.$refs.addWindowMatter.getDeptInfo(obj);
}, },
}, },
}; };
...@@ -626,27 +617,10 @@ export default { ...@@ -626,27 +617,10 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.department { .department {
width: 100%; width: 100%;
height: 89vh;
position: relative;
display: flex;
.left {
width: 224px;
height: 100%; height: 100%;
}
.line {
width: 20px;
background-color: #f0f2f5;
margin-top: -20px;
position: relative; position: relative;
&::after { display: flex;
content: ""; background-color: #fff;
width: 17px;
height: 20px;
background-color: #f0f2f5;
position: absolute;
bottom: -20px;
}
}
.department_left { .department_left {
height: 85px; height: 85px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
...@@ -726,7 +700,6 @@ export default { ...@@ -726,7 +700,6 @@ export default {
border: 0; border: 0;
background-color: #0595fd; background-color: #0595fd;
margin-top: 10px; margin-top: 10px;
margin-right: 550px;
} }
.department_btnserch { .department_btnserch {
border: 0; border: 0;
...@@ -734,10 +707,11 @@ export default { ...@@ -734,10 +707,11 @@ export default {
margin-left: 10px; margin-left: 10px;
} }
.department_right_tab { .department_right_tab {
width: 1050px; margin-top: 20px;
} }
.department_right_table { .department_right_table {
font-size: 5px; font-size: 5px;
background-color: #fff;
} }
.edit { .edit {
color: rgb(41, 184, 41); color: rgb(41, 184, 41);
...@@ -757,16 +731,8 @@ export default { ...@@ -757,16 +731,8 @@ export default {
} }
.window-box { .window-box {
flex: 1; flex: 1;
padding-top: 10px; padding: 10px;
} }
// .ant-pagination {
// margin-top: 10px;
// margin-left: 10px;
// margin-right: 10px;
// }
// .table-content {
// height: 650px;
// }
.department-list { .department-list {
flex: 1; flex: 1;
padding-bottom: 10px; padding-bottom: 10px;
...@@ -776,10 +742,6 @@ export default { ...@@ -776,10 +742,6 @@ export default {
} }
} }
} }
// .ant-form-item {
// display: flex;
// align-items: center !important;
// }
.ant-checkbox-wrapper { .ant-checkbox-wrapper {
margin-left: 0px; margin-left: 0px;
margin-right: 10px; margin-right: 10px;
......
<template> <template>
<div class="festival festival"> <div class="festival festival">
<div class="main">
<!-- 左边站点树 -->
<div class="left">
<sitetree @getSite="handleClick" @clickArea="clickArea"></sitetree>
</div>
<!-- 右边表格 -->
<div class="right ff">
<div class="skins_bnt btn-box"> <div class="skins_bnt btn-box">
<!-- 新增按钮 --> <!-- 新增按钮 -->
<a-button type="primary" @click="showModal" class="skins_btn_1" <a-button type="primary" @click="showModal" class="skins_btn_1"
...@@ -74,21 +67,6 @@ ...@@ -74,21 +67,6 @@
</template> </template>
</a-table> </a-table>
</div> </div>
<!-- <div class="pagination" v-if="total">
<a-pagination
v-model="page"
:show-total="(total) => `共 ${total} 条`"
:total="total"
show-less-items
@change="changePagination"
show-size-changer
show-quick-jumper
:pageSizeOptions="pageSizeOptions"
@showSizeChange="showSizeChange"
/>
</div> -->
</div>
</div>
<!-- 弹窗 --> <!-- 弹窗 -->
<addfestivals <addfestivals
ref="addfestivals" ref="addfestivals"
...@@ -100,7 +78,7 @@ ...@@ -100,7 +78,7 @@
<script> <script>
import { getHolidayList, DelHoliday } from "@/services/festival"; import { getHolidayList, DelHoliday } from "@/services/festival";
import addfestivals from "./components/addfestivals.vue"; import addfestivals from "./components/addfestivals.vue";
import sitetree from "@/components/sitetree/siteTree"; import local from "@/utils/local";
const columns = [ const columns = [
{ {
title: "序号", title: "序号",
...@@ -155,7 +133,7 @@ export default { ...@@ -155,7 +133,7 @@ export default {
name: "festival", name: "festival",
components: { components: {
addfestivals, addfestivals,
sitetree, // sitetree,
}, },
data() { data() {
return { return {
...@@ -168,21 +146,13 @@ export default { ...@@ -168,21 +146,13 @@ export default {
total: 0, total: 0,
pageSizeOptions: ["10", "30", "50", "100"], pageSizeOptions: ["10", "30", "50", "100"],
year: "", year: "",
siteId: "", siteId: local.getLocal("siteId"),
}; };
}, },
created() {}, created() {
methods: {
// 选择站点
handleClick(val) {
Object.assign(this.$data, this.$options.data());
this.siteId = val.id;
this.getHolidayData(); this.getHolidayData();
}, },
// 点击区域 methods: {
clickArea() {
Object.assign(this.$data, this.$options.data());
},
// 获取节假日列表 // 获取节假日列表
async getHolidayData() { async getHolidayData() {
this.loading = true; this.loading = true;
...@@ -263,9 +233,9 @@ export default { ...@@ -263,9 +233,9 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.festival { .festival {
width: 100%; width: 100%;
.main {
height: 89vh;
padding: 20px; padding: 20px;
background-color: #fff;
.main {
display: flex; display: flex;
.left { .left {
width: 224px; width: 224px;
......
...@@ -18,11 +18,15 @@ export default { ...@@ -18,11 +18,15 @@ export default {
getToken() { getToken() {
let token = this.$route.query.token; let token = this.$route.query.token;
let userInfo = this.$route.query.userInfo; let userInfo = this.$route.query.userInfo;
let siteId = this.$route.query.siteid;
let siteName = this.$route.query.siteName;
if (token && userInfo) { if (token && userInfo) {
userInfo = JSON.parse(userInfo); userInfo = JSON.parse(userInfo);
local.setLocal("token", token); local.setLocal("token", token);
local.setLocal("baseUserInfo", userInfo); local.setLocal("baseUserInfo", userInfo);
this.$router.push("basicset/website"); local.setLocal("siteId", siteId);
local.setLocal("siteName", siteName);
this.$router.push("/website");
} else { } else {
this.$message.warning("跳转失败,请重新登录"); this.$message.warning("跳转失败,请重新登录");
setTimeout(() => { setTimeout(() => {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="main-right right ff"> <div class="main-right right ff">
<div class="right_box"> <div class="right_box">
<div v-if="siteData.length > 0"> <div v-if="siteData.length" class="rigth-content">
<div <div
v-show="active === index" v-show="active === index"
v-for="(item, index) in siteData" v-for="(item, index) in siteData"
...@@ -195,7 +195,16 @@ ...@@ -195,7 +195,16 @@
</div> </div>
</div> </div>
</div> </div>
<a-empty v-else description="暂无站点" /> <div v-else class="empty-show">
<a-empty description="暂无站点" />
<div class="btn_box" v-if="!siteData.length">
<div style="width: 200px">
<a-button block size="large" @click="addSiteAll"
>新增站点</a-button
>
</div>
</div>
</div>
<!-- 切换站点 --> <!-- 切换站点 -->
<!-- <div class="cut-btn"> <!-- <div class="cut-btn">
<div> <div>
...@@ -213,11 +222,6 @@ ...@@ -213,11 +222,6 @@
/> />
</div> </div>
</div> --> </div> -->
<div class="btn_box" v-if="!siteData.length">
<div style="width: 200px">
<a-button block size="large" @click="addSiteAll">新增站点</a-button>
</div>
</div>
</div> </div>
</div> </div>
...@@ -366,8 +370,8 @@ export default { ...@@ -366,8 +370,8 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.website { .website {
height: 100%;
display: flex; display: flex;
.line { .line {
width: 20px; width: 20px;
background-color: #f0f2f5; background-color: #f0f2f5;
...@@ -384,12 +388,19 @@ export default { ...@@ -384,12 +388,19 @@ export default {
} }
.right { .right {
width: 100%; width: 100%;
height: 100%;
color: #333; color: #333;
padding: 10px; padding: 10px;
height: calc(100vh - 160px); background-color: #fff;
overflow-y: auto;
.right_box { .right_box {
height: 100%;
padding-left: 20px; padding-left: 20px;
display: flex;
justify-content: center;
align-items: center;
.rigth-content {
height: 100%;
}
.cut-btn { .cut-btn {
margin-top: 30px; margin-top: 30px;
display: flex; display: flex;
...@@ -532,9 +543,6 @@ export default { ...@@ -532,9 +543,6 @@ export default {
.work-day { .work-day {
margin-right: 10px; margin-right: 10px;
} }
.main-right {
height: 810px !important;
}
.ant-empty { .ant-empty {
margin-top: 25%; margin-top: 25%;
......
<template> <template>
<div class="configurat"> <div class="configurat">
<div class="main">
<!-- 左边站点树 -->
<div class="left">
<sitetree @getSite="handleClick" @clickArea="clickArea"></sitetree>
</div>
<div class="right">
<div class="title">短信全局配置</div> <div class="title">短信全局配置</div>
<div class="set-configurat"> <div class="set-configurat">
<y-switch <y-switch
...@@ -16,38 +10,28 @@ ...@@ -16,38 +10,28 @@
></y-switch> ></y-switch>
</div> </div>
</div> </div>
</div>
</div>
</template> </template>
<script> <script>
import YSwitch from "@/components/yswitch/YSwitch.vue"; import YSwitch from "@/components/yswitch/YSwitch.vue";
import sitetree from "@/components/sitetree/siteTree";
import { getSmssetList, saveSmssetList } from "@/services/configurat"; import { getSmssetList, saveSmssetList } from "@/services/configurat";
import local from "@/utils/local";
export default { export default {
components: { components: {
YSwitch, YSwitch,
sitetree,
}, },
data() { data() {
return { return {
setInfo: { setInfo: {
siteId: "", siteId: local.getLocal("siteId"),
messageoff: "", messageoff: "",
}, },
}; };
}, },
methods: { created() {
// 选择站点
handleClick(val) {
this.setInfo.siteId = val.id;
this.getSmssetList();
},
// 点击区域
clickArea() {
this.setInfo.siteId = "";
this.getSmssetList(); this.getSmssetList();
}, },
methods: {
// 获取站点短信设置 // 获取站点短信设置
async getSmssetList() { async getSmssetList() {
let res = await getSmssetList({ let res = await getSmssetList({
...@@ -58,7 +42,6 @@ export default { ...@@ -58,7 +42,6 @@ export default {
let { data } = res.data.data; let { data } = res.data.data;
if (data.length) { if (data.length) {
this.setInfo = data[0]; this.setInfo = data[0];
console.log(this.setInfo);
} else { } else {
this.setInfo.messageoff = ""; this.setInfo.messageoff = "";
this.setInfo.id && this.$delete(this.setInfo, "id"); this.setInfo.id && this.$delete(this.setInfo, "id");
...@@ -66,13 +49,10 @@ export default { ...@@ -66,13 +49,10 @@ export default {
}, },
// 开关 // 开关
async changeClose() { async changeClose() {
console.log(this.setInfo);
let res = await saveSmssetList(this.setInfo); let res = await saveSmssetList(this.setInfo);
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.$message.error(msg);
} }
}, },
}, },
...@@ -82,8 +62,8 @@ export default { ...@@ -82,8 +62,8 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.configurat { .configurat {
width: 100%; width: 100%;
height: 89vh; height: 100%;
padding: 15px; padding: 20px;
.main { .main {
height: 100%; height: 100%;
display: flex; display: flex;
......
...@@ -9,4 +9,8 @@ export default {}; ...@@ -9,4 +9,8 @@ export default {};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.index {
width: 100%;
background-color: #fff;
}
</style> </style>
\ No newline at end of file
...@@ -121,6 +121,7 @@ export default { ...@@ -121,6 +121,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.surface { .surface {
padding: 15px; padding: 15px;
background-color: #fff;
.container { .container {
width: 100%; width: 100%;
position: relative; position: relative;
...@@ -129,7 +130,6 @@ export default { ...@@ -129,7 +130,6 @@ export default {
border-top: 1px solid rgb(224, 224, 224); border-top: 1px solid rgb(224, 224, 224);
background-color: #fff; background-color: #fff;
display: flex; display: flex;
height: 79vh;
.menu-box { .menu-box {
width: 20%; width: 20%;
padding: 15px; padding: 15px;
......
...@@ -145,6 +145,13 @@ ...@@ -145,6 +145,13 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="身份证" prop="idCard">
<a-input v-model="form.idCard" placeholder="请输入身份证号码" />
</a-form-model-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col :span="20"> <a-col :span="20">
<a-form-model-item <a-form-model-item
...@@ -301,6 +308,19 @@ export default { ...@@ -301,6 +308,19 @@ export default {
}, },
}, },
data() { data() {
const checkIdCard = (rule, value, callback) => {
if (!value) {
callback();
} else if (
!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test(
value
)
) {
callback(new Error("身份证格式不正确"));
} else {
callback();
}
};
return { return {
api: process.env.VUE_APP_API_BASE_URL.includes("base") api: process.env.VUE_APP_API_BASE_URL.includes("base")
? process.env.VUE_APP_API_BASE_URL.replace("base", "") ? process.env.VUE_APP_API_BASE_URL.replace("base", "")
...@@ -327,6 +347,7 @@ export default { ...@@ -327,6 +347,7 @@ export default {
siteId: "", // 站点id siteId: "", // 站点id
name: "", // 姓名 name: "", // 姓名
number: "", // 工号 number: "", // 工号
idCard: "", // 身份证
userpost: "", // 职务 userpost: "", // 职务
posttitle: "", // 职称 posttitle: "", // 职称
politicalstatus: undefined, // 政治面貌 politicalstatus: undefined, // 政治面貌
...@@ -358,6 +379,7 @@ export default { ...@@ -358,6 +379,7 @@ export default {
phone: [ phone: [
{ required: false, validator: changeLandline, trigger: "blur" }, { required: false, validator: changeLandline, trigger: "blur" },
], ],
idCard: [{ required: false, validator: checkIdCard, trigger: "blur" }],
}, },
windowData: [], // 部门窗口信息 windowData: [], // 部门窗口信息
}; };
...@@ -483,7 +505,7 @@ export default { ...@@ -483,7 +505,7 @@ export default {
object-fit: cover; object-fit: cover;
} }
/deep/.ant-form-item { /deep/.ant-form-item {
margin-bottom: 10px; margin-bottom: 15px;
} }
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
......
...@@ -150,6 +150,13 @@ ...@@ -150,6 +150,13 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row>
<a-col :span="12">
<a-form-model-item label="身份证" prop="idCard">
<a-input v-model="form.idCard" placeholder="请输入身份证号码" />
</a-form-model-item>
</a-col>
</a-row>
<a-row> <a-row>
<a-col :span="20"> <a-col :span="20">
<a-form-model-item <a-form-model-item
...@@ -287,7 +294,11 @@ ...@@ -287,7 +294,11 @@
:wrapper-col="{ span: 19 }" :wrapper-col="{ span: 19 }"
label="办理事项" label="办理事项"
> >
<a-input v-model="form.business" type="textarea" /> <a-input
v-model="form.business"
placeholder="请输入办理事项"
type="textarea"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -298,7 +309,11 @@ ...@@ -298,7 +309,11 @@
:wrapper-col="{ span: 19 }" :wrapper-col="{ span: 19 }"
label="岗位职责" label="岗位职责"
> >
<a-input v-model="form.duty" type="textarea" /> <a-input
v-model="form.duty"
placeholder="请输入岗位职责"
type="textarea"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -309,7 +324,11 @@ ...@@ -309,7 +324,11 @@
:wrapper-col="{ span: 19 }" :wrapper-col="{ span: 19 }"
label="服务承诺" label="服务承诺"
> >
<a-input v-model="form.promise" type="textarea" /> <a-input
v-model="form.promise"
placeholder="请输入服务承诺"
type="textarea"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -322,6 +341,7 @@ import { changeAccount, changePassWord } from "@/utils/validate"; ...@@ -322,6 +341,7 @@ import { changeAccount, changePassWord } from "@/utils/validate";
import { getWindowList, saveWorkman, uploadFile } from "@/services/dept"; import { getWindowList, saveWorkman, uploadFile } from "@/services/dept";
import { modelList } from "@/services/basicsetFun"; import { modelList } from "@/services/basicsetFun";
import { changePhone, changeLandline } from "@/utils/validate"; import { changePhone, changeLandline } from "@/utils/validate";
import local from "@/utils/local";
export default { export default {
props: { props: {
visibleAll: { visibleAll: {
...@@ -350,6 +370,19 @@ export default { ...@@ -350,6 +370,19 @@ export default {
}, },
}, },
data() { data() {
const checkIdCard = (rule, value, callback) => {
if (!value) {
callback();
} else if (
!/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/.test(
value
)
) {
callback(new Error("身份证格式不正确"));
} else {
callback();
}
};
return { return {
api: process.env.VUE_APP_API_BASE_URL.includes("base") api: process.env.VUE_APP_API_BASE_URL.includes("base")
? process.env.VUE_APP_API_BASE_URL.replace("base", "") ? process.env.VUE_APP_API_BASE_URL.replace("base", "")
...@@ -363,8 +396,8 @@ export default { ...@@ -363,8 +396,8 @@ export default {
modelIds: [], // 模块 modelIds: [], // 模块
siteInfo: { siteInfo: {
//站点信息 //站点信息
siteId: "", siteId: local.getLocal("siteId"),
siteName: "", siteName: local.getLocal("siteName"),
}, },
form: { form: {
loginName: "", // 用户名 loginName: "", // 用户名
...@@ -378,6 +411,7 @@ export default { ...@@ -378,6 +411,7 @@ export default {
siteId: "", // 站点id siteId: "", // 站点id
name: "", // 姓名 name: "", // 姓名
number: "", // 工号 number: "", // 工号
idCard: "", // 身份证
userpost: "", // 职务 userpost: "", // 职务
posttitle: "", // 职称 posttitle: "", // 职称
politicalstatus: undefined, // 政治面貌 politicalstatus: undefined, // 政治面貌
...@@ -415,6 +449,7 @@ export default { ...@@ -415,6 +449,7 @@ export default {
phone: [ phone: [
{ required: false, validator: changeLandline, trigger: "blur" }, { required: false, validator: changeLandline, trigger: "blur" },
], ],
idCard: [{ required: false, validator: checkIdCard, trigger: "blur" }],
}, },
windowData: [], // 部门窗口信息 windowData: [], // 部门窗口信息
}; };
...@@ -433,17 +468,11 @@ export default { ...@@ -433,17 +468,11 @@ export default {
this.getModelList(); this.getModelList();
}, },
methods: { methods: {
// 获取站点信息
getSiteInfo(info) {
this.siteInfo.siteId = info.id;
this.siteInfo.siteName = info.label;
},
// 获取模块 // 获取模块
async getModelList() { async getModelList() {
let res = await modelList({ page: 1, size: -1 }); let res = await modelList({ page: 1, size: -1 });
this.modelIds = res.data.data.data; this.modelIds = res.data.data.data;
}, },
// 部门选择 // 部门选择
async handleDeptSelect(val, node) { async handleDeptSelect(val, node) {
this.form.windowId = undefined; this.form.windowId = undefined;
...@@ -548,7 +577,7 @@ export default { ...@@ -548,7 +577,7 @@ export default {
object-fit: cover; object-fit: cover;
} }
/deep/.ant-form-item { /deep/.ant-form-item {
margin-bottom: 10px; margin-bottom: 15px;
} }
/deep/.ant-form-explain { /deep/.ant-form-explain {
position: absolute; position: absolute;
......
<template> <template>
<div class="website p15"> <div class="website">
<!-- 左边 -->
<div class="left ff">
<sitetree @getSite="handleClick" @clickArea="clickArea" />
</div>
<!-- 中间空白 -->
<div class="line"></div>
<!-- 右边 --> <!-- 右边 -->
<div class="right ff" style="overflow: -Scroll"> <div class="right ff">
<div class="person_message">工作人员管理</div> <div class="person_message">工作人员管理</div>
<div class="person_chang"> <div class="person_chang">
<div class="person_gruop">选择部门:</div> <div class="person_gruop">选择部门:</div>
...@@ -41,9 +35,7 @@ ...@@ -41,9 +35,7 @@
</div> </div>
<div class="on btn"> <div class="on btn">
<div> <div>
<a-button type="primary" @click="showModal" class="skins_btn_1" <a-button type="primary" @click="showModal">新增人员</a-button>
>新增人员</a-button
>
<a-dropdown> <a-dropdown>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1"> <a-menu-item key="1">
...@@ -163,9 +155,9 @@ ...@@ -163,9 +155,9 @@
<script> <script>
import addpersonnel from "./components/addpersonnel.vue"; import addpersonnel from "./components/addpersonnel.vue";
import sitetree from "@/components/sitetree/siteTree";
import EditPwd from "./components/EditPwd"; import EditPwd from "./components/EditPwd";
import EditPersonel from "./components/EditPersonel.vue"; import EditPersonel from "./components/EditPersonel.vue";
import local from "@/utils/local";
// import axios from "axios"; // import axios from "axios";
import { import {
getDeptList, getDeptList,
...@@ -246,7 +238,6 @@ const columns = [ ...@@ -246,7 +238,6 @@ const columns = [
]; ];
export default { export default {
components: { components: {
sitetree,
addpersonnel, addpersonnel,
EditPwd, EditPwd,
EditPersonel, EditPersonel,
...@@ -260,7 +251,7 @@ export default { ...@@ -260,7 +251,7 @@ export default {
api: process.env.VUE_APP_API_BASE_URL.includes("base") api: process.env.VUE_APP_API_BASE_URL.includes("base")
? process.env.VUE_APP_API_BASE_URL.replace("base", "") ? process.env.VUE_APP_API_BASE_URL.replace("base", "")
: process.env.VUE_APP_API_BASE_URL, : process.env.VUE_APP_API_BASE_URL,
siteId: "", siteId: local.getLocal("siteId"),
deptData: [], // 部门数据 deptData: [], // 部门数据
windowData: [], // 窗口数据 windowData: [], // 窗口数据
WorkmanData: [], // 工作人员列表 WorkmanData: [], // 工作人员列表
...@@ -275,19 +266,12 @@ export default { ...@@ -275,19 +266,12 @@ export default {
politicalDict: {}, // 政治面貌字典 politicalDict: {}, // 政治面貌字典
}; };
}, },
created() {}, created() {
methods: { this.getDeptList();
handleClick(val) { this.getWindowData();
Object.assign(this.$data, this.$options.data()); this.getWorkmanData();
this.siteId = val.id;
this.getDeptList({ siteId: val.id });
this.getWindowData({ siteId: val.id });
this.getWorkmanData({ siteId: val.id });
this.$refs.addpersonnel.getSiteInfo(val);
},
clickArea() {
Object.assign(this.$data, this.$options.data());
}, },
methods: {
// 获取部门 // 获取部门
async getDeptList(obj = {}) { async getDeptList(obj = {}) {
let res = await getDeptList({ let res = await getDeptList({
...@@ -486,32 +470,11 @@ export default { ...@@ -486,32 +470,11 @@ export default {
border-color: rgba(5, 149, 253, 1); border-color: rgba(5, 149, 253, 1);
} }
.website { .website {
display: flex;
height: 89vh;
.left {
width: 224px;
height: 100%;
}
.line {
width: 20px;
background-color: #f0f2f5;
margin-top: -20px;
position: relative;
&::after {
content: "";
width: 17px;
height: 20px;
background-color: #f0f2f5;
position: absolute;
bottom: -20px;
}
}
.right { .right {
width: 100%; width: 100%;
padding-right: 20px; padding-right: 20px;
padding-top: 10px; padding-top: 10px;
color: #333; color: #333;
overflow-y: auto;
padding-left: 20px; padding-left: 20px;
.person_message { .person_message {
font-weight: 600; font-weight: 600;
......
import TabsView from "@/layouts/tabs/TabsView"; // import TabsView from "@/layouts/tabs/TabsView";
import BlankView from "@/layouts/BlankView"; // import BlankView from "@/layouts/BlankView";
import Layouts from "@/layouts/Layouts";
// import PageView from '@/layouts/PageView' // import PageView from '@/layouts/PageView'
// 路由配置 // 路由配置
...@@ -28,40 +29,31 @@ const options = { ...@@ -28,40 +29,31 @@ const options = {
{ {
path: "/", path: "/",
name: "首页", name: "首页",
component: TabsView, component: Layouts,
redirect: "/jump", redirect: "/website",
children: [ children: [
{
path: "basicset",
name: "基础设置",
meta: {
icon: "setting",
},
component: BlankView,
children: [
// {
// path: 'user',
// name: '用户管理',
// component: () => import('@/pages/basicset/user/list'),
// },
// {
// path: 'menu',
// name: '菜单管理',
// component: () => import('@/pages/basicset/menu/list'),
// },
{ {
path: "website", path: "website",
name: "站点管理", name: "站点管理",
meta: {
icon: "bank",
},
component: () => import("@/pages/basicset/site/website"), component: () => import("@/pages/basicset/site/website"),
}, },
{ {
path: "deploy", path: "deploy",
name: "部署模块管理", name: "部署模块管理",
meta: {
icon: "appstore",
},
component: () => import("@/pages/basicset/deploy/deploy"), component: () => import("@/pages/basicset/deploy/deploy"),
}, },
{ {
path: "business", path: "business",
name: "业务事项管理", name: "业务事项管理",
meta: {
icon: "book",
},
component: () => import("@/pages/basicset/business/business"), component: () => import("@/pages/basicset/business/business"),
}, },
{ {
...@@ -74,17 +66,41 @@ const options = { ...@@ -74,17 +66,41 @@ const options = {
{ {
path: "department", path: "department",
meta: {
icon: "audit",
},
component: () => import("@/pages/basicset/dept/Index"),
children: [
{
path: "",
name: "部门窗口管理", name: "部门窗口管理",
component: () => import("@/pages/basicset/dept/department"), component: () => import("@/pages/basicset/dept/department"),
meta: { invisible: true, keepAlive: true },
},
{
path: "adddepartment",
name: "新增窗口事项",
meta: {
invisible: true,
},
component: () => import("@/pages/basicset/dept/addWindowMatter"),
},
],
}, },
{ {
path: "personnel", path: "personnel",
name: "工作人员管理", name: "工作人员管理",
meta: {
icon: "idcard",
},
component: () => import("@/pages/basicset/workman/personnel"), component: () => import("@/pages/basicset/workman/personnel"),
}, },
{ {
path: "surface", path: "surface",
component: () => import("@/pages/basicset/surface/index"), component: () => import("@/pages/basicset/surface/index"),
meta: {
icon: "skin",
},
children: [ children: [
{ {
path: "", path: "",
...@@ -104,45 +120,142 @@ const options = { ...@@ -104,45 +120,142 @@ const options = {
{ {
path: "configurat", path: "configurat",
name: "短信配置", name: "短信配置",
meta: {
icon: "mail",
},
component: () => import("@/pages/basicset/sms/configurat"), component: () => import("@/pages/basicset/sms/configurat"),
}, },
{ {
path: "festival", path: "festival",
name: "节假日配置", name: "节假日配置",
meta: {
icon: "carry-out",
},
component: () => import("@/pages/basicset/holiday/festival"), component: () => import("@/pages/basicset/holiday/festival"),
}, },
{ {
path: "appmarket", path: "appmarket",
component: () => import("@/pages/basicset/appmarket/Index"), component: () => import("@/pages/basicset/appmarket/Index"),
meta: {
icon: "shop",
},
children: [ children: [
{ {
path: "", path: "",
name: "应用集市", name: "应用集市",
component: () => component: () => import("@/pages/basicset/appmarket/AppMarket"),
import("@/pages/basicset/appmarket/AppMarket"),
meta: { invisible: true }, meta: { invisible: true },
}, },
{ {
path: "appdetails", path: "appdetails",
name: "应用详情", name: "应用详情",
component: () => component: () => import("@/pages/basicset/appmarket/AppDetails"),
import("@/pages/basicset/appmarket/AppDetails"),
meta: { invisible: true }, meta: { invisible: true },
}, },
], ],
}, },
// { // {
// path: 'qrcode', // path: "basicset",
// name: '二维码设置', // name: "基础设置",
// component: () => import('@/pages/basicset/qrcode'), // meta: {
// icon: "setting",
// }, // },
// component: BlankView,
// children: [
// { // {
// path: 'skins', // path: "website",
// name: '皮肤管理', // name: "站点管理",
// component: () => import('@/pages/basicset/skins/skins'), // component: () => import("@/pages/basicset/site/website"),
// },
// {
// path: "deploy",
// name: "部署模块管理",
// component: () => import("@/pages/basicset/deploy/deploy"),
// },
// {
// path: "business",
// name: "业务事项管理",
// component: () => import("@/pages/basicset/business/business"),
// },
// {
// path: "addbusiness",
// name: "新增事项",
// component: () =>
// import("@/pages/basicset/addbusiness/addbusiness.vue"),
// meta: { invisible: true },
// },
// {
// path: "department",
// name: "部门窗口管理",
// component: () => import("@/pages/basicset/dept/department"),
// },
// {
// path: "personnel",
// name: "工作人员管理",
// component: () => import("@/pages/basicset/workman/personnel"),
// },
// {
// path: "surface",
// component: () => import("@/pages/basicset/surface/index"),
// children: [
// {
// path: "",
// name: "皮肤管理",
// component: () => import("@/pages/basicset/surface/surface"),
// meta: { invisible: true },
// },
// {
// path: "addsurfacetemplate",
// name: "新增皮肤m模板",
// component: () =>
// import("@/pages/basicset/surface/AddSurfaceTemplate"),
// meta: { invisible: true },
// },
// ],
// },
// {
// path: "configurat",
// name: "短信配置",
// component: () => import("@/pages/basicset/sms/configurat"),
// },
// {
// path: "festival",
// name: "节假日配置",
// component: () => import("@/pages/basicset/holiday/festival"),
// },
// {
// path: "appmarket",
// component: () => import("@/pages/basicset/appmarket/Index"),
// children: [
// {
// path: "",
// name: "应用集市",
// component: () =>
// import("@/pages/basicset/appmarket/AppMarket"),
// meta: { invisible: true },
// },
// {
// path: "appdetails",
// name: "应用详情",
// component: () =>
// import("@/pages/basicset/appmarket/AppDetails"),
// meta: { invisible: true },
// },
// ],
// },
// // {
// // path: 'qrcode',
// // name: '二维码设置',
// // component: () => import('@/pages/basicset/qrcode'),
// // },
// // {
// // path: 'skins',
// // name: '皮肤管理',
// // component: () => import('@/pages/basicset/skins/skins'),
// // },
// ],
// }, // },
],
},
], ],
}, },
], ],
......
import { import {
dept,window,workman,windowbusiness,windowmatter,upload dept,
} from '@/services/basicsetApi' window,
workman,
windowbusiness,
windowmatter,
upload,
} from "@/services/basicsetApi";
import {request, METHOD} from '@/utils/request' import { request, METHOD } from "@/utils/request";
/** /**
* 部门 * 部门
*/ */
// 查询部门列表 // 查询部门列表
export async function getDeptList(data) { export async function getDeptList(data) {
return request(dept.list, METHOD.POST, data) return request(dept.list, METHOD.POST, data);
} }
// 编辑部门 // 编辑部门
export async function editDept(data) { export async function editDept(data) {
return request(dept.edit, METHOD.GET, data) return request(dept.edit, METHOD.GET, data);
} }
// 新增部门 // 新增部门
export async function saveDept(data) { export async function saveDept(data) {
return request(dept.save, METHOD.POST, data) return request(dept.save, METHOD.POST, data);
} }
// 删除部门 // 删除部门
export async function delDept(data) { export async function delDept(data) {
return request(dept.delete, METHOD.GET, data) return request(dept.delete, METHOD.GET, data);
} }
/** /**
* 窗口 * 窗口
*/ */
// 窗口列表 // 窗口列表
export async function getWindowList(data) { export async function getWindowList(data) {
return request(window.list, METHOD.POST, data) return request(window.list, METHOD.POST, data);
}
// 查看窗口信息
export async function getWindowInfo(data) {
return request(window.info, METHOD.GET, data);
} }
// 新增窗口 // 新增窗口
export async function addWindow(data) { export async function addWindow(data) {
return request(window.save, METHOD.POST, data) return request(window.save, METHOD.POST, data);
} }
// 删除窗口 // 删除窗口
export async function delWindow(data) { export async function delWindow(data) {
return request(window.delete, METHOD.GET, data) return request(window.delete, METHOD.GET, data);
} }
/** /**
...@@ -44,11 +53,11 @@ export async function delWindow(data) { ...@@ -44,11 +53,11 @@ export async function delWindow(data) {
*/ */
// 保存窗口业务 // 保存窗口业务
export async function addWindowBusiness(data) { export async function addWindowBusiness(data) {
return request(windowbusiness.save, METHOD.POST, data) return request(windowbusiness.save, METHOD.POST, data);
} }
// 窗口关联业务 // 窗口关联业务
export async function addBusinessToWindow(data) { export async function addBusinessToWindow(data) {
return request(windowbusiness.addBusinessToWindow , METHOD.POST, data) return request(windowbusiness.addBusinessToWindow, METHOD.POST, data);
} }
/** /**
...@@ -56,37 +65,37 @@ export async function addBusinessToWindow(data) { ...@@ -56,37 +65,37 @@ export async function addBusinessToWindow(data) {
*/ */
// 窗口工作人员列表 // 窗口工作人员列表
export async function getWorkmanList(data) { export async function getWorkmanList(data) {
return request(workman.list, METHOD.POST, data) return request(workman.list, METHOD.POST, data);
} }
// 新增工作人员 // 新增工作人员
export async function saveWorkman(data) { export async function saveWorkman(data) {
return request(workman.save, METHOD.POST, data) return request(workman.save, METHOD.POST, data);
} }
// 删除工作人员 // 删除工作人员
export async function delWorkman(data) { export async function delWorkman(data) {
return request(workman.delete, METHOD.GET, data) return request(workman.delete, METHOD.GET, data);
} }
// 编辑工作人员 // 编辑工作人员
export async function editWorkman(data) { export async function editWorkman(data) {
return request(workman.edit, METHOD.GET, data) return request(workman.edit, METHOD.GET, data);
} }
// 导出工作人员模板 // 导出工作人员模板
export async function downLoadTemplate(data,config) { export async function downLoadTemplate(data, config) {
return request(workman.downloadTemplate, METHOD.POST, data,config) return request(workman.downloadTemplate, METHOD.POST, data, config);
} }
// 批量导入工作人员 // 批量导入工作人员
export async function importData(data,config) { export async function importData(data, config) {
return request(workman.importData, METHOD.POST, data,config) return request(workman.importData, METHOD.POST, data, config);
} }
// 上传附件 // 上传附件
export async function uploadFile(data) { export async function uploadFile(data) {
return request(upload.file, METHOD.POST, data) return request(upload.file, METHOD.POST, data);
} }
// 工作人员修改密码 // 工作人员修改密码
export function changePwd(data) { export function changePwd(data) {
return request(workman.changePwd, METHOD.POST, data) return request(workman.changePwd, METHOD.POST, data);
} }
/** /**
...@@ -94,13 +103,13 @@ export function changePwd(data) { ...@@ -94,13 +103,13 @@ export function changePwd(data) {
*/ */
// 新增窗口事项 // 新增窗口事项
export async function saveWindowmatter(data) { export async function saveWindowmatter(data) {
return request(windowmatter.save, METHOD.POST, data) return request(windowmatter.save, METHOD.POST, data);
} }
// 获取窗口事项列表 // 获取窗口事项列表
export async function getWindowmatterList(data) { export async function getWindowmatterList(data) {
return request(windowmatter.list, METHOD.POST, data) return request(windowmatter.list, METHOD.POST, data);
} }
// 删除窗口事项 // 删除窗口事项
export async function delWindowmatter(data) { export async function delWindowmatter(data) {
return request(windowmatter.delete, METHOD.GET, data) return request(windowmatter.delete, METHOD.GET, data);
} }
...@@ -5,13 +5,19 @@ ...@@ -5,13 +5,19 @@
* @returns {boolean|*} * @returns {boolean|*}
*/ */
function hasPermission(authority, permissions) { function hasPermission(authority, permissions) {
let required = '*' let required = "*";
if (typeof authority === 'string') { if (typeof authority === "string") {
required = authority required = authority;
} else if (typeof authority === 'object') { } else if (typeof authority === "object") {
required = authority.permission required = authority.permission;
} }
return required === '*' || (permissions && permissions.findIndex(item => item === required || item.id === required) !== -1) return (
required === "*" ||
(permissions &&
permissions.findIndex(
(item) => item === required || item.id === required
) !== -1)
);
} }
/** /**
...@@ -20,11 +26,11 @@ function hasPermission(authority, permissions) { ...@@ -20,11 +26,11 @@ function hasPermission(authority, permissions) {
* @param roles 用户角色集合 * @param roles 用户角色集合
*/ */
function hasRole(authority, roles) { function hasRole(authority, roles) {
let required = undefined let required = undefined;
if (typeof authority === 'object') { if (typeof authority === "object") {
required = authority.role required = authority.role;
} }
return authority === '*' || hasAnyRole(required, roles) return authority === "*" || hasAnyRole(required, roles);
} }
/** /**
...@@ -35,13 +41,20 @@ function hasRole(authority, roles) { ...@@ -35,13 +41,20 @@ function hasRole(authority, roles) {
*/ */
function hasAnyRole(required, roles) { function hasAnyRole(required, roles) {
if (!required) { if (!required) {
return false return false;
} else if(Array.isArray(required)) { } else if (Array.isArray(required)) {
return roles.findIndex(role => { return (
return required.findIndex(item => item === role || item === role.id) !== -1 roles.findIndex((role) => {
return (
required.findIndex((item) => item === role || item === role.id) !== -1
);
}) !== -1 }) !== -1
);
} else { } else {
return roles.findIndex(role => role === required || role.id === required) !== -1 return (
roles.findIndex((role) => role === required || role.id === required) !==
-1
);
} }
} }
...@@ -53,13 +66,13 @@ function hasAnyRole(required, roles) { ...@@ -53,13 +66,13 @@ function hasAnyRole(required, roles) {
* @returns {boolean} * @returns {boolean}
*/ */
function hasAuthority(route, permissions, roles) { function hasAuthority(route, permissions, roles) {
const authorities = [...route.meta.pAuthorities, route.meta.authority] const authorities = [...route.meta.pAuthorities, route.meta.authority];
for (let authority of authorities) { for (let authority of authorities) {
if (!hasPermission(authority, permissions) && !hasRole(authority, roles)) { if (!hasPermission(authority, permissions) && !hasRole(authority, roles)) {
return false return false;
} }
} }
return true return true;
} }
/** /**
...@@ -69,17 +82,17 @@ function hasAuthority(route, permissions, roles) { ...@@ -69,17 +82,17 @@ function hasAuthority(route, permissions, roles) {
* @param roles * @param roles
*/ */
function filterMenu(menuData, permissions, roles) { function filterMenu(menuData, permissions, roles) {
return menuData.filter(menu => { return menuData.filter((menu) => {
if (menu.meta && menu.meta.invisible === undefined) { if (menu.meta && menu.meta.invisible === undefined) {
if (!hasAuthority(menu, permissions, roles)) { if (!hasAuthority(menu, permissions, roles)) {
return false return false;
} }
} }
if (menu.children && menu.children.length > 0) { if (menu.children && menu.children.length > 0) {
menu.children = filterMenu(menu.children, permissions, roles) menu.children = filterMenu(menu.children, permissions, roles);
} }
return true return true;
}) });
} }
export {filterMenu, hasAuthority} export { filterMenu, hasAuthority };
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