新版交易所前段管理后台
1
jhzh
2025-08-18 1107fcd6f49bf9543b23e1b74160f2dc9162bb3d
src/views/modules/cryptos-spots/cryptos-spots-transport.vue
@@ -4,17 +4,9 @@
      <el-tab-pane label="当前单" name="1"></el-tab-pane>
      <el-tab-pane label="历史单" name="2"></el-tab-pane>
    </el-tabs>
    <avue-crud
      ref="crud"
      :page.sync="page"
      :data="dataList"
      :option="tableOption"
      :cell-class-name="addClasscolor"
      @search-change="searchChange"
      @selection-change="selectionChange"
      @refresh-change="refreshChange"
      @on-load="getDataList"
    >
      <avue-crud ref="crud" :page.sync="page" :data="dataList" :option="tableOption" :cell-class-name="addClasscolor"
         @search-change="searchChange" @selection-change="selectionChange" @refresh-change="refreshChange"
         @on-load="getDataList">
      <template slot-scope="scope" slot="userNamesolt">
        <span @click="searchName(scope.row.userName)" class="seachButton">{{
          scope.row.userName
@@ -22,13 +14,12 @@
      </template>
      <!-- (剩余/委托金额) -->
      <template slot-scope="scope" slot="vove">
        <span class="green">{{ scope.row.volumeUnitAmount }}</span
        >/<span>{{ scope.row.volumeOpenUnitAmount }}</span>
            <span
               class="green">{{ scope.row.volumeUnitAmount }}</span>/<span>{{ scope.row.volumeOpenUnitAmount }}</span>
      </template>
      <!-- (剩余/委托保证金) -->
      <template slot-scope="scope" slot="depo">
        <span class="green">{{ scope.row.deposit }}</span
        >/<span>{{ scope.row.depositOpen }}</span>
            <span class="green">{{ scope.row.deposit }}</span>/<span>{{ scope.row.depositOpen }}</span>
      </template>
      <template slot-scope="scope" slot="closTime">
        <span v-if="scope.row.closeTime">{{
@@ -39,105 +30,69 @@
        <div class="cheBoxMain" v-if="activeName == 1">
          <div style="margin-bottom: 10px">调整行情</div>
          <div class="chekClect">
            <el-select
              v-model="dataForm.symbol"
              clearable
              placeholder="请选择币种"
            >
              <el-option
                v-for="item in option"
                :key="item.symbol"
                :label="item.name"
                :value="item.symbol"
              >
                  <el-select v-model="dataForm.symbol" clearable placeholder="请选择币种">
                     <el-option v-for="item in option" :key="item.symbol" :label="item.name"
                        :value="item.symbol">
              </el-option>
            </el-select>
          </div>
          <div class="chekClect" style="margin-top: 3px">
            <el-button
              type="primary"
              icon="el-icon-edit"
              size="small"
              @click="addOrUpdateHandle(dataForm.symbol)"
              >调整</el-button
            >
                  <el-button type="primary" icon="el-icon-edit" size="small"
                     @click="addOrUpdateHandle(dataForm.symbol)">调整</el-button>
          </div>
        </div>
      </template>
      <template slot="menuLeft">
        <div class="main">
          <el-tabs
            v-if="activeName == '2'"
            v-model="activeName2"
            @tab-click="handleClick2"
          >
               <el-tabs v-if="activeName == '2'" v-model="activeName2" @tab-click="handleClick2">
            <el-tab-pane label="全部" name="1"></el-tab-pane>
            <el-tab-pane label="持仓" name="2"></el-tab-pane>
            <el-tab-pane label="已平仓" name="3"></el-tab-pane>
          </el-tabs>
        </div>
      </template>
      <template
        slot-scope="scope"
        slot="menu"
        v-if="scope.row.state == 'submitted'"
      >
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="small"
          v-if="isAuth('sys:user:delete')"
          @click.stop="deleteHandle(scope.row.orderNo)"
          >平仓</el-button
        >
         <template slot-scope="scope" slot="menu" v-if="scope.row.state == 'submitted'">
            <el-button type="primary" icon="el-icon-edit" size="small" v-if="isAuth('sys:user:delete')"
               @click.stop="deleteHandle(scope.row.orderNo)">平仓</el-button>
            <el-button type="primary" icon="el-icon-edit" size="small"
               @click.stop="UpdateHandle(scope.row)">盈亏控制</el-button>
      </template>
    </avue-crud>
    <add-or-update
      v-if="addOrUpdateVisible"
      ref="addOrUpdate"
      @refreshDataList="refreshChange"
    ></add-or-update>
    <el-dialog
      title="完整用户名(完整钱包地址)"
      :close-on-click-modal="false"
      :visible.sync="userNamevisible"
    >
      <!-- 弹窗,  修改 -->
      <add-or-updates v-if="UpdateVisibles" ref="Updates" @refreshDataList="getDataList"></add-or-updates>
      <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="refreshChange"></add-or-update>
      <el-dialog title="完整用户名(完整钱包地址)" :close-on-click-modal="false" :visible.sync="userNamevisible">
      <el-form :model="dataForm" ref="dataForm">
        <el-form-item label="" prop="">
          <div style="font-size: 20px">
            <span>{{ username }}</span
            ><a
              class="seachButton"
              target="_blank"
              :href="'https://etherscan.io/address/' + username"
              >在Etherscan上查看</a
            >
                  <span>{{ username }}</span><a class="seachButton" target="_blank"
                     :href="'https://etherscan.io/address/' + username">在Etherscan上查看</a>
          </div>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="userNamevisible = false">取消</el-button>
        <el-button type="primary" @click="userNamevisible = false"
          >确定</el-button
        >
            <el-button type="primary" @click="userNamevisible = false">确定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { tableOption } from "@/crud/shop/transportm";
   import {
      tableOption
   } from "@/crud/shop/transportm";
import AddOrUpdate from "./transport-add-or-update";
   import Updates from "./finance-add-or-updates";
export default {
  data() {
    return {
      dateRange: [],
      option: [
        {
            option: [{
          symbol: 1,
          name: "DOGE/USTD",
        },
      ],
            }, ],
      dataForm: {
        transName: "",
      },
@@ -150,6 +105,7 @@
      username: "",
      userNamevisible: false,
      addOrUpdateVisible: false,
            UpdateVisibles: false,
      page: {
        total: 0, // 总页数
        currentPage: 1, // 当前页数
@@ -161,6 +117,7 @@
  },
  components: {
    AddOrUpdate,
         'add-or-updates': Updates
  },
  created() {
    this.getAction();
@@ -168,7 +125,10 @@
  mounted() {},
  computed: {},
  methods: {
    addClasscolor({ column, row }) {
         addClasscolor({
            column,
            row
         }) {
      //表单样式
      if (
        (column.property === "direction" && row.direction == "buy") ||
@@ -188,6 +148,7 @@
        return "yellow";
      }
    },
    // 获取数据列表
    getDataList(page, done) {
      page = page === undefined ? this.page : page;
@@ -198,8 +159,7 @@
        ),
        method: "get",
        params: this.$http.adornParams(
          Object.assign(
            {
                  Object.assign({
              type: "cryptos", //forex->外汇,commodities->大宗商品,指数/ETF->indices, A-stocks->A股, HK-stocks->港股.US-stocks->美股,cryptos->虚拟货币
              current: page == null ? this.page.currentPage : page.currentPage,
              size: page == null ? this.page.pageSize : page.pageSize,
@@ -214,7 +174,9 @@
          ),
          false
        ),
      }).then(({ data }) => {
            }).then(({
               data
            }) => {
        this.dataList = data.data.records;
        this.page.total = data.data.total;
        this.dataListLoading = false;
@@ -264,6 +226,13 @@
      }
      this.getDataList();
    },
         // 修改
         UpdateHandle(id) {
            this.UpdateVisibles = true;
            this.$nextTick(() => {
               this.$refs.Updates.init(id);
            });
         },
    // 新增 / 修改
    addOrUpdateHandle(id) {
      if (this.dataForm.symbol) {
@@ -298,7 +267,9 @@
              params: this.$http.adornParams({
                orderNo: orderNo,
              }),
            }).then(({ data }) => {
                     }).then(({
                        data
                     }) => {
              this.$message({
                message: "平仓成功",
                type: "success",
@@ -309,8 +280,7 @@
                },
              });
            });
          } else {
          }
                  } else {}
        });
    },
    //行情数据
@@ -321,10 +291,15 @@
        params: this.$http.adornParams({
          type: "cryptos", //forex->外汇,commodities->大宗商品,指数/ETF->indices, A-stocks->A股, HK-stocks->港股.US-stocks->美股,cryptos->虚拟货币
        }),
      }).then(({ data }) => {
            }).then(({
               data
            }) => {
        if (data.data.records) {
          this.option = data.data.records.map((item, index) => {
            return Object.assign({}, { symbol: item.symbol, name: item.name });
                     return Object.assign({}, {
                        symbol: item.symbol,
                        name: item.name
                     });
          });
        }
      });
@@ -357,6 +332,7 @@
    overflow: hidden;
    padding: 50px 20px;
  }
  .chekClect {
    float: left;
    margin-right: 20px;