Commit 72712ba9 authored by 田功镭's avatar 田功镭

*)modify bugs

parent f878d562
import Mock from 'mockjs';
export const appdatas = () =>{
export const appdatas = () => {
return Mock.mock({
'dataList|10-20': [{
'key|+1': 1,
'text|1': '@ctitle(2, 4)',
'count': function() {
return this.children.length;
},
'children|5-10': [{
'key': '@id',
'title': '@ctitle(3, 5)',
'dataList|10-20': [
{
'key|+1': 1,
'text|1': '@ctitle(2, 4)',
count() {
return this.children.length;
},
'children|5-10': [
{
key: '@id',
title: '@ctitle(3, 5)',
'funcIcon|+1': [
'/src/assets/funcicon/search.png',
'/src/assets/funcicon/text.png',
'/src/assets/funcicon/think.png',
'/src/assets/funcicon/print.png',
'/src/assets/funcicon/calender.png',
'/src/assets/funcicon/calc.png'
]
}
]
}
]
});
};
export const recommends = () => {
return Mock.mock({
'dataList|1-6': [
{
key: '@id',
title: '@ctitle(3, 5)',
itemPath: '@word(2, 3) / @word(3, 5)',
'funcIcon|+1': [
'/src/assets/funcicon/search.png',
'/src/assets/funcicon/text.png',
......@@ -19,25 +43,7 @@ export const appdatas = () =>{
'/src/assets/funcicon/calender.png',
'/src/assets/funcicon/calc.png'
]
}]
}]
});
};
export const recommends = () => {
return Mock.mock({
'dataList|1-6': [{
'key': '@id',
'title': '@ctitle(3, 5)',
'itemPath': '@word(2, 3) / @word(3, 5)',
'funcIcon|+1': [
'/src/assets/funcicon/search.png',
'/src/assets/funcicon/text.png',
'/src/assets/funcicon/think.png',
'/src/assets/funcicon/print.png',
'/src/assets/funcicon/calender.png',
'/src/assets/funcicon/calc.png'
]
}]
}
]
});
};
......@@ -5,6 +5,6 @@ import Mock from 'mockjs';
// @csentence
// @cparagraph
export default function accounts(){
export default function accounts() {
return Mock.mock('@ctitle');
}
import {
onePage,
digitalPlan,
giot,
dispatch,
analysis
} from './outterUrlConsts';
import { onePage, digitalPlan, giot, dispatch, analysis } from './outterUrlConsts';
const systems = [
{ id: '1', name: '实战指挥辅助决策平台', url: dispatch() },
......
......@@ -15,49 +15,49 @@ const analysisUrl = AmosConfig.outterURI.analysis;
const forum = AmosConfig.outterURI.forum;
const helpCenter = AmosConfig.outterURI.helpCenter;
export function mainIneer(){
export function mainIneer() {
return mainIneerUrl;
}
export function onePage(){
export function onePage() {
return parseText(onePageUrl, {
user: getUser(),
token: getToken()
});
}
export function digitalPlan(){
export function digitalPlan() {
return parseText(digitalPlanUrl, {
user: getUser(),
token: getToken()
});
}
export function giot(){
export function giot() {
return parseText(giotUrl, {
user: getUser(),
token: getToken()
});
}
export function dispatch(){
export function dispatch() {
return parseText(dispatchUrl, {
user: getUser(),
token: getToken()
});
}
export function analysis(){
export function analysis() {
return parseText(analysisUrl, {
user: getUser(),
token: getToken()
});
}
export function dataAnaysisUrl(){
export function dataAnaysisUrl() {
return dataAnalysis;
}
export function forumUrl(){
export function forumUrl() {
return forum;
}
export function helpCenterUrl(){
export function helpCenterUrl() {
return helpCenter;
}
......@@ -20,7 +20,7 @@ export const sessionConsts = {
systemMenu: 'systemMenu'
};
const getAll = function(consts){
const getAll = function(consts) {
return Object.values(consts) || [];
};
......
......@@ -5,5 +5,3 @@ export const EYE_MODE_CHANGE = 'EYE_MODE_CHANGE';
//主题模块
export const THEMES_CHANGE = 'THEMES_CHANGE';
export const THEMES_TOP_CHANGE = 'THEMES_TOP_CHANGE';
This diff is collapsed.
......@@ -5,6 +5,6 @@ export const THEMES_TEMPLATE = '/static/css/app.css';
* 补全icon 路径
* @param {string} iconName
*/
export const completeDevIcon = (iconName) => {
export const completeDevIcon = iconName => {
return `/src/assets/iot/deviceManage/${iconName}`;
};
......@@ -5,7 +5,6 @@ const completePrefix = endConf.completePrefix;
const AmosConfig = endConf.AmosConfig;
const baseURI = AmosConfig.wsURI.baseURI;
export default {
testWs: completePrefix(baseURI, '')
};
......@@ -13,27 +13,25 @@ import IECServer from './view/iec/server';
import PluginCore from './view/mainframe/PluginCore';
import './styles/giot/index.scss';
import "./styles/view/common/index.scss";
import './styles/view/common/index.scss';
const plugView = {
device: PluginCore, //告警管理路由配置
alarmManage: AlarmManage, //告警管理路由配置
deviceInterface: DeviceInterface, //设备接口路由配置
deviceProtocol: DeviceProtocol, //设备协议路由配置
device: PluginCore, // 告警管理路由配置
alarmManage: AlarmManage, // 告警管理路由配置
deviceInterface: DeviceInterface, // 设备接口路由配置
deviceProtocol: DeviceProtocol, // 设备协议路由配置
deviceManage: DeviceManage, // 设备模板
ruleManage: RuleManage, //任务管理路由配置
ruleManage: RuleManage, // 任务管理路由配置
topoManage: TopoManage, // 拓扑视图
historicalData: HistoricalData, // 历史数据
recentAlarm: RecentAlarm, //当前告警路由配置
recentAlarm: RecentAlarm, // 当前告警路由配置
createEquipment: CreateEquipment, // 设备列表
plcManager: PLCManager,
iec104client: IECClient,
iec104server: IECServer
};
export const initPluginsConfig = ({
staticHeader
}) => {
export const initPluginsConfig = ({ staticHeader }) => {
window.isIotPluginsToAmos = true;
window.iotRequestInfo = {
staticHeader
......
......@@ -2,42 +2,41 @@ import actionCreator from 'amos-processor/lib/redux/actionCreator';
import formatUrl from 'amos-processor/lib/utils/urlFormat';
// import completeSecurityUrl from 'amos-security/lib/consts/securityUrl';
export const COMPANY_TABLE_INFOS = 'COMPANY_TABLE_INFOS'; //公司-单位管理表格信息
export const COMPANY_TABLE_INFOS_SUCCESS = 'COMPANY_TABLE_INFOS_SUCCESS'; //公司-单位管理表格信息
export const COMPANY_TABLE_INFOS_ERROR = 'COMPANY_TABLE_INFOS_ERROR'; //公司-单位管理表格信息
export const COMPANY_TABLE_INFOS = 'COMPANY_TABLE_INFOS'; // 公司-单位管理表格信息
export const COMPANY_TABLE_INFOS_SUCCESS = 'COMPANY_TABLE_INFOS_SUCCESS'; // 公司-单位管理表格信息
export const COMPANY_TABLE_INFOS_ERROR = 'COMPANY_TABLE_INFOS_ERROR'; // 公司-单位管理表格信息
export const COMPANY_LEVELS = 'COMPANY_LEVELS'; //公司-获取单位级别集合
export const COMPANY_LEVELS_SUCCESS = 'COMPANY_LEVELS_SUCCESS'; //公司-获取单位级别集合
export const COMPANY_LEVELS_ERROR = 'COMPANY_LEVELS_ERROR'; //公司-获取单位级别集合
export const COMPANY_LEVELS = 'COMPANY_LEVELS'; // 公司-获取单位级别集合
export const COMPANY_LEVELS_SUCCESS = 'COMPANY_LEVELS_SUCCESS'; // 公司-获取单位级别集合
export const COMPANY_LEVELS_ERROR = 'COMPANY_LEVELS_ERROR'; // 公司-获取单位级别集合
export const COMPANY_DEL = 'COMPANY_DEL'; //公司-删除单位信息
export const COMPANY_DEL_SUCCESS = 'COMPANY_DEL_SUCCESS'; //公司-删除单位信息
export const COMPANY_DEL_ERROR = 'COMPANY_DEL_ERROR'; //公司-删除单位信息
export const COMPANY_DEL = 'COMPANY_DEL'; // 公司-删除单位信息
export const COMPANY_DEL_SUCCESS = 'COMPANY_DEL_SUCCESS'; // 公司-删除单位信息
export const COMPANY_DEL_ERROR = 'COMPANY_DEL_ERROR'; // 公司-删除单位信息
export const COMPANY_ADD = 'COMPANY_ADD'; //公司-添加单位信息
export const COMPANY_ADD_SUCCESS = 'COMPANY_ADD_SUCCESS'; //公司-添加单位信息
export const COMPANY_ADD_ERROR = 'COMPANY_ADD_ERROR'; //公司-添加单位信息
export const COMPANY_ADD = 'COMPANY_ADD'; // 公司-添加单位信息
export const COMPANY_ADD_SUCCESS = 'COMPANY_ADD_SUCCESS'; // 公司-添加单位信息
export const COMPANY_ADD_ERROR = 'COMPANY_ADD_ERROR'; // 公司-添加单位信息
export const COMPANY_EDIT = 'COMPANY_EDIT'; //公司-编辑单位信息
export const COMPANY_EDIT_SUCCESS = 'COMPANY_EDIT_SUCCESS'; //公司-编辑单位信息
export const COMPANY_EDIT_ERROR = 'COMPANY_EDIT_ERROR'; //公司-编辑单位信息
export const COMPANY_EDIT = 'COMPANY_EDIT'; // 公司-编辑单位信息
export const COMPANY_EDIT_SUCCESS = 'COMPANY_EDIT_SUCCESS'; // 公司-编辑单位信息
export const COMPANY_EDIT_ERROR = 'COMPANY_EDIT_ERROR'; // 公司-编辑单位信息
export const COMPANY_INFO = 'COMPANY_INFO'; //公司-根据id获取单位信息
export const COMPANY_INFO_SUCCESS = 'COMPANY_INFO_SUCCESS'; //公司-根据id获取单位信息
export const COMPANY_INFO_ERROR = 'COMPANY_INFO_ERROR'; //公司-根据id获取单位信息
export const COMPANY_INFO = 'COMPANY_INFO'; // 公司-根据id获取单位信息
export const COMPANY_INFO_SUCCESS = 'COMPANY_INFO_SUCCESS'; // 公司-根据id获取单位信息
export const COMPANY_INFO_ERROR = 'COMPANY_INFO_ERROR'; // 公司-根据id获取单位信息
export const COMPANY_ALL_LIST = 'COMPANY_ALL_LIST'; //公司-所有单位信息
export const COMPANY_ALL_LIST_SUCCESS = 'COMPANY_ALL_LIST_SUCCESS'; //公司-所有单位信息
export const COMPANY_ALL_LIST_ERROR = 'COMPANY_ALL_LIST_ERROR'; //公司-所有单位信息
export const COMPANY_ALL_LIST = 'COMPANY_ALL_LIST'; // 公司-所有单位信息
export const COMPANY_ALL_LIST_SUCCESS = 'COMPANY_ALL_LIST_SUCCESS'; // 公司-所有单位信息
export const COMPANY_ALL_LIST_ERROR = 'COMPANY_ALL_LIST_ERROR'; // 公司-所有单位信息
export const COMPANY_SUPERIOR_LIST = 'COMPANY_SUPERIOR_LIST'; //公司-获取所有上级单位集合
export const COMPANY_SUPERIOR_LIST_SUCCESS = 'COMPANY_SUPERIOR_LIST_SUCCESS'; //公司-获取所有上级单位集合
export const COMPANY_SUPERIOR_LIST_ERROR = 'COMPANY_SUPERIOR_LIST_ERROR'; //公司-获取所有上级单位集合
export const COMPANY_EIDT_SPERIOR_LIST = 'COMPANY_EIDT_SPERIOR_LIST'; //公司-编辑时获取上级单位集合
export const COMPANY_EIDT_SPERIOR_LIST_SUCCESS = 'COMPANY_EIDT_SPERIOR_LIST_SUCCESS'; //公司-编辑时获取上级单位集合
export const COMPANY_EIDT_SPERIOR_LIST_ERROR = 'COMPANY_EIDT_SPERIOR_LIST_ERROR'; //公司-编辑时获取上级单位集合
export const COMPANY_SUPERIOR_LIST = 'COMPANY_SUPERIOR_LIST'; // 公司-获取所有上级单位集合
export const COMPANY_SUPERIOR_LIST_SUCCESS = 'COMPANY_SUPERIOR_LIST_SUCCESS'; // 公司-获取所有上级单位集合
export const COMPANY_SUPERIOR_LIST_ERROR = 'COMPANY_SUPERIOR_LIST_ERROR'; // 公司-获取所有上级单位集合
export const COMPANY_EIDT_SPERIOR_LIST = 'COMPANY_EIDT_SPERIOR_LIST'; // 公司-编辑时获取上级单位集合
export const COMPANY_EIDT_SPERIOR_LIST_SUCCESS = 'COMPANY_EIDT_SPERIOR_LIST_SUCCESS'; // 公司-编辑时获取上级单位集合
export const COMPANY_EIDT_SPERIOR_LIST_ERROR = 'COMPANY_EIDT_SPERIOR_LIST_ERROR'; // 公司-编辑时获取上级单位集合
export default function(base) {
let sysUrl = completeSecurityUrl(base);
......@@ -46,78 +45,86 @@ export default function(base) {
* 公司-获取单位级别集合
* @param {string} companyLevels
*/
companyLevelsAction: () => actionCreator({
type: COMPANY_LEVELS,
method: 'get',
url: sysUrl.companyLevels
}),
companyLevelsAction: () =>
actionCreator({
type: COMPANY_LEVELS,
method: 'get',
url: sysUrl.companyLevels
}),
/**
* 公司-单位管理表格信息
* @param {string} companyInfos
*/
companyTableAction: () => actionCreator({
type: COMPANY_TABLE_INFOS,
method: 'get',
url: sysUrl.companyInfos
}),
companyTableAction: () =>
actionCreator({
type: COMPANY_TABLE_INFOS,
method: 'get',
url: sysUrl.companyInfos
}),
/**
* 公司-获取所有上级单位集合
* @param {string} companyInfos
*
*/
superiorUnitAction: () => actionCreator({
type: COMPANY_SUPERIOR_LIST,
method: 'get',
url: sysUrl.superiorUnitUrl
}),
superiorUnitAction: () =>
actionCreator({
type: COMPANY_SUPERIOR_LIST,
method: 'get',
url: sysUrl.superiorUnitUrl
}),
/**
* 公司-编辑时获取上级单位集合
* @param {string} superiorUnitEditUrl
* @param {string} id
*
*/
superiorUnitEditAction: (id) => actionCreator({
type: COMPANY_EIDT_SPERIOR_LIST,
method: 'get',
url: formatUrl(sysUrl.superiorUnitEditUrl, { id })
}),
superiorUnitEditAction: id =>
actionCreator({
type: COMPANY_EIDT_SPERIOR_LIST,
method: 'get',
url: formatUrl(sysUrl.superiorUnitEditUrl, { id })
}),
/**
* 公司-根据id获取单位信息
* @param {string} getCompanyById
* @param {string} id
*
*/
companyInfoAction: (id) => actionCreator({
type: COMPANY_INFO,
method: 'get',
url: formatUrl(sysUrl.getCompanyById, { id })
}),
companyInfoAction: id =>
actionCreator({
type: COMPANY_INFO,
method: 'get',
url: formatUrl(sysUrl.getCompanyById, { id })
}),
/**
* 公司-删除单位信息
*/
companyDelAction: (id) => actionCreator({
type: COMPANY_DEL,
method: 'del',
url: `${sysUrl.delCompany}?ids=${id}`
}),
companyDelAction: id =>
actionCreator({
type: COMPANY_DEL,
method: 'del',
url: `${sysUrl.delCompany}?ids=${id}`
}),
/**
* 公司-添加单位信息
*/
companyAddAction: (obj) => actionCreator({
type: COMPANY_ADD,
method: 'put',
url: sysUrl.addCompany,
data: obj
}),
companyAddAction: obj =>
actionCreator({
type: COMPANY_ADD,
method: 'put',
url: sysUrl.addCompany,
data: obj
}),
/**
* 公司-编辑单位信息
*/
companyEditAction: (obj) => actionCreator({
type: COMPANY_EDIT,
method: 'put',
url: sysUrl.editCompany,
data: obj
})
companyEditAction: obj =>
actionCreator({
type: COMPANY_EDIT,
method: 'put',
url: sysUrl.editCompany,
data: obj
})
};
}
This diff is collapsed.
......@@ -4,38 +4,38 @@ import AsyncLoader from 'ray-code-split';
// import parsePlugin from './parsePlugin';
const AsyncEmptyPage = (props) => <AsyncLoader load={import('./../view/common/page/EmptyPage')} componentProps={props} />;
const AsyncLogin = (props) => <AsyncLoader load={import('./../view/login')} componentProps={props} />;
const AsyncEmptyPage = props => <AsyncLoader load={import('./../view/common/page/EmptyPage')} componentProps={props} />;
const AsyncLogin = props => <AsyncLoader load={import('./../view/login')} componentProps={props} />;
const AsyncRegionList = props => <AsyncLoader load={import('./../view/region')} componentProps={props} />;
// const AsyncUserInfo = (props) => <AsyncLoader load={import('./../view/userInfo')} componentProps={props} />;
const AsyncRootView = (props) => <AsyncLoader load={import('./../view/mainframe')} componentProps={props} />;
const AsyncRootView = props => <AsyncLoader load={import('./../view/mainframe')} componentProps={props} />;
// const AsyncCompany = (props) => <AsyncLoader load={import('./../view/company')} componentProps={props} />;
// const AsyncDepartment = (props) => <AsyncLoader load={import('amos-security/lib/view/department')} componentProps={props} />;
// const AsyncMenu = (props) => <AsyncLoader load={import('amos-security/lib/view/menu')} componentProps={props} />;
// const AsyncRole = (props) => <AsyncLoader load={import('amos-security/lib/view/role')} componentProps={props} />;
// const AsyncSystemDic = (props) => <AsyncLoader load={import('amos-security/lib/view/systemdic')} componentProps={props} />;
// const AsyncUser = (props) => <AsyncLoader load={import('./../view/user')} componentProps={props} />;
const AsyncConfig = (props) => <AsyncLoader load={import('./../view/config')} componentProps={props} />;
const AsyncMonitor = (props) => <AsyncLoader load={import('./../view/monitor')} componentProps={props} />;
const AsyncHistoryAlarm = (props) => <AsyncLoader load={import('./../view/historyAlarm')} componentProps={props} />;
const AsyncRecentAlarm = (props) => <AsyncLoader load={import('./../view/recentAlarm')} componentProps={props} />;
const AsyncRuleDesign = (props) => <AsyncLoader load={import('./../view/ruleDesign')} componentProps={props} />;
const AsyncDeviceCustom = (props) => <AsyncLoader load={import('./../view/deviceCustom')} componentProps={props} />;
const AsyncOnlineMonitor = (props) => <AsyncLoader load={import('./../view/onlineMonitor')} componentProps={props} />;
const AsyncAlarmManage = (props) => <AsyncLoader load={import('./../view/alarmManage')} componentProps={props} />;
const AsyncOverview = (props) => <AsyncLoader load={import('./../view/zonglan/home')} componentProps={props} />;
const AsyncDeviceInterface = (props) => <AsyncLoader load={import('./../view/deviceInterface')} componentProps={props} />;
const AsyncDeviceProtocol = (props) => <AsyncLoader load={import('./../view/deviceProtocol')} componentProps={props} />;
const AsyncDeviceManage = (props) => <AsyncLoader load={import('./../view/deviceManage')} componentProps={props} />;
const AsyncRuleManage = (props) => <AsyncLoader load={import('./../view/ruleManage')} componentProps={props} />;
const AsyncTopoManage = (props) => <AsyncLoader load={import('./../view/topoManage')} componentProps={props} />;
const AsyncKunShan = (props) => <AsyncLoader load={import('./../view/topoManage/KunShan')} componentProps={props} />;
const AsyncHistoricalData = (props) => <AsyncLoader load={import('./../view/historicalData')} componentProps={props} />;
const AsyncCreateEquipment = (props) => <AsyncLoader load={import('./../view/createEquipment')} componentProps={props} />;
const AsyncSectionStoreRoom = (props) => <AsyncLoader load={import('./../view/sectionStoreRoom')} componentProps={props} />;
const AsyncPLCManager = (props) => <AsyncLoader load={import('../view/plcManager')} componentProps={props} />;
const AsyncIECClientManager = (props) => <AsyncLoader load={import('../view/iec/client')} componentProps={props} />;
const AsyncIECMasterManager = (props) => <AsyncLoader load={import('../view/iec/server')} componentProps={props} />;
const AsyncConfig = props => <AsyncLoader load={import('./../view/config')} componentProps={props} />;
const AsyncMonitor = props => <AsyncLoader load={import('./../view/monitor')} componentProps={props} />;
const AsyncHistoryAlarm = props => <AsyncLoader load={import('./../view/historyAlarm')} componentProps={props} />;
const AsyncRecentAlarm = props => <AsyncLoader load={import('./../view/recentAlarm')} componentProps={props} />;
const AsyncRuleDesign = props => <AsyncLoader load={import('./../view/ruleDesign')} componentProps={props} />;
const AsyncDeviceCustom = props => <AsyncLoader load={import('./../view/deviceCustom')} componentProps={props} />;
const AsyncOnlineMonitor = props => <AsyncLoader load={import('./../view/onlineMonitor')} componentProps={props} />;
const AsyncAlarmManage = props => <AsyncLoader load={import('./../view/alarmManage')} componentProps={props} />;
const AsyncOverview = props => <AsyncLoader load={import('./../view/zonglan/home')} componentProps={props} />;
const AsyncDeviceInterface = props => <AsyncLoader load={import('./../view/deviceInterface')} componentProps={props} />;
const AsyncDeviceProtocol = props => <AsyncLoader load={import('./../view/deviceProtocol')} componentProps={props} />;
const AsyncDeviceManage = props => <AsyncLoader load={import('./../view/deviceManage')} componentProps={props} />;
const AsyncRuleManage = props => <AsyncLoader load={import('./../view/ruleManage')} componentProps={props} />;
const AsyncTopoManage = props => <AsyncLoader load={import('./../view/topoManage')} componentProps={props} />;
const AsyncKunShan = props => <AsyncLoader load={import('./../view/topoManage/KunShan')} componentProps={props} />;
const AsyncHistoricalData = props => <AsyncLoader load={import('./../view/historicalData')} componentProps={props} />;
const AsyncCreateEquipment = props => <AsyncLoader load={import('./../view/createEquipment')} componentProps={props} />;
const AsyncSectionStoreRoom = props => <AsyncLoader load={import('./../view/sectionStoreRoom')} componentProps={props} />;
const AsyncPLCManager = props => <AsyncLoader load={import('../view/plcManager')} componentProps={props} />;
const AsyncIECClientManager = props => <AsyncLoader load={import('../view/iec/client')} componentProps={props} />;
const AsyncIECMasterManager = props => <AsyncLoader load={import('../view/iec/server')} componentProps={props} />;
const Routes = {
// ...parsePlugin(),
......@@ -69,7 +69,7 @@ const Routes = {
iec104server: AsyncIECMasterManager
};
const pageCompontent = (key) => {
const pageCompontent = key => {
return Routes[key] || AsyncEmptyPage;
};
......@@ -77,8 +77,8 @@ export {
AsyncLogin,
AsyncRootView,
// AsyncUserInfo,
AsyncOverview
, AsyncRegionList
AsyncOverview,
AsyncRegionList
};
export default pageCompontent;
/**
* 根据用户菜单数据生成对应的路由
* @param {array} menus
......@@ -24,12 +22,12 @@ export default function calcRoutes(menus = [], pageCompontent) {
_itemRoutes = newItemRoutes.childRoutes;
}
}
if (e.children && e.children.length > 0){
if (e.children && e.children.length > 0) {
convertMenus(e.children, itemRoutes.childRoutes, level + 1);
}
resRoutes.push(itemRoutes);
} else {
if (e.children && e.children.length > 0){
if (e.children && e.children.length > 0) {
convertMenus(e.children, resRoutes, level);
}
}
......
......@@ -6,9 +6,7 @@ import StageLayout from './../view/ruleDesign/ruleStatge';
/**
* 系统自定义路由
*/
const customRoutes = [
{ path: 'ruledeploy/:libkey', component: StageLayout, parent: 'ruledesign' }
];
const customRoutes = [{ path: 'ruledeploy/:libkey', component: StageLayout, parent: 'ruledesign' }];
/**
* path mapping
......@@ -25,6 +23,6 @@ export const pathMapping = {
* 将自定义路由添加到主路由上
* @param {*} mainRoutes
*/
const addCustomRoutes = (mainRoutes) => combineRoutes(mainRoutes, customRoutes);
const addCustomRoutes = mainRoutes => combineRoutes(mainRoutes, customRoutes);
export default addCustomRoutes;
......@@ -41,16 +41,16 @@ const Routes = {
monitor: Monitor,
onlineMonitor: OnlineMonitor,
deviceCustom: DeviceCustom,
alarmManage: AlarmManage, //告警管理路由配置
deviceInterface: DeviceInterface, //设备接口路由配置
deviceProtocol: DeviceProtocol, //设备协议路由配置
alarmManage: AlarmManage, // 告警管理路由配置
deviceInterface: DeviceInterface, // 设备接口路由配置
deviceProtocol: DeviceProtocol, // 设备协议路由配置
deviceManage: DeviceManage,
ruleManage: RuleManage, //任务管理路由配置
ruleManage: RuleManage, // 任务管理路由配置
topoManage: TopoManage,
kunshan: KunShan,
historicalData: HistoricalData,
historyAlarm: HistoryAlarm, //历史告警路由配置
recentAlarm: RecentAlarm, //当前告警路由配置
historyAlarm: HistoryAlarm, // 历史告警路由配置
recentAlarm: RecentAlarm, // 当前告警路由配置
ruledesign: RuleDesign,
overview: Overview,
createEquipment: CreateEquipment,
......@@ -60,7 +60,7 @@ const Routes = {
iec104server: IECServer
};
const pageCompontent = (key) => {
const pageCompontent = key => {
return Routes[key] || EmptyPage;
};
......
import formatUrl from 'amos-processor/lib/utils/urlFormat';
import Url from '../consts/urlConsts';
import { IecUrl } from '../consts/urlConsts';
import Url, { IecUrl } from '../consts/urlConsts';
import { commonGet, commonPost, commonDelete, commonPut } from '../utils/request';
/**
* 根据条件查询设备类型
*/
export const fetchTemplateStatisticsAction = (data) => {
export const fetchTemplateStatisticsAction = data => {
return commonPost(Url.fetchTemplateStatistics, data);
};
/**
* 查询设备类型下所有设备
*/
export const fetchTemplatEquipmentsAction = (id,data) => {
export const fetchTemplatEquipmentsAction = (id, data) => {
const url = `${Url.fetchTemplatEquipments}/${id}`;
return commonPost(url,data);
return commonPost(url, data);
};
/**
* 查询设备或模板下所有接口
*/
export const fetchTemplatOrEqpIntfcAction = (eqpTemplId,eqpId) => {
export const fetchTemplatOrEqpIntfcAction = (eqpTemplId, eqpId) => {
eqpId = eqpId === undefined ? 0 : eqpId;
const url = `${Url.fetchTemplatOrEqpIntfc}/${eqpTemplId}/${eqpId}/intfcs`;
return commonGet(url);
......@@ -30,22 +29,22 @@ export const fetchTemplatOrEqpIntfcAction = (eqpTemplId,eqpId) => {
/**
* 编辑设备名称
*/
export const editEquipmentNameAction = (data) => {
return commonPost(Url.editEquipmentName,data);
export const editEquipmentNameAction = data => {
return commonPost(Url.editEquipmentName, data);
};
/**
* 删除设备
*/
export const deleteEquipmentAction = (ids) => {
export const deleteEquipmentAction = ids => {
const url = `${Url.delEquipmentById}`;
return commonDelete(url,ids);
return commonDelete(url, ids);
};
/**
* 删除设备模板
*/
export const deleteEquipmentTemplateAction = (id) => {
export const deleteEquipmentTemplateAction = id => {
const url = `${Url.deleteDeviceById}/${id}`;
return commonDelete(url);
};
......@@ -53,7 +52,7 @@ export const deleteEquipmentTemplateAction = (id) => {
/**
* 获取能力信息
*/
export const fetchCapacityListInfoAction = (id) => {
export const fetchCapacityListInfoAction = id => {
const url = `${Url.fetchCapacityListInfoById}/${id}`;
return commonGet(url);
};
......@@ -61,7 +60,7 @@ export const fetchCapacityListInfoAction = (id) => {
/**
* 查询设备或模板下所有能力
*/
export const fetchTemplatOrEqpQuotaAction = (eqpTemplId,eqpId) => {
export const fetchTemplatOrEqpQuotaAction = (eqpTemplId, eqpId) => {
eqpId = eqpId === undefined ? 0 : eqpId;
const url = `${Url.fetchTemplatOrEqpQuota}/${eqpTemplId}/${eqpId}/cpbls`;
return commonGet(url);
......@@ -70,25 +69,23 @@ export const fetchTemplatOrEqpQuotaAction = (eqpTemplId,eqpId) => {
/**
* 查询设备或模板下所有能力属性
*/
export const fetchTemplatOrEqpQuotaPropertyAction = (eqpId,capId) => {
export const fetchTemplatOrEqpQuotaPropertyAction = (eqpId, capId) => {
eqpId = eqpId === undefined ? 0 : eqpId;
const url = `${Url.fetchTemplatOrEqpQuota}/${eqpId}/${capId}/cpblAttrs`;
return commonGet(url);
};
/**
* 保存设备名称
*/
export const addEditEquipmentAction = (data) => {
return commonPost(Url.addEditEquipment,data);
export const addEditEquipmentAction = data => {
return commonPost(Url.addEditEquipment, data);
};
/**
* 查询设备或模板下所有能力属性
*/
export const fetchAllTemplatOrEqpQuotaPropertyAction = (eqpTemplId,eqpId) => {
export const fetchAllTemplatOrEqpQuotaPropertyAction = (eqpTemplId, eqpId) => {
eqpId = eqpId === undefined ? 0 : eqpId;
const url = `${Url.fetchTemplatOrEqpQuota}/${eqpTemplId}/${eqpId}/eqpCpblAttrs`;
return commonGet(url);
......@@ -97,14 +94,14 @@ export const fetchAllTemplatOrEqpQuotaPropertyAction = (eqpTemplId,eqpId) => {
/**
* 保存设备名称
*/
export const fetchTopoEquipmentAction = (data) => {
return commonPost(Url.getRealDevice,data);
export const fetchTopoEquipmentAction = data => {
return commonPost(Url.getRealDevice, data);
};
/**
* 获取能力下接口
*/
export const fetchCapacityInterfaceAction = (id) => {
export const fetchCapacityInterfaceAction = id => {
const url = `${Url.fetchCapacityInterface}/${id}`;
return commonGet(url);
};
......@@ -112,58 +109,56 @@ export const fetchCapacityInterfaceAction = (id) => {
/**
* 查询拓扑中设备所有配置信息
*/
export const fetchTopoDeviceAction = (id) => {
export const fetchTopoDeviceAction = id => {
const url = `${Url.fetchTopoDevice}/${id}`;
return commonGet(url);
};
export const getChannelByType = (type) => {
const url = formatUrl(IecUrl.channelListUrl, { type } );
export const getChannelByType = type => {
const url = formatUrl(IecUrl.channelListUrl, { type });
return commonGet(url);
};
export const createChannel = (param) => {
export const createChannel = param => {
return commonPost(IecUrl.channelUrl, param);
};
export const deleteChannel = (id) => {
const url = formatUrl(IecUrl.deleteChannelUrl, { id } );
export const deleteChannel = id => {
const url = formatUrl(IecUrl.deleteChannelUrl, { id });
return commonDelete(url);
};
export const getChannelPoint = (channel) => {
const url = formatUrl(IecUrl.channelPointUrl, { channel } );
export const getChannelPoint = channel => {
const url = formatUrl(IecUrl.channelPointUrl, { channel });
return commonGet(url);
};
export const deleteChannelPoint = (channel) => {
const url = formatUrl(IecUrl.channelPointUrl, { channel } );
export const deleteChannelPoint = channel => {
const url = formatUrl(IecUrl.channelPointUrl, { channel });
return commonDelete(url);
};
export const addPoint = (param) => {
export const addPoint = param => {
return commonPost(IecUrl.pointUrl, param);
};
export const deletePoint = (ids) => {
const url = formatUrl(IecUrl.deletePointUrl, { ids } );
export const deletePoint = ids => {
const url = formatUrl(IecUrl.deletePointUrl, { ids });
return commonDelete(url);
};
export const getIecChannelPoint = (channelNo, pointType) => {
const url = formatUrl(IecUrl.iecChannelPointUrl, { channelNo , pointType} );
const url = formatUrl(IecUrl.iecChannelPointUrl, { channelNo, pointType });
return commonGet(url);
};
export const deleteIecChannelPoint = (channelNo, pointType) => {
const url = formatUrl(IecUrl.iecChannelPointUrl, { channelNo, pointType } );
const url = formatUrl(IecUrl.iecChannelPointUrl, { channelNo, pointType });
return commonDelete(url);
};
export const downloadIecTmpl = () => {
let a = document.createElement('a')
let a = document.createElement('a');
a.href = IecUrl.iecDownloadIecTmplUrl;
a.click();
};
\ No newline at end of file
};
......@@ -10,7 +10,7 @@ export const extendSystemAction = () => {
return commonGet(url);
};
export const regionSelectAction = (body) => {
export const regionSelectAction = body => {
let url = formatUrl(secExtUrl.regionSelectUrl);
return commonPost(url, body);
};
......@@ -5,20 +5,20 @@ import { commonGet, commonPost, commonDelete, commonPut } from '../utils/request
/**
* 获取所有的rulelib
*/
export const rulelibListAction = (requestParam) => {
return commonPost(Url.rulelibListUrl,requestParam);
export const rulelibListAction = requestParam => {
return commonPost(Url.rulelibListUrl, requestParam);
};
export const initStageView = (objId) => {
export const initStageView = objId => {
const url = `${Url.initStageViewUrl}/${objId}`;
return commonGet(url);
};
export const saveStageView = (viewData) => {
export const saveStageView = viewData => {
return commonPost(Url.saveStageViewUrl, viewData);
};
export const queryRuleSubObj = (subObjId) => {
export const queryRuleSubObj = subObjId => {
const url = formatUrl(Url.queryRuleSubObjUrl, { subObjId });
return commonGet(url);
};
......@@ -34,7 +34,7 @@ export const queryRuleSubObj = (subObjId) => {
* }
* }
*/
export const addViewNode = (data) => {
export const addViewNode = data => {
return commonPost(Url.addViewNodeUrl, data);
};
......@@ -46,7 +46,7 @@ export const addViewNode = (data) => {
* targetId: '',
* }
*/
export const addViewLink = (data) => {
export const addViewLink = data => {
return commonPost(Url.addViewLinkUrl, data);
};
......@@ -57,7 +57,7 @@ export const addViewLink = (data) => {
* label: ''
* }
*/
export const updateNodeLabel = (data) => {
export const updateNodeLabel = data => {
return commonPut(Url.updateNodeLabelUrl, data);
};
......@@ -65,7 +65,7 @@ export const updateNodeLabel = (data) => {
* 删除元素节点
* @param {string} nodeId
*/
export const delViewNode = (nodeId) => {
export const delViewNode = nodeId => {
const url = `${Url.delViewNodeUrl}/${nodeId}`;
return commonDelete(url);
};
......@@ -73,7 +73,7 @@ export const delViewNode = (nodeId) => {
/**
* 获取对象标签集合
*/
export const queryObjectTagsAction = (objId) => {
export const queryObjectTagsAction = objId => {
const url = formatUrl(Url.queryObjectTagsUrl, { objId });
return commonGet(url);
};
......@@ -81,50 +81,50 @@ export const queryObjectTagsAction = (objId) => {
/**
* 获取对象类型集合
*/
export const queryObjectTypesAction = (objId) => {
export const queryObjectTypesAction = objId => {
const url = formatUrl(Url.queryObjectTypesUrl, { objId });
return commonGet(url);
};
/**
* 删除子对象
*/
export const removeSubObjectAction = (subObjId) => {
* 删除子对象
*/
export const removeSubObjectAction = subObjId => {
const url = `${Url.removeObjUrl}/${subObjId}`;
return commonDelete(url);
};
/**
* 启用/停用子对象
*/
export const startUseSubObjectAction = (subObjId) => {
* 启用/停用子对象
*/
export const startUseSubObjectAction = subObjId => {
const url = `${Url.changeRule}/${subObjId}`;
return commonPut(url);
};
/**
* 启用/停用对象
*/
export const startUseObjectAction = (status) => {
* 启用/停用对象
*/
export const startUseObjectAction = status => {
const url = `${Url.changeAllRule}/${status}`;
return commonPut(url);
};
/**
* 添加对象
*/
export const addSubObjectAction = (subObject) => {
* 添加对象
*/
export const addSubObjectAction = subObject => {
const url = formatUrl(Url.addSingleRule);
return commonPost(url, subObject);
};
/**
* 编辑对象
*/
export const updateSubObjectAction = (subObject) => {
* 编辑对象
*/
export const updateSubObjectAction = subObject => {
const url = formatUrl(Url.editSingleRule);
return commonPut(url, subObject);
};
/**
* 获取触发规则对象根据触发器元素id
*/
export const queryTriggerRuleAction = (elementId) => {
* 获取触发规则对象根据触发器元素id
*/
export const queryTriggerRuleAction = elementId => {
const url = formatUrl(Url.queryTriggerUrl, { elementId });
return commonGet(url);
};
......@@ -136,11 +136,11 @@ export const queryTriggerRuleAction = (elementId) => {
* label: ''
* }
*/
export const updateNode = (data) => {
export const updateNode = data => {
return commonPut(Url.updateNodeUrl, data);
};
export const fetchNodeConfigAction = (nodeId) => {
export const fetchNodeConfigAction = nodeId => {
const url = `${Url.fetchNodeConfig}/${nodeId}`;
return commonGet(url);
};
......
......@@ -6,6 +6,6 @@ import { commonGet, commonPost, commonDelete, commonPut } from '../utils/request
* 条件查询插件
* @param {*} param
*/
export const getSectionsByParamAction = (param) => {
export const getSectionsByParamAction = param => {
return commonPost(Url.getSectionsByParam, param);
};
......@@ -22,7 +22,7 @@ export const getPermissionsCompany = () => {
* 获取当前角色权限菜单
* @param {*} roleSeq 角色Id
*/
export const getPermissionsMenus = (roleSeq) => {
export const getPermissionsMenus = roleSeq => {
return commonGet(formatUrl(secExtUrl.permissionsMenusUrl, { roleSeq }));
};
......
......@@ -12,7 +12,7 @@ export const subViewListAction = () => {
/**
* 获取视图下设备
*/
export const subEgpListAction = (name) => {
export const subEgpListAction = name => {
const url = `${Url.fetchSubgraphEquipments}/${name}`;
return commonGet(url);
};
......@@ -20,16 +20,15 @@ export const subEgpListAction = (name) => {
/**
* 获取视图下设备
*/
export const fetchSubEgpListAction = (id) => {
export const fetchSubEgpListAction = id => {
const url = `${Url.fetchSingleSubgraphEquipments}/${id}`;
return commonGet(url);
};
/**
* 根据公司orgCode获取下属视图
*/
export const subviewByOrgCodeAction = (orgCode) => {
export const subviewByOrgCodeAction = orgCode => {
const url = `${Url.getSubviewByOrgCode}/${orgCode}`;
return commonGet(url);
};
......@@ -37,23 +36,22 @@ export const subviewByOrgCodeAction = (orgCode) => {
/**
* 根据公司id获取公司信息
*/
export const fetchCompanyById = (id) => {
export const fetchCompanyById = id => {
const url = `${Url.fetchCompanyById}/${id}`;
return commonGet(url);
};
/**
* 编辑公司背景
*/
export const editOrgImgAction = (param) => {
export const editOrgImgAction = param => {
return commonPost(Url.editOrgImgUrl, param);
};
/**
* 获取公司背景
*/
export const fetchOrgImgsAction = (orgCode) => {
export const fetchOrgImgsAction = orgCode => {
const url = `${Url.fetchOrgImgs}/${orgCode}`;
return commonGet(url);
};
......@@ -61,44 +59,43 @@ export const fetchOrgImgsAction = (orgCode) => {
/**
* 获取公司背景
*/
export const fetchSimpleOrgImgsAction = (orgCode) => {
export const fetchSimpleOrgImgsAction = orgCode => {
const url = `${Url.fetchSimpleOrgImgs}/${orgCode}`;
return commonGet(url);
};
/**
* 编辑视图背景
* @param {*} param
*/
export const editSubviewImgAction = (param) => {
export const editSubviewImgAction = param => {
return commonPost(Url.editSubviewImg, param);
};
/**
* 保存/编辑视图信息
*/
export const editSubviewAction = (param) => {
export const editSubviewAction = param => {
return commonPost(Url.addSubgraph, param);
};
/**
* 更新视图名称
*/
export const updateEquipmentNameAction = (param) => {
export const updateEquipmentNameAction = param => {
return commonPost(Url.updateNodeName, param);
};
/**
* 更新设备配置信息
*/
export const updateEquipmentConfigAction = (param) => {
export const updateEquipmentConfigAction = param => {
return commonPost(Url.updateEquipmentConfig, param);
};
/**
* 新增编辑设备图片
*/
export const addeEditEqpImgAction = (data) => {
return commonPost(Url.addeEditEqpImg,data);
export const addeEditEqpImgAction = data => {
return commonPost(Url.addeEditEqpImg, data);
};
......@@ -2,12 +2,13 @@
* 系统store
* @author fe-tiangonglei
*/
import { createStore, applyMiddleware, compose } from 'redux';
import { createStore, applyMiddleware } from 'redux';
import thunkMiddleware from 'redux-thunk';
import createLogger from 'redux-logger';
// 导入中间件
import promiseMiddleware from 'amos-processor/lib/middleware/promiseMiddleware';
import amosFetchMiddleware from 'amos-processor/lib/middleware/amosFetchMiddleware';
import { smartStore, simpleStore } from 'amos-processor/lib/redux/storeCreator';
// 已经合并多个reducers
import rootReducers from './../model/reducers';
......@@ -16,29 +17,16 @@ import rootReducers from './../model/reducers';
* 创建一个 Redux store 来以存放应用中所有的 state,应用中应有且仅有一个 store。
* 基本使用
*/
export const store = createStore(rootReducers);
export const store = simpleStore(rootReducers);
/**
* dev store 结合 redux-devtools-extension,需要浏览器支持,添加redux-devtools插件即可
* @param {object} initialState
*/
export const configureStoreWithDev = (initialState) => {
const composeEnhancers = typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
// Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
}) : compose;
const enhancer = composeEnhancers(
applyMiddleware(
thunkMiddleware,
promiseMiddleware({ promiseTypeSuffixes: ['PENDING', 'SUCCESS', 'ERROR'] }),
amosFetchMiddleware(),
createLogger()
)
);
const store = createStore(rootReducers, initialState, enhancer);
export const configureStoreWithDev = initialState => smartStore(rootReducers, initialState, [
promiseMiddleware({ promiseTypeSuffixes: ['PENDING', 'SUCCESS', 'ERROR'] }),
amosFetchMiddleware()
], (store) => {
// if (module.hot) {
// // Enable Webpack hot module replacement for reducers
// module.hot.accept('../model/reducers', () => {
......@@ -46,8 +34,7 @@ export const configureStoreWithDev = (initialState) => {
// store.replaceReducer(nextRootReducer);
// });
// }
return store;
};
});
// 创建一个带中间件的store
const createStoreWithMiddleware = applyMiddleware(
......@@ -62,7 +49,6 @@ const createStoreWithMiddleware = applyMiddleware(
* @param {object} initialState
*/
export default function configureStore(initialState) {
const store = createStoreWithMiddleware(rootReducers, initialState);
return store;
const _store = createStoreWithMiddleware(rootReducers, initialState);
return _store;
}
// 导入第三方
@import "~amos-antd/dist/amosantd.css";
@import '~amos-antd/dist/amosantd.css';
// 导入 framework
@import "~amos-framework/dist/amosframework.css";
@import "~amos-pro/dist/amospro.css";
@import "~amos-devgrid/dist/amosdevgrid.css";
@import '~amos-framework/dist/amosframework.css';
@import '~amos-pro/dist/amospro.css';
@import '~amos-devgrid/dist/amosdevgrid.css';
@import "./variable/config.scss";
@import "./variable/default.scss";
@import "core";
@import "icon";
@import "progress";
@import './variable/config.scss';
@import './variable/default.scss';
@import 'core';
@import 'icon';
@import 'progress';
html {
box-sizing: border-box;
......@@ -46,7 +46,7 @@ h3 {
}
a {
color: #42A5F5;
color: #42a5f5;
text-decoration: none;
&:hover {
......@@ -79,8 +79,8 @@ a {
#app {
width: 100%;
height: 100%;
.ant-layout-has-sider{
.ant-layout{
.ant-layout-has-sider {
.ant-layout {
width: calc(100% - 180px);
}
}
......
......@@ -15,7 +15,7 @@
&:hover {
.element-editor {
background-color: rgba(white, 0.3);
box-shadow: 0 0 0 1px rgba(#CCC, 0.3);
box-shadow: 0 0 0 1px rgba(#ccc, 0.3);
}
}
}
......
@import "./vars.scss";
@import './vars.scss';
.rule-header {
width: 100%;
......
@import "./common.scss";
@import "./header.scss";
@import "./ruleDesign.scss";
@import "./ruleDeploy.scss";
@import "./ruleDeployConfig.scss";
@import "./ruleTree.scss";
@import "./plumb.scss";
@import "./topo/index.scss";
@import "./triggerEditor.scss";
@import './common.scss';
@import './header.scss';
@import './ruleDesign.scss';
@import './ruleDeploy.scss';
@import './ruleDeployConfig.scss';
@import './ruleTree.scss';
@import './plumb.scss';
@import './topo/index.scss';
@import './triggerEditor.scss';
@import "~amos-jsplumb/assets/index.scss";
@import '~amos-jsplumb/assets/index.scss';
$lime: lime;
$lime-tint: rgba($lime, 0.65);
$actionlist: #AADF45;
$actionlist: #aadf45;
%node-custom-container {
@extend %node-container;
......@@ -47,8 +47,6 @@ $actionlist: #AADF45;
}
}
.node-content {
flex: 1;
font-size: 20px;
......@@ -63,7 +61,7 @@ $actionlist: #AADF45;
@extend %node-custom-container;
&.node-wrapper-active {
border: 2px dashed #BBB;
border: 2px dashed #bbb;
}
.ele-node-icon {
......@@ -126,7 +124,7 @@ $actionlist: #AADF45;
// 数据源
.data-node-ele {
@include make-giot-node(12.13rem, 2.05rem, "././../../assets/iot/rule/ele-item-datanode.png");
@include make-giot-node(12.13rem, 2.05rem, '././../../assets/iot/rule/ele-item-datanode.png');
.node-content-wrapper {
@extend %node-custom-container;
......@@ -143,16 +141,16 @@ $actionlist: #AADF45;
width: 12.13rem;
height: 3.2rem;
cursor: move;
background:url("././../../assets/iot/rule/ele-item-datanode.png") no-repeat;
background: url('././../../assets/iot/rule/ele-item-datanode.png') no-repeat;
background-size: 100% 100%;
&:hover {
border: 2px solid 1rem;
border: 2px solid 1rem;
}
}
// 告警节点
.alarm-node-ele {
@include make-giot-node(12.13rem, 2.05rem, "././../../assets/iot/rule/ele-item-alarm.png");
@include make-giot-node(12.13rem, 2.05rem, '././../../assets/iot/rule/ele-item-alarm.png');
.node-content-wrapper {
@extend %node-custom-container;
......@@ -169,16 +167,16 @@ $actionlist: #AADF45;
width: 12.13rem;
height: 3.2rem;
cursor: move;
background:url("././../../assets/iot/rule/ele-item-alarm.png") no-repeat;
background: url('././../../assets/iot/rule/ele-item-alarm.png') no-repeat;
background-size: 100% 100%;
&:hover {
border: 2px solid 1rem;
border: 2px solid 1rem;
}
}
// 输出节点
.output-node-ele {
@include make-giot-node(12.13rem, 2.05rem, "././../../assets/iot/rule/ele-item-output.png");
@include make-giot-node(12.13rem, 2.05rem, '././../../assets/iot/rule/ele-item-output.png');
.node-content-wrapper {
@extend %node-custom-container;
......@@ -195,10 +193,10 @@ $actionlist: #AADF45;
width: 12.13rem;
height: 3.2rem;
cursor: move;
background:url("././../../assets/iot/rule/ele-item-output.png") no-repeat;
background: url('././../../assets/iot/rule/ele-item-output.png') no-repeat;
background-size: 100% 100%;
&:hover {
border: 2px solid 1rem;
border: 2px solid 1rem;
}
}
......
@import "./vars.scss";
@import './vars.scss';
$rule-prop-bar-border: #797979;
$rule-prop-bar-bg: #FAFAFA;
$rule-prop-bar-bg: #fafafa;
$header-bg-color: linear-gradient(180deg, rgba(216, 216, 216, 1) 0%, rgba(216, 216, 216, 1) 0%, rgba(228, 228, 228, 1) 100%, rgba(228, 228, 228, 1) 100%);
.rule-layout {
......@@ -45,7 +45,7 @@ $header-bg-color: linear-gradient(180deg, rgba(216, 216, 216, 1) 0%, rgba(216, 2
line-height: 40px;
margin-left: 10%;
border: 1px solid #deddde;
color: #345FA6;
color: #345fa6;
background: -webkit-gradient(linear, left top, left bottom, from(#e4e4e4), color-stop(0%, #e4e4e4), color-stop(100%, #f2f2f2), to(#f2f2f2));
background: linear-gradient(180deg, #e4e4e4 0%, #e4e4e4 0%, #f2f2f2 100%, #f2f2f2 100%);
border-radius: 4px 4px 0 0;
......@@ -75,7 +75,7 @@ $header-bg-color: linear-gradient(180deg, rgba(216, 216, 216, 1) 0%, rgba(216, 2
.rule-scene {
height: calc(100% - 3rem);
background: url("../../assets/iot/rule/default-scene.png") repeat;
background: url('../../assets/iot/rule/default-scene.png') repeat;
background-color: $grey-tint;
}
}
......@@ -110,7 +110,7 @@ $header-bg-color: linear-gradient(180deg, rgba(216, 216, 216, 1) 0%, rgba(216, 2
padding-left: 1rem;
font-size: 16px;
line-height: 2.8rem;
background: #E9E9E9;
background: #e9e9e9;
}
.property-content {
......@@ -157,17 +157,17 @@ $header-bg-color: linear-gradient(180deg, rgba(216, 216, 216, 1) 0%, rgba(216, 2
}
.ele-item-datanode {
background: url("./../../assets/iot/rule/ele-item-datanode-prop.png") no-repeat;
background: url('./../../assets/iot/rule/ele-item-datanode-prop.png') no-repeat;
}
.ele-item-alarm {
background: url("./../../assets/iot/rule/ele-item-alarm-prop.png") no-repeat;
background: url('./../../assets/iot/rule/ele-item-alarm-prop.png') no-repeat;
}
.ele-item-output {
background: url("./../../assets/iot/rule/ele-item-output-prop.png") no-repeat;
background: url('./../../assets/iot/rule/ele-item-output-prop.png') no-repeat;
}
.ele-item-requestresponse {
background: url("./../../assets/iot/rule/ele-item-requestresponse-prop.png") no-repeat;
background: url('./../../assets/iot/rule/ele-item-requestresponse-prop.png') no-repeat;
}
......@@ -18,10 +18,9 @@
text-align: center;
background: white;
border: 1px solid lightgray;
border-bottom: 2px solid #345FA6;
border-bottom: 2px solid #345fa6;
}
%head-two {
height: 0;
......@@ -29,7 +28,7 @@
width: 18rem;
height: 30px;
text-align: center;
background: linear-gradient(180deg, white 0%, white 0%, #E4E4E4 100%, #E4E4E4 100%);
background: linear-gradient(180deg, white 0%, white 0%, #e4e4e4 100%, #e4e4e4 100%);
border-right: 1px solid #797979;
border-bottom: 1px solid #797979;
}
......@@ -43,7 +42,7 @@
font-size: 15px;
line-height: 30px;
text-align: center;
background: linear-gradient(270deg, white 0%, #F2F2F2 0%, #E4E4E4 100%, white 100%);
background: linear-gradient(270deg, white 0%, #f2f2f2 0%, #e4e4e4 100%, white 100%);
border: 1px solid #797979;
&:hover {
......@@ -62,8 +61,8 @@
line-height: 30px;
color: white;
text-align: center;
background: #345FA6;
border: 1px solid #345FA6;
background: #345fa6;
border: 1px solid #345fa6;
border-radius: 20px;
&:hover {
......@@ -83,8 +82,8 @@
line-height: 29px;
color: white;
text-align: center;
background: #345FA6;
border: 1px solid #345FA6;
background: #345fa6;
border: 1px solid #345fa6;
border-radius: 20px;
&:hover {
......@@ -105,7 +104,7 @@
float: left;
width: 100%;
height: 100%;
background-color: #E4E4E4;
background-color: #e4e4e4;
border: 1px solid gray;
.ant-select-selection {
......@@ -138,7 +137,6 @@
}
}
.control-panel {
width: 100%;
height: 36px;
......@@ -247,5 +245,3 @@
}
}
}
@import "./vars.scss";
@import './vars.scss';
.rule-manage-root {
float: right;
......@@ -12,7 +12,7 @@
font-size: 1.2rem;
line-height: 50px;
color: black;
background: #E3E3E3;
background: #e3e3e3;
.rule-lib-header-content {
.rule-lib-header-left {
......@@ -24,7 +24,6 @@
}
}
.rule-lib-design {
width: 100%;
height: 100%;
......@@ -72,7 +71,7 @@
border-bottom-left-radius: 0;
&:hover {
box-shadow: 0 0 5px 3px #B4B4B4;
box-shadow: 0 0 5px 3px #b4b4b4;
}
.rule-lib-item-title {
......@@ -91,7 +90,7 @@
right: 0;
width: 2.5rem;
height: 100%;
background: #2572B3;
background: #2572b3;
border-radius: 0 1rem 0 0;
&:hover {
......@@ -103,7 +102,7 @@
.rule-lib-item-content {
display: flex;
height: calc(100% - 2.5rem);
background: #DBDBDB;
background: #dbdbdb;
flex-direction: column;
-webkit-transition: height 1s;
-moz-transition: height 1s;
......@@ -130,26 +129,26 @@
width: 100%;
height: calc(100% - 2.5rem);
overflow: hidden;
background: #DBDBDB;
background: #dbdbdb;
}
.rule-operate-row {
width: 100%;
height: 57px;
background-color: #EDEDED;
border-bottom: 1px solid #345FA6;
background-color: #ededed;
border-bottom: 1px solid #345fa6;
.rule-operate-cell {
width: 100%;
height: 100%;
font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
font-family: 'Microsoft Sans Serif Bold', 'Microsoft Sans Serif Normal', 'Microsoft Sans Serif';
font-size: 14px;
font-style: normal;
font-weight: 700;
line-height: 57px;
color: rgb(52, 95, 166);
text-align: center;
border-right: 1px solid #345FA6;
border-right: 1px solid #345fa6;
.obj-publish-switch {
width: 100%;
......@@ -161,7 +160,7 @@
.amos-switch-inner {
padding-left: 7px;
font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
font-family: 'Microsoft Sans Serif Bold', 'Microsoft Sans Serif Normal', 'Microsoft Sans Serif';
font-size: 14px;
font-style: normal;
font-weight: 700;
......@@ -178,7 +177,7 @@
.amos-switch-inner {
padding-left: 7px;
font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
font-family: 'Microsoft Sans Serif Bold', 'Microsoft Sans Serif Normal', 'Microsoft Sans Serif';
font-size: 14px;
font-style: normal;
font-weight: 700;
......@@ -201,7 +200,7 @@
.amos-switch-checked {
.amos-switch-inner {
padding-left: 24px;
font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
font-family: 'Microsoft Sans Serif Bold', 'Microsoft Sans Serif Normal', 'Microsoft Sans Serif';
font-size: 14px;
font-style: normal;
font-weight: 700;
......@@ -223,7 +222,7 @@
.rule-operate-cell-right {
width: 100%;
height: 100%;
font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
font-family: 'Microsoft Sans Serif Bold', 'Microsoft Sans Serif Normal', 'Microsoft Sans Serif';
font-size: 14px;
font-style: normal;
font-weight: 700;
......@@ -241,7 +240,7 @@
.amos-switch-inner {
padding-left: 7px;
font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
font-family: 'Microsoft Sans Serif Bold', 'Microsoft Sans Serif Normal', 'Microsoft Sans Serif';
font-size: 14px;
font-style: normal;
font-weight: 700;
......@@ -258,7 +257,7 @@
.amos-switch-inner {
padding-left: 7px;
font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
font-family: 'Microsoft Sans Serif Bold', 'Microsoft Sans Serif Normal', 'Microsoft Sans Serif';
font-size: 14px;
font-style: normal;
font-weight: 700;
......@@ -281,7 +280,7 @@
.amos-switch-checked {
.amos-switch-inner {
padding-left: 24px;
font-family: "Microsoft Sans Serif Bold", "Microsoft Sans Serif Normal", "Microsoft Sans Serif";
font-family: 'Microsoft Sans Serif Bold', 'Microsoft Sans Serif Normal', 'Microsoft Sans Serif';
font-size: 14px;
font-style: normal;
font-weight: 700;
......@@ -315,7 +314,7 @@
border-color: rgba(52, 95, 166, 1);
border-style: solid;
border-width: 3px;
box-shadow: 0 0 5px 3px #B4B4B4;
box-shadow: 0 0 5px 3px #b4b4b4;
.rule-lib-item-content {
height: 0;
......@@ -359,7 +358,7 @@
right: 0;
width: 2.5rem;
height: 100%;
background: #2572B3;
background: #2572b3;
border-radius: 0 1rem 0 0;
&:hover {
......@@ -379,7 +378,7 @@
z-index: 1;
display: flex;
height: 100%;
background: #DBDBDB;
background: #dbdbdb;
flex-direction: column;
-webkit-transition: height 1s;
-moz-transition: height 1s;
......@@ -390,12 +389,12 @@
height: 9rem;
padding: 1rem 1rem 0 0.5rem;
margin: 9px;
border: 1px solid #345FA6;
border: 1px solid #345fa6;
.item-photo-inner {
width: 100%;
height: 100%;
background: url("./../../assets/iot/rule/topology.png") no-repeat;
background: url('./../../assets/iot/rule/topology.png') no-repeat;
}
}
......@@ -440,7 +439,7 @@
}
.amos-modal-header {
background-color: #345FA6;
background-color: #345fa6;
.amos-modal-title {
color: white;
......@@ -466,8 +465,8 @@
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #FFFFFF;
background-color: #E3E3E3;
color: #ffffff;
background-color: #e3e3e3;
border-radius: 61px;
text-align: center;
line-height: 30px;
......@@ -488,8 +487,8 @@
font-weight: 700;
font-style: normal;
font-size: 15px;
color: #FFFFFF;
background-color: #345FA6;
color: #ffffff;
background-color: #345fa6;
border-radius: 61px;
text-align: center;
line-height: 30px;
......
$topo-bg: inear-gradient(180deg, #D8D8D8, #D8D8D8 0, #E4E4E4 100%, #E4E4E4 0);
$topo-border-color: #ABA8A8;
$topo-bg: inear-gradient(180deg, #d8d8d8, #d8d8d8 0, #e4e4e4 100%, #e4e4e4 0);
$topo-border-color: #aba8a8;
.rule-tree {
float: left;
......@@ -41,20 +41,20 @@ $topo-border-color: #ABA8A8;
}
.ant-tree-switcher_open {
font-family: "amosicon" !important;
font-family: 'amosicon' !important;
font-size: 1.4rem;
&::after {
content: "\e6f9";
content: '\e6f9';
}
}
.ant-tree-switcher_close {
font-family: "amosicon" !important;
font-family: 'amosicon' !important;
font-size: 1.4rem;
&::after {
content: "\e6e7";
content: '\e6e7';
}
}
......@@ -65,11 +65,11 @@ $topo-border-color: #ABA8A8;
}
.ant-tree-switcher_close {
font-family: "amosicon" !important;
font-family: 'amosicon' !important;
font-size: 1.4rem;
&::after {
content: "\e6e7";
content: '\e6e7';
}
}
}
......
@import "./node.scss";
@import "./topo.scss";
@import "./topotree.scss";
@import "./nodelib.scss";
@import './node.scss';
@import './topo.scss';
@import './topotree.scss';
@import './nodelib.scss';
@import "~amos-jsplumb/assets/index.scss";
$node-title-color: #EFEFEF;
$default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpBQjkzMjk3RDAxQ0MxMUU4QTYzQUE3MDNCNkQ2M0MzOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpBQjkzMjk3RTAxQ0MxMUU4QTYzQUE3MDNCNkQ2M0MzOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkFCOTMyOTdCMDFDQzExRThBNjNBQTcwM0I2RDYzQzM5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkFCOTMyOTdDMDFDQzExRThBNjNBQTcwM0I2RDYzQzM5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+mn17wgAAABxJREFUeNpivH37NgMpgImBRDCqYVTD0NEAEGAAC3YCsayESVIAAAAASUVORK5CYII=";
@import '~amos-jsplumb/assets/index.scss';
$node-title-color: #efefef;
$default-img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpBQjkzMjk3RDAxQ0MxMUU4QTYzQUE3MDNCNkQ2M0MzOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpBQjkzMjk3RTAxQ0MxMUU4QTYzQUE3MDNCNkQ2M0MzOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkFCOTMyOTdCMDFDQzExRThBNjNBQTcwM0I2RDYzQzM5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkFCOTMyOTdDMDFDQzExRThBNjNBQTcwM0I2RDYzQzM5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+mn17wgAAABxJREFUeNpivH37NgMpgImBRDCqYVTD0NEAEGAAC3YCsayESVIAAAAASUVORK5CYII=';
.custom-node-popover {
.ant-popover-inner-content {
......@@ -23,12 +23,11 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
border-style: solid;
border-width: 2px;
border-radius: 5px;
content: "";
content: '';
}
}
}
%element-cell-style {
width: 50px;
height: 50px;
......@@ -38,7 +37,7 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
width: 100%;
height: 100%;
color: black;
border: 1px solid #345FA6;
border: 1px solid #345fa6;
}
.element-bar {
......@@ -169,7 +168,7 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
height: 26px;
padding-top: 2px;
padding-left: 10px;
background: #F2F2F2;
background: #f2f2f2;
border-radius: 9px;
-webkit-box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.34902);
box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.34902);
......@@ -186,7 +185,7 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
height: 26px;
padding-top: 2px;
padding-left: 10px;
background: #F2F2F2;
background: #f2f2f2;
border-radius: 9px;
-webkit-box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.34902);
box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.34902);
......@@ -204,7 +203,7 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
// z-index: 1;
width: 137px;
height: 26px;
background: #F2F2F2;
background: #f2f2f2;
border-radius: 9px;
box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.34902);
......@@ -249,17 +248,17 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
&:focus {
outline: none;
box-shadow: 1px 1px 8px 1px #345FA6;
box-shadow: 1px 1px 8px 1px #345fa6;
}
&:hover {
border: 5px solid rgba(255, 0, 0, 0);
box-shadow: 1px 1px 8px 1px #345FA6;
box-shadow: 1px 1px 8px 1px #345fa6;
}
}
.giot-ele {
@include make-giot-node(100px, 70px, "./../../assets/iot/topo/giot.png");
@include make-giot-node(100px, 70px, './../../assets/iot/topo/giot.png');
top: 250px;
left: 200px;
......@@ -277,12 +276,12 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
width: 1em;
height: 1em;
cursor: pointer;
background-color: #345FA6;
box-shadow: 0 0 2px #345FA6;
background-color: #345fa6;
box-shadow: 0 0 2px #345fa6;
transition: box-shadow 0.25s ease-in;
&:hover {
box-shadow: 0 0 6px #345FA6;
box-shadow: 0 0 6px #345fa6;
}
}
}
......@@ -336,7 +335,7 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
width: 137px;
height: 26px;
border-radius: 9px;
background: #F2F2F2;
background: #f2f2f2;
&:first-child {
width: 20px;
......@@ -414,12 +413,12 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
width: 1em;
height: 1em;
cursor: pointer;
background-color: #345FA6;
box-shadow: 0 0 2px #345FA6;
background-color: #345fa6;
box-shadow: 0 0 2px #345fa6;
transition: box-shadow 0.25s ease-in;
&:hover {
box-shadow: 0 0 6px #345FA6;
box-shadow: 0 0 6px #345fa6;
}
}
......@@ -431,12 +430,12 @@ $default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg
width: 1em;
height: 1em;
cursor: pointer;
background-color: #345FA6;
box-shadow: 0 0 2px #345FA6;
background-color: #345fa6;
box-shadow: 0 0 2px #345fa6;
transition: box-shadow 0.25s ease-in;
&:hover {
box-shadow: 0 0 6px #345FA6;
box-shadow: 0 0 6px #345fa6;
}
.node-action {
......
.nodelib-list {
padding: 0.5rem 1rem;
......@@ -11,7 +10,6 @@
cursor: move;
.nodelib-item-pic {
}
.nodelib-item-text {
......
@import "./../vars.scss";
@import './../vars.scss';
$border-color: #797979;
$left-border-color: #9C9C9C;
$left-bg: #FAFAFA;
$left-border-color: #9c9c9c;
$left-bg: #fafafa;
$header-bg-color: linear-gradient(180deg, rgba(216, 216, 216, 1) 0%, rgba(216, 216, 216, 1) 0%, rgba(228, 228, 228, 1) 100%, rgba(228, 228, 228, 1) 100%);
%header-extra-item {
......@@ -31,7 +31,7 @@ $header-bg-color: linear-gradient(180deg, rgba(216, 216, 216, 1) 0%, rgba(216, 2
// 昆山
.kunshan-topo-content {
height: calc(100% - 3rem);
background: url("../../assets/iot/topo/kunshan.png") no-repeat;
background: url('../../assets/iot/topo/kunshan.png') no-repeat;
background-color: $grey-tint;
background-size: 100% 100%;
}
......@@ -77,7 +77,7 @@ $header-bg-color: linear-gradient(180deg, rgba(216, 216, 216, 1) 0%, rgba(216, 2
height: 2rem;
line-height: 2rem;
text-align: center;
background: #DDE4E5;
background: #dde4e5;
}
.container-inner {
......
......@@ -18,20 +18,20 @@
}
.ant-tree-switcher_open {
font-family: "amosicon" !important;
font-family: 'amosicon' !important;
font-size: 1.4rem;
&::after {
content: "\e6f9";
content: '\e6f9';
}
}
.ant-tree-switcher_close {
font-family: "amosicon" !important;
font-family: 'amosicon' !important;
font-size: 1.4rem;
&::after {
content: "\e6e7";
content: '\e6e7';
}
}
......@@ -42,7 +42,7 @@
}
.ant-tree-switcher_close {
font-family: "amosicon" !important;
font-family: 'amosicon' !important;
font-size: 1.4rem;
}
}
......
$tabs-topbar-bg-color: linear-gradient(180deg, white 0%, white 0%, rgba(228, 228, 228, 1) 100%, rgba(228, 228, 228, 1) 100%);
$trigger-border: 1px solid #797979;
$trigger-border-color: #797979;
$trigger-bg-color: #D8D8D8;
$trigger-bg-color: #d8d8d8;
.trigger-editor-content {
height: 100%;
......@@ -64,7 +63,7 @@ $trigger-bg-color: #D8D8D8;
.trigger-editor-attribute {
position: relative;
height: calc(100% - 17.4rem);
background: #F1F1F1;
background: #f1f1f1;
border: 1px solid #797979;
border-top: 0;
......@@ -86,7 +85,7 @@ $trigger-bg-color: #D8D8D8;
border: solid transparent;
border-left-color: $trigger-border-color;
border-width: 1.5rem;
content: "";
content: '';
}
&::after {
......@@ -97,9 +96,9 @@ $trigger-bg-color: #D8D8D8;
width: 0;
height: 5;
border: solid transparent;
border-left-color: #EFEFEF;
border-left-color: #efefef;
border-width: calc(1.5rem - 1px);
content: "";
content: '';
}
}
......@@ -172,7 +171,7 @@ $trigger-bg-color: #D8D8D8;
.amos-tabs-tabitem-inner {
padding: 0.22rem 1rem;
color: black;
background-color: #F1F1F1;
background-color: #f1f1f1;
border-radius: 0.8rem 0.8rem 0 0;
}
}
......@@ -182,7 +181,7 @@ $trigger-bg-color: #D8D8D8;
.amos-tabs-panel {
min-height: 60px;
padding: 10px;
background: #F1F1F1;
background: #f1f1f1;
border: 1px solid #999;
}
}
......@@ -194,7 +193,7 @@ $trigger-bg-color: #D8D8D8;
padding-left: 1rem;
line-height: 2.2rem;
text-align: right;
background: #DDE4E5;
background: #dde4e5;
border-bottom: $trigger-border;
> span {
......@@ -225,7 +224,7 @@ $trigger-bg-color: #D8D8D8;
width: 100%;
height: calc(100% - 2.2rem);
overflow-y: scroll;
background: #E4E4E4;
background: #e4e4e4;
.trigger-stem {
display: flex;
......@@ -292,21 +291,21 @@ $trigger-bg-color: #D8D8D8;
margin-right: 1.7rem;
line-height: 2.4rem;
text-align: center;
background-color: #CCC;
background-color: #ccc;
border-right: 0;
&.trigger-breadcrumb-active {
color: white;
background-color: #F90;
background-color: #f90;
&::before {
position: absolute;
top: 0;
left: -1.2rem;
border-top: calc(1.2rem - 1px) solid #F90;
border-bottom: 1.2rem solid #F90;
border-top: calc(1.2rem - 1px) solid #f90;
border-bottom: 1.2rem solid #f90;
border-left: 1.2rem solid transparent;
content: "";
content: '';
}
&::after {
......@@ -315,8 +314,8 @@ $trigger-bg-color: #D8D8D8;
right: -1.2rem;
border-top: 1.2rem solid transparent;
border-bottom: 1.2rem solid transparent;
border-left: 1.2rem solid #F90;
content: "";
border-left: 1.2rem solid #f90;
content: '';
}
}
......@@ -324,10 +323,10 @@ $trigger-bg-color: #D8D8D8;
position: absolute;
top: 0;
left: -1.2rem;
border-top: calc(1.2rem - 1px) solid #CCC;
border-bottom: 1.2rem solid #CCC;
border-top: calc(1.2rem - 1px) solid #ccc;
border-bottom: 1.2rem solid #ccc;
border-left: 1.2rem solid transparent;
content: "";
content: '';
}
&::after {
......@@ -336,8 +335,8 @@ $trigger-bg-color: #D8D8D8;
right: -1.2rem;
border-top: 1.2rem solid transparent;
border-bottom: 1.2rem solid transparent;
border-left: 1.2rem solid #CCC;
content: "";
border-left: 1.2rem solid #ccc;
content: '';
}
}
}
......@@ -359,7 +358,7 @@ $trigger-bg-color: #D8D8D8;
float: right;
width: calc(100% - 4rem);
border-top: 1px solid #838383;
content: "";
content: '';
}
}
}
......@@ -416,7 +415,7 @@ $trigger-bg-color: #D8D8D8;
.trigger-textarea-bg-item {
height: 2.2rem;
background: #F1F1F1;
background: #f1f1f1;
border-bottom: 1px solid #666;
.trigger-textarea-bg-item-no {
......@@ -426,7 +425,7 @@ $trigger-bg-color: #D8D8D8;
line-height: 2.2rem;
text-align: center;
vertical-align: top;
background: #D8D8D8;
background: #d8d8d8;
border-right: 1px solid #666;
}
......@@ -490,7 +489,7 @@ $trigger-bg-color: #D8D8D8;
.trigger-textarea-rule-attribute {
margin-right: 5px;
color: #F90;
color: #f90;
}
.trigger-textarea-rule-condition {
......@@ -505,7 +504,7 @@ $trigger-bg-color: #D8D8D8;
}
.trigger-textarea-rule-result {
color: #63F;
color: #63f;
}
}
}
......
$gray-linear-bg: linear-gradient(180deg, white 0%, #F2F2F2 0%, #E4E4E4 100%, white 100%);
$blue-linear-bg: linear-gradient(180deg, #2572B3 0%, #2572B3 2%, #40509D 100%, #40509D 100%);
$border-gray: #ABA8A8;
$color-grey: #CCC;
$primary-color: #27B3FE;
$gray-linear-bg: linear-gradient(180deg, white 0%, #f2f2f2 0%, #e4e4e4 100%, white 100%);
$blue-linear-bg: linear-gradient(180deg, #2572b3 0%, #2572b3 2%, #40509d 100%, #40509d 100%);
$border-gray: #aba8a8;
$color-grey: #ccc;
$primary-color: #27b3fe;
$grey-deep: $color-grey;
$active-color: $primary-color;
$black-tint: #9C9C9C;
$grey-tint: #EBEBEB;
$black-tint: #9c9c9c;
$grey-tint: #ebebeb;
$default-img: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpBQjkzMjk3RDAxQ0MxMUU4QTYzQUE3MDNCNkQ2M0MzOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpBQjkzMjk3RTAxQ0MxMUU4QTYzQUE3MDNCNkQ2M0MzOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkFCOTMyOTdCMDFDQzExRThBNjNBQTcwM0I2RDYzQzM5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkFCOTMyOTdDMDFDQzExRThBNjNBQTcwM0I2RDYzQzM5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+mn17wgAAABxJREFUeNpivH37NgMpgImBRDCqYVTD0NEAEGAAC3YCsayESVIAAAAASUVORK5CYII=";
$default-img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpBQjkzMjk3RDAxQ0MxMUU4QTYzQUE3MDNCNkQ2M0MzOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpBQjkzMjk3RTAxQ0MxMUU4QTYzQUE3MDNCNkQ2M0MzOSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkFCOTMyOTdCMDFDQzExRThBNjNBQTcwM0I2RDYzQzM5IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkFCOTMyOTdDMDFDQzExRThBNjNBQTcwM0I2RDYzQzM5Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+mn17wgAAABxJREFUeNpivH37NgMpgImBRDCqYVTD0NEAEGAAC3YCsayESVIAAAAASUVORK5CYII=';
// 导入字体
@import "./../assets/amosFont/iconfont.css";
@import './../assets/amosFont/iconfont.css';
/* Icon sizes */
......
......@@ -11,12 +11,12 @@
&::before {
display: block;
font-family: "anticon" !important;
font-family: 'anticon' !important;
}
}
@mixin iconfont-font($content) {
font-family: "amosicon";
font-family: 'amosicon';
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
......
@import "./icon.scss";
@import "./size.scss";
@import './icon.scss';
@import './size.scss';
@keyframes amosFadeIn {
0% {
opacity: 0;
......
// 导入 progress
@import "~ray-progress/assets/progress.scss";
@import '~ray-progress/assets/progress.scss';
$progress-color: #173C9C;
$progress-color: #173c9c;
#rayprogress {
.bar {
......
......@@ -7,28 +7,27 @@ $base-color-2: rgba($base-color, 0.35);
$top-height: 3.5rem;
$content-height: calc(100% - 3.5rem);
$background-color: #203957;
$font-family: "Microsoft YaHei";
$font-family: 'Microsoft YaHei';
$font-size: 12px;
$tab-width: 12rem;
/** Colors */
// Background color for `<body>`
$body-background: white;
// Base background color for most components
$component-background: white;
$primary-color-light: #CFEEFF;
$primary-color: #27B3FE;
$primary-color-deep: #19AFFF;
$primary-color-deeper: #00A6FF;
$success-color: #4CD964;
$danger-color: #F94242;
$warning-color: #FAAD14;
$error-color: #F5222D;
$color-grey: #CCC;
$primary-color-light: #cfeeff;
$primary-color: #27b3fe;
$primary-color-deep: #19afff;
$primary-color-deeper: #00a6ff;
$success-color: #4cd964;
$danger-color: #f94242;
$warning-color: #faad14;
$error-color: #f5222d;
$color-grey: #ccc;
$color-white: white;
$color-disable: #F4F4F4;
$color-disable: #f4f4f4;
$active-hover-foucs-bg-color: rgba(222, 222, 222, 0.2);
......@@ -43,15 +42,15 @@ $primary-8: lighten($primary-color, 8);
$primary-9: lighten($primary-color, 9);
$primary-10: lighten($primary-color, 10);
$disabled-color: #9E9E9E;
$disabled-border-color: #EAEAEA;
$disabled-bg-color: #ECEFF1;
$disabled-color: #9e9e9e;
$disabled-border-color: #eaeaea;
$disabled-bg-color: #eceff1;
$minor-color: #CCC;
$minor-bg-color: #F8F8F8;
$minor-bg-color-hover: #F1F1F1;
$minor-bg-color-active: #EAEAEA;
$minor-border-color: #C6C6C6;
$minor-color: #ccc;
$minor-bg-color: #f8f8f8;
$minor-bg-color-hover: #f1f1f1;
$minor-bg-color-active: #eaeaea;
$minor-border-color: #c6c6c6;
/** border */
......@@ -91,11 +90,10 @@ $font-size-lg: $font-size-base + 2px;
$font-color: white;
// Border color
$border-color-base: #D8D8D8;
$border-color-split: #E8E8E8;
$border-color-base: #d8d8d8;
$border-color-split: #e8e8e8;
$border-style-base: solid;
// text color
$text-color: rgba(black, 65%);
$text-color-secondary: rgba(black, 45%);
......@@ -103,7 +101,7 @@ $heading-color-dark: rgba(white, 100%);
$text-color-dark: rgba(white, 85%);
$text-color-secondary-dark: rgba(white, 65%);
$heading-color: rgba(black, 85%);
$text-shadow-color: #BADFFF;
$text-shadow-color: #badfff;
// LINK
$link-color: $primary-color;
......@@ -112,7 +110,6 @@ $link-active-color: $primary-7;
$link-decoration: none;
$link-hover-decoration: none;
/** nav theme */
/** Animation */
......@@ -130,7 +127,6 @@ $ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
$ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
$ease-in-out-quint: cubic-bezier(0.86, 0, 0.07, 1);
// media
// Media queries breakpoints
// Extra small screen / phone
......
......@@ -10,11 +10,11 @@ $core-bg: linear-gradient(180deg, $core-tint-color 0%, $core-tint-color 0%, $cor
$core-item-active-bg: linear-gradient(180deg, $core-color-shallow-1 0%, $core-color-shallow-1 0%, $core-color-shallow-2 100%, $core-color-shallow-2 100%);
$danger-color: #f06;
$danger-color-deep: #f30;
$core-close: $core-color;//linear-gradient(180deg, $danger-color 0%, $danger-color 0%, $danger-color-deep 100%, $danger-color-deep 100%);
$core-close: $core-color; //linear-gradient(180deg, $danger-color 0%, $danger-color 0%, $danger-color-deep 100%, $danger-color-deep 100%);
// 组件颜色
$component-bg: rgb(242, 242, 242);
$component-bg-active: linear-gradient(180deg, #aeaeae 0%, #aeaeae 0%, #c9c9c9 100%, #c9c9c9 100%);//rgb(228, 228, 228);
$component-bg-active: linear-gradient(180deg, #aeaeae 0%, #aeaeae 0%, #c9c9c9 100%, #c9c9c9 100%); //rgb(228, 228, 228);
$component-bg-linear: linear-gradient(180deg, white 0%, white 0%, $component-bg 100%, $component-bg 100%);
// header font color
......
......@@ -14,7 +14,7 @@ $core-close: linear-gradient(180deg, $danger-color 0%, $danger-color 0%, $danger
// 组件颜色
$component-bg: rgb(242, 242, 242);
$component-bg-active: linear-gradient(180deg, #aeaeae 0%, #aeaeae 0%, #c9c9c9 100%, #c9c9c9 100%);//rgb(228, 228, 228);
$component-bg-active: linear-gradient(180deg, #aeaeae 0%, #aeaeae 0%, #c9c9c9 100%, #c9c9c9 100%); //rgb(228, 228, 228);
$component-bg-linear: linear-gradient(180deg, white 0%, white 0%, $component-bg 100%, $component-bg 100%);
// header font color
......
$logo-title-color: #183698;
$btn-bg-color: linear-gradient(180deg, #173B97 0%, #1447A4 0%, #124FAA 100%, #1250AB 100%);
$btn-border-color: #173B97;
$btn-bg-color: linear-gradient(180deg, #173b97 0%, #1447a4 0%, #124faa 100%, #1250ab 100%);
$btn-border-color: #173b97;
#app {
.login-content {
width: 100%;
height: 99.7%;
background: url("../../assets/auth/login-bg.png") no-repeat;
background: url('../../assets/auth/login-bg.png') no-repeat;
background-size: cover;
border-bottom: 3px solid #3139C7;
border-bottom: 3px solid #3139c7;
.login-center-content {
min-height: 550px;
......@@ -18,7 +18,7 @@ $btn-border-color: #173B97;
display: inline-block;
width: 62%;
height: 100%;
background: url("../../assets/auth/login-desc.png") no-repeat;
background: url('../../assets/auth/login-desc.png') no-repeat;
background-size: 100% 100%;
.login-language-bottom {
......@@ -37,12 +37,12 @@ $btn-border-color: #173B97;
.login-form {
.login-form-usericon {
background: url("/src/assets/auth/user.png") no-repeat;
background: url('/src/assets/auth/user.png') no-repeat;
background-position-x: 35%;
}
.login-form-passicon {
background: url("/src/assets/auth/pwd.png") no-repeat;
background: url('/src/assets/auth/pwd.png') no-repeat;
background-position-x: 35%;
}
......@@ -59,20 +59,20 @@ $btn-border-color: #173B97;
.signup-container {
width: 100%;
height: 99.7%;
background: url("../../assets/auth/login-bg.png") no-repeat;
background: url('../../assets/auth/login-bg.png') no-repeat;
background-size: cover;
border-bottom: 3px solid #3139C7;
border-bottom: 3px solid #3139c7;
.ant-input {
color: white;
background-color: #272A3F;
border: 1px solid #44506E;
background-color: #272a3f;
border: 1px solid #44506e;
border-radius: 5px;
}
.ant-btn-primary[disabled] {
color: white;
background-color: #BDBDBD;
background-color: #bdbdbd;
}
.signup-verifica-img {
......@@ -91,5 +91,3 @@ $btn-border-color: #173B97;
}
}
}
......@@ -6,12 +6,12 @@
// header
$header-height: 40px;
// $header-background: linear-gradient(180deg, $core-deep-color 0%, $core-deep-color 0%, $core-tint-color 100%, $core-tint-color 100%);
$header-background: $core-color;//rgba($core-deep-color, 0.8);
$header-background: $core-color; //rgba($core-deep-color, 0.8);
$header-item-active: $core-deep-color;
$nav-item-border: 1px solid $core-deep-color;
// control
$side-item-bg: $component-bg-linear;//linear-gradient(180deg, #afafaf 0%, #afafaf 0%, #c8c8c8 100%, #c8c8c8 100%);
$side-item-bg: $component-bg-linear; //linear-gradient(180deg, #afafaf 0%, #afafaf 0%, #c8c8c8 100%, #c8c8c8 100%);
$side-item-bg-active: $component-bg-active;
$border-color: $core-border-color;
$pane-bg: $component-bg;
......@@ -39,7 +39,6 @@ $danger-color-level-2: rgb(236, 32, 32);
$taskwork-color-level-1: #e300fc;
$taskwork-color-level-2: #00c8fc;
$check-color-level-0: rgba(204, 204, 204, 1);
$check-color-level-1: rgba(0, 208, 0, 1);
$check-color-level-2: rgba(255, 205, 0, 1);
......@@ -83,7 +82,7 @@ $core-bg2-color: #f2f2f2;
//biz table
$biz-table-font-color: black;
$biz-table-title-color: $component-bg;
$biz-title-color: rgba(243, 243, 243, 1);//$component-bg-active;
$biz-title-color: rgba(243, 243, 243, 1); //$component-bg-active;
$biz-border-color: rgba(201, 201, 201, 1);
$model-header-color-3d: #ebebeb;
$model-body-color-3d: #f9f9f9;
......@@ -140,7 +140,6 @@
}
}
.amos-anim-small-to-big {
animation: amos-anim-small-to-big 0.5s;
animation-iteration-count: 1;
......
@import "./../../variable/config.scss";
@import './../../variable/config.scss';
.doc-wrapper {
display: inline-block;
......@@ -24,7 +24,7 @@
.doc-source-triger {
text-align: right;
font-size: 16px;
border-top: 1px solid #EBEDF0;
border-top: 1px solid #ebedf0;
padding: 1rem 0.5rem;
color: rgba(0, 0, 0, 0.65);
......@@ -38,7 +38,7 @@
display: block;
overflow: auto;
border-radius: 0 0 2px 2px;
border-top: 1px dashed #EBEDF0;
border-top: 1px dashed #ebedf0;
.code-wrapper {
position: relative;
......
@import "./../../variable/config.scss";
@import './../../variable/config.scss';
.standard-form-row {
border-bottom: 1px dashed $border-color-split;
......@@ -34,7 +33,7 @@
line-height: 32px;
&::after {
content: ":";
content: ':';
}
}
}
......
//文本大小
.f-10 { font-size: 10px; }
.f-12 { font-size: 12px; }
.f-13 { font-size: 13px; }
.f-14 { font-size: 14px; }
.f-15 { font-size: 15px; }
.f-16 { font-size: 16px; }
.f-17 { font-size: 17px; }
.f-18 { font-size: 18px; }
.f-19 { font-size: 19px; }
.f-20 { font-size: 20px; }
.f-24 { font-size: 24px; }
.f-28 { font-size: 28px; }
.f-32 { font-size: 32px; }
.f-10 {
font-size: 10px;
}
.f-12 {
font-size: 12px;
}
.f-13 {
font-size: 13px;
}
.f-14 {
font-size: 14px;
}
.f-15 {
font-size: 15px;
}
.f-16 {
font-size: 16px;
}
.f-17 {
font-size: 17px;
}
.f-18 {
font-size: 18px;
}
.f-19 {
font-size: 19px;
}
.f-20 {
font-size: 20px;
}
.f-24 {
font-size: 24px;
}
.f-28 {
font-size: 28px;
}
.f-32 {
font-size: 32px;
}
//padding系列
.p-5 { padding: 5px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }
.pt-5 { padding-top: 5px; }
.pt-10 { padding-top: 10px; }
.pt-15 { padding-top: 15px; }
.pt-20 { padding-top: 20px; }
.pl-5 { padding-left: 5px; }
.pl-10 { padding-left: 10px; }
.pl-15 { padding-left: 15px; }
.pl-20 { padding-left: 20px; }
.pr-5 { padding-right: 5px; }
.pr-10 { padding-right: 10px; }
.pr-15 { padding-right: 15px; }
.pr-20 { padding-right: 20px; }
.pb-5 { padding-bottom: 5px; }
.pb-10 { padding-bottom: 10px; }
.pb-15 { padding-bottom: 15px; }
.pb-20 { padding-bottom: 20px; }
.p-5 {
padding: 5px;
}
.p-10 {
padding: 10px;
}
.p-15 {
padding: 15px;
}
.p-20 {
padding: 20px;
}
//margin系列
.m-5 { margin: 5px; }
.m-10 { margin: 10px; }
.m-15 { margin: 15px; }
.m-20 { margin: 20px; }
.pt-5 {
padding-top: 5px;
}
.pt-10 {
padding-top: 10px;
}
.pt-15 {
padding-top: 15px;
}
.pt-20 {
padding-top: 20px;
}
.mt-5 { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.pl-5 {
padding-left: 5px;
}
.pl-10 {
padding-left: 10px;
}
.pl-15 {
padding-left: 15px;
}
.pl-20 {
padding-left: 20px;
}
.pr-5 {
padding-right: 5px;
}
.pr-10 {
padding-right: 10px;
}
.pr-15 {
padding-right: 15px;
}
.pr-20 {
padding-right: 20px;
}
.pb-5 {
padding-bottom: 5px;
}
.pb-10 {
padding-bottom: 10px;
}
.pb-15 {
padding-bottom: 15px;
}
.pb-20 {
padding-bottom: 20px;
}
.ml-5 { margin-left: 5px; }
.ml-10 { margin-left: 10px; }
.ml-15 { margin-left: 15px; }
.ml-20 { margin-left: 20px; }
//margin系列
.m-5 {
margin: 5px;
}
.m-10 {
margin: 10px;
}
.m-15 {
margin: 15px;
}
.m-20 {
margin: 20px;
}
.mt-5 {
margin-top: 5px;
}
.mt-10 {
margin-top: 10px;
}
.mt-15 {
margin-top: 15px;
}
.mt-20 {
margin-top: 20px;
}
.mr-5 { margin-right: 5px; }
.mr-10 { margin-right: 10px; }
.mr-15 { margin-right: 15px; }
.mr-20 { margin-right: 20px; }
.ml-5 {
margin-left: 5px;
}
.ml-10 {
margin-left: 10px;
}
.ml-15 {
margin-left: 15px;
}
.ml-20 {
margin-left: 20px;
}
.mb-5 { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mr-5 {
margin-right: 5px;
}
.mr-10 {
margin-right: 10px;
}
.mr-15 {
margin-right: 15px;
}
.mr-20 {
margin-right: 20px;
}
.mb-5 {
margin-bottom: 5px;
}
.mb-10 {
margin-bottom: 10px;
}
.mb-15 {
margin-bottom: 15px;
}
.mb-20 {
margin-bottom: 20px;
}
//宽度
.w-50 { width: 50px; }
.w-80 { width: 80px; }
.w-100 { width: 100px; }
.w-120 { width: 120px; }
.w-150 { width: 150px; }
.w-180 { width: 180px; }
.w-200 { width: 200px; }
.w-50 {
width: 50px;
}
.w-80 {
width: 80px;
}
.w-100 {
width: 100px;
}
.w-120 {
width: 120px;
}
.w-150 {
width: 150px;
}
.w-180 {
width: 180px;
}
.w-200 {
width: 200px;
}
//浮动
.f-l { float: left; }
.f-r { float: right; }
.f-l {
float: left;
}
.f-r {
float: right;
}
//清除浮动
.clearfix {
......@@ -94,32 +216,64 @@
}
//隐藏
.none { display: none; }
.none {
display: none;
}
//手标 手势-手
.cursor-d { cursor: default; }
.cursor-t { cursor: text; }
.cursor-h { cursor: hand; }
.cursor-m { cursor: move; }
.cursor-p { cursor: pointer; }
.cursor-d {
cursor: default;
}
.cursor-t {
cursor: text;
}
.cursor-h {
cursor: hand;
}
.cursor-m {
cursor: move;
}
.cursor-p {
cursor: pointer;
}
//文本居中
.center { text-align: center; }
.center {
text-align: center;
}
//文本缩进
.t-i-1 { text-indent: 1rem; }
.t-i-2 { text-indent: 2rem; }
.t-i-1 {
text-indent: 1rem;
}
.t-i-2 {
text-indent: 2rem;
}
//文本文字间间隔
.l-s-5 { letter-spacing: 5px; }
.l-s-10 { letter-spacing: 10px; }
.l-s-5 {
letter-spacing: 5px;
}
.l-s-10 {
letter-spacing: 10px;
}
//0边框
.border { border: 0; }
.border-l-0 { border-left: 0; }
.border-r-0 { border-right: 0; }
.border-t-0 { border-top: 0; }
.border-b-0 { border-bottom: 0; }
.border {
border: 0;
}
.border-l-0 {
border-left: 0;
}
.border-r-0 {
border-right: 0;
}
.border-t-0 {
border-top: 0;
}
.border-b-0 {
border-bottom: 0;
}
.border-lr-0 {
border-left: 0;
......@@ -163,5 +317,3 @@
.img-circle {
border-radius: 50%;
}
......@@ -36,7 +36,8 @@
height: 20px;
bottom: 0;
right: 0;
background: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=") no-repeat;
background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4=')
no-repeat;
background-position: bottom right;
padding: 0 3px 3px 0;
background-origin: content-box;
......
@import "./formrow.scss";
@import "./docwrapper.scss";
@import "./general.scss";
@import "./menuHead.scss";
@import './formrow.scss';
@import './docwrapper.scss';
@import './general.scss';
@import './menuHead.scss';
......@@ -56,10 +56,8 @@
}
}
}
}
.amos-dropnav-item-active {
color: rgb(0, 0, 0);
background: linear-gradient(0deg, rgb(201, 201, 201) 0%, rgb(201, 201, 201) 0%, rgb(174, 174, 174) 100%, rgb(174, 174, 174) 100%);
......@@ -70,12 +68,12 @@
}
.amos-dropdown-menu-warpper {
background-color: #345FA6;
background-color: #345fa6;
border-radius: 0 0 6px 6px;
.amos-dropnav-sub {
padding: 0;
background-color: #345FA6;
background-color: #345fa6;
border-radius: 0 0 6px 6px;
.amos-dropnav-item {
......@@ -86,15 +84,15 @@
> a {
line-height: 4rem;
color: white;
background-color: #345FA6;
background-color: #345fa6;
&:hover {
background-color: #2E5392;
background-color: #2e5392;
}
}
&:hover {
background-color: #345FA6 !important;
background-color: #345fa6 !important;
}
}
......
@import "./common/index.scss";
@import "./biz/login.scss";
@import "./biz/header.scss";
@import "./region/index.scss";
@import './common/index.scss';
@import './biz/login.scss';
@import './biz/header.scss';
@import './region/index.scss';
......@@ -9,4 +9,3 @@
.ant-menu-sub .ant-menu-inline {
background: transparent;
}
......@@ -18,8 +18,8 @@
font-weight: bold;
color: white;
cursor: pointer;
background-color: #282828a0;//$core-tint-color;
border: 2px solid #222;//$core-border-color;
background-color: #282828a0; //$core-tint-color;
border: 2px solid #222; //$core-border-color;
border-radius: 6px;
.region-form {
......@@ -49,7 +49,6 @@
}
}
.device-data-items {
.plc-title {
height: 40px;
......@@ -78,4 +77,4 @@
.risk-model-button {
display: block;
margin-left: 0 !important;
}
\ No newline at end of file
}
/**
* 日期格式化文件
*/
Date.prototype.format = function(format){
Date.prototype.format = function(format) {
let o = {
'M+': this.getMonth() + 1, //month
'd+': this.getDate(), //day
......@@ -9,7 +9,7 @@ Date.prototype.format = function(format){
'm+': this.getMinutes(), //minute
's+': this.getSeconds(), //second
'q+': Math.floor((this.getMonth() + 3) / 3), //quarter
'S': this.getMilliseconds() //millisecond
S: this.getMilliseconds() //millisecond
};
if (/(y+)/.test(format)) {
......@@ -28,15 +28,15 @@ Date.prototype.format = function(format){
* 如:长时间格式:'2016-10-10 12:00:00'
* 短时间格式:'2016-10-10'
*/
export const strToTime = (str) => {
str = str.replace(/-/g,'/');
export const strToTime = str => {
str = str.replace(/-/g, '/');
let date = new Date(str);
return date.getTime();
};
/**
* 根据时间戳获取该时间的长时间格式字符串
*/
export const dateToStr = (time) => {
export const dateToStr = time => {
let date = new Date(time);
let nowStr = date.format('yyyy-MM-dd hh:mm:ss');
return nowStr;
......@@ -45,7 +45,7 @@ export const dateToStr = (time) => {
* 根据时间戳获取该时间字符串格式,格式如下
* 03-27(月份和天数)
*/
export const dateToMouthDay = (time) => {
export const dateToMouthDay = time => {
let date = new Date(time);
let nowStr = date.format('MM-dd');
return nowStr;
......@@ -54,7 +54,7 @@ export const dateToMouthDay = (time) => {
* 根据时间戳获取该时间字符串格式,格式如下
* 18:00(小时和分钟)
*/
export const dateToHourMi = (time) => {
export const dateToHourMi = time => {
let date = new Date(time);
let nowStr = date.format('hh:mm');
return nowStr;
......@@ -64,7 +64,7 @@ export const dateToHourMi = (time) => {
* 根据时间戳获取整点长时间格式字符串,格式如下
* 2016-10-22 10:00:00
*/
export const dateToHour = (time) => {
export const dateToHour = time => {
let date = new Date(time);
let nowStr = date.format('yyyy-MM-dd hh');
nowStr = `${nowStr}:00:00`;
......@@ -113,7 +113,7 @@ export const currentDateMdhms = () => {
* 根据时间戳获取改时间的如下格式字符串
* 12-30 12:00
*/
export const dateToNoYS = (time) => {
export const dateToNoYS = time => {
let date = new Date(time);
let nowStr = date.format('MM-dd hh:mm');
return nowStr;
......@@ -121,16 +121,16 @@ export const dateToNoYS = (time) => {
/**
* 将秒换算成时分秒
*/
export const formatSeconds = (value) => {
export const formatSeconds = value => {
const hour = 3600;
const minute = 60;
let result = '';
if (value){
let theTime = parseInt(value);// 秒
let theTime1 = 0;// 分
let theTime2 = 0;// 小时
theTime2 = parseInt( theTime / hour );
theTime1 = parseInt(( theTime % hour ) / minute );
if (value) {
let theTime = parseInt(value); // 秒
let theTime1 = 0; // 分
let theTime2 = 0; // 小时
theTime2 = parseInt(theTime / hour);
theTime1 = parseInt((theTime % hour) / minute);
result = `${theTime2}小时 ${theTime1}分钟`;
} else {
result = `请开始分析!`;
......
......@@ -7,7 +7,7 @@ export const cacheConsts = {
CURRENT_REGION: 'CURRENT_REGION'
};
export const setRegion = (data) => {
export const setRegion = data => {
lsTool.write(cacheConsts.CURRENT_REGION, JSON.stringify(data));
};
......
/* eslint no-magic-numbers: 0 */
export const getMousePos = (event) => {
export const getMousePos = event => {
const e = event || window.event;
const scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
const scrollY = document.documentElement.scrollTop || document.body.scrollTop;
......@@ -35,7 +35,7 @@ export const getCatalogOffset = (domEle = {}) => {
return box;
};
export const getCatalogPanelOffset = (domEle) => {
export const getCatalogPanelOffset = domEle => {
const position = getCatalogOffset(domEle);
return {
......
......@@ -14,14 +14,13 @@ const property = {
};
export const dataFalcor = (agent, datas) => {
if (!utils.isArray(datas)){
if (!utils.isArray(datas)) {
datas = [].concat(datas);
}
return datas.map(d => d[agent]);
};
export default function(options = {}){
export default function(options = {}) {
const { existPanelSize = 0, cardOptions = {}, panelUID } = options;
const xCol = existPanelSize % 2 === 0 ? property.firstCol : property.secondCol;
......
......@@ -2,7 +2,6 @@ import { UUID } from 'amos-tool';
const defaultLen = 16;
export default function(len = defaultLen){
export default function(len = defaultLen) {
return UUID.uuid(len);
}
export default function(data){
export default function(data) {
return new Promise((resolve, reject) => {
if (data) {
if (data.dataList || data.dataList === null){
if (data.dataList || data.dataList === null) {
resolve(data.dataList);
} else if (data.result || data.result === null){
if(data.content){
} else if (data.result || data.result === null) {
if (data.content) {
resolve(data);
}else{
} else {
resolve(data.result);
}
}else if (data == 'TypeError: Failed to fetch'){
} else if (data == 'TypeError: Failed to fetch') {
reject(data);
}else{
} else {
resolve(data);
}
} else {
reject(data);
reject(data);
}
});
}
......@@ -7,11 +7,13 @@ import payload from './payload';
const lsTool = Store.lsTool;
const defaultHeaders = () => {
return window.isIotPluginsToAmos ? window.iotRequestInfo.staticHeader : {
appKey: 'AMOS_IOT',
product: 'AMOS_IOT_WEB'
};
}
return window.isIotPluginsToAmos
? window.iotRequestInfo.staticHeader
: {
appKey: 'AMOS_IOT',
product: 'AMOS_IOT_WEB'
};
};
export const compleHeaders = () => {
return {
......@@ -20,16 +22,15 @@ export const compleHeaders = () => {
};
};
export function commonGet(url) {
return amosRequest(url, {
method: 'GET',
headers: compleHeaders(),
reject(error){
method: 'GET',
headers: compleHeaders(),
reject(error) {
console.log('请求失败,服务器错误!');
message.danger(error.message || '请求失败,服务器错误!');
}
}).then(data => payload(data));
}).then(data => payload(data));
}
export function commonPost(url, data, params) {
......@@ -37,7 +38,7 @@ export function commonPost(url, data, params) {
headers: compleHeaders(),
method: 'POST',
body: data,
reject(error){
reject(error) {
console.log('请求失败,服务器错误!');
message.danger(error.message || '请求失败,服务器错误!');
}
......@@ -49,7 +50,7 @@ export function commonPut(url, data, params) {
headers: compleHeaders(),
method: 'PUT',
body: data,
reject(error){
reject(error) {
console.log('请求失败,服务器错误!');
message.danger(error.message || '请求失败,服务器错误!');
}
......@@ -61,25 +62,25 @@ export function commonDelete(url, data, params) {
headers: compleHeaders(),
method: 'DELETE',
body: data,
reject(error){
reject(error) {
console.log('请求失败,服务器错误!');
message.danger(error.message || '请求失败,服务器错误!');
}
}).then(data => payload(data));
}
export function getToken(){
export function getToken() {
return lsTool.read(sysConsts.token);
}
export function setToken(token){
export function setToken(token) {
return lsTool.write(sysConsts.token, token);
}
export function getUser(){
export function getUser() {
return lsTool.read(sysConsts.userId);
}
export function setUser(userId){
export function setUser(userId) {
return lsTool.write(sysConsts.userId, userId);
}
import { Store, utils } from 'amos-tool';
import SysConsts from 'amos-processor/lib/config/consts';
const lsTool = Store.lsTool;
const userConfigs = {
......@@ -12,9 +13,9 @@ const userConfigs = {
export const changeAssideStatus = (asside, flag) => {
const result = flag ? 1 : 0;
if (asside === 'right'){
if (asside === 'right') {
lsTool.write(userConfigs.rightAsideOpenFlag, result);
} else if (asside === 'left'){
} else if (asside === 'left') {
lsTool.write(userConfigs.leftAsideOpenFlag, result);
}
};
......@@ -29,15 +30,14 @@ export const getAssideStatus = () => {
};
const transUndefinedToDefault = (val, _default = '') => {
if (val === 0 || val === '0'){
if (val === 0 || val === '0') {
return false;
} else if (val === 1 || val === '1'){
} else if (val === 1 || val === '1') {
return true;
}
return utils.isEmpty(val) ? _default : val;
};
export const currentUser = () => {
var e = JSON.parse(lsTool.read(SysConsts.company));
return {
......@@ -47,5 +47,5 @@ export const currentUser = () => {
userName: lsTool.read(SysConsts.userName),
nickName: lsTool.read(SysConsts.nickName),
company: e
}
}
};
};
......@@ -4,20 +4,13 @@ import PropTypes from 'prop-types';
class AlarmManage extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div style={{ width: '100%', height: '100%' }}>
{ this.props.children }
</div>
);
return <div style={{ width: '100%', height: '100%' }}>{this.props.children}</div>;
}
}
AlarmManage.propTypes = {
};
AlarmManage.propTypes = {};
export default AlarmManage;
......@@ -11,13 +11,12 @@ import { Icon } from 'amos-antd';
class GridButton extends Component {
constructor(props) {
super(props);
}
render() {
const { text, onClick, icon, className } = this.props;
return (
<a className={className} title={text} onClick={onClick} >
<a className={className} title={text} onClick={onClick}>
<Icon type={icon} />
<span>{text}</span>
</a>
......
......@@ -2,15 +2,9 @@ import React from 'react';
import PropTypes from 'prop-types';
const Pre = ({ children }) => {
return (
<div className="code-wrapper">
{children}
</div>
);
return <div className="code-wrapper">{children}</div>;
};
Pre.propTypes = {
};
Pre.propTypes = {};
export default Pre;
......@@ -5,7 +5,6 @@ import Icon from 'amos-icon';
import Pre from './Pre';
class DocWrapper extends Component {
constructor(props) {
super(props);
this.state = {
......@@ -17,8 +16,7 @@ class DocWrapper extends Component {
this.setState({
codeShow: !this.state.codeShow
});
}
};
render() {
const { codeShow } = this.state;
......@@ -32,19 +30,16 @@ class DocWrapper extends Component {
{title}
{extraAction}
</div>
<div className="doc-example">
{children}
</div>
<div className="doc-example">{children}</div>
<div className="doc-source">
<div className="doc-source-triger">
<div className="doc-source-descr">{descr}</div>
<div className="source-triger-btn" onClick={this.toggleSource}><Icon icon={icon} />源码</div>
</div>
<div className="doc-source-code">
{
codeShow && <Pre>{code}</Pre>
}
<div className="source-triger-btn" onClick={this.toggleSource}>
<Icon icon={icon} />
源码
</div>
</div>
<div className="doc-source-code">{codeShow && <Pre>{code}</Pre>}</div>
</div>
</div>
);
......
......@@ -11,7 +11,6 @@ import classNames from 'classnames';
* @extends {Component}
*/
class TriggerEditor extends Component {
constructor(props) {
super(props);
this.state = {
......@@ -26,10 +25,13 @@ class TriggerEditor extends Component {
}
onClosed = () => {
this.setState({
expanded: false
}, () => this.props.closeDesigner());
}
this.setState(
{
expanded: false
},
() => this.props.closeDesigner()
);
};
render() {
const { expanded } = this.state;
......@@ -37,29 +39,20 @@ class TriggerEditor extends Component {
const editorCls = classNames({
'trigger-editor-content': true,
'expanded': expanded
expanded: expanded
});
const icon = expanded ? 'right' : 'left';
return (
<Animate
transitionName="slide-right"
showProp="data-expand"
transitionAppear
>
<Animate transitionName="slide-right" showProp="data-expand" transitionAppear>
<div className="trigger-editor" data-expand={expanded}>
<div
className={editorCls}
>
{children}
</div>
{
expanded &&
<div className={editorCls}>{children}</div>
{expanded && (
<div className="slider-right" onClick={this.onClosed}>
<Icon icon={icon} />
</div>
}
)}
</div>
</Animate>
);
......@@ -73,7 +66,7 @@ TriggerEditor.propTypes = {
};
TriggerEditor.defaultProps = {
closeDesigner(){},
closeDesigner() {},
expanded: false
};
......
......@@ -8,11 +8,14 @@ import { amosRequest } from 'amos-processor';
* @param {any} options : { url, params: { method, body, header } }
* @returns enhance Component
*/
export default function(WrapperComponent, options){
const _options = Object.assign({}, {
method: 'get'
}, options);
export default function(WrapperComponent, options) {
const _options = Object.assign(
{},
{
method: 'get'
},
options
);
const { url, method, data, params } = _options;
......@@ -34,35 +37,30 @@ export default function(WrapperComponent, options){
}
componentWillMount() {
amosRequest(url, newOptions).then(
data => this.setState({
amosRequest(url, newOptions).then(data =>
this.setState({
dataList: data
}));
})
);
}
reload = (data) => {
reload = data => {
let _params = {};
data && (
_params = {
data &&
(_params = {
body: data
}
);
amosRequest(url, _params).then(
data => this.setState({
});
amosRequest(url, _params).then(data =>
this.setState({
dataList: data
}));
}
})
);
};
render() {
const { dataList } = this.state;
return (
<WrapperComponent
dataList={dataList}
reload={this.reload}
{...this.props}
/>
);
return <WrapperComponent dataList={dataList} reload={this.reload} {...this.props} />;
}
}
......
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import { Portal } from 'amos-framework';
const IS_REACT_16 = !!ReactDOM.createPortal;
/**
* portal component
*
* @param {any} WrappedComponent
* @param {any} options
* @returns enhance Component
*/
export default function(WrappedComponent, options){
class WrapperComponent extends Component {
static propTypes = {
visible: PropTypes.bool,
getContainer: PropTypes.func
};
constructor(props) {
super(props);
this.state = {
visible: false
};
}
shouldComponentUpdate({ visible }) {
return !!(this.props.visible || visible);
}
componentWillUnmount() {
if (IS_REACT_16) {
return;
}
if (this.props.visible) {
this.renderComponent({
afterLeave: this.removeContainer,
onLeave() {
},
visible: false
});
} else {
this.removeContainer();
}
}
getComponent = (extra = {}) => {
return (
<WrappedComponent
ref={node => this._component = node}
{...this.props}
{...extra}
key="portal-wrapper"
/>
);
}
getContainer = () => {
if (this.props.getContainer) {
return this.props.getContainer();
}
const container = document.createElement('div');
document.body.appendChild(container);
return container;
}
removeContainer = () => {
if (this._container) {
const container = this._container;
ReactDOM.unmountComponentAtNode(container);
container.parentNode.removeChild(container);
this._container = null;
}
}
renderComponent = (componentArg, ready) => {
const { visible } = this.props;
if (!visible || this._component) {
if (!this._container) {
this._container = this.getContainer();
}
const component = this.getComponent(componentArg);
ReactDOM.unstable_renderSubtreeIntoContainer(this,
component, this._container,
function callback() {
this._component = this;
if (ready) {
ready.call(this);
}
});
}
}
render() {
const { visible } = this.props;
let portal = null;
if (!IS_REACT_16) {
return portal;
}
if (visible || this._component) {
portal = (
<Portal getContainer={this.getContainer}>
{this.getComponent()}
</Portal>
);
}
return portal;
}
}
return WrapperComponent;
}
import { render } from 'react-dom';
/**
......@@ -8,13 +7,13 @@ import { render } from 'react-dom';
* @param {any} options : { containerKey, visible }
* @returns enhance Component
*/
export default function(WrappedComponent, options){
export default function(WrappedComponent, options) {
const { containerKey, visible } = options;
const getContainer = () => {
return document.getElementById(containerKey);
};
if (visible){
if (visible) {
render(WrappedComponent, getContainer());
}
}
import amosRequest from 'amos-processor/lib/fetch/amosRequest';
const commonPost = (url, data) => {
return amosRequest(url, {
method: 'POST',
body: data,
reject(err){
}
reject(err) {}
});
};
......@@ -15,9 +12,7 @@ const commonGet = (url, data) => {
return amosRequest(url, {
method: 'GET',
body: data,
reject(err){
}
reject(err) {}
});
};
......@@ -25,9 +20,7 @@ const commonPut = (url, data) => {
return amosRequest(url, {
method: 'PUT',
body: data,
reject(err){
}
reject(err) {}
});
};
......@@ -35,9 +28,7 @@ const commonDel = (url, data) => {
return amosRequest(url, {
method: 'DELETE',
body: data,
reject(err){
}
reject(err) {}
});
};
......@@ -45,9 +36,7 @@ export function getService(url, data) {
return amosRequest(url, {
method: 'GET',
body: data,
reject(err){
}
reject(err) {}
});
}
......@@ -55,9 +44,6 @@ export function postService(url, data) {
return amosRequest(url, {
method: 'POST',
body: data,
reject(err){
}
reject(err) {}
});
}
......@@ -10,10 +10,8 @@ const scale = 10;
* @param {any} options : { url, params: { method, body, header } }
* @returns enhance Component
*/
export default function(WrapperComponent, options){
export default function(WrapperComponent, options) {
class WhComponent extends Component {
static propTypes = {
vh: PropTypes.number,
vw: PropTypes.number,
......@@ -21,23 +19,17 @@ export default function(WrapperComponent, options){
};
render() {
const { vw, vh, style = {}, ...rest } = this.props;
const { vw, vh, style = {}, ...rest } = this.props;
if (vw){
if (vw) {
style.width = `${vw * scale}vw`;
}
if (vh){
if (vh) {
style.height = `${vh * scale}vh`;
}
return (
<WrapperComponent
style={style}
{...rest}
/>
);
return <WrapperComponent style={style} {...rest} />;
}
}
......
......@@ -20,24 +20,24 @@ class ComMethodOptionsFilter extends Component {
this.setState({ scriptLangOptions });
}
//全清
// 全清
delFilter = () => {
let { scriptLangOptions,clearBtnStyle } = this.state;
let { scriptLangOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn selected-btn';
scriptLangOptions.map(option=>{
scriptLangOptions.map(option => {
option.selected = false;
option.style = 'all-filter-btn';
});
this.setState({ scriptLangOptions,clearBtnStyle });
this.setState({ scriptLangOptions, clearBtnStyle });
this.props.comMethodSelectFunc([]);
}
};
//筛选条件点击事件
selectClick = (e) => {
// 筛选条件点击事件
selectClick = e => {
let filterOptionList = [];
let { scriptLangOptions,clearBtnStyle } = this.state;
let { scriptLangOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn';
scriptLangOptions.map(option=>{
scriptLangOptions.map(option => {
if (option.label === e.target.innerText) {
option.selected = true;
option.style = 'all-filter-btn selected-btn';
......@@ -46,31 +46,34 @@ class ComMethodOptionsFilter extends Component {
filterOptionList.push(option);
}
});
this.setState({ scriptLangOptions,clearBtnStyle });
this.setState({ scriptLangOptions, clearBtnStyle });
this.props.comMethodSelectFunc(filterOptionList);
}
};
//加载接口通讯方式所有筛选按钮
// 加载接口通讯方式所有筛选按钮
AllCommunityOptionFunc = () => {
let { scriptLangOptions,clearBtnStyle } = this.state;
let { scriptLangOptions, clearBtnStyle } = this.state;
let res = [];
res.push(
<div key={`clear1`} className={clearBtnStyle} onClick={this.delFilter}>
<div key="clear1" className={clearBtnStyle} onClick={this.delFilter}>
<div>不限</div>
</div>);
scriptLangOptions.map(option=>{
res.push(<div key={`scriptLang${option.value}`} className={option.style} onClick={this.selectClick}>{option.label}</div>);
</div>
);
scriptLangOptions.map(option => {
res.push(
<div key={`scriptLang${option.value}`} className={option.style} onClick={this.selectClick}>
{option.label}
</div>
);
// if (option.selected) {
// clearBtnStyle = 'all-filter-btn selected-btn';
// }
});
return res;
}
};
render() {
return (
this.AllCommunityOptionFunc()
);
return this.AllCommunityOptionFunc();
}
}
......
......@@ -22,22 +22,22 @@ class CommunityOptionsFilter extends Component {
//全清
delFilter = () => {
let { communityOptions,clearBtnStyle } = this.state;
let { communityOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn selected-btn';
communityOptions.map(option=>{
communityOptions.map(option => {
option.selected = false;
option.style = 'all-filter-btn';
});
this.setState({ communityOptions,clearBtnStyle });
this.setState({ communityOptions, clearBtnStyle });
this.props.communitySelectFunc([]);
}
};
//筛选条件点击事件
selectClick = (e) => {
selectClick = e => {
let filterOptionList = [];
let { communityOptions,clearBtnStyle } = this.state;
let { communityOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn';
communityOptions.map(option=>{
communityOptions.map(option => {
if (option.label === e.target.innerText) {
if (option.selected) {
option.selected = false;
......@@ -57,32 +57,37 @@ class CommunityOptionsFilter extends Component {
} else {
clearBtnStyle = 'all-filter-btn';
}
this.setState({ communityOptions,clearBtnStyle });
this.setState({ communityOptions, clearBtnStyle });
this.props.communitySelectFunc(filterOptionList);
}
};
//反选‘不限’
disableAllSelected = () => {
let clearBtnStyle = 'all-filter-btn selected-btn';
this.setState({ clearBtnStyle });
}
};
//加载接口通讯方式所有筛选按钮
AllCommunityOptionFunc = () => {
let { communityOptions,clearBtnStyle } = this.state;
let { communityOptions, clearBtnStyle } = this.state;
let res = [];
res.push(
<div key={`0community`} className={clearBtnStyle} onClick={this.delFilter}>
<div>不限</div>
</div>);
communityOptions.map(option=>{
res.push(<div key={`${option.value}community`} className={option.style} onClick={this.selectClick}>{option.label}</div>);
</div>
);
communityOptions.map(option => {
res.push(
<div key={`${option.value}community`} className={option.style} onClick={this.selectClick}>
{option.label}
</div>
);
// if (option.selected) {
// clearBtnStyle = 'all-filter-btn selected-btn';
// }
});
return res;
}
};
render() {
return this.AllCommunityOptionFunc();
......
......@@ -22,29 +22,28 @@ class IndustryOptionsFilter extends Component {
//全清
delFilter = () => {
let { equiptemplateIndustryOptions,clearBtnStyle } = this.state;
let { equiptemplateIndustryOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn selected-btn';
equiptemplateIndustryOptions.map(option=>{
equiptemplateIndustryOptions.map(option => {
option.selected = false;
option.style = 'all-filter-btn';
});
this.setState({ equiptemplateIndustryOptions,clearBtnStyle });
this.setState({ equiptemplateIndustryOptions, clearBtnStyle });
this.props.industrySelectFunc([]);
}
//反选‘不限’
disableAllSelected = () => {
let clearBtnStyle = 'all-filter-btn selected-btn';
this.setState({ clearBtnStyle });
}
};
//反选‘不限’
disableAllSelected = () => {
let clearBtnStyle = 'all-filter-btn selected-btn';
this.setState({ clearBtnStyle });
};
//筛选条件点击事件
selectClick = (e) => {
selectClick = e => {
let filterOptionList = [];
let { equiptemplateIndustryOptions,clearBtnStyle } = this.state;
let { equiptemplateIndustryOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn';
equiptemplateIndustryOptions.map(option=>{
equiptemplateIndustryOptions.map(option => {
if (option.label === e.target.innerText) {
option.selected = true;
option.style = 'all-filter-btn selected-btn';
......@@ -53,31 +52,34 @@ class IndustryOptionsFilter extends Component {
filterOptionList.push(option);
}
});
this.setState({ equiptemplateIndustryOptions,clearBtnStyle });
this.setState({ equiptemplateIndustryOptions, clearBtnStyle });
this.props.industrySelectFunc(filterOptionList);
}
};
//加载接口通讯方式所有筛选按钮
AllIndustryOptionFunc = () => {
let { equiptemplateIndustryOptions,clearBtnStyle } = this.state;
let { equiptemplateIndustryOptions, clearBtnStyle } = this.state;
let res = [];
res.push(
<div key={`clear1`} className={clearBtnStyle} onClick={this.delFilter}>
<div>不限</div>
</div>);
if(equiptemplateIndustryOptions != undefined && equiptemplateIndustryOptions.length>0){
equiptemplateIndustryOptions.map(option=>{
res.push(<div key={`industry${option.value}`} className={option.style} onClick={this.selectClick}>{option.label}</div>);
});
}
</div>
);
if (equiptemplateIndustryOptions != undefined && equiptemplateIndustryOptions.length > 0) {
equiptemplateIndustryOptions.map(option => {
res.push(
<div key={`industry${option.value}`} className={option.style} onClick={this.selectClick}>
{option.label}
</div>
);
});
}
return res;
}
};
render() {
return (
this.AllIndustryOptionFunc()
);
return this.AllIndustryOptionFunc();
}
}
......
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { capacityClassifyEnum } from './../../deviceManage/common/DeviceEnum';
import { capacityClassifyEnum } from './../../deviceManage/common/DeviceEnum';
import { enums2array } from './../../deviceManage/common/DeviceLang';
//能力option数据
// 能力option数据
let obilityOptionData = [];
enums2array(capacityClassifyEnum).map((item)=>{
obilityOptionData.push({ value: item.key, label: item.label,selected: false,style: 'all-filter-btn' });
enums2array(capacityClassifyEnum).map(item => {
obilityOptionData.push({ value: item.key, label: item.label, selected: false, style: 'all-filter-btn' });
});
/**
* 能力分类筛选
......@@ -23,24 +23,24 @@ class ObilityOptionsFilter extends Component {
};
}
//全清
// 全清
delFilter = () => {
let { obilityOptions,clearBtnStyle } = this.state;
let { obilityOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn selected-btn';
obilityOptions.map((option)=>{
obilityOptions.map(option => {
option.selected = false;
option.style = 'all-filter-btn';
});
this.setState({ obilityOptions,clearBtnStyle });
this.setState({ obilityOptions, clearBtnStyle });
this.props.obilitySelectFunc([]);
}
};
//筛选条件点击事件
selectClick = (e) => {
// 筛选条件点击事件
selectClick = e => {
let filterOptionList = [];
let { obilityOptions,clearBtnStyle } = this.state;
let { obilityOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn';
obilityOptions.map((option)=>{
obilityOptions.map(option => {
if (option.label === e.target.innerText) {
if (option.selected) {
option.selected = false;
......@@ -54,43 +54,46 @@ class ObilityOptionsFilter extends Component {
filterOptionList.push(option);
}
});
//‘不限’选项的样式控制
// ‘不限’选项的样式控制
if (filterOptionList.length === 0) {
clearBtnStyle = 'all-filter-btn selected-btn';
} else {
clearBtnStyle = 'all-filter-btn';
}
this.setState({ obilityOptions,clearBtnStyle });
this.setState({ obilityOptions, clearBtnStyle });
this.props.obilitySelectFunc(filterOptionList);
}
};
//反选‘不限’
// 反选‘不限’
disableAllSelected = () => {
let clearBtnStyle = 'all-filter-btn selected-btn';
this.setState({ clearBtnStyle });
}
};
//加载能力分类所有筛选按钮
// 加载能力分类所有筛选按钮
AllObilityOptionFunc = () => {
let { obilityOptions,clearBtnStyle } = this.state;
let { obilityOptions, clearBtnStyle } = this.state;
let res = [];
res.push(
<div key={`obility`} className={clearBtnStyle} onClick={this.delFilter}>
<div key="obility" className={clearBtnStyle} onClick={this.delFilter}>
<div>不限</div>
</div>);
obilityOptions.map((option)=>{
res.push(<div key={`obility${option.value}`} className={option.style} onClick={this.selectClick}>{option.label}</div>);
</div>
);
obilityOptions.map(option => {
res.push(
<div key={`obility${option.value}`} className={option.style} onClick={this.selectClick}>
{option.label}
</div>
);
// if (option.selected) {
// clearBtnStyle = 'all-filter-btn selected-btn';
// }
});
return res;
}
};
render() {
return (
this.AllObilityOptionFunc()
);
return this.AllObilityOptionFunc();
}
}
......
......@@ -20,50 +20,50 @@ class ProtocolOptionsFilter extends Component {
componentDidMount = () => {
let { flag } = this.props;
let visibility = '';
if (flag === '1'){
if (flag === '1') {
visibility = '0';
} else if (flag === '2'){
} else if (flag === '2') {
visibility = '1';
}
// let defaultCriterias = [{ name: 'visibility',type: 'EQUAL',value: visibility }];
AmosFetch.post(OltSerUrl.protocolDataList,{ data: {} }).then(res => {
if (res.ok) {
return res.json();
}
else
{
throw new Error('从服务端获取数据失败!');
}
}).then((data)=>{
if (data.result === 'SUCCESS'){
if (data.dataList !== null){
let protocolCheckBoxList = [];
data.dataList.map(e=>{
protocolCheckBoxList.push({ value: e.id,label: e.name,selected: false,style: 'all-filter-btn' });
});
this.setState({ protocolOptions: protocolCheckBoxList });
AmosFetch.post(OltSerUrl.protocolDataList, { data: {} })
.then(res => {
if (res.ok) {
return res.json();
} else {
throw new Error('从服务端获取数据失败!');
}
}
});
}
})
.then(data => {
if (data.result === 'SUCCESS') {
if (data.dataList !== null) {
let protocolCheckBoxList = [];
data.dataList.map(e => {
protocolCheckBoxList.push({ value: e.id, label: e.name, selected: false, style: 'all-filter-btn' });
});
this.setState({ protocolOptions: protocolCheckBoxList });
}
}
});
};
//全清
delFilter = () => {
let { protocolOptions,clearBtnStyle } = this.state;
let { protocolOptions, clearBtnStyle } = this.state;
clearBtnStyle = 'all-filter-btn selected-btn';
protocolOptions.map(option=>{
protocolOptions.map(option => {
option.selected = false;
option.style = 'all-filter-btn';
});
this.setState({ protocolOptions,clearBtnStyle });
this.setState({ protocolOptions, clearBtnStyle });
this.props.protocolSelectFunc([]);
}
};
//筛选条件点击事件
selectClick = (e) => {
selectClick = e => {
let filterOptionList = [];
let { protocolOptions,clearBtnStyle } = this.state;
protocolOptions.map(option=>{
let { protocolOptions, clearBtnStyle } = this.state;
protocolOptions.map(option => {
if (option.label === e.target.innerText) {
if (option.selected) {
option.selected = false;
......@@ -83,37 +83,40 @@ class ProtocolOptionsFilter extends Component {
} else {
clearBtnStyle = 'all-filter-btn';
}
this.setState({ protocolOptions,clearBtnStyle });
this.setState({ protocolOptions, clearBtnStyle });
this.props.protocolSelectFunc(filterOptionList);
}
};
//反选‘不限’
disableAllSelected = () => {
let clearBtnStyle = 'all-filter-btn selected-btn';
this.setState({ clearBtnStyle });
}
};
//加载协议所有筛选按钮
AllProtocolOptionFunc = () => {
let { protocolOptions,clearBtnStyle } = this.state;
let { protocolOptions, clearBtnStyle } = this.state;
let res = [];
res.push(
<div key={`protocol0`} className={clearBtnStyle} onClick={this.delFilter}>
<div>不限</div>
</div>);
protocolOptions.map(option=>{
res.push(<div key={`protocol${option.value}`} className={option.style} onClick={this.selectClick}>{option.label}</div>);
</div>
);
protocolOptions.map(option => {
res.push(
<div key={`protocol${option.value}`} className={option.style} onClick={this.selectClick}>
{option.label}
</div>
);
// if (option.selected) {
// clearBtnStyle = 'all-filter-btn selected-btn';
// }
});
return res;
}
};
render() {
return (
this.AllProtocolOptionFunc()
);
return this.AllProtocolOptionFunc();
}
}
......
......@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
class Header extends Component {
render() {
const { title, extra } = this.props;
return (
......
......@@ -40,14 +40,13 @@ class ExtraTools extends Component {
this.loadUserInfo();
}
loadUserInfo = () => {
getCurrentUser().then(d => {
this.setState({
userInfo: d
});
});
}
};
handleClickUser = () => {
const { userInfo } = this.state;
......@@ -82,9 +81,13 @@ class ExtraTools extends Component {
if (userExtra) {
userContent = utils.isBoolean(userExtra) ? (
<ul>
<li className="modify-pwd" onClick={this.handleClickUser}>修改密码</li>
<li className="modify-pwd" onClick={this.handleClickUser}>
修改密码
</li>
</ul>
) : userExtra;
) : (
userExtra
);
}
const basicInfo = {
......@@ -94,16 +97,8 @@ class ExtraTools extends Component {
return (
<div className={cls}>
<Menu direction="horizontal">
{extraTools && extraTools}
</Menu>
<User
userPic={userPic}
basicInfo={basicInfo}
handleLogOut={this.handleLogOut}
extra={userContent}
onAvatarClick={this.handleClickUser}
/>
<Menu direction="horizontal">{extraTools && extraTools}</Menu>
<User userPic={userPic} basicInfo={basicInfo} handleLogOut={this.handleLogOut} extra={userContent} onAvatarClick={this.handleClickUser} />
</div>
);
}
......
......@@ -12,7 +12,6 @@ import ExtraTools from './ExtraTools';
* @extends {Component}
*/
class Header extends Component {
constructor(props) {
super(props);
this.state = {
......@@ -35,26 +34,26 @@ class Header extends Component {
onMouseOver = () => {
// 未打开
if (!this.expanded){
if (!this.expanded) {
this.expanded = true;
this.toggleSubMenu(this.expanded);
}
}
};
onMouseOut = () => {
if (this.expanded){
if (this.expanded) {
this.expanded = false;
this.toggleSubMenu(this.expanded);
}
}
};
toggleSubMenu = (flag) => {
toggleSubMenu = flag => {
const { height } = this.props;
const activeHeight = flag ? height : 0;
this.setState({
activeHeight
});
}
};
render() {
const { activeHeight, showText } = this.state;
......
......@@ -12,8 +12,7 @@ import connectMenu from './connectMenu';
*/
@connectMenu
export default class LevelMenu extends Component {
renderItemLink = (item) => {
renderItemLink = item => {
const { iconPrefix } = this.props;
const { icon, label, isBlank, path, permissionName } = item;
const NavIcon = icon && <Icon icon={icon} prefix={iconPrefix} className="menu-item-icon" />;
......@@ -34,15 +33,12 @@ export default class LevelMenu extends Component {
);
}
return Item;
}
};
render() {
const { className, onClick, nonChild, children } = this.props;
return (
<li
className={className}
onClick={onClick}
>
<li className={className} onClick={onClick}>
{this.renderItemLink(this.props)}
{!nonChild && <AFIcon icon="right" className="menu-subitem-icon" />}
{!nonChild && children}
......
......@@ -22,10 +22,7 @@ class Logo extends Component {
Logo.propTypes = {
logoImg: PropTypes.string,
onLogoClick: PropTypes.func,
logoExtra: PropTypes.oneOfType([
PropTypes.node,
PropTypes.bool
])
logoExtra: PropTypes.oneOfType([PropTypes.node, PropTypes.bool])
};
export default Logo;
......@@ -20,18 +20,13 @@ class MainFrame extends Component {
static propTypes = {
children: PropTypes.node,
logoImg: PropTypes.string,
logoExtra: PropTypes.oneOfType([
PropTypes.node,
PropTypes.bool
]),
logoExtra: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
opSearchMenusUrl: PropTypes.string,
// 菜单获取完成之后的操作[可进行打开默认页面] (menus) => {}
onMenuLoadCompleted: PropTypes.func,
defaultLink: PropTypes.string,
// 执行注销是跳转的路由,或者注销之后手动执行的方法
loginLink: PropTypes.oneOfType([
PropTypes.func
]),
loginLink: PropTypes.oneOfType([PropTypes.func]),
sysToolPorps: PropTypes.object,
isLoginout: PropTypes.bool,
logout: PropTypes.func,
......@@ -40,10 +35,7 @@ class MainFrame extends Component {
onLogoClick: PropTypes.func,
renderSubmenu: PropTypes.func,
// 菜单宽度
menuWidth: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),
menuWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
// 系统中使用到的 amos-icon组件,设置统一的 prefix,默认为 `amosicon`
iconPrefix: PropTypes.string
};
......@@ -51,7 +43,7 @@ class MainFrame extends Component {
static defaultProps = {
iconPrefix: 'amosicon',
defaultLink: '/main',
loginLink: () =>{},
loginLink: () => {},
onMenuLoadCompleted: () => {},
menuWidth: '8rem'
};
......@@ -73,7 +65,7 @@ class MainFrame extends Component {
componentWillReceiveProps(nextProps) {
const { loginLink } = this.props;
if (nextProps.isLoginout) {
if (utils.isFunction(loginLink)){
if (utils.isFunction(loginLink)) {
loginLink();
}
}
......@@ -85,20 +77,22 @@ class MainFrame extends Component {
getPermissionsMenus(role).then((menus = []) => {
const lsTool = Store.lsTool;
lsTool.write(SysConsts.permissions, JSON.stringify(menus));
this.setState({
extendSystem: menus
}, () => onMenuLoadCompleted(menus));
this.setState(
{
extendSystem: menus
},
() => onMenuLoadCompleted(menus)
);
});
};
onLogoClick = () => {
const { defaultLink } = this.props;
if (defaultLink){
if (defaultLink) {
this.context.router ? this.context.router.push(defaultLink) : browserHistory.push(defaultLink);
}
this.props.onLogoClick && this.props.onLogoClick();
}
};
render() {
const { children, logoImg, sysToolPorps, logout, sweepReducers, logoExtra, renderSubmenu, menuWidth, iconPrefix } = this.props;
......
......@@ -23,29 +23,29 @@ class MenuItem extends PureComponent {
isActive = () => {
const { menuKey, activeKey } = this.props;
return menuKey === activeKey;
}
};
genHiddenStyle = () => {
const { height = 0 } = this.props;
if (height > 0){
if (height > 0) {
return {};
}
return {
display: 'none'
};
}
};
genStyle = () => {
const { menuWidth } = this.props;
if (menuWidth){
if (menuWidth) {
return {
width: menuWidth
};
}
return {};
}
};
renderItemLink = (item) => {
renderItemLink = item => {
const { iconPrefix } = this.props;
const NavIcon = item.icon && <Icon icon={item.icon} prefix={iconPrefix} className="menu-item-icon" />;
let Item;
......@@ -65,56 +65,52 @@ class MenuItem extends PureComponent {
);
}
return Item;
}
};
renderSub = () => {
const { menuKey, children, onSubMenuClick, activeSubKey, setSubMenuActive, renderSubmenu, menuWidth, iconPrefix } = this.props;
const hiddenStyle = this.genHiddenStyle();
return (
<ul className="menu-sublist">
{
children.map(c => {
const cls = classNames('menu-subitem', {
'active': c.sequenceNbr === activeSubKey
{children.map(c => {
const cls = classNames('menu-subitem', {
active: c.sequenceNbr === activeSubKey
});
if (renderSubmenu) {
return renderSubmenu({
...c,
className: cls,
onSubMenuClick,
setSubMenuActive
});
if (renderSubmenu){
return renderSubmenu({
...c,
className: cls,
onSubMenuClick,
setSubMenuActive
});
}
return (
<SubMenuItem
{...c}
key={c.sequenceNbr}
className={cls}
iconPrefix={iconPrefix}
menuKey={c.sequenceNbr}
rootMenuKey={menuKey}
subItems={c.children}
onClick={() => onSubMenuClick(menuKey, c.sequenceNbr)}
onSubMenuClick={onSubMenuClick}
setMenuActive={setSubMenuActive}
menuWidth={menuWidth}
>
{this.renderItemLink(c)}
{c.children && c.children.length > 0 && <AFIcon icon="right" className="menu-subitem-icon" style={hiddenStyle} />}
</SubMenuItem>
);
})
}
}
return (
<SubMenuItem
{...c}
key={c.sequenceNbr}
className={cls}
iconPrefix={iconPrefix}
menuKey={c.sequenceNbr}
rootMenuKey={menuKey}
subItems={c.children}
onClick={() => onSubMenuClick(menuKey, c.sequenceNbr)}
onSubMenuClick={onSubMenuClick}
setMenuActive={setSubMenuActive}
menuWidth={menuWidth}
>
{this.renderItemLink(c)}
{c.children && c.children.length > 0 && <AFIcon icon="right" className="menu-subitem-icon" style={hiddenStyle} />}
</SubMenuItem>
);
})}
</ul>
);
}
};
/** 渲染一个没有二级菜单的块,用于颜色分布 */
renderNonSub = () => {
return (
<ul className="menu-sublist" />
);
}
return <ul className="menu-sublist" />;
};
renderFooter = () => {
const { footerIcon, extraIcon, icon, iconPrefix } = this.props;
......@@ -123,24 +119,22 @@ class MenuItem extends PureComponent {
const imgContent = utils.isImageSrc(_icon) ? <img src={_icon} alt="" /> : <Icon prefix={iconPrefix} icon={_icon} />;
return (
<div className="nav-menu-item-footer" style={hiddenStyle}>
<div className="footer-icon">
{imgContent}
</div>
<div className="footer-icon">{imgContent}</div>
<span className="footer-line" />
</div>
);
}
};
render() {
const { menuKey, permissionName, children, activeKey, height = 0, ...rest } = this.props;
let itemContent;
if (children){
if (children) {
itemContent = <div className="nav-menu-item-label">{permissionName}</div>;
} else {
itemContent = <div className="nav-menu-item-label">{this.renderItemLink({ permissionName, ...rest })}</div>;
}
const cls = classNames('nav-menu-item', {
'active': menuKey === activeKey
active: menuKey === activeKey
});
const style = this.genStyle();
return (
......@@ -166,13 +160,15 @@ MenuItem.propTypes = {
footerIcon: PropTypes.string,
extraIcon: PropTypes.string,
path: PropTypes.string,
children: PropTypes.arrayOf(PropTypes.shape({
sequenceNbr: PropTypes.string.isRequired,
permissionName: PropTypes.string,
icon: PropTypes.string,
path: PropTypes.string,
isBlank: PropTypes.bool
})),
children: PropTypes.arrayOf(
PropTypes.shape({
sequenceNbr: PropTypes.string.isRequired,
permissionName: PropTypes.string,
icon: PropTypes.string,
path: PropTypes.string,
isBlank: PropTypes.bool
})
),
activeKey: PropTypes.string,
activeSubKey: PropTypes.string,
setMenuActive: PropTypes.func,
......@@ -181,10 +177,7 @@ MenuItem.propTypes = {
onMenuClosed: PropTypes.func,
toggleSubMenu: PropTypes.func,
renderSubmenu: PropTypes.func,
menuWidth: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
menuWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
};
export default MenuItem;
......@@ -9,7 +9,6 @@ import MenuItem from './MenuItem';
* @extends {PureComponent}
*/
class MenuList extends PureComponent {
constructor(props) {
super(props);
this.state = {
......@@ -26,25 +25,25 @@ class MenuList extends PureComponent {
activeSubKey: subKey
});
this.props.onMenuClosed();
}
};
setMenuActive = (key) => {
setMenuActive = key => {
const { activeKey } = this.state;
if (activeKey !== key){
if (activeKey !== key) {
this.setState({
activeKey: key
});
}
}
};
setSubMenuActive = (key) => {
setSubMenuActive = key => {
const { activeSubKey } = this.state;
if (activeSubKey !== key){
if (activeSubKey !== key) {
this.setState({
activeSubKey: key
});
}
}
};
render() {
const { activeKey, activeSubKey } = this.state;
......@@ -53,35 +52,29 @@ class MenuList extends PureComponent {
return (
<div className="nav-menu-wrapper">
<div className={cls}>
<div
className="nav-menu-bg"
style={{ height }}
onMouseOver={this.onMouseOver}
onMouseOut={this.onMouseOut}
/>
<div className="nav-menu-bg" style={{ height }} onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut} />
<ul className="nav-menu-list" onMouseOver={onMenuOpen} onMouseOut={onMenuClosed}>
{
(navs || []).map(n => {
const { sequenceNbr, ...rest } = n;
return (
<MenuItem
key={sequenceNbr}
{...rest}
iconPrefix={iconPrefix}
menuKey={sequenceNbr}
height={height}
activeKey={activeKey}
activeSubKey={activeSubKey}
setMenuActive={this.setMenuActive}
setSubMenuActive={this.setSubMenuActive}
onSubMenuClick={this.onSubMenuClick}
onMenuClosed={onMenuClosed}
toggleSubMenu={toggleSubMenu}
renderSubmenu={renderSubmenu}
menuWidth={menuWidth}
/>);
})
}
{(navs || []).map(n => {
const { sequenceNbr, ...rest } = n;
return (
<MenuItem
key={sequenceNbr}
{...rest}
iconPrefix={iconPrefix}
menuKey={sequenceNbr}
height={height}
activeKey={activeKey}
activeSubKey={activeSubKey}
setMenuActive={this.setMenuActive}
setSubMenuActive={this.setSubMenuActive}
onSubMenuClick={this.onSubMenuClick}
onMenuClosed={onMenuClosed}
toggleSubMenu={toggleSubMenu}
renderSubmenu={renderSubmenu}
menuWidth={menuWidth}
/>
);
})}
</ul>
</div>
</div>
......@@ -91,21 +84,20 @@ class MenuList extends PureComponent {
MenuList.propTypes = {
height: PropTypes.number,
navs: PropTypes.arrayOf(PropTypes.shape({
sequenceNbr: PropTypes.string.isRequired,
permissionName: PropTypes.string.isRequired,
icon: PropTypes.string,
path: PropTypes.string,
children: PropTypes.array
})),
navs: PropTypes.arrayOf(
PropTypes.shape({
sequenceNbr: PropTypes.string.isRequired,
permissionName: PropTypes.string.isRequired,
icon: PropTypes.string,
path: PropTypes.string,
children: PropTypes.array
})
),
toggleSubMenu: PropTypes.func,
onMenuOpen: PropTypes.func,
onMenuClosed: PropTypes.func,
renderSubmenu: PropTypes.func,
menuWidth: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
menuWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
};
export default MenuList;
......@@ -7,10 +7,10 @@ import connectMenu from './connectMenu';
import LevelMenu from './LevelMenu';
const calcHtmlSize = (value, ratio) => {
if (!utils.isNil(value) && !utils.isNull(value)){
if (utils.isNumber(value)){
if (!utils.isNil(value) && !utils.isNull(value)) {
if (utils.isNumber(value)) {
return parseFloat(value) * ratio;
} else if (utils.isString(value)){
} else if (utils.isString(value)) {
const numVal = parseFloat(value);
const unit = value.replace(numVal, '');
return `${numVal * ratio}${unit}`;
......@@ -28,14 +28,13 @@ const calcHtmlSize = (value, ratio) => {
*/
@connectMenu
class SubMenuItem extends PureComponent {
genRecursiveStyle = (level) => {
genRecursiveStyle = level => {
const { menuWidth } = this.props;
return {
width: menuWidth,
left: calcHtmlSize(menuWidth, level)
};
}
};
/** 每一个 subitem 均是其父节点的内容,所以只需要 left 其父节点的宽即可 */
genRecursiveStyle2 = () => {
......@@ -44,7 +43,7 @@ class SubMenuItem extends PureComponent {
width: menuWidth,
left: menuWidth
};
}
};
recursiveRender = (subItems, level = 1) => {
const { onSubMenuClick, rootMenuKey, iconPrefix } = this.props;
......@@ -52,44 +51,37 @@ class SubMenuItem extends PureComponent {
const style = this.genRecursiveStyle2();
return (
<ul className={cls} style={style}>
{
subItems.map(si => {
const cls = classNames('menu-subitem', {
// 'active': si.key === activeRecursiveKey
});
const nonChild = utils.isEmpty(si.children);
let newLevel = level;
if (!nonChild){
newLevel += 1;
}
return (
<LevelMenu
{...si}
key={si.sequenceNbr}
menuKey={si.sequenceNbr}
className={cls}
iconPrefix={iconPrefix}
nonChild={nonChild}
onClick={() => onSubMenuClick(rootMenuKey, si.sequenceNbr)}
>
{
!nonChild && this.recursiveRender(si.children, newLevel)
}
</LevelMenu>
);
})
}
{subItems.map(si => {
const cls = classNames('menu-subitem', {
// 'active': si.key === activeRecursiveKey
});
const nonChild = utils.isEmpty(si.children);
let newLevel = level;
if (!nonChild) {
newLevel += 1;
}
return (
<LevelMenu
{...si}
key={si.sequenceNbr}
menuKey={si.sequenceNbr}
className={cls}
iconPrefix={iconPrefix}
nonChild={nonChild}
onClick={() => onSubMenuClick(rootMenuKey, si.sequenceNbr)}
>
{!nonChild && this.recursiveRender(si.children, newLevel)}
</LevelMenu>
);
})}
</ul>
);
}
};
render() {
const { className, children, onClick, subItems } = this.props;
return (
<li
className={className}
onClick={onClick}
>
<li className={className} onClick={onClick}>
{children}
{subItems && subItems.length > 0 && this.recursiveRender(subItems)}
</li>
......@@ -108,10 +100,7 @@ SubMenuItem.propTypes = {
onSubMenuClick: PropTypes.func,
children: PropTypes.node,
subItems: PropTypes.array,
menuWidth: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
menuWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
};
export default SubMenuItem;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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