diff --git a/src/packages/components/Tables/Tables/TablesBasic/config.ts b/src/packages/components/Tables/Tables/TablesBasic/config.ts new file mode 100644 index 00000000..eeca61bd --- /dev/null +++ b/src/packages/components/Tables/Tables/TablesBasic/config.ts @@ -0,0 +1,35 @@ +import cloneDeep from 'lodash/cloneDeep' +import { PublicConfigClass } from '@/packages/public' +import { CreateComponentType } from '@/packages/index.d' +import { chartInitConfig } from '@/settings/designSetting' +import { TablesBasicConfig } from './index' +import dataJson from './data.json' + +const {dimensions,source} = dataJson +export const option = { + dataset:{dimensions,source}, + pagination:{ + page: 1, + pageSize:5 + }, + align:'center', + style:{ + border:'on', + singleColumn:'off', + singleLine:'off', + bottomBordered:'on', + striped:'on', + fontSize:16, + borderWidth:0, + borderColor:'black', + borderStyle:'solid' + }, + inputShow:"none" +} + +export default class Config extends PublicConfigClass implements CreateComponentType { + public key = TablesBasicConfig.key + public attr = { ...chartInitConfig, w: 600, h: 300, zIndex: -1 } + public chartConfig = cloneDeep(TablesBasicConfig) + public option = cloneDeep(option) +} diff --git a/src/packages/components/Tables/Tables/TablesBasic/config.vue b/src/packages/components/Tables/Tables/TablesBasic/config.vue new file mode 100644 index 00000000..10b06699 --- /dev/null +++ b/src/packages/components/Tables/Tables/TablesBasic/config.vue @@ -0,0 +1,156 @@ + + + diff --git a/src/packages/components/Tables/Tables/TablesBasic/data.json b/src/packages/components/Tables/Tables/TablesBasic/data.json new file mode 100644 index 00000000..6d671fb6 --- /dev/null +++ b/src/packages/components/Tables/Tables/TablesBasic/data.json @@ -0,0 +1,60 @@ +{ + "dimensions":[ + { + "title": "产品名称", + "key": "productName" + }, + { + "title": "产品销量(万)", + "key": "totalSum" + }, + { + "title": "销售额(万)", + "key": "totalAmount" + } + ], + "source":[ + { + "key": 0, + "productName": "产品A1", + "totalSum": 10, + "totalAmount": 10 + }, + { + "key": 1, + "productName": "产品B1", + "totalSum": 10, + "totalAmount": 10 + }, + { + "key": 2, + "productName": "产品C1", + "totalSum": 10, + "totalAmount": 10 + }, + { + "key": 3, + "productName": "产品D1", + "totalSum": 10, + "totalAmount": 10 + }, + { + "key": 4, + "productName": "产品A2", + "totalSum": 10, + "totalAmount": 10 + }, + { + "key": 5, + "productName": "产品D2", + "totalSum": 10, + "totalAmount": 10 + }, + { + "key": 6, + "productName": "产品A3", + "totalSum": 10, + "totalAmount": 10 + } + ] +} \ No newline at end of file diff --git a/src/packages/components/Tables/Tables/TablesBasic/index.ts b/src/packages/components/Tables/Tables/TablesBasic/index.ts new file mode 100644 index 00000000..5abe033a --- /dev/null +++ b/src/packages/components/Tables/Tables/TablesBasic/index.ts @@ -0,0 +1,14 @@ +import { ConfigType, PackagesCategoryEnum, ChartFrameEnum } from '@/packages/index.d' +import { ChatCategoryEnum, ChatCategoryEnumName } from '../../index.d' + +export const TablesBasicConfig: ConfigType = { + key: 'TablesBasic', + chartKey: 'VTablesBasic', + conKey: 'VCTablesBasic', + title: '基础表格', + category: ChatCategoryEnum.TABLE, + categoryName: ChatCategoryEnumName.TABLE, + package: PackagesCategoryEnum.TABLES, + chartFrame: ChartFrameEnum.COMMON, + image: 'tables_list.png' +} diff --git a/src/packages/components/Tables/Tables/TablesBasic/index.vue b/src/packages/components/Tables/Tables/TablesBasic/index.vue new file mode 100644 index 00000000..5dcd2901 --- /dev/null +++ b/src/packages/components/Tables/Tables/TablesBasic/index.vue @@ -0,0 +1,91 @@ + + + + + diff --git a/src/packages/components/Tables/Tables/index.ts b/src/packages/components/Tables/Tables/index.ts index dbad93ec..45ca3a63 100644 --- a/src/packages/components/Tables/Tables/index.ts +++ b/src/packages/components/Tables/Tables/index.ts @@ -1,4 +1,5 @@ import { TableListConfig } from './TableList' import { TableScrollBoardConfig } from './TableScrollBoard' +import { TablesBasicConfig } from "./TablesBasic/index"; -export default [TableListConfig, TableScrollBoardConfig] +export default [TableListConfig, TableScrollBoardConfig,TablesBasicConfig]