大宝管理后台代码
xxx
dcc
2024-05-07 abcf89c0931fc453f4fd8e1d4d48b8b469d0f3c7
src/views/product/baseCurrency.vue
@@ -23,7 +23,7 @@
                    icon="search"
                    style="margin-left: 8px"
                    @click=";(queryParam.pageNum = 1), getlist()"
                    >查询
                  >查询
                  </a-button>
                  <a-button
@@ -135,7 +135,7 @@
import pick from 'lodash.pick'
export default {
  name: 'Basecurrency',
  data() {
  data () {
    return {
      columns: [
        {
@@ -145,34 +145,34 @@
          width: 200,
          customRender: (text, row, index) => {
            return `${row.coinName}(${row.coinCode})`
          },
          }
        },
        {
          title: '基础货币Gid',
          dataIndex: 'coinGid',
          align: 'center',
          align: 'center'
        },
        {
          title: '当前汇率',
          dataIndex: 'nowPrice',
          align: 'center',
          align: 'center'
        },
        {
          title: '默认汇率',
          dataIndex: 'defaultRate',
          align: 'center',
          align: 'center'
        },
        {
          title: '汇率使用',
          dataIndex: 'dynamicRate',
          align: 'center',
          scopedSlots: { customRender: 'dynamicRate' },
          scopedSlots: { customRender: 'dynamicRate' }
        },
        {
          title: '是否可用',
          dataIndex: 'isUse',
          align: 'center',
          scopedSlots: { customRender: 'isUse' },
          scopedSlots: { customRender: 'isUse' }
        },
        {
          title: '添加时间',
@@ -181,7 +181,7 @@
          width: 180,
          customRender: (text, row, index) => {
            return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
          },
          }
        },
        {
          title: '操作',
@@ -189,8 +189,8 @@
          align: 'center',
          fixed: 'right',
          width: 150,
          scopedSlots: { customRender: 'action' },
        },
          scopedSlots: { customRender: 'action' }
        }
      ],
      // 表头
      pagination: {
@@ -200,14 +200,14 @@
        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: {
        pageNum: 1,
        pageSize: 10,
        coinCode: '',
        coinName: '',
        coinName: ''
      },
      datalist: [],
@@ -216,32 +216,32 @@
      addUserform: this.$form.createForm(this),
      labelCol: {
        xs: { span: 24 },
        sm: { span: 7 },
        sm: { span: 7 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 13 },
        sm: { span: 13 }
      },
      fields: ['coinName', 'coinCode', 'defaultRate', 'dynamicRate', 'isUse'],
      currentDetails: '',
      currentDetails: ''
    }
  },
  created() {
  created () {
    this.getlist()
  },
  methods: {
    geteditbaseCurrency(val) {
    geteditbaseCurrency (val) {
      this.currentDetails = val
      this.addUserdialog = true
      this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
      this.addUserform.setFieldsValue(pick(val, this.fields))
    },
    CanceladdUserdialog() {
    CanceladdUserdialog () {
      this.addUserdialog = false
      const form = this.$refs.addUserform.form
      form.resetFields()
    },
    OkaddUserdialog() {
    OkaddUserdialog () {
      const form = this.$refs.addUserform.form
      form.validateFields((errors, values) => {
        if (!errors) {
@@ -277,15 +277,15 @@
        }
      })
    },
    getqueryParam() {
    getqueryParam () {
      this.queryParam = {
        pageNum: 1,
        pageSize: 10,
        coinCode: '',
        coinName: '',
        coinName: ''
      }
    },
    getlist() {
    getlist () {
      this.loading = true
      coinlist(this.queryParam).then((res) => {
        this.datalist = res.data.list
@@ -293,16 +293,16 @@
        this.loading = false
      })
    },
    onPageChange(page, pageSize) {
    onPageChange (page, pageSize) {
      this.queryParam.pageNum = page
      this.getlist()
    },
    onSizeChange(current, pageSize) {
    onSizeChange (current, pageSize) {
      this.queryParam.pageNum = current
      this.queryParam.pageSize = pageSize
      this.getlist()
    },
  },
    }
  }
}
</script>
<style scoped>