代码完善

master
gk 2022-02-23 21:03:39 +08:00
parent efec90abee
commit 67f96016e8
15 changed files with 1862 additions and 12004 deletions

View File

@ -1,5 +1,5 @@
registry=http://develop.kdayun.com:8081/repository/npm-yh-enterprise/ registry=http://develop.kdayun.com:8081/repository/npm-yh-community/
email=pony@kdayun.com email=kdayun-community@kdayun.com
always-auth=true always-auth=true
#base64(用户名:密码) #用户名:密码 base64
_auth="cG9ueToxMjM0NTY=" _auth="a2RheXVuLWNvbW11bml0eTprZGF5dW4uY29t"

File diff suppressed because one or more lines are too long

View File

@ -1,18 +1,11 @@
import "yh-baidu/dist/index";
import 'yh-bigscreen/dist/index';
import 'yh-business/dist/index';
import 'yh-chart/dist/index'; import 'yh-chart/dist/index';
import "yh-demo/dist/index";
import 'yh-designer/dist/base/datasource/index'; import 'yh-designer/dist/base/datasource/index';
import 'yh-designer/dist/components/core/index'; import 'yh-designer/dist/components/core/index';
import 'yh-designer/dist/designer/Designer'; import 'yh-designer/dist/designer/Designer';
import 'yh-designer/dist/designer/Preview'; import 'yh-designer/dist/designer/Preview';
import 'yh-designer/dist/services/index'; import 'yh-designer/dist/services/index';
import "yh-map/dist/index";
import "yh-moble/dist/index";
import 'yh-player/dist/index'; import 'yh-player/dist/index';
import 'yh-sqldatasource/dist/index';
import 'yh-standard/dist/extend/index'; import 'yh-standard/dist/extend/index';
import 'yh-standard/dist/form/index'; import 'yh-standard/dist/form/index';
import 'yh-standard/dist/layout/index'; import 'yh-standard/dist/layout/index';
import "yh-table/dist/index";
import "yh-wangeditor/dist/index";

View File

@ -1,17 +1,10 @@
import "yh-baidu/dist/index";
import 'yh-bigscreen/dist/index';
import 'yh-business/dist/index';
import 'yh-chart/dist/index'; import 'yh-chart/dist/index';
import "yh-demo/dist/index";
import 'yh-designer/dist/base/datasource/index'; import 'yh-designer/dist/base/datasource/index';
import 'yh-designer/dist/components/core/index'; import 'yh-designer/dist/components/core/index';
import 'yh-designer/dist/designer/Preview'; import 'yh-designer/dist/designer/Preview';
import 'yh-designer/dist/services/index'; import 'yh-designer/dist/services/index';
import "yh-map/dist/index";
import "yh-moble/dist/index";
import 'yh-player/dist/index'; import 'yh-player/dist/index';
import 'yh-sqldatasource/dist/index';
import 'yh-standard/dist/extend/index'; import 'yh-standard/dist/extend/index';
import 'yh-standard/dist/form/index'; import 'yh-standard/dist/form/index';
import 'yh-standard/dist/layout/index'; import 'yh-standard/dist/layout/index';
import "yh-table/dist/index";
import "yh-wangeditor/dist/index";

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -45,9 +45,8 @@
"jss-preset-default": "10.6.0", "jss-preset-default": "10.6.0",
"lodash": "4.16.6", "lodash": "4.16.6",
"yh-standard": "^1.0.1", "yh-standard": "^1.0.1",
"yh-table": "^1.0.0", "yh-chart": "^1.0.1",
"yh-wangeditor": "^1.0.1", "yh-player": "^1.0.1",
"yh-sqldatasource": "^1.0.1",
"yh-demo": "^1.0.1" "yh-demo": "^1.0.1"
} }
} }

View File

@ -1,8 +1,5 @@
import "yh-baidu/dist/index";
import 'yh-bigscreen/dist/index';
import 'yh-business/dist/index';
import 'yh-chart/dist/index'; import 'yh-chart/dist/index';
import "yh-demo/dist/index"; import "yh-demo/dist/index";
import 'yh-designer/dist/base/datasource/index'; import 'yh-designer/dist/base/datasource/index';
@ -10,14 +7,9 @@ import 'yh-designer/dist/components/core/index';
import 'yh-designer/dist/designer/Designer'; import 'yh-designer/dist/designer/Designer';
import 'yh-designer/dist/designer/Preview'; import 'yh-designer/dist/designer/Preview';
import 'yh-designer/dist/services/index'; import 'yh-designer/dist/services/index';
import "yh-map/dist/index";
import "yh-moble/dist/index";
import 'yh-player/dist/index'; import 'yh-player/dist/index';
import 'yh-sqldatasource/dist/index';
import 'yh-standard/dist/extend/index'; import 'yh-standard/dist/extend/index';
import 'yh-standard/dist/form/index'; import 'yh-standard/dist/form/index';
import 'yh-standard/dist/layout/index'; import 'yh-standard/dist/layout/index';
import "yh-table/dist/index";
import "yh-wangeditor/dist/index";

View File

@ -1,18 +1,11 @@
import "yh-baidu/dist/index";
import 'yh-bigscreen/dist/index';
import 'yh-business/dist/index';
import 'yh-chart/dist/index'; import 'yh-chart/dist/index';
import "yh-demo/dist/index";
import 'yh-designer/dist/base/datasource/index'; import 'yh-designer/dist/base/datasource/index';
import 'yh-designer/dist/components/core/index'; import 'yh-designer/dist/components/core/index';
import 'yh-designer/dist/designer/Preview'; import 'yh-designer/dist/designer/Preview';
import 'yh-designer/dist/services/index'; import 'yh-designer/dist/services/index';
import "yh-map/dist/index";
import "yh-moble/dist/index";
import 'yh-player/dist/index'; import 'yh-player/dist/index';
import 'yh-sqldatasource/dist/index';
import 'yh-standard/dist/extend/index'; import 'yh-standard/dist/extend/index';
import 'yh-standard/dist/form/index'; import 'yh-standard/dist/form/index';
import 'yh-standard/dist/layout/index'; import 'yh-standard/dist/layout/index';
import "yh-table/dist/index";
import "yh-wangeditor/dist/index";

View File

@ -1,6 +1,6 @@
#npm 私有仓库 #npm 私有仓库
registry=http://develop.kdayun.com:8081/repository/npm-public registry=http://develop.kdayun.com:8081/repository/npm-public
email=xxx@kdayun.com email=kdayun-community@kdayun.com
always-auth=true always-auth=true
#用户名:密码 base64 #用户名:密码 base64
_auth="a2RheWRldm9sb3BlcjoxMjNxd2U" _auth="a2RheXVuLWNvbW11bml0eTprZGF5dW4uY29t"

File diff suppressed because it is too large Load Diff

View File

@ -42,4 +42,4 @@
"publishConfig": { "publishConfig": {
"registry": "http://develop.kdayun.com:8081/repository/npm-yh-demo" "registry": "http://develop.kdayun.com:8081/repository/npm-yh-demo"
} }
} }

View File

@ -1,6 +1,9 @@
import * as _ from 'lodash';
import { ContainerBase } from "yh-designer/dist/base/ComponentBase"; import { ContainerBase } from "yh-designer/dist/base/ComponentBase";
import { Component, serialize } from "yh-designer/dist/base/decorators/Decorators"; import { Component, serialize } from "yh-designer/dist/base/decorators/Decorators";
import { InputAttrFormulaEditor } from "yh-designer/dist/designer/attrbuteEditors/InputAttrFormulaEditor"; import { EventAttrEditor } from "yh-designer/dist/designer/attrbuteEditors/EventAttrEditor";
import { InputAttrEditor } from "yh-designer/dist/designer/attrbuteEditors/InputAttrEditor";
import { Common } from "yh-designer/dist/utils/Common";
interface DemoStyle { interface DemoStyle {
@ -11,36 +14,86 @@ interface DemoStyle {
*/ */
@Component({ icon: 'fa fa-address-card-o', gourp: 'form', title: 'Demo组件', name: 'Demo组件', visiable: true }) @Component({ icon: 'fa fa-address-card-o', gourp: 'form', title: 'Demo组件', name: 'Demo组件', visiable: true })
export class Demo extends ContainerBase { export class Demo extends ContainerBase {
/** /**
* *
*/ */
@serialize(String, 'Demo标题') @serialize(String, 'Demo标题')
title: string title: string
/**
*
*/
@serialize(String, '400px')
width: string
/**
*
*/
@serialize(String, '300px')
height: string
/**
*
*/
@serialize(String)
clickScript: string
constructor(config) { constructor(config) {
super(config); super(config);
this.width = this.width || '400px'
this.height = this.height || '300px'
} }
/**
* Html
*/
doGetElemtHtml() { doGetElemtHtml() {
return [ return [
'<div>' + this.title + '</div>' '<div>' + this.title + '</div>'
].join('') ].join('')
} }
/**
*
* @param parentCmp
*/
render(parentCmp) { render(parentCmp) {
//调用父类的渲染
super.render(parentCmp); super.render(parentCmp);
let that = this;
if (!that.getDesignModel()) {
this.$elemt.on('click', function (e) {
that.stopEventPropagation(e);
that.enable && that.raiseEvent('onClick', that);
//这里触发点击事件
that.raiseOnClickScript();
});
}
}
/**
*
*/
raiseOnClickScript() {
if (Common.isNotEmpty(this.clickScript) && this.enable && !this.getDesignModel()) {
let fn: Function = Common.evalScript(this.clickScript)
if (_.isFunction(fn)) {
let params = Array.prototype.slice.call(arguments);
if (params.length < 2) {
fn.call(this, this);
} else
fn.apply(this, params)
}
}
} }
protected doGetClassName(): string { protected doGetClassName(): string {
return this.css.Demo return this.css.Demo
} }
css: DemoStyle css: DemoStyle
/**
* css
* 使jss
*/
doGetCss(): DemoStyle { doGetCss(): DemoStyle {
const styles = { const styles = {
Demo: { Demo: {
"clear": "both", "clear": "both",
"background": "red",
"position": "relative", "position": "relative",
"& *": { "& *": {
"font": "inherit", "font": "inherit",
@ -49,13 +102,25 @@ export class Demo extends ContainerBase {
} }
return styles; return styles;
} }
getAttrEditors() { getAttrEditors() {
let that = this; let that = this;
let atrr = super.getAttrEditors() let atrr = super.getAttrEditors()
atrr.push(new InputAttrFormulaEditor(that, { atrr.push(new InputAttrEditor(that, {
attr: "title", attr: "title",
labelCaption: "视频标题", labelCaption: "Demo标题",
title: "视频标题", title: "Demo标题",
}));
// 设置按钮的点击脚本属性编辑器
atrr.push(new EventAttrEditor(that, {
attr: "clickScript",
title: "",
btnText: "点击事件",
demo: `function Button1_onClickScript(cxt: ScriptContext, btn: Button) {
Common.msg('hello')
}`,
parameter: "cmp:" + Common.getClassName(that)
})); }));
return atrr; return atrr;
} }

View File

@ -1,24 +1,24 @@
{ {
"id": 0, "id": 0,
"name": "yh-player 播放器组件", "name": "yh-demo demo组件",
"kind": 0, "kind": 0,
"flags": {}, "flags": {},
"children": [ "children": [
{ {
"id": 2, "id": 1,
"name": "YhPlayer", "name": "demo",
"kind": 1, "kind": 1,
"kindString": "Module", "kindString": "Module",
"flags": {}, "flags": {},
"children": [ "children": [
{ {
"id": 3, "id": 2,
"name": "YhPlayer", "name": "Demo",
"kind": 128, "kind": 128,
"kindString": "Class", "kindString": "Class",
"flags": {}, "flags": {},
"comment": { "comment": {
"shortText": "播放视频组件\n依赖: ckPlayer.js" "shortText": "Demo组件"
}, },
"decorators": [ "decorators": [
{ {
@ -28,27 +28,27 @@
"name": "Component" "name": "Component"
}, },
"arguments": { "arguments": {
"config": "{ icon: 'fa fa-file-video-o', gourp: 'form', title: '视频播放', name: '视频播放', visiable: true }" "config": "{ icon: 'fa fa-address-card-o', gourp: 'form', title: 'Demo组件', name: 'Demo组件', visiable: true }"
} }
} }
], ],
"children": [ "children": [
{ {
"id": 4, "id": 3,
"name": "constructor", "name": "constructor",
"kind": 512, "kind": 512,
"kindString": "Constructor", "kindString": "Constructor",
"flags": {}, "flags": {},
"signatures": [ "signatures": [
{ {
"id": 5, "id": 4,
"name": "new YhPlayer", "name": "new Demo",
"kind": 16384, "kind": 16384,
"kindString": "Constructor signature", "kindString": "Constructor signature",
"flags": {}, "flags": {},
"parameters": [ "parameters": [
{ {
"id": 6, "id": 5,
"name": "config", "name": "config",
"kind": 32768, "kind": 32768,
"kindString": "Parameter", "kindString": "Parameter",
@ -61,20 +61,20 @@
], ],
"type": { "type": {
"type": "reference", "type": "reference",
"id": 3, "id": 2,
"name": "YhPlayer" "name": "Demo"
} }
} }
] ]
}, },
{ {
"id": 8, "id": 9,
"name": "title", "name": "clickScript",
"kind": 1024, "kind": 1024,
"kindString": "Property", "kindString": "Property",
"flags": {}, "flags": {},
"comment": { "comment": {
"shortText": "视频的标题" "shortText": "点击脚本"
}, },
"decorators": [ "decorators": [
{ {
@ -90,9 +90,9 @@
], ],
"sources": [ "sources": [
{ {
"fileName": "YhPlayer.ts", "fileName": "demo.ts",
"line": 24, "line": 37,
"character": 9 "character": 15
} }
], ],
"type": { "type": {
@ -101,13 +101,31 @@
} }
}, },
{ {
"id": 7, "id": 19,
"name": "url", "name": "css",
"kind": 1024,
"kindString": "Property",
"flags": {},
"sources": [
{
"fileName": "demo.ts",
"line": 87,
"character": 7
}
],
"type": {
"type": "reference",
"name": "DemoStyle"
}
},
{
"id": 8,
"name": "height",
"kind": 1024, "kind": 1024,
"kindString": "Property", "kindString": "Property",
"flags": {}, "flags": {},
"comment": { "comment": {
"shortText": "播放的视频路径" "shortText": "组件的高度"
}, },
"decorators": [ "decorators": [
{ {
@ -118,15 +136,15 @@
}, },
"arguments": { "arguments": {
"type": "String", "type": "String",
"defalutValue": "'http://ckplayer-video-sample.oss-cn-shanghai.aliyuncs.com/sample-mp4/05cacb4e02f9d9e.mp4'" "defalutValue": "'300px'"
} }
} }
], ],
"sources": [ "sources": [
{ {
"fileName": "YhPlayer.ts", "fileName": "demo.ts",
"line": 18, "line": 31,
"character": 7 "character": 10
} }
], ],
"type": { "type": {
@ -135,21 +153,178 @@
} }
}, },
{ {
"id": 14, "id": 6,
"name": "title",
"kind": 1024,
"kindString": "Property",
"flags": {},
"comment": {
"shortText": "的标题"
},
"decorators": [
{
"name": "serialize",
"type": {
"type": "reference",
"name": "serialize"
},
"arguments": {
"type": "String",
"defalutValue": "'Demo标题'"
}
}
],
"sources": [
{
"fileName": "demo.ts",
"line": 21,
"character": 9
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 7,
"name": "width",
"kind": 1024,
"kindString": "Property",
"flags": {},
"comment": {
"shortText": "组件宽度"
},
"decorators": [
{
"name": "serialize",
"type": {
"type": "reference",
"name": "serialize"
},
"arguments": {
"type": "String",
"defalutValue": "'400px'"
}
}
],
"sources": [
{
"fileName": "demo.ts",
"line": 26,
"character": 9
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 17,
"name": "doGetClassName",
"kind": 2048,
"kindString": "Method",
"flags": {
"isProtected": true
},
"sources": [
{
"fileName": "demo.ts",
"line": 84,
"character": 28
}
],
"signatures": [
{
"id": 18,
"name": "doGetClassName",
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
},
{
"id": 20,
"name": "doGetCss",
"kind": 2048,
"kindString": "Method",
"flags": {},
"sources": [
{
"fileName": "demo.ts",
"line": 92,
"character": 12
}
],
"signatures": [
{
"id": 21,
"name": "doGetCss",
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"comment": {
"shortText": "这里是设置css地方\n使用的是jss"
},
"type": {
"type": "reference",
"name": "DemoStyle"
}
}
]
},
{
"id": 10,
"name": "doGetElemtHtml",
"kind": 2048,
"kindString": "Method",
"flags": {},
"sources": [
{
"fileName": "demo.ts",
"line": 46,
"character": 18
}
],
"signatures": [
{
"id": 11,
"name": "doGetElemtHtml",
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"comment": {
"shortText": "这里是渲染组件的Html元素地方"
},
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
},
{
"id": 22,
"name": "getAttrEditors", "name": "getAttrEditors",
"kind": 2048, "kind": 2048,
"kindString": "Method", "kindString": "Method",
"flags": {}, "flags": {},
"sources": [ "sources": [
{ {
"fileName": "YhPlayer.ts", "fileName": "demo.ts",
"line": 54, "line": 107,
"character": 18 "character": 18
} }
], ],
"signatures": [ "signatures": [
{ {
"id": 15, "id": 23,
"name": "getAttrEditors", "name": "getAttrEditors",
"kind": 4096, "kind": 4096,
"kindString": "Call signature", "kindString": "Call signature",
@ -165,59 +340,68 @@
] ]
}, },
{ {
"id": 9, "id": 15,
"name": "getElemtHtml", "name": "raiseOnClickScript",
"kind": 2048, "kind": 2048,
"kindString": "Method", "kindString": "Method",
"flags": {}, "flags": {},
"sources": [ "sources": [
{ {
"fileName": "YhPlayer.ts", "fileName": "demo.ts",
"line": 33, "line": 72,
"character": 16 "character": 22
} }
], ],
"signatures": [ "signatures": [
{ {
"id": 10, "id": 16,
"name": "getElemtHtml", "name": "raiseOnClickScript",
"kind": 4096, "kind": 4096,
"kindString": "Call signature", "kindString": "Call signature",
"flags": {}, "flags": {},
"comment": {
"shortText": " 触发点击事件脚本的函数"
},
"type": { "type": {
"type": "intrinsic", "type": "intrinsic",
"name": "string" "name": "void"
} }
} }
] ]
}, },
{ {
"id": 11, "id": 12,
"name": "render", "name": "render",
"kind": 2048, "kind": 2048,
"kindString": "Method", "kindString": "Method",
"flags": {}, "flags": {},
"sources": [ "sources": [
{ {
"fileName": "YhPlayer.ts", "fileName": "demo.ts",
"line": 38, "line": 55,
"character": 10 "character": 10
} }
], ],
"signatures": [ "signatures": [
{ {
"id": 12, "id": 13,
"name": "render", "name": "render",
"kind": 4096, "kind": 4096,
"kindString": "Call signature", "kindString": "Call signature",
"flags": {}, "flags": {},
"comment": {
"shortText": "这里组件渲染的主方法"
},
"parameters": [ "parameters": [
{ {
"id": 13, "id": 14,
"name": "parentCmp", "name": "parentCmp",
"kind": 32768, "kind": 32768,
"kindString": "Parameter", "kindString": "Parameter",
"flags": {}, "flags": {},
"comment": {
"text": "\n"
},
"type": { "type": {
"type": "intrinsic", "type": "intrinsic",
"name": "any" "name": "any"
@ -237,14 +421,17 @@
"title": "Constructors", "title": "Constructors",
"kind": 512, "kind": 512,
"children": [ "children": [
4 3
] ]
}, },
{ {
"title": "Properties", "title": "Properties",
"kind": 1024, "kind": 1024,
"children": [ "children": [
9,
19,
8, 8,
6,
7 7
] ]
}, },
@ -252,17 +439,20 @@
"title": "Methods", "title": "Methods",
"kind": 2048, "kind": 2048,
"children": [ "children": [
14, 17,
9, 20,
11 10,
22,
15,
12
] ]
} }
], ],
"sources": [ "sources": [
{ {
"fileName": "YhPlayer.ts", "fileName": "demo.ts",
"line": 12, "line": 16,
"character": 21 "character": 17
} }
], ],
"extendedTypes": [ "extendedTypes": [
@ -278,20 +468,20 @@
"title": "Classes", "title": "Classes",
"kind": 128, "kind": 128,
"children": [ "children": [
3 2
] ]
} }
], ],
"sources": [ "sources": [
{ {
"fileName": "YhPlayer.ts", "fileName": "demo.ts",
"line": 1, "line": 1,
"character": 0 "character": 0
} }
] ]
}, },
{ {
"id": 1, "id": 24,
"name": "index", "name": "index",
"kind": 1, "kind": 1,
"kindString": "Module", "kindString": "Module",
@ -310,8 +500,8 @@
"title": "Modules", "title": "Modules",
"kind": 1, "kind": 1,
"children": [ "children": [
2, 1,
1 24
] ]
} }
] ]

View File

@ -1,2 +1,2 @@
import "./YhPlayer"; import "./demo";