Compare commits
2 Commits
827ce856f7
...
d0b3903772
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0b3903772 | ||
|
|
76a539d989 |
@ -5,7 +5,7 @@ import {
|
|||||||
empty,
|
empty,
|
||||||
getDataFieldValue,
|
getDataFieldValue,
|
||||||
guid,
|
guid,
|
||||||
setDataFieldValue,
|
setDataFieldValue,getCustomParams,
|
||||||
extendRule,
|
extendRule,
|
||||||
permissionUtils,
|
permissionUtils,
|
||||||
initFilter,
|
initFilter,
|
||||||
@ -574,7 +574,6 @@ 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>
|
||||||
@ -2970,6 +2969,7 @@ params【字段属性】=值
|
|||||||
clickKey,
|
clickKey,
|
||||||
close,
|
close,
|
||||||
getIds,
|
getIds,
|
||||||
|
...getCustomParams(btnConfig.customParams),//wyw 使能获取到 按钮参数 SE072 使用
|
||||||
onSave: () => {
|
onSave: () => {
|
||||||
close();
|
close();
|
||||||
//this.onAfterBtnCallApi({...params});
|
//this.onAfterBtnCallApi({...params});
|
||||||
|
|||||||
169
src/components/CustomPages/SC/SC022ImportData.js
Normal file
169
src/components/CustomPages/SC/SC022ImportData.js
Normal file
@ -0,0 +1,169 @@
|
|||||||
|
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)
|
||||||
50
src/files/edit/SE072.js
Normal file
50
src/files/edit/SE072.js
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
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,6 +21,7 @@ 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'))
|
||||||
@ -257,6 +258,7 @@ 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,6 +21,7 @@ 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'))
|
||||||
@ -246,6 +247,7 @@ 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