提交 28f617ad authored 作者: 钟是志's avatar 钟是志

样式修改

上级 15cbad40
...@@ -6,21 +6,21 @@ ...@@ -6,21 +6,21 @@
* callback 提交完成后执行回调函数 * callback 提交完成后执行回调函数
* form form表单控件 * form form表单控件
*/ */
import React, { useState } from 'react'; import React, { useState } from "react";
import { Modal, message } from 'antd'; import { Modal, message } from "antd";
import { preHandle } from '@/webPublic/one_stop_public/utils/myutils'; import { preHandle } from "@/webPublic/one_stop_public/utils/myutils";
import { connect } from 'dva'; import { connect } from "dva";
import Btn from './pagesBtn'; import Btn from "./pagesBtn";
import styles from './styles.less'; import styles from "./styles.less";
import ModalDiy from '@/baseComponent/ModalDiy'; import ModalDiy from "@/baseComponent/ModalDiy";
import { callbackSubmitData } from '@/webPublic/one_stop_public/models/callbackExamineProcess'; import { callbackSubmitData } from "@/webPublic/one_stop_public/models/callbackExamineProcess";
import { getToken } from '@/utils/authority'; import { getToken } from "@/utils/authority";
import { isJSON } from '@/webPublic/zyd_public/utils/utils'; import { isJSON } from "@/webPublic/zyd_public/utils/utils";
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request'; import { uaaRequest } from "@/webPublic/one_stop_public/utils/request";
function AuditButton(props) { function AuditButton(props) {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [modalContent, setModalContent] = useState(''); const [modalContent, setModalContent] = useState("");
const [isSubmitLoading, setSubmitLoading] = useState(false); const [isSubmitLoading, setSubmitLoading] = useState(false);
const [affairOkParams, setAffairParams] = useState({}); const [affairOkParams, setAffairParams] = useState({});
...@@ -28,11 +28,11 @@ function AuditButton(props) { ...@@ -28,11 +28,11 @@ function AuditButton(props) {
// 有taskIds属性时,是批量审核, // 有taskIds属性时,是批量审核,
const { dispatch, callback, data, form, taskIds, selectRows } = props; const { dispatch, callback, data, form, taskIds, selectRows } = props;
const { oldKey, btnValue } = affairOkParams; const { oldKey, btnValue } = affairOkParams;
if (window.stuSigningAuditXueShengChu && btnValue === '0') { if (window.stuSigningAuditXueShengChu && btnValue === "0") {
// 黔南就业学生处批量审批签章 特殊处理 专门为黔南签章批量审核搞的函数
// 应该是点击同意才执行这个全局函数. // 应该是点击同意才执行这个全局函数.
// 专门为黔南签章批量审核搞的函数
window.stuSigningAuditXueShengChu({ window.stuSigningAuditXueShengChu({
userNowInfo: (isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) || {}, userNowInfo: (isJSON(localStorage.getItem("user")) && JSON.parse(localStorage.getItem("user"))) || {},
buttonInfo: data?.btns && data?.btns.length ? data?.btns.find((x) => x.value === btnValue) : {}, buttonInfo: data?.btns && data?.btns.length ? data?.btns.find((x) => x.value === btnValue) : {},
token: getToken(), token: getToken(),
selectRows, selectRows,
...@@ -41,7 +41,7 @@ function AuditButton(props) { ...@@ -41,7 +41,7 @@ function AuditButton(props) {
[oldKey]: btnValue, // 每个配置按钮对应的对象内容 oldkey = 接口中 key btnValue = 接口中 value [oldKey]: btnValue, // 每个配置按钮对应的对象内容 oldkey = 接口中 key btnValue = 接口中 value
// reason: value, // 审批理由 // reason: value, // 审批理由
code: taskIds ? undefined : data.code, code: taskIds ? undefined : data.code,
reason: form.getFieldsValue()?.reason, reason: form.getFieldsValue()?.reason
}), }),
code: taskIds ? undefined : data.code, code: taskIds ? undefined : data.code,
message, message,
...@@ -51,20 +51,21 @@ function AuditButton(props) { ...@@ -51,20 +51,21 @@ function AuditButton(props) {
setVisible, setVisible,
setSubmitLoading, setSubmitLoading,
remark: { remark: {
setVisible: '关闭弹窗的方法', setVisible: "关闭弹窗的方法",
setSubmitLoading: '显示为加载中', setSubmitLoading: "显示为加载中",
path: ' 代码在学工的这里面 src/webPublic/FormInsertDiy/AuditButton/index.js', path: " 代码在学工的这里面 src/webPublic/FormInsertDiy/AuditButton/index.js",
message: '蚂蚁金服的message 用来展示进度条. 不懂问我', message: "蚂蚁金服的message 用来展示进度条. 不懂问我",
Modal: '蚂蚁金服的Modal 用来提示审核已完成', Modal: "蚂蚁金服的Modal 用来提示审核已完成",
callback: '执行完了的回调函数', callback: "执行完了的回调函数",
else: '其他参数打印出来自己看看', else: "其他参数打印出来自己看看",
uaaRequest: '调一站式的接口的方法', uaaRequest: "调一站式的接口的方法"
}, }
}); });
return true; return true;
} }
form.validateFieldsAndScroll((err, values) => {
if (err) return; let buttonInfo = data?.btns && data?.btns.length ? data?.btns.find((x) => x.value === btnValue) : {};
const submitValues = (values) => {
setSubmitLoading(true); setSubmitLoading(true);
preHandle(values); preHandle(values);
let payload = { let payload = {
...@@ -74,20 +75,19 @@ function AuditButton(props) { ...@@ -74,20 +75,19 @@ function AuditButton(props) {
examineMap: JSON.stringify({ examineMap: JSON.stringify({
[oldKey]: btnValue, // 每个配置按钮对应的对象内容 oldkey = 接口中 key btnValue = 接口中 value [oldKey]: btnValue, // 每个配置按钮对应的对象内容 oldkey = 接口中 key btnValue = 接口中 value
// reason: value, // 审批理由 // reason: value, // 审批理由
code: taskIds ? undefined : data.code, code: taskIds ? undefined : data.code
}), }),
taskForm: JSON.stringify(values), // 审批表单的参数值 taskForm: JSON.stringify(values), // 审批表单的参数值
apiData: data, apiData: data,
taskFormKey: data?.taskFormKey, taskFormKey: data?.taskFormKey,
userNowInfo: userNowInfo:
(isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) || {}, (isJSON(localStorage.getItem("user")) && JSON.parse(localStorage.getItem("user"))) || {},
buttonInfo: buttonInfo,
data?.btns && data?.btns.length ? data?.btns.find((x) => x.value === btnValue) : {}, token: getToken()
token: getToken(),
}; };
payload = callbackSubmitData(payload); payload = callbackSubmitData(payload);
dispatch({ dispatch({
type: 'affair/getExamineProcess', type: "affair/getExamineProcess",
payload, payload,
callback: (val) => { callback: (val) => {
setSubmitLoading(false); setSubmitLoading(false);
...@@ -95,11 +95,21 @@ function AuditButton(props) { ...@@ -95,11 +95,21 @@ function AuditButton(props) {
if (callback) { if (callback) {
callback(val); callback(val);
} }
}, }
}); });
};
console.log(buttonInfo);
if (buttonInfo?.isValidateForm === false) {
submitValues(form.getFieldsValue());
} else {
form.validateFieldsAndScroll((err, values) => {
if (err) return;
submitValues(values);
}); });
} }
}
function hideModal() { function hideModal() {
setVisible(false); setVisible(false);
} }
...@@ -108,25 +118,25 @@ function AuditButton(props) { ...@@ -108,25 +118,25 @@ function AuditButton(props) {
* 根据不同值,返回对应样式 * 根据不同值,返回对应样式
*/ */
function getStyle(key, value) { function getStyle(key, value) {
if (key === 'examine') { if (key === "examine") {
switch (value) { switch (value) {
case 1: case 1:
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_reject}`].join(' '); return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_reject}`].join(" ");
case 2: case 2:
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_no}`].join(' '); return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_no}`].join(" ");
case 0: case 0:
return 'deafalut'; return "deafalut";
case '1': case "1":
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_reject}`].join(' '); return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_reject}`].join(" ");
case '2': case "2":
return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_no}`].join(' '); return [`${styles.btn_margin}`, `${styles.btn}`, `${styles.btn_no}`].join(" ");
case '0': case "0":
return 'deafalut'; return "deafalut";
default: default:
return 'deafalut'; return "deafalut";
} }
} else { } else {
return 'deafalut'; return "deafalut";
} }
} }
...@@ -137,7 +147,7 @@ function AuditButton(props) { ...@@ -137,7 +147,7 @@ function AuditButton(props) {
} }
const { const {
data: { isHandle, btns }, data: { isHandle, btns }
} = props; } = props;
if (!isHandle || !Array.isArray(btns) || btns.length < 1) return null; if (!isHandle || !Array.isArray(btns) || btns.length < 1) return null;
return ( return (
...@@ -161,7 +171,7 @@ function AuditButton(props) { ...@@ -161,7 +171,7 @@ function AuditButton(props) {
handleCancel={hideModal} handleCancel={hideModal}
handleOk={affairOk} handleOk={affairOk}
confirmLoading={isSubmitLoading}> confirmLoading={isSubmitLoading}>
<div style={{ fontSize: 16, textAlign: 'center', height: 150, lineHeight: '150px' }}> <div style={{ fontSize: 16, textAlign: "center", height: 150, lineHeight: "150px" }}>
{modalContent} {modalContent}
</div> </div>
</ModalDiy> </ModalDiy>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论