范围配置入口

This commit is contained in:
Yuan 2023-08-22 13:41:46 +08:00
parent c31551eaf7
commit 94a4fb6726
4 changed files with 6 additions and 110 deletions

View File

@ -69,11 +69,6 @@ const list = reactive([
label: '发布管理',
icon: 'app_registration',
},
{
path: '/dataManage/rangeManage',
label: '范围配置',
icon: 'app_registration',
},
{
path: '/dataManage/lineInfo',
label: '线路信息管理',

View File

@ -33,6 +33,12 @@
label="预览"
:to="`/linemap/${props.row.lineId}/${props.row.type}`"
/>
<q-btn
color="primary"
:disable="operateDisabled"
label="范围配置"
:to="`/dataManage/publish`"
/>
<q-btn
color="red"
:disable="operateDisabled"

View File

@ -1,100 +0,0 @@
<script setup lang="ts">
import { QTable, QTableColumn } from 'quasar';
import { onMounted, ref } from 'vue';
import { getDeviceAreaList, type IAreaConfigListItem } from '../api/ConfigApi';
const tableRef = ref<QTable>();
const columns: QTableColumn[] = [
{
name: 'id',
label: 'id',
field: 'id',
},
{
name: 'lineId',
label: '线路',
field: 'lineId',
},
{
name: 'areaName',
label: '范围名称',
field: 'areaName',
},
{
name: 'deviceType',
label: '设备类型',
field: 'deviceType',
},
];
const rows = ref<IAreaConfigListItem[]>([]);
const loading = ref(false);
const pagination = ref({
sortBy: 'desc',
descending: false,
page: 1,
rowsPerPage: 10,
rowsNumber: 10,
});
const onRequest: QTable['onRequest'] = async (props) => {
const { page, rowsPerPage } = props.pagination;
loading.value = true;
const resp = await getDeviceAreaList({ current: page, size: rowsPerPage });
pagination.value.page = resp.current;
pagination.value.rowsNumber = resp.total;
pagination.value.rowsPerPage = resp.size;
rows.value = resp.records;
loading.value = false;
};
onMounted(() => {
tableRef.value?.requestServerInteraction();
});
</script>
<template>
<div class="q-pa-md">
<q-table
ref="tableRef"
title="范围配置"
:rows="rows"
:columns="columns"
row-key="id"
v-model:pagination="pagination"
:rows-per-page-options="[10, 20, 50, 100]"
:loading="loading"
binary-state-sort
@request="onRequest"
>
<!-- <template v-slot:top-right>
<q-input
dense
debounce="1000"
v-model="filter.name"
label="名称"
></q-input>
<q-btn flat round color="primary" icon="search" />
</template> -->
<!-- <template v-slot:body-cell-operations="props">
<q-td :props="props">
<div class="q-gutter-sm row justify-center">
<q-btn
color="primary"
:disable="operateDisabled"
label="预览"
:to="`/linemap/${props.row.lineId}/${props.row.type}`"
/>
<q-btn
color="red"
:disable="operateDisabled"
label="删除"
@click="deleteData(props.row)"
/>
</div>
</q-td>
</template> -->
</q-table>
</div>
</template>

View File

@ -35,11 +35,6 @@ const routes: RouteRecordRaw[] = [
name: 'publish',
component: () => import('pages/PublishManage.vue'),
},
{
path: 'rangeManage',
name: 'rangeManage',
component: () => import('pages/RangeManage.vue'),
},
{
path: 'lineInfo',
name: 'lineInfo',