| | |
| | | <template> |
| | | <el-drawer |
| | | :title="$t('hj2')" |
| | | :visible.sync="dialogVisible" |
| | | direction="rtl" |
| | | :before-close="onClose" |
| | | size="980px" |
| | | > |
| | | <el-drawer :title="$t('hj2')" :visible.sync="dialogVisible" direction="rtl" :before-close="onClose" size="980px"> |
| | | <div class="drawer-content"> |
| | | <el-table |
| | | height="100%" |
| | | :data="tableData" |
| | | style="width: 100%; flex: 1" |
| | | empty-text="No Data" |
| | | > |
| | | <el-table height="100%" :data="tableData" style="width: 100%; flex: 1" empty-text="No Data"> |
| | | <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 |
| | | <span :class="`${scope.row.profitAndLose < 0 |
| | | ? 'r_c' |
| | | : scope.row.profitAndLose > 0 |
| | | ? 'lc_c' |
| | | : '' |
| | | }`" |
| | | > |
| | | }`"> |
| | | {{ scope.row.profitAndLose }} ({{ |
| | | scope.row.profitAndLoseParent |
| | | }}) |
| | |
| | | </el-table> |
| | | |
| | | <div class="pagination flex-end"> |
| | | <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 times = null; // 计时器 |
| | | import mixins from "@/mixins/myMixins"; // 混入 |
| | | import * as api from "@/axios/api"; |
| | | export default { |
| | |
| | | this.opt.stockType = this.type; |
| | | this.apiInterface = api.getchicang; // 赋值接口 |
| | | this.init(); // 获取记录列表 |
| | | |
| | | this.stopTimer() |
| | | times = setInterval(() => { |
| | | this.getList() |
| | | }, 3000) |
| | | }, |
| | | methods: { |
| | | // 关闭弹窗 |
| | |
| | | this.$emit("update:dialogVisible", false); |
| | | this.$emit("onClose"); // 关闭弹窗时,通知父组件 |
| | | }, |
| | | stopTimer() { |
| | | if (times) { |
| | | clearInterval(times); |
| | | times = null; |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |