Browse Source

rev 区域筛选

master
周俊杰 1 year ago
parent
commit
3b21a4d4c1
  1. 2
      acs/nladmin-system/src/main/java/org/nl/acs/device/rest/DeviceDbitemController.java
  2. 30
      acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java
  3. 4
      acs/nladmin-system/src/main/java/org/nl/acs/device/wql/Qdevice_query_002.wql
  4. 43
      acs/nladmin-ui/src/views/acs/device/index.vue

2
acs/nladmin-system/src/main/java/org/nl/acs/device/rest/DeviceDbitemController.java

@ -25,7 +25,7 @@ import java.util.Map;
@RestController
@RequiredArgsConstructor
@Api(tags = "设备采集项管理")
@RequestMapping("/api/deviceDbitem")
@RequestMapping("Dbitem")
public class DeviceDbitemController {
private final DeviceDbitemService deviceDbitemService;

30
acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java

@ -78,15 +78,20 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
logger.info("Hello World");
HashMap param = new HashMap();
param.put("flag", "01");
if (whereJson.get("blurry") != null) {
param.put("blurry", "%" + whereJson.get("blurry") + "%");
}
if (whereJson.get("region") != null) {
param.put("region", whereJson.get("region"));
}
if (whereJson.get("device_type") != null) {
param.put("device_type", whereJson.get("device_type"));
}
JSONObject json = WQL.getWO("Qdevice_query_002").addParamMap(param).pageQuery(WqlUtil.getHttpContext(page), "is_config asc,seq_num desc,update_time desc");
return json;
}
@Override
@ -269,25 +274,14 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
@Override
public void download(List<DeviceDto> all, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (DeviceDto device : all) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("生产厂家", device.getManufacturer());
map.put("厂家电话", device.getManufacturer_phone());
map.put("opcServer标识", device.getOpc_server_id());
map.put("opcPlc标识", device.getOpc_plc_id());
map.put("是否启用", device.getIs_active());
map.put("是否删除", device.getIs_delete());
map.put("创建者", device.getCreate_by());
map.put("创建时间", device.getCreate_time());
map.put("修改者", device.getUpdate_by());
map.put("修改时间", device.getUpdate_time());
map.put("设备编码", device.getDevice_code());
map.put("设备名字", device.getDevice_name());
map.put("设备类型", device.getDevice_type());
map.put("是否配置", device.getIs_config());
map.put("备注", device.getRemark());
map.put("device_code",null);
map.put("device_name",null);
map.put("device_type",null);
map.put("is_config",null);
map.put("is_route",null);
map.put("region",null);
list.add(map);
}
FileUtil.downloadExcel(list, response);
}

4
acs/nladmin-system/src/main/java/org/nl/acs/device/wql/Qdevice_query_002.wql

@ -23,6 +23,7 @@
输入.methods_code TYPEAS s_string
输入.methods_id TYPEAS s_string
输入.blurry TYPEAS s_string
输入.region TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
@ -60,6 +61,9 @@
OPTION 输入.blurry <> ""
( d.device_code LIKE 输入.blurry or d.device_name LIKE 输入.blurry)
ENDOPTION
OPTION 输入.region <> ""
d.region = 输入.region
ENDOPTION
OPTION 输入.device_type <> ""
d.device_type = 输入.device_type
ENDOPTION

43
acs/nladmin-ui/src/views/acs/device/index.vue

@ -26,9 +26,29 @@
>
<el-option v-for="item in device_types" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
<el-select
v-model="query.region"
clearable
filterable
size="small"
placeholder="区域名称"
class="filter-item"
style="width: 190px"
@change="crud.toQuery"
>
<el-option v-for="item in regions" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
<rrOperation />
</div>
<crudOperation :permission="permission">
<el-button
slot="right"
class="filter-item"
size="mini"
type="warning"
icon="el-icon-download"
@click="crud.doExport"
>导出模型</el-button>
<el-button
slot="right"
class="filter-item"
@ -174,6 +194,8 @@ import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import { get } from '@/api/system/dictDetail'
import UploadDialog from '@/views/acs/device/UploadDialog'
import {download} from '@/api/data'
import {downloadFile} from '@/utils'
const defaultForm = {
manufacturer: null,
@ -192,7 +214,8 @@ const defaultForm = {
device_type: null,
region: null,
is_config: null,
remark: null
remark: null,
region: null
}
export default {
name: 'Device',
@ -215,7 +238,9 @@ export default {
del: ['admin', 'device:del']
},
device_types: [],
regions: [],
uploadShow: false,
regions: [],
rules: {
device_code: [
@ -226,8 +251,10 @@ export default {
],
device_type: [
{ required: true, message: '设备类型不能为空', trigger: 'blur' }
],
region: [
{ required: true, message: '所属区域不能为空', trigger: 'blur' }
]
}
}
},
@ -238,7 +265,7 @@ export default {
this.device_types = data.content
})
//
get('region_type').then(data => {
get('region').then(data => {
this.regions = data.content
})
})
@ -257,6 +284,16 @@ export default {
}).catch(err => {
console.log(err.response.data.message)
})
},
downloadMethod() {
this.beforeInit()
this.downloadLoading = true
download(this.url + 'api/device/download', this.params).then(result => {
downloadFile(result, this.title + '数据', 'xlsx')
this.downloadLoading = false
}).catch(() => {
this.downloadLoading = false
})
}
}
}

Loading…
Cancel
Save