no commit message
This commit is contained in:
@ -1,181 +1,177 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
||||||
|
|
||||||
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device!=='mobile'">
|
||||||
<search id="header-search" class="right-menu-item" />
|
<search id="header-search" class="right-menu-item" />
|
||||||
|
|
||||||
<el-tooltip content="下载源码" effect="dark" placement="bottom">
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||||
<ruo-yi id="ruoyi" class="right-menu-item hover-effect" />
|
|
||||||
</el-tooltip>
|
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
||||||
|
<size-select id="size-select" class="right-menu-item hover-effect" />
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
</el-tooltip>
|
||||||
|
|
||||||
<el-tooltip content="布局大小" effect="dark" placement="bottom">
|
</template>
|
||||||
<size-select id="size-select" class="right-menu-item hover-effect" />
|
|
||||||
</el-tooltip>
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
||||||
|
<div class="avatar-wrapper">
|
||||||
</template>
|
<img :src="avatar" class="user-avatar">
|
||||||
|
<i class="el-icon-caret-bottom" />
|
||||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
|
</div>
|
||||||
<div class="avatar-wrapper">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<img :src="avatar" class="user-avatar">
|
<router-link to="/user/profile">
|
||||||
<i class="el-icon-caret-bottom" />
|
<el-dropdown-item>个人中心</el-dropdown-item>
|
||||||
</div>
|
</router-link>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-item>
|
||||||
<router-link to="/user/profile">
|
<span @click="setting = true">布局设置</span>
|
||||||
<el-dropdown-item>个人中心</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</router-link>
|
<el-dropdown-item divided>
|
||||||
<el-dropdown-item>
|
<span @click="logout">退出登录</span>
|
||||||
<span @click="setting = true">布局设置</span>
|
</el-dropdown-item>
|
||||||
</el-dropdown-item>
|
</el-dropdown-menu>
|
||||||
<el-dropdown-item divided>
|
</el-dropdown>
|
||||||
<span @click="logout">退出登录</span>
|
</div>
|
||||||
</el-dropdown-item>
|
</div>
|
||||||
</el-dropdown-menu>
|
</template>
|
||||||
</el-dropdown>
|
|
||||||
</div>
|
<script>
|
||||||
</div>
|
import { mapGetters } from 'vuex'
|
||||||
</template>
|
import Breadcrumb from '@/components/Breadcrumb'
|
||||||
|
import Hamburger from '@/components/Hamburger'
|
||||||
<script>
|
import Screenfull from '@/components/Screenfull'
|
||||||
import { mapGetters } from 'vuex'
|
import SizeSelect from '@/components/SizeSelect'
|
||||||
import Breadcrumb from '@/components/Breadcrumb'
|
import Search from '@/components/HeaderSearch'
|
||||||
import Hamburger from '@/components/Hamburger'
|
import RuoYi from '@/components/RuoYi'
|
||||||
import Screenfull from '@/components/Screenfull'
|
|
||||||
import SizeSelect from '@/components/SizeSelect'
|
export default {
|
||||||
import Search from '@/components/HeaderSearch'
|
components: {
|
||||||
import RuoYi from '@/components/RuoYi'
|
Breadcrumb,
|
||||||
|
Hamburger,
|
||||||
export default {
|
Screenfull,
|
||||||
components: {
|
SizeSelect,
|
||||||
Breadcrumb,
|
Search,
|
||||||
Hamburger,
|
RuoYi
|
||||||
Screenfull,
|
},
|
||||||
SizeSelect,
|
computed: {
|
||||||
Search,
|
...mapGetters([
|
||||||
RuoYi
|
'sidebar',
|
||||||
},
|
'avatar',
|
||||||
computed: {
|
'device'
|
||||||
...mapGetters([
|
]),
|
||||||
'sidebar',
|
setting: {
|
||||||
'avatar',
|
get() {
|
||||||
'device'
|
return this.$store.state.settings.showSettings
|
||||||
]),
|
},
|
||||||
setting: {
|
set(val) {
|
||||||
get() {
|
this.$store.dispatch('settings/changeSetting', {
|
||||||
return this.$store.state.settings.showSettings
|
key: 'showSettings',
|
||||||
},
|
value: val
|
||||||
set(val) {
|
})
|
||||||
this.$store.dispatch('settings/changeSetting', {
|
}
|
||||||
key: 'showSettings',
|
}
|
||||||
value: val
|
},
|
||||||
})
|
methods: {
|
||||||
}
|
toggleSideBar() {
|
||||||
}
|
this.$store.dispatch('app/toggleSideBar')
|
||||||
},
|
},
|
||||||
methods: {
|
async logout() {
|
||||||
toggleSideBar() {
|
this.$confirm('确定注销并退出系统吗?', '提示', {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
confirmButtonText: '确定',
|
||||||
},
|
cancelButtonText: '取消',
|
||||||
async logout() {
|
type: 'warning'
|
||||||
this.$confirm('确定注销并退出系统吗?', '提示', {
|
}).then(() => {
|
||||||
confirmButtonText: '确定',
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
cancelButtonText: '取消',
|
location.reload()
|
||||||
type: 'warning'
|
})
|
||||||
}).then(() => {
|
})
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
}
|
||||||
location.reload()
|
}
|
||||||
})
|
}
|
||||||
})
|
</script>
|
||||||
}
|
|
||||||
}
|
<style lang="scss" scoped>
|
||||||
}
|
.navbar {
|
||||||
</script>
|
height: 50px;
|
||||||
|
overflow: hidden;
|
||||||
<style lang="scss" scoped>
|
position: relative;
|
||||||
.navbar {
|
background: #fff;
|
||||||
height: 50px;
|
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
.hamburger-container {
|
||||||
background: #fff;
|
line-height: 46px;
|
||||||
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
height: 100%;
|
||||||
|
float: left;
|
||||||
.hamburger-container {
|
cursor: pointer;
|
||||||
line-height: 46px;
|
transition: background .3s;
|
||||||
height: 100%;
|
-webkit-tap-highlight-color:transparent;
|
||||||
float: left;
|
|
||||||
cursor: pointer;
|
&:hover {
|
||||||
transition: background .3s;
|
background: rgba(0, 0, 0, .025)
|
||||||
-webkit-tap-highlight-color:transparent;
|
}
|
||||||
|
}
|
||||||
&:hover {
|
|
||||||
background: rgba(0, 0, 0, .025)
|
.breadcrumb-container {
|
||||||
}
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.breadcrumb-container {
|
.errLog-container {
|
||||||
float: left;
|
display: inline-block;
|
||||||
}
|
vertical-align: top;
|
||||||
|
}
|
||||||
.errLog-container {
|
|
||||||
display: inline-block;
|
.right-menu {
|
||||||
vertical-align: top;
|
float: right;
|
||||||
}
|
height: 100%;
|
||||||
|
line-height: 50px;
|
||||||
.right-menu {
|
|
||||||
float: right;
|
&:focus {
|
||||||
height: 100%;
|
outline: none;
|
||||||
line-height: 50px;
|
}
|
||||||
|
|
||||||
&:focus {
|
.right-menu-item {
|
||||||
outline: none;
|
display: inline-block;
|
||||||
}
|
padding: 0 8px;
|
||||||
|
height: 100%;
|
||||||
.right-menu-item {
|
font-size: 18px;
|
||||||
display: inline-block;
|
color: #5a5e66;
|
||||||
padding: 0 8px;
|
vertical-align: text-bottom;
|
||||||
height: 100%;
|
|
||||||
font-size: 18px;
|
&.hover-effect {
|
||||||
color: #5a5e66;
|
cursor: pointer;
|
||||||
vertical-align: text-bottom;
|
transition: background .3s;
|
||||||
|
|
||||||
&.hover-effect {
|
&:hover {
|
||||||
cursor: pointer;
|
background: rgba(0, 0, 0, .025)
|
||||||
transition: background .3s;
|
}
|
||||||
|
}
|
||||||
&:hover {
|
}
|
||||||
background: rgba(0, 0, 0, .025)
|
|
||||||
}
|
.avatar-container {
|
||||||
}
|
margin-right: 30px;
|
||||||
}
|
|
||||||
|
.avatar-wrapper {
|
||||||
.avatar-container {
|
margin-top: 5px;
|
||||||
margin-right: 30px;
|
position: relative;
|
||||||
|
|
||||||
.avatar-wrapper {
|
.user-avatar {
|
||||||
margin-top: 5px;
|
cursor: pointer;
|
||||||
position: relative;
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
.user-avatar {
|
border-radius: 10px;
|
||||||
cursor: pointer;
|
}
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
.el-icon-caret-bottom {
|
||||||
border-radius: 10px;
|
cursor: pointer;
|
||||||
}
|
position: absolute;
|
||||||
|
right: -20px;
|
||||||
.el-icon-caret-bottom {
|
top: 25px;
|
||||||
cursor: pointer;
|
font-size: 12px;
|
||||||
position: absolute;
|
}
|
||||||
right: -20px;
|
}
|
||||||
top: 25px;
|
}
|
||||||
font-size: 12px;
|
}
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
@ -19,7 +19,7 @@ module.exports = {
|
|||||||
/**
|
/**
|
||||||
* 是否显示logo
|
* 是否显示logo
|
||||||
*/
|
*/
|
||||||
sidebarLogo: true,
|
sidebarLogo: false,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string | array} 'production' | ['production', 'development']
|
* @type {string | array} 'production' | ['production', 'development']
|
||||||
|
@ -1,345 +1,344 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
||||||
<el-form-item label="公告标题" prop="noticeTitle">
|
<el-form-item label="公告标题" prop="noticeTitle">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.noticeTitle"
|
v-model="queryParams.noticeTitle"
|
||||||
placeholder="请输入公告标题"
|
placeholder="请输入公告标题"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="操作人员" prop="createBy">
|
<el-form-item label="操作人员" prop="createBy">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.createBy"
|
v-model="queryParams.createBy"
|
||||||
placeholder="请输入操作人员"
|
placeholder="请输入操作人员"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="类型" prop="noticeType">
|
<el-form-item label="类型" prop="noticeType">
|
||||||
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable size="small">
|
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in typeOptions"
|
v-for="dict in typeOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="dict.dictValue"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['system:notice:add']"
|
v-hasPermi="['system:notice:add']"
|
||||||
>新增</el-button>
|
>新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['system:notice:edit']"
|
v-hasPermi="['system:notice:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['system:notice:remove']"
|
v-hasPermi="['system:notice:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" stripe border fit highlight-current-row :data="noticeList" @selection-change="handleSelectionChange" @row-dblclick="handleUpdate">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
|
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
|
||||||
<el-table-column
|
<el-table-column label="公告标题" align="center" prop="noticeTitle" :show-overflow-tooltip="true"/>
|
||||||
label="公告标题"
|
<el-table-column
|
||||||
align="center"
|
label="公告类型"
|
||||||
prop="noticeTitle"
|
align="center"
|
||||||
:show-overflow-tooltip="true"
|
prop="noticeType"
|
||||||
/>
|
:formatter="typeFormat"
|
||||||
<el-table-column
|
width="100"
|
||||||
label="公告类型"
|
/>
|
||||||
align="center"
|
<el-table-column
|
||||||
prop="noticeType"
|
label="状态"
|
||||||
:formatter="typeFormat"
|
align="center"
|
||||||
width="100"
|
prop="status"
|
||||||
/>
|
:formatter="statusFormat"
|
||||||
<el-table-column
|
width="100"
|
||||||
label="状态"
|
/>
|
||||||
align="center"
|
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
|
||||||
prop="status"
|
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
||||||
:formatter="statusFormat"
|
<template slot-scope="scope">
|
||||||
width="100"
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
/>
|
</template>
|
||||||
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<el-button
|
||||||
</template>
|
plain
|
||||||
</el-table-column>
|
size="small"
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
type="primary"
|
||||||
<template slot-scope="scope">
|
icon="el-icon-edit"
|
||||||
<el-button
|
@click="handleUpdate(scope.row)"
|
||||||
size="mini"
|
v-hasPermi="['system:notice:edit']"
|
||||||
type="text"
|
>修改</el-button>
|
||||||
icon="el-icon-edit"
|
<el-button
|
||||||
@click="handleUpdate(scope.row)"
|
plain
|
||||||
v-hasPermi="['system:notice:edit']"
|
size="small"
|
||||||
>修改</el-button>
|
type="primary"
|
||||||
<el-button
|
icon="el-icon-delete"
|
||||||
size="mini"
|
@click="handleDelete(scope.row)"
|
||||||
type="text"
|
v-hasPermi="['system:notice:remove']"
|
||||||
icon="el-icon-delete"
|
>删除</el-button>
|
||||||
@click="handleDelete(scope.row)"
|
</template>
|
||||||
v-hasPermi="['system:notice:remove']"
|
</el-table-column>
|
||||||
>删除</el-button>
|
</el-table>
|
||||||
</template>
|
|
||||||
</el-table-column>
|
<pagination
|
||||||
</el-table>
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
<pagination
|
:page.sync="queryParams.pageNum"
|
||||||
v-show="total>0"
|
:limit.sync="queryParams.pageSize"
|
||||||
:total="total"
|
@pagination="getList"
|
||||||
:page.sync="queryParams.pageNum"
|
/>
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
<!-- 添加或修改公告对话框 -->
|
||||||
/>
|
<el-dialog :title="title" :visible.sync="open" width="780px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<!-- 添加或修改公告对话框 -->
|
<el-row>
|
||||||
<el-dialog :title="title" :visible.sync="open" width="780px">
|
<el-col :span="12">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form-item label="公告标题" prop="noticeTitle">
|
||||||
<el-row>
|
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
|
||||||
<el-col :span="12">
|
</el-form-item>
|
||||||
<el-form-item label="公告标题" prop="noticeTitle">
|
</el-col>
|
||||||
<el-input v-model="form.noticeTitle" placeholder="请输入公告标题" />
|
<el-col :span="12">
|
||||||
</el-form-item>
|
<el-form-item label="公告类型" prop="noticeType">
|
||||||
</el-col>
|
<el-select v-model="form.noticeType" placeholder="请选择">
|
||||||
<el-col :span="12">
|
<el-option
|
||||||
<el-form-item label="公告类型" prop="noticeType">
|
v-for="dict in typeOptions"
|
||||||
<el-select v-model="form.noticeType" placeholder="请选择">
|
:key="dict.dictValue"
|
||||||
<el-option
|
:label="dict.dictLabel"
|
||||||
v-for="dict in typeOptions"
|
:value="dict.dictValue"
|
||||||
:key="dict.dictValue"
|
></el-option>
|
||||||
:label="dict.dictLabel"
|
</el-select>
|
||||||
:value="dict.dictValue"
|
</el-form-item>
|
||||||
></el-option>
|
</el-col>
|
||||||
</el-select>
|
<el-col :span="24">
|
||||||
</el-form-item>
|
<el-form-item label="状态">
|
||||||
</el-col>
|
<el-radio-group v-model="form.status">
|
||||||
<el-col :span="24">
|
<el-radio
|
||||||
<el-form-item label="状态">
|
v-for="dict in statusOptions"
|
||||||
<el-radio-group v-model="form.status">
|
:key="dict.dictValue"
|
||||||
<el-radio
|
:label="dict.dictValue"
|
||||||
v-for="dict in statusOptions"
|
>{{dict.dictLabel}}</el-radio>
|
||||||
:key="dict.dictValue"
|
</el-radio-group>
|
||||||
:label="dict.dictValue"
|
</el-form-item>
|
||||||
>{{dict.dictLabel}}</el-radio>
|
</el-col>
|
||||||
</el-radio-group>
|
<el-col :span="24">
|
||||||
</el-form-item>
|
<el-form-item label="内容">
|
||||||
</el-col>
|
<Editor v-model="form.noticeContent" />
|
||||||
<el-col :span="24">
|
</el-form-item>
|
||||||
<el-form-item label="内容">
|
</el-col>
|
||||||
<Editor v-model="form.noticeContent" />
|
</el-row>
|
||||||
</el-form-item>
|
</el-form>
|
||||||
</el-col>
|
<div slot="footer" class="dialog-footer" style="padding-top:20px">
|
||||||
</el-row>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
</el-form>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
<div slot="footer" class="dialog-footer" style="padding-top:20px">
|
</div>
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
</el-dialog>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
</div>
|
||||||
</div>
|
</template>
|
||||||
</el-dialog>
|
|
||||||
</div>
|
<script>
|
||||||
</template>
|
import { listNotice, getNotice, delNotice, addNotice, updateNotice, exportNotice } from "@/api/system/notice";
|
||||||
|
import Editor from '@/components/Editor';
|
||||||
<script>
|
|
||||||
import { listNotice, getNotice, delNotice, addNotice, updateNotice, exportNotice } from "@/api/system/notice";
|
export default {
|
||||||
import Editor from '@/components/Editor';
|
name: "Notice",
|
||||||
|
components: {
|
||||||
export default {
|
Editor
|
||||||
name: "Notice",
|
},
|
||||||
components: {
|
data() {
|
||||||
Editor
|
return {
|
||||||
},
|
// 遮罩层
|
||||||
data() {
|
loading: true,
|
||||||
return {
|
// 选中数组
|
||||||
// 遮罩层
|
ids: [],
|
||||||
loading: true,
|
// 非单个禁用
|
||||||
// 选中数组
|
single: true,
|
||||||
ids: [],
|
// 非多个禁用
|
||||||
// 非单个禁用
|
multiple: true,
|
||||||
single: true,
|
// 总条数
|
||||||
// 非多个禁用
|
total: 0,
|
||||||
multiple: true,
|
// 公告表格数据
|
||||||
// 总条数
|
noticeList: [],
|
||||||
total: 0,
|
// 弹出层标题
|
||||||
// 公告表格数据
|
title: "",
|
||||||
noticeList: [],
|
// 是否显示弹出层
|
||||||
// 弹出层标题
|
open: false,
|
||||||
title: "",
|
// 是否显示弹出层
|
||||||
// 是否显示弹出层
|
open: false,
|
||||||
open: false,
|
// 类型数据字典
|
||||||
// 类型数据字典
|
statusOptions: [],
|
||||||
statusOptions: [],
|
// 状态数据字典
|
||||||
// 状态数据字典
|
typeOptions: [],
|
||||||
typeOptions: [],
|
// 查询参数
|
||||||
// 查询参数
|
queryParams: {
|
||||||
queryParams: {
|
pageNum: 1,
|
||||||
pageNum: 1,
|
pageSize: 10,
|
||||||
pageSize: 10,
|
noticeTitle: undefined,
|
||||||
noticeTitle: undefined,
|
createBy: undefined,
|
||||||
createBy: undefined,
|
status: undefined
|
||||||
status: undefined
|
},
|
||||||
},
|
// 表单参数
|
||||||
// 表单参数
|
form: {},
|
||||||
form: {},
|
// 表单校验
|
||||||
// 表单校验
|
rules: {
|
||||||
rules: {
|
noticeTitle: [
|
||||||
noticeTitle: [
|
{ required: true, message: "公告标题不能为空", trigger: "blur" }
|
||||||
{ required: true, message: "公告标题不能为空", trigger: "blur" }
|
],
|
||||||
],
|
noticeType: [
|
||||||
noticeType: [
|
{ required: true, message: "公告类型不能为空", trigger: "blur" }
|
||||||
{ required: true, message: "公告类型不能为空", trigger: "blur" }
|
]
|
||||||
]
|
}
|
||||||
}
|
};
|
||||||
};
|
},
|
||||||
},
|
created() {
|
||||||
created() {
|
this.getList();
|
||||||
this.getList();
|
this.getDicts("sys_notice_status").then(response => {
|
||||||
this.getDicts("sys_notice_status").then(response => {
|
this.statusOptions = response.data;
|
||||||
this.statusOptions = response.data;
|
});
|
||||||
});
|
this.getDicts("sys_notice_type").then(response => {
|
||||||
this.getDicts("sys_notice_type").then(response => {
|
this.typeOptions = response.data;
|
||||||
this.typeOptions = response.data;
|
});
|
||||||
});
|
},
|
||||||
},
|
methods: {
|
||||||
methods: {
|
/** 查询公告列表 */
|
||||||
/** 查询公告列表 */
|
getList() {
|
||||||
getList() {
|
this.loading = true;
|
||||||
this.loading = true;
|
listNotice(this.queryParams).then(response => {
|
||||||
listNotice(this.queryParams).then(response => {
|
this.noticeList = response.rows;
|
||||||
this.noticeList = response.rows;
|
this.total = response.total;
|
||||||
this.total = response.total;
|
this.loading = false;
|
||||||
this.loading = false;
|
});
|
||||||
});
|
},
|
||||||
},
|
// 公告状态字典翻译
|
||||||
// 公告状态字典翻译
|
statusFormat(row, column) {
|
||||||
statusFormat(row, column) {
|
return this.selectDictLabel(this.statusOptions, row.status);
|
||||||
return this.selectDictLabel(this.statusOptions, row.status);
|
},
|
||||||
},
|
// 公告状态字典翻译
|
||||||
// 公告状态字典翻译
|
typeFormat(row, column) {
|
||||||
typeFormat(row, column) {
|
return this.selectDictLabel(this.typeOptions, row.noticeType);
|
||||||
return this.selectDictLabel(this.typeOptions, row.noticeType);
|
},
|
||||||
},
|
// 取消按钮
|
||||||
// 取消按钮
|
cancel() {
|
||||||
cancel() {
|
this.open = false;
|
||||||
this.open = false;
|
this.reset();
|
||||||
this.reset();
|
},
|
||||||
},
|
// 表单重置
|
||||||
// 表单重置
|
reset() {
|
||||||
reset() {
|
this.form = {
|
||||||
this.form = {
|
noticeId: undefined,
|
||||||
noticeId: undefined,
|
noticeTitle: undefined,
|
||||||
noticeTitle: undefined,
|
noticeType: undefined,
|
||||||
noticeType: undefined,
|
noticeContent: undefined,
|
||||||
noticeContent: undefined,
|
status: "0"
|
||||||
status: "0"
|
};
|
||||||
};
|
this.resetForm("form");
|
||||||
this.resetForm("form");
|
},
|
||||||
},
|
/** 搜索按钮操作 */
|
||||||
/** 搜索按钮操作 */
|
handleQuery() {
|
||||||
handleQuery() {
|
this.queryParams.pageNum = 1;
|
||||||
this.queryParams.pageNum = 1;
|
this.getList();
|
||||||
this.getList();
|
},
|
||||||
},
|
/** 重置按钮操作 */
|
||||||
/** 重置按钮操作 */
|
resetQuery() {
|
||||||
resetQuery() {
|
this.resetForm("queryForm");
|
||||||
this.resetForm("queryForm");
|
this.handleQuery();
|
||||||
this.handleQuery();
|
},
|
||||||
},
|
// 多选框选中数据
|
||||||
// 多选框选中数据
|
handleSelectionChange(selection) {
|
||||||
handleSelectionChange(selection) {
|
this.ids = selection.map(item => item.noticeId)
|
||||||
this.ids = selection.map(item => item.noticeId)
|
this.single = selection.length!=1
|
||||||
this.single = selection.length!=1
|
this.multiple = !selection.length
|
||||||
this.multiple = !selection.length
|
},
|
||||||
},
|
/** 新增按钮操作 */
|
||||||
/** 新增按钮操作 */
|
handleAdd() {
|
||||||
handleAdd() {
|
this.reset();
|
||||||
this.reset();
|
this.open = true;
|
||||||
this.open = true;
|
this.title = "添加公告";
|
||||||
this.title = "添加公告";
|
},
|
||||||
},
|
/** 修改按钮操作 */
|
||||||
/** 修改按钮操作 */
|
handleUpdate(row) {
|
||||||
handleUpdate(row) {
|
this.reset();
|
||||||
this.reset();
|
const noticeId = row.noticeId || this.ids
|
||||||
const noticeId = row.noticeId || this.ids
|
getNotice(noticeId).then(response => {
|
||||||
getNotice(noticeId).then(response => {
|
this.form = response.data;
|
||||||
this.form = response.data;
|
this.open = true;
|
||||||
this.open = true;
|
this.title = "修改公告";
|
||||||
this.title = "修改公告";
|
});
|
||||||
});
|
},
|
||||||
},
|
/** 提交按钮 */
|
||||||
/** 提交按钮 */
|
submitForm: function() {
|
||||||
submitForm: function() {
|
this.$refs["form"].validate(valid => {
|
||||||
this.$refs["form"].validate(valid => {
|
if (valid) {
|
||||||
if (valid) {
|
if (this.form.noticeId != undefined) {
|
||||||
if (this.form.noticeId != undefined) {
|
updateNotice(this.form).then(response => {
|
||||||
updateNotice(this.form).then(response => {
|
if (response.code === 200) {
|
||||||
if (response.code === 200) {
|
this.msgSuccess("修改成功");
|
||||||
this.msgSuccess("修改成功");
|
this.open = false;
|
||||||
this.open = false;
|
this.getList();
|
||||||
this.getList();
|
} else {
|
||||||
} else {
|
this.msgError(response.msg);
|
||||||
this.msgError(response.msg);
|
}
|
||||||
}
|
});
|
||||||
});
|
} else {
|
||||||
} else {
|
addNotice(this.form).then(response => {
|
||||||
addNotice(this.form).then(response => {
|
if (response.code === 200) {
|
||||||
if (response.code === 200) {
|
this.msgSuccess("新增成功");
|
||||||
this.msgSuccess("新增成功");
|
this.open = false;
|
||||||
this.open = false;
|
this.getList();
|
||||||
this.getList();
|
} else {
|
||||||
} else {
|
this.msgError(response.msg);
|
||||||
this.msgError(response.msg);
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
},
|
||||||
},
|
/** 删除按钮操作 */
|
||||||
/** 删除按钮操作 */
|
handleDelete(row) {
|
||||||
handleDelete(row) {
|
const noticeIds = row.noticeId || this.ids
|
||||||
const noticeIds = row.noticeId || this.ids
|
this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", {
|
||||||
this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", {
|
confirmButtonText: "确定",
|
||||||
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
||||||
cancelButtonText: "取消",
|
type: "warning"
|
||||||
type: "warning"
|
}).then(function() {
|
||||||
}).then(function() {
|
return delNotice(noticeIds);
|
||||||
return delNotice(noticeIds);
|
}).then(() => {
|
||||||
}).then(() => {
|
this.getList();
|
||||||
this.getList();
|
this.msgSuccess("删除成功");
|
||||||
this.msgSuccess("删除成功");
|
}).catch(function() {});
|
||||||
}).catch(function() {});
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
</script>
|
||||||
</script>
|
|
||||||
|
@ -17,7 +17,7 @@ module.exports = {
|
|||||||
// 部署生产环境和开发环境下的URL。
|
// 部署生产环境和开发环境下的URL。
|
||||||
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
||||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||||
publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
|
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
||||||
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
||||||
|
@ -1,17 +1,5 @@
|
|||||||
package com.ruoyi.project.system.controller;
|
package com.ruoyi.project.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||||
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
||||||
@ -20,10 +8,16 @@ import com.ruoyi.framework.web.domain.AjaxResult;
|
|||||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||||
import com.ruoyi.project.system.domain.SysNotice;
|
import com.ruoyi.project.system.domain.SysNotice;
|
||||||
import com.ruoyi.project.system.service.ISysNoticeService;
|
import com.ruoyi.project.system.service.ISysNoticeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公告 信息操作处理
|
* 公告 信息操作处理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@ -89,4 +83,11 @@ public class SysNoticeController extends BaseController
|
|||||||
{
|
{
|
||||||
return toAjax(noticeService.deleteNoticeById(noticeId));
|
return toAjax(noticeService.deleteNoticeById(noticeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/msg")
|
||||||
|
public AjaxResult message()
|
||||||
|
{
|
||||||
|
return toAjax(10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://locahost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: MRyyserver2019
|
password: MRyyserver2019
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
|
Reference in New Issue
Block a user