提交 7b77139d authored 作者: wanyielin's avatar wanyielin

判断必选1

...@@ -189,6 +189,7 @@ export default class AffairPage extends React.Component { ...@@ -189,6 +189,7 @@ export default class AffairPage extends React.Component {
const { workId, dataBaseId, addFields, showIframe, renderIframe } = this.state; const { workId, dataBaseId, addFields, showIframe, renderIframe } = this.state;
const url = config.onestopPC.split('/#/'); const url = config.onestopPC.split('/#/');
let iframeUrl = `${url[0]}/#/IFrameForApply?id=${workId}&token=${getToken()}`; let iframeUrl = `${url[0]}/#/IFrameForApply?id=${workId}&token=${getToken()}`;
console.log(iframeUrl);
// iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getToken()}`; // iframeUrl = `http://localhost:8000/onestop/IFrameForApply?id=${workId}&token=${getToken()}`;
return ( return (
<PageHeaderWrapper title=""> <PageHeaderWrapper title="">
......
import { text, number, date, format, taskNode } from '../config/index'; import { text, number, date, format, taskNode } from '../config/index';
import { isJSON } from '@/baseComponent/utils'; import { isJSON } from '@/baseComponent/utils';
import { translateAddFields } from '../config/index'; import { translateAddFields } from '../config/index';
import ColumnsRender from '@/highOrderComponent/ColumnsRender'; import config from '@/config/config';
import { Tooltip } from 'antd'; import { Tooltip } from 'antd';
import moment from 'moment'; import moment from 'moment';
import React from 'react'; import React from 'react';
...@@ -314,7 +314,12 @@ export function handleColumns(columns){ ...@@ -314,7 +314,12 @@ export function handleColumns(columns){
if (item.dataType) { if (item.dataType) {
if (text.indexOf(item.dataType) > -1) { // 文本类型字段 if (text.indexOf(item.dataType) > -1) { // 文本类型字段
item.render = (text) => { item.render = (text) => {
if (typeof text === 'string' && text.length > 20) { if(item.extendType === 'file' && typeof text === 'string'){
let url = text.includes('http') ? text : config.sqlFormsServer + text;
console.log(url);
return <a href={url} target={'_blank'}>点击查看</a>;
}
else if (typeof text === 'string' && text.length > 20) {
const oldTitle = text; const oldTitle = text;
const newTitle = text.slice(0, 7) + '...'; const newTitle = text.slice(0, 7) + '...';
return ( return (
...@@ -322,8 +327,14 @@ export function handleColumns(columns){ ...@@ -322,8 +327,14 @@ export function handleColumns(columns){
<span key={text}>{newTitle}</span> <span key={text}>{newTitle}</span>
</Tooltip> </Tooltip>
); );
} else if (typeof text === 'object' && Array.isArray(text.files) && text.files.length) { } else if (item.extendType === 'file' &&
return <a href={text.files[0].path} target={'_blank'}>点击查看</a>; typeof text === 'object' && Array.isArray(text.files) && text.files.length) {
let url = text.files[0].path.includes('http') ?
text.files[0].path :
config.sqlFormsServer + text.files[0].path;
return <a href={url} target={'_blank'}>
点击查看
</a>;
} else { } else {
return text; return text;
} }
......
...@@ -731,7 +731,7 @@ class FormList extends React.Component { ...@@ -731,7 +731,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, { {form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name], initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }], rules: [{ required: !item.isNull }],
})(<Input readOnly={!isAdd} placeholder="请输入"/>)} })(<Input style={{ width: '70%' }} readOnly={!isAdd} placeholder="请输入"/>)}
</FormItem> </FormItem>
); );
} }
...@@ -771,7 +771,7 @@ class FormList extends React.Component { ...@@ -771,7 +771,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, { {form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name], initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }], rules: [{ required: !item.isNull }],
})(<Input placeholder="请输入"/>)} })(<Input style={{ width: '70%' }} placeholder="请输入"/>)}
</FormItem> </FormItem>
); );
} else if (number.indexOf(item.type) > -1) { } else if (number.indexOf(item.type) > -1) {
...@@ -818,7 +818,7 @@ class FormList extends React.Component { ...@@ -818,7 +818,7 @@ class FormList extends React.Component {
{form.getFieldDecorator(item.name, { {form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name], initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }], rules: [{ required: !item.isNull }],
})(<Input placeholder="请输入"/>)} })(<Input style={{ width: '70%' }} placeholder="请输入"/>)}
</FormItem> </FormItem>
); );
} }
...@@ -832,11 +832,12 @@ class FormList extends React.Component { ...@@ -832,11 +832,12 @@ class FormList extends React.Component {
if (querys.length == 0) { if (querys.length == 0) {
return ''; return '';
} }
return ( return (
<Form layout="inline"> <Form layout="inline">
<Row > <Row >
{querys.map((item) => {querys.map((item) =>
<Col span={8} key={item.id}> <Col style={{height:58}} span={8} key={item.id}>
{this.getItem(true,form, { {this.getItem(true,form, {
...item, ...item,
isNull: true isNull: true
......
...@@ -503,7 +503,9 @@ export default class tableCom extends Component { ...@@ -503,7 +503,9 @@ export default class tableCom extends Component {
} }
} }
} }
} */ }
}
} */
if (!this.props.isEdit && this.props.fatherCode) { if (!this.props.isEdit && this.props.fatherCode) {
if (bindObj != null) { if (bindObj != null) {
...@@ -1219,14 +1221,37 @@ export default class tableCom extends Component { ...@@ -1219,14 +1221,37 @@ export default class tableCom extends Component {
if (Object.keys(mapData).length > 0) { if (Object.keys(mapData).length > 0) {
const columnIds = json.columnIds; const columnIds = json.columnIds;
if (columnIds && columnIds['c1']) { const bindObj = this.getColumn('c1');
const columnId = columnIds['c1'][columnIds['c1'].length - 1];
if (mapData[columnId] != null) { let dataColumn = this.props.fatherCode != null ? (bindObj ? { ...bindObj, base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}` } :
dataColumn = mapData[columnId]
{ base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` })
: bindObj;
if (this.props.fatherCode == null && dataColumn == null) dataColumn = { base52: this.props.uuid }
/* if (this.props.fatherCode != null) {
dataColumn = { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
} else {
dataColumn = { base52: this.props.uuid }
if (Object.keys(mapData).length > 0) {
const columnIds = json.columnIds;
if (columnIds && columnIds['c1']) {
const columnId = columnIds['c1'][columnIds['c1'].length - 1];
if (mapData[columnId] != null) {
dataColumn = mapData[columnId]
}
} }
} }
} } */
} */ // if (!this.props.isEdit && this.props.fatherCode) {
// if (bindObj != null) {
// dataColumn.base52 = bindObj.base52
// } else {
// dataColumn.base52 = this.props.uuid
// }
// }
if (!this.props.isEdit && this.props.fatherCode) { if (!this.props.isEdit && this.props.fatherCode) {
if (bindObj != null) { if (bindObj != null) {
...@@ -1701,7 +1726,7 @@ export default class tableCom extends Component { ...@@ -1701,7 +1726,7 @@ export default class tableCom extends Component {
if (this.props.fatherCode == null && dataColumn == null) { if (this.props.fatherCode == null && dataColumn == null) {
dataColumn = { base52: this.props.uuid } dataColumn = { base52: this.props.uuid }
} }
if (!dataColumn.isNull) { if (dataColumn.isNull != null && !dataColumn.isNull) {
required = true; required = true;
} }
......
...@@ -8,7 +8,7 @@ import LoginWithQrCode from './LoginWithQrCode'; ...@@ -8,7 +8,7 @@ import LoginWithQrCode from './LoginWithQrCode';
* wxSocketGateWay: websocket链接地址 'ws://scjoyedu.eicp.net:51337/wswx/test106/socket/' * wxSocketGateWay: websocket链接地址 'ws://scjoyedu.eicp.net:51337/wswx/test106/socket/'
* mockServer: 获取sessionId 接口前缀 'http://scjoyedu.eicp.net:51337/test106', * mockServer: 获取sessionId 接口前缀 'http://scjoyedu.eicp.net:51337/test106',
* */ * */
export default function LoginByQrCode({ url, LoginType, wxSocketGateWay, mockServer }) { export default function LoginByQrCode({ hintStyle, url, LoginType, wxSocketGateWay, mockServer }) {
return ( return (
<div> <div>
<div style={{ backgroundColor: 'white', width: 288, padding: 10, margin: 'auto' }}> <div style={{ backgroundColor: 'white', width: 288, padding: 10, margin: 'auto' }}>
...@@ -19,7 +19,7 @@ export default function LoginByQrCode({ url, LoginType, wxSocketGateWay, mockSer ...@@ -19,7 +19,7 @@ export default function LoginByQrCode({ url, LoginType, wxSocketGateWay, mockSer
wxSocketGateWay={wxSocketGateWay} wxSocketGateWay={wxSocketGateWay}
/> />
</div> </div>
<div style={{ marginTop: 20, color: 'white' }}> <div style={{ marginTop: 20, color: 'white', ...hintStyle, }}>
请使用 请使用
<span style={{ color: 'red' }}>微信扫一扫</span> <span style={{ color: 'red' }}>微信扫一扫</span>
扫码登录 扫码登录
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论