init
This commit is contained in:
@@ -132,6 +132,14 @@ export function updateUser(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUserTag(data) {
|
||||
return request({
|
||||
url: '/xq/user/editTag',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户管理
|
||||
export function delUser(id) {
|
||||
return request({
|
||||
|
||||
@@ -648,6 +648,11 @@ export const linkTypeBannerList = [
|
||||
{ value: 3, label: '图片',listClass: listClass.primary},
|
||||
]
|
||||
|
||||
export const userTagList = [
|
||||
{ value: 1, label: '火热',listClass: listClass.danger},
|
||||
{ value: 2, label: '活跃',listClass: listClass.success},
|
||||
]
|
||||
|
||||
|
||||
export const professionList = [
|
||||
{ value: '运动员', label: '运动员'},
|
||||
|
||||
@@ -42,6 +42,16 @@
|
||||
v-hasPermi="['xq:user:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleUserTagUpdate"
|
||||
v-hasPermi="['xq:user:edit']"
|
||||
>修改标签</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@@ -52,6 +62,11 @@
|
||||
<cai-dict-tag :options="appUserTypeList" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标签" align="center" prop="tag">
|
||||
<template v-slot="scope">
|
||||
<cai-dict-tag :options="userTagList" :value="scope.row.tag" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="编号" align="center" prop="usercode" />
|
||||
<el-table-column label="昵称" align="center" prop="nickname" />
|
||||
<el-table-column label="手机号" align="center" prop="mobile" />
|
||||
@@ -129,6 +144,8 @@
|
||||
<user-info-dialog v-if="userInfoDialogVisible" ref="userInfoDialog" />
|
||||
<add-user-dialog v-if="addUserDialogVisible" ref="addUserDialog" @refreshDataList="getList" />
|
||||
<update-user-dialog v-if="updateUserDialogVisible" ref="updateUserDialog" @refreshDataList="getList" />
|
||||
<update-user-tag-dialog v-if="updateUserTagDialogVisible" ref="updateUserTagDialog" @refreshDataList="getList" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -144,22 +161,24 @@ import {
|
||||
userResetNickname,
|
||||
userLock, userUnlock
|
||||
} from '@/api/xq/user'
|
||||
import { appUserTypeList, finishStatusList, genderList, userStatusList } from '@/constant/statusMap'
|
||||
import { appUserTypeList, finishStatusList, genderList, userStatusList, userTagList } from '@/constant/statusMap'
|
||||
import BindInviteDialog from '@/views/xq/user/bind-invite-dialog.vue'
|
||||
import UserInfoDialog from '@/views/xq/user/user-info-dialog.vue'
|
||||
import AddUserDialog from '@/views/xq/user/add-user-dialog.vue'
|
||||
import UpdateUserDialog from '@/views/xq/user/update-user-dialog.vue'
|
||||
import UpdateUserTagDialog from '@/views/xq/user/update-user-tag-dialog.vue'
|
||||
|
||||
export default {
|
||||
name: "User",
|
||||
components: { BindInviteDialog,UserInfoDialog,AddUserDialog,UpdateUserDialog},
|
||||
components: { BindInviteDialog,UserInfoDialog,AddUserDialog,UpdateUserDialog,UpdateUserTagDialog},
|
||||
data() {
|
||||
return {
|
||||
userStatusList,genderList,appUserTypeList,finishStatusList,
|
||||
userStatusList,genderList,appUserTypeList,finishStatusList,userTagList,
|
||||
bindInviteDialogVisible: false,
|
||||
userInfoDialogVisible: false,
|
||||
addUserDialogVisible: false,
|
||||
updateUserDialogVisible: false,
|
||||
updateUserTagDialogVisible: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -221,6 +240,12 @@ export default {
|
||||
this.$refs.addUserDialog.init()
|
||||
})
|
||||
},
|
||||
handleUserTagUpdate(){
|
||||
this.updateUserTagDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.updateUserTagDialog.init(this.ids)
|
||||
})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.updateUserDialogVisible = true
|
||||
|
||||
70
src/views/xq/user/update-user-tag-dialog.vue
Normal file
70
src/views/xq/user/update-user-tag-dialog.vue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<el-dialog title="修改用户" :close-on-click-modal="false" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-form-item label="标签" prop="tag">
|
||||
<el-select v-model="form.tag" size="small" style="width: 95%">
|
||||
<el-option
|
||||
v-for="dict in userTagList"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { userTagList } from '@/constant/statusMap'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { updateUserTag } from '@/api/xq/user'
|
||||
|
||||
export default {
|
||||
name: "UserInfo",
|
||||
components: { },
|
||||
data() {
|
||||
return {
|
||||
userTagList,
|
||||
open:false,
|
||||
buttonLoading: false,
|
||||
userIds: [],
|
||||
form:{
|
||||
tag: undefined,
|
||||
},
|
||||
rules:{
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
init(userIds,tag){
|
||||
this.open = true;
|
||||
this.$nextTick(() => {
|
||||
this.form.tag = tag
|
||||
this.userIds = userIds
|
||||
})
|
||||
},
|
||||
submitForm(){
|
||||
updateUserTag({
|
||||
'tag': this.form.tag,
|
||||
'userIds': this.userIds,
|
||||
}).then(data => {
|
||||
this.$modal.msgSuccess("修改用户成功");
|
||||
this.buttonLoading = false;
|
||||
this.open = false
|
||||
this.$emit('refreshDataList')
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -35,8 +35,8 @@ module.exports = {
|
||||
proxy: {
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: `http://localhost:8080`,
|
||||
// target: `http://xq-admin.mubai8888.com/prod-api`,
|
||||
// target: `http://localhost:8080`,
|
||||
target: `http://xq-admin.mubai8888.com/prod-api`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
|
||||
Reference in New Issue
Block a user