提交 14f52974 authored 作者: 钟是志's avatar 钟是志

26688 就业管理系统,就业处新增专场招聘信息,新增后详情页为空,编辑后也为空,账号:101307

上级 90bf65b7
......@@ -4,7 +4,12 @@ import styles from './index.less';
import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }) {
export default function RenderForm({
get = 'web',
isCg = 'yes',
style,
...rest
}) {
let content = rest?.postData?.unifiedServicePatternModel?.content;
if (isJSON(content)) {
content = JSON.parse(content);
......@@ -29,6 +34,7 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }
if (!content) {
return null;
}
return (
<div className={styles.zyd_onestop_style_class} style={style}>
<ZdyTable ref={tableRoot}
......@@ -47,11 +53,18 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }
* @param {Object} content 表单内容,传入对象
* @param {String} templateCode 表单模板
*/
export function RenderFormByContent({ content, templateCode, form, get, isCg }) {
export function RenderFormByContent({
content,
templateCode,
form,
get,
isCg
}) {
const [formTemplate, setFormTemplate] = useState();
useEffect(
() => {
fetchTemplateByCode(templateCode).then((res) => {
fetchTemplateByCode(templateCode)
.then((res) => {
if (res) {
setFormTemplate(res);
}
......@@ -89,11 +102,16 @@ export function RenderFormByObjId({
form,
get,
isCg,
}) {
}) {
const [content, setContent] = useState({});
useEffect(
() => {
fetchTableItem({ dataObjId: objId, key: dataTypeKey, value: dataTypeValue }).then((res) => {
fetchTableItem({
dataObjId: objId,
key: dataTypeKey,
value: dataTypeValue
})
.then((res) => {
setContent(res || {});
if (onLoad) {
onLoad(res);
......
......@@ -14,6 +14,7 @@ import TableCom from '../tableCompon';
import IsNewTable from './isNewMobileTable';
import maintain from '../assets/maintain.png';
import { isJSON } from '@/webPublic/one_stop_public/copy';
export default class ZdyTable extends Component {
constructor(props) {
super(props);
......@@ -56,11 +57,17 @@ export default class ZdyTable extends Component {
// if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){
// }
if (isPreview || isChild) {
this.initExcel({ datas: this.props.datas, trees: this.props.trees }, () => {
this.initExcel({
datas: this.props.datas,
trees: this.props.trees
}, () => {
this.setState({
...this.state,
...this.props,
formConfig: { ...this.state.formConfig, style: this.props.style },
formConfig: {
...this.state.formConfig,
style: this.props.style
},
isReady: true,
viewMode:
this.props.currentFormKey &&
......@@ -273,10 +280,14 @@ export default class ZdyTable extends Component {
}
importExcel = (res, callback) => {
if(this.props.importExcel) {
this.props.importExcel(res,callback);
return }
const { datas, trees } = this.configs;
if (this.props.importExcel) {
this.props.importExcel(res, callback);
return;
}
const {
datas,
trees
} = this.configs;
const sheets = res.sheets;
for (var s = 0; s < sheets.length; s++) {
......@@ -290,14 +301,20 @@ export default class ZdyTable extends Component {
const c = rr[j];
if (c.value == null || c.value == '') {
rows.push({
uuid: 'id_' + UUID.v4().replace(/-/g, '2'),
uuid: 'id_' + UUID.v4()
.replace(/-/g, '2'),
row: c.rowSpan,
col: c.colSpan,
content: { comName: 'Excel', cwidth: c.width, cheight: c.height },
content: {
comName: 'Excel',
cwidth: c.width,
cheight: c.height
},
});
} else {
rows.push({
uuid: 'id_' + UUID.v4().replace(/-/g, '2'),
uuid: 'id_' + UUID.v4()
.replace(/-/g, '2'),
row: c.rowSpan,
col: c.colSpan,
content: {
......@@ -318,7 +335,8 @@ export default class ZdyTable extends Component {
for (var j = 0; j < charts.length; j++) {
const chartModel = charts[j];
rows.push({
uuid: 'id_' + UUID.v4().replace(/-/g, '2'),
uuid: 'id_' + UUID.v4()
.replace(/-/g, '2'),
content: {
comName: 'Echart',
columnIds: { c1: [] },
......@@ -332,7 +350,10 @@ export default class ZdyTable extends Component {
}
}
if (datas[uuid] == null) {
trees.push({ title: sheets[s].name, key: uuid });
trees.push({
title: sheets[s].name,
key: uuid
});
}
datas[uuid] = {
width: 400,
......@@ -436,9 +457,15 @@ export default class ZdyTable extends Component {
nextProps.currentFormKey && nextProps.datas && nextProps.datas[nextProps.currentFormKey]
? nextProps.datas[nextProps.currentFormKey].viewMode
: null,
formConfig: { ...this.state.formConfig, style: nextProps.style },
formConfig: {
...this.state.formConfig,
style: nextProps.style
},
},
() => this.initExcel({ datas: nextProps.datas, trees: nextProps.trees }),
() => this.initExcel({
datas: nextProps.datas,
trees: nextProps.trees
}),
);
return;
}
......@@ -624,7 +651,7 @@ export default class ZdyTable extends Component {
};
getCurrentFormTitle2 = (key) => {
if (this.configs == null) return;
const trees = this.configs&&this.configs.trees?this.configs.trees:this.props.trees;
const trees = this.configs && this.configs.trees ? this.configs.trees : this.props.trees;
if (trees == null) return;
return this.getT(trees, key);
};
......@@ -637,9 +664,9 @@ export default class ZdyTable extends Component {
if (trees[i].key == key) {
return trees[i].title;
}
if (trees[i].children != null&& trees[i].children.length> 0) {
if (trees[i].children != null && trees[i].children.length > 0) {
const x = this.getT(trees[i].children, key);
if(x!=null) return x
if (x != null) return x;
}
}
return null;
......@@ -687,7 +714,7 @@ export default class ZdyTable extends Component {
isPreview,
} = this.props;
const trees = this.configs&&this.configs.trees?this.configs.trees:this.props.trees;
const trees = this.configs && this.configs.trees ? this.configs.trees : this.props.trees;
let get;
if (viewMode != null && viewMode != '') {
......@@ -721,12 +748,6 @@ export default class ZdyTable extends Component {
borderLeft: '1px solid gray',
borderBottom: '1px solid gray',
};
const borderStyleTwo = {
// 处理隐藏组件边框样式问题
borderRight: '1px solid gray',
borderLeft: '1px solid gray',
borderTop: '1px solid gray',
};
let updateTime;
const styleDiv = this.props.height
? {
......@@ -745,21 +766,27 @@ export default class ZdyTable extends Component {
if (!isReady) return <></>;
if (this.props.postData?.isUpdate) {
updateTime = moment(+this.props.postData?.updateTime).format('llll');
updateTime = moment(+this.props.postData?.updateTime)
.format('llll');
}
if (this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e') {
if (this.props.currentFormKey === 'a05771be-44c9-4fd6-b579-f8d7b2133206') {
debugger;
console.log(this);
}
switch (get) {
case 'web':
// this.props.form.validateFields()
// .then((values) => {
// })
// .catch(error => console.log(error));
return (
<>
{this.props.postData?.isUpdate ? (
<div style={{ margin: '100px 24px 24px' }}>
<div style={{ textAlign: 'center' }}>
<img style={{ marginRight: 30 }} src={maintain} />
<img style={{ marginRight: 30 }} src={maintain}/>
</div>
<p
style={{
......@@ -778,7 +805,8 @@ export default class ZdyTable extends Component {
<div id="web_table">
<Form className="login-form">
{isEdit && defaultBinds
? Object.keys(defaultBinds).map((k) => {
? Object.keys(defaultBinds)
.map((k) => {
const r = defaultBinds[k];
if (
r.columnIds == null ||
......@@ -798,7 +826,7 @@ export default class ZdyTable extends Component {
return this.props.form.getFieldDecorator(name, {
initialValue: value,
})(<Input type="hidden" />);
})(<Input type="hidden"/>);
})
: ''}
<Row>
......@@ -850,7 +878,8 @@ export default class ZdyTable extends Component {
rowSpan={cell.row}
colSpan={cell.col}
key={j}
data-cell-id={cell.uuid || 'no_uuid_' + Math.random().slice(0,6)}
data-cell-id={cell.uuid || 'no_uuid_' + Math.random()
.slice(0, 6)}
style={{
overflow: 'auto',
textAlign:
......@@ -921,7 +950,7 @@ export default class ZdyTable extends Component {
</table>
{style.pageBreakAfter != null ? (
<div style={{ pageBreakAfter: style.pageBreakAfter }} />
<div style={{ pageBreakAfter: style.pageBreakAfter }}/>
) : (
''
)}
......@@ -939,7 +968,7 @@ export default class ZdyTable extends Component {
{this.props.postData?.isUpdate ? (
<div style={{ margin: '100px 24px 24px' }}>
<div style={{ textAlign: 'center' }}>
<img style={{ width: '100%' }} src={maintain} />
<img style={{ width: '100%' }} src={maintain}/>
</div>
<p
style={{
......@@ -957,7 +986,8 @@ export default class ZdyTable extends Component {
) : (
<Form {...formItemLayout} id="mobile_table" className="login-form">
{defaultBinds
? Object.keys(defaultBinds).map((k) => {
? Object.keys(defaultBinds)
.map((k) => {
const r = defaultBinds[k];
if (
r.columnIds == null ||
......@@ -977,7 +1007,7 @@ export default class ZdyTable extends Component {
return this.props.form.getFieldDecorator(name, {
initialValue: value,
})(<Input type="hidden" />);
})(<Input type="hidden"/>);
})
: ''}
<IsNewTable
......
......@@ -22,8 +22,8 @@ export default function prepareShow(postData = {}, content = '') {
window.moment = moment;
return new Promise((resolve, reject) => {
if(agg?.unifiedServicePatternModel?.id){
console.log('%c' + `onestop/#/admin/processServices/modelConfig/templateDetail/designById?id=${agg.unifiedServicePatternModel.id}&token=${getToken()}`, 'color: green;background: white;font-size: 14px');
console.log('%c' + `wisdomSchool/#/designFormByUrl?id=${agg.unifiedServicePatternModel.id}&token=${getToken()}`, 'color: green;background: white;font-size: 14px');
console.log('%c' + `${window.location.origin}/onestop/#/admin/processServices/modelConfig/templateDetail/designById?id=${agg.unifiedServicePatternModel.id}&token=${getToken()}`, 'color: green;background: white;font-size: 14px');
console.log('%c' + `${window.location.origin}/wisdomSchool/#/designFormByUrl?id=${agg.unifiedServicePatternModel.id}&token=${getToken()}`, 'color: green;background: white;font-size: 14px');
}
let data = agg?.unifiedServicePatternModel?.content || content;
let g = !!data && isJSON(data) && JSON.parse(data)?.templateWillMount;
......
......@@ -69,8 +69,7 @@ import PictureSignature, {
SignArray,
} from '@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature';
import WangEditor from '@/webPublic/zyd_public/WangEditor/OnstopWang';
import { noPrefix, noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import { giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
import { noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/request';
const { TextArea } = Input;
const { Option } = Select;
......@@ -1083,7 +1082,7 @@ export default class tableCom extends Component {
},
this.props.index,
this.props.fatherCode,
{
{ // utils函数的参数
moment,
sql: this.sqlUtil.bind(this, base52, json, callback),
message,
......@@ -1502,7 +1501,8 @@ export default class tableCom extends Component {
<>
{this.props.form.getFieldDecorator(this.props.uuid, {
initialValue: fk,
})(<Input type="hidden" />)}{' '}
})(<Input type="hidden" />)}
{' '}
<ZdyTable
taskId={this.props.taskId}
importExcel={this.props.importExcel}
......@@ -3863,6 +3863,7 @@ ${obj[dataColumn.base52]}
);
}
} else {
// console.log(datas[modalCode]);
return (
<>
{modalCode ? (
......
......@@ -111,15 +111,20 @@ export function preHandle(values) {
for (let k in objValues) {
if (k != '' && objValues[k] instanceof Object) {
let childObj = objValues[k];
// console.table(childObj);
for (let j in childObj) {
// 我写的代码
if (j.indexOf('$') > -1 && Array.isArray(childObj[j]) && childObj[j].length === 2) {
j.split('$').map((g,index) => {
if(moment.isMoment(childObj[j][index])){
childObj[g] = childObj[j][index].valueOf();
childObj[j][index] = childObj[j][index].valueOf();
}
});
delete childObj[j];
if(j === 'LckrMFujFgw$LckrXpIoQdc'){
console.log(values[key][k][j], key, k, j);
}
// delete childObj[j];
// 我写的代码
// 欢哥写的代码.
// for (var i = 0; i < xxx.length; i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论