| | |
| | | _templates.push({ |
| | | uuid: temp.MenuID, |
| | | title: temp.MenuName, |
| | | MenuNo: temp.MenuNo, |
| | | type: temp.Template, |
| | | url: illust[temp.Template], |
| | | disabled: temp.disabled || false, |
| | |
| | | </Row> |
| | | <Row> |
| | | {this.state.usedTemplates.map((template, index) => { |
| | | if (!tempSearchKey || template.title.toLowerCase().indexOf(tempSearchKey.toLowerCase()) >= 0) { |
| | | return ( |
| | | <Col key={template.type + index} className={template.disabled ? 'disabled' : ''} title={template.disTitle || ''} span={6}> |
| | | <Card |
| | | title={template.title}> |
| | | <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/> |
| | | <div className="card-operation"> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template, 'user')}}>使用模板</Button> |
| | | </div> |
| | | </Card> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | if (tempSearchKey) { |
| | | if ((template.title + template.MenuNo).toLowerCase().indexOf(tempSearchKey.toLowerCase()) === -1) { |
| | | return null |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Col key={template.type + index} className={template.disabled ? 'disabled' : ''} title={template.disTitle || ''} span={6}> |
| | | <Card |
| | | title={template.title}> |
| | | <img onClick={() => {this.previewPicture(template)}} src={template.url} alt=""/> |
| | | <div className="card-operation"> |
| | | <Button type="primary" onClick={() => {this.useTemplate(template, 'user')}}>使用模板</Button> |
| | | </div> |
| | | </Card> |
| | | </Col> |
| | | ) |
| | | })} |
| | | </Row> |
| | | </TabPane> |