Compare commits
No commits in common. "d0b39037720a3d0c5e35afda9e6c3b40888c64b8" and "827ce856f7c59f031daa2a6a5e63f0e5718098f4" have entirely different histories.
d0b3903772
...
827ce856f7
@ -5,7 +5,7 @@ import {
|
|||||||
empty,
|
empty,
|
||||||
getDataFieldValue,
|
getDataFieldValue,
|
||||||
guid,
|
guid,
|
||||||
setDataFieldValue,getCustomParams,
|
setDataFieldValue,
|
||||||
extendRule,
|
extendRule,
|
||||||
permissionUtils,
|
permissionUtils,
|
||||||
initFilter,
|
initFilter,
|
||||||
@ -574,6 +574,7 @@ params【字段名称显示】
|
|||||||
Object.keys(params).forEach((n) => {
|
Object.keys(params).forEach((n) => {
|
||||||
const temps = cols.filter(t => t.field === n);
|
const temps = cols.filter(t => t.field === n);
|
||||||
if (temps && temps.length) {
|
if (temps && temps.length) {
|
||||||
|
debugger
|
||||||
var temp = temps[0].label;
|
var temp = temps[0].label;
|
||||||
temps[0].label = <Tooltip title={params[n]}>
|
temps[0].label = <Tooltip title={params[n]}>
|
||||||
<span>{temp}</span>
|
<span>{temp}</span>
|
||||||
@ -2969,7 +2970,6 @@ params【字段属性】=值
|
|||||||
clickKey,
|
clickKey,
|
||||||
close,
|
close,
|
||||||
getIds,
|
getIds,
|
||||||
...getCustomParams(btnConfig.customParams),//wyw 使能获取到 按钮参数 SE072 使用
|
|
||||||
onSave: () => {
|
onSave: () => {
|
||||||
close();
|
close();
|
||||||
//this.onAfterBtnCallApi({...params});
|
//this.onAfterBtnCallApi({...params});
|
||||||
|
|||||||
@ -1,169 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { connect } from 'dva';
|
|
||||||
import { Button, Icon, Upload, Form } from 'antd';
|
|
||||||
import config from "../../../config.js";
|
|
||||||
import storage from '../../../utils/storage';
|
|
||||||
import { initFilter, extendRule, downLoad, extendInclude, setDataFieldValue, guid, initQueryFilter, showFiles, showApprove, showUserSign, showUsersSign } from "../../../utils/common";
|
|
||||||
|
|
||||||
class SC022ImportData extends React.Component {
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
this.state = {
|
|
||||||
data: null,
|
|
||||||
Msg: '',
|
|
||||||
isMsgShow: false,
|
|
||||||
url: props.data.url,
|
|
||||||
fileName: props.data.fileName,
|
|
||||||
isOk: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getRequestHeaders = () => {
|
|
||||||
// 请求参数
|
|
||||||
const addHeader = 'Bearer ' + storage('lacal').getItem('accessToken').val
|
|
||||||
const userId = storage('lacal').getItem('userid').val
|
|
||||||
const user = storage('lacal').getItem('loginUserVerify').val
|
|
||||||
const RootOrgId = storage('lacal').getItem('RootOrgId').val
|
|
||||||
const orgId = storage('lacal').getItem('webOrgId').val
|
|
||||||
const Tenant = storage('lacal').getItem('Tenant').val
|
|
||||||
const headers = {
|
|
||||||
// 'Content-Type': type === 'post' ? 'application/json' : 'application/x-www-form-urlencoded',
|
|
||||||
Authorization: addHeader,
|
|
||||||
userid: userId,
|
|
||||||
username: user ? user.username : '',
|
|
||||||
RootOrgId,
|
|
||||||
orgId,
|
|
||||||
Tenant: Tenant
|
|
||||||
}
|
|
||||||
return headers
|
|
||||||
}
|
|
||||||
|
|
||||||
fillImportData = (ret) => {
|
|
||||||
if (!ret) {
|
|
||||||
this.setState({
|
|
||||||
data: [],
|
|
||||||
selectedRowKeys: [],
|
|
||||||
messages: '',
|
|
||||||
})
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (ret.ErrorMessage) {
|
|
||||||
this.setState({
|
|
||||||
messages: ('错误:' + ret.ErrorMessage)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let messages = '';
|
|
||||||
if (ret.Data && ret.Data.MessageList && ret.Data.MessageList.length) {
|
|
||||||
var tmps = [];
|
|
||||||
ret.Data.MessageList.forEach((n, i) => {
|
|
||||||
tmps.push(n);
|
|
||||||
});
|
|
||||||
messages = tmps.join('\n');
|
|
||||||
}
|
|
||||||
const selectedRowKeys = [];
|
|
||||||
if (ret.Data && ret.Data.Data) {
|
|
||||||
ret.Data.Data.forEach((n, i) => {
|
|
||||||
selectedRowKeys.push(n.ID);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.setState({
|
|
||||||
data: (ret.Data && ret.Data.Data ? ret.Data.Data : []),
|
|
||||||
selectedRowKeys,
|
|
||||||
messages
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//渲染页面
|
|
||||||
render() {
|
|
||||||
const { data, Msg, isMsgShow, url, urlDown, isOk, fileName } = this.state;
|
|
||||||
const that = this;
|
|
||||||
var dataPass = {}
|
|
||||||
dataPass.OrgId = this.props.login.OrgId
|
|
||||||
if (this.props.data.id && this.props.data.id.length > 0) {
|
|
||||||
dataPass.EDU_CARD_ID = this.props.data.id
|
|
||||||
}
|
|
||||||
const uploadProps = {
|
|
||||||
name: 'file',
|
|
||||||
action: config.serviceHost(url),
|
|
||||||
data: dataPass,//, ImportConfigCode: configCode, delFlag: delFlag
|
|
||||||
fileList: this.state.updateLoadFileList,
|
|
||||||
accept: '.xls,.xlsx',
|
|
||||||
headers: this.getRequestHeaders(),
|
|
||||||
onChange(info) {
|
|
||||||
var Msg = ''
|
|
||||||
var isOk = true
|
|
||||||
if (info.file.status === 'done') {
|
|
||||||
if (info.file.response.IsSuccessful) {
|
|
||||||
that.props.login.RegD = info.file.response.Data//params.stateData.copy() //本来可以传值
|
|
||||||
that.props.data.onCancel()//弹窗关闭
|
|
||||||
that.props.data.close()//主界面回调刷新
|
|
||||||
} else {
|
|
||||||
//失败
|
|
||||||
Msg = info.file.response.ErrorMessage
|
|
||||||
isOk = false
|
|
||||||
// message.error(`${info.file.response.ErrorMessage} `);
|
|
||||||
}
|
|
||||||
} else if (info.file.status === 'error') {
|
|
||||||
isOk = false
|
|
||||||
if (info.file.response && info.file.response.ErrorMessage) {
|
|
||||||
Msg = "【" + info.file.name + '】导入错误,详情:' + info.file.response.ErrorMessage
|
|
||||||
// message.error(`${info.file.name} 导入错误,详情:${info.file.response.ErrorMessage}`);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Msg = "【" + info.file.name + '】导入错误'
|
|
||||||
// message.error(`${info.file.name} 导入错误`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
that.setState({
|
|
||||||
updateLoadFileList: info.fileList,
|
|
||||||
data: info,
|
|
||||||
Msg: '导入说明:' + Msg,
|
|
||||||
isMsgShow: true,
|
|
||||||
isOk: isOk
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
return <div>
|
|
||||||
<div style={{ padding: '10px' }}>
|
|
||||||
<Form>
|
|
||||||
<table>
|
|
||||||
<tr >
|
|
||||||
<td>
|
|
||||||
<Button onClick={() => { downLoad(config.picServerHost, fileName) }}>
|
|
||||||
<Icon type="vertical-align-bottom" /> 下载模板 {/* <a href={config.serviceHost(urlDown)}>下载模板</a> */}
|
|
||||||
</Button>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<Upload style={{ marginLeft: '30px' }} {...uploadProps}>
|
|
||||||
<Button>
|
|
||||||
<Icon type="upload" /> 数据导入
|
|
||||||
</Button>
|
|
||||||
</Upload>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{
|
|
||||||
isMsgShow ? (
|
|
||||||
isOk ? <tr >
|
|
||||||
<td colSpan={2}>
|
|
||||||
{Msg}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
:
|
|
||||||
<tr style={{ color: 'red' }}>
|
|
||||||
<td colSpan={2}>
|
|
||||||
{Msg}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
)
|
|
||||||
: null
|
|
||||||
}
|
|
||||||
</table>
|
|
||||||
</Form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
export default connect(({ login, app }) => ({ login, app }))(SC022ImportData)
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
import { message } from "antd/lib/index";
|
|
||||||
import { getPropertyData, extendInclude, extendRule, auditOptionShow, initFilter, guid, getCustomParams } from "../../utils/common";
|
|
||||||
import FormPage from '../../components/FormPage';
|
|
||||||
import ShowModal from '../../components/common/ShowModal';
|
|
||||||
import { Button } from 'antd'
|
|
||||||
// import { forEach } from "core-js/core/array";
|
|
||||||
// import { now } from "core-js/core/date";
|
|
||||||
// import { connect } from 'dva';
|
|
||||||
// import { forEach } from "core-js/core/array";
|
|
||||||
/**
|
|
||||||
* @return {string}
|
|
||||||
*/
|
|
||||||
// 编辑
|
|
||||||
export default {
|
|
||||||
onBeforeSaveHandleRecord(params) {
|
|
||||||
// debugger
|
|
||||||
// params.record = params.stateData//所有的信息都过去 后台竟然没法接收
|
|
||||||
},
|
|
||||||
btnSubAdd: ({ record, parentRecord, setState, data, stateData, close, loadData, login, btn, closeForm, onCancel }) => {//setStateData 报错
|
|
||||||
let dataSubForm = {
|
|
||||||
content: <FormPage formCode={btn.FORM_CODE} data={{
|
|
||||||
id: (record ? record.ID : (stateData && stateData.ID ? stateData.ID : '')),
|
|
||||||
homeReload: true,
|
|
||||||
...getCustomParams(btn.CUSTOM_PARAMS),
|
|
||||||
rules: [parentRecord],
|
|
||||||
close: () => {
|
|
||||||
if (login.RegD && login.RegD.length > 0) {
|
|
||||||
if (stateData.Nav_Detail == null) {
|
|
||||||
stateData.Nav_Detail = []
|
|
||||||
}
|
|
||||||
debugger
|
|
||||||
login.RegD.forEach(e => {
|
|
||||||
stateData.Nav_Detail.push(e)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
login.RegD = {}
|
|
||||||
},
|
|
||||||
onCancel: () => {
|
|
||||||
//wyw 此方法要有不能被删除 别处会重写
|
|
||||||
debugger
|
|
||||||
},
|
|
||||||
}} />,
|
|
||||||
};
|
|
||||||
return {
|
|
||||||
content: <ShowModal data={dataSubForm} login={login} title={btn.LABEL}>
|
|
||||||
<Button type={btn.CSS} icon={btn.ICON}>{btn.LABEL}</Button>
|
|
||||||
</ShowModal>
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@ -21,7 +21,6 @@ const createLoadableComponent = (importFunc) => Loadable({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const SC022Import = createLoadableComponent(() => import('../components/CustomPages/SC/SC022Import'))
|
const SC022Import = createLoadableComponent(() => import('../components/CustomPages/SC/SC022Import'))
|
||||||
const SC022ImportData = createLoadableComponent(() => import('../components/CustomPages/SC/SC022ImportData'))
|
|
||||||
const FMUserEditPage = createLoadableComponent(() => import('../components/CustomPages/FM/UserEditPage'))
|
const FMUserEditPage = createLoadableComponent(() => import('../components/CustomPages/FM/UserEditPage'))
|
||||||
const FMUserEditPageAuth = createLoadableComponent(() => import('../components/CustomPages/FM/UserEditPageAuth'))
|
const FMUserEditPageAuth = createLoadableComponent(() => import('../components/CustomPages/FM/UserEditPageAuth'))
|
||||||
const FMUserGroupEditPage = createLoadableComponent(() => import('../components/CustomPages/FM/UserGroupEditPage'))
|
const FMUserGroupEditPage = createLoadableComponent(() => import('../components/CustomPages/FM/UserGroupEditPage'))
|
||||||
@ -258,7 +257,6 @@ export default function (componentName, formId, formParam, data, formCode, formD
|
|||||||
return {
|
return {
|
||||||
|
|
||||||
SC022Import: <SC022Import formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
SC022Import: <SC022Import formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||||
SC022ImportData: <SC022ImportData formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
|
||||||
FMUserEditPage: <FMUserEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
FMUserEditPage: <FMUserEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||||
FMUserEditPageAuth: <FMUserEditPageAuth formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
FMUserEditPageAuth: <FMUserEditPageAuth formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||||
FMUserGroupEditPage: <FMUserGroupEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
FMUserGroupEditPage: <FMUserGroupEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||||
|
|||||||
@ -21,7 +21,6 @@ const createLoadableComponent = (importFunc) => Loadable({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const SC022Import = createLoadableComponent(() => import('../components/CustomPages/SC/SC022Import'))
|
const SC022Import = createLoadableComponent(() => import('../components/CustomPages/SC/SC022Import'))
|
||||||
const SC022ImportData = createLoadableComponent(() => import('../components/CustomPages/SC/SC022ImportData'))
|
|
||||||
const FMUserEditPage = createLoadableComponent(() => import('../components/CustomPages/FM/UserEditPage'))
|
const FMUserEditPage = createLoadableComponent(() => import('../components/CustomPages/FM/UserEditPage'))
|
||||||
const FMUserEditPageAuth = createLoadableComponent(() => import('../components/CustomPages/FM/UserEditPageAuth'))
|
const FMUserEditPageAuth = createLoadableComponent(() => import('../components/CustomPages/FM/UserEditPageAuth'))
|
||||||
const FMUserGroupEditPage = createLoadableComponent(() => import('../components/CustomPages/FM/UserGroupEditPage'))
|
const FMUserGroupEditPage = createLoadableComponent(() => import('../components/CustomPages/FM/UserGroupEditPage'))
|
||||||
@ -247,7 +246,6 @@ export default function (componentName, formId, formParam, data, formCode, formD
|
|||||||
return {
|
return {
|
||||||
|
|
||||||
SC022Import: <SC022Import formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
SC022Import: <SC022Import formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||||
SC022ImportData: <SC022ImportData formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
|
||||||
FMUserEditPage: <FMUserEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
FMUserEditPage: <FMUserEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||||
FMUserEditPageAuth: <FMUserEditPageAuth formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
FMUserEditPageAuth: <FMUserEditPageAuth formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||||
FMUserGroupEditPage: <FMUserGroupEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
FMUserGroupEditPage: <FMUserGroupEditPage formId={formId} formParam={formParam} data={data} formCode={formCode} formData={formData} />,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user