Commit d520731f authored by 皮倩雯's avatar 皮倩雯

fix: 消息平台样式优化,数据字典样式优化

parent 1242a8be
...@@ -260,6 +260,7 @@ const AddModal = props => { ...@@ -260,6 +260,7 @@ const AddModal = props => {
}); });
setAllData(arr); setAllData(arr);
setTableData(newArr); setTableData(newArr);
console.log(newArr);
setSelect(newArr); setSelect(newArr);
} }
}); });
...@@ -342,6 +343,7 @@ const AddModal = props => { ...@@ -342,6 +343,7 @@ const AddModal = props => {
} else { } else {
data.splice(index, 1); data.splice(index, 1);
} }
console.log(data);
setSelect(data); setSelect(data);
}; };
// 附加 // 附加
...@@ -386,8 +388,8 @@ const AddModal = props => { ...@@ -386,8 +388,8 @@ const AddModal = props => {
size="small" size="small"
rowKey="id" rowKey="id"
expandedRowKeys={select.map(item => item.key)} // 展开的行 expandedRowKeys={select.map(item => item.key)} // 展开的行
defaultExpandedRowKeys={0} // 展开的行
expandRowByClick expandRowByClick
defaultExpandAllRows
pagination={false} pagination={false}
scroll={{ y: 'calc(100vh - 186px)' }} scroll={{ y: 'calc(100vh - 186px)' }}
onExpand={onUnfold} onExpand={onUnfold}
......
...@@ -24,18 +24,14 @@ import { ...@@ -24,18 +24,14 @@ import {
BorderInnerOutlined, BorderInnerOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
import { import { CM_Table_LoadTable, removeTable, loadUnattachedTables } from '@/services/platform/bs';
CM_Table_LoadTable, import { useHistory } from 'react-router-dom';
removeTable,
loadUnattachedTables,
} from '@/services/platform/bs';
import styles from './index.less'; import styles from './index.less';
import Editor from './components/Field/editor'; import Editor from './components/Field/editor';
import AddTablelList from './components/Field/addTable'; import AddTablelList from './components/Field/addTable';
import AffiliateAdd from './components/Field/affiliateAdd'; import AffiliateAdd from './components/Field/affiliateAdd';
import LoadGroup from './components/Field/loadGroup'; import LoadGroup from './components/Field/loadGroup';
import LoadGroupNew from './components/Field/loadGroupNew'; import LoadGroupNew from './components/Field/loadGroupNew';
import { useHistory } from 'react-router-dom';
const { Search } = Input; const { Search } = Input;
const { Option } = Select; const { Option } = Select;
const placeholder = '请输入表名'; const placeholder = '请输入表名';
...@@ -72,11 +68,7 @@ const TableManager = props => { ...@@ -72,11 +68,7 @@ const TableManager = props => {
console.log(selectTableName, 'selectTableName'); console.log(selectTableName, 'selectTableName');
console.log(arr, 'arr'); console.log(arr, 'arr');
console.log(props.history.location.query, 'props.history.location.query'); console.log(props.history.location.query, 'props.history.location.query');
if ( if (arr.length > 0 && props.history.location.query && selectTableName == '') {
arr.length > 0 &&
props.history.location.query &&
selectTableName == ''
) {
console.log(234534256342); console.log(234534256342);
let { tableScroll, template } = props.history.location.query; let { tableScroll, template } = props.history.location.query;
setSelectTableName(template); setSelectTableName(template);
...@@ -234,8 +226,7 @@ const TableManager = props => { ...@@ -234,8 +226,7 @@ const TableManager = props => {
return tempObj; return tempObj;
}; };
const setRowClassName = record => const setRowClassName = record =>
Object.entries(record).toString() === Object.entries(record).toString() === Object.entries(selectTableName).toString()
Object.entries(selectTableName).toString()
? styles.clickRowStyle ? styles.clickRowStyle
: ''; : '';
const expandedRowRender = item => { const expandedRowRender = item => {
...@@ -272,8 +263,7 @@ const TableManager = props => { ...@@ -272,8 +263,7 @@ const TableManager = props => {
dataIndex: 'missingFieldCount', dataIndex: 'missingFieldCount',
key: 'missingFieldCount', key: 'missingFieldCount',
align: 'center', align: 'center',
render: text => { render: text => (
return (
<div <div
className={classnames({ className={classnames({
[styles.lack]: text !== '(无)', [styles.lack]: text !== '(无)',
...@@ -281,8 +271,7 @@ const TableManager = props => { ...@@ -281,8 +271,7 @@ const TableManager = props => {
> >
{text} {text}
</div> </div>
); ),
},
}, },
{ {
title: '未附加', title: '未附加',
...@@ -337,9 +326,7 @@ const TableManager = props => { ...@@ -337,9 +326,7 @@ const TableManager = props => {
}} }}
> >
<Tooltip title="删除"> <Tooltip title="删除">
<DeleteOutlined <DeleteOutlined style={{ fontSize: '16px', color: '#e86060' }} />
style={{ fontSize: '16px', color: '#e86060' }}
/>
</Tooltip> </Tooltip>
</Popconfirm> </Popconfirm>
</div> </div>
...@@ -367,16 +354,14 @@ const TableManager = props => { ...@@ -367,16 +354,14 @@ const TableManager = props => {
columns={columns1} columns={columns1}
bordered bordered
size="small" size="small"
onRow={record => { onRow={record => ({
return {
onDoubleClick: event => { onDoubleClick: event => {
event.stopPropagation(); event.stopPropagation();
history.push({ history.push({
pathname: `/bsmanger/base/filedConfig/${record.tableName}`, pathname: `/bsmanger/base/filedConfig/${record.tableName}`,
state: { state: {
template: record, template: record,
tableScroll: document.querySelector('.ant-table-body') tableScroll: document.querySelector('.ant-table-body').scrollTop,
.scrollTop,
}, },
}); });
}, },
...@@ -384,8 +369,7 @@ const TableManager = props => { ...@@ -384,8 +369,7 @@ const TableManager = props => {
event.stopPropagation(); event.stopPropagation();
setSelectTableName(record); setSelectTableName(record);
}, // 点击行 }, // 点击行
}; })}
}}
rowClassName={setRowClassName} rowClassName={setRowClassName}
showHeader={false} showHeader={false}
dataSource={allData[item.type]} dataSource={allData[item.type]}
...@@ -399,13 +383,11 @@ const TableManager = props => { ...@@ -399,13 +383,11 @@ const TableManager = props => {
title: '名称', title: '名称',
dataIndex: 'type', dataIndex: 'type',
key: 'type', key: 'type',
render: text => { render: text => (
return (
<a style={{ fontWeight: 'bold' }}> <a style={{ fontWeight: 'bold' }}>
{text}({allData && allData[text] ? allData[text].length : 0}个) {text}({allData && allData[text] ? allData[text].length : 0}个)
</a> </a>
); ),
},
width: 260, width: 260,
}, },
{ {
...@@ -431,9 +413,7 @@ const TableManager = props => { ...@@ -431,9 +413,7 @@ const TableManager = props => {
dataIndex: 'missingFieldCount', dataIndex: 'missingFieldCount',
key: 'missingFieldCount', key: 'missingFieldCount',
align: 'center', align: 'center',
render: text => { render: text => <div>{text}</div>,
return <div>{text}</div>;
},
}, },
{ {
title: '未附加', title: '未附加',
...@@ -528,8 +508,8 @@ const TableManager = props => { ...@@ -528,8 +508,8 @@ const TableManager = props => {
columns={columns} columns={columns}
expandable={{ expandedRowRender }} expandable={{ expandedRowRender }}
expandedRowKeys={select.map(item => item.key)} // 展开的行 expandedRowKeys={select.map(item => item.key)} // 展开的行
expandRowByClick={true} expandRowByClick
defaultExpandAllRows={true} // defaultExpandedRowKeys={0}
dataSource={groupArr} dataSource={groupArr}
scroll={{ y: 'calc(100vh - 190px)' }} scroll={{ y: 'calc(100vh - 190px)' }}
size="small" size="small"
...@@ -550,11 +530,7 @@ const TableManager = props => { ...@@ -550,11 +530,7 @@ const TableManager = props => {
/> />
)} )}
{visible && type === 'add' && ( {visible && type === 'add' && (
<AddTablelList <AddTablelList type={type} onCancel={() => setVisible(false)} callBackSubmit={onSubmit} />
type={type}
onCancel={() => setVisible(false)}
callBackSubmit={onSubmit}
/>
)} )}
{visible && type === 'affiliateAdd' && ( {visible && type === 'affiliateAdd' && (
<AffiliateAdd <AffiliateAdd
......
...@@ -73,11 +73,6 @@ const maintenance = () => { ...@@ -73,11 +73,6 @@ const maintenance = () => {
}, },
}), }),
align: 'center', align: 'center',
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
),
}, },
{ {
title: '台账名称', title: '台账名称',
...@@ -157,11 +152,6 @@ const maintenance = () => { ...@@ -157,11 +152,6 @@ const maintenance = () => {
}, },
}), }),
align: 'center', align: 'center',
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
),
}, },
{ {
title: '执行角色', title: '执行角色',
...@@ -199,11 +189,6 @@ const maintenance = () => { ...@@ -199,11 +189,6 @@ const maintenance = () => {
}, },
}), }),
align: 'center', align: 'center',
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
),
}, },
{ {
title: '在线任务量', title: '在线任务量',
...@@ -241,11 +226,6 @@ const maintenance = () => { ...@@ -241,11 +226,6 @@ const maintenance = () => {
}, },
}), }),
align: 'center', align: 'center',
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
),
}, },
{ {
title: '操作', title: '操作',
......
...@@ -148,26 +148,12 @@ const incident = () => { ...@@ -148,26 +148,12 @@ const incident = () => {
dataIndex: 'reportFields', dataIndex: 'reportFields',
key: 'reportFields', key: 'reportFields',
width: 80, width: 80,
render: record => (
<Tooltip placement="topLeft" title={record}>
<span style={{ color: 'grey' }} key={record}>
{record}
</span>
</Tooltip>
),
}, },
{ {
title: '显示字段', title: '显示字段',
dataIndex: 'displayFields', dataIndex: 'displayFields',
key: 'displayFields', key: 'displayFields',
width: 80, width: 80,
render: record => (
<Tooltip placement="topLeft" title={record}>
<span style={{ color: 'grey' }} key={record}>
{record}
</span>
</Tooltip>
),
}, },
{ {
......
...@@ -425,25 +425,23 @@ const WebDic = () => { ...@@ -425,25 +425,23 @@ const WebDic = () => {
setAddVisible1(true); setAddVisible1(true);
} }
if (value === 2) { if (value === 2) {
if (selectID.length === 0) {
notification.error({
message: '提交失败',
description: '请先选择一级条目',
});
} else {
setAddVisible(true); setAddVisible(true);
} }
}
addForm.resetFields(); addForm.resetFields();
}; };
// 添加二级条目 // 添加二级条目
const submitAdd = value => { const submitAdd = value => {
console.log(value);
if (value.length === 0) {
notification.error({
message: '提交失败',
description: '请先选择一级条目',
});
} else {
const nodeName1 = addForm.getFieldsValue(); const nodeName1 = addForm.getFieldsValue();
const nodeName = addForm.getFieldsValue().nodeName1; const nodeName = addForm.getFieldsValue().nodeName1;
const nodeValue = addForm.getFieldsValue().nodeValue1; const nodeValue = addForm.getFieldsValue().nodeValue1;
console.log(nodeName1);
console.log(nodeName);
let arr = []; let arr = [];
let result = nodeName1.users; let result = nodeName1.users;
if (result) { if (result) {
...@@ -473,7 +471,6 @@ const WebDic = () => { ...@@ -473,7 +471,6 @@ const WebDic = () => {
}); });
} }
}); });
}
}; };
// 添加一级条目 // 添加一级条目
const submitAdd1 = value => { const submitAdd1 = value => {
...@@ -629,6 +626,7 @@ const WebDic = () => { ...@@ -629,6 +626,7 @@ const WebDic = () => {
console.log(info, 'info'); console.log(info, 'info');
setFiles(info.file); setFiles(info.file);
if (info.file.status !== 'uploading') { if (info.file.status !== 'uploading') {
// eslint-disable-next-line array-callback-return
info.fileList.map(item => { info.fileList.map(item => {
console.log(item.response); console.log(item.response);
data = item.response.code; data = item.response.code;
......
...@@ -61,13 +61,7 @@ const BaseConfig = () => { ...@@ -61,13 +61,7 @@ const BaseConfig = () => {
> >
站点编号: 站点编号:
</span> </span>
{currentSiteInfo ? (
<Input value={currentSiteInfo} disabled={true} style={{ width: '300px' }} /> <Input value={currentSiteInfo} disabled={true} style={{ width: '300px' }} />
) : (
<div>
<Input value={currentSiteInfo} style={{ width: '300px' }} />
</div>
)}
<br /> <br />
<div style={{ marginTop: '50px', display: 'flex', alignItems: 'center' }}> <div style={{ marginTop: '50px', display: 'flex', alignItems: 'center' }}>
<img src={servie} style={{ height: '16px' }} alt="" /> <img src={servie} style={{ height: '16px' }} alt="" />
......
.template_container{ .template_container {
width: 100%; width: 100%;
height: calc(100vh - 124px); height: calc(100vh - 124px);
.ant-select-arrow .anticon { .ant-select-arrow .anticon {
vertical-align: middle; vertical-align: middle;
} }
.ant-table-thead tr th{ .ant-table-thead tr th {
font-weight: 600; font-weight: 600;
color:rgba(0,0,0,0.85); color: rgba(0, 0, 0, 0.85);
} }
.operate_bar{ .operate_bar {
width: 100%; width: 100%;
height: 60px; height: 60px;
background-color: white; background-color: white;
...@@ -16,32 +16,32 @@ ...@@ -16,32 +16,32 @@
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
.template_type{ .template_type {
height: 60px; height: 60px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
.title{ .title {
margin-left: 10px; margin-left: 10px;
margin-right: 10px; margin-right: 10px;
} }
} }
.fast_search{ .fast_search {
height: 60px; height: 60px;
margin-right: 10px; margin-right: 10px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
.title{ .title {
margin-left: 20px; margin-left: 20px;
margin-right: 5px; margin-right: 5px;
} }
} }
} }
.ant-modal-body ant-form{ .ant-modal-body ant-form {
width: 100%; width: 100%;
} }
...@@ -51,23 +51,25 @@ ...@@ -51,23 +51,25 @@
.anticon svg { .anticon svg {
margin-top: -5px; margin-top: -5px;
} }
.list_view{ .list_view {
width: 100%; width: 100%;
height: calc(100vh - 184px); height: calc(100vh - 184px);
background-color: white; background-color: white;
overflow-y: scroll; overflow-y: scroll;
} }
.button, html [type="button"], [type="reset"], [type="submit"] { .button,
html [type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button; -webkit-appearance: button;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.ant-col ant-form-item-control{ .ant-col ant-form-item-control {
margin-top: 0; margin-top: 0;
} }
.ant-table-body{ .ant-table-body {
max-height: calc(100vh - 300px)!important; max-height: calc(100vh - 300px) !important;
min-height:calc(100vh - 300px)!important; min-height: calc(100vh - 300px) !important;
} }
} }
...@@ -60,7 +60,6 @@ const AddModal = props => { ...@@ -60,7 +60,6 @@ const AddModal = props => {
<SiteModal <SiteModal
{...props} {...props}
title="模板添加" title="模板添加"
bodyStyle={{ width: '100%', minHeight: '100px' }}
style={{ top: 200, borderRadius: '20px' }} style={{ top: 200, borderRadius: '20px' }}
width="820px" width="820px"
destroyOnClose destroyOnClose
...@@ -69,18 +68,16 @@ const AddModal = props => { ...@@ -69,18 +68,16 @@ const AddModal = props => {
onOk={() => onSubmit()} onOk={() => onSubmit()}
confirmLoading={loading} confirmLoading={loading}
> >
<div style={{ width: '750px', height: '500px', overflowY: 'scroll', overflowX: 'hidden' }}> <div style={{ height: '500px', overflowY: 'scroll', overflowX: 'hidden' }}>
<Form form={form} {...layout} onFinish={onSubmitSuccess}> <Form form={form} {...layout} onFinish={onSubmitSuccess}>
<Row>
<Col span={3} />
<Col span={12}>
<Item <Item
label="模板名称" label="模板名称"
wrapperCol={{ span: 17 }}
labelCol={{ span: 6 }}
style={{ marginBottom: '0' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Item
label=""
name="name" name="name"
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -88,11 +85,15 @@ const AddModal = props => { ...@@ -88,11 +85,15 @@ const AddModal = props => {
}, },
]} ]}
> >
<Input style={{ width: '12rem' }} placeholder="请输入模板名称" /> <Input style={{ width: '80%' }} placeholder="请输入模板名称" />
</Item> </Item>
</Col>
<Col span={9}>
<Item <Item
label="模板类型" label="模板类型"
name="type" name="type"
labelCol={{ span: 8 }}
wrapperCol={{ span: 16 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -100,27 +101,24 @@ const AddModal = props => { ...@@ -100,27 +101,24 @@ const AddModal = props => {
}, },
]} ]}
> >
<Select style={{ width: '10rem' }} onChange={value => onChangeType(value)}> <Select style={{ width: '85%' }} onChange={value => onChangeType(value)}>
<Select.Option value="公众号">公众号</Select.Option> <Select.Option value="公众号">公众号</Select.Option>
<Select.Option value="短信">短信</Select.Option> <Select.Option value="短信">短信</Select.Option>
<Select.Option value="企业微信">企业微信</Select.Option> <Select.Option value="企业微信">企业微信</Select.Option>
</Select> </Select>
</Item> </Item>
</div> </Col>
</Item> </Row>
{form.getFieldsValue().type !== '企业微信' ? ( {form.getFieldsValue().type !== '企业微信' ? (
<> <>
<Row>
<Col span={12}>
<Item <Item
label="请选择第三方模板名称" label="请选择第三方模板名称"
wrapperCol={{ span: 17 }}
labelCol={{ span: 6 }}
style={{ marginBottom: '0' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Item
label=""
name="third_name" name="third_name"
wrapperCol={{ span: 12 }}
labelCol={{ span: 12 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -131,7 +129,7 @@ const AddModal = props => { ...@@ -131,7 +129,7 @@ const AddModal = props => {
{/* <Input placeholder="请输入模板名称" /> */} {/* <Input placeholder="请输入模板名称" /> */}
<Select <Select
placeholder="请选择模板名称" placeholder="请选择模板名称"
style={{ width: '12rem' }} style={{ width: '120%' }}
onChange={(value, option) => onChange(value, option)} onChange={(value, option) => onChange(value, option)}
> >
{templateName && {templateName &&
...@@ -143,9 +141,13 @@ const AddModal = props => { ...@@ -143,9 +141,13 @@ const AddModal = props => {
))} ))}
</Select> </Select>
</Item> </Item>
</Col>
<Col span={12}>
<Item <Item
label="第三方模板编号" label="第三方模板编号"
name="third_id" name="third_id"
wrapperCol={{ span: 12 }}
labelCol={{ span: 12 }}
rules={[ rules={[
{ {
required: true, required: true,
...@@ -153,22 +155,19 @@ const AddModal = props => { ...@@ -153,22 +155,19 @@ const AddModal = props => {
}, },
]} ]}
> >
<Input disabled placeholder="请输入第三方模板编号" /> <Input disabled placeholder="请输入第三方模板编号" style={{ width: '85%' }} />
</Item>
</div>
</Item> </Item>
</Col>
</Row>
</> </>
) : ( ) : (
<> <>
<Row>
<Col span={12}>
<Item <Item
label="请选择第三方模板名称" label="请选择第三方模板名称"
wrapperCol={{ span: 17 }} wrapperCol={{ span: 12 }}
labelCol={{ span: 6 }} labelCol={{ span: 12 }}
style={{ marginBottom: '0' }}
>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Item
label=""
name="third_name" name="third_name"
rules={[ rules={[
{ {
...@@ -188,9 +187,12 @@ const AddModal = props => { ...@@ -188,9 +187,12 @@ const AddModal = props => {
<Select.Option value="图片">图片</Select.Option> <Select.Option value="图片">图片</Select.Option>
</Select> </Select>
</Item> </Item>
</Col>
<Col span={12}>
<Item <Item
label="企业微信应用id" label="企业微信应用id"
labelCol={{ span: 11 }} wrapperCol={{ span: 12 }}
labelCol={{ span: 12 }}
name="weixin" name="weixin"
rules={[ rules={[
{ {
...@@ -199,28 +201,28 @@ const AddModal = props => { ...@@ -199,28 +201,28 @@ const AddModal = props => {
}, },
]} ]}
> >
<Input placeholder="请输入企业微信号" /> <Input placeholder="请输入企业微信号" style={{ width: '160px' }} />
</Item>
</div>
</Item> </Item>
</Col>
</Row>
</> </>
)} )}
<Item label="模板参数1.0" labelCol={{ span: 6 }} name="params"> <Item label="模板参数1.0" labelCol={{ span: 6 }} name="params">
<TextArea rows={2} style={{ width: '96%' }} placeholder="first|Second|Third|Four" /> <TextArea rows={2} style={{ width: '95%' }} placeholder="first|Second|Third|Four" />
</Item> </Item>
<Item label="模板参数2.0" labelCol={{ span: 6 }} name="param1"> <Item label="模板参数2.0" labelCol={{ span: 6 }} name="param1">
<TextArea rows={2} style={{ width: '96%' }} placeholder="first|Second|Third|Four" /> <TextArea rows={2} style={{ width: '95%' }} placeholder="first|Second|Third|Four" />
</Item> </Item>
<Item label="参数说明" name="desc" labelCol={{ span: 6 }}> <Item label="参数说明" name="desc" labelCol={{ span: 6 }}>
<TextArea <TextArea
style={{ width: '96%' }} style={{ width: '95%' }}
rows={4} rows={4}
placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息" placeholder="first: 标题信息|Second: 展示内容|Third: 时间|Four: 备注信息"
/> />
</Item> </Item>
<Item label="解析规则" name="analysis_params" labelCol={{ span: 6 }}> <Item label="解析规则" name="analysis_params" labelCol={{ span: 6 }}>
<TextArea rows={2} style={{ width: '96%' }} placeholder="param1|param2|param3|param4" /> <TextArea rows={2} style={{ width: '95%' }} placeholder="param1|param2|param3|param4" />
</Item> </Item>
</Form> </Form>
</div> </div>
......
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