调整了前端对使用和未使用确权项目的支持

This commit is contained in:
zhangxunhui 2023-02-04 11:08:53 +08:00
parent c2a21b2780
commit fcaaef137a
4 changed files with 62 additions and 61 deletions

View File

@ -644,13 +644,6 @@ class MessageCount extends Component {
value={this.state.body} value={this.state.body}
onChange={this.changbodypr} onChange={this.changbodypr}
/> />
{/*<Input*/}
{/* type="select"*/}
{/* placeholder="请选择解决的issue"*/}
{/* style={{ marginTop: 20 }}*/}
{/* value={this.state.fix_issue_id}*/}
{/* onChange={this.changefixissue}*/}
{/*/>*/}
<Select <Select
id = {'select_project'} id = {'select_project'}
style={{ marginTop: 20, width: "500px" }} style={{ marginTop: 20, width: "500px" }}

View File

@ -52,7 +52,7 @@ class Index extends Component {
languageFlag:false, languageFlag:false,
ignoreFlag:false, ignoreFlag:false,
licenseFlag:false, licenseFlag:false,
show_div:"hidden", display: "none",
} }
} }
componentDidMount = () => { componentDidMount = () => {
@ -303,13 +303,13 @@ class Index extends Component {
// add by zxh: handleBlockchainChange // add by zxh: handleBlockchainChange
handleBlockchainChange = (event) => { handleBlockchainChange = (event) => {
if (this.state.show_div == 'hidden') { if (this.state.display == "none") {
this.setState({ this.setState({
show_div: "visible" display: "block"
}); });
} else { } else {
this.setState({ this.setState({
show_div: "hidden" display: "none"
}); });
} }
} }
@ -578,40 +578,6 @@ class Index extends Component {
<Checkbox value="limit">将项目设为私有<span className="font-13 color-grey-9">(只有项目所有人或拥有权限的项目成员才能看到)</span></Checkbox> <Checkbox value="limit">将项目设为私有<span className="font-13 color-grey-9">(只有项目所有人或拥有权限的项目成员才能看到)</span></Checkbox>
)} )}
</Form.Item > </Form.Item >
{/*增加区块链选项,不要求必选,默认是选择的*/}
<Form.Item
label="确权"
style={{ margin: "0px" }}
className="privatePart"
>
{getFieldDecorator('blockchain')(
<Checkbox value="limit" onClick={this.handleBlockchainChange}>项目加入确权机制<span className="ml15 font-13 color-grey-9">(贡献确权上链并使用权益证明代表贡献)</span></Checkbox>
)}
</Form.Item >
<Form.Item
style={{ margin: "15px", display: "block" }}
className="privatePart"
ref={(blockchain_item => {this.blockchain_item = blockchain_item})}
>
<div class="div_flex_row" style={{visibility: this.state.show_div == "visible" ? "visible": "hidden"}}>
{getFieldDecorator('blockchain_token_all', {
rules: [{
required: false, message: '请填写项目token总数(单位:枚)'
}],
})(
<Input type={'number'} min={0} step={1} placeholder="请填写项目token总数(单位:枚)" />
)}
{getFieldDecorator('blockchain_init_token', {
rules: [{
required: false, message: '请填写项目创始人获取token的百分比(%)'
}],
})(
<Input type={'number'} min={0} max={100} step={1} placeholder="请填写项目创始人获取token的百分比(%)" />
)}
</div>
</Form.Item>
{ {
projectsType && projectsType === "mirror" && projectsType && projectsType === "mirror" &&
@ -680,6 +646,42 @@ class Index extends Component {
)} )}
</Form.Item> </Form.Item>
} }
{/*增加区块链选项,不要求必选,默认是选择的*/}
<Form.Item
label="确权"
style={{ margin: "0px" }}
className="privatePart"
>
{getFieldDecorator('blockchain')(
<Checkbox value="limit" onClick={this.handleBlockchainChange}>项目加入确权机制<span className="ml15 font-13 color-grey-9">(贡献确权上链并使用权益证明代表贡献)</span></Checkbox>
)}
</Form.Item >
<Form.Item
style={{ margin: "15px", display: "block" }}
className="privatePart"
ref={(blockchain_item => {this.blockchain_item = blockchain_item})}
>
<div class="div_flex_row" style={{display: this.state.display == "block" ? "block": "none"}}>
{getFieldDecorator('blockchain_token_all', {
rules: [{
required: false, message: '请填写项目token总数(单位:枚)'
}],
})(
<Input type={'number'} min={0} step={1} placeholder="请填写项目token总数(单位:枚)" />
)}
{getFieldDecorator('blockchain_init_token', {
rules: [{
required: false, message: '请填写项目创始人获取token的百分比(%)'
}],
})(
<Input type={'number'} min={0} max={100} step={1} placeholder="请填写项目创始人获取token的百分比(%)" />
)}
</div>
</Form.Item>
<div className="mt20"> <div className="mt20">
<span className="ant-form-item-required"></span> <span className="ant-form-item-required"></span>
</div> </div>

View File

@ -42,8 +42,8 @@ class Detail extends Component {
} }
componentDidMount = () => { componentDidMount = () => {
this.getDetail();
this.getBlockchainTokenNum(); this.getBlockchainTokenNum();
this.getDetail();
}; };
componentDidUpdate=()=>{ componentDidUpdate=()=>{
@ -362,10 +362,13 @@ class Detail extends Component {
)} )}
</span> </span>
</p> </p>
<p className="grid-item-left pb15"> {
this.state.blockchain_token_num != -1 ? <p className="grid-item-left pb15">
<span className="issue_detail_info">悬赏金额:</span> <span className="issue_detail_info">悬赏金额:</span>
<span>{this.state.blockchain_token_num}</span> <span>{this.state.blockchain_token_num}</span>
</p> </p> : ""
}
<p className="grid-item-left pb15"> <p className="grid-item-left pb15">
<span className="issue_detail_info">里程碑:</span> <span className="issue_detail_info">里程碑:</span>
<span className="title_overflow"> <span className="title_overflow">

View File

@ -490,10 +490,11 @@ class order_form extends Component {
</div> </div>
<div className="list-left list-left-padding issue-edit-form-right"> <div className="list-left list-left-padding issue-edit-form-right">
<div className="pd20 background-f issue-form-right"> <div className="pd20 background-f issue-form-right">
{issue_chosen && issue_chosen.use_blockchain ?
<Form.Item label="悬赏金额"> <Form.Item label="悬赏金额">
{getFieldDecorator("issue_token_num", {rules: []})( {getFieldDecorator("issue_token_num", { rules: [] })(
<Input <Input
ref={(input) => this.input_token=input} ref={(input) => this.input_token = input}
type={"number"} type={"number"}
min={0} min={0}
max={this.state.issue_token_num} max={this.state.issue_token_num}
@ -502,6 +503,8 @@ class order_form extends Component {
/> />
)} )}
</Form.Item> </Form.Item>
: ""}
<Form.Item label="指派成员"> <Form.Item label="指派成员">
{getFieldDecorator("assigned_to_id", {rules: []})( {getFieldDecorator("assigned_to_id", {rules: []})(
<Select <Select