邓洁 : 修复bug
This commit is contained in:
@@ -47,6 +47,8 @@ const authStore = useAuthStore();
|
||||
const loginForm = reactive({
|
||||
username: "admin",
|
||||
password: "123456",
|
||||
// username: "",
|
||||
// password: "",
|
||||
code: "",
|
||||
uuid: "",
|
||||
});
|
||||
|
||||
@@ -165,12 +165,12 @@ const formRules = ref({
|
||||
const formInstance = ref()
|
||||
const getList = () => {
|
||||
getSiteList({
|
||||
// userId:userId,
|
||||
userId:userId,
|
||||
...pageInfo
|
||||
}).then((res) => {
|
||||
total.value = res.data.total;
|
||||
showAddIcon.value = total.value % 6!==0;
|
||||
showFirst.value = total.value / pageInfo.pageSize >= 1;
|
||||
showFirst.value = total.value / pageInfo.pageSize > 1;
|
||||
res.data.rows.map(item => {
|
||||
if (item.tunnelList === null || item.tunnelList.length === 0) {
|
||||
item.info = info.value
|
||||
@@ -188,7 +188,6 @@ const handleClickSite = (type) => {
|
||||
if (type.checked) {
|
||||
siteIds.value.push(type.siteId)
|
||||
siteNameList.value.push(type.siteName)
|
||||
|
||||
} else {
|
||||
siteIds.value.map((item, index) => {
|
||||
if (item === type.siteId) {
|
||||
@@ -260,6 +259,15 @@ const handleSubmit = (instance) => {
|
||||
const handleChooseAll=()=>{
|
||||
siteList.value.map(item=>{
|
||||
item.checked=!item.checked
|
||||
if(item.checked&&!item.isDefault){
|
||||
siteIds.value.push(item.siteId)
|
||||
}else if(!item.checked&&!item.isDefault){
|
||||
siteIds.value.map((newItem, index) => {
|
||||
if (newItem === item.siteId) {
|
||||
siteIds.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleMoreDelete = () => {
|
||||
|
||||
@@ -269,7 +269,6 @@ const handleGoSiteOrIndex = () => {
|
||||
} else if (type === 'i') {
|
||||
router.push('/')
|
||||
}
|
||||
|
||||
}
|
||||
const getList = () => {
|
||||
getTunnelList({
|
||||
@@ -333,6 +332,15 @@ const handleGoToEditTunnel = (tunnelId) => {
|
||||
const handleChooseAll = () => {
|
||||
tunnelList.value.map(item => {
|
||||
item.checked = !item.checked
|
||||
if(item.checked&&!item.isDefault){
|
||||
tunnelIds.value.push(item.tunnelId)
|
||||
}else if(!item.checked&&!item.isDefault){
|
||||
tunnelIds.value.map((newItem, index) => {
|
||||
if (newItem === item.tunnelId) {
|
||||
tunnelIds.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleEditDevice = (tunnelId) => {
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<!-- <div class="all-btn" @click="handleAll">-->
|
||||
<!-- 全选-->
|
||||
<!-- </div>-->
|
||||
<div class="all-btn del-btn" @click="handleDelete">
|
||||
删除
|
||||
</div>
|
||||
<!-- <div class="all-btn del-btn" @click="handleDelete">-->
|
||||
<!-- 删除-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-content">
|
||||
@@ -24,12 +24,18 @@
|
||||
v-model="username"
|
||||
clearable
|
||||
placeholder="输入搜索内容"
|
||||
@clear="getInfo"
|
||||
/>
|
||||
</div>
|
||||
<el-button type="primary" :icon="Search" style="margin-left: 20px" @click="getInfo">搜索</el-button>
|
||||
</div>
|
||||
<div>用户管理</div>
|
||||
<div class="add-btn" @click="handleAddUser">添加用户</div>
|
||||
<div class="all-del-btn">
|
||||
<div class="add-btn" @click="handleAddUser">添加用户</div>
|
||||
<div class="all-btn del-btn" @click="handleDelete">
|
||||
删除
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="device-table">
|
||||
<el-table stripe ref="multipleTable" @select="handleSelect"
|
||||
@@ -61,18 +67,19 @@
|
||||
<el-form-item label="当前站点">
|
||||
<div class="current-site">{{ currentSite }}<span>如果需要切换站点,请返回首屏切换</span></div>
|
||||
</el-form-item>
|
||||
<el-form-item label="输入用户名称">
|
||||
<el-input v-model="form.userName" placeholder="请输入用户名称"/>
|
||||
<el-form-item label="输入账户">
|
||||
<el-input v-model="form.userName" placeholder="请输入账户"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="输入用户昵称">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称"/>
|
||||
<el-form-item label="输入密码" v-if="title==='添加用户'">
|
||||
<el-input type="password" show-password v-model="form.password" placeholder="请输入密码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="输入昵称">
|
||||
<el-input v-model="form.nickName" placeholder="请输入昵称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="输入电话号码">
|
||||
<el-input v-model="form.phoneNumber" placeholder="输入电话号码"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="输入密码" v-if="title==='添加用户'">
|
||||
<el-input v-model="form.password" placeholder="请输入密码"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="选择身份">
|
||||
<el-radio-group v-model="form.roleId" @change="(val) => {
|
||||
console.log('vaaa',val)
|
||||
@@ -136,7 +143,7 @@ const tunnelIndex = ref()
|
||||
const username = ref()
|
||||
const userIds = ref()
|
||||
const showFirst = ref(true)
|
||||
const currentSite = ref()
|
||||
const currentSite = ref('')
|
||||
const formInstance = ref()
|
||||
const userData = ref([])
|
||||
const pageInfo = reactive({
|
||||
@@ -191,18 +198,23 @@ const handleAll = () => {
|
||||
multipleTable.value.toggleAllSelection()
|
||||
}
|
||||
const handleDelete = () => {
|
||||
ElMessageBox.confirm(`是否确认删除该用户吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteUser(userIds.value).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
getInfo()
|
||||
}
|
||||
console.log('userIds.value',userIds.value)
|
||||
if (userIds.value ===undefined) {
|
||||
ElMessage.warning('请先选择用户进行删除')
|
||||
} else {
|
||||
ElMessageBox.confirm(`是否确认删除该用户吗?`, '系统提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteUser(userIds.value).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
getInfo()
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
const reset = () => {
|
||||
form.value = {
|
||||
@@ -236,12 +248,12 @@ const getInfo = () => {
|
||||
})
|
||||
}
|
||||
getInfo()
|
||||
const firstPage=()=>{
|
||||
const firstPage = () => {
|
||||
pageInfo.pageNum = 1
|
||||
getInfo()
|
||||
}
|
||||
const lastPage=()=>{
|
||||
pageInfo.pageNum = total.value/pageInfo.pageSize
|
||||
const lastPage = () => {
|
||||
pageInfo.pageNum = total.value / pageInfo.pageSize
|
||||
getInfo()
|
||||
}
|
||||
//点击页码进行分页功能
|
||||
@@ -263,6 +275,7 @@ const handleSubmit = async (formInstance) => {
|
||||
if (res.code === 1000) {
|
||||
getInfo()
|
||||
isVisited.value = false
|
||||
ElMessage.success(res.msg)
|
||||
} else {
|
||||
ElMessage.warning(res.msg)
|
||||
}
|
||||
@@ -272,6 +285,7 @@ const handleSubmit = async (formInstance) => {
|
||||
if (res.code === 1000) {
|
||||
getInfo()
|
||||
isVisited.value = false
|
||||
ElMessage.success(res.msg)
|
||||
} else {
|
||||
ElMessage.warning(res.msg)
|
||||
}
|
||||
@@ -294,15 +308,26 @@ const handleSelect = async (selection, row) => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.current-site{
|
||||
font-size: 38px;color: #FFFFFF;
|
||||
:deep(.el-input .el-input__password) {
|
||||
font-size: 60px;
|
||||
}
|
||||
|
||||
:deep(.el-input__clear) {
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.current-site {
|
||||
font-size: 41px;
|
||||
color: #FFFFFF;
|
||||
margin-top: 12px;
|
||||
>span{
|
||||
font-size: 30px!important;
|
||||
color: darkgray!important;
|
||||
|
||||
> span {
|
||||
font-size: 38px !important;
|
||||
color: darkgray !important;
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-table__header-wrapper .el-checkbox) {
|
||||
display: none
|
||||
}
|
||||
@@ -390,31 +415,32 @@ const handleSelect = async (selection, row) => {
|
||||
}
|
||||
}
|
||||
|
||||
.all-del-btn {
|
||||
display: flex;
|
||||
|
||||
.del-btn {
|
||||
width: 168px;
|
||||
height: 60px;
|
||||
background: #08B7B8;
|
||||
border-radius: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
.all-btn {
|
||||
cursor: pointer;
|
||||
padding-left: 53px;
|
||||
width: 178px;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
border-radius: 11px;
|
||||
border: 2px solid #08B7B8;
|
||||
color: #FFFFFF;
|
||||
font-size: 38px;
|
||||
.all-del-btn {
|
||||
display: flex;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 40px;
|
||||
margin-right: 70px;
|
||||
}
|
||||
.del-btn {
|
||||
width: 168px;
|
||||
height: 60px;
|
||||
background: #08B7B8;
|
||||
border-radius: 11px;
|
||||
}
|
||||
|
||||
.all-btn {
|
||||
cursor: pointer;
|
||||
padding-left: 53px;
|
||||
width: 178px;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
border-radius: 11px;
|
||||
border: 2px solid #08B7B8;
|
||||
color: #FFFFFF;
|
||||
font-size: 38px;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -433,7 +459,7 @@ const handleSelect = async (selection, row) => {
|
||||
border-radius: 20px;
|
||||
border: 2px solid #05FEFF;
|
||||
box-sizing: border-box;
|
||||
padding: 73px 98px;
|
||||
padding: 73px 58px;
|
||||
|
||||
.user-top {
|
||||
width: 100%;
|
||||
@@ -452,14 +478,15 @@ const handleSelect = async (selection, row) => {
|
||||
|
||||
.add-btn {
|
||||
cursor: pointer;
|
||||
width: 170px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
width: 180px;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
background: #08B7B8;
|
||||
border-radius: 6px;
|
||||
color: #FFFFFF;
|
||||
font-size: 35px;
|
||||
font-size: 38px;
|
||||
padding-left: 19px;
|
||||
//margin-left: 20px;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
@@ -467,25 +494,25 @@ const handleSelect = async (selection, row) => {
|
||||
|
||||
:deep(.el-button) {
|
||||
width: 140px;
|
||||
height: 60px;
|
||||
height: 70px;
|
||||
background: #08B7B8;
|
||||
border-radius: 6px;
|
||||
border: none;
|
||||
font-size: 35px;
|
||||
font-size: 38px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
:deep(.el-input__wrapper) {
|
||||
width: 292px;
|
||||
height: 60px;
|
||||
width: 300px;
|
||||
height: 70px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #05FEFF;
|
||||
background-color: transparent;
|
||||
font-size: 35px;
|
||||
font-size: 38px;
|
||||
|
||||
.el-input__inner {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
@@ -493,7 +520,7 @@ const handleSelect = async (selection, row) => {
|
||||
}
|
||||
|
||||
:deep(.el-table--fit) {
|
||||
width: 2000px !important;
|
||||
width: 2110px !important;
|
||||
}
|
||||
|
||||
:deep(.cell) {
|
||||
|
||||
Reference in New Issue
Block a user