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

辅导员备注修改

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