Commit dc6ceea2 authored by 田翔's avatar 田翔

fix: 封装代码

parent a1ea1f83
import React from 'react'
import styles from './index.less'
const CoordView = (props) => {
const { value } = props
return (
<div className={styles.coordView}>{value}</div>
)
}
export default CoordView
\ No newline at end of file
import React from 'react'
import styles from './index.less'
const FileView = (props) => {
const { value, fileType } = props
if (fileType === '图片') {
let fileList = value ? value.split(',') : null
if (!fileList) return null
return (
<div className={styles.fileView}>
{
fileList.map(v => {
return (
<img style={{ width: '65px' }} src={`${'http://192.168.10.167:8088'}/PandaWorkFlow/WorkFlow/AccountManage/DownloadFiles?filePath=${v}`}></img>
)
})
}
</div>
)
}
return (
<div className={styles.fileView}>{value}</div>
)
}
export default FileView
\ No newline at end of file
.fileView {
display: flex;
}
\ No newline at end of file
import React, { useMemo } from 'react'
import { Table, Tooltip } from 'antd'
import FileView from './components/FileView'
import CoordView from './components/CoordView'
const TablePack = (props) => {
const { value, widget } = props
// console.log('props', props)
if (widget === 'FileUpload') {
return <FileView {...props} />
}
if (widget) {
console.log('widget', widget)
if (['Coordinate', 'Device', 'SearchLocation'].includes(widget)) {
return <CoordView {...props} />
}
return (
......
......@@ -63,12 +63,14 @@ const TableRender = (props) => {
dataIndex: 'r',
key: 'r',
width: 50,
align: 'center',
fixed: 'left',
},
...fileColumns,
{
title: '操作',
width: 120,
align: 'center',
fixed: 'right',
render: (r) => {
let btns = [
......@@ -86,7 +88,7 @@ const TableRender = (props) => {
}
]
return (
<div>
<div style={{ display: 'flex', justifyContent: 'center' }}>
{
btns.map(v => {
return (
......
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