");
12 | positionGroup.append($("
"));
13 | this.positionSelect=$(`
`);
17 | positionGroup.append(this.positionSelect);
18 | var self=this;
19 | this.positionSelect.change(function(){
20 | window.formBuilder.formPosition=$(this).val();
21 | });
22 | this.col.append(positionGroup);
23 | }
24 | refreshValue(current){
25 | this.positionSelect.val(window.formBuilder.formPosition);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ureport2-js/src/form/property/TextProperty.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-10-16.
3 | */
4 | import Property from './Property.js';
5 | export default class TextProperty extends Property{
6 | constructor(report){
7 | super();
8 | this.init(report);
9 | }
10 | init(report){
11 | this.col.append(this.buildBindParameter());
12 | this.positionLabelGroup=this.buildPositionLabelGroup();
13 | this.col.append(this.positionLabelGroup);
14 | this.col.append(this.buildLabelGroup());
15 | }
16 | refreshValue(current){
17 | super.refreshValue(current);
18 | if(this.typeSelect){
19 | this.typeSelect.val(current.editorType);
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ureport2-js/src/form/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Form Test
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ureport2-js/src/form/test.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-10-13.
3 | */
4 | import FormBuilder from './FormBuilder.js';
5 |
6 | $(document).ready(function(){
7 | new FormBuilder($("#container"));
8 | });
--------------------------------------------------------------------------------
/ureport2-js/src/form/webpack.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.gao on 2016/5/17.
3 | */
4 | var webpack = require('webpack');
5 | module.exports = {
6 | entry: {
7 | test:'./test.js'
8 | },
9 | output: {
10 | path: './output',
11 | filename: '[name].bundle.js'
12 | },
13 | module: {
14 | loaders: [
15 | {
16 | test: /\.json$/,
17 | loader: 'json'
18 | },
19 | {
20 | test: /\.(jsx|js)?$/,
21 | exclude: /(node_modules|bower_components)/,
22 | loader: 'babel',
23 | query: {
24 | presets: ['react', 'es2015'],
25 | compact:true
26 | }
27 | },
28 | {
29 | test: /\.css$/,
30 | loader: "style-loader!css-loader"
31 | },
32 | {
33 | test: /\.(eot|woff|woff2|ttf|svg|png|jpg)$/,
34 | loader: 'url-loader?limit=1000000&name=[name]-[hash].[ext]'
35 | }
36 | ]
37 | }
38 | };
--------------------------------------------------------------------------------
/ureport2-js/src/i18n/i18n.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-10-01.
3 | */
4 | import defaultI18nJsonData from './designer.json';
5 | import en18nJsonData from './designer_en.json';
6 | export default function buildLocal(){
7 | let language=window.navigator.language || window.navigator.browserLanguage;
8 | if(!language){
9 | language='zh-cn';
10 | }
11 | language=language.toLowerCase();
12 | window.i18n=defaultI18nJsonData;
13 | if(language!=='zh-cn'){
14 | window.i18n=en18nJsonData;
15 | }
16 | }
--------------------------------------------------------------------------------
/ureport2-js/src/i18n/preview.json:
--------------------------------------------------------------------------------
1 | {
2 | "pdfPrint":{
3 | "title":"PDF在线打印",
4 | "setup":"打印配置",
5 | "paper":"纸张:",
6 | "custom":"自定义",
7 | "width":"宽(毫米):",
8 | "numberTip":"请输入数字!",
9 | "height":"高(毫米):",
10 | "orientation":"方向:",
11 | "portrait":"纵向",
12 | "landscape":"横向",
13 | "leftMargin":"左边距(毫米):",
14 | "rightMargin":"右边距(毫米):",
15 | "topMargin":"上边距(毫米):",
16 | "bottomMargin":"下边距(毫米):",
17 | "apply":"应用",
18 | "fail":"操作失败!",
19 | "print":"打印"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ureport2-js/src/i18n/preview_en.json:
--------------------------------------------------------------------------------
1 | {
2 | "pdfPrint":{
3 | "title":"pdf online print",
4 | "setup":"Print Setup",
5 | "paper":"Paper:",
6 | "custom":"Custom",
7 | "width":"Width(mm):",
8 | "numberTip":"Please input a number",
9 | "height":"Height(mm):",
10 | "orientation":"Orientation:",
11 | "portrait":"Portrait",
12 | "landscape":"Landscape",
13 | "leftMargin":"Left Margin(mm):",
14 | "rightMargin":"Right Margin(mm):",
15 | "topMargin":"Top Margin(mm):",
16 | "bottomMargin":"Bottom Margin(mm):",
17 | "apply":"Apply",
18 | "fail":"Apply fail!",
19 | "print":"Print"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ureport2-js/src/panel/property/chart/AreaChartValueEditor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-06-27.
3 | */
4 | import BarChartValueEditor from './BarChartValueEditor.js';
5 | export default class AreaChartValueEditor extends BarChartValueEditor{
6 | constructor(parentContainer,context){
7 | super(parentContainer,context,'area');
8 | }
9 | }
--------------------------------------------------------------------------------
/ureport2-js/src/panel/property/chart/DoughnutChartValueEditor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-06-27.
3 | */
4 | import BarChartValueEditor from './BarChartValueEditor.js';
5 | export default class DoughnutChartValueEditor extends BarChartValueEditor{
6 | constructor(parentContainer,context){
7 | super(parentContainer,context,'doughnut');
8 | this.axisLI.hide();
9 | }
10 | }
--------------------------------------------------------------------------------
/ureport2-js/src/panel/property/chart/HorizontalBarChartValueEditor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-06-27.
3 | */
4 | import BarChartValueEditor from './BarChartValueEditor.js';
5 | export default class HorizontalBarChartValueEditor extends BarChartValueEditor{
6 | constructor(parentContainer,context){
7 | super(parentContainer,context,'horbar');
8 | }
9 | }
--------------------------------------------------------------------------------
/ureport2-js/src/panel/property/chart/LineChartValueEditor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-06-27.
3 | */
4 | import BarChartValueEditor from './BarChartValueEditor.js';
5 | export default class LineChartValueEditor extends BarChartValueEditor{
6 | constructor(parentContainer,context){
7 | super(parentContainer,context,'line');
8 | }
9 | }
--------------------------------------------------------------------------------
/ureport2-js/src/panel/property/chart/PieChartValueEditor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-06-27.
3 | */
4 | import BarChartValueEditor from './BarChartValueEditor.js';
5 | export default class PieChartValueEditor extends BarChartValueEditor{
6 | constructor(parentContainer,context){
7 | super(parentContainer,context,'pie');
8 | this.axisLI.hide();
9 | }
10 | }
--------------------------------------------------------------------------------
/ureport2-js/src/panel/property/chart/PolarChartValueEditor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-06-27.
3 | */
4 | import BarChartValueEditor from './BarChartValueEditor.js';
5 | export default class PolarChartValueEditor extends BarChartValueEditor{
6 | constructor(parentContainer,context){
7 | super(parentContainer,context,'polar');
8 | this.axisLI.hide();
9 | }
10 | }
--------------------------------------------------------------------------------
/ureport2-js/src/panel/property/chart/RadarChartValueEditor.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-06-27.
3 | */
4 | import BarChartValueEditor from './BarChartValueEditor.js';
5 | export default class RadarChartValueEditor extends BarChartValueEditor{
6 | constructor(parentContainer,context){
7 | super(parentContainer,context,'radar');
8 | this.axisLI.hide();
9 | }
10 | }
--------------------------------------------------------------------------------
/ureport2-js/src/table/HeaderUtils.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-03-22.
3 | */
4 |
5 | export function renderRowHeader(hot,context){
6 | const countRows=hot.countRows();
7 | const headers=[];
8 | const rowHeaders=context.rowHeaders;
9 | for(let i=1;i<=countRows;i++){
10 | let type='';
11 | for(let header of rowHeaders){
12 | if(header.rowNumber===(i-1)){
13 | if(header.band==='headerrepeat'){
14 | type=`
HR`;
15 | }else if(header.band==='footerrepeat'){
16 | type=`
FR`;
17 | }else if(header.band==='title'){
18 | type=`
T`;
19 | }else if(header.band==='summary'){
20 | type=`
S`;
21 | }
22 | break;
23 | }
24 | }
25 | headers.push(i+type);
26 | }
27 | hot.updateSettings({
28 | rowHeaders:headers
29 | });
30 | };
31 |
--------------------------------------------------------------------------------
/ureport2-js/src/table/Hooks.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-01-27.
3 | */
4 |
5 |
--------------------------------------------------------------------------------
/ureport2-js/src/tools/ImportTool.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-01-25.
3 | */
4 | import Tool from './Tool.js';
5 | import ImportDialog from '../dialog/ImportDialog.js';
6 |
7 | export default class ImportTool extends Tool{
8 | constructor(){
9 | super();
10 | this.dialog=new ImportDialog();
11 | }
12 | execute(){
13 | this.dialog.show();
14 | }
15 | getTitle(){
16 | return `${window.i18n.importExcel}`;
17 | }
18 | getIcon(){
19 | return `
`;
20 | }
21 | }
--------------------------------------------------------------------------------
/ureport2-js/src/tools/OpenTool.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-01-25.
3 | */
4 | import Tool from './Tool.js';
5 | import OpenDialog from '../dialog/OpenDialog.js';
6 |
7 | export default class OpenTool extends Tool{
8 | constructor(context){
9 | super(context);
10 | this.openDialog=new OpenDialog(context);
11 | }
12 | execute(){
13 | this.openDialog.show()
14 | }
15 | getTitle(){
16 | return `${window.i18n.openFile}`;
17 | }
18 | getIcon(){
19 | return `
`;
20 | }
21 | }
--------------------------------------------------------------------------------
/ureport2-js/src/tools/RedoTool.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-01-25.
3 | */
4 | import Tool from './Tool.js';
5 | import {undoManager} from '../Utils.js';
6 | import {alert} from '../MsgBox.js';
7 |
8 | export default class RedoTool extends Tool{
9 | execute(){
10 | if(undoManager.hasRedo()){
11 | undoManager.redo();
12 | }else{
13 | alert(`${window.i18n.tools.redo.noRedo}`);
14 | }
15 | }
16 | getTitle(){
17 | return `${window.i18n.tools.redo.redo}`;
18 | }
19 | getIcon(){
20 | return `
`;
21 | }
22 | }
--------------------------------------------------------------------------------
/ureport2-js/src/tools/SearchFormSwitchTool.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-01-25.
3 | */
4 | import Tool from './Tool.js';
5 | import {setDirty} from '../Utils.js';
6 | import SearchFormDialog from '../dialog/SearchFormDialog.js';
7 |
8 | export default class SearchFormSwitchTool extends Tool{
9 | constructor(context){
10 | super(context);
11 | this.dialog=new SearchFormDialog();
12 | }
13 | execute(){
14 | setDirty();
15 | this.dialog.show(this.context.reportDef);
16 | }
17 | getTitle(){
18 | return `${window.i18n.tools.searchFormSwitch}`;
19 | }
20 | getIcon(){
21 | return `
`;
22 | }
23 | }
--------------------------------------------------------------------------------
/ureport2-js/src/tools/SettingsTool.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-01-25.
3 | */
4 | import Tool from './Tool.js';
5 | import {alert} from '../MsgBox.js';
6 | import SettingsDialog from '../dialog/SettingsDialog.js';
7 |
8 | export default class SettingsTool extends Tool{
9 | constructor(context){
10 | super(context);
11 | this.settingsDialog=new SettingsDialog();
12 | }
13 | execute(){
14 | this.settingsDialog.show(this.context);
15 | }
16 | getTitle(){
17 | return `${window.i18n.setting}`;
18 | }
19 | getIcon(){
20 | return `
`;
21 | }
22 | }
--------------------------------------------------------------------------------
/ureport2-js/src/tools/Tool.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-01-25.
3 | */
4 | import {alert} from '../MsgBox.js';
5 |
6 | export default class Tool{
7 | constructor(context){
8 | this.context=context;
9 | }
10 | buildButton(){
11 | const btn=$(`
`);
14 | const _this=this;
15 | btn.click(function(){
16 | _this.execute();
17 | });
18 | return btn;
19 | }
20 | checkSelection(){
21 | const selected=this.context.hot.getSelected();
22 | if(!selected || selected.length===0){
23 | alert(`${window.i18n.selectTargetCellFirst}`);
24 | return false;
25 | }else{
26 | return true;
27 | }
28 | }
29 | };
--------------------------------------------------------------------------------
/ureport2-js/src/tools/UndoTool.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-01-25.
3 | */
4 | import Tool from './Tool.js';
5 | import {undoManager} from '../Utils.js';
6 | import {alert} from '../MsgBox.js';
7 |
8 | export default class UndoTool extends Tool{
9 | execute(){
10 | if(undoManager.hasUndo()){
11 | undoManager.undo();
12 | }else{
13 | alert(`${window.i18n.tools.undo.noUndo}`);
14 | }
15 | }
16 | getTitle(){
17 | return `${window.i18n.tools.undo.undo}`;
18 | }
19 | getIcon(){
20 | return `
`;
21 | }
22 | }
--------------------------------------------------------------------------------
/ureport2-js/src/tree/css/tree.css:
--------------------------------------------------------------------------------
1 | .tree {
2 | }
3 | .tree li {
4 | list-style-type:none;
5 | margin:0;
6 | padding:2px 5px 0 0px;
7 | position:relative;
8 | line-height: 1;
9 | }
10 | .tree li::before, .tree li::after {
11 | content:'';
12 | left:-35px;
13 | position:absolute;
14 | right:auto
15 | }
16 | .tree li::before {
17 | border-left:1px solid #999;
18 | bottom:50px;
19 | height:100%;
20 | top:-1px;
21 | width:1px;
22 | }
23 | .tree li div li::before {
24 | border:none;
25 | }
26 | .tree li::after {
27 | border-top:1px solid #999;
28 | height:20px;
29 | top:23px;
30 | width:15px
31 | }
32 | .tree li div li::after {
33 | border:none
34 | }
35 | .tree li {
36 | margin-top:-5px;
37 | }
38 | .tree li span {
39 | border:1px solid transparent;
40 | display:block;
41 | margin:10px 0px 5px -20px;
42 | cursor:pointer;
43 | white-space: nowrap;
44 | }
45 | .tree li.parent_li>span {
46 | }
47 | .tree>ul>li::before, .tree>ul>li::after {
48 | border:0
49 | }
50 | .tree li:last-child::before {
51 | height:30px;
52 | }
53 | .tree-active{
54 | border:solid 1px #2196F3 !important
55 | }
--------------------------------------------------------------------------------
/ureport2-js/src/widget/MiddleSlash.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-03-16.
3 | */
4 | import Slash from './Slash.js';
5 |
6 | export default class MiddleSlash extends Slash{
7 | constructor(width,height,fontSize){
8 | super(width,height,fontSize);
9 | }
10 | init(){
11 |
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ureport2-js/src/widget/Slash.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-03-16.
3 | */
4 | export default class Slash{
5 | constructor(width,height,fontSize){
6 | this.width=width;
7 | this.height=height;
8 | this.fontSize=fontSize;
9 | this.text='未命名';
10 | }
11 | _computeDegree(a,b){
12 | const c=Math.sqrt(a*a+b*b);
13 | const sin=Math.sin(b/c);
14 | const degree=(180/Math.PI)*Math.asin(sin);
15 | return parseInt(degree);
16 | }
17 | _computeAngle(a,b){
18 | const c=Math.sqrt(a*a+b*b);
19 | const cosB=(a*a+c*c-b*b)/2*a*c;
20 | const angle=Math.acos(cosB)*(180/Math.PI);
21 | return parseInt(angle);
22 | }
23 | }
--------------------------------------------------------------------------------
/ureport2-js/src/widget/TopSlash.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Jacky.Gao on 2017-03-16.
3 | */
4 | import Slash from './Slash.js';
5 |
6 | export default class TopSlash extends Slash{
7 | constructor(width,height,fontSize,lastHeight){
8 | super(width,height,fontSize);
9 | this.init(lastHeight);
10 | }
11 | init(lastHeight){
12 | this.degree=this._computeDegree(this.width,this.height+lastHeight/2);
13 | this.angle=this._computeAngle(this.width,this.height+lastHeight);
14 | const angle=this.angle-this.degree;
15 | const sin=Math.sin((angle/180)*Math.PI);
16 | const w=this.fontSize/2;
17 | const length=w/sin;
18 |
19 | const newAngle=90-this.angle;
20 | const cos=Math.cos((newAngle/180)*Math.PI);
21 | this.y=parseInt(length/cos);
22 |
23 | const topAngle=this.angle-angle*2;
24 | const topCos=Math.cos((topAngle/180)*Math.PI);
25 | const x=parseInt(length/topCos);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ureport2-parent/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | ureport2-parent
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.m2e.core.maven2Builder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.m2e.core.maven2Nature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ureport2-parent/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding/
=UTF-8
3 |
--------------------------------------------------------------------------------
/ureport2-parent/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------