初始项目
This commit is contained in:
14
mallplusui-web-admin/src/views/sys/admin/add.vue
Normal file
14
mallplusui-web-admin/src/views/sys/admin/add.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<admin-detail :is-edit='false'></admin-detail>
|
||||
</template>
|
||||
<script>
|
||||
import AdminDetail from './components/AdminDetail'
|
||||
export default {
|
||||
name: 'addAdmin',
|
||||
components: { AdminDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="admin" :rules="loginRules" ref="adminFrom" label-width="150px">
|
||||
<el-form-item label="用户昵称:" prop="nickName">
|
||||
<el-input v-model="admin.nickName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名:" prop="username">
|
||||
<el-input v-model="admin.username"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="邮箱:" prop="email">
|
||||
<el-input v-model="admin.email"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="图像:" prop="icon">
|
||||
<single-upload v-model="admin.icon"></single-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色:" prop="roleIds">
|
||||
<el-checkbox-group v-model="allRoles1">
|
||||
<el-checkbox v-for="(item,index) in allRoles" :key="index" :checked="item.checked" :label="item.id">{{item.name}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:">
|
||||
<el-input
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
v-model="admin.note"
|
||||
:autosize="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('adminFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('adminFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createAdmin, getAdmin, updateAdmin,userRoles,userRoleCheck} from '@/api/admin'
|
||||
import {isvalidUsername} from '@/utils/validate';
|
||||
import {fetchList} from '@/api/role'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
const defaultAdmin={
|
||||
username: '',
|
||||
roleIds:'',
|
||||
|
||||
};
|
||||
export default {
|
||||
name: 'AdminDetail',
|
||||
components:{SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const validateUsername = (rule, value, callback) => {
|
||||
if (!isvalidUsername(value)) {
|
||||
callback(new Error('请输入正确的用户名'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
};
|
||||
const validatePass = (rule, value, callback) => {
|
||||
if (value.length < 3) {
|
||||
callback(new Error('密码不能小于3位'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
};
|
||||
return {
|
||||
admin:Object.assign({}, defaultAdmin),
|
||||
allRoles:null,
|
||||
userRoles:null,
|
||||
roleIds:null,
|
||||
listQuery: {
|
||||
pageNum: 1,
|
||||
pageSize: 100
|
||||
},
|
||||
loginRules: {
|
||||
username: [{required: true, trigger: 'blur', message: '请输入用户名',}]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
this.listQuery.adminId=this.$route.query.id;
|
||||
userRoleCheck(this.listQuery).then(res => {
|
||||
if(res.code==200){
|
||||
this.allRoles = res.data
|
||||
}
|
||||
});
|
||||
|
||||
getAdmin(this.$route.query.id).then(response => {
|
||||
this.admin = response.data;
|
||||
});
|
||||
}else{
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.allRoles = response.data.records;
|
||||
});
|
||||
this.admin = Object.assign({},defaultAdmin);
|
||||
};
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
//选中的服务保证
|
||||
allRoles1: {
|
||||
get() {
|
||||
let list = [];
|
||||
if (this.roleIds === undefined || this.roleIds == null || this.roleIds === '') return list;
|
||||
let ids = this.roleIds.split(',');
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
list.push(Number(ids[i]));
|
||||
}
|
||||
return list;
|
||||
},
|
||||
set(newValue) {
|
||||
let serviceIds = '';
|
||||
if (newValue != null && newValue.length > 0) {
|
||||
for (let i = 0; i < newValue.length; i++) {
|
||||
serviceIds += newValue[i] + ',';
|
||||
}
|
||||
if (serviceIds.endsWith(',')) {
|
||||
serviceIds = serviceIds.substr(0, serviceIds.length - 1)
|
||||
}
|
||||
this.roleIds = serviceIds;
|
||||
} else {
|
||||
this.roleIds = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.admin.roleIds = this.roleIds;
|
||||
if (this.isEdit) {
|
||||
updateAdmin(this.$route.query.id, this.admin).then(response => {
|
||||
if(response.code==200){
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
}else{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
} else {
|
||||
createAdmin(this.admin).then(response => {
|
||||
if(response.code==200)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.admin = Object.assign({}, defaultAdmin);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}else{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.admin = Object.assign({},defaultAdmin);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
317
mallplusui-web-admin/src/views/sys/admin/index.vue
Normal file
317
mallplusui-web-admin/src/views/sys/admin/index.vue
Normal file
@@ -0,0 +1,317 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchAdminList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="用户名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addAdmin()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="adminTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
<el-table-column label="编号" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="注册时间" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.createTime | formatTime}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户昵称" align="center">
|
||||
<template slot-scope="scope">{{scope.row.nickName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户账号" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.username}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="邮件" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.email}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="是否禁用" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="handleShowStatusChange(scope.$index, scope.row)"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
v-model="scope.row.status">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column label="操作" width="250" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleCommunity(scope.$index, scope.row)">绑定小区
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="operateType" placeholder="批量操作">
|
||||
<el-option
|
||||
v-for="item in operates"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="search-button"
|
||||
@click="handleBatchOperate()"
|
||||
type="primary"
|
||||
size="small">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {formatDate} from '@/utils/date';
|
||||
import {fetchList, updateShowStatus, updateFactoryStatus, deleteAdmin} from '@/api/admin'
|
||||
|
||||
export default {
|
||||
name: 'adminList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示会员",
|
||||
value: "showAdmin"
|
||||
},
|
||||
{
|
||||
label: "隐藏会员",
|
||||
value: "hideAdmin"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters:{
|
||||
formatTime(time) {
|
||||
if(time==null||time===''){
|
||||
return 'N/A';
|
||||
}
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
formatStatus(status){
|
||||
for(let i=0;i<defaultStatusOptions.length;i++){
|
||||
if(status===defaultStatusOptions[i].value){
|
||||
return defaultStatusOptions[i].label;
|
||||
}
|
||||
}
|
||||
},
|
||||
formatReturnAmount(row){
|
||||
return row.productRealPrice*row.productCount;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleCommunity(index, row) {
|
||||
this.$router.push({path: '/sys/userCommunity', query: {id: row.id}})
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updateAdmin', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该会员', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteAdmin(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
},
|
||||
handleFactoryStatusChange(index, row) {
|
||||
var data = new URLSearchParams();
|
||||
data.append("ids", row.id);
|
||||
data.append("factoryStatus", row.factoryStatus);
|
||||
updateFactoryStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.factoryStatus === 0) {
|
||||
row.factoryStatus = 1;
|
||||
} else {
|
||||
row.factoryStatus = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleShowStatusChange(index, row) {
|
||||
let data = new URLSearchParams();
|
||||
|
||||
data.append("ids", row.id);
|
||||
data.append("showStatus", row.status);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.status === 0) {
|
||||
row.status = 1;
|
||||
} else {
|
||||
row.status = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchAdminList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
export(){
|
||||
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showAdmin') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideAdmin') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addAdmin() {
|
||||
this.$router.push({path: '/sys/addAdmin'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
14
mallplusui-web-admin/src/views/sys/admin/update.vue
Normal file
14
mallplusui-web-admin/src/views/sys/admin/update.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<admin-detail :is-edit='true'></admin-detail>
|
||||
</template>
|
||||
<script>
|
||||
import AdminDetail from './components/AdminDetail'
|
||||
export default {
|
||||
name: 'updateAdmin',
|
||||
components: { AdminDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
169
mallplusui-web-admin/src/views/sys/admin/userCommunity.vue
Normal file
169
mallplusui-web-admin/src/views/sys/admin/userCommunity.vue
Normal file
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<div style="margin-top: 50px">
|
||||
<el-form :model="role" :rules="rules" ref="roleFrom"
|
||||
label-width="120px" style="width: 680px"
|
||||
size="small">
|
||||
<el-form-item label="用户名称:" prop="name">
|
||||
<el-input v-model="role.nickName"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="关联权限:">
|
||||
<el-transfer
|
||||
style="display: inline-block"
|
||||
filterable
|
||||
:filter-method="filterMethod"
|
||||
filter-placeholder="请输入权限名称"
|
||||
v-model="selectSubject"
|
||||
:titles="subjectTitles"
|
||||
:data="subjectList">
|
||||
</el-transfer>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('roleFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('roleFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getAdmin,userCommunityRelate,communityList } from '@/api/admin'
|
||||
import {fetchList as fetchSubjectList} from '@/api/build/community'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
const defaultRole={
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'RoleDetail',
|
||||
components:{SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
role:Object.assign({}, defaultRole),
|
||||
//所有专题列表
|
||||
subjectList: [],
|
||||
//专题左右标题
|
||||
subjectTitles: ['待选择', '已选择'],
|
||||
communityIds:null,
|
||||
rules: {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSubjectList();
|
||||
|
||||
communityList(this.$route.query.id).then(res => {
|
||||
this.communityIds=res.data;
|
||||
});
|
||||
getAdmin(this.$route.query.id).then(response => {
|
||||
this.role = response.data;
|
||||
});
|
||||
|
||||
},
|
||||
computed:{
|
||||
//选中的专题
|
||||
selectSubject:{
|
||||
get:function () {
|
||||
let subjects =[];
|
||||
if(this.communityIds==null||this.communityIds.length<=0){
|
||||
return subjects;
|
||||
}
|
||||
for(let i=0;i<this.communityIds.length;i++){
|
||||
subjects.push(this.communityIds[i].communityId);
|
||||
}
|
||||
return subjects;
|
||||
},
|
||||
set:function (newValue) {
|
||||
console.log(newValue)
|
||||
this.communityIds=[];
|
||||
for(let i=0;i<newValue.length;i++){
|
||||
this.communityIds.push({communityId:newValue[i]});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getSubjectList() {
|
||||
fetchSubjectList().then(response => {
|
||||
let list = response.data.records;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
this.subjectList.push({
|
||||
label: list[i].name,
|
||||
key: list[i].id
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
filterMethod(query, item) {
|
||||
return item.label.indexOf(query) > -1;
|
||||
},
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let serviceIds='';
|
||||
for(let i=0;i<this.communityIds.length;i++){
|
||||
serviceIds += this.communityIds[i].communityId + ',';
|
||||
}
|
||||
if (serviceIds.endsWith(',')) {
|
||||
serviceIds = serviceIds.substr(0, serviceIds.length - 1)
|
||||
}
|
||||
this.role.communityIds = serviceIds;
|
||||
this.role.userId=this.role.id;
|
||||
if (this.isEdit) {
|
||||
userCommunityRelate( this.role).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
} else {
|
||||
userCommunityRelate(this.role).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.role = Object.assign({},defaultRole);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.role = Object.assign({},defaultRole);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/adminDayStatics/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/adminDayStatics/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<adminDayStatics-detail :is-edit='false'>
|
||||
</adminDayStatics-detail>
|
||||
</template>
|
||||
<script>
|
||||
import AdminDayStaticsDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addAdminDayStatics',
|
||||
components: {AdminDayStaticsDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="adminDayStatics" :rules="rules" ref="AdminDayStaticsFrom" label-width="150px">
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="id"
|
||||
prop="id">
|
||||
<el-input v-model="adminDayStatics.id" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="添加商品"
|
||||
prop="goodsCount">
|
||||
<el-input v-model="adminDayStatics.goodsCount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="支付订单数"
|
||||
prop="payOrderCount">
|
||||
<el-input v-model="adminDayStatics.payOrderCount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="文章数"
|
||||
prop="articleCount">
|
||||
<el-input v-model="adminDayStatics.articleCount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="支付金额"
|
||||
prop="payAmount">
|
||||
<el-input v-model="adminDayStatics.payAmount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="添加会员数"
|
||||
prop="memberCount">
|
||||
<el-input v-model="adminDayStatics.memberCount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="创建时间"
|
||||
prop="createTime">
|
||||
<el-input v-model="adminDayStatics.createTime" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="商户"
|
||||
prop="storeId">
|
||||
<el-input v-model="adminDayStatics.storeId" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="没有支付订单数"
|
||||
prop="notPayOrderCount">
|
||||
<el-input v-model="adminDayStatics.notPayOrderCount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="没有支付订单金额"
|
||||
prop="notPayAmount">
|
||||
<el-input v-model="adminDayStatics.notPayAmount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="商户"
|
||||
prop="storeName">
|
||||
<el-input v-model="adminDayStatics.storeName" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('AdminDayStaticsFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('AdminDayStaticsFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createAdminDayStatics, getAdminDayStatics, updateAdminDayStatics} from '@/api/sys/adminDayStatics'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultAdminDayStatics = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'AdminDayStaticsDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
adminDayStatics:
|
||||
Object.assign({},
|
||||
defaultAdminDayStatics),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo
|
||||
:
|
||||
[
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort
|
||||
:
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getAdminDayStatics(this.$route.query.id).then(response => {
|
||||
this.adminDayStatics = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.adminDayStatics = Object.assign({},
|
||||
defaultAdminDayStatics)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateAdminDayStatics(this.$route.query.id, this.adminDayStatics).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createAdminDayStatics(this.adminDayStatics).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.adminDayStatics = Object.assign({},
|
||||
defaultAdminDayStatics)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.adminDayStatics = Object.assign({},
|
||||
defaultAdminDayStatics)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
292
mallplusui-web-admin/src/views/sys/adminDayStatics/index.vue
Normal file
292
mallplusui-web-admin/src/views/sys/adminDayStatics/index.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchAdminDayStaticsList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="adminDayStaticsTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="storeId"
|
||||
label="商户">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.storeId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="storeName"
|
||||
label="商户">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.storeName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime"
|
||||
label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.createTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="goodsCount"
|
||||
label="添加商品">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.goodsCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="payOrderCount"
|
||||
label="支付订单数">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.payOrderCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="articleCount"
|
||||
label="文章数">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.articleCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="payAmount"
|
||||
label="支付金额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.payAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="memberCount"
|
||||
label="添加会员数">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.memberCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="notPayOrderCount"
|
||||
label="没有支付订单数">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.notPayOrderCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="notPayAmount"
|
||||
label="没有支付订单金额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.notPayAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteAdminDayStatics} from '@/api/sys/adminDayStatics'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'adminDayStaticsList',
|
||||
data() {
|
||||
return {
|
||||
operates: [],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/sys/updateAdminDayStatics', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteAdminDayStatics(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchAdminDayStaticsList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showAdminDayStatics') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideAdminDayStatics') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addAdminDayStatics() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/sys/addAdminDayStatics'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<adminDayStatics-detail :is-edit='true'>
|
||||
</adminDayStatics-detail>
|
||||
</template>
|
||||
<script>
|
||||
import AdminDayStaticsDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateAdminDayStatics',
|
||||
components: {AdminDayStaticsDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
14
mallplusui-web-admin/src/views/sys/adminLog/add.vue
Normal file
14
mallplusui-web-admin/src/views/sys/adminLog/add.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<adminLog-detail :is-edit='false'></adminLog-detail>
|
||||
</template>
|
||||
<script>
|
||||
import AdminLogDetail from './components/AdminLogDetail'
|
||||
export default {
|
||||
name: 'addAdminLog',
|
||||
components: { AdminLogDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
261
mallplusui-web-admin/src/views/sys/adminLog/adminLogStatic.vue
Normal file
261
mallplusui-web-admin/src/views/sys/adminLog/adminLogStatic.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchAdminLogList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="提交时间:">
|
||||
<el-date-picker
|
||||
class="input-width"
|
||||
v-model="listQuery.startTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="提交时间:">
|
||||
<el-date-picker
|
||||
class="input-width"
|
||||
v-model="listQuery.endTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="adminLogStatic"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
|
||||
|
||||
<el-table-column label="接口名" align="center">
|
||||
<template slot-scope="scope">{{scope.row.method}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调用次数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平均时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.avgMin}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.1秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count1}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.3秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count2}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.6秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count3}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过1秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count4}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过1.5秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count5}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过3秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count6}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="超过0.1秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum1}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.3秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum2}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.6秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum3}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过1秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum4}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过1.5秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum5}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过3秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum6}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {fetchList, deleteAdminLog,logStatic} from '@/api/sys/adminLog'
|
||||
import {formatDate} from '@/utils/date';
|
||||
export default {
|
||||
name: 'adminLogList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示品牌",
|
||||
value: "showAdminLog"
|
||||
},
|
||||
{
|
||||
label: "隐藏品牌",
|
||||
value: "hideAdminLog"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
logStatic(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updateAdminLog', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该品牌', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteAdminLog(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchAdminLogList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showAdminLog') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideAdminLog') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addAdminLog() {
|
||||
this.$router.push({path: '/build/add${className}'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="adminLog" :rules="rules" ref="adminLogFrom" label-width="150px">
|
||||
<el-form-item label="编号:" prop="id">
|
||||
<el-input v-model="adminLog.id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户编号:" prop="userId">
|
||||
<el-input v-model="adminLog.userId"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名:" prop="userName">
|
||||
<el-input v-model="adminLog.userName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="模块名:" prop="serviceName">
|
||||
<el-input v-model="adminLog.serviceName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="记录类名+方法名:" prop="method">
|
||||
<el-input v-model="adminLog.method"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述:" prop="operationDesc">
|
||||
<el-input v-model="adminLog.operationDesc"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间:" prop="createTime">
|
||||
<el-input v-model="adminLog.createTime"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="IP:" prop="ip">
|
||||
<el-input v-model="adminLog.ip"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数:" prop="params">
|
||||
<el-input v-model="adminLog.params"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('adminLogFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('adminLogFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createAdminLog, getAdminLog, updateAdminLog} from '@/api/sys/adminLog'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
import {formatDate} from '@/utils/date';
|
||||
const defaultAdminLog={
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'AdminLogDetail',
|
||||
components:{SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
adminLog:Object.assign({}, defaultAdminLog),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo: [
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort: [
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getAdminLog(this.$route.query.id).then(response => {
|
||||
this.adminLog = response.data;
|
||||
});
|
||||
}else{
|
||||
this.adminLog = Object.assign({},defaultAdminLog);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.isEdit) {
|
||||
updateAdminLog(this.$route.query.id, this.adminLog).then(response => {
|
||||
if(response.code==200){
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
}else{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
createAdminLog(this.adminLog).then(response => {
|
||||
if(response.code==200){
|
||||
this.$refs[formName].resetFields();
|
||||
this.adminLog = Object.assign({},defaultAdminLog);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
}else{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.adminLog = Object.assign({},defaultAdminLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
231
mallplusui-web-admin/src/views/sys/adminLog/index.vue
Normal file
231
mallplusui-web-admin/src/views/sys/adminLog/index.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchAdminLogList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="adminLogTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
|
||||
<el-table-column label="用户名" align="center">
|
||||
<template slot-scope="scope">{{scope.row.userName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接口类型" align="center">
|
||||
<template slot-scope="scope">{{scope.row.serviceName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接口" align="center">
|
||||
<template slot-scope="scope">{{scope.row.method}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.timeMin}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center">
|
||||
<template slot-scope="scope">{{scope.row.createTime|formatCreateTime}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="IP" align="center">
|
||||
<template slot-scope="scope">{{scope.row.ip}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数数据显示xxxxxxxx" align="center">
|
||||
<template slot-scope="scope">{{scope.row.params}}</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {fetchList, deleteAdminLog} from '@/api/sys/adminLog'
|
||||
import {formatDate} from '@/utils/date';
|
||||
export default {
|
||||
name: 'adminLogList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示品牌",
|
||||
value: "showAdminLog"
|
||||
},
|
||||
{
|
||||
label: "隐藏品牌",
|
||||
value: "hideAdminLog"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updateAdminLog', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该品牌', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteAdminLog(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchAdminLogList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showAdminLog') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideAdminLog') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addAdminLog() {
|
||||
this.$router.push({path: '/build/add${className}'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
14
mallplusui-web-admin/src/views/sys/adminLog/update.vue
Normal file
14
mallplusui-web-admin/src/views/sys/adminLog/update.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<adminLog-detail :is-edit='true'></adminLog-detail>
|
||||
</template>
|
||||
<script>
|
||||
import AdminLogDetail from './components/AdminLogDetail'
|
||||
export default {
|
||||
name: 'updateAdminLog',
|
||||
components: { AdminLogDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
98
mallplusui-web-admin/src/views/sys/aliPay/config.vue
Normal file
98
mallplusui-web-admin/src/views/sys/aliPay/config.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="100px">
|
||||
<el-form-item label="appId" prop="appId">
|
||||
<el-input v-model="form.appId" style="width: 40%"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">应用APPID,收款账号既是APPID对应支付宝账号</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="商家账号" prop="sysServiceProviderId">
|
||||
<el-input v-model="form.sysServiceProviderId" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">商家账号</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户私钥" prop="privateKey">
|
||||
<el-input v-model="form.privateKey" type="password" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">商户私钥,你的PKCS8格式RSA2私钥</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付宝公钥" prop="publicKey">
|
||||
<el-input v-model="form.publicKey" type="password" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">支付宝公钥</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="回调地址" prop="returnUrl">
|
||||
<el-input v-model="form.returnUrl" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">订单完成后返回的地址</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="异步通知" prop="notifyUrl">
|
||||
<el-input v-model="form.notifyUrl" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">支付结果异步通知地址</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button :loading="loading" size="medium" type="primary" @click="doSubmit">保存配置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { get, update } from '@/api/sys/alipay'
|
||||
export default {
|
||||
name: 'Config',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
form: { appId: '', sysServiceProviderId: '', privateKey: '', publicKey: '', returnUrl: '', notifyUrl: '' },
|
||||
rules: {
|
||||
appId: [
|
||||
{ required: true, message: 'appId', trigger: 'blur' }
|
||||
],
|
||||
sysServiceProviderId: [
|
||||
{ required: true, message: '请输入商家账号', trigger: 'blur' }
|
||||
],
|
||||
privateKey: [
|
||||
{ required: true, message: '商户私钥不能为空', trigger: 'blur' }
|
||||
],
|
||||
publicKey: [
|
||||
{ required: true, message: '支付宝公钥不能为空', trigger: 'blur' }
|
||||
],
|
||||
returnUrl: [
|
||||
{ required: true, message: '回调地址不能为空', trigger: 'blur' }
|
||||
],
|
||||
notifyUrl: [
|
||||
{ required: true, message: '回调地址不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
get().then(res => {
|
||||
this.form = res.data
|
||||
})
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
update(this.form).then(res => {
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
49
mallplusui-web-admin/src/views/sys/aliPay/index.vue
Normal file
49
mallplusui-web-admin/src/views/sys/aliPay/index.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" style="padding-left: 5px;">
|
||||
<el-tab-pane label="参数配置" name="first">
|
||||
<Config/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="支付测试" name="second">
|
||||
<ToPay/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="使用说明" name="third">
|
||||
<div>
|
||||
<blockquote class="my-blockquote">注意</blockquote>
|
||||
<pre class="my-code">
|
||||
测试所用参数都是沙箱环境,仅供测试使用,申请地址:<a style="color: #00a0e9" href="https://openhome.alipay.com/platform/appDaily.htm?tab=info" target="_blank">支付宝开发平台</a>
|
||||
如需付款测试,请使用
|
||||
账号:uuxesw9745@sandbox.com
|
||||
密码与支付密码:111111</pre>
|
||||
<blockquote class="my-blockquote"> 支付设置</blockquote>
|
||||
<pre class="my-code">
|
||||
// 支付提供两个接口,
|
||||
// PC端与手机端,并且在前端使用代码识别
|
||||
if (/(Android)/i.test(navigator.userAgent)){ // 判断是否为Android手机
|
||||
url = "/aliPay/toPayAsWeb"
|
||||
}else if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)){ // 判断是否为苹果手机
|
||||
url = "/aliPay/toPayAsWeb"
|
||||
} else {
|
||||
url = "/aliPay/toPayAsPC"
|
||||
}</pre>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Config from './config'
|
||||
import ToPay from './toPay'
|
||||
import '@/styles/description.scss'
|
||||
export default {
|
||||
name: 'AliPay',
|
||||
components: { Config, ToPay },
|
||||
data() {
|
||||
return {
|
||||
activeName: 'second'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
86
mallplusui-web-admin/src/views/sys/aliPay/toPay.vue
Normal file
86
mallplusui-web-admin/src/views/sys/aliPay/toPay.vue
Normal file
@@ -0,0 +1,86 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="90px">
|
||||
<el-form-item label="商品名称" prop="subject">
|
||||
<el-input v-model="form.subject" style="width: 35%"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品价格" prop="totalAmount">
|
||||
<el-input v-model="form.totalAmount" style="width: 35%"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">测试允许区间(0,5000]</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品描述" prop="body">
|
||||
<el-input v-model="form.body" style="width: 35%" rows="8" type="textarea"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button :loading="loading" size="medium" type="primary" @click="doSubmit">去支付</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { toAliPay } from '@/api/sys/alipay'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
url: '',
|
||||
// 新窗口的引用
|
||||
newWin: null,
|
||||
loading: false, form: { subject: '', totalAmount: '', body: '' },
|
||||
rules: {
|
||||
subject: [
|
||||
{ required: true, message: '商品名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
totalAmount: [
|
||||
{ required: true, message: '商品价格不能为空', trigger: 'blur' }
|
||||
],
|
||||
body: [
|
||||
{ required: true, message: '商品描述不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
url(newVal, oldVal) {
|
||||
if (newVal && this.newWin) {
|
||||
this.newWin.sessionStorage.clear()
|
||||
this.newWin.location.href = newVal
|
||||
// 重定向后把url和newWin重置
|
||||
this.url = ''
|
||||
this.newWin = null
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
// 先打开一个空的新窗口,再请求
|
||||
this.newWin = window.open()
|
||||
let url = ''
|
||||
if (/(Android)/i.test(navigator.userAgent)) { // 判断是否为Android手机
|
||||
url = 'aliPay/toPayAsWeb'
|
||||
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { // 判断是否为苹果手机
|
||||
url = 'aliPay/toPayAsWeb'
|
||||
} else {
|
||||
url = 'aliPay/toPayAsPC'
|
||||
}
|
||||
toAliPay(url, this.form).then(res => {
|
||||
this.loading = false
|
||||
this.url = res.data
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err)
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
14
mallplusui-web-admin/src/views/sys/area/add.vue
Normal file
14
mallplusui-web-admin/src/views/sys/area/add.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<area-detail :is-edit='false'></area-detail>
|
||||
</template>
|
||||
<script>
|
||||
import AreaDetail from './components/AreaDetail'
|
||||
export default {
|
||||
name: 'addArea',
|
||||
components: { AreaDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="area" :rules="rules" ref="areaFrom" label-width="150px">
|
||||
<el-form-item label=":" prop="id">
|
||||
<el-input v-model="area.id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label=":" prop="pid">
|
||||
<el-input v-model="area.pid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="层级:" prop="deep">
|
||||
<el-input v-model="area.deep"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称:" prop="name">
|
||||
<el-input v-model="area.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="拼音前缀:" prop="pinyinPrefix">
|
||||
<el-input v-model="area.pinyinPrefix"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="拼音:" prop="pinyin">
|
||||
<el-input v-model="area.pinyin"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注名:" prop="extId">
|
||||
<el-input v-model="area.extId"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注名:" prop="extName">
|
||||
<el-input v-model="area.extName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('areaFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('areaFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createArea, getArea, updateArea} from '@/api/area'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
const defaultArea={
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'AreaDetail',
|
||||
components:{SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
area:Object.assign({}, defaultArea),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo: [
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort: [
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getArea(this.$route.query.id).then(response => {
|
||||
this.area = response.data;
|
||||
});
|
||||
}else{
|
||||
this.area = Object.assign({},defaultArea);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.isEdit) {
|
||||
updateArea(this.$route.query.id, this.area).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
} else {
|
||||
createArea(this.area).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.area = Object.assign({},defaultArea);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.area = Object.assign({},defaultArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
278
mallplusui-web-admin/src/views/sys/area/index.vue
Normal file
278
mallplusui-web-admin/src/views/sys/area/index.vue
Normal file
@@ -0,0 +1,278 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchAreaList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="名称:">
|
||||
<el-input v-model="listQuery.name" class="input-width" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="级别:">
|
||||
<el-select v-model="listQuery.deep" placeholder="全部" clearable class="input-width">
|
||||
<el-option v-for="item in typeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-form-item label="编码:">
|
||||
<el-input v-model="listQuery.id" class="input-width" placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="父编码:">
|
||||
<el-input v-model="listQuery.pid" class="input-width" placeholder="父编码"></el-input>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="areaTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="编码" align="center">
|
||||
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="父编码" align="center">
|
||||
<template slot-scope="scope">{{scope.row.pid}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="层级" align="center">
|
||||
<template slot-scope="scope">{{scope.row.deep}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="名称" align="center">
|
||||
<template slot-scope="scope">{{scope.row.name}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="拼音前缀" align="center">
|
||||
<template slot-scope="scope">{{scope.row.pinyinPrefix}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="拼音" align="center">
|
||||
<template slot-scope="scope">{{scope.row.pinyin}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注名" align="center">
|
||||
<template slot-scope="scope">{{scope.row.extId}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注名" align="center">
|
||||
<template slot-scope="scope">{{scope.row.extName}}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="operateType" placeholder="批量操作">
|
||||
<el-option
|
||||
v-for="item in operates"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="search-button"
|
||||
@click="handleBatchOperate()"
|
||||
type="primary"
|
||||
size="small">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {fetchList, deleteArea} from '@/api/area'
|
||||
const defaultTypeOptions=[
|
||||
{
|
||||
label: '省级',
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '市级',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '县级',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '区级',
|
||||
value: 3
|
||||
}
|
||||
];
|
||||
export default {
|
||||
name: 'areaList',
|
||||
data() {
|
||||
return {
|
||||
typeOptions:Object.assign({},defaultTypeOptions),
|
||||
operates: [
|
||||
{
|
||||
label: "显示品牌",
|
||||
value: "showArea"
|
||||
},
|
||||
{
|
||||
label: "隐藏品牌",
|
||||
value: "hideArea"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updateArea', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该品牌', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteArea(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchAreaList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showArea') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideArea') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addArea() {
|
||||
this.$router.push({path: '/sys/addArea'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
14
mallplusui-web-admin/src/views/sys/area/update.vue
Normal file
14
mallplusui-web-admin/src/views/sys/area/update.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<area-detail :is-edit='true'></area-detail>
|
||||
</template>
|
||||
<script>
|
||||
import AreaDetail from './components/AreaDetail'
|
||||
export default {
|
||||
name: 'updateArea',
|
||||
components: { AreaDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/dict/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/dict/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<dict-detail :is-edit='false'>
|
||||
</dict-detail>
|
||||
</template>
|
||||
<script>
|
||||
import DictDetail from './components/DictDetail'
|
||||
|
||||
export default {
|
||||
name: 'addDict',
|
||||
components: {DictDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="dict" :rules="rules" ref="dictFrom" label-width="150px">
|
||||
|
||||
<el-form-item label="类型:" prop="type">
|
||||
<el-input v-model="dict.type"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签:" prop="key">
|
||||
<el-input v-model="dict.keyname"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="值:" prop="value">
|
||||
<el-input v-model="dict.valuename"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input v-model="dict.remark"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('dictFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('dictFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createDict, getDict, updateDict} from '@/api/sys/dict'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
const defaultDict= {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'DictDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dict:
|
||||
Object.assign({},
|
||||
defaultDict),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo
|
||||
:
|
||||
[
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort
|
||||
:
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getDict(this.$route.query.id).then(response => {
|
||||
this.dict = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.dict = Object.assign({},
|
||||
defaultDict)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateDict(this.$route.query.id, this.dict).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createDict(this.dict).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.dict = Object.assign({},
|
||||
defaultDict)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.dict = Object.assign({},
|
||||
defaultDict)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
256
mallplusui-web-admin/src/views/sys/dict/index.vue
Normal file
256
mallplusui-web-admin/src/views/sys/dict/index.vue
Normal file
@@ -0,0 +1,256 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchDictList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addDict()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="dictTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="" align="center">
|
||||
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" align="center">
|
||||
<template slot-scope="scope">{{scope.row.type}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标签" align="center">
|
||||
<template slot-scope="scope">{{scope.row.keyname}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="值" align="center">
|
||||
<template slot-scope="scope">{{scope.row.valuename}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">{{scope.row.remark}}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteDict} from '@/api/sys/dict'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'dictList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示类型",
|
||||
value: "showDict"
|
||||
},
|
||||
{
|
||||
label: "隐藏类型",
|
||||
value: "hideDict"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.totalPage;
|
||||
this.pageSize = response.data.pageSize;
|
||||
})
|
||||
;
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/sys/updateDict', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteDict(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
})
|
||||
;
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchDictList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showDict') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideDict') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addDict() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/sys/addDict'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/dict/update.vue
Normal file
16
mallplusui-web-admin/src/views/sys/dict/update.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<dict-detail :is-edit='true'>
|
||||
</dict-detail>
|
||||
</template>
|
||||
<script>
|
||||
import DictDetail from './components/DictDetail'
|
||||
|
||||
export default {
|
||||
name: 'updateDict',
|
||||
components: {DictDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
91
mallplusui-web-admin/src/views/sys/email/config.vue
Normal file
91
mallplusui-web-admin/src/views/sys/email/config.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="100px">
|
||||
<el-form-item label="发件人邮箱" prop="fromUser">
|
||||
<el-input v-model="form.fromUser" style="width: 40%"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">Sender mailbox</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="发件用户名" prop="user">
|
||||
<el-input v-model="form.user" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">Sender usernamex</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮箱密码" prop="pass">
|
||||
<el-input v-model="form.pass" type="password" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">email Password</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="SMTP地址" prop="host">
|
||||
<el-input v-model="form.host" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">SMTP address</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="SMTP端口" prop="port">
|
||||
<el-input v-model="form.port" style="width: 40%;"/>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">SMTP port</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button :loading="loading" size="medium" type="primary" @click="doSubmit">保存配置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { get, update } from '@/api/sys/email'
|
||||
export default {
|
||||
name: 'Config',
|
||||
data() {
|
||||
return {
|
||||
loading: false, form: { id: 1, fromUser: '', user: '', pass: '', host: '', port: '', sslEnable: '' },
|
||||
rules: {
|
||||
fromUser: [
|
||||
{ required: true, message: '请输入发件人邮箱', trigger: 'blur' },
|
||||
{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }
|
||||
],
|
||||
user: [
|
||||
{ required: true, message: '请输入发件用户名', trigger: 'blur' }
|
||||
],
|
||||
pass: [
|
||||
{ required: true, message: '密码不能为空', trigger: 'blur' }
|
||||
],
|
||||
host: [
|
||||
{ required: true, message: 'SMTP地址不能为空', trigger: 'blur' }
|
||||
],
|
||||
port: [
|
||||
{ required: true, message: 'SMTP端口不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
get(1).then(res => {
|
||||
this.form = res.data
|
||||
})
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
update(this.form).then(res => {
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
42
mallplusui-web-admin/src/views/sys/email/index.vue
Normal file
42
mallplusui-web-admin/src/views/sys/email/index.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" style="padding-left: 5px;">
|
||||
<el-tab-pane label="邮箱配置" name="first">
|
||||
<Config/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发送邮件" name="second">
|
||||
<Send/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="使用说明" name="third">
|
||||
<div>
|
||||
<blockquote class="my-blockquote"> 邮件服务器配置</blockquote>
|
||||
<pre class="my-code">
|
||||
# 邮件服务器的SMTP地址,可选,默认为smtp
|
||||
# 邮件服务器的SMTP端口,可选,默认465或者25
|
||||
# 发件人(必须正确,否则发送失败)
|
||||
# 用户名,默认为发件人邮箱前缀
|
||||
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,如QQ和163等等)
|
||||
# 是否开启ssl,默认开启</pre>
|
||||
<blockquote class="my-blockquote">更多帮助</blockquote>
|
||||
<pre class="my-code">更多帮助请查看文档:<a style="color:#009688" href="http://hutool.mydoc.io/#text_319499" target="_black">hutool工具包</a></pre>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Config from './config'
|
||||
import Send from './send'
|
||||
import '@/styles/description.scss'
|
||||
export default {
|
||||
name: 'Email',
|
||||
components: { Config, Send },
|
||||
data() {
|
||||
return {
|
||||
activeName: 'second'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
132
mallplusui-web-admin/src/views/sys/email/send.vue
Normal file
132
mallplusui-web-admin/src/views/sys/email/send.vue
Normal file
@@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="100px">
|
||||
<el-form-item label="邮件标题" prop="subject">
|
||||
<el-input v-model="form.subject" style="width: 40%"/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-for="(domain, index) in tos"
|
||||
:label="'收件邮箱' + (index === 0 ? '': index)"
|
||||
:key="domain.key">
|
||||
<el-input v-model="domain.value" style="width: 31%"/>
|
||||
<el-button icon="el-icon-plus" @click="addDomain" />
|
||||
<el-button style="margin-left:0px;" icon="el-icon-minus" @click.prevent="removeDomain(domain)"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="内容:" prop="content">
|
||||
<el-tabs v-model="activeHtmlName" type="card">
|
||||
|
||||
<tinymce :width="595" :height="300" v-model="form.content"></tinymce>
|
||||
|
||||
|
||||
</el-tabs>
|
||||
</el-form-item>
|
||||
<el-button :loading="loading" style="margin-left:1.6%;" size="medium" type="primary" @click="doSubmit">发送邮件</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { send } from '@/api/sys/email'
|
||||
import { validatEmail } from '@/utils/validate'
|
||||
import Tinymce from '@/components/Tinymce'
|
||||
export default {
|
||||
name: 'Index',
|
||||
components:{ Tinymce},
|
||||
data() {
|
||||
return {
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
},
|
||||
loading: false, form: { subject: '', tos: [], content: '' },
|
||||
tos: [{
|
||||
value: ''
|
||||
}],
|
||||
rules: {
|
||||
subject: [
|
||||
{ required: true, message: '标题不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
// sm.ms图床
|
||||
'imagesUploadApi',
|
||||
// 七牛云 按需选择
|
||||
'qiNiuUploadApi'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
removeDomain(item) {
|
||||
var index = this.tos.indexOf(item)
|
||||
if (index !== -1 && this.tos.length !== 1) {
|
||||
this.tos.splice(index, 1)
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请至少保留一位联系人',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
},
|
||||
addDomain() {
|
||||
this.tos.push({
|
||||
value: '',
|
||||
key: Date.now()
|
||||
})
|
||||
},
|
||||
doSubmit() {
|
||||
const _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
this.form.tos = []
|
||||
if (valid) {
|
||||
let sub = false
|
||||
this.tos.forEach(function(data, index) {
|
||||
if (data.value === '') {
|
||||
_this.$message({
|
||||
message: '收件邮箱不能为空',
|
||||
type: 'warning'
|
||||
})
|
||||
sub = true
|
||||
} else if (validatEmail(data.value)) {
|
||||
_this.form.tos.push(data.value)
|
||||
} else {
|
||||
_this.$message({
|
||||
message: '收件邮箱格式错误',
|
||||
type: 'warning'
|
||||
})
|
||||
sub = true
|
||||
}
|
||||
})
|
||||
if (sub) { return false }
|
||||
this.loading = true
|
||||
send(this.form).then(res => {
|
||||
this.$notify({
|
||||
title: '发送成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editor{
|
||||
text-align:left;
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
188
mallplusui-web-admin/src/views/sys/gen/generator.vue
Normal file
188
mallplusui-web-admin/src/views/sys/gen/generator.vue
Normal file
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button type="primary" size="mini" @click="toGen">生成代码</el-button>
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" title="代码生成配置" append-to-body width="880px">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="90px">
|
||||
<el-form-item label="模块名称" prop="moduleName">
|
||||
<el-input v-model="form.moduleName"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="至于包下" prop="pack">
|
||||
<el-input v-model="form.pack"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="前端路径" prop="path">
|
||||
<el-input v-model="form.path"/>
|
||||
</el-form-item>
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;margin-bottom: 15px">
|
||||
<el-table-column label="序号" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.$index + 1 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="columnName" label="字段名称"/>
|
||||
<el-table-column prop="columnType" label="字段类型"/>
|
||||
<el-table-column prop="columnComment" label="字段标题">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="data[scope.$index].columnComment" class="edit-input"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="查询方式">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="data[scope.$index].columnQuery" class="edit-input" clearable placeholder="请选择">
|
||||
<el-option
|
||||
label="模糊查询"
|
||||
value="1"/>
|
||||
<el-option
|
||||
label="精确查询"
|
||||
value="2"/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="columnShow" label="列表显示">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip :content="scope.row.columnShow === 'true' ?'显示':'不显示'" placement="top">
|
||||
<el-switch
|
||||
v-model="data[scope.$index].columnShow"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-value="true"
|
||||
inactive-value="false"/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item label="作者名称" prop="author">
|
||||
<el-input v-model="form.author"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单名称" prop="prefix">
|
||||
<el-input v-model="form.prefix" placeholder="菜单名称"/>
|
||||
</el-form-item>
|
||||
<!-- 可自定义显示配置 -->
|
||||
<!-- <el-form-item label="Api路径">-->
|
||||
<!-- <el-input v-model="form.apiPath"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="是否覆盖" prop="cover">
|
||||
<el-radio-group v-model="form.cover" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="genLoading" type="primary" @click="doSubmit">生成</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import initData from '@/mixins/initData'
|
||||
import { update, get,generator } from '@/api/sys/gen'
|
||||
|
||||
export default {
|
||||
name: 'Generator',
|
||||
mixins: [initData],
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
genLoading: false, dialog: false, columnQuery: '',
|
||||
form: { author: '', pack: '', path: '', moduleName: '', cover: 'false', apiPath: '', prefix: '' },
|
||||
rules: {
|
||||
author: [
|
||||
{ required: true, message: '作者不能为空', trigger: 'blur' }
|
||||
],
|
||||
pack: [
|
||||
{ required: true, message: '包路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
moduleName: [
|
||||
{ required: true, message: '包路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: '前端代码生成路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
cover: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toGen() {
|
||||
this.dialog = true
|
||||
this.time = 130
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
get().then(data => {
|
||||
this.form = data.data
|
||||
console.log(this.form)
|
||||
if (!this.form || !this.form.author){
|
||||
this.form= { author: 'mallplus', pack: 'com.zscat.mallplus.oms', path: 'web', moduleName: 'sys', cover: 'false', apiPath: 'web', prefix: '' };
|
||||
this.form.cover = this.form.cover.toString()
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
},
|
||||
beforeInit() {
|
||||
// this.form= { author: 'mallplus', pack: 'com.zscat.mallplus.oms', path: 'web', moduleName: 'sys', cover: 'false', apiPath: 'web', prefix: '' },
|
||||
this.url = 'gen/columns'
|
||||
const tableName = this.name
|
||||
this.params = { tableName }
|
||||
return true
|
||||
},
|
||||
cancel() {
|
||||
this.dialog = false
|
||||
this.genLoading = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = { author: '', pack: '', path: '', moduleName: '', cover: 'false', apiPath: '', prefix: '' }
|
||||
},
|
||||
doSubmit() {
|
||||
this.genLoading = true
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
update(this.form).then(res => {
|
||||
generator(this.data, this.name).then(res => {
|
||||
this.$notify({
|
||||
title: '生成成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.cancel()
|
||||
}).catch(err => {
|
||||
this.cancel()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
}).catch(err => {
|
||||
this.cancel()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.edit-input {
|
||||
.el-input__inner {
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .el-dialog__body{
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/deep/ .input-with-select .el-input-group__prepend {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
105
mallplusui-web-admin/src/views/sys/gen/index.vue
Normal file
105
mallplusui-web-admin/src/views/sys/gen/index.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-input v-model="query.name" clearable placeholder="请输入表名" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column label="序号" width="85" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>{{ scope.$index + 1 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="tableName" label="表名"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="engine" label="数据库引擎"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="coding" label="字符编码集"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="remark" label="备注"/>
|
||||
|
||||
<el-table-column label="操作" width="140px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<Generator :name="scope.row.tableName"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import initData from '@/mixins/initData'
|
||||
|
||||
import Generator from './generator'
|
||||
export default {
|
||||
name: 'GeneratorIndex',
|
||||
components: { Generator },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
form: { author: '', pack: '', path: '', moduleName: '', cover: 'false', apiPath: '', prefix: '' },
|
||||
rules: {
|
||||
author: [
|
||||
{ required: true, message: '作者不能为空', trigger: 'blur' }
|
||||
],
|
||||
pack: [
|
||||
{ required: true, message: '包路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
moduleName: [
|
||||
{ required: true, message: '包路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: '前端代码生成路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
apiPath: [
|
||||
{ required: true, message: '前端Api文件生成路径不能为空', trigger: 'blur' }
|
||||
],
|
||||
cover: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
beforeInit() {
|
||||
this.url = 'gen/tables'
|
||||
const query = this.query
|
||||
const name = query.name
|
||||
this.params = { page: this.page, size: this.size }
|
||||
if (name) { this.params['name'] = name }
|
||||
return true
|
||||
},
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
this.doUpdate()
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
300
mallplusui-web-admin/src/views/sys/gen/index1.vue
Normal file
300
mallplusui-web-admin/src/views/sys/gen/index1.vue
Normal file
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchRoleList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="会员名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addRole()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="genTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="表名称" align="center">
|
||||
<template slot-scope="scope">{{scope.row.tableName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="表描述" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.tableComment}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="codeGen(scope.row.tableName)">生成代码
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="operateType" placeholder="批量操作">
|
||||
<el-option
|
||||
v-for="item in operates"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="search-button"
|
||||
@click="handleBatchOperate()"
|
||||
type="primary"
|
||||
size="small">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {formatDate} from '@/utils/date';
|
||||
import {fetchList,codeGens} from '@/api/sys/gen'
|
||||
|
||||
export default {
|
||||
name: 'genList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示会员",
|
||||
value: "showRole"
|
||||
},
|
||||
{
|
||||
label: "隐藏会员",
|
||||
value: "hideRole"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters:{
|
||||
formatTime(time) {
|
||||
if(time==null||time===''){
|
||||
return 'N/A';
|
||||
}
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
formatStatus(status){
|
||||
for(let i=0;i<defaultStatusOptions.length;i++){
|
||||
if(status===defaultStatusOptions[i].value){
|
||||
return defaultStatusOptions[i].label;
|
||||
}
|
||||
}
|
||||
},
|
||||
formatReturnAmount(row){
|
||||
return row.productRealPrice*row.productCount;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
codeGen(tableName) {
|
||||
location.href = "http://localhost:8081/gen/code1/" + tableName;
|
||||
},
|
||||
codeGen1(tableName) {
|
||||
console.log(tableName);
|
||||
codeGens(tableName).then(response => {
|
||||
console.log(response);
|
||||
this.$message({
|
||||
message: '生成成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
console.log(response.data);
|
||||
this.listLoading = false;
|
||||
this.list = response.data;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.totalPage;
|
||||
this.pageSize = response.data.pageSize;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updateRole', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该会员', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRole(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
handleFactoryStatusChange(index, row) {
|
||||
var data = new URLSearchParams();
|
||||
data.append("ids", row.id);
|
||||
data.append("factoryStatus", row.factoryStatus);
|
||||
updateFactoryStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.factoryStatus === 0) {
|
||||
row.factoryStatus = 1;
|
||||
} else {
|
||||
row.factoryStatus = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleShowStatusChange(index, row) {
|
||||
let data = new URLSearchParams();
|
||||
;
|
||||
data.append("ids", row.id);
|
||||
data.append("showStatus", row.showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.showStatus === 0) {
|
||||
row.showStatus = 1;
|
||||
} else {
|
||||
row.showStatus = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchRoleList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showRole') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideRole') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addRole() {
|
||||
this.$router.push({path: '/pms/addRole'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/job/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/job/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<job-detail :is-edit='false'>
|
||||
</job-detail>
|
||||
</template>
|
||||
<script>
|
||||
import JobDetail from './components/JobDetail'
|
||||
|
||||
export default {
|
||||
name: 'addJob',
|
||||
components: {JobDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
177
mallplusui-web-admin/src/views/sys/job/components/JobDetail.vue
Normal file
177
mallplusui-web-admin/src/views/sys/job/components/JobDetail.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="subject" :rules="rules" ref="subjectFrom" label-width="150px">
|
||||
|
||||
<el-form-item label="任务名称:" prop="jobName">
|
||||
<el-input v-model="subject.jobName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="调用目标字符串:" prop="invokeTarget">
|
||||
<el-input v-model="subject.invokeTarget"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="cron表达式:" prop="cronExpression">
|
||||
<el-input v-model="subject.cronExpression"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="执行策略:" prop="misfirePolicy">
|
||||
<el-radio-group v-model="subject.misfirePolicy">
|
||||
<el-radio :label="1">立即执行</el-radio>
|
||||
<el-radio :label="2">执行一次</el-radio>
|
||||
<el-radio :label="3">放弃执行</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="并发执行:">
|
||||
<el-radio-group v-model="subject.concurrent">
|
||||
<el-radio :label="0">允许</el-radio>
|
||||
<el-radio :label="1">禁止</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="状态:">
|
||||
<el-radio-group v-model="subject.status">
|
||||
<el-radio :label="0">正常</el-radio>
|
||||
<el-radio :label="1">停止</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注:" prop="remark">
|
||||
<el-input v-model="subject.remark"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('subjectFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('subjectFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createJob, getJob, updateJob} from '@/api/sys/job'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultJob = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'JobDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
subject:Object.assign({}, defaultJob),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo:
|
||||
[
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort:
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getJob(this.$route.query.id).then(response => {
|
||||
this.subject = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.subject = Object.assign({},
|
||||
defaultJob)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.isEdit
|
||||
) {
|
||||
updateJob(this.$route.query.id, this.subject).then(response => {
|
||||
if (response.code == 200
|
||||
) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
} else {
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
} else {
|
||||
createJob(this.subject).then(response => {
|
||||
if (response.code == 200
|
||||
) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.subject = Object.assign({},
|
||||
defaultJob)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
} else {
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.subject = Object.assign({},
|
||||
defaultJob)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
377
mallplusui-web-admin/src/views/sys/job/index.vue
Normal file
377
mallplusui-web-admin/src/views/sys/job/index.vue
Normal file
@@ -0,0 +1,377 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchJobList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addJob()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="dictTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="任务编号" align="center">
|
||||
<template slot-scope="scope">{{scope.row.jobId}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务名称" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p> {{scope.row.jobName}}</p>
|
||||
<p>
|
||||
<el-button
|
||||
type="text"
|
||||
@click="handleShowVeriyEditDialog(scope.$index, scope.row)">执行日志
|
||||
</el-button>
|
||||
</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="任务分组" align="center">
|
||||
<template slot-scope="scope">{{scope.row.jobGroup}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调用目标字符串" align="center">
|
||||
<template slot-scope="scope">{{scope.row.invokeTarget}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="执行表达式" align="center">
|
||||
<template slot-scope="scope">{{scope.row.cronExpression}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务状态" align="center" >
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="handleRecomChange(scope.$index, scope.row)"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
v-model="scope.row.status">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column label="创建时间" align="center">
|
||||
<template slot-scope="scope">{{scope.row.createTime | formatCreateTime}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="run(scope.$index, scope.row)">执行一次
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<el-dialog
|
||||
title="执行日志"
|
||||
:visible.sync="dialogVisible"
|
||||
width="40%">
|
||||
<el-table style="width: 100%;margin-top: 20px"
|
||||
:data="blanceList"
|
||||
border>
|
||||
|
||||
<el-table-column label="日志编号" align="center">
|
||||
<template slot-scope="scope">{{scope.row.jobLogId}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务名称" align="center">
|
||||
<template slot-scope="scope">{{scope.row.jobName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调用目标字符串" align="center">
|
||||
<template slot-scope="scope">{{scope.row.invokeTarget}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="日志信息" align="center">
|
||||
<template slot-scope="scope">{{scope.row.jobMessage}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template slot-scope="scope">{{scope.row.status|formatStatus}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.createTime | formatCreateTime}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteJob,checkCronExpressionIsValid,changeStatus,run,fetchJobLogList} from '@/api/sys/job'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'dictList',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible:false,
|
||||
dialogVisible1:false,
|
||||
blanceList:null,
|
||||
operates: [
|
||||
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '正常';
|
||||
} else{
|
||||
return '停止';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleShowVeriyEditDialog(index,row){
|
||||
this.dialogVisible=true;
|
||||
fetchJobLogList({jobId:row.jobId,pageSize:100}).then(response=>{
|
||||
this.blanceList=response.data.records;
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.totalPage;
|
||||
this.pageSize = response.data.pageSize;
|
||||
})
|
||||
;
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/sys/updateJob', query: {id: row.jobId}})
|
||||
},
|
||||
run(index, row) {
|
||||
this.$confirm('是否要执行定时任务', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
run({ "jobId": row.jobId, "jobGroup": row.jobGroup}
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '执行成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
})
|
||||
;
|
||||
},
|
||||
handleRecomChange(index, row) {
|
||||
changeStatus({ "jobId": row.jobId, "jobGroup": row.jobGroup, "status": row.status}).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
stop(index, row) {
|
||||
this.$confirm('是否要停用任务', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
changeStatus({ "jobId": row.jobId, "jobGroup": row.jobGroup, "status": 1}
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '停用任务成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
})
|
||||
;
|
||||
},
|
||||
start(index, row) {
|
||||
this.$confirm('是否要启用任务', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
changeStatus({ "jobId": row.jobId, "jobGroup": row.jobGroup, "status": 0}
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '启用任务成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
})
|
||||
;
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteJob(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
})
|
||||
;
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchJobList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showJob') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideJob') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addJob() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/sys/addJob'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
152
mallplusui-web-admin/src/views/sys/job/joblog.vue
Normal file
152
mallplusui-web-admin/src/views/sys/job/joblog.vue
Normal file
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchJobList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入任务名称:">
|
||||
<el-input style="width: 203px" v-model="listQuery.jobName" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="dictTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="日志编号" align="center">
|
||||
<template slot-scope="scope">{{scope.row.jobLogId}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务名称" align="center">
|
||||
<template slot-scope="scope">{{scope.row.jobName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调用目标字符串" align="center">
|
||||
<template slot-scope="scope">{{scope.row.invokeTarget}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="日志信息" align="center">
|
||||
<template slot-scope="scope">{{scope.row.jobMessage}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template slot-scope="scope">{{scope.row.status |formatStatus}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.createTime | formatCreateTime}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchJobLogList} from '@/api/sys/job'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'dictList',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible:false,
|
||||
dialogVisible1:false,
|
||||
blanceList:null,
|
||||
operates: [
|
||||
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '正常';
|
||||
} else{
|
||||
return '停止';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchJobLogList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.totalPage;
|
||||
this.pageSize = response.data.pageSize;
|
||||
});
|
||||
},
|
||||
searchJobList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/job/update.vue
Normal file
16
mallplusui-web-admin/src/views/sys/job/update.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<job-detail :is-edit='true'>
|
||||
</job-detail>
|
||||
</template>
|
||||
<script>
|
||||
import JobDetail from './components/JobDetail'
|
||||
|
||||
export default {
|
||||
name: 'updateJob',
|
||||
components: {JobDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
14
mallplusui-web-admin/src/views/sys/permission/add.vue
Normal file
14
mallplusui-web-admin/src/views/sys/permission/add.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<permission-detail :is-edit='false'></permission-detail>
|
||||
</template>
|
||||
<script>
|
||||
import PermissionDetail from './components/PermisiionDetail'
|
||||
export default {
|
||||
name: 'addPermission',
|
||||
components: { PermissionDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="permission" :rules="rules" ref="permissionFrom" label-width="150px">
|
||||
<el-form-item label="类别:" prop="name">
|
||||
<el-radio-group v-model="permission.type" @change="getPermissionCategoryList">
|
||||
<el-radio :label="0" >目录</el-radio>
|
||||
<el-radio :label="1" >菜单</el-radio>
|
||||
<el-radio :label="2" >按钮</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="权限名:" prop="name">
|
||||
<el-input v-model="permission.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="权限值:">
|
||||
<el-input v-model="permission.value"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单url:">
|
||||
<el-input v-model="permission.uri"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级菜单:" prop="type" v-if="permission.type>0">
|
||||
<el-select
|
||||
v-model="permission.pid"
|
||||
|
||||
placeholder="请选择上级菜单">
|
||||
<el-option
|
||||
v-for="item in permissionCategoryOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单排序:">
|
||||
<el-input v-model="permission.sort"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单图像:" prop="logo">
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
width="450"
|
||||
trigger="click"
|
||||
@show="$refs['iconSelect'].reset()">
|
||||
<IconSelect ref="iconSelect" @selected="selected" />
|
||||
<el-input slot="reference" v-model="permission.icon" style="width: 450px;" placeholder="点击选择图标" readonly>
|
||||
<svg-icon v-if="permission.icon" slot="prefix" :icon-class="permission.icon" class="el-input__icon" style="height: 32px;width: 16px;" />
|
||||
<i v-else slot="prefix" class="el-icon-search el-input__icon"/>
|
||||
</el-input>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否显示:">
|
||||
<el-radio-group v-model="permission.status">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('permissionFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('permissionFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createPermission, getPermission, updatePermission,fetchList} from '@/api/permission'
|
||||
import IconSelect from '@/components/IconSelect'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
const defaultPermission={
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'PermissionDetail',
|
||||
components:{SingleUpload,IconSelect},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listQuery: {
|
||||
type: null
|
||||
},
|
||||
selectPermissionCategoryValue:[],
|
||||
permissionCategoryOptions: [],
|
||||
typeName:'',
|
||||
permission:Object.assign({}, defaultPermission),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入菜单名', trigger: 'blur'}
|
||||
],
|
||||
type: [{required: true, message: '请选择菜单类型', trigger: 'blur'}]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getPermission(this.$route.query.id).then(response => {
|
||||
this.permission = response.data;
|
||||
this.getPermissionCategoryList();
|
||||
});
|
||||
}else{
|
||||
this.permission = Object.assign({},defaultPermission);
|
||||
|
||||
}
|
||||
// this.getPermissionCategoryList();
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleTypeChange(val) {
|
||||
let typeId = 0;
|
||||
for (let i = 0; i < this.permissionCategoryOptions.length; i++) {
|
||||
if (this.permissionCategoryOptions[i].value === val) {
|
||||
typeId = this.permissionCategoryOptions[i].value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.permission.type = typeId;
|
||||
},
|
||||
getPermissionCategoryList(){
|
||||
this.permissionCategoryOptions.length=0;
|
||||
if (this.permission.type){
|
||||
this.listQuery.type=this.permission.type-1;
|
||||
}
|
||||
|
||||
fetchList(this.listQuery).then(response => {
|
||||
let list = response.data;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
this.permissionCategoryOptions.push({label: list[i].name, value: list[i].id});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.isEdit) {
|
||||
updatePermission(this.$route.query.id, this.permission).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
} else {
|
||||
createPermission(this.permission).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.permission = Object.assign({},defaultPermission);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
selected(name) {
|
||||
this.permission.icon = name
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.permission = Object.assign({},defaultPermission);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" :before-close="cancel" :title="isAdd ? '新增菜单' : '编辑菜单'" append-to-body width="580px">
|
||||
<el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="菜单类型">
|
||||
<el-radio-group v-model="form.type" size="mini" style="width: 178px">
|
||||
<el-radio-button label="0">目录</el-radio-button>
|
||||
<el-radio-button label="1">菜单</el-radio-button>
|
||||
<el-radio-button label="2">按钮</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2'" label="菜单图标">
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
width="450"
|
||||
trigger="click"
|
||||
@show="$refs['iconSelect'].reset()">
|
||||
<IconSelect ref="iconSelect" @selected="selected" />
|
||||
<el-input slot="reference" v-model="form.icon" style="width: 450px;" placeholder="点击选择图标" readonly>
|
||||
<svg-icon v-if="form.icon" slot="prefix" :icon-class="form.icon" class="el-input__icon" style="height: 32px;width: 16px;" />
|
||||
<i v-else slot="prefix" class="el-icon-search el-input__icon"/>
|
||||
</el-input>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2'" label="外链菜单">
|
||||
<el-radio-group v-model="form.iframe" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() === '1'" label="菜单缓存">
|
||||
<el-radio-group v-model="form.cache" size="mini">
|
||||
<el-radio-button label="true">是</el-radio-button>
|
||||
<el-radio-button label="false">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2'" label="菜单可见">
|
||||
<el-radio-group v-model="form.hidden" size="mini">
|
||||
<el-radio-button label="false">是</el-radio-button>
|
||||
<el-radio-button label="true">否</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '2'" label="菜单标题" prop="name">
|
||||
<el-input v-model="form.name" :style=" form.type.toString() === '0' ? 'width: 450px' : 'width: 178px'" placeholder="菜单标题"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() === '2'" label="按钮名称">
|
||||
<el-input v-model="form.name" placeholder="按钮名称" style="width: 178px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.type.toString() !== '0'" label="权限标识">
|
||||
<el-input :disabled="form.iframe === 'true'" v-model="form.permission" placeholder="权限标识" style="width: 178px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.type.toString() !== '2'" label="路由地址" prop="path">
|
||||
<el-input v-model="form.path" placeholder="路由地址" style="width: 178px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单排序">
|
||||
<el-input-number v-model.number="form.sort" :min="0" :max="999" controls-position="right" style="width: 178px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.iframe === 'false' && form.type.toString() === '1'" label="组件名称">
|
||||
<el-input v-model="form.componentName" style="width: 178px;" placeholder="匹配组件内Name字段"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-show="form.iframe === 'false' && form.type.toString() === '1'" label="组件路径">
|
||||
<el-input v-model="form.component" style="width: 178px;" placeholder="组件路径"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级类目">
|
||||
<treeselect v-model="form.pid" :options="menus" style="width: 450px;" placeholder="选择上级类目" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit, getMenusTree } from '@/api/menu'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import IconSelect from '@/components/IconSelect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
export default {
|
||||
components: { Treeselect, IconSelect },
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false, menus: [],
|
||||
form: { name: '', sort: 999, path: '', component: '', componentName: '', iframe: 'false', roles: [], pid: 0, icon: '', cache: false, hidden: false, type: 0, permission: '' },
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||
],
|
||||
path: [
|
||||
{ required: true, message: '请输入地址', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else this.doEdit()
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
doAdd() {
|
||||
add(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = { name: '', sort: 999, path: '', component: '', componentName: '', iframe: 'false', roles: [], pid: 0, icon: '', cache: false, hidden: false, type: 0, permission: '' }
|
||||
},
|
||||
selected(name) {
|
||||
this.form.icon = name
|
||||
},
|
||||
getMenus() {
|
||||
getMenusTree().then(res => {
|
||||
this.menus = []
|
||||
const menu = { id: 0, label: '顶级类目', children: [] }
|
||||
menu.children = res
|
||||
this.menus.push(menu)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
/deep/ .el-input-number .el-input__inner {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
330
mallplusui-web-admin/src/views/sys/permission/index.vue
Normal file
330
mallplusui-web-admin/src/views/sys/permission/index.vue
Normal file
@@ -0,0 +1,330 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchPermissionList()"
|
||||
type="primary"
|
||||
size="small" icon="el-icon-search">
|
||||
搜索
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.pid" placeholder="父编号"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addPermission()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table
|
||||
:data="list"
|
||||
border
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="80"
|
||||
label="ID">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="pid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="120"
|
||||
label="上级ID">
|
||||
</el-table-column>
|
||||
<table-tree-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
treeKey="id"
|
||||
width="200"
|
||||
label="名称">
|
||||
</table-tree-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="uri"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
:show-overflow-tooltip="true"
|
||||
label="菜单URL">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="value"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
:show-overflow-tooltip="true"
|
||||
label="授权标识">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
:show-overflow-tooltip="true"
|
||||
label="菜单排序">
|
||||
</el-table-column>
|
||||
<el-table-column label="是否显示" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="handleShowStatusChange(scope.$index, scope.row)"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
v-model="scope.row.status">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="添加时间" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.createTime | formatTime}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {formatDate} from '@/utils/date';
|
||||
import TableTreeColumn from '@/components/table-tree-column/index';
|
||||
import {treeDataTranslate} from '@/utils/index';
|
||||
import {deletePermission, fetchList, updateFactoryStatus, updateShowStatus} from '@/api/permission'
|
||||
export default {
|
||||
name: 'permissionList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示",
|
||||
value: "showPermission"
|
||||
},
|
||||
{
|
||||
label: "隐藏",
|
||||
value: "hidePermission"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null
|
||||
},
|
||||
list: [],
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
components: {
|
||||
TableTreeColumn
|
||||
},
|
||||
filters: {
|
||||
// formatMenuType(value) {
|
||||
// if (value === 1) {
|
||||
// return '菜单';
|
||||
// } else if (value === 2) {
|
||||
// return '按钮';
|
||||
// } else if (value === 0) {
|
||||
// return '目录';
|
||||
// }
|
||||
// },
|
||||
formatTime(time) {
|
||||
if (time == null || time === '') {
|
||||
return 'N/A';
|
||||
}
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
formatStatus(status) {
|
||||
for (let i = 0; i < defaultStatusOptions.length; i++) {
|
||||
if (status === defaultStatusOptions[i].value) {
|
||||
return defaultStatusOptions[i].label;
|
||||
}
|
||||
}
|
||||
},
|
||||
formatReturnAmount(row) {
|
||||
return row.productRealPrice * row.productCount;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
|
||||
this.listLoading = false;
|
||||
this.list = treeDataTranslate(response.data, 'id',"pid");
|
||||
|
||||
// this.total = response.data.length;
|
||||
// this.totalPage = response.data.pages;
|
||||
// this.pageSize = response.data.size;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updatePermission', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该条记录', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deletePermission(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
handleFactoryStatusChange(index, row) {
|
||||
var data = new URLSearchParams();
|
||||
data.append("ids", row.id);
|
||||
data.append("factoryStatus", row.factoryStatus);
|
||||
updateFactoryStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.factoryStatus === 0) {
|
||||
row.factoryStatus = 1;
|
||||
} else {
|
||||
row.factoryStatus = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleShowStatusChange(index, row) {
|
||||
let data = new URLSearchParams();
|
||||
;
|
||||
data.append("ids", row.id);
|
||||
data.append("showStatus", row.status);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.showStatus === 0) {
|
||||
row.showStatus = 1;
|
||||
} else {
|
||||
row.showStatus = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchPermissionList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showPermission') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hidePermission') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addPermission() {
|
||||
this.$router.push({path: '/sys/addPermission'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
14
mallplusui-web-admin/src/views/sys/permission/update.vue
Normal file
14
mallplusui-web-admin/src/views/sys/permission/update.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<permission-detail :is-edit='true'></permission-detail>
|
||||
</template>
|
||||
<script>
|
||||
import PermissionDetail from './components/PermisiionDetail'
|
||||
export default {
|
||||
name: 'updatePermission',
|
||||
components: { PermissionDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<permissionCategory-detail :is-edit='false'></permissionCategory-detail>
|
||||
</template>
|
||||
<script>
|
||||
import PermissionCategoryDetail from './components/PermissionCategoryDetail'
|
||||
export default {
|
||||
name: 'addPermissionCategory',
|
||||
components: { PermissionCategoryDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="permissionCategory" :rules="rules" ref="permissionCategoryFrom" label-width="150px">
|
||||
<el-form-item label=":" prop="id" style="display: none">
|
||||
<el-input v-model="permissionCategory.id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型名称:" prop="name">
|
||||
<el-input v-model="permissionCategory.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型图标:" prop="icon">
|
||||
<el-input v-model="permissionCategory.icon"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型数量:" prop="typeCount">
|
||||
<el-input v-model="permissionCategory.typeCount"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:" prop="showStatus">
|
||||
<el-input v-model="permissionCategory.showStatus"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序:" prop="sort">
|
||||
<el-input v-model="permissionCategory.sort"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('permissionCategoryFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('permissionCategoryFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createPermissionCategory, getPermissionCategory, updatePermissionCategory} from '@/api/sys/permissionCategory'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
import {formatDate} from '@/utils/date';
|
||||
const defaultPermissionCategory={
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'PermissionCategoryDetail',
|
||||
components:{SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permissionCategory:Object.assign({}, defaultPermissionCategory),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入类型名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getPermissionCategory(this.$route.query.id).then(response => {
|
||||
this.permissionCategory = response.data;
|
||||
});
|
||||
}else{
|
||||
this.permissionCategory = Object.assign({},defaultPermissionCategory);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.isEdit) {
|
||||
updatePermissionCategory(this.$route.query.id, this.permissionCategory).then(response => {
|
||||
if(response.code==200){
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
}else{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
createPermissionCategory(this.permissionCategory).then(response => {
|
||||
if(response.code==200){
|
||||
this.$refs[formName].resetFields();
|
||||
this.permissionCategory = Object.assign({},defaultPermissionCategory);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
}else{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.permissionCategory = Object.assign({},defaultPermissionCategory);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
250
mallplusui-web-admin/src/views/sys/permissionCategory/index.vue
Normal file
250
mallplusui-web-admin/src/views/sys/permissionCategory/index.vue
Normal file
@@ -0,0 +1,250 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchPermissionCategoryList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addPermissionCategory()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="permissionCategoryTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="id" align="center">
|
||||
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型名称" align="center">
|
||||
<template slot-scope="scope">{{scope.row.name}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型图标" align="center">
|
||||
<template slot-scope="scope">{{scope.row.icon}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型数量" align="center">
|
||||
<template slot-scope="scope">{{scope.row.typeCount}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template slot-scope="scope">{{scope.row.showStatus}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sort}}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {fetchList, deletePermissionCategory} from '@/api/sys/permissionCategory'
|
||||
import {formatDate} from '@/utils/date';
|
||||
export default {
|
||||
name: 'permissionCategoryList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示类型",
|
||||
value: "showPermissionCategory"
|
||||
},
|
||||
{
|
||||
label: "隐藏类型",
|
||||
value: "hidePermissionCategory"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
console.log(response.data);
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.totalPage;
|
||||
this.pageSize = response.data.pageSize;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updatePermissionCategory', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deletePermissionCategory(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchPermissionCategoryList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showPermissionCategory') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hidePermissionCategory') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addPermissionCategory() {
|
||||
//手动将route,改成$router
|
||||
this.$router.push({path: '/sys/addPermissionCategory'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<permissionCategory-detail :is-edit='true'></permissionCategory-detail>
|
||||
</template>
|
||||
<script>
|
||||
import PermissionCategoryDetail from './components/PermissionCategoryDetail'
|
||||
export default {
|
||||
name: 'updatePermissionCategory',
|
||||
components: { PermissionCategoryDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
261
mallplusui-web-admin/src/views/sys/picture/index.vue
Normal file
261
mallplusui-web-admin/src/views/sys/picture/index.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!--搜索-->
|
||||
<el-input v-model="query.filename" clearable placeholder="输入文件名" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-date-picker
|
||||
v-model="query.date"
|
||||
type="daterange"
|
||||
range-separator=":"
|
||||
class="el-range-editor--small filter-item"
|
||||
style="height: 30.5px;width: 220px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 上传 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
v-permission="['admin','pictures:add']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-upload"
|
||||
@click="dialog = true">上传图片</el-button>
|
||||
</div>
|
||||
<div v-permission="['admin','pictures:del']" style="display: inline-block;">
|
||||
<el-button
|
||||
:loading="delAllLoading"
|
||||
:disabled="data.length === 0 || $refs.table.selection.length === 0"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="open">删除</el-button>
|
||||
</div>
|
||||
<!-- 导出 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
:loading="downloadLoading"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="download">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--上传图片-->
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" append-to-body width="600px" @close="doSubmit">
|
||||
<el-upload
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:before-remove="handleBeforeRemove"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:action="imagesUploadApi"
|
||||
list-type="picture-card">
|
||||
<i class="el-icon-plus"/>
|
||||
</el-upload>
|
||||
<el-dialog :append-to-body="true" :visible.sync="dialogVisible">
|
||||
<img :src="dialogImageUrl" width="100%" alt="">
|
||||
</el-dialog>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" ref="table" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="filename" label="文件名"/>
|
||||
<el-table-column prop="username" label="上传者"/>
|
||||
<el-table-column ref="table" :show-overflow-tooltip="true" prop="url" label="缩略图">
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.url" style="color: #42b983" target="_blank"><img :src="scope.row.url" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="size" label="文件大小"/>
|
||||
<el-table-column prop="height" label="高度"/>
|
||||
<el-table-column prop="width" label="宽度"/>
|
||||
<el-table-column width="180px" prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['admin','pictures:del'])" label="操作" width="100px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
:ref="scope.row.id"
|
||||
placement="top"
|
||||
width="180">
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission' // 权限判断函数
|
||||
import initData from '@/mixins/initData'
|
||||
import { parseTime, downloadFile } from '@/utils/index'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { del, delAll, downloadPicture } from '@/api/picture'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'Pictures',
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
delAllLoading: false,
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
},
|
||||
dialog: false,
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
pictures: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'imagesUploadApi'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'api/pictures'
|
||||
const sort = 'id,desc'
|
||||
const query = this.query
|
||||
const filename = query.filename
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
if (filename) { this.params[filename] = filename }
|
||||
if (query.date) {
|
||||
this.params['startTime'] = query.date[0]
|
||||
this.params['endTime'] = query.date[1]
|
||||
}
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
this.delLoading = true
|
||||
del(id).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doDelete() {
|
||||
this.delAllLoading = true
|
||||
const data = this.$refs.table.selection
|
||||
const ids = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
ids.push(data[i].id)
|
||||
}
|
||||
delAll(ids).then(res => {
|
||||
this.delAllLoading = false
|
||||
this.init()
|
||||
this.dleChangePage(ids.length)
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delAllLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.$confirm('你确定删除选中的数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.doDelete()
|
||||
})
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
const uid = file.uid
|
||||
const id = response.id
|
||||
this.pictures.push({ uid, id })
|
||||
},
|
||||
handleBeforeRemove(file, fileList) {
|
||||
for (let i = 0; i < this.pictures.length; i++) {
|
||||
if (this.pictures[i].uid === file.uid) {
|
||||
del(this.pictures[i].id).then(res => {})
|
||||
return true
|
||||
}
|
||||
}
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
// 刷新列表数据
|
||||
doSubmit() {
|
||||
this.fileList = []
|
||||
this.dialogVisible = false
|
||||
this.dialogImageUrl = ''
|
||||
this.dialog = false
|
||||
this.init()
|
||||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
download() {
|
||||
this.beforeInit()
|
||||
this.downloadLoading = true
|
||||
downloadPicture(this.params).then(result => {
|
||||
downloadFile(result, '图片列表', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
}).catch(() => {
|
||||
this.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
14
mallplusui-web-admin/src/views/sys/role/add.vue
Normal file
14
mallplusui-web-admin/src/views/sys/role/add.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<role-detail :is-edit='false'></role-detail>
|
||||
</template>
|
||||
<script>
|
||||
import RoleDetail from './components/RoleDetail'
|
||||
export default {
|
||||
name: 'addRole',
|
||||
components: { RoleDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<div style="margin-top: 50px">
|
||||
<el-form :model="role" :rules="rules" ref="roleFrom"
|
||||
label-width="120px" style="width: 680px"
|
||||
size="small">
|
||||
<el-form-item label="角色名称:" prop="name">
|
||||
<el-input v-model="role.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色描述:">
|
||||
<el-input
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
v-model="role.description"
|
||||
:autosize="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联权限:">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-tooltip class="item" effect="dark" content="选择指定角色分配菜单" placement="top">
|
||||
<span class="role-span">菜单分配</span>
|
||||
</el-tooltip>
|
||||
|
||||
</div>
|
||||
<el-tree
|
||||
ref="menu"
|
||||
:data="menus"
|
||||
:default-checked-keys="menuIds"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
show-checkbox
|
||||
accordion
|
||||
show-el-checkbox
|
||||
node-key="id"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('roleFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('roleFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {createRole, getRole, updateRole,rolePermission} from '@/api/role'
|
||||
import {treeList} from '@/api/permission'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
const defaultRole={
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'RoleDetail',
|
||||
components:{SingleUpload},
|
||||
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
role:Object.assign({}, defaultRole),
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
currentId: 0, menuLoading: false, showButton: false,
|
||||
delLoading: false, menus: [], menuIds: [],
|
||||
//所有专题列表
|
||||
subjectList: [],
|
||||
//专题左右标题
|
||||
subjectTitles: ['待选择', '已选择'],
|
||||
menuIds:null,
|
||||
roleMenus:null,
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入角色明', trigger: 'blur'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.getMenuList();
|
||||
this.getMenus();
|
||||
|
||||
if (this.isEdit) {
|
||||
rolePermission(this.$route.query.id).then(res => {
|
||||
if (this.$route.query.id) {
|
||||
|
||||
// 清空菜单的选中
|
||||
// this.$refs.menu.setCheckedKeys([])
|
||||
// 保存当前的角色id
|
||||
this.currentId = this.$route.query.id
|
||||
console.log(this.roleMenus)
|
||||
// 初始化
|
||||
let menuIds = []
|
||||
// 菜单数据需要特殊处理
|
||||
if (res.data && res.data.length>0){
|
||||
res.data.forEach(function(data, index) {
|
||||
menuIds.push(data.permissionId)
|
||||
})
|
||||
}
|
||||
this.menuIds = menuIds;
|
||||
}
|
||||
});
|
||||
getRole(this.$route.query.id).then(response => {
|
||||
this.role = response.data;
|
||||
});
|
||||
|
||||
}else{
|
||||
this.role = Object.assign({},defaultRole);
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getMenus() {
|
||||
treeList().then(res => {
|
||||
this.menus = res.data
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
filterMethod(query, item) {
|
||||
return item.label.indexOf(query) > -1;
|
||||
},
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let serviceIds='';
|
||||
|
||||
// 得到半选的父节点数据,保存起来
|
||||
this.$refs.menu.getHalfCheckedNodes().forEach(function(data, index) {
|
||||
serviceIds += data.id + ',';
|
||||
})
|
||||
// 得到已选中的 key 值
|
||||
this.$refs.menu.getCheckedKeys().forEach(function(data, index) {
|
||||
serviceIds += data + ',';
|
||||
})
|
||||
|
||||
if (serviceIds.endsWith(',')) {
|
||||
serviceIds = serviceIds.substr(0, serviceIds.length - 1)
|
||||
}
|
||||
this.role.menuIds = serviceIds;
|
||||
if (this.isEdit) {
|
||||
updateRole(this.$route.query.id, this.role).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
} else {
|
||||
createRole(this.role).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.role = Object.assign({},defaultRole);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.role = Object.assign({},defaultRole);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
<template>
|
||||
<div style="margin-top: 50px">
|
||||
<el-form :model="role" :rules="rules" ref="roleFrom"
|
||||
label-width="120px" style="width: 680px"
|
||||
size="small">
|
||||
<el-form-item label="角色名称:" prop="name">
|
||||
<el-input v-model="role.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色描述:">
|
||||
<el-input
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
v-model="role.description"
|
||||
:autosize="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联权限:">
|
||||
<el-transfer
|
||||
style="display: inline-block"
|
||||
filterable
|
||||
:filter-method="filterMethod"
|
||||
filter-placeholder="请输入权限名称"
|
||||
v-model="selectSubject"
|
||||
:titles="subjectTitles"
|
||||
:data="subjectList">
|
||||
</el-transfer>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('roleFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('roleFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {createRole, getRole, updateRole,rolePermission} from '@/api/role'
|
||||
import {treeList} from '@/api/permission'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
const defaultRole={
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'RoleDetail',
|
||||
components:{SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
role:Object.assign({}, defaultRole),
|
||||
//所有专题列表
|
||||
subjectList: [],
|
||||
//专题左右标题
|
||||
subjectTitles: ['待选择', '已选择'],
|
||||
menuIds:null,
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入角色明', trigger: 'blur'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getMenuList();
|
||||
if (this.isEdit) {
|
||||
rolePermission(this.$route.query.id).then(res => {
|
||||
this.menuIds=res.data;
|
||||
});
|
||||
getRole(this.$route.query.id).then(response => {
|
||||
this.role = response.data;
|
||||
});
|
||||
}else{
|
||||
this.role = Object.assign({},defaultRole);
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
//选中的专题
|
||||
selectSubject:{
|
||||
get:function () {
|
||||
let subjects =[];
|
||||
if(this.menuIds==null||this.menuIds.length<=0){
|
||||
return subjects;
|
||||
}
|
||||
for(let i=0;i<this.menuIds.length;i++){
|
||||
subjects.push(this.menuIds[i].permissionId);
|
||||
}
|
||||
return subjects;
|
||||
},
|
||||
set:function (newValue) {
|
||||
this.menuIds=[];
|
||||
for(let i=0;i<newValue.length;i++){
|
||||
this.menuIds.push({permissionId:newValue[i]});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getMenuList() {
|
||||
treeList().then(response => {
|
||||
let list = response.data;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
this.subjectList.push({
|
||||
label: list[i].name,
|
||||
key: list[i].id
|
||||
});
|
||||
if(list[i].children){
|
||||
let ch1 = list[i].children;
|
||||
for (let i = 0; i < ch1.length; i++) {
|
||||
this.subjectList.push({
|
||||
label: '--'+ch1[i].name,
|
||||
key: ch1[i].id
|
||||
});
|
||||
if(ch1[i].children){
|
||||
let ch2 = ch1[i].children;
|
||||
for (let i = 0; i < ch2.length; i++) {
|
||||
this.subjectList.push({
|
||||
label: '----'+ch2[i].name,
|
||||
key: ch2[i].id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
filterMethod(query, item) {
|
||||
return item.label.indexOf(query) > -1;
|
||||
},
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let serviceIds='';
|
||||
for(let i=0;i<this.menuIds.length;i++){
|
||||
serviceIds += this.menuIds[i].permissionId + ',';
|
||||
}
|
||||
if (serviceIds.endsWith(',')) {
|
||||
serviceIds = serviceIds.substr(0, serviceIds.length - 1)
|
||||
}
|
||||
this.role.menuIds = serviceIds;
|
||||
if (this.isEdit) {
|
||||
updateRole(this.$route.query.id, this.role).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
} else {
|
||||
createRole(this.role).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.role = Object.assign({},defaultRole);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.role = Object.assign({},defaultRole);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
307
mallplusui-web-admin/src/views/sys/role/index.vue
Normal file
307
mallplusui-web-admin/src/views/sys/role/index.vue
Normal file
@@ -0,0 +1,307 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchRoleList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="会员名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addRole()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="roleTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
<el-table-column label="编号" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="添加时间" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.createTime | formatTime}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="角色名称" align="center">
|
||||
<template slot-scope="scope">{{scope.row.name}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户数量" width="180" align="center">
|
||||
<template slot-scope="scope">{{scope.row.adminCount}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="handleShowStatusChange(scope.$index, scope.row)"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
v-model="scope.row.status">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="operateType" placeholder="批量操作">
|
||||
<el-option
|
||||
v-for="item in operates"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button
|
||||
style="margin-left: 20px"
|
||||
class="search-button"
|
||||
@click="handleBatchOperate()"
|
||||
type="primary"
|
||||
size="small">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {formatDate} from '@/utils/date';
|
||||
import {fetchList, updateShowStatus, updateFactoryStatus, deleteRole} from '@/api/role'
|
||||
|
||||
export default {
|
||||
name: 'roleList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示会员",
|
||||
value: "showRole"
|
||||
},
|
||||
{
|
||||
label: "隐藏会员",
|
||||
value: "hideRole"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters:{
|
||||
formatTime(time) {
|
||||
if(time==null||time===''){
|
||||
return 'N/A';
|
||||
}
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
formatStatus(status){
|
||||
for(let i=0;i<defaultStatusOptions.length;i++){
|
||||
if(status===defaultStatusOptions[i].value){
|
||||
return defaultStatusOptions[i].label;
|
||||
}
|
||||
}
|
||||
},
|
||||
formatReturnAmount(row){
|
||||
return row.productRealPrice*row.productCount;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
//this.total = response.data.records.length;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updateRole', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该会员', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteRole(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
handleFactoryStatusChange(index, row) {
|
||||
var data = new URLSearchParams();
|
||||
data.append("ids", row.id);
|
||||
data.append("factoryStatus", row.factoryStatus);
|
||||
updateFactoryStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.factoryStatus === 0) {
|
||||
row.factoryStatus = 1;
|
||||
} else {
|
||||
row.factoryStatus = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleShowStatusChange(index, row) {
|
||||
let data = new URLSearchParams();
|
||||
|
||||
data.append("ids", row.id);
|
||||
data.append("showStatus", row.status);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.showStatus === 0) {
|
||||
row.showStatus = 1;
|
||||
} else {
|
||||
row.showStatus = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchRoleList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showRole') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideRole') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addRole() {
|
||||
this.$router.push({path: '/sys/addRole'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
283
mallplusui-web-admin/src/views/sys/role/index1.vue
Normal file
283
mallplusui-web-admin/src/views/sys/role/index1.vue
Normal file
@@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入名称或者描述搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-date-picker
|
||||
v-model="query.date"
|
||||
type="daterange"
|
||||
range-separator=":"
|
||||
class="el-range-editor--small filter-item"
|
||||
style="height: 30.5px;width: 220px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div v-permission="['admin','roles:add']" style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add">新增</el-button>
|
||||
</div>
|
||||
<!-- 导出 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
:loading="downloadLoading"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="download">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="15">
|
||||
<!--角色管理-->
|
||||
<el-col :xs="24" :sm="24" :md="16" :lg="16" :xl="17" style="margin-bottom: 10px">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span class="role-span">角色列表</span>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="data" highlight-current-row size="small" style="width: 100%;" @current-change="handleCurrentChange">
|
||||
<el-table-column prop="name" label="名称"/>
|
||||
<el-table-column prop="dataScope" label="数据权限"/>
|
||||
<el-table-column prop="permission" label="角色权限"/>
|
||||
<el-table-column prop="level" label="角色级别"/>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="remark" label="描述"/>
|
||||
<el-table-column :show-overflow-tooltip="true" width="130px" prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['admin','roles:edit','roles:del'])" label="操作" width="130px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin','roles:edit']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
v-permission="['admin','roles:del']"
|
||||
:ref="scope.row.id"
|
||||
placement="top"
|
||||
width="180">
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<!-- 授权 -->
|
||||
<el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="7">
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-tooltip class="item" effect="dark" content="选择指定角色分配菜单" placement="top">
|
||||
<span class="role-span">菜单分配</span>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
v-permission="['admin','roles:edit']"
|
||||
:disabled="!showButton"
|
||||
:loading="menuLoading"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
style="float: right; padding: 6px 9px"
|
||||
type="primary"
|
||||
@click="saveMenu">保存</el-button>
|
||||
</div>
|
||||
<el-tree
|
||||
ref="menu"
|
||||
:data="menus"
|
||||
:default-checked-keys="menuIds"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
accordion
|
||||
show-el-checkbox
|
||||
node-key="id"/>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/initData'
|
||||
import { del } from '@/api/role'
|
||||
import { getMenusTree } from '@/api/menu'
|
||||
import { parseTime, downloadFile } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
import { editMenu, get, downloadRole } from '@/api/role'
|
||||
export default {
|
||||
name: 'Role',
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'label'
|
||||
},
|
||||
currentId: 0, menuLoading: false, showButton: false,
|
||||
delLoading: false, menus: [], menuIds: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getMenus()
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.showButton = false
|
||||
this.url = 'api/roles'
|
||||
const sort = 'level,asc'
|
||||
const query = this.query
|
||||
const value = query.value
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
if (value) { this.params['blurry'] = value }
|
||||
if (query.date) {
|
||||
this.params['startTime'] = query.date[0]
|
||||
this.params['endTime'] = query.date[1]
|
||||
}
|
||||
// 清空菜单的选中
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
this.delLoading = true
|
||||
del(id).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
getMenus() {
|
||||
getMenusTree().then(res => {
|
||||
this.menus = res
|
||||
})
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (val) {
|
||||
const _this = this
|
||||
// 清空菜单的选中
|
||||
this.$refs.menu.setCheckedKeys([])
|
||||
// 保存当前的角色id
|
||||
this.currentId = val.id
|
||||
// 点击后显示按钮
|
||||
this.showButton = true
|
||||
// 初始化
|
||||
this.menuIds = []
|
||||
// 菜单数据需要特殊处理
|
||||
val.menus.forEach(function(data, index) {
|
||||
_this.menuIds.push(data.id)
|
||||
})
|
||||
}
|
||||
},
|
||||
saveMenu() {
|
||||
this.menuLoading = true
|
||||
const role = { id: this.currentId, menus: [] }
|
||||
// 得到半选的父节点数据,保存起来
|
||||
this.$refs.menu.getHalfCheckedNodes().forEach(function(data, index) {
|
||||
const menu = { id: data.id }
|
||||
role.menus.push(menu)
|
||||
})
|
||||
// 得到已选中的 key 值
|
||||
this.$refs.menu.getCheckedKeys().forEach(function(data, index) {
|
||||
const menu = { id: data }
|
||||
role.menus.push(menu)
|
||||
})
|
||||
editMenu(role).then(res => {
|
||||
this.$notify({
|
||||
title: '保存成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.menuLoading = false
|
||||
this.update()
|
||||
}).catch(err => {
|
||||
this.menuLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
update() {
|
||||
// 无刷新更新 表格数据
|
||||
get(this.currentId).then(res => {
|
||||
for (let i = 0; i < this.data.length; i++) {
|
||||
if (res.id === this.data[i].id) {
|
||||
this.data[i] = res
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.deptIds = []
|
||||
_this.form = { id: data.id, name: data.name, remark: data.remark, depts: data.depts, dataScope: data.dataScope, level: data.level, permission: data.permission }
|
||||
if (_this.form.dataScope === '自定义') {
|
||||
_this.getDepts()
|
||||
}
|
||||
for (let i = 0; i < _this.form.depts.length; i++) {
|
||||
_this.deptIds[i] = _this.form.depts[i].id
|
||||
}
|
||||
_this.dialog = true
|
||||
},
|
||||
download() {
|
||||
this.beforeInit()
|
||||
this.downloadLoading = true
|
||||
downloadRole(this.params).then(result => {
|
||||
downloadFile(result, '角色列表', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
}).catch(() => {
|
||||
this.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.role-span {
|
||||
font-weight: bold;color: #303133;
|
||||
font-size: 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .el-tree-node__label{
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
14
mallplusui-web-admin/src/views/sys/role/update.vue
Normal file
14
mallplusui-web-admin/src/views/sys/role/update.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<role-detail :is-edit='true'></role-detail>
|
||||
</template>
|
||||
<script>
|
||||
import RoleDetail from './components/RoleDetail'
|
||||
export default {
|
||||
name: 'updateRole',
|
||||
components: { RoleDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
37
mallplusui-web-admin/src/views/sys/storage/index.vue
Normal file
37
mallplusui-web-admin/src/views/sys/storage/index.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" style="padding-left: 8px;" @tab-click="tabClick">
|
||||
<el-tab-pane label="本地存储" name="first">
|
||||
<Local ref="local"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="七牛云存储" name="second">
|
||||
<QiNiu ref="qiNiu"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import QiNiu from './qiniu/index'
|
||||
import Local from './local/index'
|
||||
import '@/styles/description.scss'
|
||||
export default {
|
||||
name: 'Storage',
|
||||
components: { QiNiu, Local },
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
tabClick(name) {
|
||||
if (this.activeName === 'first') {
|
||||
this.$refs.local.init()
|
||||
} else {
|
||||
this.$refs.qiNiu.init()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
122
mallplusui-web-admin/src/views/sys/storage/local/form.vue
Normal file
122
mallplusui-web-admin/src/views/sys/storage/local/form.vue
Normal file
@@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '上传文件' : '编辑文件'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="文件名" >
|
||||
<el-input v-model="form.name" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<!-- 上传文件 -->
|
||||
<el-form-item v-if="isAdd" label="上传">
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
:before-upload="beforeUpload"
|
||||
:auto-upload="false"
|
||||
:headers="headers"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:action="fileUploadApi + '?name=' + form.name">
|
||||
<div class="eladmin-upload"><i class="el-icon-upload"/> 添加文件</div>
|
||||
<div slot="tip" class="el-upload__tip">可上传任意格式文件,且不超过100M</div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { edit } from '@/api/localStorage'
|
||||
export default {
|
||||
props: {
|
||||
isAdd: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false, dialog: false,
|
||||
headers: { 'Authorization': 'Bearer ' + getToken() },
|
||||
form: {
|
||||
id: '',
|
||||
name: ''
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'fileUploadApi'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.$refs.upload.submit()
|
||||
} else this.doEdit()
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: '',
|
||||
name: ''
|
||||
}
|
||||
},
|
||||
beforeUpload(file) {
|
||||
let isLt2M = true
|
||||
isLt2M = file.size / 1024 / 1024 < 100
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传文件大小不能超过 100MB!')
|
||||
}
|
||||
this.loading = false
|
||||
return isLt2M
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
this.dialog = false
|
||||
this.resetForm()
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$parent.init()
|
||||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
258
mallplusui-web-admin/src/views/sys/storage/local/index.vue
Normal file
258
mallplusui-web-admin/src/views/sys/storage/local/index.vue
Normal file
@@ -0,0 +1,258 @@
|
||||
<template>
|
||||
<div class="app-container" style="padding: 8px;">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入内容模糊搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-date-picker
|
||||
v-model="query.date"
|
||||
type="daterange"
|
||||
range-separator=":"
|
||||
class="el-range-editor--small filter-item"
|
||||
style="height: 30.5px;width: 220px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
v-permission="['admin','storage:add']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-upload"
|
||||
@click="add">文件上传
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- 多选删除 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
v-permission="['admin','storage:del']"
|
||||
:loading="delAllLoading"
|
||||
:disabled="data.length === 0 || $refs.table.selection.length === 0"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="open">删除
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- 导出 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
:loading="downloadLoading"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="download">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" ref="table" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column prop="name" width="150px" label="文件名">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
:content="'file/' + scope.row.type + '/' + scope.row.realName"
|
||||
placement="top-start"
|
||||
title="路径"
|
||||
width="200"
|
||||
trigger="hover">
|
||||
<a
|
||||
slot="reference"
|
||||
:href="baseApi + '/file/' + scope.row.type + '/' + scope.row.realName"
|
||||
class="el-link--primary"
|
||||
style="word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color: #1890ff;font-size: 13px;"
|
||||
target="_blank">
|
||||
{{ scope.row.name }}
|
||||
</a>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="path" label="预览图">
|
||||
<template slot-scope="{row}">
|
||||
<el-image
|
||||
:src=" baseApi + '/file/' + row.type + '/' + row.realName"
|
||||
:preview-src-list="[baseApi + '/file/' + row.type + '/' + row.realName]"
|
||||
fit="contain"
|
||||
lazy
|
||||
class="el-avatar">
|
||||
<div slot="error">
|
||||
<i class="el-icon-document"/>
|
||||
</div>
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="suffix" label="文件类型"/>
|
||||
<el-table-column prop="type" label="类别"/>
|
||||
<el-table-column prop="size" label="大小"/>
|
||||
<el-table-column prop="operate" label="操作人"/>
|
||||
<el-table-column prop="createTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['admin','storage:edit','storage:del'])" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin','storage:edit']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
v-permission="['admin','storage:del']"
|
||||
:ref="scope.row.id"
|
||||
placement="top"
|
||||
width="180">
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/initData'
|
||||
import { del, delAll, downloadStorage } from '@/api/localStorage'
|
||||
import { parseTime, downloadFile } from '@/utils/index'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false, delAllLoading: false,
|
||||
queryTypeOptions: [
|
||||
{ key: 'name', display_name: '文件名' },
|
||||
{ key: 'suffix', display_name: '后缀' },
|
||||
{ key: 'type', display_name: '类型' },
|
||||
{ key: 'operate', display_name: '操作人' }
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'baseApi'
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'api/localStorage'
|
||||
const sort = 'id,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
const query = this.query
|
||||
const value = query.value
|
||||
if (value) { this.params['blurry'] = value }
|
||||
if (query.date) {
|
||||
this.params['startTime'] = query.date[0]
|
||||
this.params['endTime'] = query.date[1]
|
||||
}
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
this.delLoading = true
|
||||
del(id).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.dleChangePage()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.isAdd = true
|
||||
this.$refs.form.dialog = true
|
||||
},
|
||||
edit(data) {
|
||||
this.isAdd = false
|
||||
const _this = this.$refs.form
|
||||
_this.form = {
|
||||
id: data.id,
|
||||
name: data.name
|
||||
}
|
||||
_this.dialog = true
|
||||
},
|
||||
doDelete() {
|
||||
this.delAllLoading = true
|
||||
const data = this.$refs.table.selection
|
||||
const ids = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
ids.push(data[i].id)
|
||||
}
|
||||
delAll(ids).then(res => {
|
||||
this.delAllLoading = false
|
||||
this.dleChangePage(ids.length)
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delAllLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.$confirm('你确定删除选中的数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.doDelete()
|
||||
})
|
||||
},
|
||||
download() {
|
||||
this.beforeInit()
|
||||
this.downloadLoading = true
|
||||
downloadStorage(this.params).then(result => {
|
||||
downloadFile(result, '文件列表', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
}).catch(() => {
|
||||
this.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .el-image__error, .el-image__placeholder{
|
||||
background: none;
|
||||
}
|
||||
/deep/ .el-image-viewer__wrapper{
|
||||
top: 55px;
|
||||
}
|
||||
</style>
|
||||
98
mallplusui-web-admin/src/views/sys/storage/qiniu/form.vue
Normal file
98
mallplusui-web-admin/src/views/sys/storage/qiniu/form.vue
Normal file
@@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<!--上传图片-->
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" title="七牛云配置" append-to-body width="580px">
|
||||
<el-form ref="form" :model="form" :rules="rules" style="margin-top: 6px;" size="small" label-width="110px">
|
||||
<el-form-item label="Access Key" prop="accessKey">
|
||||
<el-input v-model="form.accessKey" style="width: 95%" placeholder="accessKey,在安全中心,秘钥管理中查看"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="Secret Key" prop="secretKey">
|
||||
<el-input v-model="form.secretKey" type="password" style="width: 95%;" placeholder="secretKey,在安全中心,秘钥管理中查看"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间名称" prop="bucket">
|
||||
<el-input v-model="form.bucket" style="width: 95%;" placeholder="存储空间名称作为唯一的 Bucket 识别符"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="外链域名" prop="host">
|
||||
<el-input v-model="form.host" style="width: 95%;" placeholder = "外链域名,可自定义,需在七牛云绑定"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="存储区域" prop="port">
|
||||
<el-select v-model="form.zone" placeholder="请选择存储区域">
|
||||
<el-option
|
||||
v-for="item in zones"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="空间类型" prop="host">
|
||||
<el-radio v-model="form.type" label="公开">公开</el-radio>
|
||||
<el-radio v-model="form.type" label="私有" >私有</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="dialog = false">取消</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { get, update } from '@/api/qiniu'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
zones: ['华东', '华北', '华南', '北美', '东南亚'], dialog: false,
|
||||
loading: false, form: { accessKey: '', secretKey: '', bucket: '', host: '', zone: '', type: '' },
|
||||
rules: {
|
||||
accessKey: [
|
||||
{ required: true, message: '请输入accessKey', trigger: 'blur' }
|
||||
],
|
||||
secretKey: [
|
||||
{ required: true, message: '请输入secretKey', trigger: 'blur' }
|
||||
],
|
||||
bucket: [
|
||||
{ required: true, message: '请输入空间名称', trigger: 'blur' }
|
||||
],
|
||||
host: [
|
||||
{ required: true, message: '请输入外链域名', trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '空间类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
get().then(res => {
|
||||
this.form = res
|
||||
})
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
update(this.form).then(res => {
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.$parent.init()
|
||||
this.loading = false
|
||||
this.dialog = false
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
300
mallplusui-web-admin/src/views/sys/storage/qiniu/index.vue
Normal file
300
mallplusui-web-admin/src/views/sys/storage/qiniu/index.vue
Normal file
@@ -0,0 +1,300 @@
|
||||
<template>
|
||||
<div class="app-container" style="padding: 8px;">
|
||||
<!--表单组件-->
|
||||
<eForm ref="form"/>
|
||||
<!-- 工具栏 -->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入文件名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-date-picker
|
||||
v-model="query.date"
|
||||
type="daterange"
|
||||
range-separator=":"
|
||||
class="el-range-editor--small filter-item"
|
||||
style="height: 30.5px;width: 220px"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 上传 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-upload" @click="dialog = true">上传文件</el-button>
|
||||
</div>
|
||||
<!-- 同步 -->
|
||||
<el-button :icon="icon" class="filter-item" size="mini" type="warning" @click="synchronize">同步数据</el-button>
|
||||
<!-- 配置 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-s-tools"
|
||||
@click="doConfig">七牛配置</el-button>
|
||||
</div>
|
||||
<!-- 多选删除 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
:loading="delAllLoading"
|
||||
:disabled="data.length === 0 || $refs.table.selection.length === 0"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="open">删除</el-button>
|
||||
</div>
|
||||
<!-- 导出 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
:loading="downloadLoading"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
@click="downloadList">导出</el-button>
|
||||
</div>
|
||||
<!-- 文件上传 -->
|
||||
<el-dialog :visible.sync="dialog" :close-on-click-modal="false" append-to-body width="500px" @close="doSubmit">
|
||||
<el-upload
|
||||
:before-remove="handleBeforeRemove"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:file-list="fileList"
|
||||
:headers="headers"
|
||||
:action="qiNiuUploadApi"
|
||||
class="upload-demo"
|
||||
multiple>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
<div slot="tip" style="display: block;" class="el-upload__tip">请勿上传违法文件,且文件不超过15M</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" ref="table" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column :show-overflow-tooltip="true" label="文件名">
|
||||
<template slot-scope="scope">
|
||||
<a href="JavaScript:;" class="el-link el-link--primary" target="_blank" type="primary" @click="download(scope.row.id)">{{ scope.row.key }}</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :show-overflow-tooltip="true" prop="suffix" label="文件类型"/>
|
||||
<el-table-column prop="bucket" label="空间名称"/>
|
||||
<el-table-column prop="size" label="文件大小"/>
|
||||
<el-table-column prop="type" label="空间类型"/>
|
||||
<el-table-column width="180px" prop="updateTime" label="创建日期">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
:ref="scope.row.id"
|
||||
placement="top"
|
||||
width="180">
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import initData from '@/mixins/initData'
|
||||
import { del, download, sync, delAll, downloadQiNiu } from '@/api/qiniu'
|
||||
import { parseTime, downloadFile } from '@/utils/index'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import eForm from './form'
|
||||
export default {
|
||||
components: { eForm },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
icon: 'el-icon-refresh', delAllLoading: false,
|
||||
url: '', headers: { 'Authorization': 'Bearer ' + getToken() }, dialog: false,
|
||||
dialogImageUrl: '', dialogVisible: false, fileList: [], files: [],
|
||||
newWin: null, downloadLoading: false, delLoading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'qiNiuUploadApi'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
url(newVal, oldVal) {
|
||||
if (newVal && this.newWin) {
|
||||
this.newWin.sessionStorage.clear()
|
||||
this.newWin.location.href = newVal
|
||||
// 重定向后把url和newWin重置
|
||||
this.url = ''
|
||||
this.newWin = null
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
beforeInit() {
|
||||
this.url = 'api/qiNiuContent'
|
||||
const sort = 'id,desc'
|
||||
const query = this.query
|
||||
const value = query.value
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
if (value) { this.params['key'] = value }
|
||||
if (query.date) {
|
||||
this.params['startTime'] = query.date[0]
|
||||
this.params['endTime'] = query.date[1]
|
||||
}
|
||||
return true
|
||||
},
|
||||
doConfig() {
|
||||
const _this = this.$refs.form
|
||||
_this.init()
|
||||
_this.dialog = true
|
||||
},
|
||||
subDelete(id) {
|
||||
this.delLoading = true
|
||||
del(id).then(res => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
download(id) {
|
||||
this.downloadLoading = true
|
||||
// 先打开一个空的新窗口,再请求
|
||||
this.newWin = window.open()
|
||||
download(id).then(res => {
|
||||
this.downloadLoading = false
|
||||
this.url = res.url
|
||||
}).catch(err => {
|
||||
this.downloadLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
const uid = file.uid
|
||||
const id = response.id
|
||||
this.files.push({ uid, id })
|
||||
},
|
||||
handleBeforeRemove(file, fileList) {
|
||||
for (let i = 0; i < this.files.length; i++) {
|
||||
if (this.files[i].uid === file.uid) {
|
||||
del(this.files[i].id).then(res => {})
|
||||
return true
|
||||
}
|
||||
}
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
// 刷新列表数据
|
||||
doSubmit() {
|
||||
this.fileList = []
|
||||
this.dialogVisible = false
|
||||
this.dialogImageUrl = ''
|
||||
this.dialog = false
|
||||
this.init()
|
||||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
synchronize() {
|
||||
this.icon = 'el-icon-loading'
|
||||
this.buttonName = '同步中'
|
||||
sync().then(res => {
|
||||
this.icon = 'el-icon-refresh'
|
||||
this.buttonName = '同步数据'
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '数据同步成功',
|
||||
type: 'success',
|
||||
duration: 1500
|
||||
})
|
||||
this.toQuery()
|
||||
}).catch(err => {
|
||||
this.icon = 'el-icon-refresh'
|
||||
this.buttonName = '同步数据'
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doDelete() {
|
||||
this.delAllLoading = true
|
||||
const data = this.$refs.table.selection
|
||||
const ids = []
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
ids.push(data[i].id)
|
||||
}
|
||||
delAll(ids).then(res => {
|
||||
this.delAllLoading = false
|
||||
this.dleChangePage(ids.length)
|
||||
this.init()
|
||||
this.$notify({
|
||||
title: '删除成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(err => {
|
||||
this.delAllLoading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
open() {
|
||||
this.$confirm('你确定删除选中的数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.doDelete()
|
||||
})
|
||||
},
|
||||
downloadList() {
|
||||
this.beforeInit()
|
||||
this.downloadLoading = true
|
||||
downloadQiNiu(this.params).then(result => {
|
||||
downloadFile(result, '七牛云文件列表', 'xlsx')
|
||||
this.downloadLoading = false
|
||||
}).catch(() => {
|
||||
this.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
16
mallplusui-web-admin/src/views/sys/store/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/store/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStore-detail :is-edit='false'>
|
||||
</sysStore-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addSysStore',
|
||||
components: {SysStoreDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
266
mallplusui-web-admin/src/views/sys/store/components/detail.vue
Normal file
266
mallplusui-web-admin/src/views/sys/store/components/detail.vue
Normal file
@@ -0,0 +1,266 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="sysStore" :rules="rules" ref="SysStoreFrom" label-width="150px">
|
||||
|
||||
|
||||
<el-form-item
|
||||
label=" 店铺名称"
|
||||
prop="name">
|
||||
<el-input v-model="sysStore.name" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="服务手机"
|
||||
prop="servicePhone">
|
||||
<el-input v-model="sysStore.supportPhone" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="服务电话"
|
||||
prop="contactMobile">
|
||||
<el-input v-model="sysStore.contactMobile" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="负责人"
|
||||
prop="contactName">
|
||||
<el-input v-model="sysStore.contactName" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="图标:" prop="logo">
|
||||
<single-upload v-model="sysStore.logo"></single-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证照:" prop="servicePhone">
|
||||
<single-upload v-model="sysStore.servicePhone"></single-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label=" 营业执照:" prop="supportName">
|
||||
<single-upload v-model="sysStore.supportName"></single-upload>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="地址细节"
|
||||
prop="addressDetail">
|
||||
<el-input v-model="sysStore.addressDetail" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="联系QQ"
|
||||
prop="contactQq">
|
||||
<el-input v-model="sysStore.contactQq" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="支持电话"
|
||||
prop="supportPhone">
|
||||
<el-input v-model="sysStore.supportPhone" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="描述"
|
||||
prop="description">
|
||||
<el-input v-model="sysStore.description" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="地图:" prop="phone">
|
||||
|
||||
<input v-model.number="center.lng" />
|
||||
<input v-model.number="center.lat" />
|
||||
|
||||
<baidu-map ak="15BWmtGEGGkZ8lSPUGah30XZ6IGw57HE"
|
||||
class="map bm-view"
|
||||
:scroll-wheel-zoom="true"
|
||||
:center="center"
|
||||
:zoom="zoom"
|
||||
:auto-resize="true"
|
||||
@moving="syncCenterAndZoom"
|
||||
@moveend="syncCenterAndZoom"
|
||||
@zoomend="syncCenterAndZoom">
|
||||
<bm-copyright
|
||||
anchor="BMAP_ANCHOR_TOP_RIGHT"
|
||||
:copyright="[{id: 1, content: 'Copyright Message', bounds: {ne: {lng: 110, lat: 40}, sw:{lng: 0, lat: 0}}}, {id: 2, content: '<a>mallplus多租户商城</a>'}]">
|
||||
</bm-copyright>
|
||||
<bm-city-list anchor="BMAP_ANCHOR_TOP_LEFT" @changeAfter="changeAfters"></bm-city-list>
|
||||
<!-- <bm-local-search :keyword="keyword" :auto-viewport="true" :location="location"></bm-local-search>-->
|
||||
</baidu-map>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('SysStoreFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('SysStoreFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import BaiduMap from 'vue-baidu-map/components/map/Map.vue'
|
||||
import BmLocalSearch from 'vue-baidu-map/components/search/LocalSearch';
|
||||
import BmCityList from 'vue-baidu-map/components/controls/CityList';
|
||||
import BmCopyright from 'vue-baidu-map/components/controls/Copyright';
|
||||
import BmView from 'vue-baidu-map/components/map/MapView';
|
||||
import {createSysStore, getSysStore, updateSysStore} from '@/api/sys/sysStore'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultSysStore = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'SysStoreDetail',
|
||||
components: {SingleUpload,BaiduMap,BmLocalSearch,BmCityList,BmView,BmCopyright},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysStore:
|
||||
Object.assign({},
|
||||
defaultSysStore),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
|
||||
sort :
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}, location: '北京',
|
||||
keyword: '百度',
|
||||
center: {
|
||||
lng: 116.404,
|
||||
lat: 39.915
|
||||
},
|
||||
zoom: 15
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getSysStore(this.$route.query.id).then(response => {
|
||||
this.sysStore = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.sysStore = Object.assign({},
|
||||
defaultSysStore)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeAfters(e){
|
||||
console.log('123')
|
||||
console.log(e)
|
||||
},
|
||||
handleScroll (e) {
|
||||
//修复body高度为100%,百度地图鼠标滚轮滚动产生位移问题,以及全景鼠标hover后未显示全景信息问题
|
||||
document.body.scrollTop=0
|
||||
document.documentElement.scrollTop =0
|
||||
},
|
||||
syncCenterAndZoom (e) {
|
||||
|
||||
const {lng, lat} = e.target.getCenter()
|
||||
this.center.lng = lng
|
||||
this.center.lat = lat
|
||||
this.zoom = e.target.getZoom()
|
||||
},
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
this.sysStore.addressLat=this.center.lat;
|
||||
this.sysStore.addressLng=this.center.lng;
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateSysStore(this.$route.query.id, this.sysStore).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createSysStore(this.sysStore).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStore = Object.assign({},
|
||||
defaultSysStore)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStore = Object.assign({},
|
||||
defaultSysStore)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.bm-view {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
424
mallplusui-web-admin/src/views/sys/store/index.vue
Normal file
424
mallplusui-web-admin/src/views/sys/store/index.vue
Normal file
@@ -0,0 +1,424 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchSysStoreList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addSysStore()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="sysStoreTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="id"
|
||||
label="id">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.id }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="name"
|
||||
label="名称">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="audit(scope.$index, scope.row)"
|
||||
:active-value="3"
|
||||
:inactive-value="2"
|
||||
v-model="scope.row.status">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="是否显示" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="handleShowStatusChange(scope.$index, scope.row)"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
v-model="scope.row.isBoutique">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="createTime"
|
||||
label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.createTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="logo"
|
||||
label="logo">
|
||||
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.logo"></template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="addressDetail"
|
||||
label="地址">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.addressDetail }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="contactQq"
|
||||
label="联系QQ">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.contactQq }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="supportPhone"
|
||||
label="支持电话">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.supportPhone }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="contactQrcode"
|
||||
label="二维码">
|
||||
|
||||
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.contactQrcode"></template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="collect"
|
||||
label="收藏">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.collect }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="hit"
|
||||
label="浏览">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.hit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="goodsCount"
|
||||
label="商品量">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.goodsCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="orderCount"
|
||||
label="订单量">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.orderCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="payAmount"
|
||||
label="销售额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.payAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="articleCount"
|
||||
label="文章量">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.articleCount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="amount"
|
||||
label="预存款">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.amount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="freezAmount"
|
||||
label="冻结金额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.freezAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteSysStore,updateShowStatus,audit} from '@/api/sys/sysStore'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'sysStoreList',
|
||||
data() {
|
||||
return {
|
||||
operates: [],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
formatHome(value) {
|
||||
if (value === 1) {
|
||||
return '显示';
|
||||
} else {
|
||||
return '不显示';
|
||||
}
|
||||
},
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '申请中';
|
||||
} else if (value === 2) {
|
||||
return '审核失败';
|
||||
} else if (value === 3) {
|
||||
return '审核成功';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/store/updateStore', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteSysStore(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
handleShowStatusChange(index, row) {
|
||||
let data = new URLSearchParams();
|
||||
;
|
||||
data.append("ids", row.id);
|
||||
data.append("showStatus", row.showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.showStatus === 0) {
|
||||
row.showStatus = 1;
|
||||
} else {
|
||||
row.showStatus = 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
audit(index, row) {
|
||||
let data = new URLSearchParams();
|
||||
;
|
||||
data.append("ids", row.id);
|
||||
data.append("showStatus", row.showStatus);
|
||||
audit(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.showStatus === 3) {
|
||||
row.showStatus = 2;
|
||||
} else {
|
||||
row.showStatus = 3;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchSysStoreList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showSysStore') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideSysStore') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addSysStore() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/store/addStore'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/store/update.vue
Normal file
16
mallplusui-web-admin/src/views/sys/store/update.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStore-detail :is-edit='true'>
|
||||
</sysStore-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateSysStore',
|
||||
components: {SysStoreDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysShop/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysShop/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysShop-detail :is-edit='false'>
|
||||
</sysShop-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysShopDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addSysShop',
|
||||
components: {SysShopDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
234
mallplusui-web-admin/src/views/sys/sysShop/components/detail.vue
Normal file
234
mallplusui-web-admin/src/views/sys/sysShop/components/detail.vue
Normal file
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="sysShop" :rules="rules" ref="SysShopFrom" label-width="150px">
|
||||
|
||||
<el-form-item
|
||||
label="门店名称"
|
||||
prop="storeName">
|
||||
<el-input v-model="sysShop.storeName" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="门店电话/手机号"
|
||||
prop="mobile">
|
||||
<el-input v-model="sysShop.mobile" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="门店联系人"
|
||||
prop="linkman">
|
||||
<el-input v-model="sysShop.linkman" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="门店logo:" prop="logo">
|
||||
<single-upload v-model="sysShop.logo"></single-upload>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="门店详细地址"
|
||||
prop="address">
|
||||
<el-input v-model="sysShop.address" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="地图:" prop="phone">
|
||||
|
||||
<input v-model.number="center.lng" />
|
||||
<input v-model.number="center.lat" />
|
||||
|
||||
<baidu-map ak="15BWmtGEGGkZ8lSPUGah30XZ6IGw57HE"
|
||||
class="map bm-view"
|
||||
:scroll-wheel-zoom="true"
|
||||
:center="center"
|
||||
:zoom="zoom"
|
||||
:auto-resize="true"
|
||||
@moving="syncCenterAndZoom"
|
||||
@moveend="syncCenterAndZoom"
|
||||
@zoomend="syncCenterAndZoom">
|
||||
<bm-copyright
|
||||
anchor="BMAP_ANCHOR_TOP_RIGHT"
|
||||
:copyright="[{id: 1, content: 'Copyright Message', bounds: {ne: {lng: 110, lat: 40}, sw:{lng: 0, lat: 0}}}, {id: 2, content: '<a>mallplus多租户商城</a>'}]">
|
||||
</bm-copyright>
|
||||
<bm-city-list anchor="BMAP_ANCHOR_TOP_LEFT" @changeAfter="changeAfters"></bm-city-list>
|
||||
<!-- <bm-local-search :keyword="keyword" :auto-viewport="true" :location="location"></bm-local-search>-->
|
||||
</baidu-map>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('SysShopFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('SysShopFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import BaiduMap from 'vue-baidu-map/components/map/Map.vue'
|
||||
import BmLocalSearch from 'vue-baidu-map/components/search/LocalSearch';
|
||||
import BmCityList from 'vue-baidu-map/components/controls/CityList';
|
||||
import BmCopyright from 'vue-baidu-map/components/controls/Copyright';
|
||||
import BmView from 'vue-baidu-map/components/map/MapView';
|
||||
import {createSysShop, getSysShop, updateSysShop} from '@/api/sys/sysShop'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultSysShop = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'SysShopDetail',
|
||||
components:{SingleUpload,BaiduMap,BmLocalSearch,BmCityList,BmView,BmCopyright},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysShop:
|
||||
Object.assign({},
|
||||
defaultSysShop),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
|
||||
sort:
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}, location: '北京',
|
||||
keyword: '百度',
|
||||
center: {
|
||||
lng: 116.404,
|
||||
lat: 39.915
|
||||
},
|
||||
zoom: 15
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getSysShop(this.$route.query.id).then(response => {
|
||||
this.sysShop = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.sysShop = Object.assign({},
|
||||
defaultSysShop)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeAfters(e){
|
||||
console.log('123')
|
||||
console.log(e)
|
||||
},
|
||||
handleScroll (e) {
|
||||
//修复body高度为100%,百度地图鼠标滚轮滚动产生位移问题,以及全景鼠标hover后未显示全景信息问题
|
||||
document.body.scrollTop=0
|
||||
document.documentElement.scrollTop =0
|
||||
},
|
||||
syncCenterAndZoom (e) {
|
||||
|
||||
const {lng, lat} = e.target.getCenter()
|
||||
this.center.lng = lng
|
||||
this.center.lat = lat
|
||||
this.zoom = e.target.getZoom()
|
||||
},
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log(this.center)
|
||||
this.sysShop.latitude=this.center.lat;
|
||||
this.sysShop.longitude=this.center.lng;
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateSysShop(this.$route.query.id, this.sysShop).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createSysShop(this.sysShop).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysShop = Object.assign({},
|
||||
defaultSysShop)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysShop = Object.assign({},
|
||||
defaultSysShop)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.bm-view {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
288
mallplusui-web-admin/src/views/sys/sysShop/index.vue
Normal file
288
mallplusui-web-admin/src/views/sys/sysShop/index.vue
Normal file
@@ -0,0 +1,288 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchSysShopList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addSysShop()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="sysShopTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
<el-table-column prop="id"
|
||||
label="编号">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.id }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="storeName"
|
||||
label="门店名称">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.storeName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="mobile"
|
||||
label="电话/手机号">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.mobile }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="linkman"
|
||||
label="门店联系人">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.linkman }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="logo"
|
||||
label="门店logo">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.logo"></template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="address"
|
||||
label="详细地址">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.address }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="latitude"
|
||||
label="纬度">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.latitude }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="longitude"
|
||||
label="经度">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.longitude }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="ctime"
|
||||
label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.ctime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteSysShop} from '@/api/sys/sysShop'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'sysShopList',
|
||||
data() {
|
||||
return {
|
||||
operates: [],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/marking/updateSysShop', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteSysShop(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchSysShopList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showSysShop') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideSysShop') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addSysShop() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/marking/addSysShop'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysShop/update.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysShop/update.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysShop-detail :is-edit='true'>
|
||||
</sysShop-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysShopDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateSysShop',
|
||||
components: {SysShopDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysStoreCash/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysStoreCash/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreCash-detail :is-edit='false'>
|
||||
</sysStoreCash-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreCashDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addSysStoreCash',
|
||||
components: {SysStoreCashDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="sysStoreCash" :rules="rules" ref="SysStoreCashFrom" label-width="150px">
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="id"
|
||||
prop="id">
|
||||
<el-input v-model="sysStoreCash.id" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="createTime"
|
||||
prop="createTime">
|
||||
<el-input v-model="sysStoreCash.createTime" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="updateTime"
|
||||
prop="updateTime">
|
||||
<el-input v-model="sysStoreCash.updateTime" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="account"
|
||||
prop="account">
|
||||
<el-input v-model="sysStoreCash.account" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="amount"
|
||||
prop="amount">
|
||||
<el-input v-model="sysStoreCash.amount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="bank"
|
||||
prop="bank">
|
||||
<el-input v-model="sysStoreCash.bank" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="status"
|
||||
prop="status">
|
||||
<el-input v-model="sysStoreCash.status" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="storeId"
|
||||
prop="storeId">
|
||||
<el-input v-model="sysStoreCash.storeId" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('SysStoreCashFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('SysStoreCashFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createSysStoreCash, getSysStoreCash, updateSysStoreCash} from '@/api/sys/sysStoreCash'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultSysStoreCash = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'SysStoreCashDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysStoreCash:
|
||||
Object.assign({},
|
||||
defaultSysStoreCash),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo
|
||||
:
|
||||
[
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort
|
||||
:
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getSysStoreCash(this.$route.query.id).then(response => {
|
||||
this.sysStoreCash = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.sysStoreCash = Object.assign({},
|
||||
defaultSysStoreCash)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateSysStoreCash(this.$route.query.id, this.sysStoreCash).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createSysStoreCash(this.sysStoreCash).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreCash = Object.assign({},
|
||||
defaultSysStoreCash)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreCash = Object.assign({},
|
||||
defaultSysStoreCash)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
308
mallplusui-web-admin/src/views/sys/sysStoreCash/index.vue
Normal file
308
mallplusui-web-admin/src/views/sys/sysStoreCash/index.vue
Normal file
@@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchSysStoreCashList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addSysStoreCash()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="sysStoreCashTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="id"
|
||||
label="编号">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.id }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="createTime"
|
||||
label="添加时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.createTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="updateTime"
|
||||
label="更新时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.updateTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="account"
|
||||
label="账户">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.account }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="balance"
|
||||
label="当前余额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.balance }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="amount"
|
||||
label="提现金额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.amount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="bank"
|
||||
label="银行卡">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.bank }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
@change="audit(scope.$index, scope.row)"
|
||||
:active-value="3"
|
||||
:inactive-value="2"
|
||||
v-model="scope.row.status">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="storeId"
|
||||
label="店铺编号">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.storeId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteSysStoreCash,audit} from '@/api/sys/sysStoreCash'
|
||||
import {auditStoreMoney} from '@/api/sys/sysStoreDepositLog'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'sysStoreCashList',
|
||||
data() {
|
||||
return {
|
||||
operates: [],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '提交申请';
|
||||
} else if (value === 2) {
|
||||
return '审核成功';
|
||||
} else if (value === 3) {
|
||||
return '审核失败';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/sys/updateSysStoreCash', query: {id: row.id}})
|
||||
},
|
||||
audit(index, row) {
|
||||
let data = new URLSearchParams();
|
||||
;
|
||||
data.append("id", row.id);
|
||||
data.append("amount", row.amount);
|
||||
data.append("showStatus", row.status);
|
||||
|
||||
auditStoreMoney(data).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
}).catch(error => {
|
||||
if (row.showStatus === 3) {
|
||||
row.showStatus = 2;
|
||||
} else {
|
||||
row.showStatus = 3;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteSysStoreCash(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchSysStoreCashList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showSysStoreCash') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideSysStoreCash') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addSysStoreCash() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/sys/addSysStoreCash'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysStoreCash/update.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysStoreCash/update.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreCash-detail :is-edit='true'>
|
||||
</sysStoreCash-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreCashDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateSysStoreCash',
|
||||
components: {SysStoreCashDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysStoreClass/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysStoreClass/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreClass-detail :is-edit='false'>
|
||||
</sysStoreClass-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreClassDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addSysStoreClass',
|
||||
components: {SysStoreClassDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="sysStoreClass" :rules="rules" ref="SysStoreClassFrom" label-width="150px">
|
||||
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="名称"
|
||||
prop="name">
|
||||
<el-input v-model="sysStoreClass.name" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="图片"
|
||||
prop="pic">
|
||||
<single-upload v-model="sysStoreClass.pic"></single-upload>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="排序"
|
||||
prop="sort">
|
||||
<el-input v-model="sysStoreClass.sort" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="备注"
|
||||
prop="memo">
|
||||
<el-input v-model="sysStoreClass.memo" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('SysStoreClassFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('SysStoreClassFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createSysStoreClass, getSysStoreClass, updateSysStoreClass} from '@/api/sys/sysStoreClass'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultSysStoreClass = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'SysStoreClassDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysStoreClass:
|
||||
Object.assign({},
|
||||
defaultSysStoreClass),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getSysStoreClass(this.$route.query.id).then(response => {
|
||||
this.sysStoreClass = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.sysStoreClass = Object.assign({},
|
||||
defaultSysStoreClass)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateSysStoreClass(this.$route.query.id, this.sysStoreClass).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createSysStoreClass(this.sysStoreClass).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreClass = Object.assign({},
|
||||
defaultSysStoreClass)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreClass = Object.assign({},
|
||||
defaultSysStoreClass)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
271
mallplusui-web-admin/src/views/sys/sysStoreClass/index.vue
Normal file
271
mallplusui-web-admin/src/views/sys/sysStoreClass/index.vue
Normal file
@@ -0,0 +1,271 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchSysStoreClassList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addSysStoreClass()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="sysStoreClassTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="id"
|
||||
label="编号">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.id }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="name"
|
||||
label="名称">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="pic"
|
||||
label="图片">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="sort"
|
||||
label="排序">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.sort }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="createTime"
|
||||
label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.createTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteSysStoreClass} from '@/api/sys/sysStoreClass'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'sysStoreClassList',
|
||||
data() {
|
||||
return {
|
||||
operates: [],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/store/updateSysStoreClass', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteSysStoreClass(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchSysStoreClassList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showSysStoreClass') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideSysStoreClass') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addSysStoreClass() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/store/addSysStoreClass'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysStoreClass/update.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysStoreClass/update.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreClass-detail :is-edit='true'>
|
||||
</sysStoreClass-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreClassDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateSysStoreClass',
|
||||
components: {SysStoreClassDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysStoreComment/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysStoreComment/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreComment-detail :is-edit='false'>
|
||||
</sysStoreComment-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreCommentDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addSysStoreComment',
|
||||
components: {SysStoreCommentDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="sysStoreComment" :rules="rules" ref="SysStoreCommentFrom" label-width="150px">
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="id"
|
||||
prop="id">
|
||||
<el-input v-model="sysStoreComment.id" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="名称"
|
||||
prop="name">
|
||||
<el-input v-model="sysStoreComment.name" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="创建时间"
|
||||
prop="createTime">
|
||||
<el-input v-model="sysStoreComment.createTime" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="图片"
|
||||
prop="pic">
|
||||
<el-input v-model="sysStoreComment.pic" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="排序"
|
||||
prop="sort">
|
||||
<el-input v-model="sysStoreComment.sort" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="备注"
|
||||
prop="memo">
|
||||
<el-input v-model="sysStoreComment.memo" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="storeId"
|
||||
prop="storeId">
|
||||
<el-input v-model="sysStoreComment.storeId" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="memberId"
|
||||
prop="memberId">
|
||||
<el-input v-model="sysStoreComment.memberId" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="等级"
|
||||
prop="star">
|
||||
<el-input v-model="sysStoreComment.star" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('SysStoreCommentFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('SysStoreCommentFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createSysStoreComment, getSysStoreComment, updateSysStoreComment} from '@/api/sys/sysStoreComment'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultSysStoreComment = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'SysStoreCommentDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysStoreComment:
|
||||
Object.assign({},
|
||||
defaultSysStoreComment),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo
|
||||
:
|
||||
[
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort
|
||||
:
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getSysStoreComment(this.$route.query.id).then(response => {
|
||||
this.sysStoreComment = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.sysStoreComment = Object.assign({},
|
||||
defaultSysStoreComment)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateSysStoreComment(this.$route.query.id, this.sysStoreComment).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createSysStoreComment(this.sysStoreComment).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreComment = Object.assign({},
|
||||
defaultSysStoreComment)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreComment = Object.assign({},
|
||||
defaultSysStoreComment)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
284
mallplusui-web-admin/src/views/sys/sysStoreComment/index.vue
Normal file
284
mallplusui-web-admin/src/views/sys/sysStoreComment/index.vue
Normal file
@@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchSysStoreCommentList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="sysStoreCommentTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="id"
|
||||
label="id">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.id }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="memberId"
|
||||
label="memberId">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.memberId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="name"
|
||||
label="名称">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="pic"
|
||||
label="图片">
|
||||
<template slot-scope="scope">
|
||||
<template slot-scope="scope"><img style="height: 80px" :src="scope.row.pic"></template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="sort"
|
||||
label="排序">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.sort }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="memo"
|
||||
label="备注">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.memo }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="star"
|
||||
label="等级">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.star }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime"
|
||||
label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.createTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteSysStoreComment} from '@/api/sys/sysStoreComment'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'sysStoreCommentList',
|
||||
data() {
|
||||
return {
|
||||
operates: [],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/sys/updateSysStoreComment', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteSysStoreComment(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchSysStoreCommentList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showSysStoreComment') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideSysStoreComment') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addSysStoreComment() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/sys/addSysStoreComment'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreComment-detail :is-edit='true'>
|
||||
</sysStoreComment-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreCommentDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateSysStoreComment',
|
||||
components: {SysStoreCommentDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreDepositLog-detail :is-edit='false'>
|
||||
</sysStoreDepositLog-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreDepositLogDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addSysStoreDepositLog',
|
||||
components: {SysStoreDepositLogDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="sysStoreDepositLog" :rules="rules" ref="SysStoreDepositLogFrom" label-width="150px">
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="id"
|
||||
prop="id">
|
||||
<el-input v-model="sysStoreDepositLog.id" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="createTime"
|
||||
prop="createTime">
|
||||
<el-input v-model="sysStoreDepositLog.createTime" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="updateTime"
|
||||
prop="updateTime">
|
||||
<el-input v-model="sysStoreDepositLog.updateTime" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="balance"
|
||||
prop="balance">
|
||||
<el-input v-model="sysStoreDepositLog.balance" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="credit"
|
||||
prop="credit">
|
||||
<el-input v-model="sysStoreDepositLog.credit" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="debit"
|
||||
prop="debit">
|
||||
<el-input v-model="sysStoreDepositLog.debit" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="memo"
|
||||
prop="memo">
|
||||
<el-input v-model="sysStoreDepositLog.memo" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="type"
|
||||
prop="type">
|
||||
<el-input v-model="sysStoreDepositLog.type" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="storeId"
|
||||
prop="storeId">
|
||||
<el-input v-model="sysStoreDepositLog.storeId" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('SysStoreDepositLogFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('SysStoreDepositLogFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createSysStoreDepositLog, getSysStoreDepositLog, updateSysStoreDepositLog} from '@/api/sys/sysStoreDepositLog'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultSysStoreDepositLog = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'SysStoreDepositLogDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysStoreDepositLog:
|
||||
Object.assign({},
|
||||
defaultSysStoreDepositLog),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo
|
||||
:
|
||||
[
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort
|
||||
:
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getSysStoreDepositLog(this.$route.query.id).then(response => {
|
||||
this.sysStoreDepositLog = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.sysStoreDepositLog = Object.assign({},
|
||||
defaultSysStoreDepositLog)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateSysStoreDepositLog(this.$route.query.id, this.sysStoreDepositLog).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createSysStoreDepositLog(this.sysStoreDepositLog).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreDepositLog = Object.assign({},
|
||||
defaultSysStoreDepositLog)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreDepositLog = Object.assign({},
|
||||
defaultSysStoreDepositLog)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
455
mallplusui-web-admin/src/views/sys/sysStoreDepositLog/index.vue
Normal file
455
mallplusui-web-admin/src/views/sys/sysStoreDepositLog/index.vue
Normal file
@@ -0,0 +1,455 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchSysStoreDepositLogList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.type" placeholder="类型类型/1-6"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addSysStoreDepositLog()"
|
||||
size="mini">
|
||||
预存款充值
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="drawSysStoreDepositLog()"
|
||||
size="mini">
|
||||
预存款提现
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="sysStoreDepositLogTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="id"
|
||||
label="编号">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.id }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="createTime"
|
||||
label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.createTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="updateTime"
|
||||
label="更新时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.updateTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="type"
|
||||
label="类型">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.type |formatStatus}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="balance"
|
||||
label="当前余额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.balance }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="credit"
|
||||
label="收入金额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.credit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="debit"
|
||||
label="支出金额">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.debit }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="memo"
|
||||
label="备注">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.memo }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="storeId"
|
||||
label="storeId">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.storeId }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<el-dialog
|
||||
title="预存款充值"
|
||||
:visible.sync="blance.dialogVisible"
|
||||
width="40%">
|
||||
<el-form :model="blance" ref="brandFrom" label-width="150px">
|
||||
<el-form-item
|
||||
label="可用余额:"
|
||||
prop="account">
|
||||
<el-input v-model="blance.balance" readonly="readonly" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值金额:" prop="detail">
|
||||
<el-input v-model="blance.credit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式:">
|
||||
<el-radio-group v-model="blance.memo">
|
||||
<el-radio-button :label="1">微信</el-radio-button>
|
||||
<el-radio-button :label="2">支付宝</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="blance.dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleEditBlance">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="预存款提现"
|
||||
:visible.sync="integration.dialogVisible"
|
||||
width="40%">
|
||||
<el-form :model="integration" ref="brandFrom" label-width="150px">
|
||||
<el-form-item
|
||||
label="可用余额:"
|
||||
prop="balance">
|
||||
<el-input v-model="integration.balance" readonly="readonly" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="收款账号:"
|
||||
prop="account">
|
||||
<el-input v-model="integration.account" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="金额:"
|
||||
prop="amount">
|
||||
<el-input v-model="integration.amount" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="收款银行:"
|
||||
prop="bank">
|
||||
<el-input v-model="integration.bank" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="integration.dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleEditIntegration">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {getCurrentStore} from '@/api/sys/sysStore'
|
||||
import {fetchList, deleteSysStoreDepositLog,drawStoreMoney,addStoreMoney,auditStoreMoney} from '@/api/sys/sysStoreDepositLog'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'sysStoreDepositLogList',
|
||||
data() {
|
||||
return {
|
||||
operates: [],
|
||||
operateType: null,
|
||||
store:null,
|
||||
blance:{
|
||||
dialogVisible:false,
|
||||
id:null,
|
||||
},
|
||||
integration:{
|
||||
dialogVisible:false,
|
||||
id:null,
|
||||
},
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '预存款充值';
|
||||
} else if (value === 2) {
|
||||
return '预存款调整';
|
||||
} else if (value === 3) {
|
||||
return '订单支付';
|
||||
} else if (value === 4) {
|
||||
return '服务支付';
|
||||
}else if (value === 5) {
|
||||
return '订单退款';
|
||||
}else if (value === 6) {
|
||||
return '订单结算';
|
||||
}else if (value === 7) {
|
||||
return '提现';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
})
|
||||
;
|
||||
getCurrentStore().then(response => {
|
||||
this.blance.balance=response.data.amount
|
||||
this.integration.balance=response.data.amount
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/sys/updateSysStoreDepositLog', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteSysStoreDepositLog(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchSysStoreDepositLogList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showSysStoreDepositLog') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideSysStoreDepositLog') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addSysStoreDepositLog() {
|
||||
this.blance.dialogVisible=true;
|
||||
|
||||
},
|
||||
drawSysStoreDepositLog() {
|
||||
this.integration.dialogVisible=true;
|
||||
|
||||
},
|
||||
handleEditBlance(){
|
||||
|
||||
this.$confirm('是否要进行余额充值', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(()=>{
|
||||
|
||||
addStoreMoney(this.blance).then(response => {
|
||||
this.$message({
|
||||
message: '余额充值成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
this.blance.dialogVisible=false;
|
||||
|
||||
});
|
||||
},
|
||||
handleEditIntegration(){
|
||||
if(this.integration.blance<this.integration.amount){
|
||||
this.$message({
|
||||
message: '请余额不足',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return
|
||||
}
|
||||
if(this.integration.amount==null){
|
||||
this.$message({
|
||||
message: '请输入金额',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return
|
||||
}
|
||||
if(this.integration.account==null){
|
||||
this.$message({
|
||||
message: '请输入账户',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return
|
||||
}
|
||||
if(this.integration.bank==null){
|
||||
this.$message({
|
||||
message: '请输入银行',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return
|
||||
}
|
||||
this.$confirm('是否要进行申请提现', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(()=>{
|
||||
|
||||
drawStoreMoney(this.integration).then(response => {
|
||||
this.$message({
|
||||
message: '申请提现成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
this.integration.dialogVisible=false;
|
||||
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreDepositLog-detail :is-edit='true'>
|
||||
</sysStoreDepositLog-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreDepositLogDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateSysStoreDepositLog',
|
||||
components: {SysStoreDepositLogDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysStoreRank/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysStoreRank/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreRank-detail :is-edit='false'>
|
||||
</sysStoreRank-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreRankDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addSysStoreRank',
|
||||
components: {SysStoreRankDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="sysStoreRank" :rules="rules" ref="SysStoreRankFrom" label-width="150px">
|
||||
|
||||
|
||||
|
||||
<el-form-item
|
||||
label="名称"
|
||||
prop="name">
|
||||
<el-input v-model="sysStoreRank.name" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="可发布商品数"
|
||||
prop="quantity">
|
||||
<el-input v-model="sysStoreRank.quantity" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="服务费"
|
||||
prop="serviceFee">
|
||||
<el-input v-model="sysStoreRank.serviceFee" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="排序"
|
||||
prop="sort">
|
||||
<el-input v-model="sysStoreRank.sort" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
label="备注"
|
||||
prop="memo">
|
||||
<el-input v-model="sysStoreRank.memo" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('SysStoreRankFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('SysStoreRankFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createSysStoreRank, getSysStoreRank, updateSysStoreRank} from '@/api/sys/sysStoreRank'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultSysStoreRank = {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'SysStoreRankDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysStoreRank:
|
||||
Object.assign({},
|
||||
defaultSysStoreRank),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo
|
||||
:
|
||||
[
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getSysStoreRank(this.$route.query.id).then(response => {
|
||||
this.sysStoreRank = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.sysStoreRank = Object.assign({},
|
||||
defaultSysStoreRank)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateSysStoreRank(this.$route.query.id, this.sysStoreRank).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createSysStoreRank(this.sysStoreRank).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreRank = Object.assign({},
|
||||
defaultSysStoreRank)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysStoreRank = Object.assign({},
|
||||
defaultSysStoreRank)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
268
mallplusui-web-admin/src/views/sys/sysStoreRank/index.vue
Normal file
268
mallplusui-web-admin/src/views/sys/sysStoreRank/index.vue
Normal file
@@ -0,0 +1,268 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchSysStoreRankList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
class="btn-add"
|
||||
@click="addSysStoreRank()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="sysStoreRankTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column prop="id"
|
||||
label="id">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.id }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="createTime"
|
||||
label="创建时间">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.createTime |formatCreateTime}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="name"
|
||||
label="名称">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="quantity"
|
||||
label="可发布商品数">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.quantity }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column prop="serviceFee"
|
||||
label="服务费">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.serviceFee }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deleteSysStoreRank} from '@/api/sys/sysStoreRank'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'sysStoreRankList',
|
||||
data() {
|
||||
return {
|
||||
operates: [],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/store/updateSysStoreRank', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteSysStoreRank(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
})
|
||||
;
|
||||
|
||||
})
|
||||
;
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchSysStoreRankList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showSysStoreRank') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideSysStoreRank') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addSysStoreRank() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/store/addSysStoreRank'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysStoreRank/update.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysStoreRank/update.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysStoreRank-detail :is-edit='true'>
|
||||
</sysStoreRank-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysStoreRankDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateSysStoreRank',
|
||||
components: {SysStoreRankDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysTest/add.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysTest/add.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysTest-detail :is-edit='false'>
|
||||
</sysTest-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysTestDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'addSysTest',
|
||||
components: {SysTestDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
170
mallplusui-web-admin/src/views/sys/sysTest/components/detail.vue
Normal file
170
mallplusui-web-admin/src/views/sys/sysTest/components/detail.vue
Normal file
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="sysTest" :rules="rules" ref="SysTestFrom" label-width="150px">
|
||||
|
||||
|
||||
<el-form-item label="编号" prop="id">
|
||||
<el-input v-model="sysTest.id" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="sysTest.name" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="sysTest.createTime" style="width: 370px;"/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('SysTestFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('SysTestFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createSysTest, getSysTest, updateSysTest} from '@/api/sys/sysTest'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
|
||||
const defaultSysTest= {
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'SysTestDetail',
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sysTest:
|
||||
Object.assign({},
|
||||
defaultSysTest),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo
|
||||
:
|
||||
[
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort
|
||||
:
|
||||
[
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getSysTest(this.$route.query.id).then(response => {
|
||||
this.sysTest = response.data;
|
||||
})
|
||||
;
|
||||
} else {
|
||||
this.sysTest = Object.assign({},
|
||||
defaultSysTest)
|
||||
;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if(valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit
|
||||
)
|
||||
{
|
||||
updateSysTest(this.$route.query.id, this.sysTest).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
createSysTest(this.sysTest).then(response => {
|
||||
if(response.code == 200
|
||||
)
|
||||
{
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysTest = Object.assign({},
|
||||
defaultSysTest)
|
||||
;
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
;
|
||||
}
|
||||
})
|
||||
;
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.sysTest = Object.assign({},
|
||||
defaultSysTest)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
233
mallplusui-web-admin/src/views/sys/sysTest/index.vue
Normal file
233
mallplusui-web-admin/src/views/sys/sysTest/index.vue
Normal file
@@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchSysTestList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="类型名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
<el-button
|
||||
|
||||
class="btn-add"
|
||||
@click="addSysTest()"
|
||||
size="mini">
|
||||
添加
|
||||
</el-button>
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="sysTestTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column align="center" prop="编号" label="编号">
|
||||
<template slot-scope="scope">{{scope.row.id}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="名称" label="名称"/>
|
||||
<el-table-column align="center" prop="创建时间" label="创建时间"/>
|
||||
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="handleUpdate(scope.$index, scope.row)">编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index, scope.row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
//将$都替换为$
|
||||
import {fetchList, deletes} from '@/api/sys/sysTest'
|
||||
import {formatDate} from '@/utils/date';
|
||||
|
||||
export default {
|
||||
name: 'sysTestList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
});
|
||||
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push(
|
||||
{path: '/sys/updateSysTest', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该类型', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deletes(row.id
|
||||
).
|
||||
then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchSysTestList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showSysTest') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideSysTest') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
})
|
||||
;
|
||||
},
|
||||
addSysTest() {
|
||||
//手动将router,改成$router
|
||||
this.$router.push({path: '/sys/addSysTest'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
16
mallplusui-web-admin/src/views/sys/sysTest/update.vue
Normal file
16
mallplusui-web-admin/src/views/sys/sysTest/update.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<sysTest-detail :is-edit='true'>
|
||||
</sysTest-detail>
|
||||
</template>
|
||||
<script>
|
||||
import SysTestDetail from './components/detail'
|
||||
|
||||
export default {
|
||||
name: 'updateSysTest',
|
||||
components: {SysTestDetail}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
14
mallplusui-web-admin/src/views/sys/webLog/add.vue
Normal file
14
mallplusui-web-admin/src/views/sys/webLog/add.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<webLog-detail :is-edit='false'></webLog-detail>
|
||||
</template>
|
||||
<script>
|
||||
import WebLogDetail from './components/WebLogDetail'
|
||||
export default {
|
||||
name: 'addWebLog',
|
||||
components: { WebLogDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="webLog" :rules="rules" ref="webLogFrom" label-width="150px">
|
||||
<el-form-item label="编号:" prop="id">
|
||||
<el-input v-model="webLog.id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户编号:" prop="userId">
|
||||
<el-input v-model="webLog.userId"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名:" prop="userName">
|
||||
<el-input v-model="webLog.userName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="模块名:" prop="serviceName">
|
||||
<el-input v-model="webLog.serviceName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="记录类名+方法名:" prop="method">
|
||||
<el-input v-model="webLog.method"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述:" prop="operationDesc">
|
||||
<el-input v-model="webLog.operationDesc"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间:" prop="createTime">
|
||||
<el-input v-model="webLog.createTime"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="IP:" prop="ip">
|
||||
<el-input v-model="webLog.ip"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数:" prop="params">
|
||||
<el-input v-model="webLog.params"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('webLogFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('webLogFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import {createWebLog, getWebLog, updateWebLog} from '@/api/sys/webLog'
|
||||
import SingleUpload from '@/components/Upload/singleUpload'
|
||||
import {formatDate} from '@/utils/date';
|
||||
const defaultWebLog={
|
||||
name: ''
|
||||
};
|
||||
export default {
|
||||
name: 'WebLogDetail',
|
||||
components:{SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
webLog:Object.assign({}, defaultWebLog),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
],
|
||||
logo: [
|
||||
{required: true, message: '请输入品牌logo', trigger: 'blur'}
|
||||
],
|
||||
sort: [
|
||||
{type: 'number', message: '排序必须为数字'}
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getWebLog(this.$route.query.id).then(response => {
|
||||
this.webLog = response.data;
|
||||
});
|
||||
}else{
|
||||
this.webLog = Object.assign({},defaultWebLog);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.isEdit) {
|
||||
updateWebLog(this.$route.query.id, this.webLog).then(response => {
|
||||
if(response.code==200){
|
||||
this.$refs[formName].resetFields();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
}else{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
createWebLog(this.webLog).then(response => {
|
||||
if(response.code==200){
|
||||
this.$refs[formName].resetFields();
|
||||
this.webLog = Object.assign({},defaultWebLog);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration:1000
|
||||
});
|
||||
this.$router.back();
|
||||
}else{
|
||||
this.$message({
|
||||
message: response.msg,
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration:1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.webLog = Object.assign({},defaultWebLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
231
mallplusui-web-admin/src/views/sys/webLog/index.vue
Normal file
231
mallplusui-web-admin/src/views/sys/webLog/index.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchWebLogList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="webLogTable"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
|
||||
<el-table-column label="用户名" align="center">
|
||||
<template slot-scope="scope">{{scope.row.userName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接口类型" align="center">
|
||||
<template slot-scope="scope">{{scope.row.serviceName}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接口" align="center">
|
||||
<template slot-scope="scope">{{scope.row.method}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.timeMin}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center">
|
||||
<template slot-scope="scope">{{scope.row.createTime|formatCreateTime}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="IP" align="center">
|
||||
<template slot-scope="scope">{{scope.row.ip}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数数据显示xxxxxxxx" align="center">
|
||||
<template slot-scope="scope">{{scope.row.params}}</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="batch-operate-container">
|
||||
|
||||
</div>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper"
|
||||
:page-size="listQuery.pageSize"
|
||||
:page-sizes="[5,10,15]"
|
||||
:current-page.sync="listQuery.pageNum"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {fetchList, deleteWebLog} from '@/api/sys/webLog'
|
||||
import {formatDate} from '@/utils/date';
|
||||
export default {
|
||||
name: 'webLogList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示品牌",
|
||||
value: "showWebLog"
|
||||
},
|
||||
{
|
||||
label: "隐藏品牌",
|
||||
value: "hideWebLog"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.totalPage = response.data.pages;
|
||||
this.pageSize = response.data.size;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updateWebLog', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该品牌', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteWebLog(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchWebLogList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showWebLog') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideWebLog') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addWebLog() {
|
||||
this.$router.push({path: '/build/add${className}'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
14
mallplusui-web-admin/src/views/sys/webLog/update.vue
Normal file
14
mallplusui-web-admin/src/views/sys/webLog/update.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<webLog-detail :is-edit='true'></webLog-detail>
|
||||
</template>
|
||||
<script>
|
||||
import WebLogDetail from './components/WebLogDetail'
|
||||
export default {
|
||||
name: 'updateWebLog',
|
||||
components: { WebLogDetail }
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
||||
|
||||
261
mallplusui-web-admin/src/views/sys/webLog/webLogStatic.vue
Normal file
261
mallplusui-web-admin/src/views/sys/webLog/webLogStatic.vue
Normal file
@@ -0,0 +1,261 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button
|
||||
style="float: right"
|
||||
@click="searchAdminLogList()"
|
||||
type="primary"
|
||||
size="small">
|
||||
查询结果
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="输入搜索:">
|
||||
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="提交时间:">
|
||||
<el-date-picker
|
||||
class="input-width"
|
||||
v-model="listQuery.startTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="提交时间:">
|
||||
<el-date-picker
|
||||
class="input-width"
|
||||
v-model="listQuery.endTime"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="date"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
|
||||
</el-card>
|
||||
<div class="table-container">
|
||||
<el-table ref="webLogStatic"
|
||||
:data="list"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="listLoading"
|
||||
border>
|
||||
|
||||
|
||||
<el-table-column label="接口名" align="center">
|
||||
<template slot-scope="scope">{{scope.row.method}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调用次数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="平均时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.avgMin}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.1秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count1}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.3秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count2}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.6秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count3}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过1秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count4}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过1.5秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count5}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过3秒个数" align="center">
|
||||
<template slot-scope="scope">{{scope.row.count6}}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="超过0.1秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum1}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.3秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum2}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过0.6秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum3}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过1秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum4}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过1.5秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum5}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="超过3秒总时长" align="center">
|
||||
<template slot-scope="scope">{{scope.row.sum6}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {fetchList,logStatic} from '@/api/sys/webLog'
|
||||
import {formatDate} from '@/utils/date';
|
||||
export default {
|
||||
name: 'adminLogList',
|
||||
data() {
|
||||
return {
|
||||
operates: [
|
||||
{
|
||||
label: "显示品牌",
|
||||
value: "showAdminLog"
|
||||
},
|
||||
{
|
||||
label: "隐藏品牌",
|
||||
value: "hideAdminLog"
|
||||
}
|
||||
],
|
||||
operateType: null,
|
||||
listQuery: {
|
||||
keyword: null,
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
list: null,
|
||||
total: null,
|
||||
listLoading: true,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
|
||||
formatStatus(value) {
|
||||
if (value === 1) {
|
||||
return '未开始';
|
||||
} else if (value === 2) {
|
||||
return '活动中';
|
||||
} else if (value === 3) {
|
||||
return '已结束';
|
||||
} else if (value === 4) {
|
||||
return '已失效';
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
logStatic(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
this.list = response.data;
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$router.push({path: '/sys/updateAdminLog', query: {id: row.id}})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('是否要删除该品牌', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteAdminLog(row.id).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getProductList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
getProductCommentList(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
searchAdminLogList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleBatchOperate() {
|
||||
console.log(this.multipleSelection);
|
||||
if (this.multipleSelection < 1) {
|
||||
this.$message({
|
||||
message: '请选择一条记录',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let showStatus = 0;
|
||||
if (this.operateType === 'showAdminLog') {
|
||||
showStatus = 1;
|
||||
} else if (this.operateType === 'hideAdminLog') {
|
||||
showStatus = 0;
|
||||
} else {
|
||||
this.$message({
|
||||
message: '请选择批量操作类型',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
let data = new URLSearchParams();
|
||||
data.append("ids", ids);
|
||||
data.append("showStatus", showStatus);
|
||||
updateShowStatus(data).then(response => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
addAdminLog() {
|
||||
this.$router.push({path: '/build/add${className}'})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user