提交 3f5ffe8b authored 作者: 钟是志's avatar 钟是志

26991 专场招聘--签到二维码显示优化

上级 74d25ab6
...@@ -2,10 +2,11 @@ import { text, number, date, format, taskNode } from '../config/index'; ...@@ -2,10 +2,11 @@ import { text, number, date, format, taskNode } from '../config/index';
import { isJSON } from '@/baseComponent/utils'; import { isJSON } from '@/baseComponent/utils';
import { translateAddFields, getSearchCondition } from '../config/index'; import { translateAddFields, getSearchCondition } from '../config/index';
import config from '@/config/config'; import config from '@/config/config';
import { Tooltip } from 'antd'; import { Tooltip, Modal } from 'antd';
import moment from 'moment'; import moment from 'moment';
import React from 'react'; import React from 'react';
import { findListTaskDefinition } from '@/webPublic/FormInsertDiy/AffairPage/publicApiService'; import { findListTaskDefinition } from '@/webPublic/FormInsertDiy/AffairPage/publicApiService';
import QRCode from 'qrcode.react';
const handleSqlModels = (sqlModels, defaultValues) => { const handleSqlModels = (sqlModels, defaultValues) => {
if (typeof sqlModels === 'undefined' || !Array.isArray(sqlModels)) { if (typeof sqlModels === 'undefined' || !Array.isArray(sqlModels)) {
...@@ -70,7 +71,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => { ...@@ -70,7 +71,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => {
} }
} }
if (content.comName === 'PartForm') { if (content.comName === 'PartForm') {
const { childFormKey, columnIds } = content; const {
childFormKey,
columnIds
} = content;
if (childFormKey) { if (childFormKey) {
let thisSource = (obj[childFormKey] && obj[childFormKey].items) || []; let thisSource = (obj[childFormKey] && obj[childFormKey].items) || [];
let thisFields = funcHandleFileds(thisSource, obj, fieldsColumns); let thisFields = funcHandleFileds(thisSource, obj, fieldsColumns);
...@@ -106,7 +110,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => { ...@@ -106,7 +110,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => {
if (content.enums) { if (content.enums) {
let options = isJSON(content.enums) ? JSON.parse(content.enums) : []; let options = isJSON(content.enums) ? JSON.parse(content.enums) : [];
options = options.map((x) => { options = options.map((x) => {
return { key: x.value, name: x.label }; return {
key: x.value,
name: x.label
};
}); });
oneFiled.options = options; oneFiled.options = options;
} }
...@@ -126,7 +133,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => { ...@@ -126,7 +133,10 @@ const funcHandleFileds = (source, obj, fieldsColumns) => {
} }
} }
if (content.comName === 'ChildForm') { if (content.comName === 'ChildForm') {
const { childFormKey, columnIds } = content; const {
childFormKey,
columnIds
} = content;
let thisSource = obj[childFormKey].items; let thisSource = obj[childFormKey].items;
let thisFields = funcHandleFileds(thisSource, obj, fieldsColumns); let thisFields = funcHandleFileds(thisSource, obj, fieldsColumns);
for (let i = 0; i < thisFields.length; i++) { for (let i = 0; i < thisFields.length; i++) {
...@@ -289,7 +299,7 @@ export async function destructionGetDetail(response) { ...@@ -289,7 +299,7 @@ export async function destructionGetDetail(response) {
let optProcess = await findListTaskDefinition({ let optProcess = await findListTaskDefinition({
appId: response.id, appId: response.id,
}); });
if(optProcess){ if (optProcess) {
searchCondition.push({ searchCondition.push({
key: 'taskDefKey', key: 'taskDefKey',
name: '流程节点', name: '流程节点',
...@@ -348,6 +358,26 @@ export function handleColumns(columns) { ...@@ -348,6 +358,26 @@ export function handleColumns(columns) {
if (isJSON(text)) { if (isJSON(text)) {
text = JSON.parse(text); text = JSON.parse(text);
} }
if (item.extendType === 'qrCode' && typeof text === 'string') {
let url = text.includes('http') ? text : config.gateWayPort + text;
const clickUrl = () => {
Modal.info({
title: '二维码',
content: <QRCode
bgColor="#FFFFFF"
fgColor="#000000"
level="Q"
size={200}
style={{
display: 'block',
margin: 'auto',
}}
value={url}
/>,
});
};
return (<a onClick={clickUrl}>查看二维码</a>);
}
if (item.extendType === 'file' && typeof text === 'string') { if (item.extendType === 'file' && typeof text === 'string') {
let url = text.includes('http') ? text : config.sqlFormsServer + text; let url = text.includes('http') ? text : config.sqlFormsServer + text;
return ( return (
...@@ -390,9 +420,11 @@ export function handleColumns(columns) { ...@@ -390,9 +420,11 @@ export function handleColumns(columns) {
if (!isNaN(Number(text)) && Number(text) > 10000000) { if (!isNaN(Number(text)) && Number(text) > 10000000) {
text = Number(text); text = Number(text);
if (item.dataFormatStrWeb) { if (item.dataFormatStrWeb) {
return moment(text).format(item.dataFormatStrWeb); return moment(text)
.format(item.dataFormatStrWeb);
} }
return moment(text).format(format[item.dataType]); return moment(text)
.format(format[item.dataType]);
} else { } else {
return ''; return '';
} }
...@@ -418,15 +450,7 @@ export function handleColumns(columns) { ...@@ -418,15 +450,7 @@ export function handleColumns(columns) {
} }
}; };
} }
/*if (columnsLength > 10 && item.title && !item.width) {
item.width = item.title.length * 30;
if (item.title === '学号') {
item.width = 140;
}
if (item.title.indexOf('时间') > -1) {
item.width = 150;
}
}*/
} }
return columns; return columns;
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论