Commit f53f9ea3 authored by 王晓旭's avatar 王晓旭

Merge branch 'reg' of http://gitlab.scsmile.cn/zxf/smart_gov_platform into reg

parents 9dc7aab9 02cfd887
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
"secure-ls": "^1.2.6", "secure-ls": "^1.2.6",
"v-viewer": "^1.6.4", "v-viewer": "^1.6.4",
"viser-vue": "^2.4.8", "viser-vue": "^2.4.8",
"vue": "^2.6.11", "vue": "2.6.11",
"vue-i18n": "^8.18.2", "vue-i18n": "^8.18.2",
"vue-jsonp": "^2.0.0", "vue-jsonp": "^2.0.0",
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
"less-loader": "^6.1.1", "less-loader": "^6.1.1",
"style-resources-loader": "^1.3.2", "style-resources-loader": "^1.3.2",
"vue-cli-plugin-style-resources-loader": "^0.1.4", "vue-cli-plugin-style-resources-loader": "^0.1.4",
"vue-template-compiler": "^2.6.11", "vue-template-compiler": "2.6.11",
"vuepress": "^1.5.2", "vuepress": "^1.5.2",
"webpack-theme-color-replacer": "1.3.18", "webpack-theme-color-replacer": "1.3.18",
"whatwg-fetch": "^3.0.0" "whatwg-fetch": "^3.0.0"
......
import {loadRoutes, loadGuards, setAppOptions} from '@/utils/routerUtil' // import {loadRoutes, loadGuards, setAppOptions} from '@/utils/routerUtil'
import {loadInterceptors} from '@/utils/request' import { loadInterceptors } from "@/utils/request";
import guards from '@/router/guards' // import guards from '@/router/guards'
import interceptors from '@/utils/axios-interceptors' import interceptors from "@/utils/axios-interceptors";
/** /**
* 启动引导方法 * 启动引导方法
...@@ -11,15 +11,15 @@ import interceptors from '@/utils/axios-interceptors' ...@@ -11,15 +11,15 @@ import interceptors from '@/utils/axios-interceptors'
* @param i18n 应用的 vue-i18n 实例 * @param i18n 应用的 vue-i18n 实例
* @param i18n 应用的 message 实例 * @param i18n 应用的 message 实例
*/ */
function bootstrap({router, store, i18n, message}) { function bootstrap({ router, store, i18n, message }) {
// 设置应用配置 // 设置应用配置
setAppOptions({router, store, i18n}) // setAppOptions({router, store, i18n})
// 加载 axios 拦截器 // 加载 axios 拦截器
loadInterceptors(interceptors, {router, store, i18n, message}) loadInterceptors(interceptors, { router, store, i18n, message });
// 加载路由 // 加载路由
loadRoutes() // loadRoutes()
// 加载路由守卫 // 加载路由守卫
loadGuards(guards, {router, store, i18n, message}) // loadGuards(guards, {router, store, i18n, message})
} }
export default bootstrap export default bootstrap;
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import store from "@/store/index"; import store from "@/store/index";
// 皮肤模板页面权限 // 皮肤模板页面权限
export const permission = { export const permission = {
inserted: function(el, binding) { inserted: function (el, binding) {
const { value } = binding; const { value } = binding;
// const roles = local.getLocal("baseUserInfo").id; // const roles = local.getLocal("baseUserInfo").id;
const roles = store.getters["site/userInfo"].id; const roles = store.getters["site/userInfo"].id;
...@@ -17,3 +17,25 @@ export const permission = { ...@@ -17,3 +17,25 @@ export const permission = {
} }
}, },
}; };
// 按钮鉴权
export const hasPermi = {
inserted: function (el, binding) {
const { value } = binding;
const permissions = store.getters["site/permissions"];
if (value && value instanceof Array && value.length > 0) {
const permissionFlag = value;
const hasPermissions = permissions.some((permission) => {
return permissionFlag.includes(permission);
});
if (!hasPermissions) {
el.remove();
}
} else {
throw new Error(`请设置操作权限标签值`);
}
},
};
<template>
<div class="new-page-layout">
<a-layout>
<NewPageHerder></NewPageHerder>
<a-layout>
<SideBar v-if="layout === 'side'"></SideBar>
<a-layout-content>
<keep-alive>
<!-- 需要缓存的视图组件 -->
<router-view v-if="$route.meta.keepAlive" class="layout-page">
</router-view>
</keep-alive>
<!-- 不需要缓存的视图组件 -->
<router-view class="layout-page" v-if="!$route.meta.keepAlive">
</router-view>
</a-layout-content>
</a-layout>
</a-layout>
</div>
</template>
<script>
import { mapState } from "vuex";
import NewPageHerder from "./header/NewPageHerder.vue";
import SideBar from "./side/SideBar.vue";
export default {
components: {
NewPageHerder,
SideBar,
},
data() {
return {};
},
computed: {
...mapState("setting", ["layout"]),
},
};
</script>
<style lang="less" scoped>
.new-page-layout {
width: 100vw;
height: 100vh;
}
/deep/.ant-layout {
width: 100%;
height: 100%;
.ant-layout-content {
width: 100%;
// height: calc(100% - 64px);
padding: 20px;
}
}
.layout-page {
background: #fff;
}
</style>
<template> <template>
<div class="tableview viewbox"> <div class="tableview">
<div class="head b-b"> <div class="head" v-if="secondaryRoutes.length">
<router-link :to="item.fullPath" v-for="(item,index) in subMenu" :key="index"><a-icon :type="item.meta.icon" /> {{item.name}}</router-link> <router-link
</div> :to="item.path"
<router-view /> v-for="(item, index) in secondaryRoutes"
:key="index"
>
<a-icon v-if="item.meta.icon" :type="item.meta.icon" />
{{ item.meta && item.meta.title }}</router-link
>
</div> </div>
<div ref="outBox" class="out-box">
<router-view />
</div>
</div>
</template> </template>
<script> <script>
import {mapGetters} from 'vuex' import { mapState } from "vuex";
export default { export default {
computed:{ data() {
...mapGetters('setting', ['subMenu']), return {};
},
watch: {
"$route.path"() {
this.$refs.outBox.scrollTop = 0;
}, },
created(){ },
console.log(this.subMenu) computed: {
} ...mapState("site", ["secondaryRoutes"]),
} },
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.tableview{ .tableview {
border-radius: 8px; height: 100%;
overflow: hidden; border-radius: 8px;
.head{ display: flex;
padding:0 10px; flex-direction: column;
background: #fff; .out-box {
a{ flex: 1;
margin-right:30px; padding: 15px;
color: #202020; overflow-y: auto;
font-size: 14px; background: #fff;
padding: 10px 0; }
display: inline-block; .head {
} padding: 0 10px;
.router-link-active{ background: #fff;
color: #2681e8; border-bottom: 1px solid #d9d9d9;
position: relative; i {
&::after{ color: #2681e8;
content: ""; }
display: block; a {
border-bottom: 2px solid #2681e8; margin-right: 30px;
position: absolute; color: rgba(0, 0, 0, 0.65);
left: 0; font-size: 14px;
bottom: 0; padding: 10px 0;
right: 0; display: inline-block;
} font-weight: bold;
} }
.router-link-active {
color: #2681e8;
position: relative;
&::after {
content: "";
display: block;
border-bottom: 2px solid #2681e8;
position: absolute;
left: 0;
bottom: 0;
right: 0;
}
} }
}
} }
</style> </style>
\ No newline at end of file
<template>
<a-menu
:selectedKeys="current"
:mode="mode"
:theme="theme"
@click="changeMenu"
>
<template v-for="item in menus">
<a-sub-menu
v-if="!item.hideChildrenInMenu && item.children && item.children.length"
:key="item.path"
>
<span slot="title" class="submenu-title-wrapper"
><a-icon v-if="item.meta.icon" :type="item.meta.icon" />{{
item.meta && item.meta.title
}}</span
>
<a-menu-item v-for="v in item.children" :key="v.path">
{{ v.meta && v.meta.title }}
</a-menu-item>
</a-sub-menu>
<template v-else>
<a-menu-item :key="item.path">
<a-icon v-if="item.meta.icon" :type="item.meta.icon" />{{
item.meta && item.meta.title
}}
</a-menu-item>
</template>
</template>
</a-menu>
</template>
<script>
import { mapState, mapMutations } from "vuex";
export default {
props: {
mode: {
type: String,
default: "horizontal",
},
theme: {
type: String,
default: "light",
},
},
computed: {
...mapState("site", ["sysName", "sysLogo", "path", "menus"]),
...mapState("setting", ["layout"]),
current() {
const route = this.$route;
const { meta, matched } = route;
if (meta.activeMenu) {
return [meta.activeMenu];
}
return matched
.filter((item) => item.path)
.map((item) => item.path && item.path);
},
},
created() {},
methods: {
...mapMutations("site", ["SET_secondaryRoutes"]),
changeMenu({ key }) {
this.SET_secondaryRoutes(key);
this.$router.push({ path: key });
},
},
};
</script>
<style lang="less" scoped>
.ant-menu-horizontal {
min-width: 200px;
height: 64px;
line-height: 64px;
// vertical-align: middle;
box-shadow: none;
background: #0000;
border: none;
.ant-menu-item,
/deep/.ant-menu-submenu-title {
top: 0;
color: rgba(254, 254, 254, 0.65);
border: none;
&:hover {
color: #fff;
border: none;
}
}
/deep/.ant-menu-submenu-horizontal {
border: none;
}
/deep/.ant-menu-item-selected {
background: #1890ff !important;
color: #fff;
}
}
</style>
<template>
<a-layout-header class="new-page-herder">
<div class="logo-box">
<img
class="logo"
:src="sysLogo ? sysLogo : require('@/assets/img/logo.png')"
/>
<h1 class="title">
{{ sysName ? sysName : systemName }}
</h1>
<HeaderSite></HeaderSite>
</div>
<MenuBar v-if="layout === 'head'"></MenuBar>
<a-space size="middle">
<InitArea :visibleInit.sync="visibleInit"></InitArea>
<a v-permission="[1]" @click="visibleInit = true">
<a-icon type="redo" />
初始化区域数据
</a>
<a-tooltip title="返回门户" placement="bottom">
<a class="header-item" :href="portalUrl + (path ? path : '')">
<a-icon type="home" /> 返回门户
</a>
</a-tooltip>
<!-- 初始化区域数据弹窗 -->
</a-space>
</a-layout-header>
</template>
<script>
import { mapState, mapMutations } from "vuex";
import HeaderSite from "./HeaderSite.vue";
import MenuBar from "../components/MenuBar.vue";
import InitArea from "@/components/initarea/InitArea.vue";
export default {
components: { HeaderSite, MenuBar, InitArea },
data() {
return {
api: process.env.VUE_APP_API_basics_URL + "/",
systemName: process.env.VUE_APP_sysName,
searchActive: false,
value: undefined,
treeData: [],
visibleInit: false,
portalUrl: process.env.VUE_APP_API_portal_URL + "/#", // 门户地址
};
},
computed: {
...mapState("site", ["sysName", "sysLogo", "path", "menus"]),
...mapState("setting", ["layout"]),
current() {
const route = this.$route;
const { meta, matched } = route;
if (meta.activeMenu) {
return [meta.activeMenu];
}
return matched
.filter((item) => item.path)
.map((item) => item.path && item.path);
},
},
created() {
document.title = this.sysName ? this.sysName : this.systemName; // 设置项目标题
},
methods: {
...mapMutations("site", ["SET_secondaryRoutes"]),
changeMenu({ key }) {
this.SET_secondaryRoutes(key);
this.$router.push({ path: key });
},
},
};
</script>
<style lang="less" scoped>
.new-page-herder {
flex-shrink: 0;
padding: 0px 20px;
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%);
color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
a {
color: #fff;
}
.logo-box {
display: flex;
align-items: center;
}
.logo {
height: 32px;
margin-right: 8px;
}
.title {
margin: 0px;
margin-right: 34px;
font-weight: bold;
font-size: 18px;
color: #fff;
cursor: pointer;
}
.ant-menu-horizontal {
min-width: 200px;
height: 64px;
line-height: 64px;
// vertical-align: middle;
box-shadow: none;
background: #0000;
border: none;
.ant-menu-item,
/deep/.ant-menu-submenu-title {
top: 0;
color: rgba(254, 254, 254, 0.65);
border: none;
&:hover {
color: #fff;
}
}
/deep/.ant-menu-submenu-horizontal {
border: none;
}
/deep/.ant-menu-item-selected {
background: #1890ff !important;
color: #fff;
}
}
.header-item {
color: #fff;
}
}
</style>
<template>
<a-layout-sider>
<MenuBar mode="inline"></MenuBar>
</a-layout-sider>
</template>
<script>
import MenuBar from "../components/MenuBar.vue";
export default {
components: { MenuBar },
};
</script>
<style lang="less" scoped>
.ant-layout-sider {
background: #fff;
}
</style>
...@@ -2,8 +2,20 @@ ...@@ -2,8 +2,20 @@
<div class="app-category"> <div class="app-category">
<div class="header flex aic jcb mb20 pdr6"> <div class="header flex aic jcb mb20 pdr6">
<a-space> <a-space>
<a-button type="primary" @click="handleAdd"> 新增主题 </a-button> <a-button
<a-button type="danger" @click="handleDelAll"> 批量移除 </a-button> type="primary"
v-hasPermi="['appmarket:appTheme:add']"
@click="handleAdd"
>
新增主题
</a-button>
<a-button
type="danger"
v-hasPermi="['appmarket:appTheme:remove']"
@click="handleDelAll"
>
批量移除
</a-button>
</a-space> </a-space>
<a-input-search <a-input-search
style="width: 300px" style="width: 300px"
...@@ -52,10 +64,16 @@ ...@@ -52,10 +64,16 @@
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<span class="primary pointer" @click="handleEdit(record)" <span
class="primary pointer"
v-hasPermi="['appmarket:appTheme:edit']"
@click="handleEdit(record)"
>编辑</span >编辑</span
> >
<span class="delete pointer" @click="handleDel(record.id)" <span
class="delete pointer"
v-hasPermi="['appmarket:appTheme:remove']"
@click="handleDel(record.id)"
>删除</span >删除</span
> >
</a-space> </a-space>
......
...@@ -4,7 +4,13 @@ ...@@ -4,7 +4,13 @@
<div class="header"> <div class="header">
<div class="titel">设备应用黑名单</div> <div class="titel">设备应用黑名单</div>
<div class="control pdr6"> <div class="control pdr6">
<a-button type="danger" @click="handleDelAll"> 批量移除 </a-button> <a-button
type="danger"
v-hasPermi="['appmarket:blackapp:remove']"
@click="handleDelAll"
>
批量移除
</a-button>
<div class="business-control"> <div class="business-control">
<a-space> <a-space>
<a-input-search <a-input-search
...@@ -38,7 +44,10 @@ ...@@ -38,7 +44,10 @@
(blackAppTable.page - 1) * blackAppTable.size + index + 1 (blackAppTable.page - 1) * blackAppTable.size + index + 1
}}</span> }}</span>
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<span class="delete pointer" @click="handleDel(record.id)" <span
class="delete pointer"
v-hasPermi="['appmarket:blackapp:remove']"
@click="handleDel(record.id)"
>移除</span >移除</span
> >
</template> </template>
...@@ -113,7 +122,10 @@ ...@@ -113,7 +122,10 @@
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<span class="primary pointer" @click="handleIn(record)" <span
class="primary pointer"
v-hasPermi="['appmarket:blackapp:join']"
@click="handleIn(record)"
>加入黑名单</span >加入黑名单</span
> >
</a-space> </a-space>
...@@ -136,7 +148,7 @@ import { ...@@ -136,7 +148,7 @@ import {
getBlackAppList, getBlackAppList,
deleteBlackapp, deleteBlackapp,
} from "@/services/market"; } from "@/services/market";
import {getProductList} from "@/services/surface"; import { getProductList } from "@/services/surface";
import local from "@/utils/local"; import local from "@/utils/local";
import DevToBlack from "../modal/DevToBlack.vue"; import DevToBlack from "../modal/DevToBlack.vue";
import YTable from "@/components/YTable.vue"; import YTable from "@/components/YTable.vue";
...@@ -243,12 +255,12 @@ export default { ...@@ -243,12 +255,12 @@ export default {
async getProductList() { async getProductList() {
let res = await getProductList({ let res = await getProductList({
siteId: this.siteId, siteId: this.siteId,
page:1, page: 1,
size:-1 size: -1,
}); });
if (res.data.code === 1) { if (res.data.code === 1) {
let { data } = res.data.data; let { data } = res.data.data;
this.productList = data this.productList = data;
} }
}, },
// 获取设备黑名单 // 获取设备黑名单
......
...@@ -2,9 +2,25 @@ ...@@ -2,9 +2,25 @@
<div class="terminal"> <div class="terminal">
<div class="header flex aic jcb mb20 pdr6"> <div class="header flex aic jcb mb20 pdr6">
<a-space> <a-space>
<a-button type="primary" @click="handleAdd"> 新增应用 </a-button> <a-button
<a-button type="primary" @click="handleClone"> 克隆 </a-button> type="primary"
<a-button type="primary" @click="handleTheme"> v-hasPermi="['appmarket:moveapp:add']"
@click="handleAdd"
>
新增应用
</a-button>
<a-button
type="primary"
v-hasPermi="['appmarket:moveapp:clone']"
@click="handleClone"
>
克隆
</a-button>
<a-button
type="primary"
v-hasPermi="['appmarket:moveapp:theme']"
@click="handleTheme"
>
批量关联应用主题 批量关联应用主题
</a-button> </a-button>
<a-button v-permission="[1]" type="danger" @click="handleDelAll"> <a-button v-permission="[1]" type="danger" @click="handleDelAll">
...@@ -84,13 +100,22 @@ ...@@ -84,13 +100,22 @@
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<span class="primary pointer" @click="handleCloneAppData(record)" <span
class="primary pointer"
v-hasPermi="['appmarket:moveapp:cloneData']"
@click="handleCloneAppData(record)"
>克隆数据</span >克隆数据</span
> >
<span class="primary pointer" @click="handleEdit(record)" <span
class="primary pointer"
v-hasPermi="['appmarket:moveapp:edit']"
@click="handleEdit(record)"
>编辑</span >编辑</span
> >
<span class="primary pointer" @click="handleCheck(record.id)" <span
class="primary pointer"
v-hasPermi="['appmarket:moveapp:examine']"
@click="handleCheck(record.id)"
>查看</span >查看</span
> >
<span <span
......
...@@ -2,9 +2,25 @@ ...@@ -2,9 +2,25 @@
<div class="terminal"> <div class="terminal">
<div class="header flex aic jcb mb20 pdr6"> <div class="header flex aic jcb mb20 pdr6">
<a-space> <a-space>
<a-button type="primary" @click="handleAdd"> 新增应用 </a-button> <a-button
<a-button type="primary" @click="handleClone"> 克隆 </a-button> type="primary"
<a-button type="primary" @click="handleTheme"> v-hasPermi="['appmarket:terminalapp:add']"
@click="handleAdd"
>
新增应用
</a-button>
<a-button
type="primary"
v-hasPermi="['appmarket:terminalapp:clone']"
@click="handleClone"
>
克隆
</a-button>
<a-button
type="primary"
v-hasPermi="['appmarket:terminalapp:theme']"
@click="handleTheme"
>
批量关联应用主题 批量关联应用主题
</a-button> </a-button>
<a-button v-permission="[1]" type="danger" @click="handleDelAll"> <a-button v-permission="[1]" type="danger" @click="handleDelAll">
...@@ -84,13 +100,22 @@ ...@@ -84,13 +100,22 @@
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<span class="primary pointer" @click="handleCloneAppData(record)" <span
class="primary pointer"
v-hasPermi="['appmarket:terminalapp:cloneData']"
@click="handleCloneAppData(record)"
>克隆数据</span >克隆数据</span
> >
<span class="primary pointer" @click="handleEdit(record)" <span
class="primary pointer"
v-hasPermi="['appmarket:terminalapp:edit']"
@click="handleEdit(record)"
>编辑</span >编辑</span
> >
<span class="primary pointer" @click="handleCheck(record.id)" <span
class="primary pointer"
v-hasPermi="['appmarket:terminalapp:examine']"
@click="handleCheck(record.id)"
>查看</span >查看</span
> >
<span <span
......
...@@ -147,9 +147,9 @@ ...@@ -147,9 +147,9 @@
<script> <script>
import YSwitch from "../../../../components/yswitch/YSwitch.vue"; import YSwitch from "../../../../components/yswitch/YSwitch.vue";
import { saveApp } from "@/services/market"; import { saveApp } from "@/services/market";
import { mapGetters } from "vuex";
import { checkCodeNumber } from "@/utils/validate"; import { checkCodeNumber } from "@/utils/validate";
import YUpload from "@/components/YUpload.vue"; import YUpload from "@/components/YUpload.vue";
import { getSiteTree } from "@/services/basicsetFun";
// import local from "@/utils/local"; // import local from "@/utils/local";
export default { export default {
components: { components: {
...@@ -176,6 +176,7 @@ export default { ...@@ -176,6 +176,7 @@ export default {
data() { data() {
return { return {
api: process.env.VUE_APP_API_BASE_URL + "/", api: process.env.VUE_APP_API_BASE_URL + "/",
SiteTree: [],
labelCol: { labelCol: {
span: 3, span: 3,
}, },
...@@ -252,10 +253,35 @@ export default { ...@@ -252,10 +253,35 @@ export default {
this.$emit("update:AddVisible", val); this.$emit("update:AddVisible", val);
}, },
}, },
...mapGetters("site", ["SiteTree"]),
}, },
created() {}, created() {
this.getSiteTree();
},
methods: { methods: {
// 区域不能选择
editSelectable(arr) {
return arr.map((v) => {
if (v.children && v.children.length > 0) {
this.editSelectable(v.children);
}
if (v.type === "area") {
v.selectable = false;
v.checkable = false;
} else {
v.selectable = true;
v.checkable = true;
}
return v;
});
},
// 获取站点树
async getSiteTree() {
let res = await getSiteTree({});
let { siteTree } = res.data.data;
siteTree = this.editSelectable(siteTree);
this.SiteTree = siteTree;
},
// 关闭 // 关闭
onClose() { onClose() {
this.$refs.form.resetFields(); this.$refs.form.resetFields();
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
</template> </template>
<script> <script>
import { mapGetters } from "vuex";
import { cloneApp } from "@/services/market"; import { cloneApp } from "@/services/market";
import { getSiteTree } from "@/services/basicsetFun";
export default { export default {
props: { props: {
siteVisible: { siteVisible: {
...@@ -48,6 +48,7 @@ export default { ...@@ -48,6 +48,7 @@ export default {
data() { data() {
return { return {
siteIdList: [], // 站点id siteIdList: [], // 站点id
SiteTree: [],
replaceFields: { replaceFields: {
title: "label", title: "label",
key: "id", key: "id",
...@@ -64,9 +65,35 @@ export default { ...@@ -64,9 +65,35 @@ export default {
this.$emit("update:siteVisible", val); this.$emit("update:siteVisible", val);
}, },
}, },
...mapGetters("site", ["SiteTree"]), },
created() {
this.getSiteTree();
}, },
methods: { methods: {
// 区域不能选择
editSelectable(arr) {
return arr.map((v) => {
if (v.children && v.children.length > 0) {
this.editSelectable(v.children);
}
if (v.type === "area") {
v.selectable = false;
v.checkable = false;
} else {
v.selectable = true;
v.checkable = true;
}
return v;
});
},
// 获取站点树
async getSiteTree() {
let res = await getSiteTree({});
let { siteTree } = res.data.data;
siteTree = this.editSelectable(siteTree);
this.SiteTree = siteTree;
},
async handleOk() { async handleOk() {
if (!this.siteIdList) { if (!this.siteIdList) {
this.$message.warning("请先选择站点"); this.$message.warning("请先选择站点");
...@@ -105,4 +132,4 @@ export default { ...@@ -105,4 +132,4 @@ export default {
.tips { .tips {
font-weight: 600 !important; font-weight: 600 !important;
} }
</style> </style>
\ No newline at end of file
...@@ -6,8 +6,18 @@ ...@@ -6,8 +6,18 @@
<div class="control pdr6"> <div class="control pdr6">
<div> <div>
<a-space size="middle"> <a-space size="middle">
<a-button type="primary" @click="showModal"> 新增业务 </a-button> <a-button
<a-button type="danger" @click="handleBatchDelSiteBusiness"> type="primary"
v-hasPermi="['business:businessmanage:addSiteBusiness']"
@click="showModal"
>
新增业务
</a-button>
<a-button
type="danger"
v-hasPermi="['business:businessmanage:removeSiteBusiness']"
@click="handleBatchDelSiteBusiness"
>
批量移除 批量移除
</a-button> </a-button>
</a-space> </a-space>
...@@ -64,11 +74,13 @@ ...@@ -64,11 +74,13 @@
<a-space size="middle"> <a-space size="middle">
<span <span
class="primary pointer" class="primary pointer"
v-hasPermi="['business:businessmanage:editSiteBusiness']"
@click="handleEditSiteBusiness(record)" @click="handleEditSiteBusiness(record)"
>编辑</span >编辑</span
> >
<span <span
class="delete pointer" class="delete pointer"
v-hasPermi="['business:businessmanage:removeSiteBusiness']"
@click="handleDelSiteBusiness(record.id, record)" @click="handleDelSiteBusiness(record.id, record)"
>删除</span >删除</span
> >
...@@ -83,7 +95,11 @@ ...@@ -83,7 +95,11 @@
<div class="titel">一体化业务列表</div> <div class="titel">一体化业务列表</div>
<div class="control pdr6"> <div class="control pdr6">
<div> <div>
<a-button type="primary" @click="handleBatchJoin"> <a-button
type="primary"
v-hasPermi="['business:businessmanage:join']"
@click="handleBatchJoin"
>
批量加入 批量加入
</a-button> </a-button>
</div> </div>
...@@ -125,11 +141,15 @@ ...@@ -125,11 +141,15 @@
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<span class="primary pointer" @click="handleIn(record.id)" <span
class="primary pointer"
v-hasPermi="['business:businessmanage:join']"
@click="handleIn(record.id)"
>加入</span >加入</span
> >
<span <span
class="delete pointer" class="delete pointer"
v-hasPermi="['business:businessmanage:remove']"
@click="handleDelBusiness(+record.id)" @click="handleDelBusiness(+record.id)"
>删除</span >删除</span
> >
...@@ -538,13 +558,14 @@ export default { ...@@ -538,13 +558,14 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
position: relative;
&::after { &::after {
content: ""; content: "";
width: 1px; width: 1px;
height: 82vh; height: 100%;
position: absolute; position: absolute;
background-color: #eeeeee; background-color: #eeeeee;
top: 44px; top: 0px;
left: 50%; left: 50%;
} }
.left, .left,
......
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
<div class="titel">站点事项列表</div> <div class="titel">站点事项列表</div>
<div class="header-bottom pdr6"> <div class="header-bottom pdr6">
<div class="left-btn"> <div class="left-btn">
<a-button type="danger" @click="handleBatchDelSiteMatter"> <a-button
type="danger"
v-hasPermi="['business:mattermanage:removeSiteMatter']"
@click="handleBatchDelSiteMatter"
>
批量移除 批量移除
</a-button> </a-button>
</div> </div>
...@@ -104,13 +108,17 @@ ...@@ -104,13 +108,17 @@
<span <span
v-if="record.source == 1" v-if="record.source == 1"
class="primary pointer" class="primary pointer"
v-hasPermi="['business:mattermanage:editSiteMatter']"
@click="handleSiteEdit(record)" @click="handleSiteEdit(record)"
>编辑</span >编辑</span
> >
<span href="javascript:;" style="visibility: hidden" v-else <span href="javascript:;" style="visibility: hidden" v-else
>编辑</span >编辑</span
> >
<span class="delete pointer" @click="handleDel(record.id, record)" <span
class="delete pointer"
v-hasPermi="['business:mattermanage:removeSiteMatter']"
@click="handleDel(record.id, record)"
>移除</span >移除</span
> >
</a-space> </a-space>
...@@ -125,11 +133,27 @@ ...@@ -125,11 +133,27 @@
<div class="control pdr6"> <div class="control pdr6">
<div> <div>
<a-space size="middle"> <a-space size="middle">
<a-button type="primary" @click="handleAddAll"> <a-button
type="primary"
v-hasPermi="['business:mattermanage:join']"
@click="handleAddAll"
>
批量加入 批量加入
</a-button> </a-button>
<a-button type="primary" @click="addMatter"> 新增事项 </a-button> <a-button
<a-button type="primary" @click="handleImport"> 导入 </a-button> type="primary"
v-hasPermi="['business:mattermanage:addMatter']"
@click="addMatter"
>
新增事项
</a-button>
<a-button
type="primary"
v-hasPermi="['business:mattermanage:import']"
@click="handleImport"
>
导入
</a-button>
</a-space> </a-space>
</div> </div>
<div> <div>
...@@ -218,14 +242,19 @@ ...@@ -218,14 +242,19 @@
v-if="record.source == 1" v-if="record.source == 1"
class="primary pointer" class="primary pointer"
@click="handleEdit(record.id)" @click="handleEdit(record.id)"
v-hasPermi="['business:mattermanage:edit']"
>编辑</span >编辑</span
> >
<span style="visibility: hidden" v-else>编辑</span> <span style="visibility: hidden" v-else>编辑</span>
<span class="primary pointer" @click="handleIn(record.id)" <span
class="primary pointer"
v-hasPermi="['business:mattermanage:join']"
@click="handleIn(record.id)"
>加入</span >加入</span
> >
<span <span
class="delete pointer" class="delete pointer"
v-hasPermi="['business:mattermanage:removeMatter']"
@click="handleDelBaseMatter(record.id)" @click="handleDelBaseMatter(record.id)"
>删除</span >删除</span
> >
...@@ -636,7 +665,7 @@ export default { ...@@ -636,7 +665,7 @@ export default {
let input = document.createElement("input"); let input = document.createElement("input");
input.type = "file"; input.type = "file";
input.accept = ".xlsx"; input.accept = ".xlsx";
input.style.display = 'none'; input.style.display = "none";
document.body.appendChild(input); document.body.appendChild(input);
input.click(); input.click();
input.onchange = async () => { input.onchange = async () => {
...@@ -662,13 +691,14 @@ export default { ...@@ -662,13 +691,14 @@ export default {
.basicset-tab2 { .basicset-tab2 {
width: 100%; width: 100%;
display: flex; display: flex;
position: relative;
&::after { &::after {
content: ""; content: "";
width: 1px; width: 1px;
height: 82vh; height: 100%;
position: absolute; position: absolute;
background-color: #eeeeee; background-color: #eeeeee;
top: 44px; top: 0;
left: 45%; left: 45%;
} }
.left, .left,
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
type="danger" type="danger"
@click="batchDelSiteBusiness" @click="batchDelSiteBusiness"
:loading="delSiteBusinessLoading" :loading="delSiteBusinessLoading"
v-hasPermi="['business:businessinmanage:remove']"
> >
批量解除 批量解除
</a-button> </a-button>
...@@ -50,11 +51,13 @@ ...@@ -50,11 +51,13 @@
<a-space> <a-space>
<span <span
class="primary pointer" class="primary pointer"
v-hasPermi="['business:businessinmanage:info']"
@click="handleisUnbound(true, record)" @click="handleisUnbound(true, record)"
>关联详情</span >关联详情</span
> >
<span <span
class="delete pointer" class="delete pointer"
v-hasPermi="['business:businessinmanage:remove']"
@click="handleisUnbound(false, record)" @click="handleisUnbound(false, record)"
>解除</span >解除</span
> >
...@@ -69,7 +72,13 @@ ...@@ -69,7 +72,13 @@
<div class="titel">站点事项列表</div> <div class="titel">站点事项列表</div>
<div class="control pdr6"> <div class="control pdr6">
<div> <div>
<a-button type="primary" @click="handleAddAll"> 批量关联 </a-button> <a-button
type="primary"
@click="handleAddAll"
v-hasPermi="['business:businessinmanage:correlation']"
>
批量关联
</a-button>
</div> </div>
<div> <div>
<a-space> <a-space>
...@@ -135,7 +144,12 @@ ...@@ -135,7 +144,12 @@
</template> </template>
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<span class="primary pointer" @click="handleIn(record)">关联</span> <span
class="primary pointer"
v-hasPermi="['business:businessinmanage:correlation']"
@click="handleIn(record)"
>关联</span
>
</template> </template>
</y-table> </y-table>
</div> </div>
...@@ -701,13 +715,14 @@ export default { ...@@ -701,13 +715,14 @@ export default {
.basicset-tab3 { .basicset-tab3 {
width: 100%; width: 100%;
display: flex; display: flex;
position: relative;
&::after { &::after {
content: ""; content: "";
width: 1px; width: 1px;
height: 82vh; height: 100%;
position: absolute; position: absolute;
background-color: #eeeeee; background-color: #eeeeee;
top: 44px; top: 0;
left: 50%; left: 50%;
} }
.left, .left,
......
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
<a-space size="middle"> <a-space size="middle">
<div <div
class="workguide_btn" class="workguide_btn"
v-hasPermi="['business:workguide:hot']"
:style="{ color: record.hot == 1 ? '#03d76f' : '#1890FF' }" :style="{ color: record.hot == 1 ? '#03d76f' : '#1890FF' }"
@click="handleSiteEdit(record, 'hot')" @click="handleSiteEdit(record, 'hot')"
> >
...@@ -125,6 +126,7 @@ ...@@ -125,6 +126,7 @@
<div <div
class="workguide_btn" class="workguide_btn"
style="width: 60px" style="width: 60px"
v-hasPermi="['business:workguide:show']"
@click="handleSiteEdit(record, 'display')" @click="handleSiteEdit(record, 'display')"
> >
{{ record.display == 1 ? "取消展示" : "展示" }} {{ record.display == 1 ? "取消展示" : "展示" }}
......
...@@ -3,8 +3,20 @@ ...@@ -3,8 +3,20 @@
<div class="flex aic jcb mb20"> <div class="flex aic jcb mb20">
<div> <div>
<a-space> <a-space>
<a-button type="primary" @click="handleAdd"> 新增 </a-button> <a-button
<a-button type="danger" @click="handleDelAll"> 批量删除 </a-button> type="primary"
v-hasPermi="['deploy:statement:add']"
@click="handleAdd"
>
新增
</a-button>
<a-button
type="danger"
v-hasPermi="['deploy:statement:remove']"
@click="handleDelAll"
>
批量删除
</a-button>
</a-space> </a-space>
</div> </div>
<a-space> <a-space>
...@@ -75,10 +87,18 @@ ...@@ -75,10 +87,18 @@
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<a href="javascript:;" class="primary" @click="handleEdit(record)" <a
href="javascript:;"
class="primary"
v-hasPermi="['deploy:statement:edit']"
@click="handleEdit(record)"
>编辑</a >编辑</a
> >
<a href="javascript:;" class="delete" @click="handleDel(record.id)" <a
href="javascript:;"
class="delete"
v-hasPermi="['deploy:statement:remove']"
@click="handleDel(record.id)"
>删除</a >删除</a
> >
</a-space> </a-space>
......
...@@ -3,10 +3,19 @@ ...@@ -3,10 +3,19 @@
<div class="flex1 auto-scroll-y"> <div class="flex1 auto-scroll-y">
<div class="control pdr6"> <div class="control pdr6">
<div> <div>
<a-button type="primary" style="margin-right: 10px" @click="handleAdd" <a-button
type="primary"
style="margin-right: 10px"
v-hasPermi="['deploy:manage:add']"
@click="handleAdd"
>新增模块</a-button >新增模块</a-button
> >
<a-button type="danger" @click="handleDelAll">批量删除模块</a-button> <a-button
type="danger"
v-hasPermi="['deploy:manage:remove']"
@click="handleDelAll"
>批量删除模块</a-button
>
</div> </div>
<div class="search-box"> <div class="search-box">
<a-input-search <a-input-search
...@@ -67,10 +76,16 @@ ...@@ -67,10 +76,16 @@
<!-- <span class="primary pointer" @click="statementManage(record)" <!-- <span class="primary pointer" @click="statementManage(record)"
>配置报表</span >配置报表</span
> --> > -->
<span class="primary pointer" @click="handleEdit(record)" <span
class="primary pointer"
v-hasPermi="['deploy:manage:edit']"
@click="handleEdit(record)"
>编辑</span >编辑</span
> >
<span class="delete pointer" @click="handleDel(record.id)" <span
class="delete pointer"
v-hasPermi="['deploy:manage:remove']"
@click="handleDel(record.id)"
>删除</span >删除</span
> >
</a-space> </a-space>
......
...@@ -8,7 +8,11 @@ ...@@ -8,7 +8,11 @@
</TabHeader> </TabHeader>
<div class="department_on flex aic"> <div class="department_on flex aic">
<!-- <div class="department_manage">部门管理({{ deptTotal }}</div> --> <!-- <div class="department_manage">部门管理({{ deptTotal }}</div> -->
<a-button type="primary" @click="showModalAdd" class="department_add" <a-button
type="primary"
v-hasPermi="['department:addDept']"
@click="showModalAdd"
class="department_add"
>新增部门</a-button >新增部门</a-button
> >
<a-input-search <a-input-search
...@@ -37,7 +41,7 @@ ...@@ -37,7 +41,7 @@
</a-tooltip> </a-tooltip>
</div> </div>
<div class="department_icon_edit"> <div class="department_icon_edit">
<a-tooltip> <a-tooltip v-hasPermi="['department:editDept']">
<template slot="title"> 查看编辑 </template> <template slot="title"> 查看编辑 </template>
<a-icon <a-icon
type="edit" type="edit"
...@@ -46,7 +50,7 @@ ...@@ -46,7 +50,7 @@
@click.stop="showModal(v)" @click.stop="showModal(v)"
/> />
</a-tooltip> </a-tooltip>
<a-tooltip> <a-tooltip v-hasPermi="['department:removeDept']">
<template slot="title"> 删除 </template> <template slot="title"> 删除 </template>
<a-icon <a-icon
...@@ -78,8 +82,13 @@ ...@@ -78,8 +82,13 @@
<div class="department_right_add"> <div class="department_right_add">
<div class="flex aic jcb pdr6"> <div class="flex aic jcb pdr6">
<a-space> <a-space>
<a-button type="primary" @click="addModal">新增窗口</a-button> <a-button
<a-dropdown> type="primary"
@click="addModal"
v-hasPermi="['department:addWindow']"
>新增窗口</a-button
>
<a-dropdown v-hasPermi="['department:more']">
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1"> <a-menu-item key="1">
<a-upload <a-upload
...@@ -153,16 +162,28 @@ ...@@ -153,16 +162,28 @@
<!-- 操作 --> <!-- 操作 -->
<div slot="action" slot-scope="{ record }"> <div slot="action" slot-scope="{ record }">
<div class="flex jcb flexwrap"> <div class="flex jcb flexwrap">
<span class="primary pointer" @click="workModal(record)" <span
class="primary pointer"
v-hasPermi="['department:business']"
@click="workModal(record)"
>业务</span >业务</span
> >
<span class="primary pointer" @click="addWindowMatter(record)" <span
class="primary pointer"
v-hasPermi="['department:matter']"
@click="addWindowMatter(record)"
>事项</span >事项</span
> >
<span class="primary pointer" @click="editModal(record)" <span
class="primary pointer"
v-hasPermi="['department:editWindow']"
@click="editModal(record)"
>编辑</span >编辑</span
> >
<span class="delete pointer" @click="delWindow(record.id)" <span
class="delete pointer"
v-hasPermi="['department:removeWindow']"
@click="delWindow(record.id)"
>删除</span >删除</span
> >
</div> </div>
......
...@@ -2,8 +2,18 @@ ...@@ -2,8 +2,18 @@
<div class="hall-manage"> <div class="hall-manage">
<div class="control flex aic jcb mb20 pdr6"> <div class="control flex aic jcb mb20 pdr6">
<a-space size="middle"> <a-space size="middle">
<a-button type="primary" @click="handleAdd">新增大厅</a-button> <a-button
<a-button type="danger" @click="handleDelAll">批量删除</a-button> type="primary"
v-hasPermi="['hall:hallmanage:add']"
@click="handleAdd"
>新增大厅</a-button
>
<a-button
type="danger"
v-hasPermi="['hall:hallmanage:remove']"
@click="handleDelAll"
>批量删除</a-button
>
</a-space> </a-space>
<div class="search-box"> <div class="search-box">
<a-input-search <a-input-search
...@@ -42,10 +52,16 @@ ...@@ -42,10 +52,16 @@
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<span class="primary pointer" @click="handleEdit(record)" <span
class="primary pointer"
v-hasPermi="['hall:hallmanage:edit']"
@click="handleEdit(record)"
>编辑</span >编辑</span
> >
<span class="delete pointer" @click="handleDel(record.id)" <span
class="delete pointer"
v-hasPermi="['hall:hallmanage:remove']"
@click="handleDel(record.id)"
>删除</span >删除</span
> >
</a-space> </a-space>
......
...@@ -4,7 +4,15 @@ ...@@ -4,7 +4,15 @@
<div class="header"> <div class="header">
<div class="titel">大厅窗口</div> <div class="titel">大厅窗口</div>
<div class="control pdr6"> <div class="control pdr6">
<a-button type="danger" @click="handleDelAll"> 批量移除 </a-button> <div>
<a-button
type="danger"
@click="handleDelAll"
v-hasPermi="['hall:hallwindow:remove']"
>
批量移除
</a-button>
</div>
<div class="business-control"> <div class="business-control">
<a-space> <a-space>
<a-select <a-select
...@@ -58,7 +66,10 @@ ...@@ -58,7 +66,10 @@
}}</span> }}</span>
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<span class="delete pointer" @click="handleDel(record.id)" <span
class="delete pointer"
v-hasPermi="['hall:hallwindow:remove']"
@click="handleDel(record.id)"
>移除</span >移除</span
> >
</template> </template>
...@@ -71,7 +82,13 @@ ...@@ -71,7 +82,13 @@
<div class="titel">站点窗口</div> <div class="titel">站点窗口</div>
<div class="control pdr6"> <div class="control pdr6">
<div> <div>
<a-button type="primary" @click="handleAddAll"> 批量加入 </a-button> <a-button
type="primary"
@click="handleAddAll"
v-hasPermi="['hall:hallwindow:join']"
>
批量加入
</a-button>
</div> </div>
<div class="business-control"> <div class="business-control">
<a-space> <a-space>
...@@ -126,7 +143,10 @@ ...@@ -126,7 +143,10 @@
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<span class="primary pointer" @click="handleIn([record])" <span
class="primary pointer"
v-hasPermi="['hall:hallwindow:join']"
@click="handleIn([record])"
>加入大厅</span >加入大厅</span
> >
</a-space> </a-space>
......
...@@ -4,9 +4,15 @@ ...@@ -4,9 +4,15 @@
<div class="pd15 flex1 auto-scroll-y"> <div class="pd15 flex1 auto-scroll-y">
<div class="btn-box pdr6"> <div class="btn-box pdr6">
<!-- 新增按钮 --> <!-- 新增按钮 -->
<a-button type="primary" @click="showModal" class="skins_btn_1" <div>
>新增节日</a-button <a-button
> type="primary"
@click="showModal"
v-hasPermi="['festival:add']"
class="skins_btn_1"
>新增节日</a-button
>
</div>
<div> <div>
<a-space> <a-space>
<a-select <a-select
...@@ -67,8 +73,18 @@ ...@@ -67,8 +73,18 @@
<!-- 操作 --> <!-- 操作 -->
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<a @click="handleEdit(record)" class="primary">编辑</a> <a
<a class="delete" @click="handleDel(record.id)">删除</a> @click="handleEdit(record)"
v-hasPermi="['festival:edit']"
class="primary"
>编辑</a
>
<a
class="delete"
v-hasPermi="['festival:remove']"
@click="handleDel(record.id)"
>删除</a
>
</a-space> </a-space>
</template> </template>
</y-table> </y-table>
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
<script> <script>
import local from "@/utils/local"; import local from "@/utils/local";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import { createMenus } from "@/router"; import { calcMenu, menusFilter } from "@/router";
import { getMenuIndex } from "@/services/system";
import { generateRoutes, filterBtn } from "@/utils/util";
export default { export default {
data() { data() {
return {}; return {};
...@@ -24,18 +26,15 @@ export default { ...@@ -24,18 +26,15 @@ export default {
"SET_sysName", "SET_sysName",
"SET_sysLogo", "SET_sysLogo",
"SET_path", "SET_path",
"SET_permissions",
"SET_routes",
"SET_menusList",
"SET_secondaryRoutes",
]), ]),
// 获取token // 获取token
getToken() { getToken() {
let { let { token, userInfo, siteid, siteName, sysName, sysLogo, path } =
token, this.$route.query;
userInfo,
siteid,
siteName,
sysName,
sysLogo,
path,
} = this.$route.query;
if (token && userInfo) { if (token && userInfo) {
userInfo = JSON.parse(userInfo); userInfo = JSON.parse(userInfo);
this.SET_userInfo(userInfo); this.SET_userInfo(userInfo);
...@@ -47,9 +46,7 @@ export default { ...@@ -47,9 +46,7 @@ export default {
this.SET_path(path); this.SET_path(path);
local.setLocal("siteId", siteid); local.setLocal("siteId", siteid);
local.setLocal("siteName", siteName); local.setLocal("siteName", siteName);
// 动态菜单 this.getMenuTree();
createMenus();
this.$router.push("/website");
} else { } else {
this.$message.warning("跳转失败,请重新登录"); this.$message.warning("跳转失败,请重新登录");
setTimeout(() => { setTimeout(() => {
...@@ -57,6 +54,36 @@ export default { ...@@ -57,6 +54,36 @@ export default {
}, 2000); }, 2000);
} }
}, },
// 获取用户菜单
async getMenuTree() {
let res = await getMenuIndex();
if (res.data.code === 1) {
let {
data: { menuList },
} = res.data;
// 过滤掉按钮
let menus = filterBtn(menuList, false);
let routes = generateRoutes(menus);
routes = menusFilter(routes);
this.SET_menusList(menus);
this.setBtnPermissions(menuList);
calcMenu();
if (routes.length) {
let path = routes[0].path;
this.SET_secondaryRoutes(path);
this.$router.push(path);
} else {
this.$message.warning("暂无页面权限,请联系管理员!");
}
}
},
// 添加按钮权限字符
setBtnPermissions(menuList) {
let btnPermissions = filterBtn(menuList)
.filter((v) => v.perms)
.map((v) => v.perms);
this.SET_permissions(btnPermissions);
},
}, },
}; };
</script> </script>
......
<template>
<div class="ff">
<Standardtable
:columns="tablecolumns"
:dataSource="tabledataSource"
:bordered="true"
:selectedRows="selectedRows"
:columnsSearch="columnsSearch"
@selectedRowChange="selectedRowChange"
></Standardtable>
<show ref="pageshow" />
</div>
</template>
<script>
import table from "@/mixins/table"
import show from "./show"
export default {
mixins: [table],
data () {
return {
tablecolumns: [
{
title: "序号",
width: "70px",
customRender: this.RenderIndex
},
{
title: "菜单名称",
dataIndex: "name",
},
{
title: "操作",
width: "200px",
customRender: (text, record) => <tableActive record={record} onEdit={this.OnTableEdit} onDel={this.OnTableDel} />
},
],//表头数据
tabledataSource: [
{ id: 1, name: "测试" },
{ id: 2, name: "测试2", children: [{ id: 3, name: "2.1" }] }
],
columnsSearch: [
{ type: 'select', dataIndex: 'type', span: 5, dictionaries: [{ label: '全部', value: '' }, { label: '选项1', value: 1 }, { label: '选项2', value: 2 }], placeholder: "请选择" },
{ type: 'text', dataIndex: 'name', span: 12, width: 150, placeholder: "请输入搜索名称" }
]//表格查询条件
}
},
components: {
show
}
}
</script>
\ No newline at end of file
<template>
<a-modal
:title="title"
:visible="formVisible"
@cancel="formVisible = false"
>
<div slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button type="primary" :loading="formConfirmLoading" @click="handleOk">确定</a-button>
</div>
<slot>
<a-form-model
ref="ruleForm"
:model="formInfo"
:rules="formRules"
:label-col="{span:labelCol}"
:wrapper-col="{span: wrapperCol}"
>
<a-form-model-item label="菜单名称" prop="grade">
<w-input v-model="formInfo.grade" placeholder="请输入菜单名称"/>
</a-form-model-item>
<a-form-model-item label="菜单图标">
<w-input v-model="formInfo.name" placeholder="请输入菜单名称"/>
</a-form-model-item>
</a-form-model>
</slot>
</a-modal>
</template>
<script>
import form from "@/mixins/form"
export default {
mixins:[form],
props:{
labelCol:{
type:Number,
default:5,
},
wrapperCol:{
type:Number,
default:16,
}
},
data(){
return{
formInfo:{
grade:"",//菜单名称
},//表单提交数据
formRules:{
grade:[{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
},//表单验证
title:"提示"
}
},
methods:{
// 保存
handleOk(){
this.formSave()
},
// 新增
onAdd(){
this.title = "新增菜单"
this.formVisible = true
},
// 编辑
onEdit(row){
this.title = "编辑菜单"
this.formVisible = true
console.log(row)
}
}
}
</script>
\ No newline at end of file
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
<div class="btn-box"> <div class="btn-box">
<a-space size="middle" v-if="siteData.length"> <a-space size="middle" v-if="siteData.length">
<a-button <a-button
v-permission="[1]" v-hasPermi="['website:Sync']"
type="primary" type="primary"
@click="handleSync(siteData[0].id)" @click="handleSync(siteData[0].id)"
>同步数据</a-button >同步数据</a-button
> >
<a-button <a-button
v-permission="[1]" v-hasPermi="['website:edit']"
type="primary" type="primary"
@click="editSiteInfo(siteData[0])" @click="editSiteInfo(siteData[0])"
>编辑</a-button >编辑</a-button
> >
<a-button <a-button
v-permission="[1]" v-hasPermi="['website:remove']"
type="danger" type="danger"
@click="deleteSite(siteData[0].id, 0)" @click="deleteSite(siteData[0].id, 0)"
>删除</a-button >删除</a-button
...@@ -199,7 +199,11 @@ ...@@ -199,7 +199,11 @@
<a-empty description="暂无站点" /> <a-empty description="暂无站点" />
<div class="btn_box"> <div class="btn_box">
<div style="width: 200px"> <div style="width: 200px">
<a-button block size="large" @click="addSiteAll" <a-button
block
size="large"
v-hasPermi="['website:add']"
@click="addSiteAll"
>新增站点</a-button >新增站点</a-button
> >
</div> </div>
......
<template> <template>
<div class="configurat"> <div class="configurat">
<div class="title">短信全局配置</div> <div class="title">短信全局配置</div>
<div class="des"> <div class="des">全局配置,一键控制</div>
全局配置,一键控制 <div class="des">轻松管理政务短信通知的全局设置,确保信息的准确传递</div>
</div>
<div class="des">
轻松管理政务短信通知的全局设置,确保信息的准确传递
</div>
<div class="tag-list"> <div class="tag-list">
<div class="tag-item" v-for="v in tagList" :key="v"> <div class="tag-item" v-for="v in tagList" :key="v">
{{ v }} {{ v }}
</div> </div>
</div> </div>
<a-tooltip> <a-tooltip v-hasPermi="['configurat:switch']">
<template slot="title"> <template slot="title">
当前状态:{{ setInfo.messageoff ? "开启" : "关闭" }} 当前状态:{{ setInfo.messageoff ? "开启" : "关闭" }}
</template> </template>
......
...@@ -8,10 +8,16 @@ ...@@ -8,10 +8,16 @@
<a-button <a-button
type="primary" type="primary"
style="margin-right: 10px" style="margin-right: 10px"
v-hasPermi="['social:add']"
@click="handleAdd" @click="handleAdd"
>新增</a-button >新增</a-button
> >
<a-button type="danger" @click="handleDelAll">批量删除</a-button> <a-button
type="danger"
v-hasPermi="['social:remove']"
@click="handleDelAll"
>批量删除</a-button
>
</div> </div>
</a-space> </a-space>
</div> </div>
...@@ -31,10 +37,16 @@ ...@@ -31,10 +37,16 @@
> >
<template slot="action" slot-scope="{ record }"> <template slot="action" slot-scope="{ record }">
<a-space size="middle"> <a-space size="middle">
<span class="primary pointer" @click="handleEdit(record)" <span
class="primary pointer"
v-hasPermi="['social:edit']"
@click="handleEdit(record)"
>编辑</span >编辑</span
> >
<span class="delete pointer" @click="handleDel(record.id)" <span
class="delete pointer"
v-hasPermi="['social:remove']"
@click="handleDel(record.id)"
>删除</span >删除</span
> >
</a-space> </a-space>
......
...@@ -35,10 +35,16 @@ ...@@ -35,10 +35,16 @@
</div> </div>
</a-spin> </a-spin>
<div class="preview-btn"> <div class="preview-btn">
<a-button type="primary" style="margin-bottom: 10px" @click="AddSurface" <a-button
type="primary"
v-hasPermi="['surface:addSkin']"
style="margin-bottom: 10px"
@click="AddSurface"
>新增皮肤</a-button >新增皮肤</a-button
> >
<a-button @click="editClassify">编辑分类</a-button> <a-button @click="editClassify" v-hasPermi="['surface:editClassify']"
>编辑分类</a-button
>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -24,8 +24,16 @@ ...@@ -24,8 +24,16 @@
</div> </div>
<div class="show-btn flex aic jcc"> <div class="show-btn flex aic jcc">
<a-space size="middle"> <a-space size="middle">
<a-button type="primary" @click="editSurface">修改皮肤参数</a-button> <a-button
<a-button type="danger" @click="handleClose(curSkin.id)" type="primary"
v-hasPermi="['surface:editSkin']"
@click="editSurface"
>修改皮肤参数</a-button
>
<a-button
type="danger"
v-hasPermi="['surface:removeSkin']"
@click="handleClose(curSkin.id)"
>删除皮肤</a-button >删除皮肤</a-button
> >
</a-space> </a-space>
......
<template>
<div class="system flex flexc">
<a-tabs :activeKey="activeKey" @change="changeRouter">
<!-- <a-tab-pane key="/system/user">
<span slot="tab">
<a-icon type="user" />
用户管理
</span>
</a-tab-pane>
<a-tab-pane key="/system/role">
<span slot="tab">
<a-icon type="idcard" />
角色管理
</span>
</a-tab-pane>
<a-tab-pane key="/system/resource">
<span slot="tab">
<a-icon type="cloud-sync" />
资源管理
</span>
</a-tab-pane>
<a-tab-pane key="/system/dimension">
<span slot="tab">
<a-icon type="deployment-unit" />
维度管理
</span>
</a-tab-pane> -->
<a-tab-pane key="/system/parameter">
<span slot="tab">
<a-icon type="container" />
系统参数
</span>
</a-tab-pane>
<a-tab-pane key="/system/task">
<span slot="tab">
<a-icon type="compass" />
任务信息
</span>
</a-tab-pane>
<a-tab-pane key="/system/systemlogs">
<span slot="tab">
<a-icon type="cloud-server" />
操作日志
</span>
</a-tab-pane>
</a-tabs>
<div class="system-out-box flex1">
<router-view></router-view>
</div>
</div>
</template>
<script>
export default {
computed: {
activeKey() {
return this.$route.path;
},
},
methods: {
changeRouter(path) {
this.$router.push(path);
},
},
};
</script>
<style lang="less" scoped>
.system {
width: 100%;
height: 100%;
.system-out-box {
padding: 0px 15px 15px 15px;
overflow-y: auto;
}
/deep/.ant-tabs-nav-container {
border-bottom: 1px solid #f0f0f0 !important;
}
}
</style>
<template>
<div class="dimension-container">
<div class="control flex aic jcb mb15 pdr6">
<div>
<a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
<div class="search-box">
<a-input-search
placeholder="请输入维度名搜索"
enter-button="搜索"
v-model="searchValue"
allowClear
@search="onSearch"
/>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:loading="loading"
bordered
:scroll="{ y: 590 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space size="middle">
<span
href="javascript:;"
class="primary pointer"
@click="handleEdit(text)"
>编辑</span
>
<span
href="javascript:;"
class="delete pointer"
@click="handleDel(text.id)"
>删除</span
>
</a-space>
</template>
</a-table>
</div>
<!-- 新增 -->
<AddDimension
ref="AddDimension"
:addVisible.sync="addVisible"
:title="title"
:dict="dict"
@addSuccess="getDimensionList"
></AddDimension>
</div>
</template>
<script>
import { getDimensionList, delDimension } from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddDimension from "./modal/AddDimension";
export default {
components: { AddDimension },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "名称",
dataIndex: "dimensionName",
},
{
title: "编码",
dataIndex: "dimensionCode",
},
{
title: "类型",
dataIndex: "dimensionType",
customRender: (text) => {
return this.dict.dimensionType[text];
},
},
{
title: "维度值",
dataIndex: "dimensionValue",
},
{
title: "创建时间",
dataIndex: "createTime",
customRender: (text) => {
return this.$moment(text).format("YYYY-MM-DD HH:mm:ss");
},
},
{
title: "操作",
width: "120px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
current: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
title: "新增",
};
},
created() {
this.getDimensionList();
},
methods: {
// 获取列表
async getDimensionList() {
this.loading = true;
let res = await getDimensionList({
page: this.current,
size: this.size,
dimensionName: this.searchValue,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total, dict } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getDimensionList();
}
this.tableData = data;
this.total = total;
this.dict = dict;
}
},
// 新增
handleAdd() {
this.title = "新增";
this.$refs.AddDimension.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.current = 1;
},
// 分页
handleChange(num) {
this.current = num;
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
},
// 选择
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warn("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 编辑
handleEdit(row) {
this.title = "编辑";
this.$refs.AddDimension.onEdit(row);
this.addVisible = true;
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delDimension({ id });
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getDimensionList();
}
console.log(id);
},
onCancel() {
console.log("Cancel");
},
});
},
},
};
</script>
<style lang="less" scoped>
.dimension-container {
width: 100%;
height: 100%;
}
</style>
<template>
<div>
<a-modal
:title="title"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="名称" prop="dimensionName">
<a-input
v-model="form.dimensionName"
placeholder="请输入维度名称"
></a-input>
</a-form-model-item>
<a-form-model-item label="编号" prop="dimensionCode">
<a-input
v-model="form.dimensionCode"
placeholder="请输入维度编号"
></a-input>
</a-form-model-item>
<a-form-model-item label="类型" prop="dimensionType">
<a-select v-model="form.dimensionType" placeholder="请选择维度类型">
<a-select-option
v-for="(v, key) in dict.dimensionType"
:key="key"
:value="Number(key)"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item label="维度值" prop="dimensionValue">
<a-input
v-model="form.dimensionValue"
placeholder="请输入维度值"
></a-input>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveDimension } from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
title: {
required: true,
type: String,
default: "",
},
dict: {
required: true,
type: Object,
default: () => {},
},
},
data() {
return {
loading: false,
form: {
dimensionName: "", // 维度名称
dimensionCode: "", // 维度编码
dimensionValue: "", // 维度值
dimensionType: undefined, // 维度类型
},
rules: {
dimensionName: [
{ required: true, message: "请输入维度名称", trigger: "blur" },
],
dimensionCode: [
{ required: true, message: "请输入维度编码", trigger: "blur" },
],
dimensionValue: [
{ required: true, message: "请输入维度值", trigger: "blur" },
],
dimensionType: [
{ required: true, message: "请选择维度类型", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
created() {},
methods: {
// 新增
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await saveDimension(this.form);
let { code, msg } = res.data;
this.loading = false;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
// 重置
handleReset() {
this.$refs.form.resetFields();
},
// 关闭
handleCancel() {
this.$refs.form.resetFields();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<div class="parameter">
<div class="control flex aic jcb mb15 pdr6">
<div>
<a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
<div class="search-box">
<a-space>
<a-input
placeholder="请输入参数名搜索"
v-model="searchForm.name"
allowClear
/>
<a-button type="primary" @click="onSearch">搜索</a-button>
<a-button @click="resetSearch">重置</a-button>
</a-space>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<y-table
:columns="columns"
:data="tableData"
:pageSize.sync="size"
:page.sync="page"
:total="total"
:loading="loading"
:scroll="{ y: 560 }"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
@changePagination="getSystemParameterList"
>
<span slot="index" slot-scope="{ index }">{{
(page - 1) * size + index + 1
}}</span>
<!-- 有效状态 -->
<template slot="validStatus" slot-scope="{ record }">
<a-tag>{{ dict.validStatus[record.validStatus] }} </a-tag>
</template>
<!-- 修改状态 -->
<template slot="modStatus" slot-scope="{ record }">
<a-tag>{{ dict.modStatus[record.modStatus] }} </a-tag>
</template>
<!-- 展现类型 -->
<template slot="displayType" slot-scope="{ record }">
<!-- {{ text.displayType || "--" }} -->
<a-tag>{{ dict.displayType[record.displayType] }} </a-tag>
</template>
<!-- 操作 -->
<template slot="action" slot-scope="{ record }">
<a-space size="middle">
<span
href="javascript:;"
class="primary pointer"
@click="handleEdit(record)"
>编辑</span
>
<span
href="javascript:;"
class="delete pointer"
@click="handleDel(record.id)"
>删除</span
>
</a-space>
</template>
</y-table>
</div>
<!-- 新增 -->
<AddParameter
ref="AddParameter"
:addVisible.sync="addVisible"
:title="title"
:dict="dict"
@addSuccess="getSystemParameterList"
></AddParameter>
</div>
</template>
<script>
import { getSystemParameterList, delSystemParameter } from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddParameter from "./modal/AddParameter.vue";
import YTable from "@/components/YTable.vue";
export default {
components: {
AddParameter,
YTable,
},
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "index",
},
},
{
title: "参数名称",
dataIndex: "name",
},
{
title: "一级组织",
// dataIndex: "firstOrganize",
customRender: (text) => {
return text.firstOrganize || "--";
},
},
{
title: "二级组织",
// dataIndex: "secondOrganize",
customRender: (text) => {
return text.secondOrganize || "--";
},
},
{
title: "参数键",
dataIndex: "paramKey",
},
{
title: "参数值",
dataIndex: "paramValue",
},
{
title: "有效状态",
// dataIndex: "validStatus",
scopedSlots: {
customRender: "validStatus",
},
// customRender: (text) => {
// return this.filterItems(text.validStatus, this.dict.validStatus);
// },
},
{
title: "修改状态",
scopedSlots: {
customRender: "modStatus",
},
},
{
title: "展现类型",
scopedSlots: {
customRender: "displayType",
},
},
{
title: "备注",
// dataIndex: "remark",
customRender: (text) => {
return text.remark || "--";
},
},
{
title: "操作",
width: "120px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
page: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
searchForm: {
name: "",
},
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
title: "新增",
};
},
created() {
this.getSystemParameterList();
},
methods: {
// 获取参数列表
async getSystemParameterList() {
this.loading = true;
let res = await getSystemParameterList({
page: this.page,
size: this.size,
name: `%${this.searchForm.name}%`,
});
this.loading = false;
if (res.data.code == 1) {
let { total, data, dict } = res.data.data;
this.dict = dict;
if (!data.length && this.page > 1) {
this.page -= 1;
this.getSystemParameterList();
}
this.total = total;
this.tableData = data;
}
},
// 新增
handleAdd() {
this.title = "新增";
this.$refs.AddParameter.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.page = 1;
this.selectedRowKeys = [];
this.getSystemParameterList();
},
// 重置搜索
resetSearch() {
this.page = 1;
this.selectedRowKeys = [];
Object.assign(this.searchForm, this.$options.data().searchForm);
this.getSystemParameterList();
},
// 选择
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warn("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 编辑
handleEdit(row) {
this.title = "编辑";
this.$refs.AddParameter.onEdit(row);
this.addVisible = true;
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delSystemParameter({ id });
let { code, msg } = res.data;
if (code == 1) {
_this.$message.success(msg);
_this.selectedRowKeys = [];
_this.getSystemParameterList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
},
};
</script>
<style lang="less" scoped>
.parameter {
width: 100%;
height: 100%;
}
</style>
<template>
<div>
<a-modal
:title="title"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
>
<template slot="footer">
<a-space>
<a-button @click="handleReset">重置</a-button>
<a-upload
name="file"
:show-upload-list="false"
:action="api + 'base/file/commonupload'"
@change="handleUpload"
>
<a-button type="primary">文件上传</a-button>
</a-upload>
<a-button type="primary" @click="handleOk">确定</a-button>
</a-space>
</template>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="参数名称" prop="name">
<a-input v-model="form.name" placeholder="请输入参数名称" />
</a-form-model-item>
<a-form-model-item label="一级组织" prop="firstOrganize">
<a-input v-model="form.firstOrganize" placeholder="请输入一级组织" />
</a-form-model-item>
<a-form-model-item label="二级组织" prop="secondOrganize">
<a-input v-model="form.secondOrganize" placeholder="请输入二级组织" />
</a-form-model-item>
<a-form-model-item label="参数键" prop="paramKey">
<a-input v-model="form.paramKey" placeholder="请输入参数键" />
</a-form-model-item>
<a-form-model-item label="参数值" prop="paramValue">
<a-input v-model="form.paramValue" placeholder="请输入参数值" />
</a-form-model-item>
<a-form-model-item label="参数修改状态" prop="modStatus">
<a-select v-model="form.modStatus" placeholder="请选择参数修改状态">
<a-select-option
v-for="(v, key) in dict.modStatus"
:key="key"
:value="Number(key)"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item label="展现类型" prop="displayType">
<!-- <a-input v-model="form.displayType" placeholder="请输入排序" /> -->
<a-select v-model="form.displayType" placeholder="请选择展现类型">
<a-select-option
v-for="(v, key) in dict.displayType"
:key="key"
:value="Number(key)"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item label="参数有效状态" prop="validStatus">
<a-radio-group v-model="form.validStatus">
<a-radio
v-for="(v, key) in dict.validStatus"
:value="Number(key)"
:key="key"
>{{ v }}</a-radio
>
</a-radio-group>
</a-form-model-item>
<a-form-model-item label="备注" prop="remark">
<a-textarea
:autoSize="{ minRows: 4, maxRows: 4 }"
v-model="form.remark"
placeholder="请输入备注"
allow-clear
/>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveSystemParameter } from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
title: {
required: true,
type: String,
default: "",
},
dict: {
required: true,
type: Object,
default: () => {
return {};
},
},
},
data() {
return {
api: process.env.VUE_APP_API_BASE_URL + "/",
form: {
name: "", // 参数名称
firstOrganize: "", // 一级组织
secondOrganize: "", // 二级组织
paramKey: "", // 参数键
paramValue: "", // 参数值
modStatus: undefined, // 参数修改状态
displayType: undefined, // 展现类型
validStatus: "", // 参数有效状态
remark: "", // 备注
},
rules: {
name: [{ required: true, message: "请输入参数名称", trigger: "blur" }],
paramKey: [
{ required: true, message: "请输入参数键", trigger: "blur" },
],
paramValue: [
{ required: true, message: "请输入参数值", trigger: "blur" },
],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
methods: {
// 关闭弹窗
handleCancel() {
this.$refs.form.resetFields();
this.Visible = false;
},
// 重置
handleReset() {
this.$refs.form.resetFields();
},
// 新增
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
let res = await saveSystemParameter(this.form);
let { code, msg } = res.data;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
// 文件上传
handleUpload({ file }) {
if (file.status === "done") {
let { code, url, msg } = file.response;
if (code == 1) {
this.form.paramValue = url;
} else {
this.$message.error(msg);
}
}
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<div class="resource-container">
<div class="control flex aic jcb mb15 pdr6">
<a-space>
<a-button type="primary" @click="handleAdd">新增</a-button>
<a-button
v-permission="[1]"
type="primary"
class="addclass"
@click="refSresource"
>刷新资源</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</a-space>
<div class="search-box">
<a-input-search
placeholder="请输入资源名搜索"
enter-button="搜索"
v-model="searchValue"
allowClear
@search="onSearch"
/>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:loading="loading"
bordered
:scroll="{ y: 590 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space size="middle">
<span
href="javascript:;"
class="primary pointer"
@click="handleEdit(text)"
>编辑</span
>
<span
href="javascript:;"
class="delete pointer"
@click="handleDel(text.id)"
>删除</span
>
</a-space>
</template>
</a-table>
</div>
<!-- 新增、编辑 -->
<AddResurce
ref="AddResurce"
:title="title"
:visible.sync="addVisible"
:dict="dict"
@add="getResourceList"
></AddResurce>
</div>
</template>
<script>
import {
getResourceList,
refreshResource,
delResource,
} from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddResurce from "./modal/AddResurce.vue";
export default {
components: { AddResurce },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "名称",
width: 400,
dataIndex: "name",
},
{
title: "资源",
dataIndex: "url",
customRender: (text) => {
if (text) {
return text.split(",").map((v) => {
return (
<a-tag style="margin-bottom:4px" color="blue">
{v}
</a-tag>
);
});
}
},
},
{
title: "认证类型",
width: 200,
dataIndex: "authType",
customRender: (text) => {
return this.dict.authType[text];
},
},
{
title: "操作",
width: "120px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
current: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
title: "新增",
};
},
created() {
this.getResourceList();
},
methods: {
// 获取资源列表
async getResourceList() {
this.loading = true;
let res = await getResourceList({
page: this.current,
size: this.size,
name: `%${this.searchValue}%`,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total, dict } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getResourceList();
}
this.tableData = data;
this.total = total;
this.dict = dict;
}
},
// 新增
handleAdd() {
this.title = "新增";
this.$refs.AddResurce.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.current = 1;
this.getResourceList();
},
// 分页
handleChange(num) {
this.current = num;
this.getResourceList();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
this.getResourceList();
},
// 选择
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warn("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 编辑
handleEdit(row) {
this.title = "编辑";
this.$refs.AddResurce.onEdit(row);
this.addVisible = true;
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delResource({ id });
if (res.data.code == 1) {
let { msg } = res.data;
_this.$message.success(msg);
_this.getResourceList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 刷新资源
async refSresource() {
let _this = this;
this.$confirm({
title: "系统提示",
content: "确定要刷新资源吗?",
okText: "",
cancelText: "",
centered: true,
async onOk() {
let res = await refreshResource();
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getResourceList();
}
},
});
},
},
};
</script>
<style lang="less" scoped>
.resource-container {
width: 100%;
height: 100%;
}
</style>
<template>
<div class="add-resurce">
<a-modal
:title="title"
:centered="true"
:visible="Visible"
@cancel="handleCancel"
width="30%"
:maskClosable="false"
>
<a-form-model
:label-col="{
span: 5,
}"
:wrapper-col="{
span: 19,
}"
ref="form"
:model="form"
:rules="rules"
>
<a-form-model-item label="资源名称" prop="name">
<a-input
placeholder="请输入资源名称"
allowClear
v-model="form.name"
/>
</a-form-model-item>
<a-form-model-item label="权限类型" prop="authType">
<a-select v-model="form.authType" placeholder="请选择权限类型">
<a-select-option
v-for="(v, key) in dict.authType"
:key="key"
:value="Number(key)"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item class="url-params-box" label="链接地址">
<a-form-model-item
class="url-params"
v-for="(v, i) in form.urls"
:key="i"
:prop="`urls.${i}.value`"
:rules="[
{ required: true, validator: validatorUrl, trigger: 'blur' },
]"
>
<a-input
class="mr10"
v-model="v.value"
placeholder="请输入链接地址"
/>
<a-space>
<a-button type="primary" @click="changeParams(i, 'add')"
><a-icon type="plus"
/></a-button>
<a-button
type="danger"
v-if="i > 0"
@click="changeParams(i, 'remove')"
><a-icon type="minus"
/></a-button>
</a-space>
</a-form-model-item>
</a-form-model-item>
</a-form-model>
<template slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button
type="primary"
class="addclass"
:loading="loading"
@click="subForm"
>确定</a-button
>
</template>
</a-modal>
</div>
</template>
<script>
import { saveResource } from "@/services/system";
export default {
props: {
title: {
required: true,
type: String,
default: "新增资源",
},
visible: {
required: true,
type: Boolean,
default: false,
},
dict: {
required: true,
type: Object,
default: () => {},
},
},
data() {
return {
loading: false,
form: {
name: "",
authType: undefined,
url: "",
urls: [
{
value: "",
},
],
},
rules: {
name: [{ required: true, message: "请输入资源名称", trigger: "blur" }],
authType: [
{ required: true, message: "请输选择权限类型", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:visible", val);
},
},
},
methods: {
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
onEdit(row) {
setTimeout(() => {
this.form = { ...row };
let arr = [];
if (this.form.url) {
arr = this.form.url.split(",").map((v) => {
return {
value: v,
};
});
}
this.$set(this.form, "urls", arr);
}, 10);
},
subForm() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await saveResource({
...this.form,
url: this.form.urls.map((v) => v.value).join(","),
});
let { code, msg } = res.data;
this.loading = false;
if (code == 1) {
this.$message.success(msg);
this.$emit("add");
this.handleCancel();
}
}
});
},
// 判断是否存在链接
isRepeat(val) {
return this.form.urls.filter((v) => v.value == val).length > 1;
},
// 校验链接地址
validatorUrl(rule, value, callback) {
if (!value) {
callback(new Error("请输入链接"));
} else if (this.isRepeat(value)) {
callback(new Error("重复的链接地址"));
} else {
callback();
}
},
changeParams(index, type) {
if (type == "add") {
let obj = {
value: "",
};
if (this.form.urls.some((v) => !v.value)) {
this.$message.warning("请先完成前面地址的填写");
return;
}
this.form.urls.splice(index + 1, 0, obj);
} else {
this.form.urls.splice(index, 1);
}
// this.$forceUpdate();
},
resetForm() {
// 重置还原表单信息内容
this.$refs.form.resetFields();
this.$set(this.form, "urls", [{ value: "" }]);
},
handleCancel() {
this.resetForm();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped>
/deep/.ant-modal-body {
max-height: 600px;
overflow-y: auto;
}
/deep/.url-params-box {
display: block !important;
.ant-form-item-children {
display: block;
}
}
/deep/.url-params {
.ant-form-item-children {
display: flex;
align-items: center;
}
}
</style>
<template>
<div class="role-container">
<div class="control flex aic jcb mb15 pdr6">
<div>
<a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
<div class="search-box">
<a-input-search
placeholder="请输入角色名搜索"
enter-button="搜索"
v-model="searchValue"
allowClear
@search="onSearch"
/>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:loading="loading"
bordered
:scroll="{ y: 590 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space size="middle">
<span class="primary pointer" @click="apportion(text)"
>分配资源</span
>
<span class="primary pointer" @click="handleResDim(text)"
>资源规则</span
>
<span class="primary pointer" @click="handleEdit(text)">编辑</span>
<span class="delete pointer" @click="handleDel(text.id)">删除</span>
</a-space>
</template>
</a-table>
</div>
<!-- 新增 -->
<AddRole
ref="AddRole"
:title="title"
:addVisible.sync="addVisible"
@addSuccess="getRoleList"
></AddRole>
<!-- 分配资源 -->
<ApportionRes ref="ApportionRes" :visible.sync="resVisible"></ApportionRes>
<!-- 资源规则 -->
<ResDimList ref="ResDimList" :visible.sync="resDimListVisible"></ResDimList>
</div>
</template>
<script>
import { getRoleList, delRole } from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddRole from "./modal/AddRole.vue";
import ApportionRes from "./modal/ApportionRes.vue";
import ResDimList from "./modal/ResDimList.vue";
export default {
components: { AddRole, ApportionRes, ResDimList },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "角色名称",
dataIndex: "name",
},
{
title: "备注",
dataIndex: "remark",
},
{
title: "操作",
width: "20% ",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
current: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
resVisible: false,
resDimListVisible: false,
title: "新增角色",
};
},
created() {
this.getRoleList();
},
methods: {
// 获取角色列表
async getRoleList() {
this.loading = true;
let res = await getRoleList({
current: this.current,
size: this.size,
name: this.searchValue,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getRoleList();
}
this.tableData = data;
this.total = total;
}
},
// 新增
handleAdd() {
this.title = "新增角色";
this.$refs.AddRole.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.current = 1;
this.getRoleList();
},
// 分页
handleChange(num) {
this.current = num;
this.getRoleList();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
this.getRoleList();
},
// 选择
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warn("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 编辑
handleEdit(row) {
this.title = "编辑角色";
this.$refs.AddRole.onEdit(row);
this.addVisible = true;
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delRole({ id });
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getRoleList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 分配资源
apportion(row) {
this.$refs.ApportionRes.onAdd(row.id);
this.resVisible = true;
},
// 资源维度
handleResDim(row) {
this.$refs.ResDimList.getRoleInfo(row);
this.resDimListVisible = true;
},
},
};
</script>
<style lang="less" scoped>
.role-container {
width: 100%;
height: 100%;
}
</style>
<template>
<div>
<a-modal
:title="title"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
:zIndex="1001"
>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="所属资源" prop="resourceId">
<a-cascader
:options="resourceList"
v-model="resource"
placeholder="请选择资源"
@change="changeRes"
/>
</a-form-model-item>
<a-form-model-item label="所属维度" prop="ruleCode">
<a-select
allowClear
v-model="form.ruleCode"
@change="changeDim"
placeholder="请选择所属维度"
>
<a-select-option
v-for="v in dimensionList"
:key="v.id"
:value="v.dimensionCode"
:dataset-row="v"
>
{{ v.dimensionName }}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="规则条件" prop="ruleCondition">
<a-select
allowClear
v-model="form.ruleCondition"
placeholder="请选择规则条件"
>
<a-select-option
v-for="(v, key) in dict.ruleCondition"
:key="key"
:value="key"
>
{{ v }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-form-model>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
>
</a-modal>
</div>
</template>
<script>
import {
getDimensionList,
getResourceList,
saveDimRes,
} from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
title: {
required: true,
type: String,
default: "",
},
dict: {
required: true,
type: Object,
default: () => {},
},
},
data() {
return {
loading: false,
resource: [],
dimensionList: [], // 维度列表
resourceList: [], // 资源列表
form: {
roleId: "", // 角色id
resourceId: "", // 资源id
ruleCode: undefined, // 维度编码
ruleName: "", // 维度名称
ruleCondition: undefined, // 规则条件
ruleValue: "", // 维度值
ruleType: "", // 维度类型
roleName: "", // 角色名称
resourceName: "", // 资源名称
},
rules: {
resourceId: [
{ required: true, message: "请选择资源", trigger: "change" },
],
ruleCode: [
{ required: true, message: "请选择维度", trigger: "change" },
],
ruleCondition: [
{ required: true, message: "请选择规则条件", trigger: "change" },
],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
created() {
this.getDimensionList();
this.getResourceList();
},
methods: {
// 获取维度列表
async getDimensionList() {
let res = await getDimensionList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.dimensionList = data;
}
},
// 获取资源列表
async getResourceList() {
let res = await getResourceList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.resourceList = this.groupByAuth(data);
}
},
// 资源分组
groupByAuth(list) {
let group = {};
let groupList = [];
list.forEach((item) => {
let name = item.name.split("-")[0];
if (!group[name]) {
group[name] = {
indeterminate: false,
checkAll: false,
list: [],
};
}
group[name].list.push(item);
});
groupList = Object.keys(group).map((key) => {
return {
label: key,
value: key,
children: group[key].list.map((v) => {
return {
label: v.name,
value: v.id,
};
}),
};
});
return groupList;
},
// 选择资源
changeRes(val, selectedOptions) {
if (selectedOptions.length) {
this.form.resourceId = selectedOptions[1].value;
this.form.resourceName = selectedOptions[1].label;
} else {
this.form.resourceId = "";
this.form.resourceName = "";
}
},
// 选择维度
changeDim(val, e) {
if (val && e) {
let { dimensionName, dimensionType, dimensionValue } = e.data.attrs[
"dataset-row"
];
this.form.ruleName = dimensionName;
this.form.ruleType = dimensionType;
this.form.ruleValue = dimensionValue;
} else {
this.form.ruleName = "";
this.form.ruleType = "";
this.form.ruleValue = "";
}
},
// 新增
onAdd(roleInfo) {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
this.form.roleId = roleInfo.id;
this.form.roleName = roleInfo.name;
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
let resName = this.form.resourceName.split("-")[0];
this.resource = [resName, this.form.resourceId];
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await saveDimRes(this.form);
let { code, msg } = res.data;
this.loading = false;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
// 重置
handleReset() {
this.$refs.form.resetFields();
this.form.ruleName = "";
this.form.ruleType = "";
this.form.ruleValue = "";
this.form.resourceId = "";
this.form.resourceName = "";
this.resource = [];
},
// 关闭
handleCancel() {
this.handleReset();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<div>
<a-modal
:title="title"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button
slot="footer"
type="primary"
:loading="loading"
@click="handleOk"
>确定</a-button
>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="名称" prop="name">
<a-input v-model="form.name" placeholder="请输入角色名称"></a-input>
</a-form-model-item>
<a-form-model-item label="备注" prop="remark">
<a-textarea
v-model="form.remark"
placeholder="请输入备注"
></a-textarea>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveRole } from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
title: {
required: true,
type: String,
default: "",
},
},
data() {
return {
loading: false,
form: {
name: "",
remark: "",
roleType: 2,
},
rules: {
name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
created() {},
methods: {
// 新增
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.loading = true;
let res = await saveRole(this.form);
let { code, msg } = res.data;
this.loading = false;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
// 重置
handleReset() {
this.$refs.form.resetFields();
},
// 关闭
handleCancel() {
this.$refs.form.resetFields();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<div class="apportion-res">
<a-modal
title="分配资源"
:centered="true"
:visible="Visible"
@cancel="handleCancel"
width="40%"
:maskClosable="false"
>
<div class="mb10" v-for="(v, key) in resourceList" :key="key">
<div class="mb10" :style="{ borderBottom: '1px solid #E9E9E9' }">
<span class="title">{{ key }}</span>
<a-checkbox
:indeterminate="v.indeterminate"
:checked="v.checkAll"
@change="onCheckAllChange($event, v)"
>
全选
</a-checkbox>
</div>
<a-checkbox-group
style="width:100%"
:value="form.resourceIdList"
@change="onChange($event, v)"
>
<a-row>
<a-col :span="12" v-for="item in v.list" :key="item.id">
<a-checkbox :value="item.id">
{{ item.name }}
</a-checkbox>
</a-col>
</a-row>
</a-checkbox-group>
</div>
<template slot="footer">
<a-button @click="resetForm">重置</a-button>
<a-button type="primary" class="addclass" @click="subForm"
>确定</a-button
>
</template>
</a-modal>
</div>
</template>
<script>
import {
getRoleResourceList,
getResourceList,
saveRoleResource,
} from "@/services/system";
export default {
props: {
visible: {
required: true,
type: Boolean,
default: false,
},
},
data() {
return {
form: {
resourceIdList: [],
roleId: "",
},
rules: {},
resourceList: {}, // 资源列表
userResourceList: [], // 用户资源列表
};
},
computed: {
Visible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:visible", val);
},
},
},
methods: {
// 获取资源列表
async getResourceList() {
let res = await getResourceList({
page: 1,
size: -1,
});
if (res.data.code == 1) {
let { data } = res.data.data;
this.resourceList = this.groupByAuth(data);
}
},
// 获取角色资源权限列表
async getRoleResourceList(roleId) {
let res = await getRoleResourceList({
size: -1,
page: 1,
roleId,
});
if (res.data.code == 1) {
let { data } = res.data.data;
let arr = data.filter((v) => v.resourceId);
this.form.resourceIdList = arr.map((v) => v.resourceId);
}
},
// 权限分组
groupByAuth(list) {
let group = {};
list.forEach((item) => {
let name = item.name.split("-")[0];
if (!group[name]) {
group[name] = {
indeterminate: false,
checkAll: false,
list: [],
};
}
group[name].list.push(item);
});
return group;
},
// 控制全选
onCheckAllChange(e, row) {
let rowIds = row.list.map((v) => v.id);
let checked = e.target.checked;
row.indeterminate = false;
row.checkAll = checked;
if (checked) {
this.form.resourceIdList = [
...new Set([...this.form.resourceIdList, ...rowIds]),
];
} else {
this.form.resourceIdList = this.form.resourceIdList.filter((v) => {
return !rowIds.includes(v);
});
}
},
// 控制单选
onChange(checkedList, row) {
let rowIds = row.list.map((v) => v.id);
this.form.resourceIdList = this.form.resourceIdList.filter((v) => {
return !rowIds.includes(v);
});
this.form.resourceIdList = [
...new Set([...this.form.resourceIdList, ...checkedList]),
];
row.indeterminate =
!!checkedList.length && checkedList.length < rowIds.length;
row.checkAll = checkedList.length === rowIds.length;
},
onAdd(roleId) {
Object.assign(this.form, this.$options.data().form);
this.form.roleId = roleId;
this.getResourceList();
this.getRoleResourceList(roleId);
},
async subForm() {
let res = await saveRoleResource(this.form);
if (res.data.code == 1) {
this.$message.success("添加成功");
this.handleCancel();
}
},
resetForm() {
this.form.resourceIdList = [];
Object.keys(this.resourceList).forEach((key) => {
this.resourceList[key].checkAll = false;
this.resourceList[key].indeterminate = false;
});
// 重置还原表单信息内容
// this.$refs.form.resetFields();
},
handleCancel() {
this.resetForm();
this.Visible = false;
},
},
};
</script>
<style lang="less" scoped>
/deep/.ant-modal-body {
max-height: 700px;
overflow-y: auto;
}
.title {
margin-right: 1em;
font-size: 18px;
font-weight: bold;
}
</style>
<template>
<div>
<a-drawer
title="资源规则"
:visible="Visible"
@close="onClose"
:maskClosable="false"
:destroyOnClose="true"
width="50%"
>
<div class="mb10">
角色名称:<span class="primary">{{ roleInfo.name }}</span>
</div>
<div class="search-box flex aic jcb mb20">
<div>
<a-space>
<a-button type="primary" @click="handleAdd"> 新增 </a-button>
<a-button type="danger" @click="handleDelAll"> 批量删除 </a-button>
</a-space>
</div>
<a-input-search
style="width: 300px"
placeholder="请输入维度名称搜索"
enter-button="搜索"
v-model="searchVal"
allowClear
@search="onSearch"
/>
</div>
<!-- 表格 -->
<div class="table-content">
<a-table
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
size="small"
:loading="loading"
bordered
:scroll="{ y: 460 }"
:columns="columns"
:pagination="{
showTotal: (total) => `共 ${total} 条`,
current: current,
total: total,
pageSize: size,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: pageSizeOptions,
onChange: handleChange,
onShowSizeChange: showSizeChange,
}"
:data-source="tableData"
:rowKey="(record) => record.id"
>
<!-- 序号 -->
<span slot="num" slot-scope="text, record, index">{{
(current - 1) * size + index + 1
}}</span>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-space>
<a href="javascript:;" class="edit" @click="handleEdit(text)"
>编辑</a
>
<a href="javascript:;" class="delete" @click="handleDel(text.id)"
>删除</a
>
</a-space>
</template>
</a-table>
</div>
<AddResDim
ref="AddResDim"
:addVisible.sync="addVisible"
:title="title"
:dict="dict"
@addSuccess="getDimResList"
></AddResDim>
</a-drawer>
</div>
</template>
<script>
import { pageSizeOptions } from "@/config/pageConfig.js";
import { getDimResList, delDimRes } from "@/services/system";
import AddResDim from "./AddResDim.vue";
export default {
props: {
visible: {
type: Boolean,
require: true,
default: false,
},
},
components: { AddResDim },
data() {
const columns = [
{
title: "序号",
dataIndex: "num",
width: "65px",
scopedSlots: {
customRender: "num",
},
},
{
title: "维度名称",
dataIndex: "ruleName",
},
{
title: "维度编码",
dataIndex: "ruleCode",
},
{
title: "维度类型",
dataIndex: "ruleType",
},
{
title: "维度值",
dataIndex: "ruleValue",
},
{
title: "所属资源",
dataIndex: "resourceName",
},
{
title: "规则条件",
dataIndex: "ruleCondition",
customRender: (text) => {
return this.dict.ruleCondition[text];
},
},
{
title: "创建时间",
dataIndex: "createTime",
customRender: (text) => {
return this.$moment(text).format("YYYY-MM-DD HH:mm:ss");
},
},
{
title: "操作",
width: "100px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
roleInfo: {}, // 模块信息
loading: false,
total: 0,
size: 10,
current: 1,
pageSizeOptions,
selectedRowKeys: [],
tableData: [],
addVisible: false,
title: "新增",
searchVal: "",
dict: {}, // 字典
};
},
computed: {
Visible: {
get() {
return this.visible;
},
set(val) {
this.$emit("update:visible", val);
},
},
},
methods: {
// 获取模块信息
getRoleInfo(roleInfo) {
this.roleInfo = roleInfo;
this.getDimResList();
},
// 获取列表
async getDimResList() {
this.loading = true;
let res = await getDimResList({
current: this.current,
size: this.size,
roleId: this.roleInfo.id,
ruleName: `%${this.searchVal}%`,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total, dict } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getDimResList();
}
this.total = total;
this.tableData = data;
this.dict = dict;
}
},
handleAdd() {
this.title = "新增";
this.addVisible = true;
this.$refs.AddResDim.onAdd(this.roleInfo);
},
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warning("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 关闭抽屉
onClose() {
this.searchVal = "";
this.selectedRowKeys = [];
this.Visible = false;
},
// 搜索
onSearch() {
this.current = 1;
this.getDimResList();
},
// 编辑
handleEdit(row) {
this.title = "编辑";
this.addVisible = true;
this.$refs.AddResDim.onEdit(row);
},
// 翻页
handleChange(cur) {
this.current = cur;
this.getDimResList();
},
// 改变每页显示数量
showSizeChange(current, size) {
this.current = current;
this.size = size;
this.getDimResList();
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delDimRes({ id });
if (res.data.code == 1) {
_this.$message.success(res.data.msg);
_this.getDimResList();
}
},
});
},
// 选中
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
},
};
</script>
<style lang="less" scoped></style>
<template>
<!-- 系统日志 -->
<div class="system-logs">
<div class="control pdr6">
<div class="search-box">
<a-input-search
placeholder="请输入请求地址搜索"
enter-button="搜索"
v-model="searchValue"
allowClear
@search="onSearch"
/>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<y-table
:columns="columns"
:data="tableData"
:pageSize.sync="size"
:page.sync="page"
:total="total"
:loading="loading"
:scroll="{ y: 560 }"
@changePagination="getSystemLogsList"
>
<span slot="index" slot-scope="{ index }">{{
(page - 1) * size + index + 1
}}</span>
<!-- 操作时间 -->
<template slot="logDate" slot-scope="{ record }">
{{ record.logDate | dateFormat }}
</template>
</y-table>
</div>
</div>
</template>
<script>
import { getSystemLogsList } from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import YTable from "@/components/YTable.vue";
const columns = [
{
title: "序号",
width: "65px",
scopedSlots: {
customRender: "index",
},
},
{
title: "用户名称",
dataIndex: "userName",
},
{
title: "登录名称",
dataIndex: "loginName",
},
{
title: "请求地址",
dataIndex: "requestUrl",
},
{
title: "操作内容",
dataIndex: "content",
},
{
title: "操作IP地址",
dataIndex: "ip",
},
{
title: "操作时间",
scopedSlots: {
customRender: "logDate",
},
},
];
export default {
components: {
YTable,
},
data() {
return {
columns,
loading: false,
current: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
tableData: [],
};
},
created() {
this.getSystemLogsList();
},
methods: {
// 获取日志列表
async getSystemLogsList() {
this.loading = true;
let res = await getSystemLogsList({
page: this.current,
size: this.size,
requestUrl: this.searchValue,
});
this.loading = false;
if (res.data.code == 1) {
let { data, total } = res.data.data;
this.tableData = data;
this.total = total;
}
},
// 搜索
onSearch() {
this.current = 1;
this.getSystemLogsList();
},
},
};
</script>
<style lang="less" scoped>
.system-logs {
width: 100%;
height: 100%;
.control {
display: flex;
justify-content: flex-end;
margin-bottom: 15px;
}
}
</style>
<template>
<div class="task-set">
<div class="control flex aic jcb mb15 pdr6">
<div>
<a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增</a-button
>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
<div class="search-box">
<a-input-search
placeholder="请输入任务名搜索"
enter-button="搜索"
v-model="searchValue"
allowClear
@search="onSearch"
/>
</div>
</div>
<!-- 表格 -->
<div class="table-content">
<y-table
:columns="columns"
:data="tableData"
:pageSize.sync="size"
:page.sync="page"
:total="total"
:loading="loading"
:scroll="{ y: 560 }"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
@changePagination="getSystemTaskList"
>
<span slot="index" slot-scope="{ index }">{{
(page - 1) * size + index + 1
}}</span>
<!-- 执行策略 -->
<template slot="excuteStrategy" slot-scope="{ record }">
<a-tag>{{ dict.excuteStrategy[record.excuteStrategy] }} </a-tag>
</template>
<!-- 最后执行时间 -->
<template slot="lastExcuteTime" slot-scope="{ record }">
{{ record.lastExcuteTime | dateFormat }}
</template>
<!-- 任务状态 -->
<template slot="status" slot-scope="{ record }">
<a-tag>{{ dict.status[record.status] }} </a-tag>
</template>
<!-- 操作 -->
<template slot="action" slot-scope="{ record }">
<a-space size="middle">
<span
href="javascript:;"
class="primary pointer"
@click="handleEdit(record)"
>编辑</span
>
<span
href="javascript:;"
class="delete pointer"
@click="handleDel(record.id)"
>删除</span
>
</a-space>
</template>
</y-table>
</div>
<!-- 新增 -->
<AddTask
ref="AddTask"
:addVisible.sync="addVisible"
:title="title"
:dict="dict"
@addSuccess="getSystemTaskList"
></AddTask>
</div>
</template>
<script>
import { getSystemTaskList, delSystemTask } from "@/services/system";
import { pageSizeOptions } from "@/config/pageConfig.js";
import AddTask from "./modal/AddTask.vue";
import YTable from "@/components/YTable.vue";
export default {
components: {
AddTask,
YTable,
},
data() {
const columns = [
{
title: "序号",
width: "65px",
scopedSlots: {
customRender: "index",
},
},
{
title: "任务名称",
dataIndex: "name",
},
{
title: "执行主机",
customRender: (text) => {
return text.excuteHost || "--";
},
},
{
title: "执行关键字",
customRender: (text) => {
return text.taskKey || "--";
},
},
{
title: "执行策略",
scopedSlots: {
customRender: "excuteStrategy",
},
},
{
title: "最后执行主机",
customRender: (text) => {
return text.lastExcuteHost || "--";
},
},
{
title: "最后执行时间",
scopedSlots: {
customRender: "lastExcuteTime",
},
},
{
title: "任务状态",
scopedSlots: {
customRender: "status",
},
},
{
title: "操作",
width: "120px",
scopedSlots: { customRender: "action" },
},
];
return {
columns,
loading: false,
page: 1,
size: 10,
total: 0,
pageSizeOptions,
searchValue: "", // 搜索
tableData: [],
selectedRowKeys: [],
dict: {}, // 字典
addVisible: false,
title: "新增",
};
},
created() {
this.getSystemTaskList();
},
methods: {
// 获取参数列表
async getSystemTaskList() {
this.loading = true;
let res = await getSystemTaskList({
page: this.page,
size: this.size,
name: `%${this.searchValue}%`,
});
this.loading = false;
if (res.data.code == 1) {
let { total, data, dict } = res.data.data;
this.dict = dict;
if (!data.length && this.page > 1) {
this.page -= 1;
this.getSystemTaskList();
}
this.total = total;
this.tableData = data;
}
},
// 新增
handleAdd() {
this.title = "新增";
this.$refs.AddTask.onAdd();
this.addVisible = true;
},
// 搜索
onSearch() {
this.page = 1;
this.selectedRowKeys = [];
this.getSystemTaskList();
},
// 选择
onSelectChange(keys) {
this.selectedRowKeys = keys;
},
// 批量删除
handleDelAll() {
if (!this.selectedRowKeys.length) {
this.$message.warn("请先勾选数据");
return;
}
let ids = this.selectedRowKeys.join(",");
this.handleDel(ids);
},
// 编辑
handleEdit(row) {
console.log(row);
this.title = "编辑";
this.$refs.AddTask.onEdit(row);
this.addVisible = true;
},
// 删除
handleDel(id) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delSystemTask({ id });
let { code, msg } = res.data;
if (code == 1) {
_this.$message.success(msg);
_this.selectedRowKeys = [];
_this.getSystemTaskList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
},
};
</script>
<style lang="less" scoped>
.task-set {
width: 100%;
height: 100%;
}
</style>
<template>
<div>
<a-modal
:title="title"
:visible="Visible"
@cancel="handleCancel"
:maskClosable="false"
>
<a-button slot="footer" @click="handleReset">重置</a-button>
<a-button slot="footer" type="primary" @click="handleOk">确定</a-button>
<a-form-model
:model="form"
ref="form"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
>
<a-form-model-item label="任务名称" prop="name">
<a-input v-model="form.name" placeholder="请输入参数名称" />
</a-form-model-item>
<a-form-model-item label="关键字" prop="taskKey">
<a-input v-model="form.taskKey" placeholder="请输入关键字" />
</a-form-model-item>
<a-form-model-item label="执行服务" prop="excuteService">
<a-input v-model="form.excuteService" placeholder="请输入执行服务" />
</a-form-model-item>
<a-form-model-item label="执行策略" prop="excuteStrategy">
<a-select
v-model="form.excuteStrategy"
@change="changeExcuteStrategy"
placeholder="请选择执行策略"
>
<a-select-option
v-for="(v, key) in dict.excuteStrategy"
:key="key"
:value="Number(key)"
>{{ v }}</a-select-option
>
</a-select>
</a-form-model-item>
<a-form-model-item
label="执行日期"
v-if="form.excuteStrategy != 4"
prop="excuteDate"
>
<a-input
v-if="form.excuteStrategy == 1"
disabled
value="每天"
placeholder="请输入执行日期"
/>
<a-select
placeholder="请选择执行日期"
v-model.number="form.excuteDate"
v-else-if="form.excuteStrategy == 2"
>
<a-select-option
v-for="(v, key) in weeks"
:key="key"
:value="Number(key)"
>
{{ v }}
</a-select-option>
</a-select>
<a-select
placeholder="请选择执行日期"
v-else-if="form.excuteStrategy == 3"
v-model="form.excuteDate"
>
<a-select-option
v-for="(v, key) in days"
:key="key"
:value="Number(key)"
>
{{ v }}
</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="执行间隔时间" prop="excuteDate" v-else>
<a-input
placeholder="执行间隔时间"
v-model.number="form.excuteDate"
suffix="秒"
/>
</a-form-model-item>
<a-form-model-item
label="执行时间"
v-if="form.excuteStrategy != 4"
prop="excuteTime"
>
<a-time-picker
valueFormat="HH:mm"
format="HH:mm"
v-model="form.excuteTime"
/>
</a-form-model-item>
<a-form-model-item label="执行主机" prop="excuteHost">
<a-input v-model="form.excuteHost" placeholder="请输入执行主机" />
</a-form-model-item>
<a-form-model-item label="执行参数" prop="excuteParam">
<a-input v-model="form.excuteParam" placeholder="请输入执行参数" />
</a-form-model-item>
<a-form-model-item label="备注" prop="remark">
<a-textarea
:autoSize="{ minRows: 4, maxRows: 4 }"
v-model="form.remark"
placeholder="请输入备注"
allow-clear
/>
</a-form-model-item>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { saveSystemTask } from "@/services/system";
export default {
components: {},
props: {
addVisible: {
required: true,
type: Boolean,
default: false,
},
title: {
required: true,
type: String,
default: "",
},
dict: {
required: true,
type: Object,
default: () => {
return {};
},
},
},
data() {
return {
days: {}, // 号数
weeks: {}, // 周
form: {
name: "", // 任务名称
taskKey: "", // 关键字
excuteService: "", // 执行服务
excuteStrategy: 1, // 执行策略
excuteDate: 0, // 执行日期
excuteTime: "", // 执行时间
excuteHost: "", // 执行主机
excuteParam: "", // 执行参数
remark: "", // 备注
},
rules: {
name: [{ required: true, message: "请输入任务名称", trigger: "blur" }],
taskKey: [{ required: true, message: "请输入关键字", trigger: "blur" }],
excuteService: [
{ required: true, message: "请输入执行服务", trigger: "blur" },
],
},
};
},
computed: {
Visible: {
get() {
return this.addVisible;
},
set(val) {
this.$emit("update:addVisible", val);
},
},
},
created() {
for (let i = 1; i <= 31; i++) {
this.days[i] = i + "";
}
let numArr = ["", "", "", "", "", "", ""];
for (let i = 1; i <= 7; i++) {
this.weeks[i] = "星期" + numArr[i - 1];
}
},
methods: {
// 切换执行策略
changeExcuteStrategy(val) {
if (val == 1) {
this.form.excuteDate = 0;
} else {
this.form.excuteDate = undefined;
}
if (val == 4) {
this.form.excuteTime = "";
}
},
// 关闭弹窗
handleCancel() {
this.$refs.form.resetFields();
this.Visible = false;
},
// 重置
handleReset() {
this.$refs.form.resetFields();
},
// 新增
onAdd() {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
},
// 编辑
onEdit(row) {
this.$nextTick(() => {
this.form = { ...row };
});
},
// 保存
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
let res = await saveSystemTask(this.form);
let { code, msg } = res.data;
if (code == 1) {
this.$message.success(msg);
this.$emit("addSuccess");
this.handleCancel();
}
}
});
},
},
};
</script>
<style lang="less" scoped></style>
...@@ -25,6 +25,12 @@ ...@@ -25,6 +25,12 @@
维度管理 维度管理
</span> </span>
</a-tab-pane> --> </a-tab-pane> -->
<a-tab-pane key="/system/menu">
<span slot="tab">
<a-icon type="deployment-unit" />
菜单管理
</span>
</a-tab-pane>
<a-tab-pane key="/system/parameter"> <a-tab-pane key="/system/parameter">
<span slot="tab"> <span slot="tab">
<a-icon type="container" /> <a-icon type="container" />
......
This diff is collapsed.
<template>
<a-popover placement="bottomLeft" trigger="click" width="100%">
<div slot="content" class="content ">
<div
:class="['item', { active: value === '' }]"
@click="handleChange('')"
>
<span>无图标</span>
</div>
<div v-for="(v, i) in iconJson" :key="i">
<div
:class="['item', { active: v === value }]"
@click="handleChange(v)"
>
<a-icon :type="v" />
<span>{{ v }}</span>
</div>
</div>
</div>
<a-input :value="value" :placeholder="placeholder" readOnly>
<a-icon v-if="value" slot="prefix" :type="value" />
<a-icon v-else slot="prefix" type="search" />
</a-input>
</a-popover>
</template>
<script>
import iconJson from "./icon.json";
export default {
model: {
prop: "value",
event: "change",
},
props: {
value: {
type: String,
default: "",
},
placeholder: {
type: String,
default: "点击选择图标",
},
},
data() {
return {
iconJson,
};
},
methods: {
handleChange(v) {
this.$emit("change", v);
},
},
};
</script>
<style lang="less" scoped>
.content {
width: 100%;
max-height: 300px;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px 16px;
overflow: auto;
&::-webkit-scrollbar {
width: 6px;
height: 6px;
overflow-y: auto;
}
&::-webkit-scrollbar-thumb {
border-radius: 6px;
background-color: rgba(144, 147, 153, 0.5);
}
&::-webkit-scrollbar-track {
border-radius: 6px;
background: rbga(0, 0, 0, 0);
}
.active {
color: #1890ff;
}
}
.item {
display: flex;
align-items: center;
gap: 16px;
cursor: pointer;
}
</style>
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
return { return {
columns, columns,
loading: false, loading: false,
current: 1, page: 1,
size: 10, size: 10,
total: 0, total: 0,
pageSizeOptions, pageSizeOptions,
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
async getSystemLogsList() { async getSystemLogsList() {
this.loading = true; this.loading = true;
let res = await getSystemLogsList({ let res = await getSystemLogsList({
page: this.current, page: this.page,
size: this.size, size: this.size,
requestUrl: this.searchValue, requestUrl: this.searchValue,
}); });
...@@ -112,7 +112,7 @@ export default { ...@@ -112,7 +112,7 @@ export default {
}, },
// 搜索 // 搜索
onSearch() { onSearch() {
this.current = 1; this.page = 1;
this.getSystemLogsList(); this.getSystemLogsList();
}, },
}, },
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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