Commit 0fbb4330 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents d79f9757 aa232724
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
"core-js": "^3.6.5", "core-js": "^3.6.5",
"date-fns": "^2.14.0", "date-fns": "^2.14.0",
"echarts": "^5.2.2", "echarts": "^5.2.2",
"element-china-area-data": "^5.0.2",
"enquire.js": "^2.1.6", "enquire.js": "^2.1.6",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"highlight.js": "^10.2.1", "highlight.js": "^10.2.1",
......
<!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:启用 //动画设置
name: 'bounce', //动画效果,支持的动画效果可参考 ./animate.config.js disabled: true, //禁用动画,true:禁用,false:启用
direction: 'left' //动画方向,切换页面时动画的方向,参考 ./animate.config.js name: "bounce", //动画效果,支持的动画效果可参考 ./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; },
} else { // 选中
this.$message.error(`站点错误:${msg}`); 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 {
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;
}
},
// 更新选中
updataSite(row) {
const { id } = row;
this.checkid = undefined;
let index = this.checkarr.findIndex((v) => v.id == id);
this.checkarr.length = index + 1;
this.sitelist = row.children;
if (row && row.type == "site") {
this.isSite = false;
} else {
this.isSite = true;
}
// this.getwaitedListdata(id);
}, },
clickSite(siteid, site_name) { getwaitedListdata() {
waitedSavesite({ siteid: siteid }).then((res) => { getSiteTree().then((res) => {
const { code, data, msg } = res.data; const { code, data } = res.data;
if (code == 0) { if (code == 1) {
let user = JSON.parse( const { siteTree } = data;
localStorage.getItem(process.env.VUE_APP_USER_KEY) this.sitelist = siteTree;
); let arr = [];
user.siteid = siteid; const treeFn = function (e) {
user.site_name = site_name; e.forEach((element) => {
this.setUser(user); arr.push(element);
// setAuthorization(data); if (element.children && element.children.length > 0) {
} else { treeFn(element.children);
this.$message.error(msg); }
});
};
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 {
color: #fff;
padding: 0 20px; padding: 0 20px;
font-size: 14px;
min-width: 200px;
display: inline-block;
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;
}
.check-site {
cursor: pointer;
}
} }
</style> </style>
\ No newline at end of file
...@@ -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
...@@ -3,14 +3,37 @@ ...@@ -3,14 +3,37 @@
<!-- 头部 --> <!-- 头部 -->
<div class="header flex aic jcb mb20"> <div class="header flex aic jcb mb20">
<a-button type="primary" @click="handleAdd">新增</a-button> <a-button type="primary" @click="handleAdd">新增</a-button>
<!-- <a-input-search <div class="search-box">
style="width: 300px" <a-input-group compact>
placeholder="请输入标题关键字搜索" <a-select style="min-width: 100px" v-model="fieldCode">
enter-button="搜索" <a-select-option value=""> 全部 </a-select-option>
v-model="searchVal" <a-select-option
allowClear v-for="v in appTemplate"
@search="onSearch" :key="v.id"
/> --> :value="v.fieldCode"
>
{{ v.fieldName }}
</a-select-option>
</a-select>
<a-input-search
style="width: 300px"
placeholder="请输入关键字搜索"
enter-button="搜索"
v-model="searchVal"
allowClear
@search="onSearch"
/>
<!-- <a-input style="width: 50%" default-value="Xihu District, Hangzhou" /> -->
</a-input-group>
<!-- <a-input-search
style="width: 300px"
placeholder="请输入标题关键字搜索"
enter-button="搜索"
v-model="searchVal"
allowClear
@search="onSearch"
/> -->
</div>
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<div class="table-content"> <div class="table-content">
...@@ -86,6 +109,7 @@ export default { ...@@ -86,6 +109,7 @@ export default {
tableData: [], tableData: [],
AddVisible: false, AddVisible: false,
title: "", title: "",
fieldCode: "",
}; };
}, },
computed: { computed: {
...@@ -119,6 +143,7 @@ export default { ...@@ -119,6 +143,7 @@ export default {
}, },
created() { created() {
this.getDatasetList(); this.getDatasetList();
console.log(this.appTemplate);
}, },
methods: { methods: {
// 获取数据列表 // 获取数据列表
...@@ -128,6 +153,8 @@ export default { ...@@ -128,6 +153,8 @@ export default {
page: this.current, page: this.current,
size: this.size, size: this.size,
appId: this.appId, appId: this.appId,
fieldCode: this.fieldCode,
fieldValue: this.searchVal,
}); });
this.loading = false; this.loading = false;
if (res.data.code === 1) { if (res.data.code === 1) {
...@@ -208,4 +235,8 @@ export default { ...@@ -208,4 +235,8 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-input-group {
display: flex;
justify-content: flex-end;
}
</style> </style>
\ No newline at end of file
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
showTotal: (total) => `共 ${total} 条`, showTotal: (total) => `共 ${total} 条`,
current: current, current: current,
total: total, total: total,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange, onChange: handleChange,
onShowSizeChange: showSizeChange, onShowSizeChange: showSizeChange,
}" }"
...@@ -33,9 +30,7 @@ ...@@ -33,9 +30,7 @@
:rowKey="(record) => record.id" :rowKey="(record) => record.id"
> >
<!-- 序号 --> <!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{ <span slot="num" slot-scope="text, record, index">{{ index + 1 }}</span>
(current - 1) * size + index + 1
}}</span>
<!-- 允许为空 --> <!-- 允许为空 -->
<template slot="fieldNull" slot-scope="text"> <template slot="fieldNull" slot-scope="text">
<a-tag v-if="text.fieldNull === 1" color="green"></a-tag> <a-tag v-if="text.fieldNull === 1" color="green"></a-tag>
...@@ -126,9 +121,9 @@ export default { ...@@ -126,9 +121,9 @@ export default {
columns, columns,
loading: false, loading: false,
current: 1, current: 1,
size: 10, size: -1,
total: 100, total: 0,
pageSizeOptions: ["10", "30", "50", "100"], // pageSizeOptions: ["10", "30", "50", "100"],
searchVal: "", searchVal: "",
tableData: [], tableData: [],
fieldVisible: false, fieldVisible: false,
......
...@@ -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,
}, },
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
class="upload-app" class="upload-app"
label="上传应用" label="上传应用"
prop="filePath" prop="filePath"
v-if="form.appType === 1"
> >
<a-upload <a-upload
name="file" name="file"
...@@ -97,10 +98,13 @@ ...@@ -97,10 +98,13 @@
accept="application/x-zip-compressed" accept="application/x-zip-compressed"
> >
<a-button type="primary"> <a-button type="primary">
<a-icon type="upload" /> 选择文件 <a-icon type="upload" /> .zip文件
</a-button> </a-button>
</a-upload> </a-upload>
</a-form-model-item> </a-form-model-item>
<a-form-model-item v-else label="应用URL" prop="url">
<a-input v-model="form.url" placeholder="请输入应用URL" />
</a-form-model-item>
<a-form-model-item label="更新说明" prop="notes"> <a-form-model-item label="更新说明" prop="notes">
<a-textarea <a-textarea
placeholder="请输入更新说明" placeholder="请输入更新说明"
...@@ -184,10 +188,11 @@ export default { ...@@ -184,10 +188,11 @@ export default {
appIconPath: "", // 应用图标 appIconPath: "", // 应用图标
appThemeName: "", // 应用主题名称 appThemeName: "", // 应用主题名称
type: 1, // 类型(1.终端应用,2.移动端应用) type: 1, // 类型(1.终端应用,2.移动端应用)
appType: "", // 类型(1.应用程序,2.url) appType: 1, // 类型(1.应用程序,2.url)
shelves: 0, shelves: 0,
fileName: "", // 文件名称 fileName: "", // 文件名称
filePath: "", // 文件相对路径地址 filePath: "", // 文件相对路径地址
url: "", // 应用url
summary: "", // 简介 summary: "", // 简介
notes: "", // 更新说明 notes: "", // 更新说明
dataUpdate: 0, // 是否数据更新(0.否,1.是) dataUpdate: 0, // 是否数据更新(0.否,1.是)
...@@ -217,6 +222,7 @@ export default { ...@@ -217,6 +222,7 @@ export default {
summary: [ summary: [
{ required: true, message: "请输入应用简介", trigger: "blur" }, { required: true, message: "请输入应用简介", trigger: "blur" },
], ],
url: [{ required: true, message: "请输入应用URL", trigger: "blur" }],
notes: [ notes: [
{ required: true, message: "请输入应用更新说明", trigger: "blur" }, { required: true, message: "请输入应用更新说明", trigger: "blur" },
], ],
......
<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>
<a-tab-pane forceRender :key="1" tab="业务管理">
<BusinessTabs1 ref="BusinessTabs1" /> <a-tab-pane :key="2" tab="事项管理">
</a-tab-pane> <BusinessTabs2 v-if="active === 2" ref="BusinessTabs2" />
</a-tab-pane>
<a-tab-pane forceRender :key="2" tab="事项管理">
<BusinessTabs2 ref="BusinessTabs2" /> <a-tab-pane :key="3" tab="业务事项关联">
</a-tab-pane> <BusinessTabs3 v-if="active === 3" ref="BusinessTabs3" />
</a-tab-pane>
<a-tab-pane forceRender :key="3" tab="业务事项关联"> </a-tabs>
<BusinessTabs3 ref="BusinessTabs3" />
</a-tab-pane>
</a-tabs>
</div>
</div> </div>
</template> </template>
...@@ -24,11 +20,9 @@ ...@@ -24,11 +20,9 @@
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,84 +31,31 @@ export default { ...@@ -37,84 +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:
console.log(this.siteId);
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 { &::after {
width: 85%; content: "";
position: relative; width: 1px;
margin-left: 18px; height: 82vh;
&::after { position: absolute;
content: ""; background-color: #eeeeee;
width: 1px; top: 44px;
min-height: 82vh; left: 50%;
position: absolute;
background-color: #eeeeee;
top: 44px;
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() {
this.getSiteBusinessData();
this.getBusinessListData();
},
methods: { methods: {
// 获取站点 // 现在业务成功
getSiteInfo(siteId) { AddSuccess() {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态
this.siteId = siteId;
this.getSiteBusinessData(); this.getSiteBusinessData();
this.getBusinessListData(); this.getBusinessListData();
}, },
getEmpty() {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态
},
// 去掉空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 {
......
...@@ -46,11 +46,12 @@ ...@@ -46,11 +46,12 @@
total: leftTotal, total: leftTotal,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
defaultPageSize: leftSize,
pageSizeOptions: pageSizeOptions, pageSizeOptions: pageSizeOptions,
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 }"
...@@ -110,7 +111,7 @@ ...@@ -110,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} 条`,
...@@ -165,12 +166,13 @@ import { ...@@ -165,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" },
}, },
{ {
...@@ -183,7 +185,6 @@ const leftColumns = [ ...@@ -183,7 +185,6 @@ const leftColumns = [
{ {
title: "事项名称", title: "事项名称",
ellipsis: true, ellipsis: true,
width: "30%",
dataIndex: "matterName", dataIndex: "matterName",
}, },
{ {
...@@ -204,8 +205,7 @@ const leftColumns = [ ...@@ -204,8 +205,7 @@ const leftColumns = [
const rightColumns = [ const rightColumns = [
{ {
title: "序号", title: "序号",
dataIndex: "id", width: "50px",
width: "12%",
scopedSlots: { customRender: "num" }, scopedSlots: { customRender: "num" },
}, },
{ {
...@@ -218,7 +218,6 @@ const rightColumns = [ ...@@ -218,7 +218,6 @@ const rightColumns = [
{ {
title: "事项名称", title: "事项名称",
ellipsis: true, ellipsis: true,
width: "40%",
dataIndex: "matterName", dataIndex: "matterName",
}, },
{ {
...@@ -250,7 +249,7 @@ export default { ...@@ -250,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: "", // 窗口到现场次数
...@@ -260,20 +259,11 @@ export default { ...@@ -260,20 +259,11 @@ export default {
}; };
}, },
created() { created() {
// this.getMatterSiteData(); this.getMatterSiteData();
this.getMatterListData();
}, },
methods: { methods: {
// 获取站点
getSiteInfo(siteId) {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态
this.siteId = siteId;
this.getMatterSiteData();
this.getMatterListData();
},
getEmpty() {
Object.assign(this.$data, this.$options.data()); //获取data源对象,覆盖当前data对象状态
},
// 获取站点事项 // 获取站点事项
async getMatterSiteData(search = {}) { async getMatterSiteData(search = {}) {
this.leftLoading = true; this.leftLoading = true;
...@@ -337,8 +327,7 @@ export default { ...@@ -337,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() {
...@@ -346,7 +335,6 @@ export default { ...@@ -346,7 +335,6 @@ export default {
}, },
}); });
}, },
//新增事项 //新增事项
addItems() { addItems() {
if (!this.siteId) { if (!this.siteId) {
...@@ -358,11 +346,9 @@ export default { ...@@ -358,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) {
...@@ -408,7 +394,6 @@ export default { ...@@ -408,7 +394,6 @@ export default {
this.rightSize = size; this.rightSize = size;
this.getMatterListData(); this.getMatterListData();
}, },
// 右搜索 // 右搜索
onSearchRight() { onSearchRight() {
this.rightCurrent = 1; this.rightCurrent = 1;
...@@ -458,6 +443,52 @@ export default { ...@@ -458,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", this.getSiteBusinessData();
"delBusiness", this.getMatterSiteData();
"delMatterSiteData",
"addMatterSiteData",
"delBusinessMatter",
"delMatterSiteRelevance",
]);
this.$bus.$on("addBusiness", () => {
this.getSiteBusinessData();
});
this.$bus.$on("newBusiness", () => {
this.getSiteBusinessData();
});
this.$bus.$on("delBusiness", () => {
this.getSiteBusinessData();
});
this.$bus.$on("delMatterSiteData", () => {
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,17 +71,19 @@ ...@@ -77,17 +71,19 @@
<div class="ff window-box"> <div class="ff window-box">
<div class="department_right_add"> <div class="department_right_add">
<div>窗口管理</div> <div>窗口管理</div>
<a-button type="primary" @click="addModal" class="department_btnadd" <div class="flex aic jcb">
>新增窗口</a-button <a-button type="primary" @click="addModal" class="department_btnadd"
> >新增窗口</a-button
<a-input-search >
placeholder="请输入窗口名称搜索" <a-input-search
v-model="windowSearch" placeholder="请输入窗口名称搜索"
allowClear v-model="windowSearch"
enter-button="搜索" allowClear
style="width: 250px" enter-button="搜索"
@search="onSearchRight" style="width: 250px"
/> @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 {
} }
}, },
}, },
// 进入路由前
beforeRouteEnter(to, from, next) {
if (from.path === "/department/adddepartment") {
// 新增事项路由
to.meta.isBack = true;
} else {
to.meta.isBack = false;
}
next();
},
// 新增事项页面返回不刷新页面
activated() {
if (!this.$route.meta.isBack) {
this.getDeptListData();
this.getBusinessData();
this.getWindowListData();
} else {
this.$route.meta.isBack = false;
}
},
created() {},
methods: { methods: {
handleClick(val) {
Object.assign(this.$data, this.$options.data());
this.siteId = val.id;
this.getDeptListData({ siteId: val.id });
this.getWindowListData({ siteId: val.id });
this.getBusinessData({ siteId: val.id });
if (this.$refs.adddepartment) {
this.$refs.adddepartment.getSiteInfo(val);
}
if (this.$refs.addwindow) {
this.$refs.addwindow.getSiteInfo(val);
}
},
clickArea() {
Object.assign(this.$data, this.$options.data());
},
// 去掉空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",
windowId: data.id, query: {
windowName: data.name, windowId: data.id,
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; height: 100%;
position: relative; position: relative;
display: flex; display: flex;
.left { background-color: #fff;
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;
}
}
.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="skins_bnt btn-box">
<!-- 左边站点树 --> <!-- 新增按钮 -->
<div class="left"> <a-button type="primary" @click="showModal" class="skins_btn_1"
<sitetree @getSite="handleClick" @clickArea="clickArea"></sitetree> >新增节日</a-button
</div> >
<!-- 右边表格 --> <div>
<div class="right ff"> <a-input-search
<div class="skins_bnt btn-box"> style="width: 300px"
<!-- 新增按钮 --> allowClear
<a-button type="primary" @click="showModal" class="skins_btn_1" placeholder="请输入年份查询"
>新增节日</a-button enter-button="搜索"
> v-model="year"
<div> @search="onSearch"
<a-input-search />
style="width: 300px"
allowClear
placeholder="请输入年份查询"
enter-button="搜索"
v-model="year"
@search="onSearch"
/>
</div>
</div>
<div class="table-content">
<!-- 表格 -->
<a-table
bordered
:columns="columns"
:loading="loading"
:data-source="list"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: page,
total: total,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: changePagination,
onShowSizeChange: showSizeChange,
}"
:scroll="{ y: 600 }"
:rowKey="(record) => record.id"
>
<a slot="name" slot-scope="text">{{ text }}</a>
<span slot="number" slot-scope="text, record, index">{{
(page - 1) * size + index + 1
}}</span>
<!-- 年 -->
<template slot="year" slot-scope="text">
<span>{{ text.startTime | year }}</span>
</template>
<!-- 日期 -->
<template slot="days" slot-scope="text">
<span>{{ text.startTime | days }}</span>
<span v-if="text.startTime !== text.endTime">~</span>
<span v-if="text.startTime !== text.endTime">{{
text.endTime | days
}}</span>
</template>
<!-- 类型 -->
<template slot="type" slot-scope="text">
<span>{{ text.workorholiday === 0 ? "节假日" : "工作日" }}</span>
</template>
<!-- 备注 -->
<template slot="summary" slot-scope="text">
<span>{{ text.summary ? text.summary : "--" }}</span>
</template>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a type="primary" @click="handleEdit(text)" class="edit">编辑</a>
<a class="delet" @click="handleDel(text.id)">删除</a>
</template>
</a-table>
</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>
</div> </div>
<div class="table-content">
<!-- 表格 -->
<a-table
bordered
:columns="columns"
:loading="loading"
:data-source="list"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: page,
total: total,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: changePagination,
onShowSizeChange: showSizeChange,
}"
:scroll="{ y: 600 }"
:rowKey="(record) => record.id"
>
<a slot="name" slot-scope="text">{{ text }}</a>
<span slot="number" slot-scope="text, record, index">{{
(page - 1) * size + index + 1
}}</span>
<!-- 年 -->
<template slot="year" slot-scope="text">
<span>{{ text.startTime | year }}</span>
</template>
<!-- 日期 -->
<template slot="days" slot-scope="text">
<span>{{ text.startTime | days }}</span>
<span v-if="text.startTime !== text.endTime">~</span>
<span v-if="text.startTime !== text.endTime">{{
text.endTime | days
}}</span>
</template>
<!-- 类型 -->
<template slot="type" slot-scope="text">
<span>{{ text.workorholiday === 0 ? "节假日" : "工作日" }}</span>
</template>
<!-- 备注 -->
<template slot="summary" slot-scope="text">
<span>{{ text.summary ? text.summary : "--" }}</span>
</template>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a type="primary" @click="handleEdit(text)" class="edit">编辑</a>
<a class="delet" @click="handleDel(text.id)">删除</a>
</template>
</a-table>
</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() {
this.getHolidayData();
},
methods: { methods: {
// 选择站点
handleClick(val) {
Object.assign(this.$data, this.$options.data());
this.siteId = val.id;
this.getHolidayData();
},
// 点击区域
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%;
padding: 20px;
background-color: #fff;
.main { .main {
height: 89vh;
padding: 20px;
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(() => {
......
...@@ -109,6 +109,11 @@ ...@@ -109,6 +109,11 @@
style="width: 260px" style="width: 260px"
:options="options" :options="options"
placeholder="请选择位置" placeholder="请选择位置"
:field-names="{
value: 'label',
children: 'children',
label: 'label',
}"
@change="oncityChange" @change="oncityChange"
/> />
</a-form-model-item> </a-form-model-item>
...@@ -254,7 +259,8 @@ ...@@ -254,7 +259,8 @@
<script> <script>
import { modelList, siteSave } from "@/services/basicsetFun"; import { modelList, siteSave } from "@/services/basicsetFun";
import YCheckbox from "@/components/ycheckbox/YCheckbox.vue"; import YCheckbox from "@/components/ycheckbox/YCheckbox.vue";
import options from "@/utils/city"; // import options from "@/utils/city";
import { regionData } from "element-china-area-data";
export default { export default {
props: { props: {
formVisible: { formVisible: {
...@@ -305,7 +311,7 @@ export default { ...@@ -305,7 +311,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,
loading: false, loading: false,
options, // 地区级联数据 options: regionData, // 地区级联数据
tablename: "", //接口名称 tablename: "", //接口名称
modelIds: [], // 板块数据 modelIds: [], // 板块数据
cityData: [], cityData: [],
...@@ -625,6 +631,7 @@ export default { ...@@ -625,6 +631,7 @@ export default {
}, },
// 地址 // 地址
oncityChange(val) { oncityChange(val) {
console.log(val);
[ [
this.formInfo.proCode, this.formInfo.proCode,
this.formInfo.cityCode, this.formInfo.cityCode,
...@@ -637,7 +644,7 @@ export default { ...@@ -637,7 +644,7 @@ export default {
this.$jsonp(`https://restapi.amap.com/v3/geocode/geo?parameters`, { this.$jsonp(`https://restapi.amap.com/v3/geocode/geo?parameters`, {
//官方接口 //官方接口
output: "jsonp", output: "jsonp",
key: "21e7ac78b448640e516f1eddc3ffd720", //腾讯地图获取的key key: "21e7ac78b448640e516f1eddc3ffd720", //key
address: address, //获取输入的位置 address: address, //获取输入的位置
}) })
.then((res) => { .then((res) => {
......
...@@ -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>
...@@ -236,9 +240,10 @@ ...@@ -236,9 +240,10 @@
import sitetree from "@/components/sitetree/index"; import sitetree from "@/components/sitetree/index";
import addsite from "./components/addsite.vue"; import addsite from "./components/addsite.vue";
import alldetails from "./components/alldetails.vue"; import alldetails from "./components/alldetails.vue";
import local from "@/utils/local";
import { import {
deleteSite, deleteSite,
// siteInfo, siteInfo,
getSiteList, getSiteList,
SyncSiteData, SyncSiteData,
} from "@/services/basicsetFun"; } from "@/services/basicsetFun";
...@@ -261,10 +266,13 @@ export default { ...@@ -261,10 +266,13 @@ export default {
active: 0, //站点激活 active: 0, //站点激活
siteData: [], //站点数据 siteData: [], //站点数据
areaID: "", areaID: "",
siteId: local.getLocal("siteId"),
// modelData: [], // 模块数据 // modelData: [], // 模块数据
}; };
}, },
created() {}, created() {
this.getSiteInfo();
},
methods: { methods: {
getArea(info) { getArea(info) {
...@@ -288,16 +296,18 @@ export default { ...@@ -288,16 +296,18 @@ export default {
this.siteData = data; this.siteData = data;
}, },
// 获取站点信息 // 获取站点信息
// async getSiteInfo(info = {}) { async getSiteInfo() {
// let res = await siteInfo({ id: info.id }); let res = await siteInfo({ id: this.siteId });
// let { data, dict } = res.data; let { data, dict } = res.data;
// let arr = data.modelIds.split(","); data.modelIds = data.modelIds.split(",");
// this.modelData = Object.keys(dict.modelIds).reduce( data.modelData = Object.keys(dict.modelIds).reduce(
// (pre, cur) => (arr.includes(cur) && pre.push(dict.modelIds[cur]), pre), (pre, cur) => (
// [] data.modelIds.includes(cur) && pre.push(dict.modelIds[cur]), pre
// ); ),
// this.siteData = data; []
// }, );
this.siteData = [data];
},
// 删除 // 删除
deleteSite(val) { deleteSite(val) {
...@@ -366,8 +376,8 @@ export default { ...@@ -366,8 +376,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 +394,20 @@ export default { ...@@ -384,12 +394,20 @@ 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 {
width: 100%;
height: 100%;
}
.cut-btn { .cut-btn {
margin-top: 30px; margin-top: 30px;
display: flex; display: flex;
...@@ -532,9 +550,6 @@ export default { ...@@ -532,9 +550,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>
<a-modal
title="新增皮肤"
on-ok="handleOk"
class="skins_bnt_add"
:width="720"
:visible="Visible"
@cancel="Visible = false"
>
<template slot="footer">
<a-button key="back" @click="handleCancel" class="skins_chongzhi">重置</a-button>
<a-button
key="submit"
type="primary"
:loading="loading"
@click="handleOk"
class="skins_queding"
>确定</a-button>
</template>
<a-checkbox-group @change="onChange">
<a-row>
<a-form-item label="选择系统">
<a-col :span="8">
<a-checkbox value>窗口屏</a-checkbox>
</a-col>
<a-col :span="8">
<a-checkbox value>集中屏</a-checkbox>
</a-col>
<a-col :span="8">
<a-checkbox value>呼叫器</a-checkbox>
</a-col>
<a-col :span="8">
<a-checkbox value>评价器</a-checkbox>
</a-col>
<a-col :span="8">
<a-checkbox value>导视机</a-checkbox>
</a-col>
</a-form-item>
</a-row>
</a-checkbox-group>
<a-form-item label="版本号" class="banben">
<a-input placeholder="请输入版本号" class="skins_num" />
</a-form-item>
<a-form-item label="标题" class="biaoti">
<a-input placeholder="请输入标题" class="skins_num" />
</a-form-item>
<a-form-item label="皮肤" class="pifu">
<a-upload
name="avatar"
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">上传图片</div>
</div>
</a-upload>
</a-form-item>
</a-modal>
</template>
<script>
export default {
data () {
return {
loading: false,
}
},
props: {
visibleSkin: {
type: Boolean,
default: false,
}
},
methods: {
handleOk () {
this.loading = true;
setTimeout(() => {
this.visibleSkin = false;
this.loading = false;
}, 3000);
},
onChange (checkedValues) {
console.log('checked = ', checkedValues);
},
handleChange () {
console.log(123);
},
handleCancel () {
this.visibleSkin = false;
},
},
computed: {
Visible: {
get () {
return this.visibleSkin
},
set (val) {
this.$emit('update:visibleSkin', val)
}
}
},
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<a-modal :visible="Visible" @cancel="Visible = false" title="皮肤" @ok="showOk" :width="750">
<img src="~@/assets/img/derma.png" class="pht2" />
</a-modal>
</template>
<script>
export default {
data () {
return {
}
},
props: {
visibleImg: {
type: Boolean,
default: false,
}
},
computed: {
Visible: {
get () {
return this.visibleImg
},
set (val) {
this.$emit('update:visibleImg', val)
}
}
},
methods: {
showOk (e) {
console.log(e);
// this.visibleImg = false;
},
}
}
</script>
<style lang="less" scoped>
.pht2 {
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file
<template>
<div class="skins ff">
<p>皮肤管理</p>
<!-- 皮肤管理 -->
<div class="skins_font">
<!-- 按钮 -->
<div class="skins_bnt">
<a-button type="primary" @click="showModal" class="skins_btn_1">新增</a-button>
<!-- 新增弹窗 -->
<addskins :visibleSkin.sync="visibleSkin"></addskins>
</div>
<!-- 输入框 -->
<div class="skins_sou">
<a-input-search
placeholder="请输入系统名称搜索"
style="width: 200px"
@search="onSearch"
class="skins_sou_1"
/>
<!-- 搜索按钮 -->
<a-button type="primary" class="skins_btn_2">搜索</a-button>
</div>
</div>
<!-- 表格 -->
<a-table :columns="columns" :data-source="data">
<a slot="name" slot-scope="text">{{ text }}</a>
<span slot="number" slot-scope="text, record, index">{{ index + 1 }}</span>
<span slot="pic">
<img src="~@/assets/img/derma.png" class="pht" type="primary" @click="showPic" />
<!-- 图片弹窗 -->
<maximg :visibleImg.sync="visibleImg"></maximg>
</span>
<span slot="action">
<a type="primary" @click="showModal" class="edit">编辑</a>
<a class="delet">删除</a>
</span>
</a-table>
<!-- <DelModal :message="message" ref="delModal"/> -->
</div>
</template>
<script>
import addskins from './components/addskins.vue'
import Maximg from './components/maximg.vue';
const columns = [
{
title: "序号",
dataIndex: "number",
scopedSlots: {
customRender: "number"
},
},
{
title: "系统名称",
dataIndex: 'name',
},
{
title: "标题",
dataIndex: "title",
},
{
title: "版本",
dataIndex: "versions",
},
{
title: "皮肤",
dataIndex: "skin",
scopedSlots: {
customRender: "pic"
},
},
{
title: "操作",
scopedSlots: {
customRender: "action",
},
},
];
const data = [
{
key: 1,
name: "自助服务终端",
title: "自助服务终端版本1",
versions: "v1.0",
},
{
key: 2,
name: "集中屏",
title: "窗口屏版本1",
versions: "v1.0",
},
{
key: 3,
name: "评价器",
title: "自助服务终端版本1",
versions: "v1.0",
},
{
key: 4,
name: "窗口屏",
title: "窗口屏版本2",
versions: "v2.0",
},
{
key: 5,
name: "集中屏",
title: "窗口屏版本3",
versions: "v3.0",
},
];
export default {
components: {
addskins,
Maximg
},
data () {
return {
data,
columns,
visibleSkin: false,
visibleImg: false,
// previewVisible: false,
};
},
methods: {
showModal () {
this.visibleSkin = true;
},
showPic () {
this.visibleImg = true;
},
onSearch () {
console.log(13);
},
handleCancell () {
this.previewVisible = false;
},
// delmodal() {
// this.message = '皮肤'
// this.$refs.delModal.show()
// },
},
};
</script>
<style lang="less" scoped>
.biaoti {
margin-left: 20px;
}
.pifu {
margin-left: 20px;
}
.banben {
margin-left: 10px;
}
.pht {
width: 127px;
height: 71px;
}
.skins_font {
display: flex;
margin-bottom: 15px;
}
.skins_btn_1 {
width: 90px;
height: 36px;
background-color: rgba(5, 149, 253, 1);
border-color: rgba(5, 149, 253, 1);
flex: 1;
}
.skins_sou_1 {
position: relative;
// float: left;
margin-left: 1242px;
width: 278px;
height: 36px;
padding: 2px 2px 2px 25px;
font-family: 'Arial Normal', 'Arial', sans-serif;
font-weight: 400;
font-style: normal;
font-size: 13px;
letter-spacing: normal;
margin-right: 10px;
}
.skins_btn_2 {
outline: none;
margin-right: 20px;
width: 72px;
height: 36px;
background: inherit;
background-color: rgba(5, 149, 253, 1);
border: none;
border-radius: 5px;
box-shadow: none;
font-family: 'PingFang-SC-ExtraLight', 'PingFang SC ExtraLight', 'PingFang SC',
sans-serif;
font-weight: 400;
font-style: normal;
}
.skins_btn_2:focus {
outline: none;
}
.ant-table-thead {
background-color: rgb(214, 214, 214) !important;
}
.edit {
color: rgb(41, 184, 41);
margin-right: 40px;
}
.delet {
color: red;
}
.skins_num {
width: 380px;
}
.skins_queding {
width: 90px;
height: 36px;
background: inherit;
background-color: rgba(5, 149, 253, 1);
border: none;
border-radius: 5px;
box-shadow: none;
}
.skins_chongzhi {
width: 90px;
height: 36px;
background: inherit;
background-color: rgba(5, 149, 253, 0);
box-sizing: border-box;
border-width: 1px;
border-style: solid;
border-color: rgba(220, 223, 230, 1);
border-radius: 5px;
}
</style>
\ No newline at end of file
<template> <template>
<div class="configurat"> <div class="configurat">
<div class="main"> <div class="title">短信全局配置</div>
<!-- 左边站点树 --> <div class="set-configurat">
<div class="left"> <y-switch
<sitetree @getSite="handleClick" @clickArea="clickArea"></sitetree> v-model="setInfo.messageoff"
</div> checkedChildren="开"
<div class="right"> unCheckedChildren="关"
<div class="title">短信全局配置</div> @change="changeClose"
<div class="set-configurat"> ></y-switch>
<y-switch
v-model="setInfo.messageoff"
checkedChildren="开"
unCheckedChildren="关"
@change="changeClose"
></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: "",
}, },
}; };
}, },
created() {
this.getSmssetList();
},
methods: { methods: {
// 选择站点
handleClick(val) {
this.setInfo.siteId = val.id;
this.getSmssetList();
},
// 点击区域
clickArea() {
this.setInfo.siteId = "";
this.getSmssetList();
},
// 获取站点短信设置 // 获取站点短信设置
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,10 @@ export default {}; ...@@ -9,4 +9,10 @@ export default {};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.index {
width: 100%;
min-height: 100%;
background-color: #fff;
display: flex;
}
</style> </style>
\ No newline at end of file
...@@ -120,16 +120,19 @@ export default { ...@@ -120,16 +120,19 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.surface { .surface {
padding: 15px; width: 100%;
height: auto;
background-color: #fff;
.container { .container {
width: 100%; width: 100%;
height: 100%;
position: relative; position: relative;
} }
.main { .main {
height: 100%;
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;
...@@ -143,7 +146,13 @@ export default { ...@@ -143,7 +146,13 @@ export default {
} }
} }
} }
/deep/.ant-card {
height: 100%;
display: flex;
flex-direction: column;
}
/deep/.ant-card-body { /deep/.ant-card-body {
flex: 1;
padding: 0px; padding: 0px;
} }
</style> </style>
\ No newline at end of file
...@@ -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() {
this.getDeptList();
this.getWindowData();
this.getWorkmanData();
},
methods: { methods: {
handleClick(val) {
Object.assign(this.$data, this.$options.data());
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());
},
// 获取部门 // 获取部门
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;
......
This diff is collapsed.
import { import {
dept,window,workman,windowbusiness,windowmatter,upload dept,
} from '@/services/basicsetApi' window,
workman,
import {request, METHOD} from '@/utils/request' windowbusiness,
windowmatter,
upload,
} from "@/services/basicsetApi";
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);
} }
\ No newline at end of file
...@@ -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) => {
}) !== -1 return (
required.findIndex((item) => item === role || item === role.id) !== -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 };
...@@ -3066,6 +3066,11 @@ check-types@^8.0.3: ...@@ -3066,6 +3066,11 @@ check-types@^8.0.3:
resolved "https://registry.npm.taobao.org/check-types/download/check-types-8.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcheck-types%2Fdownload%2Fcheck-types-8.0.3.tgz" resolved "https://registry.npm.taobao.org/check-types/download/check-types-8.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcheck-types%2Fdownload%2Fcheck-types-8.0.3.tgz"
integrity sha1-M1bMoZyIlUTy16le1JzlCKDs9VI= integrity sha1-M1bMoZyIlUTy16le1JzlCKDs9VI=
china-area-data@^5.0.1:
version "5.0.1"
resolved "https://registry.npmmirror.com/china-area-data/-/china-area-data-5.0.1.tgz#7943b83a0619f033bb5893da80cb46e52e44be66"
integrity sha512-BQDPpiv5Nn+018ekcJK2oSD9PAD+E1bvXB0wgabc//dFVS/KvRqCgg0QOEUt3vBkx9XzB5a9BmkJCEZDBxVjVw==
china-division@^2.5.0: china-division@^2.5.0:
version "2.5.0" version "2.5.0"
resolved "https://registry.npmmirror.com/china-division/-/china-division-2.5.0.tgz" resolved "https://registry.npmmirror.com/china-division/-/china-division-2.5.0.tgz"
...@@ -4475,6 +4480,14 @@ electron-to-chromium@^1.4.76: ...@@ -4475,6 +4480,14 @@ electron-to-chromium@^1.4.76:
resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.77.tgz" resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.77.tgz"
integrity sha512-fiDxw8mO9Ph1Z0bjX2sFTPpi0J0QkOiwOJF+5Q0J0baNc/F9lLePAvDPlnoxvbUYYMizqrKPeotRRkJ9LtxAew== integrity sha512-fiDxw8mO9Ph1Z0bjX2sFTPpi0J0QkOiwOJF+5Q0J0baNc/F9lLePAvDPlnoxvbUYYMizqrKPeotRRkJ9LtxAew==
element-china-area-data@^5.0.2:
version "5.0.2"
resolved "https://registry.npmmirror.com/element-china-area-data/-/element-china-area-data-5.0.2.tgz#006c26594b8865cb619994063c732562e4583d30"
integrity sha512-vLQuvOKJy/uiX7MRHEk3x/j09hipuIl6DJ/C4XFUG7D7Pj3O47sy+Y6aAArM6k9v8cD9UX6e+yz2S4J+IPnZ8g==
dependencies:
china-area-data "^5.0.1"
lodash-es "^4.17.15"
elliptic@^6.0.0, elliptic@^6.5.2: elliptic@^6.0.0, elliptic@^6.5.2:
version "6.5.3" version "6.5.3"
resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz" resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz"
...@@ -7104,6 +7117,11 @@ locate-path@^5.0.0: ...@@ -7104,6 +7117,11 @@ locate-path@^5.0.0:
dependencies: dependencies:
p-locate "^4.1.0" p-locate "^4.1.0"
lodash-es@^4.17.15:
version "4.17.21"
resolved "https://registry.npmmirror.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
lodash._reinterpolate@^3.0.0: lodash._reinterpolate@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.npm.taobao.org/lodash._reinterpolate/download/lodash._reinterpolate-3.0.0.tgz" resolved "https://registry.npm.taobao.org/lodash._reinterpolate/download/lodash._reinterpolate-3.0.0.tgz"
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<i class="title">智慧大厅综合管理系统</i> <i class="title">智慧大厅综合管理系统</i>
<!-- <i class="title">智慧政务一体化综合管理平台4.0</i> --> <!-- <i class="title">智慧政务一体化综合管理平台4.0</i> -->
<div class="selectOnptions"> <div class="selectOnptions">
<a-select v-model="siteId" @change="handleChange"> <a-select v-model="siteInfo" labelInValue @change="handleChange">
<a-select-option v-for="v in siteList" :key="v.id" :value="v.id"> <a-select-option v-for="v in siteList" :key="v.id" :value="v.id">
{{ v.siteName }} {{ v.siteName }}
</a-select-option> </a-select-option>
...@@ -108,7 +108,9 @@ export default { ...@@ -108,7 +108,9 @@ export default {
showPage: false, showPage: false,
visibleEditPwd: false, visibleEditPwd: false,
siteList: Storage.get(2, "siteList"), // 站点列表 siteList: Storage.get(2, "siteList"), // 站点列表
siteId: Storage.get(2, "siteId") ? Storage.get(2, "siteId") : "暂无站点", // 当前站点 siteInfo: {
key: Storage.get(2, "siteId") ? Storage.get(2, "siteId") : "暂无站点", // 当前站点
},
userInfo: Storage.get(2, "userInfo"), // 用户信息 userInfo: Storage.get(2, "userInfo"), // 用户信息
}; };
}, },
...@@ -130,8 +132,9 @@ export default { ...@@ -130,8 +132,9 @@ export default {
}, },
methods: { methods: {
...mapMutations("user", ["SET_USERDATA"]), ...mapMutations("user", ["SET_USERDATA"]),
handleChange(val) { handleChange(info) {
Storage.set(2, "siteId", val); Storage.set(2, "siteId", info.key);
Storage.set(2, "siteName", info.label);
this.$bus.$emit("changeSite"); this.$bus.$emit("changeSite");
}, },
handelClick(item) { handelClick(item) {
...@@ -157,6 +160,7 @@ export default { ...@@ -157,6 +160,7 @@ export default {
// this.$message.success(res.msg); // this.$message.success(res.msg);
this.$Storage.remove(2, "Authorization"); this.$Storage.remove(2, "Authorization");
this.$Storage.remove(2, "siteId"); this.$Storage.remove(2, "siteId");
this.$Storage.remove(2, "siteName");
this.$Storage.remove(2, "userInfo"); this.$Storage.remove(2, "userInfo");
this.SET_USERDATA({}); this.SET_USERDATA({});
setTimeout(() => { setTimeout(() => {
......
...@@ -77,7 +77,10 @@ export default { ...@@ -77,7 +77,10 @@ export default {
if (res.code == 1) { if (res.code == 1) {
let { siteList, user } = res.data; let { siteList, user } = res.data;
this.$Storage.set(2, "siteList", siteList); this.$Storage.set(2, "siteList", siteList);
if (siteList.length) this.$Storage.set(2, "siteId", siteList[0].id); if (siteList.length) {
this.$Storage.set(2, "siteId", siteList[0].id);
this.$Storage.set(2, "siteName", siteList[0].siteName);
}
this.$Storage.set(2, "Authorization", res.data.token); this.$Storage.set(2, "Authorization", res.data.token);
this.$Storage.set(2, "userInfo", user); this.$Storage.set(2, "userInfo", user);
// this.SET_USERDATA(user); // this.SET_USERDATA(user);
......
...@@ -56,6 +56,7 @@ export default { ...@@ -56,6 +56,7 @@ export default {
openWindow(href) { openWindow(href) {
let token = Storage.get(2, "Authorization"); let token = Storage.get(2, "Authorization");
let siteid = Storage.get(2, "siteId"); let siteid = Storage.get(2, "siteId");
let siteName = Storage.get(2, "siteName");
let reg = /^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+/; let reg = /^((https|http|ftp|rtsp|mms)?:\/\/)[^\s]+/;
let info = Storage.get(2, "userInfo"); let info = Storage.get(2, "userInfo");
let userInfo = JSON.stringify({ let userInfo = JSON.stringify({
...@@ -64,7 +65,7 @@ export default { ...@@ -64,7 +65,7 @@ export default {
}); });
if (reg.test(href)) { if (reg.test(href)) {
window.open( window.open(
`${href}?token=${token}&siteid=${siteid}&userInfo=${userInfo}`, `${href}?token=${token}&siteid=${siteid}&siteName=${siteName}&userInfo=${userInfo}`,
"_blank" "_blank"
); );
} }
......
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