新版交易所前段管理后台
1
PC-20250623MANY\Administrator
2025-10-21 7bbf9b23bcd3f2bbf54aa62476cd2c4e7ea88aaa
1
1 files modified
2 files added
430 ■■■■ changed files
src/crud/user/bi-parameters.js 30 ●●●●● patch | view | raw | blame | history
src/views/modules/user/bi-parameters.vue 307 ●●●●● patch | view | raw | blame | history
src/views/modules/user/manger.vue 93 ●●●●● patch | view | raw | blame | history
src/crud/user/bi-parameters.js
New file
@@ -0,0 +1,30 @@
export const tableOptionData = {
  searchMenuSpan: 0,
  columnBtn: false,
  border: false,
  selection: false,
  index: false,
  indexLabel: '序号',
  stripe: false,
  menuAlign: 'center',
  menuWidth: 180,
  align: 'center',
  refreshBtn: false,
  searchSize: 'mini',
  addBtn: false,
  editBtn: false,
  delBtn: false,
  viewBtn: false,
  menu:false,
  props: {
    label: 'label',
    value: 'value'
  },
  column: [{
    label: '币种',
    prop: 'name',
  },{
    label: '数量',
    prop: 'volume',
  }]
}
src/views/modules/user/bi-parameters.vue
New file
@@ -0,0 +1,307 @@
<template>
  <el-dialog :title="'总资产'" :close-on-click-modal="false" :visible.sync="visible" width="1200px" @close="handClose">
    <div class="mod-subscribe-general">
      <avue-crud ref="crud" :page.sync="page" :data="dataList" :option="tableOption_1" @search-change="searchChange"
        @selection-change="selectionChange">
      </avue-crud>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">关闭</el-button>
      <!-- <el-button type="primary" @click="dataFormSubmit()">确定</el-button> -->
    </span>
    <!-- 弹窗, 新增 / 修改 -->
    <!-- <parameters
      v-if="parameters"
      ref="parameters"
      @refreshDataList="getDataList"
    ></parameters>
    <paramsDelet
      v-if="paramsDelet"
      ref="paramsDelet"
      @refreshDataList="getDataList"
    ></paramsDelet> -->
    <!-- 确认弹窗-end -->
  </el-dialog>
</template>
<script>
import { tableOptionData } from "@/crud/user/bi-parameters";
import { Debounce } from "@/utils/debounce";
export default {
  data() {
    return {
      stock: "",
      visible: false,
      dialogFormVisible: true,
      paramsDelet: false,
      parameters: false,
      formLabelWidth: "120px",
      type: "", //type:'forex', //forex->外汇,commodities->大宗商品,指数/ETF->indices, A-stocks->A股, HK-stocks->港股.US-stocks->美股,cryptos->虚拟货币
      menuList: [],
      options: [],
      menuListTreeProps: {
        label: "name",
        children: "children",
      },
      options: [],
      optionsTwo: [
        {
          label: "机器人刷单",
          value: 1,
        },
        {
          label: "第三方数据采集",
          value: 2,
        },
      ],
      row: "",
      dataForm: {
        symbol: "",
      },
      dataRule: {},
      tableOption_1: tableOptionData,
      page: {
        total: 0, // 总页数
        currentPage: 1, // 当前页数
        pageSize: 10, // 每页显示多少条
      },
      dataList: [],
    };
  },
  created() {
    // this.getSymbol();
  },
  components: {
    // parameters,
    // paramsDelet
  },
  methods: {
    init(row) {
      // this.row = row || "";
      // this.tableOption = tableOptionData ;
      // // console.log("stocks => " + stocks)
      // if (row) {
      //   this.dataForm.symbol = row.symbol;
      //   this.getDataList(this.page);
      // } else {
      // }
      this.dataList = [
        // { name: "ETF现货", value: "0" },
      ];
      this.getSymbol(row.userCode, (data) => {
        this.dataList = data.data.extends;
      });
      this.visible = true;
      // this.dialogFormVisible = false
    },
    handClose() {
      this.tableOption = {};
      // this.$data.dataForm=JSON.parse(JSON.stringify(this.$options.data().dataForm))
      // this.$nextTick(() => {
      //     this.$refs['dataForm'].clearValidate() // 清除表单验证
      //   })
      // this.optionsTwo.value = ''
      // this.options.value = ''
    },
    changeVal(val) {
      this.$forceUpdate();
    },
    dataFormSubmit: Debounce(function () { }),
    // 条件查询
    searchChange(params, done) {
      this.getDataList(this.page, params, done);
    },
    // 获取项目种类列表
    getSymbol(userId, call) {
      this.dataListLoading = true;
      this.$http({
        url: this.$http.adornUrl("/user/getWalletExtends"),
        method: "get",
        params: this.$http.adornParams(
          Object.assign({
            userId: userId,
          }),
          false
        ),
      }).then(({ data }) => {
        if (data.code == 0) {
          call(data);
        }
      });
    },
    // 多选变化
    selectionChange(val) {
      this.dataListSelections = val;
    },
    handleAvatarSuccess(res, file) {
      this.dataForm.imageUrl = URL.createObjectURL(file.raw); //显示地址
      this.dataForm.imgUrl = res.data.path; //接口传递
      console.log(this.dataForm.imageUrl);
    },
    beforeAvatarUpload(file) {
      // const isJPG = file.type === 'image/jpeg';
      const isLt2M = file.size / 1024 / 1024 < 10;
      if (!isLt2M) {
        this.$message.error("上传图片大小不能超过 10MB!");
      }
      return isLt2M;
    },
    // 获取数据列表
    getDataList(page, params, done) {
      this.dataListLoading = true;
      this.$http({
        url: this.$http.adornUrl(
          "/normal/adminContractManageAction!/listPara.action"
        ),
        method: "get",
        params: this.$http.adornParams(
          Object.assign(
            {
              //type:this.type,//type:'forex', //forex->外汇,commodities->大宗商品,指数/ETF->indices, A-stocks->A股, HK-stocks->港股.US-stocks->美股,cryptos->虚拟货币
              symbol: this.dataForm.symbol,
              current: page == null ? this.page.currentPage : page.currentPage,
              size: page == null ? this.page.pageSize : page.pageSize,
            },
            params
          )
        ),
      }).then(({ data }) => {
        if (data.code == 0) {
          console.log("data => " + data);
          this.dataList = data.data.records;
          this.page.total = data.data.total;
        } else {
          this.$message({
            message: data.msg,
            type: "error",
            duration: 1000,
            onClose: () => { },
          });
        }
        this.dataListLoading = false;
        if (done) {
          done();
        }
      });
    },
    // 新增 / 修改
    addOrUpdateHandle(arr, row) {
      this.parameters = true;
      this.$nextTick(() => {
        this.$refs.parameters.init(arr, row);
      });
    },
    // 删除
    deleteHandle(id) {
      this.paramsDelet = true;
      this.$nextTick(() => {
        this.$refs.paramsDelet.init(id);
      });
    },
    Add(call) {
      this.$prompt("输入杠杆倍数", "新增杠杆", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
      })
        .then(({ value }) => {
          //
          this.$http({
            url: this.$http.adornUrl(
              "/normal/adminItemLeverageAction!/add.action"
            ),
            method: "post",
            data: this.$http.adornData(
              Object.assign({
                lever_rate: value,
              })
            ),
          }).then(({ data }) => {
            if (data.code == 0) {
              this.$message({
                message: "操作成功",
                type: "success",
                duration: 1500,
                onClose: () => {
                  this.getDataList();
                },
              });
            } else {
              this.$message({
                message: data.msg,
                type: "error",
                duration: 1500,
                onClose: () => { },
              });
            }
          });
          //
          if (call) {
            call();
          }
        })
        .catch((e) => {
          console.log("error = " + e);
          this.$message({
            type: "info",
            message: "取消输入",
          });
        });
    },
  },
};
</script>
<style scoped>
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}
.avatar {
  width: 178px;
  height: 178px;
  display: block;
}
.speaInputTwo {
  width: 250px;
}
.speaInputThtree {
  width: 120px;
}
.speaInputFive {
  width: 87px;
}
</style>
<style lang="scss" scoped>
::v-deep .el-dialog__body {
  padding: 0px 20px;
}
::v-deep .avue-crud__menu {
  height: auto;
  min-height: 0px;
}
</style>
src/views/modules/user/manger.vue
@@ -1,15 +1,7 @@
<template>
  <div class="mod-manger">
    <avue-crud
      ref="crud"
      :page.sync="page"
      :data="dataList"
      :option="tableOption"
      @search-change="searchChange"
      :cell-class-name="addClasscolor"
      @selection-change="selectionChange"
      @on-load="getDataList"
    >
    <avue-crud ref="crud" :page.sync="page" :data="dataList" :option="tableOption" @search-change="searchChange"
      :cell-class-name="addClasscolor" @selection-change="selectionChange" @on-load="getDataList">
      <template slot="menuLeft">
        <!-- <el-button type="primary"
                   icon="el-icon-plus"
@@ -29,40 +21,29 @@
        }}</span>
      </template>
      <template slot-scope="scope" slot="property">
        <span @click="lookProperty(scope.row)" class="seachButton">{{
          "查看资产"
        }}</span>
        <span @click="lookProperty(scope.row)" class="seachButton">
          {{ "查看资产" }}
        </span>
        <br>
        <span @click="lookBi(scope.row)" class="seachButton">
          {{ "币资产" }}
        </span>
      </template>
      <template slot-scope="scope" slot="moneyslot">
        <span
          class="seachButton"
          @click="
            moneyCheack(scope.row.userId, '钱包', false, scope.row.userCode)
          "
          >{{ scope.row.money }}</span
        >
        <span class="seachButton" @click="
          moneyCheack(scope.row.userId, '钱包', false, scope.row.userCode)
          ">{{ scope.row.money }}</span>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-select
          v-model="scope.row.select"
          class="celectSpeac"
          clearable
          placeholder="操作"
          @change="
            changeSelet(
              scope.row.userId,
              scope.row.select,
              scope.row.userCode,
              scope.row
            )
          "
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
        <el-select v-model="scope.row.select" class="celectSpeac" clearable placeholder="操作" @change="
          changeSelet(
            scope.row.userId,
            scope.row.select,
            scope.row.userCode,
            scope.row
          )
          ">
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
        <!-- <el-button type="primary"
@@ -79,21 +60,15 @@
      </template>
    </avue-crud>
    <!-- 弹窗, 新增 / 修改 -->
    <add-or-update
      v-if="addOrUpdateVisible"
      ref="addOrUpdate"
      @refreshDataList="getDataList"
    ></add-or-update>
    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
    <!-- 弹窗, 新增 / 修改 -->
    <otherdate
      v-if="otherdateVisible"
      ref="otherdate"
      @refreshDataList="getDataList"
    ></otherdate>
    <otherdate v-if="otherdateVisible" ref="otherdate" @refreshDataList="getDataList"></otherdate>
    <!-- 参数管理 -->
    <parameters v-if="parametersFlag" ref="parameters"> </parameters>
    <!-- 参数管理 -->
    <parameters2 v-if="parametersFlag2" ref="parameters2"> </parameters2>
    <!-- 参数管理 -->
    <parameters3 v-if="parametersFlag3" ref="parameters3"> </parameters3>
  </div>
</template>
<script>
@@ -102,9 +77,11 @@
import otherdate from "./mangr-other-update";
import parameters from "./grid-parameters";
import parameters2 from "./property-parameters";
import parameters3 from "./bi-parameters";
export default {
  data() {
    return {
      parametersFlag3: false,
      parametersFlag2: false,
      parametersFlag: false,
      dataList: [],
@@ -172,6 +149,7 @@
    otherdate,
    parameters,
    parameters2,
    parameters3,
  },
  methods: {
    // 获取数据列表
@@ -272,8 +250,8 @@
      var userIds = id
        ? [id]
        : this.dataListSelections.map((item) => {
            return item.userId;
          });
          return item.userId;
        });
      this.$confirm(
        `确定对[id=${userIds.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
        "提示",
@@ -299,7 +277,7 @@
            });
          });
        })
        .catch(() => {});
        .catch(() => { });
    },
    searchName(row) {
      //this.userNamevisible = true
@@ -315,6 +293,12 @@
        this.$refs.parameters2.init(row);
      });
    },
    lookBi(row) {
      this.parametersFlag3 = true;
      this.$nextTick(() => {
        this.$refs.parameters3.init(row);
      });
    },
  },
};
</script>
@@ -324,13 +308,16 @@
::v-deep .celectSpeac .el-input__inner {
  background: #1c4efa !important;
}
::v-deep .celectSpeac .el-input__inner::placeholder {
  color: #fff;
}
.speacButton {
  color: rgb(69, 147, 235);
  cursor: pointer;
}
.speacButton:hover {
  color: #356ced;
}