提交 83127b29 authored 作者: 钟是志's avatar 钟是志

Merge remote-tracking branch 'origin/master'

...@@ -75,7 +75,6 @@ class AffairPage extends React.Component { ...@@ -75,7 +75,6 @@ class AffairPage extends React.Component {
getFormDetail = (workId) => { getFormDetail = (workId) => {
service.getFormDetail(workId).then((response) => { service.getFormDetail(workId).then((response) => {
console.log(response);
if (typeof response.unifiedServicePatternModel === 'undefined') { if (typeof response.unifiedServicePatternModel === 'undefined') {
return false; return false;
} }
...@@ -386,7 +385,10 @@ class AffairPage extends React.Component { ...@@ -386,7 +385,10 @@ class AffairPage extends React.Component {
}} }}
/> />
) : ( ) : (
<ApplyForZyd {...this.props} returnList={this.returnList} id={workId} /> <ApplyForZyd {...this.props}
returnList={this.returnList}
id={workId === '1549319936277479424' ? '1590627747913269248' : workId} />
/* 姚鑫国说的 北电科违纪要用另外一个id发起 2022年11月10日 */
) )
) : null} ) : null}
</div> </div>
......
import pageSetting from './pageSetting'; import pageSetting from './pageSetting';
import React, { Component } from 'react'; import React, { Component, useContext } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper'; import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import ListTab from './ListTab'; import ListTab from './ListTab';
import { getHandledPage, getWaitPage } from '../publicApiService'; import { getHandledPage, getWaitPage } from '../publicApiService';
import AuditModal from '@/webPublic/FormInsertDiy/AuditPage/BatchAudit/AuditModal'; import AuditModal from '@/webPublic/FormInsertDiy/AuditPage/BatchAudit/AuditModal';
import { ModalInfo } from '@/baseComponent/Modal'; import { ModalInfo } from '@/baseComponent/Modal';
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import CreateC from '@/webPublic/FormInsertDiy/ExportComponent/ContextCreate';
export default class AuditPage extends Component { class AuditPage extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {}; this.state = {};
} }
componentDidMount() {}
// componentDidMount() {
// console.log(this.context);
// }
handleButtonSet = () => { handleButtonSet = () => {
const { hasBatchAudit, batchAuditButtonName, noNeedForm, tab2Buttons = [] } = this.props; const { hasBatchAudit, batchAuditButtonName, noNeedForm, tab2Buttons = [] } = this.props;
...@@ -76,6 +80,7 @@ export default class AuditPage extends Component { ...@@ -76,6 +80,7 @@ export default class AuditPage extends Component {
scroll: { x: 'max-content' }, scroll: { x: 'max-content' },
getPageService: getWaitPage, getPageService: getWaitPage,
beforeSearchData: (data) => { beforeSearchData: (data) => {
console.log(data);
let searcherKeyValue = {}; let searcherKeyValue = {};
for (let item of searchCondition) { for (let item of searchCondition) {
if (typeof data[item.key] !== 'undefined' && item.key !== 'taskDefKey') { if (typeof data[item.key] !== 'undefined' && item.key !== 'taskDefKey') {
...@@ -109,6 +114,7 @@ export default class AuditPage extends Component { ...@@ -109,6 +114,7 @@ export default class AuditPage extends Component {
tableRowKey: 'id', tableRowKey: 'id',
columns, columns,
}; };
console.log(this.context.locationState?.tab2Props?.search?.field);
const tab2 = { const tab2 = {
search: { search: {
field: {}, field: {},
...@@ -119,7 +125,8 @@ export default class AuditPage extends Component { ...@@ -119,7 +125,8 @@ export default class AuditPage extends Component {
}, },
beforeSearchData: (data) => { beforeSearchData: (data) => {
let searcherKeyValue = {}; let searcherKeyValue = {};
for (let item of searchCondition) { console.log(data);
for (let item of searchCondition) {
if (typeof data[item.key] !== 'undefined' && item.key !== 'taskDefKey') { if (typeof data[item.key] !== 'undefined' && item.key !== 'taskDefKey') {
searcherKeyValue[item.base52] = data[item.key]; searcherKeyValue[item.base52] = data[item.key];
} }
...@@ -144,9 +151,11 @@ export default class AuditPage extends Component { ...@@ -144,9 +151,11 @@ export default class AuditPage extends Component {
big: 4, big: 4,
small: 4, small: 4,
}, },
...this.context.locationState?.tab2Props?.search,
}, },
tableRowKey: 'id', tableRowKey: 'id',
columns, columns,
}; };
return { return {
tab1, tab1,
...@@ -154,10 +163,11 @@ export default class AuditPage extends Component { ...@@ -154,10 +163,11 @@ export default class AuditPage extends Component {
}; };
}; };
render() { render() {
const { workId, dataBaseId, addFields, searchCondition } = this.props; const { workId, dataBaseId, addFields, searchCondition } = this.props;
// const { locationState } = useContext(CreateC);
return ( // console.log(locationState);
return (
<PageHeaderWrapper title=""> <PageHeaderWrapper title="">
<ListTab <ListTab
tabList={pageSetting.tabList} tabList={pageSetting.tabList}
...@@ -166,9 +176,15 @@ export default class AuditPage extends Component { ...@@ -166,9 +176,15 @@ export default class AuditPage extends Component {
dataBaseId={dataBaseId} dataBaseId={dataBaseId}
searchCondition={searchCondition} searchCondition={searchCondition}
addFields={addFields} addFields={addFields}
locationState={this.context.locationState}
pageSearch={this.handleSearchSet({})} pageSearch={this.handleSearchSet({})}
/> />
</PageHeaderWrapper> </PageHeaderWrapper>
); );
} }
} }
AuditPage.contextType = CreateC;
export default AuditPage;
...@@ -55,16 +55,16 @@ export default class List extends Component { ...@@ -55,16 +55,16 @@ export default class List extends Component {
const { pagination, formValues } = this.state; const { pagination, formValues } = this.state;
const search = pageSearch.search; const search = pageSearch.search;
let data = deepCopy(formValues); let data = deepCopy(formValues);
/** 如果配置了默认值 则 加进去 **/ // /** 如果配置了默认值 则 加进去 **/
for (let item in search.field) { // for (let item in search.field) {
let one = search.field[item]; // let one = search.field[item];
if (one.required && typeof data[item] === 'undefined') { // if (one.required && typeof data[item] === 'undefined') {
/** // /**
* 存在必填项 且当前必填项没有值时 则传入. 如果必填项有值则不需要修改 // * 存在必填项 且当前必填项没有值时 则传入. 如果必填项有值则不需要修改
* */ // * */
data[item] = one.defaultValue; // data[item] = one.defaultValue;
} // }
} // }
if (listConfig.paging) { if (listConfig.paging) {
// 是否分页 // 是否分页
data.pageSize = pagination.pageSize; data.pageSize = pagination.pageSize;
......
import React, { Component, Fragment } from 'react'; import React, { Component, Fragment } from 'react';
import { Tabs } from 'antd'; import { Tabs } from 'antd';
import styles from '@/baseComponent/index.less'; import styles from '@/baseComponent/index.less';
import PropTypes from 'prop-types'; import CreateC from '@/webPublic/FormInsertDiy/ExportComponent/ContextCreate';
import Shell from '@/baseComponent/Shell'; import Shell from '@/baseComponent/Shell';
import List from './List'; import List from './List';
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
export default class ListTab extends Component { class ListTab extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
const { tabList } = this.props; const { tabList } = this.props;
const tabKeys = Object.keys(tabList); const tabKeys = Object.keys(tabList);
this.state = { this.state = {
activeKey: tabKeys[0], activeKey: this.props.locationState?.activeKey || tabKeys[0],
tabKeys: tabKeys, tabKeys: tabKeys,
}; };
} }
handleChangeTab = (activeKey) => { handleChangeTab = (activeKey) => {
this.setState( this.setState(
{ {
activeKey: '-111111', activeKey: '-111111',
}, },
() => { () => {
setTimeout(() => { setTimeout(() => {
this.setState({ this.setState({
activeKey: activeKey, activeKey: activeKey,
}); });
}, 30); }, 30);
}, },
); );
}; };
render() { render() {
const { const {
tabList, tabList,
pageSearch, pageSearch,
pageButton, pageButton,
workId, workId,
dataBaseId, dataBaseId,
addFields, addFields,
searchCondition, searchCondition,
} = this.props; } = this.props;
const { activeKey, tabKeys } = this.state; const {
return ( activeKey,
<Fragment> tabKeys
<Shell styleShell={{ marginTop: 0 }}> } = this.state;
{/*<SearchDom />*/} return (
<Tabs activeKey={activeKey} className={styles.ListTab} onChange={this.handleChangeTab}> <Fragment>
{tabKeys.map((item) => { <Shell styleShell={{ marginTop: 0 }}>
return <TabPane tab={tabList[item].name} key={item} />; {/*<SearchDom />*/}
})} <Tabs activeKey={activeKey} className={styles.ListTab} onChange={this.handleChangeTab}>
</Tabs> {tabKeys.map((item) => {
</Shell> return <TabPane tab={tabList[item].name} key={item}/>;
{tabKeys.map((item) => { })}
return activeKey === item ? ( </Tabs>
<List </Shell>
listConfig={tabList[item].listConfig} {tabKeys.map((item) => {
key={item} if (activeKey === item && pageSearch[item]) {
workId={workId} const search = pageSearch[item].search;
addFields={addFields} if (search.mustHaveCondition && !search.condition.length) {
searchCondition={searchCondition} // 如果配置了 mustHaveCondition 则 必须有搜索条件才渲染页面 保证 搜索条件正常传给后台
dataBaseId={dataBaseId} return null;
pageSearch={pageSearch[item]} }
pageButton={pageButton[item]} }
/> return activeKey === item ? (
) : null; <List
})} listConfig={tabList[item].listConfig}
</Fragment> key={item}
); workId={workId}
} addFields={addFields}
searchCondition={searchCondition}
dataBaseId={dataBaseId}
pageSearch={pageSearch[item]}
pageButton={pageButton[item]}
/>
) : null;
})}
</Fragment>
);
}
} }
ListTab.propTypes = {}; ListTab.contextType = CreateC;
ListTab.propTypes = {};
ListTab.defaultProps = {}; ListTab.defaultProps = {};
export default ListTab;
...@@ -10,7 +10,7 @@ import * as service from '../publicApiService'; ...@@ -10,7 +10,7 @@ import * as service from '../publicApiService';
import AuditPage from './AuditPage'; import AuditPage from './AuditPage';
import * as destructionFunc from '../destruction'; import * as destructionFunc from '../destruction';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import { CreateC } from '../../ExportComponent/ActiveMenuComponent'; import CreateC from '../../ExportComponent/ContextCreate';
class Index extends React.Component { class Index extends React.Component {
static defaultProps = { static defaultProps = {
...@@ -134,7 +134,6 @@ class Index extends React.Component { ...@@ -134,7 +134,6 @@ class Index extends React.Component {
response = response.filter((x) => { response = response.filter((x) => {
return x.title !== '流程进度'; return x.title !== '流程进度';
}); });
console.log(response);
if (response && response.length) { if (response && response.length) {
this.setState( this.setState(
{ {
...@@ -199,7 +198,7 @@ class Index extends React.Component { ...@@ -199,7 +198,7 @@ class Index extends React.Component {
}); });
} }
} }
console.log(JSON.stringify(d)); // console.log(JSON.stringify(d));
} }
return ( return (
<AuditPage <AuditPage
...@@ -222,5 +221,6 @@ class Index extends React.Component { ...@@ -222,5 +221,6 @@ class Index extends React.Component {
export default function Pr(props) { export default function Pr(props) {
const { routerConfig } = useContext(CreateC); const { routerConfig } = useContext(CreateC);
// console.log(routerConfig);
return <Index {...props} routerConfig={routerConfig}/>; return <Index {...props} routerConfig={routerConfig}/>;
} }
...@@ -17,10 +17,7 @@ import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/ex ...@@ -17,10 +17,7 @@ import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/ex
import ApplyMerge from './ApplyMerge'; // merge import ApplyMerge from './ApplyMerge'; // merge
import AuditMerge from './AuditMerge'; import AuditMerge from './AuditMerge';
import CheckRecordMerge from './CheckRecordMerge'; import CheckRecordMerge from './CheckRecordMerge';
import CreateC from './ContextCreate';
export const CreateC = createContext({
routerConfig: {},
});
window.iframeParentComponent = { window.iframeParentComponent = {
Modal, Modal,
...@@ -116,10 +113,12 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) { ...@@ -116,10 +113,12 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
default: default:
break; break;
} }
console.log('112233');
return ( return (
<CreateC.Provider <CreateC.Provider
value={{ value={{
routerConfig, routerConfig,
locationState: location?.state,
}}> }}>
{Res} {Res}
</CreateC.Provider> </CreateC.Provider>
......
import { createContext } from 'react';
const CreateC = createContext({
routerConfig: {},
locationState: {},
});
export default CreateC;
...@@ -9,20 +9,21 @@ ...@@ -9,20 +9,21 @@
import React from 'react'; import React from 'react';
import FormList from './formList'; import FormList from './formList';
import TreeList from './formList/TreeList'; import TreeList from './formList/TreeList';
import { Spin } from 'antd';
export default class TableList extends React.Component { export default class TableList extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
const value = props.value || {}; const value = props.value || {};
this.otherProps = {}; this.otherProps = {};
if (props.json.otherProps && props.json.otherProps.length) { if (props.json.otherProps && props.json.otherProps.length) {
try { try {
this.otherProps = new Function(props.json.otherProps)(); this.otherProps = new Function(props.json.otherProps)();
} catch (e) { } catch (e) {
console.log('Table 列表组件 otherProps 获取失败'); console.log('Table 列表组件 otherProps 获取失败');
} }
} }
// console.log(this.otherProps); // console.log(this.otherProps);
this.state = { this.state = {
isAll: value.isAll, isAll: value.isAll,
querys: value.querys, querys: value.querys,
...@@ -40,38 +41,43 @@ export default class TableList extends React.Component { ...@@ -40,38 +41,43 @@ export default class TableList extends React.Component {
} }
}; };
static getDerivedStateFromProps(nextProps, prevState) { static getDerivedStateFromProps(nextProps, prevState) {
// ... // ...
if('value' in nextProps){ if ('value' in nextProps) {
return {...nextProps.value}; // 更新state return { ...nextProps.value }; // 更新state
} }
return null; //不需要更新任何state return null; //不需要更新任何state
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if(prevState?.columns !== this.state.columns){ if (prevState?.columns !== this.state.columns) {
this.setState({ console.log(prevState.columns, this.state.columns);
showNo: true, this.setState(
}, () => { {
setTimeout(()=>{ showNo: true,
this.setState({ },
showNo: false, () => {
}); setTimeout(() => { // 如果两次的表头不同 重新渲染组件
}, 1000); this.setState({
}); showNo: false,
} });
} }, 10);
},
);
}
}
render() { render() {
const { isTree, json, uuid } = this.props; const { isTree, json, uuid } = this.props;
const { showNo } = this.state; const { showNo } = this.state;
if(showNo){ // console.log(showNo);
return null; if (showNo) {
} return null;
}
return isTree ? ( return isTree ? (
<TreeList <TreeList
otherProps={this.otherProps} otherProps={this.otherProps}
json={json} json={json}
onSelectRow={this.props.value.onSelectRow} onSelectRow={this.props.value.onSelectRow}
istableCom={true} istableCom={true}
showHeader={this.props.showHeader} showHeader={this.props.showHeader}
...@@ -84,26 +90,26 @@ export default class TableList extends React.Component { ...@@ -84,26 +90,26 @@ export default class TableList extends React.Component {
rights={this.props.rights || []} rights={this.props.rights || []}
objCode={this.props.objCode} objCode={this.props.objCode}
isFormCom={true} isFormCom={true}
uuid={uuid} uuid={uuid}
sql={this.props.sql} sql={this.props.sql}
/> />
) : ( ) : (
<FormList <FormList
otherProps={this.otherProps} otherProps={this.otherProps}
json={json} json={json}
onSelectRow={this.props.value.onSelectRow} onSelectRow={this.props.value.onSelectRow}
getCheckboxProps={this.props.value.getCheckboxProps} getCheckboxProps={this.props.value.getCheckboxProps}
istableCom={true} istableCom={true}
showHeader={this.props.showHeader} showHeader={this.props.showHeader}
get={this.props.get} get={this.props.get}
isHiddenPage={this.props.isHiddenPage != null ? this.props.isHiddenPage : false} isHiddenPage={this.props.isHiddenPage != null ? this.props.isHiddenPage : false}
pageSize={this.props.pageSize || 10} pageSize={this.props.pageSize || 10}
value={{...this.state}} value={{ ...this.state }}
notShowBack={true} notShowBack={true}
rights={this.props.rights || []} rights={this.props.rights || []}
objCode={this.props.objCode} objCode={this.props.objCode}
isFormCom={true} isFormCom={true}
uuid={uuid} uuid={uuid}
sql={this.props.sql} sql={this.props.sql}
/> />
); );
......
...@@ -293,6 +293,7 @@ class FormList extends React.Component { ...@@ -293,6 +293,7 @@ class FormList extends React.Component {
if (Number(objCode) === 1) { if (Number(objCode) === 1) {
this.initColumn(); this.initColumn();
} else { } else {
console.log('componentDidMount-296');
dispatch({ dispatch({
type: 'DataObj/findByCode', type: 'DataObj/findByCode',
payload: { objCode: this.props.objCode }, payload: { objCode: this.props.objCode },
...@@ -442,7 +443,6 @@ class FormList extends React.Component { ...@@ -442,7 +443,6 @@ class FormList extends React.Component {
if(this.props.json?.isDiy){ // 2022年11月8日 姚鑫国说的 开起了这个 自定义模式 就不调接口查表头了. 也不调接口查枚举项那些 if(this.props.json?.isDiy){ // 2022年11月8日 姚鑫国说的 开起了这个 自定义模式 就不调接口查表头了. 也不调接口查枚举项那些
this.getPage(); this.getPage();
return undefined; return undefined;
} }
dispatch({ dispatch({
type: 'formList/getHead', type: 'formList/getHead',
...@@ -638,7 +638,7 @@ class FormList extends React.Component { ...@@ -638,7 +638,7 @@ class FormList extends React.Component {
getPage = (params, values, callPage, pageNo) => { getPage = (params, values, callPage, pageNo) => {
const { objCode } = this.props; const { objCode } = this.props;
if (this.columns == null || this.columns.length === 0) { if (!this.columns || !Array.isArray(this.columns) || this.columns.length === 0) {
return; return;
} }
const { dispatch } = this.props; const { dispatch } = this.props;
...@@ -1159,7 +1159,6 @@ class FormList extends React.Component { ...@@ -1159,7 +1159,6 @@ class FormList extends React.Component {
render() { render() {
const { modalVisible, selectedRows, rights, data, isReady } = this.state; const { modalVisible, selectedRows, rights, data, isReady } = this.state;
if (!isReady) { if (!isReady) {
return ( return (
<div <div
......
...@@ -3163,12 +3163,16 @@ ${obj[dataColumn.base52]} ...@@ -3163,12 +3163,16 @@ ${obj[dataColumn.base52]}
otherProps = {}; otherProps = {};
} }
} }
console.log(selectDis,'selectDis',disabled,'disabled');
const optDiy = Array.isArray(json?.options) ? json.options : Array.isArray(options) ? options : []; const optDiy = Array.isArray(json?.options) ? json.options : Array.isArray(options) ? options : [];
if(dataColumn.base52 === 'KjWXQFIprRc'){
// console.log(json, required, dataColumn, optDiy);
}
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: !initValue && otherProps?.mode === 'multiple' ? undefined : initValue, initialValue: !initValue && otherProps?.mode === 'multiple' ? undefined : initValue,
rules: rules:
json.vlds && json.vlds.length > 0 Array.isArray(json.vlds) && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
......
...@@ -183,7 +183,6 @@ export async function requestOrigin(url, data, options = {}){ ...@@ -183,7 +183,6 @@ export async function requestOrigin(url, data, options = {}){
}) })
.then(response => { .then(response => {
// console.log(response);
if (response && response.errMsg) { if (response && response.errMsg) {
response.errMsg = response.errMsg.slice(0, 50); response.errMsg = response.errMsg.slice(0, 50);
} }
......
import { Button, Drawer, Input, message } from 'antd';
import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'dva';
import ButtonDiy from '@/baseComponent/ButtonDiy';
import moment from 'moment';
import styles from './styles.less';
import { getUserInfo } from '@/webPublic/one_stop_public/utils/token';
const { TextArea } = Input;
function EditDrawer(props) {
const { dispatch, templateData, TEMPLATE } = props;
const [loading, setLoading] = useState(false);
const [showEdit, setShowEdit] = useState(process.env.NODE_ENV === 'development');
const saveTimeOut = useRef();
const [lowCodeEdit, setLowCodeEdit] = useState({});
useEffect(
() => {
if (templateData) {
setLowCodeEdit({ ...templateData });
}
},
[templateData],
);
const onClose = () => {
setShowEdit(!showEdit);
};
const handleSaveTemplate = () => {
lowCodeEdit.updateTime = moment().format('YYYY-MM-DD HH:mm:ss');
const content = JSON.stringify(lowCodeEdit);
message.info('正在保存数据,请耐心等待');
setLoading(true);
dispatch({
type: 'lowCode_design/saveTemplateApi',
payload: {
name: lowCodeEdit.name,
content,
TEMPLATE,
},
callback: () => {
saveTimeOut.current = null;
setLoading(false);
},
});
};
const changeKey = (value, key) => {
let newCodeEdit = lowCodeEdit;
newCodeEdit[key] = value;
setLowCodeEdit(newCodeEdit);
};
// TODO localStorage 事件中获取的state 不是最新的.
const handleLocalStorageSave = (e) => {
if (e.key === 'save-low-code-local') {
const newV = e.newValue;
if (newV && newV.length > 20) {
changeKey(newV, 'beforeShow');
if (!saveTimeOut.current) {
saveTimeOut.current = window.setTimeout(() => {
message.info('正在保存');
handleSaveTemplate();
}, 500);
}
}
}
};
useEffect(
() => {
if (lowCodeEdit?.beforeShow) {
window.addEventListener('storage', handleLocalStorageSave);
}
return () => {
window.removeEventListener('storage', handleLocalStorageSave);
};
},
[lowCodeEdit.beforeShow],
);
const editFullScreen = () => {
localStorage.setItem('edit-low-code-local', JSON.stringify(lowCodeEdit));
if(process.env.NODE_ENV === 'development'){
window.open('http://scjoyedu.eicp.net:51352/wisdomSchool/#/quanPingBianji?id=' + lowCodeEdit.TEMPLATE);
}
window.open(window.location.origin + '/wisdomSchool/#/quanPingBianji?id=' + lowCodeEdit.TEMPLATE);
};
return (
<>
<Drawer
title="编辑"
placement="right"
onClose={onClose}
visible={showEdit}
width={700}
maskClosable={false}>
<TextArea
autoSize={{
minRows: 5,
maxRows: 10,
}}
value={JSON.stringify(templateData, null, '\t')}
disabled={true}
style={{ marginBottom: '20px' }}
/>
{
loading ? '正在保存中请勿编辑' :
<>
挂载前执行
<ButtonDiy name={'全屏编辑'} handleClick={editFullScreen} type={'danger'} />
<TextArea
autoSize={{
minRows: 10,
maxRows: 15,
}}
defaultValue={lowCodeEdit?.beforeShow || ''}
onChange={(e) => {
changeKey(e.target.value, 'beforeShow');
}}
// readOnly={true}
style={{ marginBottom: '20px' }}
/>
<Button onClick={handleSaveTemplate} type={'primary'}>
保存
</Button>
</>
}
</Drawer>
<div
data-edit-point={'EditDrawer'}
className={styles.editPoint}
style={{
display: getUserInfo().stuNo === 'admin' ? 'block' : 'none',
}}
onClick={() => {
setShowEdit(!showEdit);
}}
>.</div>
</>
);
}
export default connect(({ lowCode_design }) => {
return {
templateData: lowCode_design.templateData,
};
})(EditDrawer);
.editPoint{
position: absolute;
z-index: 10;
right: 0;
top: 64px;
cursor: pointer;
}
...@@ -309,7 +309,8 @@ export function checkInputType(data, type) { ...@@ -309,7 +309,8 @@ export function checkInputType(data, type) {
} }
break; break;
case 'email': case 'email':
if (!/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(data)) { const reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/;
if (!reg.test(data)) {
message.warning('邮箱格式错误!'); message.warning('邮箱格式错误!');
return false; return false;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论