diff --git a/release_note.txt b/release_note.txt index 7574079..0d0c52f 100644 --- a/release_note.txt +++ b/release_note.txt @@ -1 +1 @@ -v1.3.1 +v1.4.0 diff --git a/src/components/TransactionListExplorer/index.vue b/src/components/TransactionListExplorer/index.vue index b64f735..7b2166a 100644 --- a/src/components/TransactionListExplorer/index.vue +++ b/src/components/TransactionListExplorer/index.vue @@ -101,7 +101,6 @@
交易回执详情 @@ -215,8 +214,49 @@ export default { this.buttonState.disablePreClick = true this.buttonState.disableNextClick = false }, - handleReceiptDetails(val) { - this.txReceipt = val + async handleReceiptDetails(val) { + if (typeof val.properties.byProxy !== 'undefined') { + this.txReceipt = val + return + } + const response = await getTransaction({ + path: this.chainValue, + txHash: val.txHash, + blockNumber: val.blockNumber + }).catch( + (error) => { + this.$message({ + message: '网络异常:' + error, + type: 'error', + duration: 5000 + }) + } + ) + if ( + typeof response.errorCode === 'undefined' || + response.errorCode !== 0 + ) { + throw new Error( + '查询交易失败,交易哈希: ' + + val.txHash + + ',详情: ' + + JSON.stringify(response) + ) + } + if ( + typeof response.errorCode === 'undefined' || + response.errorCode !== 0 + ) { + throw new Error( + '查询交易失败,交易哈希: ' + + val.txHash + + ',详情: ' + + JSON.stringify(response) + ) + } + var tx = response.data + this.txReceipt = response.data + this.txHash = tx.txHash }, handlePrevClick() { if (this.currentStep <= 0) { @@ -366,36 +406,77 @@ export default { this.buttonState.loading = false return } - - this.fetchAllTx(chainValue, resp.data.transactions) - .then((response) => { - this.buttonState.loading = false - this.nextBlockNumber = resp.data.nextBlockNumber - this.nextOffset = resp.data.nextOffset - - if (response.length === 0) { - this.$message({ - type: 'info', - message: '交易列表为空,已查询至数据末尾' - }) - this.updateButtonStatus() - return + if (resp.data.transactions.length === 0 && resp.data.transactionWithDetails === 0) { + this.$message({ + type: 'info', + message: '交易列表为空,已查询至数据末尾' + }) + this.updateButtonStatus() + return + } + if (resp.data.transactionWithDetails.length !== 0) { + this.buttonState.loading = false + this.nextBlockNumber = resp.data.nextBlockNumber + this.nextOffset = resp.data.nextOffset + var txs = [] + if (resp.data.transactionWithDetails.length === 0) { + return txs + } + const defaultValue = (value, defaultValue) => { + if (value === 0) { + return value } - - if (this.controlVersion !== version) { - return + if (!value) { + return defaultValue } - - this.transactionList = response - this.historyData[this.currentStep] = response - this.currentStep += 1 - - this.updateButtonStatus() - }) - .catch((err) => { - this.buttonState.loading = false - this.$message({ type: 'error', message: err.toString() }) - }) + return value + } + if (this.controlVersion !== version) { + return + } + for (const tx of resp.data.transactionWithDetails) { + var newTx = {} + newTx.txHash = defaultValue(tx.txHash, 'unknown') + newTx.username = defaultValue(tx.username, 'unknown') + newTx.txID = defaultValue(tx.xaTransactionID, 'unknown') + newTx.blockNumber = defaultValue(tx.blockNumber, 'unknown') + newTx.path = defaultValue(tx.path, 'unknown') + newTx.method = defaultValue(tx.method, 'unknown') + newTx.properties = defaultValue(tx.properties, 'unknown') + txs[txs.length] = newTx + } + this.transactionList = txs + this.historyData[this.currentStep] = txs + this.currentStep += 1 + this.updateButtonStatus() + } + if (resp.data.transactions.length !== 0) { + this.fetchAllTx(chainValue, resp.data.transactions) + .then((response) => { + this.buttonState.loading = false + this.nextBlockNumber = resp.data.nextBlockNumber + this.nextOffset = resp.data.nextOffset + if (response.length === 0) { + this.$message({ + type: 'info', + message: '交易列表为空,已查询至数据末尾' + }) + this.updateButtonStatus() + return + } + if (this.controlVersion !== version) { + return + } + this.transactionList = response + this.historyData[this.currentStep] = response + this.currentStep += 1 + this.updateButtonStatus() + }) + .catch((err) => { + this.buttonState.loading = false + this.$message({ type: 'error', message: err.toString() }) + }) + } }) .catch((error) => { this.buttonState.loading = false diff --git a/src/views/transaction/transactionSteps/xaTransactionStep.js b/src/views/transaction/transactionSteps/xaTransactionStep.js index f5b0b96..e91591e 100644 --- a/src/views/transaction/transactionSteps/xaTransactionStep.js +++ b/src/views/transaction/transactionSteps/xaTransactionStep.js @@ -1,3 +1,24 @@ +export const xaTransactionManagerSteps = [ + { + element: '#ChainExplorer', + title: '1. 导航选择', + intro: '第一步:从zone-chain导航中选择对应的链', + position: 'right' + }, + { + element: '#xaTransactionListExplorer', + title: '2. 事务列表展示', + intro: '第二步:选择好对应的链之后,就会在资源列表中展示这条链中所有事务', + position: 'left' + }, + { + element: '#sendxaTransaction', + title: '发起交易', + intro: '若需要发起事务,请点击"发起事务"按钮', + position: 'left' + } +] + export const startXASteps = [ { element: '#XAID', diff --git a/src/views/transaction/xaTransactionList.vue b/src/views/transaction/xaTransactionList.vue index e5bfb2e..92d3e56 100644 --- a/src/views/transaction/xaTransactionList.vue +++ b/src/views/transaction/xaTransactionList.vue @@ -1,146 +1,252 @@ - +