Browse Source

refactor: 重构页面

qufenxi
alan 5 years ago
parent
commit
d3ec5be295
  1. 10
      .eslintignore
  2. 235
      .eslintrc
  3. 7
      .gitattributes
  4. 11
      .gitignore
  5. 239
      README.md
  6. BIN
      assets/font/iconfont.eot
  7. 119
      assets/font/iconfont.svg
  8. BIN
      assets/font/iconfont.ttf
  9. BIN
      assets/font/iconfont.woff
  10. 29
      babel.config.js
  11. 6
      config/fineui.prepare.js
  12. 48
      config/fineui.setup.js
  13. 34
      config/jest.environment.js
  14. 238
      i18n/zh_cn.properties
  15. 44
      index.html
  16. 26
      jest.config.js
  17. 15
      lib/transform-i18n/transform-i18n.js
  18. 7
      lib/upgrade/index.js
  19. 103
      package.json
  20. 373
      private/constants.ts
  21. 241
      private/i18n.ts
  22. 180
      redis.js
  23. 4
      src/app/app.constant.ts
  24. 39
      src/app/app.model.ts
  25. 55
      src/app/app.ts
  26. 4
      src/app/connection/left/item/left_item.less
  27. 77
      src/app/connection/left/item/left_item.ts
  28. 43
      src/app/connection/left/item/left_item_delete.ts
  29. 26
      src/app/connection/left/item/left_item_icon.ts
  30. 39
      src/app/connection/left/left.ts
  31. 50
      src/app/connection/link_set.mixin.ts
  32. 154
      src/app/connection/link_set.model.ts
  33. 26
      src/app/connection/link_set.service.ts
  34. 58
      src/app/connection/link_set.ts
  35. 6
      src/app/connection/more/item/more_link_item.less
  36. 68
      src/app/connection/more/item/more_link_item.ts
  37. 6
      src/app/connection/more/item/more_link_litem.model.ts
  38. 16
      src/app/connection/more/more_link.model.ts
  39. 50
      src/app/connection/more/more_link.service.ts
  40. 52
      src/app/connection/more/more_link.ts
  41. 30
      src/app/connection/right/nothing.ts
  42. 33
      src/app/connection/right/right.ts
  43. 25
      src/app/connection/right/right.typing.d.ts
  44. 6
      src/app/connection/right/right_detail/right_detail.model.ts
  45. 74
      src/app/connection/right/right_detail/right_detail.ts
  46. 20
      src/app/connection/right/right_edit/right_edit.model.ts
  47. 24
      src/app/connection/right/right_edit/right_edit.service.ts
  48. 373
      src/app/connection/right/right_edit/right_edit.ts
  49. 226
      src/app/connection/right/right_edit/right_edit_jndi.ts
  50. 325
      src/app/connection/right/right_edit/right_edit_mysql.ts
  51. 20
      src/app/connection/right/right_show/right_show.model.ts
  52. 72
      src/app/connection/right/right_show/right_show.ts
  53. 203
      src/app/connection/right/right_show/right_show_jndi.ts
  54. 20
      src/app/connection/right/right_title/right_title.model.ts
  55. 66
      src/app/connection/right/right_title/right_title.ts
  56. 23
      src/app/connection/select/select.service.ts
  57. 77
      src/app/connection/select/select.ts
  58. 17
      src/app/status/left/left.model.ts
  59. 44
      src/app/status/left/left.ts
  60. 39
      src/app/status/left/left_item.ts
  61. 9
      src/app/status/link_status.model.ts
  62. 63
      src/app/status/link_status.ts
  63. 14
      src/app/status/right/right.model.ts
  64. 68
      src/app/status/right/right.ts
  65. 6
      src/app/status/right/right.typings.d.ts
  66. 91
      src/app/status/right/right_card.ts
  67. 8
      src/app/title/title.less
  68. 11
      src/app/title/title.model.ts
  69. 61
      src/app/title/title.ts
  70. 91
      src/demo/plugin.redis.edit.ts
  71. 68
      src/demo/plugin.redis.preview.ts
  72. 53
      src/demo/plugin.tedis.pool.ts
  73. 3
      src/demo/style.scss
  74. 3
      src/i18n.ts
  75. BIN
      src/img/ads.jpg
  76. BIN
      src/img/amazon-redshift.jpg
  77. BIN
      src/img/apache-impala.jpg
  78. BIN
      src/img/apache-kylin.jpg
  79. BIN
      src/img/apache-phoenix.jpg
  80. BIN
      src/img/database-selected.png
  81. BIN
      src/img/derby.jpg
  82. BIN
      src/img/error.png
  83. BIN
      src/img/gbase-8a.jpg
  84. BIN
      src/img/gbase-8s.jpg
  85. BIN
      src/img/gbase-8t.jpg
  86. BIN
      src/img/h2.jpg
  87. BIN
      src/img/hadoop-hive.jpg
  88. BIN
      src/img/hbase.jpg
  89. BIN
      src/img/hp-vertica.jpg
  90. BIN
      src/img/hsql.jpg
  91. BIN
      src/img/hw-dws.jpg
  92. BIN
      src/img/hw-elk.jpg
  93. BIN
      src/img/hw-fusioninsight-hd.jpg
  94. BIN
      src/img/hw-libr-a.jpg
  95. BIN
      src/img/ibm-db2.jpg
  96. BIN
      src/img/icon_close9x9_normal.png
  97. BIN
      src/img/informix.jpg
  98. BIN
      src/img/kingbase.jpg
  99. BIN
      src/img/loading.gif
  100. BIN
      src/img/mysql.jpg
  101. Some files were not shown because too many files have changed in this diff Show More

10
.eslintignore

@ -1,5 +1,5 @@
dist/*.js types
src/assets/* node_modules/
src/lib/* dist/
webpack.config.js assets/
curd.mock.ts webpack/

235
.eslintrc.js → .eslintrc

@ -1,89 +1,61 @@
module.exports = { {
parser: '@typescript-eslint/parser', "env": {
plugins: ['@typescript-eslint'], "browser": true,
extends: ['plugin:@typescript-eslint/recommended'], "node": true,
rules:{ "es6": true,
"indent": "off", "jest/globals": true
"quotes": [1, "single"], },
"space-infix-ops": 2,//操作符前后有空格 "globals": {
// 必须使用 === 和 !== ,和 null 对比时除外 "Fix": true,
'eqeqeq': [2, 'always', { 'null': 'ignore' }], "BI": true,
// 函数的形参不能多于5个 "Report": true,
'max-params': [2, 5], "Dec": true,
// 禁止 switch 中出现相同的 case "DecCst": true
'no-duplicate-case': 2, },
// 禁止使用 var,必须用 let 或 const "parser": "@typescript-eslint/parser",
'no-var': 0, "parserOptions": {
// 禁止出现空代码块 "project": "./tsconfig.json",
'no-empty': [2, { 'allowEmptyCatch': true }], "ecmaVersion": 6,
// 禁止空的 function "sourceType": "module",
// 包含注释的情况下允许 "ecmaFeatures": {
'no-empty-function': 0, "modules": true
// if 后必须包含 { ,单行 if 除外
'curly': [2, 'multi-line', 'consistent'],
// for 循环不得因方向错误造成死循环
'for-direction': 2,
// 关键字前后必须有空格
'keyword-spacing': 2,
'key-spacing':2,
// 最大块嵌套深度为 5 层
'max-depth': [2, 5],
// 最大回调深度为 3 层
'max-nested-callbacks': [2, 3],
// 禁止普通字符串中出现模板字符串语法
'no-template-curly-in-string': 0,
// 禁止连等赋值
'no-multi-assign': 2,
// 禁止使用连续的空格
'no-multi-spaces': 2,
// 禁止使用 \ 来定义多行字符串,统一使用模板字符串来做
'no-multi-str': 2,
// 禁止使用 new Object
'no-new-object': 2,
// 禁止使用 new require
'no-new-require': 2,
// 禁止使用 new Symbol
'no-new-symbol': 2,
// 禁止 new Boolean、Number 或 String
'no-new-wrappers': 2,
// 禁止 new 一个类而不存储该实例
'no-new': 2,
// 禁止把原生对象 Math、JSON、Reflect 当函数使用
'no-obj-calls': 2,
// 禁止使用八进制转义符
'no-octal-escape': 2,
// 禁止使用0开头的数字表示八进制
'no-octal': 2,
// 禁止使用 __dirname + 'file' 的形式拼接路径,应该使用 path.join 或 path.resolve 来代替
'no-path-concat': 2,
// 禁止对函数的参数重新赋值
'no-param-reassign': 2,
// 禁止使用保留字作为变量名
'no-shadow-restricted-names': 2,
// 禁止数组中出现连续逗号
'no-sparse-arrays': 2,
// 禁止在finally块中出现 return、throw、break、continue
'no-unsafe-finally': 2,
// 禁止出现不安全的否定,如 for (!key in obj} {},应该写为 for (!(key in obj)} {}
'no-unsafe-negation': 2,
// ...后面不允许有空格
'rest-spread-spacing': [2, 'never'],
// 注释的斜线和星号后要加空格
'spaced-comment': [2, 'always', {
'block': {
exceptions: ['*'],
balanced: true
} }
}], },
// typeof 判断条件只能是 "undefined", "object", "boolean", "number", "string", "function" 或 "symbol" "plugins": ["@typescript-eslint", "jest"],
'valid-typeof': 2, "rules": {
"@typescript-eslint/indent": ["error", 2], "no-underscore-dangle": 0,
"@typescript-eslint/explicit-function-return-type": ["warn", { "prefer-rest-params": 0,
allowExpressions: true "no-plusplus": 0,
}], "max-len": 0,
"@typescript-eslint/no-explicit-any": ["off"], "no-use-before-define": [
"error",
{
"functions": false
}
],
"new-cap": [
"error",
{
"properties": false
}
],
"no-confusing-arrow": ["off"],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"args": "none",
"ignoreRestSiblings": true
}
],
"no-irregular-whitespace": [
"error",
{
"skipTemplates": false,
"skipStrings": false
}
],
// 声明 // 声明
"prefer-const": "error", //如果一个变量不会被重新赋值,最好使用const进行声明 "prefer-const": "error", //如果一个变量不会被重新赋值,最好使用const进行声明
"no-const-assign": "error", //不允许改变用const声明的变量 "no-const-assign": "error", //不允许改变用const声明的变量
@ -93,14 +65,8 @@ module.exports = {
"no-prototype-builtins": "error", // 禁止直接使用 Object.prototypes 的内置属性 "no-prototype-builtins": "error", // 禁止直接使用 Object.prototypes 的内置属性
"no-extend-native": "error", // 禁止扩展原生对象 "no-extend-native": "error", // 禁止扩展原生对象
"no-new-object": "error", // 禁止使用 Object 构造函数 "no-new-object": "error", // 禁止使用 Object 构造函数
"object-shorthand": [ "object-shorthand": ["error", "always"], //要求对象字面量简写语法
"error", "quote-props": ["error", "as-needed"], // 对象属性只在需要的时候加引号
"always"
], //要求对象字面量简写语法
"quote-props": [
"error",
"as-needed"
], // 对象属性只在需要的时候加引号
// 数组 // 数组
"no-sparse-arrays": "error", // 禁用稀疏数组 "no-sparse-arrays": "error", // 禁用稀疏数组
"no-array-constructor": "error", //禁止使用 Array 构造函数 "no-array-constructor": "error", //禁止使用 Array 构造函数
@ -114,16 +80,13 @@ module.exports = {
} }
], // 字符串开头和结束使用单引号 ], // 字符串开头和结束使用单引号
"prefer-template": "error", // 使用模板而非字符串连接 "prefer-template": "error", // 使用模板而非字符串连接
"template-curly-spacing": [ "template-curly-spacing": ["error", "never"], // 强制模板字符串中花括号内不能出现空格
"error",
"never"
], // 强制模板字符串中花括号内不能出现空格
"no-path-concat": "error", // 当使用 _dirname 和 _filename 时不允许字符串拼接 "no-path-concat": "error", // 当使用 _dirname 和 _filename 时不允许字符串拼接
"no-useless-concat": "error", // 禁止没有必要的字符拼接 "no-useless-concat": "error", // 禁止没有必要的字符拼接
"no-useless-escape": "error", // 禁用不必要的转义 "no-useless-escape": "error", // 禁用不必要的转义
// 函数 // 函数
"no-dupe-args": "error", // 禁止在 function 定义中出现重复的参数 "no-dupe-args": "error", // 禁止在 function 定义中出现重复的参数
"no-new-func": "error", // 禁用Function构造函数 // "no-new-func": "error", // 禁用Function构造函数
"no-return-assign": "error", // 禁止在返回语句中赋值 "no-return-assign": "error", // 禁止在返回语句中赋值
"func-style": [ "func-style": [
"error", "error",
@ -133,10 +96,7 @@ module.exports = {
} }
], // 统一函数风格为函数表达式或函数声明,并且允许使用箭头函数 ], // 统一函数风格为函数表达式或函数声明,并且允许使用箭头函数
"newline-before-return": "error", // 要求 return 语句之前有一空行 "newline-before-return": "error", // 要求 return 语句之前有一空行
"wrap-iife": [ "wrap-iife": ["error", "outside"], // 立即执行函数外部必须包裹括号
"error",
"outside"
], // 立即执行函数外部必须包裹括号
"no-loop-func": "error", // 禁止在非function内声明function "no-loop-func": "error", // 禁止在非function内声明function
// "space-before-function-paren": "error", // 函数括号前必须要有空格 // "space-before-function-paren": "error", // 函数括号前必须要有空格
"no-param-reassign": "error", // 禁止修改函数参数 "no-param-reassign": "error", // 禁止修改函数参数
@ -144,10 +104,7 @@ module.exports = {
// 箭头函数 // 箭头函数
"prefer-arrow-callback": "error", // 回调使用箭头函数 "prefer-arrow-callback": "error", // 回调使用箭头函数
"arrow-spacing": "error", // 箭头前后要有空格 "arrow-spacing": "error", // 箭头前后要有空格
"arrow-parens": [ "arrow-parens": ["error", "as-needed"], // 参数使用括号包裹
"error",
"as-needed"
], // 参数使用括号包裹
"arrow-body-style": [ "arrow-body-style": [
"error", "error",
"as-needed", "as-needed",
@ -167,10 +124,12 @@ module.exports = {
// 属性 // 属性
"dot-notation": "error", //强制在任何允许的时候使用点号访问属性 "dot-notation": "error", //强制在任何允许的时候使用点号访问属性
// 变量 // 变量
"no-undef": "error", // 禁止使用未声明的变量
// "one-var": ["error", "never"], // 变量统一声明 // "one-var": ["error", "never"], // 变量统一声明
// 比较运算符 & 相等运算符 // 比较运算符 & 相等运算符
"eqeqeq": "error", // 使用 === 和 !== 代替 == 和 != "eqeqeq": "error", // 使用 === 和 !== 代替 == 和 !=
"no-nested-ternary": "error", // 禁止混合的三目运算符 "no-case-declarations": "error", // 禁止在 case 或 default 子句中出现变量声明
// "no-nested-ternary": "error", // 禁止混合的三目运算符
"no-unneeded-ternary": "error", //禁止可以在有更简单的可替代的表达式时使用三元操作符 "no-unneeded-ternary": "error", //禁止可以在有更简单的可替代的表达式时使用三元操作符
// 条件 // 条件
"no-cond-assign": "error", // 禁止在条件语句中出现赋值操作符 "no-cond-assign": "error", // 禁止在条件语句中出现赋值操作符
@ -181,10 +140,7 @@ module.exports = {
"no-fallthrough": "error", // 禁止 case 语句落空 "no-fallthrough": "error", // 禁止 case 语句落空
// 代码块 // 代码块
"brace-style": "error", // 代码块左括号紧跟上一行结束 "brace-style": "error", // 代码块左括号紧跟上一行结束
"curly": [ "curly": ["error", "multi-line"], // if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号
"error",
"multi-line"
], // if、else if、else、for、while强制使用大括号,但允许在单行中省略大括号
"no-empty": [ "no-empty": [
"error", "error",
{ {
@ -193,11 +149,22 @@ module.exports = {
], // 禁止空块语句,但允许出现空的 catch 子句 ], // 禁止空块语句,但允许出现空的 catch 子句
// 注释 // 注释
"spaced-comment": "error", // 注释前有空格 "spaced-comment": "error", // 注释前有空格
"no-mixed-spaces-and-tabs": "error", // 禁止使用 空格 和 tab 混合缩进 "lines-around-comment": [
"space-before-blocks": [ "error",
{
"beforeBlockComment": false
}
], // 块级注释前要有空行
// 空白
"indent": [
"error", "error",
"always" 4,
], // 语句块之前的需要有空格 {
"SwitchCase": 1
}
], // 缩进控制4空格
"no-mixed-spaces-and-tabs": "error", // 禁止使用 空格 和 tab 混合缩进
"space-before-blocks": ["error", "always"], // 语句块之前的需要有空格
"keyword-spacing": "error", // 关键字后面必须要有空格 "keyword-spacing": "error", // 关键字后面必须要有空格
"space-infix-ops": [ "space-infix-ops": [
"error", "error",
@ -207,32 +174,14 @@ module.exports = {
], // 要求中缀操作符周围有空格,设置 int32Hint 选项为 true (默认 false) 允许 a|0 不带空格 ], // 要求中缀操作符周围有空格,设置 int32Hint 选项为 true (默认 false) 允许 a|0 不带空格
"eol-last": "error", // 要求文件末尾保留一行空行 "eol-last": "error", // 要求文件末尾保留一行空行
"newline-per-chained-call": "error", // 要求方法链中每个调用都有一个换行符 "newline-per-chained-call": "error", // 要求方法链中每个调用都有一个换行符
"padded-blocks": [ "padded-blocks": ["error", "never"], // 代码块开始和结束位置不可以有多余的空行
"error", "space-in-parens": ["error", "never"], // 禁止圆括号内的空格
"never" "array-bracket-spacing": ["error", "never"], // 数组紧贴括号部分不允许包含空格
], // 代码块开始和结束位置不可以有多余的空行 "object-curly-spacing": ["error", "always"], // 对象紧贴花括号部分不允许包含空格
"space-in-parens": [
"error",
"never"
], // 禁止圆括号内的空格
"array-bracket-spacing": [
"error",
"never"
], // 数组紧贴括号部分不允许包含空格
"object-curly-spacing": [
"error",
"never"
], // 对象紧贴花括号部分不允许包含空格
"no-regex-spaces": "error", // 禁止正则表达式字面量中出现多个空格 "no-regex-spaces": "error", // 禁止正则表达式字面量中出现多个空格
"no-multi-spaces": "error", // 禁止出现多个空格而且不是用来作缩进的 "no-multi-spaces": "error", // 禁止出现多个空格而且不是用来作缩进的
"block-spacing": [ "block-spacing": ["error", "never"], // 单行代码块中紧贴括号部分不允许包含空格
"error", "computed-property-spacing": ["error", "never"], // 禁止括号和其内部值之间的空格
"never"
], // 单行代码块中紧贴括号部分不允许包含空格
"computed-property-spacing": [
"error",
"never"
], // 禁止括号和其内部值之间的空格
"no-trailing-spaces": [ "no-trailing-spaces": [
"error", "error",
{ {
@ -250,10 +199,7 @@ module.exports = {
], // 强制 yield* 表达式中 * 号前有空格,后无空格 ], // 强制 yield* 表达式中 * 号前有空格,后无空格
// 逗号 // 逗号
"comma-style": "error", // 逗号必须放在行末 "comma-style": "error", // 逗号必须放在行末
"comma-dangle": [ "comma-dangle": ["error", "always-multiline"], // 多行对象字面量中要求拖尾逗号
"error",
"always-multiline"
], // 多行对象字面量中要求拖尾逗号
"comma-spacing": [ "comma-spacing": [
"error", "error",
{ {
@ -276,7 +222,8 @@ module.exports = {
"no-extra-boolean-cast": "error", // 禁止不必要的布尔类型转换 "no-extra-boolean-cast": "error", // 禁止不必要的布尔类型转换
// 其他最佳实践或规范 // 其他最佳实践或规范
"strict": "error", // 使用强制模式开关use strict; "strict": "error", // 使用强制模式开关use strict;
// "@typescript-eslint/no-extra-parens": ["error"], // 禁止冗余的括号
"@typescript-eslint/no-extra-parens": ["error"],
"no-eval": "error", // 禁用 eval() "no-eval": "error", // 禁用 eval()
"no-with": "error", // 禁用 with 语句 "no-with": "error", // 禁用 with 语句
"no-unexpected-multiline": "error", // 禁止使用令人困惑的多行表达式 "no-unexpected-multiline": "error", // 禁止使用令人困惑的多行表达式

7
.gitattributes vendored

@ -1,7 +0,0 @@
* text=auto !eol
designer_scripts/designer_scripts.iml -text
designer_scripts/src/readme.md -text
designer_scripts/src/scripts/store/web/index.html -text
designer_scripts/src/scripts/store/web/js/bridge.js -text
designer_scripts/src/scripts/store/web/js/lib/jquery-2.2.2.min.js -text
designer_scripts/src/scripts/store/web/js/store.js -text

11
.gitignore vendored

@ -1,3 +1,10 @@
node_modules /node_modules
yarn.lock /bower_components
.idea/
.DS_Store
/constants/classes/
dist dist
package-lock.json
.vscode
yarn-error.log
.history/

239
README.md

@ -5,149 +5,216 @@
![finui](https://img.shields.io/badge/lib-FinUi-blue.svg) ![finui](https://img.shields.io/badge/lib-FinUi-blue.svg)
## 开始 ## 开始
下载代码
```
git clone ssh://git@cloud.finedevelop.com:7999/~alan/database-connection.git
```
安装依赖 安装依赖
``` ```
yarn yarn
``` ```
开始开发 开始开发
``` ```
yarn start yarn dev
``` ```
## 接口文档 ## 接口文档
### 增加数据连接类型 ### 增加数据连接类型
使用`BI.config`,ConstantName名称为`dec.constant.database.conf.connect.list`,值为连接的名称 使用`BI.config`,ConstantName名称为`dec.constant.database.conf.connect.types`,值为连接的名称
例如增加`Redis`的连接: 例如增加`Redis`的连接:
```js ```js
BI.config(ConstantName, (datas: string[]) => [...datas, 'Redis']); BI.config(ConstantPluginTyps, (datas: string[]) => [...datas, {
text: 'Redis',
databaseType: 'Redis',
}]);
``` ```
### 数据连接填写页面 ### 数据连接填写页面
ConstantName名称为`dec.constant.database.conf.connect.form.${name.toLowerCase()}.edit`,值为组件shortcut的名称 ConstantName名称为`dec.constant.database.conf.connect.form.${name}.edit`,值为组件shortcut的名称
例如配置`Redis`的连接填写页面: ### 数据连接展示页面
ConstantName名称为`dec.constant.database.conf.connect.form.${name}.show`,值为组件shortcut的名称
```js ### 示例
const className = 'fr.plugin.redis.preview'; ```
const RedisPreview = BI.inherit(BI.Widget, { const ConstantRedisType = 'dec.constant.database.conf.connect.types';
const ConstantRedisShow = 'dec.constant.database.conf.connect.form.Redis.show';
const ConstantRedisEdit = 'dec.constant.database.conf.connect.form.Redis.edit';
BI.DOM.ready(() => {
BI.config(ConstantRedisType, datas => [...datas, {
text: 'Redis',
databaseType: 'Redis',
}]);
const RedisShowName = 'dec.dcm.connection.plugin.redis.show';
const RedisShow = BI.inherit(BI.Widget, {
props: {
formData: {
url: '',
port: '6379',
password: '',
},
},
render() { render() {
const o = this.options;
return { return {
type: 'bi.vertical',
hgap: 15,
vgap: 10,
items: [
{
type: 'bi.left', type: 'bi.left',
cls: 'title', items: [
items: [{ {
type: 'bi.editor', type: 'bi.label',
watermark:'这里是编辑页', cls: 'bi-font-bold',
}], width: 100,
}; textAlign: 'left',
text: '数据库地址',
}, },
}); {
BI.shortcut(className, RedisPreview); type: 'bi.label',
BI.constant('dec.constant.database.conf.connect.form.redis.edit', className); text: o.formData.url,
``` },
### 数据连接预览页面 ],
ConstantName名称为`dec.constant.database.conf.connect.form.${name.toLowerCase()}.show`,值为组件shortcut的名称 },
{
例如配置`Redis`的连接预览页面: type: 'bi.left',
items: [
```js {
const className = 'fr.plugin.redis.edit'; type: 'bi.label',
const RedisPreview = BI.inherit(BI.Widget, { cls: 'bi-font-bold',
render() { width: 100,
return { textAlign: 'left',
text: '端口号',
},
{
type: 'bi.label',
text: o.formData.port,
},
],
},
{
type: 'bi.left', type: 'bi.left',
cls: 'title', items: [
items: [{ {
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '密码',
},
{
type: 'bi.label', type: 'bi.label',
text:'这里是预览页', text: o.formData.password,
}], },
],
},
],
}; };
}, },
}); });
BI.shortcut(className, RedisPreview);
BI.constant('dec.constant.database.conf.connect.form.redis.edit', className);
```
### 插件配置表单值传递
ConstantName名称为`dec.constant.database.conf.connect.form.${name.toLowerCase()}.value`,值为插件数据结构
例如:
```js
const ConstantName = 'dec.constant.database.conf.connect.form.redis.value';
const form = {
url:'192.168.1.22',
port: 6379,
password: '123456'
};
BI.config(ConstantName, (data: object) => form);
```
### 数据连接池页面
ConstantName名称为`dec.constant.database.conf.connect.form.${name.toLowerCase()}.pool`,值为组件shortcut的名称
例如配置`Redis`的连接预览页面: BI.shortcut(RedisShowName, RedisShow);
BI.constant(ConstantRedisShow, RedisShowName);
```js
const classNamePool = 'fr.plugin.redis.pool';
const WidgetPool = BI.inherit(BI.Widget, { const RedisEditName = 'dec.dcm.connection.plugin.redis.edit';
const RedisEdit = BI.inherit(BI.Widget, {
props: {
formData: {
url: '',
port: '6379',
password: '',
},
},
render() { render() {
const {maxActive, maxIdle, numActive, numIdle} = this.options; const o = this.options;
return { return {
type: 'bi.left', type: 'bi.vertical',
hgap: 15,
vgap: 10,
items: [ items: [
{ {
type: 'bi.left', type: 'bi.left',
cls: 'right-status-item',
items: [ items: [
{ {
type: 'bi.vertical', type: 'bi.label',
cls:'right-status-board', cls: 'bi-font-bold',
items: [ width: 100,
textAlign: 'left',
text: '数据库地址',
},
{ {
type: 'bi.vertical', type: 'bi.text_editor',
cls:'right-status-board-item', width: 300,
allowBlank: true,
ref: _ref => {
this.url = _ref;
},
text: o.formData.url,
},
],
},
{
type: 'bi.left',
items: [ items: [
{ {
type: 'bi.label', type: 'bi.label',
cls: 'right-status-text', cls: 'bi-font-bold',
extraCls: 'card-font1', width: 100,
text: numActive, textAlign: 'left',
text: '端口号',
}, },
{ {
type: 'bi.label', type: 'bi.text_editor',
cls: 'right-status-text', width: 300,
text: '/', allowBlank: true,
ref: _ref => {
this.port = _ref;
}, },
{ text: o.formData.port,
type: 'bi.label',
cls: 'right-status-text',
text: maxActive,
}, },
], ],
}, },
{
type: 'bi.left',
items: [
{ {
type: 'bi.label', type: 'bi.label',
text: 'Redis连接数', cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '密码',
}, },
], {
type: 'bi.text_editor',
width: 300,
allowBlank: true,
inputType: 'password',
ref: _ref => {
this.password = _ref;
},
text: o.formData.password,
}, },
], ],
}, },
], ],
}; };
}, },
getSubmitValue() {
return {
url: this.url.getValue(),
port: this.port.getValue(),
password: this.password.getValue(),
};
},
}); });
BI.shortcut(classNamePool, WidgetPool);
BI.constant('dec.constant.database.conf.connect.form.redis.pool', classNamePool); BI.shortcut(RedisEditName, RedisEdit);
BI.constant(ConstantRedisEdit, RedisEditName);
});
``` ```

BIN
assets/font/iconfont.eot

Binary file not shown.

119
assets/font/iconfont.svg

@ -0,0 +1,119 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="dayin_normal" unicode="&#59004;" d="M832 256h128V640h-128v-64H192V640H64v-384h128V384h640v-128z m0-64v-256H192v256H64a64 64 0 0 0-64 64V640a64 64 0 0 0 64 64h128V832h640v-128h128a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-128zM256 640h512V768H256v-128z m0-640h512V320H256v-320z m64 256h384v-64H320v64z m0-128h384v-64H320v64z m480 320a32 32 0 1 0 0 64 32 32 0 0 0 0-64z" horiz-adv-x="1024" />
<glyph glyph-name="charujilu_normal" unicode="&#59005;" d="M640 384H504.704l37.696-37.76a32 32 0 1 0-45.248-45.184L406.656 391.552a32 32 0 0 0 0 45.248L497.152 527.36a32 32 0 0 0 45.248-45.248L508.352 448H640V576h384v-64h-320v-192h320v-64h-384V384zM0 512V768.064h384V512H0z m64 64h256V704H64v-128zM0-128V320h384v-448H0z m65.984 256H320v128H65.984v-128zM64-64h256v128H64v-128z" horiz-adv-x="1024" />
<glyph glyph-name="dayinjianrong_normal" unicode="&#59006;" d="M832 0v-64H192v256H64a64 64 0 0 0-64 64V640a64 64 0 0 0 64 64h128V832h640v-128h128a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-128v-128h64v64h64v-64h64v-64h-64v-64h-64v64h-64z m0 256h128V640h-128v-64H192V640H64v-384h128V384h640v-128zM256 640h512V768H256v-128z m0-640h512V320H256v-320z m64 256h384v-64H320v64z m0-128h384v-64H320v64z m480 320a32 32 0 1 0 0 64 32 32 0 0 0 0-64z" horiz-adv-x="1024" />
<glyph glyph-name="dayinyulan_normal" unicode="&#59007;" d="M715.648 27.52a224 224 0 1 0 89.088 89.28c3.008-2.112 5.824-4.48 8.512-7.168l64.384-64.384a63.936 63.936 0 1 0-90.496-90.496l-64.384 64.384a64.32 64.32 0 0 0-7.04 8.384zM640 741.504V576h165.504L640 741.504zM576 768H192v-768h256v-64H128V832h512l256-256v-192h-64V512H576V768z m32-384A160.192 160.192 0 0 1 448 224C448 135.808 519.808 64 608 64s160 71.808 160 160S696.192 384 608 384z m-320 320h192a32 32 0 0 0 0-64h-192a32 32 0 0 0 0 64z m0-128h192a32 32 0 0 0 0-64h-192a32 32 0 0 0 0 64z" horiz-adv-x="1024" />
<glyph glyph-name="daochu_normal" unicode="&#59008;" d="M960 544l-64 64v-320l64 64V-128H320l-256 256.064V896h896v-352zM127.936 192h256v-256H896V832H127.936v-640z m26.56-64L320-37.504V128H154.496z m681.152 353.728l-79.296 79.36a32 32 0 1 0 45.248 45.248l135.744-135.808a32 32 0 0 0 0-45.248l-135.68-135.744a32 32 0 0 0-45.312 45.248l82.944 82.944H480a32 32 0 0 0 0 64h355.648z" horiz-adv-x="1024" />
<glyph glyph-name="daoru_normal" unicode="&#59009;" d="M128 225.728V352H64V896h640l256-256.064V-128H64v160h64v129.728h-32a32 32 0 1 0 0 64H128z m0-64V-64h768.064V576h-256V832H128v-606.272h323.648l-79.296 79.36a32 32 0 0 0 45.248 45.248l135.744-135.808a32 32 0 0 0 0-45.248l-135.68-135.744a32 32 0 0 0-45.312 45.248l82.944 82.944H128zM869.504 640L704 805.504V640h165.504zM352 528L256 384H192l128 192-128 192h64l96-144L448 768h64L384 576l128-192H448L352 528z" horiz-adv-x="1024" />
<glyph glyph-name="dayinjipianyi_normal" unicode="&#59010;" d="M384.035601 45.238364l81.019493 81.083489a31.99822 31.99822 0 0 0 45.245484-45.309479l-135.73645-135.672454a31.99822 31.99822 0 0 0-45.245483 0l-135.73645 135.672454a31.99822 31.99822 0 0 0 45.245483 45.309479L320.039161 45.046374V383.971522H109.234887l81.211483-81.275479a31.99822 31.99822 0 1 0-45.245484-45.181487L9.40044 393.251005a31.99822 31.99822 0 0 0 0 45.245484l135.800446 135.800446a31.99822 31.99822 0 1 0 45.245484-45.30948L109.36288 447.967962H320.039161V786.765116L238.763682 705.553634a31.99822 31.99822 0 1 0-45.181487 45.245483L329.254648 886.599563a31.99822 31.99822 0 0 0 45.30948 0l135.73645-135.800446a31.99822 31.99822 0 0 0-45.245484-45.245483L384.035601 786.573127V447.967962h466.726039l-81.08349 81.019493a31.99822 31.99822 0 0 0 45.309479 45.30948l135.672454-135.800446a31.99822 31.99822 0 0 0 0-45.245484l-135.672454-135.736449a31.99822 31.99822 0 0 0-45.309479 45.245483L850.953629 383.971522H384.035601v-338.733158z" horiz-adv-x="1024" />
<glyph glyph-name="tijiao_normal" unicode="&#59011;" d="M256 768H128v-768h768V768h-128v-320H256V768zM64 832h896v-896H64V832z m256-64v-256h384V768H320z m256-64h64v-128H576V704z" horiz-adv-x="1024" />
<glyph glyph-name="shanchujilu_normal" unicode="&#59012;" d="M640 384h195.648l-34.048 34.048a32 32 0 1 0 45.248 45.248l90.496-90.496a32 32 0 0 0 0-45.248l-90.496-90.496a32 32 0 0 0-45.248 45.248l37.76 37.696H640v-128H320v-256H64v64h192v192H64V256.064h512V448H64V512h192V704H64V768h256v-256h320v-128z" horiz-adv-x="1024" />
<glyph glyph-name="morencanshu_normal" unicode="&#59013;" d="M768 96h160a32 32 0 1 0 0-64H768v-32a32 32 0 1 0-64 0v32H96a32 32 0 1 0 0 64H704V128a32 32 0 1 0 64 0v-32z m-224 320h384a32 32 0 1 0 0-64h-384V320a32 32 0 0 0-64 0v32h-384a32 32 0 0 0 0 64h384V448a32 32 0 0 0 64 0v-32zM256 736V768a32 32 0 0 0 64 0v-32h608a32 32 0 1 0 0-64H320V640a32 32 0 0 0-64 0v32H96a32 32 0 0 0 0 64H256z" horiz-adv-x="1024" />
<glyph glyph-name="yemianshezhi_normal" unicode="&#59014;" d="M0 768h1024v-768H0V768z m64-64v-640h896V704H64z m512 0h64v-640H576V704z m128-96h192v-64h-192v64z m0-128h192v-64h-192v64z m0-128h192v-64h-192v64z m0-128h192v-64h-192v64z m-576 384h384v-64H128v64z m0-192h384v-64H128v64z m0-192h384v-64H128v64z" horiz-adv-x="1024" />
<glyph glyph-name="tupian_normal" unicode="&#59015;" d="M64 33.472l322.048 265.728 122.496-122.496 187.968 250.624L960 253.248V512h-256V768H64v-734.528z m59.904-33.536H960v176.64l-248.512 164.096-196.032-261.376-133.504 133.504L123.904 0zM768 741.504V576h165.504L768 741.504zM0 832h768l256-256v-640H0V832z m256-384a128 128 0 1 0 0 256 128 128 0 0 0 0-256z m0 64a64 64 0 1 1 0 128 64 64 0 0 1 0-128z" horiz-adv-x="1024" />
<glyph glyph-name="youjian_normal" unicode="&#59016;" d="M64 70.4l288 288 45.248-45.248L148.096 64h714.944L613.888 313.152 659.2 358.4l294.4-294.4H960V659.328L505.6 204.8 64 646.464v-576zM96.96 704l408.576-408.64L914.176 704H96.896zM0 768h1024v-768H0V768z" horiz-adv-x="1024" />
<glyph glyph-name="qingkong_normal" unicode="&#59017;" d="M259.712 32h143.04l-207.104 207.104-72.384-72.448L259.712 32z m271.744 0H960v-64H256l-0.064 0.064h-22.592L32.448 166.592 620.8 754.88l316.8-316.8L531.456 32zM467.2 58.048l379.904 379.904L620.8 664.32 240.896 284.352 467.2 58.048z" horiz-adv-x="1024" />
<glyph glyph-name="xianshidanyuangezhi_normal" unicode="&#59018;" d="M320 768H64v-768h896V768H384v-256h576v-64H384v-448H320V448H64V512h256V768zM0 832h1024v-896H0V832z m576-512h320v-64H576V320zM448 320h64v-64H448V320z m0-128h448v-64H448v64z" horiz-adv-x="1024" />
<glyph glyph-name="Flashdayin_normal" unicode="&#59019;" d="M896 384h64V768H64v-384h64V576h-32V640h832v-64H896v-192z m0-64v-448H128V320H64a64 64 0 0 0-64 64V768a64 64 0 0 0 64 64h896a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-64zM192-64h640V576H192v-640z m128 272h384v-64H320v64z m0-128h384v-64H320v64z m480 592a32 32 0 1 0 0 64 32 32 0 0 0 0-64zM598.4 329.6h115.2v-64h-179.2v230.4h64v-166.4z m-224 0v-64h-64v230.4h192v-64h-128v-38.4h115.2v-64h-115.2z" horiz-adv-x="1024" />
<glyph glyph-name="icon_baobiaowebshuxing_shangyiye_normal" unicode="&#59020;" d="M265.344 400.448l294.208 294.208a32 32 0 1 0 45.248-45.312L333.248 377.856 604.8 106.24a32 32 0 1 0-45.248-45.248L265.344 355.2a32 32 0 0 0 0 45.248z" horiz-adv-x="1024" />
<glyph glyph-name="icon_baobiaowebshuxing_shouye_normal" unicode="&#59021;" d="M438.144 406.848l294.208 294.208a32 32 0 0 0 45.248-45.312L506.048 384.256l271.552-271.552a32 32 0 0 0-45.248-45.248L438.144 361.6a32 32 0 0 0 0 45.248zM268.8 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="shujuxiaoyan_normal" unicode="&#59022;" d="M0 768V832h128v-64H0z m192 0V832h128.064v-64H192z m192 0V832h128v-64H384z m192 0V832h128v-64H576z m192 0V832h128.064v-64H768zM0 640V704h576v-64H0z m777.792-579.968L845.632 128 568.128 405.44l-92.16 24.32 24.32-92.16 277.504-277.568z m45.248-45.248l27.008-27.008 67.84 67.84-27.008 27.072-67.84-67.84z m-384.704 306.56l-46.592 176.96a12.8 12.8 0 0 0 15.68 15.616l176.96-46.528a64 64 0 0 0 28.992-16.64l372.48-372.48a32 32 0 0 0 0-45.248l-113.216-113.152a32 32 0 0 0-45.248 0L455.04 292.352a64 64 0 0 0-16.64 28.928z" horiz-adv-x="1024" />
<glyph glyph-name="PDFdayin_normal" unicode="&#59023;" d="M896 384h64V768H64v-384h64V576h-32V640h832v-64H896v-192z m0-64v-448H128V320H64a64 64 0 0 0-64 64V768a64 64 0 0 0 64 64h896a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-64zM192-64h640V576H192v-640z m608 736a32 32 0 1 0 0 64 32 32 0 0 0 0-64zM275.2 384h38.4a89.6 89.6 0 1 0 0-179.2h-38.4V128h-64V384h64z m0-64v-51.2h38.4a25.6 25.6 0 1 1 0 51.2h-38.4z m204.8 0v-128H512a32 32 0 0 1 32 32v64A32 32 0 0 1 512 320h-32z m-64 64H512a96 96 0 0 0 96-96v-64A96 96 0 0 0 512 128H416V384z m268.8-179.2V128h-64V384h192v-64h-128v-51.2h115.2v-64h-115.2z" horiz-adv-x="1024" />
<glyph glyph-name="zidingyianniu_normal" unicode="&#59024;" d="M375.488 759.488a136.512 136.512 0 1 0 273.024 0v-25.6c4.864-1.92 9.6-3.84 14.336-5.952l18.112 18.112a136.512 136.512 0 1 0 193.088-193.088l-18.112-18.112c2.048-4.736 4.032-9.472 5.952-14.336h25.6a136.512 136.512 0 0 0 0-273.024h-25.6c-1.92-4.864-3.84-9.6-5.952-14.336l18.112-18.112a136.512 136.512 0 1 0-193.088-193.088l-18.112 18.112a373.248 373.248 0 0 0-14.336-5.952v-25.6a136.512 136.512 0 0 0-273.024 0v25.6c-4.864 1.92-9.6 3.84-14.336 5.952l-18.112-18.112a136.512 136.512 0 1 0-193.088 193.088l18.112 18.112a373.248 373.248 0 0 0-5.952 14.336h-25.6a136.512 136.512 0 1 0 0 273.024h25.6c1.92 4.864 3.84 9.6 5.952 14.336l-18.112 18.112A136.512 136.512 0 1 0 343.04 746.048l18.112-18.112c4.736 2.048 9.472 4.032 14.336 5.952v25.6z m67.584-71.936l-24.128-7.616a307.968 307.968 0 0 1-50.368-20.864l-22.4-11.712-53.504 53.44A68.928 68.928 0 0 1 195.2 603.328l53.44-53.44-11.712-22.4a307.968 307.968 0 0 1-20.864-50.432l-7.616-24.128h-75.52a68.928 68.928 0 1 1 0-137.856h75.52l7.616-24.128c5.44-17.408 12.416-34.24 20.864-50.368l11.712-22.4-53.44-53.504a68.928 68.928 0 0 1 97.472-97.472l53.44 53.44 22.4-11.712c16.192-8.448 33.024-15.424 50.432-20.864l24.128-7.616v-75.52a68.928 68.928 0 1 1 137.856 0v75.52l24.128 7.616c17.408 5.44 34.24 12.416 50.368 20.864l22.4 11.712 53.504-53.44a68.928 68.928 0 0 1 97.472 97.472l-53.44 53.44 11.712 22.4c8.448 16.192 15.424 33.024 20.864 50.432l7.616 24.128h75.52a68.928 68.928 0 1 1 0 137.856h-75.52l-7.616 24.128a307.968 307.968 0 0 1-20.864 50.368l-11.712 22.4 53.44 53.504a68.928 68.928 0 0 1-97.472 97.472l-53.44-53.44-22.4 11.712a307.968 307.968 0 0 1-50.432 20.864l-24.128 7.616v75.52a68.928 68.928 0 1 1-137.856 0v-75.52zM512 192a192 192 0 1 0 0 384 192 192 0 0 0 0-384z m0 64a128 128 0 1 1 0 256 128 128 0 0 1 0-256z" horiz-adv-x="1024" />
<glyph glyph-name="Excel-daoru_normal" unicode="&#59025;" d="M64 32h64V-64h768.064V576h-256V832H128v-544H64V896h640l256-256.064V-128H64v160zM869.504 640L704 805.504V640h165.504z m-609.856-447.104l-34.048 34.048a32 32 0 0 0 45.248 45.312l90.496-90.56a32 32 0 0 0 0-45.248l-90.496-90.496a32 32 0 1 0-45.248 45.248l37.76 37.76H32a32 32 0 1 0 0 64h227.648zM768 256h-64v-64h64v64z m64 64v-320H384V320h448z m-64-256v64h-64v-64h64z m-128 192H576v-64h64v64z m0-192v64H576v-64h64z m-128 192H448v-64h64v64z m0-192v64H448v-64h64zM352 528L256 384H192l128 192-128 192h64l96-144L448 768h64L384 576l128-192H448L352 528z" horiz-adv-x="1024" />
<glyph glyph-name="zancun_normal" unicode="&#59026;" d="M800 160h64v-64h-128v128h64v-64zM896 311.872V768h-128v-320H256V768H128v-768h456.128A224 224 0 0 0 896 311.872z m64-68.48A224 224 0 0 0 652.544-64L64-63.936V832h896v-588.544zM320 768v-256h384V768H320z m256-64h64v-128H576V704z m192-736a160 160 0 1 1 0 320 160 160 0 0 1 0-320z" horiz-adv-x="1024" />
<glyph glyph-name="icon_baobiaowebshuxing_xiayiye_normal" unicode="&#59027;" d="M758.4 400.448a32 32 0 0 0 0-45.248l-294.144-294.144a32 32 0 1 0-45.312 45.248l271.552 271.552-271.552 271.488a32 32 0 1 0 45.312 45.312l294.144-294.208z" horiz-adv-x="1024" />
<glyph glyph-name="icon_baobiaowebshuxing_moye_normal" unicode="&#59028;" d="M585.6 406.848a32 32 0 0 0 0-45.248l-294.144-294.144a32 32 0 1 0-45.312 45.248L517.76 384.256 246.144 655.744a32 32 0 1 0 45.312 45.312L585.6 406.848zM754.944 704a32 32 0 0 0 32-32v-576a32 32 0 1 0-64 0v576a32 32 0 0 0 32 32z" horiz-adv-x="1024" />
<glyph glyph-name="Appledayin_normal" unicode="&#59029;" d="M896 384h64V768H64v-384h64V576h-32V640h832v-64H896v-192z m0-64v-448H128V320H64a64 64 0 0 0-64 64V768a64 64 0 0 0 64 64h896a64 64 0 0 0 64-64v-384a64 64 0 0 0-64-64h-64zM192-64h640V576H192v-640z m608 736a32 32 0 1 0 0 64 32 32 0 0 0 0-64zM505.216 311.552c32.064 5.312 37.824 12.928 32.64 32.192-16.64 62.336 26.688 104.448 110.912 124.096a32 32 0 1 0 14.592-62.336c-53.76-12.544-68.544-26.88-63.616-45.248 2.048-7.744 3.328-15.232 3.776-22.336a232.32 232.32 0 0 1 15.36 9.344 32 32 0 0 0 35.264-53.376 272.192 272.192 0 0 0-119.68-44.352 370.752 370.752 0 0 0-27.52-2.112c-73.152-3.072-147.776 15.232-171.328 57.6-28.928 52.096 0.768 110.912 53.248 131.84a32 32 0 0 0 23.68-59.456c-19.648-7.872-29.12-26.624-20.992-41.28 8.064-14.464 62.08-26.304 113.664-24.576z m-263.68-258.56a32 32 0 0 0 51.904 37.376c31.808-44.288 101.376-68.16 211.2-68.16 110.528 0 184.128 24.256 222.72 70.08a32 32 0 0 0 48.96-41.216c-52.864-62.848-144.064-92.864-271.68-92.864-128.32 0-216.896 30.4-263.168 94.784z m143.552 28.288a32 32 0 1 0 22.848 59.776c23.04-8.768 56.32-13.44 99.2-13.44 41.152 0 68.032 4.352 78.592 10.88a32 32 0 0 0 33.472-54.592c-23.36-14.336-59.968-20.352-112-20.352-50.112 0-90.752 5.76-122.112 17.728z m-27.264 105.984a32 32 0 0 0 33.92 54.272c25.984-16.192 63.616-24.768 113.216-24.768 48.384 0 81.024 8.128 97.984 22.272a32 32 0 1 0 40.896-49.28c-30.656-25.408-76.992-36.992-138.88-36.992-60.672 0-109.824 11.2-147.136 34.56z m156.288 172.8a32 32 0 0 0-61.888-16.192c-15.616 59.712-3.84 107.52 37.952 136.128 17.92 12.16 23.232 27.264 17.28 52.032a32 32 0 1 0 62.272 14.912c11.968-49.92-2.944-92.16-43.456-119.808-16.64-11.392-21.504-31.232-12.16-67.008z m200.512-98.624a32 32 0 0 0 8.32 63.424c48-6.208 77.056-35.84 77.056-81.792 0-58.176-40.768-100.672-113.088-129.088a32 32 0 0 0-23.36 59.584c50.432 19.84 72.448 42.752 72.448 69.504 0 12.16-3.776 16-21.376 18.368z" horiz-adv-x="1024" />
<glyph glyph-name="Worddaochu_normal" unicode="&#59030;" d="M896.064 96H960V-128H64V896h640l256-256.064V416h-63.936V576h-256V832H128v-896h768.064v160zM869.504 640L704 805.504V640h165.504zM396.8 320v-128h32a32 32 0 0 1 32 32v64a32 32 0 0 1-32 32h-32z m-64 64h96a96 96 0 0 0 96-96v-64A96 96 0 0 0 428.8 128H332.8V384z m320-64a32 32 0 0 1-32-32v-64a32 32 0 1 1 64 0v64a32 32 0 0 1-32 32z m0 64a96 96 0 0 0 96-96v-64a96 96 0 0 0-192 0v64A96 96 0 0 0 652.8 384zM960 313.6c-22.4 4.288-39.552 6.4-51.328 6.4-17.664 0-63.872-12.8-63.872-64s46.208-64 63.872-64c11.776 0 28.864 2.112 51.328 6.4v-62.4c1.088-4.288-16-6.4-51.328-6.4-53.056 0-129.792 34.88-128 126.4 1.664 91.52 74.944 128 128 128 35.328 0 52.48-2.112 51.328-6.4v-64z" horiz-adv-x="1024" />
<glyph glyph-name="Excel-daochu_normal" unicode="&#59031;" d="M960 480l-63.936 63.936v32h-256V832H128v-896h768.064v288.064L960 288V-128H64V896h640l256-256.064V480zM869.504 640L704 805.504V640h165.504z m30.144-222.272l-34.048 34.048a32 32 0 1 0 45.248 45.248l90.496-90.496a32 32 0 0 0 0-45.248l-90.496-90.496a32 32 0 1 0-45.248 45.248l37.76 37.76H672a32 32 0 1 0 0 64h227.648zM352 528L256 384H192l128 192-128 192h64l96-144L448 768h64L384 576l128-192H448L352 528zM704 256h-64v-64h64v64z m54.4 64H768v-320H192V320h566.4zM704 64v64h-64v-64h64z m-128 192H512v-64h64v64z m0-192v64H512v-64h64z m-128 192H384v-64h64v64z m0-192v64H384v-64h64z m-128 192H256v-64h64v64z m0-192v64H256v-64h64z" horiz-adv-x="1024" />
<glyph glyph-name="dangqianye-zongyeshu_normal" unicode="&#59032;" d="M64-64V832h896v-896H64z m64 64h768V576H128v-576zM128 640h768V768H128v-128z m64-448V512h256v-320H192z m64 64h128V448H256v-192z m256 192V512h320v-64H512z m0-128V384h320v-64H512z m0-128v64h320v-64H512z m-320-128v64h640v-64H192z" horiz-adv-x="1024" />
<glyph glyph-name="icon_baobiaowebshuxing_suofang_normal" unicode="&#59033;" d="M788.928 704H640V768h256.064v-256H832V656.448l-256-256v-272.512h384.064V832H192v-384h340.928l256 256zM128 448V896.064h896V64H576v-128H0V448h128z m-64-448h448V384H64v-384z" horiz-adv-x="1024" />
<glyph glyph-name="PDFdaochu_normal" unicode="&#59034;" d="M896.064 96H960V-128H64V896h640l256-256.064V416h-63.936V576h-256V832H128v-896h768.064v160zM869.504 640L704 805.504V640h165.504zM384 352h38.4a89.6 89.6 0 1 0 0-179.2H384v-76.8H320v256h64z m0-64v-51.2h38.4a25.6 25.6 0 1 1 0 51.2H384z m224 0v-128h32a32 32 0 0 1 32 32v64a32 32 0 0 1-32 32h-32z m-64 64H640a96 96 0 0 0 96-96v-64a96 96 0 0 0-96-96H544v256z m288-179.2v-76.8h-64v256h192v-64h-128v-51.2h115.2v-64H832z" horiz-adv-x="1024" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 17 KiB

BIN
assets/font/iconfont.ttf

Binary file not shown.

BIN
assets/font/iconfont.woff

Binary file not shown.

29
babel.config.js

@ -0,0 +1,29 @@
module.exports = function(api) {
api.cache(true);
const presets = [
[
'@babel/preset-env',
{
targets: {
ie: 9,
chrome: 47,
},
},
],
'@babel/preset-typescript',
];
const plugins = [
[
'@babel/plugin-proposal-decorators',
{
legacy: true,
},
],
'@babel/plugin-proposal-class-properties',
];
return {
presets,
plugins,
};
};

6
config/fineui.prepare.js

@ -0,0 +1,6 @@
!(function () {
// 先把准备环境准备好
while (BI.prepares && BI.prepares.length > 0) {
BI.prepares.shift()();
}
}());

48
config/fineui.setup.js

@ -0,0 +1,48 @@
!(function () {
Report = {
SessionMgr: {
get() {
return '';
},
},
};
let target = null;
const targetStack = [];
function pushTarget (_target) {
if (target) {
targetStack.push(target);
}
Fix.Model.target = target = _target;
}
function popTarget () {
Fix.Model.target = target = targetStack.pop();
}
Fix.Test = {
makeContext: (state, fn) => {
const Store = BI.inherit(Fix.Model, {
state,
childContext: Object.keys(state),
});
const store = new Store();
pushTarget(store);
fn(store);
popTarget();
return store;
},
extractContext: (model, contextList) => {
BI.each(BI.deepClone(model), key => {
if (BI.contains(contextList, key)) {
return;
}
delete model[key];
});
return model;
},
};
}());

34
config/jest.environment.js

@ -0,0 +1,34 @@
const JsdomEnvironment = require('jest-environment-jsdom');
const path = require('path');
const fs = require('fs');
class FineUiEnvironment extends JsdomEnvironment {
async setup(...args) {
await super.setup(args);
const document = this.dom.window.document;
document.createElement('body');
[
'../node_modules/fineui/dist/fineui.js',
'../node_modules/fineui-materials/docs/materials.js',
'../config/fineui.prepare.js',
'./fineui.setup.js',
].forEach(scriptRelativePath => {
writeScript(document, scriptRelativePath);
});
return Promise.resolve();
}
}
function writeScript(document, scriptRelativePath) {
const scriptEl = document.createElement('script');
scriptEl.text = fs.readFileSync(path.resolve(__dirname, scriptRelativePath), {
encoding: 'utf8',
});
document.body.appendChild(scriptEl);
}
module.exports = FineUiEnvironment;

238
i18n/zh_cn.properties

@ -1,11 +1,23 @@
Dec-Dcm_Connection_New= 新建数据连接
Dec-Dcm_Connection_Name= 数据连接名称
Dec-Dcm_Connection_None= 无可用数据连接,请点击添加
Dec-Dcm_Connection_Test= 测试连接
Dec-Dcm_Connection_Commonly= 常用
Dec-Dcm_Connection_Type_Filter= 类型筛选:
Dec-Dcm_Connection_Support_Inner= 内置支持
Dec-Dcm_Connection_Support_Plugin= 插件支持
Dec-Dcm_Connection_Filter_Tip= 提示:当前仅支持部分插件类型,未支持类型请使用设计器的旧版本数据连接进行创建
Dec-Dcm_Connection_All= 所有
Dec-Dcm_Connection_Other= 其他
Dec-Dcm_Connection_Management= 数据连接管理 Dec-Dcm_Connection_Management= 数据连接管理
Dec-Dcm_Pool_Connection_Management= 连接池管理 Dec-Dcm_Pool_Connection_Management= 连接池状态
Dec-Dcm_Data_Connections= 数据连接 Dec-Dcm_Data_Connections= 数据连接
Dec-Dcm_Active_Connections_Number= 活动连接数 Dec-Dcm_Active_Connections_Number= 活动连接数
Dec-Dcm_Leisure_Connections_Number= 空闲连接数 Dec-Dcm_Leisure_Connections_Number= 空闲连接数
Dec-Dcm_Connections= 连接 Dec-Dcm_Connections= 连接
Dec-Dcm_Default= 默认 Dec-Dcm_Default= 默认
Dec-Dcm_Delete= 删除 Dec-Dcm_Delete= 删除
Dec-Dcm_Millisecond= 毫秒
Dec-Dcm_Test_Connection= 测试连接 Dec-Dcm_Test_Connection= 测试连接
Dec-Dcm_Copy= 复制 Dec-Dcm_Copy= 复制
Dec-Dcm_Edit= 编辑 Dec-Dcm_Edit= 编辑
@ -13,18 +25,20 @@ Dec-Dcm_Save= 保存
Dec-Dcm_Yes= 是 Dec-Dcm_Yes= 是
Dec-Dcm_No= 否 Dec-Dcm_No= 否
Dec-Dcm_Search= 搜索 Dec-Dcm_Search= 搜索
Dec-Dcm_Type= 类型 Dec-Dcm_Type= 类型:{R1}
Dec-Dcm_Other= 其他 Dec-Dcm_Other= 其他
Dec-Dcm_Tips= 提示 Dec-Dcm_Tips= 提示
Dec-Dcm_Back= 返回 Dec-Dcm_Back= 返回
Dec-Dcm_Creator= 创建者 Dec-Dcm_Creator= 创建者:{R1}
Dec-Dcm_First_Step= 第一步 Dec-Dcm_First_Step= 第一步
Dec-Dcm_Second_Step= 第二步 Dec-Dcm_Second_Step= 第二步
Dec-Dcm_Third_Step= 第三步 Dec-Dcm_Third_Step= 第三步
Dec-Dcm_Connection_ConnectionName_Cannt_Null= 数据连接名不可为空
Dec-Dcm_Connection_Np_Registered= 该类型暂仅支持在设计器中使用旧版本数据连接查看
Dec-Dcm_Connection_Detailed_Information= 详细信息 Dec-Dcm_Connection_Detailed_Information= 详细信息
Dec-Dcm_Connection_Handup_Information= 收起信息 Dec-Dcm_Connection_Handup_Information= 收起信息
Dec-Dcm_Connection_Testing= 正在测试连接,请稍候... Dec-Dcm_Connection_Testing= 正在测试连接,请稍候...
Dec-Dcm_Connection_Test_Fail= 测试连接失败 Dec-Dcm_Connection_Test_Fail= {R1}测试连接失败
Dec-Dcm_Connection_Test_Success= 连接成功 Dec-Dcm_Connection_Test_Success= 连接成功
Dec-Dcm_Connection_Option_Cannot_Find= 找不到该连接的配置信息 Dec-Dcm_Connection_Option_Cannot_Find= 找不到该连接的配置信息
Dec-Dcm_Connection_Config_No_Save= 当前设置尚未保存,是否保存? Dec-Dcm_Connection_Config_No_Save= 当前设置尚未保存,是否保存?
@ -34,15 +48,21 @@ Dec-Dcm_Connection_More_Title= 更多数据连接
Dec-Dcm_Connection_Other= 其他 Dec-Dcm_Connection_Other= 其他
Dec-Dcm_Connection_Plase_Add_One= 请选择左侧数据连接或点击新建数据连接 Dec-Dcm_Connection_Plase_Add_One= 请选择左侧数据连接或点击新建数据连接
Dec-Dcm_Connection_Is_Existence= 数据连接名已存在 Dec-Dcm_Connection_Is_Existence= 数据连接名已存在
Dec-Dcm_Connection_No_Search_Result= 无搜索结果
Dec-Dcm_Connection_Form_ConnectionName= 数据连接名 Dec-Dcm_Connection_Form_ConnectionName= 数据连接名
Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm= *修改数据连接名会影响相关数据表和仪表板 Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm= *修改数据连接名会影响相关数据表和仪表板
Dec-Dcm_Connection_Form_Driver= 驱动 Dec-Dcm_Connection_Form_Driver= 驱动
Dec-Dcm_Connection_Form_URL= URL Dec-Dcm_Connection_Form_URL= URL
Dec-Dcm_Connection_Form_Database_URL= 数据库URL
Dec-Dcm_Connection_Form_Place_Input= 请输入 Dec-Dcm_Connection_Form_Place_Input= 请输入
Dec-Dcm_Connection_Form_OriginalCharsetName= 编码 Dec-Dcm_Connection_Form_OriginalCharsetName= 编码
Dec-Dcm_Connection_Form_Auto= 自动 Dec-Dcm_Connection_Form_Auto= 自动
Dec-Dcm_Connection_Form_Host= 主机
Dec-Dcm_Connection_Form_AuthType= 认证方式
Dec-Dcm_Connection_Form_UserName= 用户名 Dec-Dcm_Connection_Form_UserName= 用户名
Dec-Dcm_Connection_Form_Password= 密码 Dec-Dcm_Connection_Form_Password= 密码
Dec-Dcm_Connection_Form_Principal= 客户端principal
Dec-Dcm_Connection_Form_KeyPath= keytab密钥路径
Dec-Dcm_Connection_Form_Pool_Properties= 连接池属性 Dec-Dcm_Connection_Form_Pool_Properties= 连接池属性
Dec-Dcm_Connection_Form_SQL_Validation_Query= SQL验证查询 Dec-Dcm_Connection_Form_SQL_Validation_Query= SQL验证查询
Dec-Dcm_Connection_Form_Connection-Check= 获取连接前校验 Dec-Dcm_Connection_Form_Connection-Check= 获取连接前校验
@ -50,11 +70,217 @@ Dec-Dcm_Connection_Form_Connection_Max_Number= 最大活动连接数
Dec-Dcm_Connection_Form_Place_Input-Number= 请输入有效的正整数 Dec-Dcm_Connection_Form_Place_Input-Number= 请输入有效的正整数
Dec-Dcm_Connection_Form_Pattern= 模式 Dec-Dcm_Connection_Form_Pattern= 模式
Dec-Dcm_Connection_Form_Database_Addr= 数据库地址 Dec-Dcm_Connection_Form_Database_Addr= 数据库地址
Dec-Dcm_Connection_Form_Database_Port= 端口号 Dec-Dcm_Connection_Form_Database_Name= 数据库名称
Dec-Dcm_Connection_Form_Database_Port= 端口
Dec-Dcm_Connection_Form_Database_Advanced_Setting= 高级设置
Dec-Dcm_Connection_Form_Database_Initial_Size= 初始化连接数
Dec-Dcm_Connection_Form_Database_Max_Active= 最大活动连接数
Dec-Dcm_Connection_Form_Database_Max_Idle= 最大空闲连接数
Dec-Dcm_Connection_Form_Database_Max_Wait= 最大等待时间
Dec-Dcm_Connection_Form_Database_Validation_Query= SQL验证查询
Dec-Dcm_Connection_Form_Database_Test_On_Borrow= 获取连接前检验
Dec-Dcm_Connection_Form_Database_Test_On_Return= 归还连接前检验
Dec-Dcm_Connection_Form_Database_Test_While_Idle= 开启空闲回收器检验
Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis= 空闲连接回收器休眠时间
Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num= 空闲连接回收检查数
Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis= 保持空闲最小时间值
Dec-Dcm_Connection_Make_Sure_Delete= 确定删除该数据连接? Dec-Dcm_Connection_Make_Sure_Delete= 确定删除该数据连接?
Dec-Dcm_Connection_ReConnect= 重新连接 Dec-Dcm_Connection_ReConnect= 重新连接
Dec-Dcm_Connection_JNDI_Form_ConnectionName= JNDI的名字 Dec-Dcm_Connection_JNDI_Form_ConnectionName= JNDI的名字
Dec-Dcm_Connection_JNDI_Form_Connection= 数据来自数据连接
Dec-Dcm_Connection_Form_JNDI_Context= 上下文 Dec-Dcm_Connection_Form_JNDI_Context= 上下文
Dec-Dcm_Connection_Form_JNDI_Advanced= 高级 Dec-Dcm_Connection_Form_JNDI_Advanced= 高级
Dec-Dcm_Connection_Form_JNDI_Other_Attributes= 其他属性 Dec-Dcm_Connection_Form_JNDI_Other_Attributes= 其他属性
Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes= 收起 Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes= 收起
Dec-Dcm_Connection_JNDI= JNDI数据连接
Dec-Dcm_Connection_JNDI_Warning= 注意:需要把包含INTIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下
Dec-Dcm_Connection_Error= 接口访问错误
BI-Multi_Date_Quarter_End= 季度末
BI-Multi_Date_Month_Begin= 月初
BI-Multi_Date_YMD= 年月日
BI-Custom_Color= 自定义颜色
BI-Numerical_Interval_Input_Data= 请输入数值
BI-Please_Input_Natural_Number= 请输入非负整数
BI-No_More_Data= 无更多数据
BI-Basic_Altogether= 共
BI-Basic_Sunday= 星期日
BI-Widget_Background_Colour= 组件背景
BI-Color_Picker_Error_Text= 请输入0~255的正整数
BI-Multi_Date_Month= 月
BI-No_Selected_Item= 没有可选项
BI-Multi_Date_Year_Begin= 年初
BI-Quarter_1= 第1季度
BI-Quarter_2= 第2季度
BI-Quarter_3= 第3季度
BI-Quarter_4= 第4季度
BI-Multi_Date_Year_Next= 年后
BI-Multi_Date_Month_Prev= 个月前
BI-Month_Trigger_Error_Text= 请输入1~12的正整数
BI-Less_And_Equal= 小于等于
BI-Year_Trigger_Invalid_Text= 请输入有效时间
BI-Multi_Date_Week_Next= 周后
BI-Font_Size= 字号
BI-Basic_Total= 共
BI-Already_Selected= 已选择
BI-Formula_Insert= 插入
BI-Select_All= 全选
BI-Basic_Tuesday= 星期二
BI-Multi_Date_Month_End= 月末
BI-Load_More= 点击加载更多数据
BI-Basic_September= 九月
BI-Current_Is_Last_Page= 当前已是最后一页
BI-Basic_Auto= 自动
BI-Basic_Count= 个
BI-Basic_Value= 值
BI-Basic_Unrestricted= 无限制
BI-Quarter_Trigger_Error_Text= 请输入1~4的正整数
BI-Basic_More= 更多
BI-Basic_Wednesday= 星期三
BI-Basic_Bold= 加粗
BI-Basic_Simple_Saturday= 六
BI-Multi_Date_Month_Next= 个月后
BI-Basic_March= 三月
BI-Current_Is_First_Page= 当前已是第一页
BI-Basic_Thursday= 星期四
BI-Basic_Prompt= 提示
BI-Multi_Date_Today= 今天
BI-Multi_Date_Quarter_Prev= 个季度前
BI-Row_Header= 行表头
BI-Date_Trigger_Error_Text= 日期格式示例:2015-3-11
BI-Basic_Cancel= 取消
BI-Basic_January= 一月
BI-Basic_June= 六月
BI-Basic_July= 七月
BI-Basic_April= 四月
BI-Multi_Date_Quarter_Begin= 季度初
BI-Multi_Date_Week= 周
BI-Click_Blank_To_Select= 点击\\空格键\\选中完全匹配项
BI-Basic_August= 八月
BI-Word_Align_Left= 文字居左
BI-Basic_November= 十一月
BI-Font_Colour= 字体颜色
BI-Multi_Date_Day_Prev= 天前
BI-Select_Part= 部分选择
BI-Multi_Date_Day_Next= 天后
BI-Less_Than= 小于
BI-Basic_February= 二月
BI-Multi_Date_Year= 年
BI-Number_Index= 序号
BI-Multi_Date_Week_Prev= 周前
BI-Next_Page= 下一页
BI-Right_Page= 向右翻页
BI-Numerical_Interval_Signal_Value= 前后值相等,请将操作符改为“≤”
BI-Basic_December= 十二月
BI-Basic_Saturday= 星期六
BI-Basic_Simple_Wednesday= 三
BI-Multi_Date_Quarter_Next= 个季度后
BI-Basic_October= 十月
BI-Basic_Simple_Friday= 五
BI-Basic_Save= 保存
BI-Numerical_Interval_Number_Value= 请保证前面的数值小于/等于后面的数值
BI-Previous_Page= 上一页
BI-No_Select= 搜索结果为空
BI-Basic_Clears= 清空
BI-Created_By_Me= 我创建的
BI-Basic_Simple_Tuesday= 二
BI-Word_Align_Right= 文字居右
BI-Summary_Values= 汇总
BI-Basic_Clear= 清除
BI-Upload_File_Size_Error= 文件大小不支持
BI-Up_Page= 向上翻页
BI-Basic_Simple_Sunday= 日
BI-Multi_Date_Relative_Current_Time= 相对当前时间
BI-Selected_Data= 已选数据:
BI-Multi_Date_Quarter= 季度
BI-Check_Selected= 查看已选
BI-Basic_Search= 搜索
BI-Basic_May= 五月
BI-Continue_Select= 继续选择
BI-Please_Input_Positive_Integer= 请输入正整数
BI-Upload_File_Type_Error= 文件类型不支持
BI-Upload_File_Error= 文件上传失败
BI-Basic_Friday= 星期五
BI-Down_Page= 向下翻页
BI-Basic_Monday= 星期一
BI-Left_Page= 向左翻页
BI-Transparent_Color= 透明
BI-Basic_Simple_Monday= 一
BI-Multi_Date_Year_End= 年末
BI-Time_Interval_Error_Text= 请保证开始时间早于/等于结束时间
BI-Basic_Time= 时间
BI-Basic_OK= 确定
BI-Basic_Sure= 确定
BI-Basic_Simple_Thursday= 四
BI-Multi_Date_Year_Prev= 年前
BI-Tiao_Data= 条数据
BI-Basic_Italic= 斜体
BI-Basic_Dynamic_Title= 动态时间
BI-Basic_Year= 年
BI-Basic_Single_Quarter= 季
BI-Basic_Month= 月
BI-Basic_Week= 周
BI-Basic_Day= 天
BI-Basic_Work_Day= 工作日
BI-Basic_Front= 前
BI-Basic_Behind= 后
BI-Basic_Empty= 空
BI-Basic_Month_End= 月末
BI-Basic_Month_Begin= 月初
BI-Basic_Year_End= 年末
BI-Basic_Year_Begin= 年初
BI-Basic_Quarter_End= 季末
BI-Basic_Quarter_Begin= 季初
BI-Basic_Week_End= 周末
BI-Basic_Week_Begin= 周初
BI-Basic_Current_Day= 当天
BI-Basic_Begin_Start= 初
BI-Basic_End_Stop= 末
BI-Basic_Current_Year= 今年
BI-Basic_Year_Fen= 年份
BI-Basic_Current_Month= 本月
BI-Basic_Current_Quarter= 本季度
BI-Basic_Year_Month= 年月
BI-Basic_Year_Quarter= 年季度
BI-Basic_Input_Can_Not_Null= 输入框不能为空
BI-Basic_Date_Time_Error_Text= 日期格式示例:2015-3-11 00:00:00
BI-Basic_Input_From_To_Number= 请输入{R1}的数值
BI-Basic_Or= 或
BI-Basic_And= 且
BI-Conf_Add_Formula= 添加公式
BI-Conf_Add_Condition= 添加条件
BI-Conf_Formula_And= 且公式条件
BI-Conf_Formula_Or= 或公式条件
BI-Conf_Condition_And= 且条件
BI-Conf_Condition_Or= 或条件
BI-Microsoft_YaHei= 微软雅黑
BI-Apple_Light= 苹方-light
BI-Font_Family= 字体
BI-Basic_Please_Input_Content= 请输入内容
BI-Word_Align_Center= 文字居中
BI-Basic_Please_Enter_Number_Between= 请输入{R1}-{R2}的值
BI-More_Than= 大于
BI-More_And_Equal= 大于等于
BI-Please_Enter_SQL= 请输入SQL
BI-Basic_Click_To_Add_Text= +点击新增\\{R1}\\
BI-Basic_Please_Select= 请选择
BI-Basic_Font_Color= 文字颜色
BI-Basic_Background_Color= 背景色
BI-Basic_Underline= 下划线
BI-Basic_Param_Month= {R1}月
BI-Basic_Param_Day= {R1}日
BI-Basic_Param_Quarter= {R1}季度
BI-Basic_Param_Week_Count= 第{R1}周
BI-Basic_Param_Hour= {R1}时
BI-Basic_Param_Minute= {R1}分
BI-Basic_Param_Second= {R1}秒
BI-Basic_Param_Year= {R1}年
BI-Basic_Date_Day= 日
BI-Basic_Hour_Sin= 时
BI-Basic_Seconds= 秒
BI-Basic_Minute= 分
BI-Basic_Wan= 万
BI-Basic_Million= 百万
BI-Basic_Billion= 亿
BI-Basic_Quarter= 季度
BI-Basic_No_Select= 不选
BI-Basic_Now= 此刻

44
index.html

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Fine Report</title>
<!--核心css文件-->
<link
rel="preload"
href="./node_modules/fineui/dist/font/iconfont.woff"
as="font"
type="font/woff"
crossorigin=""
/>
<link
rel="preload"
href="assets/font/iconfont.woff"
as="font"
type="font/woff"
crossorigin=""
/>
<link
rel="stylesheet"
type="text/css"
href="./node_modules/fineui/dist/fineui.css"
/>
<link
rel="stylesheet"
type="text/css"
href="./node_modules/fineui-materials/docs/materials.css"
/>
</head>
<script>
var DecCst = null;
var Dec = null;
</script>
<body id="body">
<div id="wrapper"></div>
<script src="./node_modules/fineui/dist/fineui.js"></script>
<script src="./node_modules/fineui/i18n/i18n.cn.js"></script>
<script src="./node_modules/fineui-materials/docs/materials.js"></script>
<script src="./redis.js"></script>
</body>
</html>

26
jest.config.js

@ -0,0 +1,26 @@
const { pathsToModuleNameMapper } = require('ts-jest/utils');
// In the following statement, replace `./tsconfig` with the path to your `tsconfig` file
// which contains the path mapping (ie the `compilerOptions.paths` option):
const { jsonc } = require('jsonc');
const { readFileSync } = require('fs');
const { compilerOptions } = jsonc.parse(readFileSync('./tsconfig.json', { encoding: 'utf8' }));
module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testEnvironment: './config/jest.environment.js',
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>',
}),
globals: {
'ts-jest': {
diagnostics: {
ignoreCodes: ['TS151001'],
},
},
},
};

15
lib/transform-i18n/transform-i18n.js

@ -0,0 +1,15 @@
const { resolve } = require('path');
const { writeFileSync } = require('fs');
const propertiesReader = require('properties-reader');
let content = '';
const properties = propertiesReader(resolve(__dirname, '../../i18n/zh_cn.properties'));
properties.each((key, value) => {
content += ` '${key}': '${value}',\n`;
});
writeFileSync(resolve(__dirname, '../../private/i18n.ts'), `export default {
${content}};
`);

7
lib/upgrade/index.js

@ -0,0 +1,7 @@
const { execSync } = require('child_process');
const repositories = ['fineui', 'fineui-materials'];
repositories.forEach(repository => {
execSync(`yarn upgrade ${repository}`);
});

103
package.json

@ -1,38 +1,81 @@
{ {
"name": "database-connection", "name": "decision-webui-dcm",
"version": "1.0.0", "version": "1.0.0",
"description": "数据连接设置页面", "description": "",
"main": "index.js", "main": "src/index.ts",
"scripts": { "repository": "",
"start": "webpack-dev-server --mode development --open", "author": "decision",
"build": "webpack --mode production" "license": "MIT",
"dependencies": {
"@types/jss": "9.5.8",
"autoprefixer": "^9.6.1",
"es6-promise": "4.2.6",
"jss": "9.8.7",
"jss-plugin-global": "10.0.0-alpha.7",
"jss-plugin-nested": "10.0.0-alpha.7",
"nprogress": "0.2.0"
}, },
"author": "alan <alan@fanrun.com>",
"license": "ISC",
"devDependencies": { "devDependencies": {
"@types/node": "^12.0.2", "@babel/core": "7.4.5",
"@typescript-eslint/eslint-plugin": "^1.6.0", "@babel/plugin-proposal-class-properties": "^7.5.0",
"@typescript-eslint/parser": "^1.6.0", "@babel/plugin-proposal-decorators": "7.4.4",
"copy-webpack-plugin": "^5.0.2", "@babel/polyfill": "7.4.4",
"css-loader": "^2.1.1", "@babel/preset-env": "7.4.5",
"eslint": "^5.16.0", "@babel/preset-typescript": "7.3.3",
"file-loader": "^3.0.1", "@types/jest": "24.0.11",
"html-webpack-plugin": "^3.2.0", "@typescript-eslint/eslint-plugin": "1.7.0",
"less": "^3.9.0", "@typescript-eslint/parser": "1.7.0",
"less-loader": "^5.0.0", "axios": "0.18.0",
"mini-css-extract-plugin": "^0.6.0", "babel-loader": "8.0.6",
"node-sass": "^4.11.0", "body-parser": "1.18.3",
"path": "^0.12.7", "chokidar": "2.1.5",
"sass-loader": "^7.1.0", "cross-env": "5.2.0",
"style-loader": "^0.23.1", "css-loader": "3.0.0",
"ts-loader": "^5.3.3", "eslint": "5.16.0",
"typescript": "^3.4.1", "eslint-plugin-jest": "22.4.1",
"webpack": "^4.29.6", "express": "4.16.4",
"webpack-cli": "^3.3.0", "html-webpack-plugin": "3.2.0",
"webpack-dev-server": "^3.2.1", "http-proxy": "1.17.0",
"webpack-stream": "^5.2.1" "husky": "1.3.1",
"jest": "24.7.1",
"jest-environment-jsdom": "24.7.1",
"jsdom": "15.0.0",
"jsonc": "1.1.0",
"less": "3.9.0",
"less-loader": "5.0.0",
"mini-css-extract-plugin": "0.7.0",
"npm-run-all": "4.1.5",
"postcss-loader": "3.0.0",
"postcss-simple-vars": "5.0.2",
"properties-reader": "0.0.16",
"source-map-loader": "0.2.4",
"style-loader": "0.23.1",
"ts-jest": "24.0.2",
"typescript": "3.5.1",
"webpack": "4.35.2",
"webpack-cli": "3.3.5",
"webpack-dev-server": "3.7.2",
"webpack-merge": "4.2.1",
"ydoc": "4.1.0",
"ydoc-plugin-jsdoc": "0.0.3"
}, },
"optionalDependencies": { "optionalDependencies": {
"fineui": "git+ssh://git@cloud.finedevelop.com:7999/visual/fineui.git" "fineui": "git+ssh://git@cloud.finedevelop.com:7999/visual/fineui.git",
"fineui-materials": "git+ssh://git@cloud.finedevelop.com:7999/fui/fineui-materials.git#release/10.0"
},
"scripts": {
"dev": "cross-env NODE_ENV=mock webpack-dev-server -p --progress --config=webpack/webpack.dev.js --mode development --open",
"build": "webpack -p --progress --config=webpack/webpack.prod.js --mode production",
"eslint": "eslint './*.js' './**/*.js' './**/*.ts'",
"eslint-fix": "eslint './*.js' './**/*.js' './**/*.ts' --fix",
"const": "javac -encoding UTF-8 -d constants/classes constants/*.java && java -cp constants/classes FRConstantsWriter",
"i18n": "node ./lib/transform-i18n/transform-i18n.js",
"test": "jest --passWithNoTests",
"upgrade": "node lib/upgrade"
},
"husky": {
"hooks": {
"pre-push": "npm run eslint && npm run test"
}
} }
} }

373
private/constants.ts

@ -1,373 +0,0 @@
export const OTHER_CONNECT = 'other';
export const JNDI_CONNECT = 'JNDI';
export const MYSQL_CONNECT = 'MySQL';
export const DEFAULT_INFO = 'DESIGNER';
export const ACTION_DELETE = 'ACTION_DELETE';
export const ACTION_COPY = 'ACTION_COPY';
export const ACTION_TEST = 'ACTION_TEST';
export const TAB_LINK_SET = 'TAB_LINK_SET';
export const TAB_LINK_POOL = 'TAB_LINK_POOL';
export const DATA_LINKS = ['APACHE KYLIN', 'DERBY', 'HP Vertica', 'IBM DB2', 'INFORMIX', 'Microsoft SQL Server', 'MySQL', 'Oracle', 'Privotal Greenplum Database', 'Postgresql', 'GaussDB 200', 'JNDI'];
export const DATA_BASE_TYPE_OTHER = [
{
text: 'ADS',
databaseType: 'ads',
driver: 'com.mysql.jdbc.Driver',
url: 'jdbc:mysql://hostname:port/my_ads_db',
},
{
text: 'Amazon Redshift',
databaseType: 'amazon-redshift',
driver: 'com.amazon.redshift.jdbc4.Driver',
drivers: ['com.amazon.redshift.jdbc4.Driver', 'com.amazon.redshift.jdbc41.Driver'],
url: 'jdbc:redshift://endpoint:port/database',
},
{
text: 'APACHE IMPALA',
databaseType: 'apache-impala',
driver: 'com.cloudera.impala.jdbc41.Driver',
url: 'jdbc:impala://hostname:port/_impala_builtins',
},
{
text: 'APACHE KYLIN',
databaseType: 'apache-kylin',
driver: 'org.apache.kylin.jdbc.Driver',
url: 'jdbc:kylin://<hostname>:<port>/<kylin_project_name>',
},
{
text: 'APACHE Phoenix',
databaseType: 'apache-phoenix',
driver: 'org.apache.phoenix.jdbc.PhoenixDriver',
url: 'jdbc:phoenix:hostname:port/dbname',
},
{
text: 'DERBY',
databaseType: 'derby',
driver: 'org.apache.derby.jdbc.ClientDriver',
url: 'jdbc:derby://localhost:1527/',
},
{
text: 'Gbase 8A',
databaseType: 'gbase-8a',
driver: 'com.gbase.jdbc.Driver',
url: 'jdbc:gbase://hostname:port/dbname',
},
{
text: 'Gbase 8S',
databaseType: 'gbase-8s',
driver: 'com.gbasedbt.jdbc.IfxDriver',
url: 'jdbc:gbasedbt-sqli://{host}:{port}/{database}',
},
{
text: 'Gbase 8T',
databaseType: 'gbase-8t',
driver: 'com.informix.jdbc.IfxDriver',
url: 'jdbc:informix-sqli://{host}:{port}/{database}:INFORMIXSERVER={server}',
},
{
text: 'H2',
databaseType: 'h2',
driver: 'org.h2.Driver',
url: 'jdbc:h2://${ENV_HOME}/../databaseName',
},
{
text: '华为云DWS',
databaseType: 'hw-dws',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'FusionInsight elk',
databaseType: 'hw-elk',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'FusionInsight HD',
databaseType: 'hw-fusioninsight-hd',
driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://10.135.0.110:24002,10.135.0.67:24002,10.135.0.66:24002/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;sasl.qop=auth-conf;auth=KERBEROS;zk.principal=zookeeper/hadoop;principal=hive/hadoop.hadoop.com@HADOOP.COM;',
},
{
text: 'GaussDB 200',
databaseType: 'hw-libr-a',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
}, {
text: 'Hadoop Hive',
databaseType: 'hadoop-hive',
driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://hostname:port/databasename',
}, {
text: 'Hbase',
databaseType: 'hbase',
driver: 'org.apache.phoenix.jdbc.PhoenixDriver',
url: 'jdbc:phoenix:hostname:port/dbname',
}, {
text: 'HP Vertica',
databaseType: 'hp-vertica',
driver: 'com.vertica.jdbc.Driver',
url: 'jdbc:vertica://ip:port/databaseName',
}, {
text: 'Hsql',
databaseType: 'hsql',
driver: 'com.fr.third.org.hsqldb.jdbcDriver',
url: 'jdbc:hsqldb:file:[PATH_TO_DB_FILES]',
}, {
text: 'IBM DB2',
databaseType: 'ibm-db2',
driver: 'com.ibm.db2.jcc.DB2Driver',
url: 'jdbc:db2://hostname:port/dbname',
}, {
text: 'INFORMIX',
databaseType: 'informix',
driver: 'com.informix.jdbc.IfxDriver',
url: 'jdbc:informix-sqli://{host}:{port}/{database}:INFORMIXSERVER={server}',
}, {
text: 'KINGBASE',
databaseType: 'kingbase',
driver: 'com.kingbase.Driver',
url: 'jdbc:kingbase://hostname:port',
}, {
text: 'Microsoft SQL Server',
databaseType: 'sql-server',
driver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
url: 'jdbc:sqlserver://localhost:1433;databaseName=',
}, {
text: 'MySQL',
databaseType: 'mysql',
driver: 'com.mysql.jdbc.Driver',
drivers: ['com.mysql.jdbc.Driver', 'org.gjt.mm.mysql.Driver'],
url: 'jdbc:mysql://localhost/dbname',
},
{
text: 'Oracle',
databaseType: 'oracle',
driver: 'oracle.jdbc.driver.OracleDriver',
url: 'jdbc:oracle:thin:@localhost:1521:databaseName',
},
{
text: 'Pivotal Greenplum Database',
databaseType: 'pivotal-greenplum-database',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
}, {
text: 'Postgresql',
databaseType: 'postgresql',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
}, {
text: 'Presto',
databaseType: 'presto',
driver: 'com.facebook.presto.jdbc.PrestoDriver',
url: 'jdbc:presto://host:port/catalog',
}, {
text: 'SAP HANA',
databaseType: 'sap-hana',
driver: 'com.sap.db.jdbc.Driver',
url: 'jdbc:sap://hostname:port?reconnect=true',
}, {
text: 'SAP Sybase',
databaseType: 'sap-sybase',
driver: 'com.sybase.jdbc4.jdbc.SybDriver',
url: 'jdbc:sybase:Tds:hostname:2638/databasename',
}, {
text: 'SPARK',
databaseType: 'spark',
driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://hostname:port/databasename',
}, {
text: 'Sqlite',
databaseType: 'sqlite',
driver: 'org.sqlite.JDBC',
url: 'jdbc:sqlite:[PATH_TO_DB_FILES]',
}, {
text: 'TeraData',
databaseType: 'teradata',
driver: 'com.ncr.teradata.TeraDriver',
url: 'jdbc:teradata://localhost/CLIENT_CHARSET=EUC_CN,TMODE=TERA,CHARSET=ASCII,LOB_SUPPORT',
}, {
text: 'TRANSWARP INCEPTOR',
databaseType: 'transwarp-inceptor',
driver: 'org.apache.hive.jdbc.HiveDriver',
url: 'jdbc:hive2://hostname:port/databasename',
},
];
export const DATA_BASE_TYPE = [
{
text: 'APACHE KYLIN',
databaseType: 'apache-kylin',
driver: 'org.apache.kylin.jdbc.Driver',
url: 'jdbc:kylin://<hostname>:<port>/<kylin_project_name>',
},
{
text: 'DERBY',
databaseType: 'derby',
driver: 'org.apache.derby.jdbc.ClientDriver',
url: 'jdbc:derby://localhost:1527/',
},
{
text: 'HP Vertica',
databaseType: 'hp-vertica',
driver: 'com.vertica.jdbc.Driver',
url: 'jdbc:vertica://ip:port/databaseName',
},
{
text: 'IBM DB2',
databaseType: 'ibm-db2',
driver: 'com.ibm.db2.jcc.DB2Driver',
url: 'jdbc:db2://hostname:port/dbname',
},
{
text: 'INFORMIX',
databaseType: 'informix',
driver: 'com.informix.jdbc.IfxDriver',
url: 'jdbc:informix-sqli://{host}:{port}/{database}:INFORMIXSERVER={server}',
},
{
text: 'Microsoft SQL Server',
databaseType: 'sql-server',
driver: 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
url: 'jdbc:sqlserver://localhost:1433;databaseName=',
},
{
text: 'Oracle',
databaseType: 'oracle',
driver: 'oracle.jdbc.driver.OracleDriver',
url: 'jdbc:oracle:thin:@localhost:1521:databaseName',
},
{
text: 'Privotal Greenplum Database',
databaseType: 'pivotal-greenplum-database',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'Postgresql',
databaseType: 'postgresql',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'GaussDB 200',
databaseType: 'hw-libr-a',
driver: 'org.postgresql.Driver',
url: 'jdbc:postgresql://hostname:port/dbname',
},
{
text: 'MySQL',
databaseType: 'mysql',
driver: 'com.mysql.jdbc.Driver',
drivers: ['com.mysql.jdbc.Driver', 'org.gjt.mm.mysql.Driver'],
url: 'jdbc:mysql://localhost/dbname',
},
{
text: OTHER_CONNECT,
databaseType: 'other',
driver: 'org.h2.Driver',
drivers: ['org.h2.Driver', 'com.fr.third.org.hsqldb.jdbcDriver', 'org.sqlite.JDBC'],
url: 'jdbc:h2://${ENV_HOME}/../databaseName',
},
...DATA_BASE_TYPE_OTHER,
{
text: JNDI_CONNECT,
},
];
export const JNDI_FACTORYS = ['', 'weblogic.jndi.WLInitialContextFactory', 'com.ibm.websphere.naming.WsnInitialContextFactory', 'org.jboss.naming.HttpNamingContextFactory', 'org.jnp.interfaces.NamingContextFactory', 'com.caucho.burlap.BurlapContextFactory'];
export const OTHER_ATTRIBUTES = [
{
text: 'OBJECT_FACTORIES',
name: 'objectFactories',
},
{
text: 'STATE_FACTORIES',
name: 'stateFactories',
},
{
text: 'URL_PKG_PREFIXES',
name: 'urlPkgPrefixes',
},
{
text: 'DNS_URL',
name: 'dnsUrl',
},
{
text: 'AUTHORITATIVE',
name: 'authoritative',
},
{
text: 'BATCHSIZE',
name: 'batchSize',
},
{
text: 'REFERRAL',
name: 'referral',
},
{
text: 'SECURITY_PROTOCOL',
name: 'securityProtocol',
},
{
text: 'SECURITY_AUTHENTICATION',
name: 'securityAuthentication',
},
{
text: 'LANGUAGE',
name: 'language',
},
{
text: 'APPLET',
name: 'applet',
},
];
export const CONNECT_CHARSET = [
{
text: 'GBK',
value: 'GBK',
},
{
text: 'BIG5',
value: 'BIG5',
},
{
text: 'ISO-8859-1',
value: 'ISO-8859-1',
},
{
text: 'UTF-8',
value: 'UTF-8',
},
{
text: 'UTF-16',
value: 'UTF-16',
},
{
text: 'EUC_JP',
value: 'EUC_JP',
},
{
text: 'EUC_KR',
value: 'EUC_KR',
},
{
text: 'CP850',
value: 'CP850',
},
];
const DecDcm = {
TEST_STATUS_WAITING: 1,
TEST_STATUS_SUCCESS: 2,
TEST_STATUS_FAIL: 3,
};
export default DecDcm;

241
private/i18n.ts

@ -1,12 +1,24 @@
export default { export default {
'Dec-Dcm_Connection_New': '新建数据连接',
'Dec-Dcm_Connection_Name': '数据连接名称',
'Dec-Dcm_Connection_None': '无可用数据连接,请点击添加',
'Dec-Dcm_Connection_Test': '测试连接',
'Dec-Dcm_Connection_Commonly': '常用',
'Dec-Dcm_Connection_Type_Filter': '类型筛选:',
'Dec-Dcm_Connection_Support_Inner': '内置支持',
'Dec-Dcm_Connection_Support_Plugin': '插件支持',
'Dec-Dcm_Connection_Filter_Tip': '提示:当前仅支持部分插件类型,未支持类型请使用设计器的旧版本数据连接进行创建',
'Dec-Dcm_Connection_All': '所有',
'Dec-Dcm_Connection_Other': '其他',
'Dec-Dcm_Connection_Management': '数据连接管理', 'Dec-Dcm_Connection_Management': '数据连接管理',
'Dec-Dcm_Pool_Connection_Management': '连接池管理', 'Dec-Dcm_Pool_Connection_Management': '连接池状态',
'Dec-Dcm_Data_Connections': '数据连接', 'Dec-Dcm_Data_Connections': '数据连接',
'Dec-Dcm_Active_Connections_Number': '活动连接数', 'Dec-Dcm_Active_Connections_Number': '活动连接数',
'Dec-Dcm_Leisure_Connections_Number': '空闲连接数', 'Dec-Dcm_Leisure_Connections_Number': '空闲连接数',
'Dec-Dcm_Connections': '连接', 'Dec-Dcm_Connections': '连接',
'Dec-Dcm_Default': '默认', 'Dec-Dcm_Default': '默认',
'Dec-Dcm_Delete': '删除', 'Dec-Dcm_Delete': '删除',
'Dec-Dcm_Millisecond': '毫秒',
'Dec-Dcm_Test_Connection': '测试连接', 'Dec-Dcm_Test_Connection': '测试连接',
'Dec-Dcm_Copy': '复制', 'Dec-Dcm_Copy': '复制',
'Dec-Dcm_Edit': '编辑', 'Dec-Dcm_Edit': '编辑',
@ -14,36 +26,42 @@ export default {
'Dec-Dcm_Yes': '是', 'Dec-Dcm_Yes': '是',
'Dec-Dcm_No': '否', 'Dec-Dcm_No': '否',
'Dec-Dcm_Search': '搜索', 'Dec-Dcm_Search': '搜索',
'Dec-Dcm_Type': '类型', 'Dec-Dcm_Type': '类型:{R1}',
'Dec-Dcm_Other': '其他', 'Dec-Dcm_Other': '其他',
'Dec-Dcm_Tips': '提示', 'Dec-Dcm_Tips': '提示',
'Dec-Dcm_Back': '返回', 'Dec-Dcm_Back': '返回',
'Dec-Dcm_Creator': '创建者', 'Dec-Dcm_Creator': '创建者:{R1}',
'Dec-Dcm_First_Step': '第一步', 'Dec-Dcm_First_Step': '第一步',
'Dec-Dcm_Second_Step': '第二步', 'Dec-Dcm_Second_Step': '第二步',
'Dec-Dcm_Third_Step': '第三步', 'Dec-Dcm_Third_Step': '第三步',
'Dec-Dcm_Connection_ConnectionName_Cannt_Null': '数据连接名不可为空',
'Dec-Dcm_Connection_Np_Registered': '该类型暂仅支持在设计器中使用旧版本数据连接查看',
'Dec-Dcm_Connection_Detailed_Information': '详细信息', 'Dec-Dcm_Connection_Detailed_Information': '详细信息',
'Dec-Dcm_Connection_Handup_Information': '收起信息', 'Dec-Dcm_Connection_Handup_Information': '收起信息',
'Dec-Dcm_Connection_Testing': '正在测试连接,请稍候...', 'Dec-Dcm_Connection_Testing': '正在测试连接,请稍候...',
'Dec-Dcm_Connection_Test_Fail': '测试连接失败', 'Dec-Dcm_Connection_Test_Fail': '{R1}测试连接失败',
'Dec-Dcm_Connection_Test_Success': '连接成功', 'Dec-Dcm_Connection_Test_Success': '连接成功',
'Dec-Dcm_Connection_Option_Cannot_Find': '找不到该连接的配置信息', 'Dec-Dcm_Connection_Option_Cannot_Find': '找不到该连接的配置信息',
'Dec-Dcm_Connection_Config_No_Save': '当前设置尚未保存,是否保存?', 'Dec-Dcm_Connection_Config_No_Save': '当前设置尚未保存,是否保存?',
'Dec-Dcm_Connection_New': '新建数据连接',
'Dec-Dcm_Connection_More': '更多数据连接...', 'Dec-Dcm_Connection_More': '更多数据连接...',
'Dec-Dcm_Connection_More_Title': '更多数据连接', 'Dec-Dcm_Connection_More_Title': '更多数据连接',
'Dec-Dcm_Connection_Other': '其他',
'Dec-Dcm_Connection_Plase_Add_One': '请选择左侧数据连接或点击新建数据连接', 'Dec-Dcm_Connection_Plase_Add_One': '请选择左侧数据连接或点击新建数据连接',
'Dec-Dcm_Connection_Is_Existence': '数据连接名已存在', 'Dec-Dcm_Connection_Is_Existence': '数据连接名已存在',
'Dec-Dcm_Connection_No_Search_Result': '无搜索结果',
'Dec-Dcm_Connection_Form_ConnectionName': '数据连接名', 'Dec-Dcm_Connection_Form_ConnectionName': '数据连接名',
'Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm': '*修改数据连接名会影响相关数据表和仪表板', 'Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm': '*修改数据连接名会影响相关数据表和仪表板',
'Dec-Dcm_Connection_Form_Driver': '驱动', 'Dec-Dcm_Connection_Form_Driver': '驱动',
'Dec-Dcm_Connection_Form_URL': 'URL', 'Dec-Dcm_Connection_Form_URL': 'URL',
'Dec-Dcm_Connection_Form_Database_URL': '数据库URL',
'Dec-Dcm_Connection_Form_Place_Input': '请输入', 'Dec-Dcm_Connection_Form_Place_Input': '请输入',
'Dec-Dcm_Connection_Form_OriginalCharsetName': '编码', 'Dec-Dcm_Connection_Form_OriginalCharsetName': '编码',
'Dec-Dcm_Connection_Form_Auto': '自动', 'Dec-Dcm_Connection_Form_Auto': '自动',
'Dec-Dcm_Connection_Form_Host': '主机',
'Dec-Dcm_Connection_Form_AuthType': '认证方式',
'Dec-Dcm_Connection_Form_UserName': '用户名', 'Dec-Dcm_Connection_Form_UserName': '用户名',
'Dec-Dcm_Connection_Form_Password': '密码', 'Dec-Dcm_Connection_Form_Password': '密码',
'Dec-Dcm_Connection_Form_Principal': '客户端principal',
'Dec-Dcm_Connection_Form_KeyPath': 'keytab密钥路径',
'Dec-Dcm_Connection_Form_Pool_Properties': '连接池属性', 'Dec-Dcm_Connection_Form_Pool_Properties': '连接池属性',
'Dec-Dcm_Connection_Form_SQL_Validation_Query': 'SQL验证查询', 'Dec-Dcm_Connection_Form_SQL_Validation_Query': 'SQL验证查询',
'Dec-Dcm_Connection_Form_Connection-Check': '获取连接前校验', 'Dec-Dcm_Connection_Form_Connection-Check': '获取连接前校验',
@ -51,13 +69,218 @@ export default {
'Dec-Dcm_Connection_Form_Place_Input-Number': '请输入有效的正整数', 'Dec-Dcm_Connection_Form_Place_Input-Number': '请输入有效的正整数',
'Dec-Dcm_Connection_Form_Pattern': '模式', 'Dec-Dcm_Connection_Form_Pattern': '模式',
'Dec-Dcm_Connection_Form_Database_Addr': '数据库地址', 'Dec-Dcm_Connection_Form_Database_Addr': '数据库地址',
'Dec-Dcm_Connection_Form_Database_Port': '端口号', 'Dec-Dcm_Connection_Form_Database_Name': '数据库名称',
'Dec-Dcm_Connection_Form_Database_Port': '端口',
'Dec-Dcm_Connection_Form_Database_Advanced_Setting': '高级设置',
'Dec-Dcm_Connection_Form_Database_Initial_Size': '初始化连接数',
'Dec-Dcm_Connection_Form_Database_Max_Active': '最大活动连接数',
'Dec-Dcm_Connection_Form_Database_Max_Idle': '最大空闲连接数',
'Dec-Dcm_Connection_Form_Database_Max_Wait': '最大等待时间',
'Dec-Dcm_Connection_Form_Database_Validation_Query': 'SQL验证查询',
'Dec-Dcm_Connection_Form_Database_Test_On_Borrow': '获取连接前检验',
'Dec-Dcm_Connection_Form_Database_Test_On_Return': '归还连接前检验',
'Dec-Dcm_Connection_Form_Database_Test_While_Idle': '开启空闲回收器检验',
'Dec-Dcm_Connection_Form_Database_Test_Between_Eviction_Millis': '空闲连接回收器休眠时间',
'Dec-Dcm_Connection_Form_Database_Tests_PerEviction_Run_Num': '空闲连接回收检查数',
'Dec-Dcm_Connection_Form_Database_Min_Evictable_Idle_Time_Millis': '保持空闲最小时间值',
'Dec-Dcm_Connection_Make_Sure_Delete': '确定删除该数据连接?', 'Dec-Dcm_Connection_Make_Sure_Delete': '确定删除该数据连接?',
'Dec-Dcm_Connection_ReConnect': '重新连接', 'Dec-Dcm_Connection_ReConnect': '重新连接',
'Dec-Dcm_Connection_JNDI_Form_ConnectionName': 'JNDI的名字', 'Dec-Dcm_Connection_JNDI_Form_ConnectionName': 'JNDI的名字',
'Dec-Dcm_Connection_JNDI_Form_Connection': '数据来自数据连接',
'Dec-Dcm_Connection_Form_JNDI_Context': '上下文', 'Dec-Dcm_Connection_Form_JNDI_Context': '上下文',
'Dec-Dcm_Connection_Form_JNDI_Advanced': '高级', 'Dec-Dcm_Connection_Form_JNDI_Advanced': '高级',
'Dec-Dcm_Connection_Form_JNDI_Other_Attributes': '其他属性', 'Dec-Dcm_Connection_Form_JNDI_Other_Attributes': '其他属性',
'Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes': '收起', 'Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes': '收起',
'Dec-Dcm_Connection_Form_JNDI_Notice': '注意:需要把包含INITIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下.', 'Dec-Dcm_Connection_JNDI': 'JNDI数据连接',
'Dec-Dcm_Connection_JNDI_Warning': '注意:需要把包含INTIAL_CONTEXT_FACTORY类的.jar文件复制到软件安装目录下的/lib目录下',
'Dec-Dcm_Connection_Error': '接口访问错误',
'BI-Multi_Date_Quarter_End': '季度末',
'BI-Multi_Date_Month_Begin': '月初',
'BI-Multi_Date_YMD': '年月日',
'BI-Custom_Color': '自定义颜色',
'BI-Numerical_Interval_Input_Data': '请输入数值',
'BI-Please_Input_Natural_Number': '请输入非负整数',
'BI-No_More_Data': '无更多数据',
'BI-Basic_Altogether': '共',
'BI-Basic_Sunday': '星期日',
'BI-Widget_Background_Colour': '组件背景',
'BI-Color_Picker_Error_Text': '请输入0~255的正整数',
'BI-Multi_Date_Month': '月',
'BI-No_Selected_Item': '没有可选项',
'BI-Multi_Date_Year_Begin': '年初',
'BI-Quarter_1': '第1季度',
'BI-Quarter_2': '第2季度',
'BI-Quarter_3': '第3季度',
'BI-Quarter_4': '第4季度',
'BI-Multi_Date_Year_Next': '年后',
'BI-Multi_Date_Month_Prev': '个月前',
'BI-Month_Trigger_Error_Text': '请输入1~12的正整数',
'BI-Less_And_Equal': '小于等于',
'BI-Year_Trigger_Invalid_Text': '请输入有效时间',
'BI-Multi_Date_Week_Next': '周后',
'BI-Font_Size': '字号',
'BI-Basic_Total': '共',
'BI-Already_Selected': '已选择',
'BI-Formula_Insert': '插入',
'BI-Select_All': '全选',
'BI-Basic_Tuesday': '星期二',
'BI-Multi_Date_Month_End': '月末',
'BI-Load_More': '点击加载更多数据',
'BI-Basic_September': '九月',
'BI-Current_Is_Last_Page': '当前已是最后一页',
'BI-Basic_Auto': '自动',
'BI-Basic_Count': '个',
'BI-Basic_Value': '值',
'BI-Basic_Unrestricted': '无限制',
'BI-Quarter_Trigger_Error_Text': '请输入1~4的正整数',
'BI-Basic_More': '更多',
'BI-Basic_Wednesday': '星期三',
'BI-Basic_Bold': '加粗',
'BI-Basic_Simple_Saturday': '六',
'BI-Multi_Date_Month_Next': '个月后',
'BI-Basic_March': '三月',
'BI-Current_Is_First_Page': '当前已是第一页',
'BI-Basic_Thursday': '星期四',
'BI-Basic_Prompt': '提示',
'BI-Multi_Date_Today': '今天',
'BI-Multi_Date_Quarter_Prev': '个季度前',
'BI-Row_Header': '行表头',
'BI-Date_Trigger_Error_Text': '日期格式示例:2015-3-11',
'BI-Basic_Cancel': '取消',
'BI-Basic_January': '一月',
'BI-Basic_June': '六月',
'BI-Basic_July': '七月',
'BI-Basic_April': '四月',
'BI-Multi_Date_Quarter_Begin': '季度初',
'BI-Multi_Date_Week': '周',
'BI-Click_Blank_To_Select': '点击\\空格键\\选中完全匹配项',
'BI-Basic_August': '八月',
'BI-Word_Align_Left': '文字居左',
'BI-Basic_November': '十一月',
'BI-Font_Colour': '字体颜色',
'BI-Multi_Date_Day_Prev': '天前',
'BI-Select_Part': '部分选择',
'BI-Multi_Date_Day_Next': '天后',
'BI-Less_Than': '小于',
'BI-Basic_February': '二月',
'BI-Multi_Date_Year': '年',
'BI-Number_Index': '序号',
'BI-Multi_Date_Week_Prev': '周前',
'BI-Next_Page': '下一页',
'BI-Right_Page': '向右翻页',
'BI-Numerical_Interval_Signal_Value': '前后值相等,请将操作符改为“≤”',
'BI-Basic_December': '十二月',
'BI-Basic_Saturday': '星期六',
'BI-Basic_Simple_Wednesday': '三',
'BI-Multi_Date_Quarter_Next': '个季度后',
'BI-Basic_October': '十月',
'BI-Basic_Simple_Friday': '五',
'BI-Basic_Save': '保存',
'BI-Numerical_Interval_Number_Value': '请保证前面的数值小于/等于后面的数值',
'BI-Previous_Page': '上一页',
'BI-No_Select': '搜索结果为空',
'BI-Basic_Clears': '清空',
'BI-Created_By_Me': '我创建的',
'BI-Basic_Simple_Tuesday': '二',
'BI-Word_Align_Right': '文字居右',
'BI-Summary_Values': '汇总',
'BI-Basic_Clear': '清除',
'BI-Upload_File_Size_Error': '文件大小不支持',
'BI-Up_Page': '向上翻页',
'BI-Basic_Simple_Sunday': '日',
'BI-Multi_Date_Relative_Current_Time': '相对当前时间',
'BI-Selected_Data': '已选数据:',
'BI-Multi_Date_Quarter': '季度',
'BI-Check_Selected': '查看已选',
'BI-Basic_Search': '搜索',
'BI-Basic_May': '五月',
'BI-Continue_Select': '继续选择',
'BI-Please_Input_Positive_Integer': '请输入正整数',
'BI-Upload_File_Type_Error': '文件类型不支持',
'BI-Upload_File_Error': '文件上传失败',
'BI-Basic_Friday': '星期五',
'BI-Down_Page': '向下翻页',
'BI-Basic_Monday': '星期一',
'BI-Left_Page': '向左翻页',
'BI-Transparent_Color': '透明',
'BI-Basic_Simple_Monday': '一',
'BI-Multi_Date_Year_End': '年末',
'BI-Time_Interval_Error_Text': '请保证开始时间早于/等于结束时间',
'BI-Basic_Time': '时间',
'BI-Basic_OK': '确定',
'BI-Basic_Sure': '确定',
'BI-Basic_Simple_Thursday': '四',
'BI-Multi_Date_Year_Prev': '年前',
'BI-Tiao_Data': '条数据',
'BI-Basic_Italic': '斜体',
'BI-Basic_Dynamic_Title': '动态时间',
'BI-Basic_Year': '年',
'BI-Basic_Single_Quarter': '季',
'BI-Basic_Month': '月',
'BI-Basic_Week': '周',
'BI-Basic_Day': '天',
'BI-Basic_Work_Day': '工作日',
'BI-Basic_Front': '前',
'BI-Basic_Behind': '后',
'BI-Basic_Empty': '空',
'BI-Basic_Month_End': '月末',
'BI-Basic_Month_Begin': '月初',
'BI-Basic_Year_End': '年末',
'BI-Basic_Year_Begin': '年初',
'BI-Basic_Quarter_End': '季末',
'BI-Basic_Quarter_Begin': '季初',
'BI-Basic_Week_End': '周末',
'BI-Basic_Week_Begin': '周初',
'BI-Basic_Current_Day': '当天',
'BI-Basic_Begin_Start': '初',
'BI-Basic_End_Stop': '末',
'BI-Basic_Current_Year': '今年',
'BI-Basic_Year_Fen': '年份',
'BI-Basic_Current_Month': '本月',
'BI-Basic_Current_Quarter': '本季度',
'BI-Basic_Year_Month': '年月',
'BI-Basic_Year_Quarter': '年季度',
'BI-Basic_Input_Can_Not_Null': '输入框不能为空',
'BI-Basic_Date_Time_Error_Text': '日期格式示例:2015-3-11 00:00:00',
'BI-Basic_Input_From_To_Number': '请输入{R1}的数值',
'BI-Basic_Or': '或',
'BI-Basic_And': '且',
'BI-Conf_Add_Formula': '添加公式',
'BI-Conf_Add_Condition': '添加条件',
'BI-Conf_Formula_And': '且公式条件',
'BI-Conf_Formula_Or': '或公式条件',
'BI-Conf_Condition_And': '且条件',
'BI-Conf_Condition_Or': '或条件',
'BI-Microsoft_YaHei': '微软雅黑',
'BI-Apple_Light': '苹方-light',
'BI-Font_Family': '字体',
'BI-Basic_Please_Input_Content': '请输入内容',
'BI-Word_Align_Center': '文字居中',
'BI-Basic_Please_Enter_Number_Between': '请输入{R1}-{R2}的值',
'BI-More_Than': '大于',
'BI-More_And_Equal': '大于等于',
'BI-Please_Enter_SQL': '请输入SQL',
'BI-Basic_Click_To_Add_Text': '+点击新增\\{R1}\\',
'BI-Basic_Please_Select': '请选择',
'BI-Basic_Font_Color': '文字颜色',
'BI-Basic_Background_Color': '背景色',
'BI-Basic_Underline': '下划线',
'BI-Basic_Param_Month': '{R1}月',
'BI-Basic_Param_Day': '{R1}日',
'BI-Basic_Param_Quarter': '{R1}季度',
'BI-Basic_Param_Week_Count': '第{R1}周',
'BI-Basic_Param_Hour': '{R1}时',
'BI-Basic_Param_Minute': '{R1}分',
'BI-Basic_Param_Second': '{R1}秒',
'BI-Basic_Param_Year': '{R1}年',
'BI-Basic_Date_Day': '日',
'BI-Basic_Hour_Sin': '时',
'BI-Basic_Seconds': '秒',
'BI-Basic_Minute': '分',
'BI-Basic_Wan': '万',
'BI-Basic_Million': '百万',
'BI-Basic_Billion': '亿',
'BI-Basic_Quarter': '季度',
'BI-Basic_No_Select': '不选',
'BI-Basic_Now': '此刻',
}; };

180
redis.js

@ -0,0 +1,180 @@
const ConstantRedisType = 'dec.constant.database.conf.connect.types';
const ConstantRedisShow = 'dec.constant.database.conf.connect.form.Redis.show';
const ConstantRedisEdit = 'dec.constant.database.conf.connect.form.Redis.edit';
BI.DOM.ready(() => {
BI.config(ConstantRedisType, datas => [...datas, {
text: 'Redis',
databaseType: 'Redis',
}]);
const RedisShowName = 'dec.dcm.connection.plugin.redis.show';
const RedisShow = BI.inherit(BI.Widget, {
props: {
formData: {
url: '',
port: '6379',
password: '',
},
},
render() {
const o = this.options;
return {
type: 'bi.vertical',
hgap: 15,
vgap: 10,
items: [
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '数据库地址',
},
{
type: 'bi.label',
text: o.formData.url,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '端口号',
},
{
type: 'bi.label',
text: o.formData.port,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '密码',
},
{
type: 'bi.label',
text: o.formData.password,
},
],
},
],
};
},
});
BI.shortcut(RedisShowName, RedisShow);
BI.constant(ConstantRedisShow, RedisShowName);
const RedisEditName = 'dec.dcm.connection.plugin.redis.edit';
const RedisEdit = BI.inherit(BI.Widget, {
props: {
formData: {
url: '',
port: '6379',
password: '',
},
},
render() {
const o = this.options;
return {
type: 'bi.vertical',
hgap: 15,
vgap: 10,
items: [
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '数据库地址',
},
{
type: 'bi.text_editor',
width: 300,
allowBlank: true,
ref: _ref => {
this.url = _ref;
},
text: o.formData.url,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '端口号',
},
{
type: 'bi.text_editor',
width: 300,
allowBlank: true,
ref: _ref => {
this.port = _ref;
},
text: o.formData.port,
},
],
},
{
type: 'bi.left',
items: [
{
type: 'bi.label',
cls: 'bi-font-bold',
width: 100,
textAlign: 'left',
text: '密码',
},
{
type: 'bi.text_editor',
width: 300,
allowBlank: true,
inputType: 'password',
ref: _ref => {
this.password = _ref;
},
text: o.formData.password,
},
],
},
],
};
},
getSubmitValue() {
return {
url: this.url.getValue(),
port: this.port.getValue(),
password: this.password.getValue(),
};
},
});
BI.shortcut(RedisEditName, RedisEdit);
BI.constant(ConstantRedisEdit, RedisEditName);
});

4
src/app/app.constant.ts

@ -1,4 +0,0 @@
export const ConstantName = 'dec.constant.database.conf.connect.list';
BI.constant(ConstantName, [
]);
export default ConstantName;

39
src/app/app.model.ts

@ -1,39 +0,0 @@
const className = 'dec.dcm.model.main';
import {ModelType} from '@ui';
import {LinkType} from '@ui/type';
import {fetchLinkList} from '../shared/crud/crud.request';
import {TAB_LINK_SET} from '@private/constants';
const linkList: LinkType[] = [];
const Model: ModelType = {
childContext: ['tab', 'linkList', 'linkSelected', 'linkUpdate', 'moreLinkSelected', 'statusSelected', 'connectionNameErr'],
state () {
return {
tab: '',
linkList,
linkSelected: {},
linkUpdate: {},
moreLinkSelected: '',
statusSelected: '',
connectionNameErr: '',
};
},
computed: {
},
actions: {
initData(callback: Function) {
fetchLinkList((linkList: LinkType[]) => {
this.model.linkList = linkList;
this.model.tab = TAB_LINK_SET;
callback();
});
},
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

55
src/app/app.ts

@ -1,55 +0,0 @@
import {Vtape, Absolute, LinearSegment} from '../ui/index';
import appModel from './app.model';
import title from './title/title';
import linkSet from './connection/link_set';
import linkStatus from './status/link_status';
import '../less/index.less';
const className = 'dec.dcm.main';
const Widget = BI.inherit(BI.Widget, {
props: {
baseCls: 'dec-webui-dcm-layout bi-background',
},
_store() {
return BI.Models.getModel(appModel);
},
beforeInit (callback) {
this.store.initData(callback);
},
render() {
return {
type: Vtape,
items: [
{
el: {
type: title,
},
height: 40,
},
{
type: Absolute,
items: [{
el: {
type: linkSet,
},
left: 10,
top: 10,
right: 10,
bottom: 10,
}, {
el: {
type: linkStatus,
},
left: 10,
top: 10,
right: 10,
bottom: 10,
}],
},
],
};
},
});
BI.shortcut(className, Widget);
export default className;

4
src/app/connection/left/item/left_item.less

@ -1,4 +0,0 @@
@import '../../../../less/index.less';
.dec-webui-dcm-connection-left-item{
.hover-visible(link-item-icon);
}

77
src/app/connection/left/item/left_item.ts

@ -1,77 +0,0 @@
import './left_item.less';
import {WidgetType, Icon, TextButton, LeftRightVerticalAdapt} from '@ui';
import ItemIcon from './left_item_icon';
import ItemDelete from './left_item_delete';
import Model from '../../link_set.model';
import {ACTION_COPY, ACTION_TEST, ACTION_DELETE, DEFAULT_INFO} from '@private/constants';
const className = 'dec.dcm.component.linkSet.left.item';
const Widget: WidgetType = {
props: {
title: '',
id: '',
creator: '',
baseCls: 'dec-webui-dcm-connection-left-item bi-list-item-active',
},
_store() {
return BI.Models.getModel(Model);
},
render() {
const {title, creator, text, id} = this.options;
return {
type: LeftRightVerticalAdapt,
items: {
left: [
{
type: Icon,
cls: 'dcm-link-font',
height: 25,
width: 25,
text: BI.i18nText('Dec-Dcm_Connections'),
title,
},
{
type: TextButton,
text: title,
title,
},
],
right: [
{
type: ItemIcon,
cls: 'link-item-icon dcm-test-font',
title: BI.i18nText('Dec-Dcm_Test_Connection'),
value: ACTION_TEST,
id,
},
{
type: ItemIcon,
cls: 'link-item-icon copy-font',
title: BI.i18nText('Dec-Dcm_Copy'),
value: ACTION_COPY,
id,
},
{
type: ItemIcon,
cls: 'link-item-icon dcm-info-font',
title: `${BI.i18nText('Dec-Dcm_Type')}${text === DEFAULT_INFO ? BI.i18nText('Dec-Dcm_Other') : text} \r\n${BI.i18nText('Dec-Dcm_Creator')}${creator}`,
id,
},
{
type: ItemDelete,
cls: 'link-item-icon dcm-delete-font',
title: BI.i18nText('Dec-Dcm_Delete'),
value: ACTION_DELETE,
id,
},
],
},
};
},
doClick() {
const {title} = this.options;
this.store.setLinkSelected(title);
},
};
BI.shortcut(className, BI.inherit(BI.BasicButton, Widget));
export default className;

43
src/app/connection/left/item/left_item_delete.ts

@ -1,43 +0,0 @@
import {WidgetType, Icon, BubbleCombo, TextBubblePopupBarView} from '@ui';
import Model from '../../link_set.model';
const className = 'dec.dcm.component.linkSet.left.item.icon.delete';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
render() {
const {title, id} = this.options;
const that = this;
return {
type: BubbleCombo,
stopPropagation: true,
direction: 'bottom',
ref: _ref => {
this.combo = _ref;
},
el: {
type: Icon,
height: 25,
width: 25,
title,
},
popup: {
type: TextBubblePopupBarView,
text: BI.i18nText('Dec-Dcm_Connection_Make_Sure_Delete'),
listeners: [{
eventName: BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,
action (type: boolean) {
that.combo.hideView();
if (type) {
that.store.onIconClick(title, id);
}
},
}],
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

26
src/app/connection/left/item/left_item_icon.ts

@ -1,26 +0,0 @@
import {WidgetType, IconButton} from '@ui';
import Model from '../../link_set.model';
const className = 'dec.dcm.component.linkSet.left.item.icon';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
render() {
const {title} = this.options;
return {
type: IconButton,
height: 25,
width: 25,
stopPropagation: true,
title,
handler: () => {
const {id, title} = this.options;
this.store.onIconClick(title, id);
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

39
src/app/connection/left/left.ts

@ -1,39 +0,0 @@
import {WidgetType, ListView} from '@ui';
import Model from '../link_set.model';
import {LinkType} from '@ui/type';
import LeftItem from './item/left_item';
const className = 'dec.dcm.component.linkset.left';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkList(linkList: LinkType[]) {
this.leftContent.populate(BI.createItems(this._renderItems(linkList)));
},
},
render() {
return {
type: ListView,
ref: _ref => {
this.leftContent = _ref;
},
items: this._renderItems(this.model.linkList),
};
},
_renderItems(linkList: LinkType[]) {
return BI.map(linkList, (index: number, item: LinkType) => {
return {
type: LeftItem,
selected: item.isSelected,
title: item.connectionName,
id: item.connectionId,
creator: item.creator,
text: item.text ? item.text : BI.i18nText('Dec-Dcm_Default'),
};
});
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

50
src/app/connection/link_set.mixin.ts

@ -1,50 +0,0 @@
import {LinkType} from '@ui/type';
import {saveConnection} from './link_set.service';
const mixinName = 'dec.dcm.minxin.linkset';
const Mixin = {
setConnectionNameErr(err: string) {
this.model.connectionNameErr = err;
},
setEdit(type: boolean) {
this.model.linkSelected = {
...this.model.linkSelected,
isSelected: type,
};
this.model.linkUpdate = this.model.linkSelected;
},
setCancel() {
const linkSelected: LinkType = this.model.linkSelected;
const linkList: LinkType[] = this.model.linkList;
if (linkSelected.connectionId) {
this.setEdit(false);
} else {
this.model.linkList = [
...linkList.filter(item => !!item.connectionId),
];
if (this.model.linkList.length > 0) {
this.model.linkList[0].isSelected = true;
this.model.linkSelected = {
...this.model.linkList[0],
isSelected: false,
};
} else {
this.model.linkSelected = {};
}
this.model.linkUpdate = this.model.linkSelected;
}
},
saveLink() {
const pluginData = this.model.linkUpdate.text ? BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${this.model.linkUpdate.text.toLowerCase()}.value`) : {};
const update = {
...this.model.linkUpdate,
...pluginData,
};
saveConnection(update).then(() => {
this.setEdit(false);
});
},
};
Fix.mixin(mixinName, Mixin);
export default mixinName;

154
src/app/connection/link_set.model.ts

@ -1,154 +0,0 @@
import {LinkType} from '@ui/type';
import {deleteConnection, testConnection} from '@shared/crud/crud.request';
import {getCnnectionName} from './select/select.service';
import {DATA_BASE_TYPE} from '@private/constants';
import dialog from '@shared/service/dialog.service';
import Mixin from './link_set.mixin';
const className = 'dec.dcm.model.linkset';
const Model = {
context: ['tab', 'linkList', 'linkSelected', 'linkUpdate', 'connectionNameErr'],
mixins: [Mixin],
actions: {
/**
*
* @param name
*/
setLinkSelected(name: string) {
this._noSaveConfirm(() => {
this._setLinkSelected(name);
});
},
onIconClick(title: string, id: string) {
switch (title) {
case BI.i18nText('Dec-Dcm_Delete'):
deleteConnection(id, () => {
this.model.linkList = [...this.model.linkList.filter((item: LinkType) => item.connectionId !== id)];
this.model.linkSelected = {};
this.model.linkUpdate = {};
});
break;
case BI.i18nText('Dec-Dcm_Test_Connection'):
this._textLink(id);
break;
case BI.i18nText('Dec-Dcm_Copy'):
this._noSaveConfirm(() => {
this.copyLink(id);
});
break;
default:
break;
}
},
copyLink(id: string) {
const connectionName = BI.find(this.model.linkList, (index: number, item: LinkType) => item.connectionId === id).connectionName;
const name = getCnnectionName(this.model.linkList, connectionName);
let data = {};
this.model.linkList.forEach((item: LinkType) => {
if (item.connectionId === id) {
data = item;
}
});
const newCopy = {
...data,
isSelected: true,
connectionName: name,
connectionId: '',
};
this.model.linkList = [
newCopy,
...this.model.linkList,
];
this.model.linkSelected = {
...newCopy,
};
this.model.linkUpdate = {
...newCopy,
};
},
setLinkUpdate(value: any) {
this.model.linkUpdate = value;
},
setNewLink(value: string) {
if (!DATA_BASE_TYPE.some(item => item.text === value) && !BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${value.toLowerCase()}.edit`)) {
dialog.error(BI.i18nText('Dec-Dcm_Connection_Option_Cannot_Find'));
return;
}
this._noSaveConfirm(() => {
this._setNewLink(value);
});
},
},
_setLinkSelected(name: string) {
this.model.linkList.forEach((item: LinkType) => {
item.isSelected = item.connectionName === name;
if (item.connectionName === name) {
this.model.linkSelected = {
...item,
isSelected: false,
};
}
});
this.model.linkList = [...this.model.linkList];
this.model.linkUpdate = this.model.linkSelected;
},
_textLink(id: string) {
const link = this.model.linkList.find((item: LinkType) => item.connectionId === id);
const loadingId = dialog.loading(BI.i18nText('Dec-Dcm_Connection_Testing'));
testConnection(link, (res: any) => {
dialog.remove(loadingId);
if (res && res.errorCode) {
dialog.linkFail(`${link.connectionName}${BI.i18nText('Dec-Dcm_Connection_Test_Fail')}`, res.errorMsg, () => {
this._textLink(id);
});
} else {
dialog.success(BI.i18nText('Dec-Dcm_Connection_Test_Success'));
}
});
},
_setNewLink(value: string) {
const name = getCnnectionName(this.model.linkList, value);
let data = {};
DATA_BASE_TYPE.forEach(item => {
if (item.text === value) {
data = item;
}
});
this.model.linkList = [
{
connectionName: name,
isSelected: true,
...data,
text: value,
},
...this.model.linkList,
];
this.model.linkSelected = {
...data,
connectionName: name,
isSelected: true,
text: value,
};
this.model.linkUpdate = {
...data,
connectionName: name,
text: value,
};
},
_noSaveConfirm(cb: Function) {
if (this.model.linkSelected && this.model.linkSelected.isSelected) {
dialog.confirm(BI.i18nText('Dec-Dcm_Connection_Config_No_Save'), (isConfirm: boolean) => {
if (isConfirm) {
this.saveLink();
} else {
this.setCancel();
}
cb();
});
} else {
cb();
}
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

26
src/app/connection/link_set.service.ts

@ -1,26 +0,0 @@
import {LinkType} from '@ui/type';
import {addConnection, updateConnection} from '@shared/crud/crud.request';
export function saveConnection(linkUpdate: LinkType): Promise<string> {
if (linkUpdate.connectionId) {
return new Promise(((resolve, reject) => {
try {
addConnection(linkUpdate, (res: string) => {
resolve(res);
});
} catch (error) {
reject(error);
}
}));
}
return new Promise(((resolve, reject) => {
try {
updateConnection(linkUpdate, (res: string) => {
resolve(res);
});
} catch (error) {
reject(error);
}
}));
}

58
src/app/connection/link_set.ts

@ -1,58 +0,0 @@
import {Htape, WidgetType, Vtape, VerticalAdapt} from '@ui';
import LeftList from './left/left';
import linkSetModel from './link_set.model';
import Select from './select/select';
import Right from './right/right';
import {TAB_LINK_SET} from '@private/constants';
const className = 'dec.dcm.linkset';
const Widget: WidgetType = {
props: {
baseCls: 'bi-card',
},
_store() {
return BI.Models.getModel(linkSetModel);
},
watch: {
tab(tab: string) {
this.setVisible(tab === TAB_LINK_SET);
},
},
render() {
return {
type: Htape,
items: [{
el: {
type: Vtape,
cls: 'dcm-link-left bi-border-right',
items: [
{
el: {
type: VerticalAdapt,
cls: 'bi-border-bottom',
items: [
{
type: Select,
hgap: 10,
vgap: 10,
},
],
},
height: 40,
}, {
type: LeftList,
cls: 'left-list',
vgap: 10,
hgap: 10,
},
],
},
width: 280,
}, {
type: Right,
}],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

6
src/app/connection/more/item/more_link_item.less

@ -1,6 +0,0 @@
@import '../../../../less/index.less';
.dec-webui-dcm-connection-more-link-item{
&:hover{
border-color :@border-color-highlight;
}
}

68
src/app/connection/more/item/more_link_item.ts

@ -1,68 +0,0 @@
import './more_link_item.less';
import {WidgetType, Img, Label, Layout, Absolute, Vtape} from '@ui/index';
import ModelName from './more_link_litem.model';
const className = 'dec.dcm.component.linkSet.morelink.item';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-connection-more-link-item bi-border',
height: 120,
width: 120,
},
_store() {
return BI.Models.getModel(ModelName);
},
watch: {
otherSelected(otherSelected: string) {
const {text} = this.options;
this.selected.setVisible(text === otherSelected);
},
},
render() {
const {text, name} = this.options;
return {
type: Vtape,
items: [
{
type: Absolute,
items: [
{
el: {
type: Img,
src: this._buildResourceUrl(name),
},
},
{
el: {
type: Layout,
cls: 'dcm-link-more-selected',
invisible: true,
width: 30,
height: 30,
ref: _ref => {
this.selected = _ref;
},
},
right: 0,
},
],
},
{
el: {
type: Label,
cls: 'bi-header-background',
text,
},
height: 30,
},
],
};
},
_buildResourceUrl(name: string) {
// TODO: 目前不知道生产环境下的图片的绝对地址,先这样写用于测试。
return `img/${name}.jpg`;
},
};
BI.shortcut(className, BI.inherit(BI.BasicButton, Widget));
export default className;

6
src/app/connection/more/item/more_link_litem.model.ts

@ -1,6 +0,0 @@
const className = 'dec.dcm.model.link_set.more_link_item';
export const Model = BI.inherit(Fix.Model, {
context: ['otherSelected'],
});
BI.model(className, Model);
export default className;

16
src/app/connection/more/more_link.model.ts

@ -1,16 +0,0 @@
const className = 'dec.dcm.model.link_set.more_link';
export const Model = BI.inherit(Fix.Model, {
childContext: ['otherSelected'],
state() {
return {
otherSelected: '',
};
},
actions: {
setOtherSelected(name: string) {
this.model.otherSelected = name;
},
},
});
BI.model(className, Model);
export default className;

50
src/app/connection/more/more_link.service.ts

@ -1,50 +0,0 @@
import MoreLink from './more_link';
let subbitButton = null;
let selectKey = '';
export const moreLink = (onConfirm?: Function): void => {
const id = BI.UUID();
BI.Popovers.create(id, {
type: 'bi.bar_popover',
size: 'normal',
header: BI.i18nText('Dec-Dcm_Connection_More_Title'),
width: 560,
height: 500,
body: {
type: MoreLink,
listeners: [
{
eventName: 'EVENT_SELECT',
action (text: string) {
selectKey = text;
subbitButton.setEnable(true);
},
},
],
},
footer: {
type: 'bi.right_vertical_adapt',
lgap: 10,
items: [{
type: 'bi.button',
text: BI.i18nText('BI-Basic_Cancel'),
value: 1,
level: 'ignore',
handler () {
BI.Popovers.close(id);
},
}, {
type: 'bi.button',
text: BI.i18nText('BI-Basic_Sure'),
disabled: true,
value: 0,
ref: _ref => {
subbitButton = _ref;
},
handler () {
BI.Popovers.close(id);
onConfirm ? onConfirm(selectKey) : null;
},
}],
},
}).open(id);
};

52
src/app/connection/more/more_link.ts

@ -1,52 +0,0 @@
import {WidgetType, SearchEditor, Left, Vtape, VerticalAdapt} from '@ui/index';
import {DATA_BASE_TYPE_OTHER} from '@private/constants';
import MoreLinkItem from './item/more_link_item';
import ModelName from './more_link.model';
const className = 'dec.dcm.component.linkSet.morelink';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(ModelName);
},
render() {
return {
type: Vtape,
items: [
{
el: {
type: VerticalAdapt,
items: [{
type: SearchEditor,
width: 300,
watermark: BI.i18nText('Dec-Dcm_Search'),
}],
},
height: 30,
},
{
type: Left,
scrolly: true,
tgap: 2,
rgap: 2,
bgap: 2,
lgap: 2,
items: this._createItems(),
},
],
};
},
_createItems() {
return BI.map(DATA_BASE_TYPE_OTHER, (index: number, item) => {
return {
type: MoreLinkItem,
text: item.text,
name: item.databaseType,
handler: () => {
this.store.setOtherSelected(item.text);
this.fireEvent('EVENT_SELECT', item.text);
},
};
});
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

30
src/app/connection/right/nothing.ts

@ -1,30 +0,0 @@
import {WidgetType, Layout, Label, HorizotalAdapt, Vtape} from '@ui/index';
const className = 'dec.dcm.component.right.nothing';
const Widget: WidgetType = {
render() {
return {
type: HorizotalAdapt,
top: 200,
items: [{
type: Vtape,
width: 260,
height: 150,
items: [
{
el: {
type: Layout,
cls: 'data-connection-background',
},
height: 130,
},
{
type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Plase_Add_One'),
},
],
}],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

33
src/app/connection/right/right.ts

@ -1,33 +0,0 @@
import {WidgetType, ListView} from '@ui';
import {LinkType} from '@ui/type';
import Nothing from './nothing';
import RightDetail from './right_detail/right_detail';
import Model from '../link_set.model';
const className = 'dec.dcm.component.right';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkSelected(linkSelected: LinkType) {
this.rightContent.populate(BI.createItems([
{
type: (linkSelected && linkSelected.connectionName) ? RightDetail : Nothing,
},
]));
},
},
render() {
return {
type: ListView,
ref: _ref => {
this.rightContent = _ref;
},
items: [{
type: Nothing,
}],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

25
src/app/connection/right/right.typing.d.ts vendored

@ -1,25 +0,0 @@
export interface AttributeType {
text: string;
name: string;
}
export interface FormType {
connectionName?: string;
factory?: string;
url?: string;
principal?: string;
credentials?: string;
originalCharsetName?: string;
objectFactories?: string;
stateFactories?: string;
urlPkgPrefixes?: string;
dnsUrl?: string;
authoritative?: string;
batchSize?: string;
referral?: string;
securityProtocol?: string;
securityAuthentication?: string;
language?: string;
applet?: string;
}

6
src/app/connection/right/right_detail/right_detail.model.ts

@ -1,6 +0,0 @@
const className = 'dec.dcm.model.link.set.right.detail';
export const Model = BI.inherit(Fix.Model, {
context: ['linkSelected'],
});
BI.model(className, Model);
export default className;

74
src/app/connection/right/right_detail/right_detail.ts

@ -1,74 +0,0 @@
import {WidgetType, ListView} from '@ui/index';
import Model from './right_detail.model';
import {LinkType} from '@ui/type';
import Title from '../right_title/right_title';
import RightShow from '../right_show/right_show';
import RightShowJndi from '../right_show/right_show_jndi';
import RightEdit from '../right_edit/right_edit';
import RightEditMysql from '../right_edit/right_edit_mysql';
import RightEditJndi from '../right_edit/right_edit_jndi';
import pluginListConstant from '../../../app.constant';
import {MYSQL_CONNECT, JNDI_CONNECT} from '@private/constants';
const className = 'dec.dcm.component.right.detail';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkSelected(linkSelected: LinkType) {
const showPage = this._createItems(linkSelected);
this.rightDetail.populate(BI.createItems(showPage));
},
},
render() {
const linkSelected = this.model.linkSelected;
return {
type: ListView,
ref: _ref => {
this.rightDetail = _ref;
},
items: this._createItems(linkSelected),
};
},
_createItems(linkSelected: LinkType) {
const plugins: string[] = BI.Constants.getConstant(pluginListConstant);
const isPlugin = BI.some(plugins, (index: number, item: string) => item === linkSelected.text);
let editPage = null;
let showPage = null;
switch (linkSelected.text) {
case (MYSQL_CONNECT):
editPage = RightEditMysql;
showPage = RightShow;
break;
case (JNDI_CONNECT):
editPage = RightEditJndi;
showPage = RightShowJndi;
break;
default:
editPage = RightEdit;
showPage = RightShow;
}
if (isPlugin) {
editPage = BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${linkSelected.text.toLowerCase()}.edit`);
showPage = BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${linkSelected.text.toLowerCase()}.preview`);
}
return [
{
type: Title,
isEdit: linkSelected.isSelected,
linkSelected,
}, {
type: linkSelected.isSelected ? editPage : showPage,
vgap: 10,
hgap: 10,
linkSelected,
},
];
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

20
src/app/connection/right/right_edit/right_edit.model.ts

@ -1,20 +0,0 @@
export const className = 'dec.dcm.model.components.right.edit';
export const Model = BI.inherit(Fix.Model, {
state() {
return {
isCollapse: false,
};
},
computed: {
},
actions: {
setIsCollapse(status: boolean) {
this.model.isCollapse = status;
},
},
});
BI.model(className, Model);
export default className;

24
src/app/connection/right/right_edit/right_edit.service.ts

@ -1,24 +0,0 @@
import {LinkType} from '@ui/type';
export function getDrivers(linkSelected: LinkType): {text: string; value: string}[] {
const drivers: {text: string; value: string}[] = [];
if (linkSelected.drivers && linkSelected.drivers.length > 0) {
linkSelected.drivers.forEach(item => {
drivers.push({
text: item,
value: item,
});
});
} else {
drivers.push({
text: linkSelected.driver,
value: linkSelected.driver,
});
}
return drivers;
}
export function connectNameChecker(name: string): boolean {
return /^\+?[1-9][0-9]*$/.test(name);
}

373
src/app/connection/right/right_edit/right_edit.ts

@ -1,373 +0,0 @@
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor, VerticalAdapt, Label} from '@ui/index';
import {LinkType} from '@ui/type';
import {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model';
import Title from '@shared/components/title';
import {getDrivers, connectNameChecker} from './right_edit.service';
let connectionName: any = null;
const className = 'dec.dcm.component.right.edit';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
connectionNameErr(msg: string) {
if (msg) {
BI.Bubbles.show('singleBubble', msg, connectionName, {
level: 'error',
});
} else {
BI.Bubbles.hide('singleBubble');
}
},
},
render() {
const linkSelected: LinkType = this.model.linkSelected;
const that = this;
return {
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
},
{
type: TextEditor,
width: 300,
value: linkSelected.connectionName,
ref(ref: any) {
connectionName = ref;
},
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
connectionName: this.getValue(),
});
},
}, {
eventName: BI.Editor.EVENT_FOCUS,
action() {
that.store.setConnectionNameErr('');
},
}],
},
{
type: Label,
cls: 'bi-water-mark',
lgap: 5,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_First_Step'),
},
{
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
},
{
type: TextValueCombo,
width: 300,
text: linkSelected.driver,
items: getDrivers(linkSelected),
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
driver: this.getValue()[0],
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.url,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
url: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: TextValueCombo,
width: 300,
text: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName,
items: [
{
text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
value: '',
},
...CONNECT_CHARSET,
],
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
originalCharsetName: this.getValue()[0],
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.user,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
user: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
},
{
type: TextEditor,
inputType: 'password',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.password,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
password: this.getValue(),
});
},
}],
},
],
},
{
type: Title,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'),
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
},
{
type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
height: 100,
value: linkSelected.validationQuery,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
validationQuery: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
},
{
type: MultiSelectItem,
text: BI.i18nText('Dec-Dcm_Yes'),
selected: linkSelected.testOnBorrow,
width: 60,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
testOnBorrow: this.isSelected(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 60,
value: linkSelected.maxActive,
errorText: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input-Number'),
validationChecker: connectNameChecker,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
maxActive: this.getValue(),
});
},
}],
},
],
},
],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Second_Step'),
},
{
type: Button,
width: 80,
text: BI.i18nText('Dec-Dcm_Test_Connection'),
level: 'ignore',
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Third_Step'),
},
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Pattern'),
},
{
type: TextEditor,
width: 300,
disabled: true,
},
],
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

226
src/app/connection/right/right_edit/right_edit_jndi.ts

@ -1,226 +0,0 @@
import {Vertical, TextValueCombo, TextButton, Label, TextEditor, VerticalAdapt} from '@ui';
import {JNDI_FACTORYS, OTHER_ATTRIBUTES, CONNECT_CHARSET} from '@private/constants';
import {AttributeType} from '../right.typing';
import ModelName from './right_edit.model';
const classNameEdit = 'dec.dcm.component.right.edit.jndi';
const Widget = BI.inherit(BI.Widget, {
_store() {
return BI.Models.getModel(ModelName);
},
watch: {
isCollapse(isCollapse) {
const text = isCollapse ? BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes') : BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes');
this.collapseRef.setText(text);
this.otherAttributesRef.setVisible(isCollapse);
},
},
render() {
const {connectionName, url, factory, principal, credentials, originalCharsetName} = this.options;
return {
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: connectionName,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Context'),
},
{
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'INTIAL_CONTEXT_FACTORY',
},
{
type: TextValueCombo,
width: 300,
value: factory,
items: BI.map(JNDI_FACTORYS, (index: number, item: string) => {
return {
text: item,
value: item,
};
}),
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'PROVIDER_URL',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: url,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'SECURITY_PRINCIPAL',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: principal,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'SECURITY_CREDENTIALS',
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: credentials,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: TextButton,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'),
width: 480,
textAlign: 'right',
ref: _ref => {
this.collapseRef = _ref;
},
handler: () => {
this.store.setIsCollapse(!this.model.isCollapse);
},
},
],
},
{
type: Vertical,
invisible: true,
ref: _ref => {
this.otherAttributesRef = _ref;
},
items: this._getOtherItems(),
},
],
},
],
},
{
type: Label,
cls: 'bi-error',
lgap: 10,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'),
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Advanced'),
},
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: TextValueCombo,
width: 300,
items: [{
text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
value: originalCharsetName,
},
...CONNECT_CHARSET,
],
},
],
},
],
};
},
_getOtherItems() {
return BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return {
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: item.text,
},
{
type: TextEditor,
width: 300,
allowBlank: true,
value: this.options[item.name],
},
],
};
});
},
});
BI.shortcut(classNameEdit, Widget);
export default classNameEdit;

325
src/app/connection/right/right_edit/right_edit_mysql.ts

@ -1,325 +0,0 @@
import {WidgetType, Vertical, MultiSelectItem, TextAreaEditor, Button, TextValueCombo, TextEditor, VerticalAdapt, Label} from '@ui/index';
import {LinkType} from '@ui/type';
import {CONNECT_CHARSET} from '@private/constants';
import Model from '../../link_set.model';
import Title from '@shared/components/title';
import {getDrivers, connectNameChecker} from './right_edit.service';
let connectionName: any = null;
const className = 'dec.dcm.component.right.edit.mysql';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
connectionNameErr(msg: string) {
if (msg) {
BI.Bubbles.show('singleBubble', msg, connectionName, {
level: 'error',
});
} else {
BI.Bubbles.hide('singleBubble');
}
},
},
render() {
const linkSelected: LinkType = this.model.linkSelected;
const that = this;
return {
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
},
{
type: TextEditor,
width: 300,
value: linkSelected.connectionName,
ref(ref: any) {
connectionName = ref;
},
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
connectionName: this.getValue(),
});
},
}, {
eventName: BI.Editor.EVENT_FOCUS,
action() {
that.store.setConnectionNameErr('');
},
}],
},
{
type: Label,
cls: 'bi-water-mark',
lgap: 5,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName-Change-Confirm'),
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
},
{
type: TextValueCombo,
width: 300,
text: linkSelected.driver,
items: getDrivers(linkSelected),
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
driver: this.getValue()[0],
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.url,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
url: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: TextValueCombo,
width: 300,
text: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName,
items: [
{
text: BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
value: '',
},
...CONNECT_CHARSET,
],
listeners: [{
eventName: BI.TextValueCombo.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
originalCharsetName: this.getValue()[0],
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.user,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
user: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
},
{
type: TextEditor,
inputType: 'password',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
value: linkSelected.password,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
password: this.getValue(),
});
},
}],
},
],
},
{
type: Title,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'),
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
},
{
type: TextAreaEditor,
cls: 'bi-border',
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 300,
height: 100,
value: linkSelected.validationQuery,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
validationQuery: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
},
{
type: MultiSelectItem,
text: BI.i18nText('Dec-Dcm_Yes'),
selected: linkSelected.testOnBorrow,
width: 60,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
testOnBorrow: this.isSelected(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
},
{
type: TextEditor,
allowBlank: true,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input'),
width: 60,
value: linkSelected.maxActive,
errorText: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input-Number'),
validationChecker: connectNameChecker,
listeners: [{
eventName: BI.Editor.EVENT_CHANGE,
action() {
that.store.setLinkUpdate({
...that.model.linkUpdate,
maxActive: this.getValue(),
});
},
}],
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Button,
width: 80,
text: BI.i18nText('Dec-Dcm_Test_Connection'),
level: 'ignore',
},
],
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

20
src/app/connection/right/right_show/right_show.model.ts

@ -1,20 +0,0 @@
export const className = 'dec.dcm.model.components.right.show';
export const Model = BI.inherit(Fix.Model, {
state() {
return {
isCollapse: false,
};
},
computed: {
},
actions: {
setIsCollapse(status: boolean) {
this.model.isCollapse = status;
},
},
});
BI.model(className, Model);
export default className;

72
src/app/connection/right/right_show/right_show.ts

@ -1,72 +0,0 @@
import {WidgetType, Vertical} from '@ui/index';
import RightShowModel from '../../link_set.model';
import BothSide from '@shared/components/both_side';
import Title from '@shared/components/title';
import {LinkType} from '@ui/type';
const className = 'dec.dcm.component.right.show';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(RightShowModel);
},
render() {
const linkSelected: LinkType = this.model.linkSelected;
return {
type: Vertical,
vgap: 10,
items: [
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_ConnectionName'),
rightText: linkSelected.connectionName,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_Driver'),
rightText: linkSelected.driver,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_URL'),
rightText: linkSelected.url,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
rightText: linkSelected.originalCharsetName === '' ? BI.i18nText('Dec-Dcm_Connection_Form_Auto') : linkSelected.originalCharsetName,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_UserName'),
rightText: linkSelected.user,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
rightText: linkSelected.password,
},
{
type: Title,
text: BI.i18nText('Dec-Dcm_Connection_Form_Pool_Properties'),
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_SQL_Validation_Query'),
rightText: linkSelected.validationQuery,
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_Connection-Check'),
rightText: linkSelected.testOnBorrow ? BI.i18nText('Dec-Dcm_Yes') : BI.i18nText('Dec-Dcm_No'),
},
{
type: BothSide,
leftText: BI.i18nText('Dec-Dcm_Connection_Form_Connection_Max_Number'),
rightText: linkSelected.maxActive,
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

203
src/app/connection/right/right_show/right_show_jndi.ts

@ -1,203 +0,0 @@
import {Vertical, TextButton, Label, VerticalAdapt} from '@ui';
import {OTHER_ATTRIBUTES} from '@private/constants';
import {AttributeType} from '../right.typing';
import ModelName from './right_show.model';
const className = 'dec.dcm.component.right.show.jndi';
const Widget = BI.inherit(BI.Widget, {
_store() {
return BI.Models.getModel(ModelName);
},
watch: {
isCollapse(isCollapse) {
const text = isCollapse ? BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Collapse-Attributes') : BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes');
this.collapseRef.setText(text);
this.otherAttributesRef.setVisible(isCollapse);
},
},
render() {
const {connectionName, url, factory, principal, credentials, originalCharsetName} = this.options;
return {
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
},
{
type: Label,
text: connectionName,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Context'),
},
{
type: Vertical,
vgap: 10,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'INTIAL_CONTEXT_FACTORY',
},
{
type: Label,
text: factory,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'PROVIDER_URL',
},
{
type: Label,
text: url,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'SECURITY_PRINCIPAL',
},
{
type: Label,
value: principal,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: 'SECURITY_CREDENTIALS',
},
{
type: Label,
value: credentials,
},
],
},
{
type: VerticalAdapt,
items: [
{
type: TextButton,
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Other_Attributes'),
width: 480,
textAlign: 'right',
ref: _ref => {
this.collapseRef = _ref;
},
handler: () => {
this.store.setIsCollapse(!this.model.isCollapse);
},
},
],
},
{
type: Vertical,
invisible: true,
ref: _ref => {
this.otherAttributesRef = _ref;
},
items: this._getOtherItems(),
},
],
},
],
},
{
type: Label,
cls: 'bi-error',
lgap: 10,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Notice'),
},
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 115,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_JNDI_Advanced'),
},
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
},
{
type: Label,
text: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
},
],
},
],
};
},
_getOtherItems() {
return BI.map(OTHER_ATTRIBUTES, (index: number, item: AttributeType) => {
return {
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-font-bold',
width: 180,
textAlign: 'left',
text: item.text,
},
{
type: Label,
value: this.options[item.name],
},
],
};
});
},
});
BI.shortcut(className, Widget);
export default className;

20
src/app/connection/right/right_title/right_title.model.ts

@ -1,20 +0,0 @@
import LinksetMixin from '../../link_set.mixin';
import {LinkType} from '@ui/type';
const modelName = 'dec.dcm.model.component.right.title';
export const Model = BI.inherit(Fix.Model, {
context: ['linkSelected', 'linkList', 'linkUpdate'],
mixins: [LinksetMixin],
actions: {
onSave() {
const linkList: LinkType[] = this.model.linkList;
const result = BI.find(linkList, (idx: number, value: LinkType) => this.model.linkUpdate.connectionName === value.connectionName && value.connectionId !== this.model.linkUpdate.connectionId);
if (result) {
this.setConnectionNameErr(BI.i18nText('Dec-Dcm_Connection_Is_Existence'));
} else {
this.saveLink();
}
},
},
});
BI.model(modelName, Model);
export default modelName;

66
src/app/connection/right/right_title/right_title.ts

@ -1,66 +0,0 @@
import {WidgetType, Label, Button, LeftRightVerticalAdapt} from '@ui/index';
import RightTitleModel from './right_title.model';
import {LinkType} from '@ui/type';
import {OTHER_CONNECT} from '@private/constants';
const className = 'dec.dcm.component.right.title';
const Widget: WidgetType = {
props: {
baseCls: 'bi-border-bottom',
},
_store() {
return BI.Models.getModel(RightTitleModel);
},
render() {
const linkSelected: LinkType = this.model.linkSelected;
const that = this;
const {isEdit} = this.options;
const title = linkSelected.text === OTHER_CONNECT ? BI.i18nText('Dec-Dcm_Connection_Other') : linkSelected.text;
return {
type: LeftRightVerticalAdapt,
height: 40,
items: {
left: [
{
type: Label,
cls: 'bi-font-bold',
hgap: 10,
text: `${BI.i18nText('Dec-Dcm_Data_Connections')}(${title ? title : BI.i18nText('Dec-Dcm_Default')})`,
},
],
right: [
{
type: Button,
hgap: 10,
invisible: isEdit,
text: BI.i18nText('Dec-Dcm_Edit'),
handler() {
that.store.setEdit(true);
},
},
{
type: Button,
hgap: 10,
invisible: !isEdit,
level: 'ignore',
text: BI.i18nText('BI-Basic_Cancel'),
handler() {
that.store.setCancel();
},
},
{
type: Button,
hgap: 10,
invisible: !isEdit,
text: BI.i18nText('Dec-Dcm_Save'),
handler() {
that.store.onSave();
},
},
],
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

23
src/app/connection/select/select.service.ts

@ -1,23 +0,0 @@
import {LinkType} from '@ui/type';
import pluginListConstant from '../../app.constant';
export const getCnnectionName = (links: LinkType[], name: string): string => {
const plugins: string[] = BI.Constants.getConstant(pluginListConstant);
let nameIndex = 0;
const title = name.replace(/[0-9]/g, '');
const isPlugin = BI.some(plugins, (index: number, item: string) => item === title);
const startWith = isPlugin ? title : BI.i18nText('Dec-Dcm_Data_Connections');
links.forEach(link => {
link.isSelected = false;
if (link.connectionName.startsWith(startWith)) {
const name = link.connectionName.replace(startWith, '0');
const index = parseInt(name, 10) + 1;
if (index > nameIndex) {
nameIndex = index;
}
}
});
return `${startWith}${nameIndex > 0 ? nameIndex : ''}`;
};

77
src/app/connection/select/select.ts

@ -1,77 +0,0 @@
import {WidgetType, Combo, ButtonGroup, TextItem, Vertical} from '@ui';
import selectModel from '../link_set.model';
import {moreLink} from '../more/more_link.service';
import connectList from '../../app.constant';
import {DATA_LINKS} from '@private/constants';
const className = 'dec.dcm.linkset.select';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(selectModel);
},
render() {
return {
type: Combo,
trigger: 'click',
adjustYOffset: 4,
el: {
type: 'bi.button',
text: BI.i18nText('Dec-Dcm_Connection_New'),
},
popup: {
el: {
type: ButtonGroup,
items: [...BI.map([...DATA_LINKS, ...BI.Constants.getConstant(connectList)], (index: number, item: string) => {
return {
type: TextItem,
height: 24,
width: 152,
textLgap: 10,
text: item,
title: item,
value: item,
};
}), {
type: TextItem,
height: 24,
width: 152,
textLgap: 10,
text: BI.i18nText('Dec-Dcm_Connection_More'),
title: BI.i18nText('Dec-Dcm_Connection_More'),
value: 'more',
}, {
type: TextItem,
cls: 'bi-border-top',
height: 24,
width: 152,
textLgap: 10,
text: BI.i18nText('Dec-Dcm_Connection_Other'),
title: BI.i18nText('Dec-Dcm_Connection_Other'),
value: 'other',
}],
layouts: [{
type: Vertical,
}],
},
maxHeight: 400,
},
listeners: [{
eventName: 'EVENT_CHANGE',
action: (v: string) => {
if (v === 'more') {
moreLink((text: string) => {
this.store.setNewLink(text);
});
} else {
this.store.setNewLink(v);
}
this.combo.hideView();
},
}],
ref: _ref => {
this.combo = _ref;
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

17
src/app/status/left/left.model.ts

@ -1,17 +0,0 @@
import {ModelType} from '@ui';
const className = 'dec.dcm.model.linkstatus.left';
const Model: ModelType = {
context: ['tab', 'linkList', 'statusSelected'],
state () {
return {
selected: '',
};
},
actions: {
setStatusSelected(title: string) {
this.model.statusSelected = title;
},
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

44
src/app/status/left/left.ts

@ -1,44 +0,0 @@
import {WidgetType, ListView} from '@ui';
import Model from './left.model';
import {LinkType} from '@ui/type';
import LeftItem from './left_item';
const className = 'dec.dcm.component.linkStatus.left';
const Widget: WidgetType = {
_store() {
return BI.Models.getModel(Model);
},
watch: {
linkList(linkList: LinkType[]) {
const title = linkList.length > 0 ? linkList[0].connectionName : '';
this.store.setStatusSelected(title);
},
statusSelected(title: string) {
const linkList = this.model.linkList;
this.leftContent.populate(BI.createItems(this._renderItems(linkList, title)));
},
},
render() {
return {
type: ListView,
ref: _ref => {
this.leftContent = _ref;
},
items: this._renderItems(this.model.linkList, this.model.statusSelected),
};
},
_renderItems(linkList: LinkType[], selectTitle = '') {
return BI.map(linkList, (index: number, item: LinkType) => {
return {
type: LeftItem,
selected: item.connectionName === selectTitle,
title: item.connectionName,
id: item.connectionId,
creator: item.creator,
text: item.text ? item.text : BI.i18nText('Dec-Dcm_Default'),
};
});
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

39
src/app/status/left/left_item.ts

@ -1,39 +0,0 @@
import {WidgetType, TextButton, VerticalAdapt} from '@ui';
import Model from './left.model';
const className = 'dec.dcm.component.linkStatus.left.item';
const Widget: WidgetType = {
props: {
title: '',
id: '',
creator: '',
baseCls: 'bi-list-item-active',
},
_store() {
return BI.Models.getModel(Model);
},
render() {
const {title} = this.options;
return {
type: VerticalAdapt,
cls: 'bi-list-item-active',
height: 30,
items: [
{
type: TextButton,
cls: 'link-title',
lgap: 10,
textAlign: 'left',
text: title,
title,
},
],
};
},
doClick() {
const {title} = this.options;
this.store.setStatusSelected(title);
},
};
BI.shortcut(className, BI.inherit(BI.BasicButton, Widget));
export default className;

9
src/app/status/link_status.model.ts

@ -1,9 +0,0 @@
import {ModelType} from '@ui';
const className = 'dec.dcm.model.linkstatus';
const Model: ModelType = {
context: ['tab', 'linkList'],
actions: {
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

63
src/app/status/link_status.ts

@ -1,63 +0,0 @@
import {WidgetType, Htape, Vtape, Label, VerticalAdapt} from '@ui';
import linkStatusModel from './link_status.model';
import LeftList from './left/left';
import Right from './right/right';
import {TAB_LINK_POOL} from '@private/constants';
const className = 'dec.dcm.linkstatus';
const Widget: WidgetType = {
props: {
baseCls: 'bi-card',
},
_store() {
return BI.Models.getModel(linkStatusModel);
},
watch: {
tab(tab: string) {
this.linkStatus.setVisible(tab === TAB_LINK_POOL);
},
},
render() {
return {
type: Htape,
invisible: true,
ref: _ref => {
this.linkStatus = _ref;
},
items: [{
el: {
type: Vtape,
cls: 'dcm-link-left',
items: [
{
el: {
type: VerticalAdapt,
cls: 'bi-border-bottom',
items: [
{
type: Label,
cls: 'bi-font-bold',
hgap: 6,
vgap: 6,
text: BI.i18nText('Dec-Dcm_Data_Connections'),
},
],
},
height: 40,
}, {
type: LeftList,
cls: 'left-list',
},
],
},
width: 280,
}, {
type: Right,
cls: 'bi-border-left',
}],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

14
src/app/status/right/right.model.ts

@ -1,14 +0,0 @@
import {ModelType} from '@ui';
const className = 'dec.dcm.model.linkstatus.right';
const Model: ModelType = {
context: ['linkList', 'statusSelected'],
state () {
return {
selected: '',
};
},
actions: {
},
};
BI.model(className, BI.inherit(Fix.Model, Model));
export default className;

68
src/app/status/right/right.ts

@ -1,68 +0,0 @@
import {WidgetType, Label, ListView, VerticalAdapt, Vtape} from '@ui/index';
import Model from './right.model';
import {info} from '@shared/crud/crud.request';
import RightCard from './right_card';
import {InfoType} from './right.typings';
import {LinkType} from '@ui/type';
import pluginListConstant from '../../app.constant';
const className = 'dcm-link-form';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom',
},
_store() {
return BI.Models.getModel(Model);
},
watch: {
statusSelected(title: string) {
const link = BI.find(this.model.linkList, (index: number, item: LinkType) => item.connectionName === title);
const plugins: string[] = BI.Constants.getConstant(pluginListConstant);
const isPlugin = link.text && BI.some(plugins, (index: number, item: string) => item === link.text);
const Pool = isPlugin ? BI.Constants.getConstant(`dec.constant.database.conf.connect.form.${link.text.toLowerCase()}.pool`) : RightCard;
info(name, (res: InfoType) => {
this.statusGroup.populate(BI.createItems([{
type: Pool,
...res,
}]));
});
this.statusTitle.setText(`${BI.i18nText('Dec-Dcm_Data_Connections')}(${title})`);
},
},
render() {
return {
type: Vtape,
items: [
{
el: {
type: VerticalAdapt,
cls: 'bi-border-bottom',
items: [
{
type: Label,
cls: 'bi-font-bold',
lgap: 10,
text: BI.i18nText('Dec-Dcm_Data_Connections'),
},
],
ref: _ref => {
this.statusTitle = _ref;
},
},
height: 40,
}, {
type: ListView,
cls: 'right-status-body',
vgap: 10,
hgap: 10,
ref: _ref => {
this.statusGroup = _ref;
},
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

6
src/app/status/right/right.typings.d.ts vendored

@ -1,6 +0,0 @@
export interface InfoType{
maxActive: number;
maxIdle: number;
numActive: number;
numIdle: number;
}

91
src/app/status/right/right_card.ts

@ -1,91 +0,0 @@
import './right_card.less';
import {WidgetType, Left, Label, Vertical, FloatCenter, CenterAdapt, VerticalAdapt} from '@ui/index';
const className = 'dec.dcm.component.linkStatus.right.card';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-status-right-card',
},
render() {
const {maxActive, maxIdle, numActive, numIdle} = this.options;
return {
type: FloatCenter,
height: 150,
hgap: 20,
items: [
{
type: Vertical,
cls: 'bi-background',
items: [
{
type: CenterAdapt,
cls: 'right-status-board-item',
tgap: 40,
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-high-light card-font-success',
text: numActive,
},
{
type: Label,
text: '/',
},
{
type: Label,
text: maxActive,
},
],
},
],
},
{
type: Label,
text: BI.i18nText('Dec-Dcm_Active_Connections_Number'),
},
],
},
{
type: Vertical,
cls: 'bi-background',
items: [
{
type: CenterAdapt,
tgap: 40,
cls: 'right-status-board-item',
items: [
{
type: VerticalAdapt,
items: [
{
type: Label,
cls: 'bi-high-light card-font-heighlight',
text: numIdle,
},
{
type: Label,
text: '/',
},
{
type: Label,
text: maxIdle,
},
],
},
],
},
{
type: Label,
text: BI.i18nText('Dec-Dcm_Leisure_Connections_Number'),
},
],
},
],
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

8
src/app/title/title.less

@ -1,8 +0,0 @@
@import '../../less/index.less';
.dec-webui-dcm-title{
.title-item-selected{
color: @background-color-highlight;
border-bottom-color:@border-color-highlight;
border-bottom-width: 2px;
}
}

11
src/app/title/title.model.ts

@ -1,11 +0,0 @@
const className = 'dec.dcm.model.title.item';
const Model = BI.inherit(Fix.Model, {
context: ['tab'],
actions: {
setTab(value: string) {
this.model.tab = value;
},
},
});
BI.model(className, Model);
export default className;

61
src/app/title/title.ts

@ -1,61 +0,0 @@
import './title.less';
import {WidgetType, IconButton, LeftRightVerticalAdapt, LinearSegment} from '@ui/index';
import Model from './title.model';
import {isDesigner, closeWindow} from '@shared/crud/crud.request';
import {TAB_LINK_SET, TAB_LINK_POOL} from '@private/constants';
const className = 'dec.dcm.title';
const Widget: WidgetType = {
props: {
baseCls: 'dec-webui-dcm-title bi-card bi-border-bottom',
},
_store() {
return BI.Models.getModel(Model);
},
render() {
const showCloseButton = isDesigner();
const that = this;
return {
type: LeftRightVerticalAdapt,
items: {
left: [
{
type: LinearSegment,
cls: 'bi-card',
height: 40,
width: 200,
items: [{
text: BI.i18nText('Dec-Dcm_Connection_Management'),
value: TAB_LINK_SET,
selected: true,
}, {
text: BI.i18nText('Dec-Dcm_Pool_Connection_Management'),
value: TAB_LINK_POOL,
}],
listeners: [{
eventName: 'EVENT_CHANGE',
action () {
that.store.setTab(this.getValue()[0]);
},
}],
},
],
right: [
showCloseButton ? {
type: IconButton,
cls: 'close-ha-font',
width: 30,
height: 30,
rgap: 10,
handler() {
closeWindow();
},
} : null,
],
},
};
},
};
BI.shortcut(className, BI.inherit(BI.Widget, Widget));
export default className;

91
src/demo/plugin.redis.edit.ts

@ -1,91 +0,0 @@
import './style.scss';
import {TextEditor, Vertical, Left, Label} from '@ui/index';
const RedisConstantName = 'dec.constant.database.conf.connect.form.redis.value';
const form = {
url: '192.168.1.22',
port: 6379,
password: '123456',
};
const classNameEdit = 'dec.dcm.plugin.redis.edit';
const Widget = BI.inherit(BI.Widget, {
render() {
return {
type: Vertical,
cls: 'bi-plugin-redis',
bgap: 10,
items: [
{
type: Left,
height: 30,
items: [
{
type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'),
value: form.url,
allowBlank: true,
width: 300,
height: 24,
}],
},
{
type: Left,
height: 30,
items: [
{
type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: TextEditor,
watermark: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
allowBlank: true,
width: 300,
height: 24,
value: form.port,
errorText: BI.i18nText('Dec-Dcm_Connection_Form_Place_Input-Number'),
validationChecker (v: string) {
return /^\+?[1-9][0-9]*$/.test(v);
},
}],
},
{
type: Left,
height: 30,
items: [
{
type: Label,
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: TextEditor,
inputType: 'password',
value: form.password,
allowBlank: true,
width: 300,
height: 24,
}],
},
],
};
},
});
BI.shortcut(classNameEdit, Widget);
export default classNameEdit;
export const ConstantName = 'dec.constant.database.conf.connect.list';
BI.config(ConstantName, (datas: string[]) => [...datas, 'Redis']);
BI.constant(RedisConstantName, form);
BI.constant('dec.constant.database.conf.connect.form.redis.edit', classNameEdit);

68
src/demo/plugin.redis.preview.ts

@ -1,68 +0,0 @@
const classNamePreview = 'dec.dcm.plugin.redis.preview';
const RedisConstantName = 'dec.constant.database.conf.connect.form.redis.value';
const form = BI.Constants.getConstant(RedisConstantName);
const Widget = BI.inherit(BI.Widget, {
render() {
return {
type: 'bi.vertical',
cls: 'bi-plugin-redis',
bgap: 10,
items: [
{
type: 'bi.left',
height: 30,
items: [
{
type: 'bi.label',
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Addr'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: 'bi.label',
text: form.url,
height: 24,
}],
},
{
type: 'bi.left',
height: 30,
items: [
{
type: 'bi.label',
text: BI.i18nText('Dec-Dcm_Connection_Form_Database_Port'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: 'bi.label',
text: form.port,
height: 24,
}],
},
{
type: 'bi.left',
height: 30,
items: [
{
type: 'bi.label',
text: BI.i18nText('Dec-Dcm_Connection_Form_Password'),
height: 24,
width: 115,
textAlign: 'left',
},
{
type: 'bi.label',
text: '********',
height: 24,
}],
},
],
};
},
});
BI.shortcut(classNamePreview, Widget);
BI.constant('dec.constant.database.conf.connect.form.redis.preview', classNamePreview);

53
src/demo/plugin.tedis.pool.ts

@ -1,53 +0,0 @@
const classNamePool = 'dec.dcm.plugin.redis.pool';
const WidgetPool = BI.inherit(BI.Widget, {
render() {
const {maxActive, maxIdle, numActive, numIdle} = this.options;
return {
type: 'bi.left',
items: [
{
type: 'bi.left',
cls: 'right-status-item',
items: [
{
type: 'bi.vertical',
cls: 'right-status-board',
items: [
{
type: 'bi.vertical',
cls: 'right-status-board-item',
items: [
{
type: 'bi.label',
cls: 'right-status-text',
text: numActive,
},
{
type: 'bi.label',
cls: 'right-status-text',
text: '/',
},
{
type: 'bi.label',
cls: 'right-status-text',
text: maxActive,
},
],
},
{
type: 'bi.label',
height: 20,
text: BI.i18nText('Dec-Dcm_Active_Connections_Number'),
},
],
},
],
},
],
};
},
});
BI.shortcut(classNamePool, WidgetPool);
BI.constant('dec.constant.database.conf.connect.form.redis.pool', classNamePool);

3
src/demo/style.scss

@ -1,3 +0,0 @@
.bi-plugin-redis{
padding: 20px;
}

3
src/i18n.ts

@ -0,0 +1,3 @@
import i18n from '../private/i18n';
BI.addI18n(i18n);

BIN
src/img/ads.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

BIN
src/img/amazon-redshift.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
src/img/apache-impala.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/apache-kylin.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

BIN
src/img/apache-phoenix.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/database-selected.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/img/derby.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/error.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

BIN
src/img/gbase-8a.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

BIN
src/img/gbase-8s.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

BIN
src/img/gbase-8t.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

BIN
src/img/h2.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/hadoop-hive.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

BIN
src/img/hbase.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
src/img/hp-vertica.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/hsql.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/hw-dws.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
src/img/hw-elk.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

BIN
src/img/hw-fusioninsight-hd.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

BIN
src/img/hw-libr-a.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
src/img/ibm-db2.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
src/img/icon_close9x9_normal.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

BIN
src/img/informix.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
src/img/kingbase.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

BIN
src/img/loading.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

BIN
src/img/mysql.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save