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

样式修改

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