Commit 308549bd authored by 王康's avatar 王康

Merge branch 'master' of 115.28.80.125:softwarefactory/vueelementtemplate

parents 70ab1bcd e8903fd4
### 基本使用
```jsx
<hm-complex-table :userId="0e26566e953449a7a7500c34be39fd26"
: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>
```
......@@ -32,6 +32,9 @@
type: Object,
required: true
},
/*
* 在详情页需要传入用户的id用来带出用户信息
* */
userId: {
type: null,
required: true
......@@ -64,18 +67,23 @@
request.defaults.baseURL = '/org/api'
}
console.log(request.defaults)
console.log(`request.defaults.baseURL: ${request.defaults.baseURL}`)
},
getList() {
getList: function () {
const self = this
self.listLoading = true
const params = {}
// 拿到所有的用户
request(self.schema.modelUnderscorePlural, {
params: params
}).then(resp => {
self.list = resp.data
console.log(self.list)
self.detail = self.list[0]
// console.log(self.list)
// 匹配需要展示的用户
_.each(self.list, function (item) {
if (item.id === self.userId) {
self.detail = item
}
})
})
}
}
......
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