Commit 1df324d5 authored by 陈前坚's avatar 陈前坚

perf: style

parent 6492197d
import React from 'react'; 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'; import { DataSet } from '@antv/data-set';
const data = [ const data = [
{ value: 251, name: '大事例一', subName: '子事例一' }, { value: 251, name: '接口名称一', subName: '子事例一' },
{ value: 1041, name: '大事例三', subName: '子事例二' }, { value: 1041, name: '接口名称三', subName: '子事例二' },
{ value: 610, name: '大事例二', subName: '子事例二' }, { value: 610, name: '接口名称二', subName: '子事例二' },
{ value: 434, name: '大事例二', subName: '子事例四' }, { value: 434, name: '接口名称二', subName: '子事例四' },
{ value: 335, name: '大事例二', subName: '子事例五' }, { value: 335, name: '接口名称二', subName: '子事例五' },
{ value: 250, 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); const dv1 = new DataSet.View().source(data);
dv1 dv1
.transform({ .transform({
...@@ -41,31 +56,88 @@ dv2 ...@@ -41,31 +56,88 @@ dv2
order: 'DESC', // 默认为 ASC,DESC 则为逆序 order: 'DESC', // 默认为 ASC,DESC 则为逆序
}); });
console.log(dv2.rows); console.log(dv2.rows);
function Demo() { function Demo() {
const [timeForm] = Form.useForm();
return ( return (
<> <>
<Chart <Form style={{ padding: '0px 6px' }} form={timeForm}>
height={300} <Row>
width={400} <Col span={4}>
autoFit <Form.Item name="startTime" label="起始时间">
data={dv1.rows} <DatePicker showTime format="YYYY-MM-DD HH:mm:ss" />
interactions={['active-region']} </Form.Item>
padding="auto" </Col>
> <Col span={4}>
<Interval position="name*计数" /> <Form.Item name="endTime" label="结束时间">
<Tooltip shared /> <DatePicker showTime format="YYYY-MM-DD HH:mm:ss" />
</Chart> </Form.Item>
<Chart </Col>
height={300} <Col span={12}>
width={400} <Button
autoFit onClick={() => {
data={dv2.rows} // timeForm.setFieldsValue({ startTime: '2020-11-12 12:12:12' });
interactions={['active-region']} }}
padding="auto" >
> 1小时
<Interval position="subName*平均值" /> </Button>
<Tooltip shared /> <Button>6小时</Button>
</Chart> <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 = () => { ...@@ -563,33 +563,29 @@ const UserManage = () => {
message: '提交失败', message: '提交失败',
description: '登录名不支持中文!', description: '登录名不支持中文!',
}); });
} } else if (password.length < 6) {
if (password.length < 6) {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '密码至少为6位!', description: '密码至少为6位!',
}); });
} } else if (userName === '') {
if (userName === '') {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '用户名称不能为空!', description: '用户名称不能为空!',
}); });
} } else if (phone !== '' && !isPhone.test(phone)) {
if (phone !== '' && !isPhone.test(phone)) {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '请输入11位手机号!', description: '请输入11位手机号!',
}); });
} } else if (email !== '' && !isEmail.test(email)) {
if (email !== '' && !isEmail.test(email)) {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '邮箱格式不正确!', description: '邮箱格式不正确!',
}); });
} }
// 所有验证通过才可以提交,phone/email为空时不验证 // 所有验证通过才可以提交,phone/email为空时不验证
if ( else if (
noChinese.test(loginName) && noChinese.test(loginName) &&
password.length >= 6 && password.length >= 6 &&
userName && userName &&
...@@ -940,28 +936,24 @@ const UserManage = () => { ...@@ -940,28 +936,24 @@ const UserManage = () => {
message: '提交失败', message: '提交失败',
description: '登录名不支持中文!', description: '登录名不支持中文!',
}); });
} } else if (userName === '') {
if (userName === '') {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '用户姓名不能为空!', description: '用户姓名不能为空!',
}); });
} } else if (phone !== '' && !isPhone.test(phone)) {
if (phone !== '' && !isPhone.test(phone)) {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '请输入11位手机号!', description: '请输入11位手机号!',
}); });
} } else if (email !== '' && !isEmail.test(email)) {
if (email !== '' && !isEmail.test(email)) {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
description: '邮箱格式不正确!', description: '邮箱格式不正确!',
}); });
} }
// 所有验证通过才可以提交,phone/email为空时不验证 // 所有验证通过才可以提交,phone/email为空时不验证
if ( else if (
loginName && loginName &&
noChinese.test(loginName) && noChinese.test(loginName) &&
userName && userName &&
...@@ -1051,9 +1043,7 @@ const UserManage = () => { ...@@ -1051,9 +1043,7 @@ const UserManage = () => {
}; };
// 提交-批量删除用户 // 提交-批量删除用户
const submitDeleteUsers = () => { const submitDeleteUsers = () => {
const temp = orgIDs.split(','); multiDeleteUsers(userIDs)
const [org] = temp;
multiDeleteUsers(userIDs, org)
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
setDeleteUserVisible(false); setDeleteUserVisible(false);
......
...@@ -30,7 +30,7 @@ import WebConfigPage from '@/pages/webConfig'; ...@@ -30,7 +30,7 @@ import WebConfigPage from '@/pages/webConfig';
import AppConfigPage from '@/pages/appConfig'; import AppConfigPage from '@/pages/appConfig';
import MobileConfigPage from '@/pages/mobileConfig'; import MobileConfigPage from '@/pages/mobileConfig';
import { USER_MODE } from '@/utils/constants'; import { USER_MODE } from '@/utils/constants';
import BaseFramContainer from '@/components/BaseFramContainer'; import BaseFrameContainer from '@/components/BaseFrameContainer';
const iconStyle = { verticalAlign: '0.125em' }; const iconStyle = { verticalAlign: '0.125em' };
const superAuthority = [USER_MODE.SUPER]; const superAuthority = [USER_MODE.SUPER];
...@@ -140,7 +140,19 @@ export default { ...@@ -140,7 +140,19 @@ export default {
{ {
path: '/platformCenter/gis', path: '/platformCenter/gis',
name: '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', // path: '/platformCenter/order',
...@@ -150,7 +162,7 @@ export default { ...@@ -150,7 +162,7 @@ export default {
{ {
path: '/platformCenter/notify', path: '/platformCenter/notify',
name: '消息平台', name: '消息平台',
component: BaseFramContainer, component: BaseFrameContainer,
tabs: [ tabs: [
{ {
tabName: '推送模板配置', tabName: '推送模板配置',
...@@ -169,14 +181,14 @@ export default { ...@@ -169,14 +181,14 @@ export default {
name: '视频管理', name: '视频管理',
url: url:
'/web4/?widget=product/oms/VideoConfig/VideoConfig|hideMap=true&videoType=萤石云', '/web4/?widget=product/oms/VideoConfig/VideoConfig|hideMap=true&videoType=萤石云',
component: BaseFramContainer, component: BaseFrameContainer,
}, },
{ {
path: '/platformCenter/emq', path: '/platformCenter/emq',
name: '宿主管理', name: '宿主管理',
url: url:
'/web4/?widget=product/oms/MqttConfig/MqttConfig.js|hideMap=true', '/web4/?widget=product/oms/MqttConfig/MqttConfig.js|hideMap=true',
component: BaseFramContainer, component: BaseFrameContainer,
}, },
{ {
path: '/platformCenter/dictionary', path: '/platformCenter/dictionary',
......
...@@ -151,12 +151,11 @@ export const deleteUser = userID => ...@@ -151,12 +151,11 @@ export const deleteUser = userID =>
userID, userID,
}); });
// 批量删除用户 // 批量删除用户
export const multiDeleteUsers = (userIDs, orgIDs) => export const multiDeleteUsers = userIDs =>
get(`${PUBLISH_SERVICE}/UserCenter/DeleteUsers`, { get(`${PUBLISH_SERVICE}/UserCenter/DeleteUsers`, {
_version: 9999, _version: 9999,
_dc: Date.now(), _dc: Date.now(),
userIds: userIDs, userIds: userIDs,
groupId: orgIDs,
}); });
export const setUserRelation = (userID, roleList = [], stationList) => 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