|
|
@@ -6,6 +6,24 @@ import consts from '@/consts'
|
|
|
import { queryLock } from '@/services/lock'
|
|
|
import Locks from '@/components/PopContent/Locks'
|
|
|
|
|
|
+// 渲染产品标签
|
|
|
+export const ProductLabel = ({ data }) => {
|
|
|
+ if (!data) return <></>
|
|
|
+ let newData = data
|
|
|
+ if (!Array.isArray(data)) {
|
|
|
+ newData = data.split('+')
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ {newData.map((item, index) => (
|
|
|
+ <Tag key={index} color="#886ab5">
|
|
|
+ {item}
|
|
|
+ </Tag>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+}
|
|
|
+
|
|
|
const Lockstore = props => {
|
|
|
const { collapsed } = props
|
|
|
const needSubtractHeight = 48 + 48 + 48 + 64 + 24 + 32 // 需要被裁掉的高度
|
|
|
@@ -62,17 +80,9 @@ const Lockstore = props => {
|
|
|
dataIndex: 'product',
|
|
|
key: 'product',
|
|
|
width: 350,
|
|
|
- render: (text, record) => {
|
|
|
- const productArr = text.split('+')
|
|
|
- return (
|
|
|
- <div>
|
|
|
- {productArr.map((item, index) => (
|
|
|
- <Tag key={index} color="#886ab5">
|
|
|
- {item}
|
|
|
- </Tag>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
- )
|
|
|
+ render: text => {
|
|
|
+ // const productArr = text.split('+')
|
|
|
+ return <ProductLabel data={text} />
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -133,20 +143,4 @@ const Lockstore = props => {
|
|
|
)
|
|
|
}
|
|
|
|
|
|
-// 渲染产品标签
|
|
|
-export const RenderProductLabel = product => {
|
|
|
- let newProduct = product
|
|
|
- if (!Array.isArray(product)) {
|
|
|
- newProduct = product.split('+')
|
|
|
- }
|
|
|
- return (
|
|
|
- <div>
|
|
|
- {newProduct.map((item, index) => (
|
|
|
- <Tag key={index} color="#886ab5">
|
|
|
- {item}
|
|
|
- </Tag>
|
|
|
- ))}
|
|
|
- </div>
|
|
|
- )
|
|
|
-}
|
|
|
export default Lockstore
|