更换ico,添加轮播管理,修改查询检索布局
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 1.2 KiB |
33
src/api/rotation.js
Normal file
33
src/api/rotation.js
Normal file
@ -0,0 +1,33 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 分页查询所有轮播列表
|
||||
export function getRotationList(params) {
|
||||
return request({
|
||||
url: '/show/list',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 添加轮播
|
||||
export function addRotation(data) {
|
||||
return request({
|
||||
url: '/show/create',
|
||||
method:'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
// 删除轮播
|
||||
export function deleteRotation(params) {
|
||||
return request({
|
||||
url: '/show/delete',
|
||||
method:'post',
|
||||
params
|
||||
});
|
||||
}
|
||||
// 修改轮播
|
||||
export function updateRotation(data) {
|
||||
return request({
|
||||
url: '/show/update',
|
||||
method:'post',
|
||||
data
|
||||
});
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 1.2 KiB |
@ -12,6 +12,7 @@ import accountManagement from './modules/accountManagement';
|
||||
import customerService from './modules/customerService';
|
||||
import feedback from './modules/feedback';
|
||||
import settings from './modules/settings';
|
||||
import rotation from './modules/rotation';
|
||||
|
||||
export const DynamicRoutes = [
|
||||
// 政策管理
|
||||
@ -28,6 +29,8 @@ export const DynamicRoutes = [
|
||||
customerService,
|
||||
// 意见反馈
|
||||
feedback,
|
||||
// 轮播管理
|
||||
rotation,
|
||||
// 系统设置
|
||||
settings
|
||||
];
|
||||
|
17
src/router/modules/rotation.js
Normal file
17
src/router/modules/rotation.js
Normal file
@ -0,0 +1,17 @@
|
||||
import Layout from '@/layout';
|
||||
// 轮播管理
|
||||
const nestedRouter = {
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
children: [
|
||||
{
|
||||
path: 'rotation',
|
||||
component: resolve => require(['@/views/rotation/index'], resolve),
|
||||
name: 'rotation',
|
||||
meta: { title: '轮播管理', icon: 'row' }
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
export default nestedRouter;
|
@ -4,11 +4,6 @@
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<div style="float:right">
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form
|
||||
@ -21,6 +16,11 @@
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="queryParams.phone" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -4,11 +4,6 @@
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<div style="float:right">
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form
|
||||
@ -21,6 +16,11 @@
|
||||
<el-form-item label="企业名称">
|
||||
<el-input v-model="queryParams.companyName" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -42,11 +42,11 @@
|
||||
type="index"
|
||||
></el-table-column>
|
||||
<el-table-column label="企业全称" prop="companyName" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <template slot-scope="scope">
|
||||
<el-link type="primary" :underline="false">{{
|
||||
scope.row.companyName
|
||||
}}</el-link>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="头像"
|
||||
|
@ -14,11 +14,11 @@
|
||||
type="index"
|
||||
></el-table-column>
|
||||
<el-table-column label="资讯标题" prop="title" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <template slot-scope="scope">
|
||||
<el-link type="primary" :underline="false">{{
|
||||
scope.row.title
|
||||
}}</el-link>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
|
@ -4,11 +4,6 @@
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<div style="float:right">
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form
|
||||
@ -21,6 +16,11 @@
|
||||
<el-form-item label="解读标题">
|
||||
<el-input v-model="queryParams.title" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -41,12 +41,12 @@
|
||||
align="center"
|
||||
type="index"
|
||||
></el-table-column>
|
||||
<el-table-column label="解读标题" prop="name" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-table-column label="解读标题" prop="title" align="center">
|
||||
<!-- <template slot-scope="scope">
|
||||
<el-link type="primary" :underline="false">{{
|
||||
scope.row.title
|
||||
}}</el-link>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="归口" align="center" prop="attribute">
|
||||
<template slot-scope="scope">
|
||||
|
@ -4,11 +4,6 @@
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<div style="float: right">
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form
|
||||
@ -86,6 +81,11 @@
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -21,13 +21,13 @@
|
||||
<el-table-column label="标签" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
plain
|
||||
type="success"
|
||||
:disabled="scope.row.name == '类型' ? true : false"
|
||||
size="mini"
|
||||
@click="handleAddTag(scope.row.id)"
|
||||
>添加标签</el-button
|
||||
>
|
||||
<el-button plain size="mini" @click="handleLook(scope.row.id)"
|
||||
<el-button type="warning" size="mini" @click="handleLook(scope.row.id)"
|
||||
>查看标签</el-button
|
||||
>
|
||||
</template>
|
||||
|
216
src/views/rotation/index.vue
Normal file
216
src/views/rotation/index.vue
Normal file
@ -0,0 +1,216 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button style="float: right" @click="open" size="mini">
|
||||
添加轮播
|
||||
</el-button>
|
||||
</el-card>
|
||||
<el-table style="width: 100%" class="table-container" :data="rotationList">
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
type="index"
|
||||
></el-table-column>
|
||||
<el-table-column label="轮播图片" prop="pic" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.pic"
|
||||
fit="cover">
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="跳转链接"
|
||||
align="center"
|
||||
prop="url"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="handleUpdate(scope.row)" type="text" size="small"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button @click="handleDelete(scope.row.id)" type="text" size="small"
|
||||
>删除</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"
|
||||
/>
|
||||
<el-dialog
|
||||
title="轮播图"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%">
|
||||
<el-form
|
||||
:model="ruleForm"
|
||||
ref="ruleForm"
|
||||
:rules="rules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="跳转链接" prop="url">
|
||||
<el-input placeholder="请输入" v-model="ruleForm.url"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="轮播图片" prop="pic">
|
||||
<multi-upload v-model="selectProductPics" :maxCount="1"></multi-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getRotationList,addRotation, deleteRotation, updateRotation } from '@/api/rotation';
|
||||
import MultiUpload from '@/components/Upload/multiUpload';
|
||||
export default {
|
||||
components: {
|
||||
MultiUpload
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
total: 0,
|
||||
rotationList: [],
|
||||
dialogVisible: false,
|
||||
ruleForm: {
|
||||
url: '',
|
||||
pic: ''
|
||||
},
|
||||
rules: {
|
||||
url: [{ required: true, message: '请输入', trigger: 'blur' }],
|
||||
pic: [{ required: true, message: '请上传', trigger: 'blur' }]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
//主图和画册图片
|
||||
selectProductPics: {
|
||||
get: function() {
|
||||
let pics = [];
|
||||
if (
|
||||
this.ruleForm.pic === undefined ||
|
||||
this.ruleForm.pic == null ||
|
||||
this.ruleForm.pic === ''
|
||||
) {
|
||||
return pics;
|
||||
}
|
||||
pics.push(this.ruleForm.pic);
|
||||
if (
|
||||
this.ruleForm.albumPics === undefined ||
|
||||
this.ruleForm.albumPics == null ||
|
||||
this.ruleForm.albumPics === ''
|
||||
) {
|
||||
return pics;
|
||||
}
|
||||
let albumPics = this.ruleForm.albumPics.split(',');
|
||||
for (let i = 0; i < albumPics.length; i++) {
|
||||
pics.push(albumPics[i]);
|
||||
}
|
||||
return pics;
|
||||
},
|
||||
set: function(newValue) {
|
||||
if (newValue == null || newValue.length === 0) {
|
||||
this.ruleForm.pic = null;
|
||||
this.ruleForm.albumPics = null;
|
||||
} else {
|
||||
this.ruleForm.pic = newValue[0];
|
||||
// this.ruleForm.picList = newValue;
|
||||
this.ruleForm.albumPics = '';
|
||||
if (newValue.length > 1) {
|
||||
for (let i = 1; i < newValue.length; i++) {
|
||||
this.ruleForm.albumPics += newValue[i];
|
||||
if (i !== newValue.length - 1) {
|
||||
this.ruleForm.albumPics += ',';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
getRotationList(this.queryParams).then(({ data }) => {
|
||||
this.rotationList = data.list;
|
||||
this.total = data.total
|
||||
});
|
||||
},
|
||||
open(){
|
||||
this.dialogVisible = true
|
||||
},
|
||||
handleUpdate(row){
|
||||
this.ruleForm = Object.assign({}, row)
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitForm(formName){
|
||||
this.$refs[formName].validate(valid=>{
|
||||
if(valid){
|
||||
if(this.ruleForm.id){
|
||||
updateRotation(this.ruleForm).then(res=>{
|
||||
this.msgSuccess(res.data)
|
||||
this.ruleForm = {
|
||||
url: '',
|
||||
pic: ''
|
||||
}
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
})
|
||||
}else{
|
||||
addRotation(this.ruleForm).then(res=>{
|
||||
this.msgSuccess(res.data)
|
||||
this.ruleForm = {
|
||||
url: '',
|
||||
pic: ''
|
||||
}
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
// this.dialogVisible = false
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(id) {
|
||||
this.$confirm('确认删除该轮播图?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(function() {
|
||||
return deleteRotation({id});
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess('删除成功');
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// .el-tag + .el-tag {
|
||||
// margin-left: 10px;
|
||||
// }
|
||||
</style>
|
@ -24,7 +24,9 @@
|
||||
>{{ item.msgNoReadCount }}条未读</el-tag
|
||||
>
|
||||
</div>
|
||||
<div class="company">{{ numTop }}</div>
|
||||
<div class="company">
|
||||
<!-- {{ numTop }} -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="user_item_r">14:19</div> -->
|
||||
@ -294,10 +296,51 @@ export default {
|
||||
error: function () {
|
||||
console.log('连接错误');
|
||||
},
|
||||
msgTips(){
|
||||
let that = this;
|
||||
if (!('Notification' in window)) {
|
||||
console.log('浏览器不支持消息通知');
|
||||
return;
|
||||
}
|
||||
Notification.requestPermission(function(permission) {
|
||||
//如果不是当前页面,标题栏闪动+消息提示
|
||||
if (document.hidden) {
|
||||
var options = {
|
||||
body: '您有新的未读消息,请及时处理',
|
||||
silent: true
|
||||
};
|
||||
var notification = new Notification('消息通知', options);
|
||||
notification.onclick = function() {
|
||||
window.open(`/service`, '_blank');
|
||||
};
|
||||
//标题栏闪动
|
||||
var defaultTitle = document.title;
|
||||
if (that.isReceive) {
|
||||
return;
|
||||
} else {
|
||||
that.isReceive = true;
|
||||
}
|
||||
that.timer = setInterval(function() {
|
||||
var title = document.title;
|
||||
if (document.hidden && that.isReceive) {
|
||||
if (/你有新消息/.test(title) == false) {
|
||||
document.title = '【你有新消息】';
|
||||
} else {
|
||||
document.title = defaultTitle;
|
||||
}
|
||||
} else {
|
||||
that.isReceive = false;
|
||||
document.title = defaultTitle;
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
},
|
||||
getMessage(msg) {
|
||||
const data = JSON.parse(msg.data);
|
||||
console.log(JSON.parse(msg.data));
|
||||
const msgInfo = JSON.parse(msg.data);
|
||||
this.msgTips()
|
||||
// 遍历用户列表 新消息的用户未读数量加加
|
||||
if (msgInfo.sendUserId === this.activeId) {
|
||||
this.info.push(msgInfo);
|
||||
@ -358,6 +401,7 @@ export default {
|
||||
align-items: center;
|
||||
.el-avatar {
|
||||
position: relative;
|
||||
background: unset;
|
||||
img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
|
@ -4,11 +4,6 @@
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<div style="float:right">
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form
|
||||
@ -21,6 +16,11 @@
|
||||
<el-form-item label="成果标题">
|
||||
<el-input v-model="queryParams.title" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -42,11 +42,11 @@
|
||||
type="index"
|
||||
></el-table-column>
|
||||
<el-table-column label="成果标题" prop="title" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <template slot-scope="scope">
|
||||
<el-link type="primary" :underline="false">{{
|
||||
scope.row.title
|
||||
}}</el-link>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="技术领域"
|
||||
|
@ -4,11 +4,6 @@
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<div style="float:right">
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form
|
||||
@ -21,6 +16,11 @@
|
||||
<el-form-item label="需求标题">
|
||||
<el-input v-model="queryParams.title" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSearchList" size="small">
|
||||
查询
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -42,11 +42,11 @@
|
||||
type="index"
|
||||
></el-table-column>
|
||||
<el-table-column label="需求标题" prop="title" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <template slot-scope="scope">
|
||||
<el-link type="primary" :underline="false">{{
|
||||
scope.row.title
|
||||
}}</el-link>
|
||||
</template>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="技术领域"
|
||||
|
Reference in New Issue
Block a user