This commit is contained in:
yulixing 2019-05-31 11:35:39 +08:00
parent 600d922283
commit 9254fe4885
15 changed files with 42 additions and 85 deletions

View File

@ -2,7 +2,7 @@
<div class="game-card"> <div class="game-card">
<div class="content clearfix"> <div class="content clearfix">
<div class="l fl mgr-20"> <div class="l fl mgr-20">
<router-link :to="`/games/details/${info._id}/info`" class="dis-b icon-box"> <router-link :to="`/games/details/${info._id}/info`" class="dis-b icon-box">
<img :src="info.game_icon" class="icon img-fit"> <img :src="info.game_icon" class="icon img-fit">
</router-link> </router-link>
</div> </div>
@ -29,19 +29,22 @@
<script> <script>
import { delGame } from '@/api/games' import { delGame } from '@/api/games'
import {mapGetters} from 'vuex' import { mapGetters } from 'vuex'
export default { export default {
name: 'GameCard', name: 'GameCard',
props: ['info'], props: ['info'],
data() { data() {
return { return {
permEdit: false, permEdit: false
} }
}, },
mounted() { mounted() {
this.permEdit = this.userInfo.permissions.includes(`${this.info._id}-edit`) || this.userInfo.permissions.includes(`${this.info._id}-publish`) this.permEdit =
this.userInfo.permissions.includes(`${this.info._id}-edit`) ||
this.userInfo.permissions.includes(`${this.info._id}-publish`) ||
this.userInfo.permissions.includes(`games-writeable`)
}, },
computed:{ computed: {
...mapGetters(['userInfo']) ...mapGetters(['userInfo'])
}, },
methods: { methods: {

View File

@ -43,7 +43,6 @@ const actions = {
getInfo(state.token) getInfo(state.token)
.then(response => { .then(response => {
const { data } = response const { data } = response
console.log(data)
if (!data || data.errcode !== 0) { if (!data || data.errcode !== 0) {
reject('验证失败,请重新登录!') reject('验证失败,请重新登录!')
} }

View File

@ -47,7 +47,7 @@ service.interceptors.response.use(
Message({ Message({
message: data.errmsg || 'error', message: data.errmsg || 'error',
type: 'error', type: 'error',
duration: 5 * 1000 duration: 10 * 1000
}) })
return Promise.reject(data.errmsg || 'error') return Promise.reject(data.errmsg || 'error')
} else { } else {
@ -87,7 +87,7 @@ service.interceptors.response.use(
// } // }
}, },
error => { error => {
console.log('err' + error) // for debug console.log(error) // for debug
Message({ Message({
message: error.message, message: error.message,
type: 'error', type: 'error',

View File

@ -112,41 +112,31 @@ export default {
methods: { methods: {
// filter // filter
search() { search() {
console.log('搜索')
}, },
reset(formName) { reset(formName) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
console.log('重置')
}, },
// toolbar // toolbar
addGame() { addGame() {
this.$router.push('/games/details/info') this.$router.push('/games/details/info')
console.log('添加游戏')
}, },
batchDel() { batchDel() {
console.log('批量删除游戏')
}, },
batchOpt() { batchOpt() {
this.batch.show = !this.batch.show this.batch.show = !this.batch.show
this.batch.txt = this.batch.show ? '关闭' : '批量操作' this.batch.txt = this.batch.show ? '关闭' : '批量操作'
console.log('批量操作')
}, },
// table // table
viewGame(row) { viewGame(row) {
console.log('查看游戏')
}, },
editGame(row) { editGame(row) {
console.log('编辑游戏')
}, },
delGame(row) { delGame(row) {
console.log('删除游戏')
}, },
// pagination // pagination
sizeChange(val) { sizeChange(val) {
console.log(`每页 ${val}`)
}, },
pageChange(val) { pageChange(val) {
console.log(`当前页: ${val}`)
} }
} }
} }

View File

@ -112,41 +112,31 @@ export default {
methods: { methods: {
// filter // filter
search() { search() {
console.log('搜索')
}, },
reset(formName) { reset(formName) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
console.log('重置')
}, },
// toolbar // toolbar
addGame() { addGame() {
this.$router.push('/games/details/info') this.$router.push('/games/details/info')
console.log('添加游戏')
}, },
batchDel() { batchDel() {
console.log('批量删除游戏')
}, },
batchOpt() { batchOpt() {
this.batch.show = !this.batch.show this.batch.show = !this.batch.show
this.batch.txt = this.batch.show ? '关闭' : '批量操作' this.batch.txt = this.batch.show ? '关闭' : '批量操作'
console.log('批量操作')
}, },
// table // table
viewGame(row) { viewGame(row) {
console.log('查看游戏')
}, },
editGame(row) { editGame(row) {
console.log('编辑游戏')
}, },
delGame(row) { delGame(row) {
console.log('删除游戏')
}, },
// pagination // pagination
sizeChange(val) { sizeChange(val) {
console.log(`每页 ${val}`)
}, },
pageChange(val) { pageChange(val) {
console.log(`当前页: ${val}`)
} }
} }
} }

View File

@ -229,41 +229,31 @@ export default {
methods: { methods: {
// filter // filter
search() { search() {
console.log('搜索')
}, },
reset(formName) { reset(formName) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
console.log('重置')
}, },
// toolbar // toolbar
addGame() { addGame() {
this.$router.push('/games/details/info') this.$router.push('/games/details/info')
console.log('添加游戏')
}, },
batchDel() { batchDel() {
console.log('批量删除游戏')
}, },
batchOpt() { batchOpt() {
this.batch.show = !this.batch.show this.batch.show = !this.batch.show
this.batch.txt = this.batch.show ? '关闭' : '批量操作' this.batch.txt = this.batch.show ? '关闭' : '批量操作'
console.log('批量操作')
}, },
// table // table
viewGame(row) { viewGame(row) {
console.log('查看游戏')
}, },
editGame(row) { editGame(row) {
console.log('编辑游戏')
}, },
delGame(row) { delGame(row) {
console.log('删除游戏')
}, },
// pagination // pagination
sizeChange(val) { sizeChange(val) {
console.log(`每页 ${val}`)
}, },
pageChange(val) { pageChange(val) {
console.log(`当前页: ${val}`)
} }
} }
} }

View File

@ -189,41 +189,31 @@ export default {
methods: { methods: {
// filter // filter
search() { search() {
console.log('搜索')
}, },
reset(formName) { reset(formName) {
this.$refs[formName].resetFields() this.$refs[formName].resetFields()
console.log('重置')
}, },
// toolbar // toolbar
addGame() { addGame() {
this.$router.push('/games/details/info') this.$router.push('/games/details/info')
console.log('添加游戏')
}, },
batchDel() { batchDel() {
console.log('批量删除游戏')
}, },
batchOpt() { batchOpt() {
this.batch.show = !this.batch.show this.batch.show = !this.batch.show
this.batch.txt = this.batch.show ? '关闭' : '批量操作' this.batch.txt = this.batch.show ? '关闭' : '批量操作'
console.log('批量操作')
}, },
// table // table
viewGame(row) { viewGame(row) {
console.log('查看游戏')
}, },
editGame(row) { editGame(row) {
console.log('编辑游戏')
}, },
delGame(row) { delGame(row) {
console.log('删除游戏')
}, },
// pagination // pagination
sizeChange(val) { sizeChange(val) {
console.log(`每页 ${val}`)
}, },
pageChange(val) { pageChange(val) {
console.log(`当前页: ${val}`)
} }
} }
} }

View File

@ -267,7 +267,6 @@ export default {
this.$refs[formName].validate(valid => { this.$refs[formName].validate(valid => {
if (valid) { if (valid) {
this.saveEdit() this.saveEdit()
console.log(this.gameForm)
} else { } else {
this.$message.error('请按要求填写游戏信息!') this.$message.error('请按要求填写游戏信息!')
return false return false

View File

@ -257,14 +257,11 @@ export default {
mounted() { mounted() {
this.uid = this.$route.params.uid this.uid = this.$route.params.uid
this.token = getToken() this.token = getToken()
if (this.uid && this.uid === 'new') {
this.permEdit = this.permEdit =
this.userInfo.permissions.includes(`games-writeable`) this.userInfo.permissions.includes(`${this.uid}-edit`) ||
} else { this.userInfo.permissions.includes(`${this.uid}-publish`) ||
this.permEdit = this.userInfo.permissions.includes(`games-writeable`)
this.userInfo.permissions.includes(`${this.uid}-edit`) ||
this.userInfo.permissions.includes(`${this.uid}-publish`)
}
getPlatformList() getPlatformList()
.then(res => { .then(res => {
@ -443,6 +440,7 @@ export default {
}) })
}, },
createFtp(index) { createFtp(index) {
this.$message.success('请求已发送,请耐心等待!')
createFtp({ createFtp({
uid: this.uid, uid: this.uid,
game_name_en: this.baseForm.game_name_en, game_name_en: this.baseForm.game_name_en,

View File

@ -190,13 +190,13 @@ export default {
}, },
mounted() { mounted() {
this.uid = this.$route.params.uid this.uid = this.$route.params.uid
console.log(this.uid)
this.permissionEdit = this.permissionEdit =
this.userInfo.permissions.includes(`${this.uid}-edit`) || this.userInfo.permissions.includes(`${this.uid}-edit`) ||
this.userInfo.permissions.includes(`${this.uid}-publish`) this.userInfo.permissions.includes(`${this.uid}-publish`) ||
this.permissionPublish = this.userInfo.permissions.includes( this.userInfo.permissions.includes(`games-writeable`)
`${this.uid}-publish` this.permissionPublish =
) this.userInfo.permissions.includes(`${this.uid}-publish`) ||
this.userInfo.permissions.includes(`games-writeable`)
this.getGameInfo(this.getGameSettings) this.getGameInfo(this.getGameSettings)
this.getSettingsList() this.getSettingsList()
}, },
@ -205,7 +205,6 @@ export default {
this.$emit('change', changed) this.$emit('change', changed)
}, },
// left // left
getGameInfo(cb) { getGameInfo(cb) {
getGame({ uid: this.uid }) getGame({ uid: this.uid })
.then(res => { .then(res => {

View File

@ -161,13 +161,11 @@ export default {
}) })
} }
if (this.filterForm.game_type) { if (this.filterForm.game_type) {
console.log(this.filterForm.game_type)
result = result.filter(game => { result = result.filter(game => {
return game.game_type + '' === this.filterForm.game_type return game.game_type + '' === this.filterForm.game_type
}) })
} }
this.dataCount = result.length this.dataCount = result.length
console.log(result)
return result return result
}, },
search() { search() {

View File

@ -126,7 +126,6 @@ export default {
}, },
editSetting(row) { editSetting(row) {
this.openModal(false, row) this.openModal(false, row)
console.log('查看游戏')
}, },
// modal // modal
openModal(isNew, data) { openModal(isNew, data) {

View File

@ -104,7 +104,6 @@ export default {
.dispatch('user/login', this.loginForm) .dispatch('user/login', this.loginForm)
.then(data => { .then(data => {
if (data.errcode === 0) { if (data.errcode === 0) {
console.log('/登录成功')
this.$router.push({ path: this.redirect || '/' }) this.$router.push({ path: this.redirect || '/' })
} else { } else {
this.$message.error(data.errmsg) this.$message.error(data.errmsg)

View File

@ -34,8 +34,8 @@
<el-button @click="editPwd" v-if="!editPassword" size="mini">修改密码</el-button> <el-button @click="editPwd" v-if="!editPassword" size="mini">修改密码</el-button>
</el-form-item> </el-form-item>
<el-form-item label="角色"> <el-form-item label="角色">
<div class="w100" style="overflow: hidden;" v-if="userForm.roles.length > 0"> <div class="w100" style="overflow: hidden;" v-if="userInfo.roles.length > 0">
<el-tag v-for="item in userForm.roles" :key="item" class="mgr-20">{{item}}</el-tag> <el-tag v-for="item in userInfo.roles" :key="item" class="mgr-20">{{item}}</el-tag>
</div> </div>
<div class="w100" style="overflow: hidden;" v-else> <div class="w100" style="overflow: hidden;" v-else>
<el-tag class="mgr-20">普通用户</el-tag> <el-tag class="mgr-20">普通用户</el-tag>

View File

@ -19,6 +19,7 @@
class="table mgt-20 mgb-20" class="table mgt-20 mgb-20"
@selection-change="tableSelectionChange" @selection-change="tableSelectionChange"
v-loading="isLoaded" v-loading="isLoaded"
@row-click="rowClick"
> >
<el-table-column v-if="batch.show" type="selection" width="55"/> <el-table-column v-if="batch.show" type="selection" width="55"/>
<el-table-column prop="name" label="角色" show-overflow-tooltip sortable/> <el-table-column prop="name" label="角色" show-overflow-tooltip sortable/>
@ -168,23 +169,23 @@ export default {
permission: { permission: {
name: 'permission', name: 'permission',
label: '权限管理', label: '权限管理',
permission: 'readable' permission: 'hidden'
}, },
logs: { logs: {
name: 'logs', name: 'logs',
label: '操作日志', label: '操作日志',
permission: 'readable' permission: 'hidden'
},
dics: {
name: 'dics',
label: '字典',
permission: 'readable'
},
data: {
name: 'data',
label: '数据查询',
permission: 'readable'
} }
// dics: {
// name: 'dics',
// label: '',
// permission: 'readable'
// },
// data: {
// name: 'data',
// label: '',
// permission: 'readable'
// }
}, },
basePermissionArr: [], basePermissionArr: [],
gamePermissionTable: {}, gamePermissionTable: {},
@ -195,7 +196,9 @@ export default {
mounted() { mounted() {
this.getData() this.getData()
this.getGameList() this.getGameList()
this.permWriteable = this.userInfo.permissions.includes('permission-writeable') this.permWriteable = this.userInfo.permissions.includes(
'permission-writeable'
)
}, },
computed: { computed: {
...mapGetters(['userInfo']) ...mapGetters(['userInfo'])
@ -253,6 +256,9 @@ export default {
this.getData() this.getData()
}, },
// table // table
rowClick(row, column, event) {
this.openModal(false, row)
},
getData() { getData() {
this.isLoaded = true this.isLoaded = true
request({ request({
@ -267,7 +273,6 @@ export default {
}) })
return return
} }
console.log('refresh')
this.tableData = data.roleList this.tableData = data.roleList
this.isLoaded = false this.isLoaded = false
}) })
@ -343,7 +348,6 @@ export default {
.then(res => { .then(res => {
const { data } = res const { data } = res
if (data.errcode === 0) { if (data.errcode === 0) {
console.log(data)
const obj = {} const obj = {}
data.gameList.map(game => { data.gameList.map(game => {
obj[game._id] = { obj[game._id] = {
@ -353,7 +357,6 @@ export default {
permission: 'hidden' permission: 'hidden'
} }
}) })
console.log(obj)
this.gamePermissionTable = obj this.gamePermissionTable = obj
} }
}) })