Skip to content

Commit

Permalink
Merge pull request #489 from WeBankBlockchain/lab-dev
Browse files Browse the repository at this point in the history
fix bool of trans
  • Loading branch information
CodingCattwo authored Apr 17, 2023
2 parents 6f3eddb + d0292aa commit 7cdfc8f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
height: 100%;
margin: 0px;
padding: 0px;
}</style></head><body><body><div id=app></div><script type=text/javascript src=./static/js/0.ce2a76371303d3d75221.js></script><script type=text/javascript src=./static/js/4.1e68a47808b0c77ac992.js></script><script type=text/javascript src=./static/js/runtime.bb37252c90fcce12574a.js></script><script type=text/javascript src=./static/js/6.79ad17ade2027bc30fc6.js></script></body><script src=./static/js/web3.min.js type=text/javascript></script><script>if (self == top) {
}</style></head><body><body><div id=app></div><script type=text/javascript src=./static/js/0.a8135dffc4f0f4b9222e.js></script><script type=text/javascript src=./static/js/4.1e68a47808b0c77ac992.js></script><script type=text/javascript src=./static/js/runtime.bb37252c90fcce12574a.js></script><script type=text/javascript src=./static/js/6.79ad17ade2027bc30fc6.js></script></body><script src=./static/js/web3.min.js type=text/javascript></script><script>if (self == top) {
var antiClickjack = document.getElementById("antiClickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
Expand Down

Large diffs are not rendered by default.

Binary file added dist/static/js/0.a8135dffc4f0f4b9222e.js.gz
Binary file not shown.
Binary file removed dist/static/js/0.ce2a76371303d3d75221.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion release_note.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.0.0
v3.0.2
44 changes: 27 additions & 17 deletions src/components/sendTransaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</el-select>
<el-select v-model="transation.funcName" :placeholder="$t('contracts.methodName')" filterable v-show="funcList.length > 0" @change="changeFunc" style="width: 300px" popper-class="func-name">
<el-option :label="item.name" :key="item.funcId" :value="item.funcId" v-for="item in funcList">
<span :class=" {'func-color': checkFunction(item)}">{{item.name}}</span>
<span :class=" {'func-color': checkFunction(item)}">{{item.name}}</span>
</el-option>
</el-select>
</div>
Expand Down Expand Up @@ -188,7 +188,7 @@ export default {
},
ruleForms: [],
rules: {
int: [
int: [
{
required: true,
message: this.$t("text.sendInput"),
Expand Down Expand Up @@ -219,7 +219,7 @@ export default {
trigger: "blur",
},
],
uint256: [
uint256: [
{
required: true,
message: this.$t("text.sendInput"),
Expand Down Expand Up @@ -433,10 +433,14 @@ export default {
if (value.funcId === this.transation.funcName) {
this.pramasData = value.inputs;
this.ruleForm.ruleForms = value.inputs;
console.log(value.stateMutability)
if(value.stateMutability=='view'||value.stateMutability=='pure'||value.stateMutability=='constant'){
console.log(value.stateMutability);
if (
value.stateMutability == "view" ||
value.stateMutability == "pure" ||
value.stateMutability == "constant"
) {
this.constant = true;
}else{
} else {
this.constant = false;
}
this.pramasObj = value;
Expand Down Expand Up @@ -502,7 +506,6 @@ export default {
if (this.transation.funcType === "constructor") {
this.transation.funcName = this.data.contractName;
}
for (let i in this.ruleForm.ruleForms) {
let data = this.ruleForm.ruleForms[i].value;
if (data && isJson(data)) {
Expand All @@ -511,16 +514,19 @@ export default {
} catch (error) {
console.log(error);
}
} else if (data === "true" || data === "false") {
this.transation.reqVal[i] = eval(data.toLowerCase());
} else {
}
// else if (data === "true" || data === "false") {
// this.transation.reqVal[i] = eval(data.toLowerCase());
// }
else {
this.transation.reqVal[i] = data;
}
}
this.ruleForm.ruleForms.map((item, index) => {
if (item.value == "true" || item.value == "false") {
this.ruleForm.ruleForms[index] = eval(item.value.toLowerCase());
} else if (
// if (item.value == "true" || item.value == "false") {
// this.ruleForm.ruleForms[index] = eval(item.value.toLowerCase());
// } else
if (
item.value.hasOwnProperty("substring") &&
item.value.substring(0, 1) == "["
) {
Expand All @@ -534,7 +540,7 @@ export default {
// rules.push(this.transation.reqVal[i]);
// }
let data = this.pramasData[i].value;
rules.push(data)
rules.push(data);
}
let functionName = "";
Expand Down Expand Up @@ -566,7 +572,7 @@ export default {
}
if (this.isWasm) {
data.isWasm = true;
}else{
} else {
data.isWasm = false;
}
sendTransation(data)
Expand Down Expand Up @@ -620,7 +626,7 @@ export default {
type: "error",
duration: 2000,
});
if (res.data.code === 201151||res.data.code === 201014) {
if (res.data.code === 201151 || res.data.code === 201014) {
setTimeout(() => {
this.$notify({
title: "提示",
Expand Down Expand Up @@ -671,7 +677,11 @@ export default {
this.getUserData();
},
checkFunction(item) {
return (item.stateMutability==='view'||item.stateMutability==='cosntant'||item.stateMutability==='pure') ? false : true;
return item.stateMutability === "view" ||
item.stateMutability === "cosntant" ||
item.stateMutability === "pure"
? false
: true;
},
},
};
Expand Down

0 comments on commit 7cdfc8f

Please sign in to comment.