|
|
@@ -37,7 +37,7 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary" @click="handleSearch">
|
|
|
+ <el-button type="primary" @click="getData">
|
|
|
<el-icon><Search /></el-icon>
|
|
|
<span> 查询</span>
|
|
|
</el-button>
|
|
|
@@ -244,20 +244,57 @@ import {
|
|
|
} from '@/api/user'
|
|
|
import { RSAencrypt } from '@/utils/jsencrypt'
|
|
|
|
|
|
+onMounted(() => {
|
|
|
+ getData()
|
|
|
+})
|
|
|
+
|
|
|
+// 获取账号管理列表
|
|
|
+const getData = async () => {
|
|
|
+ const res = await getUserList({
|
|
|
+ userName: searchAccount.value,
|
|
|
+ name: searchName.value,
|
|
|
+ time: searchTime.value,
|
|
|
+ currPage: currentPage.value,
|
|
|
+ pageSize: pageSize.value
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ tableData.value = res.list
|
|
|
+ total.value = res.totalCount
|
|
|
+ currentPage.value = res.currPage
|
|
|
+}
|
|
|
+
|
|
|
+// 筛选区域数据
|
|
|
+const searchAccount = ref('')
|
|
|
+const searchName = ref('')
|
|
|
+const searchTime = ref('')
|
|
|
+// 账号管理列表数据
|
|
|
+const tableData = ref([])
|
|
|
+// 编辑弹窗数据
|
|
|
const editInfo = ref({
|
|
|
userName: '',
|
|
|
name: '',
|
|
|
newPassword: '',
|
|
|
newPassword2: ''
|
|
|
})
|
|
|
-
|
|
|
+// 新增账号弹窗数据
|
|
|
const addInfo = ref({
|
|
|
userName: '',
|
|
|
name: '',
|
|
|
newPassword: '',
|
|
|
newPassword2: ''
|
|
|
})
|
|
|
+// 总条数
|
|
|
+const total = ref(0)
|
|
|
+// 当前页
|
|
|
+const currentPage = ref(1)
|
|
|
+// 每页多少条
|
|
|
+const pageSize = ref(8)
|
|
|
+// 编辑弹窗显示隐藏控制
|
|
|
+const dialogVisible = ref(false)
|
|
|
+// 新增账号弹窗显示隐藏控制
|
|
|
+const dialogVisibleAdd = ref(false)
|
|
|
|
|
|
+// 删除按钮回调
|
|
|
const handleDelete = (id) => {
|
|
|
ElMessageBox.confirm('确定删除吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
@@ -279,47 +316,6 @@ const handleDelete = (id) => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// 获取账号管理列表
|
|
|
-const getData = async () => {
|
|
|
- const res = await getUserList({
|
|
|
- userName: searchAccount.value,
|
|
|
- name: searchName.value,
|
|
|
- time: searchTime.value,
|
|
|
- currPage: currentPage.value,
|
|
|
- pageSize: pageSize.value
|
|
|
- })
|
|
|
- // console.log(res)
|
|
|
- tableData.value = res.list
|
|
|
- total.value = res.totalCount
|
|
|
- currentPage.value = res.currPage
|
|
|
-}
|
|
|
-
|
|
|
-onMounted(() => {
|
|
|
- getData()
|
|
|
-})
|
|
|
-
|
|
|
-// 筛选区域数据
|
|
|
-const searchAccount = ref('')
|
|
|
-const searchName = ref('')
|
|
|
-const searchTime = ref('')
|
|
|
-
|
|
|
-// 总条数
|
|
|
-const total = ref(0)
|
|
|
-// 当前页
|
|
|
-const currentPage = ref(1)
|
|
|
-// 每页多少条
|
|
|
-const pageSize = ref(8)
|
|
|
-
|
|
|
-// 编辑弹窗显示隐藏控制
|
|
|
-const dialogVisible = ref(false)
|
|
|
-
|
|
|
-const dialogVisibleAdd = ref(false)
|
|
|
-
|
|
|
-// 查询按钮回调
|
|
|
-const handleSearch = () => {
|
|
|
- getData()
|
|
|
-}
|
|
|
-
|
|
|
// 新增按钮回调
|
|
|
const handleAdd = () => {
|
|
|
dialogVisibleAdd.value = true
|
|
|
@@ -333,12 +329,10 @@ const handleAdd = () => {
|
|
|
|
|
|
// 每页条数改变时的回调
|
|
|
const handleSizeChange = (val) => {
|
|
|
- // console.log(`${val} items per page`)
|
|
|
pageSize.value = val
|
|
|
}
|
|
|
// 当前页改变时的回调
|
|
|
const handleCurrentChange = (val) => {
|
|
|
- // console.log(`current page: ${val}`)
|
|
|
currentPage.value = val
|
|
|
}
|
|
|
|
|
|
@@ -346,13 +340,10 @@ const handleCurrentChange = (val) => {
|
|
|
const handleEdit = (row) => {
|
|
|
dialogVisible.value = true
|
|
|
editInfo.value = Object.assign(editInfo.value, row)
|
|
|
- // editInfo.value.name = row.name
|
|
|
- // editInfo.value.userName = row.userName
|
|
|
- // console.log(editInfo.value)
|
|
|
}
|
|
|
|
|
|
+// 编辑弹窗确定按钮回调
|
|
|
const handleEditConfirm = async () => {
|
|
|
- // console.log(editInfo.value)
|
|
|
if (editInfo.value.newPassword === '') {
|
|
|
ElMessage.error('请输入密码')
|
|
|
return
|
|
|
@@ -381,6 +372,7 @@ const handleEditConfirm = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 新增账号弹窗确定按钮回调
|
|
|
const handleEditConfirmAdd = async () => {
|
|
|
if (addInfo.value.userName === '') {
|
|
|
ElMessage.error('请输入账号')
|
|
|
@@ -414,8 +406,6 @@ const handleEditConfirmAdd = async () => {
|
|
|
getData()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-const tableData = ref([])
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|