2
PC-20250623MANY\Administrator
2025-09-28 258c7fb2632175f63c7b1602e56721e7f9ca741a
2
3 files modified
21 ■■■■ changed files
src/axios/api.js 5 ●●●●● patch | view | raw | blame | history
src/views/home/components/HomeLb.vue 10 ●●●●● patch | view | raw | blame | history
src/views/home/components/HomeRight.vue 6 ●●●●● patch | view | raw | blame | history
src/axios/api.js
@@ -258,6 +258,11 @@
  return post("/user/sell.do", options);
}
// 用户一键平仓
export function allsell(options) {
  return post("/user/allsell.do", options);
}
// ***用户中心***/
// 用户详情
export function getUserInfo(options) {
src/views/home/components/HomeLb.vue
@@ -8,6 +8,7 @@
    </div>
    <div class="order_list" v-if="activeName == '0'">
      <el-button type="primary" style="margin-left: 16px;" @click="CloseAll">{{ $t("一鍵平倉") }}</el-button>
      <el-table height="100%" :data="tableData" style="width: 100%" size="small" empty-text="No Data"
        @row-click="Choice">
        <el-table-column prop="stockSpell" :label="$t('hj313')">
@@ -229,6 +230,15 @@
        times = null;
      }
    },
    // 一键平仓
    async CloseAll() {
      const res = await api.allsell();
      if (res.status === 0) {
        this.$message.success(res.msg);
      } else {
        this.$message.error(res.msg);
      }
    }
  },
};
</script>
src/views/home/components/HomeRight.vue
@@ -65,7 +65,7 @@
        <div slot="prefix" class="inp_prefix flex-center">{{ $t("sp") }}</div>
      </el-input>
      <el-input v-model="sform.num" style="text-align: end" oninput="value=value.replace(/[^\d.]/g,'')" disabled>
      <el-input v-model="sform.num" style="text-align: end" oninput="value=value.replace(/[^\d.]/g,'')">
        <div slot="prefix" class="inp_prefix flex-center">{{ $t("sl") }}</div>
      </el-input>
@@ -86,8 +86,7 @@
      </div>
      <div class="submit_btns">
        <!-- <div class="bt bt2 flex-center" @click="sell()">{{ $t("hj121") }}</div> -->
        <div class="bt bt2 flex-center" @click="sell()">{{ $t("一鍵平倉") }}</div>
        <div class="bt bt2 flex-center" @click="sell()">{{ $t("hj121") }}</div>
      </div>
    </div>
  </div>
@@ -212,7 +211,6 @@
      let data = await api.findByPostionSn(res);
      if (data.status === 0) {
        this.pages = data.data;
        this.sform.num = data.data.orderNum
      }
    },
    // 平仓