10.10综合交易所原始源码-管理后台
1
admin
2026-01-07 e1e694369dabf557615669ce2f71e9af70277ff6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<template>
  <el-dialog
    title="新增"
    :close-on-click-modal="false"
    width="800px"
    :visible.sync="visible"
  >
    <el-form
      :model="dataForm"
      :rules="dataRule"
      ref="dataForm"
      @keyup.enter.native="dataFormSubmit()"
      label-width="100px"
    >
          <el-form-item label="矿机" prop="algorithm">
            <el-select
              class="speaInputTwo"
              v-model="dataForm.algorithm"
              placeholder="请选择"
              @change="changeVal(dataForm.algorithm)"
            >
              <el-option
                v-for="item in algorithms"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          
 
          <!---->
          <el-row>
            <el-col :span="11">
              <el-form-item label="投资金额区间" prop="investment_min">
                <el-input disabled v-model="investment_min" placeholder="">
                  <template v-slot:append>
                    <span>USDT</span>
                  </template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="2">          
              <el-form-item label="— —" prop="">
              </el-form-item></el-col>
            <el-col :span="11">
              <el-form-item label="" prop="investment_max">
                <el-input disabled v-model="investment_max"  placeholder="">
                  <template v-slot:append>
                    <span>USDT</span>
                  </template>
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <!---->
 
          <el-form-item label="用户uid" prop="para_uid">
            <el-input
              v-model="dataForm.para_uid"
              placeholder="用户uid"
            ></el-input>
          </el-form-item>
          <el-form-item label="投资金额" prop="para_amount">
            <el-input
              v-model="dataForm.para_amount"
              placeholder="投资金额"
            ><template v-slot:append>
                <span>USDT</span>
              </template></el-input>
          </el-form-item>
     
 
      <!-- <el-form-item  label="登录人资金密码"  prop="login_safeword">
        <el-input v-model="dataForm.login_safeword" type="password" placeholder="请输入登录人资金密码"></el-input>
      </el-form-item> -->
 
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>
<script>
import { encrypt } from "@/utils/crypto";
import { Debounce } from "@/utils/debounce";
export default {
  data() {
    return {
      investment_min:"",
      investment_max:"",
      visible: false,
      dataForm: {
        id: 0,
        roleName: "",
        remark: "",
        name: "",
        state: "",
        computing_power_unit:'',
      },
      all:{},
      algorithms: [
        {
          label: "EtHash",
          value: "EtHash",
        },
        {
          label: "EquiHash",
          value: "EquiHash",
        },
        {
          label: "Kadena",
          value: "Kadena",
        },
        {
          label: "EthHash",
          value: "EthHash",
        },
      ],
      dataRule: {
        algorithm: [
          { required: true, message: "不能为空", trigger: "blur" },
        ],
        para_uid: [
            { required: true, message: '不能为空', trigger: 'blur' },
        ],
        para_amount: [
            { required: true, message: '不能为空', trigger: 'blur' },
        ],
      },
      tempKey: -666666, // 临时key, 用于解决tree半选中状态项不能传给后台接口问题. # 待优化
    };
  },
  methods: {
    init(row) {
      this.dataForm = {};
      // if(row){
      //   this.dataForm = row;
      // }  
      this.listMiningOrder();
     
    },
    changeVal(val) {
      console.log(val);
      let data = this.all[val];
      this.investment_min = data.investment_min;
      this.investment_max = data.investment_max;
    },
    listMiningOrder(){
      //
      this.algorithms = []
      this.all = {}
      this.$http({
            url: this.$http.adornUrl(`/normal/adminMinerOrderAction!toAddOrder.action`),
            method: "get",
            params: this.$http.adornParams({
            }),
      }).then(({ data }) => {
        
        let list = data.data.miner_list;
        for(let i = 0 ; i < list.length ; i++){
          let data = list[i];
          this.algorithms[i] = {label:data.name,value:data.uuid}
 
          this.all[data.uuid] = data;
        }
        console.log("listMiningOrder => " + JSON.stringify(this.algorithms));
        this.visible = true;
 
      });
      //
    },
    // 表单提交
    dataFormSubmit: Debounce(function () {
      this.$refs["dataForm"].validate((valid) => {
        if (valid) {
          this.$http({
            url: this.$http.adornUrl(`/normal/adminMinerOrderAction!addOrder.action`),
            method: "get",
            params: this.$http.adornParams({
              para_uid:this.dataForm.para_uid,
              para_amount:this.dataForm.para_amount,
              para_minerid:this.dataForm.algorithm,
              session_token:"",
            }),
          }).then(({ data }) => {
            console.log("data => " + JSON.stringify(data));
            if(data.code==0){
              //
              this.$message({
                message: "操作成功",
                type: "success",
                duration: 1500,
                onClose: () => {
                  this.visible = false;
                  this.$emit("refreshDataList");
                },
              });
              //
            }else{
              this.$message({
                message: data.msg,
                type: 'error',
                duration: 1500,
                onClose: () => {
                }
              })
              //
            }
 
          });
        }
      });
    }),
  },
};
</script>
<style scoped>
.speaInputTwo{
  width: 660px;
}
.titleDivTwo {
  height: 40px;
  border-left: 3px solid #1c4efa;
  background: #f4f7ff;
}
.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;
}
</style>