feat: 多级菜单右侧页面混乱、历史查询

master
李小林 9 months ago
parent cf1d79c51e
commit 103d3f6026
  1. 13
      src/api/history-query/index.ts
  2. 14
      src/api/history-query/types.ts
  3. 3
      src/layout/components/Sidebar/components/SidebarMenuItem.vue
  4. 1
      src/layout/index.vue
  5. 2
      src/store/modules/permission.ts
  6. 130
      src/views/family/operate/history-query/index.vue
  7. 3
      src/views/family/operate/index.vue
  8. 27
      src/views/family/statement/detail-inventory-statistics/index.vue
  9. 6
      src/views/family/statement/index.vue

@ -0,0 +1,13 @@
import { AxiosPromise } from "axios";
import { HistoryQueryResult } from "@/api/history-query/types";
import request from "@/utils/request";
export function historyQueryApi(
data: SelectForm
): AxiosPromise<HistoryQueryResult> {
return request({
url: "/api/history-query/v1/page",
method: "POST",
data,
});
}

@ -0,0 +1,14 @@
export interface HistoryQueryTableVO {
devSno?: string;
devOui?: string;
devTypeName?: string;
userSnNo?: string;
insertdate?: string;
updatedate?: string;
}
export type HistoryQueryResult = PageResult<HistoryQueryTableVO[]>;

@ -128,8 +128,7 @@ function resolvePath(routePath: string) {
}
// (/system/user) = (/system) + (user)
const fullPath = path.resolve(props.basePath, routePath);
return fullPath;
return path.resolve(props.basePath, routePath);
}
</script>

@ -9,7 +9,6 @@
<!-- 公用侧边栏 -->
<Sidebar class="sidebar-container" />
<!-- 混合布局 -->
<div v-if="layout === 'mix'" class="mix-container">
<div class="mix-container__left">

@ -59,11 +59,9 @@ const filterAsyncRoutes = (routes: RouteRecordRaw[], roles: string[]) => {
if (tmpRoute.children) {
tmpRoute.children = filterAsyncRoutes(tmpRoute.children, roles);
}
asyncRoutes.push(tmpRoute);
}
});
return asyncRoutes;
};

@ -0,0 +1,130 @@
<template>
<div class="app-container">
<div class="search-container">
<el-form :model="queryForm" :inline="true">
<el-row>
<el-col :span="6">
<el-form-item label="查询条件">
<el-select
v-model="queryForm.selectName"
placeholder="请选择"
style="width: 240px"
@change="resetSelect"
clearable
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span="6"
v-if="
queryForm.selectName !== undefined &&
queryForm.selectName !== 'regionAreaId'
"
>
<el-input
v-model="queryForm.selectValue"
placeholder="请输入"
style="width: 300px"
/>
</el-col>
<el-col :span="buttonColSpan">
<el-form-item>
<el-button type="primary" :icon="Search" @click="handleQuery"
>搜索
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="any-table">
<el-table
:data="tableData"
max-height="450"
highlight-current-row
v-loading="loading"
>
<el-table-column label="序列号" prop="devSno" align="center" />
<el-table-column label="设备Oui" prop="devOui" align="center" />
<el-table-column label="设备型号" prop="devTypeName" align="center" />
<el-table-column label="逻辑Id" prop="userSnNo" align="center" />
<el-table-column
label="首次绑定时间"
prop="insertdate"
align="center"
/>
<el-table-column
label="记录更新时间"
prop="updatedate"
align="center"
/>
</el-table>
<pagination
v-if="total > 0"
v-model:total="total"
v-model:page="queryForm.pageNum"
v-model:limit="queryForm.pageSize"
@pagination="handleQuery"
/>
</div>
</div>
</template>
<script setup lang="ts">
import { Search } from "@element-plus/icons-vue";
import { HistoryQueryTableVO } from "@/api/history-query/types";
import { historyQueryApi } from "@/api/history-query";
defineOptions({
name: "HistoryQuery",
inheritAttrs: false,
});
const queryForm = ref<SelectForm>({
pageNum: 1,
pageSize: 10,
});
const total = ref<number>(0);
const tableData = ref<HistoryQueryTableVO[]>([]);
const options = ref<OptionType[]>([
{ label: "逻辑Id", value: "logicId" },
{ label: "设备序列号", value: "devSno" },
]);
const loading = ref<boolean>(false);
const buttonColSpan = computed(() => {
return queryForm.value.selectName === undefined ? 18 : 12;
});
const resetSelect = () => {
queryForm.value.selectValue = undefined;
};
const handleQuery = () => {
if (
queryForm.value.selectName === undefined ||
queryForm.value.selectValue === undefined
) {
ElMessage({
message: "查询条件不能为空",
type: "error",
duration: 1000,
});
return;
}
loading.value = true;
historyQueryApi(queryForm.value)
.then(({ data }) => {
tableData.value = data.list;
total.value = data.total;
})
.finally(() => {
loading.value = false;
});
};
</script>
<style scoped lang="scss"></style>

@ -0,0 +1,3 @@
<template>
<router-view />
</template>

@ -0,0 +1,27 @@
<template>
<div class="app-container"></div>
</template>
<script setup lang="ts">
defineOptions({
name: "DetailInventoryStatistics",
inheritAttrs: false,
});
const queryForm = ref<SelectForm>({
pageNum: 1,
pageSize: 10,
});
const options = ref<OptionType[]>([
{ label: "客户名称", value: "customName" },
{ label: "系统管理域", value: "regionAreaId" },
]);
const buttonColSpan = computed(() => {
return queryForm.value.selectName === undefined ? 18 : 12;
});
const resetSelect = () => {
queryForm.value.selectValue = undefined;
};
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,6 @@
<template>
<div>
<router-view />
</div>
</template>
<script setup lang="ts"></script>
Loading…
Cancel
Save