Commit 3df1e6e9 authored by 田翔's avatar 田翔
parents db009708 47161798
Pipeline #88052 passed with stages
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
"js-calendar-converter": "0.0.4", "js-calendar-converter": "0.0.4",
"lodash": "4.17.11", "lodash": "4.17.11",
"minimist": "1.2.0", "minimist": "1.2.0",
"panda-xform": "6.0.14", "panda-xform": "6.0.16",
"parseForm": "^2.3.8", "parseForm": "^2.3.8",
"prop-types": "15.7.2", "prop-types": "15.7.2",
"qrcode.react": "^3.1.0", "qrcode.react": "^3.1.0",
......
...@@ -14,7 +14,7 @@ const PictureWallProvider = props => { ...@@ -14,7 +14,7 @@ const PictureWallProvider = props => {
const [imgBed, setImgBed] = useState([]); const [imgBed, setImgBed] = useState([]);
const update = () => const update = () =>
getImageBases('icon,androidMenu,menuNew,logo,CityTemp,bootAnimation,loginPageImage,homePageImage') getImageBases('icon,androidMenu,menuNew,logo,CityTemp,bootAnimation,loginPageImage,homePageImage,userPageImage')
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
const { data } = res; const { data } = res;
......
...@@ -34,7 +34,7 @@ const tabNames: any = { ...@@ -34,7 +34,7 @@ const tabNames: any = {
loginPageImage: '登录页', loginPageImage: '登录页',
homePageImage: '主页焦点图', homePageImage: '主页焦点图',
userPageImage: '背景图', userPageImage: '背景图',
bootAnimation: '过渡页', bootAnimation: '启动过渡页',
} }
function getBase64(file: File | Blob) { function getBase64(file: File | Blob) {
......
...@@ -402,7 +402,12 @@ const StandingBook = props => { ...@@ -402,7 +402,12 @@ const StandingBook = props => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -366,9 +366,11 @@ const TableManager = props => { ...@@ -366,9 +366,11 @@ const TableManager = props => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
const escapedSearchValue = searchValue.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace( n = val.replace(
new RegExp(searchValue, 'g'), regex,
`<span style='color:red'>${searchValue}</span>`, `<span style='color:red'>${searchValue}</span>`
); );
} else { } else {
n = val; n = val;
......
...@@ -514,9 +514,11 @@ const incident = () => { ...@@ -514,9 +514,11 @@ const incident = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
const escapedSearchValue = searchValue.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace( n = val.replace(
new RegExp(searchValue, 'g'), regex,
`<span style='color:red'>${searchValue}</span>`, `<span style='color:red'>${searchValue}</span>`
); );
} else { } else {
n = val; n = val;
......
...@@ -288,9 +288,11 @@ const Flow = () => { ...@@ -288,9 +288,11 @@ const Flow = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
const escapedSearchValue = searchValue.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace( n = val.replace(
new RegExp(searchValue, 'g'), regex,
`<span style='color:red'>${searchValue}</span>`, `<span style='color:red'>${searchValue}</span>`
); );
} else { } else {
n = val; n = val;
......
...@@ -287,7 +287,12 @@ const WebDic = () => { ...@@ -287,7 +287,12 @@ const WebDic = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -565,7 +565,12 @@ const LogCenter = () => { ...@@ -565,7 +565,12 @@ const LogCenter = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(requestUrl, 'g'), `<span style='color:red'>${requestUrl}</span>`); const escapedSearchValue = requestUrl.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${requestUrl}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -127,9 +127,11 @@ const OmsLog = () => { ...@@ -127,9 +127,11 @@ const OmsLog = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
const escapedSearchValue = functionName.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace( n = val.replace(
new RegExp(functionName, 'g'), regex,
`<span style='color:red'>${functionName}</span>`, `<span style='color:red'>${functionName}</span>`
); );
} else { } else {
n = val; n = val;
......
...@@ -310,7 +310,12 @@ const ServiceLog = () => { ...@@ -310,7 +310,12 @@ const ServiceLog = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -577,7 +577,12 @@ const DrawBoardManage = () => { ...@@ -577,7 +577,12 @@ const DrawBoardManage = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -253,7 +253,12 @@ const ModelFileManage = () => { ...@@ -253,7 +253,12 @@ const ModelFileManage = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -421,7 +421,12 @@ const GateConfig = () => { ...@@ -421,7 +421,12 @@ const GateConfig = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -317,7 +317,12 @@ const Integrate = () => { ...@@ -317,7 +317,12 @@ const Integrate = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -241,7 +241,12 @@ const ProjectManage = props => { ...@@ -241,7 +241,12 @@ const ProjectManage = props => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(value, 'g'), `<span style='color:red'>${value}</span>`); const escapedSearchValue = value.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${value}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -345,7 +345,12 @@ const TemplateManage = () => { ...@@ -345,7 +345,12 @@ const TemplateManage = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(value, 'g'), `<span style='color:red'>${value}</span>`); const escapedSearchValue = value.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${value}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -342,7 +342,12 @@ const ScheduledTasks = () => { ...@@ -342,7 +342,12 @@ const ScheduledTasks = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(requestUrl, 'g'), `<span style='color:red'>${requestUrl}</span>`); const escapedSearchValue = requestUrl.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${requestUrl}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -244,7 +244,12 @@ const videoManager = () => { ...@@ -244,7 +244,12 @@ const videoManager = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -216,7 +216,7 @@ const AddConfig = props => { ...@@ -216,7 +216,7 @@ const AddConfig = props => {
name="userPageImage" name="userPageImage"
rules={[ rules={[
{ {
required: true, // required: true,
message: '请选择背景图', message: '请选择背景图',
}, },
]} ]}
......
...@@ -629,7 +629,12 @@ const SiteManageV2 = () => { ...@@ -629,7 +629,12 @@ const SiteManageV2 = () => {
const searchStyle = val => { const searchStyle = val => {
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(name, 'g'), `<span style='color:red'>${name}</span>`); const escapedSearchValue = name.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${name}</span>`
);
} else { } else {
n = val; n = val;
} }
......
...@@ -512,12 +512,14 @@ const UserManage = () => { ...@@ -512,12 +512,14 @@ const UserManage = () => {
}; };
// 模糊查询匹配的样式 // 模糊查询匹配的样式
const searchStyle = val => { const searchStyle = val => {
if (!val) {
return val;
}
let n; let n;
if (showSearchStyle) { if (showSearchStyle) {
n = val.replace(new RegExp(searchWord, 'g'), `<span style='color:red'>${searchWord}</span>`); const escapedSearchValue = searchWord.replace(/\\/g, '\\\\');
const regex = new RegExp(escapedSearchValue, 'g');
n = val.replace(
regex,
`<span style='color:red'>${searchWord}</span>`
);
} else { } else {
n = val; n = val;
} }
......
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