Commit 10cd3e0e authored by 程恺文's avatar 程恺文

视频组件文档更新

parent 71d3bf70
import {request} from '@wisdom-utils/utils';
import { request } from '@wisdom-utils/utils';
import * as constants from '../../constants';
const MonitorDevice = '/PandaMonitor/Monitor/Device';
const API = {
GET_ALARM_LIST_REAL_TIME: `${MonitorDevice}/GetAlarmListRealTime`,
GET_DEVICE_QUOTA_LIST: `${MonitorDevice}/GetQuotaList`, //
GET_EQUIPMENT_INFO: `${MonitorDevice}/GetEquipmentInfo`, // 获取设备树
GET_ALARM_LIST_REAL_TIME: `${MonitorDevice}/GetAlarmListRealTime`,
GET_DEVICE_QUOTA_LIST: `${MonitorDevice}/GetQuotaList`, //
GET_EQUIPMENT_INFO: `${MonitorDevice}/GetEquipmentInfo`, // 获取设备树
};
const monitorServices = {
GetAlarmListRealTime: {
url: API.GET_ALARM_LIST_REAL_TIME, // 获取 数据维护日志
method: constants.REQUEST_METHOD_POST,
type: constants.REQUEST_HTTP,
},
GetDeviceQuotaList: {
url: API.GET_DEVICE_QUOTA_LIST,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
getEquipmentInfo: {
url: API.GET_EQUIPMENT_INFO,
method: constants.REQUEST_METHOD_POST,
type: constants.REQUEST_HTTP,
},
GetAlarmListRealTime: {
url: API.GET_ALARM_LIST_REAL_TIME, // 获取 数据维护日志
method: constants.REQUEST_METHOD_POST,
type: constants.REQUEST_HTTP,
},
GetDeviceQuotaList: {
url: API.GET_DEVICE_QUOTA_LIST,
method: constants.REQUEST_METHOD_GET,
type: constants.REQUEST_HTTP,
},
getEquipmentInfo: {
url: API.GET_EQUIPMENT_INFO,
method: constants.REQUEST_METHOD_POST,
type: constants.REQUEST_HTTP,
},
};
export default monitorServices;
......@@ -22,7 +22,7 @@ const ECharts = memo(
ref={ref}
className={classNames(prefixCls, props.className)}
option={option}
style={{width: '100%',height:'100%'}}
style={{ width: '100%', height: '100%' }}
{...chartProps}
/>
);
......
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.10.1](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basicreport@1.10.0...@wisdom-components/basicreport@1.10.1) (2023-04-12)
**Note:** Version bump only for package @wisdom-components/basicreport
# [1.10.0](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/@wisdom-components/basicreport@1.9.3...@wisdom-components/basicreport@1.10.0) (2023-02-23)
### Features
......
const isObject = (obj) => {
return Object.prototype.toString.call(obj) === '[object Object]';
return Object.prototype.toString.call(obj) === '[object Object]';
};
const isString = (obj) => {
return Object.prototype.toString.call(obj) === '[object String]';
return Object.prototype.toString.call(obj) === '[object String]';
};
const isNumber = (num) => {
return Object.prototype.toString.call(num) === '[object Number]';
return Object.prototype.toString.call(num) === '[object Number]';
};
const isArray = (arr) => {
return Object.prototype.toString.call(arr) === '[object Array]';
return Object.prototype.toString.call(arr) === '[object Array]';
};
const isFunction = (obj) => {
return Object.prototype.toString.call(obj) === '[object Function]';
}
return Object.prototype.toString.call(obj) === '[object Function]';
};
const hasMoney = (configItems) => {
if (!configItems) return false;
let _items = configItems.split('|');
return !!_items.find((item) => item === '金额');
if (!configItems) return false;
let _items = configItems.split('|');
return !!_items.find((item) => item === '金额');
};
const isSelect = (configItems) => {
if (!configItems) return false;
let _items = configItems.split('|');
return !!_items.find((item) => item === 'renderAsSelect');
if (!configItems) return false;
let _items = configItems.split('|');
return !!_items.find((item) => item === 'renderAsSelect');
};
// options=name1[.value1],name2[.value2],name3[.value3];
const returnOptions = (configItems) => {
if (!configItems) return false;
let _items = configItems.split('|');
let _options = _items.find((item) => item.includes('options='));
if (!_options) return false;
return _options.replace('options=', '').split(',');
if (!configItems) return false;
let _items = configItems.split('|');
let _options = _items.find((item) => item.includes('options='));
if (!_options) return false;
return _options.replace('options=', '').split(',');
};
const returnRows = (configItems) => {
if (!configItems) return 3;
let _items = configItems.split('|');
let _options = _items.find((item) => item.includes('rows='));
if (!_options) return 3;
let _rows = Number(_options.replace('rows=', ''));
return !isNaN(_rows) && _rows >= 1 ? _rows : 3;
if (!configItems) return 3;
let _items = configItems.split('|');
let _options = _items.find((item) => item.includes('rows='));
if (!_options) return 3;
let _rows = Number(_options.replace('rows=', ''));
return !isNaN(_rows) && _rows >= 1 ? _rows : 3;
};
const returnCols = (configItems) => {
if (!configItems) return 1;
let _items = configItems.split('|');
let _options = _items.find((item) => item.includes('cols='));
if (!_options) return 1;
let _cols = Number(_options.replace('cols=', ''));
return !isNaN(_cols) && _cols <= 3 && _cols >= 0 ? _cols : 1;
if (!configItems) return 1;
let _items = configItems.split('|');
let _options = _items.find((item) => item.includes('cols='));
if (!_options) return 1;
let _cols = Number(_options.replace('cols=', ''));
return !isNaN(_cols) && _cols <= 3 && _cols >= 0 ? _cols : 1;
};
/**
* @description: 用来在summary中处理数值的配置
......@@ -54,36 +54,36 @@ const returnCols = (configItems) => {
* @author: ChenLong
*/
const returnHandledNumber = (configItems, num, isSummary) => {
// 精度、前缀、后缀、倍率
// $_d|_d%|_d*0.0001|金额|0.00
if (isNaN(num)) return '-';
if (!configItems) return num;
num = Number(num);
let _items = configItems.split('|');
/* let prefix = '';
// 精度、前缀、后缀、倍率
// $_d|_d%|_d*0.0001|金额|0.00
if (isNaN(num)) return '-';
if (!configItems) return num;
num = Number(num);
let _items = configItems.split('|');
/* let prefix = '';
let suffix = '';*/
let template = '_d';
let precision = 0;
let rate = 1;
_items.forEach((item) => {
let _arr = [];
if (item.match(/_d[^\*]/)) {
// 后缀
template = item;
} else if (item.match(/^_d\*/)) {
// 倍率
let _rate = item.replace(/_d\*/, '');
rate = _rate && isSummary ? Number(_rate) : 1; // 总结栏计算需要计算倍率,其他不用
} else if (item.match(/^0\./)) {
// 精度
precision = item.replace('0.', '').length;
}
});
// 可能存在NaN的问题
let final = _items.includes('金额')
? Number((num * rate).toFixed(precision)).toLocaleString()
: Number((num * rate).toFixed(precision)).toLocaleString();
return template.replace(/_d/, isString(final) ? final : '-');
let template = '_d';
let precision = 0;
let rate = 1;
_items.forEach((item) => {
let _arr = [];
if (item.match(/_d[^\*]/)) {
// 后缀
template = item;
} else if (item.match(/^_d\*/)) {
// 倍率
let _rate = item.replace(/_d\*/, '');
rate = _rate && isSummary ? Number(_rate) : 1; // 总结栏计算需要计算倍率,其他不用
} else if (item.match(/^0\./)) {
// 精度
precision = item.replace('0.', '').length;
}
});
// 可能存在NaN的问题
let final = _items.includes('金额')
? Number((num * rate).toFixed(precision)).toLocaleString()
: Number((num * rate).toFixed(precision)).toLocaleString();
return template.replace(/_d/, isString(final) ? final : '-');
};
/**
* @description: 返回configItems内配置的默认值、默认模式等等
......@@ -103,21 +103,21 @@ const returnHandledNumber = (configItems, num, isSummary) => {
* defaultDateValue 时间参数 默认时间
*/
const returnDefaultValueOrConfigs = (configItems = '', keysArray = []) => {
let _map = {};
let _configItemsArray = configItems.split('|');
keysArray.forEach((key) => {
_map[key] = _configItemsArray.find((item) => item.includes(`${key}=`))?.replace(`${key}=`, '');
});
return _map;
let _map = {};
let _configItemsArray = configItems.split('|');
keysArray.forEach((key) => {
_map[key] = _configItemsArray.find((item) => item.includes(`${key}=`))?.replace(`${key}=`, '');
});
return _map;
};
function downloadFunc(url, name, target = '_self') {
const a = document.createElement('a');
a.href = url;
a.target = target;
a.download = name;
a.click();
a.remove();
const a = document.createElement('a');
a.href = url;
a.target = target;
a.download = name;
a.click();
a.remove();
}
/**
......@@ -128,36 +128,36 @@ function downloadFunc(url, name, target = '_self') {
* @returns {Object} {type: error | success ,content: 提示...}
*/
function filenameVerification(file, special) {
// 文件名含有特殊字符 提示不能上传 {+,:/?#[]@!$&\\*+;=}
// 规则对象(flag)
var flag = !special
? new RegExp("[`~!@#$^&*=|{}':;',\\[\\]/?~!@#¥&*——|{}【】‘;:”“'。,、?]")
: new RegExp("[`~!@#$^&*=|{}':;',[\\]?~!@#¥&*——|{}【】‘;:”“'。,、?]");
if (flag.test(file.name)) {
return {
type: 'error',
content: `文件名格式错误,请检查文件名是否含有特殊字符${"~!@#$^&*=|{}':;',\\[\\]/?~!@#¥&*——|{}【】‘;:”“'。,、?"}`,
};
}
// 文件名含有特殊字符 提示不能上传 {+,:/?#[]@!$&\\*+;=}
// 规则对象(flag)
var flag = !special
? new RegExp("[`~!@#$^&*=|{}':;',\\[\\]/?~!@#¥&*——|{}【】‘;:”“'。,、?]")
: new RegExp("[`~!@#$^&*=|{}':;',[\\]?~!@#¥&*——|{}【】‘;:”“'。,、?]");
if (flag.test(file.name)) {
return {
type: 'success',
content: `上传成功!`,
type: 'error',
content: `文件名格式错误,请检查文件名是否含有特殊字符${"~!@#$^&*=|{}':;',\\[\\]/?~!@#¥&*——|{}【】‘;:”“'。,、?"}`,
};
}
return {
type: 'success',
content: `上传成功!`,
};
}
export {
isObject,
isString,
isNumber,
hasMoney,
isArray,
isFunction,
returnHandledNumber,
returnDefaultValueOrConfigs,
downloadFunc,
filenameVerification,
isSelect,
returnOptions,
returnRows,
returnCols,
isObject,
isString,
isNumber,
hasMoney,
isArray,
isFunction,
returnHandledNumber,
returnDefaultValueOrConfigs,
downloadFunc,
filenameVerification,
isSelect,
returnOptions,
returnRows,
returnCols,
};
<!--
* @Title:
* @Title:
* @Author: hongmye
* @Date: 2023-02-08 16:03:42
-->
# `@wisdom-components/dataCarousel`
> TODO: description
......
......@@ -11,20 +11,18 @@ group:
列表数据多行轮播滚动,会跟据容器高度和行高及间隔计算每页最大数量。鼠标悬浮停止轮播
## 代码演示
<code src="./demos/Basic.tsx">
## API
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| renderItem | 自定义渲染每项内容(必传) | ReactNode | - |
| itemHeight | 每行行高, | number | 40 |
| list | 数据源 | array | [] |
| gap | 每项间隔(每页最后一项没有) | array | [] |
| renderGap | 自定义间隔样式 | ReactNode | null |
| autoplay | 轮播时间,单位ms,传0则不轮播 | number | 3000 |
| config | swiper参数 | object | {} |
\ No newline at end of file
| 参数 | 说明 | 类型 | 默认值 |
| ---------- | -------------------------------- | --------- | ------ |
| renderItem | 自定义渲染每项内容(必传) | ReactNode | - |
| itemHeight | 每行行高, | number | 40 |
| list | 数据源 | array | [] |
| gap | 每项间隔(每页最后一项没有) | array | [] |
| renderGap | 自定义间隔样式 | ReactNode | null |
| autoplay | 轮播时间,单位 ms,传 0 则不轮播 | number | 3000 |
| config | swiper 参数 | object | {} |
.list_item {
height: 40px;
line-height: 1;
background: rgba(255, 0, 0, 0.5);
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0 10px;
}
\ No newline at end of file
.list_item {
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
height: 40px;
padding: 0 10px;
line-height: 1;
background: rgba(255, 0, 0, 0.5);
}
@root-entry-name: 'default';
@import '~antd/es/style/themes/index.less';
.dataCarousel {
width: 100%;
height: 100%;
......@@ -15,8 +14,8 @@
.dataCarousel {
:global {
.swiper-container {
height: 100%;
width: 100%;
height: 100%;
}
}
}
\ No newline at end of file
}
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.3.7](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/parseform@1.3.6...parseform@1.3.7) (2023-04-12)
**Note:** Version bump only for package parseform
## [1.3.6](https://g.civnet.cn:8443/ReactWeb5/wisdom-components/compare/parseform@1.3.5...parseform@1.3.6) (2023-02-09)
### Bug Fixes
......
......@@ -32,15 +32,15 @@ group:
| onChange | 内容改变回调 |
| onChangeFile | 文件改变回调(没有,则工具栏上不显示上传附件按钮) |
## ref事件
## ref 事件
| 名称 | 描述 |
| ------------ | -------------------------------------------------- |
| setHtml | 设置内容 |
| onClear | 清除内容 |
| getHtml | 获取html字符串 |
| 名称 | 描述 |
| ------- | ------------------------ |
| setHtml | 设置内容 |
| onClear | 清除内容 |
| getHtml | 获取 html 字符串 |
| getText | 获取纯内容(不包含标签) |
## API
## API
api 参考 Antd Table 组件 https://www.wangeditor.com/v4/
.RichTextDemoContainer {
// height: 400px;
// padding: 0px 100px;
background-color: #fff;
}
.contentBox {
// height: 400px;
margin-top: 10px;
padding: 20px;
background-color: #fff;
}
.RichTextDemo {
height: 100%;
overflow-y: scroll;
}
\ No newline at end of file
.RichTextDemoContainer {
// height: 400px;
// padding: 0px 100px;
background-color: #fff;
}
.contentBox {
// height: 400px;
margin-top: 10px;
padding: 20px;
background-color: #fff;
}
.RichTextDemo {
height: 100%;
overflow-y: scroll;
}
@import '~antd/es/style/themes/default.less';
// @import '~antd/es/image/style/index.less';
.RichText {
width: 100%;
height: auto;
min-height: 200px;
position: relative;
display: flex;
flex-direction: column;
border: 1px solid #d9d9d9;
border-radius: 2px;
.loadingWrap {
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
top: 0;
left: 0;
background-color: rgba(255, 255, 255, 0.8);
}
.selectBox {
position: absolute;
top: 0;
left: 0;
background: #fff;
max-height: 250px;
overflow-y: scroll;
display: none;
}
.selectList{
border: 1px solid #efefef;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.16), 0 0;
}
.selectList .selectItem:hover {
background: #1685FF;
color: #fff;
cursor: pointer;
}
.selectList .selectActiveItem {
background: #1685FF;
color: #fff;
}
.selectItem {
padding: 5px 10px;
}
ol li {
list-style: decimal !important;
}
ul li {
list-style: disc !important;
}
}
.RichTextFileList {
padding: 20px;
:global {
.@{ant-prefix}-upload-list-item {
height: 44px;
padding: 8px 16px;
.@{ant-prefix}-upload-list-item-thumbnail,
.@{ant-prefix}-upload-list-item-file {
width: 20px;
height: 22px;
>img {
width: 100%;
height: 100%;
}
}
.@{ant-prefix}-upload-list-item-name {
line-height: normal;
}
}
}
}
.RichTextContainer {
background-color: #fff;
color: #000000d9;
position: relative;
overflow-y: scroll;
flex: 1;
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
}
.RichTextToolbar {
border-bottom: 1px solid #d9d9d9;
// height: 0;
// overflow: hidden;
}
.RichTextShow img {
cursor: pointer;
}
.RichTextShow span[data-type='person'] {
font-weight: bold;
color: #44acb6 !important;
}
:global {
#RichTextContainer span[data-type='person'] {
font-weight: bold;
color: #44acb6 !important;
}
.w-e-menu[data-title="图片"] {
display: none;
}
.RichText-image {
position: relative;
display: inline-block;
}
#RichTextContainer .RichText-image-img {
max-width: calc(100% - 20px);
display: inline-block;
width: auto;
height: auto;
}
.RichText-image-mask {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
background: rgba(0, 0, 0, 0.5);
cursor: pointer;
opacity: 0;
transition: opacity 0.3s;
padding: 0;
margin: 0;
box-sizing: border-box;
}
.RichText-image-mask-info {
padding: 0;
margin: 0;
box-sizing: border-box;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
cursor: pointer;
color: #fff;
font-size: 20px;
}
.RichText-image-mask-info .anticon {
margin-inline-end: 4px;
}
.anticon svg {
display: inline-block;
}
.RichText-image-mask:hover {
opacity: 1;
}
.r-t-add-file {
color: #999;
font-family: 'w-e-icon' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
padding: 0;
margin: 0;
box-sizing: border-box;
}
.r-t-add-file:before {
content: "\e9cb";
}
.@{ant-prefix}-image-error {
display: block;
}
}
\ No newline at end of file
@import '~antd/es/style/themes/default.less';
// @import '~antd/es/image/style/index.less';
.RichText {
position: relative;
display: flex;
flex-direction: column;
width: 100%;
height: auto;
min-height: 200px;
border: 1px solid #d9d9d9;
border-radius: 2px;
.loadingWrap {
position: absolute;
top: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.8);
}
.selectBox {
position: absolute;
top: 0;
left: 0;
display: none;
max-height: 250px;
overflow-y: scroll;
background: #fff;
}
.selectList {
border: 1px solid #efefef;
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.16), 0 0;
}
.selectList .selectItem:hover {
color: #fff;
background: #1685ff;
cursor: pointer;
}
.selectList .selectActiveItem {
color: #fff;
background: #1685ff;
}
.selectItem {
padding: 5px 10px;
}
ol li {
list-style: decimal !important;
}
ul li {
list-style: disc !important;
}
}
.RichTextFileList {
padding: 20px;
:global {
.@{ant-prefix}-upload-list-item {
height: 44px;
padding: 8px 16px;
.@{ant-prefix}-upload-list-item-thumbnail,
.@{ant-prefix}-upload-list-item-file {
width: 20px;
height: 22px;
> img {
width: 100%;
height: 100%;
}
}
.@{ant-prefix}-upload-list-item-name {
line-height: normal;
}
}
}
}
.RichTextContainer {
position: relative;
flex: 1;
overflow-y: scroll;
color: #000000d9;
background-color: #fff;
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
}
.RichTextToolbar {
border-bottom: 1px solid #d9d9d9;
// height: 0;
// overflow: hidden;
}
.RichTextShow img {
cursor: pointer;
}
.RichTextShow span[data-type='person'] {
color: #44acb6 !important;
font-weight: bold;
}
:global {
#RichTextContainer span[data-type='person'] {
color: #44acb6 !important;
font-weight: bold;
}
.w-e-menu[data-title='图片'] {
display: none;
}
.RichText-image {
position: relative;
display: inline-block;
}
#RichTextContainer .RichText-image-img {
display: inline-block;
width: auto;
max-width: calc(100% - 20px);
height: auto;
}
.RichText-image-mask {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
margin: 0;
padding: 0;
color: #fff;
background: rgba(0, 0, 0, 0.5);
cursor: pointer;
opacity: 0;
transition: opacity 0.3s;
}
.RichText-image-mask-info {
box-sizing: border-box;
margin: 0;
padding: 0;
overflow: hidden;
color: #fff;
font-size: 20px;
white-space: nowrap;
text-overflow: ellipsis;
cursor: pointer;
}
.RichText-image-mask-info .anticon {
margin-inline-end: 4px;
}
.anticon svg {
display: inline-block;
}
.RichText-image-mask:hover {
opacity: 1;
}
.r-t-add-file {
box-sizing: border-box;
margin: 0;
padding: 0;
color: #999;
font-weight: normal;
font-family: 'w-e-icon' !important;
font-style: normal;
font-variant: normal;
line-height: 1;
text-transform: none;
speak: none;
-webkit-font-smoothing: antialiased;
}
.r-t-add-file:before {
content: '\e9cb';
}
.@{ant-prefix}-image-error {
display: block;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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