Commit 86489883 authored by 邓超's avatar 邓超

Merge branch 'master' of https://g.civnet.cn:8443/ReactWeb5/maintenance

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