WIP: 完成顶部导航,完成二级导航样式设置,完成主体部分样式设置,完成账户页面列表及搜索部分

This commit is contained in:
Xu Zhimeng 2023-05-11 20:19:02 +08:00
parent b8b22de474
commit d06e4f500a
39 changed files with 604 additions and 391 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1022 B

After

Width:  |  Height:  |  Size: 1022 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

View File

@ -0,0 +1,40 @@
<template>
<a-select v-bind="$attrs" v-model="innerValue">
<img slot="suffixIcon" src="@/assets/images/global/select-down.png" alt="" />
</a-select>
</template>
<script>
export default {
props: {
value: {
type: [String, Number],
}
},
data() {
return {
innerValue: null
}
},
watch: {
value () {
this.innerValue = this.value
},
innerValue () {
this.$emit('input', this.innerValue)
}
}
}
</script>
<style lang="less" scoped>
.ant-select {
.ant-select-arrow-icon {
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}
&-open {
.ant-select-arrow-icon {
transform: rotate(180deg);
}
}
}
</style>

View File

@ -0,0 +1,89 @@
<template>
<div class="search-form">
<a-row :gutter="20">
<a-form-model ref="form" :model="formModel" v-bind="$attrs" @keyup.enter.native="onSearch">
<a-col v-for="(item, index) in items" :key="index" :span="item.span || 6">
<a-form-model-item :label="item.label" :prop="item.name" :labelCol="item.labelCol">
<component :is="item.type" v-bind="item.props" v-model="formModel[item.name]" v-on="item.on"></component>
</a-form-model-item>
</a-col>
<a-col>
<a-button class="search-btn" type="primary" @click="onSearch">
<img src="@/assets/images/global/search.png" alt="">
search
</a-button>
<slot name="additional"></slot>
</a-col>
</a-form-model>
</a-row>
</div>
</template>
<script>
import { cloneDeep } from 'lodash'
export default {
props: {
items: {
type: Array,
default: () => []
},
value: {
type: Object,
default: () => ({})
}
},
data() {
return {
formModel: cloneDeep(this.value)
}
},
methods: {
onSearch() {
this.$emit('search', this.formModel)
}
},
watch: {
value(val) {
this.formModel = val
},
formModel: {
handler(val) {
this.$emit('input', val)
},
deep: true
}
}
}
</script>
<style lang="less" scoped>
.search-form {
height: 50px;
padding: 10px;
border-top: 1px solid rgba(12, 235, 201, .3);
border-bottom: 1px solid rgba(12, 235, 201, .3);
margin-bottom: 18px;
}
::v-deep .ant-form-item {
display: flex;
margin-bottom: 0;
.ant-form-item-label,
.ant-form-item-control {
line-height: 32px;
}
.ant-form-item-label {
flex-shrink: 0;
}
.ant-form-item-control-wrapper {
width: 100%;
}
}
.search-btn {
img {
width: 16px;
height: 17px;
margin-right: 9px;
}
}
</style>

View File

@ -1,6 +1,6 @@
<template> <template>
<global-layout @dynamicRouterShow="dynamicRouterShow"> <global-layout @dynamicRouterShow="dynamicRouterShow">
<div style="margin: 12px 12px 0;"> <div>
<!-- update-begin-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 --> <!-- update-begin-author:taoyan date:20201221 for:此处删掉transition标签 不知道为什么加上后 页面路由切换的时候即1及菜单切到2及菜单的时候 两个菜单页面会同时出现300-500秒左右 -->
<keep-alive v-if="multipage"> <keep-alive v-if="multipage">
<router-view v-if="reloadFlag"/> <router-view v-if="reloadFlag"/>

View File

@ -1,9 +1,21 @@
<template> <template>
<div style="height: 100%; overflow: hidden;"> <div class="custom-top-menu">
<a-menu mode="horizontal" v-model="selectedKeys" @click="onMenuSelect"> <a-menu mode="horizontal" v-model="selectedKeys" @click="onMenuSelect">
<a-menu-item v-for="menu in menus" :key="menu.name"> <a-menu-item v-for="(menu, index) in menus" :key="menu.name" :class="{ 'is-last': index === menus.length - 1}">
<img class="menu-logo" :src="'/images/top-nav/' + menu.meta.icon + '.png'" alt=""> <img
v-show="menu.name === selectedKeys[0]"
class="menu-logo"
:src="'/images/top-nav/' + menu.meta.icon + '-active.png'"
alt=""
/>
<img
v-show="menu.name !== selectedKeys[0]"
class="menu-logo"
:src="'/images/top-nav/' + menu.meta.icon + '.png'"
alt=""
/>
<span v-html="menu.meta.title.split(' ').join('<br>')"></span> <span v-html="menu.meta.title.split(' ').join('<br>')"></span>
<img v-if="index !== menus.length - 1" class="split-line" src="@/assets/images/header/split-line.png" alt="">
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</div> </div>
@ -23,7 +35,6 @@ export default {
} }
}, },
created() { created() {
const currTopMenu = this.findTopMenuByRouteName(this.menuItems, this.$route.name) const currTopMenu = this.findTopMenuByRouteName(this.menuItems, this.$route.name)
this.selectedKeys = [currTopMenu.name] this.selectedKeys = [currTopMenu.name]
}, },
@ -72,26 +83,37 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.ant-menu { .custom-top-menu {
height: 100%;
overflow: hidden;
.ant-menu {
background: transparent; background: transparent;
height: 100% !important; height: 100% !important;
color: #0cecca !important;
font-size: 16px; font-size: 16px;
&-item { &-item {
color: #0CECCA !important; color: #0cecca !important;
border-bottom: 0 !important; border-bottom: 0 !important;
height: 100%; height: 100%;
padding: 0 31px; padding: 0 30px;
border: 1px solid transparent; padding-right: 0;
font-family: MicrogrammaD-MediExte; font-family: MicrogrammaD-MediExte;
display: inline-flex !important; display: inline-flex;
align-items: center; align-items: center;
line-height: normal; line-height: normal;
&-selected, &-selected,
&-active { &-active {
background-color: rgba(9, 255, 212, .3) !important; background-color: rgba(9, 255, 212, 0.3) !important;
color: #fff !important; color: #fff !important;
border-color: rgba(5, 255, 184, 0.46); border-color: rgba(5, 255, 184, 0.46);
} }
.split-line {
margin-left: 30px;
}
&.is-last {
padding-right: 30px;
}
}
} }
} }
.menu-logo { .menu-logo {
@ -99,3 +121,38 @@ export default {
margin-right: 10px; margin-right: 10px;
} }
</style> </style>
<style lang="less">
.ant-menu-submenu-popup {
.ant-menu {
height: 73px;
background-color: #0c3d43 !important;
&-item {
color: #0cecca !important;
border-bottom: 0 !important;
height: 100% !important;
padding: 0 30px !important;
padding-right: 0 !important;
border: 1px solid transparent;
font-family: MicrogrammaD-MediExte;
font-size: 16px !important;
display: inline-flex !important;
align-items: center;
line-height: normal !important;
margin-bottom: 0;
margin-top: 0 !important;
&-selected,
&-active {
background-color: rgba(9, 255, 212, 0.3) !important;
color: #fff !important;
border-color: rgba(5, 255, 184, 0.46);
}
.split-line {
margin-left: 30px;
}
&.is-last {
padding-right: 30px !important;
}
}
}
}
</style>

View File

@ -191,7 +191,7 @@
/* update_end author:scott date:20190220 for: 缩小首页布局顶部的高度*/ /* update_end author:scott date:20190220 for: 缩小首页布局顶部的高度*/
.top-nav-header-index { .top-nav-header-index {
background: url(~@/assets/header/bg.png) no-repeat; background: url(~@/assets/images/header/bg.png) no-repeat;
background-size: 100% 120%; background-size: 100% 120%;
height: 100%; height: 100%;
background-color: transparent !important; background-color: transparent !important;

View File

@ -13,14 +13,31 @@
@toggle="toggle" @toggle="toggle"
@updateMenuTitle="handleUpdateMenuTitle" @updateMenuTitle="handleUpdateMenuTitle"
/> />
<div class="global-content">
<div class="top-border">
<img src="@/assets/images/content/top.png" alt="">
</div>
<div class="content-main">
<div class="left-border">
<img src="@/assets/images/content/left.png" alt="">
</div>
<!-- layout content -->
<a-layout-content>
<div class="sub-menus" v-if="currentChildrenMenus && currentChildrenMenus.length"> <div class="sub-menus" v-if="currentChildrenMenus && currentChildrenMenus.length">
<s-menu :menu="currentChildrenMenus" mode="horizontal" theme="light"></s-menu> <s-menu :menu="currentChildrenMenus" mode="horizontal" theme="light"></s-menu>
</div> </div>
<div class="real-content" :class="currentChildrenMenus.length? 'has-submenu': ''">
<!-- layout content -->
<a-layout-content :style="{ height: '100%', paddingTop: fixedHeader ? '59px' : '0' }">
<slot></slot> <slot></slot>
</div>
</a-layout-content> </a-layout-content>
<div class="right-border">
<img src="@/assets/images/content/left.png" alt="">
</div>
</div>
<div class="bottom-border">
<img src="@/assets/images/content/bottom.png" alt="">
</div>
</div>
</a-layout> </a-layout>
<!-- update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效但还一直转圈显示主题 正在编译 ---- --> <!-- update-start---- author:os_chengtgen -- date:20190830 -- for:issues/463 -编译主题颜色已生效但还一直转圈显示主题 正在编译 ---- -->
@ -107,7 +124,7 @@
findSubMenus(routeName) { findSubMenus(routeName) {
for (const menu of this.menus) { for (const menu of this.menus) {
if (menu.children) { if (menu.children) {
const find = menu.children.find(child => child.name === routeName || child.children && child.children.find(item => item.child.name === routeName)) const find = menu.children.find(child => child.name === routeName || child.children && child.children.find(item => item.name === routeName))
if (find) { if (find) {
return menu.children return menu.children
} }
@ -294,18 +311,13 @@
.header, .top-nav-header-index { .header, .top-nav-header-index {
.user-wrapper { .user-wrapper {
float: right; width: 140px;
height: 100%; height: 100%;
margin-left: 30px;
.action { .action {
cursor: pointer; cursor: pointer;
padding: 0 14px; padding: 0 10px;
display: inline-block; display: inline-block;
transition: all .3s;
height: 70%;
line-height: 46px;
&:hover { &:hover {
background: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.3);
} }
@ -651,10 +663,14 @@
} }
.sub-menus { .sub-menus {
margin-bottom: 16px;
.ant-menu { .ant-menu {
font-size: 16px; font-size: 16px;
background: transparent; background: rgba(12, 235, 201, .05);
border-bottom: none; border-bottom: none;
height: 40px;
line-height: normal;
padding-top: 5px;
.ant-menu-item { .ant-menu-item {
background: rgba(58, 236, 240, .22) !important; background: rgba(58, 236, 240, .22) !important;
border-bottom: none !important; border-bottom: none !important;
@ -665,10 +681,18 @@
position: relative; position: relative;
> a { > a {
color: #c9f6f6; color: #c9f6f6;
font-weight: bold;
font-family: BookmanOldStyle;
} }
&-active,
&-selected { &-selected {
> a { > a {
color: #2affdf; color: #2affdf !important;
}
&::before,
&::after {
border-color: #0cecca !important;
} }
} }
@ -692,10 +716,64 @@
} }
} }
} }
.global-content {
width: 100%;
height: calc(100% - 73px);
overflow: hidden;
position: relative;
.content-main {
display: flex;
height: 100%;
overflow: hidden;
.ant-layout-content {
flex: 1;
margin-top: 34px;
margin-bottom: 34px;
.real-content {
height: 100%;
overflow: hidden auto;
}
.has-submenu {
height: calc(100% - 56px);
}
}
}
.top-border {
position: absolute;
top: 11px;
left: 0;
width: 100%;
img {
width: 100%;
height: 21px;
}
}
.bottom-border {
position: absolute;
bottom: 6px;
img {
width: 100%;
height: 21px;
}
}
.left-border {
width: 3px;
height: 100%;
margin-left: 12px;
margin-right: 10px;
}
.right-border {
width: 3px;
height: 100%;
margin-right: 14px;
margin-left: 10px;
}
}
</style> </style>
<style lang="less" scoped> <style lang="less" scoped>
.ant-layout { .ant-layout {
background: #061314; background: #061314;
height: 100vh;
} }
</style> </style>

View File

@ -68,7 +68,7 @@
</template> </template>
<span @click="fetchNotice" class="header-notice"> <span @click="fetchNotice" class="header-notice">
<a-badge :count="msgTotal"> <a-badge :count="msgTotal">
<a-icon style="font-size: 16px; padding: 4px" type="bell" /> <img src="@/assets/images/header/notice.png" alt="">
</a-badge> </a-badge>
</span> </span>
<show-announcement ref="ShowAnnouncement" @ok="modalFormOk"></show-announcement> <show-announcement ref="ShowAnnouncement" @ok="modalFormOk"></show-announcement>

View File

@ -3,7 +3,7 @@
<header-notice class="action"/> <header-notice class="action"/>
<a-dropdown> <a-dropdown>
<span class="action action-full ant-dropdown-link user-dropdown-menu"> <span class="action action-full ant-dropdown-link user-dropdown-menu">
人头icon <img src="@/assets/images/header/avatar.png" alt="">
</span> </span>
<a-menu slot="overlay" class="user-dropdown-menu-wrapper"> <a-menu slot="overlay" class="user-dropdown-menu-wrapper">
<a-menu-item key="0"> <a-menu-item key="0">
@ -38,7 +38,7 @@
</a-dropdown> </a-dropdown>
<span class="action"> <span class="action">
<a class="logout_title" href="javascript:;" @click="handleLogout"> <a class="logout_title" href="javascript:;" @click="handleLogout">
<a-icon type="logout"/> <img src="@/assets/images/header/close.png" alt="">
</a> </a>
</span> </span>
<user-password ref="userPassword"></user-password> <user-password ref="userPassword"></user-password>

View File

@ -50,6 +50,9 @@ import '@/components/JVxeCells/install'
import './style.less' import './style.less'
//表单验证 //表单验证
import { rules } from '@/utils/rules' import { rules } from '@/utils/rules'
import CustomSelect from '@/components/CustomSelect'
Vue.prototype.rules = rules Vue.prototype.rules = rules
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.use(Storage, config.storageOptions) Vue.use(Storage, config.storageOptions)
@ -63,6 +66,7 @@ Vue.use(preview)
Vue.use(vueBus); Vue.use(vueBus);
Vue.use(JeecgComponents); Vue.use(JeecgComponents);
Vue.use(VueAreaLinkage); Vue.use(VueAreaLinkage);
Vue.component('custom-select', CustomSelect)
SSO.init(() => { SSO.init(() => {
main() main()

View File

@ -22,7 +22,8 @@ export const JeecgListMixin = {
pageSize: 10, pageSize: 10,
pageSizeOptions: ['10', '20', '30'], pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => { showTotal: (total, range) => {
return range[0] + "-" + range[1] + " 共" + total + "条" const { current, pageSize } = this.ipagination
return `${total} 条记录 第${current} / ${Math.ceil(total / pageSize)}`
}, },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,

View File

@ -5,10 +5,20 @@
src: url(~@/assets/fonts/MicrogrammaDMedExt.ttf); src: url(~@/assets/fonts/MicrogrammaDMedExt.ttf);
} }
.ant-card { @font-face {
background-color: transparent; font-family: BookmanOldStyle;
src: url(~@/assets/fonts/BOOKOS.ttf);
} }
// 卡片样式
.ant-card {
background-color: #061214;
.ant-card-body {
padding: 0;
}
}
// 表格样式
.ant-table { .ant-table {
color: #ade6ee; color: #ade6ee;
&-thead { &-thead {
@ -16,19 +26,43 @@
th { th {
background-color: #126b82 !important; background-color: #126b82 !important;
color: #fff; color: #fff;
padding: 6px 8px !important;
border-bottom: none;
} }
} }
} }
&-tbody { &-tbody {
tr { tr {
background-color: #06282A; background-color: #06282a;
&:nth-child(2n) { &:nth-child(2n) {
background-color: #08373A; background-color: #08373a;
}
td {
padding: 10px 8px !important;
border-bottom: none;
}
&:hover {
td {
background-color: transparent !important;
} }
} }
} }
}
&-placeholder {
background-color: #061214;
border-top: none;
border-bottom: none;
}
&-selected {
background-color: 0d4e5c;
}
}
.ant-table-pagination {
float: none !important;
text-align: center;
} }
// 表单样式
.ant-form { .ant-form {
&-item { &-item {
&-label { &-label {
@ -39,24 +73,28 @@
} }
} }
@formInputBgColor: #03353f; @formInputBgColor: #03353f;
@formInputBorderColor: #0b8c82; @formInputBorderColor: #0b8c82;
// 输入框样式
.ant-input { .ant-input {
background-color: @formInputBgColor; background-color: @formInputBgColor !important;
border-color: @formInputBorderColor; border-color: @formInputBorderColor !important;
border-radius: 0;
color: #fff; color: #fff;
&::placeholder { &::placeholder {
color: #fff; color: #fff;
} }
} }
// 下拉框样式
.ant-select { .ant-select {
color: #fff !important;
&-selection { &-selection {
background-color: @formInputBgColor; background-color: @formInputBgColor !important;
border-color: @formInputBorderColor; border-color: @formInputBorderColor !important;
border-radius: 0;
&__placeholder { &__placeholder {
color: #fff; color: #fff !important;
} }
} }
@ -65,12 +103,126 @@
&-menu { &-menu {
&-item { &-item {
color: #fff; color: #fff;
&:hover, background-color: #02282b;
&:not(&-disabled):hover,
&-selected, &-selected,
&-active { &-active {
background-color: #0CECCA !important; background-color: #08363c;
} }
} }
} }
} }
} }
// 树形下拉样式
.ant-select-tree {
color: #fff !important;
.ant-select-tree-node-content-wrapper {
color: #fff !important;
}
}
// 按钮
.ant-btn {
border-radius: 0;
font-family: Arial;
span {
text-shadow: 0px 1px 0px #000;
font-size: 16px;
}
}
// 空状态
.ant-empty {
background-color: transparent;
color: #fff;
}
.ant-pagination {
&,
&-item a {
color: #ade6ee;
}
&-item {
width: 26px;
height: 26px !important;
line-height: 26px !important;
border-radius: 50%;
&-active {
background-color: #00bded;
a {
color: #fff !important;
}
}
}
.ant-pagination-item-link {
color: #00bded;
}
&-disabled {
.ant-pagination-item-link {
color: #9ca2a6;
}
}
.ant-select {
&-selection {
border: none;
box-shadow: none;
background-color: transparent !important;
color: #ade6ee;
&-selected-value {
height: 26px;
line-height: 26px;
}
.ant-select-arrow {
display: none;
}
}
.ant-select-selection__rendered::after {
content: '';
margin-left: 18px;
border: 6px solid transparent;
border-top-width: 8px;
border-bottom-width: 8px;
border-top-color: #00bded;
visibility: visible;
transform: translateY(8px);
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transform-origin: 50% 25%;
}
&-open {
.ant-select-selection__rendered::after {
transform: translateY(6px) rotate(180deg);
}
}
}
&-options {
&-quick-jumper {
input {
background-color: #011927;
border: 1px solid #00cbfe;
width: 70px !important;
border-radius: 0;
color: #ade6ee;
text-align: center;
}
}
}
}
// 滚动条
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background-color: #011b1f;
}
::-webkit-scrollbar-thumb {
background-color: #007f9a;
}

View File

@ -1,129 +1,48 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <search-form :items="formItems" v-model="queryParam" @search="searchQuery">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-space style="float: right" class="btn-group" slot="additional">
<a-row :gutter="24"> <a-button @click="handleAdd" type="primary">
<img src="@/assets/images/global/add.png" alt="" />
<a-col :md="6" :sm="12"> Add
<a-form-item label="账号">
<!--<a-input placeholder="请输入账号查询" v-model="queryParam.username"></a-input>-->
<j-input placeholder="输入账号模糊查询" v-model="queryParam.username"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="性别">
<a-select v-model="queryParam.sex" placeholder="请选择性别">
<a-select-option value="">请选择</a-select-option>
<a-select-option value="1"></a-select-option>
<a-select-option value="2"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<a-form-item label="真实名字">
<a-input placeholder="请输入真实名字" v-model="queryParam.realname"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="手机号码">
<a-input placeholder="请输入手机号码查询" v-model="queryParam.phone"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item label="用户状态">
<a-select v-model="queryParam.status" placeholder="请选择">
<a-select-option value="">请选择</a-select-option>
<a-select-option value="1">正常</a-select-option>
<a-select-option value="2">冻结</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus" >添加用户</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('用户信息')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<j-third-app-button biz-type="user" :selected-row-keys="selectedRowKeys" syncToApp syncToLocal @sync-finally="onSyncFinally"/>
<a-button type="primary" icon="hdd" @click="recycleBinVisible=true">回收站</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="1">
<a-icon type="delete" @click="batchDel"/>
删除
</a-menu-item>
<a-menu-item key="2">
<a-icon type="lock" @click="batchFrozen('2')"/>
冻结
</a-menu-item>
<a-menu-item key="3">
<a-icon type="unlock" @click="batchFrozen('1')"/>
解冻
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作
<a-icon type="down"/>
</a-button> </a-button>
</a-dropdown> <a-button @click="handleAdd" type="primary">
<j-super-query :fieldList="superQueryFieldList" @handleSuperQuery="handleSuperQuery"/> <img src="@/assets/images/global/edit.png" alt="" />
</div> Edit
</a-button>
<a-button @click="handleAdd" type="primary">
<img src="@/assets/images/global/delete.png" alt="" />
Delete
</a-button>
<a-button @click="handleAdd" type="primary">
<img src="@/assets/images/global/reset-pwd.png" alt="" />
Reset pwd
</a-button>
</a-space>
</search-form>
<!-- table区域-begin -->
<div> <div>
<a-table <a-table
ref="table" ref="table"
bordered
size="middle" size="middle"
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"
@change="handleTableChange"> >
<template slot="index" slot-scope="text, record, index">
<template slot="avatarslot" slot-scope="text, record, index"> {{ index + 1 }}
<div class="anty-img-wrap">
<a-avatar shape="square" :src="getAvatarView(record.avatar)" icon="user"/>
</div>
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)" >编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link"> <a class="ant-dropdown-link"> 更多 <a-icon type="down" /> </a>
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a> <a href="javascript:;" @click="handleDetail(record)">详情</a>
@ -139,249 +58,122 @@
</a-popconfirm> </a-popconfirm>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="record.status==1"> <a-menu-item v-if="record.status == 1">
<a-popconfirm title="确定冻结吗?" @confirm="() => handleFrozen(record.id,2,record.username)"> <a-popconfirm title="确定冻结吗?" @confirm="() => handleFrozen(record.id, 2, record.username)">
<a>冻结</a> <a>冻结</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="record.status==2"> <a-menu-item v-if="record.status == 2">
<a-popconfirm title="确定解冻吗?" @confirm="() => handleFrozen(record.id,1,record.username)"> <a-popconfirm title="确定解冻吗?" @confirm="() => handleFrozen(record.id, 1, record.username)">
<a>解冻</a> <a>解冻</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</span> </span>
</a-table> </a-table>
</div> </div>
<!-- table区域-end --> <!-- table区域-end -->
<user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
<password-modal ref="passwordmodal" @ok="passwordModalOk"></password-modal>
<sys-user-agent-modal ref="sysUserAgentModal"></sys-user-agent-modal>
<!-- 用户回收站 -->
<user-recycle-bin-modal :visible.sync="recycleBinVisible" @ok="modalFormOk"/>
</a-card> </a-card>
</template> </template>
<script> <script>
import UserModal from './modules/UserModal' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import PasswordModal from './modules/PasswordModal' import SearchForm from '@/components/SearchForm'
import {putAction,getFileAccessHttpUrl} from '@/api/manage';
import {frozenBatch} from '@/api/api'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import SysUserAgentModal from "./modules/SysUserAgentModal";
import JInput from '@/components/jeecg/JInput'
import UserRecycleBinModal from './modules/UserRecycleBinModal'
import JSuperQuery from '@/components/jeecg/JSuperQuery'
import JThirdAppButton from '@/components/jeecgbiz/thirdApp/JThirdAppButton'
export default { const formItems = [
name: "UserList", {
type: 'a-input',
label: 'User',
name: 'username',
span: 4
},
{
type: 'a-input',
label: 'Name',
name: 'realname',
span: 4
},
{
type: 'custom-select',
label: 'Role',
name: 'role',
span: 4,
props: {
options: [
{
label: 'test',
value: '1'
},
{
label: 'test2',
value: '2'
}
]
}
}
]
export default {
name: 'UserList',
mixins: [JeecgListMixin], mixins: [JeecgListMixin],
components: { components: {
JThirdAppButton, SearchForm
SysUserAgentModal,
UserModal,
PasswordModal,
JInput,
UserRecycleBinModal,
JSuperQuery
}, },
data() { data() {
this.formItems = formItems
return { return {
description: '这是用户管理页面',
queryParam: {}, queryParam: {},
recycleBinVisible: false,
columns: [ columns: [
/*{ {
title: '#', title: 'NO',
dataIndex: '', align: 'center',
key:'rowIndex', width: 100,
width:60, scopedSlots: {
align:"center", customRender: 'index'
customRender:function (t,r,index) {
return parseInt(index)+1;
} }
},*/ },
{ {
title: '用户账号', title: 'USER',
align: "center", align: 'center',
dataIndex: 'username', dataIndex: 'username',
width: 120, width: 100
sorter: true
}, },
{ {
title: '用户姓名', title: 'NAME',
align: "center", align: 'center',
width: 100, width: 100,
dataIndex: 'realname', dataIndex: 'realname'
}, },
{ {
title: '头像', title: 'ROLE',
align: "center", align: 'center',
width: 120,
dataIndex: 'avatar',
scopedSlots: {customRender: "avatarslot"}
},
{
title: '性别',
align: "center",
width: 80,
dataIndex: 'sex_dictText',
sorter: true
},
{
title: '生日',
align: "center",
width: 100, width: 100,
dataIndex: 'birthday' dataIndex: 'roleCode'
}, },
{ {
title: '手机号码', title: 'PHONE',
align: "center", align: 'center',
width: 100, width: 100,
dataIndex: 'phone' dataIndex: 'phone'
},
{
title: '部门',
align: "center",
width: 180,
dataIndex: 'orgCodeTxt'
},
{
title: '负责部门',
align: "center",
width: 180,
dataIndex: 'departIds_dictText'
},
{
title: '状态',
align: "center",
width: 80,
dataIndex: 'status_dictText'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 170
} }
],
superQueryFieldList: [
{ type: 'input', value: 'username', text: '用户账号', },
{ type: 'input', value: 'realname', text: '用户姓名', },
{ type: 'select', value: 'sex', dbType: 'int', text: '性别', dictCode: 'sex' },
], ],
url: { url: {
syncUser: "/act/process/extActProcess/doSyncUser", list: '/sys/user/list',
list: "/sys/user/list", delete: '/sys/user/delete'
delete: "/sys/user/delete", }
deleteBatch: "/sys/user/deleteBatch",
exportXlsUrl: "/sys/user/exportXls",
importExcelUrl: "sys/user/importExcel",
},
} }
}, },
computed: { methods: {}
importExcelUrl: function(){ }
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
}
},
methods: {
getAvatarView: function (avatar) {
return getFileAccessHttpUrl(avatar)
},
batchFrozen: function (status) {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!');
return false;
} else {
let ids = "";
let that = this;
let isAdmin = false;
that.selectionRows.forEach(function (row) {
if (row.username == 'admin') {
isAdmin = true;
}
});
if (isAdmin) {
that.$message.warning('管理员账号不允许此操作,请重新选择!');
return;
}
that.selectedRowKeys.forEach(function (val) {
ids += val + ",";
});
that.$confirm({
title: "确认操作",
content: "是否" + (status == 1 ? "解冻" : "冻结") + "选中账号?",
onOk: function () {
frozenBatch({ids: ids, status: status}).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
} else {
that.$message.warning(res.message);
}
});
}
});
}
},
handleMenuClick(e) {
if (e.key == 1) {
this.batchDel();
} else if (e.key == 2) {
this.batchFrozen(2);
} else if (e.key == 3) {
this.batchFrozen(1);
}
},
handleFrozen: function (id, status, username) {
let that = this;
//TODO
if ('admin' == username) {
that.$message.warning('管理员账号不允许此操作!');
return;
}
frozenBatch({ids: id, status: status}).then((res) => {
if (res.success) {
that.$message.success(res.message);
that.loadData();
} else {
that.$message.warning(res.message);
}
});
},
handleChangePassword(username) {
this.$refs.passwordmodal.show(username);
},
passwordModalOk() {
//TODO datasource
},
onSyncFinally({isToLocal}) {
//
if (isToLocal) {
this.loadData()
}
},
}
}
</script> </script>
<style scoped> <style scoped lang="less">
@import '~@assets/less/common.less' @import '~@assets/less/common.less';
.btn-group {
img {
margin-right: 12px;
height: 18px;
}
}
</style> </style>