Files
apt-nl/src/pages/modules/systemmanage/user.vue

195 lines
5.3 KiB
Vue
Raw Normal View History

2023-05-12 13:54:40 +08:00
<template>
<div class="right_side">
<div class="buttons_wrapper">
<div class="row">
2023-05-15 17:24:55 +08:00
<button class="button button--primary" @click="showDialog('1')">添加用户</button>
2023-05-12 13:54:40 +08:00
</div>
</div>
<div class="grid_wrapper">
<table>
<tr>
<th>序号</th>
<th>任务号</th>
<th>姓名</th>
<th>电话</th>
<th>性别</th>
<th>创建日期</th>
<th>操作</th>
</tr>
<tr v-for="(e, i) in datalist" :key="i">
<td>{{i+1}}</td>
2023-05-15 17:24:55 +08:00
<td>admin</td>
<td>管理员</td>
<td>18888888888</td>
<td></td>
<td>2023-05-05 08:50:08</td>
2023-05-12 17:59:29 +08:00
<td>
<div class="row">
2023-05-15 17:24:55 +08:00
<button class="button button--primary grid_button" @click="showDialog('2')">修改</button>
<button class="button button--primary grid_button" @click="showDialog('3')">重置密码</button>
<button class="button button--primary grid_button" @click="showDialog('4')">删除</button>
2023-05-12 17:59:29 +08:00
</div>
</td>
2023-05-12 13:54:40 +08:00
</tr>
</table>
</div>
2023-05-12 17:59:29 +08:00
<jxDialog
2023-05-15 17:24:55 +08:00
ref="child"
:title="title"
:type="type"
@toSure="toSureDialog"
>
<div v-if="type === '1' || type === '2'" class="form_wraper">
<div class="form">
<div class="form_item">
<div class="form_item__label"><i>*</i>用户名</div>
<div class="form_item__content">
<input type="text" class="form_item__input" v-model="username">
</div>
2023-05-12 17:59:29 +08:00
</div>
2023-05-15 17:24:55 +08:00
<div class="form_item">
<div class="form_item__label">电话</div>
<div class="form_item__content">
<input type="text" class="form_item__input" v-model="phone">
</div>
2023-05-12 17:59:29 +08:00
</div>
</div>
2023-05-15 17:24:55 +08:00
<div class="form">
<div class="form_item">
<div class="form_item__label">姓名</div>
<div class="form_item__content">
<input type="text" class="form_item__input" v-model="name">
2023-05-12 13:54:40 +08:00
</div>
2023-05-15 17:24:55 +08:00
</div>
<div class="form_item">
<div class="form_item__label">性别</div>
<div class="form_item__content">
<div class="form_item__radio" v-for="(e, i) in sexArr" :key="i">
<div class="radio__input" :class="{'icon_radio_checked': e.value === sex}" @click="toRadio(e)">
<i class="icon_radio"></i>
<input type="radio" class="radio__original" v-model="e.value">
</div>
<div class="radio__label">{{ e.label }}</div>
</div>
2023-05-12 13:54:40 +08:00
</div>
</div>
2023-05-12 17:59:29 +08:00
</div>
2023-05-15 17:24:55 +08:00
<div class="form">
<div v-if="type === '1'" class="form_item">
<div class="form_item__label"><i>*</i>密码</div>
<div class="form_item__content">
<input type="text" class="form_item__input" v-model="password">
</div>
2023-05-12 17:59:29 +08:00
</div>
2023-05-15 17:24:55 +08:00
<div class="form_item">
<div class="form_item__label">角色</div>
<div class="form_item__content">
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
2023-05-12 13:54:40 +08:00
</div>
</div>
</div>
2023-05-15 17:24:55 +08:00
<div v-if="type === '3'" class="form_wraper">确定重置密码吗</div>
<div v-if="type === '4'" class="form_wraper">确定删除该用户吗</div>
2023-05-12 17:59:29 +08:00
</jxDialog>
2023-05-12 13:54:40 +08:00
</div>
</template>
<script>
2023-05-12 17:59:29 +08:00
import jxDialog from '@components/dialog.vue'
2023-05-12 13:54:40 +08:00
export default {
2023-05-12 17:59:29 +08:00
components: {
jxDialog
},
2023-05-12 13:54:40 +08:00
data () {
return {
2023-05-15 17:24:55 +08:00
datalist: [{name: ''}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}, {name: 'a'}],
active: false,
type: '',
title: '',
username: '',
phone: '',
name: '',
sexArr: [{label: '男', value: '1'}, {label: '女', value: '2'}],
sex: '1',
password: '',
2023-05-12 13:54:40 +08:00
options: [{
value: '选项1',
label: '超级管理员'
}, {
value: '选项2',
label: '系统管理员'
}, {
value: '选项3',
label: '普通用户'
}, {
value: '选项4',
label: '开发人员'
}],
2023-05-15 17:24:55 +08:00
value: ''
}
},
watch: {
type (val) {
switch (val) {
case '1':
this.title = '添加用户'
break
case '2':
this.title = '修改用户'
break
case '3':
this.title = ''
break
case '4':
this.title = ''
break
default:
this.title = ''
}
2023-05-12 13:54:40 +08:00
}
},
methods: {
2023-05-15 17:24:55 +08:00
showDialog (type) {
this.type = type
this.$refs.child.active = true
},
toSureDialog (type) {
switch (type) {
case '1':
console.log(type)
break
case '2':
console.log(type)
break
case '3':
console.log(type)
break
case '4':
console.log(type)
break
default:
console.log(type)
}
2023-05-12 13:54:40 +08:00
},
2023-05-15 17:24:55 +08:00
toRadio (e) {
this.sex = e.value
2023-05-12 13:54:40 +08:00
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.grid_wrapper
height calc(100% - 50px)
overflow-y auto
</style>