设备管理页面以及用户菜单初始化修改
This commit is contained in:
parent
8e93b4e34d
commit
2f30377d90
@ -1,4 +1,7 @@
|
||||
import createAxios from '/@/utils/axios'
|
||||
import { encrypt_aes } from '/@/utils/crypto'
|
||||
import { useAdminInfo } from '/@/stores/adminInfo'
|
||||
const adminInfo = useAdminInfo()
|
||||
|
||||
export function index() {
|
||||
return createAxios({
|
||||
@ -154,3 +157,83 @@ export function userChangePassword(params: object = {}) {
|
||||
})
|
||||
}
|
||||
|
||||
// 设备页面设备树
|
||||
export function equipTree(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/equipment/getEquipmentTree',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 设备分页查询
|
||||
export function equipQuery(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/equipment/query',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 设备新增
|
||||
export function equipAdd(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/equipment/add',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 设备删除
|
||||
export function equipDelete(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/equipment/delete',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 设备修改
|
||||
export function equipUpdate(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/equipment/update',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 导入
|
||||
// export function equipImport(params: object = {}) {
|
||||
// return createAxios({
|
||||
// url: '/api/equipment/import',
|
||||
// method: 'POST',
|
||||
// })
|
||||
// }
|
||||
|
||||
export const equipImport = (data:FormData, v:string) => {
|
||||
const token = encrypt_aes(adminInfo.token, v)
|
||||
return createAxios(
|
||||
{
|
||||
url: '/api/equipment/import',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
v,
|
||||
token,
|
||||
},
|
||||
},
|
||||
{ customEncrypt: true }
|
||||
)
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function equipExport(params: object = {}) {
|
||||
return createAxios({
|
||||
url: '/api/equipment/export',
|
||||
method: 'POST',
|
||||
data: params,
|
||||
responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
@ -30,7 +30,13 @@
|
||||
<el-table-column prop="menuName" label="菜单名称" />
|
||||
<el-table-column prop="funParam" label="菜单路径" />
|
||||
<el-table-column prop="menuOrder" label="菜单排序" />
|
||||
<el-table-column prop="menuIcon" label="图标" />
|
||||
<!-- <el-table-column prop="menuIcon" label="图标" /> -->
|
||||
<el-table-column label="图标">
|
||||
<template #default="scope">
|
||||
<!-- <i v-if="scope.row.menuIcon.substring(0, 2) === 'el'" :class="scope.row.menuIcon" style="font-size: 20px" /> -->
|
||||
<i :class="scope.row.menuIcon" style="font-size: 20px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="name" label="状态" width="180">
|
||||
<el-switch v-model="switchValue" />
|
||||
</el-table-column> -->
|
||||
@ -192,7 +198,7 @@ const RyMenusTreeQuery = (data: any) => {
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
RyMenusTreeQuery(fromParameter), allPermission()
|
||||
RyMenusTreeQuery(fromParameter), allPermission(), queryMenuMethod({ parentMenuId: 1 })
|
||||
})
|
||||
|
||||
interface Tree {
|
||||
@ -505,7 +511,6 @@ const addOnSubmit = () => {
|
||||
console.log(formInlineAdd, 'formInlineAdd')
|
||||
formRef.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
alert(1)
|
||||
formInlineAdd.parentMenuId = fromDataId.value
|
||||
menuAdd(formInlineAdd).then((res: any) => {
|
||||
console.log(res, '增加')
|
||||
|
@ -239,10 +239,11 @@ const getTree = () => {
|
||||
onMounted(() => {
|
||||
getTree()
|
||||
allPermission()
|
||||
RyUserQuery(formQuery)
|
||||
})
|
||||
|
||||
const formQuery = reactive({
|
||||
orgId: '',
|
||||
orgId: '1',
|
||||
recursive: false,
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
@ -604,12 +605,6 @@ const handleCurrentChange = (val: number) => {
|
||||
RyUserQuery(formQuery)
|
||||
}
|
||||
const pageTotal = ref(0)
|
||||
const originData = ref()
|
||||
const tableData1 = computed(() => {
|
||||
const start = (currentPage.value - 1) * currentPageSize.value
|
||||
const end = start + currentPageSize.value
|
||||
return originData.value?.slice(start, end)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user