Commit 80c71677 authored by yuwenwen's avatar yuwenwen

后台管理页面配置,话题管理接口对接

parent 8b6b9c7c
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 一站式高校轻享平台
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
# 若依管理系统/开发环境 # 若依管理系统/开发环境
VUE_APP_BASE_API = 'http://localhost:8080' VUE_APP_BASE_API = 'http://192.168.1.44:8080'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 一站式高校轻享平台
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'
......
# 页面标题 # 页面标题
VUE_APP_TITLE = 若依管理系统 VUE_APP_TITLE = 一站式高校轻享平台
NODE_ENV = production NODE_ENV = production
......
...@@ -13,8 +13,8 @@ npm install ...@@ -13,8 +13,8 @@ npm install
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 # 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npmmirror.com npm install --registry=https://registry.npmmirror.com
# 启动服务 # 启动服务(node 版本14.20.0)
npm run dev npm run dev
``` ```
浏览器访问 http://localhost:80 浏览器访问 http://localhost:80
......
safe-campus-bbs-ui/public/favicon.ico

5.53 KB | W: | H:

safe-campus-bbs-ui/public/favicon.ico

1.29 KB | W: | H:

safe-campus-bbs-ui/public/favicon.ico
safe-campus-bbs-ui/public/favicon.ico
safe-campus-bbs-ui/public/favicon.ico
safe-campus-bbs-ui/public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
import request from '@/utils/request'
// 话题列表
export function listData(params) {
return request({
url: '/bbs/moment/topic/list',
method: 'get',
params
})
}
// 话题详情
export function detailData(id) {
return request({
url: `/bbs/moment/topic/${id}`,
method: 'get'
})
}
// 新增话题
export function addData(data) {
return request({
url: '/bbs/moment/topic',
method: 'post',
data
})
}
// 修改话题
export function editData(data) {
return request({
url: '/bbs/moment/topic',
method: 'put',
data
})
}
// 置顶话题
export function setTop(data) {
return request({
url: '/bbs/moment/topic/top',
method: 'put',
data
})
}
// 删除话题
export function delData(id) {
return request({
url: `/bbs/moment/topic/${id}`,
method: 'delete'
})
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
.el-breadcrumb__inner, .el-breadcrumb__inner,
.el-breadcrumb__inner a { .el-breadcrumb__inner a {
font-weight: 400 !important; font-weight: 400 !important;
color: white !important;
} }
.el-upload { .el-upload {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
-webkit-transition: width .28s; -webkit-transition: width .28s;
transition: width 0.28s; transition: width 0.28s;
width: $base-sidebar-width !important; width: $base-sidebar-width !important;
background-color: $base-menu-background; background-color: #007BFF;
height: 100%; height: 100%;
position: fixed; position: fixed;
font-size: 0px; font-size: 0px;
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
left: 0; left: 0;
z-index: 1001; z-index: 1001;
overflow: hidden; overflow: hidden;
-webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35); // -webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
box-shadow: 2px 0 6px rgba(0,21,41,.35); // box-shadow: 2px 0 6px rgba(0,21,41,.35);
// reset element-ui css // reset element-ui css
.horizontal-collapse-transition { .horizontal-collapse-transition {
......
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
margin-left: 8px; margin-left: 8px;
.no-redirect { .no-redirect {
color: #97a8be; color: white;
cursor: text; cursor: text;
} }
} }
......
...@@ -10,20 +10,8 @@ ...@@ -10,20 +10,8 @@
<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">-->
<!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />-->
<!-- </el-tooltip>-->
<!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">-->
<!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />-->
<!-- </el-tooltip>-->
<screenfull id="screenfull" class="right-menu-item hover-effect"/> <screenfull id="screenfull" class="right-menu-item hover-effect"/>
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">-->
<!-- <size-select id="size-select" class="right-menu-item hover-effect" />-->
<!-- </el-tooltip>-->
</template> </template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click"> <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
...@@ -117,7 +105,7 @@ export default { ...@@ -117,7 +105,7 @@ export default {
height: 50px; height: 50px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background: #fff; background: #007BFF;
box-shadow: 0 1px 4px rgba(0, 21, 41, .08); box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
.hamburger-container { .hamburger-container {
...@@ -127,6 +115,7 @@ export default { ...@@ -127,6 +115,7 @@ export default {
cursor: pointer; cursor: pointer;
transition: background .3s; transition: background .3s;
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
color: white;
&:hover { &:hover {
background: rgba(0, 0, 0, .025) background: rgba(0, 0, 0, .025)
...@@ -161,7 +150,7 @@ export default { ...@@ -161,7 +150,7 @@ export default {
padding: 0 8px; padding: 0 8px;
height: 100%; height: 100%;
font-size: 18px; font-size: 18px;
color: #5a5e66; color: white;
vertical-align: text-bottom; vertical-align: text-bottom;
&.hover-effect { &.hover-effect {
......
<template> <template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }"> <div class="sidebar-logo-container" :class="{'collapse':collapse}" >
<transition name="sidebarLogoFade"> <transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/"> <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</router-link> </router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/"> <router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" /> <img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> <h1 class="sidebar-title" >{{ title }} </h1>
</router-link> </router-link>
</transition> </transition>
</div> </div>
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
}, },
data() { data() {
return { return {
title: '若依管理系统', title: '一站式高校轻享平台',
logo: logoImg logo: logoImg
} }
} }
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
width: 100%; width: 100%;
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
background: #2b2f3a; background: #007BFF;
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
......
...@@ -2,7 +2,7 @@ module.exports = { ...@@ -2,7 +2,7 @@ module.exports = {
/** /**
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
*/ */
sideTheme: 'theme-dark', sideTheme: 'theme-light',
/** /**
* 是否系统布局配置 * 是否系统布局配置
...@@ -17,7 +17,7 @@ module.exports = { ...@@ -17,7 +17,7 @@ module.exports = {
/** /**
* 是否显示 tagsView * 是否显示 tagsView
*/ */
tagsView: true, tagsView: false,
/** /**
* 是否固定头部 * 是否固定头部
......
This diff is collapsed.
<template>
<div class="app-container">
<div class="page-container"></div>
</div>
</template>
<script>
export default {
name: 'Sensitives',
data() {
return {
}
},
created() {
},
mounted() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.app-container {
background-color: rgba(241, 242, 247, 1);
height: calc(100vh - 50px);
.page-container {
background-color: white;
height: 100%;
border-radius: 6px;
padding: 20px 30px;
box-sizing: border-box;
overflow: auto;
}
}
</style>
\ No newline at end of file
<template>
<el-dialog :visible.sync="visible" :title="dialogTitle" width="28%" class="dialog" @close="handleClose">
<el-form :model="form" ref="formRef" :rules="rules">
<el-form-item label="话题名称" prop="name">
<el-input placeholder="请输入" v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input-number placeholder="请输入" style="width: 100%;" v-model="form.sort" :min="0" :step="1"
:step-strictly="true"></el-input-number>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleSubmit">确认</el-button>
</template>
</el-dialog>
</template>
<script>
import { addData, detailData, editData } from '@/api/topic';
export default {
name: 'FormDialog',
data() {
return {
visible: false,
dialogTitle: '新增话题',
form: {},
rules: {
name: [{ required: true, message: '请输入话题名称', trigger: 'blur' }]
}
}
},
methods: {
openModal(row) {
this.visible = true;
if (row) {
this.dialogTitle = '修改话题';
this.getDetail(row)
} else {
this.dialogTitle = '新增话题'
}
},
// 查详情
getDetail(row) {
detailData(row.id).then(res => {
console.log(res)
this.form = { ...res.data }
})
},
// 提交
handleSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
if (this.form.id) {
editData(this.form).then(res => {
if (res.code == 200) {
this.$modal.msgSuccess("修改成功");
this.handleClose()
this.$emit('handleOk')
} else {
this.$modal.msgError(res.msg || "修改失败");
this.handleClose()
}
})
} else {
addData(this.form).then(res => {
if (res.code == 200) {
this.$modal.msgSuccess("新增成功");
this.handleClose()
this.$emit('handleOk')
} else {
this.$modal.msgError(res.msg || "新增失败");
this.handleClose()
}
})
}
}
})
},
// 关闭
handleClose() {
this.form = {};
this.visible = false
}
}
}
</script>
<style lang="scss">
.dialog {
.el-dialog__body {
padding: 0 20px !important;
}
}
</style>
\ No newline at end of file
<template>
<div class="app-container">
<div class="page-container">
<el-form :model="queryParams" :inline="true" label-width="90">
<el-form-item label="话题名称">
<el-input v-model="queryParams.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="话题来源">
<el-select v-model="queryParams.source" placeholder="请选择">
<el-option label="轻享广场" value="轻享广场"></el-option>
<el-option label="后台管理" value="后台管理"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-row class="mb10">
<el-col :span="2">
<el-button type="primary" @click="handleAdd">新增话题</el-button>
</el-col>
</el-row>
<el-table :data="tableList">
<el-table-column label="序号" width="55" type="index" align="center"></el-table-column>
<el-table-column label="话题名称" prop="name" align="center"></el-table-column>
<el-table-column label="来源" prop="source" align="center"></el-table-column>
<el-table-column label="排序" prop="sort" align="center"></el-table-column>
<el-table-column label="置顶" prop="isTop" align="center">
<template #default="{ row }">
<span v-if="row.isTop == 1" style="color: #007BFF;"></span>
<span v-if="row.isTop == 0" style="color: #FF645F;"></span>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template #default="{ row }">
<el-button type="text" @click="handleUpdate(row)">修改</el-button>
<el-button type="text" @click="handleDelete(row)">删除</el-button>
<el-button type="text" v-if="row.isTop == '0'" @click="handleSetTop(row)">置顶</el-button>
<el-button type="text" v-if="row.isTop == '1'" @click="handleSetTop(row)">取消置顶</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
<!-- 表单 -->
<form-dialog ref="formDialogRef" @handleOk="handleReset"></form-dialog>
</div>
</template>
<script>
import { listData, setTop ,delData} from '@/api/topic';
import FormDialog from './FormDialog.vue';
export default {
name: 'Topic',
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10
},
tableList: [],
total: 0
}
},
components: {
FormDialog
},
created() {
},
mounted() {
this.getList()
},
methods: {
// 列表数据
getList() {
listData(this.queryParams).then(res => {
console.log(res)
this.tableList = res.rows;
this.total = res.total
})
},
// 新增
handleAdd() {
this.$refs.formDialogRef.openModal()
},
// 修改
handleUpdate(row) {
this.$refs.formDialogRef.openModal(row)
},
// 置顶
handleSetTop(row) {
let data = {
id: row.id,
isTop: row.isTop == 0 ? 1 : 0
}
let text = row.isTop == 0 ? '置顶' : '取消置顶'
this.$modal.confirm('确认要' + text + '话题名称为:' + row.name + '的数据吗?').then(function () {
return setTop(data);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
this.getList()
})
},
// 删除
handleDelete(row) {
this.$modal.confirm('确认要删除话题名称为:' + row.name + '的数据吗?').then(function () {
return delData(row.id);
}).then(() => {
this.$modal.msgSuccess("删除成功");
this.getList()
})
},
// 查询
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
// 重置
handleReset() {
this.queryParams = {
pageNum: 1,
pageSize: 10
}
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.app-container {
background-color: rgba(241, 242, 247, 1);
height: calc(100vh - 50px);
.page-container {
background-color: white;
height: 100%;
border-radius: 6px;
padding: 20px 30px;
box-sizing: border-box;
overflow: auto;
}
}
</style>
\ No newline at end of file
...@@ -7,7 +7,7 @@ function resolve(dir) { ...@@ -7,7 +7,7 @@ function resolve(dir) {
const CompressionPlugin = require('compression-webpack-plugin') const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题 const name = process.env.VUE_APP_TITLE || '一站式高校轻享平台' // 网页标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口
......
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