Commit 39a1f908 authored by 刘帅阳's avatar 刘帅阳

Merge remote-tracking branch 'origin/master'

parents 6a5cfe83 b74d8ab4
...@@ -82,6 +82,13 @@ export function queryUnitAdmin(query) { ...@@ -82,6 +82,13 @@ export function queryUnitAdmin(query) {
params: query params: query
}) })
} }
// 查询单一商家管理员
export function queryUnitAdminByBusinessId(businessId) {
return request({
url: '/sysuser/detail/' + businessId,
method: 'get'
})
}
// 8.查询所有单位信息 // 8.查询所有单位信息
export function listUnitAll(query) { export function listUnitAll(query) {
...@@ -100,6 +107,3 @@ export function listCourseAll(query) { ...@@ -100,6 +107,3 @@ export function listCourseAll(query) {
}) })
} }
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
action="#" action="#"
drag drag
:show-file-list="true" :show-file-list="true"
:file-list="fileList"
:http-request="handleUploadVideo" :http-request="handleUploadVideo"
:on-success="handleAvatarSuccessVideo" :on-success="handleAvatarSuccessVideo"
:before-upload="beforeAvatarUploadVideo" :before-upload="beforeAvatarUploadVideo"
...@@ -115,7 +116,10 @@ ...@@ -115,7 +116,10 @@
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div slot="tip" class="el-upload__tip">只能上传 mp4 格式的视频文件!</div> <div slot="tip" class="el-upload__tip">只能上传 mp4 格式的视频文件!</div>
</el-upload> </el-upload>
<el-button :disabled="!videoUrl" @click="previewVideo">视频预览</el-button> <div style="display: flex;flex-direction: column;">
<span v-if="secondFromDisabled" style="color: #606266;">{{ this.form.videoName }}</span>
<el-button :disabled="!videoUrl" style="width: 40%" @click="previewVideo">视频预览</el-button>
</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -156,6 +160,7 @@ export default { ...@@ -156,6 +160,7 @@ export default {
data() { data() {
return { return {
videoShow: false, videoShow: false,
isDelFile: false,
fileList: [], fileList: [],
// 视频配置 // 视频配置
playerOptions: { playerOptions: {
...@@ -244,7 +249,8 @@ export default { ...@@ -244,7 +249,8 @@ export default {
homeDisplay: undefined, homeDisplay: undefined,
videoType: undefined, videoType: undefined,
tenant: undefined, tenant: undefined,
isTop: undefined isTop: undefined,
videoName: undefined
}, },
// 状态 // 状态
statusOptions: [ statusOptions: [
...@@ -302,7 +308,6 @@ export default { ...@@ -302,7 +308,6 @@ export default {
}) })
}, },
handleUploadVideo(file) { handleUploadVideo(file) {
this.fileList = []
const formData = new FormData() const formData = new FormData()
formData.append('file', file.file) formData.append('file', file.file)
formData.append('temp', 'videoInformation') formData.append('temp', 'videoInformation')
...@@ -311,7 +316,11 @@ export default { ...@@ -311,7 +316,11 @@ export default {
this.$message.success('上传成功') this.$message.success('上传成功')
this.videoUrl = res.data.businessId this.videoUrl = res.data.businessId
this.form.videoUrlId = res.data.businessId this.form.videoUrlId = res.data.businessId
this.fileList.push(res.data) this.fileList = []
const file = {
name: res.data.originalName
}
this.fileList.push(file)
// this.playerOptions.sources[0].src = urlDecrypt(res.data.url) // this.playerOptions.sources[0].src = urlDecrypt(res.data.url)
}) })
}, },
...@@ -346,6 +355,11 @@ export default { ...@@ -346,6 +355,11 @@ export default {
this.form = res.data this.form = res.data
this.imageUrl = res.data.path this.imageUrl = res.data.path
this.videoUrl = res.data.videoUrlId this.videoUrl = res.data.videoUrlId
this.fileList = []
const file = {
name: res.data.videoName
}
this.fileList.push(file)
} }
}) })
} }
...@@ -387,14 +401,18 @@ export default { ...@@ -387,14 +401,18 @@ export default {
handleRemove(file, fileList) { handleRemove(file, fileList) {
console.log('file', file) console.log('file', file)
console.log('fileList', fileList) console.log('fileList', fileList)
this.fileList = [] if (!this.isDelFile) {
this.fileList = []
}
if (fileList.length <= 0) { if (fileList.length <= 0) {
this.videoUrl = '' this.videoUrl = ''
} }
this.isDelFile = false
}, },
beforeAvatarUploadVideo(file) { beforeAvatarUploadVideo(file) {
if (this.fileList.length > 0) { if (this.fileList.length > 0) {
this.$message.error('一次只能上传一个视频!') this.$message.error('一次只能上传一个视频!')
this.isDelFile = true
return false return false
} }
console.log('KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK') console.log('KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK')
......
...@@ -627,7 +627,7 @@ export default { ...@@ -627,7 +627,7 @@ export default {
{ {
name: '视频', name: '视频',
type: 'pie', type: 'pie',
radius: '85%', radius: '70%',
avoidLabelOverlap: true, // 是否启用防止标签重叠策略 avoidLabelOverlap: true, // 是否启用防止标签重叠策略
center: ['50%', '50%'], // 设置饼图的中心位置 center: ['50%', '50%'], // 设置饼图的中心位置
// data: [ // data: [
...@@ -664,7 +664,7 @@ export default { ...@@ -664,7 +664,7 @@ export default {
{ {
name: '文章', name: '文章',
type: 'pie', type: 'pie',
radius: '85%', radius: '70%',
avoidLabelOverlap: true, // 是否启用防止标签重叠策略 avoidLabelOverlap: true, // 是否启用防止标签重叠策略
center: ['50%', '50%'], // 设置饼图的中心位置 center: ['50%', '50%'], // 设置饼图的中心位置
// data: [ // data: [
...@@ -740,7 +740,7 @@ export default { ...@@ -740,7 +740,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: right; justify-content: right;
margin-left: 450px; //margin-left: 450px;
.titleBottom_companyName{ .titleBottom_companyName{
padding-right: 20px; padding-right: 20px;
} }
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div class="tableTitle">商家管理列表</div> <div class="tableTitle">商家管理列表</div>
<el-table v-loading="loading" class="unitTable" border :data="shopList"> <el-table v-loading="loading" class="unitTable" border :data="shopList">
<el-table-column type="index" label="序号" width="100" /> <el-table-column type="index" label="序号" width="100" />
<!-- <el-table-column label="商家编号" prop="businessId" width="100" align="center" :show-overflow-tooltip="true"> <!-- <el-table-column label="商家编号" prop="businessId" width="100" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.businessId }} {{ scope.row.businessId }}
</template> </template>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<!-- {{ scope.row.unitNumber || '-' }}--> <!-- {{ scope.row.unitNumber || '-' }}-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="商家管理员账号" prop="unitNumber" :show-overflow-tooltip="true"> <el-table-column label="商家管理员账号" prop="unitNumber" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.unitNumber || '-' }} {{ scope.row.unitNumber || '-' }}
</template> </template>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<!-- <span>{{ scope.row.createDate }}</span>--> <!-- <span>{{ scope.row.createDate }}</span>-->
<!-- </template>--> <!-- </template>-->
<!-- </el-table-column>--> <!-- </el-table-column>-->
<el-table-column label="状态" prop="flag"> <el-table-column label="状态" prop="flag">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.flag" v-model="scope.row.flag"
...@@ -164,13 +164,21 @@ ...@@ -164,13 +164,21 @@
<script> <script>
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
import { sysunitList, queryUnitAdmin, updateSysUnit, addSysUnit, delSysUnit } from '@/api/merchantManagement' import {
sysunitList,
queryUnitAdmin,
updateSysUnit,
addSysUnit,
delSysUnit,
queryUnitAdminByBusinessId
} from '@/api/merchantManagement'
export default { export default {
name: 'SysUnit', name: 'SysUnit',
data() { data() {
return { return {
userList: [], userList: [],
userUnit: [],
/** /**
* @description: 用户类型 * @description: 用户类型
* @author: gaoyu * @author: gaoyu
...@@ -249,6 +257,7 @@ export default { ...@@ -249,6 +257,7 @@ export default {
getUserList() { getUserList() {
queryUnitAdmin().then(res => { queryUnitAdmin().then(res => {
this.userList = res.data this.userList = res.data
this.userUnit = res.data
}) })
}, },
/** 根据value查label**/ /** 根据value查label**/
...@@ -326,9 +335,23 @@ export default { ...@@ -326,9 +335,23 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset()
this.form = row this.form = JSON.parse(JSON.stringify(row))
this.open = true this.open = true
this.title = '修改商家' this.title = '修改商家'
const that = this
const businessId = JSON.parse(JSON.stringify(row.userId))
this.getUserList()
queryUnitAdminByBusinessId(businessId).then(res => {
if (res.code === 200) {
if (res.data) {
const userUnitList = that.userUnit
console.log('userUnitList', userUnitList)
that.userList = JSON.parse(JSON.stringify(userUnitList))
that.userList.push(res.data)
console.log('item', that.userList)
}
}
})
}, },
// 改变状态 // 改变状态
handleStatusChange(row) { handleStatusChange(row) {
......
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