Commit 2dfd6932 authored by Bill's avatar Bill

fix: 修改会员bug

parent ca0419ba
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* @LastEditTime: 2021-04-21 16:53:13 * @LastEditTime: 2021-04-21 16:53:13
*/ */
// import CommodityRoute from './commodityRoute' // 商品能力路由 // import CommodityRoute from './commodityRoute' // 商品能力路由
// import MemberRoute from './memberRoute' // 会员能力路由 import MemberRoute from './memberRoute' // 会员能力路由
// import ShopRoute from './shopRoute' // 店铺能力路由 // import ShopRoute from './shopRoute' // 店铺能力路由
// import ChannelRoute from './channelRoute' // 渠道能力路由 // import ChannelRoute from './channelRoute' // 渠道能力路由
// import TranactionRoute from './tranactionRoute' // 交易能力路由 // import TranactionRoute from './tranactionRoute' // 交易能力路由
......
import React from 'react';
interface Iprops {
files: {
name: string,
url: string
}[]
}
const FileListRender = (props: Iprops) => {
const { files } = props;
const length = files?.length || 0
return (
<div style={{display: 'flex', flexDirection: 'column', width: '100%'}}>
{
files?.map((_row, index) => {
return (
<a style={ index + 1 === length ? {} : {marginBottom: '4px'}} key={_row.url} href={_row.url}>{_row.name}</a>
)
})
}
</div>
)
}
export default FileListRender;
...@@ -192,7 +192,13 @@ UploadFiles.defaultProps = { ...@@ -192,7 +192,13 @@ UploadFiles.defaultProps = {
uploadOrder: 2, uploadOrder: 2,
action: '/api/file/file/upload', action: '/api/file/file/upload',
headers: {}, headers: {},
beforeUpload: (file, fileList) => true, beforeUpload: (file: UploadFile) => {
if (file.size > 20 * 1024 * 1024) {
message.error("上传文件不能大于20m")
return false
}
return true
},
onChange: (file: UploadChangeParam) => { }, onChange: (file: UploadChangeParam) => { },
customizeItemRender: null, customizeItemRender: null,
onRemove: null, onRemove: null,
......
...@@ -149,7 +149,6 @@ const SuggestAdd = () => { ...@@ -149,7 +149,6 @@ const SuggestAdd = () => {
} }
const handleFetchUserData = useCallback(async (params: GetMemberInspectUsersRequest) => { const handleFetchUserData = useCallback(async (params: GetMemberInspectUsersRequest) => {
console.log(params);
const { data, code } = await PublicApi.getMemberInspectUsers(params); const { data, code } = await PublicApi.getMemberInspectUsers(params);
if (code === 1000) { if (code === 1000) {
return data; return data;
......
import React from 'react'; import React from 'react';
import { useMemo } from "react"; import { useMemo } from "react";
import FileListRender from '@/components/UploadFiles/FileListRender';
function useGetDetailCommon({ initialValue }) { function useGetDetailCommon({ initialValue }) {
...@@ -26,17 +27,9 @@ function useGetDetailCommon({ initialValue }) { ...@@ -26,17 +27,9 @@ function useGetDetailCommon({ initialValue }) {
value: initialValue?.name value: initialValue?.name
}, },
{ {
title: "附件", title: "事件附件",
value: ( value: (
<div> <FileListRender files={initialValue?.attachments} />
{
initialValue?.attachments?.map((_row) => {
return (
<a key={_row.url} href={_row.href}>{_row.name}</a>
)
})
}
</div>
) )
}, },
{ {
...@@ -71,17 +64,9 @@ function useGetDetailCommon({ initialValue }) { ...@@ -71,17 +64,9 @@ function useGetDetailCommon({ initialValue }) {
value: initialValue?.handleUserName value: initialValue?.handleUserName
}, },
{ {
title: "附件", title: "处理附件",
value: ( value: (
<div> <FileListRender files={initialValue?.handleAttachments} />
{
initialValue?.handleAttachments.map((_row) => {
return (
<a key={_row.url} href={_row.href}>{_row.name}</a>
)
})
}
</div>
) )
}, },
{ {
......
...@@ -84,7 +84,7 @@ export const complaintAddSchema: ISchema = { ...@@ -84,7 +84,7 @@ export const complaintAddSchema: ISchema = {
}, },
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 40
} }
], ],
'x-component-props': { 'x-component-props': {
...@@ -163,12 +163,14 @@ export const complaintAddSchema: ISchema = { ...@@ -163,12 +163,14 @@ export const complaintAddSchema: ISchema = {
"x-component-props": { "x-component-props": {
style: { style: {
width: '100%' width: '100%'
} },
placeholder: '最长120个字符,60个汉字'
}, },
'x-rules': [ 'x-rules': [
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 120
} }
] ]
}, },
...@@ -191,13 +193,17 @@ export const complaintAddSchema: ISchema = { ...@@ -191,13 +193,17 @@ export const complaintAddSchema: ISchema = {
'x-rules': [ 'x-rules': [
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 120
}, },
{ {
required: true, required: true,
message: "请填写事件描述" message: "请填写事件描述"
} }
] ],
"x-component-props": {
placeholder: '最长120个字符,60个汉字'
},
}, },
attachments: { attachments: {
title: '事件附件', title: '事件附件',
......
...@@ -23,8 +23,15 @@ export const handleFormSchema: ISchema = { ...@@ -23,8 +23,15 @@ export const handleFormSchema: ISchema = {
{ {
required: true, required: true,
message: '请填写处理结果' message: '请填写处理结果'
},
{
limitByte: true, // 自定义校验规则
maxByte: 60
} }
], ],
"x-component-props": {
placeholder: "最长60个字符,30个汉字"
}
}, },
handleTime: { handleTime: {
title: "处理时间", title: "处理时间",
...@@ -76,7 +83,7 @@ export const handleFormSchema: ISchema = { ...@@ -76,7 +83,7 @@ export const handleFormSchema: ISchema = {
// ] // ]
}, },
handleAttachments: { handleAttachments: {
title: '附件', title: '处理附件',
type: 'object', type: 'object',
'x-component': 'FormilyUploadFiles', 'x-component': 'FormilyUploadFiles',
} }
......
...@@ -4,7 +4,6 @@ import AnchorPage from '@/layouts/AnchorPage'; ...@@ -4,7 +4,6 @@ import AnchorPage from '@/layouts/AnchorPage';
import CustomizeColumn from '@/components/CustomizeColumn'; import CustomizeColumn from '@/components/CustomizeColumn';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import theme from '../../../../config/lingxi.theme.config'; import theme from '../../../../config/lingxi.theme.config';
import useFetchInfo from '../memberEvaluate/hooks/useFetchInfo';
import useGetAnchorHeader from './common/hooks/useGetAnchorHeader'; import useGetAnchorHeader from './common/hooks/useGetAnchorHeader';
import useGetDetailCommon from './common/hooks/useGetDetailCommon'; import useGetDetailCommon from './common/hooks/useGetDetailCommon';
import useModal from '../memberEvaluate/hooks/useModal'; import useModal from '../memberEvaluate/hooks/useModal';
......
...@@ -91,14 +91,20 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => { ...@@ -91,14 +91,20 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
if (!visible) { if (!visible) {
return; return;
} }
const keys = value.map( let list = value;
const currentMode = customizeRadio || mode === 'radio';
if (currentMode) {
list = list.slice(-1);
}
const keys = list.map(
(_row) => { (_row) => {
// console.log(typeof tableProps.rowKey === 'string' && tableProps.rowKey(_row)) // console.log(typeof tableProps.rowKey === 'string' && tableProps.rowKey(_row))
return typeof tableProps.rowKey === 'string' ? _row[tableProps.rowKey as string] : tableProps.rowKey(_row) return typeof tableProps.rowKey === 'string' ? _row[tableProps.rowKey as string] : tableProps.rowKey(_row)
}); });
setSelectRow(keys) setSelectRow(keys)
setSelectRowRecord(value); setSelectRowRecord(value);
}, [visible, value]) }, [visible, value, mode, customizeRadio])
const handleEffects = ($: any, actions: any) => { const handleEffects = ($: any, actions: any) => {
effects?.($, actions); effects?.($, actions);
...@@ -127,12 +133,12 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => { ...@@ -127,12 +133,12 @@ const TableModal: React.FC<Iprops> = (props: Iprops) => {
const keys = recordRows.map((_item) => typeof tableProps.rowKey === 'string' ? _item[tableProps.rowKey as string] : tableProps.rowKey(_item)); const keys = recordRows.map((_item) => typeof tableProps.rowKey === 'string' ? _item[tableProps.rowKey as string] : tableProps.rowKey(_item));
// if (selected) { // if (selected) {
const returnValue =await beforeChecked(record, selected, selectedRows); const returnValue =await beforeChecked(record, selected, recordRows);
if (returnValue === false) { if (returnValue === false) {
return; return;
} }
// } // }
setSelectRowRecord(selectedRows) setSelectRowRecord(recordRows)
setSelectRow(keys) setSelectRow(keys)
}; };
......
...@@ -191,7 +191,8 @@ const EvaluateAdd = (props) => { ...@@ -191,7 +191,8 @@ const EvaluateAdd = (props) => {
memberName: { memberName: {
userId: 0, userId: 0,
name: "系统" name: "系统"
} },
sendAppraisal: true,
})) || [] })) || []
// const withProjectId = new Set(tempData.map((_item) => _item.id)); // const withProjectId = new Set(tempData.map((_item) => _item.id));
const dataSource = formActions.getFieldValue('tabs.tab-2.items') || []; const dataSource = formActions.getFieldValue('tabs.tab-2.items') || [];
......
import React, { useEffect, useState } from 'react';
/**
* 获取详情
*/
type ParamsType = {
id: number,
}
type HeadersType = {
[key: string]: any,
}
type Ires = {
code: number,
data: { [key: string]: any },
message: string
}
function useFetchInfo<T extends Ires>(api: (data: any) => Promise<T>, params: ParamsType, headers?: HeadersType) {
const [loading, setLoading] = useState<boolean>(false);
const [initialValue, setInitialValue] = useState<null | Ires["data"]>(null);
useEffect(() => {
async function init() {
setLoading(true)
return new Promise<void>((resolve) => {
setTimeout(() => {
setLoading(false);
setInitialValue({
theme: 'hellow',
files: [
{
name: '百度12312',
url: "http://www.baidu.com"
}
],
scoringList: [
{
id: 1,
projectName: "123",
memberName: {
"id": 2,
"name":"456"
},
baogao: [
{
name: '123',
url: 'http://www.baidu.com/zzz.png',
}
]
}
]
})
resolve()
}, 1500)
})
}
init()
}, [])
return { loading, initialValue }
}
export default useFetchInfo
...@@ -2,6 +2,7 @@ import React, { useMemo, useState } from 'react'; ...@@ -2,6 +2,7 @@ import React, { useMemo, useState } from 'react';
import { Progress } from 'antd'; import { Progress } from 'antd';
import { GetMemberAppraisalResultGetResponse, GetMemberAppraisalSummaryGetResponse } from '@/services/MemberV2Api'; import { GetMemberAppraisalResultGetResponse, GetMemberAppraisalSummaryGetResponse } from '@/services/MemberV2Api';
import { findLastIndexFlowState } from '@/utils'; import { findLastIndexFlowState } from '@/utils';
import FileListRender from '@/components/UploadFiles/FileListRender'
/** /**
* 获取考评详情页的公共部分 * 获取考评详情页的公共部分
...@@ -64,13 +65,14 @@ function useGetDetailCommon(options: Options) { ...@@ -64,13 +65,14 @@ function useGetDetailCommon(options: Options) {
title: '附件', title: '附件',
value: ( value: (
<div> <div>
{ {/* {
initialValue?.attachments?.map((_row) => { initialValue?.attachments?.map((_row) => {
return ( return (
<a key={_row.url} href={_row.url}>{_row.name}</a> <a key={_row.url} href={_row.url}>{_row.name}</a>
) )
}) })
} } */}
<FileListRender files={initialValue?.attachments} />
</div> </div>
) )
}, },
...@@ -79,7 +81,7 @@ function useGetDetailCommon(options: Options) { ...@@ -79,7 +81,7 @@ function useGetDetailCommon(options: Options) {
value: initialValue?.subject, value: initialValue?.subject,
}, },
{ {
title: '考范围', title: '考范围',
span: 2, span: 2,
value: ( value: (
<div> <div>
...@@ -110,7 +112,7 @@ function useGetDetailCommon(options: Options) { ...@@ -110,7 +112,7 @@ function useGetDetailCommon(options: Options) {
) )
}, },
{ {
title: '考结果', title: '考结果',
value: initialValue?.result value: initialValue?.result
}, },
{ {
......
...@@ -38,11 +38,11 @@ export const evaluateAddSchema: ISchema = { ...@@ -38,11 +38,11 @@ export const evaluateAddSchema: ISchema = {
}, },
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 40
} }
], ],
'x-component-props': { 'x-component-props': {
placeholder: '最长60个字符,30个汉字' placeholder: '最长40个字符,20个汉字'
} }
}, },
name: { name: {
...@@ -70,7 +70,7 @@ export const evaluateAddSchema: ISchema = { ...@@ -70,7 +70,7 @@ export const evaluateAddSchema: ISchema = {
display: false, display: false,
}, },
'[appraisalDayStart, appraisalDayEnd]': { '[appraisalDayStart, appraisalDayEnd]': {
title: <div>考评时间 <span style={{color: '#ff4d4f', fontSize: '16px', marginLeft: '4px'}}>*</span></div>, title: <div>考评范围 <span style={{color: '#ff4d4f', fontSize: '16px', marginLeft: '4px'}}>*</span></div>,
type: 'object', type: 'object',
"x-component": 'FormilyRangeTime', "x-component": 'FormilyRangeTime',
"x-component-props": { "x-component-props": {
...@@ -128,6 +128,9 @@ export const evaluateAddSchema: ISchema = { ...@@ -128,6 +128,9 @@ export const evaluateAddSchema: ISchema = {
operations: { operations: {
title: '操作' title: '操作'
}, },
scroll: {
x: '1100px'
}
}, },
"x-rules": [ "x-rules": [
{ {
...@@ -150,6 +153,7 @@ export const evaluateAddSchema: ISchema = { ...@@ -150,6 +153,7 @@ export const evaluateAddSchema: ISchema = {
}, },
"x-props": { "x-props": {
width: 65, width: 65,
fixed: 'left',
}, },
"x-component-props": { "x-component-props": {
} }
...@@ -160,6 +164,7 @@ export const evaluateAddSchema: ISchema = { ...@@ -160,6 +164,7 @@ export const evaluateAddSchema: ISchema = {
"x-component-props": {}, "x-component-props": {},
"x-props": { "x-props": {
width: 160, width: 160,
fixed: 'left',
}, },
'x-rules': [ 'x-rules': [
{ {
...@@ -207,7 +212,7 @@ export const evaluateAddSchema: ISchema = { ...@@ -207,7 +212,7 @@ export const evaluateAddSchema: ISchema = {
'x-linkages': [ 'x-linkages': [
{ {
type: 'value:state', type: 'value:state',
target: '..[].*(memberName)', target: '..[].*(memberName,name,content)',
// true 的时候不能填 // true 的时候不能填
state: { state: {
editable: '{{$value && $value.userId !== 0}}' editable: '{{$value && $value.userId !== 0}}'
......
...@@ -7,7 +7,6 @@ import AuditProcess from '@/components/AuditProcess'; ...@@ -7,7 +7,6 @@ import AuditProcess from '@/components/AuditProcess';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { projectColumns, recordColumn } from '../columns/detail'; import { projectColumns, recordColumn } from '../columns/detail';
import useGetDetailCommon from '../hooks/useGetDetailCommon'; import useGetDetailCommon from '../hooks/useGetDetailCommon';
import useFetchInfo from '../hooks/useFetchInfo';
import useModal from '../hooks/useModal'; import useModal from '../hooks/useModal';
import theme from '../../../../../config/lingxi.theme.config'; import theme from '../../../../../config/lingxi.theme.config';
import ExamVerify, { SubmitDataTypes } from '@/components/ExamVerify'; import ExamVerify, { SubmitDataTypes } from '@/components/ExamVerify';
......
...@@ -43,10 +43,22 @@ export const modifyEvaluateScore: ISchema = { ...@@ -43,10 +43,22 @@ export const modifyEvaluateScore: ISchema = {
scoreWeight: { scoreWeight: {
title: '权重', title: '权重',
type: 'string', type: 'string',
'x-rules': [
{
pattern: /^((\d+))$/,
message: '请填写整数'
}
],
}, },
grade: { grade: {
title: '考评计分', title: '考评计分',
type: 'string', type: 'string',
'x-rules': [
{
pattern: /^((\d+)(\.\d{1,2})?)$/,
message: '请填写数字,可以保留2位小数'
}
],
}, },
templates: { templates: {
title: '考评模板', title: '考评模板',
...@@ -93,8 +105,15 @@ export const evaluateScoreRes: ISchema = { ...@@ -93,8 +105,15 @@ export const evaluateScoreRes: ISchema = {
{ {
required: true, required: true,
message: "请填写考评最终分", message: "请填写考评最终分",
},
{
pattern: /^((\d+)(\.\d{1,2})?)$/,
message: '请填写数字,可以保留2位小数'
} }
] ],
'x-component-props': {
placeholder: '请填写数字,可以保留2位小数'
}
}, },
result: { result: {
title: '考评结果', title: '考评结果',
...@@ -103,8 +122,15 @@ export const evaluateScoreRes: ISchema = { ...@@ -103,8 +122,15 @@ export const evaluateScoreRes: ISchema = {
{ {
required: true, required: true,
message: "请填写考评结果", message: "请填写考评结果",
},
{
limitByte: true, // 自定义校验规则
maxByte: 120
} }
] ],
'x-component-props': {
placeholder: '最长120个字符,60个汉字'
}
}, },
notifyMember: { notifyMember: {
title: "{{ text('通知考评结果',help('通知会员查收考评结果')) }}", title: "{{ text('通知考评结果',help('通知会员查收考评结果')) }}",
......
...@@ -38,11 +38,11 @@ export const InspectionAddSchema: ISchema = { ...@@ -38,11 +38,11 @@ export const InspectionAddSchema: ISchema = {
}, },
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 40
} }
], ],
'x-component-props': { 'x-component-props': {
placeholder: '最长60个字符,30个汉字' placeholder: '最长40个字符,20个汉字'
} }
}, },
name: { name: {
...@@ -111,6 +111,9 @@ export const InspectionAddSchema: ISchema = { ...@@ -111,6 +111,9 @@ export const InspectionAddSchema: ISchema = {
reason: { reason: {
title: '考察原因', title: '考察原因',
type: 'textarea', type: 'textarea',
'x-component-props': {
placeholder: '最长120个字符,60个汉字'
}
}, },
attachments: { attachments: {
title: '考察要求附件', title: '考察要求附件',
...@@ -158,8 +161,15 @@ export const InspectionAddSchema: ISchema = { ...@@ -158,8 +161,15 @@ export const InspectionAddSchema: ISchema = {
{ {
required: true, required: true,
message: '请输入考察结果' message: '请输入考察结果'
},
{
limitByte: true, // 自定义校验规则
maxByte: 60
} }
], ],
'x-component-props': {
placeholder: '最长60个字符,30个汉字'
}
}, },
reports: { reports: {
title: "考察报告", title: "考察报告",
......
import React from 'react'; import React from 'react';
import { useMemo } from "react"; import { useMemo } from "react";
import FileListRender from '@/components/UploadFiles/FileListRender';
function useGetDetailCommon({ initialValue }) { function useGetDetailCommon({ initialValue }) {
const basicInfo = useMemo(() => { const basicInfo = useMemo(() => {
...@@ -27,17 +27,18 @@ function useGetDetailCommon({ initialValue }) { ...@@ -27,17 +27,18 @@ function useGetDetailCommon({ initialValue }) {
value: isUpperMember ? initialValue?.upperName : initialValue?.name value: isUpperMember ? initialValue?.upperName : initialValue?.name
}, },
{ {
title: "附件", title: "事件附件",
value: ( value: (
<div> // <div>
{ // {
initialValue?.attachments?.map((_row) => { // initialValue?.attachments?.map((_row) => {
return ( // return (
<a key={_row.url} href={_row.href}>{_row.name}</a> // <a key={_row.url} href={_row.href}>{_row.name}</a>
) // )
}) // })
} // }
</div> // </div>
<FileListRender files={initialValue?.attachments} />
) )
}, },
{ {
...@@ -72,17 +73,19 @@ function useGetDetailCommon({ initialValue }) { ...@@ -72,17 +73,19 @@ function useGetDetailCommon({ initialValue }) {
value: initialValue?.handleUserName value: initialValue?.handleUserName
}, },
{ {
title: "附件", title: "处理附件",
value: ( value: (
<div> // <div>
{ // {
initialValue?.handleAttachments.map((_row) => { // initialValue?.handleAttachments.map((_row) => {
return ( // return (
<a key={_row.url} href={_row.href}>{_row.name}</a> // <a key={_row.url} href={_row.href}>{_row.name}</a>
) // )
}) // })
} // }
</div> // </div>
<FileListRender files={initialValue?.handleAttachments} />
) )
}, },
{ {
......
...@@ -68,11 +68,11 @@ export const complaintAddSchema: ISchema = { ...@@ -68,11 +68,11 @@ export const complaintAddSchema: ISchema = {
}, },
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 40
} }
], ],
'x-component-props': { 'x-component-props': {
placeholder: '最长60个字符,30个汉字' placeholder: '最长40个字符,20个汉字'
} }
}, },
memberName: { memberName: {
...@@ -146,18 +146,22 @@ export const complaintAddSchema: ISchema = { ...@@ -146,18 +146,22 @@ export const complaintAddSchema: ISchema = {
"x-component-props": { "x-component-props": {
style: { style: {
width: '100%' width: '100%'
} },
placeholder: '最长120个字符,60个汉字'
}, },
'x-rules': [ 'x-rules': [
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 120
} }
] ],
}, },
eventDesc: { eventDesc: {
title: '事件描述', title: '事件描述',
type: 'textarea', type: 'textarea',
"x-component-props": {
placeholder: '最长120个字符,60个汉字'
},
'x-rules': [ 'x-rules': [
{ {
required: true, required: true,
...@@ -165,7 +169,7 @@ export const complaintAddSchema: ISchema = { ...@@ -165,7 +169,7 @@ export const complaintAddSchema: ISchema = {
}, },
{ {
limitByte: true, // 自定义校验规则 limitByte: true, // 自定义校验规则
maxByte: 60 maxByte: 120
} }
] ]
}, },
......
import { GetMemberRectifyWaitAddGetResponse } from '@/services/MemberV2Api'; import { GetMemberRectifyWaitAddGetResponse } from '@/services/MemberV2Api';
import React from 'react'; import React from 'react';
import { useMemo } from "react"; import { useMemo } from "react";
import FileListRender from '@/components/UploadFiles/FileListRender';
type Info = { type Info = {
reportDigest?: string, reportDigest?: string,
...@@ -42,15 +43,7 @@ function useGetDetailCommon({ initialValue }: { initialValue: GetMemberRectifyWa ...@@ -42,15 +43,7 @@ function useGetDetailCommon({ initialValue }: { initialValue: GetMemberRectifyWa
{ {
title: "整改文件", title: "整改文件",
value: ( value: (
<div style={{display: 'flex', flexDirection: 'column'}}> <FileListRender files={initialValue?.attachments} />
{
initialValue?.attachments?.map((_item) => {
return (
<a key={_item.url} href={_item.url}>{_item.name}</a>
)
})
}
</div>
) )
}, },
{ {
...@@ -79,15 +72,7 @@ function useGetDetailCommon({ initialValue }: { initialValue: GetMemberRectifyWa ...@@ -79,15 +72,7 @@ function useGetDetailCommon({ initialValue }: { initialValue: GetMemberRectifyWa
{ {
title: '整改报告文件', title: '整改报告文件',
value: ( value: (
<div style={{display: 'flex', flexDirection: 'column'}}> <FileListRender files={initialValue?.reportAttachments} />
{
initialValue?.reportAttachments?.map((_item) => {
return (
<a key={_item.url} href={_item.url}>{_item.name}</a>
)
})
}
</div>
) )
} }
] ]
...@@ -96,7 +81,7 @@ function useGetDetailCommon({ initialValue }: { initialValue: GetMemberRectifyWa ...@@ -96,7 +81,7 @@ function useGetDetailCommon({ initialValue }: { initialValue: GetMemberRectifyWa
const resultInfo = useMemo(() => { const resultInfo = useMemo(() => {
return [ return [
{ {
title: '改结果', title: '改结果',
value: initialValue?.agreeResult ? '整改通过' : '整改不通过' value: initialValue?.agreeResult ? '整改通过' : '整改不通过'
}, },
{ {
......
...@@ -82,7 +82,8 @@ export const rectificationAddSchema: ISchema = { ...@@ -82,7 +82,8 @@ export const rectificationAddSchema: ISchema = {
"x-component-props": { "x-component-props": {
style: { style: {
width: '100%' width: '100%'
} },
placeholder: '最长120个字符,60个汉字'
}, },
'x-rules': [ 'x-rules': [
{ {
...@@ -101,7 +102,9 @@ export const rectificationAddSchema: ISchema = { ...@@ -101,7 +102,9 @@ export const rectificationAddSchema: ISchema = {
"x-component-props": { "x-component-props": {
style: { style: {
width: '100%' width: '100%'
} },
placeholder: '最长120个字符,60个汉字'
}, },
'x-rules': [ 'x-rules': [
{ {
......
...@@ -25,11 +25,46 @@ const confirmEditResultSchema: ISchema = { ...@@ -25,11 +25,46 @@ const confirmEditResultSchema: ISchema = {
required: true, required: true,
message: '请填写整改结果' message: '请填写整改结果'
} }
],
'x-linkages': [
{
type: 'value:schema',
// 考评人打分没勾选, 这几项都为必填
target: 'reason',
condition: `{{ $value === 0 }}`,
schema: {
"x-rules": [
{
required: true,
}
]
},
otherwise: {
"x-rules": [
{
required: false,
}
]
}
}
] ]
}, },
reason: { reason: {
title: '结果原因', title: '结果原因',
type: 'textarea', type: 'textarea',
"x-rules": [
{
required: true,
message: '请填写结果原因'
},
{
limitByte: true, // 自定义校验规则
maxByte: 120
}
],
'x-component-props': {
placeholder: '最长120个字符,60个汉字'
}
} }
} }
} }
......
.card { .card {
:global { height: 100%;
.ant-card-head {
.ant-card-head-title {
font-size: 16px;
font-weight: 600;
line-height: 16px;
color: #252d37;
}
}
display: flex;
flex-direction: column;
background-color: #fff;
border-radius: 8px;
.header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 16px;
font-size: 14px;
line-height: 16px;
color: #252D37;
font-weight: 600;
}
.body {
padding: 16px;
} }
} }
...@@ -5,19 +5,21 @@ import styles from './index.less'; ...@@ -5,19 +5,21 @@ import styles from './index.less';
type PropsNew = React.ComponentProps<typeof Card> type PropsNew = React.ComponentProps<typeof Card>
const CustomizeCard: React.FC<PropsNew> = (props: PropsNew) => { const CustomizeCard: React.FC<PropsNew> = (props: PropsNew) => {
const { title, loading, extra, children, ...rest } = props; const { title, loading, extra, children, bodyStyle, ...rest } = props;
if (loading) {
return <Card loading={loading}></Card>
}
return ( return (
<div className={styles.card}> <div className={styles.card}>
<Card <div className={styles.header}>
bordered={false} <div className={styles.title}>{title}</div>
title={title} <div className={styles.extra}>{extra}</div>
loading={loading} </div>
extra={extra} <div className={styles.body} style={bodyStyle}>
{...rest}
>
{children} {children}
</Card> </div>
</div> </div>
) )
} }
......
...@@ -3,23 +3,54 @@ import { Row, Col } from 'antd'; ...@@ -3,23 +3,54 @@ import { Row, Col } from 'antd';
import OverViewCard from './OverViewCard'; import OverViewCard from './OverViewCard';
const OverView = () => { const OverView = () => {
const list = [
{
title: '今日预警',
type: 'warn',
first: 3,
second: 4,
third: 5,
total: 12
},
{
title: '今日待处理',
type: 'primary',
first: 3,
second: 4,
third: 5,
total: 12
},
{
title: '今日已处理',
type: 'success',
first: 3,
second: 4,
third: 5,
total: 12
},
{
title: '历史总预警',
type: 'default',
first: 3,
second: 4,
third: 5,
total: 12
}
];
return ( return (
// <Row gutter={[16, 16]} justify="space-between">
<> <>
<Col span={6}> {
<OverViewCard type="warn" title={"今日预警"} total={12} first={4} second={3} third={5}/> list.map((_item) => {
</Col> return (
<Col span={6}> <Col lg={6} xxl={6} md={12} sm={24} key={_item.type}>
<OverViewCard type="primary" title={"今日预警"} total={12} first={4} second={3} third={5}/> <OverViewCard {..._item} type={_item.type as "primary"}/>
</Col> </Col>
<Col span={6}> )
<OverViewCard type="success" title={"今日预警"} total={12} first={4} second={3} third={5}/> })
</Col> }
<Col span={6}>
<OverViewCard type="default" title={"今日预警"} total={12} first={4} second={3} third={5}/>
</Col>
</> </>
// </Row>
) )
} }
......
...@@ -2,6 +2,7 @@ import React from 'react'; ...@@ -2,6 +2,7 @@ import React from 'react';
import { Card } from 'antd'; import { Card } from 'antd';
import styles from './index.less'; import styles from './index.less';
import cx from 'classnames'; import cx from 'classnames';
import CustomizeCard from '../CustomizeCard';
interface Iprops { interface Iprops {
icon?: any, icon?: any,
...@@ -18,7 +19,7 @@ interface Iprops { ...@@ -18,7 +19,7 @@ interface Iprops {
const OverViewCard: React.FC<Iprops> = (props: Iprops) => { const OverViewCard: React.FC<Iprops> = (props: Iprops) => {
const { loading, title, total, first, second, third, type } = props; const { loading, title, total, first, second, third, type } = props;
return ( return (
<Card title={title} loading={loading}> <CustomizeCard title={title} loading={loading} bodyStyle={{paddingTop: '8px'}}>
<div className={styles.section}> <div className={styles.section}>
<div className={cx(styles.icon, styles[type])}></div> <div className={cx(styles.icon, styles[type])}></div>
<span className={styles.total}>{total}</span> <span className={styles.total}>{total}</span>
...@@ -28,7 +29,7 @@ const OverViewCard: React.FC<Iprops> = (props: Iprops) => { ...@@ -28,7 +29,7 @@ const OverViewCard: React.FC<Iprops> = (props: Iprops) => {
<div className={cx(styles.second, styles.progressItem)} style={{flex: second}}>{second}</div> <div className={cx(styles.second, styles.progressItem)} style={{flex: second}}>{second}</div>
<div className={cx(styles.third, styles.progressItem)} style={{flex: third}}>{third}</div> <div className={cx(styles.third, styles.progressItem)} style={{flex: third}}>{third}</div>
</div> </div>
</Card> </CustomizeCard>
) )
} }
......
import React from 'react'; import React from 'react';
import RecordItem from './recordItem'; import RecordItem from './recordItem';
const RecordList = () => { interface Iprops {
height: number,
}
const RecordList = (props: Iprops) => {
const { height } = props;
return ( return (
<div> <div style={{height: `${height}px`, overflowY: 'scroll', margin: '8px 0 16px 16px'}}>
{ {
[1,2,3,4,5,6,7,8,9,10,11].map((_item) => { [1,2,3,4,5,6,7,8,9,10,11].map((_item) => {
return ( return (
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
.title { .title {
font-size: 16px; font-size: 16px;
color: #252D37; color: #252D37;
line-height: 14px;
line-height: 16px; line-height: 16px;
} }
} }
...@@ -45,11 +46,15 @@ ...@@ -45,11 +46,15 @@
} }
.section { .section {
padding: @padding-md; padding: @padding-md @padding-md 0 0;
// margin: 0 -8px; // margin: 0 -8px;
margin-right: -16px; margin-right: -16px;
flex: 1; flex: 1;
.radioContainer {
padding-left: @padding-md;
}
.recordList { .recordList {
margin-top: 8px; margin-top: 8px;
height: 384px; height: 384px;
......
...@@ -72,10 +72,10 @@ const WarningArea = () => { ...@@ -72,10 +72,10 @@ const WarningArea = () => {
</div> </div>
</div> </div>
<div className={styles.section}> <div className={styles.section}>
<CustomizeRadio options={warningOptions} /> <div className={styles.radioContainer}>
<div className={styles.recordList}> <CustomizeRadio options={warningOptions} />
<RecordList />
</div> </div>
<RecordList height={384} />
</div> </div>
</div> </div>
</Card> </Card>
......
...@@ -114,7 +114,7 @@ const MapChart: React.FC<Iprops> = (props: Iprops) => { ...@@ -114,7 +114,7 @@ const MapChart: React.FC<Iprops> = (props: Iprops) => {
data={bgView ? bgView.rows : bgView} data={bgView ? bgView.rows : bgView}
autoFit autoFit
placeholder={<div>Loading</div>} placeholder={<div>Loading</div>}
padding={[0, 0]} padding={[20, 0, 0, 0]}
onAfterRender={(e, c) => { onAfterRender={(e, c) => {
keepMapRatio(mapData, c, "rerender") keepMapRatio(mapData, c, "rerender")
}} }}
...@@ -124,7 +124,12 @@ const MapChart: React.FC<Iprops> = (props: Iprops) => { ...@@ -124,7 +124,12 @@ const MapChart: React.FC<Iprops> = (props: Iprops) => {
<Geom <Geom
type="polygon" type="polygon"
position="x*y" position="x*y"
style={{
fill: '#EDEEEF',
stroke: '#fff',
lineWidth: 1,
fillOpacity: 0.85,
}}
color={['centroidY', '#777090-#493398']} color={['centroidY', '#777090-#493398']}
tooltip={[ tooltip={[
'name*properties', 'name*properties',
......
...@@ -22,17 +22,15 @@ const Dashboard = () => { ...@@ -22,17 +22,15 @@ const Dashboard = () => {
> >
<Row gutter={[16,16]}> <Row gutter={[16,16]}>
<OverView /> <OverView />
<Col span={6}> <Col xxl={6} lg={6} md={6} sm={24}>
<CustomizeCard title="今日预警记录" bodyStyle={{padding: '0'}} > <CustomizeCard title="今日预警记录" bodyStyle={{padding: '0', height: '408px'}} >
<div style={{height: '384px', overflowY: 'scroll', margin: '8px 0 16px 16px'}}> <RecordList height={384} />
<RecordList />
</div>
</CustomizeCard> </CustomizeCard>
</Col> </Col>
<Col span={12}> <Col xxl={12} lg={18} md={18} sm={24}>
<WarningArea /> <WarningArea />
</Col> </Col>
<Col span={6}> <Col xxl={6} lg={6} md={6} sm={24}>
<CustomizeCard title="预警项目" headStyle={{color: 'red'}} bodyStyle={{height: '408px'}}> <CustomizeCard title="预警项目" headStyle={{color: 'red'}} bodyStyle={{height: '408px'}}>
<Row gutter={[16, 16]}> <Row gutter={[16, 16]}>
<Col span={12}> <Col span={12}>
...@@ -86,4 +84,5 @@ const Dashboard = () => { ...@@ -86,4 +84,5 @@ const Dashboard = () => {
) )
} }
export default Dashboard; export default Dashboard;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment