Commit c376bd8f authored by 胡小根's avatar 胡小根

完成styleguide文档左侧导航

parent 0d309c38
### 开发新组件
\ No newline at end of file
### 基本使用
```jsx
<hm-complex-table :schema="{
'model': 'Role',
'modelPlural': 'Roles',
'modelCamel': 'role',
'modelCamelPlural': 'roles',
'modelUnderscore': 'role',
'modelUnderscorePlural': 'roles',
'columns': [
{
'id': 'o121',
'objectId': 'E9AC3A9C-D43B-4384-A7EE-05E60BF711A7',
'name': '姓名',
'code': 'NAME',
'creationDate': '1498990741',
'creator': 'hm20160509',
'modificationDate': '1498997012',
'modifier': 'xjq',
'dataType': 'VARCHAR2(128CHAR)',
'length': '128',
'codeCamel': 'name',
'codeCamelPlural': 'names',
'codeUnderscore': 'name',
'codeUnderscorePlural': 'names',
'type': 'string'
},
{
'id': 'o122',
'objectId': 'A99D5EAB-FE49-4D56-94EE-0CAB2FEC3788',
'name': '描述',
'code': 'DESCRIPTION',
'creationDate': '1498990741',
'creator': 'hm20160509',
'modificationDate': '1498997012',
'modifier': 'xjq',
'dataType': 'CLOB',
'codeCamel': 'description',
'codeCamelPlural': 'descriptions',
'codeUnderscore': 'description',
'codeUnderscorePlural': 'descriptions',
'type': 'string'
},
{
'id': 'o123',
'objectId': '4B3D418C-C2C3-4785-A68A-C54918DE9160',
'name': '创建时间',
'code': 'CREATE_TIME',
'creationDate': '1498990741',
'creator': 'hm20160509',
'modificationDate': '1498997012',
'modifier': 'xjq',
'dataType': 'DATE',
'codeCamel': 'createTime',
'codeCamelPlural': 'createTimes',
'codeUnderscore': 'create_time',
'codeUnderscorePlural': 'create_times',
'type': 'datetime'
},
{
'id': 'o124',
'objectId': '06523D0E-DAF6-4172-AF06-B3B6240EB8CB',
'name': '等级',
'code': 'RANK',
'creationDate': '1498990741',
'creator': 'hm20160509',
'modificationDate': '1498997012',
'modifier': 'xjq',
'dataType': 'NUMBER',
'codeCamel': 'rank',
'codeCamelPlural': 'ranks',
'codeUnderscore': 'rank',
'codeUnderscorePlural': 'ranks',
'type': 'number'
}
]
}"></hm-complex-table>
```
......@@ -50,26 +50,39 @@
import waves from '@/directive/waves' // 水波纹指令
import { parseTime } from '@/utils'
import * as excel from '@/vendor/Export2Excel'
import { Button, Table, TableColumn, Pagination, Loading } from 'element-ui'
/**
* 毫末科技的表格组件.
*
* demo地址: factory.haomo-studio.com/vue-element/#/haomo/components/table
* @author 胡小根
*/
export default {
name: 'HmComplexTable',
// 集成其他组件
extends: {},
extends: {
},
// 使用其它组件
components: {},
components: {
'el-button': Button,
'el-table': Table,
'el-table-column': TableColumn,
'el-pagination': Pagination
},
// 混入公共对象
mixins: [],
props: {
/**
* 组件所使用的表定义schema。表定义schema,请使用 model2codejs 从pdm文件生成schema。
* 对于所有毫末科技的组件,必须传schema,完成数据的交互
* 对于所有毫末科技的组件,必须传schema,完成数据的交互
*/
schema: {
type: Object,
required: true
},
/**
* 搜索过滤选项。默认没有过滤功能。完整的实力为:
* 搜索过滤选项。默认没有过滤功能。完整的示例为:
* {
* "column1": {
* like: '%abc%', 模糊查询,包含字符”abc”
......@@ -141,7 +154,8 @@
}
},
directives: {
waves
waves,
Loading
},
data() {
return {
......@@ -243,6 +257,12 @@
delete filters[tableName]['placeholder']
self.$set(self.listQuery, 'filters', filters)
}
if (!request.defaults.baseURL) {
request.defaults.baseURL = '/org/api'
}
console.log(request.defaults)
console.log(`request.defaults.baseURL: ${request.defaults.baseURL}`)
},
getList() {
const self = this
......
......@@ -8,10 +8,55 @@ const path = require('path')
const utils = require('./build/utils')
// const baseWebpackConfig = require('./build/webpack.base.conf')
console.log(path.join(__dirname, 'src/assets/custom-theme/index.css'))
function resolve(dir) {
return path.join(__dirname, dir)
}
const sections = [
{
name: '概述',
sections: [
{
name: '开发新组件',
content: './docs/styleguide/develop.md'
}
]
},
{
name: '组件',
sections: [
{
name: '列表',
content: './src/views/haomo/components/tables/HmComplexTable.md'
},
{
name: '表单',
content: './src/views/haomo/components/forms/HmComplexForm.md'
},
{
name: '详情',
content: './src/views/haomo/components/details/HmComplexDetail.md'
}
]
},
{
name: '页面',
sections: [
{
name: '登录'
},
{
name: '重置密码'
},
{
name: '忘记密码'
}
]
}
]
module.exports = {
styleguideDir: './dist-styleguide',
components: 'src/views/haomo/components/**/[A-Z]*.vue',
......@@ -19,6 +64,12 @@ module.exports = {
'**/index.vue'
],
defaultExample: true,
sections: sections,
require: [
path.join(__dirname, 'src/assets/custom-theme/index.css'),
path.join(__dirname, 'src/assets/custom-theme/fonts/element-icons.ttf'),
path.join(__dirname, 'src/assets/custom-theme/fonts/element-icons.woff')
],
webpackConfig: Object.assign({
resolve: {
extensions: ['.js', '.vue', '.json'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment