| | |
| | | <span slot="stockType" slot-scope="text, record"> |
| | | <template> |
| | | <div> |
| | | <a-tag color="red" |
| | | <a-tag |
| | | color="red" |
| | | >{{ |
| | | record.stockType == 'sz' |
| | | ? '深股' |
| | |
| | | <span slot="nowPrice" slot-scope="text, record"> |
| | | <template> |
| | | <div> |
| | | <a-tag :color="record.hcrate < 0 ? 'green' : record.hcrate > 0 ? 'red' : ''" |
| | | <a-tag |
| | | :color="record.hcrate < 0 ? 'green' : record.hcrate > 0 ? 'red' : ''" |
| | | >{{ Number(record.nowPrice).toFixed(2) }} |
| | | </a-tag> |
| | | </div> |
| | |
| | | title: '股票名称 / 股票代码', |
| | | dataIndex: 'stockName', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'stockName' }, |
| | | scopedSlots: { customRender: 'stockName' } |
| | | }, |
| | | // { |
| | | // title: '沪深京股', |
| | |
| | | title: '现价', |
| | | dataIndex: 'nowPrice', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'nowPrice' }, |
| | | scopedSlots: { customRender: 'nowPrice' } |
| | | }, |
| | | { |
| | | title: '涨跌幅', |
| | | dataIndex: 'hcrate', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'hcrate' }, |
| | | scopedSlots: { customRender: 'hcrate' } |
| | | }, |
| | | // { |
| | | // title: '最近3天涨跌', |
| | |
| | | title: '显示状态', |
| | | dataIndex: 'isShow', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'isShow' }, |
| | | scopedSlots: { customRender: 'isShow' } |
| | | }, |
| | | { |
| | | title: '股票状态', |
| | | dataIndex: 'isLock', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'isLock' }, |
| | | scopedSlots: { customRender: 'isLock' } |
| | | }, |
| | | { |
| | | title: '添加时间', |
| | |
| | | align: 'center', |
| | | customRender: (text, row, index) => { |
| | | return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '' |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | title: '操作', |
| | | key: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | }, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | // 表头 |
| | | pagination: { |
| | |
| | | pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据 |
| | | onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示 |
| | | onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件 |
| | | showTotal: (total) => `共有 ${total} 条数据`, // 分页中显示总的数据 |
| | | showTotal: (total) => `共有 ${total} 条数据` // 分页中显示总的数据 |
| | | }, |
| | | loading: false, |
| | | queryParam: { |
| | |
| | | stockPlate: 'A股', |
| | | stockType: undefined, |
| | | showState: undefined, |
| | | lockState: undefined, |
| | | lockState: undefined |
| | | }, |
| | | datalist: [], |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 7 }, |
| | | sm: { span: 7 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 13 }, |
| | | sm: { span: 13 } |
| | | }, |
| | | addUserform: this.$form.createForm(this), |
| | | addUserdialog: false, |
| | |
| | | editStockdialogloading: false, |
| | | editStockform: this.$form.createForm(this), |
| | | fields: ['stockName', 'spreadRate'], |
| | | currentid: '', |
| | | currentid: '' |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | stockPlate: 'A股', |
| | | stockType: undefined, |
| | | showState: undefined, |
| | | lockState: undefined, |
| | | lockState: undefined |
| | | } |
| | | }, |
| | | getinit() { |
| | |
| | | this.pagination.current = page |
| | | this.queryParam.pageSize = pageSize |
| | | this.getlist() |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |