提交 bd3de07e 编写于 作者: chitanda's avatar chitanda

delete

上级 de792e21

要显示的变更太多。

为了保持性能,仅显示文件中的 1000/1000+

app
dist
loader
node_modules
scripts
src/assets
www
.prettierrc.js
package.json
stencil.config.ts
tsconfig.json
yarn.lock
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: ['plugin:@typescript-eslint/recommended'],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/no-unused-vars': [0],
'@typescript-eslint/explicit-module-boundary-types': [0],
'@typescript-eslint/no-explicit-any': [0],
},
};
# compiled output
/dist
/node_modules
# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# OS
.DS_Store
# Tests
/coverage
/.nyc_output
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
.history
# IDE - VSCode
!.vscode
# 排除 应用打包文件
resources/app*
\ No newline at end of file
{
"printWidth": 120,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"quoteProps": "as-needed",
"arrowParens": "avoid",
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf"
}
# 版本变更日志
这个项目的所有关键变化都将记录在此文件中.
此日志格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/),
并且此项目遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/).
## [Unreleased]
## [2022-04-02]
### Added
- 新增 eureka 支持
- 新增 eureka 配置文件 configs/eureka-client.yml
### Changed
- application.config.yaml 文件:新增参数 app.gatewayMode、app.gatewayProtocol,删除参数 nacos.enable、nacos.protocol
\ No newline at end of file
MIT License
Copyright (c) 2021 千反田丷
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
## iBizSys 网关
接收前台请求,根据具体请求具体分析在 nacos 查找对应的服务并转发。
应用的 appData 相关信息由网关层拼装生成。
### 使用到的框架
1. [nestjs](https://docs.nestjs.cn/)
2. [fastify](https://www.fastify.io/)
### 目录结构
```shell
|-- configs
| |-- app.environment.yaml 应用配置,app 在打开时会请求此配置到前台
| |-- application.config.yaml 网关基本配置(发布)
| |-- application.yaml 网关基本配置
| |-- gateway-base.yaml 转发配置(发布)
| |-- gateway.yaml 转发配置
|-- docker
|-- env
|-- nest-cli.json
|-- package.json
|-- pnpm-lock.yaml
|-- resources 静态资源目录,应用打包后放在此文件夹 app 目录下
|-- src
| |-- app.controller.ts 应用接口
| |-- app.module.ts 应用模块
| |-- app.service.ts 应用服务
| |-- config 系统基本配置
| |-- core
| | |-- constants 静态参数
| | |-- controller
| | |-- core.module.ts 核心功能模块
| | |-- database
| | |-- entities
| | |-- interface
| | |-- middleware 代理中间件
| | |-- module
| | | |-- auth 认证模块
| | | | |-- auth.controller.ts
| | | | |-- auth.module.ts
| | | | |-- auth.service.ts
| | | | |-- jwt-auth.guard.ts 全局认证拦截器
| | | | |-- jwt.strategy.ts
| | | |-- caching 缓存
| | | |-- code-list 代码表
| | | |-- dynamic 多实例动态模型转发
| | | |-- ibiz-config
| | | |-- ibiz-ou
| | | |-- ibiz-util
| | | |-- workflow 工作流转发
| | |-- service
| | | |-- gateway nacos 转发地址计算服务
| | | |-- nacos nacos 服务
| | | |-- net 网络请求
| | |-- utils
| |-- environment 一些固定配置参数,不可修改
| |-- main.ts
| |-- modules 所有实体模块,一个实体一个模块
| |-- user.module.ts 用于补充自定义扩展
|-- tsconfig.json
```
### 基本接口
1. 基本功能接口转发
| 接口 | 描述 |
| :-------------------------------- | :---------------------------- |
| /v7/login | 登录 |
| /v7/logout | 登出 |
| /v7/refreshToken | 刷新认证信息 |
| /uaa/getbydcsystem/:dcsystem | 根据中心系统标识获取用户信息 |
| /dictionaries/codelist/:codename | 代码表 |
| /wfcore/\*\* | 工作流 |
2. 全局代理直接转发接口
| 接口 | 描述 |
| :-------------------------------- | :------------ |
| dynamodel | 动态模型实例 |
| configs | 配置 |
| sysorganizations | ou |
| ibizutil | 工具接口 |
3. 其余均为实体具体实体对应的转发。
### nacos 说明
1. nacos 转发域请看 nacos-gateway.yaml 文件。
2. 参数说明
```yaml
# 定义的程序内使用的 nacos 转发的 scope
loginv7:
# 当前 scope 在 nacos 中需要映射的服务名称
serviceId: ibizrt4ebsx-rt4ebsx
```
3. 使用示例
```typescript
import { Controller } from '@nestjs/common';
import { NetService, ControllerBase } from '@/core';
@Controller()
export class XxxController {
/**
* 初始化转发 nacos loginv7 域的服务。
* 在使用此请求转发时,将请求转发至 nacos loginv7 所对应的服务
*/
protected readonly http: NetService = new NetService('loginv7');
}
```
### 使用 vscode 进行代码调试
1. 使用 vscode 打开网关项目根目录
2. 打开 vscode 运行与调试分页
3. 点击 `显示所有自动调试配置` 按钮
4. 选择 `Node.js`
5. 选择 `Run Script: start:debug app_xxx`
6. 程序开始运行,可以进行调试
7. 示例:
![vscode_debug](./resources/doc/images/vscode_debug.gif)
### 用户扩展
如需自定义扩展,编写具体模块后注册入 user.module.ts 即可。
具体写法请看 [nestjs](https://docs.nestjs.cn/) 官网。
\ No newline at end of file
// 远程登录地址,本地开发调试使用
VUE_APP_BASEURL=/api
// 远程登录地址,本地开发调试使用
VUE_APP_REMOTELOGIN=/ibizutil/login
// 文件导出
VUE_APP_EXPORTFILE=/ibizutil/download
// 文件上传
VUE_APP_UPLOADFILE=/ibizutil/upload
// 数据导入单次上传最大数量
VUE_APP_SLICEUPLOADCNT=100
// 是否为开发模式
VUE_APP_DEVMODE=false
// 是否启用AppData
VUE_APP_ENABLEAPPDATA=true
// 是否开启权限认证
VUE_APP_ENABLEPERMISSIONVALID=false
// 远端动态基础路径
VUE_APP_REMOTEDYNAPATH=
// 是否开启工作流
VUE_APP_WORKFLOW=false
// 是否启用动态
VUE_APP_BDYNAMIC=false
// SaaS模式
VUE_APP_SAASMODE=false
// 仿真mockDcSystemId
VUE_APP_MOCKDCSYSTEMID=
// 登录地址
VUE_APP_LOGINURL=
// 门户地址
VUE_APP_PORTALURL=
// 刷新token即将到期时间间隔(默认10分钟,单位:ms)
VUE_APP_REFRESHTOKENTIME=600000
// 微应用名称
VUE_APP_MICROAPPNAME=OldWebAppTest
//统一地址
VUE_APP_UNITEADDRESS=http=//172.16.100.202=8114
// 菜单权限模式,可选值:RT(RT模式),RESOURCE(资源模式),MINIX(混合模式),默认MINIX
VUE_APP_MENUPERMISSIONMODE=RESOURCE
// 预览动态基础路径
VUE_APP_PREVIEWDYNAPATH=http=//172.16.170.145
// 实例配置地址
VUE_APP_CONFIGDYNAPATH=http=//172.16.170.145/DynamicBackend/designtool/redirect
// 动态模式(RT/WEB)
VUE_APP_DYNAMODE=WEB
// 钉钉内部集成应用标识,用于钉钉应用内免登
VUE_APP_DINGTALKAPPID=
// 钉钉登录应用标识,用于网页扫码登录
VUE_APP_DINGTALKACCAPPID=
// 企业微信登录应用标识,用于网页扫码登录和企业微信内部免登
VUE_APP_WXWORKAPPID=
// cas登录地址
VUE_APP_CASLOGINURL=
// cas登出地址
VUE_APP_CASLOGOUTURL=
// 跳cas后cas未登录时默认跳转的地址
VUE_APP_CASREDIRECTURL=
// Debug栏模型配置工具地址
VUE_APP_DYNAMICCONFIGTOOLURL=http=//172.16.170.145/dynamictool/debug-bar/?origin=
// 表单项标题位置('', 'LEFT', 'RIGHT', 'TOP', 'BOTTOM')
VUE_APP_FORMITEMLABELPOS=
// 打包基础路径
VUE_APP_PUBLICPATH=./
// 是否提示所有的字段的错误信息
VUE_APP_NOTICEALLFIELDSERROR=false
// 系统默认的最大导出个数
VUE_APP_EXPORTMAXROWCOUNT=1000
# .env.dev 用于开发构建
// 是否为开发模式
VUE_APP_DEVMODE=true
\ No newline at end of file
# .env.micro 用于微应用环境构建
// 是否为开发模式
VUE_APP_DEVMODE=false
// 是否开启权限认证
VUE_APP_ENABLEPERMISSIONVALID=true
// 打包基础路径
VUE_APP_PUBLICPATH=http://localhost:8080
\ No newline at end of file
# .env.dev 用于开发构建
// 是否为开发模式
VUE_APP_DEVMODE=false
// 是否开启权限认证
VUE_APP_ENABLEPERMISSIONVALID=true
\ No newline at end of file
.DS_Store
node_modules
/dist
/tests/e2e/videos/
/tests/e2e/screenshots/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.history
# 排除模型 link 文件提交
public/assets/model
\ No newline at end of file
module.exports = {
printWidth: 120,
semi: true,
singleQuote: true,
trailingComma: 'all',
bracketSpacing: true,
jsxBracketSameLine: false,
jsxSingleQuote: true,
quoteProps: 'as-needed',
arrowParens: 'avoid',
tabWidth: 4,
useTabs: false,
endOfLine: 'lf',
};
此差异已折叠。
FROM registry.cn-shanghai.aliyuncs.com/ibizops/nginx-gzip:v1
WORKDIR /etc/nginx/conf.d
RUN rm -rf default.conf
COPY nginx.conf .
WORKDIR /
COPY dist /dist
\ No newline at end of file
FROM srcimagename
WORKDIR /dist/assets
RUN rm -rf model
COPY model model
\ No newline at end of file
此差异已折叠。
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
],
plugins: ["@babel/plugin-proposal-object-rest-spread"]
}
{
"pluginsFile": "tests/e2e/plugins/index.js"
}
module.exports = {
preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel'
}
server {
listen 80;
server_name localhost;
location /oldwebapptest/ {
alias /dist/;
index index.html index.htm;
}
location /trainsys__oldwebapptest {
proxy_pass http://gateway.ibizcloud.cn:20086;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
\ No newline at end of file
{
"name": "OldWebAppTest",
"version": "0.1.0",
"private": true,
"workspaces": [
"packages/*",
"plugins/*"
],
"scripts": {
"link-model": "./node_modules/.bin/ibz link ../../trainsys-core/src/main/resources/model/cn/ibizlab/trainsys/PSSYSAPPS/OldWebAppTest ./public/assets/model",
"serve": "node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service serve --mode dev",
"dev-serve": "node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service serve --mode dev",
"build": "yarn run link-model && node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service build --mode prod",
"micro-build": "yarn run link-model && node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service build --mode micro",
"dev-build": "node --max_old_space_size=8102 ./node_modules/@vue/cli-service/bin/vue-cli-service build --mode dev",
"watch": "vue-cli-service build --watch --no-clean --mode dev",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@fullcalendar/core": "^4.4.0",
"@fullcalendar/daygrid": "^4.4.0",
"@fullcalendar/interaction": "^4.4.0",
"@fullcalendar/list": "^4.4.0",
"@fullcalendar/timegrid": "^4.4.0",
"@fullcalendar/vue": "^4.4.0",
"@ibiz/drawer-vue": "^0.0.7",
"@popperjs/core": "^2.9.2",
"@babel/plugin-proposal-object-rest-spread": "^7.14.7",
"dexie": "^3.0.3",
"dingtalk-jsapi": "^2.13.23",
"async-validator": "^3.5.1",
"axios": "^0.21.1",
"core-js": "^3.10.1",
"echarts": "5.0.2",
"element-ui": "^2.15.1",
"file-saver": "^2.0.5",
"font-awesome": "^4.7.0",
"ibiz-core": "1.0.0",
"ibiz-gantt-elastic": "^1.0.18",
"ibiz-service": "1.0.0",
"ibiz-vue": "1.0.0",
"ibiz-vue-lib": "^0.1.20",
"moment": "^2.29.1",
"vue-text-format": "^1.2.6",
"mavon-editor": "^2.9.1",
"path-to-regexp": "^6.2.0",
"qs": "^6.10.1",
"qx-util": "^0.0.7",
"pqgridf": "^3.5.1",
"jquery-ui-pack": "^1.12.3",
"jszip": "^3.7.1",
"jquery": "^3.6.0",
"@types/jquery": "^3.5.8",
"@types/jqueryui": "^1.12.16",
"rxjs": "^6.6.7",
"tinymce": "5.7.1",
"view-design": "4.4.0",
"vue": "^2.6.12",
"vue-amap": "^0.5.10",
"vue-class-component": "^7.2.6",
"vue-grid-layout": "^2.3.12",
"vue-i18n": "^8.24.3",
"vue-property-decorator": "^9.1.2",
"vue-router": "^3.5.1",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"@interactjs/interact": "^1.10.11",
"@interactjs/auto-start": "^1.10.11",
"@interactjs/actions": "^1.10.11",
"@interactjs/modifiers": "^1.10.11",
"@interactjs/dev-tools": "^1.10.11",
"@ibiz/dynamic-model-api": "0.0.59",
"@ibiz/model-location": "^0.0.4",
"xlsx": "^0.16.9"
},
"devDependencies": {
"@ibiz/cli": "0.1.1",
"@types/echarts": "^4.9.7",
"@types/mockjs": "^1.0.3",
"@types/qs": "^6.9.6",
"@vue/cli-plugin-babel": "^4.5.12",
"@vue/cli-plugin-router": "^4.5.12",
"@vue/cli-plugin-typescript": "^4.5.12",
"@vue/cli-plugin-vuex": "^4.5.12",
"@vue/cli-service": "^4.5.12",
"@vue/test-utils": "1.1.4",
"axios-mock-adapter": "^1.19.0",
"compression-webpack-plugin": "^5.0.1",
"less": "3.13.1",
"less-loader": "^7.3.0",
"mockjs": "^1.1.0",
"script-loader": "^0.7.2",
"typescript": "^4.2.4",
"vue-template-compiler": "^2.6.12"
}
}
\ No newline at end of file
{
"name": "ibiz-core",
"version": "1.0.0",
"description": "ibiz核心包",
"main": "src/index.ts",
"author": "ibiz-temp",
"license": "MIT",
"dependencies": {
"async-validator": "^3.5.1",
"qs": "^6.10.1",
"axios": "^0.21.1",
"ramda": "^0.27.1"
},
"devDependencies": {
"@types/ramda": "^0.27.40"
}
}
import { ViewEngine } from './view-engine';
/**
* 日历导航视图界面引擎
*
* @export
* @class CalendarExpViewEngine
* @extends {ViewEngine}
*/
export class CalendarExpViewEngine extends ViewEngine {
/**
* 日历导航栏部件
*
* @type {*}
* @memberof CalendarExpViewEngine
*/
public calendarExpBar: any = null;
/**
* Creates an instance of CalendarExpViewEngine.
*
* @memberof CalendarExpViewEngine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} options
* @memberof CalendarExpViewEngine
*/
public init(options: any): void {
this.calendarExpBar = options.calendarexpbar;
super.init(options);
}
/**
* 引擎加载
*
* @memberof CalendarExpViewEngine
*/
public load(): void {
super.load();
if (this.getCalendarExpBar() && this.isLoadDefault) {
const tag = this.getCalendarExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof CalendarExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'calendarexpbar')) {
this.calendarExpBarEvent(eventName, args);
}
}
/**
* 日历导航事件
*
* @param {string} eventName
* @param {*} args
* @memberof CalendarExpViewEngine
*/
public calendarExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.emitViewEvent('viewload', args);
}
if (Object.is(eventName, 'selectionchange')) {
this.emitViewEvent('viewdataschange', args);
}
if (Object.is(eventName, 'activated')) {
this.emitViewEvent('viewdatasactivated', args);
}
}
/**
* 获取部件对象
*
* @returns {*}
* @memberof CalendarExpViewEngine
*/
public getCalendarExpBar(): any {
return this.calendarExpBar;
}
}
\ No newline at end of file
import { ViewEngine } from './view-engine';
/**
* 图表导航视图界面引擎
*
* @export
* @class ChartExpViewEngine
* @extends {ViewEngine}
*/
export class ChartExpViewEngine extends ViewEngine {
/**
* 图表导航栏部件
*
* @type {*}
* @memberof ChartExpViewEngine
*/
public chartExpBar: any = null;
/**
* Creates an instance of ChartExpViewEngine.
*
* @memberof ChartExpViewEngine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} options
* @memberof ChartExpViewEngine
*/
public init(options: any): void {
this.chartExpBar = options.chartexpbar;
super.init(options);
}
/**
* 引擎加载
*
* @memberof ChartExpViewEngine
*/
public load(): void {
super.load();
if (this.getChartExpBar() && this.isLoadDefault) {
const tag = this.getChartExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof ChartExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'chartexpbar')) {
this.chartExpBarEvent(eventName, args);
}
}
/**
* 图表导航事件
*
* @param {string} eventName
* @param {*} args
* @memberof ChartExpViewEngine
*/
public chartExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.emitViewEvent('viewload', args);
}
if (Object.is(eventName, 'selectionchange')) {
this.emitViewEvent('viewdataschange', args);
}
if (Object.is(eventName, 'activated')) {
this.emitViewEvent('viewdatasactivated', args);
}
}
/**
* 获取部件对象
*
* @returns {*}
* @memberof ChartExpViewEngine
*/
public getChartExpBar(): any {
return this.chartExpBar;
}
}
\ No newline at end of file
import { SearchViewEngine } from './search-view-engine';
/**
* 实体图表视图界面引擎
*
* @export
* @class ChartViewEngine
* @extends {SearchViewEngine}
*/
export class ChartViewEngine extends SearchViewEngine {
/**
* 图表对象
*
* @type {*}
* @memberof ChartViewEngine
*/
public chart: any;
/**
* 图表初始化
*
* @param {*} options
* @memberof ChartViewEngine
*/
public init(options: any): void {
this.chart = options.chart;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof ChartViewEngine
*/
public load(opts: any = {}): void {
if (this.getSearchForm()) {
const tag = this.getSearchForm().name;
this.setViewState2({ tag: tag, action: 'loaddraft', viewdata: this.view.viewparams });
}else if(this.getDataCtrl() && this.isLoadDefault) {
const tag = this.getDataCtrl().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: {} });
} else {
this.isLoadDefault = true;
}
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof ChartViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'chart')) {
this.chartEvent(eventName, args);
}
}
/**
* 图表事件
*
* @param {string} eventName
* @param {*} args
* @memberof ChartViewEngine
*/
public chartEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'beforeload')) {
this.dataCtrlBeforeLoad(args)
}
}
/**
* 搜索表单加载完成
*
* @memberof ChartViewEngine
*/
public onSearchFormLoad(): void {
super.onSearchFormLoad();
if (this.getDataCtrl() && this.isLoadDefault) {
const tag = this.getDataCtrl().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: {} });
}
this.isLoadDefault = true;
}
/**
* 获取数据部件
*
* @returns {*}
* @memberof ChartViewEngine
*/
public getDataCtrl(): any {
return this.chart;
}
}
\ No newline at end of file
import { ChartViewEngine } from './chart-view-engine';
/**
* 实体图表视图(部件视图)界面引擎
*
* @export
* @class ChartView9Engine
* @extends {ChartViewEngine}
*/
export class ChartView9Engine extends ChartViewEngine {
}
\ No newline at end of file
import { LogUtil, Util } from "../utils";
import { ViewEngine } from "./view-engine";
/**
* 视图引擎基类
*
* @export
* @class CommonViewEngine
*/
export class CommonViewEngine extends ViewEngine {
/**
* 部件引擎集合
*
* @memberof CommonViewEngine
*/
public ctrlEngineArray: Array<any> = [];
/**
* 视图部件Map
*
* @memberof CommonViewEngine
*/
public viewCtrlMap: Map<string, any> = new Map();
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof CommonViewEngine
*/
public init(options: any = {}): void {
this.initViewControlMap(options.ctrl);
this.initCtrlEngineArray(options.engine);
super.init(options);
}
/**
* 初始化引擎Map
*
* @param {*} options
* @memberof CommonViewEngine
*/
public initCtrlEngineArray(options: any) {
if (options && options.length > 0) {
this.ctrlEngineArray = [];
options.forEach((element: any) => {
const result = this.handleViewEngineParams(element);
this.ctrlEngineArray.push(result);
});
}
}
/**
* 初始化视图部件Map
*
* @param {*} options
* @memberof CommonViewEngine
*/
public initViewControlMap(options: any) {
if (options && options.length > 0) {
options.forEach((element: any) => {
this.viewCtrlMap.set(element.name, element.ctrl);
});
}
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof CommonViewEngine
*/
public load(opts: any = {}): void {
// 处理搜索部件加载并搜索(参数可指定触发部件)
if (this.ctrlEngineArray.length > 0) {
for (let element of this.ctrlEngineArray) {
if (element.triggerCtrlName && Object.is(element.triggerCtrlName, 'VIEW')) {
if (element.triggerType && Object.is(element.triggerType, 'CtrlLoadAndSearch')) {
this.setViewState2({ tag: element.targetCtrlName, action: 'loaddraft', viewdata: Util.deepCopy(opts) });
}
}
}
}
// 处理部件加载(参数可指定触发部件)无指定触发部件时由容器触发
if (this.ctrlEngineArray.length > 0) {
for (let element of this.ctrlEngineArray) {
if (element.triggerType && Object.is(element.triggerType, 'CtrlLoad') && !element.triggerCtrlName) {
this.setViewState2({ tag: element.targetCtrlName, action: 'load', viewdata: Util.deepCopy(opts) });
}
}
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof CommonViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
// 处理部件加载(参数可指定触发部件)
if (Object.is(eventName, 'search') ||
Object.is(eventName, 'load') ||
Object.is(eventName, 'selectionchange')) {
if (this.ctrlEngineArray.length > 0) {
for (let element of this.ctrlEngineArray) {
if (element.triggerCtrlName && Object.is(element.triggerCtrlName, ctrlName)) {
if (element.triggerType && Object.is(element.triggerType, 'CtrlLoad')) {
if (this.view) {
if (this.view.$refs[element.targetCtrlName] && this.view.$refs[element.targetCtrlName].ctrl) {
this.view.$refs[element.targetCtrlName].ctrl.setNavdatas(Util.deepCopy(args));
}
if (Util.isExistData(args)) {
this.setViewState2({ tag: element.targetCtrlName, action: 'load', viewdata: Util.deepCopy(args) });
} else {
this.setViewState2({ tag: element.targetCtrlName, action: 'reset', viewdata: Util.deepCopy(args) });
}
}
}
}
}
}
}
}
/**
* 处理视图引擎参数
*
* @param {*} args 引擎数据
* @memberof CommonViewEngine
*/
public handleViewEngineParams(args: any) {
switch (args.engineType) {
case 'CtrlLoadTrigger':
return this.handleCtrlLoad(args.getPSUIEngineParams);
case 'CtrlLoad':
return this.handleCtrlLoad(args.getPSUIEngineParams);
case 'CtrlLoadAndSearch':
return this.CtrlLoadAndSearch(args.getPSUIEngineParams);
default:
LogUtil.warn(`${args.engineType}暂未支持`);
break;
}
}
/**
* 处理搜索部件加载并搜索(参数可指定触发部件)
*
* @param {*} args 引擎参数
* @memberof CommonViewEngine
*/
public CtrlLoadAndSearch(args: any) {
if (!args || args.length < 1) {
return null;
}
const targetCtrl = args.find((item: any) => {
return item.name === 'CTRL' && item.paramType === 'CTRL';
})
return { triggerCtrlName: 'VIEW', triggerType: 'CtrlLoadAndSearch', targetCtrlName: targetCtrl.ctrlName };
}
/**
* 处理部件加载(参数可指定触发部件)
*
* @param {*} args 引擎参数
* @memberof CommonViewEngine
*/
public handleCtrlLoad(args: any) {
if (!args || args.length < 1) {
return null;
}
const triggerCtrl = args.find((item: any) => {
return item.name === 'TRIGGER' && item.paramType === 'CTRL';
})
const targetCtrl = args.find((item: any) => {
return item.name === 'CTRL' && item.paramType === 'CTRL';
})
return { triggerCtrlName: triggerCtrl?.ctrlName, triggerType: 'CtrlLoad', targetCtrlName: targetCtrl.ctrlName };
}
}
\ No newline at end of file
import { ViewEngine } from './view-engine';
import { AppServiceBase } from 'ibiz-core';
/**
* 快速摘要栏引擎
*
* @export
* @class DataPanelEngine
* @extends {ViewEngine}
*/
export class DataPanelEngine extends ViewEngine {
/**
* 快捷信息栏部件
*
* @protected
* @type {*}
* @memberof DataPanelEngine
*/
protected dataPanel: any = null;
/**
* 表单部件
*
* @protected
* @type {*}
* @memberof DataPanelEngine
*/
protected form: any = null;
/**
* 获取上下文
*
* @readonly
* @protected
* @type {*}
* @memberof DataPanelEngine
*/
protected get context(): any {
return this.view?.context || {};
}
/**
* 引擎初始化
*
* @param {*} [opt={}]
* @memberof DataPanelEngine
*/
public init(opt: any = {}): void {
super.init(opt);
this.dataPanel = opt.datapanel;
if (this.dataPanel) {
const tag = this.dataPanel.name;
let action: string = '';
if (
this.keyPSDEField &&
this.view.context[this.keyPSDEField] &&
!Object.is(this.view.context[this.keyPSDEField], '')
) {
action = 'load';
} else {
action = 'loaddraft';
}
this.setViewState2({ tag: tag, action: action, viewdata: this.view.viewparams });
}
}
/**
* 新增事件监听
*
* @protected
* @memberof DataPanelEngine
*/
protected addListener(): void {
if (this.view) {
this.view.$on('ModelLoaded', () => {
this.setData();
});
}
if (this.form) {
this.form.$on('load', () => {
this.setData();
});
}
}
/**
* 向快捷信息栏部件填充数据
*
* @memberof DataPanelEngine
*/
public setData(): void {
const data = AppServiceBase.getInstance().getAppStore();
if (this.dataPanel) {
if (Object.is(this.dataPanel.controlType, 'FORM')) {
if (data && data.data) {
this.dataPanel.fillForm(data.data);
this.dataPanel.formLogic({ name: '', newVal: null, oldVal: null });
}
} else if (Object.is(this.dataPanel.controlType, 'PANEL')) {
if (data && data.data) {
this.dataPanel.onInputDataChange(data.data);
}
}
}
}
}
import { MDViewEngine } from './md-view-engine';
/**
* 视图引擎基础
*
* @export
* @class DataViewEngine
* @extends {MDViewEngine}
*/
export class DataViewEngine extends MDViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof DataViewEngine
*/
protected dataView: any;
/**
* Creates an instance of DataViewEngine.
* @memberof DataViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof DataViewEngine
*/
public init(options: any = {}): void {
this.dataView = options.dataview;
super.init(options);
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof DataViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'dataview')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof DataViewEngine
*/
public getMDCtrl(): any {
return this.dataView;
}
/**
* 删除操作
*
* @returns {void}
* @memberof DataViewEngine
*/
public doRemove(): void {
let selectedData = this.getMDCtrl() && this.getMDCtrl().getSelection();
if (!selectedData || selectedData == null || selectedData.length === 0) {
return;
}
let dataInfo = '';
selectedData.forEach((record: any, index: number) => {
let srfmajortext = record.srfmajortext;
if (index < 5) {
if (!Object.is(dataInfo, '')) {
dataInfo += '、';
}
dataInfo += srfmajortext;
} else {
return false;
}
});
if (selectedData.length < 5) {
dataInfo = dataInfo + this.view.$t('app.dataview.sum') + selectedData.length + this.view.$t('app.dataview.data');
} else {
dataInfo = dataInfo + '...' + this.view.$t('app.dataview.sum') + selectedData.length + this.view.$t('app.dataview.data');
}
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
// 询问框
this.view.$Modal.confirm({
title:this.view.$t('app.commonwords.warning'),
content: this.view.$t('app.grid.confirmdel') + dataInfo + ',' + this.view.$t('app.grid.notrecoverable'),
onOk:() => {
this.removeData(null);
},
onCancel: () => {}
});
}
/**
* 删除
*
* @param {*} [arg={}]
* @returns {void}
* @memberof DataViewEngine
*/
public removeData(arg: any = {}): void {
if (!arg) {
arg = {};
}
if (!arg.srfkeys) {
// 获取要删除的数据集合
const selectedData: Array<any> = this.getMDCtrl() && this.getMDCtrl().getSelection();
if (!selectedData || selectedData == null || selectedData.length === 0) {
return;
}
let keys = '';
selectedData.forEach((record) => {
let key = record.srfkey;
if (!Object.is(keys, '')) {
keys += ';';
}
keys += key;
});
arg.srfkeys = keys;
}
const grid: any = this.getMDCtrl();
if (grid) {
grid.remove(arg);
}
}
}
\ No newline at end of file
import { ViewEngine } from './view-engine';
/**
* 卡片视图导航视图界面引擎
*
* @export
* @class DataViewExpViewEngine
* @extends {ViewEngine}
*/
export class DataViewExpViewEngine extends ViewEngine {
/**
* 卡片导航栏部件
*
* @type {*}
* @memberof DataViewExpViewEngine
*/
public dataviewExpBar: any = null;
/**
* Creates an instance of DataViewExpViewEngine.
*
* @memberof DataViewExpViewEngine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} options
* @memberof DataViewExpViewEngine
*/
public init(options: any): void {
this.dataviewExpBar = options.dataviewexpbar;
super.init(options);
}
/**
* 引擎加载
*
* @memberof DataViewExpViewEngine
*/
public load(): void {
super.load();
if (this.getDataviewExpBar() && this.isLoadDefault) {
const tag = this.getDataviewExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof DataViewExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'dataviewexpbar')) {
this.dataviewExpBarEvent(eventName, args);
}
}
/**
* 卡片导航事件
*
* @param {string} eventName
* @param {*} args
* @memberof DataViewExpViewEngine
*/
public dataviewExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.emitViewEvent('viewload', args);
}
if (Object.is(eventName, 'selectionchange')) {
this.emitViewEvent('viewdataschange', args);
}
if (Object.is(eventName, 'activated')) {
this.emitViewEvent('viewdatasactivated', args);
}
}
/**
* 获取部件对象
*
* @returns {*}
* @memberof DataViewExpViewEngine
*/
public getDataviewExpBar(): any {
return this.dataviewExpBar;
}
}
\ No newline at end of file
import { DataViewEngine } from './data-view-engine';
/**
*
*
* @export
* @class EditView9Engine
* @extends {EditViewEngine}
*/
export class DataView9Engine extends DataViewEngine {
}
import { ViewEngine } from './view-engine';
/**
* @description 实体首页视图引擎
* @export
* @class DeIndexViewEngine
* @extends {ViewEngine}
*/
export class DeIndexViewEngine extends ViewEngine {
/**
* @description 表单部件
* @private
* @type {*}
* @memberof DeIndexViewEngine
*/
private form: any;
/**
* @description 数据关系栏部件
* @private
* @type {*}
* @memberof DeIndexViewEngine
*/
private drBar: any;
/**
* @description 引擎初始化
* @param {*} opts
* @memberof DeIndexViewEngine
*/
public init(opts: any) {
this.form = opts.form;
this.drBar = opts.drbar;
super.init(opts);
}
/**
* @description 引擎加载
* @memberof DeIndexViewEngine
*/
public load() {
super.load();
const form = this.getForm();
if (form && this.isLoadDefault) {
const tag = form.name;
let action: string = 'loaddraft';
if (
this.keyPSDEField &&
this.view.context[this.keyPSDEField] &&
!Object.is(this.view.context[this.keyPSDEField], '')
) {
action = 'load';
}
this.setViewState2({ tag: tag, action: action, viewdata: this.view.viewparams });
}
}
/**
* @description 处理部件事件
* @param {string} ctrlName 部件名称
* @param {string} eventName 事件名称
* @param {*} args 事件数据
* @memberof DeIndexViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, this.getForm()?.name)) {
this.handleFormEvents(eventName, args);
}
if (Object.is(ctrlName, this.getDrBar()?.name)) {
this.handleDrBarEvents(eventName, args);
}
}
/**
* @description 处理表单部件事件
* @param {string} eventName 事件名
* @param {*} args 事件数据
* @memberof DeIndexViewEngine
*/
public handleFormEvents(eventName: string, args: any) {
if (Object.is(eventName, 'load')) {
this.onFormLoad(args);
}
if (Object.is(eventName, 'save')) {
this.onFormSave(args);
}
}
/**
* @description 处理数据关系栏部件事件
* @param {string} eventName 事件名
* @param {*} args 事件数据
* @memberof DeIndexViewEngine
*/
public handleDrBarEvents(eventName: string, args: any) {
if (Object.is(eventName, 'selectionchange')) {
this.drBarSelectionChange(args);
}
}
/**
* @description 表单加载完成
* @param {*} [arg={}]
* @memberof DeIndexViewEngine
*/
public onFormLoad(arg: any = {}): void {
this.view.model.dataInfo = Object.is(arg.srfuf, '1')
? this.majorPSDEField
? arg[this.majorPSDEField]
: arg.srfmajortext
: this.view.$t('app.local.new');
this.setTabCaption(this.view.model.dataInfo, Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata);
this.calcToolbarItemAuthState(this.transformData(arg));
this.setDataCtrlData(arg,true);
this.emitViewEvent('load', arg);
const drBar = this.getDrBar();
if (drBar) {
const tag = drBar.name;
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* @description 表单保存完成
* @param {*} [arg={}]
* @memberof DeIndexViewEngine
*/
public onFormSave(arg: any = {}): void {
this.view.model.dataInfo = Object.is(arg.srfuf, '1')
? this.majorPSDEField
? arg[this.majorPSDEField]
: arg.srfmajortext
: this.view.$t('app.local.new');
this.setTabCaption(this.view.model.dataInfo, Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata);
this.calcToolbarItemAuthState(this.transformData(arg));
this.emitViewEvent('save', arg);
this.emitViewEvent('viewdataschange',arg);
const drBar = this.getDrBar();
if (drBar) {
const tag = drBar.name;
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* @description 数据关系栏选中数据变化
* @param {any[]} args 选中数据
* @return {*} {void}
* @memberof DeIndexViewEngine
*/
public drBarSelectionChange(args: any[]): void {
const item = args[0];
if (!item || Object.keys(item).length === 0) {
return;
}
console.log(222, "选中数据变化", args);
this.view.selection = {};
Object.assign(this.view.selection, JSON.parse(JSON.stringify(item)));
}
/**
* @description 设置分页标题
* @param {string} info
* @param {boolean} isNew
* @memberof DeIndexViewEngine
*/
public setTabCaption(info: string, isNew: boolean): void {
let viewModel: any = this.view.model;
if (viewModel && info && !Object.is(info, '')) {
// 解决表格视图标题问题
if (this.view.$tabPageExp && this.view.viewDefaultUsage) {
this.view.$tabPageExp.setCurPageCaption({
caption: viewModel.srfCaption,
title: viewModel.srfCaption,
info: info,
viewtag: this.view.viewtag
}
);
}
if (this.view.$route) {
this.view.$route.meta.info = info;
}
}
}
/**
* @description 转化数据
* @param {*} arg 源数据
* @return {*}
* @memberof DeIndexViewEngine
*/
public transformData(arg: any) {
const form = this.getForm();
if (form && form.transformData && form.transformData instanceof Function) {
return form.transformData(arg);
}
return null;
}
/**
* @description 获取表单部件
* @return {*}
* @memberof DeIndexViewEngine
*/
public getForm() {
return this.form;
}
/**
* @description 获取数据关系栏部件
* @return {*}
* @memberof DeIndexViewEngine
*/
public getDrBar() {
return this.drBar;
}
}
\ No newline at end of file
import { ViewEngine } from './view-engine';
/**
* 编辑视图引擎
*
* @export
* @class EditViewEngine
* @extends {ViewEngine}
*/
export class EditViewEngine extends ViewEngine {
/**
* 表单部件
*
* @protected
* @type {*}
* @memberof EditViewEngine
*/
protected form: any;
/**
* 父健为当前健
*
* @protected
* @type {string}
* @memberof EditViewEngine
*/
protected p2k: string = '';
/**
* 初始化编辑视图引擎
*
* @param {*} [options={}]
* @memberof EditViewEngine
*/
public init(options: any = {}): void {
this.form = options.form;
this.p2k = options.p2k;
super.init(options);
}
/**
* 引擎加载
*
* @param {*} [opts={}]
* @memberof EditViewEngine
*/
public load(opts: any = {}): void {
super.load(opts);
if (this.getForm() && this.isLoadDefault) {
const tag = this.getForm().name;
let action: string = '';
if (
this.keyPSDEField &&
this.view.context[this.keyPSDEField] &&
!Object.is(this.view.context[this.keyPSDEField], '')
) {
action = 'load';
} else {
action = 'loaddraft';
}
this.setViewState2({ tag: tag, action: action, viewdata: this.view.viewparams });
}
this.isLoadDefault = true;
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof EditViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'form')) {
this.formEvent(eventName, args);
}
}
/**
* 表单事件
*
* @param {string} eventName
* @param {*} args
* @memberof EditViewEngine
*/
public formEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.onFormLoad(args);
}
if (Object.is(eventName, 'save')) {
this.onFormSave(args);
}
if (Object.is(eventName, 'remove')) {
this.onFormRemove(args);
}
}
/**
* 表单加载完成
*
* @param {*} args
* @memberof EditViewEngine
*/
public onFormLoad(arg: any): void {
this.view.model.dataInfo = Object.is(arg.srfuf, '1')
? this.majorPSDEField
? arg[this.majorPSDEField]
: arg.srfmajortext
: this.view.$t('app.local.new');
this.setTabCaption(this.view.model.dataInfo, Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata);
this.calcToolbarItemAuthState(this.transformData(arg));
this.setDataCtrlData(arg,true);
this.readTask(arg);
this.emitViewEvent('load', arg);
}
/**
* 表单保存完成
*
* @param {*} args
* @memberof EditViewEngine
*/
public onFormSave(arg: any): void {
this.view.model.dataInfo = Object.is(arg.srfuf, '1')
? this.majorPSDEField
? arg[this.majorPSDEField]
: arg.srfmajortext
: this.view.$t('app.local.new');
this.setTabCaption(this.view.model.dataInfo, Object.is(arg.srfuf, '0'));
const newdata: boolean = !Object.is(arg.srfuf, '1');
this.calcToolbarItemState(newdata);
this.calcToolbarItemAuthState(this.transformData(arg));
this.emitViewEvent('save', arg);
this.emitViewEvent('viewdataschange',arg);
this.emitViewEvent('viewstatechange',{isSave:true});
if(this.view && this.view.viewInstance && Object.is(this.view.viewInstance.viewType,"DEEDITVIEW9")){
this.emitViewEvent('drdatasaved',arg);
}
}
/**
* 表单删除完成
*
* @param {*} args
* @memberof EditViewEngine
*/
public onFormRemove(arg: any): void {
this.emitViewEvent('remove', arg);
this.emitViewEvent('viewdataschange', arg);
}
/**
* 处理实体界面行为
*
* @param {string} tag
* @param {string} [actionmode]
* @returns {void}
* @memberof EditViewEngine
*/
public doSysUIAction(tag: string, actionmode?: string): void {
if (Object.is(tag, 'Save')) {
this.doSave();
return;
}
super.doSysUIAction(tag, actionmode);
}
/**
* 编辑界面_保存操作
*
* @memberof IBizEditViewController
*/
public doSave(): void {
this.saveData({});
}
/**
* 保存视图数据
*
* @param {*} [arg={}]
* @memberof EditViewEngine
*/
public saveData(arg: any = {}): void {
if (this.getForm()) {
const tag = this.getForm().name;
this.setViewState2({ tag: tag, action: 'save', viewdata: arg });
}
}
/**
* 获取表单对象
*
* @returns {*}
* @memberof EditViewEngine
*/
public getForm(): any {
return this.form;
}
/**
* 设置分页标题
*
* @memberof EditViewEngine
*/
public setTabCaption(info: string, isNew: boolean): void {
let viewModel: any = this.view.model;
if (viewModel && info && !Object.is(info, '')) {
// 解决表格视图标题问题
if (this.view.$tabPageExp && this.view.viewDefaultUsage) {
this.view.$tabPageExp.setCurPageCaption({
caption: viewModel.srfCaption,
title: viewModel.srfCaption,
info: info,
viewtag: this.view.viewtag
}
);
}
if (this.view.$route) {
this.view.$route.meta.info = info;
}
}
}
/**
* 将抄送任务标记为已读
*
* @param data 业务数据
* @memberof EditViewEngine
*/
public readTask(data: any) {
if (Object.is(this.view?.viewparams?.srfwf, "cc")) {
if (this.view.readTask && this.view.readTask instanceof Function) {
Object.assign(data, { taskId: this.view.viewparams.srftaskid });
this.view.readTask(data);
}
}
}
/**
* 转化数据
*
* @memberof EditViewEngine
*/
public transformData(arg: any) {
if (!this.getForm() || !(this.getForm().transformData instanceof Function)) {
return null;
}
return this.getForm().transformData(arg);
}
}
import { EditViewEngine } from './edit-view-engine';
/**
* 实体编辑视图(左右关系)界面引擎
*
* @export
* @class EditView2Engine
* @extends {EditViewEngine}
*/
export class EditView2Engine extends EditViewEngine {
/**
* 数据关系栏
*
* @protected
* @type {*}
* @memberof EditView2Engine
*/
protected drBar: any;
/**
* Creates an instance of EditView2Engine.
*
* @memberof EditView2Engine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} [options={}]
* @memberof EditView2Engine
*/
public init(options: any = {}): void {
this.drBar = options.drbar;
super.init(options);
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof EditView2Engine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'drbar')) {
this.drbarEvent(eventName, args);
}
}
/**
* 数据关系栏事件
*
* @param {string} eventName
* @param {any[]} args
* @memberof EditView2Engine
*/
public drbarEvent(eventName: string, args: any[]): void {
if (Object.is(eventName, 'selectionchange')) {
this.drBarSelectionChange(args);
}
}
/**
* 数据关系栏选中
*
* @param {any[]} args
* @memberof EditView2Engine
*/
public drBarSelectionChange(args: any[]): void {
const item = args[0];
if (!item || Object.keys(item).length === 0) {
return;
}
this.view.selection = {};
Object.assign(this.view.selection, JSON.parse(JSON.stringify(item)));
}
/**
* 表单加载完成
*
* @param {*} [arg={}]
* @memberof EditView2Engine
*/
public onFormLoad(arg: any = {}): void {
super.onFormLoad(arg);
if (this.getDRBar()) {
const tag = this.getDRBar().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* 表单保存完成
*
* @param {*} [arg={}]
* @memberof EditView2Engine
*/
public onFormSave(arg: any = {}): void {
super.onFormSave(arg);
if (this.getDRBar()) {
const tag = this.getDRBar().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* 获取关系
*
* @returns {*}
* @memberof EditView2Engine
*/
public getDRBar(): any {
return this.drBar;
}
}
\ No newline at end of file
import { EditViewEngine } from './edit-view-engine';
/**
* 实体编辑视图(分页关系)界面引擎
*
* @export
* @class EditView3Engine
* @extends {EditViewEngine}
*/
export class EditView3Engine extends EditViewEngine {
/**
* 数据关系栏
*
* @protected
* @type {*}
* @memberof EditView3Engine
*/
protected drTab: any;
/**
* Creates an instance of EditView3Engine.
*
* @memberof EditView3Engine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} [options={}]
* @memberof EditView3Engine
*/
public init(options: any = {}): void {
this.drTab = options.drtab;
super.init(options);
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof EditView3Engine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'drtab')) {
this.drTabEvent(eventName, args);
}
}
/**
* 数据关系栏事件
*
* @param {string} eventName
* @param {any[]} args
* @memberof EditView3Engine
*/
public drTabEvent(eventName: string, args: any[]): void {
if (Object.is(eventName, 'selectionchange')) {
this.drTabSelectionChange(args);
}
}
/**
* 数据关系栏选中
*
* @param {any[]} args
* @memberof EditView3Engine
*/
public drTabSelectionChange(args: any[]): void {
const item = args[0];
if (!item || Object.keys(item).length === 0) {
return;
}
this.view.selection = {};
Object.assign(this.view.selection, JSON.parse(JSON.stringify(item)));
}
/**
* 表单加载完成
*
* @param {*} [arg={}]
* @memberof EditView3Engine
*/
public onFormLoad(arg: any = {}): void {
super.onFormLoad(arg);
if (this.getDrTab()) {
const tag = this.getDrTab().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* 表单保存完成
*
* @param {*} [arg={}]
* @memberof EditView3Engine
*/
public onFormSave(arg: any = {}): void {
super.onFormSave(arg);
if (this.getDrTab()) {
const tag = this.getDrTab().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* 获取关系
*
* @returns {*}
* @memberof EditView3Engine
*/
public getDrTab(): any {
return this.drTab;
}
}
\ No newline at end of file
import { EditViewEngine } from './edit-view-engine';
/**
* 实体编辑视图(上下关系)界面引擎
*
* @export
* @class EditView4Engine
* @extends {EditViewEngine}
*/
export class EditView4Engine extends EditViewEngine {
/**
* 数据关系栏
*
* @protected
* @type {*}
* @memberof EditView4Engine
*/
protected drTab: any;
/**
* Creates an instance of EditView4Engine.
*
* @memberof EditView4Engine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} [options={}]
* @memberof EditView4Engine
*/
public init(options: any = {}): void {
this.drTab = options.drtab;
super.init(options);
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof EditView4Engine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'drtab')) {
this.drTabEvent(eventName, args);
}
}
/**
* 数据关系栏事件
*
* @param {string} eventName
* @param {any[]} args
* @memberof EditView4Engine
*/
public drTabEvent(eventName: string, args: any[]): void {
if (Object.is(eventName, 'selectionchange')) {
this.drTabSelectionChange(args);
}
}
/**
* 数据关系栏选中
*
* @param {any[]} args
* @memberof EditView4Engine
*/
public drTabSelectionChange(args: any[]): void {
const item = args[0];
if (!item || Object.keys(item).length === 0) {
return;
}
this.view.selection = {};
Object.assign(this.view.selection, JSON.parse(JSON.stringify(item)));
}
/**
* 表单加载完成
*
* @param {*} [arg={}]
* @memberof EditView4Engine
*/
public onFormLoad(arg: any = {}): void {
super.onFormLoad(arg);
if (this.getDrTab()) {
const tag = this.getDrTab().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* 表单保存完成
*
* @param {*} [arg={}]
* @memberof EditView4Engine
*/
public onFormSave(arg: any = {}): void {
super.onFormSave(arg);
if (this.getDrTab()) {
const tag = this.getDrTab().name;
Object.assign(arg, {
srfparentdename: this.getForm().appDeCodeName,
srfparentkey: arg.srfkey,
});
this.setViewState2({ tag: tag, action: 'state', viewdata: arg });
}
}
/**
* 获取关系
*
* @returns {*}
* @memberof EditView4Engine
*/
public getDrTab(): any {
return this.drTab;
}
}
\ No newline at end of file
import { EditViewEngine } from './edit-view-engine';
/**
*
*
* @export
* @class EditView9Engine
* @extends {EditViewEngine}
*/
export class EditView9Engine extends EditViewEngine {
}
import { MDViewEngine } from './md-view-engine';
/**
* 视图引擎基础
*
* @export
* @class GridViewEngine
* @extends {MDViewEngine}
*/
export class FormPickupDataViewEngine extends MDViewEngine {
/**
* 数据视图部件
*
* @type {*}
* @memberof FormPickupDataViewEngine
*/
protected dataview: any;
/**
* Creates an instance of GridViewEngine.
* @memberof GridViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof GridViewEngine
*/
public init(options: any = {}): void {
this.dataview = options.dataview;
super.init(options);
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'dataview')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof GridViewEngine
*/
public getMDCtrl(): any {
return this.dataview;
}
}
\ No newline at end of file
import { ViewEngine } from './view-engine';
/**
* 表格导航视图界面引擎
*
* @export
* @class GridExpViewEngine
* @extends {ViewEngine}
*/
export class GridExpViewEngine extends ViewEngine {
/**
* 表格导航栏部件
*
* @type {*}
* @memberof GridExpViewEngine
*/
public gridExpBar: any = null;
/**
* Creates an instance of GridExpViewEngine.
*
* @memberof GridExpViewEngine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} options
* @memberof GridExpViewEngine
*/
public init(options: any): void {
this.gridExpBar = options.gridexpbar;
super.init(options);
}
/**
* 引擎加载
*
* @memberof GridExpViewEngine
*/
public load(): void {
super.load();
if (this.getGridExpBar() && this.isLoadDefault) {
const tag = this.getGridExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'gridexpbar')) {
this.gridExpBarEvent(eventName, args);
}
}
/**
* 表格导航事件
*
* @param {string} eventName
* @param {*} args
* @memberof GridExpViewEngine
*/
public gridExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.emitViewEvent('viewload', args);
}
if (Object.is(eventName, 'selectionchange')) {
this.emitViewEvent('viewdataschange', args);
}
if (Object.is(eventName, 'activated')) {
this.emitViewEvent('viewdatasactivated', args);
}
}
/**
* 获取部件对象
*
* @returns {*}
* @memberof GridExpViewEngine
*/
public getGridExpBar(): any {
return this.gridExpBar;
}
}
\ No newline at end of file
import { MDViewEngine } from './md-view-engine';
/**
* 视图引擎基础
*
* @export
* @class GridViewEngine
* @extends {MDViewEngine}
*/
export class GridViewEngine extends MDViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof GridViewEngine
*/
protected grid: any;
/**
* Creates an instance of GridViewEngine.
* @memberof GridViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof GridViewEngine
*/
public init(options: any = {}): void {
this.grid = options.grid;
super.init(options);
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'grid')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof GridViewEngine
*/
public getMDCtrl(): any {
return this.grid;
}
/**
* 事件处理
*
* @param {string} eventName
* @param {*} args
* @memberof GridViewEngine
*/
public MDCtrlEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'rowdblclick') && this.gridRowAllowActive(2)) {
this.doEdit(args);
return;
}
if (Object.is(eventName, 'rowclick') && this.gridRowAllowActive(1)) {
this.doEdit(args);
return;
}
if (Object.is(eventName, 'selectionchange')) {
this.selectionChange(args);
return;
}
super.MDCtrlEvent(eventName, args);
}
/**
* 表格是否被允许激活
*
* @param {number} mode
* @returns {boolean}
* @memberof GridViewEngine
*/
public gridRowAllowActive(mode: number): boolean {
return this.view.gridRowActiveMode === mode ? true : false;
}
/**
* @description 多数据部件加载完成
* @param {any[]} args
* @memberof GridViewEngine
*/
public MDCtrlLoad(args: any[]) {
super.MDCtrlLoad(args);
this.view.$nextTick(() => {
this.setViewContentHeight();
});
}
/**
* @description 设置视图内容区高度
* @memberof GridViewEngine
*/
public setViewContentHeight() {
const viewHeader:any = this.view.$el.getElementsByClassName('ivu-card-head')[0];
const viewContent: any = this.view.$el.getElementsByClassName('ivu-card-body')[0];
if (viewHeader?.offsetHeight && viewHeader?.offsetHeight != 49) {
viewContent.style.height = `calc(100% - ${viewHeader.offsetHeight}px)`
}
}
}
\ No newline at end of file
import { GridViewEngine } from "./grid-view-engine";
/**
* 实体表格视图(上下关系)视图引擎
*
* @export
* @class GridView4Engine
* @extends {GridViewEngine}
*/
export class GridView4Engine extends GridViewEngine {
/**
* 数据关系分页部件
*
* @protected
* @type {*}
* @memberof GridView4Engine
*/
protected drTab: any = null;
/**
* 引擎初始化
*
* @param {*} opts
* @memberof GridView4Engine
*/
init(opts: any) {
this.drTab = opts.drtab;
super.init(opts);
}
/**
* 选中数据变化
*
* @param {any[]} args
* @memberof GridView4Engine
*/
public selectionChange(args: any[]): void {
if (this.getDrTab() && args && args.length) {
const data = args[0];
Object.assign(data, {
srfparentdename: this.getMDCtrl()?.appDeCodeName,
srfparentkey: data.srfkey,
});
this.setViewState2({ tag: this.getDrTab().name, action: 'state', viewdata: data });
}
super.selectionChange(args);
}
/**
* 获取数据关系分页部件
*
* @return {*}
* @memberof GridView4Engine
*/
public getDrTab() {
return this.drTab;
}
}
\ No newline at end of file
import { GridViewEngine } from './grid-view-engine';
/**
* 视图引擎基础
*
* @export
* @class GridView8Engine
* @extends {GridViewEngine}
*/
export class GridView8Engine extends GridViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof GridView8Engine
*/
protected grid: any;
/**
* 表格部件
*
* @protected
* @type {*}
* @memberof Grid8ViewEngine
*/
protected totalgrid: any;
/**
* 选中数据集
*
* @protected
* @type {any[]}
* @memberof Grid8ViewEngine
*/
public selections: any[] = [];
/**
* 选中数据集
*
* @protected
* @type {any[]}
* @memberof Grid8ViewEngine
*/
public selections2: any[] = [];
/**
* Creates an instance of GridView8Engine.
* @memberof GridView8Engine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof GridView8Engine
*/
public init(options: any = {}): void {
this.grid = options.grid;
this.totalgrid = options.totalgrid;
super.init(options);
}
/**
* 引擎加载
*
* @memberof MDViewEngine
*/
public load(): void {
super.load();
this.load2();
}
/**
* 加载
*
* @memberof Grid8ViewEngine
*/
public load2(): void {
if (this.getMDCtrl2()) {
const tag = this.getMDCtrl2().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
}
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridView8Engine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'totalgrid')) {
this.MD2Event(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof GridView8Engine
*/
public getMDCtrl(): any {
return this.grid;
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof GridView8Engine
*/
public getMDCtrl2(): any {
return this.totalgrid;
}
/**
* 删除
*
* @param {*} [arg={}]
* @returns {void}
* @memberof GridView8Engine
*/
public removeData(items: any[] = []): void {
let arg: any = {};
// 获取要删除的数据集合
if (!items || items == null || items.length === 0) {
return;
}
let keys = '';
items.forEach((item) => {
let key = item.srfkey;
if (!Object.is(keys, '')) {
keys += ';';
}
keys += key;
});
arg.srfkeys = keys;
const grid: any = this.getMDCtrl();
if (grid) {
grid.remove(arg);
}
}
/**
* 添加数据
*
* @param {any[]} [items=[]]
* @memberof Grid8ViewEngine
*/
public addBatchData(items: any[] = []): void {
let arg: any = {};
// 获取要添加的数据集合
if (!items || items == null || items.length === 0) {
return;
}
let keys = '';
items.forEach((item) => {
let key = item.srfkey;
if (!Object.is(keys, '')) {
keys += ';';
}
keys += key;
});
arg.srfkeys = keys;
const grid: any = this.getMDCtrl();
if (grid) {
grid.addBatchData(arg);
}
}
/**
*
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof GridView8Engine
*/
public MDEvent(eventName: string, args: any = {}): void {
if (Object.is(eventName, 'rowclick')) {
// this.***()
}
if (Object.is(eventName, 'rowdblclick')) {
// this.doEdit(args);
}
if (Object.is(eventName, 'selectionchange')) {
// this.***()
this.selectionChange(args);
}
if (Object.is(eventName, 'remove')) {
this.load2();
}
}
/**
*
*
* @param {string} eventName
* @param {*} [args={}]
* @memberof GridView8Engine
*/
public MD2Event(eventName: string, args: any = {}): void {
if (Object.is(eventName, 'rowclick')) {
// this.***()
}
if (Object.is(eventName, 'rowdblclick')) {
// this.doEdit(args);
}
if (Object.is(eventName, 'selectionchange')) {
// this.***()
this.selectionChange2(args);
}
}
/**
* 选中变化
*
* @param {any[]} args
* @memberof GridView8Engine
*/
public selectionChange(args: any[]): void {
this.selections = [...args];
}
/**
* 选中变化
*
* @param {any[]} args
* @memberof GridView8Engine
*/
public selectionChange2(args: any[]): void {
this.selections2 = [...args];
}
/**
* 移动数据
*
* @memberof Grid8ViewEngine
*/
public moveData() {
this.addBatchData(this.selections2);
}
/**
* 移动数据
*
* @memberof Grid8ViewEngine
*/
public moveData2() {
this.removeData(this.selections);
}
/**
* 移动全部数据
*
* @memberof Grid8ViewEngine
*/
public moveAllData() {
if (this.getMDCtrl2()) {
var items: any[] = this.getMDCtrl2().getDatas();
this.addBatchData(items);
}
}
/**
* 移动全部数据
*
* @memberof Grid8ViewEngine
*/
public moveAllData2() {
if (this.getMDCtrl()) {
var items: any[] = this.getMDCtrl().getDatas();
this.removeData(items);
}
}
}
import { GridViewEngine } from './grid-view-engine';
/**
* 视图引擎基础
*
* @export
* @class GridView9Engine
* @extends {GridViewEngine}
*/
export class GridView9Engine extends GridViewEngine {
/**
* Creates an instance of GridView9Engine.
* @memberof GridView9Engine
*/
constructor() {
super();
}
}
\ No newline at end of file
import { ViewEngine } from './view-engine';
/**
*
*
* @export
* @class HtmlViewEngine
* @extends {ViewEngine}
*/
export class HtmlViewEngine extends ViewEngine {
}
export { ViewEngine } from './view-engine';
export { EditViewEngine } from './edit-view-engine';
export { EditView2Engine } from './edit-view2-engine';
export { EditView3Engine } from './edit-view3-engine';
export { EditView4Engine } from './edit-view4-engine';
export { EditView9Engine } from './edit-view9-engine';
export { MDViewEngine } from './md-view-engine';
export { GridViewEngine } from './grid-view-engine';
export { GridExpViewEngine } from './grid-exp-view-engine';
export { GridView8Engine } from './grid-view8-engine';
export { GridView9Engine } from './grid-view9-engine';
export { CalendarExpViewEngine } from './calendar-exp-view-engine';
export { ChartViewEngine } from './chart-view-engine';
export { ChartExpViewEngine } from './chart-exp-view-engine';
export { ChartView9Engine } from './chart-view9-engine';
export { DataViewEngine } from './data-view-engine';
export { DataViewExpViewEngine } from './data-view-exp-view-engine';
export { DataView9Engine } from './data-view9-engine';
export { FormPickupDataViewEngine } from './form-pickup-data-view-engine';
export { HtmlViewEngine } from './html-view-engine';
export { KanBanViewEngine } from './kan-ban-view-engine';
export { ListExpViewEngine } from './list-exp-view-engine';
export { ListViewEngine } from './list-view-engine';
export { ListView9Engine } from './list-view9-engine';
export { MapViewEngine } from './map-view-engine';
export { MapView9Engine } from './map-view9-engine';
export { MPickupViewEngine } from './mpickup-view-engine';
export { MPickupView2Engine } from './mpickup-view2-engine';
export { OptionViewEngine } from './option-view-engine';
export { PickupDataViewEngine } from './pickup-data-view-engine';
export { PickupGridViewEngine } from './pickup-grid-view-engine'
export { PickupTreeViewEngine } from './pickup-tree-view-engine';
export { PickupViewEngine } from './pickup-view-engine';
export { PickupView2Engine } from './pickup-view2-engine';
export { PickupView3Engine } from './pickup-view3-engine';
export { PortalViewEngine } from './portal-view-engine';
export { PortalView9Engine } from './portal-view9-engine';
export { SearchViewEngine } from './search-view-engine';
export { TabExpViewEngine } from './tab-exp-view-engine';
export { TabSearchViewEngine } from './tab-search-view-engine';
export { TreeExpViewEngine } from './tree-exp-view-engine';
export { TreeGridExViewEngine } from './tree-grid-ex-view-engine';
export { TreeViewEngine } from './tree-view-engine';
export { TreeView9Engine } from './tree-view9-engine';
export { WFActionViewEngine } from './wfaction-view-engine';
export { WFDynaEditViewEngine } from './wfdyna-edit-view-engine';
export { WFDynaExpGridViewEngine } from './wfdyna-exp-grid-view-engine';
export { WFEditViewEngine } from './wfedit-view-engine';
export { WFEditView3Engine } from './wfedit-view3-engine';
export { WFGridViewEngine } from './wfgrid-view-engine';
export { WFStartViewEngine } from './wfstart-view-engine';
export { WizardViewEngine } from './wizard-view-engine';
export { DataPanelEngine } from './data-panel-engine';
export { ReportViewEngine } from './report-view-engine';
export { MapExpViewEngine } from './map-exp-view-engine';
export { CommonViewEngine } from './common-view-engine';
export * from './trigger-engine';
export { DeIndexViewEngine } from './deindex-view-engine';
export { GridView4Engine } from './grid-view4-engine';
\ No newline at end of file
import { DataViewEngine } from './data-view-engine';
/**
* 视图引擎基础
*
* @export
* @class DataViewEngine
* @extends {MDViewEngine}
*/
export class KanBanViewEngine extends DataViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof DataViewEngine
*/
protected kanban: any;
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof DataViewEngine
*/
public init(options: any = {}): void {
this.kanban = options.kanban;
super.init(options);
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof DataViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'kanban')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof DataViewEngine
*/
public getMDCtrl(): any {
return this.kanban;
}
}
\ No newline at end of file
import { ViewEngine } from './view-engine';
/**
* 列表导航视图界面引擎
*
* @export
* @class ListExpViewEngine
* @extends {ViewEngine}
*/
export class ListExpViewEngine extends ViewEngine {
/**
* 列表导航栏部件
*
* @type {*}
* @memberof ListExpViewEngine
*/
public listExpBar: any = null;
/**
* Creates an instance of ListExpViewEngine.
*
* @memberof ListExpViewEngine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} options
* @memberof ListExpViewEngine
*/
public init(options: any): void {
this.listExpBar = options.listexpbar;
super.init(options);
}
/**
* 引擎加载
*
* @memberof ListExpViewEngine
*/
public load(): void {
super.load();
if (this.getListExpBar() && this.isLoadDefault) {
const tag = this.getListExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof ListExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'listexpbar')) {
this.listExpBarEvent(eventName, args);
}
}
/**
* 列表导航事件
*
* @param {string} eventName
* @param {*} args
* @memberof ListExpViewEngine
*/
public listExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.emitViewEvent('viewload', args);
}
if (Object.is(eventName, 'selectionchange')) {
this.emitViewEvent('viewdataschange', args);
}
if (Object.is(eventName, 'activated')) {
this.emitViewEvent('viewdatasactivated', args);
}
}
/**
* 获取部件对象
*
* @returns {*}
* @memberof ListExpViewEngine
*/
public getListExpBar(): any {
return this.listExpBar;
}
}
\ No newline at end of file
import { MDViewEngine } from './md-view-engine';
/**
* 视图引擎基础
*
* @export
* @class ListViewEngine
* @extends {MDViewEngine}
*/
export class ListViewEngine extends MDViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof ListViewEngine
*/
protected list: any;
/**
* Creates an instance of ListViewEngine.
* @memberof ListViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof ListViewEngine
*/
public init(options: any = {}): void {
this.list = options.list;
super.init(options);
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof ListViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'list')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof ListViewEngine
*/
public getMDCtrl(): any {
return this.list;
}
/**
* 删除操作
*
* @returns {void}
* @memberof ListViewEngine
*/
public doRemove(): void {
let selectedData = this.getMDCtrl() && this.getMDCtrl().getSelection();
if (!selectedData || selectedData == null || selectedData.length === 0) {
return;
}
let dataInfo = '';
selectedData.forEach((record: any, index: number) => {
let srfmajortext = record.srfmajortext;
if (index < 5) {
if (!Object.is(dataInfo, '')) {
dataInfo += '、';
}
dataInfo += srfmajortext;
} else {
return false;
}
});
if (selectedData.length < 5) {
dataInfo = dataInfo + this.view.$t('app.dataview.sum') + selectedData.length + this.view.$t('app.dataview.data');
} else {
dataInfo = dataInfo + '...' + this.view.$t('app.dataview.sum') + selectedData.length + this.view.$t('app.dataview.data');
}
dataInfo = dataInfo.replace(/[null]/g, '').replace(/[undefined]/g, '').replace(/[ ]/g, '');
// 询问框
this.view.$Modal.confirm({
title:this.view.$t('app.commonwords.warning'),
content: this.view.$t('app.grid.confirmdel') + dataInfo + ',' + this.view.$t('app.grid.notrecoverable'),
onOk:() => {
this.removeData(null);
},
onCancel: () => {
}
});
}
/**
* 删除
*
* @param {*} [arg={}]
* @returns {void}
* @memberof ListViewEngine
*/
public removeData(arg: any = {}): void {
if (!arg) {
arg = {};
}
if (!arg.srfkeys) {
// 获取要删除的数据集合
const selectedData: Array<any> = this.getMDCtrl() && this.getMDCtrl().getSelection();
if (!selectedData || selectedData == null || selectedData.length === 0) {
return;
}
let keys = '';
selectedData.forEach((record) => {
let key = record.srfkey;
if (!Object.is(keys, '')) {
keys += ';';
}
keys += key;
});
arg.srfkeys = keys;
}
const list: any = this.getMDCtrl();
if (list) {
list.remove(arg);
}
}
}
\ No newline at end of file
import { ListViewEngine } from './list-view-engine';
/**
*
*
* @export
* @class EditView9Engine
* @extends {EditViewEngine}
*/
export class ListView9Engine extends ListViewEngine {
}
import { ViewEngine } from './view-engine';
/**
* 地图导航视图界面引擎
*
* @export
* @class MapExpViewEngine
* @extends {ViewEngine}
*/
export class MapExpViewEngine extends ViewEngine {
/**
* 表格导航栏部件
*
* @type {*}
* @memberof MapExpViewEngine
*/
public mapExpBar: any = null;
/**
* Creates an instance of MapExpViewEngine.
*
* @memberof MapExpViewEngine
*/
constructor() {
super();
}
/**
* 初始化引擎
*
* @param {*} options
* @memberof MapExpViewEngine
*/
public init(options: any): void {
this.mapExpBar = options.mapexpbar;
super.init(options);
}
/**
* 引擎加载
*
* @memberof MapExpViewEngine
*/
public load(): void {
super.load();
if (this.getMapExpBar() && this.isLoadDefault) {
const tag = this.getMapExpBar().name;
this.setViewState2({ tag: tag, action: 'load', viewdata: this.view.viewparams });
} else {
this.isLoadDefault = true;
}
}
/**
* 部件事件机制
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MapExpViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
super.onCtrlEvent(ctrlName, eventName, args);
if (Object.is(ctrlName, 'mapexpbar')) {
this.mapExpBarEvent(eventName, args);
}
}
/**
* 地图导航事件
*
* @param {string} eventName
* @param {*} args
* @memberof MapExpViewEngine
*/
public mapExpBarEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'load')) {
this.emitViewEvent('viewload', args);
}
if (Object.is(eventName, 'selectionchange')) {
this.emitViewEvent('viewdataschange', args);
}
if (Object.is(eventName, 'activated')) {
this.emitViewEvent('viewdatasactivated', args);
}
}
/**
* 获取部件对象
*
* @returns {*}
* @memberof MapExpViewEngine
*/
public getMapExpBar(): any {
return this.mapExpBar;
}
}
\ No newline at end of file
import { MDViewEngine } from './md-view-engine';
/**
* 视图引擎基础
*
* @export
* @class GridViewEngine
* @extends {MDViewEngine}
*/
export class MapViewEngine extends MDViewEngine {
/**
* 表格部件
*
* @type {*}
* @memberof GridViewEngine
*/
protected map: any;
/**
* Creates an instance of GridViewEngine.
* @memberof MapViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof MapViewEngine
*/
public init(options: any = {}): void {
this.map = options.map;
super.init(options);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof MapViewEngine
*/
public getMDCtrl(): any {
return this.map;
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof MapViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'map')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 事件处理
*
* @param {string} eventName
* @param {*} args
* @memberof MapViewEngine
*/
public MDCtrlEvent(eventName: string, args: any): void {
if (Object.is(eventName, 'selectionchange')) {
// this.selectionChange(args);
// this.doEdit(args);
return;
}
super.MDCtrlEvent(eventName, args);
}
}
\ No newline at end of file
import { MapViewEngine } from './map-view-engine';
/**
* 视图引擎基础
*
* @export
* @class GridViewEngine
* @extends {MDViewEngine}
*/
export class MapView9Engine extends MapViewEngine {
}
\ No newline at end of file
import { EditViewEngine } from './edit-view-engine';
/**
* 实体选项操作视图界面引擎
*
* @export
* @class OptionViewEngine
* @extends {EditViewEngine}
*/
export class OptionViewEngine extends EditViewEngine {
/**
* Creates an instance of OptionViewEngine.
* 创建 OptionViewEngine 实例对象
*
* @memberof OptionViewEngine
*/
constructor() {
super();
}
}
\ No newline at end of file
import { MDViewEngine } from './md-view-engine';
/**
* 视图引擎基础
*
* @export
* @class GridViewEngine
* @extends {MDViewEngine}
*/
export class PickupDataViewEngine extends MDViewEngine {
/**
* 数据视图部件
*
* @type {*}
* @memberof FormPickupDataViewEngine
*/
protected dataview: any;
/**
* Creates an instance of GridViewEngine.
* @memberof GridViewEngine
*/
constructor() {
super();
}
/**
* 引擎初始化
*
* @param {*} [options={}]
* @memberof GridViewEngine
*/
public init(options: any = {}): void {
this.dataview = options.dataview;
super.init(options);
}
/**
* 部件事件
*
* @param {string} ctrlName
* @param {string} eventName
* @param {*} args
* @memberof GridViewEngine
*/
public onCtrlEvent(ctrlName: string, eventName: string, args: any): void {
if (Object.is(ctrlName, 'dataview')) {
this.MDCtrlEvent(eventName, args);
}
super.onCtrlEvent(ctrlName, eventName, args);
}
/**
* 获取多数据部件
*
* @returns {*}
* @memberof GridViewEngine
*/
public getMDCtrl(): any {
return this.dataview;
}
}
\ No newline at end of file
export { AppUITriggerEngine } from './app-ui-trigger-engine';
export { AppCtrlEventEngine } from './app-ctrlevent-engine';
export { AppViewEventEngine } from './app-viewevent-engine';
export { AppCustomEngine } from './app-custom-engine';
export { AppTimerEngine } from './app-timer-engine';
export { EntityBase } from './entity-base';
export { Entity } from './entity';
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册