提交 7f49d813 authored 作者: 钟是志's avatar 钟是志

辅导员备注修改

上级 6a4933ed
...@@ -100,9 +100,6 @@ function AuditButton(props) { ...@@ -100,9 +100,6 @@ function AuditButton(props) {
token: getToken() token: getToken()
}; };
payload = callbackSubmitData(payload); payload = callbackSubmitData(payload);
console.log(payload);
setVisible(false); setVisible(false);
setShowProcessModal(payload); setShowProcessModal(payload);
return false; return false;
......
...@@ -131,10 +131,7 @@ export default function SelectPerson(props) { ...@@ -131,10 +131,7 @@ export default function SelectPerson(props) {
const deleteSg = (x, index, e) => { const deleteSg = (x, index, e) => {
// 阻止事件冒泡 // 阻止事件冒泡
e.stopPropagation(); e.stopPropagation();
console.log(sgUsers);
let sgNew = [...sgUsers]; let sgNew = [...sgUsers];
console.log(x);
debugger;
sgNew = sgNew.filter(g => { sgNew = sgNew.filter(g => {
return x.businessKey !== g.businessKey; return x.businessKey !== g.businessKey;
}); });
......
...@@ -872,6 +872,7 @@ export default class ZdyTable extends Component { ...@@ -872,6 +872,7 @@ export default class ZdyTable extends Component {
} }
let styles = {}; let styles = {};
// console.log(cell.content);
if (cell.content && cell.content.styles) { if (cell.content && cell.content.styles) {
try { try {
styles = JSON.parse(cell.content.styles); styles = JSON.parse(cell.content.styles);
...@@ -895,6 +896,7 @@ export default class ZdyTable extends Component { ...@@ -895,6 +896,7 @@ export default class ZdyTable extends Component {
key={j} key={j}
data-cell-id={cell.uuid || 'no_uuid_' + Math.random() data-cell-id={cell.uuid || 'no_uuid_' + Math.random()
.slice(0, 6)} .slice(0, 6)}
data-com-name={cell.content?.comName || 'empty'}
style={{ style={{
overflow: 'auto', overflow: 'auto',
textAlign: textAlign:
......
...@@ -96,7 +96,6 @@ export default class TableList extends React.Component { ...@@ -96,7 +96,6 @@ export default class TableList extends React.Component {
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}
loading={this.props.loading}
pageSize={this.props.pageSize || 10} pageSize={this.props.pageSize || 10}
value={{...this.state}} value={{...this.state}}
notShowBack={true} notShowBack={true}
......
...@@ -116,7 +116,7 @@ export default class NormalTable extends Component { ...@@ -116,7 +116,7 @@ export default class NormalTable extends Component {
if (pagination && pagination.total) { if (pagination && pagination.total) {
pagination.showTotal = (total, range) => `共${total}条  `; pagination.showTotal = (total, range) => `共${total}条  `;
} }
// console.log(rowKey);
return ( return (
<Table <Table
dataSource={dataSource} dataSource={dataSource}
......
...@@ -6,7 +6,6 @@ export default function countWidth({ ...@@ -6,7 +6,6 @@ export default function countWidth({
if (json.twidth) { if (json.twidth) {
// 列表宽度配置项 在 组件的 扩展的配置里面 // 列表宽度配置项 在 组件的 扩展的配置里面
showDiv = json.twidth; showDiv = json.twidth;
console.log(showDiv);
return showDiv; return showDiv;
} }
if (document.getElementsByClassName('ant-layout-content')?.length) { if (document.getElementsByClassName('ant-layout-content')?.length) {
......
...@@ -43,7 +43,7 @@ const Modal = getModal(); ...@@ -43,7 +43,7 @@ const Modal = getModal();
let AllWidth = 0; // 表格总长度 let AllWidth = 0; // 表格总长度
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const CreateForm = Form.create()(props => { const CreateForm = Form.create()((props) => {
const { const {
modalVisible, modalVisible,
form, form,
...@@ -110,8 +110,7 @@ const CreateForm = Form.create()(props => { ...@@ -110,8 +110,7 @@ const CreateForm = Form.create()(props => {
] ]
} }
onOk={okHandle} onOk={okHandle}
onCancel={() => handleModalVisible()} onCancel={() => handleModalVisible()}>
>
{formItem.map((item, index) => {formItem.map((item, index) =>
getItem(false, form, item, isAdd, formData, { span: 5 }, { span: 15 }), getItem(false, form, item, isAdd, formData, { span: 5 }, { span: 15 }),
)} )}
...@@ -119,12 +118,12 @@ const CreateForm = Form.create()(props => { ...@@ -119,12 +118,12 @@ const CreateForm = Form.create()(props => {
); );
}); });
@connect(({ formList, DataColumn, DataObj, loading }) => ({ @connect(({ formList, DataColumn, DataObj }) => ({
formList, formList,
DataColumn, DataColumn,
DataObj, DataObj,
// loading: loading.models.formList || loading.models.DataColumn || loading.models.DataObj, // loading: loading.models.formList || loading.models.DataColumn || loading.models.DataObj,
loading: loading.models.formList, // loading: loading.models.formList,
// 解决 禅道 28100 查询下拉选择后界面会刷新一次 // 解决 禅道 28100 查询下拉选择后界面会刷新一次
// https://blog.csdn.net/m0_37148591/article/details/103685339 dva-loading // https://blog.csdn.net/m0_37148591/article/details/103685339 dva-loading
})) }))
...@@ -156,6 +155,7 @@ class FormList extends React.Component { ...@@ -156,6 +155,7 @@ class FormList extends React.Component {
isView: false, isView: false,
checkedList: [], // 复选框默认选中 checkedList: [], // 复选框默认选中
cacheColumns: '', // 初始表头缓存数据 后续不做增删改查 cacheColumns: '', // 初始表头缓存数据 后续不做增删改查
loading: false,
}; };
columns = []; columns = [];
...@@ -175,13 +175,13 @@ class FormList extends React.Component { ...@@ -175,13 +175,13 @@ class FormList extends React.Component {
this.props.dispatch({ this.props.dispatch({
type: 'formList/getBatchOptions', type: 'formList/getBatchOptions',
payload: { ids: refIds }, payload: { ids: refIds },
callback: options => { callback: (options) => {
this.setState({ options: { ...this.state.options, ...options } }); this.setState({ options: { ...this.state.options, ...options } });
}, },
}); });
} }
}; };
modify = record => { modify = (record) => {
// if (this.state.formItem.length < 10) { // if (this.state.formItem.length < 10) {
this.getOptions(); this.getOptions();
this.props.dispatch({ this.props.dispatch({
...@@ -192,7 +192,7 @@ class FormList extends React.Component { ...@@ -192,7 +192,7 @@ class FormList extends React.Component {
value: record[this.state.primaryKey], value: record[this.state.primaryKey],
isBase: false, isBase: false,
}, },
callback: record2 => { callback: (record2) => {
this.setState({ this.setState({
formData: record2, formData: record2,
modalVisible: true, modalVisible: true,
...@@ -203,7 +203,7 @@ class FormList extends React.Component { ...@@ -203,7 +203,7 @@ class FormList extends React.Component {
}); });
}; };
view = record => { view = (record) => {
this.getOptions(); this.getOptions();
this.setState({ this.setState({
formData: record, formData: record,
...@@ -213,7 +213,7 @@ class FormList extends React.Component { ...@@ -213,7 +213,7 @@ class FormList extends React.Component {
}); });
}; };
isJSON = str => { isJSON = (str) => {
if (typeof str == 'string') { if (typeof str == 'string') {
try { try {
var obj = JSON.parse(str); var obj = JSON.parse(str);
...@@ -230,7 +230,7 @@ class FormList extends React.Component { ...@@ -230,7 +230,7 @@ class FormList extends React.Component {
console.log('这不是个字符串'); console.log('这不是个字符串');
}; };
delete = record => { delete = (record) => {
//找出主键 //找出主键
let Keys = {}; let Keys = {};
Keys[this.state.primaryKey] = record[this.state.primaryKey]; Keys[this.state.primaryKey] = record[this.state.primaryKey];
...@@ -246,14 +246,14 @@ class FormList extends React.Component { ...@@ -246,14 +246,14 @@ class FormList extends React.Component {
}); });
}; };
viewProcess = record => { viewProcess = (record) => {
const { dispatch } = this.props; const { dispatch } = this.props;
dispatch({ dispatch({
type: 'formList/getAppId', type: 'formList/getAppId',
payload: { payload: {
code: record.process_biz_key, code: record.process_biz_key,
}, },
callback: data => { callback: (data) => {
const domainName = sessionStorage.getItem('domainName') const domainName = sessionStorage.getItem('domainName')
? sessionStorage.getItem('domainName') ? sessionStorage.getItem('domainName')
: ''; : '';
...@@ -267,7 +267,7 @@ class FormList extends React.Component { ...@@ -267,7 +267,7 @@ class FormList extends React.Component {
/** /**
* 宽度自适应函数 * 宽度自适应函数
*/ */
resize = e => { resize = (e) => {
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度 let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
let showMobileDiv = scrollWidth - 77; let showMobileDiv = scrollWidth - 77;
if (document.querySelector('#previewDiv')) { if (document.querySelector('#previewDiv')) {
...@@ -297,7 +297,7 @@ class FormList extends React.Component { ...@@ -297,7 +297,7 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'DataObj/findByCode', type: 'DataObj/findByCode',
payload: { objCode: this.props.objCode }, payload: { objCode: this.props.objCode },
callback: dataObj => { callback: (dataObj) => {
this.setState( this.setState(
{ {
objId: dataObj.id, objId: dataObj.id,
...@@ -307,14 +307,14 @@ class FormList extends React.Component { ...@@ -307,14 +307,14 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'DataRight/getUserRight', type: 'DataRight/getUserRight',
payload: { objId: this.state.objId }, payload: { objId: this.state.objId },
callback: data => { callback: (data) => {
if (!this.props.rights) { if (!this.props.rights) {
this.setState({ rights: data }); this.setState({ rights: data });
} }
dispatch({ dispatch({
type: 'DataRight/getUserColumnRight', type: 'DataRight/getUserColumnRight',
payload: { objId: this.state.objId }, payload: { objId: this.state.objId },
callback: data => { callback: (data) => {
this.setState({ columnRights: data }); this.setState({ columnRights: data });
this.initColumn(); this.initColumn();
}, },
...@@ -330,21 +330,21 @@ class FormList extends React.Component { ...@@ -330,21 +330,21 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'formList/getObjDetail', type: 'formList/getObjDetail',
payload: { id: this.state.objId }, payload: { id: this.state.objId },
callback: data => { callback: (data) => {
this.setState({ isTable: data.isTable }); this.setState({ isTable: data.isTable });
}, },
}); });
dispatch({ dispatch({
type: 'DataRight/getUserRight', type: 'DataRight/getUserRight',
payload: { objId: this.state.objId }, payload: { objId: this.state.objId },
callback: data => { callback: (data) => {
if (!this.props.rights) { if (!this.props.rights) {
this.setState({ rights: data }); this.setState({ rights: data });
} }
dispatch({ dispatch({
type: 'DataRight/getUserColumnRight', type: 'DataRight/getUserColumnRight',
payload: { objId: this.state.objId }, payload: { objId: this.state.objId },
callback: data => { callback: (data) => {
this.setState({ columnRights: data }); this.setState({ columnRights: data });
this.initColumn(); this.initColumn();
}, },
...@@ -368,7 +368,6 @@ class FormList extends React.Component { ...@@ -368,7 +368,6 @@ class FormList extends React.Component {
const a = this.props.value || {}; const a = this.props.value || {};
const jsonb = JSON.stringify(b); const jsonb = JSON.stringify(b);
const jsona = JSON.stringify(a); const jsona = JSON.stringify(a);
this.custom = jsonb; this.custom = jsonb;
if (jsona != jsonb) { if (jsona != jsonb) {
let params = { let params = {
...@@ -388,9 +387,13 @@ class FormList extends React.Component { ...@@ -388,9 +387,13 @@ class FormList extends React.Component {
} }
if (nextProps.value.getPage) { if (nextProps.value.getPage) {
console.log('390');
this.getPage(params, null, nextProps.value.getPage); this.getPage(params, null, nextProps.value.getPage);
} else { } else {
if (this.state.objId) this.getPage(params); if (this.state.objId) {
console.log('394');
this.getPage(params);
}
} }
} }
const x = nextProps.selects; const x = nextProps.selects;
...@@ -409,7 +412,7 @@ class FormList extends React.Component { ...@@ -409,7 +412,7 @@ class FormList extends React.Component {
let cacheChecked = []; let cacheChecked = [];
// 表头筛选逻辑 // 表头筛选逻辑
Array.isArray(value.columns) && Array.isArray(value.columns) &&
value.columns.map(item => { value.columns.map((item) => {
if (item.dataIndex != null) { if (item.dataIndex != null) {
cacheList.push({ cacheList.push({
label: item.title, label: item.title,
...@@ -430,7 +433,7 @@ class FormList extends React.Component { ...@@ -430,7 +433,7 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'formList/getHead', type: 'formList/getHead',
payload: { dataObjId: this.state.objId }, payload: { dataObjId: this.state.objId },
callback: datas => { callback: (datas) => {
this.state.formItem = datas; this.state.formItem = datas;
const querys = []; const querys = [];
const groups = {}; const groups = {};
...@@ -446,7 +449,7 @@ class FormList extends React.Component { ...@@ -446,7 +449,7 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'formList/getGroupList', type: 'formList/getGroupList',
payload: { columnId: datas[t].id }, payload: { columnId: datas[t].id },
callback: gourp => { callback: (gourp) => {
groups[datas[t].id] = gourp; groups[datas[t].id] = gourp;
this.setState({ groups }); this.setState({ groups });
}, },
...@@ -460,7 +463,7 @@ class FormList extends React.Component { ...@@ -460,7 +463,7 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'formList/getBatchOptions', type: 'formList/getBatchOptions',
payload: { ids: refIds }, payload: { ids: refIds },
callback: options => { callback: (options) => {
this.setState({ options }); this.setState({ options });
}, },
}); });
...@@ -478,7 +481,7 @@ class FormList extends React.Component { ...@@ -478,7 +481,7 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'formList/getHead', type: 'formList/getHead',
payload: { dataObjId: this.state.objId }, payload: { dataObjId: this.state.objId },
callback: datas => { callback: (datas) => {
const querys = []; const querys = [];
const refIds = []; const refIds = [];
const groups = {}; const groups = {};
...@@ -488,7 +491,7 @@ class FormList extends React.Component { ...@@ -488,7 +491,7 @@ class FormList extends React.Component {
let cacheList = []; let cacheList = [];
let cacheChecked = []; let cacheChecked = [];
// 表头筛选逻辑 // 表头筛选逻辑
datas.map(item => { datas.map((item) => {
if (item.name != null) { if (item.name != null) {
cacheList.push({ cacheList.push({
label: item.title, label: item.title,
...@@ -516,7 +519,7 @@ class FormList extends React.Component { ...@@ -516,7 +519,7 @@ class FormList extends React.Component {
continue; continue;
} }
if (date.includes(datas[t].type)) { if (date.includes(datas[t].type)) {
column.render = val => { column.render = (val) => {
if (val == null) { if (val == null) {
return val; return val;
} }
...@@ -527,10 +530,10 @@ class FormList extends React.Component { ...@@ -527,10 +530,10 @@ class FormList extends React.Component {
} }
}; };
} else if (datas[t].name.indexOf('process_status') > -1) { } else if (datas[t].name.indexOf('process_status') > -1) {
column.render = val => (val ? (val === '0' ? '审核通过' : '审核未通过') : null); column.render = (val) => (val ? (val === '0' ? '审核通过' : '审核未通过') : null);
} else if (datas[t].extendTypeId && datas[t].extendTypeId.indexOf('file') > -1) { } else if (datas[t].extendTypeId && datas[t].extendTypeId.indexOf('file') > -1) {
//特殊处理附件 //特殊处理附件
column.render = val => { column.render = (val) => {
if (this.isJSON(val)) { if (this.isJSON(val)) {
val = JSON.parse(val); val = JSON.parse(val);
let files = val.files; let files = val.files;
...@@ -551,7 +554,7 @@ class FormList extends React.Component { ...@@ -551,7 +554,7 @@ class FormList extends React.Component {
} }
}; };
} else { } else {
column.render = val => column.render = (val) =>
val && val.length > 100 ? ( val && val.length > 100 ? (
<Tooltip title={val} overlayStyle={{ width: 1000 }}> <Tooltip title={val} overlayStyle={{ width: 1000 }}>
<span <span
...@@ -562,8 +565,7 @@ class FormList extends React.Component { ...@@ -562,8 +565,7 @@ class FormList extends React.Component {
whiteSpace: 'nowrap', whiteSpace: 'nowrap',
overflow: 'hidden', overflow: 'hidden',
textOverflow: 'ellipsis', textOverflow: 'ellipsis',
}} }}>
>
{val} {val}
</span> </span>
</Tooltip> </Tooltip>
...@@ -586,7 +588,7 @@ class FormList extends React.Component { ...@@ -586,7 +588,7 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'formList/getGroupList', type: 'formList/getGroupList',
payload: { columnId: datas[t].id }, payload: { columnId: datas[t].id },
callback: gourp => { callback: (gourp) => {
groups[datas[t].id] = gourp; groups[datas[t].id] = gourp;
this.setState({ groups }); this.setState({ groups });
}, },
...@@ -601,7 +603,7 @@ class FormList extends React.Component { ...@@ -601,7 +603,7 @@ class FormList extends React.Component {
dispatch({ dispatch({
type: 'formList/getBatchOptions', type: 'formList/getBatchOptions',
payload: { ids: refIds }, payload: { ids: refIds },
callback: options => { callback: (options) => {
this.setState({ options }); this.setState({ options });
}, },
}); });
...@@ -636,7 +638,7 @@ class FormList extends React.Component { ...@@ -636,7 +638,7 @@ class FormList extends React.Component {
if (Number(objCode) === 1) { if (Number(objCode) === 1) {
if (callPage) { if (callPage) {
callPage(params, data => { callPage(params, (data) => {
if (!this.state.isReady) { if (!this.state.isReady) {
this.setState({ this.setState({
data, data,
...@@ -647,7 +649,7 @@ class FormList extends React.Component { ...@@ -647,7 +649,7 @@ class FormList extends React.Component {
} }
}); });
} else if (this.props.value && this.props.value.getPage) { } else if (this.props.value && this.props.value.getPage) {
this.props.value.getPage(params, data => { this.props.value.getPage(params, (data) => {
if (!this.state.isReady) { if (!this.state.isReady) {
this.setState({ this.setState({
data, data,
...@@ -659,6 +661,9 @@ class FormList extends React.Component { ...@@ -659,6 +661,9 @@ class FormList extends React.Component {
}); });
} }
} else { } else {
this.setState({
loading: true,
});
dispatch({ dispatch({
type: 'formList/fetch', type: 'formList/fetch',
payload: { payload: {
...@@ -668,7 +673,10 @@ class FormList extends React.Component { ...@@ -668,7 +673,10 @@ class FormList extends React.Component {
sql: this.sqlBs16, sql: this.sqlBs16,
dataObjId: this.state.objId, dataObjId: this.state.objId,
}, },
callback: data => { callback: (data) => {
this.setState({
loading: false,
});
if (!this.state.isReady) { if (!this.state.isReady) {
this.setState({ this.setState({
data, data,
...@@ -753,7 +761,7 @@ class FormList extends React.Component { ...@@ -753,7 +761,7 @@ class FormList extends React.Component {
// } // }
}; };
handleSelectRows = rows => { handleSelectRows = (rows) => {
if (this.props.onSelectRow) { if (this.props.onSelectRow) {
this.props.onSelectRow(rows); this.props.onSelectRow(rows);
} }
...@@ -762,7 +770,7 @@ class FormList extends React.Component { ...@@ -762,7 +770,7 @@ class FormList extends React.Component {
}); });
}; };
batchDelete = e => { batchDelete = (e) => {
const { dispatch } = this.props; const { dispatch } = this.props;
const { selectedRows } = this.state; const { selectedRows } = this.state;
...@@ -774,7 +782,7 @@ class FormList extends React.Component { ...@@ -774,7 +782,7 @@ class FormList extends React.Component {
for (let i in columns) { for (let i in columns) {
if (columns[i].isPrimaryKey) { if (columns[i].isPrimaryKey) {
//key //key
Keys[columns[i].name] = selectedRows.map(row => row[columns[i].name]).join(','); Keys[columns[i].name] = selectedRows.map((row) => row[columns[i].name]).join(',');
} }
} }
this.props.dispatch({ this.props.dispatch({
...@@ -796,7 +804,7 @@ class FormList extends React.Component { ...@@ -796,7 +804,7 @@ class FormList extends React.Component {
goBack = () => { goBack = () => {
router.goBack(); router.goBack();
}; };
handleSearch = e => { handleSearch = (e) => {
e.preventDefault(); e.preventDefault();
const { dispatch, form } = this.props; const { dispatch, form } = this.props;
...@@ -839,7 +847,7 @@ class FormList extends React.Component { ...@@ -839,7 +847,7 @@ class FormList extends React.Component {
}); });
}; };
hanldeHighSearch = e => { hanldeHighSearch = (e) => {
const pagination = this.props.formList.data.pagination; const pagination = this.props.formList.data.pagination;
let params = { let params = {
pageNo: pagination.current ? pagination.current : 1, pageNo: pagination.current ? pagination.current : 1,
...@@ -907,9 +915,8 @@ class FormList extends React.Component { ...@@ -907,9 +915,8 @@ class FormList extends React.Component {
: false : false
} }
placeholder="请选择" placeholder="请选择"
allowClear allowClear>
> {ops.map((r) => (
{ops.map(r => (
<Option value={r[item.referenceCodeName]} key={r[item.referenceCodeName]}> <Option value={r[item.referenceCodeName]} key={r[item.referenceCodeName]}>
{r[item.referenceNameName]} {r[item.referenceNameName]}
</Option> </Option>
...@@ -973,9 +980,8 @@ class FormList extends React.Component { ...@@ -973,9 +980,8 @@ class FormList extends React.Component {
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 ? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false : false
} }
allowClear allowClear>
> {ops.map((r) => (
{ops.map(r => (
<Option value={r.value} key={r.value}> <Option value={r.value} key={r.value}>
{r.value} {r.value}
</Option> </Option>
...@@ -1071,7 +1077,7 @@ class FormList extends React.Component { ...@@ -1071,7 +1077,7 @@ class FormList extends React.Component {
return ( return (
<Form layout="inline"> <Form layout="inline">
<Row style={{ padding: '15px' }}> <Row style={{ padding: '15px' }}>
{querys.map(item => ( {querys.map((item) => (
<Col style={{ height: 58 }} span={get === 'mobile' ? 24 : 8} key={item.id}> <Col style={{ height: 58 }} span={get === 'mobile' ? 24 : 8} key={item.id}>
{this.getItem( {this.getItem(
true, true,
...@@ -1090,10 +1096,9 @@ class FormList extends React.Component { ...@@ -1090,10 +1096,9 @@ class FormList extends React.Component {
style={{ style={{
textAlign: get === 'mobile' ? 'right' : '', textAlign: get === 'mobile' ? 'right' : '',
paddingRight: get === 'mobile' ? 12 : '', paddingRight: get === 'mobile' ? 12 : '',
}} }}>
>
<span className={styles.submitButtons}> <span className={styles.submitButtons}>
<Button type="primary" loading={this.props.loading} onClick={this.handleSearch}> <Button type="primary" loading={this.state.loading} onClick={this.handleSearch}>
查询 查询
</Button> </Button>
<Button style={{ marginLeft: 8 }} onClick={this.handleFormReset}> <Button style={{ marginLeft: 8 }} onClick={this.handleFormReset}>
...@@ -1115,15 +1120,15 @@ class FormList extends React.Component { ...@@ -1115,15 +1120,15 @@ class FormList extends React.Component {
* @return: * @return:
*/ */
CheckboxChange = checkedValues => { CheckboxChange = (checkedValues) => {
if (checkedValues.length === 0) { if (checkedValues.length === 0) {
message.error('至少选择一项'); message.error('至少选择一项');
return; return;
} }
const { cacheColumns } = this.state; const { cacheColumns } = this.state;
let initList = []; let initList = [];
checkedValues.map(item => { checkedValues.map((item) => {
let ary = cacheColumns.filter(data => data.dataIndex === item); let ary = cacheColumns.filter((data) => data.dataIndex === item);
if (ary.length !== 0) { if (ary.length !== 0) {
initList.push(ary[0]); initList.push(ary[0]);
} }
...@@ -1143,8 +1148,7 @@ class FormList extends React.Component { ...@@ -1143,8 +1148,7 @@ class FormList extends React.Component {
style={{ style={{
width: 20, width: 20,
margin: 'auto', margin: 'auto',
}} }}>
>
<Spin /> <Spin />
</div> </div>
); );
...@@ -1159,10 +1163,9 @@ class FormList extends React.Component { ...@@ -1159,10 +1163,9 @@ class FormList extends React.Component {
json, json,
istableCom, // 是否有模板设计器调用 istableCom, // 是否有模板设计器调用
value: { btns }, value: { btns },
loading,
uuid, uuid,
} = this.props; } = this.props;
const { showMobileDiv, isView } = this.state; const { showMobileDiv, isView, loading } = this.state;
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度 let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
let isMobile = scrollWidth < 1000; let isMobile = scrollWidth < 1000;
...@@ -1234,8 +1237,7 @@ class FormList extends React.Component { ...@@ -1234,8 +1237,7 @@ class FormList extends React.Component {
title="确定删除该数据?" title="确定删除该数据?"
onConfirm={this.delete.bind(this, record)} onConfirm={this.delete.bind(this, record)}
okText="确定" okText="确定"
cancelText="取消" cancelText="取消">
>
<a>删除</a> <a>删除</a>
</Popconfirm>, </Popconfirm>,
); );
...@@ -1248,8 +1250,7 @@ class FormList extends React.Component { ...@@ -1248,8 +1250,7 @@ class FormList extends React.Component {
textAlign: 'center', textAlign: 'center',
paddingLeft: '0px', paddingLeft: '0px',
paddingRight: '0px', paddingRight: '0px',
}} }}>
>
{Dom && {Dom &&
Dom.length && Dom.length &&
Dom.map((x, index) => ( Dom.map((x, index) => (
...@@ -1312,8 +1313,7 @@ class FormList extends React.Component { ...@@ -1312,8 +1313,7 @@ class FormList extends React.Component {
bodyStyle={{ bodyStyle={{
padding: 0, padding: 0,
width: json.twidth ? json.twidth : '100%', width: json.twidth ? json.twidth : '100%',
}} }}>
>
<div className={styles.tableList}> <div className={styles.tableList}>
<div className={styles.tableListForm}>{this.renderForm()}</div> <div className={styles.tableListForm}>{this.renderForm()}</div>
<div className={styles.tableListOperator}> <div className={styles.tableListOperator}>
...@@ -1384,8 +1384,7 @@ class FormList extends React.Component { ...@@ -1384,8 +1384,7 @@ class FormList extends React.Component {
title="确定删除该数据?" title="确定删除该数据?"
onConfirm={this.batchDelete} onConfirm={this.batchDelete}
okText="确定" okText="确定"
cancelText="取消" cancelText="取消">
>
<Button>批量删除</Button> <Button>批量删除</Button>
</Popconfirm> </Popconfirm>
</span> </span>
...@@ -1398,8 +1397,7 @@ class FormList extends React.Component { ...@@ -1398,8 +1397,7 @@ class FormList extends React.Component {
<div <div
style={{ style={{
width: 150, width: 150,
}} }}>
>
<Checkbox.Group <Checkbox.Group
onChange={this.CheckboxChange} onChange={this.CheckboxChange}
value={this.state.checkedList} value={this.state.checkedList}
...@@ -1409,18 +1407,16 @@ class FormList extends React.Component { ...@@ -1409,18 +1407,16 @@ class FormList extends React.Component {
} }
title="请选择表头展示" title="请选择表头展示"
trigger="click" trigger="click"
placement="bottom" placement="bottom">
>
<Button // 表头筛选控件 <Button // 表头筛选控件
className={styles.filter_btn} className={styles.filter_btn}
icon="filter" icon="filter">
>
表头筛选 表头筛选
</Button> </Button>
</Popover> </Popover>
)} )}
{btns && btns.after && btns.after.length > 0 {btns && btns.after && btns.after.length > 0
? btns.after.map(r => <Button {...r} loading={loading} />) ? btns.after.map((r) => <Button {...r} loading={loading} />)
: ''} : ''}
{!!this.props.otherProps && {!!this.props.otherProps &&
...@@ -1435,8 +1431,7 @@ class FormList extends React.Component { ...@@ -1435,8 +1431,7 @@ class FormList extends React.Component {
overflow: 'hidden', overflow: 'hidden',
width: isMobile ? showMobileDiv : showDiv, width: isMobile ? showMobileDiv : showDiv,
height: '100%', height: '100%',
}} }}>
>
{showDiv && ( {showDiv && (
<StandardTable <StandardTable
showHeader={this.props.showHeader != null ? this.props.showHeader : true} showHeader={this.props.showHeader != null ? this.props.showHeader : true}
...@@ -1452,7 +1447,7 @@ class FormList extends React.Component { ...@@ -1452,7 +1447,7 @@ class FormList extends React.Component {
selectedRows={selectedRows} selectedRows={selectedRows}
onSelectRow={this.handleSelectRows} onSelectRow={this.handleSelectRows}
onChange={this.handleStandardTableChange} onChange={this.handleStandardTableChange}
loading={this.props.loading} loading={loading}
/> />
)} )}
</div> </div>
...@@ -1463,8 +1458,7 @@ class FormList extends React.Component { ...@@ -1463,8 +1458,7 @@ class FormList extends React.Component {
overflow: 'hidden', overflow: 'hidden',
width: isMobile ? showMobileDiv : showDiv, width: isMobile ? showMobileDiv : showDiv,
height: '100%', height: '100%',
}} }}>
>
<div> <div>
{get === 'mobile' ? <div>手机端,请使用浏览器将手机横屏查看</div> : null} {get === 'mobile' ? <div>手机端,请使用浏览器将手机横屏查看</div> : null}
{showDiv && ( {showDiv && (
...@@ -1484,7 +1478,7 @@ class FormList extends React.Component { ...@@ -1484,7 +1478,7 @@ class FormList extends React.Component {
} }
onSelectRow={this.handleSelectRows} onSelectRow={this.handleSelectRows}
onChange={this.handleStandardTableChange} onChange={this.handleStandardTableChange}
loading={this.props.loading} loading={loading}
/> />
)} )}
</div> </div>
......
import React, { useState, useEffect, useMemo, useCallback } from 'react'; import React, { useState, useEffect, useMemo, useCallback, memo, useRef } from 'react';
import { Steps } from 'antd'; import { Steps } from 'antd';
import ZdyTable from '@/webPublic/one_stop_public/Table'; import ZdyTable from '@/webPublic/one_stop_public/Table';
const { Step } = Steps; const { Step } = Steps;
export default function StepDiy(props) { const Child = memo((props) => {
const { value, json, partFormProps } = props; const { value, json, partFormProps } = props;
const diyProps = useMemo(() => { const diyProps = useMemo(
() => {
let b = {}; let b = {};
if (value && typeof value === 'object') { if (value && typeof value === 'object') {
b = { b = {
...@@ -29,11 +30,14 @@ export default function StepDiy(props) { ...@@ -29,11 +30,14 @@ export default function StepDiy(props) {
} else { } else {
return b; return b;
} }
}, [json.otherProps, value]); },
[json.otherProps, value],
);
const [current, setCurrent] = useState(diyProps?.StepsProps?.current || 0); const [current, setCurrent] = useState(diyProps?.StepsProps?.current || 0);
const partFormKey = useMemo(() => { const partFormKey = useMemo(
() => {
if (typeof current !== 'undefined') { if (typeof current !== 'undefined') {
let item = diyProps.Step.find((g, index) => { let item = diyProps.Step.find((g, index) => {
return index === current; return index === current;
...@@ -43,26 +47,30 @@ export default function StepDiy(props) { ...@@ -43,26 +47,30 @@ export default function StepDiy(props) {
} }
} }
return undefined; return undefined;
}, [current]); },
[current],
);
useEffect(() => { useEffect(
() => {
if (diyProps?.StepsProps?.current !== current) { if (diyProps?.StepsProps?.current !== current) {
setCurrent(diyProps?.StepsProps?.current); setCurrent(diyProps?.StepsProps?.current);
} }
}, [diyProps?.StepsProps?.current]); },
[diyProps?.StepsProps?.current],
// console.log(partFormProps.form.getFieldsValue()); );
return ( return (
<div style={diyProps.outSideDivStyle}> <div style={diyProps.outSideDivStyle}>
<Steps {...diyProps.StepsProps} current={current}> <Steps {...diyProps.StepsProps} current={current}>
{Array.isArray(diyProps.Step) && {Array.isArray(diyProps.Step) &&
diyProps.Step.map(g => { diyProps.Step.map((g) => {
return <Step {...g} key={g.title} />; return <Step {...g} key={g.title} />;
})} })}
</Steps> </Steps>
{Array.isArray(diyProps.Step) && {Array.isArray(diyProps.Step) &&
diyProps.Step.filter(g => !!g.formKey).map((g, index) => { diyProps.Step.filter((g) => !!g.formKey).map((g, index) => {
return ( return (
<div key={g.formKey} style={{ display: partFormKey === g.formKey ? 'block' : 'none' }}> <div key={g.formKey} style={{ display: partFormKey === g.formKey ? 'block' : 'none' }}>
<ZdyTable <ZdyTable
...@@ -70,6 +78,7 @@ export default function StepDiy(props) { ...@@ -70,6 +78,7 @@ export default function StepDiy(props) {
currentFormTitle={'Steps组件的子表单' + g.formKey} currentFormTitle={'Steps组件的子表单' + g.formKey}
key={g.formKey} key={g.formKey}
currentFormKey={g.formKey} currentFormKey={g.formKey}
form={props.form}
{...partFormProps?.datas[g.formKey]} {...partFormProps?.datas[g.formKey]}
/> />
</div> </div>
...@@ -77,4 +86,16 @@ export default function StepDiy(props) { ...@@ -77,4 +86,16 @@ export default function StepDiy(props) {
})} })}
</div> </div>
); );
});
export default function StepDiy(props){
const { value, json, partFormProps, form } = props;
const js = useRef();
useEffect(() => {
js.current = json;
}, []);
if (!js.current) {
return null;
}
return <Child json={js.current} value={value} partFormProps={partFormProps} form={form} />;
} }
...@@ -90,8 +90,6 @@ const { MonthPicker, WeekPicker } = DatePicker; ...@@ -90,8 +90,6 @@ const { MonthPicker, WeekPicker } = DatePicker;
*/ */
const { TextArea } = Input; const { TextArea } = Input;
const { Option } = Select; const { Option } = Select;
const { RangePicker } = DatePicker;
const { TabPane } = Tabs;
const giveRender = (column = {}) => { const giveRender = (column = {}) => {
if (!column?.render) { if (!column?.render) {
...@@ -1648,16 +1646,9 @@ export default class TableCom extends Component { ...@@ -1648,16 +1646,9 @@ export default class TableCom extends Component {
init: init, init: init,
formCode: this.props.formCode, formCode: this.props.formCode,
formId: this.props.formId, formId: this.props.formId,
form: this.props.form,
mapData: mapData, mapData: mapData,
sqlData: sqlData, sqlData: sqlData,
defaultValues: defaultValues, defaultValues: defaultValues,
// currentFormTitle={
// this.props.getCurrentFormTitle ? this.props.getCurrentFormTitle(fk) : null
// }
// key={fk}
// currentFormKey={fk}
// {...datas[fk]}
}; };
} }
...@@ -1682,6 +1673,7 @@ export default class TableCom extends Component { ...@@ -1682,6 +1673,7 @@ export default class TableCom extends Component {
key={fk} key={fk}
currentFormKey={fk} currentFormKey={fk}
{...datas[fk]} {...datas[fk]}
form={this.props.form}
/> />
</> </>
); );
...@@ -3671,6 +3663,7 @@ ${obj[dataColumn.base52]} ...@@ -3671,6 +3663,7 @@ ${obj[dataColumn.base52]}
disabled={disabled} disabled={disabled}
uuid={uuid} uuid={uuid}
partFormProps={this.partFormProps} partFormProps={this.partFormProps}
form={this.props.form}
/>, />,
); );
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论