大屏项目初始化
This commit is contained in:
@@ -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>
|
||||
@@ -43,14 +43,14 @@ import { ElMessage, ElMessageBox, ElNotification } from 'element-plus'
|
||||
import ResizablePage from '@/components/Table/proResizable.vue'
|
||||
import FilterSelect from '@/components/Table/proFilterSelect.vue'
|
||||
import PDialog from '@/components/Dialog/proDialog.vue'
|
||||
import { getHomeModuleList } from '@/api/bizModule'
|
||||
import { getHomeModuleUserSave , getHomeModuleUserDelete } from '@/api/bizModuleUser'
|
||||
import { getHomeModuleListAll, getHomeModuleDelete } from '@/api/bizModule'
|
||||
import { getHomeModuleUserSave } from '@/api/bizModuleUser'
|
||||
|
||||
import vUser from './list.vue'
|
||||
import vRole from './role.vue'
|
||||
|
||||
const FormValues = ref({
|
||||
menuId: ''
|
||||
moduleId: ''
|
||||
});
|
||||
|
||||
const listData = ref([]);
|
||||
@@ -61,7 +61,7 @@ const formComponentRef = ref(null)
|
||||
|
||||
const getListData = async () => {
|
||||
try {
|
||||
const res = await getHomeModuleList();
|
||||
const res = await getHomeModuleListAll();
|
||||
listData.value = res || []
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
@@ -69,7 +69,7 @@ const getListData = async () => {
|
||||
}
|
||||
|
||||
const handleItemClick = (item) => {
|
||||
console.log('选中了:', item)
|
||||
FormValues.value.moduleId = item.moduleId
|
||||
}
|
||||
|
||||
const handleEdit = (item) => {
|
||||
@@ -85,9 +85,9 @@ const handleDelete = (item) => {
|
||||
})
|
||||
.then(async () => {
|
||||
const reqParams = {
|
||||
roleId: item.roleId
|
||||
moduleId: item.moduleId
|
||||
}
|
||||
const res = await getHomeModuleUserDelete(reqParams);
|
||||
const res = await getHomeModuleDelete(reqParams);
|
||||
ElMessage.success(res.msg);
|
||||
getListData();
|
||||
})
|
||||
|
||||
@@ -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"
|
||||
@@ -58,6 +55,8 @@
|
||||
<el-table-column prop="sex" label="性别" />
|
||||
<el-table-column prop="email" label="电子邮箱" width="225" show-overflow-tooltip="true" />
|
||||
<el-table-column prop="phone" label="联系电话" />
|
||||
<el-table-column prop="moduleName" label="模块名称" sortable />
|
||||
<el-table-column prop="moduleCode" label="模块编码" />
|
||||
<el-table-column prop="ustatus" label="状态" min-width="100" align="center">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
@@ -86,17 +85,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 { getHomeModuleSave, getHomeModuleList } from '@/api/bizModule'
|
||||
|
||||
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 +129,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 getHomeModuleList(reqParmas);
|
||||
pagination.total = res.total;
|
||||
tableData.value = res.list || [];
|
||||
} catch (error) {
|
||||
@@ -175,10 +181,6 @@ const handleEdit = (row) => {
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleExport = () => {
|
||||
ElMessage.success('开始导出数据...')
|
||||
}
|
||||
|
||||
const handleSizeChange = (val) => {
|
||||
pagination.pageSize = val
|
||||
getDataList()
|
||||
@@ -216,7 +218,7 @@ const handleSave = async () => {
|
||||
const reqParams = {
|
||||
...formData.value
|
||||
}
|
||||
const res = await getHomeRoleSave(reqParams);
|
||||
const res = await getHomeModuleSave(reqParams);
|
||||
ElMessage.success(res.msg)
|
||||
dialogVisible.value = false
|
||||
emit('refresh-role-list')
|
||||
@@ -227,6 +229,16 @@ const handleSave = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
watch(
|
||||
() => props.formParams,
|
||||
() => {
|
||||
getDataList();
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
})
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
>
|
||||
<div class="form-row">
|
||||
<div class="form-col">
|
||||
<el-form-item label="模块编号" prop="moduleId">
|
||||
<el-form-item label="模块标识" prop="moduleId">
|
||||
<el-input
|
||||
v-model="formData.moduleId"
|
||||
placeholder="请输入模块编号"
|
||||
placeholder="请输入模块标识"
|
||||
disabled
|
||||
clearable
|
||||
/>
|
||||
@@ -27,6 +27,64 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-col">
|
||||
<el-form-item label="模块编号" prop="moduleCode">
|
||||
<el-input
|
||||
v-model="formData.moduleCode"
|
||||
placeholder="请输入模块编号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-col">
|
||||
<el-form-item label="路由地址" prop="path">
|
||||
<el-input
|
||||
v-model="formData.path"
|
||||
placeholder="请输入路由地址"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-col">
|
||||
<el-form-item label="大屏标题" prop="titleName">
|
||||
<el-input
|
||||
v-model="formData.titleName"
|
||||
placeholder="请输入大屏标题"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="form-col">
|
||||
<el-form-item label="模块状态" prop="ustatus">
|
||||
<el-select
|
||||
v-model="formData.ustatus"
|
||||
placeholder="请选择模块状态"
|
||||
clearable
|
||||
>
|
||||
<el-option label="停用" value="0" />
|
||||
<el-option label="在用" value="1" />
|
||||
<el-option label="锁定" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-col">
|
||||
<el-form-item label="模块描述" prop="remark">
|
||||
<el-input
|
||||
v-model="formData.remark"
|
||||
placeholder="请输入模块描述"
|
||||
type="textarea"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row transfer-row">
|
||||
<div class="form-col transfer-col">
|
||||
<el-form-item label="权限列表" prop="userIds">
|
||||
@@ -58,6 +116,11 @@ const props = defineProps({
|
||||
default: () => ({
|
||||
moduleId: '',
|
||||
moduleName: '',
|
||||
moduleCode: '',
|
||||
path: '',
|
||||
titleName: '',
|
||||
remark: '',
|
||||
ustatus: '',
|
||||
userIds: []
|
||||
})
|
||||
},
|
||||
@@ -72,6 +135,10 @@ const transferData = ref([])
|
||||
|
||||
const formRules = {
|
||||
moduleName: [ { required: true, message: '请输入模块名称', trigger: 'blur' } ],
|
||||
moduleCode: [ { required: true, message: '请输入模块编号', trigger: 'blur' } ],
|
||||
path: [ { required: true, message: '请输入路由地址', trigger: 'blur' } ],
|
||||
titleName: [ { required: true, message: '请输入大屏标题', trigger: 'blur' } ],
|
||||
ustatus: [ { required: true, message: '请选择模块状态', trigger: 'blur' } ],
|
||||
userIds: [
|
||||
{ required: true, message: '请至少选择一个用户', trigger: 'change' }
|
||||
]
|
||||
|
||||
8
screen-vue/src/views/screen/Sys/index.vue
Normal file
8
screen-vue/src/views/screen/Sys/index.vue
Normal file
@@ -0,0 +1,8 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -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