Skip to content

Commit

Permalink
Merge pull request #62 from ffan-fe/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
bcguan2008 committed Apr 19, 2017
2 parents 45fd557 + c623aad commit 89e3625
Show file tree
Hide file tree
Showing 95 changed files with 7,844 additions and 441 deletions.
3 changes: 2 additions & 1 deletion example/app/common/commonmenu/commonmenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
<div class="nav-group-title">{{'Navigation'|translate}}</div>
<ul>
<!--<li ui-sref-active="active"><a ui-sref="{{vm.globalRoute('tabs')}}">{{'tabs'|translate}}</a></li>-->
<!--<li ui-sref-active="active"><a ui-sref="{{vm.globalRoute('steps')}}">{{'steps'|translate}}</a></li>-->
<li ui-sref-active="active"><a ui-sref="{{vm.globalRoute('breadcrumb')}}">{{'breadcrumb'|translate}}</a></li>
<li ui-sref-active="active"><a ui-sref="{{vm.globalRoute('steps')}}">{{'steps'|translate}}</a></li>
<li ui-sref-active="active"><a ui-sref="{{vm.globalRoute('nav')}}">{{'nav'|translate}}</a></li>
<li ui-sref-active="active"><a ui-sref="{{vm.globalRoute('menu')}}">{{'menu'|translate}}</a></li>
</ul>
Expand Down
11 changes: 11 additions & 0 deletions example/app/components/Breadcrumb/Breadcrumb.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import template from './Breadcrumb.html';
import controller from './Breadcrumb.controller';
import './Breadcrumb.less';

export default {
restrict: 'E',
bindings: {},
template,
controller,
controllerAs: 'vm'
};
37 changes: 37 additions & 0 deletions example/app/components/Breadcrumb/Breadcrumb.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @description xxxx
*
* @author XXXXX@wandan.cn
* @date Wed Apr 19 2017 11:18:31 GMT+0800 (CST)
* @example: http://www.fancyui.org/#/zh-cn/component/Breadcrumb
*/

import Base from '../../base';
export default class BreadcrumbController extends Base{
constructor($state,$translate) {
'ngInject';
super($state,$translate)

this.datasource = [
{
name: 'Home',
icon: '<span class="glyphicon glyphicon-home"></span>'
},
{
name: 'Application Center',
icon: ''
},
{
name: 'Application List',
icon: ''
},
{
name: 'An Application',
icon: ''
},
];
this.onClick = item => {
console.log(item);
};
}
}
72 changes: 72 additions & 0 deletions example/app/components/Breadcrumb/Breadcrumb.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<section class="intro-content">
<h1 translate='{{vm.$state.current.name}}'></h1>
</section>

<section class="intro-content">
<h2>{{'Install' | translate}}</h2>
</section>

<div class="example-block">
<div class="highlight" hljs hljs-language="bash">
npm install fancyui --save</div>
</div>

<section class="intro-content">
<h2>{{'Inject_Module' | translate}}</h2>
</section>

<div class="example-block">
<div class="highlight no-border" hljs hljs-language="javascript">
import {Breadcrumb} from 'fancyui';

export default angular.module('BreadcrumbDemo', [
Breadcrumb.name
])

</div>
</div>

<!--示例-->
<h2>{{'Example'|translate}}</h2>
<div class="example-block">
<div class="bs-example pop-confirm-example">
<f-breadcrumb datasource="vm.datasource" on-click="vm.onClick" separator=">"></f-breadcrumb>
</div>
</div>

<!--基础用法-->
<h2>{{'Basic_Usage'|translate}}</h2>
<h3>View</h3>
<div class="example-block">
<div class="highlight no-border" hljs hljs-language="html">
<f-breadcrumb datasource="vm.datasource" on-click="vm.onClick" separator=">"></f-breadcrumb>
</div>
</div>

<h3>controller</h3>

<div class="example-block">
<div class="highlight no-border" hljs hljs-language="javascript">
this.datasource = [
{
name: 'Home',
icon: '<span class="glyphicon glyphicon-home"></span>'
},
{
name: 'Application Center',
icon: ''
},
{
name: 'Application List',
icon: ''
},
{
name: 'An Application',
icon: ''
},
];
this.onClick = item => {
console.log(item);
};
</div>
</div>
7 changes: 7 additions & 0 deletions example/app/components/Breadcrumb/Breadcrumb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Breadcrumb from '../../../../lib/Breadcrumb/index.js';

import BreadcrumbComponent from './Breadcrumb.component';
export default angular.module('Breadcrumb', [
Breadcrumb.name
])
.component('breadcrumb', BreadcrumbComponent);
Empty file.
3 changes: 3 additions & 0 deletions example/app/components/introduction/introduction.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
font-size: 14px!important;
}
11 changes: 11 additions & 0 deletions example/app/components/omniTable/OmniTable.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import template from './OmniTable.html';
import controller from './OmniTable.controller';
import './OmniTable.less';

export default {
restrict: 'E',
bindings: {},
template,
controller,
controllerAs: 'vm'
};
145 changes: 145 additions & 0 deletions example/app/components/omniTable/OmniTable.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
/**
* @description xxxx
*
* @author XXXXX@wandan.cn
* @date Mon Mar 20 2017 16:54:25 GMT+0800 (CST)
* @example: http://www.fancyui.org/#/zh-cn/component/OmniTable
*/

import Base from '../../base';
export default class OmniTableController extends Base {
constructor($state, $translate, $timeout) {
'ngInject';
super($state, $translate)

const columns = [{
title: 'Name',
dataIndex: 'name',
key: 'name',
render: text => `<a href="#">${text}</a>`,
},
{
title: 'Age',
dataIndex: 'age',
key: 'age',
}, {
title: 'Address',
dataIndex: 'address',
key: 'address',
},
{
title: 'Action',
key: 'action',
render: (text, record) => `
<span>
<a href="#">Action 一 ${record.name}</a>
</span>`
}];
const data = null;
// rowSelection object indicates the need for row selection
const rowSelection = {
onSelect: (record, selected, selectedRowKeys, selectedRows) => {
console.log(record, selected, selectedRowKeys, selectedRows);
},
getCheckboxProps: record => ({
disabled: record.name === 'Disabled User' // Column configuration not to be checked
}),
defaultSelectedRowKeys: ['1', '2']
};

const search = [
{
label: '门店名称',
type: 'text',
name: 'storeName'
/*tpl: `<input type="text"
placeholder="{{field.placeholder}}"
ng-model="vm.query[field.name]"
class="f-input f-input-lg">`*/
},
{
label: '商户名称',
name: 'merchantName'
},
{
type: 'text',
label: '品牌名称',
name: 'brandNames'
},
{
type: 'text',
label: '商圈名称',
name: 'plazaName'
},
{
label: '门店名称1',
name: 'storeName1'
},
{
label: '商户名称1',
name: 'merchantName1'
},
{
type: 'text',
label: '品牌名称1',
name: 'brandNames1'
},
{
type: 'text',
label: '商圈名称1',
name: 'plazaName1'
}
];
const pagination = {
total: 500,
pageSize: 10,
showQuickJumper: true,
defaultCurrent: 45
};

this.columns = columns;
this.data = data;
this.rowSelection = rowSelection;
this.search = search;

this.dataconfig = {
keyField: 'key'
};

this.pagination = null;

this.onChange = (page, pageSize, query) => {
console.log(page, pageSize, query);
};

this.onSwitchChange = val => {
this.loading = val;
};
this.loading = true;
$timeout(() => {
this.data = [{
key: '1',
name: 'John Brown',
age: 32,
address: 'New York No. 1 Lake Park',
}, {
key: '2',
name: 'Jim Green',
age: 42,
address: 'London No. 1 Lake Park',
}, {
key: '3',
name: 'Joe Black',
age: 32,
address: 'Sidney No. 1 Lake Park',
}, {
key: '4',
name: 'Disabled User',
age: 99,
address: 'Sidney No. 1 Lake Park',
}];
this.loading = false;
this.pagination = pagination
}, 5000)
}
}
Loading

0 comments on commit 89e3625

Please sign in to comment.