From 812971f6b2cb65b8ef7c749c09d867014b9f7a87 Mon Sep 17 00:00:00 2001 From: czm <2192718639@qq.com> Date: Tue, 8 Nov 2022 13:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf(=E4=BC=98=E5=8C=96=E6=89=80?= =?UTF-8?q?=E6=9C=89=E8=BE=93=E5=85=A5=E6=A1=86):?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FromList/index.tsx | 100 ++++--- .../FromListCertification/index.tsx | 101 +++---- src/components/counter/index.tsx | 205 +++++++------ src/components/counter/index1.tsx | 198 +++++++------ src/components/filter/index.tsx | 242 +++++++++------- src/components/filterV2/index.tsx | 274 ++++++++++-------- src/components/search/index.tsx | 148 ++++++---- src/components/searchInput/index.tsx | 100 ++++--- src/pages/bindSalesman/index.tsx | 89 +++--- .../classList/components/filter/index.tsx | 251 +++++++++------- .../components/createPopup/index.tsx | 1 - .../details/components/counter/index.tsx | 203 +++++++------ .../subjectList/components/filter/index.tsx | 251 +++++++++------- src/pages/weightListAdd/index.tsx | 187 +++++++----- 14 files changed, 1288 insertions(+), 1062 deletions(-) diff --git a/src/components/FromList/index.tsx b/src/components/FromList/index.tsx index c29daf5..156391f 100644 --- a/src/components/FromList/index.tsx +++ b/src/components/FromList/index.tsx @@ -1,61 +1,67 @@ +import { Input, Text, Textarea, View } from '@tarojs/components' +import { memo } from 'react' +import './index.scss' -import { Input, Text, Textarea, View } from "@tarojs/components" -import { memo } from "react" -import "./index.scss" - -interface ListParams{ - label: string, //左边label - onInput?: (ev:Object)=>void, // 输入框输入 - onClick?:()=>any, //点击列表 - placeholder?:string, // 提示文本 - children?: any, // 插槽 - type?: string // 类型:1.input,2.textarea,3.select, - primordialType?: 'text'|'number'|'idcard'|'digit' - value?: any, - style?: object, //整行样式 - labelStyle?: object, // label样式 - contentStyle?: object, +interface ListParams { + label: string //左边label + onInput?: (ev: Object) => void // 输入框输入 + onClick?: () => any //点击列表 + placeholder?: string // 提示文本 + children?: any // 插槽 + type?: string // 类型:1.input,2.textarea,3.select, + primordialType?: 'text' | 'number' | 'idcard' | 'digit' + value?: any + style?: object //整行样式 + labelStyle?: object // label样式 + contentStyle?: object required?: boolean } // 表单列表 -const FromList = memo((props:ListParams)=>{ - const {type="input",value="",style={},labelStyle={},contentStyle={},required=false} = props; - +const FromList = memo((props: ListParams) => { + const { type = 'input', value = '', style = {}, labelStyle = {}, contentStyle = {}, required = false } = props + return ( - - {props.label} - - { - props.children?? - - { - type=="input"? - - - {value&& - props.onInput&&props.onInput({detail: {value: ""}})} className="iconfont icon-qingkong"/> - } - : - type=="textarea"?