feat: 设备类型绑定TR069

master
李小林 10 months ago
parent 3e5e016eb1
commit 8ef17fda16
  1. 8
      src/api/device-type-ver/index.ts
  2. 6
      src/api/device-type-ver/types.ts
  3. 2
      src/api/domain/types.ts
  4. 2
      src/components/IconSelect/index.vue
  5. 2
      src/components/Table/TableBar.vue
  6. 45
      src/views/resources/tr069/components/BindingDevType.vue
  7. 4
      src/views/resources/tr069/components/Tr069DevTypeSoftVerList.vue
  8. 44
      src/views/table/index.vue

@ -1,4 +1,5 @@
import {
BindingTr069Form,
DeviceTypeToVerPageResult,
DeviceTypeToVerQuery,
DeviceTypeVerForm, DevVerServicePageResult,
@ -142,3 +143,10 @@ export function addTypeVer(devTypeId: number, data: DeviceTypeVerForm) {
data,
});
}
export function tr069BindingDevType(data: BindingTr069Form) {
return request({
url: `/api/device-type-ver/v1/tr069-binding-dev-type`,
method: "POST",
data,
});
}

@ -41,3 +41,9 @@ export interface DeviceServiceVO {
servDesc?: string;
}
export type DevVerServicePageResult = PageResult<DeviceServiceVO[]>;
export interface BindingTr069Form {
ids?: number[];
tr069VerId?: number;
}

@ -29,6 +29,6 @@ export interface DomainForm {
}
export interface DomainOption {
key: ?number;
key?: number;
label?: string;
}

@ -170,7 +170,7 @@ type IconNames = keyof typeof ElementPlusIconsVue;
const renderIcon = (iconName: string) => {
const iconComponent = ElementPlusIconsVue[iconName as IconNames];
if (iconComponent) {
return h(resolveComponent(iconComponent.name));
return h(resolveComponent(<string>iconComponent.name));
}
return null;
};

@ -96,7 +96,7 @@ function showPopover() {
}
//
function changeColumn(show: boolean, index: number) {
function changeColumn(show: any, index: number) {
let columns = props.columns;
columns.map((item, i) => {
if (index === i) {

@ -57,6 +57,19 @@
</div>
<el-card shadow="never">
<template #header>
<div
style="display: flex; justify-content: flex-end; align-items: center"
>
<el-button
type="primary"
plain
@click="binding"
:disabled="multiples.length === 0"
><i-ep-position /> 绑定</el-button
>
</div>
</template>
<div class="any-table">
<el-table
:data="tableData"
@ -108,6 +121,8 @@ import {
} from "@/api/device-type";
import { Tr069DevTypeQuery, Tr069DevTypeVO } from "@/api/tr069/types";
import { ElTable } from "element-plus";
import { tr069BindingDevType } from "@/api/device-type-ver";
import { BindingTr069Form } from "@/api/device-type-ver/types";
const multiples = ref<Tr069DevTypeVO[]>([]);
const searchForm = ref<Tr069DevTypeQuery>({
devTypeName: "",
@ -116,6 +131,8 @@ const searchForm = ref<Tr069DevTypeQuery>({
pageNum: 1,
pageSize: 10,
});
const route = useRoute();
let tr069VerId: number = parseInt(<string>route.params.tr069VerId);
const vendorNameOption = ref<OptionType[]>([]);
const typeNameOption = ref<OptionType[]>([]);
const hardVerOption = ref<OptionType[]>([]);
@ -158,6 +175,34 @@ const redirect = (devTypeId: number) => {
path: `/resources/device_type_to_ver/${devTypeId}`,
});
};
const binding = () => {
let ids: number[] = [];
multiples.value.forEach((obj) => {
ids.push(<number>obj.devTypeId);
});
let form: BindingTr069Form = {
ids,
tr069VerId,
};
loading.value = true;
tr069BindingDevType(form)
.then(() => {
ElMessage({
message: "操作成功",
type: "success",
plain: true,
duration: 1000,
onClose: () => {
router.push({
path: `/resources/tr069-dev-type-soft-ver/${tr069VerId}`,
});
},
});
})
.finally(() => {
loading.value = false;
});
};
onMounted(() => {
loadVendorNameOption();
loadTypeNameOption();

@ -9,6 +9,10 @@
<i-ep-plus />
新增
</el-button>
<el-button type="primary" @click="loadTr069DevTypePage">
<i-ep-refresh />
刷新
</el-button>
</div>
</div>
</div>

@ -1,44 +0,0 @@
<template>
<div class="app-container">
<TableBar :columns="columns" @change-columns="changeColumns">
<template #bottom>
<el-button type="primary">新增用户</el-button>
</template>
</TableBar>
<AnyTable>
<template #column>
<el-table-column label="头像" v-if="columns[0].show" />
<el-table-column label="用户名" v-if="columns[1].show" />
<el-table-column label="手机号" v-if="columns[2].show" />
<el-table-column label="邮箱" v-if="columns[3].show" />
<el-table-column label="性别" v-if="columns[4].show" />
<el-table-column label="部门" v-if="columns[5].show" />
<el-table-column label="状态" v-if="columns[6].show" />
<el-table-column label="创建日期" v-if="columns[7].show" />
</template>
</AnyTable>
</div>
</template>
<script setup lang="ts">
import TableBar from "@/components/Table/TableBar.vue";
import AnyTable from "@/components/Table/AnyTable.vue";
const columns = ref<TableColumns[]>([
{ name: "头像", show: true },
{ name: "用户名", show: true },
{ name: "手机号", show: true },
{ name: "邮箱", show: true },
{ name: "性别", show: true },
{ name: "部门", show: true },
{ name: "状态", show: true },
{ name: "创建日期", show: true },
]);
const changeColumns = (newColumns: TableColumns[]) => {
columns.value = newColumns;
};
</script>
<style lang="scss" scoped>
</style>
Loading…
Cancel
Save