F 修复新建发布申请时Tag和构建版本无法搜索的问题 #530

pull/586/head
vapao 2022-07-25 09:13:53 +08:00
parent b1810b9ed1
commit 71f6450f36
1 changed files with 8 additions and 5 deletions

View File

@ -8,7 +8,7 @@ import { observer } from 'mobx-react';
import { Modal, Form, Input, Select, DatePicker, Button, message } from 'antd';
import { LoadingOutlined, SyncOutlined } from '@ant-design/icons';
import HostSelector from './HostSelector';
import { http, history } from 'libs';
import { http, history, includes } from 'libs';
import store from './store';
import lds from 'lodash';
import moment from 'moment';
@ -170,12 +170,14 @@ export default observer(function () {
placeholder="请稍等"
onChange={switchExtra1}
notFoundContent={git_type === 'repository' ? <NoVersions/> : undefined}
filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}>
filterOption={(input, option) => includes(option.content, input)}>
{git_type === 'branch' ? (
Object.keys(branches || {}).map(b => <Select.Option key={b} value={b}>{b}</Select.Option>)
Object.keys(branches || {}).map(b => (
<Select.Option key={b} value={b} content={b}>{b}</Select.Option>
))
) : git_type === 'tag' ? (
Object.entries(tags || {}).map(([tag, info]) => (
<Select.Option key={tag} value={tag}>
<Select.Option key={tag} value={tag} content={`${tag} ${info.author} ${info.message}`}>
<div style={{display: 'flex', justifyContent: 'space-between'}}>
<span style={{
width: 200,
@ -188,7 +190,8 @@ export default observer(function () {
))
) : (
repositories.map(item => (
<Select.Option key={item.id} value={item.id} disabled={type === '2' && item.id >= rb_id}>
<Select.Option key={item.id} value={item.id} content={item.version}
disabled={type === '2' && item.id >= rb_id}>
<div style={{display: 'flex', justifyContent: 'space-between'}}>
<span>{item.version}</span>
<span style={{color: '#999', fontSize: 12}}>构建于 {moment(item.created_at).fromNow()}</span>