设备统计
This commit is contained in:
parent
7b1590458b
commit
bcaa572e87
|
@ -37,6 +37,19 @@
|
|||
type: String,
|
||||
default: '#1890ff',
|
||||
},
|
||||
axisLabel: {
|
||||
type: Object,
|
||||
default: () => ({ rotate: 0}),
|
||||
},
|
||||
grid: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
}),
|
||||
},
|
||||
// update-end--author:liaozhiyang---date:20240407---for:【QQYUN-8762】首页默认及echars颜色调整
|
||||
},
|
||||
setup(props) {
|
||||
|
@ -53,9 +66,11 @@
|
|||
},
|
||||
},
|
||||
},
|
||||
grid: props.grid,
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: [],
|
||||
axisLabel: props.axisLabel,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
|
|
|
@ -272,13 +272,13 @@ const handleBlock = (record) => {
|
|||
|
||||
|
||||
onMounted(() => {
|
||||
getHousingestates();
|
||||
if (parmas.type == '1') {
|
||||
parmas.beginTime = getPreviousDate(0) + ' 00:00:00';
|
||||
parmas.endTime = getPreviousDate(0) + ' 23:59:59';
|
||||
}
|
||||
loadDate();
|
||||
loadListDate();
|
||||
getHousingestates();
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
|
@ -95,12 +95,12 @@
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
getHousingestates();
|
||||
if(parmas.type=='1'){
|
||||
parmas.beginTime=getPreviousDate(2)+' 00:00:00';
|
||||
parmas.endTime=getPreviousDate(0)+' 23:59:59';
|
||||
}
|
||||
loadDate();
|
||||
getHousingestates();
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
|
@ -74,11 +74,11 @@
|
|||
}
|
||||
|
||||
onMounted(() => {
|
||||
getHousingestates();
|
||||
if(parmas.dateString==''){
|
||||
parmas.dateString=getCurrent();
|
||||
}
|
||||
loadDate();
|
||||
getHousingestates();
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
<a-select ref="select" placeholder="请选区域" v-model:value="parmas.housingestateId"
|
||||
style="width: 200px;margin-left: 5px;" @change="handleHousinges">
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option :value="item.housingestateId" v-for="item in housingestates" :key="item.housingestateId">{{
|
||||
item.housingestateName }}</a-select-option>
|
||||
<a-select-option :value="item.housingestateId" v-for="item in housingestates" :key="item.housingestateId">{{item.housingestateName }}</a-select-option>
|
||||
</a-select>
|
||||
</a-col>
|
||||
<a-col :span="21" v-show="izList">
|
||||
|
@ -41,7 +40,9 @@
|
|||
</a-row>
|
||||
<Bar v-show="!izList" :chartData="dataSource" height="80vh"
|
||||
:option="{ title: { text: '设备投递次数排行榜', left: 'center' } }"
|
||||
:itemStyle="{ normal: { label: { show: true, position: 'top' } } }" :seriesName="'投递次数'"></Bar>
|
||||
:itemStyle="{ normal: { label: { show: true, position: 'top' } } }"
|
||||
:axisLabel="{ rotate: 45}"
|
||||
:seriesName="'次数'"></Bar>
|
||||
<a-table v-show="izList" :dataSource="tableData" :columns="columns">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
|
@ -211,8 +212,12 @@ async function loadDate() {
|
|||
const res = await tdcsList(parmas);
|
||||
dataSource.value = [];
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
let name = res[i].imei;
|
||||
if(res[i].housingestateName!=null&&res[i].content!=null){
|
||||
name = res[i].housingestateName+'-'+res[i].content;
|
||||
}
|
||||
dataSource.value.push({
|
||||
name: `${res[i].imei}`,
|
||||
name: `${name}`,
|
||||
value: res[i].cn,
|
||||
});
|
||||
}
|
||||
|
@ -272,13 +277,13 @@ const handleBlock = (record) => {
|
|||
|
||||
|
||||
onMounted(() => {
|
||||
getHousingestates();
|
||||
if (parmas.type == '1') {
|
||||
parmas.beginTime = getPreviousDate(0) + ' 00:00:00';
|
||||
parmas.endTime = getPreviousDate(0) + ' 23:59:59';
|
||||
}
|
||||
loadDate();
|
||||
loadListDate();
|
||||
getHousingestates();
|
||||
})
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,66 +1,17 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/deviceinfo/deviceInfo/list',
|
||||
save='/deviceinfo/deviceInfo/add',
|
||||
edit='/deviceinfo/deviceInfo/edit',
|
||||
deleteOne = '/deviceinfo/deviceInfo/delete',
|
||||
deleteBatch = '/deviceinfo/deviceInfo/deleteBatch',
|
||||
importExcel = '/deviceinfo/deviceInfo/importExcel',
|
||||
exportXls = '/deviceinfo/deviceInfo/exportXls',
|
||||
list = '/zh/shebei/list',
|
||||
save='/zh/shebei/add',
|
||||
edit='/zh/shebei/edit',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import { BasicColumn } from '/@/components/Table';
|
||||
import { FormSchema } from '/@/components/Table';
|
||||
import { rules } from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
|
@ -10,25 +7,7 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'imei',
|
||||
},
|
||||
{
|
||||
title: 'ICCID',
|
||||
align: 'center',
|
||||
dataIndex: 'iccid',
|
||||
},
|
||||
{
|
||||
title: '是否在线',
|
||||
align: 'center',
|
||||
dataIndex: 'isOnline',
|
||||
format(text, record, index) {
|
||||
console.log("🌊 ~ format ~ text:", text)
|
||||
|
||||
if (text == 'true') {
|
||||
return '在线';
|
||||
} else {
|
||||
return '离线';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '区域名称',
|
||||
align: 'center',
|
||||
|
@ -44,32 +23,43 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'boxNum',
|
||||
},
|
||||
{
|
||||
title: '注册会员数',
|
||||
align: "center",
|
||||
dataIndex: 'hyCount'
|
||||
},
|
||||
{
|
||||
title: '投递次数',
|
||||
align: "center",
|
||||
dataIndex: 'tdcsCount'
|
||||
},
|
||||
{
|
||||
title: 'ICCID',
|
||||
align: 'center',
|
||||
dataIndex: 'iccid',
|
||||
},
|
||||
{
|
||||
title: '是否在线',
|
||||
align: 'center',
|
||||
dataIndex: 'isOnline',
|
||||
format(text) {
|
||||
if (text == 'true') {
|
||||
return '在线';
|
||||
} else {
|
||||
return '离线';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '是否在仓库中',
|
||||
align: 'center',
|
||||
dataIndex: 'inWarehouse',
|
||||
format(text, record, index) {
|
||||
if (text == 0) {
|
||||
return '0待翻译';
|
||||
if (text == '0') {
|
||||
return '离仓';
|
||||
} else {
|
||||
return '1待翻译';
|
||||
return '在仓';
|
||||
}
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '区域ID',
|
||||
// align: 'center',
|
||||
// dataIndex: 'housingestateId',
|
||||
// },
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
imei: { title: '设备编码', order: 0, view: 'text', type: 'string' },
|
||||
iccid: { title: 'ICCID', order: 1, view: 'text', type: 'string' },
|
||||
isOnline: { title: '是否在线', order: 2, view: 'text', type: 'string' },
|
||||
content: { title: '设备点位', order: 3, view: 'text', type: 'string' },
|
||||
boxNum: { title: '桶数量', order: 4, view: 'text', type: 'string' },
|
||||
inWarehouse: { title: '是否在仓库中', order: 5, view: 'text', type: 'string' },
|
||||
housingestateId: { title: '区域ID', order: 6, view: 'text', type: 'string' },
|
||||
};
|
||||
|
|
|
@ -5,43 +5,47 @@
|
|||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-col :span="6">
|
||||
<a-form-item name="imei">
|
||||
<template #label><span title="设备编码">设备编码</span></template>
|
||||
<a-input placeholder="请输入设备编码" v-model:value="queryParam.imei" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<!-- <a-col :lg="6">
|
||||
<a-form-item name="iccid">
|
||||
<template #label><span title="ICCID">ICCI</span></template>
|
||||
<a-input placeholder="请输入ICCID" v-model:value="queryParam.iccid" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
</a-col>-->
|
||||
<a-col :span="4">
|
||||
<a-form-item name="isOnline">
|
||||
<template #label><span title="是否在线">是否在线</span></template>
|
||||
<template #label><span title="是否在线">在线</span></template>
|
||||
<a-select ref="select" v-model:value="queryParam.isOnline" style="width: 120px" placeholder="请选择是否在线">
|
||||
<a-select-option :value="true">在线</a-select-option>
|
||||
<a-select-option :value="false">离线</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-col :span="4">
|
||||
<a-form-item name="inWarehouse">
|
||||
<template #label><span title="是否在仓库中">是否在仓</span></template>
|
||||
<template #label><span title="是否在仓库中">在仓</span></template>
|
||||
<a-select ref="select" v-model:value="queryParam.inWarehouse" style="width: 120px" placeholder="请选择是否在仓库中">
|
||||
<a-select-option :value="0">0待翻译</a-select-option>
|
||||
<a-select-option :value="1">1待翻译</a-select-option>
|
||||
<a-select-option :value="0">离仓</a-select-option>
|
||||
<a-select-option :value="1">在仓</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-col :span="6">
|
||||
<a-form-item name="housingestateId">
|
||||
<template #label><span title="区域名称">区域名称</span></template>
|
||||
<a-input placeholder="请输入区域名称" v-model:value="queryParam.housingestateName" allow-clear></a-input>
|
||||
<a-select ref="select" placeholder="请选区域" v-model:value="queryParam.housingestateId"
|
||||
style="width: 200px;margin-left: 5px;" @change="handleHousinges">
|
||||
<a-select-option value="">全部</a-select-option>
|
||||
<a-select-option :value="item.housingestateId" v-for="item in housingestates" :key="item.housingestateId">{{item.housingestateName }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<a-col :span="4">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
|
@ -71,20 +75,20 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" name="deviceinfo-deviceInfo" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import {ref, reactive, onMounted} from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './DeviceInfo.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './DeviceInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import { columns } from './DeviceInfo.data';
|
||||
import { list } from './DeviceInfo.api';
|
||||
import DeviceInfoModal from './components/DeviceInfoModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import {housingestateList} from "@/views/zh/hy/hy.api";
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const housingestates = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
|
@ -95,24 +99,15 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
canResize: false,
|
||||
useSearchForm: false,
|
||||
showActionColumn: false,
|
||||
showIndexColumn: true,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
let rangerQuery = await setRangeQuery();
|
||||
return Object.assign(params, rangerQuery);
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "设备信息",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
|
@ -126,57 +121,6 @@ const wrapperCol = reactive({
|
|||
sm: 20,
|
||||
});
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
|
@ -184,39 +128,6 @@ function handleSuccess() {
|
|||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'deviceinfo:bl_device_info:edit'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'deviceinfo:bl_device_info:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
|
@ -234,33 +145,14 @@ function searchReset() {
|
|||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let rangeField = ''
|
||||
|
||||
/**
|
||||
* 设置范围查询条件
|
||||
*/
|
||||
async function setRangeQuery() {
|
||||
let queryParamClone = cloneDeep(queryParam);
|
||||
if (rangeField) {
|
||||
let fieldsValue = rangeField.split(',');
|
||||
fieldsValue.forEach(item => {
|
||||
if (queryParamClone[item]) {
|
||||
let range = queryParamClone[item];
|
||||
queryParamClone[item + '_begin'] = range[0];
|
||||
queryParamClone[item + '_end'] = range[1];
|
||||
delete queryParamClone[item];
|
||||
} else {
|
||||
queryParamClone[item + '_begin'] = '';
|
||||
queryParamClone[item + '_end'] = '';
|
||||
async function getHousingestates() {
|
||||
housingestates.value = await housingestateList();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getHousingestates();
|
||||
})
|
||||
}
|
||||
return queryParamClone;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
Loading…
Reference in New Issue