|
|
@@ -1,108 +1,54 @@
|
|
|
-import BasicTable from '@/components/Table'
|
|
|
-import consts from '@/consts'
|
|
|
-import { queryCompany } from '@/services/customer'
|
|
|
-import { refactorSortField } from '@/utils/utils'
|
|
|
-import React from 'react'
|
|
|
+// import * as echarts from 'echarts/core'
|
|
|
+// import { useEffect } from 'react'
|
|
|
+// // 引入柱状图图表,图表后缀都为 Chart
|
|
|
+// import { BarChart } from 'echarts/charts'
|
|
|
+// // 引入提示框,标题,直角坐标系,数据集,内置数据转换器组件,组件后缀都为 Component
|
|
|
+// import {
|
|
|
+// TitleComponent,
|
|
|
+// TooltipComponent,
|
|
|
+// GridComponent,
|
|
|
+// DatasetComponent,
|
|
|
+// DatasetComponentOption,
|
|
|
+// TransformComponent
|
|
|
+// } from 'echarts/components'
|
|
|
+// // 标签自动布局,全局过渡动画等特性
|
|
|
+// import { LabelLayout, UniversalTransition } from 'echarts/features'
|
|
|
+// // 引入 Canvas 渲染器,注意引入 CanvasRenderer 或者 SVGRenderer 是必须的一步
|
|
|
+// import { CanvasRenderer } from 'echarts/renderers'
|
|
|
|
|
|
-export default function Index() {
|
|
|
- const columns = [
|
|
|
- {
|
|
|
- title: '客户名称',
|
|
|
- dataIndex: 'companyName',
|
|
|
- width: 150,
|
|
|
- fixed: 'left',
|
|
|
- sorter: true
|
|
|
- },
|
|
|
- {
|
|
|
- title: '地区',
|
|
|
- dataIndex: 'districtName',
|
|
|
- width: 100
|
|
|
- },
|
|
|
- {
|
|
|
- title: '客户电话',
|
|
|
- dataIndex: 'phone',
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '联系人',
|
|
|
- dataIndex: 'clientTotal',
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '客户性质',
|
|
|
- dataIndex: 'nature',
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '客户地址',
|
|
|
- dataIndex: 'address',
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '客户传真',
|
|
|
- dataIndex: 'fax',
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '网址',
|
|
|
- dataIndex: 'webservice',
|
|
|
- search: false,
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '乘车路线',
|
|
|
- dataIndex: 'ride',
|
|
|
- search: false,
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '地标建筑',
|
|
|
- dataIndex: 'landmarks',
|
|
|
- search: false,
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '参考住宿',
|
|
|
- dataIndex: 'stay',
|
|
|
- search: false,
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '备注',
|
|
|
- dataIndex: 'remarks',
|
|
|
- search: false,
|
|
|
- width: 80
|
|
|
- },
|
|
|
- {
|
|
|
- title: '创建人',
|
|
|
- dataIndex: 'staffName',
|
|
|
- search: false,
|
|
|
- width: 80
|
|
|
- }
|
|
|
- ]
|
|
|
- return (
|
|
|
- <BasicTable
|
|
|
- resizable={true}
|
|
|
- columns={columns}
|
|
|
- rowKey={row => row.id}
|
|
|
- search={false}
|
|
|
- headerTitle="客户列表"
|
|
|
- mainMenuType="customer"
|
|
|
- columnStateType="COMPANY"
|
|
|
- rowSelection={{
|
|
|
- type: 'checkbox',
|
|
|
- columnWidth: 25
|
|
|
- }}
|
|
|
- request={async (params, sort, filter) => {
|
|
|
- const srotOrder = refactorSortField(sort)
|
|
|
- const { code = -1, data: { customer = [], total = 0 } = { customer: [], total: 0 } } =
|
|
|
- await queryCompany({ ...params, ...srotOrder, ...filter })
|
|
|
- return {
|
|
|
- data: customer,
|
|
|
- success: code === consts.RET_CODE.SUCCESS,
|
|
|
- total
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
- )
|
|
|
-}
|
|
|
+// // 注册必须的组件
|
|
|
+// echarts.use([
|
|
|
+// TitleComponent,
|
|
|
+// TooltipComponent,
|
|
|
+// GridComponent,
|
|
|
+// DatasetComponent,
|
|
|
+// TransformComponent,
|
|
|
+// BarChart,
|
|
|
+// LabelLayout,
|
|
|
+// UniversalTransition,
|
|
|
+// CanvasRenderer
|
|
|
+// ])
|
|
|
+
|
|
|
+// export default function Index() {
|
|
|
+// useEffect(() => {
|
|
|
+// const myChart = echarts.init(document.getElementById('mian11'))
|
|
|
+// myChart.setOption({
|
|
|
+// title: {
|
|
|
+// text: 'ECharts 入门示例'
|
|
|
+// },
|
|
|
+// tooltip: {},
|
|
|
+// xAxis: {
|
|
|
+// data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
|
|
|
+// },
|
|
|
+// yAxis: {},
|
|
|
+// series: [
|
|
|
+// {
|
|
|
+// name: '销量',
|
|
|
+// type: 'bar',
|
|
|
+// data: [5, 20, 36, 10, 10, 20]
|
|
|
+// }
|
|
|
+// ]
|
|
|
+// })
|
|
|
+// }, [])
|
|
|
+// return <div id="mian11" style={{ width: '300px', height: '500px' }} />
|
|
|
+// }
|