Commit 0d80fb2d authored by hanfeng's avatar hanfeng

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform-ui into base-modify

# Conflicts:
#	src/views/vehicleType/modal/oneType.vue
parents 0884f203 e31ca2db
import fetch from 'utils/fetch';
export function page(query) {
return fetch({
url: '/api/im/admin/customer_service/page',
method: 'get',
params: query
});
}
export function findById(id) {
return fetch({
url: '/api/im/admin/customer_service/' + id,
method: 'get'
});
}
/**
* 添加或编辑客服
* @param query
*/
export function add(query) {
return fetch({
url: '/api/im/admin/customer_service/add',
method: 'post',
data: query
});
}
/**
* 修改密码
* @param telphone
* @param password
*/
export function updatePassword(telphone, password) {
return fetch({
url: '/api/im/admin/customer_service/update_password/' + telphone + '/' + password,
method: 'put'
});
}
/**
* 删除
* @param id
* @param imUserId
*/
export function deleteById(id, imUserId) {
return fetch({
url: '/api/im/admin/customer_service/delete/' + id + '/' + imUserId,
method: 'delete'
});
}
import fetch from 'utils/fetch';
/**
* 分页查询
* @param query
*/
export function page(query) {
return fetch({
url: '/api/uccn/admin/friend_link/page',
method: 'post',
data: query
});
}
export function findById(id) {
return fetch({
url: '/api/uccn/admin/friend_link/' + id,
method: 'get'
});
}
/**
* 删除
* @param query
*/
export function deleteById(id) {
return fetch({
url: '/api/uccn/admin/friend_link/' + id,
method: 'delete'
});
}
/**
* 上下架
* @param query
*/
export function updateOnstateById(id, onState) {
return fetch({
url: '/api/uccn/admin/friend_link/on_state/' + id + '/' + onState,
method: 'put'
});
}
/**
* 编辑或保存
* @param query
*/
export function save(query) {
return fetch({
url: '/api/uccn/admin/friend_link/save',
method: 'post',
data: query
});
}
...@@ -486,6 +486,12 @@ export const asyncRouterMap = [{ ...@@ -486,6 +486,12 @@ export const asyncRouterMap = [{
component: _import('userManagement/memberEnter'), component: _import('userManagement/memberEnter'),
name: '会员录入', name: '会员录入',
authority: 'memberEnter' authority: 'memberEnter'
},
{
path:'imCustomerServiceManger',
component: _import('userManagement/imCustomerServiceManger/cusomterServiceList'),
name:'客服列表',
authority: 'imCustomerServiceManger'
} }
] ]
}, },
...@@ -598,6 +604,12 @@ export const asyncRouterMap = [{ ...@@ -598,6 +604,12 @@ export const asyncRouterMap = [{
component: _import('xxOfficialWebsite/seoList'), component: _import('xxOfficialWebsite/seoList'),
name: 'SEO管理', name: 'SEO管理',
authority: 'seoList' authority: 'seoList'
},
{
path: 'friendLinkList',
component: _import('xxOfficialWebsite/friendLinkList'),
name: '友情连接',
authority: 'friendLinkList'
} }
] ]
} }
......
...@@ -64,6 +64,13 @@ ...@@ -64,6 +64,13 @@
<i v-else class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <i v-else class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入描述"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="海报背景" :style="{display:'block'}"> <el-form-item label="海报背景" :style="{display:'block'}">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -201,6 +208,7 @@ ...@@ -201,6 +208,7 @@
fileList2:[], fileList2:[],
activeName2: '',//行程亮点 activeName2: '',//行程亮点
form: { form: {
alt:'',
id: undefined, id: undefined,
name: undefined,//营地名称 name: undefined,//营地名称
hot: 0,//营地热度 hot: 0,//营地热度
...@@ -360,6 +368,7 @@ ...@@ -360,6 +368,7 @@
latitude: this.campsiteObj.latitude, latitude: this.campsiteObj.latitude,
longitude: this.campsiteObj.longitude, longitude: this.campsiteObj.longitude,
posterBackground:this.form.posterBackground,//海报背景 posterBackground:this.form.posterBackground,//海报背景
alt:this.form.alt
}; };
console.log(params); console.log(params);
this.isExistCampsiteShop("create", params); this.isExistCampsiteShop("create", params);
...@@ -447,6 +456,7 @@ ...@@ -447,6 +456,7 @@
latitude: this.campsiteObj.latitude, latitude: this.campsiteObj.latitude,
longitude: this.campsiteObj.longitude, longitude: this.campsiteObj.longitude,
posterBackground:this.form.posterBackground,//海报背景 posterBackground:this.form.posterBackground,//海报背景
alt:this.form.alt,
}; };
console.log(params); console.log(params);
this.isExistCampsiteShop("update", params); this.isExistCampsiteShop("update", params);
...@@ -697,7 +707,8 @@ ...@@ -697,7 +707,8 @@
configure: '',//配套&收费 configure: '',//配套&收费
campsiteTagListVos: [],//营地类型 campsiteTagListVos: [],//营地类型
carouse:[],//banner轮播 carouse:[],//banner轮播
posterBackground:'' posterBackground:'',
alt:'',
}; };
this.showCampsiteVisible= false;//编辑营地地址 this.showCampsiteVisible= false;//编辑营地地址
} }
......
...@@ -148,6 +148,13 @@ ...@@ -148,6 +148,13 @@
<i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入描述"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="海报背景" :style="{display:'block'}"> <el-form-item label="海报背景" :style="{display:'block'}">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -290,6 +297,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -290,6 +297,7 @@ import ElRow from "element-ui/packages/row/src/row";
fileList2:[], fileList2:[],
activeName2: '',//行程亮点 activeName2: '',//行程亮点
form: { form: {
alt:undefined,
childPrice: undefined,//儿童价 childPrice: undefined,//儿童价
isOutside:"0", isOutside:"0",
tourDepartVo:undefined,//type:0出发地 1途径地 2目的地 tourDepartVo:undefined,//type:0出发地 1途径地 2目的地
...@@ -561,6 +569,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -561,6 +569,7 @@ import ElRow from "element-ui/packages/row/src/row";
priceDTOS: this.form.tourDepartTimeVo,//活动日期 priceDTOS: this.form.tourDepartTimeVo,//活动日期
tagDTOS: tagDTOS,//旅游标签 tagDTOS: tagDTOS,//旅游标签
posterBackground:this.form.posterBackground,//海报背景 posterBackground:this.form.posterBackground,//海报背景
alt: this.form.alt, //seo 标签优化
}; };
console.log(params); console.log(params);
goodsEdit(params).then(response => { goodsEdit(params).then(response => {
...@@ -706,6 +715,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -706,6 +715,7 @@ import ElRow from "element-ui/packages/row/src/row";
priceDTOS: this.form.tourDepartTimeVo,//活动日期 priceDTOS: this.form.tourDepartTimeVo,//活动日期
tagDTOS: tagDTOS,//旅游标签 tagDTOS: tagDTOS,//旅游标签
posterBackground:this.form.posterBackground,//海报背景 posterBackground:this.form.posterBackground,//海报背景
alt:this.form.alt, //seo 标签优化
}; };
console.log(params); console.log(params);
this.isCreate = true; this.isCreate = true;
...@@ -1057,6 +1067,7 @@ import ElRow from "element-ui/packages/row/src/row"; ...@@ -1057,6 +1067,7 @@ import ElRow from "element-ui/packages/row/src/row";
bannerDTOS:[],//banner轮播 bannerDTOS:[],//banner轮播
tourDepartTimeVo:[],//活动时间 tourDepartTimeVo:[],//活动时间
posterBackground:'',//海报背景 posterBackground:'',//海报背景
alt:'',
}, },
this.showDestinationVisible= false,//编辑目的地 this.showDestinationVisible= false,//编辑目的地
this.showPathWayVisible= false,//编辑途径地 this.showPathWayVisible= false,//编辑途径地
......
<template>
<div class="app-container calendar-list-container" v-loading.body="showLoadingBody">
<div v-if="!customerServiceDialogVisible">
<div class="filter-container" ref="filter-container">
<el-form :inline="inline" ref="queryForm" :model="listQuery" label-width="100px">
</el-form>
<!-- <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>-->
<el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate"
type="primary" icon="edit">添加
</el-button>
</div>
<el-table :key='tableKey' :data="list" border fit highlight-current-row
style="width: 100%">
<el-table-column
type="index"
align="center" label="序号" width="65">
</el-table-column>
<el-table-column width="200" align="center" label="客服名称">
<template scope="scope">
<span>{{scope.row.name}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="客服电话">
<template scope="scope">
<span>{{scope.row.telphone}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="客服密码">
<template scope="scope">
<span>{{scope.row.password}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="创建时间">
<template scope="scope">
<span>{{scope.row.createTime}}</span>
</template>
</el-table-column>
<el-table-column align="center" width="200" label="操作" fixed="right">
<template scope="scope">
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">
{{'编辑'}}
</el-button>
<el-button class="el-button el-button--text el-button--small" style="color:red;" size="small"
@click="deleteHandler(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div v-show="!listLoading" class="pagination-container">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page.sync="listQuery.page" :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
</div>
</div>
<!-- 友情连接 -->
<!-- <FriendLink v-if="friendLinkDialogVisible" :oneRow="oneRow" :title="modalTitle"
v-on:friendLinkDialogEvent="friendLinkDialogEvent"></friendLink>-->
<customerService v-if="customerServiceDialogVisible" :oneRow="oneRow" :title="modalTitle" v-on:customerServiceDialogEvent="customerServiceDialogEvent"></customerService>
</div>
</template>
<script>
import {mapGetters} from 'vuex';
import {
page
} from '../../../api/admin/userManagement/customerservice';
import ElRow from "element-ui/packages/row/src/row";
import ElCol from "element-ui/packages/col/src/col";
import {timestamp2Date} from 'src/utils/dateUtils';
import {deleteById} from "../../../api/admin/userManagement/customerservice";
import customerService from "src/views/userManagement/imCustomerServiceManger/model/customerServiceModel";
export default {
name: 'customerServiceManager',
components: {
customerService,
ElCol,
ElRow
},
data() {
return {
modalTitle: "创建",
BASE_API: process.env.BASE_API,
customerServiceDialogVisible: false,//添加、编辑弹框
showLoadingBody: false,
list: null,
total: null,
listLoading: true,
listQuery: {
page: 1,
limit: 10,
},
inline: true,
textMap: {
update: '编辑',
create: '创建'
},
labelForm: {},
tableKey: 0
}
},
created() {
this.page()
},
methods: {
/**
* 添加
* */
handleCreate() {
this.modalTitle = '创建';
this.oneRow = {};
this.customerServiceDialogVisible = true;
},
/**
* 上下架
*/
upStatus(row, onState) {
updateOnstateById(row.id, onState).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '成功',
type: 'success',
duration: 2000
});
this.page();
} else {
this.$notify({
title: '失败',
message: '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 删除
* */
deleteHandler(row) {
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteById(row.id,row.imUserId).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '删除成功',
type: 'success',
duration: 2000
});
this.page();
} else {
this.$notify({
title: '删除失败',
message: '操作失败!',
type: 'error',
duration: 2000
});
}
});
})
},
/**
* 编辑
* */
handleUpdate(row) {
this.modalTitle = '编辑';
this.oneRow = row;
this.customerServiceDialogVisible = true;
},
/**
* modal传递回来的数据
* */
customerServiceDialogEvent(e) {
this.customerServiceDialogVisible = false;
if (e) {
//编辑成功-重新加载列表
this.page();
}
},
/**
* 获取
* */
page() {
this.listLoading = true;
page(this.listQuery).then(response => {
let totalCountRs = undefined;
let listRs = undefined;
if (!this.$utils.isEmpty(response.data.data) && this.$utils.isInteger(response.data.totalCount)) {
listRs = response.data.data;
totalCountRs = response.data.totalCount;
listRs.map(function (item) {
item.createTime = timestamp2Date(item.createTime);
});
}
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
})
},
handleFilter() {
this.listQuery.page = 1;
this.$refs.queryForm.validate(valid => {
if (valid) {
this.getList();
} else {
return false;
}
});
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.page();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.page();
}
}
}
</script>
<template>
<!-- 友情:创建、编辑 -->
<div class = "friendLink">
<h4>{{title}}</h4>
<el-form :model="form" :rules="rules" ref="form" label-width="90px">
<el-row>
<el-col :span="8">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入客服名称"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="客服电话" prop="telphone">
<el-input v-model="form.telphone" placeholder="请输入客服电话" type="number"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="密码" prop="password">
<el-input v-model="form.password" placeholder="请输入密码" type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" v-if="title=='创建'" @click="createCustomerService('form')">确 定</el-button>
<el-button type="primary" v-if="title=='编辑'" @click="updateCustomerService('form')">确 定</el-button>
</div>
</div>
</template>
<style>
textarea{
display: none;
}
.el-upload-list li{
margin-left: 10px;
}
</style>
<script>
import {
getToken
} from '../../../../utils/auth';
import {findById,add} from "src/api/admin/userManagement/customerservice";
export default {
props: ["oneRow", "title","customerServiceDialogEvent"],
name: 'customerservice',
data() {
return {
BASE_API: process.env.BASE_API,
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
form: {
name:undefined, //名称
telphone:undefined, //客服电话
password: undefined
},
rules: {
telphone:{
type: 'string',
required: true,
message: '请输入客服电话',
trigger: 'blur'
}
},
}
},
mounted() {
this.cleanForm();
if(this.title === "编辑"){
let row = this.oneRow;
this.getOne(row.id);
}
},
computed: {
getHeaderWithToken() {
return {Authorization: getToken()};
},
},
methods: {
/**
* 创建
* */
createCustomerService(formName){
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
let params = {
name:this.form.name,
telphone: this.form.telphone,
password: this.form.password
};
this.toCreate(params);
} else {
return;
}
});
},
/**
* 编辑
* */
updateCustomerService(formName){
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
let params = {
id:this.oneRow.id,
name:this.form.name,
telphone: this.form.telphone,
password: this.form.password
};
this.toUpdate(params);
} else {
return;
}
});
},
/**
* 更新
* */
toUpdate(params){
add(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
});
this.$emit("customerServiceDialogEvent", true);
} else {
this.$notify({
title: '编辑失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 创建
* */
toCreate(params){
add(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
});
this.$emit("customerServiceDialogEvent", true);
} else {
this.$notify({
title: '创建失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 获取一条营地
* */
getOne(id){
findById(id).then(response => {
this.form = response.data;
})
},
/**
* 旅游-弹框-取消
* */
cancel() {
this.cleanForm();
this.$emit("customerServiceDialogEvent", false);
},
/**
* 清空弹框数据
*/
cleanForm() {
this.form = {
name:undefined,
telphone: undefined,
password: undefined
};
}
}
}
</script>
...@@ -158,6 +158,13 @@ ...@@ -158,6 +158,13 @@
<i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <i v-else-if="!imgFlag" class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入描述"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="海报背景" :style="{display:'block'}"> <el-form-item label="海报背景" :style="{display:'block'}">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -293,6 +300,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -293,6 +300,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本
fileList2:[], fileList2:[],
activeName2: '',//房车详情 activeName2: '',//房车详情
form: { form: {
alt:'',
pPrice:0,//普通会员 pPrice:0,//普通会员
hPrice:0,//黄金会员 hPrice:0,//黄金会员
zPrice:0,//钻石会员 zPrice:0,//钻石会员
...@@ -496,6 +504,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -496,6 +504,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本
hotSign: this.form.hotSign,//热门车型 hotSign: this.form.hotSign,//热门车型
rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值 rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
buyPrice: this.form.buyPrice,//购买价格 buyPrice: this.form.buyPrice,//购买价格
alt:this.form.alt,//seo 标签优化
intro:this.form.intro intro:this.form.intro
}; };
if(this.form.rentDiscountStatus == 2){ if(this.form.rentDiscountStatus == 2){
...@@ -552,6 +561,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -552,6 +561,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本
rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值 rentDiscountStatus: this.form.rentDiscountStatus,//租车优惠状态 0--没有优惠;1--会员折扣;2--固定值
// rentDiscountPrice:this.form.pPrice+","+this.form.hPrice+","+this.form.zPrice,//租车优惠价格 固定优化价格 // rentDiscountPrice:this.form.pPrice+","+this.form.hPrice+","+this.form.zPrice,//租车优惠价格 固定优化价格
buyPrice: this.form.buyPrice,//购买价格 buyPrice: this.form.buyPrice,//购买价格
alt:this.form.alt,//seo 标签优化
intro:this.form.intro intro:this.form.intro
}; };
if(this.form.rentDiscountStatus == 2){ if(this.form.rentDiscountStatus == 2){
...@@ -889,6 +899,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本 ...@@ -889,6 +899,7 @@ import UE from '../../modal/Ueditor';//百度ue富文本
rentDiscountPrice: "",//租车优惠价格 固定优化价格 rentDiscountPrice: "",//租车优惠价格 固定优化价格
buyPrice: 0,//购买价格 buyPrice: 0,//购买价格
posterBackground:'',//海报背景 posterBackground:'',//海报背景
alt:'',
} }
} }
} }
......
...@@ -75,6 +75,9 @@ ...@@ -75,6 +75,9 @@
<el-form-item> <el-form-item>
建议尺寸:1080*630 建议尺寸:1080*630
</el-form-item> </el-form-item>
<el-form-item label="alt">
<el-input v-model="form.alt" placeholder="请输入描述"></el-input>
</el-form-item>
<el-form-item label="跳转链接"> <el-form-item label="跳转链接">
<el-input v-model="form.url" placeholder="请输入跳转链接"></el-input> <el-input v-model="form.url" placeholder="请输入跳转链接"></el-input>
</el-form-item> </el-form-item>
...@@ -140,7 +143,8 @@ ...@@ -140,7 +143,8 @@
cover:"", cover:"",
type: "0", type: "0",
location: "0", location: "0",
platform: 1 platform: 1,
alt:""
}, },
listQuery: { listQuery: {
pageNo: 1, pageNo: 1,
......
<template>
<div class="app-container calendar-list-container" v-loading.body="showLoadingBody">
<div v-if="!friendLinkDialogVisible">
<div class="filter-container" ref="filter-container">
<el-form :inline="inline" ref="queryForm" :model="listQuery" label-width="100px">
</el-form>
<!-- <el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>-->
<el-button class="filter-item" style="margin-left: 10px;" @click="handleCreate"
type="primary" icon="edit">添加
</el-button>
</div>
<el-table :key='tableKey' :data="list" border fit highlight-current-row
style="width: 100%">
<el-table-column
type="index"
align="center" label="序号" width="65">
</el-table-column>
<el-table-column width="100" align="center" label="排序">
<template scope="scope">
<span>{{scope.row.rank}}</span>
</template>
</el-table-column>
<el-table-column width="100" align="center" label="状态">
<template scope="scope">
<span>{{scope.row.onState===true?'上架':'下架'}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="前台显示文字">
<template scope="scope">
<span>{{scope.row.name}}</span>
</template>
</el-table-column>
<el-table-column width="200" align="center" label="链接">
<template scope="scope">
<span>{{scope.row.linkUrl}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="发布时间">
<template scope="scope">
<span>{{scope.row.publishTime}}</span>
</template>
</el-table-column>
<el-table-column align="center" width="200" label="操作" fixed="right">
<template scope="scope">
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">
{{'编辑'}}
</el-button>
<el-button size="small" class="el-button el-button--text el-button--small" style="color: #6ce26c;"
v-if="scope.row.onState==false" @click="upStatus(scope.row,true)">上架
</el-button>
<el-button size="small" class="el-button el-button--text el-button--small" style="color: #1d90e6"
v-if="scope.row.onState==true" @click="upStatus(scope.row,false)">下架
</el-button>
<el-button class="el-button el-button--text el-button--small" style="color:red;" size="small"
@click="deleteHandler(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div v-show="!listLoading" class="pagination-container">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page.sync="listQuery.page" :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit"
layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
</div>
</div>
<!-- 友情连接 -->
<FriendLink v-if="friendLinkDialogVisible" :oneRow="oneRow" :title="modalTitle"
v-on:friendLinkDialogEvent="friendLinkDialogEvent"></friendLink>
</div>
</template>
<script>
import {mapGetters} from 'vuex';
import {
deleteById,
page,
updateOnstateById
} from '../../api/officialWebsit/friendLink';
import Element1 from "../admin/menu/components/element";
import ElRow from "element-ui/packages/row/src/row";
import ElCol from "element-ui/packages/col/src/col";
import {timestamp2Date} from "../../utils/dateUtils";
import FriendLink from "./modal/friendLinkModel";
export default {
name: 'friendLinkManager',
components: {
FriendLink,
ElCol,
ElRow,
Element1
},
data() {
return {
modalTitle: "创建",
BASE_API: process.env.BASE_API,
friendLinkDialogVisible: false,//添加、编辑弹框
showLoadingBody: false,
form: {
name: undefined,//名称
linkUrl: undefined, //连接地址
brief: undefined, //简要说明
rank: 0, //排序
onState: false// 上下架状态
},
publishTime: undefined,
list: null,
total: null,
status: {
0: '下架',
1: '上架'
},
listLoading: true,
listQuery: {
page: 1,
limit: 10,
onState: undefined
},
inline: true,
textMap: {
update: '编辑',
create: '创建'
},
labelForm: {},
tableKey: 0
}
},
created() {
this.page()
},
methods: {
/**
* 添加
* */
handleCreate() {
this.modalTitle = '创建';
this.oneRow = {};
this.friendLinkDialogVisible = true;
},
/**
* 上下架
*/
upStatus(row, onState) {
updateOnstateById(row.id, onState).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '成功',
type: 'success',
duration: 2000
});
this.page();
} else {
this.$notify({
title: '失败',
message: '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 删除
* */
deleteHandler(row) {
this.$confirm('确定删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteById(row.id).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '删除成功',
type: 'success',
duration: 2000
});
this.page();
} else {
this.$notify({
title: '删除失败',
message: '操作失败!',
type: 'error',
duration: 2000
});
}
});
})
},
/**
* 编辑
* */
handleUpdate(row) {
this.modalTitle = '编辑';
this.oneRow = row;
this.friendLinkDialogVisible = true;
},
/**
* modal传递回来的数据
* */
friendLinkDialogEvent(e) {
this.friendLinkDialogVisible = false;
if (e) {
//编辑成功-重新加载列表
this.page();
}
},
/**
* 获取
* */
page() {
this.listLoading = true;
page(this.listQuery).then(response => {
let totalCountRs = undefined;
let listRs = undefined;
if (!this.$utils.isEmpty(response.data.data) && this.$utils.isInteger(response.data.totalCount)) {
listRs = response.data.data;
totalCountRs = response.data.totalCount;
listRs.map(function (item) {
if (item.publishTime != null) {
item.publishTime = timestamp2Date(item.publishTime);
}
});
}
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
})
},
handleFilter() {
this.listQuery.page = 1;
this.$refs.queryForm.validate(valid => {
if (valid) {
this.getList();
} else {
return false;
}
});
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.page();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.page();
}
}
}
</script>
<template>
<!-- 友情:创建、编辑 -->
<div class = "friendLink">
<h4>{{title}}</h4>
<el-form :model="form" :rules="rules" ref="form" label-width="90px">
<el-row>
<el-col :span="8">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称"></el-input>
</el-form-item>
<el-form-item label="上架" prop="onState">
<el-checkbox v-model="form.onState"></el-checkbox>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="排序" prop="rank">
<el-input v-model="form.rank" placeholder="请输入排序" type="number"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="链接地址" prop="linkUrl">
<el-input v-model="form.linkUrl" type="text" placeholder="请输入链接地址"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="简要说明" prop="brief">
<el-input v-model="form.brief" placeholder="请输入简要说明" type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" v-if="title=='创建'" @click="createFriendLink('form')">确 定</el-button>
<el-button type="primary" v-if="title=='编辑'" @click="updateFriendLink('form')">确 定</el-button>
</div>
</div>
</template>
<style>
textarea{
display: none;
}
.el-upload-list li{
margin-left: 10px;
}
</style>
<script>
import {
getToken
} from '../../../utils/auth';
import {findById, save} from "../../../api/officialWebsit/friendLink";
export default {
props: ["oneRow", "title","friendLinkDialogEvent"],
name: 'friendLink',
data() {
return {
BASE_API: process.env.BASE_API,
config: {
initialFrameWidth: null,
initialFrameHeight: 350
},
form: {
name:undefined, //名称
onState:undefined, //上下架状态
rank:undefined, //排序
linkUrl: undefined, //链接地址
brief: undefined //简要说明
},
rules: {
name:{
type: 'string',
required: true,
message: '请输入名称',
trigger: 'blur'
},
linkUrl:{
type: 'string',
required: true,
message: '请输入链接地址',
trigger: 'blur'
}
}
}
},
mounted() {
this.cleanForm();
if(this.title === "编辑"){
let row = this.oneRow;
this.getOne(row.id);
}
},
computed: {
getHeaderWithToken() {
return {Authorization: getToken()};
},
},
methods: {
/**
* 创建
* */
createFriendLink(formName){
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
let params = {
name:this.form.name,
onState: this.form.onState,
rank:this.form.rank,
linkUrl: this.form.linkUrl,
brief: this.form.brief
};
this.toCreate(params);
} else {
return;
}
});
},
/**
* 编辑
* */
updateFriendLink(formName){
const set = this.$refs;
set[formName].validate(valid => {
if (valid) {
let params = {
id:this.oneRow.id,
name:this.form.name,
onState: this.form.onState,
rank:this.form.rank,
linkUrl: this.form.linkUrl,
brief: this.form.brief
};
this.toUpdate(params);
} else {
return;
}
});
},
/**
* 更新
* */
toUpdate(params){
save(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '编辑成功',
type: 'success',
duration: 2000
});
this.$emit("friendLinkDialogEvent", true);
} else {
this.$notify({
title: '编辑失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 创建
* */
toCreate(params){
save(params).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
});
this.$emit("friendLinkDialogEvent", true);
} else {
this.$notify({
title: '创建失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
},
/**
* 获取一条营地
* */
getOne(id){
findById(id).then(response => {
this.form = response.data;
})
},
/**
* 旅游-弹框-取消
* */
cancel() {
this.cleanForm();
this.$emit("friendLinkDialogEvent", false);
},
/**
* 清空弹框数据
*/
cleanForm() {
this.form = {
name:undefined,
onState:undefined,
rank:undefined,
linkUrl: undefined,
brief: undefined
};
}
}
}
</script>
...@@ -30,6 +30,13 @@ ...@@ -30,6 +30,13 @@
<i v-else class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> <i v-else class="el-icon-plus avatar-uploader-icon" style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入描述"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="总人数" prop="limitNum"> <el-form-item label="总人数" prop="limitNum">
...@@ -195,6 +202,7 @@ ...@@ -195,6 +202,7 @@
fileList2:[], fileList2:[],
activeName2: '',//行程亮点 activeName2: '',//行程亮点
form: { form: {
alt:undefined,
id: undefined, id: undefined,
title: undefined,//营地名称 title: undefined,//营地名称
subtitle: undefined,//营地热度 subtitle: undefined,//营地热度
...@@ -336,6 +344,7 @@ create(formName){ ...@@ -336,6 +344,7 @@ create(formName){
set[formName].validate(valid => { set[formName].validate(valid => {
if (valid) { if (valid) {
let params = { let params = {
alt:this.form.alt,
id: this.form.id, id: this.form.id,
title: this.form.title,//营地名称 title: this.form.title,//营地名称
subtitle: this.form.subtitle,//营地热度 subtitle: this.form.subtitle,//营地热度
...@@ -395,6 +404,7 @@ create(formName){ ...@@ -395,6 +404,7 @@ create(formName){
if (valid) { if (valid) {
this.isCreate = true; this.isCreate = true;
let params = { let params = {
alt:this.form.alt,
id: this.form.id, id: this.form.id,
title: this.form.title,//营地名称 title: this.form.title,//营地名称
subtitle: this.form.subtitle,//营地热度 subtitle: this.form.subtitle,//营地热度
...@@ -574,6 +584,7 @@ create(formName){ ...@@ -574,6 +584,7 @@ create(formName){
this.fileList2=[]; this.fileList2=[];
this.activeName2= '';//营地详情 this.activeName2= '';//营地详情
this.form = { this.form = {
alt:undefined,
id: undefined, id: undefined,
title: undefined,//营地名称 title: undefined,//营地名称
subtitle: undefined,//营地热度 subtitle: undefined,//营地热度
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="封面图"> <el-form-item label="封面图">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:headers="getHeaderWithToken" :headers="getHeaderWithToken"
...@@ -83,6 +82,13 @@ ...@@ -83,6 +82,13 @@
style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i> style="lineHeight:100px;width:300px;height: 100px;border: 1px dashed #ccc;"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="alt">
<el-input v-model="form.alt" type="text" placeholder="请输入描述"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card">
<el-tab-pane label="文章内容" name="first"> <el-tab-pane label="文章内容" name="first">
<div class="editor-container" v-if="activeName=='first'"> <div class="editor-container" v-if="activeName=='first'">
...@@ -162,7 +168,8 @@ ...@@ -162,7 +168,8 @@
epitome: undefined, epitome: undefined,
text:"", text:"",
author:undefined, author:undefined,
publisher:undefined publisher:undefined,
alt:undefined
}, },
rules: { rules: {
title: { title: {
...@@ -339,7 +346,8 @@ ...@@ -339,7 +346,8 @@
epitome: undefined, epitome: undefined,
text:"", text:"",
author:undefined, author:undefined,
publisher:undefined publisher:undefined,
alt:undefined
} }
} }
} }
......
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