Commit 7de07c63 authored by 扫地僧's avatar 扫地僧

半成品

parent 178f14ed
...@@ -13,8 +13,8 @@ module.exports = { ...@@ -13,8 +13,8 @@ module.exports = {
proxyTable: {}, proxyTable: {},
// Various Dev Server settings // Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST // host: 'localhost', // can be overwritten by process.env.HOST
// host: '192.168.1.100', // can be overwritten by process.env.HOST host: '192.168.1.112', // can be overwritten by process.env.HOST
port: 9527, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined port: 9527, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: true, autoOpenBrowser: true,
errorOverlay: true, errorOverlay: true,
......
import request from './request' import request from './request'
import qs from 'qs' import qs from 'qs'
export function getAdvertList(data) { export function advertList(data) {
return request({ return request({
url: '/advert/getAdvertList', url: '/advert/advertList',
method: 'post', method: 'post',
data:qs.stringify(data) data:qs.stringify(data)
}) })
......
...@@ -37,6 +37,15 @@ export function queryAllSysRole() { ...@@ -37,6 +37,15 @@ export function queryAllSysRole() {
}) })
} }
// 选择管理员
export function queryAllShopAdmin() {
return request({
url: '/sysRole/queryAllSysRole',
method: 'post',
})
}
// --------user---end----------- // --------user---end-----------
......
...@@ -54,18 +54,18 @@ export const asyncRouterMap = [ ...@@ -54,18 +54,18 @@ export const asyncRouterMap = [
// 商家管理 // 店铺管理
{ {
path: '/store', path: '/store',
alwaysShow:true, alwaysShow:true,
component: Layout, component: Layout,
redirect: '/store/storeList', redirect: '/store/storeList',
meta: { meta: {
title: '商家管理', title: '店铺管理',
icon: 'cheliang' icon: 'cheliang'
}, },
children: [ children: [
{ path: 'storeList', component: _import('store/storeList'), name: 'store_storeList', meta: { title: '商家列表' }} { path: 'storeList', component: _import('store/storeList'), name: 'store_storeList', meta: { title: '店铺列表' }}
] ]
}, },
...@@ -84,14 +84,14 @@ export const asyncRouterMap = [ ...@@ -84,14 +84,14 @@ export const asyncRouterMap = [
] ]
}, },
// 店铺管理 // 店铺管理
{ {
path: '/administrators', path: '/administrators',
alwaysShow:true, alwaysShow:true,
component: Layout, component: Layout,
redirect: '/administrators/administratorstList', redirect: '/administrators/administratorstList',
meta: { meta: {
title: '店铺管理', title: '店铺管理',
icon: 'cheliang' icon: 'cheliang'
}, },
children: [ children: [
......
<template>
<div class="view-page">
<div class="phone-bg">
<img :src="require('../../../../static/images/phone-bg.png')" alt="">
</div>
<div class="page-infro">
<!-- <el-carousel height="202px" indicator-position="none">
<el-carousel-item v-for="(item,index) in imageArr" :key="index">
<div class="bannerImg"><img :src="item" alt=""></div>
</el-carousel-item>
</el-carousel> -->
<!-- <div class="bannerImg">
<img :src="data.advertPicUrl" alt="" height="202">
</div> -->
<div class="text-infro" v-html="data.advertContent"></div>
</div>
</div>
</template>
<script>
export default {
props:["data"],
data(){
return {
imageArr:[]
}
},
beforeMount(){
const data = this.data;
// let arr = [];
// for(const key in data){
// if(key.indexOf('dishesPicUrl')>-1 && data[key]){
// arr.push(data[key])
// }
// }
// this.imageArr = arr
}
}
</script>
<style lang="scss" scoped>
.view-page{
position: relative;
.phone-bg{
width: 360px;
img{
width: 100%;
}
}
.page-infro{
background:#fff;
position: absolute;
top:110px;
left: 30px;
width:304px;
height: 540px;
overflow-x: hidden;
overflow-y: auto;
.bannerImg{
width: 100%;
height: 202px;
img{
width: 100%;
height: 100%;
}
}
.text-infro{
padding: 0 15px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="uploadimg-container" :style="{width:width+'px'}">
<el-upload class="uploader-component" :style="styleObj" action="" :show-file-list="false" :before-upload="uploadFile">
<img :style="styleObj" v-if="(type||imageUrl)&&viewUrl" :src="viewUrl || imageUrl" class="avatar">
<i v-else :style="styleObj" class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<div class="tip">宽/高:{{`${width}*${height}`}}</div>
</div>
</template>
<script>
import axios from "axios";
export default {
props: ["width", "height", "resPath", "type", "viewUrl", "imageType", "idx"],
data() {
return {
imageUrl: "",
param: { resPath: this.resPath },
styleObj: {
width: this.width + "px",
height: this.height + "px",
lineHeight: this.height + "px"
}
};
},
mounted() {},
updated() {},
methods: {
uploadFile(file) {
const upLoadUrl = process.env.BASE_API + "/upload/uploadFile";
let formData = new FormData();
formData.append("files", file);
formData.append("resPath", this.resPath);
// 限制图片上传比例
// if (this.imageType === "banner") {
// console.log(this.imageType);
// formData.append("imageType", this.imageType);
// }
const fileSize = file.size / 1024 / 1024;
if (fileSize > 2) {
this.$message({
message: "上传图片不能大于2M",
type: "warning"
});
} else {
axios.post(upLoadUrl, formData).then(res => {
if (res.data.code == 1) {
this.imageUrl = res.data.data;
if (this.idx === undefined) {
this.$emit("emitSuccess", res.data.data);
} else {
const param = {
url: res.data.data,
idx: this.idx
};
this.$emit("emitSuccess", param);
}
this.$message({
message: "上传成功",
type: "success"
});
} else {
this.$message({
message: res.data.msg,
type: "warning"
});
}
});
}
},
clearImg() {
this.imageUrl = "";
}
}
};
</script>
<style lang="scss" scoped>
.uploadimg-container {
position: relative;
overflow: hidden;
display: inline-block;
.uploader-component {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
width: 178px;
height: 178px;
transition: all 0.3s;
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
transition: all 0.3s;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
&:hover {
border-color: #409eff;
.avatar-uploader-icon {
font-size: 28px;
color: #409eff;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
& + .tip {
left: 10px;
opacity: 1;
}
}
}
.tip {
position: absolute;
left: -140px;
opacity: 0;
top: 0;
width: 131px;
color: #fff;
text-shadow: 2px 2px 2px rgba($color: #000000, $alpha: 1);
font-weight: 700;
cursor: pointer;
transition: all 0.3s;
&:hover {
left: 10px;
opacity: 1;
}
}
}
</style>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<el-row :gutter="15" v-if="this.dialogBindData.flag!=='1'"> <el-row :gutter="15" v-if="this.dialogBindData.flag!=='1'">
<el-col :span="8" class="content-left"><label>用户角色</label></el-col> <el-col :span="8" class="content-left"><label>用户角色</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择人员" v-model="dialogBindData.sysRole"> <el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择角色" v-model="dialogBindData.sysRole">
<el-option <el-option
v-for="item in chooseRole" v-for="item in chooseRole"
:key="item.roleId" :key="item.roleId"
...@@ -116,11 +116,11 @@ ...@@ -116,11 +116,11 @@
</el-row> </el-row>
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>所属部门</label></el-col> <el-col :span="8" class="content-left"><label>店铺管理员</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择部门" v-model="dialogBindData.deptId" @change="getSectionsByDeptId"> <el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择店铺管理员" v-model="dialogBindData.deptId" @change="getSectionsByDeptId">
<el-option <el-option
v-for="item in deptDatas" v-for="item in shopAdminsData"
:key="item.deptId" :key="item.deptId"
:label="item.deptName" :label="item.deptName"
:value="item.deptId"> :value="item.deptId">
...@@ -130,25 +130,11 @@ ...@@ -130,25 +130,11 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="15">
<el-col :span="8" class="content-left"><label>所属科室</label></el-col>
<el-col :span="16" class="content-right">
<el-select size="small" v-if="dialogType===1 || dialogType===2" placeholder="请选择部门" v-model="dialogBindData.sectionId">
<el-option
v-for="item in sectionDatas"
:key="item.sectionId"
:label="item.sectionName"
:value="item.sectionId">
</el-option>
</el-select>
<span v-else>{{viewSectionName(dialogBindData.sectionId)}}</span>
</el-col>
</el-row>
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>用户名</label></el-col> <el-col :span="8" class="content-left"><label>用户名</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入用户名" v-model="dialogBindData.userName"></el-input> <el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入用户名" v-model="dialogBindData.userName"></el-input>
<span v-else>{{dialogBindData.userName}}</span> <span v-else>{{dialogBindData.userName}}</span>
</el-col> </el-col>
</el-row> </el-row>
...@@ -156,7 +142,7 @@ ...@@ -156,7 +142,7 @@
<el-row :gutter="15"> <el-row :gutter="15">
<el-col :span="8" class="content-left"><label>真实姓名</label></el-col> <el-col :span="8" class="content-left"><label>真实姓名</label></el-col>
<el-col :span="16" class="content-right"> <el-col :span="16" class="content-right">
<el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入用户名" v-model="dialogBindData.realName"></el-input> <el-input v-if="dialogType===1 || dialogType===2" size="small" placeholder="请输入真实姓名" v-model="dialogBindData.realName"></el-input>
<span v-else>{{dialogBindData.realName}}</span> <span v-else>{{dialogBindData.realName}}</span>
</el-col> </el-col>
</el-row> </el-row>
...@@ -219,6 +205,7 @@ ...@@ -219,6 +205,7 @@
</template> </template>
<script> <script>
import axios from 'axios';
import elDragDialog from "@/directive/el-dragDialog"; import elDragDialog from "@/directive/el-dragDialog";
import * as system from "../../api/system"; import * as system from "../../api/system";
import { fattCreateTime } from "../../utils/fattTime"; import { fattCreateTime } from "../../utils/fattTime";
...@@ -248,11 +235,12 @@ export default { ...@@ -248,11 +235,12 @@ export default {
mobilePhone: "", mobilePhone: "",
isAvailable: 1, isAvailable: 1,
sysRole: "", sysRole: "",
deptId: "", flag: ""
flag: "",
sectionName: "",
sectionId: ""
}, },
//店铺管理员下拉数据
shopAdminsData:null,
// 是否提交 // 是否提交
submmitSuccess: false, submmitSuccess: false,
// 角色选择数据 // 角色选择数据
...@@ -337,7 +325,10 @@ export default { ...@@ -337,7 +325,10 @@ export default {
// }, // },
add() { add() {
this.dialogType = 1; this.dialogType = 1;
this.getRoleList(() => { // this.getRoleList(() => {
// this.dialogState = true;
// });
this.getRoleAndUserData(() => {
this.dialogState = true; this.dialogState = true;
}); });
}, },
...@@ -412,7 +403,7 @@ export default { ...@@ -412,7 +403,7 @@ export default {
} else { } else {
this.submmitSuccess = true; this.submmitSuccess = true;
system.addOrEditSysUser(this.dialogBindData).then(res => { system.addOrEditSysUser(this.dialogBindData).then(res => {
debugger debugger;
if (res.data.code == 1) { if (res.data.code == 1) {
this.getList(() => { this.getList(() => {
this.$message({ this.$message({
...@@ -496,6 +487,27 @@ export default { ...@@ -496,6 +487,27 @@ export default {
cb ? cb() : ""; cb ? cb() : "";
}); });
}, },
//获取角色和管理员下拉数据
getRoleAndUserData(cb) {
axios
.all([
//方法一
system.queryAllSysRole().then(res => {
this.chooseRole = res.data;
}),
//方法二
system.queryAllShopAdmin().then(res => {
this.shopAdminsData = res.data;
})
])
.then(
axios.spread((acct, perms)=> {
cb ? cb() : "";
})
);
},
// 格式化时间 // 格式化时间
fattTime(time) { fattTime(time) {
return fattCreateTime(time); return fattCreateTime(time);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment