| | |
| | | </div> |
| | | |
| | | <div class="order_list" v-if="activeName == '0'"> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | height="100%" |
| | | size="small" |
| | | empty-text="No Data" |
| | | @row-click="Choice" |
| | | > |
| | | <el-table :data="tableData" style="width: 100%" height="100%" size="small" empty-text="No Data" |
| | | @row-click="Choice"> |
| | | <el-table-column prop="stockSpell" :label="$t('hj313')"> |
| | | <template slot-scope="scope"> |
| | | <el-tag |
| | | :type="scope.row.stockGid != $mc ? 'success' : ''" |
| | | size="small" |
| | | style="margin-right: 8px" |
| | | > |
| | | <el-tag :type="scope.row.stockGid != $mc ? 'success' : ''" size="small" style="margin-right: 8px"> |
| | | {{ scope.row.stockGid }} |
| | | </el-tag> |
| | | <span>{{ scope.row.stockName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="positionType" |
| | | :label="`${$t('hj313')} ${$t('類型')}`" |
| | | > |
| | | <el-table-column prop="positionType" :label="`${$t('hj313')} ${$t('類型')}`"> |
| | | <template slot-scope="scope"> |
| | | <el-tag type="warning"> |
| | | {{ dictionary.gplx[scope.row.positionType] }} |
| | |
| | | |
| | | <el-table-column prop="profitAndLoseParent" :label="$t('Profit')"> |
| | | <template slot-scope="scope"> |
| | | <span |
| | | :class="`${ |
| | | scope.row.profitAndLose < 0 |
| | | ? 'r_c' |
| | | : scope.row.profitAndLose > 0 |
| | | ? 'lc_c' |
| | | : '' |
| | | }`" |
| | | > |
| | | <span :class="`${scope.row.profitAndLose < 0 |
| | | ? 'r_c' |
| | | : scope.row.profitAndLose > 0 |
| | | ? 'lc_c' |
| | | : '' |
| | | }`"> |
| | | {{ scope.row.profitAndLose }} ({{ |
| | | scope.row.profitAndLoseParent |
| | | }}) |
| | |
| | | </div> |
| | | |
| | | <div class="order_list" v-else-if="activeName == '1'"> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | height="100%" |
| | | size="small" |
| | | empty-text="No Data" |
| | | @row-click="Choice" |
| | | > |
| | | <el-table :data="tableData" style="width: 100%" height="100%" size="small" empty-text="No Data" |
| | | @row-click="Choice"> |
| | | <el-table-column prop="stockCode" :label="$t('sc')" width="130"> |
| | | </el-table-column> |
| | | |
| | |
| | | |
| | | <el-table-column prop="stockSpell" :label="$t('hj313')" min-width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-tag |
| | | :type="scope.row.stockGid != $mc ? 'success' : ''" |
| | | size="small" |
| | | style="margin-right: 8px" |
| | | > |
| | | <el-tag :type="scope.row.stockGid != $mc ? 'success' : ''" size="small" style="margin-right: 8px"> |
| | | {{ scope.row.stockGid }} |
| | | </el-tag> |
| | | <span>{{ scope.row.stockName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="positionType" |
| | | :label="`${$t('hj313')} ${$t('類型')}`" |
| | | width="150" |
| | | > |
| | | <el-table-column prop="positionType" :label="`${$t('hj313')} ${$t('類型')}`" width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-tag type="warning"> |
| | | {{ dictionary.gplx[scope.row.positionType] }} |
| | |
| | | 1 |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="orderNum" |
| | | :label="$t('sl')" |
| | | width="100" |
| | | ></el-table-column> |
| | | <el-table-column prop="orderNum" :label="$t('sl')" width="100"></el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="profitAndLoseParent" |
| | | :label="$t('Profit')" |
| | | width="130" |
| | | > |
| | | <el-table-column prop="profitAndLoseParent" :label="$t('Profit')" width="130"> |
| | | <template slot-scope="scope"> |
| | | <span |
| | | :class="`${ |
| | | scope.row.profitAndLose < 0 |
| | | ? 'r_c' |
| | | : scope.row.profitAndLose > 0 |
| | | ? 'lc_c' |
| | | : '' |
| | | }`" |
| | | > |
| | | <span :class="`${scope.row.profitAndLose < 0 |
| | | ? 'r_c' |
| | | : scope.row.profitAndLose > 0 |
| | | ? 'lc_c' |
| | | : '' |
| | | }`"> |
| | | {{ scope.row.profitAndLose }} ({{ |
| | | scope.row.profitAndLoseParent |
| | | }}) |
| | |
| | | </div> |
| | | |
| | | <div class="pagination_box"> |
| | | <el-pagination |
| | | background |
| | | layout="prev, pager, next" |
| | | :total="total" |
| | | :current-page="pageNum" |
| | | :page-size="pageSize" |
| | | @current-change="handleCurrentChange" |
| | | > |
| | | <el-pagination background layout="prev, pager, next" :total="total" :current-page="pageNum" :page-size="pageSize" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | let teimss2 = null; // 轮询获取持仓数据计时器 |
| | | import mixins from "@/mixins/myMixins"; // 混入 |
| | | import * as api from "@/axios/api"; |
| | | export default { |
| | |
| | | this.opt.state = this.activeName; |
| | | this.apiInterface = api.getchicang; |
| | | this.init(); |
| | | this.LoopGetList(); |
| | | }, |
| | | beforeDestroy() { |
| | | clearInterval(teimss2); |
| | | }, |
| | | methods: { |
| | | handleClick() { |
| | | this.opt.state = this.activeName; |
| | | this.tableData = []; |
| | | this.init(); |
| | | this.LoopGetList(); |
| | | }, |
| | | // 刷新轮询获取持仓数据 |
| | | LoopGetList() { |
| | | clearInterval(teimss2); |
| | | // 如果状态为1,则不进行轮询 |
| | | if (this.opt.state == '1') return |
| | | teimss2 = setInterval(() => { |
| | | this.getList(); |
| | | }, 3000); |
| | | }, |
| | | // 股票选择 |
| | | Choice(val) { |
| | |
| | | justify-content: flex-end; |
| | | padding: 10px; |
| | | } |
| | | |
| | | .order_list { |
| | | height: 0; |
| | | flex: 1; |