大屏项目初始化
This commit is contained in:
@@ -39,9 +39,6 @@
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button type="success" icon="Download" @click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
<TreeTable
|
||||
:table-data="tableData"
|
||||
@@ -211,12 +208,6 @@ const handleDelete = async (row) => {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
const handleExport = () => {
|
||||
console.log('导出菜单数据');
|
||||
}
|
||||
|
||||
const handleDialogClose = () => {
|
||||
formData.value = {}
|
||||
isEdit.value = false
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</template>
|
||||
<template #main>
|
||||
<div class="main-content">
|
||||
<vUser @refresh-role-list="getListData" />
|
||||
<vUser @refresh-role-list="getListData" :formParams="FormValues" />
|
||||
</div>
|
||||
</template>
|
||||
</ResizablePage>
|
||||
@@ -48,7 +48,7 @@ import vUser from './list.vue'
|
||||
import vRole from './role.vue'
|
||||
|
||||
const FormValues = ref({
|
||||
menuId: ''
|
||||
roleId: ''
|
||||
});
|
||||
|
||||
const listData = ref([]);
|
||||
@@ -67,7 +67,7 @@ const getListData = async () => {
|
||||
}
|
||||
|
||||
const handleItemClick = (item) => {
|
||||
console.log('选中了:', item)
|
||||
FormValues.value.roleId = item.roleId
|
||||
}
|
||||
|
||||
const handleEdit = (item) => {
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button type="success" icon="Download" @click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
<STable
|
||||
:table-data="tableData"
|
||||
@@ -86,17 +83,23 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive, onMounted, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Plus, Download, Edit, Delete } from '@element-plus/icons-vue'
|
||||
import { getHomeUserList } from '@/api/bizUser'
|
||||
import { getHomeRoleSave } from '@/api/bizRole'
|
||||
import { getHomeRoleSave, getHomeRoleUserList } from '@/api/bizRole'
|
||||
|
||||
import CSearch from '@/components/Search/proSearch.vue'
|
||||
import STable from '@/components/Table/proTable.vue'
|
||||
import PDialog from '@/components/Dialog/proDialog.vue'
|
||||
import VForm from './form.vue'
|
||||
|
||||
const props = defineProps({
|
||||
formParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
const formComponentRef = ref(null)
|
||||
const emit = defineEmits(['refresh-role-list'])
|
||||
|
||||
@@ -124,11 +127,12 @@ async function getDataList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const reqParmas = {
|
||||
... searchForm,
|
||||
pageNum: pagination.pageNum,
|
||||
pageSize: pagination.pageSize,
|
||||
... searchForm,
|
||||
...props.formParams,
|
||||
}
|
||||
const res = await getHomeUserList(reqParmas);
|
||||
const res = await getHomeRoleUserList(reqParmas);
|
||||
pagination.total = res.total;
|
||||
tableData.value = res.list || [];
|
||||
} catch (error) {
|
||||
@@ -175,10 +179,6 @@ const handleEdit = (row) => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleExport = () => {
|
||||
ElMessage.success('开始导出数据...')
|
||||
}
|
||||
|
||||
const handleSizeChange = (val) => {
|
||||
pagination.pageSize = val
|
||||
getDataList()
|
||||
@@ -227,6 +227,14 @@ const handleSave = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getDataList();
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
<el-button type="primary" icon="Plus" @click="handleAdd">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button type="success" icon="Download" @click="handleExport">
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
<STable
|
||||
:table-data="tableData"
|
||||
@@ -139,9 +136,9 @@ async function getDataList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const reqParams = {
|
||||
... searchForm,
|
||||
pageNum: pagination.pageNum,
|
||||
pageSize: pagination.pageSize,
|
||||
... searchForm,
|
||||
}
|
||||
const res = await getHomeUserList(reqParams);
|
||||
pagination.total = res.total;
|
||||
@@ -192,10 +189,6 @@ const handleEdit = (row) => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleExport = () => {
|
||||
ElMessage.success('开始导出数据...')
|
||||
}
|
||||
|
||||
const handleDelete = async (row) => {
|
||||
ElMessageBox.confirm('确定要删除该条数据吗?', '删除确认', {
|
||||
type: 'warning',
|
||||
|
||||
Reference in New Issue
Block a user