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

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

上级 90bf65b7
......@@ -4,42 +4,48 @@ 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 }) {
let content = rest?.postData?.unifiedServicePatternModel?.content;
if (isJSON(content)) {
content = JSON.parse(content);
}
const tableRoot = useRef();
useEffect(() => {
const timerId = setTimeout(() => {
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{
export default function RenderForm({
get = 'web',
isCg = 'yes',
style,
...rest
}) {
let content = rest?.postData?.unifiedServicePatternModel?.content;
if (isJSON(content)) {
content = JSON.parse(content);
}
const tableRoot = useRef();
useEffect(() => {
const timerId = setTimeout(() => {
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;
}`;
document.body.appendChild(new_element);
}, 0);
return () => {
clearTimeout(timerId);
};
}, []);
if (!content) {
return null;
}
return (
<div className={styles.zyd_onestop_style_class} style={style}>
<ZdyTable ref={tableRoot}
document.body.appendChild(new_element);
}, 0);
return () => {
clearTimeout(timerId);
};
}, []);
if (!content) {
return null;
}
return (
<div className={styles.zyd_onestop_style_class} style={style}>
<ZdyTable ref={tableRoot}
get={get}
{...rest}
isQuery={true}
init={undefined}
{...content}
/>
</div>
);
</div>
);
}
/**
......@@ -47,30 +53,37 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }
* @param {Object} content 表单内容,传入对象
* @param {String} templateCode 表单模板
*/
export function RenderFormByContent({ content, templateCode, form, get, isCg }) {
const [formTemplate, setFormTemplate] = useState();
useEffect(
() => {
fetchTemplateByCode(templateCode).then((res) => {
if (res) {
setFormTemplate(res);
}
});
},
[templateCode],
);
export function RenderFormByContent({
content,
templateCode,
form,
get,
isCg
}) {
const [formTemplate, setFormTemplate] = useState();
useEffect(
() => {
fetchTemplateByCode(templateCode)
.then((res) => {
if (res) {
setFormTemplate(res);
}
});
},
[templateCode],
);
return formTemplate ? (
<RenderForm
get={get}
isCg={isCg}
postData={{
content: JSON.stringify(content),
unifiedServicePatternModel: formTemplate,
}}
form={form}
/>
) : null;
return formTemplate ? (
<RenderForm
get={get}
isCg={isCg}
postData={{
content: JSON.stringify(content),
unifiedServicePatternModel: formTemplate,
}}
form={form}
/>
) : null;
}
/**
......@@ -81,35 +94,40 @@ export function RenderFormByContent({ content, templateCode, form, get, isCg })
* @param {Function} onLoad 数据加载的回调函数
*/
export function RenderFormByObjId({
objId,
dataTypeKey,
dataTypeValue,
onLoad,
templateCode,
form,
get,
isCg,
}) {
const [content, setContent] = useState({});
useEffect(
() => {
fetchTableItem({ dataObjId: objId, key: dataTypeKey, value: dataTypeValue }).then((res) => {
setContent(res || {});
if (onLoad) {
onLoad(res);
}
});
},
[objId, dataTypeKey, dataTypeValue],
);
objId,
dataTypeKey,
dataTypeValue,
onLoad,
templateCode,
form,
get,
isCg,
}) {
const [content, setContent] = useState({});
useEffect(
() => {
fetchTableItem({
dataObjId: objId,
key: dataTypeKey,
value: dataTypeValue
})
.then((res) => {
setContent(res || {});
if (onLoad) {
onLoad(res);
}
});
},
[objId, dataTypeKey, dataTypeValue],
);
return (
<RenderFormByContent
get={get}
isCg={isCg}
content={content}
templateCode={templateCode}
form={form}
/>
);
return (
<RenderFormByContent
get={get}
isCg={isCg}
content={content}
templateCode={templateCode}
form={form}
/>
);
}
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论