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

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

上级 90bf65b7
...@@ -4,42 +4,48 @@ import styles from './index.less'; ...@@ -4,42 +4,48 @@ import styles from './index.less';
import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services'; import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services';
import { isJSON } from '@/webPublic/zyd_public/utils/utils'; import { isJSON } from '@/webPublic/zyd_public/utils/utils';
export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }) { export default function RenderForm({
let content = rest?.postData?.unifiedServicePatternModel?.content; get = 'web',
if (isJSON(content)) { isCg = 'yes',
content = JSON.parse(content); style,
} ...rest
const tableRoot = useRef(); }) {
useEffect(() => { let content = rest?.postData?.unifiedServicePatternModel?.content;
const timerId = setTimeout(() => { if (isJSON(content)) {
const div = tableRoot.current && tableRoot.current.root; content = JSON.parse(content);
if (div) { }
div.style.overflow = 'unset'; const tableRoot = useRef();
} useEffect(() => {
let new_element = document.createElement('style'); const timerId = setTimeout(() => {
new_element.innerHTML = `main>div>#web_table .login-form>div>div>div{ const div = tableRoot.current && tableRoot.current.root;
if (div) {
div.style.overflow = 'unset';
}
let new_element = document.createElement('style');
new_element.innerHTML = `main>div>#web_table .login-form>div>div>div{
overflow: inherit !important; overflow: inherit !important;
}`; }`;
document.body.appendChild(new_element); document.body.appendChild(new_element);
}, 0); }, 0);
return () => { return () => {
clearTimeout(timerId); clearTimeout(timerId);
}; };
}, []); }, []);
if (!content) { if (!content) {
return null; return null;
} }
return (
<div className={styles.zyd_onestop_style_class} style={style}> return (
<ZdyTable ref={tableRoot} <div className={styles.zyd_onestop_style_class} style={style}>
<ZdyTable ref={tableRoot}
get={get} get={get}
{...rest} {...rest}
isQuery={true} isQuery={true}
init={undefined} init={undefined}
{...content} {...content}
/> />
</div> </div>
); );
} }
/** /**
...@@ -47,30 +53,37 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest } ...@@ -47,30 +53,37 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }
* @param {Object} content 表单内容,传入对象 * @param {Object} content 表单内容,传入对象
* @param {String} templateCode 表单模板 * @param {String} templateCode 表单模板
*/ */
export function RenderFormByContent({ content, templateCode, form, get, isCg }) { export function RenderFormByContent({
const [formTemplate, setFormTemplate] = useState(); content,
useEffect( templateCode,
() => { form,
fetchTemplateByCode(templateCode).then((res) => { get,
if (res) { isCg
setFormTemplate(res); }) {
} const [formTemplate, setFormTemplate] = useState();
}); useEffect(
}, () => {
[templateCode], fetchTemplateByCode(templateCode)
); .then((res) => {
if (res) {
setFormTemplate(res);
}
});
},
[templateCode],
);
return formTemplate ? ( return formTemplate ? (
<RenderForm <RenderForm
get={get} get={get}
isCg={isCg} isCg={isCg}
postData={{ postData={{
content: JSON.stringify(content), content: JSON.stringify(content),
unifiedServicePatternModel: formTemplate, unifiedServicePatternModel: formTemplate,
}} }}
form={form} form={form}
/> />
) : null; ) : null;
} }
/** /**
...@@ -81,35 +94,40 @@ export function RenderFormByContent({ content, templateCode, form, get, isCg }) ...@@ -81,35 +94,40 @@ export function RenderFormByContent({ content, templateCode, form, get, isCg })
* @param {Function} onLoad 数据加载的回调函数 * @param {Function} onLoad 数据加载的回调函数
*/ */
export function RenderFormByObjId({ export function RenderFormByObjId({
objId, objId,
dataTypeKey, dataTypeKey,
dataTypeValue, dataTypeValue,
onLoad, onLoad,
templateCode, templateCode,
form, form,
get, get,
isCg, isCg,
}) { }) {
const [content, setContent] = useState({}); const [content, setContent] = useState({});
useEffect( useEffect(
() => { () => {
fetchTableItem({ dataObjId: objId, key: dataTypeKey, value: dataTypeValue }).then((res) => { fetchTableItem({
setContent(res || {}); dataObjId: objId,
if (onLoad) { key: dataTypeKey,
onLoad(res); value: dataTypeValue
} })
}); .then((res) => {
}, setContent(res || {});
[objId, dataTypeKey, dataTypeValue], if (onLoad) {
); onLoad(res);
}
});
},
[objId, dataTypeKey, dataTypeValue],
);
return ( return (
<RenderFormByContent <RenderFormByContent
get={get} get={get}
isCg={isCg} isCg={isCg}
content={content} content={content}
templateCode={templateCode} templateCode={templateCode}
form={form} form={form}
/> />
); );
} }
...@@ -22,8 +22,8 @@ export default function prepareShow(postData = {}, content = '') { ...@@ -22,8 +22,8 @@ export default function prepareShow(postData = {}, content = '') {
window.moment = moment; window.moment = moment;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if(agg?.unifiedServicePatternModel?.id){ 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' + `${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' + `wisdomSchool/#/designFormByUrl?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 data = agg?.unifiedServicePatternModel?.content || content;
let g = !!data && isJSON(data) && JSON.parse(data)?.templateWillMount; let g = !!data && isJSON(data) && JSON.parse(data)?.templateWillMount;
......
...@@ -69,8 +69,7 @@ import PictureSignature, { ...@@ -69,8 +69,7 @@ import PictureSignature, {
SignArray, SignArray,
} from '@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature'; } from '@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature';
import WangEditor from '@/webPublic/zyd_public/WangEditor/OnstopWang'; import WangEditor from '@/webPublic/zyd_public/WangEditor/OnstopWang';
import { noPrefix, noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/request'; import { noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import { giveFilePostDataInfoForTrue } from '@/webPublic/one_stop_public/Base16';
const { TextArea } = Input; const { TextArea } = Input;
const { Option } = Select; const { Option } = Select;
...@@ -1083,7 +1082,7 @@ export default class tableCom extends Component { ...@@ -1083,7 +1082,7 @@ export default class tableCom extends Component {
}, },
this.props.index, this.props.index,
this.props.fatherCode, this.props.fatherCode,
{ { // utils函数的参数
moment, moment,
sql: this.sqlUtil.bind(this, base52, json, callback), sql: this.sqlUtil.bind(this, base52, json, callback),
message, message,
...@@ -1502,7 +1501,8 @@ export default class tableCom extends Component { ...@@ -1502,7 +1501,8 @@ export default class tableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(this.props.uuid, { {this.props.form.getFieldDecorator(this.props.uuid, {
initialValue: fk, initialValue: fk,
})(<Input type="hidden" />)}{' '} })(<Input type="hidden" />)}
{' '}
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
importExcel={this.props.importExcel} importExcel={this.props.importExcel}
...@@ -3863,6 +3863,7 @@ ${obj[dataColumn.base52]} ...@@ -3863,6 +3863,7 @@ ${obj[dataColumn.base52]}
); );
} }
} else { } else {
// console.log(datas[modalCode]);
return ( return (
<> <>
{modalCode ? ( {modalCode ? (
......
...@@ -111,15 +111,20 @@ export function preHandle(values) { ...@@ -111,15 +111,20 @@ export function preHandle(values) {
for (let k in objValues) { for (let k in objValues) {
if (k != '' && objValues[k] instanceof Object) { if (k != '' && objValues[k] instanceof Object) {
let childObj = objValues[k]; let childObj = objValues[k];
// console.table(childObj);
for (let j in childObj) { for (let j in childObj) {
// 我写的代码
if (j.indexOf('$') > -1 && Array.isArray(childObj[j]) && childObj[j].length === 2) { if (j.indexOf('$') > -1 && Array.isArray(childObj[j]) && childObj[j].length === 2) {
j.split('$').map((g,index) => { j.split('$').map((g,index) => {
if(moment.isMoment(childObj[j][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++) { // for (var i = 0; i < xxx.length; i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论