<view class="empty-box" hidden="{{!showEmpty}}"> <image src="../../../images/empty-list.png" mode="widthFix"></image> <text>暂未查询到相关数据~~</text> </view> 转vue格式
时间: 2023-10-05 21:08:19 浏览: 45
以下是转换后的Vue代码:
```html
<template>
<view :hidden="!showEmpty" class="empty-box">
<image src="../../../images/empty-list.png" mode="widthFix"></image>
<text>暂未查询到相关数据~~</text>
</view>
</template>
```
相关问题
给下面代码添加注释: public List<ModelPropertyDTO> getpropertitySetsByGuids(List<String> guids, EngineModel engineModel, String language, String viewId, Boolean showEmpty) { Query query = new Query(); Criteria criteria = Criteria.where("modelId").is(engineModel.getId()); if (guids != null) { Criteria criteriaUuids = Criteria.where("uuid").in(guids); query.addCriteria(criteriaUuids); } if (!StringUtils.isEmpty(viewId)) { Criteria criteriaViewId = null; if (guids != null) { // 查具体构件时 criteriaViewId = Criteria.where("viewId").is(viewId); }else{ // 直接查整个分类时 criteriaViewId = Criteria.where("type.uuid").is(viewId); } query.addCriteria(criteriaViewId); /if (guids == null) { Criteria criteriaUuids = Criteria.where("uuid").is(viewId); query.addCriteria(criteriaUuids); }/ } query.addCriteria(criteria); query.fields().include("propertySets"); query.fields().include("modelId"); query.fields().include("uuid"); query.fields().include("type"); query.fields().include("systems"); query.fields().include("location"); query.fields().include("fillsVoids"); query.fields().include("extendObject"); query.fields().include("materialNames"); query.fields().include("voidsElements"); query.fields().include("entity"); query.fields().include("extend"); List<EngineObject> engineObjectList = mongotemplate.find(query, EngineObject.class); if (guids != null && guids.size() == 1) { //说明是单个查询构件信息 if (CollectionUtils.isNotEmpty(engineObjectList) && engineObjectList.size() == 2) { engineObjectList.forEach(engineObject -> { if (IfcEntityCategory.IFCBUILDING.getValue().equalsIgnoreCase(engineObject.getEntity())) { engineObjectRepository.delete(engineObject); } }); } } //query type: 模型所有几何构件 List<String> uuidsType = engineObjectList.stream().filter(engineObject -> engineObject.getType() != null).map(engineObject -> engineObject.getType().getUuid()).collect(Collectors.toList()); // Map<String, EngineObject> engineObjectMap = queryEnginObjectType(engineModel, uuidsType); List<ModelPropertyDTO> modelPropertyDTOList = getModelPropertyDTOS(language, engineObjectList, engineObjectMap, showEmpty); return modelPropertyDTOList; }
这是一个 Java 方法,接收四个参数:一个字符串列表 guids、一个 EngineModel 对象 engineModel、一个字符串 language、一个字符串 viewId 和一个布尔值 showEmpty。方法返回一个 ModelPropertyDTO 对象列表。
该方法的作用是根据给定的 guids,从 MongoDB 数据库中查询指定的 EngineObject 对象,并将这些对象转换为 ModelPropertyDTO 对象列表返回。
接下来逐行解释代码:
```
Query query = new Query(); // 创建 MongoDB 查询对象
Criteria criteria = Criteria.where("modelId").is(engineModel.getId()); // 创建查询条件,查询 modelId 等于 engineModel 的 id 的 EngineObject 对象
if (guids != null) { // 如果 guids 不为空
Criteria criteriaUuids = Criteria.where("uuid").in(guids); // 创建查询条件,查询 uuid 在 guids 中的 EngineObject 对象
query.addCriteria(criteriaUuids); // 将 uuid 查询条件添加到查询对象中
}
if (!StringUtils.isEmpty(viewId)) { // 如果 viewId 不为空
Criteria criteriaViewId = null;
if (guids != null) { // 如果 guids 不为空
criteriaViewId = Criteria.where("viewId").is(viewId); // 创建查询条件,查询 viewId 等于 viewId 的 EngineObject 对象
}else{ // 如果 guids 为空
criteriaViewId = Criteria.where("type.uuid").is(viewId); // 创建查询条件,查询 type.uuid 等于 viewId 的 EngineObject 对象
}
query.addCriteria(criteriaViewId); // 将 viewId 查询条件添加到查询对象中
}
query.addCriteria(criteria); // 将 modelId 查询条件添加到查询对象中
// 设置需要查询的字段
query.fields().include("propertySets");
query.fields().include("modelId");
query.fields().include("uuid");
query.fields().include("type");
query.fields().include("systems");
query.fields().include("location");
query.fields().include("fillsVoids");
query.fields().include("extendObject");
query.fields().include("materialNames");
query.fields().include("voidsElements");
query.fields().include("entity");
query.fields().include("extend");
// 从 MongoDB 数据库中查询符合条件的 EngineObject 对象
List<EngineObject> engineObjectList = mongotemplate.find(query, EngineObject.class);
if (guids != null && guids.size() == 1) { // 如果 guids 不为空且只有一个元素
if (CollectionUtils.isNotEmpty(engineObjectList) && engineObjectList.size() == 2) { // 如果查询到的 EngineObject 对象不为空且数量为 2
engineObjectList.forEach(engineObject -> { // 遍历 EngineObject 对象列表
if (IfcEntityCategory.IFCBUILDING.getValue().equalsIgnoreCase(engineObject.getEntity())) { // 如果 EngineObject 对象的 entity 字段等于 IFCBUILDING
engineObjectRepository.delete(engineObject); // 从数据库中删除该 EngineObject 对象
}
});
}
}
// 查询类型为模型所有几何构件的 uuid 列表
List<String> uuidsType = engineObjectList.stream().filter(engineObject -> engineObject.getType() != null).map(engineObject -> engineObject.getType().getUuid()).collect(Collectors.toList());
// Map<String, EngineObject> engineObjectMap = queryEnginObjectType(engineModel, uuidsType);
// 根据查询到的 EngineObject 对象列表生成 ModelPropertyDTO 对象列表
List<ModelPropertyDTO> modelPropertyDTOList = getModelPropertyDTOS(language, engineObjectList, engineObjectMap, showEmpty);
// 返回 ModelPropertyDTO 对象列表
return modelPropertyDTOList;
```
if (this.data.tabIndex != i && !this.data.isLoading) { this.setData({ tabIndex: i, couponShowList: [] }) this.currentPage = 0 this.totalPage = 1 if (this.data.tabIndex == 0) { this.setData({ type: 1, showEmpty: false }) } else if (this.data.tabIndex == 1) { this.setData({ type: 2, showEmpty: false }) } else if (this.data.tabIndex == 2) { this.setData({ type: 3, showEmpty: false }) } this.getList() } 转uniapp 格式
请问您是想将这段代码转换为uniapp格式吗?转换后的代码如下:
if (this.data.tabIndex !== i && !this.data.isLoading) {
this.setData({
tabIndex: i,
couponShowList: []
});
this.currentPage = 0;
this.totalPage = 1;
if (this.data.tabIndex === 0) {
this.setData({
type: 1,
showEmpty: false
});
} else if (this.data.tabIndex === 1) {
this.setData({
type: 2,
showEmpty: false
});
} else if (this.data.tabIndex === 2) {
this.setData({
type: 3,
showEmpty: false
});
}
this.getList();
}
相关推荐
![.zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![.zip](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![jpg](https://img-home.csdnimg.cn/images/20210720090814.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)