first commit

This commit is contained in:
GYJ
2024-12-02 10:35:48 +08:00
commit 73081077d3
517 changed files with 173283 additions and 0 deletions

View File

@@ -0,0 +1,521 @@
<template>
<div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="全局系统配置" name="first">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="服务费配置" name="second">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
<template slot-scope="scope">
<div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
</template>
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<!-- <el-tab-pane label="首页配置" name="thirdly">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="是否启用" width="500">
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amendWhether(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="修改" :visible.sync="dialogFormVisible1" center>
<el-form :model="form2">
<el-form-item label="配置类型:" :label-width="formLabelWidth">
<el-input v-model="form2.min" style="width:65%;" readonly></el-input>
</el-form-item>
<el-form-item label="是否启用:" :label-width="formLabelWidth">
<el-select v-model="form2.value" placeholder="请选择类型" style="width:65%;">
<el-option v-for="item in values" :key="item.value" :label="item.label"
:value="item.label">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="WhetherNoticeTo()"> </el-button>
</div>
</el-dialog>
</el-tab-pane> -->
<el-tab-pane label="微信配置" name="fifth">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="支付宝配置" name="sixth">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
<template slot-scope="scope">
<div
style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 4;overflow: hidden;">
{{scope.row.value}}</div>
</template>
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="短信配置" name="seventh">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="客服配置" name="kefu">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="文件上传配置" name="wenjian">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
<template slot-scope="scope">
<div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
</template>
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="协议配置" name="xieyi">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
<template slot-scope="scope">
<div style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">{{scope.row.value}}</div>
</template>
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="开关配置" name="kaiguan">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型" width="250">
</el-table-column>
<el-table-column prop="value" label="内容">
</el-table-column>
<el-table-column prop="createAt" label="创建时间" width="180">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="图片配置" name="image">
<el-table v-loading="tableDataLoading" :data="tableData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型" width="250">
</el-table-column>
<el-table-column prop="value" label="内容">
<template slot-scope="scope">
<div
style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">
{{scope.row.value}}
</div>
</template>
</el-table-column>
<el-table-column prop="createAt" label="创建时间" width="180">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="amend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<!-- 修改弹框 -->
<el-dialog title="修改" :visible.sync="dialogFormVisible" center>
<el-form :model="form">
<el-form-item label="配置类型:" :label-width="formLabelWidth">
<el-input v-model="form.min" style="width:65%;" readonly></el-input>
</el-form-item>
<el-form-item label="内容:" :label-width="formLabelWidth">
<quill-editor v-if="form.conditionFrom=='xieyi'" ref="myTextEditor" v-model="form.value" :options="quillOption"
style="padding-bottom: 50px;height: 300px;width: 72%;display: inline-table;margin-bottom: 60px;">
</quill-editor>
<div v-else-if="form.conditionFrom=='image'">
<!-- <el-input v-model="form.value" style="width:65%;"></el-input> -->
<el-upload class="avatar-uploader" v-model="form.value"
:action="$http.adornUrlUp('alioss/upload')" :show-file-list="false"
:on-success="handleAvatarSuccess1">
<img v-if="form.value" :src="form.value" class="avatar" style="width: 148px;height: 148px;" />
<i v-else class="el-icon-plus avatar-uploader-icon" style="font-size: 28px;color: #8c939d"></i>
</el-upload>
</div>
<div v-else-if="form.conditionFrom=='kaiguan'">
<div>
<el-radio-group v-model="form.value">
<el-radio label="是"></el-radio>
<el-radio label="否"></el-radio>
</el-radio-group>
</div>
</div>
<el-input v-else v-model="form.value" :rows="4" style="width:65%;"></el-input>
<!-- <el-input v-model="form.value" style="width:65%;"></el-input> -->
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="amendNoticeTo()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
quillEditor
} from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import quillConfig from '../locality/quill-config.js'
export default {
components: {
quillEditor
},
data() {
return {
quillOption: quillConfig,
openValue: '是',
closeValue: '否',
limit: 10,
page: 0,
min: '',
value: '',
id: '',
condition: 'xitong',
activeName: 'first',
dialogFormVisible: false,
dialogFormVisible1: false,
tableDataLoading: true,
formLabelWidth: '200px',
form: {
id: '',
min: '',
value: '',
type: '',
},
form2: {
id: '',
min: '',
value: '',
type: '',
},
values: [{
value: 1,
label: '是'
},
{
value: 2,
label: '否'
}
],
tableData: [],
checkBoxData: [] //多选框选择的值
}
},
methods: {
handleSizeChange(val) {
this.limit = val;
this.dataSelect();
},
handleCurrentChange(val) {
this.page = val - 1;
this.dataSelect();
},
handleClick(tab, event) {
if (tab._props.label == '全局系统配置') {
this.condition = 'xitong'
this.dataSelect()
}
if (tab._props.label == '首页配置') {
this.condition = 'shouye'
this.dataSelect()
}
if (tab._props.label == '微信配置') {
this.condition = 'weixin'
this.dataSelect()
}
if (tab._props.label == '支付宝配置') {
this.condition = 'zhifubao'
this.dataSelect()
}
if (tab._props.label == '短信配置') {
this.condition = 'duanxin'
this.dataSelect()
}
if (tab._props.label == '任务系统配置') {
this.condition = 'renwu'
this.dataSelect()
}
if (tab._props.label == '文件上传配置') {
this.condition = 'oss'
this.dataSelect()
}
if (tab._props.label == '服务费配置') {
this.condition = 'fuwufei'
this.dataSelect()
}
if (tab._props.label == '协议配置') {
this.condition = 'xieyi'
this.dataSelect()
}
if (tab._props.label == '图片配置') {
this.condition = 'image'
this.dataSelect()
}
if (tab._props.label == '开关配置') {
this.condition = 'kaiguan'
this.dataSelect()
}
if (tab._props.label == '客服配置') {
this.condition = 'kefu'
this.dataSelect()
}
},
// 修改弹框
amend(index, rows) {
this.dialogFormVisible = true;
this.form.id = rows.id;
this.form.type = rows.type
this.form.min = rows.min;
this.form.value = rows.value;
this.form.max = rows.max;
this.form.createAt = rows.createAt;
this.form.conditionFrom = rows.conditionFrom
},
// 修改
amendNoticeTo() {
this.$http({
url: this.$http.adornUrl('common/update'),
method: 'post',
data: this.$http.adornData({
'id': this.form.id,
'type': this.form.type,
'value': this.form.value,
'min': this.form.min,
'max': this.form.max,
'createAt': this.form.createAt,
'conditionFrom': this.form.conditionFrom
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message.error(data.msg)
}
})
},
// 修改首页
amendWhether(index, rows) {
this.dialogFormVisible1 = true;
this.form2.id = rows.id;
this.form2.type = rows.type
this.form2.min = rows.min;
this.form2.value = rows.value;
this.form2.max = rows.max;
this.form2.createAt = rows.createAt;
this.form2.conditionFrom = rows.conditionFrom
},
WhetherNoticeTo() {
this.$http({
url: this.$http.adornUrl('common/update'),
method: 'post',
data: this.$http.adornData({
'id': this.form2.id,
'type': this.form2.type,
'value': this.form2.value,
'min': this.form2.min,
'max': this.form2.max,
'createAt': this.form2.createAt,
'conditionFrom': this.form2.conditionFrom
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message.error(data.msg)
}
})
},
// 获取数据列表
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl(`common/type/condition/${this.condition}`),
method: 'get',
params: this.$http.adornParams({})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.tableDataLoading = false
let returnData = data.data;
this.tableData = returnData
}
})
},
handleAvatarSuccess1(file, fileList) {
this.form.value = file.data
console.log('file.data',file.data)
},
},
mounted() {
this.dataSelect()
}
}
</script>
<style scoped="scoped">
.eit {
height: 120px;
}
</style>

487
src/views/app/app.vue Normal file
View File

@@ -0,0 +1,487 @@
<template>
<div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<div style="float: right;margin-right:2%;">
<el-button style='margin: 10px 0;' :disabled="!isAuth('app:add')" size="mini" type="primary"
icon="document" @click="addUpgrade">添加升级</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="upgradeData1.records">
<el-table-column fixed prop="id" label="编号" width="80">
</el-table-column>
<el-table-column prop="wgtUrl" label="统一地址">
</el-table-column>
<el-table-column prop="androidWgtUrl" label="安卓">
</el-table-column>
<el-table-column prop="iosWgtUrl" label="苹果">
</el-table-column>
<el-table-column prop="version" label="安卓版本">
</el-table-column>
<el-table-column prop="iosVersion" label="ios版本">
</el-table-column>
<el-table-column prop="content" label="升级方式">
<template slot-scope="scope">
<span>{{scope.row.method == 'true' ? '强制升级' : '普通升级'}}</span>
</template>
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('app:update')"
@click="upgradebj(scope.$index, scope.row)">编辑
</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('app:delete')"
@click="upgradelete(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="upgradeData1.total">
</el-pagination>
</div>
<!-- 添加升级弹框 -->
<el-dialog title="添加升级" :visible.sync="dialogFormVisible3" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;"><i
style="color: #f56c6c;margin-right: 2px;">*</i>统一地址</span>
<el-input style="width: 50%;" v-model="wgtUrl" placeholder="请输入统一地址"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;"><i
style="color: #f56c6c;margin-right: 2px;">*</i>安卓地址</span>
<el-input style="width:50%;" v-model="androidWgtUrl" placeholder="请输入安卓地址"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;"><i
style="color: #f56c6c;margin-right: 2px;">*</i>苹果地址</span>
<el-input style="width: 50%;" v-model="iosWgtUrl" placeholder="请输入苹果地址"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;"><i
style="color: #f56c6c;margin-right: 2px;">*</i>安卓版本号</span>
<el-input style="width: 50%;" v-model="version" placeholder="请输入安卓版本号"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;"><i
style="color: #f56c6c;margin-right: 2px;">*</i>ios版本号</span>
<el-input style="width: 50%;" v-model="iosVersion" placeholder="请输入ios版本号"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;"><i
style="color: #f56c6c;margin-right: 2px;">*</i>升级方式</span>
<el-select v-model="method" placeholder="请选择升级方式" style="width:50%;">
<el-option v-for="item in methods" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;"><i
style="color: #f56c6c;margin-right: 2px;">*</i>升级内容</span>
<el-input style="width: 50%;" v-model="des" placeholder="请输入升级内容"></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3 = false"> </el-button>
<el-button type="primary" @click="upgradaddTo()"> </el-button>
</div>
</el-dialog>
<!-- 修改升级弹框 -->
<el-dialog title="修改" :visible.sync="dialogFormVisible4" center>
<el-form :model="formupgrad">
<el-form-item label="统一地址:" :label-width="formLabelWidth">
<el-input v-model="formupgrad.wgtUrl" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="安卓地址:" :label-width="formLabelWidth">
<el-input v-model="formupgrad.androidWgtUrl" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="苹果地址:" :label-width="formLabelWidth">
<el-input v-model="formupgrad.iosWgtUrl" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="安卓版本号:" :label-width="formLabelWidth">
<el-input v-model="formupgrad.version" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="ios版本号" :label-width="formLabelWidth">
<el-input v-model="formupgrad.iosVersion" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="升级方式:" :label-width="formLabelWidth">
<el-select v-model="formupgrad.method" placeholder="请选择升级方式" style="width:65%;">
<el-option v-for="item in methods" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="升级内容:" :label-width="formLabelWidth">
<el-input v-model="formupgrad.des" style="width:65%;"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible4 = false"> </el-button>
<el-button type="primary" @click="upgradbjTo()"> </el-button>
</div>
</el-dialog>
</el-tabs>
</div>
</template>
<script>
export default {
data() {
return {
limit: 10,
page: 1,
state: 1,
url: '',
title: '',
type: '',
id: '',
nav: '',
keyword: '',
image_url: '',
androidWgtUrl: '',
iosWgtUrl: '',
wgtUrl: '',
version: '',
iosVersion: '',
des: '',
checkBoxData: [], //多选框选择的值
method: 'false',
methods: [{
value: 'false',
label: '普通升级'
},
{
value: 'true',
label: '强制升级'
}
],
formupgrad: {
id: '',
androidWgtUrl: '',
iosWgtUrl: '',
wgtUrl: '',
version: '',
des: '',
method: '',
iosVersion: ''
},
formLabelWidth: '200px',
activeName: 'first',
tableDataLoading: true,
dialogFormVisible3: false,
dialogFormVisible4:false,
tableData: [],
homeData: [],
choicenData2: [],
upgradeData: [],
upgradeData1: [],
choicenData: [],
types: [{
value: 'word',
label: '文字'
},
{
value: 'url',
label: '链接'
}
],
bannerData: [],
form1: {
id: '',
url: '',
image_url: ''
},
form: {
id: '',
title: '',
url: '',
type: '',
state: '',
types: [{
value: 'word',
label: '文字'
},
{
value: 'url',
label: '链接'
}
],
},
formcomp: {
id: '',
state: '',
title: '',
url: '',
image_url: ''
}
}
},
methods: {
handleSizeChange2(val) {
this.limit = val;
this.upgradeSelect()
},
handleCurrentChange2(val) {
this.page = val;
this.upgradeSelect()
},
handleClick(tab, event) {
this.upgradeSelect()
},
// 添加升级弹框
addUpgrade() {
this.dialogFormVisible3 = true
},
// 添加升级
upgradaddTo() {
if (this.wgtUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入统一地址',
type: 'warning'
});
return
}
if (this.androidWgtUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入安卓地址',
type: 'warning'
});
return
}
if (this.iosWgtUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入苹果地址',
type: 'warning'
});
return
}
if (this.version == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入安卓版本号',
type: 'warning'
});
return
}
if (this.iosVersion == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入苹果版本号',
type: 'warning'
});
return
}
if (this.method == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择升级方式',
type: 'warning'
});
return
}
if (this.des == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入升级内容',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('appinfo/save'),
method: 'post',
data: this.$http.adornData({
'androidWgtUrl': this.androidWgtUrl,
'iosWgtUrl': this.iosWgtUrl,
'wgtUrl': this.wgtUrl,
'version': this.version,
'iosVersion': this.iosVersion,
'method': this.method,
'des': this.des
})
}).then(({
data
}) => {
this.dialogFormVisible3 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.upgradeSelect()
}
})
})
},
// 修改升级弹框
upgradebj(index, rows) {
this.dialogFormVisible4 = true;
this.formupgrad.androidWgtUrl = rows.androidWgtUrl;
this.formupgrad.id = rows.id;
this.formupgrad.iosWgtUrl = rows.iosWgtUrl;
this.formupgrad.wgtUrl = rows.wgtUrl;
this.formupgrad.version = rows.version;
this.formupgrad.iosVersion = rows.iosVersion;
this.formupgrad.des = rows.des;
this.formupgrad.method = rows.method;
},
// 修改升级
upgradbjTo() {
this.$http({
url: this.$http.adornUrl('appinfo/save'),
method: 'post',
data: this.$http.adornData({
'id': this.formupgrad.id,
'androidWgtUrl': this.formupgrad.androidWgtUrl,
'iosWgtUrl': this.formupgrad.iosWgtUrl,
'wgtUrl': this.formupgrad.wgtUrl,
'version': this.formupgrad.version,
'iosVersion': this.formupgrad.iosVersion,
'des': this.formupgrad.des,
'method': this.formupgrad.method,
})
}).then(({
data
}) => {
this.dialogFormVisible4 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.upgradeSelect()
}
})
})
},
// 删除升级
upgradelete(row) {
let delid = row.id
this.id = delid
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`appinfo/delete/${this.id}`),
method: 'get',
params: this.$http.adornParams({})
}).then(({
data
}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.name = '';
this.upgradeSelect()
}
})
})
}).catch(() => {})
},
// 升级配置数据列表
upgradeSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl(`appinfo/list?page=${this.page}&limit=${this.limit}`),
method: 'get',
params: this.$http.adornParams({})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data;
this.upgradeData1 = returnData
})
},
},
mounted() {
console.log('···························')
this.upgradeSelect()
}
};
</script>
<style>
.customWidth {
width: 80% !important;
}
.adver_main.box {
display: block;
max-width: 100%;
text-align: center;
border: 1px dotted rgba(67, 79, 103, .4);
}
.cards {
padding: 0 8px;
margin-bottom: 15px;
}
.adver_main.box a {
display: flex;
justify-content: center;
height: 150px;
line-height: 150px;
text-decoration: none
}
.bannerManin {
border: 1px solid #e8e8e8;
font-size: 14px;
padding: 0 24px;
display: flex;
justify-content: center;
align-items: center;
height: 113px;
color: rgba(0, 0, 0, .65);
}
.bannerManin span {
display: inline-block;
margin-left: 5px;
}
.bannerManin img {
width: 48px;
height: 48px;
border-radius: 50%;
}
.bannerbtn {
display: flex;
border-top: none !important;
border: 1px solid #e8e8e8;
padding: 11px;
font-size: 14px;
color: #3E8EF7;
}
.bannerbtn a {
flex: 1;
text-align: center;
color: #3E8EF7 !important;
text-decoration: none;
}
</style>

View File

@@ -0,0 +1,382 @@
<template>
<div>
<div style="display: inline-block;">
<span>状态</span>
<el-select v-model="status" style="width:150px;margin-left: 10px;" @change="select()">
<el-option v-for="item in statesnum" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;
<div style="position: relative;display: inline-block;">
<span>姓名</span>
<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入姓名" v-model="userName"></el-input>&nbsp;&nbsp;
</div>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select">查询</el-button>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置</el-button>
<el-button style='margin:0 0 20px 20px;' v-if="isAuth('autonym:pass')" size="mini" type="primary" icon="document" @click="passClick()" :disabled="checkBoxData.length <= 0">通过</el-button>
</div>
<el-table
@selection-change="changeFun"
v-loading="tableDataLoading"
:data="tableData.list">
<el-table-column type="selection" fixed >
</el-table-column>
<el-table-column
prop="id"
label="编号">
</el-table-column>
</el-table-column>
<el-table-column
prop="studentImg"
label="学生证照片"
width="150">
<template slot-scope="scope">
<div v-if="scope.row.studentImg == null || scope.row.studentImg == ''">
暂无图片
</div>
<div v-else-if="scope.row.studentImg.includes(',')" style="display:flex;flex-wrap: wrap;">
<div v-for="item in scope.row.studentImg.split(',')" style="margin: 2px;">
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="item" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="item" alt="">
</el-popover>
</div>
</div>
<div v-else>
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="scope.row.studentImg" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="scope.row.studentImg" alt="">
</el-popover>
</div>
</template>
</el-table-column>
<el-table-column
prop="cardFront"
label="身份证正面"
width="150">
<template slot-scope="scope">
<div v-if="scope.row.cardFront == null || scope.row.cardFront == ''">
暂无图片
</div>
<div v-else-if="scope.row.cardFront.includes(',')" style="display:flex;flex-wrap: wrap;">
<div v-for="item in scope.row.cardFront.split(',')" style="margin: 2px;">
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="item" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="item" alt="">
</el-popover>
</div>
</div>
<div v-else>
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="scope.row.cardFront" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="scope.row.cardFront" alt="">
</el-popover>
</div>
</template>
</el-table-column>
<el-table-column
prop="cardBack"
label="身份证反面"
width="150">
<template slot-scope="scope">
<div v-if="scope.row.cardBack == null || scope.row.cardBack == ''">
暂无图片
</div>
<div v-else-if="scope.row.cardBack.includes(',')" style="display:flex;flex-wrap: wrap;">
<div v-for="item in scope.row.cardBack.split(',')" style="margin: 2px;">
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="item" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="item" alt="">
</el-popover>
</div>
</div>
<div v-else>
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="scope.row.cardBack" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="scope.row.cardBack" alt="">
</el-popover>
</div>
</template>
</el-table-column>
<el-table-column
prop="userName"
label="姓名"
width="200">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row)">{{scope.row.userName ? scope.row.userName : '未绑定'}}</span>
</template>
</el-table-column>
<el-table-column
prop="school"
label="学校"
width="150">
</el-table-column>
<el-table-column
prop="address"
label="地址"
width="160">
</el-table-column>
<el-table-column
prop="content"
label="审核内容"
width="160">
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
width="160">
</el-table-column>
<el-table-column
fixed='right'
prop="status"
label="状态"
width="160">
<template slot-scope="scope">
<span v-if="scope.row.status == 0">待审核</span>
<span v-if="scope.row.status == 1">审核成功</span>
<span v-if="scope.row.status == 2">已拒绝</span>
</template>
</el-table-column>
<el-table-column
fixed='right'
label="操作"
width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
:disabled="!isAuth('autonym:refuse') || scope.row.status !== 0"
@click="refuseClick(scope.row)">拒绝
</el-button>
<el-button
size="mini"
type="primary"
:disabled="!isAuth('autonym:pass') || scope.row.status !== 0"
@click="passClicks(scope.row)">通过
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]"
:page-size="limit"
:current-page="page"
layout="total,sizes, prev, pager, next,jumper"
:total="tableData.totalCount">
</el-pagination>
</div>
<!-- 任务拒绝弹框 -->
<el-dialog title="任务拒绝" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;position: relative;top: -70px;">拒绝理由</span>
<el-input style="width:50%;" v-model="content" type="textarea" :rows="4" placeholder="请输入拒绝理由"></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="refuseto()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
limit:10,
page:1,
content:'',
status:-1,
statesnum:[
{
value: -1,
label: '全部'
},
{
value: 0,
label: '待审核'
}, {
value: 1,
label: '审核成功'
}, {
value: 2,
label: '拒绝'
}
],
userName :'',
activeName: 'first',
tableDataLoading:false,
dialogFormVisible:false,
tableData:[],
checkBoxData: [],//多选框选择的值
}
},
methods: {
// 多选
changeFun(val) {
this.checkBoxData = val;
},
// 详情跳转
updates (row) {
this.$router.push({path: '/userDetail', query: {userId: row.userId}})
},
handleSizeChange(val) {
this.limit = val;
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val;
this.dataSelect()
},
//任务通过
passClick(id){
this.status = 1
this.content= '同意'
var ids= id ? [id] : this.checkBoxData.map(item => {
return item.id
})
this.$http({
url: this.$http.adornUrl(`student/auditStudentAuthentication/${ids}/${this.status}/${this.content}`),
method: 'post',
data: this.$http.adornData({
})
}).then(({data}) => {
if(data.code == 0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.content= ''
this.status = -1
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.content= ''
this.status = -1
this.dataSelect()
}
})
}
})
},
//单条任务通过
passClicks(row){
this.status = 1
this.content= '同意'
this.$http({
url: this.$http.adornUrl(`student/auditStudentAuthentication/${row.id}/${this.status}/${this.content}`),
method: 'post',
data: this.$http.adornData({
})
}).then(({data}) => {
if(data.code == 0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.content= ''
this.status = -1
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.content= ''
this.status = -1
this.dataSelect()
}
})
}
})
},
//任务拒绝
refuseClick(rows){
this.status = 2
this.helpTakeId = rows.id
this.content = ''
this.dialogFormVisible = true
},
refuseto(){
if (this.content == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入拒绝理由',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl(`student/auditStudentAuthentication/${this.helpTakeId}/${this.status}/${this.content}`),
method: 'post',
data: this.$http.adornData({
})
}).then(({data}) => {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.content = ''
this.status = -1
this.dataSelect()
}
})
})
},
// 查询
select(){
this.page = 1
this.limit = 10
this.dataSelect()
},
// 重置
cleans(){
this.status = -1
this.userName = ''
this.dataSelect()
},
// 获取派单数据列表
dataSelect () {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('student/selectStudentPage'),
method: 'get',
params: this.$http.adornParams({
'page':this.page,
'limit':this.limit,
'status':this.status,
'userName':this.userName
})
}).then(({data}) => {
this.tableDataLoading = false
let returnData = data.data;
this.tableData = returnData
})
}
},
mounted() {
this.dataSelect()
}
};
</script>
<style>
</style>

View File

@@ -0,0 +1,902 @@
<template>
<el-tabs v-model = "activeName" @tab-click = "handleClick">
<el-tab-pane label = "轮播图" name = "first">
<div style = "float: right;margin-right:2%;">
<el-button style = "margin: 10px 0;" :disabled = "!isAuth('bannerList:add')" size = "mini" type = "primary" icon = "document"
@click = "addNotice">添加轮播图</el-button>
</div>
<el-table v-loading = "tableDataLoading" :data = "tableData.list">
<el-table-column fixed prop = "id" label = "编号" width = "50"></el-table-column>
<el-table-column prop = "imageUrl" label = "头像">
<template slot-scope = "scope">
  <img :src = "scope.row.imageUrl" width = "60" height = "60"/>
</template>
</el-table-column>
<el-table-column prop = "name" label = "轮播图名称"></el-table-column>
<el-table-column prop = "state" label = "状态">
<template slot-scope = "scope">
<span v-if = "scope.row.state == 1">显示</span>
<span v-if = "scope.row.state == 2" style = "color: #f56c6c;">隐藏</span>
</template>
</el-table-column>
<el-table-column prop = "state" label = "是否启用">
<template slot-scope = "scope">
<el-switch v-model = "scope.row.state" @change = "change(scope.row.state,scope.row)" :active-value = "openValue"
:inactive-value = "closeValue" active-color = "#13ce66" inactive-color = "#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column prop = "createTime" label = "创建时间" width = "160"></el-table-column>
<el-table-column label = "操作" width = "180">
<template slot-scope = "scope">
<el-button size = "mini" type = "primary" :disabled = "!isAuth('bannerList:update')"
@click = "amendBanner(scope.$index, scope.row)">修改
</el-button>
<el-button size = "mini" type = "danger" :disabled = "!isAuth('bannerList:delete')"
@click = "deletes(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[10, 20, 30, 40]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label = "首页分类" name = "second">
<div style = "float: right;margin-right:2%;">
<el-button style = "margin: 10px 0;" :disabled = "!isAuth('bannerList:add')" size = "mini" type = "primary" icon = "document" @click = "addNotice2">添加任务分类</el-button>
</div>
<el-table v-loading = "tableDataLoading" :data = "tableData.list">
<el-table-column fixed prop = "id" label = "编号" width = "50">
</el-table-column>
<el-table-column prop = "imageUrl" label = "头像">
<template slot-scope = "scope">
  <img :src = "scope.row.imageUrl" width = "60" height = "60"/>
</template>
</el-table-column>
<el-table-column prop = "name" label = "分类名称">
</el-table-column>
<el-table-column prop = "url" label = "链接" width = "180">
</el-table-column>
<el-table-column prop = "state" label = "状态">
<template slot-scope = "scope">
<span v-if = "scope.row.state == 1">显示</span>
<span v-if = "scope.row.state == 2" style = "color: #f56c6c;">隐藏</span>
</template>
</el-table-column>
<el-table-column prop = "state" label = "是否启用">
<template slot-scope = "scope">
<el-switch v-model = "scope.row.state" @change = "change(scope.row.state,scope.row)" :active-value = "openValue"
:inactive-value = "closeValue" active-color = "#13ce66" inactive-color = "#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column prop = "createTime" label = "创建时间" width = "160">
</el-table-column>
<el-table-column label = "操作" width = "180">
<template slot-scope = "scope">
<el-button size = "mini" type = "primary" :disabled = "!isAuth('bannerList:update')"
@click = "amendBanner(scope.$index, scope.row)">修改
</el-button>
<el-button size = "mini" type = "danger" :disabled = "!isAuth('bannerList:delete')" @click = "deletes(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[10, 20, 30, 40]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.totalCount">
</el-pagination>
</div>
<!-- 添加弹框 -->
<el-dialog title = "添加" :visible.sync = "dialogFormVisible2" center>
<div style = "margin-bottom: 10px;display: flex;">
<span style = "width: 200px;display: inline-block;text-align: right;">图片</span>
<div
style = " width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class = "avatar-uploader" v-model = "imageUrl"
:action="$http.adornUrlUp('alioss/upload')" :show-file-list = "false"
:on-success = "handleAvatarSuccess">
<img v-if = "imageUrl" :src = "imageUrl" class = "avatar"
style = "border-radius: 6px;width: 148px;height: 148px;"/>
<i v-else class = "el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">链接</span>
<el-input style = "width:50%;" v-model = "url" placeholder = "请输入链接"></el-input>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">名称</span>
<el-input style = "width:50%;" v-model = "name" placeholder = "请输入名称"></el-input>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">备注</span>
<el-input style = "width:50%;" v-model = "describes" placeholder = "请输入描述"></el-input>
</div>
<div slot = "footer" class = "dialog-footer">
<el-button @click = "dialogFormVisible2 = false"> </el-button>
<el-button type = "primary" @click = "addNoticeTo2()"> </el-button>
</div>
</el-dialog>
</el-tab-pane>
<el-tab-pane label = "我的推广" name = "third">
<div style = "float: right;margin-right:2%;">
<el-button style = "margin: 10px 0;" :disabled = "!isAuth('bannerList:add')" size = "mini" type = "primary" icon = "document"
@click = "addNotice3">添加活动</el-button>
</div>
<el-table v-loading = "tableDataLoading" :data = "tableData.list">
<el-table-column fixed prop = "id" label = "编号" width = "50">
</el-table-column>
<el-table-column prop = "imageUrl" label = "头像">
<template slot-scope = "scope">
  <img :src = "scope.row.imageUrl" width = "60" height = "60"/>
</template>
</el-table-column>
<el-table-column prop = "name" label = "活动名称">
</el-table-column>
<el-table-column prop = "url" label = "链接" width = "180">
</el-table-column>
<el-table-column prop = "state" label = "状态">
<template slot-scope = "scope">
<span v-if = "scope.row.state == 1">显示</span>
<span v-if = "scope.row.state == 2" style = "color: #f56c6c;">隐藏</span>
</template>
</el-table-column>
<el-table-column prop = "state" label = "是否启用">
<template slot-scope = "scope">
<el-switch v-model = "scope.row.state" @change = "change(scope.row.state,scope.row)" :active-value = "openValue"
:inactive-value = "closeValue" active-color = "#13ce66" inactive-color = "#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column prop = "createTime" label = "创建时间" width = "160">
</el-table-column>
<el-table-column label = "操作" width = "180">
<template slot-scope = "scope">
<el-button size = "mini" type = "primary" :disabled = "!isAuth('bannerList:update')"
@click = "amendBanner(scope.$index, scope.row)">修改
</el-button>
<el-button size = "mini" type = "danger" :disabled = "!isAuth('bannerList:delete')" @click = "deletes(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[10, 20, 30, 40]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.totalCount">
</el-pagination>
</div>
<!-- 添加弹框 -->
<el-dialog title = "添加" :visible.sync = "dialogFormVisible3" center>
<div style = "margin-bottom: 10px;display: flex;">
<span style = "width: 200px;display: inline-block;text-align: right;">图片</span>
<div
style = " width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class = "avatar-uploader" v-model = "imageUrl"
:action="$http.adornUrlUp('alioss/upload')" :show-file-list = "false"
:on-success = "handleAvatarSuccess">
<img v-if = "imageUrl" :src = "imageUrl" class = "avatar"
style = "border-radius: 6px;width: 148px;height: 148px;"/>
<i v-else class = "el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">链接</span>
<el-input style = "width:50%;" v-model = "url" placeholder = "请输入链接"></el-input>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">名称</span>
<el-input style = "width:50%;" v-model = "name" placeholder = "请输入名称"></el-input>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">备注</span>
<el-input style = "width:50%;" v-model = "describes" placeholder = "请输入描述"></el-input>
</div>
<div slot = "footer" class = "dialog-footer">
<el-button @click = "dialogFormVisible3 = false"> </el-button>
<el-button type = "primary" @click = "addNoticeTo3()"> </el-button>
</div>
</el-dialog>
</el-tab-pane>
<el-tab-pane label = "邀请背景图" name = "fourthly">
<!-- <div style = "float: right;margin-right:2%;">
<el-button style = "margin: 10px 0;" :disabled = "!isAuth('bannerList:add')" size = "mini" type = "primary" icon = "document"
@click = "addNotice5">添加背景图</el-button>
</div> -->
<el-table v-loading = "tableDataLoading" :data = "tableData.list">
<el-table-column fixed prop = "id" label = "编号" width = "50">
</el-table-column>
<el-table-column prop = "imageUrl" label = "头像">
<template slot-scope = "scope">
  <img :src = "scope.row.imageUrl" width = "60" height = "60"/>
</template>
</el-table-column>
<el-table-column prop = "name" label = "背景图名称">
</el-table-column>
<el-table-column prop = "describes" label = "活动描述">
</el-table-column>
<el-table-column prop = "url" label = "链接" width = "180">
</el-table-column>
<el-table-column prop = "createTime" label = "创建时间" width = "160">
</el-table-column>
<el-table-column label = "操作" width = "120">
<template slot-scope = "scope">
<el-button size = "mini" type = "primary" :disabled = "!isAuth('bannerList:update')"
@click = "amendBanner(scope.$index, scope.row)">修改
</el-button>
<!-- <el-button size = "mini" type = "danger" :disabled = "!isAuth('bannerList:delete')" @click = "deletes(scope.row)">删除
</el-button> -->
</template>
</el-table-column>
</el-table>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[10, 20, 30, 40]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.totalCount">
</el-pagination>
</div>
<!-- 添加弹框 -->
<el-dialog title = "添加" :visible.sync = "dialogFormVisible5" center>
<div style = "margin-bottom: 10px;display: flex;">
<span style = "width: 200px;display: inline-block;text-align: right;">图片</span>
<div
style = " width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class = "avatar-uploader" v-model = "imageUrl"
:action="$http.adornUrlUp('alioss/upload')" :show-file-list = "false"
:on-success = "handleAvatarSuccess">
<img v-if = "imageUrl" :src = "imageUrl" class = "avatar"
style = "border-radius: 6px;width: 148px;height: 148px;"/>
<i v-else class = "el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">链接</span>
<el-input style = "width:50%;" v-model = "url" placeholder = "请输入链接"></el-input>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">名称</span>
<el-input style = "width:50%;" v-model = "name" placeholder = "请输入名称"></el-input>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">备注</span>
<el-input style = "width:50%;" v-model = "describes" placeholder = "请输入描述"></el-input>
</div>
<div slot = "footer" class = "dialog-footer">
<el-button @click = "dialogFormVisible5 = false"> </el-button>
<el-button type = "primary" @click = "addNoticeTo5()"> </el-button>
</div>
</el-dialog>
</el-tab-pane>
<el-tab-pane label = "剧情壁纸" name = "juqing">
<div style = "float: right;margin-right:2%;">
<el-button style = "margin: 10px 0;" :disabled = "!isAuth('bannerList:add')" size = "mini" type = "primary" icon = "document"
@click = "addNotice">添加</el-button>
</div>
<el-table v-loading = "tableDataLoading" :data = "tableData.list">
<el-table-column fixed prop = "id" label = "编号" width = "50"></el-table-column>
<el-table-column prop = "imageUrl" label = "图片">
<template slot-scope = "scope">
  <img :src = "scope.row.imageUrl" width = "60" height = "60"/>
</template>
</el-table-column>
<el-table-column prop = "name" label = "名称"></el-table-column>
<el-table-column prop = "state" label = "状态">
<template slot-scope = "scope">
<span v-if = "scope.row.state == 1">显示</span>
<span v-if = "scope.row.state == 2" style = "color: #f56c6c;">隐藏</span>
</template>
</el-table-column>
<el-table-column prop = "state" label = "是否启用">
<template slot-scope = "scope">
<el-switch v-model = "scope.row.state" @change = "change(scope.row.state,scope.row)" :active-value = "openValue"
:inactive-value = "closeValue" active-color = "#13ce66" inactive-color = "#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column prop = "createTime" label = "创建时间" width = "160"></el-table-column>
<el-table-column label = "操作" width = "180">
<template slot-scope = "scope">
<el-button size = "mini" type = "primary" :disabled = "!isAuth('bannerList:update')"
@click = "amendBanner(scope.$index, scope.row)">修改
</el-button>
<el-button size = "mini" type = "danger" :disabled = "!isAuth('bannerList:delete')"
@click = "deletes(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[10, 20, 30, 40]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<!-- 添加弹框 -->
<el-dialog title = "添加" :visible.sync = "dialogFormVisible" center>
<div style = "margin-bottom: 10px;display: flex;">
<span style = "width: 200px;display: inline-block;text-align: right;">图片</span>
<div
style = " width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class = "avatar-uploader" v-model = "imageUrl"
:action="$http.adornUrlUp('alioss/upload')" :show-file-list = "false"
:on-success = "handleAvatarSuccess">
<img v-if = "imageUrl" :src = "imageUrl" class = "avatar"
style = "border-radius: 6px;width: 148px;height: 148px;"/>
<i v-else class = "el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">链接</span>
<el-input style = "width:50%;" v-model = "url" placeholder = "请输入链接"></el-input>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">名称</span>
<el-input style = "width:50%;" v-model = "name" placeholder = "请输入名称"></el-input>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;">备注</span>
<el-input style = "width:50%;" v-model = "describes" placeholder = "请输入描述"></el-input>
</div>
<div slot = "footer" class = "dialog-footer">
<el-button @click = "dialogFormVisible = false"> </el-button>
<el-button type = "primary" @click = "addNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 修改弹框 -->
<el-dialog title = "修改" :visible.sync = "dialogFormVisible1" center>
<el-form :model = "form">
<el-form-item label = "图片:" :label-width = "formLabelWidth">
<div style = " width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class = "avatar-uploader" v-model = "imageUrl":action="$http.adornUrlUp('alioss/upload')"
:show-file-list = "false" :on-success = "handleAvatarSuccess2">
<img v-if = "form.imageUrl" :src = "form.imageUrl" class = "avatar"
style = "border-radius: 6px;width: 148px;height: 148px;"/>
<i v-else class = "el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</el-form-item>
<el-form-item label = "链接:" :label-width = "formLabelWidth">
<el-input v-model = "form.url" style = "width:65%;"></el-input>
</el-form-item>
<el-form-item label = "名称:" :label-width = "formLabelWidth">
<el-input v-model = "form.name" style = "width:65%;"></el-input>
</el-form-item>
<el-form-item label = "备注:" :label-width = "formLabelWidth">
<el-input v-model = "form.describes" style = "width:65%;"></el-input>
</el-form-item>
</el-form>
<div slot = "footer" class = "dialog-footer">
<el-button @click = "dialogFormVisible1 = false"> </el-button>
<el-button type = "primary" @click = "amendNoticeTo()"> </el-button>
</div>
</el-dialog>
</el-tabs>
</template>
<script>
export default {
data () {
return {
page: 1,
limit: 10,
classify: 1,
openValue: 1,
closeValue: 2,
name: '',
imageUrl: '',
url: '',
state: -1,
describes: '',
activeName: 'first',
dialogFormVisible: false,
dialogFormVisible1: false,
dialogFormVisible2: false,
dialogFormVisible3: false,
dialogFormVisible4: false,
dialogFormVisible5: false,
dialogFormVisible6: false,
tableDataLoading: true,
formLabelWidth: '200px',
tableData: [],
choicenData2: [],
checkBoxData: [],//多选框选择的值
keyword: '',
info: {
stockDate: this.getNowTime(), //日期
},
states: [
{
label: '显示',
value: 1
},
{
label: '隐藏',
value: 2
}
],
form: {
id: '',
name: '',
imageUrl: '',
url: '',
classify: '',
createTime: '',
sort: '',
state: '',
describes: ''
}
}
},
methods: {
//处理默认选中当前日期
getNowTime () {
var now = new Date()
var year = now.getFullYear() //得到年份
var month = now.getMonth() //得到月份
var date = now.getDate() //得到日期
var hh = now.getHours() < 10 ? '0' + now.getHours() : now.getHours()
var mm = now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes()
var ss = now.getSeconds() < 10 ? '0' + now.getSeconds() : now.getSeconds()
month = month + 1
month = month.toString().padStart(2, '0')
date = date.toString().padStart(2, '0')
var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`
return defaultDate
this.$set(this.info, 'stockDate', defaultDate)
},
// tabs切换
handleClick (tab, event) {
if (tab._props.label == '轮播图') {
this.page = 1
this.limit = 10
this.classify = 1
this.dataSelect()
}
if (tab._props.label == '首页分类') {
this.page = 1
this.limit = 10
this.classify = 2
this.dataSelect()
}
if (tab._props.label == '我的推广') {
this.page = 1
this.limit = 10
this.classify = 3
this.dataSelect()
}
if (tab._props.label == '邀请背景图') {
this.page = 1
this.limit = 10
this.classify = 5
this.dataSelect()
}
if (tab._props.label == '剧情壁纸') {
this.page = 1
this.limit = 10
this.classify = 10
this.dataSelect()
}
},
//上传成功
handleAvatarSuccess (file) {
this.imageUrl = file.data
},
handleAvatarSuccess2 (file2) {
this.form.imageUrl = file2.data
},
handleSizeChange (val) {
this.limit = val
this.dataSelect()
},
handleCurrentChange (val) {
this.page = val
this.dataSelect()
},
// 是否启用
change (val, row) {
this.$http({
url: this.$http.adornUrl(`banner/updateBannerStateById`),
method: 'get',
params: this.$http.adornParams({
'id':row.id
})
}).then(({data}) => {
if(data.code==0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
//添加banner图
addNotice () {
this.dialogFormVisible = true
},
// 添加banner图
addNoticeTo () {
if (this.imageUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请上传图片',
type: 'warning'
})
return
}
if (this.name == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入名称',
type: 'warning'
})
return
}
this.$http({
url: this.$http.adornUrl('banner/insertBanner'),
method: 'post',
data: this.$http.adornData({
'classify': this.classify,
'imageUrl': this.imageUrl,
'state': this.state,
'url': this.url,
'name': this.name,
'describes': this.describes
})
}).then(({data}) => {
if(data.code==0){
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.imageUrl = ''
this.state = ''
this.url = ''
this.name = ''
this.describes = ''
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
// 修改
amendBanner (index, rows) {
this.dialogFormVisible1 = true
this.form.id = rows.id
this.form.imageUrl = rows.imageUrl
this.form.url = rows.url
this.form.sort = rows.sort
this.form.state = rows.state
this.form.name = rows.name
this.form.describes = rows.describes
},
// 修改
amendNoticeTo () {
this.$http({
url: this.$http.adornUrl(`banner/updateBannerById`),
method: 'post',
data: this.$http.adornData({
'id':this.form.id,
'createTime':this.info.stockDate,
'imageUrl':this.form.imageUrl,
'url':this.form.url,
'state':this.form.state,
'sort':this.form.sort,
'name':this.form.name,
'describes':this.form.describes
})
}).then(({data}) => {
if(data.code==0){
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
//添加任务分类
addNotice2 () {
this.dialogFormVisible2 = true
},
// 添加添加任务分类
addNoticeTo2 () {
if (this.imageUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请上传图片',
type: 'warning'
})
return
}
if (this.name == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入名称',
type: 'warning'
})
return
}
this.classify = 2
this.$http({
url: this.$http.adornUrl('banner/insertBanner'),
method: 'post',
data: this.$http.adornData({
'classify': this.classify,
'imageUrl': this.imageUrl,
'state': this.state,
'url': this.url,
'name': this.name,
'describes': this.describes
})
}).then(({data}) => {
if(data.code==0){
this.dialogFormVisible2 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.imageUrl = ''
this.state = ''
this.url = ''
this.name = ''
this.describes = ''
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
//添加活动
addNotice3 () {
this.dialogFormVisible3 = true
},
// 添加添加活动
addNoticeTo3 () {
if (this.imageUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请上传图片',
type: 'warning'
})
return
}
if (this.name == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入名称',
type: 'warning'
})
return
}
this.classify = 3
this.$http({
url: this.$http.adornUrl('banner/insertBanner'),
method: 'post',
data: this.$http.adornData({
'classify': this.classify,
'imageUrl': this.imageUrl,
'state': this.state,
'url': this.url,
'name': this.name,
'describes': this.describes
})
}).then(({data}) => {
if(data.code==0){
this.dialogFormVisible3 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.imageUrl = ''
this.state = ''
this.url = ''
this.name = ''
this.describes = ''
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
//添加活动背景图
addNotice5 () {
if (this.tableData.length == 1) {
this.$message({
title: '提示',
duration: 1800,
message: '活动背景图只能添加一张',
type: 'warning'
})
} else {
this.dialogFormVisible5 = true
}
},
// 添加背景图
addNoticeTo5 () {
if (this.imageUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
// type: 'success',
message: '请上传图片',
type: 'warning'
})
return
}
if (this.name == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入名称',
type: 'warning'
})
return
}
this.classify = 5
this.$http({
url: this.$http.adornUrl('banner/insertBanner'),
method: 'post',
data: this.$http.adornData({
'classify': this.classify,
'imageUrl': this.imageUrl,
'state': this.state,
'url': this.url,
'name': this.name,
'describes': this.describes
})
}).then(({data}) => {
this.dialogFormVisible5 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.imageUrl = ''
this.state = ''
this.url = ''
this.name = ''
this.describes = ''
this.dataSelect()
}
})
})
},
// 删除banner图
deletes (row) {
let delid = row.id
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`banner/deleteBannerById?ids=${delid}`),
method: 'get',
data: this.$http.adornData({})
}).then(({data}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
}).catch(() => {
})
},
// 获取数据列表
dataSelect () {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('banner/selectBannerPage'),
method: 'get',
params: this.$http.adornParams({
'page':this.page,
'limit':this.limit,
'state': this.state,
'classify': this.classify,
})
}).then(({data}) => {
if (data && data.code === 0) {
this.tableDataLoading = false
let returnData = data.data
this.tableData = returnData
}
})
},
},
mounted () {
this.dataSelect()
}
}
</script>
<style>
.customWidth {
width: 80% !important;
}
</style>

323
src/views/campus/campus.vue Normal file
View File

@@ -0,0 +1,323 @@
<template>
<div>
<div style="display: inline-block;float: right;">
<el-button size="mini" type="primary" icon="document" @click="refresh" >刷新</el-button>
<el-button style='margin:0 0 20px 10px;' :disabled="!isAuth('campus:add')" size="mini" type="primary" icon="document" @click="classifyStair()" >添加社区</el-button>
<el-button style='margin:0 0 20px 10px;' size="mini" type="danger" icon="document" @click="deleteStairs()" :disabled="checkBoxData.length <= 0 || !isAuth('campus:delete')">批量删除</el-button>
</div>
<el-table
@selection-change="changeFun"
v-loading="tableDataLoading"
:data="tableData.list">
<el-table-column type="selection" fixed >
</el-table-column>
<el-table-column
prop="campusId"
label="编号">
</el-table-column>
<el-table-column
prop="campusName"
label="社区名称">
</el-table-column>
<el-table-column
prop="campusDetails"
label="社区地址">
</el-table-column>
<el-table-column
label="操作"
width="150">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
:disabled="!isAuth('campus:update')"
@click="compile(scope.$index, scope.row)">编辑
</el-button>
<el-button
size="mini"
type="danger"
:disabled="!isAuth('campus:delete')"
@click="deleteStair(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]"
:page-size="limit"
:current-page="page"
layout="total,sizes, prev, pager, next,jumper"
:total="tableData.totalCount">
</el-pagination>
</div>
<!-- 添加社区 -->
<el-dialog title="添加社区" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">社区名称</span>
<el-input style="width:50%;" v-model="campusName" type="text" placeholder="请输入社区名称"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">社区地址</span>
<el-input style="width:50%;" v-model="campusDetails" type="text" placeholder="请输入社区地址"></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="StairNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 修改一级分类 -->
<el-dialog title="修改社区" :visible.sync="dialogFormVisible1" center>
<el-form :model="form">
<el-form-item label="社区名称:" :label-width="formLabelWidth" >
<el-input v-model="form.campusName" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="社区地址:" :label-width="formLabelWidth" >
<el-input v-model="form.campusDetails" style="width:65%;"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="CompileNoticeTo()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
limit:10,
page:1,
checkBoxData: [],//多选框选择的值
formLabelWidth:'200px',
tableDataLoading:false,
dialogFormVisible:false,
dialogFormVisible1:false,
tableData:[],
campusName:'',
campusDetails:'',
form:{
campusId:'',
campusName:'',
campusDetails:''
}
}
},
methods: {
// 多选
changeFun(val) {
this.checkBoxData = val;
},
handleSizeChange(val) {
this.limit = val;
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val;
this.dataSelect()
},
// 刷新
refresh(){
this.dataSelect()
},
// 添加社区弹框
classifyStair(){
this.dialogFormVisible = true
},
// 添加社区
StairNoticeTo(){
if (this.campusName == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入社区名称',
type: 'warning'
});
return
}
if (this.campusDetails == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入社区地址',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('helpCampus/insertCampus'),
method: 'post',
data: this.$http.adornData({
'campusName':this.campusName,
'campusDetails': this.campusDetails,
})
}).then(({data}) => {
this.dialogFormVisible = false
this.$message({
message: '添加成功',
type: 'success',
duration: 1500,
onClose: () => {
this.campusName = ''
this.campusDetails = ''
this.dataSelect()
}
})
})
},
// 修改社区
compile(index,rows){
this.dialogFormVisible1=true;
this.form.campusId = rows.campusId;
this.form.campusName = rows.campusName;
this.form.campusDetails = rows.campusDetails;
},
// 修改社区
CompileNoticeTo(){
this.$http({
url: this.$http.adornUrl('helpCampus/updateCampus '),
method: 'post',
data: this.$http.adornData({
'campusId':this.form.campusId,
'campusName': this.form.campusName,
'campusDetails' :this.form.campusDetails
})
}).then(({data}) => {
if(data.code == 0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible1 = false
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.dialogFormVisible1 = false
this.dataSelect()
}
})
}
})
},
// 批量删除
deleteStairs(id){
this.$confirm(`确定批量删除信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var ids= id ? [id] : this.checkBoxData.map(item => {
return item.campusId
})
this.$http({
url: this.$http.adornUrl(`helpCampus/deleteCampus?ids=${ids}`),
method: 'get',
params: this.$http.adornParams({
})
}).then(({data}) => {
if(data.code == 0){
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.content= ''
this.status = 0
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.content= ''
this.status = 0
this.dataSelect()
}
})
}
})
}).catch(() => {})
},
//删除
deleteStair(row){
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`helpCampus/deleteCampus?ids=${row.campusId}`),
method: 'get',
params: this.$http.adornParams({
})
}).then(({data}) => {
if(data.code == 0){
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}
})
}).catch(() => {})
},
// 重置
cleans(){
this.phone = ''
this.status = 0
this.dataSelect()
},
// 获取派单数据列表
dataSelect () {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('helpCampus/selectCampusPage'),
method: 'get',
params: this.$http.adornParams({
'page':this.page,
'limit':this.limit,
'content':this.content
})
}).then(({data}) => {
this.tableDataLoading = false
let returnData = data.data;
this.tableData = returnData
})
}
},
mounted() {
this.dataSelect()
}
};
</script>
<style>
</style>

992
src/views/campus/coupon.vue Normal file
View File

@@ -0,0 +1,992 @@
<template>
<div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="发卡分类" name="first">
<div style="display: inline-block;float: right;">
<el-button size="mini" type="primary" icon="document" @click="refresh">刷新</el-button>
<el-button style='margin:0 0 20px 10px;' :disabled="!isAuth('coupon:add')" size="mini"
type="primary" icon="document" @click="amend()">添加</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="tableData.records">
<el-table-column prop="typeId" label="编号" width="80">
</el-table-column>
<el-table-column prop="remarks" label="名称">
</el-table-column>
<el-table-column prop="giveNum" label="赠送会员天数">
</el-table-column>
<el-table-column prop="validDay" label="有效天数">
</el-table-column>
<!-- <el-table-column label="状态">
<template slot-scope="scope">
<span style="color: #3E8EF7;" v-if="scope.row.status == 1">开启</span>
<span v-if="scope.row.status == 2">关闭</span>
</template>
</el-table-column> -->
<el-table-column prop="createTime" label="创建时间">
</el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('coupon:update')"
@click="amend(scope.row)" style="margin: 3px;">编辑
</el-button>
<el-button size="mini" type="warning"
@click="listBtnKm(scope.row)" style="margin: 3px;">卡密列表
</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('coupon:delete')"
@click="deleteStair(scope.row)" style="margin: 3px;">删除
</el-button>
<el-button :disabled="!isAuth('coupon:update')" size="mini"
type="primary" icon="document" @click="shengCoupon(scope.row)" style="margin: 3px;">生成卡密</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next" :total="tableData.total">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="发卡列表" name="putong">
<div style="display: inline-block;margin: 3px;">
<div style="position: relative;display: inline-block;margin:5px;">
<span>卡密</span>
<el-input style="width: 200px;" @keydown.enter.native="refreshList" placeholder="请输入卡密"
v-model="sdkContent">
</el-input>&nbsp;&nbsp;
</div>
<div style="position: relative;display: inline-block;margin:5px;">
<span>卡密名称</span>
<el-input style="width: 200px;" @keydown.enter.native="refreshList" placeholder="请输入卡密名称"
v-model="couponIssueNameT">
</el-input>&nbsp;&nbsp;
</div>
<div style="position: relative;display: inline-block;margin:5px;">
<span>渠道商名称</span>
<el-input style="width: 200px;" @keydown.enter.native="refreshList" placeholder="请输入渠道商名称"
v-model="sysUserNameT">
</el-input>&nbsp;&nbsp;
</div>
<div style="position: relative;display: inline-block;margin:5px;">
<span>领取用户</span>
<el-input style="width: 200px;" @keydown.enter.native="refreshList" placeholder="请输入领取用户"
v-model="userName">
</el-input>&nbsp;&nbsp;
</div>
<div style="margin:5px;display: inline-block;">
<span>状态</span>
<el-select v-model="status" style="width:150px;margin-left: 10px;" @change="refreshList(status)">
<el-option v-for="item in statesnum" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<span>开始时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="startTime" align="right" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间">
</el-date-picker>&nbsp;&nbsp;&nbsp;
<span>截止时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="endTime" align="right" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择截止时间">
</el-date-picker>
<div style="display: inline-block;">
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="refreshList">查询
</el-button>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
<!-- <el-button style='margin-left:15px;' size="mini" type="primary" icon="document"
:disabled="!isAuth('couponissue:add')" @click="amend()">添加
</el-button> -->
<el-button style='margin:0 0 20px 20px;' size="mini" type="primary" icon="document"
@click="transferClcik()" :disabled="checkBoxData.length <= 0 || !isAuth('financeList:transfer')">
批量删除
</el-button>
</div>
</div>
<el-table v-loading="tableDataLoadingKm" :data="tableDataKm.records" @selection-change="changeFunP" >
<el-table-column type="selection">
</el-table-column>
<el-table-column prop="sdkId" fixed="left" label="编号" width="80">
</el-table-column>
<el-table-column prop="sdkRemarks" label="卡密名称">
</el-table-column>
<el-table-column prop="sdkContent" label="卡密">
</el-table-column>
<el-table-column prop="sysUserName" label="渠道商名称">
</el-table-column>
<el-table-column prop="giveNum" label="赠送会员天数">
</el-table-column>
<el-table-column prop="overdueTime" label="到期时间">
</el-table-column>
<el-table-column label="领取用户">
<template slot-scope="scope">
<span style="color: #3E8EF7;cursor: pointer;" @click="updates(scope.row)" v-if="scope.row.nickName">{{scope.row.nickName}}</span>
<span v-else>未绑定</span>
</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<span style="color: red;" v-if="scope.row.status == 0">待使用</span>
<span style="color: #3E8EF7;" v-if="scope.row.status == 1">已使用</span>
<span style="color: #999;" v-if="scope.row.status == 2">已过期</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="150">
</el-table-column>
<el-table-column label="操作" width="80">
<template slot-scope="scope">
<el-button size="mini" type="danger" :disabled="!isAuth('coupon:delete')"
@click="deleteStairKm(scope.row)" style="margin: 3px;">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChangeList" @current-change="handleCurrentChangeList"
:page-sizes="[10, 20, 30, 50, 100]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next" :total="tableDataKm.total">
</el-pagination>
</div>
</el-tab-pane>
<!-- 修改 -->
<el-dialog :title="titles" :visible.sync="dialogFormVisible" center>
<el-form :model="form">
<el-form-item label="名称:" :label-width="formLabelWidth">
<el-input v-model="form.remarks" style="width:65%;" placeholder="请输入名称"></el-input>
</el-form-item>
<el-form-item label="赠送会员天数:" :label-width="formLabelWidth">
<el-input v-model="form.giveNum" style="width:65%;" placeholder="请输入赠送会员天数"></el-input>
</el-form-item>
<el-form-item label="有效天数:" :label-width="formLabelWidth">
<el-input v-model="form.validDay" style="width:65%;" placeholder="请输入有效天数"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="amendNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 生成卡密 -->
<el-dialog title="生成卡密" :visible.sync="dialogFormVisible3" center width="70%">
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">渠道商</span>
<el-input style="width:50%;" v-model="sysUserName" @focus="qudaoBtn" placeholder="请选择渠道商">
</el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">生成数量</span>
<el-input style="width:50%;" v-model="num" type="number" :min="0" placeholder="请输入生成数量">
</el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3 = false"> </el-button>
<el-button type="primary" @click="couponNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 卡密列表 -->
<el-dialog title="卡密列表" :visible.sync="dialogFormVisibleKm" center width="70%">
<div style="display: inline-block;margin: 3px;">
<div style="position: relative;display: inline-block;">
<span>领取用户</span>
<el-input style="width: 200px;" @keydown.enter.native="refreshList" placeholder="请输入领取用户"
v-model="userName">
</el-input>&nbsp;&nbsp;
</div>
<div style="position: relative;display: inline-block;margin:5px;">
<span>渠道商名称</span>
<el-input style="width: 200px;" @keydown.enter.native="refreshList" placeholder="请输入渠道商名称"
v-model="sysUserNameT">
</el-input>&nbsp;&nbsp;
</div>
<div style="margin:2% 0;display: inline-block;">
<span>状态</span>
<el-select v-model="status" style="width:150px;margin-left: 10px;" @change="refreshList(status)">
<el-option v-for="item in statesnum" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<span>开始时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="startTime" align="right" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间">
</el-date-picker>&nbsp;&nbsp;&nbsp;
<span>截止时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="endTime" align="right" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择截止时间">
</el-date-picker>
</div>
<div style="display: inline-block;">
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="refreshList">查询
</el-button>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
<el-button size="mini" type="warning" :disabled="!isAuth('coupon:delete')"
@click="excelStair()" style="margin: 3px;">导出excel
</el-button>
</div>
<el-table v-loading="tableDataLoadingKm" :data="tableDataKm.records">
<el-table-column prop="sdkId" fixed="left" label="编号" width="80">
</el-table-column>
<el-table-column prop="sdkRemarks" label="卡密名称">
</el-table-column>
<el-table-column prop="sdkContent" label="卡密">
</el-table-column>
<el-table-column prop="sysUserName" label="渠道商名称">
</el-table-column>
<el-table-column prop="giveNum" label="赠送会员天数" width="80">
</el-table-column>
<el-table-column prop="overdueTime" label="到期时间">
</el-table-column>
<el-table-column label="领取用户">
<template slot-scope="scope">
<span style="color: #3E8EF7;cursor: pointer;" @click="updates(scope.row)" v-if="scope.row.nickName">{{scope.row.nickName}}</span>
<span v-else>未绑定</span>
</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<span style="color: red;" v-if="scope.row.status == 0">待使用</span>
<span style="color: #3E8EF7;" v-if="scope.row.status == 1">已使用</span>
<span style="color: #999;" v-if="scope.row.status == 2">已过期</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="领取时间" width="150">
</el-table-column>
<el-table-column label="操作" width="80">
<template slot-scope="scope">
<el-button size="mini" type="danger" :disabled="!isAuth('coupon:delete')"
@click="deleteStairKm(scope.row)" style="margin: 3px;">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChangeList" @current-change="handleCurrentChangeList"
:page-sizes="[10, 20, 30, 50, 100]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next" :total="tableDataKm.total">
</el-pagination>
</div>
</el-dialog>
<!-- 渠道商 -->
<el-dialog title="渠道商" :visible.sync="dialogFormVisibleQd" center width="70%">
<el-table :data="dataList" v-loading="dataListLoading" style="width: 100%;">
<el-table-column prop="userId" header-align="center" align="center" width="80" label="ID">
</el-table-column>
<el-table-column prop="username" header-align="center" align="center" label="用户名">
</el-table-column>
<el-table-column prop="email" header-align="center" align="center" label="邮箱">
</el-table-column>
<el-table-column prop="mobile" header-align="center" align="center" label="手机号">
</el-table-column>
<el-table-column prop="qdRate" header-align="center" align="center" label="渠道佣金">
<!-- <template slot-scope="scope">
<span v-for="(item,index) in scope.row.roleEntityList" :key="index">{{item.roleName}} </span>
</template> -->
</el-table-column>
<el-table-column prop="qdCode" header-align="center" align="center" label="渠道码">
<template slot-scope="scope">
<span v-if="scope.row.qdCode" >{{scope.row.qdCode}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="status" header-align="center" align="center" label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">禁用</el-tag>
<el-tag v-else size="small">正常</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" header-align="center" align="center" width="180" label="创建时间">
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small"
@click="addOrUpdateHandle(scope.row)">确认</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</el-tabs>
</div>
</template>
<script>
export default {
data() {
return {
limit: 10,
page: 1,
size1: 10,
page1: 1,
form: {
typeId: '',
giveNum: '',
remarks: '',
validDay: '',
},
formLabelWidth: '200px',
tableDataLoading: false,
tableDataLoadingKm:false,
dialogFormVisible: false,
tableData: {},
tableDataKm:{},
activeName: 'first',
classify: 1,
couponIssueNameT: '',
statusT: 0,
couponIds: [],
couponIdList: [],
dialogFormVisible4: false,
dialogFormVisible5: false,
tableDataLoadingY: false,
tableDataYhq: {},
size1: 10,
page1: 1,
titles: '添加',
tableDataList: [],
dialogFormVisible3: false,
num:0,
couponCardTypeId:'',
status:'',
statesnum: [{
label: '全部',
value: ''
},
{
label: '待使用',
value: 0
},
{
label: '已使用',
value: 1
},
{
label: '已过期',
value: 2
}
],
dialogFormVisibleKm:false,
checkBoxData: [], //多选框选择的值
userName:'',
sdkContent:'',
startTime: '',
endTime: '',
info: {
stockDate: this.getNowTime(), //日期
},
info2: {
stockDate2: this.getNowTime2(), //日期
},
dialogFormVisibleQd:false,
dataList:[],
dataListLoading:false,
sysUserId:'',
sysUserName:'',
sysUserNameT:'',
}
},
methods: {
//处理默认选中当前日期
getNowTime() {
var now = new Date()
var year = now.getFullYear() //得到年份
var month = now.getMonth() //得到月份
var date = now.getDate() //得到日期
month = month + 1
month = month.toString().padStart(2, '0')
date = date.toString().padStart(2, '0')
var defaultDate = `${year}-${month}-${date}`
return defaultDate
this.$set(this.info, 'stockDate', defaultDate)
},
//处理默认选中当前日期
getNowTime2() {
var now = new Date()
var year = now.getFullYear() //得到年份
var month = now.getMonth() - now.getMonth() //得到月份
var date = now.getDate() - now.getDate() + 1 //得到日期
month = month + 1
month = month.toString().padStart(2, '0')
date = date.toString().padStart(2, '0')
var defaultDate = `${year}-${month}-${date}`
return defaultDate
this.$set(this.info, 'stockDate', defaultDate)
},
// 多选
changeFunP(val) {
this.checkBoxData = val;
},
handleSizeChange(val) {
this.limit = val;
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val;
this.dataSelect()
},
handleSizeChange(val) {
this.size = val;
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val;
this.dataSelect()
},
handleSizeChangeList(val) {
this.limit = val;
this.dataSelectKm()
},
handleCurrentChangeList(val) {
this.page = val;
this.dataSelectKm()
},
handleSizeChangeY(val) {
this.size1 = val;
this.dataSelectYhq()
},
handleCurrentChangeY(val) {
this.page1 = val;
this.dataSelectYhq()
},
handleClick(tab, event) {
this.limit = 10
this.page = 1
this.couponCardTypeId = ''
if (tab._props.label == '发卡分类') {
this.classify = 1
this.dataSelect()
}
if (tab._props.label == '发卡列表') {
this.dataSelectKm()
}
},
// 刷新
refresh() {
this.page = 1
this.dataSelect()
},
// 添加、修改
amend(row) {
this.dialogFormVisible = true
this.couponIds = []
this.couponIdList = []
if (row) {
this.titles = '修改'
this.form.typeId = row.typeId
this.form.giveNum = row.giveNum
this.form.remarks = row.remarks
this.form.validDay = row.validDay
} else {
this.titles = '添加'
this.form.typeId = ''
this.form.giveNum = ''
this.form.remarks = ''
this.form.validDay = ''
}
},
handleAvatarSuccess2(file, fileList) {
this.form.couponIssueImage = file.data
},
// 修改
amendNoticeTo() {
if (this.form.remarks ==='' ) {
this.$message({
title: '提示',
type: 'error',
duration: 1800,
message: '请输入名称',
type: 'warning'
});
return
}
if (this.form.giveNum === '' ||this.form.giveNum ==null) {
this.$message({
title: '提示',
type: 'error',
duration: 1800,
message: '请输入赠送会员天数',
type: 'warning'
});
return
}
if (this.form.validDay ==='' ) {
this.$message({
title: '提示',
type: 'error',
duration: 1800,
message: '请输入有效天数',
type: 'warning'
});
return
}
if (this.titles == '添加') {
var url = 'couponCard/insertCouponCardType'
} else {
var url = 'couponCard/updateCouponCardType'
}
this.$http({
url: this.$http.adornUrl('admin/sdkType/saveSdkType'),
method: 'post',
// data: this.$http.adornData({
params: this.$http.adornParams({
'typeId': this.form.typeId,
'giveNum': this.form.giveNum,
'remarks': this.form.remarks,
'validDay': this.form.validDay,
})
}).then(({
data
}) => {
if(data.code==0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
this.dialogFormVisible = false
}else{
this.$message({
message: data.msg,
type: 'success',
duration: 1500,
onClose: () => {
}
})
}
})
},
//删除
deleteStair(row) {
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('admin/sdkType/deleteSdkType'),
method: 'get',
params: this.$http.adornParams({
'typeId': row.typeId
})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}
})
}).catch(() => {})
},
refreshList(){
this.page = 1
this.dataSelectKm()
},
// 重置
cleans() {
this.endTime = ''
this.startTime = ''
this.couponIssueNameT = ''
this.sdkContent = ''
this.status = ''
this.userName = ''
this.sysUserNameT = ''
this.page = 1
this.dataSelectKm()
},
// 获取卡密分类数据列表
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('admin/sdkType/getSdkTypeList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'remarks': this.content
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data;
this.tableData = returnData
if (data.data.list.length == 0) {
this.page = this.page - 1
this.dataSelect()
}
})
},
// 打开优惠券列表
couponIdBtn(rows) {
this.dataSelectYhq()
this.dialogFormVisible4 = true
},
//获取优惠券数据
dataSelectYhq() {
this.tableDataLoadingY = true
this.$http({
url: this.$http.adornUrl('admin/coupon/seleteAllCoupon'),
method: 'get',
params: this.$http.adornParams({
'page': this.page1,
'limit': this.size1
})
}).then(({
data
}) => {
this.tableDataLoadingY = false
let returnData = data.data;
this.tableDataYhq = returnData
})
},
// 删除优惠券
couponIdClose(ietm, index) {
console.log('index', index, 'ietm', ietm, this.couponIdList.length)
if (this.couponIdList.length < 2) {
this.$message({
title: '提示',
type: 'error',
duration: 1800,
message: '最少需要选中一张优惠券',
type: 'warning'
});
return
} else {
this.couponIdList.splice(index, 1)
this.couponIds.splice(index, 1)
}
},
// 批量开启
closes2(id) {
this.dialogFormVisible4 = false
},
// 多选券
changeFun(row) {
this.couponIds.push(row.couponId)
this.couponIdList.push(row.couponName)
this.dialogFormVisible4 = false
},
// 优惠券列表
listBtn(row) {
this.tableDataList = row.couponList
this.dialogFormVisible5 = true
},
// 生成卡密弹框
shengCoupon(row){
this.num = ''
this.sysUserId= ''
this.sysUserName= ''
this.couponCardTypeId = row.typeId
this.dialogFormVisible3 = true
},
// 确认生成
couponNoticeTo(){
if (this.sysUserId == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择渠道商',
type: 'warning'
});
return
}
if (this.num == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入生成数量',
type: 'warning'
});
return
}
if (this.num >100) {
this.$notify({
title: '提示',
duration: 1800,
message: '单次生成数量数量最高为100',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('admin/sdkInfo/saveSdkInfo'),
method: 'post',
params: this.$http.adornParams({
'typeId': this.couponCardTypeId,
'num':this.num,
'sysUserId':this.sysUserId,
})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible3 = false
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}
})
},
// 卡密列表
dataSelectKm(){
this.tableDataLoadingKm = true
// if (this.endTime == '') {
// this.endTime = this.info.stockDate
// }
// if (this.startTime == '') {
// this.startTime = this.info2.stockDate2
// }
this.$http({
url: this.$http.adornUrl('admin/sdkInfo/getSdkList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'sdkRemarks': this.couponIssueNameT,
'status': this.status,
'typeId':this.couponCardTypeId,
'nickName':this.userName,
'sdkContent':this.sdkContent,
'endTime': this.endTime,
'startTime': this.startTime,
'sysUserName':this.sysUserNameT,
})
}).then(({
data
}) => {
this.tableDataLoadingKm = false
let returnData = data.data;
this.tableDataKm = returnData
})
},
// 详情跳转
updates(row) {
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
})
},
// 卡密列表弹框
listBtnKm(row){
this.couponCardTypeId = row.typeId
this.couponIssueNameT = ''
this.sdkContent = ''
this.status = ''
this.userName = ''
this.sysUserNameT = ''
this.dataSelectKm()
this.dialogFormVisibleKm = true
},
// 导出
excelStair(){
// var endTime = this.endTime
// if (this.endTime != '') {
// endTime = this.endTime + " 23:59:59"
// }
this.$http({
url: this.$http.adornUrl('admin/sdkInfo/excelCouponCardList'),
method: 'get',
responseType: 'blob',
params: this.$http.adornParams({
'sdkRemarks': this.couponIssueNameT,
'status': this.status,
'typeId':this.couponCardTypeId,
'nickName':this.userName,
'sdkContent':this.sdkContent,
'endTime': this.endTime,
'startTime': this.startTime,
'sysUserName':this.sysUserNameT
})
}).then(({
data
}) => {
let blob = new Blob([data], {
type: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob)
} else {
let url = window.URL.createObjectURL(blob)
let elink = document.createElement('a')
elink.download = '卡密列表.xlsx'
elink.style.display = 'none'
elink.href = url
document.body.appendChild(elink)
elink.click()
document.body.removeChild(elink)
}
})
},
//批量删除
deleteStairKm(row) {
var sdkIds = []
sdkIds.push(row.sdkId)
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('admin/sdkInfo/deleteSdk'),
method: 'get',
params: this.$http.adornParams({
'sdkIds': row.sdkId,
})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelectKm()
}
})
} else {
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.dataSelectKm()
}
})
}
})
}).catch(() => {})
},
// 批量转账
transferClcik(id) {
var ids = id ? [id] : this.checkBoxData.map(item => {
return item.sdkId
})
this.$http({
url: this.$http.adornUrl('admin/sdkInfo/deleteSdk'),
method: 'get',
params: this.$http.adornParams({
'sdkIds': ids.toString(),
})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelectKm()
}
})
} else {
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.dataSelectKm()
}
})
}
})
},
// 渠道商弹框
qudaoBtn(){
this.getDataList()
this.dialogFormVisibleQd = true
},
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('sys/user/list'),
method: 'get',
params: this.$http.adornParams({
'page': 1,
'limit': 10,
'username': '',
'isChannel':1
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
} else {
this.dataList = []
}
this.dataListLoading = false
})
},
// 确认选择渠道商
addOrUpdateHandle(row){
this.sysUserId = row.userId
this.sysUserName = row.username
this.dialogFormVisibleQd = false
},
},
mounted() {
this.dataSelect()
}
};
</script>
<style>
</style>

61
src/views/common/404.vue Normal file
View File

@@ -0,0 +1,61 @@
<template>
<div class="site-wrapper site-page--not-found">
<div class="site-content__wrapper">
<div class="site-content">
<h2 class="not-found-title">400</h2>
<p class="not-found-desc">抱歉您访问的页面<em>失联</em> ...</p>
<el-button @click="$router.go(-1)">返回上一页</el-button>
<el-button type="primary" class="not-found-btn-gohome" @click="$router.push({ name: 'home' })">进入首页</el-button>
</div>
</div>
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss">
.site-wrapper.site-page--not-found {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
.site-content__wrapper {
padding: 0;
margin: 0;
background-color: #fff;
}
.site-content {
position: fixed;
top: 15%;
left: 50%;
z-index: 2;
padding: 30px;
text-align: center;
transform: translate(-50%, 0);
}
.not-found-title {
margin: 20px 0 15px;
font-size: 10em;
font-weight: 400;
color: rgb(55, 71, 79);
}
.not-found-desc {
margin: 0 0 30px;
font-size: 26px;
text-transform: uppercase;
color: rgb(118, 131, 143);
> em {
font-style: normal;
color: #ee8145;
}
}
.not-found-btn-gohome {
margin-left: 30px;
}
}
</style>

1278
src/views/common/home.vue Normal file

File diff suppressed because it is too large Load Diff

182
src/views/common/login.vue Normal file
View File

@@ -0,0 +1,182 @@
<template>
<div class="site-wrapper site-page--login">
<div class="site-content__wrapper">
<div class="site-content">
<div class="login-main">
<h3 class="login-title">{{entryName}}</h3>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" status-icon>
<el-form-item prop="userName">
<el-input v-model="dataForm.userName" placeholder="帐号"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
</el-form-item>
<el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha" placeholder="验证码">
</el-input>
</el-col>
<el-col :span="10" class="login-captcha">
<img :src="captchaPath" @click="getCaptcha()" alt="">
</el-col>
</el-row>
</el-form-item>
<el-form-item>
<el-button class="login-btn-submit" type="primary" @click="dataFormSubmit()">登录</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
</div>
</template>
<script>
import { getUUID } from '@/utils'
import { entryName } from '@/utils/httpRequest'
export default {
data () {
return {
dataForm: {
userName: '',
password: '',
uuid: '',
captcha: '',
entryName:'',
},
dataRule: {
userName: [
{ required: true, message: '帐号不能为空', trigger: 'blur' }
],
password: [
{ required: true, message: '密码不能为空', trigger: 'blur' }
],
captcha: [
{ required: true, message: '验证码不能为空', trigger: 'blur' }
]
},
captchaPath: ''
}
},
created () {
this.entryName = entryName
this.getCaptcha()
},
methods: {
// 提交表单
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('sys/login'),
method: 'post',
data: this.$http.adornData({
'username': this.dataForm.userName,
'password': this.dataForm.password,
'uuid': this.dataForm.uuid,
'captcha': this.dataForm.captcha,
'adminType':1
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$cookie.set('token', data.token)
this.$router.replace({ name: 'home' })
} else {
this.getCaptcha()
this.$message.error(data.msg)
}
})
}
})
},
// 获取验证码
getCaptcha () {
this.dataForm.uuid = getUUID()
this.captchaPath = this.$http.adornUrl(`/captcha.jpg?uuid=${this.dataForm.uuid}`)
}
}
}
</script>
<style lang="scss">
.site-wrapper.site-page--login {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(38, 50, 56, .2);
overflow: hidden;
&:before {
position: fixed;
top: 0;
left: 0;
z-index: -1;
width: 100%;
height: 100%;
content: "";
background-image: url(~@/assets/img/login_bg.jpg);
background-size: cover;
}
.site-content__wrapper {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
padding: 0;
margin: 0;
overflow-x: hidden;
overflow-y: auto;
background-color: transparent;
}
.site-content {
min-height: 100%;
// padding: 30px 500px 30px 30px;
}
.brand-info {
margin: 220px 100px 0 90px;
color: #fff;
}
.brand-info__text {
margin: 0 0 22px 0;
font-size: 48px;
font-weight: 400;
text-transform : uppercase;
}
.brand-info__intro {
margin: 10px 0;
font-size: 16px;
line-height: 1.58;
opacity: .6;
}
.login-main {
position: absolute;
top:50%;
left: 50%;
margin-left: -200px;
margin-top: -150px;
padding: 20px 30px;
width: 400px;
border-radius:8px;
background-color: #fff;
}
.login-title {
font-size: 20px;
text-align:center;
margin-top:10px;
}
.login-captcha {
overflow: hidden;
> img {
width: 100%;
cursor: pointer;
}
}
.login-btn-submit {
width: 100%;
margin-top: 38px;
}
}
</style>

View File

@@ -0,0 +1,33 @@
<template>
<el-form>
<h2>布局设置</h2>
<el-form-item label="导航条类型">
<el-radio-group v-model="navbarLayoutType">
<el-radio label="default" border>default</el-radio>
<el-radio label="inverse" border>inverse</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="侧边栏皮肤">
<el-radio-group v-model="sidebarLayoutSkin">
<el-radio label="light" border>light</el-radio>
<el-radio label="dark" border>dark</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</template>
<script>
export default {
computed: {
navbarLayoutType: {
get () { return this.$store.state.common.navbarLayoutType },
set (val) { this.$store.commit('common/updateNavbarLayoutType', val) }
},
sidebarLayoutSkin: {
get () { return this.$store.state.common.sidebarLayoutSkin },
set (val) { this.$store.commit('common/updateSidebarLayoutSkin', val) }
}
}
}
</script>

View File

@@ -0,0 +1,346 @@
<template>
<el-tabs v-model = "activeName" @tab-click = "handleClick">
<!-- <el-tab-pane label = "会员列表" name = "first"> -->
<div style = "margin-right:2%;text-align: right;">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">刷新
</el-button>
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" :disabled="!isAuth('domainName:add')" @click="add">添加
</el-button>
</div>
<el-table v-loading = "tableDataLoading" :data = "tableData.list" >
<el-table-column prop = "urlId" label = "编号" width = "80"></el-table-column>
<el-table-column prop = "urlAddress" label = "域名地址">
</el-table-column>
<el-table-column prop = "num" label = "使用次数" >
</el-table-column>
<el-table-column prop="status" label="状态" width="150">
<template slot-scope="scope">
<!-- <span v-if="scope.row.status==1">开启</span>
<span v-if="scope.row.status==2">关闭</span> -->
<el-switch v-model="scope.row.status" @change="changeTj(scope.row)"
:disabled="!isAuth('domainName:update')" :active-value="openValue" :inactive-value="closeValue"
active-color="#13ce66" inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column prop = "createTime" label = "创建时间" >
</el-table-column>
<el-table-column label = "操作" width = "180" align="center" fixed="right">
<template slot-scope = "scope">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" :disabled="!isAuth('domainName:update')" @click="updata(scope.row)">修改
</el-button>
<el-button size = "mini" type = "danger" :disabled="!isAuth('domainName:delete')" @click = "deletes(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[5, 10, 15, 20]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.totalCount">
</el-pagination>
</div>
<!-- </el-tab-pane> -->
<el-dialog title="添加" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">域名地址</span>
<el-input style="width:50%;" v-model="urlAddress" placeholder="请输入域名地址"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">使用次数</span>
<el-input style="width:50%;" v-model="num" type="number" min="0" placeholder="请输入使用次数" ></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">状态</span>
<el-radio-group v-model="status">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="vipAdd()"> </el-button>
</div>
</el-dialog>
<el-dialog title="修改" :visible.sync="dialogFormVisible1" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">域名地址</span>
<el-input style="width:50%;" v-model="urlAddress" placeholder="请输入域名地址"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">使用次数</span>
<el-input style="width:50%;" v-model="num" type="number" min="0" placeholder="请输入使用次数"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">状态</span>
<el-radio-group v-model="status">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="vipUpdata()"> </el-button>
</div>
</el-dialog>
</el-tabs>
</template>
<script>
export default {
data () {
return {
activeName:'first',
page: 1,
limit: 10,
classify: 1,
id:'',
urlAddress: '',
num: '',
inviteImg: '',
tableDataLoading:false,
dialogFormVisible:false,
dialogFormVisible1:false,
tableData:{},
status:1,
openValue:1,
closeValue:2,
}
},
methods: {
// tabs切换
handleClick (tab, event) {
if (tab._props.label == '轮播图') {
this.page = 1
this.limit = 5
this.classify = 1
this.dataSelect()
}
},
handleSizeChange (val) {
this.limit = val
this.dataSelect()
},
handleCurrentChange (val) {
this.page = val
this.dataSelect()
},
// 查询列表
select() {
this.page = 1
this.dataSelect()
},
// 添加
add(){
this.urlAddress = ''
this.num = ''
this.id = ''
this.inviteImg = '';
this.dialogFormVisible = true
},
updata(row){
this.urlAddress = row.urlAddress
this.num = row.num
this.id = row.urlId
this.dialogFormVisible1 = true
},
vipAdd(){
if (this.urlAddress == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入域名地址',
type: 'warning'
});
return
}
if (this.num == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入使用次数',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('urlAddress/insertUrlAddress'),
method: 'post',
data: this.$http.adornData({
'urlAddress':this.urlAddress,
'num':this.num,
'status':this.status
})
}).then(({data}) => {
if(data.code == 0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible = false
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
vipUpdata(){
if (this.urlAddress == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入域名地址',
type: 'warning'
});
return
}
if (this.num === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入使用次数',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('urlAddress/updateUrlAddress'),
method: 'post',
data: this.$http.adornData({
'urlAddress':this.urlAddress,
'num':this.num,
'urlId':this.id,
'status':this.status,
})
}).then(({data}) => {
if(data.code == 0){
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.urlAddress = ''
this.num = ''
this.id = ''
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
// 删除
deletes (row) {
let delid = row.urlId
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`urlAddress/deleteUrlAddress?addressId=${delid}`),
method: 'post',
params: this.$http.adornParams({})
}).then(({data}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
}).catch(() => {
})
},
// 获取数据列表
dataSelect () {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('urlAddress/selectUrlAddressList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'urlAddress':'',
'status':'',
})
}).then(({data}) => {
if (data && data.code === 0) {
this.tableDataLoading = false
let returnData = data.data
this.tableData = returnData
}
})
},
//修改状态
changeTj(row){
this.$http({
url: this.$http.adornUrl('urlAddress/updateUrlAddress'),
method: 'post',
data: this.$http.adornData({
'urlAddress':row.urlAddress,
'num':row.num,
'urlId':row.urlId,
'status':row.status,
})
}).then(({
data
}) => {
if(data.code==0){
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}
})
},
},
mounted () {
this.dataSelect()
}
}
</script>
<style>
.customWidth {
width: 80% !important;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,334 @@
<template>
<div>
<div style="float: right;margin-right:2%;">
<el-button style='margin: 10px 0;' size="mini" type="primary"
icon="document" @click="Notice">刷新</el-button>
<el-button style='margin: 10px 0;' :disabled="!isAuth('IntegralGoods:add')" size="mini" type="primary"
icon="document" @click="addNotice">添加</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column fixed prop="payClassifyId" label="编号" width="50">
</el-table-column>
<!-- <el-table-column prop="memberImg" label="图片">
<template slot-scope="scope">
  <img :src="scope.row.memberImg" width="60" height="60" />
</template>
</el-table-column> -->
<el-table-column prop="price" label="售价">
</el-table-column>
<el-table-column prop="payDiamond" label="钻石价格" width="100">
</el-table-column>
<el-table-column prop="money" label="金豆数量">
</el-table-column>
<el-table-column prop="wxGoodsId" label="微信道具id">
</el-table-column>
<el-table-column prop="productId" label="苹果道具id">
</el-table-column>
<el-table-column prop="sort" label="排序">
</el-table-column>
<el-table-column prop="giveMoney" label="赠送金豆">
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('IntegralGoods:update')"
@click="amendBanner(scope.$index, scope.row)">修改
</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('IntegralGoods:delete')" @click="deletes(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 50, 100]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center>
<!-- <div style="margin-bottom: 10px;display: flex;">
<span style="width: 200px;display: inline-block;text-align: right;">图片</span>
<div style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload
class="avatar-uploader"
v-model="memberImg"
:action="$http.adornUrl('alioss/upload')"
:show-file-list="false"
:on-success="handleAvatarSuccess"
>
<img v-if="memberImg" :src="memberImg" class="avatar" style="border-radius: 6px;width: 148px;height: 148px;"/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div> -->
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">售价</span>
<el-input style="width:50%;" v-model="price" placeholder="请输入售价"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">钻石价格</span>
<el-input style="width:50%;" v-model="payDiamond" placeholder="请输入钻石价格"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">金豆数量</span>
<el-input style="width:50%;" v-model="money" placeholder="请输入金豆数量"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">赠送金豆</span>
<el-input style="width:50%;" v-model="giveMoney" placeholder="请输入赠送金豆"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">微信道具id</span>
<el-input style="width:50%;" v-model="wxGoodsId" placeholder="请输入微信道具id"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">苹果道具id</span>
<el-input style="width:50%;" v-model="productId" placeholder="请输入苹果道具id"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">排序</span>
<el-input style="width:50%;" v-model="sort" placeholder="请输入排序"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addNoticeTo()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
page: 1,
limit: 10,
tableDataLoading: true,
dialogFormVisible: false,
tableData: [],
price: '',
memberImg: '',
memberId: '',
money: '',
payDiamond:'',
wxGoodsId:'',
productId:'',
giveMoney: '',
sort: '',
payClassifyId: '',
title: '添加'
}
},
methods: {
// 获取数据列表
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('payClassify/selectPayClassifyList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit
})
}).then(({
data
}) => {
if (data && data.code === 0) {
console.log('会员列表', data)
this.tableDataLoading = false
let returnData = data.data;
this.tableData = returnData;
}
})
},
//上传成功
handleAvatarSuccess(file) {
this.memberImg = file.data
},
Notice(){
this.page = 1
this.dataSelect()
},
addNotice() {
this.money = ''
this.wxGoodsId = ''
this.productId = ''
this.memberId = ''
this.price = ''
this.giveMoney = ''
this.sort = ''
this.payDiamond = ''
this.title = '添加'
this.dialogFormVisible = true
},
handleCurrentChange(val) {
this.page = val
this.dataSelect()
},
handleSizeChange(val) {
this.limit = val
this.dataSelect()
},
// 添加banner图
addNoticeTo() {
if (this.price === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入售价',
type: 'warning'
});
return
}
if (this.payDiamond === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入钻石价格',
type: 'warning'
});
return
}
if (this.money === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入金豆数量',
type: 'warning'
});
return
}
if (this.giveMoney === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入赠送金豆',
type: 'warning'
});
return
}
this.classify = 1
if (this.title == '添加') {
var url = 'payClassify/insertPayClassify'
} else {
var url = 'payClassify/updatePayClassify'
}
this.$http({
url: this.$http.adornUrl(url),
method: 'post',
data: this.$http.adornData({
'money': this.money,
'wxGoodsId':this.wxGoodsId,
'productId':this.productId,
'memberId': this.memberId,
'price': this.price,
'sort': this.sort,
'giveMoney': this.giveMoney,
'payClassifyId': this.payClassifyId,
'payDiamond':this.payDiamond,
})
}).then(({
data
}) => {
if(data.code==0){
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
// 修改
amendBanner(index, rows, a) {
if (rows.wxGoodsId) {
this.wxGoodsId = rows.wxGoodsId
} else {
this.wxGoodsId = ''
}
if (rows.productId) {
this.productId = rows.productId
} else {
this.productId = ''
}
if (rows.payDiamond) {
this.payDiamond = rows.payDiamond
} else {
this.payDiamond = ''
}
this.dialogFormVisible = true
this.payClassifyId = rows.payClassifyId
this.money = rows.money
this.sort = rows.sort
this.giveMoney = rows.giveMoney
this.price = rows.price
this.title = '修改'
},
//删除一级
deletes(row) {
let delid = row.payClassifyId
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`payClassify/deletePayClassify/?payClassifyId=${delid}`),
method: 'post',
params: this.$http.adornParams({})
}).then(({
data
}) => {
if(data.code==0){
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
}).catch(() => {})
},
},
mounted() {
this.dataSelect()
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,320 @@
<template>
<div>
<div style="display: inline-block;">
<span>开始时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="startTime" align="right" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间">
</el-date-picker>&nbsp;&nbsp;&nbsp;
<span>截止时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="endTime" align="right" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择截止时间">
</el-date-picker>
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="timeDate2">
查询</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column prop="id" label="编号" width="50"></el-table-column>
<el-table-column prop="userName" label="用户名">
<template slot-scope="scope">
<span style="color: #f56c6c;cursor:pointer" @click="updates(scope.row)">{{ scope.row.userName }}</span>
</template>
</el-table-column>
<el-table-column prop="orderId" label="充值订单号" width="200"></el-table-column>
<el-table-column prop="money" label="充值金额"></el-table-column>
<el-table-column prop="userId" label="会员编号"></el-table-column>
<el-table-column label="分类">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 1">app微信</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 2">微信公众号</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 3">微信小程序</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 4">app支付宝</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 5">h5支付宝</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 6">抖音</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 7">苹果支付</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 8">快手支付</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.classify == 9">系统充值</span>
</template>
</el-table-column>
<el-table-column label="状态">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.state == 0">待支付</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.state == 1">支付成功</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.state == 2">支付失败</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="170">
</el-table-column>
<el-table-column prop="payTime" label="支付时间" width="170">
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 50, 100]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
<el-dialog :title="title" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;display: flex;">
<span style="width: 200px;display: inline-block;text-align: right;">图片</span>
<div
style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class="avatar-uploader" v-model="memberImg" :action="$http.adornUrl('alioss/upload')"
:show-file-list="false" :on-success="handleAvatarSuccess">
<img v-if="memberImg" :src="memberImg" class="avatar"
style="border-radius: 6px;width: 148px;height: 148px;" />
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">名称</span>
<el-input style="width:50%;" v-model="memberName" placeholder="请输入名称"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">排序</span>
<el-input style="width:50%;" v-model="sort" placeholder="请输入排序"
onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addNoticeTo()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
page: 1,
limit: 10,
tableDataLoading: true,
dialogFormVisible: false,
tableData: [],
memberName: '',
memberImg: '',
memberId: '',
sort: '',
title: '添加',
startTime: '',
endTime: '',
info: {
stockDate: this.getNowTime(), //日期
},
info2: {
stockDate2: this.getNowTime2(), //日期
},
}
},
methods: {
//处理默认选中当前日期
getNowTime() {
var now = new Date()
var year = now.getFullYear() //得到年份
var month = now.getMonth() //得到月份
var date = now.getDate() //得到日期
month = month + 1
month = month.toString().padStart(2, '0')
date = date.toString().padStart(2, '0')
var defaultDate = `${year}-${month}-${date}`
return defaultDate
this.$set(this.info, 'stockDate', defaultDate)
},
//处理默认选中当前日期
getNowTime2() {
var now = new Date()
var year = now.getFullYear() //得到年份
var month = now.getMonth() - now.getMonth() //得到月份
var date = now.getDate() - now.getDate() + 1 //得到日期
month = month + 1
month = month.toString().padStart(2, '0')
date = date.toString().padStart(2, '0')
var defaultDate = `${year}-${month}-${date}`
return defaultDate
this.$set(this.info, 'stockDate', defaultDate)
},
// 详情跳转
updates(row) {
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
})
},
// 获取数据列表
dataSelect() {
this.tableDataLoading = true
if (this.endTime == '') {
this.endTime = this.info.stockDate
}
if (this.startTime == '') {
this.startTime = this.info2.stockDate2
}
this.$http({
url: this.$http.adornUrl('cash/selectUserRechargeByUserId'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'endTime': this.endTime,
'startTime': this.startTime,
})
}).then(({
data
}) => {
if (data && data.code === 0) {
console.log('会员列表', data)
this.tableDataLoading = false
let returnData = data.data;
this.tableData = returnData;
}
})
},
timeDate2() {
this.dataSelect()
},
//上传成功
handleAvatarSuccess(file) {
this.memberImg = file.data
},
addNotice() {
this.dialogFormVisible = true
},
handleCurrentChange(val) {
this.page = val
this.dataSelect()
},
handleSizeChange(val) {
this.limit = val
this.dataSelect()
},
// 添加banner图
addNoticeTo() {
if (this.memberImg == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请上传图片',
type: 'warning'
});
return
}
if (this.memberName == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入名称',
type: 'warning'
});
return
}
this.classify = 1
if (this.title == '添加') {
var url = 'member/insertMember'
} else {
var url = 'member/updateMember'
}
this.$http({
url: this.$http.adornUrl(url),
method: 'post',
data: this.$http.adornData({
'memberImg': this.memberImg,
'memberId': this.memberId,
'memberName': this.memberName,
'sort': this.sort
})
}).then(({
data
}) => {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.memberImg = ''
this.memberId = ''
this.memberName = ''
this.sort = ''
this.title = '添加'
this.dataSelect()
}
})
})
},
// 修改
amendBanner(index, rows, a) {
if (a == 1) {
this.pl = 1
} else {
this.pl = 0
}
this.dialogFormVisible = true
this.id = rows.id
this.memberImg = rows.memberImg
this.memberId = rows.memberId
this.sort = rows.sort
this.memberName = rows.memberName
this.title = '修改'
},
// 修改
amendNoticeTo() {
this.$http({
url: this.$http.adornUrl(
`?memberId=${this.memberId}&memberImg=${this.memberImg}&sort=${this.sort}&memberName=${this.memberName}`
),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
},
//删除一级
deletes(row) {
let delid = row.memberId
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`member/deleteMemberById/?memberId=${delid}`),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
}).catch(() => {})
},
},
mounted() {
this.dataSelect()
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,347 @@
<template>
<div>
<div style="margin:2% 0;display: inline-block;">
<el-input style="width: 180px;" @keydown.enter.native="select" clearable placeholder="请输入推送活动名称"
v-model="integralName"></el-input>
</div>
<div style="display: inline-block;">
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select">查询
</el-button>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
</div>
<div style="float: right;margin-right:2%;">
<el-button style='margin: 10px 0;' :disabled="!isAuth('integral:add')" size="mini" type="primary"
icon="document" @click="addNotice">添加推送活动</el-button>
<el-button style='margin: 10px 0;' :disabled="!isAuth('integral:delete') || checkBoxData.length <= 0"
size="mini" type="danger" icon="document" @click="choideletes()">批量删除</el-button>
</div>
<el-table v-loading="tableDataLoading" @selection-change="changeFun" :data="tableData.list">
<el-table-column type="selection">
</el-table-column>
<el-table-column prop="sendMoneyId" label="编号" width="80">
</el-table-column>
<el-table-column prop="integralName" label="活动名称" width="150">
</el-table-column>
<el-table-column prop="describes" label="活动描述" width="200">
</el-table-column>
<el-table-column prop="integralNum" label="活动积分">
</el-table-column>
<el-table-column prop="money" label="活动金额">
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160">
</el-table-column>
<el-table-column fixed="right" label="操作" width="250">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('integral:update')"
@click="look(scope.row)">详情
</el-button>
<el-button size="mini" type="primary" :disabled="!isAuth('integral:update')"
@click="updates(scope.row)">修改
</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('integral:delete')"
@click="deleteuser(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
<!-- 添加弹框 -->
<el-dialog title="添加推送活动" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">活动名称</span>
<el-input style="width:50%;" v-model="integralName" placeholder="请输入活动名称"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">活动积分</span>
<el-input style="width:50%;" v-model="integralNum" placeholder="请输入活动积分" type="number"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">活动金额</span>
<el-input style="width:50%;" v-model="money" placeholder="请输入活动金额" type="number"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span
style="width: 200px;display: inline-block;text-align: right;position: relative;top: -75px;">活动描述</span>
<el-input style="width:50%;" v-model="describes" type="textarea" :rows="4" placeholder="请输入活动描述">
</el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="addNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 修改弹框 -->
<el-dialog title="修改推送活动" :visible.sync="dialogFormVisible1" center>
<el-form :model="form">
<el-form-item label="活动名称:" :label-width="formLabelWidth">
<el-input v-model="form.integralName" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="活动积分:" :label-width="formLabelWidth">
<el-input v-model="form.integralNum" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="活动金额:" :label-width="formLabelWidth">
<el-input v-model="form.money" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="活动描述:" :label-width="formLabelWidth">
<el-input v-model="form.describes" style="width:65%;"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="amendNoticeTo()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
limit: 10,
page: 1,
integralName: '',
describes: '',
integralNum: '',
money: '',
sendMoneyId: '',
checkBoxData: [], //多选框选择的值
form: {
sendMoneyId: '',
integralName: '',
describes: '',
integralNum: '',
money: '',
state: '',
createTime: ''
},
formLabelWidth: '200px',
dialogFormVisible: false,
dialogFormVisible1: false,
tableDataLoading: true,
tableData: [],
}
},
methods: {
// 多选
changeFun(val) {
this.checkBoxData = val;
},
// 详情跳转
look(row) {
this.$router.push({
path: '/integralDetail',
query: {
sendMoneyId: row.sendMoneyId
}
})
},
handleSizeChange(val) {
this.limit = val
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val
this.dataSelect()
},
// 查询
select() {
this.dataSelect()
},
// 重置
cleans() {
this.integralName = ''
this.dataSelect()
},
//添加推送活动弹框
addNotice() {
this.dialogFormVisible = true
},
// 添加推送活动
addNoticeTo() {
if (this.integralName == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入推送活动名称',
type: 'warning'
});
return
}
if (this.describes == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入活动描述',
type: 'warning'
});
return
}
if (this.integralNum == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入积分',
type: 'warning'
});
return
}
if (this.money == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入金额',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('integral/insertSendMoney'),
method: 'post',
data: this.$http.adornData({
'integralName': this.integralName,
'describes': this.describes,
'integralNum': this.integralNum,
'money': this.money
})
}).then(({
data
}) => {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.integralName = ''
this.describes = ''
this.integralNum = ''
this.money = ''
this.dataSelect()
}
})
})
},
// 修改推送活动
updates(rows) {
console.log(rows)
this.dialogFormVisible1 = true
this.form.sendMoneyId = rows.sendMoneyId
this.form.integralName = rows.integralName
this.form.describes = rows.describes
this.form.integralNum = rows.integralNum
this.form.money = rows.money
this.form.createTime = rows.createTime
this.form.state = rows.state
},
// 修改
amendNoticeTo() {
this.$http({
url: this.$http.adornUrl('integral/updateSendMoney'),
method: 'post',
data: this.$http.adornData({
'sendMoneyId': this.form.sendMoneyId,
'integralName': this.form.integralName,
'describes': this.form.describes,
'integralNum': this.form.integralNum,
'money': this.form.money,
'state': this.form.state,
'createTime': this.form.createTime
})
}).then(({
data
}) => {
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
},
// 批量删除任务
choideletes(sendMoneyId) {
var ids = sendMoneyId ? [sendMoneyId] : this.checkBoxData.map(item => {
return item.sendMoneyId
})
this.$http({
url: this.$http.adornUrl(`integral/deleteSendMoney?sendMoneyIds=${ids}`),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
this.$message({
message: '批量删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
},
// 删除
deleteuser(row) {
let delid = row.sendMoneyId
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`integral/deleteSendMoney?sendMoneyIds=${delid}`),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
}).catch(() => {})
},
// 获取数据列表
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('integral/selectSendMoneyList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'integralName': this.integralName,
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data
this.tableData = returnData
})
}
},
mounted() {
this.dataSelect()
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,96 @@
<template>
<div>
<div style="display: inline-block;font-size:18px;margin-bottom: 15px;">
<a href="#" @click="prev" style="text-decoration:none;font-size: 14px;">
<icon-svg name="jiantou" style="width: 1.2em;height: 1.2em;position: relative;top: 0.3em;"></icon-svg>
返回
</a>
<span style="display: inline-block;margin: 0 15px;color: #D9D9D9;">|</span>
<span>活动详情</span>
</div>
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column prop="nickName" label="昵称" width="150">
<template slot-scope="scope">
<span
style="color: #4f9dec;cursor: pointer;">{{scope.row.nickName ? scope.row.nickName : '未绑定'}}</span>
</template>
</el-table-column>
<el-table-column prop="integralName" label="活动名称" width="150">
</el-table-column>
<el-table-column prop="describes" label="活动描述">
</el-table-column>
<el-table-column prop="money" label="活动金额">
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160">
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
data() {
return {
limit: 10,
page: 1,
tableDataLoading: true,
tableData: []
}
},
methods: {
// 返回上一级
prev() {
this.$router.back()
},
// 详情跳转
updates(row) {
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
})
},
handleSizeChange(val) {
this.limit = val
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val
this.dataSelect()
},
// 获取数据列表
dataSelect() {
let sendMoneyId = this.$route.query.sendMoneyId
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('integral/selectSendMoneyDetailsList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'sendMoneyId': sendMoneyId,
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data
this.tableData = returnData
})
}
},
mounted() {
this.dataSelect()
}
}
</script>
<style>
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,245 @@
<template>
<div>
<div style = "float: right;margin-right:2%;">
<el-button style = "margin: 10px 0;" :disabled = "!isAuth('materialLink:add')" size = "mini" type = "primary" icon = "document"
@click = "advertNotice">添加素材</el-button>
</div>
<el-table v-loading = "tableDataLoading" :data = "guangaoData">
<el-table-column fixed prop = "id" label = "编号" width = "80"></el-table-column>
<el-table-column prop = "imgUrl" label = "素材图片" width="180">
<template slot-scope = "scope">
<img :src = "scope.row.image_url" alt = "" width = "170px" height = "60">
</template>
</el-table-column>
<el-table-column prop = "url" label = "素材链接"></el-table-column>
<el-table-column prop = "createAt" label = "创建时间" width="180"></el-table-column>
<el-table-column label = "操作" width = "150">
<template slot-scope = "scope">
<el-button size = "mini" type = "primary" :disabled = "!isAuth('materialLink:update')"
@click = "advertUpdates(scope.row)">修改</el-button>
<el-button size = "mini" type = "danger" :disabled = "!isAuth('materialLink:delete')"
@click = "advertdeletes(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加素材 -->
<el-dialog title = "添加素材" :visible.sync = "dialogFormVisible" center>
<div style = "margin-bottom: 10px;display: flex;">
<span style = "width: 200px;display: inline-block;text-align: right;">素材图片</span>
<div style = " width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class = "avatar-uploader" v-model = "imgUrl" :action="$http.adornUrl('alioss/upload')"
:show-file-list = "false" :on-success = "handleAvatarSuccess">
<img v-if = "imgUrl" :src = "imgUrl" class = "avatar" style = "border-radius: 6px;width:148px;height: 148px;"/>
<i v-else class = "el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
<div style = "margin-bottom: 10px;">
<span style = "width: 200px;display: inline-block;text-align: right;position: relative;top: -68px;">素材地址</span>
<el-input style = "width:50%;" v-model = "linkUrl" placeholder = "请输入素材地址" type = "textarea" :rows = "4"></el-input>
</div>
<div slot = "footer" class = "dialog-footer">
<el-button @click = "dialogFormVisible = false"> </el-button>
<el-button type = "primary" @click = "advertNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 修改素材 -->
<el-dialog title = "修改素材" :visible.sync = "dialogFormVisible1" center>
<el-form :model = "form">
<el-form-item label = "素材图片:" :label-width = "formLabelWidth">
<div style = " width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height:148px;">
<el-upload class = "avatar-uploader" v-model = "form.imgUrl" :action="$http.adornUrl('alioss/upload')"
:show-file-list = "false" :on-success = "handleAvatarSuccess1">
<img v-if = "form.imgUrl" :src = "form.imgUrl" class = "avatar" style = "border-radius: 6px;width:148px;height: 148px;"/>
<i v-else class = "el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</el-form-item>
<el-form-item label = "素材链接:" :label-width = "formLabelWidth">
<el-input v-model = "form.linkUrl" style = "width:65%;" type = "textarea" :rows = "4"></el-input>
</el-form-item>
</el-form>
<div slot = "footer" class = "dialog-footer">
<el-button @click = "dialogFormVisible1 = false"> </el-button>
<el-button type = "primary" @click = "amendadvertTo()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data () {
return {
imgUrl: '',
linkUrl: '',
type: 3,
form: {
id: '',
imgUrl: '',
linkUrl: '',
createAt: ''
},
formLabelWidth: '200px',
tableDataLoading: false,
dialogFormVisible1: false,
dialogFormVisible: false,
guangaoData: [],
}
},
methods: {
handleAvatarSuccess (file) {
this.imgUrl = file.data
this.linkUrl = this.imgUrl
},
handleAvatarSuccess1 (file) {
this.form.imgUrl = file.data
this.form.linkUrl = this.form.imgUrl
},
handleSizeChange (val) {
this.size = val
this.guangaoSelect()
},
handleCurrentChange (val) {
this.page = val
this.guangaoSelect()
},
// 刷新
refresh () {
this.choicenSelect()
this.handpick()
},
// 添加素材弹框
advertNotice () {
this.dialogFormVisible = true
},
// 添加素材
advertNoticeTo () {
if (this.linkUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入跳转链接',
type: 'warning'
})
return
}
if (this.imgUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请上传素材图',
type: 'warning'
})
return
}
this.$http({
url: this.$http.adornUrl(`banner/update/-1?url=${this.linkUrl}&image=${this.imgUrl}&type=${this.type}`),
method: 'post',
data: this.$http.adornData({})
}).then(({data}) => {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.imgUrl = ''
this.linkUrl = ''
this.guangaoSelect()
}
})
})
},
// 点击修改
advertUpdates (rows) {
this.form.id = rows.id
this.form.imgUrl = rows.image_url
this.form.linkUrl = rows.url
this.dialogFormVisible1 = true
},
// 确定修改
amendadvertTo () {
if (this.form.linkUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入跳转链接',
type: 'warning'
})
return
}
if (this.form.imgUrl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请上传素材图',
type: 'warning'
})
return
}
this.$http({
url: this.$http.adornUrl(`banner/update/${this.form.id}?url=${this.form.linkUrl}&image=${this.form.imgUrl}&type=${this.type}`),
method: 'post',
data: this.$http.adornData({})
}).then(({data}) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.guangaoSelect()
this.dialogFormVisible1 = false
}
})
})
},
// 删除广告
advertdeletes (row) {
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`banner/delete/${row.id}`),
method: 'get',
params: this.$http.adornParams({})
}).then(({data}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.guangaoSelect()
}
})
})
})
},
// 获取素材数据
guangaoSelect () {
let page = this.page - 1
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('banner/user/list/3'),
method: 'get',
params: this.$http.adornParams({})
}).then(({data}) => {
this.tableDataLoading = false
let returnData = data.data
this.guangaoData = returnData
})
},
},
mounted () {
this.guangaoSelect()
}
}
</script>
<style>
.customWidth {
width: 80% !important;
}
</style>

View File

@@ -0,0 +1,97 @@
/*富文本编辑图片上传配置*/
import http from '../../utils/httpRequest.js'
const uploadConfig = {
action: http.adornUrl('alioss/upload'), // 必填参数 图片上传地址
methods: 'POST', // 必填参数 图片上传方式
token: '', // 可选参数 如果需要token验证假设你的token有存放在sessionStorage
name: 'file', // 必填参数 文件的参数名
size: 500, // 可选参数 图片大小单位为Kb, 1M = 1024Kb
accept: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon' // 可选 可上传的图片格式
};
// toolbar工具栏的工具选项默认展示全部
const toolOptions = [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
[{'header': 1}, {'header': 2}],
[{'list': 'ordered'}, {'list': 'bullet'}],
[{'script': 'sub'}, {'script': 'super'}],
[{'indent': '-1'}, {'indent': '+1'}],
[{'direction': 'rtl'}],
[{'size': ['small', false, 'large', 'huge']}],
[{'header': [1, 2, 3, 4, 5, 6, false]}],
[{'color': []}, {'background': []}],
[{'font': []}],
[{'align': []}],
['clean'],
['link', 'image', 'video']
];
const handlers = {
image: function image() {
var self = this;
var fileInput = this.container.querySelector('input.ql-image[type=file]');
if (fileInput === null) {
fileInput = document.createElement('input');
fileInput.setAttribute('type', 'file');
// 设置图片参数名
if (uploadConfig.name) {
fileInput.setAttribute('name', uploadConfig.name);
}
// 可设置上传图片的格式
fileInput.setAttribute('accept', uploadConfig.accept);
fileInput.classList.add('ql-image');
// 监听选择文件
fileInput.addEventListener('change', function () {
// 创建formData
var formData = new FormData();
formData.append(uploadConfig.name, fileInput.files[0]);
formData.append('object','product');
// 如果需要token且存在token
if (uploadConfig.token) {
formData.append('token', uploadConfig.token)
}
// 图片上传
var xhr = new XMLHttpRequest();
xhr.open(uploadConfig.methods, uploadConfig.action, true);
// 上传数据成功,会触发
xhr.onload = function (e) {
if (xhr.status === 200) {
var res = JSON.parse(xhr.responseText);
let length = self.quill.getSelection(true).index;
//这里很重要你图片上传成功后img的src需要在这里添加res.path就是你服务器返回的图片链接。
self.quill.insertEmbed(length, 'image', res.data);
self.quill.setSelection(length + 1)
}
fileInput.value = ''
console.log('eeeeeeeeeeeeeeeee',e)
};
// 开始上传数据
xhr.upload.onloadstart = function (e) {
fileInput.value = ''
};
// 当发生网络异常的时候会触发,如果上传数据的过程还未结束
xhr.upload.onerror = function (e) {
};
// 上传数据完成(成功或者失败)时会触发
xhr.upload.onloadend = function (e) {
// console.log('上传结束')
};
xhr.send(formData)
});
this.container.appendChild(fileInput);
}
fileInput.click();
}
};
export default {
placeholder: '',
theme: 'snow', // 主题
modules: {
toolbar: {
container: toolOptions, // 工具栏选项
handlers: handlers // 事件重写
}
}
};

127
src/views/main-content.vue Normal file
View File

@@ -0,0 +1,127 @@
<template>
<main class="site-content" :class="{ 'site-content--tabs': $route.meta.isTab }">
<!-- 主入口标签页 s -->
<el-tabs
v-if="$route.meta.isTab"
v-model="mainTabsActiveName"
:closable="true"
@tab-click="selectedTabHandle"
@tab-remove="removeTabHandle">
<el-dropdown class="site-tabs__tools" :show-timeout="0">
<i class="el-icon-arrow-down el-icon--right"></i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="tabsCloseCurrentHandle">关闭当前标签页</el-dropdown-item>
<el-dropdown-item @click.native="tabsCloseOtherHandle">关闭其它标签页</el-dropdown-item>
<el-dropdown-item @click.native="tabsCloseAllHandle">关闭全部标签页</el-dropdown-item>
<el-dropdown-item @click.native="refresh()">刷新当前标签页</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-tab-pane
v-for="item in mainTabs"
:key="item.name"
:label="item.title"
:name="item.name">
<el-card :body-style="siteContentViewHeight">
<iframe
v-if="item.type === 'iframe'"
:src="item.iframeUrl"
width="100%" height="100%" frameborder="0" scrolling="yes">
</iframe>
<keep-alive v-else>
<router-view v-if="item.name === mainTabsActiveName" />
</keep-alive>
</el-card>
</el-tab-pane>
</el-tabs>
<!-- 主入口标签页 e -->
<el-card v-else :body-style="siteContentViewHeight">
<keep-alive>
<router-view />
</keep-alive>
</el-card>
</main>
</template>
<script>
import { isURL } from '@/utils/validate'
export default {
inject: ['refresh'],
data () {
return {
}
},
computed: {
documentClientHeight: {
get () { return this.$store.state.common.documentClientHeight }
},
menuActiveName: {
get () { return this.$store.state.common.menuActiveName },
set (val) { this.$store.commit('common/updateMenuActiveName', val) }
},
mainTabs: {
get () { return this.$store.state.common.mainTabs },
set (val) { this.$store.commit('common/updateMainTabs', val) }
},
mainTabsActiveName: {
get () { return this.$store.state.common.mainTabsActiveName },
set (val) { this.$store.commit('common/updateMainTabsActiveName', val) }
},
siteContentViewHeight () {
var height = this.documentClientHeight - 50 - 30 - 2
if (this.$route.meta.isTab) {
height -= 40
return isURL(this.$route.meta.iframeUrl) ? { height: height + 'px' } : { minHeight: height + 'px' }
}
return { minHeight: height + 'px' }
}
},
methods: {
// tabs, 选中tab
selectedTabHandle (tab) {
tab = this.mainTabs.filter(item => item.name === tab.name)
if (tab.length >= 1) {
this.$router.push({ name: tab[0].name, query: tab[0].query, params: tab[0].params })
}
},
// tabs, 删除tab
removeTabHandle (tabName) {
this.mainTabs = this.mainTabs.filter(item => item.name !== tabName)
if (this.mainTabs.length >= 1) {
// 当前选中tab被删除
if (tabName === this.mainTabsActiveName) {
var tab = this.mainTabs[this.mainTabs.length - 1]
this.$router.push({ name: tab.name, query: tab.query, params: tab.params }, () => {
this.mainTabsActiveName = this.$route.name
})
}
} else {
this.menuActiveName = ''
this.$router.push({ name: 'home' })
}
},
// tabs, 关闭当前
tabsCloseCurrentHandle () {
this.removeTabHandle(this.mainTabsActiveName)
},
// tabs, 关闭其它
tabsCloseOtherHandle () {
this.mainTabs = this.mainTabs.filter(item => item.name === this.mainTabsActiveName)
},
// tabs, 关闭全部
tabsCloseAllHandle () {
this.mainTabs = []
this.menuActiveName = ''
this.$router.push({ name: 'home' })
},
// tabs, 刷新当前
tabsRefreshCurrentHandle () {
var tab = this.$route
this.removeTabHandle(tab.name)
this.$nextTick(() => {
this.$router.push({ name: tab.name, query: tab.query, params: tab.params })
})
}
}
}
</script>

View File

@@ -0,0 +1,112 @@
<template>
<el-dialog
title="修改密码"
:visible.sync="visible"
:append-to-body="true">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="账号">
<span>{{ userName }}</span>
</el-form-item>
<el-form-item label="原密码" prop="password">
<el-input type="password" v-model="dataForm.password"></el-input>
</el-form-item>
<el-form-item label="新密码" prop="newPassword">
<el-input type="password" v-model="dataForm.newPassword"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="confirmPassword">
<el-input type="password" v-model="dataForm.confirmPassword"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { clearLoginInfo } from '@/utils'
export default {
data () {
var validateConfirmPassword = (rule, value, callback) => {
if (this.dataForm.newPassword !== value) {
callback(new Error('确认密码与新密码不一致'))
} else {
callback()
}
}
return {
visible: false,
dataForm: {
password: '',
newPassword: '',
confirmPassword: ''
},
dataRule: {
password: [
{ required: true, message: '原密码不能为空', trigger: 'blur' }
],
newPassword: [
{ required: true, message: '新密码不能为空', trigger: 'blur' }
],
confirmPassword: [
{ required: true, message: '确认密码不能为空', trigger: 'blur' },
{ validator: validateConfirmPassword, trigger: 'blur' }
]
}
}
},
computed: {
userName: {
get () { return this.$store.state.user.name }
},
mainTabs: {
get () { return this.$store.state.common.mainTabs },
set (val) { this.$store.commit('common/updateMainTabs', val) }
}
},
methods: {
// 初始化
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/sys/user/password'),
method: 'post',
data: this.$http.adornData({
'password': this.dataForm.password,
'newPassword': this.dataForm.newPassword
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$nextTick(() => {
this.mainTabs = []
clearLoginInfo()
this.$router.replace({ name: 'login' })
})
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

112
src/views/main-navbar.vue Normal file
View File

@@ -0,0 +1,112 @@
<template>
<nav class="site-navbar" :class="'site-navbar--' + navbarLayoutType">
<div class="site-navbar__header">
<h1 class="site-navbar__brand" @click="$router.push({ name: 'home' })">
<a class="site-navbar__brand-lg" href="javascript:;">{{entryName}}</a>
<a class="site-navbar__brand-mini" href="javascript:;">
<img src="~@/assets/img/avatar.png" style="width: 25px;border-radius: 50%;">
</a>
</h1>
</div>
<div class="site-navbar__body clearfix">
<el-menu
class="site-navbar__menu"
mode="horizontal">
<el-menu-item class="site-navbar__switch" index="0" @click="sidebarFold = !sidebarFold">
<icon-svg name="zhedie"></icon-svg>
</el-menu-item>
</el-menu>
<el-menu
class="site-navbar__menu site-navbar__menu--right"
mode="horizontal">
<!-- <el-menu-item index="1" @click="$router.push({ name: 'theme' })">
<template slot="title">
<el-badge value="new">
<icon-svg name="shezhi" class="el-icon-setting"></icon-svg>
</el-badge>
</template>
</el-menu-item> -->
<el-menu-item class="site-navbar__avatar" index="3">
<el-dropdown :show-timeout="0" placement="bottom">
<span class="el-dropdown-link">
<img src="~@/assets/img/avatar.png" :alt="userName">{{ userName }}
</span>
<el-dropdown-menu slot="dropdown">
<!-- <el-dropdown-item @click.native="updatePasswordHandle()">修改密码</el-dropdown-item> -->
<el-dropdown-item @click.native="logoutHandle()">退出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-menu-item>
</el-menu>
</div>
<!-- 弹窗, 修改密码 -->
<update-password v-if="updatePassowrdVisible" ref="updatePassowrd"></update-password>
</nav>
</template>
<script>
import UpdatePassword from './main-navbar-update-password'
import { clearLoginInfo } from '@/utils'
import { entryName } from '@/utils/httpRequest'
export default {
data () {
return {
updatePassowrdVisible: false,
entryName:'',
}
},
mounted() {
this.entryName = entryName
},
components: {
UpdatePassword
},
computed: {
navbarLayoutType: {
get () { return this.$store.state.common.navbarLayoutType }
},
sidebarFold: {
get () { return this.$store.state.common.sidebarFold },
set (val) { this.$store.commit('common/updateSidebarFold', val) }
},
mainTabs: {
get () { return this.$store.state.common.mainTabs },
set (val) { this.$store.commit('common/updateMainTabs', val) }
},
userName: {
get () { return this.$store.state.user.name }
}
},
methods: {
// 修改密码
updatePasswordHandle () {
this.updatePassowrdVisible = true
this.$nextTick(() => {
this.$refs.updatePassowrd.init()
})
},
// 退出
logoutHandle () {
this.$confirm(`确定进行[退出]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/logout'),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
clearLoginInfo()
this.$cookie.set('token','')
sessionStorage.clear()
this.$router.push({ name: 'login' })
}
})
}).catch(() => {})
}
}
}
</script>

View File

@@ -0,0 +1,55 @@
<template>
<el-submenu
v-if="menu.list && menu.list.length >= 1"
:index="menu.menuId + ''"
:popper-class="'site-sidebar--' + sidebarLayoutSkin + '-popper'">
<template slot="title">
<icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
<span>{{ menu.name }}</span>
</template>
<sub-menu
v-for="item in menu.list"
:key="item.menuId"
:menu="item"
:dynamicMenuRoutes="dynamicMenuRoutes">
</sub-menu>
</el-submenu>
<el-menu-item v-else :index="menu.menuId + ''" @click="gotoRouteHandle(menu)">
<icon-svg :name="menu.icon || ''" class="site-sidebar__menu-icon"></icon-svg>
<span>{{ menu.name }}</span>
</el-menu-item>
</template>
<script>
import SubMenu from './main-sidebar-sub-menu'
export default {
name: 'sub-menu',
props: {
menu: {
type: Object,
required: true
},
dynamicMenuRoutes: {
type: Array,
required: true
}
},
components: {
SubMenu
},
computed: {
sidebarLayoutSkin: {
get () { return this.$store.state.common.sidebarLayoutSkin }
}
},
methods: {
// 通过menuId与动态(菜单)路由进行匹配跳转至指定路由
gotoRouteHandle (menu) {
var route = this.dynamicMenuRoutes.filter(item => item.meta.menuId === menu.menuId)
if (route.length >= 1) {
this.$router.push({ name: route[0].name })
}
}
}
}
</script>

134
src/views/main-sidebar.vue Normal file
View File

@@ -0,0 +1,134 @@
<template>
<aside class="site-sidebar" :class="'site-sidebar--' + sidebarLayoutSkin">
<div class="site-sidebar__inner">
<el-menu
:default-active="menuActiveName || 'home'"
:collapse="sidebarFold"
:collapseTransition="false"
class="site-sidebar__menu">
<!-- <el-menu-item index="home" @click="$router.push({ name: 'home' })">
<icon-svg name="shuju" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">数据中心</span>
</el-menu-item>
<el-menu-item index="userList" @click="$router.push({ name: 'userList' })">
<icon-svg name="yonghul" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">用户中心</span>
</el-menu-item>
<el-menu-item index="financeList" @click="$router.push({ name: 'financeList' })">
<icon-svg name="caiwu" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">财务中心</span>
</el-menu-item>
<el-menu-item index="message" @click="$router.push({ name: 'message' })">
<icon-svg name="xiaoxi" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">消息中心</span>
</el-menu-item>
<el-menu-item index="mission" @click="$router.push({ name: 'mission' })">
<icon-svg name="renwu" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">任务中心</span>
</el-menu-item>
<el-menu-item index="taskConfig" @click="$router.push({ name: 'taskConfig' })">
<icon-svg name="renwu" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">任务配置</span>
</el-menu-item> -->
<!-- <el-menu-item index="missionsye" @click="$router.push({ name: 'missionsye' })">
<icon-svg name="pingtai" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">系统任务</span>
</el-menu-item> -->
<!-- <el-menu-item index="materialsList" @click="$router.push({ name: 'materialsList' })">
<icon-svg name="xinxi" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">好物圈</span>
</el-menu-item> -->
<!-- <el-menu-item index="bannerList" @click="$router.push({ name: 'bannerList' })">
<icon-svg name="shangpin" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">商城配置</span>
</el-menu-item>
<el-menu-item index="allocationList" @click="$router.push({ name: 'allocationList' })">
<icon-svg name="system" class="site-sidebar__menu-icon"></icon-svg>
<span slot="title">系统配置</span>
</el-menu-item> -->
<sub-menu
v-for="menu in menuList"
:key="menu.menuId"
:menu="menu"
:dynamicMenuRoutes="dynamicMenuRoutes">
</sub-menu>
</el-menu>
</div>
</aside>
</template>
<script>
import SubMenu from './main-sidebar-sub-menu'
import { isURL } from '@/utils/validate'
export default {
data () {
return {
dynamicMenuRoutes: []
}
},
components: {
SubMenu
},
computed: {
sidebarLayoutSkin: {
get () { return this.$store.state.common.sidebarLayoutSkin }
},
sidebarFold: {
get () { return this.$store.state.common.sidebarFold }
},
menuList: {
get () { return this.$store.state.common.menuList },
set (val) { this.$store.commit('common/updateMenuList', val) }
},
menuActiveName: {
get () { return this.$store.state.common.menuActiveName },
set (val) { this.$store.commit('common/updateMenuActiveName', val) }
},
mainTabs: {
get () { return this.$store.state.common.mainTabs },
set (val) { this.$store.commit('common/updateMainTabs', val) }
},
mainTabsActiveName: {
get () { return this.$store.state.common.mainTabsActiveName },
set (val) { this.$store.commit('common/updateMainTabsActiveName', val) }
}
},
watch: {
$route: 'routeHandle'
},
created () {
this.menuList = JSON.parse(sessionStorage.getItem('menuList') || '[]')
this.dynamicMenuRoutes = JSON.parse(sessionStorage.getItem('dynamicMenuRoutes') || '[]')
this.routeHandle(this.$route)
},
methods: {
// 路由操作
routeHandle (route) {
if (route.meta.isTab) {
// tab选中, 不存在先添加
var tab = this.mainTabs.filter(item => item.name === route.name)[0]
if (!tab) {
if (route.meta.isDynamic) {
route = this.dynamicMenuRoutes.filter(item => item.name === route.name)[0]
if (!route) {
return console.error('未能找到可用标签页!')
}
}
tab = {
menuId: route.meta.menuId || route.name,
name: route.name,
title: route.meta.title,
type: isURL(route.meta.iframeUrl) ? 'iframe' : 'module',
iframeUrl: route.meta.iframeUrl || '',
params: route.params,
query: route.query
}
this.mainTabs = this.mainTabs.concat(tab)
}
this.menuActiveName = tab.menuId + ''
this.mainTabsActiveName = tab.name
}
}
}
}
</script>

90
src/views/main.vue Normal file
View File

@@ -0,0 +1,90 @@
<template>
<div
class="site-wrapper"
:class="{ 'site-sidebar--fold': sidebarFold }"
v-loading.fullscreen.lock="loading"
element-loading-text="拼命加载中">
<template v-if="!loading">
<main-navbar />
<main-sidebar />
<div class="site-content__wrapper" :style="{ 'min-height': documentClientHeight + 'px' }">
<main-content v-if="!$store.state.common.contentIsNeedRefresh" />
</div>
</template>
</div>
</template>
<script>
import MainNavbar from './main-navbar'
import MainSidebar from './main-sidebar'
import MainContent from './main-content'
export default {
provide () {
return {
// 刷新
refresh () {
this.$store.commit('common/updateContentIsNeedRefresh', true)
this.$nextTick(() => {
this.$store.commit('common/updateContentIsNeedRefresh', false)
})
}
}
},
data () {
return {
loading: true
}
},
components: {
MainNavbar,
MainSidebar,
MainContent
},
computed: {
documentClientHeight: {
get () { return this.$store.state.common.documentClientHeight },
set (val) { this.$store.commit('common/updateDocumentClientHeight', val) }
},
sidebarFold: {
get () { return this.$store.state.common.sidebarFold }
},
userId: {
get () { return this.$store.state.user.id },
set (val) { this.$store.commit('user/updateId', val) }
},
userName: {
get () { return this.$store.state.user.name },
set (val) { this.$store.commit('user/updateName', val) }
}
},
created () {
this.getUserInfo()
},
mounted () {
this.resetDocumentClientHeight()
},
methods: {
// 重置窗口可视高度
resetDocumentClientHeight () {
this.documentClientHeight = document.documentElement['clientHeight']
window.onresize = () => {
this.documentClientHeight = document.documentElement['clientHeight']
}
},
// 获取当前管理员信息
getUserInfo () {
this.$http({
url: this.$http.adornUrl('/sys/user/info'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.loading = false
this.userId = data.user.userId
this.userName = data.user.username
}
})
}
}
}
</script>

View File

@@ -0,0 +1,705 @@
<template>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="分类管理" name="first">
<div style="margin: 10px; display: inline-block;">
<span>分类名称</span>
<el-input style="width:150px;" @keydown.enter.native="select" v-model="helpClassifyNameT"
placeholder="请输入分类名称"></el-input>
</div>
<div style="margin:10px;display: inline-block;">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">查询
</el-button>
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
<el-button style='margin-left:15px;' :disabled="!isAuth('materialsList:add')" size="mini" type="primary"
icon="document" @click="addNotice">添加分类</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="tableDataF.list">
<el-table-column fixed prop="helpClassifyId" label="编号" width="80">
</el-table-column>
<el-table-column prop="helpClassifyName" label="分类名称">
</el-table-column>
<el-table-column prop="sort" label="排序">
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
</el-table-column>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('materialsList:update')"
@click="updates(scope.$index, scope.row)">编辑
</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('materialsList:delete')"
@click="deletes(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加弹框 -->
<el-dialog title="添加分类" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">分类名称</span>
<el-input style="width:50%;" v-model="helpClassifyName" placeholder="请输入分类名称"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">排序</span>
<el-input-number size="medium" v-model="sort"></el-input-number>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="releasNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 修改弹框 -->
<el-dialog title="修改分类" :visible.sync="dialogFormVisible1" center>
<el-form :model="form">
<el-form-item label="分类名称:" :label-width="formLabelWidth">
<el-input v-model="form.helpClassifyName" style="width:65%;"></el-input>
</el-form-item>
</el-form>
<el-form :model="form">
<el-form-item label="排序:" :label-width="formLabelWidth">
<el-input-number size="medium" v-model="form.sort"></el-input-number>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="amendNoticeTo()"> </el-button>
</div>
</el-dialog>
</el-tab-pane>
<el-tab-pane label="文章管理" name="second">
<div style="margin: 10px; display: inline-block;">
<span>文章分类</span>
<el-select v-model="classifyId" placeholder="请选择类型" style="width:150px;"
@change="articleSelect(classifyId)">
<el-option v-for="(item,index) in classifyIds" :key="item.index" :label="item.helpClassifyName"
:value="item.helpClassifyId">
</el-option>
</el-select>
</div>
<div style="margin: 10px; display: inline-block;">
<span>文章名称</span>
<el-input style="width:150px;" @keydown.enter.native="selectW" v-model="helpWordTitleT"
placeholder="请输入文章名称"></el-input>
</div>
<div style="margin:10px;display: inline-block;">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="selectW">查询
</el-button>
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleansW">重置
</el-button>
<el-button style='margin-left:15px;' size="mini" :disabled="!isAuth('materialsList:add')" type="primary"
icon="document" @click="addNoticewz">添加文章</el-button>&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column prop="helpWordId" label="编号" width="80">
</el-table-column>
<el-table-column prop="helpWordTitle" label="标题">
<template slot-scope="scope">
<div
style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">
{{scope.row.helpWordTitle}}</div>
</template>
</el-table-column>
<el-table-column prop="helpWordContent" label="内容">
<template slot-scope="scope">
<div
style="display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;max-height:80px;">
{{scope.row.helpWordContent}}</div>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" width="140">
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160">
</el-table-column>
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('materialsList:update')"
@click="updateswz(scope.$index, scope.row)">编辑
</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('materialsList:delete')"
@click="deleteswz(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 50, 100]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
<!-- 添加弹框 -->
<el-dialog title="添加文章" :visible.sync="dialogFormVisible2" center width="80%">
<div style="margin-bottom: 10px;">
<span style="width: 100px;display: inline-block;text-align: right;">文章分类</span>
<el-select v-model="classifyIdFl" placeholder="请选择类型" style="width: 80%;">
<el-option v-for="(item,index) in classifyIds" :key="item.index" :label="item.helpClassifyName"
:value="item.helpClassifyId">
</el-option>
</el-select>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 100px;display: inline-block;text-align: right;">排序</span>
<el-input-number size="medium" v-model="sort"></el-input-number>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 100px;display: inline-block;text-align: right;">文章标题</span>
<el-input style="width: 80%;" v-model="helpWordTitle" placeholder="请输入文章标题"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 100px;display: inline-block;text-align: right;">文章内容</span>
<quill-editor ref="myTextEditor" v-model="helpWordContent" :options="quillOption"
style="padding-bottom: 50px;height: 500px;width: 80%;display: inline-table;margin-bottom: 60px;">
</quill-editor>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible2 = false"> </el-button>
<el-button type="primary" @click="releasNoticeTowz()"> </el-button>
</div>
</el-dialog>
<!-- 修改弹框 -->
<el-dialog title="修改文章" :visible.sync="dialogFormVisible3" center width="80%">
<el-form :model="form">
<el-form-item label="文章分类:" :label-width="formLabelWidth">
<el-select v-model="formwz.helpClassifyId" placeholder="请选择类型" style="width:80%;">
<el-option v-for="(item,index) in classifyIds" :key="item.index"
:label="item.helpClassifyName" :value="item.helpClassifyId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="排序:" :label-width="formLabelWidth">
<el-input-number size="medium" v-model="formwz.sort"></el-input-number>
</el-form-item>
<el-form-item label="文章标题:" :label-width="formLabelWidth">
<el-input v-model="formwz.helpWordTitle" style="width:80%;"></el-input>
</el-form-item>
<el-form-item label="文章内容:" :label-width="formLabelWidth">
<quill-editor ref="myTextEditor" v-model="formwz.helpWordContent" :options="quillOption"
style="padding-bottom: 50px;height: 500px;width: 80%;display: inline-table;margin-bottom: 60px;">
</quill-editor>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3 = false"> </el-button>
<el-button type="primary" @click="amendNoticeTowz()"> </el-button>
</div>
</el-dialog>
</el-tab-pane>
</el-tabs>
</template>
<script>
import {
quillEditor
} from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import quillConfig from '../locality/quill-config.js'
export default {
name: 'news',
components: {
quillEditor
},
data() {
return {
limit: 10,
page: 1,
state: 1,
sort: 0,
remark: '',
createTime: '',
helpClassifyName: '',
helpClassifyId: '',
classifyId: 1,
classifyIds: [],
form: {
helpClassifyId: '',
state: '',
sort: '',
helpClassifyName: '',
createTime: '',
remark: ''
},
helpWordTitle: '',
helpWordContent: '',
classifyIdFl: '',
formwz: {
helpWordId: '',
picture: '',
articleUrl: '',
helpWordContent: '',
helpWordTitle: '',
helpClassifyId: '',
createTime: '',
sort: 0,
},
info: {
stockDate: this.getNowTime(), //日期
},
picture: '',
picture2: '',
articleUrl: '',
title: '',
formLabelWidth: '200px',
activeName: 'first',
tableDataLoading: false,
dialogFormVisible1: false,
dialogFormVisible: false,
dialogFormVisible2: false,
dialogFormVisible3: false,
tableData: {},
tableDataF: {},
parentIdnum: '',
helpClassifyNameT: '',
classnum: [{
value: '0',
label: '一级分类'
},
{
value: '1',
label: '二级分类'
}
],
value: [],
quillOption: quillConfig,
helpWordTitleT: '',
}
},
methods: {
//处理默认选中当前日期
getNowTime() {
var now = new Date();
var year = now.getFullYear(); //得到年份
var month = now.getMonth(); //得到月份
var date = now.getDate(); //得到日期
var hh = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
var mm = now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
var ss = now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
month = month + 1;
month = month.toString().padStart(2, "0");
date = date.toString().padStart(2, "0");
var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`;
return defaultDate;
this.$set(this.info, "stockDate", defaultDate);
},
handleClick(tab, event) {
this.page = 1
if (tab._props.label == '分类管理') {
this.dataSelect()
}
if (tab._props.label == '文章管理') {
// this.classifyId = 1
this.dataSelectW()
this.articleSelect()
}
},
handleSizeChange(val) {
this.limit = val;
this.articleSelect()
},
handleCurrentChange(val) {
this.page = val;
this.articleSelect()
},
handleAvatarSuccess(file) {
this.picture = file.data;
},
handleAvatarSuccess2(file2) {
this.formwz.picture = file2.data;
},
// 添加分类弹框
addNotice() {
this.helpClassifyName = ''
this.sort = 0
this.dialogFormVisible = true
},
// 添加分类
releasNoticeTo() {
if (this.helpClassifyName == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择分类名称',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('helpWord/insertHelpClassify'),
method: 'post',
data: this.$http.adornData({
'state': this.state,
'sort': this.sort,
'remark': this.remark,
'helpClassifyName': this.helpClassifyName,
'createTime': this.info.stockDate,
'types':1,
})
}).then(({
data
}) => {
if (data.code == 0) {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
},
// 编辑分类弹框
updates(index, rows) {
this.form.state = rows.state;
this.form.sort = rows.sort;
this.dialogFormVisible1 = true;
this.form.helpClassifyId = rows.helpClassifyId;
this.form.helpClassifyName = rows.helpClassifyName;
this.form.remark = rows.remark;
this.form.createTime = rows.createTime;
},
// 修改类别
amendNoticeTo() {
this.$http({
url: this.$http.adornUrl(`helpWord/updateHelpClassify`),
method: 'post',
data: this.$http.adornData({
'helpClassifyId': this.form.helpClassifyId,
'helpClassifyName': this.form.helpClassifyName,
'types':1,
})
}).then(({
data
}) => {
if (data.code == 0) {
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
},
// 删除分类
deletes(row) {
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(
`helpWord/deleteHelpClassify?helpClassifyId=${row.helpClassifyId}`),
method: 'post',
params: this.$http.adornParams({})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
}).catch(() => {})
},
// 添加文章弹框
addNoticewz() {
this.helpWordTitle = ''
this.articleUrl = ''
this.helpWordContent = ''
this.picture = ''
this.sort = 0
this.dialogFormVisible2 = true
},
// 添加文章
releasNoticeTowz() {
if (this.classifyIdFl == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择文章分类',
type: 'warning'
});
return
}
if (this.helpWordTitle == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入文章标题',
type: 'warning'
});
return
}
if (this.helpWordContent == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入内容',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('helpWord/insertHelpWord'),
method: 'post',
data: this.$http.adornData({
'helpClassifyId': this.classifyIdFl,
'helpWordContent': this.helpWordContent,
'createTime': this.info.stockDate,
'sort': this.sort,
'helpWordTitle': this.helpWordTitle,
})
}).then(({
data
}) => {
if (data.code == 0) {
this.dialogFormVisible2 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.articleSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
},
// 编辑文章弹框
updateswz(index, rows) {
this.formwz.picture = rows.picture;
this.dialogFormVisible3 = true;
this.formwz.helpWordId = rows.helpWordId;
this.formwz.helpClassifyId = rows.helpClassifyId
this.formwz.sort = rows.sort;
this.formwz.helpWordContent = rows.helpWordContent;
this.formwz.helpWordTitle = rows.helpWordTitle;
this.formwz.createTime = rows.createTime;
},
// 修改文章
amendNoticeTowz() {
this.$http({
url: this.$http.adornUrl('helpWord/updateHelpWord'),
method: 'post',
data: this.$http.adornData({
'helpWordId': this.formwz.helpWordId,
'helpWordContent': this.formwz.helpWordContent,
'helpClassifyId': this.formwz.helpClassifyId,
'helpWordTitle': this.formwz.helpWordTitle,
'createTime': this.info.stockDate,
'sort': this.formwz.sort
})
}).then(({
data
}) => {
if (data.code == 0) {
this.dialogFormVisible3 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.articleSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
},
// 删除文章
deleteswz(row) {
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('helpWord/deleteHelpWord'),
method: 'post',
params: this.$http.adornParams({
'helpWordId': row.helpWordId
})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.name = '';
this.articleSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
}).catch(() => {})
},
// 获取分类管理数据
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('helpWord/selectHelpClassifyList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': 100,
'helpClassifyName': this.helpClassifyNameT
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data;
this.tableDataF = returnData
})
},
// 分类无分页
dataSelectW() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('helpWord/selectHelpClassifyList'),
method: 'get',
params: this.$http.adornParams({
'helpClassifyName': this.helpClassifyNameT
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data;
this.classifyId = data.data[0].helpClassifyId
this.classifyIds = returnData
this.articleSelect()
})
},
// 获取文章管理数据
articleSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('helpWord/selectHelpWordList'),
method: 'get',
params: this.$http.adornParams({
'helpClassifyId': this.classifyId,
'helpWordTitle': this.helpWordTitleT,
'page': this.page,
'limit': this.limit
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data;
this.tableData = returnData
})
},
handleChange(value) {
this.value.forEach(element => {
this.parentId = element
})
},
// 查询
select() {
this.page = 1
this.dataSelect()
},
// 重置
cleans() {
this.helpClassifyNameT = ''
this.page = 1
this.dataSelect()
},
// 查询
selectW() {
this.page = 1
this.articleSelect()
},
// 重置
cleansW() {
this.helpWordTitleT = ''
this.page = 1
this.articleSelect()
},
},
mounted() {
this.dataSelect()
this.dataSelectW()
}
};
</script>
<style>
</style>

View File

@@ -0,0 +1,587 @@
<template>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="公告中心" name="first">
<div style="float: right;margin-right:2%;">
<el-button style="margin: 10px 0;" :disabled="!isAuth('message:add')" size="mini" type="primary"
icon="document" @click="addNotice">添加公告</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column prop="id" label="编号" width="80">
</el-table-column>
<el-table-column prop="title" label="标题">
</el-table-column>
<el-table-column prop="url" label="链接">
</el-table-column>
<el-table-column prop="type" label="类型">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.type === 'url' ">链接</span>
<span style="color: #4f9dec;cursor: pointer;" v-if="scope.row.type === 'word' ">文本</span>
</template>
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" width="150">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('message:update')"
@click="updates(scope.$index, scope.row)">修改
</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('message:delete')"
@click="deletes(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[5, 10, 15, 20]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalElements">
</el-pagination>
</div>
<!-- 添加弹框 -->
<el-dialog title="添加公告" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">标题</span>
<el-input style="width:50%;" v-model="title" placeholder="请输入公告标题"></el-input>
</div>
<div style="margin-bottom: 10px;" v-if="type=='url'">
<span style="width: 200px;display: inline-block;text-align: right;">链接</span>
<el-input style="width: 50%;" v-model="url" placeholder="请输入公告链接"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">类型</span>
<el-select v-model="type" placeholder="请选择公告类型" style="width:50%;">
<el-option v-for="item in types" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="releasNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 修改弹框 -->
<el-dialog title="修改" :visible.sync="dialogFormVisible1" center>
<el-form :model="form">
<el-form-item label="标题:" :label-width="formLabelWidth">
<el-input v-model="form.title" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="链接:" :label-width="formLabelWidth">
<el-input v-model="form.url" style="width:65%;"></el-input>
</el-form-item>
<el-form-item label="类型:" :label-width="formLabelWidth">
<el-select v-model="form.type" placeholder="请选择类型" style="width:65%;">
<el-option v-for="item in types" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="amendNoticeTo()"> </el-button>
</div>
</el-dialog>
</el-tab-pane>
<el-tab-pane label="用户反馈" name="two">
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column prop="id" label="编号" width="80">
</el-table-column>
<el-table-column prop="title" label="联系方式">
</el-table-column>
<el-table-column prop="content" label="内容">
</el-table-column>
<el-table-column prop="createAt" label="创建时间" width="160">
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="用户消息" name="fourth">
<div style="float: right;margin-right:2%;">
<el-button style='margin: 10px 0;' :disabled="!isAuth('message:push')" size="mini" type="primary"
icon="document" @click="magNotice">消息推送</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column prop="id" label="编号" width="80">
</el-table-column>
<el-table-column prop="userName" label="用户名称">
</el-table-column>
<el-table-column prop="title" label="消息标题">
</el-table-column>
<el-table-column prop="content" label="消息内容">
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="updataDetails(scope.row)">用户详情
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<!-- <el-tab-pane label="消息推送" name="seventh">
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column fixed prop="id" label="编号" width="80">
</el-table-column>
<el-table-column prop="userName" label="用户名称">
</el-table-column>
<el-table-column prop="title" label="消息标题">
</el-table-column>
<el-table-column prop="content" label="消息内容" width="280">
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="updataDetails(scope.row)">用户详情
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[5, 10, 15, 20]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane> -->
<!-- 消息推送 -->
<el-dialog title="消息推送" :visible.sync="dialogFormVisible2" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">类型</span>
<el-select v-model="flag" placeholder="请选择类型" style="width:50%">
<el-option v-for="item in flags" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
</div>
<div style="margin-bottom: 10px;" v-if="flag == 1">
<span style="width: 200px;display: inline-block;text-align: right;">用户手机号</span>
<el-input style="width: 50%;" v-model="phone" placeholder="请输入用户手机号"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">消息标题</span>
<el-input style="width: 50%;" v-model="title" placeholder="请输入消息标题"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span
style="width: 200px;display: inline-block;text-align: right;position: relative;top: -65px;">消息内容</span>
<el-input style="width: 50%;" type="textarea" rows="4" v-model="content" placeholder="请输入消息内容">
</el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible2 = false"> </el-button>
<el-button type="primary" @click="magNoticeTo()"> </el-button>
</div>
</el-dialog>
</el-tabs>
</template>
<script>
export default {
data() {
return {
limit: 10,
page: 1,
state: 1,
url: '',
title: '',
type: '',
id: '',
types: [{
value: 'word',
label: '文字'
},
{
value: 'url',
label: '链接'
}
],
form: {
id: '',
title: '',
url: '',
type: '',
state: '',
types: [{
value: 'word',
label: '文字'
},
{
value: 'url',
label: '链接'
}
],
},
phone: '',
content: '',
flag: '',
flags: [{
value: 1,
label: '单个用户'
},
{
value: 2,
label: '全部用户'
}
],
formLabelWidth: '200px',
activeName: 'first',
tableDataLoading: false,
dialogFormVisible1: false,
dialogFormVisible2: false,
dialogFormVisible: false,
tableData: [],
}
},
methods: {
// 详情跳转
updataDetails(row) {
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
});
},
handleSizeChange(val) {
this.limit = val;
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val;
this.dataSelect()
},
handleClick(tab, event) {
if (tab._props.label == '公告中心') {
this.page = 1
this.limit = 10
this.state = 1
this.dataSelect()
}
if (tab._props.label == '用户反馈') {
this.page = 1
this.limit = 10
this.state = 2
this.dataSelect()
}
if (tab._props.label == '用户消息') {
this.page = 1
this.limit = 10
this.state = 5
this.dataSelect()
}
if (tab._props.label == '消息推送') {
this.page = 1
this.limit = 10
this.state = 8
this.dataSelect()
}
},
// 消息推送
magNotice() {
this.dialogFormVisible2 = true
},
// 消息推送
magNoticeTo() {
if (this.flag == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择类型',
type: 'warning'
});
return
}
if (this.title == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入标题',
type: 'warning'
});
return
}
if (this.content == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入内容',
type: 'warning'
});
return
}
if (this.flag == 1) {
if (this.phone == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入用户手机号',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('cash/sendMsg'),
method: 'get',
params: this.$http.adornParams({
'title': this.title,
'content': this.content,
'phone': this.phone,
'flag': this.flag
})
}).then(({
data
}) => {
this.dialogFormVisible2 = false
if (data.code == -100) {
this.$message({
message: data.msg,
type: 'error',
duration: 1500,
onClose: () => {
this.title = ''
this.content = ''
this.phone = ''
this.flag = ''
this.dataSelect()
}
})
}
if (data.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.title = ''
this.content = ''
this.phone = ''
this.flag = ''
this.dataSelect()
}
})
}
})
}
if (this.flag == 2) {
this.$http({
url: this.$http.adornUrl('cash/sendMsg'),
method: 'get',
params: this.$http.adornParams({
'title': this.title,
'content': this.content,
'flag': this.flag,
})
}).then(({
data
}) => {
this.dialogFormVisible2 = false
if (data.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.title = ''
this.content = ''
this.flag = ''
this.dataSelect()
}
})
}
})
}
},
// 获取数据列表
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl(`message/page/${this.state}/${this.page}/${this.limit}`),
method: 'get',
params: this.$http.adornParams({})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data;
if (this.state == 2) {
for (var i in data.data.list) {
var a = data.data.list[i].content.toString()
var b = JSON.parse(a)
data.data.list[i].content = b.content
console.log('key', b.content)
}
}
this.tableData = returnData
})
},
// 添加公告弹框
addNotice() {
this.dialogFormVisible = true
},
// 添加公告
releasNoticeTo() {
if (this.title == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入公告标题',
type: 'warning'
})
return
}
if (this.type == 'url') {
if (this.url == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入公告链接',
type: 'warning'
})
return
}
}
if (this.type == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择公告类型',
type: 'warning'
})
return
}
this.$http({
url: this.$http.adornUrl('message/add'),
method: 'post',
data: this.$http.adornData({
'state': this.state,
'url': this.url,
'title': this.title,
'type': this.type
})
}).then(({
data
}) => {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
},
// 修改弹框
updates(index, rows) {
this.form.state = rows.state
this.dialogFormVisible1 = true
this.form.id = rows.id
this.form.title = rows.title
this.form.url = rows.url
this.form.type = rows.type
},
// 修改商品类别
amendNoticeTo() {
if (this.form.title == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入公告标题',
type: 'warning'
})
return
}
if (this.form.url == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入公告链接',
type: 'warning'
})
return
}
if (this.form.type == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择公告类型',
type: 'warning'
})
return
}
this.$http({
url: this.$http.adornUrl('message/update'),
method: 'post',
data: this.$http.adornData({
'id': this.form.id,
'state': this.form.state,
'title': this.form.title,
'url': this.form.url,
'type': this.form.type,
})
}).then(({
data
}) => {
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
},
// 删除公告
deletes(row) {
let delid = row.id
this.id = delid
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`message/delete/${this.id}`),
method: 'get',
params: this.$http.adornParams({})
}).then(({
data
}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.name = ''
this.dataSelect()
}
})
})
}).catch(() => {})
},
},
mounted() {
this.dataSelect()
}
};
</script>
<style>
</style>

View File

@@ -0,0 +1,286 @@
<template>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="注销信息" name="first">
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column prop="id" label="编号" width="80">
</el-table-column>
<el-table-column prop="userName" label="用户昵称" width="150">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;"
@click="updataDetails(scope.row,scope.row.userEntity)">
{{ scope.row.userEntity ? scope.row.userEntity.userName : '未绑定' }}
</span>
</template>
</el-table-column>
<el-table-column prop="content" label="内容">
<!-- <template slot-scope="scope">
<span>注销账户</span>
</template> -->
</el-table-column>
<el-table-column prop="createAt" label="创建时间" width="160">
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-button size="mini" type="danger" :disabled="!isAuth('messageZx:shenhe')"
v-if="scope.row.userEntity!=null" @click="deleteuser(scope.row)">注销用户</el-button>
<span v-else>用户已注销</span>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<el-dialog title="审核处理" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">审核结果</span>
<el-radio-group v-model="radio">
<el-radio :label="0">通过</el-radio>
<el-radio :label="1">驳回</el-radio>
</el-radio-group>
</div>
<div style="margin-bottom: 10px;" v-if="radio===1">
<span
style="width: 200px;display: inline-block;text-align: right;position: relative;top: -70px;">驳回理由</span>
<el-input style="width:50%;" v-model="content" type="textarea" :rows="4" placeholder="请输入驳回理由">
</el-input>
</div>
<div style="margin-bottom: 10px;" v-if="radio===0">
<span style="width: 200px;display: inline-block;text-align: right;">处理结果</span>
<el-radio-group v-model="clStatus">
<el-radio :label="0">封号</el-radio>
<el-radio :label="1">下架</el-radio>
</el-radio-group>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="refuseto()"> </el-button>
</div>
</el-dialog>
</el-tabs>
</template>
<script>
export default {
data() {
return {
limit: 10,
page: 1,
state: 3,
content: '',
activeName: 'first',
tableDataLoading: false,
dialogFormVisible: false,
tableData: [],
radio: '',
clStatus: '',
messageId: '',
platform: '',
platform1: '',
}
},
methods: {
// 详情跳转
updataDetails(row, userEntity) {
if (userEntity != null) {
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
});
} else {
this.$message({
message: '当前用户已注销',
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
},
handleSizeChange(val) {
this.limit = val;
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val;
this.dataSelect()
},
handleClick(tab, event) {
if (tab._props.label == '注销信息') {
this.page = 1
this.limit = 10
this.state = 3
this.dataSelect()
}
},
// 获取数据列表
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl(`message/selectMessageByType`),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'state': this.state,
'platform': this.platform1
})
}).then(({
data
}) => {
this.tableDataLoading = false
// for (var i in data.data.list) {
// var a = data.data.list[i].content.toString()
// var b = JSON.parse(a)
// data.data.list[i].content = b.content
// console.log('key', b.content)
// }
let returnData = data.data;
this.tableData = returnData
})
},
// 注销
deleteuser(row) {
let delid = row.userId
this.$confirm(`确定要注销该用户?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`user/deleteUserByUserId/${delid}`),
method: 'post',
params: this.$http.adornData({})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
})
},
//审核弹框
refuseClick(rows) {
this.radio = ''
this.clStatus = ''
this.content = ''
this.messageId = rows.id
this.platform = rows.platform
this.dialogFormVisible = true
},
//提交审核
refuseto() {
if (this.radio === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择审核结果',
type: 'warning'
});
return
}
if (this.radio === 1) {
if (this.content == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入拒绝理由',
type: 'warning'
});
return
}
}
if (this.radio === 0) {
if (this.clStatus === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择处理结果',
type: 'warning'
});
return
}
}
var status = ''
if (this.radio === 1) {
status = 1
} else {
if (this.clStatus === 0) {
status = 2
}
if (this.clStatus === 1) {
status = 3
}
}
this.$http({
url: this.$http.adornUrl('message/auditMessage'),
method: 'post',
params: this.$http.adornParams({
'messageId': this.messageId,
'status': status,
'auditContent': this.content
})
}).then(({
data
}) => {
if (data.code == 0) {
this.dialogFormVisible = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.content = ''
this.status = -1
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
},
},
mounted() {
this.dataSelect()
}
};
</script>
<style>
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,256 @@
<template>
<div>
<div style="margin:2% 0;display: inline-block;">
<span>投诉内容:</span>
<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入投诉内容"
v-model="content"></el-input>
</div>
<div style="display: inline-block;">
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select">查询
</el-button>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column fixed prop="id" label="id" width="80">
</el-table-column>
<el-table-column prop="nickName" label="用户昵称" width="150">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;"
@click="updates(scope.row)">{{scope.row.nickName ? scope.row.nickName : '未绑定'}}</span>
</template>
</el-table-column>
<el-table-column prop="title" label="标题">
</el-table-column>
<el-table-column prop="picture" label="截图">
<template slot-scope="scope">
<div v-if="scope.row.picture == null || scope.row.picture == ''">
暂无图片
</div>
<div v-else-if="scope.row.picture.includes(',')" style="display:flex;flex-wrap: wrap;">
<div v-for="item in scope.row.picture.split(',')" style="margin: 2px;">
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="item" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="item" alt="">
</el-popover>
</div>
</div>
<div v-else>
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="scope.row.picture" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="scope.row.picture" alt="">
</el-popover>
</div>
</template>
</el-table-column>
<el-table-column prop="content" label="投诉内容">
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160">
</el-table-column>
<el-table-column fixed='right' prop="state" label="状态" width="100">
<template slot-scope="scope">
<span style="color: #4f9dec;" v-if="scope.row.state === 1 ">待审核</span>
<span v-if="scope.row.state === 2 ">已审核</span>
</template>
</el-table-column>
<el-table-column fixed='right' label="操作" width="150">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="complainDetails(scope.row)">详情/处理
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
<!-- 任务投诉 -->
<el-dialog title="任务投诉详情" :visible.sync="dialogFormVisible" center>
<el-form :model="form">
<el-form-item label="投诉内容:" :label-width="formLabelWidth">
<span>{{form.content}}</span>
</el-form-item>
<el-form-item label="投诉截图:" :label-width="formLabelWidth">
<div style="display: flex;flex-wrap: wrap;">
<div v-for="(item,index) of imgs" style="margin-left: 10px;margin-top: 10px;">
<img :src="item" class="avatar" style="width:148px;height: 148px;" />
</div>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" v-if="form.state == 1">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="amendNoticeTo()"> </el-button>
</div>
</el-dialog>
<!-- 处理任务 -->
<el-dialog title="处理任务" :visible.sync="dialogFormVisible1" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">任务状态</span>
<el-radio-group v-model="state">
<el-radio :label="2">下架</el-radio>
<el-radio :label="3">不下架</el-radio>
</el-radio-group>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="complainTo()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
limit: 10,
page: 1,
userId: '',
content: '',
form: {
id: '',
content: '',
picture: '',
state: ''
},
state: '',
imgs: [],
formLabelWidth: '200px',
activeName: 'first',
tableDataLoading: false,
dialogFormVisible: false,
dialogFormVisible1: false,
tableData: [],
}
},
methods: {
handleSizeChange(val) {
this.limit = val;
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val;
this.dataSelect()
},
// 用户详情跳转
updates(row) {
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
})
},
//删除任务投诉
deleteStair(row) {
let delid = row.id
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`helpClassify/deleteClassifyById/?id=${delid}`),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.name = '';
this.classifySelect()
}
})
})
}).catch(() => {})
},
// 查询
select() {
this.dataSelect()
},
// 重置
cleans() {
this.content = ''
this.dataSelect()
},
complainDetails(row) {
this.form.id = row.id
this.form.content = row.content
this.form.picture = row.picture
this.form.state = row.state
let imgs = this.form.picture.split(',')
this.imgs = imgs;
this.dialogFormVisible = true
},
// 处理
amendNoticeTo() {
this.dialogFormVisible1 = true
},
// 处理投诉
complainTo() {
if (this.state == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择任务状态',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl(`/helpComplaint/solveHelpComplaint/${this.form.id}/${this.state}`),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible = false
this.dialogFormVisible1 = false
this.dataSelect()
}
})
}
})
},
// 获取任务投诉列表
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('helpComplaint/selectHelpComplaintList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'userId': this.userId,
'content': this.content
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data;
this.tableData = returnData
})
}
},
mounted() {
this.dataSelect()
}
};
</script>
<style>
</style>

View File

@@ -0,0 +1,280 @@
<template>
<div class="detailtabel">
<div style="display: inline-block;font-size:18px;margin-bottom: 15px;">
<a href="#" @click="prev" style="text-decoration:none;font-size: 14px;">
<icon-svg name="jiantou" style="width: 1.2em;height: 1.2em;position: relative;top: 0.3em;"></icon-svg>
返回
</a>
<span style="display: inline-block;margin: 0 15px;color: #D9D9D9;">|</span>
<span>派单详情</span>
</div>
<div class="table_main">
<table>
<tbody>
<tr>
<th>用户名称</th>
<td>{{tableData.nickName}}</td>
<th>标题</th>
<td>{{tableData.title}}</td>
<th style="width: 180px;">任务要求</th>
<td class="border-rt">{{tableData.content}}</td>
</tr>
<tr>
<th>验证信息</th>
<td>{{tableData.verifyContent}}</td>
<th>打开内容</th>
<td style="width: 180px;">{{tableData.openContent}}</td>
<th>编号</th>
<td class="border-rt">{{tableData.id}}</td>
</tr>
<tr>
<th>数量</th>
<td>{{tableData.taskNum}}</td>
<th>接单数量</th>
<td>{{tableData.endNum}}</td>
<th>发布时间</th>
<td class="border-rt">{{tableData.createTime}}</td>
</tr>
<tr>
<th>截至时间</th>
<td>{{tableData.endTime}} </td>
<th>审核时间按分</th>
<td>{{tableData.auditTime}}</td>
<th>任务限时按分</th>
<td class="border-rt">{{tableData.restrictTime}}</td>
</tr>
<tr>
<th>状态</th>
<td v-if="tableData.state == 0">待审核</td>
<td v-if="tableData.state == 1">进行中</td>
<td v-if="tableData.state == 2">已结束</td>
<td v-if="tableData.state == 3">已拒绝</td>
<td v-if="tableData.state == 4">已结算</td>
<th>打开方式</th>
<td>
<span v-if="tableData.openType== 1">链接打开</span>
<span v-if="tableData.openType== 2">口令打开</span>
<span v-if="tableData.openType== 3">扫码打开</span>
</td>
<th>打开app分类</th>
<td class="border-rt">{{tableData.openApp}}</td>
</tr>
<tr>
<th class="border-bt">验证信息</th>
<td class="border-bt">{{tableData.verifyContent}}</td>
<th class="border-bt">价格(原价)</th>
<td class="border-bt">{{tableData.taskOriginalPrice}}</td>
</tr>
</tbody>
</table>
</div>
<div style="margin-top:25px;">
<el-table v-loading="tableDataLoading" :data="taskData.list">
<el-table-column fixed prop="id" label="接单id">
</el-table-column>
<el-table-column prop="nickName" label="接单人名称" width="150">
</el-table-column>
<el-table-column prop="content" label="提交内容" width="150">
<template slot-scope="scope">
<span>{{scope.row.content}}</span>
</template>
</el-table-column>
<el-table-column prop="money" label="价格(接单时收取的价格)" width="180">
</el-table-column>
<el-table-column prop="zhiMoney" label="直属收益">
</el-table-column>
<el-table-column prop="feiMoney" label="非直属收益" width="150">
</el-table-column>
<el-table-column prop="pingMoney" label="平台收益">
</el-table-column>
<el-table-column prop="auditContent" label="拒绝原因" width="160">
</el-table-column>
<el-table-column prop="category" label="拒绝类型" width="160">
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160">
</el-table-column>
<el-table-column prop="auditTime" label="审核时间" width="160">
</el-table-column>
<el-table-column fixed='right' prop="state" label="状态" width="100">
<template slot-scope="scope">
<span style="color: #4f9dec;" v-if="scope.row.state === 0 ">接单成功</span>
<span style="color: #4f9dec;" v-if="scope.row.state === 1 ">提交待审核</span>
<span style="color: #4f9dec;" v-if="scope.row.state === 2 ">审核成功</span>
<span style="color: #4f9dec;" v-if="scope.row.state === 3 ">已拒绝</span>
<span style="color: #4f9dec;" v-if="scope.row.state === 4 ">已维权</span>
<span style="color: #4f9dec;" v-if="scope.row.state === 5 ">已放弃</span>
</template>
</el-table-column>
<el-table-column fixed='right' label="操作">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="check(scope.$index, scope.row)">查看
</el-button>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[5, 10, 15, 20]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="taskData.totalCount">
</el-pagination>
</div>
<!-- 任务查看弹框 -->
<el-dialog title="查看" :visible.sync="dialogFormVisible" center>
<div v-for="(item,index) in helpTaskData" :key="index" style="text-align: center;">
<span>步骤 {{index+1}}</span>
<!-- <p>接单id{{item.helpSendOrderId}}</p> -->
<p class="red">验证图</p>
<img :src="item.picture" alt="" width="260" height="460">
</div>
<div v-if="helpTaskData == '' " style="text-align: center;">暂无内容</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="dialogFormVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
export default {
data() {
return {
state: 0,
limit: 5,
page: 1,
dialogFormVisible: false,
tableDataLoading: true,
tableData: {},
taskData: [],
helpTaskData: []
}
},
methods: {
// 返回上一级
prev() {
this.$router.back()
},
handleSizeChange(val) {
this.limit = val;
this.taskSelect()
},
handleCurrentChange(val) {
this.page = val;
this.taskSelect()
},
// 接单人查看
check(index, rows) {
this.$http({
url: this.$http.adornUrl('helpTask/selectSendOrderDetailsById'),
method: 'get',
params: this.$http.adornParams({
'id': rows.id
})
}).then(({
data
}) => {
if (data.code === 0) {
let returnData = data.data;
this.dialogFormVisible = true
this.helpTaskData = returnData
}
})
},
// 获取数据列表
dataSelect() {
let id = this.$route.query.id
this.$http({
url: this.$http.adornUrl('helpTask/selectTakeOrderDetails'),
method: 'get',
params: this.$http.adornParams({
'id': id
})
}).then(({
data
}) => {
if (data.code === 0) {
let returnData = data.data;
this.tableData = returnData;
}
})
},
// 获取数据列表
taskSelect() {
this.tableDataLoading = true
let page = this.page - 1
let id = this.$route.query.id
this.$http({
url: this.$http.adornUrl('helpTask/selectSendOrderByTaskList'),
method: 'get',
params: this.$http.adornParams({
'page': page,
'limit': this.limit,
'id': id
})
}).then(({
data
}) => {
if (data.code === 0) {
this.tableDataLoading = false
let returnData = data.data;
this.taskData = returnData;
}
})
},
},
mounted() {
this.dataSelect()
this.taskSelect()
},
}
</script>
<style scoped="scoped">
.detailtabel h2 {
margin-top: 0;
}
.detailtabel .table_main table {
width: 100%;
}
.detailtabel .table_main {
border: 1px solid #e8e8e8;
}
.detailtabel table tr {
border-bottom: 1px solid #e8e8e8;
}
.detailtabel table tr th {
background-color: #fafafa;
padding: 16px 24px;
border-right: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
}
.detailtabel table tr td {
padding: 16px 24px;
border-right: 1px solid #e8e8e8;
border-bottom: 1px solid #e8e8e8;
}
.detailtabel table th {
color: rgba(0, 0, 0, .85);
font-weight: 400;
font-size: 14px;
line-height: 1.5;
}
.border-rt {
border-right: none !important;
}
.border-bt {
border-bottom: none !important;
}
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1386
src/views/mission/system.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,108 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px">
<el-form-item label="bean名称" prop="beanName">
<el-input v-model="dataForm.beanName" placeholder="spring bean名称, 如: testTask"></el-input>
</el-form-item>
<el-form-item label="参数" prop="params">
<el-input v-model="dataForm.params" placeholder="参数"></el-input>
</el-form-item>
<el-form-item label="cron表达式" prop="cronExpression">
<el-input v-model="dataForm.cronExpression" placeholder="如: 0 0 12 * * ?"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
beanName: '',
params: '',
cronExpression: '',
remark: '',
status: 0
},
dataRule: {
beanName: [
{ required: true, message: '用户名不能为空', trigger: 'blur' }
],
cronExpression: [
{ required: true, message: 'cron表达式不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/schedule/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.beanName = data.schedule.beanName
this.dataForm.params = data.schedule.params
this.dataForm.cronExpression = data.schedule.cronExpression
this.dataForm.remark = data.schedule.remark
this.dataForm.status = data.schedule.status
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/schedule/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'jobId': this.dataForm.id || undefined,
'beanName': this.dataForm.beanName,
'params': this.dataForm.params,
'cronExpression': this.dataForm.cronExpression,
'remark': this.dataForm.remark,
'status': !this.dataForm.id ? undefined : this.dataForm.status
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,152 @@
<template>
<el-dialog
title="日志列表"
:close-on-click-modal="false"
:visible.sync="visible"
width="75%">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.id" placeholder="任务ID" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
height="460"
style="width: 100%;">
<el-table-column
prop="logId"
header-align="center"
align="center"
width="80"
label="日志ID">
</el-table-column>
<el-table-column
prop="jobId"
header-align="center"
align="center"
width="80"
label="任务ID">
</el-table-column>
<el-table-column
prop="beanName"
header-align="center"
align="center"
label="bean名称">
</el-table-column>
<el-table-column
prop="params"
header-align="center"
align="center"
label="参数">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small">成功</el-tag>
<el-tag v-else @click.native="showErrorInfo(scope.row.logId)" size="small" type="danger" style="cursor: pointer;">失败</el-tag>
</template>
</el-table-column>
<el-table-column
prop="times"
header-align="center"
align="center"
label="耗时(单位: 毫秒)">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
width="180"
label="执行时间">
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false
}
},
methods: {
init () {
this.visible = true
this.getDataList()
},
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/scheduleLog/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'jobId': this.dataForm.id
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 失败信息
showErrorInfo (id) {
this.$http({
url: this.$http.adornUrl(`/sys/scheduleLog/info/${id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.$alert(data.log.error)
} else {
this.$message.error(data.msg)
}
})
}
}
}
</script>

View File

@@ -0,0 +1,277 @@
<template>
<div class="mod-schedule">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.beanName" placeholder="bean名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button><!-- v-if="isAuth('sys:schedule:save')" -->
<el-button type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">批量删除</el-button> <!-- v-if="isAuth('sys:schedule:delete')" -->
<el-button type="danger" @click="pauseHandle()"
:disabled="dataListSelections.length <= 0">批量暂停</el-button><!-- v-if="isAuth('sys:schedule:pause')" -->
<el-button type="danger" @click="resumeHandle()"
:disabled="dataListSelections.length <= 0">批量恢复</el-button> <!-- v-if="isAuth('sys:schedule:resume')" -->
<el-button type="danger" @click="runHandle()"
:disabled="dataListSelections.length <= 0">批量立即执行</el-button> <!-- v-if="isAuth('sys:schedule:run')" -->
<el-button type="success" @click="logHandle()">日志列表</el-button> <!-- v-if="isAuth('sys:schedule:log')" -->
</el-form-item>
</el-form>
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50">
</el-table-column>
<el-table-column prop="jobId" header-align="center" align="center" width="80" label="ID">
</el-table-column>
<el-table-column prop="beanName" header-align="center" align="center" label="bean名称">
</el-table-column>
<el-table-column prop="params" header-align="center" align="center" label="参数">
</el-table-column>
<el-table-column prop="cronExpression" header-align="center" align="center" label="cron表达式">
</el-table-column>
<el-table-column prop="remark" header-align="center" align="center" label="备注">
</el-table-column>
<el-table-column prop="status" header-align="center" align="center" label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small">正常</el-tag>
<el-tag v-else size="small" type="danger">暂停</el-tag>
</template>
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small"
@click="addOrUpdateHandle(scope.row.jobId)">修改</el-button> <!-- v-if="isAuth('sys:schedule:update')" -->
<el-button type="text" size="small"
@click="deleteHandle(scope.row.jobId)">删除</el-button> <!-- v-if="isAuth('sys:schedule:delete')" -->
<el-button type="text" size="small"
@click="pauseHandle(scope.row.jobId)">暂停</el-button> <!-- v-if="isAuth('sys:schedule:pause')" -->
<el-button type="text" size="small"
@click="resumeHandle(scope.row.jobId)">恢复</el-button> <!-- v-if="isAuth('sys:schedule:resume')" -->
<el-button type="text" size="small"
@click="runHandle(scope.row.jobId)">立即执行</el-button> <!-- v-if="isAuth('sys:schedule:run')" -->
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<!-- 弹窗, 日志列表 -->
<log v-if="logVisible" ref="log"></log>
</div>
</template>
<script>
import AddOrUpdate from './schedule-add-or-update'
import Log from './schedule-log'
export default {
data() {
return {
dataForm: {
beanName: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false,
logVisible: false
}
},
components: {
AddOrUpdate,
Log
},
activated() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/schedule/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'beanName': this.dataForm.beanName
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/schedule/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
// 暂停
pauseHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '暂停' : '批量暂停'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/schedule/pause'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
// 恢复
resumeHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '恢复' : '批量恢复'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/schedule/resume'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
// 立即执行
runHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.jobId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '立即执行' : '批量立即执行'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/schedule/run'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
// 日志列表
logHandle() {
this.logVisible = true
this.$nextTick(() => {
this.$refs.log.init()
})
}
}
}
</script>

View File

@@ -0,0 +1,133 @@
<template>
<el-dialog
title="云存储配置"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<el-form-item size="mini" label="存储类型">
<el-radio-group v-model="dataForm.type">
<el-radio :label="1">七牛</el-radio>
<el-radio :label="2">阿里云</el-radio>
<!-- <el-radio :label="3">腾讯云</el-radio> -->
</el-radio-group>
</el-form-item>
<template v-if="dataForm.type === 1">
<el-form-item size="mini">
<a href="http://www.sz.io/open/qiniu.html" target="_blank">免费申请(七牛)10GB储存空间</a>
</el-form-item>
<el-form-item label="域名">
<el-input v-model="dataForm.qiniuDomain" placeholder="七牛绑定的域名"></el-input>
</el-form-item>
<el-form-item label="路径前缀">
<el-input v-model="dataForm.qiniuPrefix" placeholder="不设置默认为空"></el-input>
</el-form-item>
<el-form-item label="AccessKey">
<el-input v-model="dataForm.qiniuAccessKey" placeholder="七牛AccessKey"></el-input>
</el-form-item>
<el-form-item label="SecretKey">
<el-input v-model="dataForm.qiniuSecretKey" placeholder="七牛SecretKey"></el-input>
</el-form-item>
<el-form-item label="空间名">
<el-input v-model="dataForm.qiniuBucketName" placeholder="七牛存储空间名"></el-input>
</el-form-item>
</template>
<template v-else-if="dataForm.type === 2">
<el-form-item label="域名">
<el-input v-model="dataForm.aliyunDomain" placeholder="阿里云绑定的域名"></el-input>
</el-form-item>
<el-form-item label="路径前缀">
<el-input v-model="dataForm.aliyunPrefix" placeholder="不设置默认为空"></el-input>
</el-form-item>
<el-form-item label="EndPoint">
<el-input v-model="dataForm.aliyunEndPoint" placeholder="阿里云EndPoint"></el-input>
</el-form-item>
<el-form-item label="AccessKeyId">
<el-input v-model="dataForm.aliyunAccessKeyId" placeholder="阿里云AccessKeyId"></el-input>
</el-form-item>
<el-form-item label="AccessKeySecret">
<el-input v-model="dataForm.aliyunAccessKeySecret" placeholder="阿里云AccessKeySecret"></el-input>
</el-form-item>
<el-form-item label="BucketName">
<el-input v-model="dataForm.aliyunBucketName" placeholder="阿里云BucketName"></el-input>
</el-form-item>
</template>
<template v-else-if="dataForm.type === 3">
<el-form-item label="域名">
<el-input v-model="dataForm.qcloudDomain" placeholder="腾讯云绑定的域名"></el-input>
</el-form-item>
<el-form-item label="路径前缀">
<el-input v-model="dataForm.qcloudPrefix" placeholder="不设置默认为空"></el-input>
</el-form-item>
<el-form-item label="AppId">
<el-input v-model="dataForm.qcloudAppId" placeholder="腾讯云AppId"></el-input>
</el-form-item>
<el-form-item label="SecretId">
<el-input v-model="dataForm.qcloudSecretId" placeholder="腾讯云SecretId"></el-input>
</el-form-item>
<el-form-item label="SecretKey">
<el-input v-model="dataForm.qcloudSecretKey" placeholder="腾讯云SecretKey"></el-input>
</el-form-item>
<el-form-item label="BucketName">
<el-input v-model="dataForm.qcloudBucketName" placeholder="腾讯云BucketName"></el-input>
</el-form-item>
<el-form-item label="Bucket所属地区">
<el-input v-model="dataForm.qcloudRegion" placeholder="如sh可选值 华南gz 华北tj 华东sh"></el-input>
</el-form-item>
</template>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {},
dataRule: {}
}
},
methods: {
init (id) {
this.visible = true
this.$http({
url: this.$http.adornUrl('/sys/oss/config'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.dataForm = data && data.code === 0 ? data.config : []
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/sys/oss/saveConfig'),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,71 @@
<template>
<el-dialog
title="上传文件"
:close-on-click-modal="false"
@close="closeHandle"
:visible.sync="visible">
<el-upload
drag
:action="url"
:before-upload="beforeUploadHandle"
:on-success="successHandle"
multiple
:file-list="fileList"
style="text-align: center;">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只支持jpgpnggif格式的图片</div>
</el-upload>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
url: '',
num: 0,
successNum: 0,
fileList: []
}
},
methods: {
init (id) {
this.url = this.$http.adornUrl(`/sys/oss/upload?token=${this.$cookie.get('token')}`)
this.visible = true
},
// 上传之前
beforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error('只支持jpg、png、gif格式的图片')
return false
}
this.num++
},
// 上传成功
successHandle (response, file, fileList) {
this.fileList = fileList
this.successNum++
if (response && response.code === 0) {
if (this.num === this.successNum) {
this.$confirm('操作成功, 是否继续操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(() => {
this.visible = false
})
}
} else {
this.$message.error(response.msg)
}
},
// 弹窗关闭时
closeHandle () {
this.fileList = []
this.$emit('refreshDataList')
}
}
}
</script>

View File

@@ -0,0 +1,149 @@
<template>
<div class="mod-oss">
<el-form :inline="true" :model="dataForm">
<el-form-item>
<el-button type="primary" @click="configHandle()">云存储配置</el-button>
<el-button type="primary" @click="uploadHandle()">上传文件</el-button>
<el-button type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50">
</el-table-column>
<el-table-column prop="id" header-align="center" align="center" width="80" label="ID">
</el-table-column>
<el-table-column prop="url" header-align="center" align="center" label="URL地址">
</el-table-column>
<el-table-column prop="createDate" header-align="center" align="center" width="180" label="创建时间">
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 云存储配置 -->
<config v-if="configVisible" ref="config"></config>
<!-- 弹窗, 上传文件 -->
<upload v-if="uploadVisible" ref="upload" @refreshDataList="getDataList"></upload>
</div>
</template>
<script>
import Config from './oss-config'
import Upload from './oss-upload'
export default {
data() {
return {
dataForm: {},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
configVisible: false,
uploadVisible: false
}
},
components: {
Config,
Upload
},
activated() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/oss/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val
},
// 云存储配置
configHandle() {
this.configVisible = true
this.$nextTick(() => {
this.$refs.config.init()
})
},
// 上传文件
uploadHandle() {
this.uploadVisible = true
this.$nextTick(() => {
this.$refs.upload.init()
})
},
// 删除
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/oss/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>

View File

@@ -0,0 +1,187 @@
<template>
<div class="mod-user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.userName" placeholder="用户名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('sys:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('sys:user:delete')" type="danger" @click="deleteHandle()"
:disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50">
</el-table-column>
<el-table-column prop="userId" header-align="center" align="center" width="80" label="ID">
</el-table-column>
<el-table-column prop="username" header-align="center" align="center" label="用户名">
</el-table-column>
<el-table-column prop="email" header-align="center" align="center" label="邮箱">
</el-table-column>
<el-table-column prop="mobile" header-align="center" align="center" label="手机号">
</el-table-column>
<el-table-column prop="qdRate" header-align="center" align="center" label="渠道佣金">
<!-- <template slot-scope="scope">
<span v-for="(item,index) in scope.row.roleEntityList" :key="index">{{item.roleName}} </span>
</template> -->
</el-table-column>
<el-table-column prop="qdCode" header-align="center" align="center" label="渠道码">
<template slot-scope="scope">
<span v-if="scope.row.qdCode" >{{scope.row.qdCode}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<!-- <el-table-column prop="money" header-align="center" align="center" label="钱包">
<template slot-scope="scope">
<span v-if="scope.row.money" >{{scope.row.money}}</span>
<span v-else> - </span>
</template>
</el-table-column> -->
<el-table-column prop="status" header-align="center" align="center" label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">禁用</el-tag>
<el-tag v-else size="small">正常</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" header-align="center" align="center" width="180" label="创建时间">
</el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button :disabled="!isAuth('sys:user:update')" type="text" size="small"
@click="addOrUpdateHandle(scope.row.userId)">修改</el-button>
<el-button :disabled="!isAuth('sys:user:delete')" type="text" size="small"
@click="deleteHandle(scope.row.userId)">删除</el-button>
<el-button size="mini" type="primary" @click="qianbao(scope.row)"
style="margin: 3px;">管理员详情</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './user-add-or-updateG'
export default {
data() {
return {
dataForm: {
userName: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated() {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('sys/user/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'username': this.dataForm.userName,
'isChannel':1
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle(val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
// this.$refs.addOrUpdate.homeSelect(id)
})
},
// 删除
deleteHandle(id) {
var userIds = id ? [id] : this.dataListSelections.map(item => {
return item.userId
})
this.$confirm(`确定对[id=${userIds.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/user/delete'),
method: 'post',
data: this.$http.adornData(userIds, false)
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
},
// 小区钱包
qianbao(row){
this.$router.push({
path: '/storeincomeZ',
query: {
userId: row.userId,
detail:JSON.stringify(row)
}
})
}
}
}
</script>

View File

@@ -0,0 +1,99 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="参数名" prop="paramKey">
<el-input v-model="dataForm.paramKey" placeholder="参数名"></el-input>
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input v-model="dataForm.paramValue" placeholder="参数值"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
paramKey: '',
paramValue: '',
remark: ''
},
dataRule: {
paramKey: [
{ required: true, message: '参数名不能为空', trigger: 'blur' }
],
paramValue: [
{ required: true, message: '参数值不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/config/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.paramKey = data.config.paramKey
this.dataForm.paramValue = data.config.paramValue
this.dataForm.remark = data.config.remark
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/config/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'paramKey': this.dataForm.paramKey,
'paramValue': this.dataForm.paramValue,
'remark': this.dataForm.remark
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,176 @@
<template>
<div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.paramKey" placeholder="参数名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
width="80"
label="ID">
</el-table-column>
<el-table-column
prop="paramKey"
header-align="center"
align="center"
label="参数名">
</el-table-column>
<el-table-column
prop="paramValue"
header-align="center"
align="center"
label="参数值">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './config-add-or-update'
export default {
data () {
return {
dataForm: {
paramKey: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/config/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'paramKey': this.dataForm.paramKey
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/config/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>

View File

@@ -0,0 +1,123 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="字典名称" prop="name">
<el-input v-model="dataForm.name" placeholder="参数名"></el-input>
</el-form-item>
<el-form-item label="字典类型" prop="type">
<el-input v-model="dataForm.type" placeholder="参数值"></el-input>
</el-form-item>
<el-form-item label="字典码" prop="code">
<el-input v-model="dataForm.code" placeholder="参数值"></el-input>
</el-form-item>
<el-form-item label="字典值" prop="value">
<el-input v-model="dataForm.value" placeholder="参数值"></el-input>
</el-form-item>
<el-form-item label="排序" prop="orderNum">
<el-input-number v-model="dataForm.orderNum" controls-position="right" :min="0" label="排序号"></el-input-number>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data () {
return {
visible: false,
dataForm: {
id: 0,
name: '',
type: '',
code: '',
value: '',
orderNum: 0,
remark: ''
},
dataRule: {
name: [
{ required: true, message: '字典名称不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '字典类型不能为空', trigger: 'blur' }
],
code: [
{ required: true, message: '字典码不能为空', trigger: 'blur' }
],
value: [
{ required: true, message: '字典值不能为空', trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/dict/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.name = data.dict.name
this.dataForm.type = data.dict.type
this.dataForm.code = data.dict.code
this.dataForm.value = data.dict.value
this.dataForm.orderNum = data.dict.orderNum
this.dataForm.remark = data.dict.remark
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/dict/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'name': this.dataForm.name,
'type': this.dataForm.type,
'code': this.dataForm.code,
'value': this.dataForm.value,
'orderNum': this.dataForm.orderNum,
'remark': this.dataForm.remark
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,197 @@
<template>
<div class="mod-dict">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.name" placeholder="字典名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('sys:dict:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="id"
header-align="center"
align="center"
width="80"
label="ID">
</el-table-column>
<el-table-column
prop="name"
header-align="center"
align="center"
label="字典名称">
</el-table-column>
<el-table-column
prop="type"
header-align="center"
align="center"
label="字典类型">
</el-table-column>
<el-table-column
prop="code"
header-align="center"
align="center"
label="字典码">
</el-table-column>
<el-table-column
prop="value"
header-align="center"
align="center"
width="180"
label="字典值">
</el-table-column>
<el-table-column
prop="orderNum"
header-align="center"
align="center"
width="180"
label="排序">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
width="180"
label="备注">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button v-if="isAuth('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button v-if="isAuth('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './dict-add-or-update'
export default {
data () {
return {
dataForm: {
name: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/dict/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'name': this.dataForm.name
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/dict/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>

View File

@@ -0,0 +1,138 @@
<template>
<div class="mod-log">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.key" placeholder="用户名/用户操作" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
style="width: 100%">
<el-table-column
prop="id"
header-align="center"
align="center"
width="80"
label="ID">
</el-table-column>
<el-table-column
prop="username"
header-align="center"
align="center"
label="用户名">
</el-table-column>
<el-table-column
prop="operation"
header-align="center"
align="center"
label="用户操作">
</el-table-column>
<el-table-column
prop="method"
header-align="center"
align="center"
width="150"
:show-overflow-tooltip="true"
label="请求方法">
</el-table-column>
<el-table-column
prop="params"
header-align="center"
align="center"
width="150"
:show-overflow-tooltip="true"
label="请求参数">
</el-table-column>
<el-table-column
prop="time"
header-align="center"
align="center"
label="执行时长(毫秒)">
</el-table-column>
<el-table-column
prop="ip"
header-align="center"
align="center"
width="150"
label="IP地址">
</el-table-column>
<el-table-column
prop="createDate"
header-align="center"
align="center"
width="180"
label="创建时间">
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
</template>
<script>
export default {
data () {
return {
dataForm: {
key: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
selectionDataList: []
}
},
created () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/log/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'key': this.dataForm.key
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
}
}
}
</script>

View File

@@ -0,0 +1,260 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="类型" prop="type">
<el-radio-group v-model="dataForm.type">
<el-radio v-for="(type, index) in dataForm.typeList" :label="index" :key="index">{{ type }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item :label="dataForm.typeList[dataForm.type] + '名称'" prop="name">
<el-input v-model="dataForm.name" :placeholder="dataForm.typeList[dataForm.type] + '名称'"></el-input>
</el-form-item>
<el-form-item label="上级菜单" prop="parentName">
<el-popover
ref="menuListPopover"
placement="bottom-start"
trigger="click">
<el-tree
:data="menuList"
:props="menuListTreeProps"
node-key="menuId"
ref="menuListTree"
@current-change="menuListTreeCurrentChangeHandle"
:default-expand-all="true"
:highlight-current="true"
:expand-on-click-node="false">
</el-tree>
</el-popover>
<el-input v-model="dataForm.parentName" v-popover:menuListPopover :readonly="true" placeholder="点击选择上级菜单" class="menu-list__input"></el-input>
</el-form-item>
<el-form-item v-if="dataForm.type === 1" label="菜单路由" prop="url">
<el-input v-model="dataForm.url" placeholder="菜单路由"></el-input>
</el-form-item>
<el-form-item v-if="dataForm.type !== 0" label="授权标识" prop="perms">
<el-input v-model="dataForm.perms" placeholder="多个用逗号分隔, 如: user:list,user:create"></el-input>
</el-form-item>
<el-form-item v-if="dataForm.type !== 2" label="排序号" prop="orderNum">
<el-input-number v-model="dataForm.orderNum" controls-position="right" :min="0" label="排序号"></el-input-number>
</el-form-item>
<el-form-item v-if="dataForm.type !== 2" label="菜单图标" prop="icon">
<el-row>
<el-col :span="22">
<el-popover
ref="iconListPopover"
placement="bottom-start"
trigger="click"
popper-class="mod-menu__icon-popover">
<div class="mod-menu__icon-inner">
<div class="mod-menu__icon-list">
<el-button
v-for="(item, index) in iconList"
:key="index"
@click="iconActiveHandle(item)"
:class="{ 'is-active': item === dataForm.icon }">
<icon-svg :name="item"></icon-svg>
</el-button>
</div>
</div>
</el-popover>
<el-input v-model="dataForm.icon" v-popover:iconListPopover :readonly="true" placeholder="菜单图标名称" class="icon-list__input"></el-input>
</el-col>
<el-col :span="2" class="icon-list__tips">
<el-tooltip placement="top" effect="light">
<div slot="content">全站推荐使用SVG Sprite, 详细请参考:<a href="//github.com/daxiongYang/sz-fast-vue/blob/master/src/icons/index.js" target="_blank">icons/index.js</a>描述</div>
<i class="el-icon-warning"></i>
</el-tooltip>
</el-col>
</el-row>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { treeDataTranslate } from '@/utils'
import Icon from '@/icons'
export default {
data () {
var validateUrl = (rule, value, callback) => {
if (this.dataForm.type === 1 && !/\S/.test(value)) {
callback(new Error('菜单URL不能为空'))
} else {
callback()
}
}
return {
visible: false,
dataForm: {
id: 0,
type: 1,
typeList: ['目录', '菜单', '按钮'],
name: '',
parentId: 0,
parentName: '',
url: '',
perms: '',
orderNum: 0,
icon: '',
iconList: []
},
dataRule: {
name: [
{ required: true, message: '菜单名称不能为空', trigger: 'blur' }
],
parentName: [
{ required: true, message: '上级菜单不能为空', trigger: 'change' }
],
url: [
{ validator: validateUrl, trigger: 'blur' }
]
},
menuList: [],
menuListTreeProps: {
label: 'name',
children: 'children'
}
}
},
created () {
this.iconList = Icon.getNameList()
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.$http({
url: this.$http.adornUrl('/sys/menu/select'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.menuList = treeDataTranslate(data.menuList, 'menuId')
}).then(() => {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
}).then(() => {
if (!this.dataForm.id) {
// 新增
this.menuListTreeSetCurrentNode()
} else {
// 修改
this.$http({
url: this.$http.adornUrl(`/sys/menu/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.dataForm.id = data.menu.menuId
this.dataForm.type = data.menu.type
this.dataForm.name = data.menu.name
this.dataForm.parentId = data.menu.parentId
this.dataForm.url = data.menu.url
this.dataForm.perms = data.menu.perms
this.dataForm.orderNum = data.menu.orderNum
this.dataForm.icon = data.menu.icon
this.menuListTreeSetCurrentNode()
})
}
})
},
// 菜单树选中
menuListTreeCurrentChangeHandle (data, node) {
this.dataForm.parentId = data.menuId
this.dataForm.parentName = data.name
},
// 菜单树设置当前选中节点
menuListTreeSetCurrentNode () {
this.$refs.menuListTree.setCurrentKey(this.dataForm.parentId)
this.dataForm.parentName = (this.$refs.menuListTree.getCurrentNode() || {})['name']
},
// 图标选中
iconActiveHandle (iconName) {
this.dataForm.icon = iconName
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/menu/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'menuId': this.dataForm.id || undefined,
'type': this.dataForm.type,
'name': this.dataForm.name,
'parentId': this.dataForm.parentId,
'url': this.dataForm.url,
'perms': this.dataForm.perms,
'orderNum': this.dataForm.orderNum,
'icon': this.dataForm.icon
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>
<style lang="scss">
.mod-menu {
.menu-list__input,
.icon-list__input {
> .el-input__inner {
cursor: pointer;
}
}
&__icon-popover {
width: 458px;
overflow: hidden;
}
&__icon-inner {
width: 478px;
max-height: 258px;
overflow-x: hidden;
overflow-y: auto;
}
&__icon-list {
width: 458px;
padding: 0;
margin: -8px 0 0 -8px;
> .el-button {
padding: 8px;
margin: 8px 0 0 8px;
> span {
display: inline-block;
vertical-align: middle;
width: 18px;
height: 18px;
font-size: 18px;
}
}
}
.icon-list__tips {
font-size: 18px;
text-align: center;
color: #e6a23c;
cursor: pointer;
}
}
</style>

View File

@@ -0,0 +1,152 @@
<template>
<div class="mod-menu">
<el-form :inline="true" :model="dataForm">
<el-form-item>
<el-button v-if="isAuth('sys:menu:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
row-key="menuId"
border
style="width: 100%; ">
<el-table-column
prop="name"
header-align="center"
min-width="150"
label="名称" >
</el-table-column>
<el-table-column
prop="parentName"
header-align="center"
align="center"
width="120"
label="上级菜单">
</el-table-column>
<el-table-column
header-align="center"
align="center"
label="图标">
<template slot-scope="scope">
<icon-svg :name="scope.row.icon || ''"></icon-svg>
</template>
</el-table-column>
<el-table-column
prop="type"
header-align="center"
align="center"
label="类型">
<template slot-scope="scope">
<el-tag v-if="scope.row.type === 0" size="small">目录</el-tag>
<el-tag v-else-if="scope.row.type === 1" size="small" type="success">菜单</el-tag>
<el-tag v-else-if="scope.row.type === 2" size="small" type="info">按钮</el-tag>
</template>
</el-table-column>
<el-table-column
prop="orderNum"
header-align="center"
align="center"
label="排序号">
</el-table-column>
<el-table-column
prop="url"
header-align="center"
align="center"
width="150"
:show-overflow-tooltip="true"
label="菜单URL">
</el-table-column>
<el-table-column
prop="perms"
header-align="center"
align="center"
width="150"
:show-overflow-tooltip="true"
label="授权标识">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button :disabled="!isAuth('sys:menu:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.menuId)">修改</el-button>
<el-button :disabled="!isAuth('sys:menu:delete')" type="text" size="small" @click="deleteHandle(scope.row.menuId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './menu-add-or-update'
import { treeDataTranslate } from '@/utils'
export default {
data () {
return {
dataForm: {},
dataList: [],
dataListLoading: false,
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/menu/list'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.dataList = treeDataTranslate(data, 'menuId')
this.dataListLoading = false
})
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行[删除]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/sys/menu/delete/${id}`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>

View File

@@ -0,0 +1,123 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="角色名称" prop="roleName">
<el-input v-model="dataForm.roleName" placeholder="角色名称"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item size="mini" label="授权">
<el-tree
:data="menuList"
:props="menuListTreeProps"
node-key="menuId"
ref="menuListTree"
:default-expand-all="true"
show-checkbox>
</el-tree>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { treeDataTranslate } from '@/utils'
export default {
data () {
return {
visible: false,
menuList: [],
menuListTreeProps: {
label: 'name',
children: 'children'
},
dataForm: {
id: 0,
roleName: '',
remark: ''
},
dataRule: {
roleName: [
{ required: true, message: '角色名称不能为空', trigger: 'blur' }
]
},
tempKey: -666666 // 临时key, 用于解决tree半选中状态项不能传给后台接口问题. # 待优化
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.$http({
url: this.$http.adornUrl('/sys/menu/list'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.menuList = treeDataTranslate(data, 'menuId')
}).then(() => {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs.menuListTree.setCheckedKeys([])
})
}).then(() => {
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/role/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.roleName = data.role.roleName
this.dataForm.remark = data.role.remark
var idx = data.role.menuIdList.indexOf(this.tempKey)
if (idx !== -1) {
data.role.menuIdList.splice(idx, data.role.menuIdList.length - idx)
}
this.$refs.menuListTree.setCheckedKeys(data.role.menuIdList)
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/sys/role/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'roleId': this.dataForm.id || undefined,
'roleName': this.dataForm.roleName,
'remark': this.dataForm.remark,
'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys(), [this.tempKey], this.$refs.menuListTree.getHalfCheckedKeys())
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script>

View File

@@ -0,0 +1,177 @@
<template>
<div class="mod-role">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.roleName" placeholder="角色名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('sys:role:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('sys:role:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="roleId"
header-align="center"
align="center"
width="80"
label="ID">
</el-table-column>
<el-table-column
prop="roleName"
header-align="center"
align="center"
label="角色名称">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
width="180"
label="创建时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button :disabled="!isAuth('sys:role:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.roleId)">修改</el-button>
<el-button :disabled="!isAuth('sys:role:delete')" type="text" size="small" @click="deleteHandle(scope.row.roleId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './role-add-or-update'
export default {
data () {
return {
dataForm: {
roleName: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/sys/role/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'roleName': this.dataForm.roleName
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.roleId
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/role/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>

View File

@@ -0,0 +1,188 @@
<template>
<el-dialog
:title="!dataForm.id ? '新增' : '修改'"
:close-on-click-modal="false"
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
<el-form-item label="用户名" prop="userName">
<el-input v-model="dataForm.userName" placeholder="登录帐号"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password" :class="{ 'is-required': !dataForm.id }">
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="comfirmPassword" :class="{ 'is-required': !dataForm.id }">
<el-input v-model="dataForm.comfirmPassword" type="password" placeholder="确认密码"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="dataForm.email" placeholder="邮箱"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="手机号"></el-input>
</el-form-item>
<el-form-item label="角色" size="mini" prop="roleIdList">
<el-checkbox-group v-model="dataForm.roleIdList">
<el-checkbox v-for="role in roleList" :key="role.roleId" v-if="role.roleId!=4" :label="role.roleId">{{ role.roleName }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="状态" size="mini" prop="status">
<el-radio-group v-model="dataForm.status">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { isEmail, isMobile } from '@/utils/validate'
export default {
data () {
var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error('密码不能为空'))
} else {
callback()
}
}
var validateComfirmPassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error('确认密码不能为空'))
} else if (this.dataForm.password !== value) {
callback(new Error('确认密码与密码输入不一致'))
} else {
callback()
}
}
var validateEmail = (rule, value, callback) => {
if (!isEmail(value)) {
callback(new Error('邮箱格式错误'))
} else {
callback()
}
}
var validateMobile = (rule, value, callback) => {
if (!isMobile(value)) {
callback(new Error('手机号格式错误'))
} else {
callback()
}
}
return {
visible: false,
roleList: [],
dataForm: {
id: 0,
userName: '',
password: '',
comfirmPassword: '',
salt: '',
email: '',
mobile: '',
roleIdList: [],
status: 1
},
dataRule: {
userName: [
{ required: true, message: '用户名不能为空', trigger: 'blur' }
],
password: [
{ validator: validatePassword, trigger: 'blur' }
],
comfirmPassword: [
{ validator: validateComfirmPassword, trigger: 'blur' }
],
email: [
{ required: true, message: '邮箱不能为空', trigger: 'blur' },
{ validator: validateEmail, trigger: 'blur' }
],
mobile: [
{ required: true, message: '手机号不能为空', trigger: 'blur' },
{ validator: validateMobile, trigger: 'blur' }
]
}
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.$http({
url: this.$http.adornUrl('/sys/role/select'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
this.roleList = data && data.code === 0 ? data.list : []
}).then(() => {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
}).then(() => {
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/sys/user/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.userName = data.user.username
this.dataForm.salt = data.user.salt
this.dataForm.email = data.user.email
this.dataForm.mobile = data.user.mobile
this.dataForm.roleIdList = data.user.roleIdList
this.dataForm.status = data.user.status
}
})
}
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
if(this.dataForm.roleIdList.length<1){
this.$message({
message: '请选择角色',
type: 'error',
duration: 1500,
})
}else{
this.$http({
url: this.$http.adornUrl(`/sys/user/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'userId': this.dataForm.id || undefined,
'username': this.dataForm.userName,
'password': this.dataForm.password,
'salt': this.dataForm.salt,
'email': this.dataForm.email,
'mobile': this.dataForm.mobile,
'status': this.dataForm.status,
'roleIdList': this.dataForm.roleIdList
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
}
})
}
}
}
</script>

View File

@@ -0,0 +1,342 @@
<template>
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-form-item label="用户名" prop="userName">
<el-input v-model="dataForm.userName" placeholder="登录帐号"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password" :class="{ 'is-required': !dataForm.id }">
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="comfirmPassword" :class="{ 'is-required': !dataForm.id }">
<el-input v-model="dataForm.comfirmPassword" type="password" placeholder="确认密码"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="dataForm.email" placeholder="邮箱"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="手机号"></el-input>
</el-form-item>
<!-- <el-form-item label="角色" size="mini" prop="roleIdList">
<el-checkbox-group v-model="dataForm.roleIdList" @change="changes">
<el-checkbox v-for="role in roleList" :key="role.roleId" :label="role.roleId">{{ role.roleName }}
</el-checkbox>
</el-checkbox-group>
</el-form-item> -->
<el-form-item label="渠道码" prop="qdCode">
<!-- <el-checkbox-group v-model="dataForm.helpCampusId" @change="changesC">
<el-checkbox v-for="role in manageList" :key="role.campusId" :label="role.campusId">
{{ role.campusName }}</el-checkbox>
</el-checkbox-group> -->
<!-- <el-radio-group v-model="dataForm.helpCampusId">
<el-radio v-for="role in manageList" :key="role.campusId" :label="role.campusId">{{ role.campusName }}</el-radio>
</el-radio-group> -->
<!-- <el-select v-model="dataForm.helpCampusId" filterable remote :remote-method="remoteMethod" :loading="loading"
style="width:200px;margin-left: 10px;">
<el-option v-for="item in manageList" :key="item.campusId" :label="item.campusName"
:value="item.campusId">
</el-option>
</el-select> -->
<el-input v-model="dataForm.qdCode" placeholder="渠道码"></el-input>
</el-form-item>
<el-form-item label="渠道佣金" prop="qdRate">
<el-input v-model="dataForm.qdRate" placeholder="渠道佣金比例,例如0.1"></el-input>
</el-form-item>
<!-- <el-form-item label="钱包" prop=" money">
<el-input v-model="dataForm.money" disabled placeholder="钱包"></el-input>
</el-form-item> -->
<el-form-item label="状态" size="mini" prop="status">
<el-radio-group v-model="dataForm.status">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import {
isEmail,
isMobile
} from '@/utils/validate'
export default {
data() {
var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error('密码不能为空'))
} else {
callback()
}
}
var validateComfirmPassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error('确认密码不能为空'))
} else if (this.dataForm.password !== value) {
callback(new Error('确认密码与密码输入不一致'))
} else {
callback()
}
}
var validateEmail = (rule, value, callback) => {
if (!isEmail(value)) {
callback(new Error('邮箱格式错误'))
} else {
callback()
}
}
var validateMobile = (rule, value, callback) => {
if (!isMobile(value)) {
callback(new Error('手机号格式错误'))
} else {
callback()
}
}
return {
visible: false,
roleList: [],
manageList: [10],
dataForm: {
id: 0,
userName: '',
password: '',
comfirmPassword: '',
salt: '',
email: '',
mobile: '',
roleIdList: [4],
helpCampusId: [],
status: 1,
isChannel:1,
qdRate:'',
qdCode:'',
money:0,
},
dataRule: {
userName: [{
required: true,
message: '用户名不能为空',
trigger: 'blur'
}],
password: [{
validator: validatePassword,
trigger: 'blur'
}],
comfirmPassword: [{
validator: validateComfirmPassword,
trigger: 'blur'
}],
email: [{
required: true,
message: '邮箱不能为空',
trigger: 'blur'
},
{
validator: validateEmail,
trigger: 'blur'
}
],
mobile: [{
required: true,
message: '手机号不能为空',
trigger: 'blur'
},
{
validator: validateMobile,
trigger: 'blur'
}
],
qdRate: [{
required: true,
message: '渠道佣金不能为空',
trigger: 'blur'
},
],
qdCode: [{
required: true,
message: '渠道码不能为空',
trigger: 'blur'
},
],
},
show:false,
loading: false,
list: [],
}
},
methods: {
init(id) {
this.dataForm.id = id || 0
this.$http({
url: this.$http.adornUrl('/sys/role/select'),
method: 'get',
params: this.$http.adornParams()
}).then(({
data
}) => {
this.roleList = data && data.code === 0 ? data.list : []
}).then(() => {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
}).then(() => {
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`sys/user/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataForm.userName = data.user.username
this.dataForm.salt = data.user.salt
this.dataForm.email = data.user.email
this.dataForm.mobile = data.user.mobile
// this.dataForm.roleIdList = this.roleIdList
this.dataForm.qdCode = data.user.qdCode
this.dataForm.status = data.user.status
this.dataForm.qdRate = data.user.qdRate
this.dataForm.money = data.user.money
var shows = 1
// for(var i in data.user.roleIdList){
// if(data.user.roleIdList[i]===10){
// shows = 2
// }
// }
if(shows==2){
this.show = true
}
if(shows==1){
this.show = false
}
}
})
}else{
this.dataForm.userName = ''
this.dataForm.salt = ''
this.dataForm.email = ''
this.dataForm.mobile = ''
// this.dataForm.roleIdList = this.roleIdList
this.dataForm.qdCode = ''
this.dataForm.status = 1
this.dataForm.qdRate = ''
this.dataForm.money = 0
}
})
},
// 获取小区数据列表
homeSelect(id) {
this.$http({
url: this.$http.adornUrl('helpCampus/selectCampusList'),
method: 'get',
params: this.$http.adornParams({
'isOpen':1
})
}).then(({
data
}) => {
let returnData = data.data;
this.manageList = returnData
this.list = this.manageList
})
},
changes(val){
var shows = 1
for(var i in val){
if(val[i]===10){
shows = 2
}
}
if(shows==2){
this.show = true
}
if(shows==1){
this.show = false
}
},
changesC(val){
console.log(val)
},
// 表单提交
dataFormSubmit() {
console.log('this.dataForm.roleIdList',this.dataForm.roleIdList)
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// if (this.dataForm.roleIdList.length < 1) {
// this.$message({
// message: '请选择角色',
// type: 'error',
// duration: 1500,
// })
// // } else if (this.dataForm.helpCampusId.length < 1) {
// // this.$message({
// // message: '请选择管理小区',
// // type: 'error',
// // duration: 1500,
// // })
// } else {
this.$http({
url: this.$http.adornUrl(
`/sys/user/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'userId': this.dataForm.id || undefined,
'username': this.dataForm.userName,
'password': this.dataForm.password,
'salt': this.dataForm.salt,
'email': this.dataForm.email,
'mobile': this.dataForm.mobile,
'status': this.dataForm.status,
'roleIdList': this.dataForm.roleIdList,
'qdCode': this.dataForm.qdCode,
'isChannel':this.dataForm.isChannel,
'qdRate':this.dataForm.qdRate,
'money':this.dataForm.money,
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
// }
}
})
},
remoteMethod(query) {
console.log('query',query)
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.manageList = this.list.filter(item => {
return item.campusName.toLowerCase()
.indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.manageList = this.list
}
}
}
}
</script>

View File

@@ -0,0 +1,351 @@
<template>
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
label-width="80px">
<el-form-item label="用户名" prop="userName">
<el-input v-model="dataForm.userName" placeholder="登录帐号"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password" :class="{ 'is-required': !dataForm.id }">
<el-input v-model="dataForm.password" type="password" placeholder="密码"></el-input>
</el-form-item>
<el-form-item label="确认密码" prop="comfirmPassword" :class="{ 'is-required': !dataForm.id }">
<el-input v-model="dataForm.comfirmPassword" type="password" placeholder="确认密码"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="dataForm.email" placeholder="邮箱"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="手机号"></el-input>
</el-form-item>
<!-- <el-form-item label="角色" size="mini" prop="roleIdList">
<el-checkbox-group v-model="dataForm.roleIdList" @change="changes">
<el-checkbox v-for="role in roleList" :key="role.roleId" :label="role.roleId">{{ role.roleName }}
</el-checkbox>
</el-checkbox-group>
</el-form-item> -->
<!-- <el-form-item label="渠道码" prop="qdCode"> -->
<!-- <el-checkbox-group v-model="dataForm.helpCampusId" @change="changesC">
<el-checkbox v-for="role in manageList" :key="role.campusId" :label="role.campusId">
{{ role.campusName }}</el-checkbox>
</el-checkbox-group> -->
<!-- <el-radio-group v-model="dataForm.helpCampusId">
<el-radio v-for="role in manageList" :key="role.campusId" :label="role.campusId">{{ role.campusName }}</el-radio>
</el-radio-group> -->
<!-- <el-select v-model="dataForm.helpCampusId" filterable remote :remote-method="remoteMethod" :loading="loading"
style="width:200px;margin-left: 10px;">
<el-option v-for="item in manageList" :key="item.campusId" :label="item.campusName"
:value="item.campusId">
</el-option>
</el-select> -->
<!-- <el-input v-model="dataForm.qdCode" placeholder="渠道码"></el-input>
</el-form-item>
<el-form-item label="渠道佣金" prop="qdRate">
<el-input v-model="dataForm.qdRate" placeholder="渠道佣金比例,例如0.1"></el-input>
</el-form-item> -->
<!-- <el-form-item label="钱包" prop=" money">
<el-input v-model="dataForm.money" disabled placeholder="钱包"></el-input>
</el-form-item> -->
<el-form-item label="状态" size="mini" prop="status">
<el-radio-group v-model="dataForm.status">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import {
isEmail,
isMobile
} from '@/utils/validate'
export default {
data() {
var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error('密码不能为空'))
} else {
callback()
}
}
var validateComfirmPassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) {
callback(new Error('确认密码不能为空'))
} else if (this.dataForm.password !== value) {
callback(new Error('确认密码与密码输入不一致'))
} else {
callback()
}
}
var validateEmail = (rule, value, callback) => {
if (!isEmail(value)) {
callback(new Error('邮箱格式错误'))
} else {
callback()
}
}
var validateMobile = (rule, value, callback) => {
if (!isMobile(value)) {
callback(new Error('手机号格式错误'))
} else {
callback()
}
}
return {
visible: false,
roleList: [],
manageList: [10],
dataForm: {
id: 0,
userName: '',
password: '',
comfirmPassword: '',
salt: '',
email: '',
mobile: '',
roleIdList: [4],
helpCampusId: [],
status: 1,
isChannel:1,
qdRate:'',
qdCode:'',
sysUserId:'',
money:0,
},
dataRule: {
userName: [{
required: true,
message: '用户名不能为空',
trigger: 'blur'
}],
password: [{
validator: validatePassword,
trigger: 'blur'
}],
comfirmPassword: [{
validator: validateComfirmPassword,
trigger: 'blur'
}],
email: [{
required: true,
message: '邮箱不能为空',
trigger: 'blur'
},
{
validator: validateEmail,
trigger: 'blur'
}
],
mobile: [{
required: true,
message: '手机号不能为空',
trigger: 'blur'
},
{
validator: validateMobile,
trigger: 'blur'
}
],
qdRate: [{
required: true,
message: '渠道佣金不能为空',
trigger: 'blur'
},
],
qdCode: [{
required: true,
message: '渠道码不能为空',
trigger: 'blur'
},
],
},
show:false,
loading: false,
list: [],
}
},
methods: {
init(id,sysUserId,qdCode,qdRate) {
this.dataForm.id = id || 0
this.dataForm.sysUserId = sysUserId
this.dataForm.qdCode = qdCode
this.dataForm.qdRate = qdRate
this.$http({
url: this.$http.adornUrl('/sys/role/select'),
method: 'get',
params: this.$http.adornParams()
}).then(({
data
}) => {
this.roleList = data && data.code === 0 ? data.list : []
}).then(() => {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
})
}).then(() => {
if (this.dataForm.id!=0) {
this.$http({
url: this.$http.adornUrl(`sys/user/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dataForm.userName = data.user.username
this.dataForm.salt = data.user.salt
this.dataForm.email = data.user.email
this.dataForm.mobile = data.user.mobile
// this.dataForm.roleIdList = this.roleIdList
this.dataForm.qdCode = data.user.qdCode
this.dataForm.status = data.user.status
this.dataForm.qdRate = data.user.qdRate
this.dataForm.money = data.user.money
this.dataForm.sysUserId = data.user.sysUserId
var shows = 1
// for(var i in data.user.roleIdList){
// if(data.user.roleIdList[i]===10){
// shows = 2
// }
// }
if(shows==2){
this.show = true
}
if(shows==1){
this.show = false
}
}
})
}else{
this.dataForm.userName = ''
this.dataForm.salt = ''
this.dataForm.email = ''
this.dataForm.mobile = ''
// this.dataForm.roleIdList = this.roleIdList
// this.dataForm.qdCode = ''
this.dataForm.status = 1
this.dataForm.qdRate = qdRate
this.dataForm.sysUserId = sysUserId
this.dataForm.qdCode = qdCode
this.dataForm.money = 0
}
})
},
// 获取小区数据列表
homeSelect(id) {
this.$http({
url: this.$http.adornUrl('helpCampus/selectCampusList'),
method: 'get',
params: this.$http.adornParams({
'isOpen':1
})
}).then(({
data
}) => {
let returnData = data.data;
this.manageList = returnData
this.list = this.manageList
})
},
changes(val){
var shows = 1
for(var i in val){
if(val[i]===10){
shows = 2
}
}
if(shows==2){
this.show = true
}
if(shows==1){
this.show = false
}
},
changesC(val){
console.log(val)
},
// 表单提交
dataFormSubmit() {
console.log('this.dataForm.roleIdList',this.dataForm.roleIdList)
this.$refs['dataForm'].validate((valid) => {
if (valid) {
// if (this.dataForm.roleIdList.length < 1) {
// this.$message({
// message: '请选择角色',
// type: 'error',
// duration: 1500,
// })
// // } else if (this.dataForm.helpCampusId.length < 1) {
// // this.$message({
// // message: '请选择管理小区',
// // type: 'error',
// // duration: 1500,
// // })
// } else {
this.$http({
url: this.$http.adornUrl(
`/sys/user/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'userId': this.dataForm.id || undefined,
'username': this.dataForm.userName,
'password': this.dataForm.password,
'salt': this.dataForm.salt,
'email': this.dataForm.email,
'mobile': this.dataForm.mobile,
'status': this.dataForm.status,
'roleIdList': this.dataForm.roleIdList,
'qdCode': this.dataForm.qdCode,
'isChannel':this.dataForm.isChannel,
'qdRate':this.dataForm.qdRate,
'money':this.dataForm.money,
'sysUserId':this.dataForm.sysUserId,
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
// }
}
})
},
remoteMethod(query) {
console.log('query',query)
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.manageList = this.list.filter(item => {
return item.campusName.toLowerCase()
.indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.manageList = this.list
}
}
}
}
</script>

View File

@@ -0,0 +1,193 @@
<template>
<div class="mod-user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.userName" placeholder="用户名" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">查询</el-button>
<el-button v-if="isAuth('sys:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="isAuth('sys:user:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
border
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
width="50">
</el-table-column>
<el-table-column
prop="userId"
header-align="center"
align="center"
width="80"
label="ID">
</el-table-column>
<el-table-column
prop="username"
header-align="center"
align="center"
label="用户名">
</el-table-column>
<el-table-column
prop="email"
header-align="center"
align="center"
label="邮箱">
</el-table-column>
<el-table-column
prop="mobile"
header-align="center"
align="center"
label="手机号">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="状态">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">禁用</el-tag>
<el-tag v-else size="small">正常</el-tag>
</template>
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
width="180"
label="创建时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button :disabled="!isAuth('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.userId)">修改</el-button>
<el-button :disabled="!isAuth('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.userId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template>
<script>
import AddOrUpdate from './user-add-or-update'
export default {
data () {
return {
dataForm: {
userName: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
addOrUpdateVisible: false
}
},
components: {
AddOrUpdate
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('sys/user/list'),
method: 'get',
params: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'username': this.dataForm.userName
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除
deleteHandle (id) {
var userIds = id ? [id] : this.dataListSelections.map(item => {
return item.userId
})
this.$confirm(`确定对[id=${userIds.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/user/delete'),
method: 'post',
data: this.$http.adornData(userIds, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}
}
}
</script>

View File

@@ -0,0 +1,370 @@
<template>
<el-tabs v-model = "activeName" @tab-click = "handleClick">
<el-tab-pane label = "订单列表" name = "first">
<div style = "margin-right:2%;">
<span>状态</span>
<el-select v-model="status" style="width:150px;margin-left: 10px;" @change="animeDat(status)">
<el-option v-for="item in statesnum" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
<div style="position: relative;display: inline-block;">
<span>订单编号</span>
<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入订单编号"
v-model="ordersNo"></el-input>&nbsp;&nbsp;
</div>
<span>订单类型</span>
<el-select v-model="ordersType" style="width:150px;margin-left: 10px;" @change="animeDat()">
<el-option v-for="item in ordersTypenum" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
<div style="position: relative;display: inline-block;">
<span>购买用户昵称</span>
<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入购买用户昵称"
v-model="userName"></el-input>&nbsp;&nbsp;
</div>
<div style="position: relative;display: inline-block;">
<span>渠道码</span>
<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入渠道码"
v-model="qdCode"></el-input>&nbsp;&nbsp;
</div>
<div style="position: relative;display: inline-block;">
<span>渠道商名称</span>
<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入渠道商名称"
v-model="sysUserName"></el-input>&nbsp;&nbsp;
</div>
<div style="margin:5px;display: inline-block;">
<span>开始时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="startTime" align="right"
type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间">
</el-date-picker>
</div>
<div style="margin:5px;display: inline-block;">
<span>截止时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="endTime" align="right" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择截止时间">
</el-date-picker>
</div>
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">查询
</el-button>
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
</div>
<el-table v-loading = "tableDataLoading" :data = "tableData.list" >
<el-table-column fixed prop = "ordersId" label = "编号" width = "80"></el-table-column>
<el-table-column prop = "ordersNo" label = "订单编号" width = "180"></el-table-column>
<el-table-column prop = "userName" label = "购买用户昵称" width = "120" align="center">
<template slot-scope = "scope">
<span style = "color: #4f9dec;cursor: pointer;" @click = "updates(scope.row)">
{{ scope.row.userName}}
</span>
</template>
</el-table-column>
<el-table-column prop = "title" label = "购买短剧/会员等级" width = "180" align="center">
<template slot-scope = "scope">
<span v-if = "scope.row.ordersType == 1">{{scope.row.title}}</span>
<span v-if = "scope.row.ordersType == 2 && scope.row.vipNameType==0">月卡</span>
<span v-if = "scope.row.ordersType == 2 && scope.row.vipNameType==1">季卡</span>
<span v-if = "scope.row.ordersType == 2 && scope.row.vipNameType==2">年卡</span>
</template>
</el-table-column>
<el-table-column prop = "qdCode" label = "渠道码"></el-table-column>
<el-table-column prop = "sysUserName" label = "渠道商名称" width = "180">
<template slot-scope = "scope">
<span style = "color: #4f9dec;">{{ scope.row.sysUserName}}</span>
</template>
</el-table-column>
<el-table-column prop = "payWay" label = "订单类型" width = "120">
<template slot-scope = "scope">
<span v-if = "scope.row.ordersType == 1">短剧</span>
<span v-if = "scope.row.ordersType == 2">会员</span>
</template>
</el-table-column>
<el-table-column prop = "payWay" label = "支付方式" width = "120">
<template slot-scope = "scope">
<span v-if = "scope.row.payWay == null">暂无</span>
<span v-if = "scope.row.payWay == 1">微信APP</span>
<span v-if = "scope.row.payWay == 2">微信公众号</span>
<span v-if = "scope.row.payWay == 3">微信小程序</span>
<span v-if = "scope.row.payWay == 4">支付宝</span>
<span v-if = "scope.row.payWay == 5">会员免费</span>
<span v-if = "scope.row.payWay == 6">金豆</span>
<span v-if = "scope.row.payWay == 7">抖音</span>
<span v-if = "scope.row.payWay == 8">快手</span>
</template>
</el-table-column>
<el-table-column prop="payDiamond" label="钻石价格" width="100">
</el-table-column>
<el-table-column prop="diamond" label="是否是钻石支付" width="100">
<template slot-scope="scope">
<span v-if="scope.row.diamond == 1"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column prop = "payMoney" label = "支付金额" width = "120"></el-table-column>
<el-table-column prop = "qdMoney" label = "渠道佣金">
<template slot-scope = "scope">
<span >{{ scope.row.qdMoney?scope.row.qdMoney:0}}</span>
</template>
</el-table-column>
<el-table-column prop = "status" label = "状态" width="80" fixed="right">
<template slot-scope = "scope">
<span v-if = "scope.row.status == null">待支付</span>
<span v-if = "scope.row.status == 0">待支付</span>
<span v-if = "scope.row.status == 1">已支付</span>
<span v-if = "scope.row.status == 2">已退款</span>
</template>
</el-table-column>
<!-- <el-table-column prop = "refundContent" label = "退款原因" ></el-table-column> -->
<el-table-column prop = "createTime" label = "创建时间" width = "200" ></el-table-column>
<el-table-column label = "操作" width = "80" align="center" fixed="right">
<template slot-scope = "scope">
<el-button style="margin:5px;" size="mini" type="warning" icon="document" :disabled="!isAuth('orderCenter:tuikuan')" @click="tuikuanBtn(scope.row)" v-if="scope.row.status==1&&scope.row.payWay != 5">退款
</el-button>
<el-button size = "mini" type = "danger" :disabled = "!isAuth('orderCenter:delete')" style="margin:5px;"
@click = "deletes(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div style="color: #B94A48;font-size: 20px;margin-top: 10px;display: inline-block;">
本页累计收入统计{{totalMoney.toFixed(2)}} </div>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[10, 20, 30, 40, 100, 200, 500]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
</el-tabs>
</template>
<script>
export default {
data () {
return {
page: 1,
limit: 10,
classify: 1,
ordersNo: '',
imageUrl: '',
url: '',
status: '',
activeName: 'first',
tableDataLoading: true,
tableData: [],
checkBoxData: [],//多选框选择的值
statesnum:[
{
label: '全部',
value: ''
},
{
label: '待支付',
value: 0
},
{
label: '已支付',
value: 1
},
{
label: '已退款',
value: 2
},
],
totalMoney: 0,
ordersTypenum: [{
label: '全部',
value: ''
},
{
label: '短剧',
value: 1
},
{
label: '会员',
value: 2
},
],
ordersType: '',
userName: '',
startTime: '',
endTime: '',
qdCode:'',
sysUserName:'',
}
},
methods: {
// 多选
changeFun (val) {
this.checkBoxData = val
},
//处理默认选中当前日期
// getNowTime () {
// var now = new Date()
// var year = now.getFullYear() //得到年份
// var month = now.getMonth() //得到月份
// var date = now.getDate() //得到日期
// var hh = now.getHours() < 10 ? '0' + now.getHours() : now.getHours()
// var mm = now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes()
// var ss = now.getSeconds() < 10 ? '0' + now.getSeconds() : now.getSeconds()
// month = month + 1
// month = month.toString().padStart(2, '0')
// date = date.toString().padStart(2, '0')
// var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`
// return defaultDate
// this.$set(this.info, 'stockDate', defaultDate)
// },
// tabs切换
handleClick (tab, event) {
if (tab._props.label == '订单列表') {
this.page = 1
this.limit = 10
this.classify = 1
this.dataSelect()
}
},
handleSizeChange (val) {
this.limit = val
this.dataSelect()
},
handleCurrentChange (val) {
this.page = val
this.dataSelect()
},
// 查询短剧列表
select() {
this.page = 1
this.limit = 10
this.dataSelect()
},
// 重置短剧列表
cleans() {
this.ordersNo = ''
this.status = ''
this.page = 1
this.ordersType = ''
this.userName = ''
this.startTime = ''
this.endTime = ''
this.qdCode = ''
this.sysUserName = ''
this.dataSelect()
},
// select选择事件
animeDat(state) {
this.page = 1
this.status = state
console.log(state)
this.dataSelect()
},
// 删除banner图
deletes (row) {
let delid = row.ordersId
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`order/deleteOrders?ids=${delid}`),
method: 'get',
data: this.$http.adornData({})
}).then(({data}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
}).catch(() => {
})
},
// 获取数据列表
dataSelect () {
this.tableDataLoading = true
this.totalMoney = 0
this.$http({
url: this.$http.adornUrl('order/selectOrders'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'ordersNo':this.ordersNo,
'status':this.status,
'ordersType': this.ordersType,
'userName': this.userName,
'startTime': this.startTime,
'endTime': this.endTime,
'qdCode': this.qdCode,
'sysUserName': this.sysUserName,
})
}).then(({data}) => {
if (data && data.code === 0) {
this.tableDataLoading = false
for (var i in data.data.list) {
if (data.data.list[i].payMoney) {
this.totalMoney = this.totalMoney + Number(data.data.list[i].payMoney)
}
}
let returnData = data.data
this.tableData = returnData
}
})
},
// 详情跳转
updates (row) {
this.$router.push({path: '/userDetail', query: {userId: row.userId}})
},
// 退款
tuikuanBtn(row){
let delid = row.ordersId
this.$confirm(`确定退款吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('order/refundOrders?ordersId='+delid),
method: 'post',
params: this.$http.adornParams({})
}).then(({
data
}) => {
if(data.code==0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
})
},
},
mounted () {
this.dataSelect()
}
}
</script>
<style>
.customWidth {
width: 80% !important;
}
</style>

View File

@@ -0,0 +1,668 @@
<template>
<div>
<div style="display: inline-block;">
<!-- <span>地区</span>
<el-select v-model="indentState" style="width:150px;margin-left: 10px;" @change="select(indentState)">
<el-option v-for="item in statesnum" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp; -->
<div style="position: relative;display: inline-block;">
<span>昵称</span>
<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入昵称" v-model="address">
</el-input>&nbsp;&nbsp;
</div>
<div style="position: relative;display: inline-block;">
<span>电话</span>
<el-input style="width: 200px;" @keydown.enter.native="select" placeholder="请输入电话" v-model="phone">
</el-input>&nbsp;&nbsp;
</div>
<!-- <div style="display: inline-block;">
<span>时间类型</span>
<el-select v-model="flag" style="width:150px;margin-left: 10px;" @change="orderfenxi">
<el-option v-for="item in flags" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;
<el-date-picker style="width: 300px;margin-left: 10px;" v-model="info.stockDate" align="right"
type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间"
@change="animeOrder">
</el-date-picker>
</div> -->
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select">查询
</el-button>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="homeData.records">
<el-table-column fixed prop="userId" label="排名" width="80">
<!-- <template slot-scope="scope">
<div>{{scope.$index+1}}</div>
</template> -->
</el-table-column>
<el-table-column prop="userName" label="昵称" width="120">
<template slot-scope="scope">
<div style="color: #4f9dec;cursor: pointer;" @click="updatesvideo(scope.row)">{{scope.row.userName?scope.row.userName:'未绑定'}}
</div>
</template>
</el-table-column>
<el-table-column prop="phone" label="电话" >
</el-table-column>
<el-table-column prop="money" label="收益" >
</el-table-column>
<el-table-column prop="counts" label="邀请人数">
</el-table-column>
<!-- <el-table-column prop="createTime" label="创建时间" width="160">
</el-table-column> -->
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
:page-sizes="[10, 20, 30, 40]" :page-size="size" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="homeData.total">
</el-pagination>
</div>
</div>
</template>
<script>
import {
quillEditor
} from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import quillConfig from '../locality/quill-config.js'
import axios from 'axios';
import {
jsonp
} from 'vue-jsonp'
import {
provinceAndCityData,
regionData,
provinceAndCityDataPlus,
regionDataPlus,
CodeToText,
TextToCode
} from 'element-china-area-data'
var cityOptions = []
var geocoder, map, markersArray = [];
export default {
components: {
quillEditor
},
data() {
return {
size: 10,
page: 1,
state: '',
limit: 10,
classify: 6,
classifys: 6,
title: '',
type: '',
nav: '',
name: '',
keyword: '',
describes: '',
checkBoxData: [], //多选框选择的值
method: 'false',
formLabelWidth: '200px',
activeName: 'first',
tableDataLoading: true,
tableDataLoading4: false,
dialogFormVisible3: false,
dialogFormVisible1: false,
dialogFormVisible2: false,
dialogFormVisible5: false,
dialogFormVisible6: false,
dialogFormVisible7: false,
dialogFormVisible8: false,
dialogFormVisible9: false,
homeData: {},
homeData1: [{
title: '帮我送',
id: 1
},
{
title: '帮我取',
id: 2
},
],
choicenData2: [],
choicenData: [],
url: '',
imageUrl: '',
imageUrl2: '',
id: '',
bannerData: [],
form1: {
// id: '',
// url: '',
// imageUrl: ''
},
formcomp: {
id: '',
state: '',
title: '',
url: '',
imageUrl: ''
},
userId: '',
search: '',
myPhone: '',
classifyIds: 0,
statusId: 1,
homeData2: [],
quillOption: quillConfig,
statusIdd: 1,
statesnum: [{
value: 0,
label: '全部'
},
{
value: 1,
label: '待支付'
}, {
value: 2,
label: '待接单'
}, {
value: 3,
label: '已接单'
}, {
value: 4,
label: '已完成'
}, {
value: 5,
label: '已取消'
}
],
// x新的
indentType: 3,
deliveryUserPhone: '', //收货人手机号
indentState: 0, //任务状态
flag: '',
info: {
stockDate: this.getNowTime(), //日期
},
flags: [{
value: 'day',
label: '按天查询'
}, {
value: 'month',
label: '按月查询'
}, {
value: 'year',
label: '按年查询'
}],
address:'',
phone:'',
}
},
methods: {
//处理默认选中当前日期
getNowTime() {
var now = new Date()
var year = now.getFullYear() //得到年份
var month = now.getMonth() //得到月份
var date = now.getDate() //得到日期
var hh = now.getHours() < 10 ? '0' + now.getHours() : now.getHours()
var mm = now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes()
var ss = now.getSeconds() < 10 ? '0' + now.getSeconds() : now.getSeconds()
month = month + 1
month = month.toString().padStart(2, '0')
date = date.toString().padStart(2, '0')
var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`
return defaultDate
this.$set(this.info, 'stockDate', defaultDate)
},
handleSizeChange1(val) {
this.limit = val
this.homeSelect()
},
handleCurrentChange1(val) {
this.page = val
this.homeSelect()
},
handleClick(tab, event) {
this.page = 1
this.indentState = 0
this.phone = ''
if (tab._props.label == '同城帮买') {
this.indentType = 3
this.homeSelect()
}
if (tab._props.label == '同城服务') {
this.type = 1
this.indentType = 4
this.homeSelect()
}
if (tab._props.label == '送取任务') {
this.indentType = 1
this.homeSelect()
}
},
// 获取社区数据列表
homeSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('user/selectInviteUserList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'userName': this.address,
'phone': this.phone,
// 'date': this.info.stockDate,
// 'dateType': this.flag,
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data
this.homeData = data.data
})
},
// 信息数据
InformationSelect() {
this.userId = this.$store.state.user.id
this.$http({
url: this.$http.adornUrl(`information/selectInformationList`),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'search': this.search,
'classify': this.classifyIds,
'status': this.statusId,
'phone': this.myPhone,
'campus': this.campus1
})
}).then(({
data
}) => {
this.tableDataLoading = false
for (var i in data.data.records) {
if (data.data.records[i].img) {
data.data.records[i].imgs = data.data.records[i].img.split(',')
}
}
let returnData = data.data
this.choicenData = returnData
})
},
// 审核
shenhe(row) {
this.shenheId = row.id
this.dialogFormVisible8 = true
},
// 提交审核
refuseto(row) {
if (this.radio == 2 && this.contents == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入驳回理由',
type: 'warning'
})
return
} else {
let ids = this.shenheId
let status = this.radio
let content = this.contents
this.$http({
url: this.$http.adornUrl(
`information/auditInformation?ids=${ids}&status=${status}&content=${content}`),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
this.dialogFormVisible8 = false
this.$message({
message: '审核完成',
type: 'success',
duration: 1500,
onClose: () => {
this.radio = 1
this.contents = ''
this.InformationSelect()
}
})
})
}
},
// 修改信息弹框
choiCompile(index, row) {
console.log(index, row)
},
// 删除信息
choidelete(row) {
let delid = row.id
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`information/deleteInformationById?ids=${delid}`),
method: 'post',
params: this.$http.adornData({})
}).then(({
data
}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.InformationSelect()
}
})
})
}).catch(() => {})
},
// 筛选信息
animeDat2(classifyIds) {
this.classifyIds = classifyIds
this.homeSelect()
},
animeDat3(state) {
this.InformationSelect()
},
// 多选
handleSelectionChange(val) {
var arr = []
for (var i in val) {
arr.push(val[i].id)
}
this.multipleSelection = arr;
console.log('val', val, this.multipleSelection)
},
// 批量删除
choideletes() {
console.log(this.multipleSelection)
let delid = this.multipleSelection.toString()
this.$confirm(`确定删除信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`information/deleteInformationById?ids=${delid}`),
method: 'post',
params: this.$http.adornData({})
}).then(({
data
}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.InformationSelect()
}
})
})
}).catch(() => {})
},
// 获取社区数据列表
homeSelect1() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('helpCampus/selectCampusList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'content': this.content
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data;
this.homeData2 = returnData
})
},
// 分类是否启用
change2(val, row) {
this.$http({
url: this.$http.adornUrl(`activity/updateActivityStatus?id=${row.id}`),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.homeSelect()
}
})
})
},
// 任务上下架
change3(val, row) {
this.$http({
url: this.$http.adornUrl(`information/updateInformationStatus?id=${row.id}`),
method: 'post',
data: this.$http.adornData({})
}).then(({
data
}) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.homeSelect()
}
})
})
},
// 详情跳转
updatesvideo(row) {
if(row.userId){
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
})
}else{
this.$notify({
title: '提示',
duration: 1800,
message: '未绑定用户',
type: 'warning'
})
return
}
},
// 查询
select() {
this.page = 1
this.limit = 10
this.homeSelect()
},
// 重置
cleans() {
this.indentState = 0
this.address = ''
this.phone = ''
this.homeSelect()
},
// 订单分析选择日期
animeOrder() {
console.log('info', this.info)
this.homeSelect()
// this.colonel()
},
// 订单分析年月日
orderfenxi(value) {
this.page = 1
let vanumber = value
// if (vanumber === 1) {
this.flag = value
this.homeSelect()
// this.colonel()
// }
// if (vanumber === 2) {
// this.flag = 2
// this.taskData()
// this.colonel()
// }
// if (vanumber === 3) {
// this.flag = 3
// this.taskData()
// this.colonel()
// }
},
},
mounted() {
this.homeSelect()
}
}
</script>
<style>
.customWidth {
width: 80% !important;
}
.adver_main.box {
display: block;
max-width: 100%;
text-align: center;
border: 1px dotted rgba(67, 79, 103, .4);
}
.cards {
padding: 0 8px;
margin-bottom: 15px;
}
.adver_main.box a {
display: flex;
justify-content: center;
height: 150px;
line-height: 150px;
text-decoration: none
}
.bannerManin {
border: 1px solid #e8e8e8;
font-size: 14px;
padding: 0 24px;
display: flex;
justify-content: center;
align-items: center;
height: 113px;
color: rgba(0, 0, 0, .65);
}
.bannerManin span {
display: inline-block;
margin-left: 5px;
}
.bannerManin img {
width: 48px;
height: 48px;
border-radius: 50%;
}
.bannerbtn {
display: flex;
border-top: none !important;
border: 1px solid #e8e8e8;
padding: 11px;
font-size: 14px;
color: #3E8EF7;
}
.bannerbtn a {
flex: 1;
text-align: center;
color: #3E8EF7 !important;
text-decoration: none;
}
.imgs {
position: relative;
border-radius: 6px;
width: 148px;
height: 148px;
margin-right: 10px;
display: inline-block;
}
.dels {
position: absolute;
top: 0;
left: 0;
display: none;
}
.dels .el-icon-delete {
line-height: 148px;
padding-left: 58px;
font-size: 25px;
color: #fff;
}
.imgs:hover .dels {
width: 100%;
height: 100%;
background: #000;
display: block;
opacity: 0.5;
}
.bqList {
padding: 4px 14px;
margin: 4px;
border: 1px solid #efefef;
font-size: 12px;
color: #999;
border-radius: 4px;
margin-right: 15px;
}
.delss {
display: none;
position: relative;
}
.delss .el-icon-delete {
position: absolute;
top: 0;
}
.bqList:hover .delss {
display: initial;
opacity: 0.5;
}
.tj {
padding: 6px !important;
margin: 4px;
font-size: 12px;
border: 1px solid #ccc;
border-radius: 4px;
}
</style>

355
src/views/riderTop/top.vue Normal file
View File

@@ -0,0 +1,355 @@
<template>
<div>
<!-- <el-tabs v-model="activeName" @tab-click="handleClick"> -->
<!-- <div style="display: inline-block;" v-if="type != 8">
<div style="display: inline-block;">
<span>时间类型</span>
<el-select v-model="flag" style="width:150px;margin-left: 10px;" @change="orderfenxi">
<el-option v-for="item in flags" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;
<el-date-picker style="width: 300px;margin-left: 10px;" v-model="info.stockDate" align="right"
type="datetime" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间"
@change="animeOrder">
</el-date-picker>
</div>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="select">查询
</el-button>
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
</div> -->
<!-- <el-tab-pane label="团长收益排行榜" name="first"> -->
<div style="text-align: right;">
<el-button style='margin-left:15px;' size="mini" type="primary" icon="document" @click="cleans">刷新
</el-button>
</div>
<el-table v-loading="tableDataLoading" :data="homeData.records">
<el-table-column fixed prop="user_id" label="编号" width="80">
</el-table-column>
<el-table-column prop="nick_name" label="代理商昵称">
<template slot-scope="scope">
<div style="color: #4f9dec;cursor: pointer;" @click="updatesvideo(scope.row)">
{{scope.row.nick_name?scope.row.nick_name:'未绑定'}}
</div>
</template>
</el-table-column>
<el-table-column prop="nickName" label="头像">
<template slot-scope="scope">
<div style="color: #4f9dec;cursor: pointer;" v-if="scope.row.avatar">
<img :src="scope.row.avatar" width="40" height="40" />
</div>
<div v-else>暂无头像</div>
</template>
</el-table-column>
<el-table-column prop="money" label="总收益">
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange1" @current-change="handleCurrentChange1"
:page-sizes="[10, 20, 30, 40]" :page-size="size" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="homeData.total">
</el-pagination>
</div>
<!-- </el-tab-pane>
</el-tabs> -->
</div>
</template>
<script>
export default {
data() {
return {
size: 10,
page: 1,
state: '',
limit: 10,
title: '',
type: 1,
activeName: 'first',
tableDataLoading: true,
homeData: {},
flag: 1,
info: {
stockDate: this.getNowTime(), //日期
},
flags: [{
value: 1,
label: '按天查询'
}, {
value: 2,
label: '按月查询'
}, {
value: 3,
label: '按年查询'
}],
}
},
methods: {
//处理默认选中当前日期
getNowTime() {
var now = new Date()
var year = now.getFullYear() //得到年份
var month = now.getMonth() //得到月份
var date = now.getDate() //得到日期
var hh = now.getHours() < 10 ? '0' + now.getHours() : now.getHours()
var mm = now.getMinutes() < 10 ? '0' + now.getMinutes() : now.getMinutes()
var ss = now.getSeconds() < 10 ? '0' + now.getSeconds() : now.getSeconds()
month = month + 1
month = month.toString().padStart(2, '0')
date = date.toString().padStart(2, '0')
var defaultDate = `${year}-${month}-${date} ${hh}:${mm}:${ss}`
return defaultDate
this.$set(this.info, 'stockDate', defaultDate)
},
handleSizeChange1(val) {
this.limit = val
this.homeSelect()
},
handleCurrentChange1(val) {
this.page = val
this.homeSelect()
},
handleClick(tab, event) {
this.page = 1
if (tab._props.label == '团长收益排行榜') {
this.type = 1
this.homeSelect()
}
if (tab._props.label == '会长收益排行榜') {
this.type = 2
this.homeSelect()
}
if (tab._props.label == '陪玩收益排行榜') {
this.type = 3
this.homeSelect()
}
if (tab._props.label == '打赏排行版') {
this.type = 5
this.homeSelect()
}
if (tab._props.label == '消费排行榜') {
this.type = 6
this.homeSelect()
}
if (tab._props.label == '充值排行榜') {
this.type = 7
this.homeSelect()
}
if (tab._props.label == '钱包排行榜') {
this.type = 8
this.flag = ''
this.info.stockDate = this.getNowTime()
this.homeSelect()
}
if (tab._props.label == '订单排行榜') {
this.type = 9
this.homeSelect()
}
},
// 信息数据
homeSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('invite/getAgentRanking'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
// 'type': this.type,
// 'time': this.info.stockDate,
// 'flag': this.flag,
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data
console.log(data.data.state)
this.homeData = data.data
})
},
// 详情跳转
updatesvideo(row) {
if (row.userId) {
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
})
} else {
this.$notify({
title: '提示',
duration: 1800,
message: '未绑定用户',
type: 'warning'
})
return
}
},
// 查询
select() {
this.page = 1
this.limit = 10
this.homeSelect()
},
// 重置
cleans() {
this.address = ''
this.flag = ''
this.info.stockDate = this.getNowTime()
this.homeSelect()
},
// 订单分析选择日期
animeOrder() {
console.log('info', this.info)
this.homeSelect()
// this.colonel()
},
// 订单分析年月日
orderfenxi(value) {
this.page = 1
let vanumber = value
this.flag = value
this.homeSelect()
},
},
mounted() {
this.homeSelect()
}
}
</script>
<style>
.customWidth {
width: 80% !important;
}
.adver_main.box {
display: block;
max-width: 100%;
text-align: center;
border: 1px dotted rgba(67, 79, 103, .4);
}
.cards {
padding: 0 8px;
margin-bottom: 15px;
}
.adver_main.box a {
display: flex;
justify-content: center;
height: 150px;
line-height: 150px;
text-decoration: none
}
.bannerManin {
border: 1px solid #e8e8e8;
font-size: 14px;
padding: 0 24px;
display: flex;
justify-content: center;
align-items: center;
height: 113px;
color: rgba(0, 0, 0, .65);
}
.bannerManin span {
display: inline-block;
margin-left: 5px;
}
.bannerManin img {
width: 48px;
height: 48px;
border-radius: 50%;
}
.bannerbtn {
display: flex;
border-top: none !important;
border: 1px solid #e8e8e8;
padding: 11px;
font-size: 14px;
color: #3E8EF7;
}
.bannerbtn a {
flex: 1;
text-align: center;
color: #3E8EF7 !important;
text-decoration: none;
}
.imgs {
position: relative;
border-radius: 6px;
width: 148px;
height: 148px;
margin-right: 10px;
display: inline-block;
}
.dels {
position: absolute;
top: 0;
left: 0;
display: none;
}
.dels .el-icon-delete {
line-height: 148px;
padding-left: 58px;
font-size: 25px;
color: #fff;
}
.imgs:hover .dels {
width: 100%;
height: 100%;
background: #000;
display: block;
opacity: 0.5;
}
.bqList {
padding: 4px 14px;
margin: 4px;
border: 1px solid #efefef;
font-size: 12px;
color: #999;
border-radius: 4px;
margin-right: 15px;
}
.delss {
display: none;
position: relative;
}
.delss .el-icon-delete {
position: absolute;
top: 0;
}
.bqList:hover .delss {
display: initial;
opacity: 0.5;
}
.tj {
padding: 6px !important;
margin: 4px;
font-size: 12px;
border: 1px solid #ccc;
border-radius: 4px;
}
</style>

View File

@@ -0,0 +1,290 @@
<template>
<div class="components-container main-cont">
<div style="position: relative;">
<span>任务标题</span>
<el-input style="width: 200px;" placeholder="请输入任务标题" v-model="title" autosize></el-input>&nbsp;&nbsp;&nbsp;&nbsp;
<span>任务分类</span>
<el-select v-model="classifyId" placeholder="请选择任务分类" style="width:200px;">
<el-option v-for="(item,index) in artiCletypes" :key="item.index" :label="item.classifyName" :value="item.id">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
<span>幸运值</span>
<el-input style="width:200px;" placeholder="请输入幸运值" type="number" v-model="luckyValue" autosize></el-input>&nbsp;&nbsp;
<div style="display: flex;align-items: center;margin: 2% 0;">
<span style="margin-right: 5px;">标题图片</span>
<el-upload
v-model="titlePicture"
:class="{hide:hideUpload}"
:action="$http.adornUrl('alioss/upload')"
:limit=1
:on-success="handleUploadSuccess"
list-type="picture-card"
:on-remove="handleRemove"
:on-change="handleChange"
>
<i class="el-icon-plus"></i>
</el-upload>
</div>
<div style="position: absolute;right:0;top:5px;">
<el-button style='margin:0 0 20px 20px;' size="mini" type="primary" icon="document" @click="artiReleass">发布任务
</el-button>
</div>
</div>
<div class="tinymce-content">
<textarea id="tinymceId" :value="content" class="tinymce-textarea"/>
</div>
</div>
</template>
<script>
import load from './tinymce-components/dynamicLoadScript'
import toolbar from './tinymce-components/toolbar'
import plugins from './tinymce-components/plugins'
const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'
export default {
name: 'Tinymce',
data() {
return {
classifyId: '',
title: '',
luckyValue: '',
titlePicture:'',
isShow: false,
hideUpload: false,
limit:1,
hasChange: false,
hasInit: false,
tinymceId: 'tinymceId',
height: 235,
toolbar: [],
menubar: 'file edit insert view format table',
languageTypeList: {
'en': 'en',
'zh': 'zh_CN'
},
artiCletypes: [],
// 富文本内容
content: ''
}
},
watch: {
content(val) {
if (!this.hasChange && this.hasInit) {
this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || ''))
}
}
},
methods: {
handleChange(file, fileList){
this.hideUpload = fileList.length >= this.limit;
},
handleRemove(file, fileList) {
this.hideUpload = fileList.length >= this.limit;
},
//上传成功
handleUploadSuccess(file,fileList) {
this.titlePicture= file.data
},
// 添加任务
artiReleass(){
if (this.title == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入任务标题',
type: 'warning'
});
return
}
if (this.classifyId == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择任务分类',
type: 'warning'
});
return
}
if (this.luckyValue == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择任务幸运值',
type: 'warning'
});
return
}
if (this.content == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择任务内容',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('helpTaskPlatform/saveHelpTaskPlatform'),
method: 'post',
data: this.$http.adornData({
'title':this.title,
'classifyId':this.classifyId,
'content':this.content,
'luckyValue':this.luckyValue,
'titlePicture':this.titlePicture
})
}).then(({data}) => {
this.dialogFormVisible = false
this.$message({
message: '添加成功',
type: 'success',
duration: 1500,
onClose: () => {
this.$router.push({path: '/missionsye'});
}
})
})
},
init() {
load(tinymceCDN, (err) => {
if (err) {
this.$message.error(err.message)
return
}
this.initTinymce()
})
},
initTinymce() {
const _this = this
window.tinymce.init({
selector: `#${this.tinymceId}`,
images_upload_handler: function (blobInfo, success, failure) {
var xhr, formData;
xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.open('POST', this.$http.adornUrlUp('alioss/upload'));
xhr.onload = function () {
var json;
if (xhr.status != 200) {
failure('HTTP Error: ' + xhr.status);
return;
}
json =JSON.parse(xhr.responseText);
if (json == "" || json == null) {
failure('Invalid JSON: ' + xhr.responseText);
return;
}
success(json.data);
};
formData = new FormData();
formData.append('file', blobInfo.blob(), blobInfo.filename());
xhr.send(formData);
},
language: this.languageTypeList['zh'],
height: this.height,
body_class: 'panel-body ',
object_resizing: false,
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
plugins,
menubar: this.menubar,
end_container_on_empty_block: true,
powerpaste_word_import: 'clean',
code_dialog_height: 450,
code_dialog_width: 1000,
advlist_bullet_styles: 'square',
advlist_number_styles: 'default',
imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
default_link_target: '_blank',
link_title: false,
// Image
imagetools_toolbar: 'rotateleft rotateright | flipv fliph | editimage imageoptions',
nonbreaking_force_tab: true, // inserting nonbreaking space &nbsp; need Nonbreaking Space Plugin
init_instance_callback: editor => {
if (_this.content) {
editor.setContent(_this.content)
}
_this.hasInit = true
editor.on('NodeChange Change KeyUp SetContent', () => {
this.hasChange = true
this.content = editor.getContent()
})
},
setup(editor) {
editor.on('FullscreenStateChanged', (e) => {
_this.fullscreen = e.state
})
}
})
},
destroyTinymce() {
const tinymce = window.tinymce.get(this.tinymceId)
if (this.fullscreen) {
tinymce.execCommand('mceFullScreen')
}
if (tinymce) {
tinymce.destroy()
}
},
// 获取分类
classifySelect () {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('platformClassify/selectClassifyList'),
method: 'get',
params: this.$http.adornParams({
})
}).then(({data}) => {
this.tableDataLoading = false
let returnData = data.data;
this.artiCletypes = returnData
})
},
},
mounted() {
this.init()
this.classifySelect()
},
beforeDestroy() {
this.destroyTinymce()
},
activated() {
if (window.tinymce) {
this.initTinymce()
}
},
deactivated() {
this.destroyTinymce()
}
}
</script>
<style>
.main-cont {
max-width: 100%;
min-width: 80%;
padding-bottom:5%;
background-color: #fff;
}
.tinymce-container {
position: relative;
line-height: normal;
}
.tinymce-container >>> .mce-fullscreen {
z-index: 10000;
}
.tinymce-textarea {
visibility: hidden;
z-index: -1;
}
.hide .el-upload--picture-card {
display: none;
}
</style>

View File

@@ -0,0 +1,315 @@
<template>
<div class="components-container main-cont">
<div style="position: relative;">
<span>任务标题</span>
<el-input style="width: 200px;" v-model="title" autosize></el-input>&nbsp;&nbsp;&nbsp;&nbsp;
<span>任务分类</span>
<el-select v-model="classifyId" placeholder="请选择任务分类" style="width:200px;">
<el-option v-for="(item,index) in artiCletypes" :key="item.index" :label="item.classifyName" :value="item.id">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;&nbsp;
<span>幸运值</span>
<el-input style="width:200px;" type="number" v-model="luckyValue" autosize></el-input>&nbsp;&nbsp;
<div style="display: flex;align-items: center;margin: 2% 0;">
<span style="margin-right: 5px;">标题图片</span>
<el-upload
v-model="titlePicture"
:class="{hide:hideUpload}"
:action="$http.adornUrl('alioss/upload')"
:limit=1
:on-success="handleUploadSuccess"
list-type="picture-card"
:on-remove="handleRemove"
:on-change="handleChange"
>
<img v-if="titlePicture" :src="titlePicture" class="avatar" style="width: 100%;height: 100%;border-radius: 4px;"/>
<i class="el-icon-plus"></i>
</el-upload>
</div>
<div style="position: absolute;right:0;top:5px;">
<el-button style='margin:0 0 20px 20px;' size="mini" type="primary" icon="document" @click="artiReleass">修改任务
</el-button>
</div>
</div>
<div class="tinymce-content">
<textarea id="tinymceId" :value="content" class="tinymce-textarea"/>
</div>
</div>
</template>
<script>
import load from './tinymce-components/dynamicLoadScript'
import toolbar from './tinymce-components/toolbar'
import plugins from './tinymce-components/plugins'
const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js'
export default {
name: 'Tinymce',
data() {
return {
classifyId: '',
title: '',
luckyValue: '',
titlePicture:'',
isShow: false,
hideUpload: false,
limit:1,
userId:'',
id:'',
hasChange: false,
hasInit: false,
tinymceId: 'tinymceId',
height: 235,
toolbar: [],
menubar: 'file edit insert view format table',
languageTypeList: {
'en': 'en',
'zh': 'zh_CN'
},
artiCletypes: [],
// 富文本内容
content: ''
}
},
watch: {
content(val) {
if (!this.hasChange && this.hasInit) {
this.$nextTick(() => window.tinymce.get(this.tinymceId).setContent(val || ''))
}
}
},
methods: {
handleChange(file, fileList){
this.hideUpload = fileList.length >= this.limit;
},
handleRemove(file, fileList) {
this.hideUpload = fileList.length >= this.limit;
},
//上传成功
handleUploadSuccess(file,fileList) {
this.titlePicture= file.data
},
// 修改任务
artiReleass(){
if (this.title == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入任务标题',
type: 'warning'
});
return
}
if (this.classifyId == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择任务分类',
type: 'warning'
});
return
}
if (this.luckyValue == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择任务幸运值',
type: 'warning'
});
return
}
if (this.content == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择任务内容',
type: 'warning'
});
return
}
let id = this.$route.query.id
this.$http({
url: this.$http.adornUrl('helpTaskPlatform/updateHelpTaskPlatform'),
method: 'post',
data: this.$http.adornData({
'id':id,
'title':this.title,
'state':this.state,
'classifyId':this.classifyId,
'content':this.content,
'luckyValue':this.luckyValue,
'titlePicture':this.titlePicture,
'createTime' : this.createTime
})
}).then(({data}) => {
this.dialogFormVisible = false
this.$message({
message: '修改成功',
type: 'success',
duration: 1500,
onClose: () => {
this.$router.push({path: '/missionsye'});
}
})
})
},
init() {
load(tinymceCDN, (err) => {
if (err) {
this.$message.error(err.message)
return
}
this.initTinymce()
})
let id = this.$route.query.id
this.$http({
url: this.$http.adornUrl('helpTaskPlatform/selectHelpTaskPlatformById'),
method: 'get',
params: this.$http.adornParams({
'id':id
})
}).then(({data}) => {
let returnData = data.data;
this.title = returnData.title
this.classifyId = returnData.classifyId
this.title = returnData.title
this.state = returnData.state
this.content = returnData.content
this.titlePicture = returnData.titlePicture
this.luckyValue = returnData.luckyValue
this.createTime = returnData.createTime
})
},
initTinymce() {
const _this = this
window.tinymce.init({
selector: `#${this.tinymceId}`,
images_upload_handler: function (blobInfo, success, failure) {
var xhr, formData;
xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.open('POST', this.$http.adornUrlUp('alioss/upload'));
xhr.onload = function () {
var json;
if (xhr.status != 200) {
failure('HTTP Error: ' + xhr.status);
return;
}
json = xhr.responseText;
if (json == "" || json == null) {
failure('Invalid JSON: ' + xhr.responseText);
return;
}
success(json);
};
formData = new FormData();
formData.append('file', blobInfo.blob(), blobInfo.filename());
xhr.send(formData);
},
language: this.languageTypeList['zh'],
height: this.height,
body_class: 'panel-body ',
object_resizing: false,
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar,
plugins,
menubar: this.menubar,
end_container_on_empty_block: true,
powerpaste_word_import: 'clean',
code_dialog_height: 450,
code_dialog_width: 1000,
advlist_bullet_styles: 'square',
advlist_number_styles: 'default',
imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'],
default_link_target: '_blank',
link_title: false,
// Image
imagetools_toolbar: 'rotateleft rotateright | flipv fliph | editimage imageoptions',
nonbreaking_force_tab: true, // inserting nonbreaking space &nbsp; need Nonbreaking Space Plugin
init_instance_callback: editor => {
if (_this.content) {
editor.setContent(_this.content)
}
_this.hasInit = true
editor.on('NodeChange Change KeyUp SetContent', () => {
this.hasChange = true
this.content = editor.getContent()
})
},
setup(editor) {
editor.on('FullscreenStateChanged', (e) => {
_this.fullscreen = e.state
})
}
})
},
destroyTinymce() {
const tinymce = window.tinymce.get(this.tinymceId)
if (this.fullscreen) {
tinymce.execCommand('mceFullScreen')
}
if (tinymce) {
tinymce.destroy()
}
},
// 获取分类
classifySelect () {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('platformClassify/selectClassifyList'),
method: 'get',
params: this.$http.adornParams({
})
}).then(({data}) => {
this.tableDataLoading = false
let returnData = data.data;
this.artiCletypes = returnData
})
},
},
mounted() {
this.init()
this.classifySelect()
},
beforeDestroy() {
this.destroyTinymce()
},
activated() {
if (window.tinymce) {
this.initTinymce()
}
},
deactivated() {
this.destroyTinymce()
}
}
</script>
<style>
.main-cont {
max-width: 100%;
min-width: 80%;
padding-bottom:5%;
background-color: #fff;
}
.tinymce-container {
position: relative;
line-height: normal;
}
.tinymce-container >>> .mce-fullscreen {
z-index: 10000;
}
.tinymce-textarea {
visibility: hidden;
z-index: -1;
}
.hide .el-upload--picture-card {
display: none;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,111 @@
<template>
<div class="upload-container">
<el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click=" dialogVisible=true">
upload
</el-button>
<el-dialog :visible.sync="dialogVisible">
<el-upload
:multiple="true"
:file-list="fileList"
:show-file-list="true"
:on-remove="handleRemove"
:on-success="handleSuccess"
:before-upload="beforeUpload"
class="editor-slide-upload"
action="https://httpbin.org/post"
list-type="picture-card"
>
<el-button size="small" type="primary">
Click upload
</el-button>
</el-upload>
<el-button @click="dialogVisible = false">
Cancel
</el-button>
<el-button type="primary" @click="handleSubmit">
Confirm
</el-button>
</el-dialog>
</div>
</template>
<script>
// import { getToken } from 'api/qiniu'
export default {
name: 'EditorSlideUpload',
props: {
color: {
type: String,
default: '#1890ff'
}
},
data() {
return {
dialogVisible: false,
listObj: {},
fileList: []
}
},
methods: {
checkAllSuccess() {
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
},
handleSubmit() {
const arr = Object.keys(this.listObj).map(v => this.listObj[v])
if (!this.checkAllSuccess()) {
this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')
return
}
this.$emit('successCBK', arr)
this.listObj = {}
this.fileList = []
this.dialogVisible = false
},
handleSuccess(response, file) {
const uid = file.uid
const objKeyArr = Object.keys(this.listObj)
for (let i = 0, len = objKeyArr.length; i < len; i++) {
if (this.listObj[objKeyArr[i]].uid === uid) {
this.listObj[objKeyArr[i]].url = response.files.file
this.listObj[objKeyArr[i]].hasSuccess = true
return
}
}
},
handleRemove(file) {
const uid = file.uid
const objKeyArr = Object.keys(this.listObj)
for (let i = 0, len = objKeyArr.length; i < len; i++) {
if (this.listObj[objKeyArr[i]].uid === uid) {
delete this.listObj[objKeyArr[i]]
return
}
}
},
beforeUpload(file) {
const _self = this
const _URL = window.URL || window.webkitURL
const fileName = file.uid
this.listObj[fileName] = {}
return new Promise((resolve, reject) => {
const img = new Image()
img.src = _URL.createObjectURL(file)
img.onload = function() {
_self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height }
}
resolve(true)
})
}
}
}
</script>
<style lang="scss" scoped>
.editor-slide-upload {
margin-bottom: 20px;
/deep/ .el-upload--picture-card {
width: 100%;
}
}
</style>

View File

@@ -0,0 +1,59 @@
let callbacks = []
function loadedTinymce() {
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144
// check is successfully downloaded script
return window.tinymce
}
const dynamicLoadScript = (src, callback) => {
const existingScript = document.getElementById(src)
const cb = callback || function() {}
if (!existingScript) {
const script = document.createElement('script')
script.src = src // src url for the third-party library being loaded.
script.id = src
document.body.appendChild(script)
callbacks.push(cb)
const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd
onEnd(script)
}
if (existingScript && cb) {
if (loadedTinymce()) {
cb(null, existingScript)
} else {
callbacks.push(cb)
}
}
function stdOnEnd(script) {
script.onload = function() {
// this.onload = null here is necessary
// because even IE9 works not like others
this.onerror = this.onload = null
for (const cb of callbacks) {
cb(null, script)
}
callbacks = null
}
script.onerror = function() {
this.onerror = this.onload = null
cb(new Error('Failed to load ' + src), script)
}
}
function ieOnEnd(script) {
script.onreadystatechange = function() {
if (this.readyState !== 'complete' && this.readyState !== 'loaded') return
this.onreadystatechange = null
for (const cb of callbacks) {
cb(null, script) // there is no way to catch loading errors in IE8
}
callbacks = null
}
}
}
export default dynamicLoadScript

View File

@@ -0,0 +1,7 @@
// Any plugins you want to use has to be imported
// Detail plugins list see https://www.tinymce.com/docs/plugins/
// Custom builds see https://www.tinymce.com/download/custom-builds/
const plugins = ['advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount']
export default plugins

View File

@@ -0,0 +1,6 @@
// Here is a list of the toolbar
// Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen']
export default toolbar

View File

@@ -0,0 +1,146 @@
<template>
<div>
<el-table v-loading="tableDataLoading" :data="renwuData">
<el-table-column fixed prop="type" label="编号" align="center" width="80">
</el-table-column>
<el-table-column prop="min" label="类型">
</el-table-column>
<el-table-column prop="value" label="内容" width="500">
</el-table-column>
<el-table-column prop="createAt" label="创建时间">
</el-table-column>
<el-table-column label="操作" prop="id" width="120">
<template slot-scope="scope">
<el-button size="mini" type="primary" :disabled="!isAuth('allocationList:update')"
@click="renwuAmend(scope.$index, scope.row)">编辑
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<!-- 修改任务弹框 -->
<el-dialog title="修改" :visible.sync="dialogFormVisible1" center>
<el-form :model="form1">
<el-form-item label="配置类型:" :label-width="formLabelWidth">
<el-input v-model="form1.min" style="width:65%;" readonly></el-input>
</el-form-item>
<el-form-item label="内容:" :label-width="formLabelWidth">
<el-input v-model="form1.value" style="width:65%;"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="renwuNoticeTo()"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
page: 1,
limit: 10,
state: 1,
openValue: 1,
closeValue: 2,
classify: 1,
money: '',
condition: 'renwu',
activeName: 'first',
dialogFormVisible: false,
tableDataLoading: true,
dialogFormVisible1: false,
formLabelWidth: '200px',
tableData: [],
renwuData: [],
form: {
id: '',
rate: ''
},
form1: {
id: '',
min: '',
value: '',
type: '',
},
}
},
methods: {
handleSizeChange(val) {
this.limit = val;
this.dataSelect();
},
handleCurrentChange(val) {
this.page = val;
this.dataSelect();
},
// 修改任务弹框
renwuAmend(index, rows) {
this.dialogFormVisible1 = true;
this.form1.id = rows.id;
this.form1.type = rows.type
this.form1.min = rows.min;
this.form1.value = rows.value;
this.form1.max = rows.max;
this.form1.createAt = rows.createAt;
this.form1.conditionFrom = rows.conditionFrom
},
// 修改任务
renwuNoticeTo() {
this.$http({
url: this.$http.adornUrl('common/update'),
method: 'post',
data: this.$http.adornData({
'id': this.form1.id,
'type': this.form1.type,
'value': this.form1.value,
'min': this.form1.min,
'max': this.form1.max,
'createAt': this.form1.createAt,
'conditionFrom': this.form1.conditionFrom
})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message.error(data.msg)
}
})
},
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl(`common/type/condition/${this.condition}`),
method: 'get',
params: this.$http.adornParams({})
}).then(({
data
}) => {
if (data && data.code === 0) {
this.tableDataLoading = false
let returnData = data.data;
this.renwuData = returnData
}
})
}
},
mounted() {
this.dataSelect()
}
}
</script>
<style>
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

902
src/views/user/userList.vue Normal file
View File

@@ -0,0 +1,902 @@
<template>
<div>
<div style="margin:5px;display: inline-block;">
<span>手机号:</span>
<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入手机号"
v-model="phone"></el-input>
</div>
<div style="margin:5px;display: inline-block;">
<span>昵称:</span>
<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入昵称"
v-model="userName"></el-input>
</div>
<div style="margin:5px;display: inline-block;">
<span>邀请码:</span>
<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入邀请码"
v-model="invitationCode"></el-input>
</div>
<div style="margin:5px;display: inline-block;">
<span>邀请人邀请码:</span>
<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入邀请人邀请码"
v-model="inviterCode"></el-input>
</div>
<div style="margin:5px;display: inline-block;">
<span>渠道码:</span>
<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入渠道码"
v-model="qdCode"></el-input>
</div>
<div style="margin:5px;display: inline-block;">
<span>渠道来源:</span>
<el-select v-model="platformT" style="width:150px;" @change="select()">
<el-option v-for="item in homeDataQ" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>&nbsp;&nbsp;&nbsp;
</div>
<div style="margin:5px;display: inline-block;">
<span>分销商:</span>
<el-input style="width: 150px;" @keydown.enter.native="select" clearable placeholder="请输入分销商"
v-model="sysUserName"></el-input>
</div>
<div style="margin:5px;display: inline-block;">
<span>开始时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="startTime" align="right"
type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择开始时间">
</el-date-picker>
</div>
<div style="margin:5px;display: inline-block;">
<span>截止时间</span>
<el-date-picker style="width: 160px;margin-left: 10px;" v-model="endTime" align="right" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择截止时间">
</el-date-picker>
</div>
<div style="display: inline-block;">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">查询
</el-button>
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="cleans">重置
</el-button>
<el-button style='margin-left:15px;' size="mini" type="warning" icon="document" @click="exportBtn" >导出Excel
</el-button>
</div>
<div style="color: orange;"> * 导出提示导出数据前请进行时间或者渠道等筛选否则导出数据量过多易出现卡顿或系统崩溃</div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="全部用户" name="first">
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column fixed prop="userId" label="编号" width="80">
</el-table-column>
<el-table-column fixed prop="userName" label="昵称" width="150">
<template slot-scope="scope">
<span style="color: #f56c6c;">{{ scope.row.userName ? scope.row.userName : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column label="图像">
<template slot-scope="scope">
<img v-if="scope.row.avatar==null" src="~@/assets/img/avatar.png" alt="" width="40"
height="40">
<img v-else :src="scope.row.avatar" alt="" width="40" height="40">
</template>
</el-table-column>
<el-table-column prop="phone" label="手机号">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row)">
{{ scope.row.phone ? scope.row.phone : '未绑定' }}
</span>
</template>
</el-table-column>
<el-table-column prop="sysUserName" label="分销商"></el-table-column>
<el-table-column prop="invitationCode" label="邀请码"></el-table-column>
<el-table-column label="邀请人邀请码">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;"
@click="updates2(scope.row.inviterCode)">{{ scope.row.inviterCode ? scope.row.inviterCode : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="qdCode" label="渠道码"></el-table-column>
<el-table-column prop="vipType" label="会员类型">
<template slot-scope="scope">
<span v-if="scope.row.vipType==2">充值会员</span>
<span v-else-if="scope.row.vipType==1">赠送会员</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="rate" label="一级推广收益比例" width="150">
<template slot-scope="scope">
<span>{{scope.row.rate?scope.row.rate:'0'}}</span>
<el-button size="mini" :disabled="!isAuth('userList:updatebl')"
style="color: #4f9dec;background: #fff;border: none;" @click="xiugai(scope.row,'rate')">
修改</el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="twoRate" label="二级推广收益比例" width="150">
<template slot-scope="scope">
<span>{{scope.row.twoRate?scope.row.twoRate:'0'}}</span>
<el-button size="mini" :disabled="!isAuth('userList:updatebl')"
style="color: #4f9dec;background: #fff;border: none;" @click="xiugai(scope.row,'twoRate')">
修改</el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="platform" label="渠道来源">
<template slot-scope="scope">
<span>{{ scope.row.platform ? scope.row.platform : '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="zhifubaoName" label="支付宝名称">
<template slot-scope="scope">
<span>{{ scope.row.zhifubaoName ? scope.row.zhifubaoName : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="zhifubao" label="支付宝账号">
<template slot-scope="scope">
<span>{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
<el-table-column prop="state " label="状态">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" @change="change(scope.row.status,scope.row.userId)"
:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-button size="mini" type="warning" @click="updateVip(scope.row)"
:disabled="!isAuth('userList:updateVip')" v-if="scope.row.member!=2">设置会员</el-button>
<el-button size="mini" type="warning" @click="quxiaoVip(scope.row)"
:disabled="!isAuth('userList:updateVip')" v-if="scope.row.member==2" plain>取消会员
</el-button>
<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
@click="deleteuser(scope.row)">删除用户</el-button>
<!-- <el-button size = "mini" type = "danger" @click = "updates1(scope.row)">封号</el-button> -->
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="充值会员用户" name="second1">
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column fixed prop="userName" label="昵称" width="150">
<template slot-scope="scope">
<span style="color: #f56c6c;">{{ scope.row.userName ? scope.row.userName : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column label="图像">
<template slot-scope="scope">
<img v-if="scope.row.avatar==null" src="~@/assets/img/avatar.png" alt="" width="40"
height="40">
<img v-else :src="scope.row.avatar" alt="" width="40" height="40">
</template>
</el-table-column>
<el-table-column prop="phone" label="手机号">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row)">
{{ scope.row.phone ? scope.row.phone : '未绑定' }}
</span>
</template>
</el-table-column>
<el-table-column prop="sysUserName" label="分销商"></el-table-column>
<el-table-column prop="invitationCode" label="邀请码"></el-table-column>
<el-table-column label="邀请人邀请码">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;"
@click="updates2(scope.row.inviterCode)">{{ scope.row.inviterCode ? scope.row.inviterCode : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="qdCode" label="渠道码"></el-table-column>
<el-table-column prop="vipType" label="会员类型">
<template slot-scope="scope">
<span v-if="scope.row.vipType==2">充值会员</span>
<span v-else-if="scope.row.vipType==1">赠送会员</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="rate" label="一级推广收益比例" width="150">
<template slot-scope="scope">
<span>{{scope.row.rate?scope.row.rate:'0'}}</span>
<el-button size="mini" :disabled="!isAuth('userList:updatebl')"
style="color: #4f9dec;background: #fff;border: none;" @click="xiugai(scope.row,'rate')">
修改</el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="twoRate" label="二级推广收益比例" width="150">
<template slot-scope="scope">
<span>{{scope.row.twoRate?scope.row.twoRate:'0'}}</span>
<el-button size="mini" :disabled="!isAuth('userList:updatebl')"
style="color: #4f9dec;background: #fff;border: none;" @click="xiugai(scope.row,'twoRate')">
修改</el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="platform" label="渠道来源">
<template slot-scope="scope">
<span>{{ scope.row.platform ? scope.row.platform : '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="zhifubaoName" label="支付宝名称">
<template slot-scope="scope">
<span>{{ scope.row.zhifubaoName ? scope.row.zhifubaoName : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="zhifubao" label="支付宝账号">
<template slot-scope="scope">
<span>{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
<el-table-column prop="state " label="状态">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" @change="change(scope.row.state,scope.row.userId)"
:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-button size="mini" type="warning" @click="updateVip(scope.row)"
:disabled="!isAuth('userList:updateVip')" v-if="scope.row.member!=2">设置会员</el-button>
<el-button size="mini" type="warning" @click="quxiaoVip(scope.row)"
:disabled="!isAuth('userList:updateVip')" v-if="scope.row.member==2" plain>取消会员
</el-button>
<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
@click="deleteuser(scope.row)">删除用户</el-button>
<!-- <el-button size = "mini" type = "danger" @click = "updates1(scope.row)">封号</el-button> -->
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="赠送会员用户" name="second2">
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column fixed prop="userName" label="昵称" width="150">
<template slot-scope="scope">
<span style="color: #f56c6c;">{{ scope.row.userName ? scope.row.userName : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column label="图像">
<template slot-scope="scope">
<img v-if="scope.row.avatar==null" src="~@/assets/img/avatar.png" alt="" width="40"
height="40">
<img v-else :src="scope.row.avatar" alt="" width="40" height="40">
</template>
</el-table-column>
<el-table-column prop="phone" label="手机号">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row)">
{{ scope.row.phone ? scope.row.phone : '未绑定' }}
</span>
</template>
</el-table-column>
<el-table-column prop="sysUserName" label="分销商"></el-table-column>
<el-table-column prop="invitationCode" label="邀请码"></el-table-column>
<el-table-column label="邀请人邀请码">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;"
@click="updates2(scope.row.inviterCode)">{{ scope.row.inviterCode ? scope.row.inviterCode : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="qdCode" label="渠道码"></el-table-column>
<el-table-column prop="vipType" label="会员类型">
<template slot-scope="scope">
<span v-if="scope.row.vipType==2">充值会员</span>
<span v-else-if="scope.row.vipType==1">赠送会员</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="rate" label="一级推广收益比例" width="150">
<template slot-scope="scope">
<span>{{scope.row.rate?scope.row.rate:'0'}}</span>
<el-button size="mini" :disabled="!isAuth('userList:updatebl')"
style="color: #4f9dec;background: #fff;border: none;" @click="xiugai(scope.row,'rate')">
修改</el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="twoRate" label="二级推广收益比例" width="150">
<template slot-scope="scope">
<span>{{scope.row.twoRate?scope.row.twoRate:'0'}}</span>
<el-button size="mini" :disabled="!isAuth('userList:updatebl')"
style="color: #4f9dec;background: #fff;border: none;" @click="xiugai(scope.row,'twoRate')">
修改</el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="platform" label="渠道来源">
<template slot-scope="scope">
<span>{{ scope.row.platform ? scope.row.platform : '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="zhifubaoName" label="支付宝名称">
<template slot-scope="scope">
<span>{{ scope.row.zhifubaoName ? scope.row.zhifubaoName : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="zhifubao" label="支付宝账号">
<template slot-scope="scope">
<span>{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
<el-table-column prop="state " label="状态">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" @change="change(scope.row.state,scope.row.userId)"
:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-button size="mini" type="warning" @click="updateVip(scope.row)"
:disabled="!isAuth('userList:updateVip')" v-if="scope.row.member!=2">设置会员</el-button>
<el-button size="mini" type="warning" @click="quxiaoVip(scope.row)"
:disabled="!isAuth('userList:updateVip')" v-if="scope.row.member==2" plain>取消会员
</el-button>
<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
@click="deleteuser(scope.row)">删除用户</el-button>
<!-- <el-button size = "mini" type = "danger" @click = "updates1(scope.row)">封号</el-button> -->
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<el-tab-pane label="普通用户" name="third">
<el-table v-loading="tableDataLoading" :data="tableData.list">
<el-table-column fixed prop="userName" label="昵称" width="150">
<template slot-scope="scope">
<span style="color: #f56c6c;">{{ scope.row.userName ? scope.row.userName : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column label="图像">
<template slot-scope="scope">
<img v-if="scope.row.avatar==null" src="~@/assets/img/avatar.png" alt="" width="40"
height="40">
<img v-else :src="scope.row.avatar" alt="" width="40" height="40">
</template>
</el-table-column>
<el-table-column prop="phone" label="手机号">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row)">
{{ scope.row.phone ? scope.row.phone : '未绑定' }}
</span>
</template>
</el-table-column>
<el-table-column prop="sysUserName" label="分销商"></el-table-column>
<el-table-column prop="invitationCode" label="邀请码"></el-table-column>
<el-table-column label="邀请人邀请码">
<template slot-scope="scope">
<span style="color: #4f9dec;cursor: pointer;"
@click="updates2(scope.row.inviterCode)">{{ scope.row.inviterCode ? scope.row.inviterCode : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="qdCode" label="渠道码"></el-table-column>
<el-table-column prop="rate" label="一级推广收益比例" width="150">
<template slot-scope="scope">
<span>{{scope.row.rate?scope.row.rate:'0'}}</span>
<el-button size="mini" :disabled="!isAuth('userList:updatebl')"
style="color: #4f9dec;background: #fff;border: none;" @click="xiugai(scope.row,'rate')">
修改</el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="twoRate" label="二级推广收益比例" width="150">
<template slot-scope="scope">
<span>{{scope.row.twoRate?scope.row.twoRate:'0'}}</span>
<el-button size="mini" :disabled="!isAuth('userList:updatebl')"
style="color: #4f9dec;background: #fff;border: none;" @click="xiugai(scope.row,'twoRate')">
修改</el-button>
</span>
</template>
</el-table-column>
<el-table-column prop="platform" label="渠道来源">
<template slot-scope="scope">
<span>{{ scope.row.platform ? scope.row.platform : '-' }}</span>
</template>
</el-table-column>
<el-table-column prop="zhifubaoName" label="支付宝名称">
<template slot-scope="scope">
<span>{{ scope.row.zhifubaoName ? scope.row.zhifubaoName : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="zhifubao" label="支付宝账号">
<template slot-scope="scope">
<span>{{ scope.row.zhifubao ? scope.row.zhifubao : '未绑定' }}</span>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
<el-table-column prop="state " label="状态">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" @change="change(scope.row.state,scope.row.userId)"
:active-value="openValue" :inactive-value="closeValue" active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<template slot-scope="scope">
<el-button size="mini" type="warning" @click="updateVip(scope.row)"
:disabled="!isAuth('userList:updateVip')" v-if="scope.row.member!=2">设置会员</el-button>
<el-button size="mini" type="warning" @click="quxiaoVip(scope.row)"
:disabled="!isAuth('userList:updateVip')" v-if="scope.row.member==2" plain>取消会员
</el-button>
<el-button size="mini" type="primary" @click="updates(scope.row)">用户详情</el-button>
<el-button size="mini" type="danger" :disabled="!isAuth('userList:delete')"
@click="deleteuser(scope.row)">删除用户</el-button>
<!-- <el-button size = "mini" type = "danger" @click = "updates1(scope.row)">封号</el-button> -->
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 10px;">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:page-sizes="[10, 20, 30, 40]" :page-size="limit" :current-page="page"
layout="total,sizes, prev, pager, next,jumper" :total="tableData.totalCount">
</el-pagination>
</div>
</el-tab-pane>
<!-- 修改比例 -->
<el-dialog :title="titleBl" :visible.sync="dialogFormVisible2" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">比例</span>
<el-input style="width:50%;" v-model="proportion" type="number" :min="0" :controls="false"
:placeholder="titleBl"></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible2 = false"> </el-button>
<el-button type="primary" @click="StairNoticeTo2()"> </el-button>
</div>
</el-dialog>
</el-tabs>
</div>
</template>
<script>
export default {
data() {
return {
openValue: 1,
closeValue: 2,
state: 'false',
limit: 10,
page: 1,
phone: '',
value: '',
member: -1,
name: '',
tableDataLoading: true,
tableData: [],
platforms: [{
value: 'all',
label: '全部'
}, {
value: 'wap',
label: '网站'
}, {
value: 'app',
label: 'APP'
}, {
value: 'weixin',
label: '微信公众号'
},
{
value: 'mp',
label: '微信小程序'
}
],
campus: '',
activeName: 'first',
userName: '',
inviterCode: '',
platformT: '',
homeDataQ: [{
value: '',
label: '全部'
}, {
value: 'H5',
label: 'H5'
}, {
value: 'app',
label: 'app'
}, {
value: '小程序',
label: '小程序'
}, {
value: '抖音',
label: '抖音'
}, ],
dialogFormVisible2: false,
titleBl: '修改佣金比例',
proportion:'',
invitationCode:'',
startTime: '',
endTime: '',
sysUserName:'',
qdCode:'',
vipType:'',
}
},
methods: {
// tabs切换
handleClick(tab, event) {
this.page = 1
if (tab._props.label == '全部用户') {
this.member = -1
this.vipType = ''
this.dataSelect()
}
if (tab._props.label == '充值会员用户') {
this.member = 2
this.vipType = 2
this.dataSelect()
}
if (tab._props.label == '赠送会员用户') {
this.member = 2
this.vipType = 1
this.dataSelect()
}
if (tab._props.label == '普通用户') {
this.member = 1
this.vipType = ''
this.dataSelect()
}
},
// 状态
change(val, userId) {
this.$http({
url: this.$http.adornUrl(`user/updateUserByUserId`),
method: 'post',
data: this.$http.adornData({
'userId':userId,
'status':val
})
}).then(({
data
}) => {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
},
// 详情跳转
updates(row) {
console.log("`````", row.userId)
this.$router.push({
path: '/userDetail',
query: {
userId: row.userId
}
})
},
// 详情跳转
updates2(inviterCode) {
this.$http({
url: this.$http.adornUrl('user/selectUserByInvitationCode'),
method: 'get',
params: this.$http.adornParams({
'invitationCode':inviterCode
})
}).then(({
data
}) => {
if (data.code == 0) {
if(data.data.userEntity){
this.$router.push({
path: '/userDetail',
query: {
userId: data.data.userEntity.userId
}
})
}
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
},
handleSizeChange(val) {
this.limit = val
this.dataSelect()
},
handleCurrentChange(val) {
this.page = val
this.dataSelect()
},
// 查询
select() {
this.page = 1
this.dataSelect()
},
// 重置
cleans() {
this.page = 1
this.campus = ''
this.phone = ''
this.userName = ''
this.inviterCode = ''
this.platformT = ''
this.sysUserName = ''
this.invitationCode = ''
this.qdCode = ''
this.startTime = ''
this.endTime = ''
this.dataSelect()
},
//删除用户
deleteuser(row) {
let delid = row.userId
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`user/deleteUserByUserId/${delid}`),
method: 'post',
params: this.$http.adornData({})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
})
},
// 封号
updates1(row) {},
// 获取数据列表
dataSelect() {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('user/selectUserList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit,
'member': this.member,
'phone': this.phone,
'campus': this.campus,
'userName': this.userName,
'inviterCode': this.inviterCode,
'platform': this.platformT,
'invitationCode':this.invitationCode,
'qdCode':this.qdCode,
'startTime': this.startTime,
'endTime': this.endTime,
'sysUserName':this.sysUserName,
'vipType':this.vipType
})
}).then(({
data
}) => {
this.tableDataLoading = false
let returnData = data.data
this.tableData = returnData
})
},
// 设置会员
updateVip(row) {
this.$http({
url: this.$http.adornUrl('vipDetails/sendVip'),
method: 'post',
params: this.$http.adornParams({
'userId': row.userId,
'num': 30
})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}
})
},
// 取消会员
quxiaoVip(row) {
this.$confirm(`确定要取消会员?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('vipDetails/deleteVip'),
method: 'post',
// data: this.$http.adornData({
params: this.$http.adornParams({
'userId': row.userId
})
}).then(({
data
}) => {
if (data.code == 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
} else {
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {}
})
}
})
})
},
xiugai(row, text) {
if (text == 'rate') {
this.titleBl = '修改一级推广收益比例'
this.proportion = row.rate
}
if (text == 'twoRate') {
this.titleBl = '修改二级推广收益比例'
this.proportion = row.twoRate
}
this.texts = text
this.userIdss = row.userId
this.dialogFormVisible2 = true
},
StairNoticeTo2() {
var datas = {}
if (this.texts == 'rate') {
datas.rate = this.proportion
}
if (this.texts == 'twoRate') {
datas.twoRate = this.proportion
}
datas.userId = this.userIdss
this.$http({
url: this.$http.adornUrl('user/updateUserByUserId'),
method: 'post',
data: this.$http.adornData(datas)
}).then(({
data
}) => {
console.log('data', data)
if(data.code==0){
this.$message({
message: '修改成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible2 = false
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
// 导出
exportBtn() {
this.$http({
url: this.$http.adornUrl('user/userListExcel'),
method: 'get',
responseType: 'blob',
params: this.$http.adornParams({
'member': this.member,
'phone': this.phone,
'campus': this.campus,
'userName': this.userName,
'inviterCode': this.inviterCode,
'platform': this.platformT,
'invitationCode':this.invitationCode,
'qdCode':this.qdCode,
'startTime': this.startTime,
'endTime': this.endTime,
})
}).then(({
data
}) => {
let blob = new Blob([data], {
type: 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
})
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob)
} else {
let url = window.URL.createObjectURL(blob)
let elink = document.createElement('a')
elink.download = '用户列表.xlsx'
elink.style.display = 'none'
elink.href = url
document.body.appendChild(elink)
elink.click()
document.body.removeChild(elink)
}
})
},
},
mounted() {
this.dataSelect()
}
}
</script>
<style scoped="scoped">
.el-button+.el-button {
margin-left: 0 !important;
margin-top: 5px !important;
}
</style>

310
src/views/viplist/index.vue Normal file
View File

@@ -0,0 +1,310 @@
<template>
<el-tabs v-model = "activeName" @tab-click = "handleClick">
<!-- <el-tab-pane label = "会员列表" name = "first"> -->
<div style = "margin-right:2%;text-align: right;">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" :disabled="!isAuth('viplist:add')" @click="add">添加
</el-button>
</div>
<el-table v-loading = "tableDataLoading" :data = "tableData.list" >
<el-table-column fixed prop = "id" label = "编号" width = "50"></el-table-column>
<el-table-column prop = "vipNameType" label = "会员类型" width = "150">
<template slot-scope = "scope">
<span v-if = "scope.row.vipNameType == 0">月会员</span>
<span v-if = "scope.row.vipNameType == 1">季会员</span>
<span v-if = "scope.row.vipNameType == 2">年会员</span>
</template>
</el-table-column>
<el-table-column prop = "money" label = "会员价格" >
</el-table-column>
<el-table-column prop="payDiamond" label="钻石价格">
</el-table-column>
<el-table-column label = "操作" width = "180" align="center" fixed="right">
<template slot-scope = "scope">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" :disabled="!isAuth('viplist:update')" @click="updata(scope.row)">修改
</el-button>
<el-button size = "mini" type = "danger" :disabled="!isAuth('viplist:delete')" @click = "deletes(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[5, 10, 15, 20]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.totalCount">
</el-pagination>
</div>
<!-- </el-tab-pane> -->
<el-dialog title="添加" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">会员类型</span>
<el-radio-group v-model="vipNameType">
<el-radio :label="0">月会员</el-radio>
<el-radio :label="1">季会员</el-radio>
<el-radio :label="2">年会员</el-radio>
</el-radio-group>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">会员价格</span>
<el-input style="width:50%;" v-model="money" type="number" min="0" placeholder="请输入会员价格" ></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">钻石价格</span>
<el-input style="width:50%;" v-model="payDiamond" type="number" min="0" placeholder="请输入钻石价格" ></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="vipAdd()"> </el-button>
</div>
</el-dialog>
<el-dialog title="修改" :visible.sync="dialogFormVisible1" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">会员类型</span>
<el-radio-group v-model="vipNameType">
<el-radio :label="0">月会员</el-radio>
<el-radio :label="1">季会员</el-radio>
<el-radio :label="2">年会员</el-radio>
</el-radio-group>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">会员价格</span>
<el-input style="width:50%;" v-model="money" type="number" min="0" placeholder="请输入会员价格"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">钻石价格</span>
<el-input style="width:50%;" v-model="payDiamond" type="number" min="0" placeholder="请输入钻石价格" ></el-input>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="vipUpdata()"> </el-button>
</div>
</el-dialog>
</el-tabs>
</template>
<script>
export default {
data () {
return {
activeName:'first',
page: 1,
limit: 10,
classify: 1,
id:'',
vipNameType: -1,
money: '',
payDiamond:'',
tableDataLoading:false,
dialogFormVisible:false,
dialogFormVisible1:false,
tableData:{},
}
},
methods: {
// 多选
changeFun (val) {
this.checkBoxData = val
},
// tabs切换
handleClick (tab, event) {
if (tab._props.label == '轮播图') {
this.page = 1
this.limit = 5
this.classify = 1
this.dataSelect()
}
},
handleSizeChange (val) {
this.limit = val
this.dataSelect()
},
handleCurrentChange (val) {
this.page = val
this.dataSelect()
},
// 查询列表
select() {
this.page = 1
this.limit = 10
this.dataSelect()
},
// 添加
add(){
this.vipNameType = -1
this.money = ''
this.payDiamond = ''
this.id = ''
this.dialogFormVisible = true
},
updata(row){
this.vipNameType = row.vipNameType
this.money = row.money
this.payDiamond = row.payDiamond
this.id = row.id
this.dialogFormVisible1 = true
},
vipAdd(){
if (this.vipNameType == -1) {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择会员类型',
type: 'warning'
});
return
}
if (this.money === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入会员价格',
type: 'warning'
});
return
}
if (this.payDiamond === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入钻石价格',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('vipDetails/insertVipDetails'),
method: 'post',
data: this.$http.adornData({
'vipNameType':this.vipNameType,
'money':this.money,
'payDiamond':this.payDiamond,
})
}).then(({data}) => {
if(data.code == 0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible = false
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
vipUpdata(){
if (this.money === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入会员价格',
type: 'warning'
});
return
}
if (this.payDiamond === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入钻石价格',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('vipDetails/updateVipDetails'),
method: 'post',
data: this.$http.adornData({
'vipNameType':this.vipNameType,
'money':this.money,
'payDiamond':this.payDiamond,
'id':this.id
})
}).then(({data}) => {
if(data.code == 0){
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
// 删除banner图
deletes (row) {
let delid = row.id
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`vipDetails/deleteVipDetails?id=${delid}`),
method: 'post',
params: this.$http.adornParams({})
}).then(({data}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
}).catch(() => {
})
},
// 获取数据列表
dataSelect () {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('vipDetails/selectVipDetailsList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit
})
}).then(({data}) => {
if (data && data.code === 0) {
this.tableDataLoading = false
let returnData = data.data
this.tableData = returnData
}
})
}
},
mounted () {
this.dataSelect()
}
}
</script>
<style>
.customWidth {
width: 80% !important;
}
</style>

View File

@@ -0,0 +1,374 @@
<template>
<el-tabs v-model = "activeName" @tab-click = "handleClick">
<!-- <el-tab-pane label = "会员列表" name = "first"> -->
<div style = "margin-right:2%;text-align: right;">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" @click="select">刷新
</el-button>
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" :disabled="!isAuth('viplist:add')" @click="add">添加
</el-button>
</div>
<div style="color: orange;"> * 提示当前为邀请奖励的配置例如邀请2人奖励用户3个月无限看短剧</div>
<el-table v-loading = "tableDataLoading" :data = "tableData.records" >
<el-table-column prop = "inviteAwardId" label = "编号" width = "80"></el-table-column>
<el-table-column prop = "inviteCount" label = "邀请人数">
</el-table-column>
<el-table-column prop = "inviteMonth" label = "奖励会员月份数" >
<template slot-scope="scope">
<span v-if="scope.row.inviteMonth=='0'">永久</span>
<span v-else>{{scope.row.inviteMonth}}</span>
</template>
</el-table-column>
<el-table-column prop="inviteImg" label="图片" width="150">
<template slot-scope="scope">
<el-popover placement="top-start" title="" trigger="hover">
<img style="width: 50px; height: 50px" :src="scope.row.inviteImg" alt="" slot="reference">
<img style="width: 200px; height: 200px" :src="scope.row.inviteImg" alt="">
</el-popover>
</template>
</el-table-column>
<el-table-column prop = "createTime" label = "创建时间" >
</el-table-column>
<el-table-column label = "操作" width = "180" align="center" fixed="right">
<template slot-scope = "scope">
<el-button style="margin-left:15px;" size="mini" type="primary" icon="document" :disabled="!isAuth('viplist:update')" @click="updata(scope.row)">修改
</el-button>
<el-button size = "mini" type = "danger" :disabled="!isAuth('viplist:delete')" @click = "deletes(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div style = "text-align: center;margin-top: 10px;float:right">
<el-pagination @size-change = "handleSizeChange" @current-change = "handleCurrentChange" :page-sizes = "[5, 10, 15, 20]"
:page-size = "limit" :current-page = "page" layout = "total,sizes, prev, pager, next,jumper"
:total = "tableData.total">
</el-pagination>
</div>
<!-- </el-tab-pane> -->
<el-dialog title="添加" :visible.sync="dialogFormVisible" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">邀请人数</span>
<el-input style="width:50%;" v-model="inviteCount" type="number" min="0" placeholder="请输入邀请人数"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">奖励类型</span>
<el-radio-group v-model="vipNameType" @change="btns()">
<el-radio :label="1">永久</el-radio>
<el-radio :label="2">月份数</el-radio>
</el-radio-group>
</div>
<div style="margin-bottom: 10px;" v-if="vipNameType==2">
<span style="width: 200px;display: inline-block;text-align: right;">奖励会员月份数</span>
<el-input style="width:50%;" v-model="inviteMonth" type="number" min="0" placeholder="请输入奖励会员月份数" ></el-input>
</div>
<div style="margin-bottom: 10px;display:flex;">
<span style="width: 200px;display: inline-block;text-align: right;">图片</span>
<div
style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class="avatar-uploader" v-model="inviteImg"
:action="$http.adornUrlUp('alioss/upload')" :show-file-list="false"
:on-success="handleAvatarSuccess5">
<img v-if="inviteImg" :src="inviteImg" class="avatar"
style="border-radius: 6px;width: 148px;height: 148px;" />
<i v-else class="el-icon-plus avatar-uploader-icon iconss"></i>
</el-upload>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="vipAdd()"> </el-button>
</div>
</el-dialog>
<el-dialog title="修改" :visible.sync="dialogFormVisible1" center>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">邀请人数</span>
<el-input style="width:50%;" v-model="inviteCount" type="number" min="0" placeholder="请输入邀请人数"></el-input>
</div>
<div style="margin-bottom: 10px;">
<span style="width: 200px;display: inline-block;text-align: right;">奖励类型</span>
<el-radio-group v-model="vipNameType" @change="btns()">
<el-radio :label="1">永久</el-radio>
<el-radio :label="2">月份数</el-radio>
</el-radio-group>
</div>
<div style="margin-bottom: 10px;" v-if='vipNameType==2'>
<span style="width: 200px;display: inline-block;text-align: right;">奖励会员月份数</span>
<el-input style="width:50%;" v-model="inviteMonth" type="number" min="0" placeholder="请输入奖励会员月份数"></el-input>
</div>
<div style="margin-bottom: 10px;display:flex;">
<span style="width: 200px;display: inline-block;text-align: right;">图片</span>
<div
style=" width:148px;height:148px;border: 1px dashed #c0ccda;border-radius: 6px;text-align: center;line-height: 148px;">
<el-upload class="avatar-uploader" v-model="inviteImg"
:action="$http.adornUrlUp('alioss/upload')" :show-file-list="false"
:on-success="handleAvatarSuccess5">
<img v-if="inviteImg" :src="inviteImg" class="avatar"
style="border-radius: 6px;width: 148px;height: 148px;" />
<i v-else class="el-icon-plus avatar-uploader-icon iconss"></i>
</el-upload>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible1 = false"> </el-button>
<el-button type="primary" @click="vipUpdata()"> </el-button>
</div>
</el-dialog>
</el-tabs>
</template>
<script>
export default {
data () {
return {
activeName:'first',
page: 1,
limit: 10,
classify: 1,
id:'',
inviteCount: '',
inviteMonth: '',
inviteImg: '',
tableDataLoading:false,
dialogFormVisible:false,
dialogFormVisible1:false,
tableData:{},
vipNameType:2,
}
},
methods: {
// 多选
changeFun (val) {
this.checkBoxData = val
},
// tabs切换
handleClick (tab, event) {
if (tab._props.label == '轮播图') {
this.page = 1
this.limit = 5
this.classify = 1
this.dataSelect()
}
},
handleSizeChange (val) {
this.limit = val
this.dataSelect()
},
handleCurrentChange (val) {
this.page = val
this.dataSelect()
},
// 封面图片上传
handleAvatarSuccess5(file) {
this.inviteImg = file.data;
},
// 查询列表
select() {
this.page = 1
this.dataSelect()
},
// 添加
add(){
this.inviteCount = ''
this.inviteMonth = ''
this.id = ''
this.inviteImg = '';
this.dialogFormVisible = true
},
updata(row){
this.inviteCount = row.inviteCount
if(row.inviteMonth==0){
this.vipNameType = 1
}else{
this.vipNameType = 2
}
this.inviteMonth = row.inviteMonth
this.id = row.inviteAwardId
this.inviteImg = row.inviteImg;
this.dialogFormVisible1 = true
},
vipAdd(){
if (this.inviteCount == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择邀请人数',
type: 'warning'
});
return
}
if (this.inviteMonth == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入奖励会员月份数',
type: 'warning'
});
return
}
if (this.inviteImg == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请上传图片',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('inviteAward/insertInviteAward'),
method: 'post',
data: this.$http.adornData({
'inviteCount':this.inviteCount,
'inviteMonth':this.inviteMonth,
'inviteImg':this.inviteImg
})
}).then(({data}) => {
if(data.code == 0){
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible = false
this.inviteCount = ''
this.money = ''
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
vipUpdata(){
if (this.inviteCount == '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请选择邀请人数',
type: 'warning'
});
return
}
if (this.inviteMonth === '') {
this.$notify({
title: '提示',
duration: 1800,
message: '请输入奖励会员月份数',
type: 'warning'
});
return
}
if (this.inviteImg == ''||this.inviteImg==null) {
this.$notify({
title: '提示',
duration: 1800,
message: '请上传图片',
type: 'warning'
});
return
}
this.$http({
url: this.$http.adornUrl('inviteAward/updateInviteAward'),
method: 'post',
data: this.$http.adornData({
'inviteCount':this.inviteCount,
'inviteMonth':this.inviteMonth,
'inviteAwardId':this.id,
'inviteImg':this.inviteImg,
})
}).then(({data}) => {
if(data.code == 0){
this.dialogFormVisible1 = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.inviteCount = ''
this.inviteMonth = ''
this.id = ''
this.dataSelect()
}
})
}else{
this.$message({
message: data.msg,
type: 'warning',
duration: 1500,
onClose: () => {
}
})
}
})
},
// 删除banner图
deletes (row) {
let delid = row.inviteAwardId
this.$confirm(`确定删除此条信息?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`inviteAward/deleteInviteAward?inviteAwardId=${delid}`),
method: 'post',
params: this.$http.adornParams({})
}).then(({data}) => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dataSelect()
}
})
})
}).catch(() => {
})
},
// 获取数据列表
dataSelect () {
this.tableDataLoading = true
this.$http({
url: this.$http.adornUrl('inviteAward/selectInviteAwardList'),
method: 'get',
params: this.$http.adornParams({
'page': this.page,
'limit': this.limit
})
}).then(({data}) => {
if (data && data.code === 0) {
this.tableDataLoading = false
let returnData = data.data
this.tableData = returnData
}
})
},
btns(){
if(this.vipNameType==1){
this.inviteMonth = 0
}else{
this.inviteMonth = ''
}
},
},
mounted () {
this.dataSelect()
}
}
</script>
<style>
.customWidth {
width: 80% !important;
}
</style>