|
@@ -33,7 +33,7 @@
|
|
|
<el-tree-select
|
|
<el-tree-select
|
|
|
v-model="formData.hardwareTypeId"
|
|
v-model="formData.hardwareTypeId"
|
|
|
:data="hardwareTypeOption"
|
|
:data="hardwareTypeOption"
|
|
|
- :props="defaultProps"
|
|
|
|
|
|
|
+ :props="{ value: 'id', label: 'hardwareTypeName', children: 'children' }"
|
|
|
@change="onSelectChange"
|
|
@change="onSelectChange"
|
|
|
placeholder="请选择硬件类型"
|
|
placeholder="请选择硬件类型"
|
|
|
/>
|
|
/>
|
|
@@ -189,11 +189,7 @@ const formRules = reactive({
|
|
|
const formRef = ref() // 表单 Ref
|
|
const formRef = ref() // 表单 Ref
|
|
|
const hardwareTypeOption = ref([]) // 硬件类型选项
|
|
const hardwareTypeOption = ref([]) // 硬件类型选项
|
|
|
|
|
|
|
|
-// 树形配置
|
|
|
|
|
-const defaultProps = {
|
|
|
|
|
- children: 'children',
|
|
|
|
|
- label: 'label'
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
/** 打开弹窗 */
|
|
|
const open = async (type: string, id?: number) => {
|
|
const open = async (type: string, id?: number) => {
|
|
@@ -283,9 +279,11 @@ const onSelectChange = (selectedId: number) => {
|
|
|
|
|
|
|
|
/** 获取硬件类型树形数据 */
|
|
/** 获取硬件类型树形数据 */
|
|
|
const getHardwareTypeTree = async () => {
|
|
const getHardwareTypeTree = async () => {
|
|
|
- const data = { pageNo: 1, pageSize: 10000 }
|
|
|
|
|
|
|
+ const data = { pageNo: 1, pageSize: -1 }
|
|
|
const response = await HardwareTypeApi.listHardwareType(data)
|
|
const response = await HardwareTypeApi.listHardwareType(data)
|
|
|
- hardwareTypeOption.value = handleTree(response.records)
|
|
|
|
|
|
|
+ console.log(response,'数据拿到了没')
|
|
|
|
|
+ hardwareTypeOption.value = handleTree(response.list,'id', 'parentTypeId')
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/** 初始化 **/
|
|
/** 初始化 **/
|