Browse Source

添加手动确认链上功能

master
long 3 years ago
parent
commit
98d49c0511
  1. 11
      src/api/system/collection.js
  2. 75
      src/views/push/index.vue

11
src/api/system/collection.js

@ -26,6 +26,9 @@ export function addCollection(data) {
})
}
// 修改nft上链
export function updateCollection(data) {
return request({
@ -42,3 +45,11 @@ export function delCollection(id) {
method: 'delete'
})
}
//确认上链
export function confirmUplink(data) {
return request({
url: '/system/collection/confirmUplink',
method: 'post',
data: data
})
}

75
src/views/push/index.vue

@ -84,16 +84,16 @@
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:collection:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="confirmUplink"
v-hasPermi="['system:collection:add']"
>手动确认上链状态</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
@ -190,14 +190,24 @@
<!-- 添加或修改nft上链对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="更新时间" prop="updatedTime">
<el-date-picker clearable
v-model="form.updatedTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择更新时间">
</el-date-picker>
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-form-item label="合约地址" prop="contract">
<el-select v-model="form.contract" placeholder="请选择合约地址" @change="changeContrat" clearable>
<el-option
v-for="configList in configList"
:key="configList.contract"
:label="configList.label"
:value="configList.contract"
/>
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="unitName">
<el-input
v-model="form.unitName"
placeholder="请选择项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -209,8 +219,8 @@
</template>
<script>
import { listCollection, getCollection, delCollection, addCollection, updateCollection } from "@/api/system/collection";
import { listCollection, getCollection, delCollection, confirmUplink, updateCollection } from "@/api/system/collection";
import { listConfig} from "@/api/system/contract";
export default {
name: "Collection",
dicts: ['sys_nft_push', 'sys_transfer'],
@ -230,6 +240,7 @@
total: 0,
// nft
collectionList: [],
configList: [],
//
title: "",
//
@ -257,6 +268,7 @@
},
created() {
this.getList();
this.getContractList();
},
methods: {
/** 查询nft上链列表 */
@ -268,6 +280,21 @@
this.loading = false;
});
},
getContractList() {
this.loading = true;
listConfig(this.queryParams).then(response => {
this.configList = response.rows;
this.total = response.total;
this.loading = false;
});
},
changeContrat(){
this.configList.forEach((element,index) => {
if (element.contract===this.form.contract){
this.form.unitName=element.unitName;
}
});
},
//
cancel() {
this.open = false;
@ -310,10 +337,10 @@
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
confirmUplink() {
this.reset();
this.open = true;
this.title = "添加nft上链";
this.title = "确认上链状态";
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -336,8 +363,8 @@
this.getList();
});
} else {
addCollection(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
confirmUplink(this.form).then(response => {
this.$modal.msgSuccess("确认链上成功");
this.open = false;
this.getList();
});

Loading…
Cancel
Save