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. 31
      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 {
selectName?: string;
selectValue?: string;
selectValue?: any;
}
}
export {};

@ -346,8 +346,15 @@
:data="tableData1"
v-loading="tableLoading"
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
label="设备标识"
align="center"
@ -422,7 +429,11 @@ import { ElTable, FormInstance, FormRules } from "element-plus";
import { getDomainOptions } from "@/api/domain";
import { addCustom } from "@/api/customer";
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 active = ref<number>(1);

@ -63,8 +63,18 @@
v-loading="loading"
highlight-current-row
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">
<template #default="scope">
<el-button
@ -338,8 +348,18 @@
max-height="300"
v-loading="loading"
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="客户类型"
@ -397,9 +417,7 @@ import {
} from "@/api/resources-equipment";
import { customerPage } from "@/api/customer";
import { CustomerVO } from "@/api/customer/types";
import { add } from "lodash-es";
const multiple = ref<Tr069DevTypeVO>({});
const searchForm = ref<Tr069DevTypeQuery>({
devTypeName: "",
devHardVer: "",
@ -454,7 +472,6 @@ const loadHardVerOption = async () => {
});
};
const handleCurrentChange = (val: Tr069DevTypeVO) => {
multiple.value = val;
addForm.value.devTypeId = val.devTypeId;
};
const loadTr069DevTypePage = () => {
@ -483,7 +500,7 @@ async function loadDomainOptions() {
}
const next1 = () => {
if (multiple.value.devTypeId === undefined) {
if (addForm.value.devTypeId === undefined) {
ElMessage({
message: "请选择一个设备类型",
type: "error",
@ -583,7 +600,7 @@ const queryCustomer = () => {
loading.value = false;
});
};
const currentCustomerId = ref<number|undefined>(0);
const currentCustomerId = ref<number | undefined>(0);
const handleCustomerChange = (val: CustomerVO) => {
currentCustomerId.value = val.customId;
};

@ -51,8 +51,15 @@
v-loading="loading"
max-height="350"
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="regionAreaName"

Loading…
Cancel
Save