|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
isShow: false,
|
|
|
formData: this.reset(),
|
|
|
formDataRules: {
|
|
|
- bindThresholdCodes: [{ required: true, message: "请选择阈值名称" }]
|
|
|
+ bindThresholdCodes: [{ required: true, message: "请选择阈值名称",trigger:'blur' }]
|
|
|
},
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
@@ -81,24 +81,6 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations([]),
|
|
|
- initDeviceTypeList(){
|
|
|
- thresholdTypeList()
|
|
|
- .then((r) => {
|
|
|
- // 使用 map 而不是 filter 进行数据转换
|
|
|
- const transformedList = r.map((item) => ({
|
|
|
- value: item.value,
|
|
|
- label: item.label,
|
|
|
- type: item.type,
|
|
|
- }));
|
|
|
-
|
|
|
- // 将转换后的数据推送到 this.deviceTypeList
|
|
|
- this.deviceTypes.push(...transformedList);
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- // 处理错误
|
|
|
- console.error('Error fetching device type list:', error);
|
|
|
- });
|
|
|
- },
|
|
|
reset() {
|
|
|
return {
|
|
|
bindThresholdCodes:null,
|
|
|
@@ -106,7 +88,14 @@ export default {
|
|
|
},
|
|
|
async show(queryParams, deviceTypes) {
|
|
|
this.queryParams = queryParams;
|
|
|
- this.deviceTypes.push(deviceTypes);
|
|
|
+ // 使用 map 而不是 filter 进行数据转换
|
|
|
+ this.deviceTypes = [];
|
|
|
+ const transformedList = deviceTypes.map((item) => ({
|
|
|
+ value: item.value,
|
|
|
+ label: item.label,
|
|
|
+ type: item.type,
|
|
|
+ }));
|
|
|
+ this.deviceTypes.push(...transformedList);
|
|
|
this.isShow = true;
|
|
|
},
|
|
|
// 事件
|
|
|
@@ -138,7 +127,6 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
- this.initDeviceTypeList();
|
|
|
},
|
|
|
mounted() {},
|
|
|
components: { },
|