Commit b3f5d06e authored by 邓超's avatar 邓超
parents 0ba67d44 43db55a7
Pipeline #38292 skipped with stages
......@@ -15,7 +15,7 @@ import {
Button,
Upload
} from 'antd';
import { EditTwoTone, DeleteOutlined, CloudSyncOutlined, SearchOutlined, PlusSquareFilled, MinusCircleOutlined, PlusOutlined, LogoutOutlined, DownloadOutlined, UploadOutlined } from '@ant-design/icons';
import { EditTwoTone, DeleteOutlined, CloudSyncOutlined, SearchOutlined, PlusSquareFilled, MinusCircleOutlined, PlusOutlined, LogoutOutlined, DownloadOutlined, UploadOutlined, SyncOutlined } from '@ant-design/icons';
import { GetDataDictionaryList, EditDataDictionary, AddDataDictionary, DeleteDataDictionary, AddDataDictionaryList, SearchDataDictionaryList, ExportDataDictionary, ImportDataDictionary } from '@/services/dataCenter/api'
import styles from './WebDic.less';
......@@ -50,6 +50,7 @@ const WebDic = () => {
const [flag1, setFlag1] = useState(0);//搜索框数据是否刷新
const [isloading, setIsloading] = useState(false)
const history = useHistory();
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [InPutVisible, setInPutVisible] = useState(false);
......@@ -70,6 +71,7 @@ const WebDic = () => {
title: () => (<span className={styles.font}>名称</span>),
dataIndex: 'nodeName',
key: 'nodeName',
render: item => searchStyle(item),
},
{
title: () => (<span className={styles.font}>操作</span>),
......@@ -281,6 +283,21 @@ const WebDic = () => {
}
]
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(searchWord, 'g'),
`<span style='color:red'>${searchWord}</span>`,
);
} else {
n = val;
}
console.log(n)
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
const setRowClassName = record => {
return record.nodeID === selectColor.nodeID ? styles.clickRowStyle : '';
}
......@@ -316,6 +333,7 @@ const WebDic = () => {
if (value === null || value === '-1') {
setData(res);
console.log(res)
console.log(first)
if (first) {
setSelect(res[0]); // 默认当前选中一级条目第一条
setSelectColor(res[0]);
......@@ -358,14 +376,14 @@ const WebDic = () => {
const onSearch = () => {
history.push({
pathname: '/dataCenter/dictionary'
});
});
}
//搜索
const sumbitSearch = () => {
SearchDataDictionaryList({ key: searchWord }).then(res => {
if (res.code === 0) {
setSearchData(res.data);
}
}
// else {
// notification.error({
// message: '提交失败',
......@@ -629,22 +647,82 @@ const WebDic = () => {
setInPutVisible(true);
}
const submitSearchUser = () => {
SearchDataDictionaryList({ key: searchWord, type: 1 }).then(res => {
if (res.code === 0) {
setShowSearchStyle(true);
if (res.data.length == 0) {
setData(res.data)
setSubData([])
} else {
setData(res.data)
getData(res.data[0].nodeID)
}
}
else {
notification.error({
message: '提交失败',
description: res.msg,
})
}
})
}
const handleReset = () => {
setSearchWord('');
setLoading(true)
setIsloading(true)
GetDataDictionaryList({ nodeID: null }).then(resnew => {
if (resnew.code === 0) {
setLoading(false)
setIsloading(false)
let res = resnew.data;
if (res.length > 0) {
res.map(item => {
item.key = item.nodeID;
return item;
});
}
setData(res);
setSelect(res[0]); // 默认当前选中一级条目第一条
setSelectColor(res[0]);
setSelectID(res[0].nodeID); // 设置选中的一级条目ID,用于添加二级条目
getData(res[0].nodeID);//拿到nodeID再次调用接口就回直接进入下面的循环,靠nodeID获取子节点二级条目
setShowSearchStyle(false);
}
setLoading(false)
setIsloading(false)
});
}
return (
<div className={styles.WebDic}>
<Spin spinning={loading} tip="loading...">
<div className={styles.item}>
<span>
{/* <span>
<SearchOutlined onClick={() => onSearch()} /><span style={{ verticalAlign: 'middle', marginLeft: '6px', marginRight: "40px", cursor: "pointer" }} onClick={() => onSearch()}>查找条目</span>
</span> */}
<span>
<Search
style={{ width: 260, marginRight: '20px', marginLeft: '10px' }}
placeholder="搜索一级条目数据"
onSearch={submitSearchUser}
onChange={e => handleSearch(e)}
enterButton
value={searchWord}
/>
<Button style={{ marginRight: '40px' }} icon={<SyncOutlined />} onClick={handleReset}>
重置
</Button>
</span>
<span>
<DownloadOutlined /><span style={{ verticalAlign: 'middle', marginLeft: '6px', marginRight: "40px", cursor: "pointer" }}><a style={{ color: 'rgba(0, 0, 0, 0.85)' }} href="/PandaOMS/OMS/DataManger/ExportDataDictionary">导出数据</a></span>
</span>
<span>
<UploadOutlined /><span style={{ verticalAlign: 'middle', marginLeft: '6px', marginRight: "40px", cursor: "pointer" }}><span style={{ color: 'rgba(0, 0, 0, 0.85)' }} onClick={() => submitInput()}>导入数据</span></span>
</span>
</div>
<Row style={{ background: 'white' }}>
<Col span={8} className={styles.left}>
......@@ -654,7 +732,7 @@ const WebDic = () => {
key=''
columns={columns}
dataSource={data}
scroll={{y: 'calc(100vh - 370px)' }}
scroll={{ y: 'calc(100vh - 370px)' }}
bordered
className={styles.pab}
title={() => {
......@@ -666,7 +744,7 @@ const WebDic = () => {
style={{
color: '#1890FF',
fontSize: '25px',
marginTop:'3px',
marginTop: '3px',
float: 'right',
}}
/>
......@@ -713,7 +791,7 @@ const WebDic = () => {
style={{
color: '#1890FF',
fontSize: '25px',
marginTop:'3px',
marginTop: '3px',
float: 'right',
}}
/>
......@@ -776,30 +854,30 @@ const WebDic = () => {
validator: (rule, value) => {
const nodeName = addForm.getFieldsValue().nodeName1;//第一项的nodeName
const nodeName1 = addForm.getFieldsValue();
let result =nodeName1.users;
let arr=[];
if(result){
result.map(item=>{
let result = nodeName1.users;
let arr = [];
if (result) {
result.map(item => {
if (item === undefined) {
} else {
let a=item.nodeName
if(a!==''){
arr.push(a)
}
let a = item.nodeName
if (a !== '') {
arr.push(a)
}
}
})
}
arr.unshift(nodeName)
console.log(arr)
if (new Set(arr).size !== arr.length) {
return Promise.reject('用户名重复')
}
return Promise.resolve();
if (new Set(arr).size !== arr.length) {
return Promise.reject('用户名重复')
}
return Promise.resolve();
}
}
]}
]}
>
<Input placeholder="请输入名称" />
</Form.Item>
......@@ -829,29 +907,29 @@ const WebDic = () => {
validator: (rule, value, callback) => {
const nodeName = addForm.getFieldsValue().nodeName1;//第一项的nodeName
const nodeName1 = addForm.getFieldsValue();
let result =nodeName1.users;
let arr=[];
result.map(item=>{
let result = nodeName1.users;
let arr = [];
result.map(item => {
if (item === undefined) {
} else {
let a=item.nodeName
if(a!==''){
arr.push(a)
}
let a = item.nodeName
if (a !== '') {
arr.push(a)
}
}
})
if(nodeName!==undefined){
if (nodeName !== undefined) {
arr.unshift(nodeName)
}
console.log(arr)
if (new Set(arr).size !== arr.length) {
arr=[...new Set(arr)]
console.log(arr)
callback('用户名重复')
}
if (new Set(arr).size !== arr.length) {
arr = [...new Set(arr)]
console.log(arr)
callback('用户名重复')
}
}
}
]
......
......@@ -27,6 +27,7 @@ const OmsLog = () => {
const [endTime, setEndTime] = useState(
moment(new Date(), 'YYYY-MM-DD HH:mm:ss'), // 默认值当前时间
);
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const columns = [
{
......@@ -45,6 +46,7 @@ const OmsLog = () => {
key: 'Function',
ellipsis: 'true',
width: 200,
render: item => searchStyle(item),
// filters: functionNameFilters,
// onFilter: (value, record) => record.functionName === value,
},
......@@ -54,6 +56,7 @@ const OmsLog = () => {
key: 'Label',
ellipsis: 'true',
width: 300,
render: item => searchStyle1(item),
},
{
title: '操作信息',
......@@ -90,6 +93,33 @@ const OmsLog = () => {
},
];
//模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(functionName, 'g'),
`<span style='color:red'>${functionName}</span>`,
);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
const searchStyle1 = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(label, 'g'),
`<span style='color:red'>${label}</span>`,
);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
// 在起止时间任意一个变化后获取数据
useEffect(() => {
if (startTime && endTime) {
......@@ -162,6 +192,7 @@ const OmsLog = () => {
setFunctionName('');
setFilteredValue([]);
setLabel('');
setShowSearchStyle(false);
};
const onChangeInput = filters => {
console.log('filters', filters);
......@@ -218,7 +249,10 @@ const OmsLog = () => {
<Button
type="primary"
style={{ marginLeft: '10px' }}
onClick={getData}
onClick={() =>{
getData()
setShowSearchStyle(true);
}}
>
查询
</Button>
......
......@@ -33,6 +33,7 @@ const ServiceLog = () => {
);
const [logType, setLogType] = useState('9999'); // 请求参数,日志类型,默认是正常,0:成功 -1:异常 9999:全部
const [searchWord, setSearchWord] = useState(''); // 关键字
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
// 计算时间间隔(分钟)
const start = new Date(startTime).getTime();
......@@ -76,6 +77,7 @@ const ServiceLog = () => {
key: 'Path',
fixed: 'left',
width: 400,
render: item => searchStyle(item),
},
{
title: '调用时间',
......@@ -130,6 +132,20 @@ const ServiceLog = () => {
sorter: (a, b) => a.ResponseSize - b.ResponseSize,
},
];
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(searchWord, 'g'),
`<span style='color:red'>${searchWord}</span>`,
);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
// 在起止时间任意一个变化后获取数据,且起止时间应该早于结束时间,且不允许跨月查询
useEffect(() => {
if (
......@@ -251,6 +267,7 @@ const ServiceLog = () => {
setStartTime(moment().startOf('week'));
setEndTime(moment(new Date(), 'YYYY-MM-DD HH:mm:ss'));
setSearchWord('');
setShowSearchStyle(false);
};
return (
<>
......@@ -298,6 +315,7 @@ const ServiceLog = () => {
placeholder="请输入接口名称"
onSearch={() => {
getData('/GetOMSLog', setDataTable);
setShowSearchStyle(true);
}}
onChange={e => handleSearch(e)}
enterButton
......
......@@ -54,8 +54,10 @@ const TableManager = props => {
const [tableData, setTableData] = useState([]);
const [select, setSelect] = useState([]);
const [selectTableName, setSelectTableName] = useState('');
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
useEffect(
record => {
console.log(343434)
loadTable(searchValue);
getField();
// if (props.history.location.query && selectTableName !== {}) {
......@@ -159,6 +161,7 @@ const TableManager = props => {
const handleSearch = text => {
loadTable(text);
setSearchValue(text);
setShowSearchStyle(true);
};
const getField = () => {
loadUnattachedTables().then(res => {
......@@ -169,6 +172,7 @@ const TableManager = props => {
};
// 加载表
const loadTable = keyword => {
console.log(222)
setTreeLoading(true);
CM_Table_LoadTable({
_version: 9999,
......@@ -243,7 +247,7 @@ const TableManager = props => {
key: 'tableName',
width: 300,
render: (text, record) => (
<div onClick={e => fieldsConfig(record, e)}>{text}</div>
<div onClick={e => fieldsConfig(record, e)}>{searchStyle(text)}</div>
),
},
{
......@@ -345,6 +349,20 @@ const TableManager = props => {
},
];
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(searchValue, 'g'),
`<span style='color:red'>${searchValue}</span>`,
);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
return (
<Table
columns={columns1}
......
......@@ -16,6 +16,7 @@ const AddFlowsModal = props => {
const [visible1, setVisible1] = useState(false)
const [pickItem, setPickItem] = useState('')
const [checkedList1, setCheckedList1] = useState([])
const [nu1, setNu1] = useState([])
const [inputValue, setInputValue] = useState({ Roles: '' });
const [selectValue, setSelectValue] = useState('')
const [characterValue, setCharacterValue] = useState('')
......@@ -242,6 +243,7 @@ const AddFlowsModal = props => {
const getRole = () => {
CM_Event_LoadDepartmentAndRoles().then(res => {
if (res.msg === 'Ok') {
setNu1(res.data)
setFiled1(formateArrDataA1(res.data, 'groupType'))
console.log(res.data)
......@@ -255,6 +257,36 @@ const AddFlowsModal = props => {
}
const pickFiled1 = (fileds) => {
// setTypes('app')
let pp = formateArrDataA1(nu1, 'group')
let ab = inputValue[fileds].split(',')
console.log(pp)
let arr = Object.keys(pp)
let b = []
let a = []
arr.map((item, index) => {
pp[item].map((i, j) => {
b.push(i)
})
})
console.log(ab)
ab.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
pp.外部字段 = a
console.log(pp)
arr.push('外部字段')
}
console.log(a)
console.log(pp)
setFiled1(pp)
console.log(fileds)
setCharacterValue(inputValue[fileds])
setCheckedList1(inputValue[fileds].split(','))
......
......@@ -25,6 +25,8 @@ const AddModal = props => {
const [checkedList2, setCheckedList2] = useState([])
const [checkedList3, setCheckedList3] = useState([])
const [checkedList4, setCheckedList4] = useState([])
const [nu, setNu] = useState([])
const [nu1, setNu1] = useState([])
const [editable, setEditable] = useState(false)
const [ReportFromMobile, setReportFromMobile] = useState(false)
......@@ -259,6 +261,7 @@ const AddModal = props => {
const getRole = () => {
CM_Event_LoadDepartmentAndRoles().then(res => {
if (res.msg === 'Ok') {
setNu1(res.data)
setFiled1(formateArrDataA1(res.data, 'groupType'))
console.log(res.data)
......@@ -296,6 +299,7 @@ const AddModal = props => {
setFlag(flag+1)
LoadEventFields({ eventTableName: value, distinctFields: '' }).then(res => {
if (res.data.root) {
setNu(res.data.root)
setFiled(formateArrDataA(res.data.root, 'group'))
console.log(filed)
console.log(res.data.root)
......@@ -489,6 +493,36 @@ const AddModal = props => {
setIsVisible1(false)
}
const pickFiled = (fileds) => {
let pp = formateArrDataA(nu, 'group')
let ab = inputValue[fileds].split(',')
console.log(pp)
let arr = Object.keys(pp)
let b = []
let a = []
arr.map((item, index) => {
pp[item].map((i, j) => {
b.push(i)
})
})
console.log(ab)
ab.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
pp.外部字段 = a
console.log(pp)
arr.push('外部字段')
}
console.log(a)
console.log(pp)
setFiled(pp)
setTypes('add')
setCharacterValue(inputValue[fileds])
setCheckedList1(inputValue[fileds].split(','))
......@@ -496,10 +530,37 @@ const AddModal = props => {
setIsVisible(true)
}
const pickFiled1 = (fileds) => {
let pp = formateArrDataA1(nu1, 'group')
let ab = inputValue[fileds].split(',')
console.log(pp)
let arr = Object.keys(pp)
let b = []
let a = []
arr.map((item, index) => {
pp[item].map((i, j) => {
b.push(i)
})
})
console.log(ab)
ab.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
}
})
if(a.length >0){
pp.外部字段 = a
console.log(pp)
arr.push('外部字段')
}
console.log(a)
console.log(pp)
setFiled1(pp)
setTypes('app')
// console.log(fileds)
// console.log(inputValue)
// console.log(inputValue[fileds])
setCharacterValue(inputValue[fileds])
setCheckedList1(inputValue[fileds].split(','))
setPickItem(fileds)
......@@ -796,7 +857,7 @@ const AddModal = props => {
>
<div className={styles.filed_listItem} >
<Input style={{ width: '83%' }} placeholder="请选择摘要字段" onChange={(e) => changeText(e, 'SummaryFields')} value={inputValue.SummaryFields} allowClear />
<Button type="dashed" onClick={() => pickFiled('SummaryFields')} icon={<PlusOutlined />} style={{ marginLeft: '0.5rem', width: '4rem' }} />
<Button type="dashed" onClick={() => pickFiled('SummaryFields')} icon={<PlusOutlined style={{marginTop:'5px'}}/>} style={{ marginLeft: '0.5rem', width: '4rem' }} />
</div>
</Item>
......
......@@ -70,12 +70,12 @@ const ChangeAddFlows = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
// let b = []
// let a = []
arr.map((item, index) => {
filed1[item].map((i, j) => {
b.push(i)
})
// filed1[item].map((i, j) => {
// b.push(i)
// })
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
......@@ -85,23 +85,23 @@ const ChangeAddFlows = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
checkAllArr.push(checkArr[index].length === filed1[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
// newCheckedList.map((item, index) => {
// if (b.includes(item) == false) {
// if(item == ''){
// a=[]
// }else{
// a.push(item)
// }
}
})
if(a.length >0){
filed1.外部字段 = a
console.log(filed1)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
// }
// })
// if(a.length >0){
// filed1.外部字段 = a
// console.log(filed1)
// arr.push('外部字段')
// }
// setTitle(arr)
// checkArr.push(a)
console.log(checkArr)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
......
......@@ -78,12 +78,12 @@ const AddModal = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
// let b = []
// let a = []
arr.map((item, index) => {
filed[item].map((i, j) => {
b.push(i)
})
// filed[item].map((i, j) => {
// b.push(i)
// })
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed[item].includes(checkItem)) {
......@@ -93,23 +93,23 @@ const AddModal = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed[item].length)
checkAllArr.push(checkArr[index].length === filed[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
// newCheckedList.map((item, index) => {
// if (b.includes(item) == false) {
// if(item == ''){
// a=[]
// }else{
// a.push(item)
// }
}
})
if(a.length >0){
filed.外部字段 = a
console.log(filed)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
// }
// })
// if(a.length >0){
// filed.外部字段 = a
// console.log(filed)
// arr.push('外部字段')
// }
// setTitle(arr)
// checkArr.push(a)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
......@@ -127,12 +127,12 @@ const AddModal = props => {
let indeterminateArr = []
let checkAllArr = []
console.log(newCheckedList);
let b = []
let a = []
// let b = []
// let a = []
arr.map((item, index) => {
filed1[item].map((i, j) => {
b.push(i)
})
// filed1[item].map((i, j) => {
// b.push(i)
// })
checkArr[index] = []
newCheckedList.map(checkItem => {
if (filed1[item].includes(checkItem)) {
......@@ -142,23 +142,23 @@ const AddModal = props => {
indeterminateArr.push(!!checkArr[index].length && checkArr[index].length < filed1[item].length)
checkAllArr.push(checkArr[index].length === filed1[item].length)
})
newCheckedList.map((item, index) => {
if (b.includes(item) == false) {
if(item == ''){
a=[]
}else{
a.push(item)
}
// newCheckedList.map((item, index) => {
// if (b.includes(item) == false) {
// if(item == ''){
// a=[]
// }else{
// a.push(item)
// }
}
})
if(a.length >0){
filed1.外部字段 = a
console.log(filed1)
arr.push('外部字段')
}
setTitle(arr)
checkArr.push(a)
// }
// })
// if(a.length >0){
// filed1.外部字段 = a
// console.log(filed1)
// arr.push('外部字段')
// }
// setTitle(arr)
// checkArr.push(a)
setCheckedList(checkArr)
setIndeterminate(indeterminateArr)
setCheckAll(checkAllArr)
......
......@@ -39,21 +39,25 @@ const ProjectManage = () => {
const [pageSize, setPageSize] = useState(10)
const [dataList, setDataList] = useState([])
const [treeLoading, setTreeLoading] = useState(false);
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [value, setValue] = useState('')
const columns = [
{
title: '方案名称',
dataIndex: 'name',
key: 'name',
render: (text, record) => (
<div>{record.type == '定时推送' ? text : <div style={{display:'flex',alignItems:'center'}}>
<div>{record.type == '定时推送' ? searchStyle(text) : <div style={{ display: 'flex', alignItems: 'center' }}>
<Tooltip title={text} >
<FieldTimeOutlined
style={{ fontSize: '16px',color: '#1890FF' ,marginRight:'0.1rem'}}
style={{ fontSize: '16px', color: '#1890FF', marginRight: '0.1rem' }}
/>
</Tooltip>
{text}
</div>}</div>
)
{searchStyle(text)}
</div>}
</div>
),
},
{
title: '方案类型',
......@@ -118,9 +122,28 @@ const ProjectManage = () => {
},
];
// 模糊查询匹配的样式
const searchStyle = val => {
console.log(val)
console.log(value)
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(value, 'g'),
`<span style='color:red'>${value}</span>`,
);
} else {
n = val;
}
console.log(val)
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
const placeholder = '请输入方案名称'
const handleSearch = (value) => {
GetMessageList({ pageSize: 10, pageIndex: 0, search: value })
setShowSearchStyle(true);
}
const changeDesc = (record) => {
setCurrentTempalte(record)
......@@ -188,6 +211,7 @@ const ProjectManage = () => {
setCurrentType("全部")
setCurrentName("全部")
GetMessageList({ pageSize: 10, pageIndex: 0 })
setShowSearchStyle(false);
}
// 弹出模态框
const handleShowModal = (key, value) => {
......@@ -266,10 +290,14 @@ const ProjectManage = () => {
)
}
const handleChange = e =>{
setValue(e.target.value)
}
const pagenation = {
showTotal: (total, range) => `第${range[0]}-${range[1]} 条/共 ${total} 条`,
pageSizeOptions: [10, 20, 50, 100],
defaultPageSize: '10',
defaultPageSize: 10,
showQuickJumper: true,
showSizeChanger: true,
};
......@@ -306,9 +334,10 @@ const ProjectManage = () => {
allowClear
placeholder={placeholder}
onSearch={handleSearch}
// onChange={handleChange}
onChange={e=>{handleChange(e)}}
enterButton
style={{ width: "300px" }}
value={value}
/>
</div>
<Button type="primary" onClick={handleReset}>重置</Button>
......@@ -316,7 +345,13 @@ const ProjectManage = () => {
</div>
<div className={styles.list_view}>
<Table bordered columns={columns} dataSource={dataList} pagination={pagenation} rowKey='ID' />
<Table
bordered
columns={columns}
dataSource={dataList}
pagination={pagenation}
rowKey='ID'
/>
</div>
<EditModal
visible={visibleParams.editVisible}
......
......@@ -56,6 +56,7 @@
.ant-table-container{
max-height: calc(100vh - 240px)!important;
min-height:calc(100vh - 240px)!important;
overflow-y: scroll;
}
}
......
......@@ -39,6 +39,8 @@ const TemplateManage = () => {
const [flag, setFlag] = useState(0)
const [option, setOption] = useState([]); // 下拉列表数据
const [treeLoading, setTreeLoading] = useState(false);
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [value, setValue] = useState('')
useEffect(() => {
getTemplateList()
......@@ -76,6 +78,7 @@ const TemplateManage = () => {
const selectFocus = (obj) => {
GetThirdpartyTemplates(obj).then(res => {
if (res.msg === "Ok") {
console.log(res.data)
setOption(res.data);
} else {
notification.error({
......@@ -104,6 +107,7 @@ const TemplateManage = () => {
dataIndex: 'name',
key: 'name',
align: 'center',
render: item => searchStyle(item),
},
{
title: '模板类型',
......@@ -181,12 +185,34 @@ const TemplateManage = () => {
];
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(value, 'g'),
`<span style='color:red'>${value}</span>`,
);
} else {
n = val;
}
console.log(n)
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
const placeholder = '请输入模板名称'
const handleSearch = (value) => {
setValue(value)
getTemplateList({ queryInfo: value })
setShowSearchStyle(true);
}
const handleReset = () => {
getTemplateList()
setValue('')
setShowSearchStyle(false);
}
const handleChange = e =>{
setValue(e.target.value)
}
const handleSelectType = (value) => {
if (value === '全部') {
......@@ -299,9 +325,10 @@ const TemplateManage = () => {
allowClear
placeholder={placeholder}
onSearch={handleSearch}
// onChange={handleChange}
onChange={e => handleChange(e)}
enterButton
style={{ width: "300px" }}
value={value}
/>
</div>
<Button type="primary" onClick={handleReset}>重置</Button>
......
......@@ -49,6 +49,7 @@ const videoManager = () => {
const [obj, setObj] = useState({});
const [show1, setShow1] = useState('block');
const [show2, setShow2] = useState('none');
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const columns = [
{
......@@ -57,6 +58,7 @@ const videoManager = () => {
key: 'Name',
width: 200,
align: 'center',
render: item => searchStyle(item),
},
{
title: '视频厂商',
......@@ -71,6 +73,7 @@ const videoManager = () => {
key: 'LoginName',
width: 350,
align: 'center',
render: item => searchStyle(item),
},
{
title: '登录密码',
......@@ -85,6 +88,7 @@ const videoManager = () => {
key: 'EquipmentCode',
width: 150,
align: 'center',
render: item => searchStyle(item),
},
{
title: '通道ID',
......@@ -183,6 +187,20 @@ const videoManager = () => {
},
];
// 模糊查询匹配的样式
const searchStyle = val => {
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(searchWord, 'g'),
`<span style='color:red'>${searchWord}</span>`,
);
} else {
n = val;
}
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
const edit = record => {
setAddVisible(true);
setKind('edit');
......@@ -255,6 +273,7 @@ const videoManager = () => {
useEffect(() => {
setLoading(true);
getData();
setShowSearchStyle(false);
}, [type, flag]);
const getData = () => {
......@@ -304,6 +323,7 @@ const videoManager = () => {
QueryWhere: searchWord,
}).then(res => {
if (res.msg === 'Ok') {
setShowSearchStyle(true);
setTableData(res.data.list);
}
});
......
......@@ -108,6 +108,8 @@ const SiteManage = () => {
if (res.code === 0) {
const { roleList } = res.data;
let arr = transTree(roleList);
console.log(roleList)
console.log(arr)
setTreeData(arr);
}
});
......
......@@ -64,7 +64,7 @@ const SiteManageV2 = () => {
const [showSearchStyle, setShowSearchStyle] = useState(false); // 是否显示模糊查询样式
const [treeVisible, setTreeVisible] = useState(true); // 树是否可见
const [treeData, setTreeData] = useState([]); // 用户站点树
const [treeDataCopy, setTreeDataCopy] = useState([]); // 机构树数据备份,用于更改机构
......@@ -102,7 +102,7 @@ const SiteManageV2 = () => {
return {
title: (
<div className={styles.title}>
<div>{org.text}</div>
<div className={styles.titleText}>{org.text}</div>
<div className={styles.tip}>
<Tooltip title="添加下级站点" className={styles.fs}>
<PlusSquareOutlined style={{ fontSize: '16px', color: '#1890FF' }} onClick={e => addSite(e, org)} />
......@@ -175,14 +175,15 @@ const SiteManageV2 = () => {
updateTrees();
}, [flag]);
useEffect(()=>{
useEffect(() => {
getValue()
},[])
}, [])
//切换站点,点击分页按钮,提交
useEffect(() => {
if (!currentStation) return;
getList();
setShowSearchStyle(false);
}, [updatePageUser, name]);
//切换站点,提交时触发已勾选列表更新
useEffect(() => {
......@@ -201,6 +202,7 @@ const SiteManageV2 = () => {
if (name) params = { ...params, name };
groupUserPagingList(params).then(res => {
if (res.code === 0 && res.data) {
setShowSearchStyle(true);
let { list } = res.data;
// 还原选择的数据
if (selectList.length > 0) {
......@@ -303,33 +305,33 @@ const SiteManageV2 = () => {
setPage({ pageNum: 1, pageSize: 10 });
console.log(data)
data.map((item, index) => {
if(item.id == props[0]){
if (item.id == props[0]) {
console.log(item.id)
console.log(item.describe)
setDes(item.describe)
}
})
})
}
const getValue = () => {
getSiteTree({ selectNode: -1 }).then(
res => {
console.log(res.data)
getData1(res.data)
getData1(res.data)
}
)
)
}
const getData1 = e => {
console.log(e)
e.map((i, j)=>{
e.map((i, j) => {
a.push(i)
if(i.children.length>0){
if (i.children.length > 0) {
getData1(i.children)
}
})
console.log(a)
setData(a)
}
// 弹出模态框
......@@ -505,6 +507,23 @@ const SiteManageV2 = () => {
const addTopStation = () => {
handleShowModal('modalVisible', true);
}
// 模糊查询匹配的样式
const searchStyle = val => {
console.log(name)
let n;
if (showSearchStyle) {
n = val.replace(
new RegExp(name, 'g'),
`<span style='color:red'>${name}</span>`,
);
} else {
n = val;
}
console.log(n)
return <div dangerouslySetInnerHTML={{ __html: n }} />;
};
return (
<PageContainer className={styles.siteManageContainer}>
<div className={styles.contentContainer}>
......@@ -628,7 +647,7 @@ const SiteManageV2 = () => {
key={`${item.userName}${item.GroupId}${index}`}
onClick={() => handleDel(index)}
>
{`${item.userName}(${item.GroupName})`}
{`${item.userName}(${searchStyle(item.GroupName)})`}
</li>
))}
</ul>
......
......@@ -403,6 +403,12 @@
width: 100%;
}
}
.titleText{
width: 12rem;
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
}
.fs{
font-size: 18px;
margin-left: 10px;
......
......@@ -50,6 +50,7 @@ const RelateRoleModal = props => {
// 提交-关联角色
const submitRole = () => {
console.log(1212121212)
SetUserRelationList(
currentUser.userID,
Object.keys(roleValueList)
......@@ -83,13 +84,7 @@ const RelateRoleModal = props => {
};
// 提交-批量关联角色
const submitRoles = () => {
console.log(roleValueList)
console.log(stationValueList)
console.log( Object.keys(roleValueList)
.map(k => roleValueList[k])
.flat()
.toString())
console.log(64634676437)
setUserRelations(
userIDs,
Object.keys(roleValueList)
......
......@@ -256,7 +256,7 @@ const WebConfigPage = props => {
}, 500);
} else {
notification.warning({
message: res.message || failMsg,
message: res.msg || failMsg,
duration: 5,
});
}
......
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