新版交易所前段管理后台
1
jhzh
9 days ago 3c9801025acf79edd3c8dc78451752e0c5d8435f
src/views/modules/mining/mining.vue
@@ -7,25 +7,25 @@
      :option="tableOption"
      @search-change="searchChange"
      @selection-change="selectionChange"
      :cell-class-name="addClasscolor"
      @on-load="getDataList"
    >
      <template slot-scope="scope" slot="investment_min">
        <span>{{ scope.row.investment_min }}</span>-<span>{{ scope.row.investment_max }}</span>
      </template>
      <template slot-scope="scope" slot="buy_currencym">
        <span>{{ scope.row.buy_currency.toUpperCase() }}</span>
      </template>
      <template slot-scope="scope" slot="output_currencym">
        <span>{{ scope.row.output_currency.toUpperCase() }}</span>
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button
          type="primary"
          icon="el-icon-edit"
          size="small"
          v-if="isAuth('sys:role:update')"
          @click.stop="addOrUpdateHandle(scope.row.roleId)"
          @click.stop="addOrUpdateHandle(scope.row)"
          >编辑</el-button
        >
        <el-button
          type="danger"
          icon="el-icon-delete"
          size="small"
          v-if="isAuth('sys:role:delete')"
          @click.stop="deleteHandle(scope.row.roleId)"
          >删除</el-button
        >
      </template>
    </avue-crud>
@@ -44,6 +44,7 @@
export default {
  data() {
    return {
      searchParams:{},
      dataForm: {},
      dataList: [],
      dataListLoading: false,
@@ -62,7 +63,7 @@
  },
  methods: {
    // 获取数据列表
    getDataList(page, params, done) {
    getDataList(page, done) {
      let obj = {
        current: 1,
        endTime: "",
@@ -75,29 +76,44 @@
      this.dataListLoading = true;
      this.$http({
        url: this.$http.adornUrl("/moneylog/list"),
        method: "post",
        data: this.$http.adornData({
        url: this.$http.adornUrl("/normal/adminMinerAction!list.action"),
        method: "get",
        params: this.$http.adornParams({
          current: this.page.currentPage,
          size: this.page.pageSize,
          rolename: this.dataForm.rolename,
          userCode: this.dataForm.userCode,
          userId: this.dataForm.userId,
          startTime: this.dataForm.startTime,
          endTime: this.dataForm.endTime,
          ...this.searchParams,
        }),
      }).then(({ data }) => {
        this.dataList = data.data.records;
        this.page.total = data.total;
        console.log("data => " + JSON.stringify(data));
        this.dataList = data.data.page.records;
        this.page.total = data.data.page.pages;
        this.dataListLoading = false;
        if (done) {
          done();
        }
      });
    },
    addClasscolor({ column, row }) {//表单样式
      if (
        (column.property === "on_sale" && row.on_sale*1 == 1)
      ) {
        return "green";
      } else if (
        (column.property === "on_sale" && row.on_sale*1 == 0)
      ) {
        return "red";
      } else {
        return "";
      }
    },
    // 条件查询
    searchChange(params, done) {
      this.getDataList(this.page, params, done);
      this.page.currentPage = 1; // 重置当前页为第一页
      if(params["name"]){
        params["name_para"] = params["name"]
      }
      this.searchParams = params;
      this.getDataList(this.page, done);
    },
    // 多选变化
    selectionChange(val) {