feat: 表格单选功能

master
李小林 9 months ago
parent ccdaa7c7d1
commit cf1d79c51e
  1. 2
      src/typings/global.d.ts
  2. 15
      src/views/resources/customer/components/AddCustom.vue
  3. 29
      src/views/resources/equipment/components/AddEquipment.vue
  4. 9
      src/views/resources/equipment/components/BindingCustom.vue

@ -94,7 +94,7 @@ declare global {
} }
interface SelectForm extends PageQuery { interface SelectForm extends PageQuery {
selectName?: string; selectName?: string;
selectValue?: string; selectValue?: any;
} }
} }
export {}; export {};

@ -346,8 +346,15 @@
:data="tableData1" :data="tableData1"
v-loading="tableLoading" v-loading="tableLoading"
highlight-current-row highlight-current-row
@current-change="handleDevChange" @row-click="handleDevChange"
> >
<el-table-column width="55">
<template #default="scope">
<el-radio :label="scope.row.devId" v-model="currentDevId">
{{ "" }}
</el-radio>
</template>
</el-table-column>
<el-table-column <el-table-column
label="设备标识" label="设备标识"
align="center" align="center"
@ -422,7 +429,11 @@ import { ElTable, FormInstance, FormRules } from "element-plus";
import { getDomainOptions } from "@/api/domain"; import { getDomainOptions } from "@/api/domain";
import { addCustom } from "@/api/customer"; import { addCustom } from "@/api/customer";
import { EquipmentTableVO } from "@/api/resources-equipment/types"; import { EquipmentTableVO } from "@/api/resources-equipment/types";
import { bindingCustomAPI, getEquipmentPage, unbindingCustomAPI } from "@/api/resources-equipment"; import {
bindingCustomAPI,
getEquipmentPage,
unbindingCustomAPI,
} from "@/api/resources-equipment";
const formData = ref<CustomForm>({}); const formData = ref<CustomForm>({});
const active = ref<number>(1); const active = ref<number>(1);

@ -63,8 +63,18 @@
v-loading="loading" v-loading="loading"
highlight-current-row highlight-current-row
max-height="450" max-height="450"
@current-change="handleCurrentChange" @row-click="handleCurrentChange"
> >
<el-table-column width="55">
<template #default="scope">
<el-radio
:label="scope.row.devTypeId"
v-model="addForm.devTypeId"
>
{{ "" }}
</el-radio>
</template>
</el-table-column>
<el-table-column label="设备类型" prop="devType" align="center"> <el-table-column label="设备类型" prop="devType" align="center">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -338,8 +348,18 @@
max-height="300" max-height="300"
v-loading="loading" v-loading="loading"
highlight-current-row highlight-current-row
@current-change="handleCustomerChange" @row-click="handleCustomerChange"
> >
<el-table-column width="55">
<template #default="scope">
<el-radio
:label="scope.row.customId"
v-model="currentCustomerId"
>
{{ "" }}
</el-radio>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="customType" prop="customType"
label="客户类型" label="客户类型"
@ -397,9 +417,7 @@ import {
} from "@/api/resources-equipment"; } from "@/api/resources-equipment";
import { customerPage } from "@/api/customer"; import { customerPage } from "@/api/customer";
import { CustomerVO } from "@/api/customer/types"; import { CustomerVO } from "@/api/customer/types";
import { add } from "lodash-es";
const multiple = ref<Tr069DevTypeVO>({});
const searchForm = ref<Tr069DevTypeQuery>({ const searchForm = ref<Tr069DevTypeQuery>({
devTypeName: "", devTypeName: "",
devHardVer: "", devHardVer: "",
@ -454,7 +472,6 @@ const loadHardVerOption = async () => {
}); });
}; };
const handleCurrentChange = (val: Tr069DevTypeVO) => { const handleCurrentChange = (val: Tr069DevTypeVO) => {
multiple.value = val;
addForm.value.devTypeId = val.devTypeId; addForm.value.devTypeId = val.devTypeId;
}; };
const loadTr069DevTypePage = () => { const loadTr069DevTypePage = () => {
@ -483,7 +500,7 @@ async function loadDomainOptions() {
} }
const next1 = () => { const next1 = () => {
if (multiple.value.devTypeId === undefined) { if (addForm.value.devTypeId === undefined) {
ElMessage({ ElMessage({
message: "请选择一个设备类型", message: "请选择一个设备类型",
type: "error", type: "error",

@ -51,8 +51,15 @@
v-loading="loading" v-loading="loading"
max-height="350" max-height="350"
highlight-current-row highlight-current-row
@current-change="handleCustomerChange" @row-click="handleCustomerChange"
> >
<el-table-column width="55">
<template #default="scope">
<el-radio :label="scope.row.customId" v-model="currentCustomerId">
{{ "" }}
</el-radio>
</template>
</el-table-column>
<el-table-column prop="customType" label="客户类型" align="center" /> <el-table-column prop="customType" label="客户类型" align="center" />
<el-table-column <el-table-column
prop="regionAreaName" prop="regionAreaName"

Loading…
Cancel
Save