Commit fae711e7 authored by 张烨's avatar 张烨
parents 78575f5a 1df324d5
import React from 'react';
import { Chart, Interval, Tooltip } from 'bizcharts';
import { Form, DatePicker, Table, Row, Col, Button } from 'antd';
import { Chart, Interval, Tooltip, Axis } from 'bizcharts';
import { DataSet } from '@antv/data-set';
const data = [
{ value: 251, name: '大事例一', subName: '子事例一' },
{ value: 1041, name: '大事例三', subName: '子事例二' },
{ value: 610, name: '大事例二', subName: '子事例二' },
{ value: 434, name: '大事例二', subName: '子事例四' },
{ value: 335, name: '大事例二', subName: '子事例五' },
{ value: 250, name: '大事例三', subName: '子事例二' },
{ value: 251, name: '接口名称一', subName: '子事例一' },
{ value: 1041, name: '接口名称三', subName: '子事例二' },
{ value: 610, name: '接口名称二', subName: '子事例二' },
{ value: 434, name: '接口名称二', subName: '子事例四' },
{ value: 335, name: '接口名称二', subName: '子事例五' },
{ value: 250, name: '接口名称三', subName: '子事例二' },
];
const columns = Object.keys(data[0]).map(key => ({
title: key,
dataIndex: key,
key,
}));
// console.log(Object.keys(data[0]));
const scale = {
name: {
alias: '接口名称', // 别名
},
subName: {
alias: '名称', // 别名
},
};
const dv1 = new DataSet.View().source(data);
dv1
.transform({
......@@ -41,31 +56,88 @@ dv2
order: 'DESC', // 默认为 ASC,DESC 则为逆序
});
console.log(dv2.rows);
function Demo() {
const [timeForm] = Form.useForm();
return (
<>
<Chart
height={300}
width={400}
autoFit
data={dv1.rows}
interactions={['active-region']}
padding="auto"
>
<Interval position="name*计数" />
<Tooltip shared />
</Chart>
<Chart
height={300}
width={400}
autoFit
data={dv2.rows}
interactions={['active-region']}
padding="auto"
>
<Interval position="subName*平均值" />
<Tooltip shared />
</Chart>
<Form style={{ padding: '0px 6px' }} form={timeForm}>
<Row>
<Col span={4}>
<Form.Item name="startTime" label="起始时间">
<DatePicker showTime format="YYYY-MM-DD HH:mm:ss" />
</Form.Item>
</Col>
<Col span={4}>
<Form.Item name="endTime" label="结束时间">
<DatePicker showTime format="YYYY-MM-DD HH:mm:ss" />
</Form.Item>
</Col>
<Col span={12}>
<Button
onClick={() => {
// timeForm.setFieldsValue({ startTime: '2020-11-12 12:12:12' });
}}
>
1小时
</Button>
<Button>6小时</Button>
<Button>12小时</Button>
<Button>1</Button>
<Button>1</Button>
</Col>
</Row>
</Form>
<Row style={{ padding: '10px' }}>
<Col span={8}>
<Chart
height={300}
width={400}
autoFit
data={dv1.rows}
interactions={['active-region']}
padding="auto"
scale={scale}
>
<Axis name="name" title />
<Axis name="计数" title />
<Interval position="name*计数" />
<Tooltip shared />
</Chart>
</Col>
<Col span={8}>
<Chart
height={300}
width={400}
autoFit
data={dv2.rows}
interactions={['active-region']}
padding="auto"
scale={scale}
>
<Axis name="subName" title />
<Axis name="平均值" title />
<Interval position="subName*平均值" />
<Tooltip shared />
</Chart>
</Col>
</Row>
<Table
size="small"
bordered
columns={columns || []}
dataSource={data}
// loading={tableLoading}
scroll={{ x: 'max-content' }}
pagination={{
showTotal: (total, range) =>
`第${range[0]}-${range[1]} 条/共 ${total} 条`,
pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: 20,
showQuickJumper: true,
showSizeChanger: true,
}}
/>
</>
);
}
......
......@@ -563,33 +563,29 @@ const UserManage = () => {
message: '提交失败',
description: '登录名不支持中文!',
});
}
if (password.length < 6) {
} else if (password.length < 6) {
notification.error({
message: '提交失败',
description: '密码至少为6位!',
});
}
if (userName === '') {
} else if (userName === '') {
notification.error({
message: '提交失败',
description: '用户名称不能为空!',
});
}
if (phone !== '' && !isPhone.test(phone)) {
} else if (phone !== '' && !isPhone.test(phone)) {
notification.error({
message: '提交失败',
description: '请输入11位手机号!',
});
}
if (email !== '' && !isEmail.test(email)) {
} else if (email !== '' && !isEmail.test(email)) {
notification.error({
message: '提交失败',
description: '邮箱格式不正确!',
});
}
// 所有验证通过才可以提交,phone/email为空时不验证
if (
else if (
noChinese.test(loginName) &&
password.length >= 6 &&
userName &&
......@@ -940,28 +936,24 @@ const UserManage = () => {
message: '提交失败',
description: '登录名不支持中文!',
});
}
if (userName === '') {
} else if (userName === '') {
notification.error({
message: '提交失败',
description: '用户姓名不能为空!',
});
}
if (phone !== '' && !isPhone.test(phone)) {
} else if (phone !== '' && !isPhone.test(phone)) {
notification.error({
message: '提交失败',
description: '请输入11位手机号!',
});
}
if (email !== '' && !isEmail.test(email)) {
} else if (email !== '' && !isEmail.test(email)) {
notification.error({
message: '提交失败',
description: '邮箱格式不正确!',
});
}
// 所有验证通过才可以提交,phone/email为空时不验证
if (
else if (
loginName &&
noChinese.test(loginName) &&
userName &&
......@@ -1051,9 +1043,7 @@ const UserManage = () => {
};
// 提交-批量删除用户
const submitDeleteUsers = () => {
const temp = orgIDs.split(',');
const [org] = temp;
multiDeleteUsers(userIDs, org)
multiDeleteUsers(userIDs)
.then(res => {
if (res.code === 0) {
setDeleteUserVisible(false);
......
......@@ -30,7 +30,7 @@ import WebConfigPage from '@/pages/webConfig';
import AppConfigPage from '@/pages/appConfig';
import MobileConfigPage from '@/pages/mobileConfig';
import { USER_MODE } from '@/utils/constants';
import BaseFramContainer from '@/components/BaseFramContainer';
import BaseFrameContainer from '@/components/BaseFrameContainer';
const iconStyle = { verticalAlign: '0.125em' };
const superAuthority = [USER_MODE.SUPER];
......@@ -140,7 +140,19 @@ export default {
{
path: '/platformCenter/gis',
name: 'GIS平台',
component: Welcome,
component: BaseFrameContainer,
tabs: [
{
tabName: '范围配置',
url:
'/web4/?widget=product/Tool/EditBoundary/EditBoundary&amp;serverCollextion=JiangNing&amp;solution=熊猫智慧水务平台',
},
{
tabName: '方案配置',
url:
'/web4/?widget=product/Tool/MapSettings/MapSettings|hideMap=true',
},
],
},
// {
// path: '/platformCenter/order',
......@@ -150,7 +162,7 @@ export default {
{
path: '/platformCenter/notify',
name: '消息平台',
component: BaseFramContainer,
component: BaseFrameContainer,
tabs: [
{
tabName: '推送模板配置',
......@@ -169,14 +181,14 @@ export default {
name: '视频管理',
url:
'/web4/?widget=product/oms/VideoConfig/VideoConfig|hideMap=true&videoType=萤石云',
component: BaseFramContainer,
component: BaseFrameContainer,
},
{
path: '/platformCenter/emq',
name: '宿主管理',
url:
'/web4/?widget=product/oms/MqttConfig/MqttConfig.js|hideMap=true',
component: BaseFramContainer,
component: BaseFrameContainer,
},
{
path: '/platformCenter/dictionary',
......
......@@ -151,12 +151,11 @@ export const deleteUser = userID =>
userID,
});
// 批量删除用户
export const multiDeleteUsers = (userIDs, orgIDs) =>
export const multiDeleteUsers = userIDs =>
get(`${PUBLISH_SERVICE}/UserCenter/DeleteUsers`, {
_version: 9999,
_dc: Date.now(),
userIds: userIDs,
groupId: orgIDs,
});
export const setUserRelation = (userID, roleList = [], stationList) =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment