|
@@ -17,6 +17,7 @@ import styles from './index.less'
|
|
|
import { isDevMode } from '@/utils/env'
|
|
import { isDevMode } from '@/utils/env'
|
|
|
import { isMobile } from '@/utils/is'
|
|
import { isMobile } from '@/utils/is'
|
|
|
import { useModal } from '@/components/ModalStore'
|
|
import { useModal } from '@/components/ModalStore'
|
|
|
|
|
+import classNames from 'classnames'
|
|
|
|
|
|
|
|
const Dashboard = ({ dispatch, departments = [] }) => {
|
|
const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
const { initialState: { currentUser } = { currentUser: {} } } = useModel('@@initialState')
|
|
const { initialState: { currentUser } = { currentUser: {} } } = useModel('@@initialState')
|
|
@@ -76,7 +77,6 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
pageSize: 100
|
|
pageSize: 100
|
|
|
})
|
|
})
|
|
|
if (code === consts.RET_CODE.SUCCESS && canSetState) {
|
|
if (code === consts.RET_CODE.SUCCESS && canSetState) {
|
|
|
- // list存起来
|
|
|
|
|
setState({
|
|
setState({
|
|
|
...state,
|
|
...state,
|
|
|
staffList: list
|
|
staffList: list
|
|
@@ -357,8 +357,8 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
</Row> */}
|
|
</Row> */}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div className="mt-4 flex flex-row ">
|
|
|
|
|
- <span className="mx-4 my-4">
|
|
|
|
|
|
|
+ <div className="flex flex-wrap">
|
|
|
|
|
+ <div className="mr-4 my-4 flex">
|
|
|
<Select
|
|
<Select
|
|
|
disabled={state.disabled}
|
|
disabled={state.disabled}
|
|
|
loading={state.loading}
|
|
loading={state.loading}
|
|
@@ -367,14 +367,14 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
defaultValue={defaultCyclicalValue}
|
|
defaultValue={defaultCyclicalValue}
|
|
|
onChange={handleCyclicalChange}
|
|
onChange={handleCyclicalChange}
|
|
|
/>
|
|
/>
|
|
|
- <span className="mx-4">
|
|
|
|
|
|
|
+ <div className="mx-2">
|
|
|
<PermSelect
|
|
<PermSelect
|
|
|
loading={state.loading}
|
|
loading={state.loading}
|
|
|
disabled={state.disabled}
|
|
disabled={state.disabled}
|
|
|
onConfirm={handlePermChange}
|
|
onConfirm={handlePermChange}
|
|
|
dataType="workbench"
|
|
dataType="workbench"
|
|
|
/>
|
|
/>
|
|
|
- </span>
|
|
|
|
|
|
|
+ </div>
|
|
|
{state.params.dataPermission === 'all' ? (
|
|
{state.params.dataPermission === 'all' ? (
|
|
|
<TreeSelect
|
|
<TreeSelect
|
|
|
size="middle"
|
|
size="middle"
|
|
@@ -398,106 +398,99 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
}}
|
|
}}
|
|
|
/>
|
|
/>
|
|
|
) : null}
|
|
) : null}
|
|
|
- </span>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
<div className="flex items-center flex-row ml-2">
|
|
<div className="flex items-center flex-row ml-2">
|
|
|
{['all', 'department'].includes(state.params.dataPermission) &&
|
|
{['all', 'department'].includes(state.params.dataPermission) &&
|
|
|
state.staffList.map(item => (
|
|
state.staffList.map(item => (
|
|
|
- <div key={item.id} onClick={() => handleStaffClick(item.id)}>
|
|
|
|
|
- <div
|
|
|
|
|
- className={[
|
|
|
|
|
- 'relative',
|
|
|
|
|
- 'cursor-pointer',
|
|
|
|
|
- state.selectId === item.id ? styles.imgBg : styles.paddingBg
|
|
|
|
|
- ].join(' ')}
|
|
|
|
|
- >
|
|
|
|
|
- <img
|
|
|
|
|
- className="w-full max-w-30px h-30px border rounded-30px"
|
|
|
|
|
- src={
|
|
|
|
|
- (isDevMode() ? 'http://cld2qa.com' : 'http://zhcld.com') +
|
|
|
|
|
- (item?.avatar ?? consts.DEFAULT_AVATAR)
|
|
|
|
|
- }
|
|
|
|
|
- />
|
|
|
|
|
- <span className={['absolute', styles.avtraName].join(' ')}>
|
|
|
|
|
- <span className={styles.bb}>{item.username}</span>
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ className={classNames('relative cursor-pointer', styles.staffItem, {
|
|
|
|
|
+ [styles.active]: state.selectId === item.id
|
|
|
|
|
+ })}
|
|
|
|
|
+ key={item.id}
|
|
|
|
|
+ onClick={() => handleStaffClick(item.id)}
|
|
|
|
|
+ >
|
|
|
|
|
+ <img
|
|
|
|
|
+ className="w-full max-w-30px h-30px border rounded-30px"
|
|
|
|
|
+ src={
|
|
|
|
|
+ (isDevMode() ? 'http://cld2qa.com' : 'http://zhcld.com') +
|
|
|
|
|
+ (item?.avatar ?? consts.DEFAULT_AVATAR)
|
|
|
|
|
+ }
|
|
|
|
|
+ />
|
|
|
|
|
+ <span className={styles.extra}>{item.username}</span>
|
|
|
</div>
|
|
</div>
|
|
|
))}
|
|
))}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div className="mt-4">
|
|
|
|
|
- <Row gutter={[8, 8]}>
|
|
|
|
|
- <Col xs={24} sm={24} md={24} lg={8} xl={8}>
|
|
|
|
|
- <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
|
|
|
|
|
- {state.loading ? (
|
|
|
|
|
- <Skeleton active avatar />
|
|
|
|
|
- ) : (
|
|
|
|
|
- <Row className="cursor-pointer" onClick={() => handleRatioCard(cardTypeMap.CLIENT)}>
|
|
|
|
|
- <Col span={6}>
|
|
|
|
|
- <div className="w-full max-w-48px h-48px border rounded-48px bg-[#0c7cd5] flex items-center justify-center">
|
|
|
|
|
- <AddressBook size="26" fill="#fff" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- <Col span={18} flex="wrap">
|
|
|
|
|
- <div className="flex items-center justify-between ">
|
|
|
|
|
- <div className="text-2xl">{state.clientChainRatio.count}</div>
|
|
|
|
|
- <span
|
|
|
|
|
- className={[
|
|
|
|
|
- 'text-xl',
|
|
|
|
|
- state.clientChainRatio.percentage.startsWith('-')
|
|
|
|
|
- ? 'text-green-500'
|
|
|
|
|
- : 'text-red-500'
|
|
|
|
|
- ].join(' ')}
|
|
|
|
|
- >
|
|
|
|
|
- {state.clientChainRatio.percentage}
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className="flex justify-between items-center">
|
|
|
|
|
- <div>新增客户</div>
|
|
|
|
|
- <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- </Row>
|
|
|
|
|
- )}
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- <Col xs={24} sm={24} md={24} lg={8} xl={8}>
|
|
|
|
|
- <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
|
|
|
|
|
- {state.loading ? (
|
|
|
|
|
- <Skeleton active avatar />
|
|
|
|
|
- ) : (
|
|
|
|
|
- <Row className="cursor-pointer" onClick={() => handleRatioCard(cardTypeMap.COMPANY)}>
|
|
|
|
|
- <Col span={6}>
|
|
|
|
|
- <div className="w-full max-w-48px h-48px border rounded-48px bg-[#0c7cd5] flex items-center justify-center">
|
|
|
|
|
- <City size="26" fill="#fff" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- <Col span={18} flex="wrap">
|
|
|
|
|
- <div className="flex items-center justify-between ">
|
|
|
|
|
- <div className="text-2xl">{state.customerChainRatio.count}</div>
|
|
|
|
|
- <span
|
|
|
|
|
- className={[
|
|
|
|
|
- 'text-xl',
|
|
|
|
|
- state.customerChainRatio.percentage.startsWith('-')
|
|
|
|
|
- ? 'text-green-500'
|
|
|
|
|
- : 'text-red-500'
|
|
|
|
|
- ].join(' ')}
|
|
|
|
|
- >
|
|
|
|
|
- {state.customerChainRatio.percentage}
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <Row gutter={[8, 8]}>
|
|
|
|
|
+ <Col xs={24} sm={24} md={24} lg={8} xl={8}>
|
|
|
|
|
+ <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
|
|
|
|
|
+ {state.loading ? (
|
|
|
|
|
+ <Skeleton active avatar />
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <Row className="cursor-pointer" onClick={() => handleRatioCard(cardTypeMap.CLIENT)}>
|
|
|
|
|
+ <Col span={6}>
|
|
|
|
|
+ <div className="w-full max-w-48px h-48px border rounded-48px bg-[#0c7cd5] flex items-center justify-center">
|
|
|
|
|
+ <AddressBook size="26" fill="#fff" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col span={18} flex="wrap">
|
|
|
|
|
+ <div className="flex items-center justify-between ">
|
|
|
|
|
+ <div className="text-2xl">{state.clientChainRatio.count}</div>
|
|
|
|
|
+ <span
|
|
|
|
|
+ className={[
|
|
|
|
|
+ 'text-xl',
|
|
|
|
|
+ state.clientChainRatio.percentage.startsWith('-') ? 'text-green-500' : 'text-red-500'
|
|
|
|
|
+ ].join(' ')}
|
|
|
|
|
+ >
|
|
|
|
|
+ {state.clientChainRatio.percentage}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className="flex justify-between items-center">
|
|
|
|
|
+ <div>新增客户</div>
|
|
|
|
|
+ <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col xs={24} sm={24} md={24} lg={8} xl={8}>
|
|
|
|
|
+ <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
|
|
|
|
|
+ {state.loading ? (
|
|
|
|
|
+ <Skeleton active avatar />
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <Row className="cursor-pointer" onClick={() => handleRatioCard(cardTypeMap.COMPANY)}>
|
|
|
|
|
+ <Col span={6}>
|
|
|
|
|
+ <div className="w-full max-w-48px h-48px border rounded-48px bg-[#0c7cd5] flex items-center justify-center">
|
|
|
|
|
+ <City size="26" fill="#fff" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col span={18} flex="wrap">
|
|
|
|
|
+ <div className="flex items-center justify-between ">
|
|
|
|
|
+ <div className="text-2xl">{state.customerChainRatio.count}</div>
|
|
|
|
|
+ <span
|
|
|
|
|
+ className={[
|
|
|
|
|
+ 'text-xl',
|
|
|
|
|
+ state.customerChainRatio.percentage.startsWith('-')
|
|
|
|
|
+ ? 'text-green-500'
|
|
|
|
|
+ : 'text-red-500'
|
|
|
|
|
+ ].join(' ')}
|
|
|
|
|
+ >
|
|
|
|
|
+ {state.customerChainRatio.percentage}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div className="flex justify-between items-center">
|
|
|
|
|
- <div>新增单位</div>
|
|
|
|
|
- <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- </Row>
|
|
|
|
|
- )}
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- {/* <Col xs={24} sm={24} md={24} lg={6} xl={6}>
|
|
|
|
|
|
|
+ <div className="flex justify-between items-center">
|
|
|
|
|
+ <div>新增单位</div>
|
|
|
|
|
+ <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ {/* <Col xs={24} sm={24} md={24} lg={6} xl={6}>
|
|
|
<div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
|
|
<div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
|
|
|
{state.loading ? (
|
|
{state.loading ? (
|
|
|
<Skeleton active avatar />
|
|
<Skeleton active avatar />
|
|
@@ -535,43 +528,42 @@ const Dashboard = ({ dispatch, departments = [] }) => {
|
|
|
)}
|
|
)}
|
|
|
</div>
|
|
</div>
|
|
|
</Col> */}
|
|
</Col> */}
|
|
|
- <Col xs={24} sm={24} md={24} lg={8} xl={8}>
|
|
|
|
|
- <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
|
|
|
|
|
- {state.loading ? (
|
|
|
|
|
- <Skeleton active avatar />
|
|
|
|
|
- ) : (
|
|
|
|
|
- <Row onClick={() => handleRatioCard(cardTypeMap.SERVICE)} className="cursor-pointer">
|
|
|
|
|
- <Col span={6}>
|
|
|
|
|
- <div className="w-full max-w-48px h-48px border rounded-48px bg-[#0c7cd5] flex items-center justify-center">
|
|
|
|
|
- <Comment size="26" fill="#fff" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- <Col span={18} flex="wrap">
|
|
|
|
|
- <div className="flex items-center justify-between ">
|
|
|
|
|
- <div className="text-2xl">{state.serviceLogChainRatio.count}</div>
|
|
|
|
|
- <span
|
|
|
|
|
- className={[
|
|
|
|
|
- 'text-xl',
|
|
|
|
|
- state.serviceLogChainRatio.percentage.startsWith('-')
|
|
|
|
|
- ? 'text-green-500'
|
|
|
|
|
- : 'text-red-500'
|
|
|
|
|
- ].join(' ')}
|
|
|
|
|
- >
|
|
|
|
|
- {state.serviceLogChainRatio.percentage}
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <Col xs={24} sm={24} md={24} lg={8} xl={8}>
|
|
|
|
|
+ <div className="p-4 bg-white border rounded-2px border-hex-f0f0f0 shadow-card">
|
|
|
|
|
+ {state.loading ? (
|
|
|
|
|
+ <Skeleton active avatar />
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <Row onClick={() => handleRatioCard(cardTypeMap.SERVICE)} className="cursor-pointer">
|
|
|
|
|
+ <Col span={6}>
|
|
|
|
|
+ <div className="w-full max-w-48px h-48px border rounded-48px bg-[#0c7cd5] flex items-center justify-center">
|
|
|
|
|
+ <Comment size="26" fill="#fff" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ <Col span={18} flex="wrap">
|
|
|
|
|
+ <div className="flex items-center justify-between ">
|
|
|
|
|
+ <div className="text-2xl">{state.serviceLogChainRatio.count}</div>
|
|
|
|
|
+ <span
|
|
|
|
|
+ className={[
|
|
|
|
|
+ 'text-xl',
|
|
|
|
|
+ state.serviceLogChainRatio.percentage.startsWith('-')
|
|
|
|
|
+ ? 'text-green-500'
|
|
|
|
|
+ : 'text-red-500'
|
|
|
|
|
+ ].join(' ')}
|
|
|
|
|
+ >
|
|
|
|
|
+ {state.serviceLogChainRatio.percentage}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div className="flex justify-between items-center">
|
|
|
|
|
- <div>服务记录</div>
|
|
|
|
|
- <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- </Row>
|
|
|
|
|
- )}
|
|
|
|
|
- </div>
|
|
|
|
|
- </Col>
|
|
|
|
|
- </Row>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div className="flex justify-between items-center">
|
|
|
|
|
+ <div>服务记录</div>
|
|
|
|
|
+ <span>{cyclicalOp.find(item => item.value === state.params.cyclical)?.title}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Col>
|
|
|
|
|
+ </Row>
|
|
|
<div className="mt-4">
|
|
<div className="mt-4">
|
|
|
<Row gutter={[8, 8]}>
|
|
<Row gutter={[8, 8]}>
|
|
|
{/* <Col xs={24} sm={24} md={24} lg={12} xl={12}>
|
|
{/* <Col xs={24} sm={24} md={24} lg={12} xl={12}>
|