|
@@ -341,7 +341,8 @@ import * as DeptApi from '@/api/system/dept'
|
|
import * as ProductClassifyApi from '@/api/pms/productclassify'
|
|
import * as ProductClassifyApi from '@/api/pms/productclassify'
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
-import {getAttrTemplateByDeviceCategoryId} from "@/api/pms/devicetemplate";
|
|
|
|
|
|
+import {DeviceAttrModelApi} from "@/api/pms/deviceattrmodel";
|
|
|
|
+
|
|
|
|
|
|
/** 设备台账 表单 */
|
|
/** 设备台账 表单 */
|
|
defineOptions({ name: 'IotDeviceForm' })
|
|
defineOptions({ name: 'IotDeviceForm' })
|
|
@@ -414,17 +415,17 @@ const list = ref([])
|
|
|
|
|
|
const assetclasschange = () => {
|
|
const assetclasschange = () => {
|
|
const assetClass = formData.value.assetClass
|
|
const assetClass = formData.value.assetClass
|
|
- getAttrTemplateByDeviceCategoryId(assetClass).then(res => {
|
|
|
|
|
|
+ DeviceAttrModelApi.getDeviceAttrModelListByDeviceCategoryId(assetClass).then(res => {
|
|
if (res){
|
|
if (res){
|
|
- if (res.attrs) {
|
|
|
|
- res.attrs.forEach((item) => {
|
|
|
|
- if (item.requiredFlag) {
|
|
|
|
- const rule = {required: true, message: item.name+'不能为空', trigger: 'blur'}
|
|
|
|
- item.rules.push(rule)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- list.value = res.attrs
|
|
|
|
- }
|
|
|
|
|
|
+ debugger
|
|
|
|
+ res.forEach((item) => {
|
|
|
|
+ if (item.requiredFlag) {
|
|
|
|
+ const rule = {required: true, message: item.name+'不能为空', trigger: 'blur'}
|
|
|
|
+ item.rules = []
|
|
|
|
+ item.rules.push(rule)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ list.value = res
|
|
} else {
|
|
} else {
|
|
list.value = []
|
|
list.value = []
|
|
}
|
|
}
|