提交 55582527 authored 作者: 姚鑫国's avatar 姚鑫国
......@@ -9,5 +9,10 @@ import AuditPage from './index';
import { getIsBei_Dian } from '@/webPublic/zyd_public/utils/getSchoolType';
export default function BatchAudit(props) {
return <AuditPage {...props} hasBatchAudit={!getIsBei_Dian() && true} />;
let noNeedForm = false;
if (props.workId === '1492048888356405248') {
noNeedForm = true;
}
return <AuditPage {...props} hasBatchAudit={!getIsBei_Dian() && true} noNeedForm={noNeedForm} />;
}
......@@ -332,6 +332,7 @@ export default class List extends Component {
search={pageSearch.search}
getPage={this.getPage}
children={children}
columns={columns}
/>
) : null}
<StandardTable {...tableProps} />
......
/**
* 禅道 30031 已处理的页面增加导出按钮
* */
import { message } from 'antd';
import React from 'react';
import { downloadFile } from '@/webPublic/one_stop_public/Table/globalFunction';
import { getToken } from '@/webPublic/one_stop_public/utils/token';
export default function exportHandledInfo({
columns = [],
appId = '1492048888356405248',
type = 'handled',
}) {
const headers = columns.filter((g) => {
return g.dataIndex !== 'operationDiy';
}).map((g) => {
if(g.title === '流程审核状态'){
return {
key: 'formStatusName',
title: g.title,
};
}
return {
key: g.dataIndex,
title: g.title,
};
});
const data = {
appId,
type,
headers: JSON.stringify(headers),
token: getToken(),
};
if(appId){
message.info('正在导出文件,请耐心等待');
let url = window.CONFIG.OAUTH_ACTION_PATH + '/UnifiedAppFormApi/exportData';
downloadFile(url, data);
}
}
......@@ -5,7 +5,7 @@ import ModalForm from './ModalForm';
export default class ButtonListDom extends Component {
render() {
const { config, getPage, selectRows, formValues, children, search, listData } = this.props;
const { config, getPage, selectRows, formValues, children, search, listData, columns } = this.props;
return (
<div style={{ height: '50px', padding: '12px 0 12px 12px', positon: 'relative' }}>
{config.map((item, i) => {
......@@ -33,7 +33,7 @@ export default class ButtonListDom extends Component {
key={item.type}
className={item.className || 'defaultBule'}
handleClick={() => {
item.handleClick(selectRows, formValues, getPage, search);
item.handleClick(selectRows, formValues, getPage, search, columns);
}}
/>
);
......
......@@ -12,6 +12,8 @@ import Detail from '@/webPublic/FormInsertDiy/AffairPage/Detail'; //详情
import { Modal, message, notification, Popconfirm } from 'antd';
import { connect } from 'dva';
import router from 'umi/router';
import { getIsQian_Nan } from '@/webPublic/zyd_public/utils/getSchoolType';
import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/exportHandledInfo';
export const CreateC = createContext({
routerConfig: {},
......@@ -77,6 +79,23 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
Res = <Audit workId={appId} {...otherProps} />;
break;
case 'BatchAudit': // 批量审批
if(appId === '1492048888356405248' && getIsQian_Nan() || process.env.NODE_ENV === 'development'){
// 禅道30031
otherProps.tab2Buttons = [
{
type: 'export',
name: '导出',
component: 'Normal',
handleClick: (selectRows, formValues, getPage, search, columns) => {
exportHandledInfo({
columns,
appId,
handled: 'handled',
});
},
},
];
}
Res = <BatchAudit workId={appId} {...otherProps} />;
break;
case 'Detail': // 详情
......
export default function lowCodeProps(info) {
return {
searchType: 'instructorSearch', // teacherSearch || studentSearch || instructorSearch
ModalProps: {
// 弹窗的属性
title: '选择辅导员',
},
firstSearchProps: {
// 最左侧搜索栏的属性
inputProps: {
placeholder: '输入辅导员姓名/工号搜索',
},
searchResultTitle: '搜索结果',
},
secondTreeProps: {
// 树形
title: '部门',
loadingTreeDataMessage: '正在加载数据',
},
thirdDetailListProps: {
// 第三栏
title: '详细辅导员列表',
emptyMessage: '暂无详细辅导员列表数据',
},
fourRangeProps: {
// 第四栏
title: '所选择的辅导员范围',
emptyMessage: '暂无选中的辅导员',
},
getResultProps: {
emptySelectMessage: '请至少选择一个辅导员',
message: '正在查询中,请耐心等待',
},
};
}
/**
* 使用方法
return {
before: [
{
children: "选择辅导员", type: "primary", onClick: () => {
// 钟是志
// 2022年10月12日
// 解决按部门选择 辅导员, 选择老师, 选择学生的需求
// window.smartFormSelectPersonComponent.lowCodeProps =
// {
// searchType: 'instructorSearch', // teacherSearch || studentSearch || instructorSearch
// ModalProps: { // 弹窗的属性
// title: '选择辅导员',
// },
// firstSearchProps: { // 最左侧搜索栏的属性
// inputProps: {
// placeholder: '输入辅导员姓名/工号搜索',
// },
// searchResultTitle: '搜索结果',
// },
// secondTreeProps: { // 树形
// title: '部门',
// loadingTreeDataMessage: '正在加载数据',
// },
// thirdDetailListProps: { // 第三栏
// title: '详细辅导员列表',
// emptyMessage: '暂无详细辅导员列表数据',
// },
// fourRangeProps: { // 第四栏
// title: '所选择的辅导员范围',
// emptyMessage: '暂无选中的辅导员',
// },
// getResultProps: {
// emptySelectMessage: '请至少选择一个辅导员',
// message: '正在查询中,请耐心等待',
// },
// };
if (window.smartFormSelectPersonComponent) {
// window.smartFormSelectPersonComponent.initShowData({
// 初始化显示的选中数据 从 callback 的componentState读取
// "checkedList": [],
// "sgUserIds": ['40-1723", "40-1470", "40-971'],
// "sgUsers": [{
// "businessKey": "40-1723",
// "businessMemo": "",
// "businessName": "丁心",
// "children": [],
// "ext": null,
// "isSelect": true,
// "level": 1
// }, {
// "businessKey": "40-1470",
// "businessMemo": "",
// "businessName": "程丽娜",
// "children": [],
// "ext": null,
// "isSelect": true,
// "level": 1
// }, {
// "businessKey": "40-971",
// "businessMemo": "",
// "businessName": "石头",
// "children": [],
// "ext": null,
// "isSelect": true,
// "level": 1
// }],
// "searchKey": "",
// "searchResult": []
// });
window.smartFormSelectPersonComponent.callback = ({ value, componentState }) => { // 回调函数
console.log(value, JSON.stringify(componentState));
// componentState 用于组件数据回显,
};
window.smartFormSelectPersonComponent.changeShow(); // 打开弹窗
}
}
},
]
}
** 使用方法
* */
import styles from './styles/styles.less';
import { Tooltip } from 'antd';
import React from 'react';
const formatTreeData = (treeData = [], res = []) => {
for (let item of treeData) {
item.title = (
<>
<Tooltip title={item.businessMemo}>
<span>{item.businessName}</span>
</Tooltip>
</>
);
item.key = item.businessKey || '0000';
item.checkable = true;
item.selectable = true;
if (!item.isSelect) {
item.selectable = false;
}
// if (!item.isSelect) {
// item.checkable = false;
// item.disabled = true;
// } else {
// item.checkable = true;
// }
// item.selectable = item.selectType === 'floor';
if (item.children && item.children.length) {
item.children = formatTreeData(item.children, []);
} else {
item.isLeaf = true;
}
}
return treeData;
};
const colorTranslate = (item) => {
const colors = {
1: '#6164C1',
2: 'rgb(202, 198, 46)',
3: '#BE0AC1',
};
if (item && item.businessKey) {
return colors[item.businessKey.split('-').length];
}
return colors[item.level] || colors['2'];
};
export function getApis(searchType) {
const apiUrls = {
// https://console-docs.apipost.cn/preview/caa25e097e7386d0/a2d8620d944c56b5?target_id=fe79cb0e-f0db-49ec-bed9-92f4a830bf75
instructorSearch: {
// 查询辅导员
search: '/instructorSearch/search',
findTree: '/instructorSearch/findTree',
findList: '/instructorSearch/findList',
getData: '/instructorSearch/getData',
getDataCacheKey: '/instructorSearch/getDataCacheKey',
readCacheData: '/instructorSearch/readCacheData',
},
teacherSearch: {
// 查询教师
search: '/teacherSearch/search',
findTree: '/teacherSearch/findTree',
findList: '/teacherSearch/findList',
getData: '/teacherSearch/getData',
getDataCacheKey: '/teacherSearch/getDataCacheKey',
readCacheData: '/teacherSearch/readCacheData',
},
studentSearch: {
// 查询学生
search: '/studentSearch/search',
findTree: '/studentSearch/findTree',
findList: '/studentSearch/findList',
getData: '/studentSearch/getData',
getDataCacheKey: '/studentSearch/getDataCacheKey',
readCacheData: '/studentSearch/readCacheData',
},
};
return apiUrls[searchType] || apiUrls.studentSearch;
}
export { formatTreeData, colorTranslate };
@color1: #d43d52;
@color2: #2196F3;
.basicTitle{
background: #fff;
padding: 5px;
}
.man{
color: @color2;
}
.woman{
color: @color1;
}
.bg-green{
background: #4daf61;
padding: 5px 10px;
color: white;
}
@import "./basicTitle.less";
.btn-warning {
color: white;
background-color: #F2B776;
border-color: #F2B776;
}
.btn-success {
color: white;
background-color: #6FC080;
border-color: #6FC080;
margin-right: 3px;
}
.modalTitle {
text-align: center;
}
.numbers {
display: grid;
grid-template-columns: repeat(3, 300px);
margin: 0 auto;
justify-items: center;
align-items: center;
width: 300px;
padding: 10px;
div {
span {
color: red;
}
}
}
.modalContent {
display: grid;
grid-template-columns: 3fr 3fr 3fr 2fr;
column-gap: 10px;
height: 60vh;
.one {
border: 1px solid #e4e4e4;
overflow-y: auto;
.options {
display: flex;
justify-content: space-between;
margin: 16px 0;
.search {
flex: 1;
color: #fff;
background: #6164C1;
border-radius: 5px;
margin-right: 10px;
}
.clear {
flex: 1;
color: #fff;
background: rgb(163, 47, 47);
border-radius: 5px;
}
}
.search_option {
margin-bottom: 6px;
}
.result {
margin-top: 20px;
.search {
border: 1px solid #e4e4e4;
height: auto;
min-height: ~'calc(60vh - 185px)';
overflow-y: auto;
cursor: pointer;
.search_no_result {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
color: #c3c3c3;
}
}
}
.college_name {
height: 30px;
line-height: 30px;
padding-left: 20px;
cursor: pointer;
}
.search_result {
> div {
height: 32px;
padding: 0 16px;
display: flex;
justify-content: space-between;
align-items: center;
font-weight: 900;
& span:last-child {
background-color: #6164C1;
padding: 0 5px;
color: #fff;
border-radius: 20px;
font-weight: 100;
}
}
.selectSg {
width: 96%;
height: 30px;
margin: 10px auto;
line-height: 30px;
padding-left: 10px;
background-color: rgb(202, 198, 46);
color: #fff;
}
}
.search_result_list {
height: 32px;
padding: 0 16px;
line-height: 32px;
font-weight: 900;
.dormCode {
margin-left: 24px;
}
& span:last-child {
background-color: #6164C1;
padding: 0 5px;
color: #fff;
border-radius: 20px;
}
}
.one_title {
height: 30px;
line-height: 30px;
background-color: #F5F7FA;
padding-left: 10px;
border-bottom: 1px solid #e4e4e4;
}
.list_content {
height: 56vh;
overflow-y: auto;
cursor: pointer;
}
.no_result {
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
color: #c3c3c3;
// height: calc(60vh - 32px);
height: 56vh;
}
}
}
.distribution {
:global {
.ant-btn-round {
border-radius: 0;
border: none;
background-color: grey;
color: #fff;
}
.ant-btn-primary {
background-color: skyblue !important;
}
}
}
@color1: #d43d52;
@color2: #2196F3;
.man {
color: @color2;
}
.woman {
color: @color1;
}
.treeDiv {
:global {
.ant-tree-node-content-wrapper {
width: 85%;
}
}
}
.bgPurple {
background-color: #6164C1;
padding: 0 5px;
color: #fff;
border-radius: 20px;
font-weight: 100;
}
.oneSelectedInfo {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
......@@ -3,6 +3,7 @@ import ZdyTable from '@/webPublic/one_stop_public/Table';
import styles from './index.less';
import { fetchTemplateByCode, fetchTableItem } from '@/webPublic/Services';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import SelectPerson from '@/webPublic/FormInsertDiy/ExportComponent/SelectPerson/Index';
export default function RenderForm({
get = 'web',
......@@ -44,6 +45,7 @@ export default function RenderForm({
init={undefined}
{...content}
/>
<SelectPerson />
</div>
);
}
......
import { apiRequest } from '@/webPublic/one_stop_public/utils/request';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import baseX from 'base-x';
import encryptApiList from '@/webPublic/one_stop_public/Base16/encryptApiList';
import encryptApiList from './encryptApiList';
var BASE16 = '0123456789abcdef';
var bs16 = baseX(BASE16);
function checkOpenBase16() {
const is_open_base14 = sessionStorage.getItem('is_open_base16')
? JSON.parse(sessionStorage.getItem('is_open_base16'))
: false;
return is_open_base14;
const is_open_base14 = sessionStorage.getItem('is_open_base16')
? JSON.parse(sessionStorage.getItem('is_open_base16'))
: false;
return is_open_base14;
}
export function Base16Encode(value) {
const is_open_base14 = checkOpenBase16();
if (is_open_base14) {
if (!value) {
return null;
} else {
let newV = new Buffer(value); // 快
const r = bs16.encode(newV); // 慢
return r;
}
}
return value;
const is_open_base14 = checkOpenBase16();
if (is_open_base14) {
if (!value) {
return null;
} else {
let newV = new Buffer(value); // 快
const r = bs16.encode(newV); // 慢
return r;
}
}
return value;
}
function giveKey(key, datas) {
if (datas && datas[key]) {
datas[key] = Base16Encode(datas[key]);
}
return datas;
if (datas && datas[key]) {
datas[key] = Base16Encode(datas[key]);
}
return datas;
}
export async function countAllValues(datas, item) {
// console.log(datas);
if (item.setNull) {
datas.allValues = JSON.stringify({});
} else {
if (item.query && !datas.isMeta) {
if (datas?.sqlKey.length < 13) {
const response = await apiRequest('/SqlManageEntityApi/findParamsKey', {
sqlKey: datas.sqlKey,
});
if (!response || (Array.isArray(response) && response.length === 0)) {
datas.allValues = JSON.stringify({});
} else {
const x = (isJSON(datas.allValues) && JSON.parse(datas.allValues)) || {};
const y = {};
for (let i of response) {
if (x[i]) {
y[i] = x[i];
}
datas.allValues = JSON.stringify(y);
}
}
} else {
datas.allValues = JSON.stringify({});
}
}
}
return datas;
// console.log(datas);
if (item.setNull) {
datas.allValues = JSON.stringify({});
} else {
if (item.query && !datas.isMeta) {
if (datas?.sqlKey.length < 13) {
const response = await apiRequest('/SqlManageEntityApi/findParamsKey', {
sqlKey: datas.sqlKey,
});
if (!response || (Array.isArray(response) && response.length === 0)) {
datas.allValues = JSON.stringify({});
} else {
const x = (isJSON(datas.allValues) && JSON.parse(datas.allValues)) || {};
const y = {};
for (let i of response) {
if (x[i]) {
y[i] = x[i];
}
datas.allValues = JSON.stringify(y);
}
}
} else {
datas.allValues = JSON.stringify({});
}
}
}
return datas;
}
export async function giveBase16EncodeAsync(datas, url) {
if (!checkOpenBase16()) {
return datas;
}
if (url && typeof url === 'string') {
for (let item of encryptApiList) {
if (url.indexOf(item.api) > -1) {
for (let g of item.key) {
if (datas[g] && item.filterEmpty && item.filterEmpty.includes(g)) {
// 压缩代码功能暂时屏蔽
/***
if (url && typeof url === 'string') {
// console.log(url);
// console.log(encryptApiList);
for (const item of encryptApiList) {
if (item.api && url.indexOf(item.api) > -1 && item.key) {
for (let g of item.key) {
// if (datas && datas[g] && item.filterEmpty && item.filterEmpty.includes(g)) {
// 压缩代码功能暂时屏蔽
/***
// console.log(datas[g]);
// console.log('%c加密数据压缩前字段' + g + '= ', 'color: red;');
// console.log('%c'+ datas[g] , 'color: red;');
......@@ -83,31 +82,30 @@ export async function giveBase16EncodeAsync(datas, url) {
// console.log('%c加密数据压缩后字段' + g + '= ', 'color: orange;');
// console.log('%c'+ datas[g] , 'color: orange;');
***/
}
if (g === 'allValues' && typeof datas[g] !== 'undefined') {
datas = await countAllValues(datas, item); // 循环中 不要写await
datas = giveKey('allValues', datas);
} else {
// console.log(g, datas);
datas = giveKey(g, datas);
}
}
// }
if (g === 'allValues' && typeof datas[g] !== 'undefined') {
datas = await countAllValues(datas, item); // 循环中 不要写await
datas = giveKey('allValues', datas);
} else {
// console.log(g, datas);
datas = giveKey(g, datas);
}
}
if (item.yinShe) {
// 映射参数字段.
datas.isBase = true;
for (let oldKey in item.yinShe) {
let newKey = item.yinShe[oldKey];
// if(typeof datas[oldKey] !== 'undefined'){
datas[newKey] = datas[oldKey];
delete datas[oldKey];
// }
}
}
return datas;
}
}
}
return datas;
if (item.yinShe) {
// 映射参数字段.
datas.isBase = true;
for (let oldKey in item.yinShe) {
let newKey = item.yinShe[oldKey];
// if(typeof datas[oldKey] !== 'undefined'){
datas[newKey] = datas[oldKey];
delete datas[oldKey];
// }
}
}
return datas;
}
}
}
return datas;
}
......@@ -58,10 +58,8 @@ class UploadCom extends React.Component {
};
this.otherProps = {};
if (props.json?.otherProps) {
this.otherProps = props.json?.otherProps;
try {
this.otherProps = new Function(this.otherProps)();
// console.log(this.otherProps);
this.otherProps = new Function(props.json?.otherProps)() || {};
} catch (e) {
console.log(e);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论