|
@@ -0,0 +1,91 @@
|
|
|
+<template>
|
|
|
+ <div style="overflow: hidden; width: 100%; height: 600px">
|
|
|
+ <vxe-grid v-bind="gridOptions">
|
|
|
+
|
|
|
+ <template #name_default="{ row }">
|
|
|
+ <vxe-button type="text" @click="openDetail(row)">点击{{ row.name }}</vxe-button>
|
|
|
+ </template>
|
|
|
+ <template #sex_default="{ row }">
|
|
|
+ <span>{{ formatSex(row) }}</span>
|
|
|
+ </template>
|
|
|
+ </vxe-grid>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { reactive } from 'vue'
|
|
|
+import { VXETable } from 'vxe-table'
|
|
|
+
|
|
|
+const gridOptions = reactive({
|
|
|
+ height: "auto",
|
|
|
+ border: false,
|
|
|
+ round: true,
|
|
|
+ columnConfig: {
|
|
|
+ resizable: true
|
|
|
+ },
|
|
|
+ toolbarConfig: {
|
|
|
+ custom: true,
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ { field: 'name', title: 'Name', align: 'center', width: 130, slots: { default: 'name_default' } },
|
|
|
+ { field: 'sex', title: 'Sex', align: 'center', width: 80, slots: { default: 'sex_default' } },
|
|
|
+ { field: 'name', title: '产品线', align: 'left', fixed: 'left', width: 180, sortable: true },
|
|
|
+ { field: 'sex', title: '总销售额', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'age', title: '总订单数', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'time', title: '总销量', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '单均价', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '广告销售额', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '本商品广告销售额', align: 'right', width: 180, sortable: true },
|
|
|
+ { field: 'address', title: '广告订单数', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '本商品广告订单数', align: 'right', width: 180, sortable: true },
|
|
|
+ { field: 'address', title: '广告销量', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '本商品广告销量', align: 'right', width: 180, sortable: true },
|
|
|
+ { field: 'address', title: '花费', align: 'right', width: 130, sortable: true, showOverflow: true },
|
|
|
+ { field: 'address', title: 'ACOS', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: 'ROAS', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: 'TACOS', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '转化率', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '点击率', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '点击成本', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '总订单成本', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '广告订单成本', align: 'right', width: 180, sortable: true },
|
|
|
+ { field: 'address', title: '曝光量', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '点击量', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '会话次数', align: 'right', width: 150, sortable: true },
|
|
|
+ { field: 'address', title: '商品会话百分比', align: 'right', width: 150, sortable: true },
|
|
|
+ { field: 'address', title: '页面浏览量', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: '推荐报价(购买按钮)百分比', align: 'right', width: 180, sortable: true, showHeaderOverflow: true },
|
|
|
+ { field: 'address', title: 'FBA库存', align: 'right', width: 130, sortable: true },
|
|
|
+ { field: 'address', title: 'FBM库存', align: 'right', width: 130, sortable: true, showHeaderOverflow: true },
|
|
|
+ ],
|
|
|
+ data: [
|
|
|
+ { id: 10001, name: 'Test1', role: 'Develop', sex: '0', age: 28, num: 234, address: 'test abc' },
|
|
|
+ { id: 10002, name: 'Test2', role: 'Test', sex: '1', age: 22, num: 34, address: 'Guangzhou' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'Test3', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ { id: 10003, name: 'TestLast', role: 'PM', sex: '0', age: 32, num: 12, address: 'Shanghai' },
|
|
|
+ ],
|
|
|
+})
|
|
|
+const formatSex = (row) => {
|
|
|
+ return row.sex === '1' ? '男' : '女'
|
|
|
+}
|
|
|
+const openDetail = (row) => {
|
|
|
+ VXETable.modal.message({
|
|
|
+ status: 'success',
|
|
|
+ content: `点击了${row.name}`,
|
|
|
+ })
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|