Compare commits
303 Commits
persist/11
...
bugfix/10.
Author | SHA1 | Date |
---|---|---|
superman | 3b07b9ee21 | 8 months ago |
superman | 7b975aafcd | 8 months ago |
superman | 237c95efbf | 8 months ago |
superman | 11007e3f36 | 8 months ago |
superman | 7b84239f09 | 8 months ago |
superman | 71979b03a8 | 8 months ago |
superman | 1f2449fc65 | 8 months ago |
superman | af37d9ea6f | 8 months ago |
superman | e2c1b6d8ab | 9 months ago |
superman | 1d4af24341 | 9 months ago |
superman | a08d475729 | 9 months ago |
superman | 0137e66841 | 10 months ago |
superman | fd4699df2b | 11 months ago |
superman | f0fb49215d | 11 months ago |
superman | d04855fb19 | 11 months ago |
superman | b75f302dff | 11 months ago |
superman | 03d7174f20 | 11 months ago |
superman | 631b9d67c8 | 11 months ago |
superman | 6257cdd927 | 11 months ago |
superman | 4d92a75a50 | 11 months ago |
superman | 40cf0a9fc5 | 12 months ago |
superman | 1f7b36bd62 | 12 months ago |
superman | a3885c0730 | 12 months ago |
superman | 243b7ebf6e | 12 months ago |
superman | 6dc64e21ca | 12 months ago |
superman | b729af00aa | 12 months ago |
superman | 435964f5b0 | 12 months ago |
superman | 08be58a1bf | 12 months ago |
superman | 083bc8bb18 | 1 year ago |
superman | 1ad5f9dd7c | 1 year ago |
superman | 5256ed8a41 | 1 year ago |
superman | 3308bc4f7f | 1 year ago |
superman | 2d6f0eecf1 | 1 year ago |
superman | 7db8016228 | 1 year ago |
superman | 115630bdca | 1 year ago |
superman | d37bed5c44 | 1 year ago |
superman | 021702f638 | 1 year ago |
superman | 371de9aafb | 1 year ago |
superman | fa76ce0ce9 | 1 year ago |
superman | 51290ef9b7 | 1 year ago |
superman | cd6a4d2127 | 1 year ago |
superman | 888b550a2e | 1 year ago |
superman | 4fa9ed6ee8 | 1 year ago |
superman | 25dd01faf8 | 1 year ago |
superman | 43943f78e6 | 1 year ago |
superman | 634b4344b6 | 1 year ago |
superman | a32aa30c67 | 1 year ago |
superman | c6182c5ba1 | 1 year ago |
superman | 750b7a8e2e | 1 year ago |
superman | 4cc646bbfb | 1 year ago |
superman | e7e9d55d15 | 1 year ago |
superman | b3a179e128 | 1 year ago |
superman | 0b1ac1834f | 1 year ago |
superman | 457f7fbdf9 | 1 year ago |
superman | 4e90158678 | 1 year ago |
superman | 36951237bb | 1 year ago |
superman | a0dba40c06 | 1 year ago |
superman | 8ad9757d88 | 1 year ago |
superman | 74d9c328d0 | 1 year ago |
superman | 070bdef10a | 1 year ago |
superman | 1fa751f291 | 1 year ago |
superman | 884c35a71a | 1 year ago |
superman | 513d2c7d49 | 1 year ago |
Cauchy.Ke-柯小龙 | 07ae3772db | 1 year ago |
Cauchy.Ke | 3789cd0724 | 1 year ago |
Austin.Duan-段嗣跃 | bd315ada58 | 1 year ago |
Austin.Duan | 3626aae9b5 | 1 year ago |
superman | 63fce0ed61 | 1 year ago |
superman | 3204dae279 | 1 year ago |
superman | f5e5b2f2ad | 1 year ago |
superman | 2734362792 | 1 year ago |
superman | cfdf035283 | 1 year ago |
superman | f6dfb79098 | 1 year ago |
superman | 923ffcf1b0 | 1 year ago |
superman | 63a0ef62ae | 1 year ago |
superman | 5282c3c8df | 1 year ago |
superman | f63da6dadc | 1 year ago |
superman | fce2051711 | 1 year ago |
superman | 8e5d9fab31 | 1 year ago |
superman | e18c7d02a9 | 1 year ago |
superman | 4607d5dc35 | 2 years ago |
superman | 81192032d5 | 2 years ago |
superman | e82190466a | 2 years ago |
superman | eb111f27ec | 2 years ago |
superman | 5fa10c2b51 | 2 years ago |
superman | 969e14d811 | 2 years ago |
superman | 57293414b9 | 2 years ago |
superman | 2d60fd04ff | 2 years ago |
superman | 20d2f1f0fb | 2 years ago |
superman | 36484cc153 | 2 years ago |
superman | 796a25b7f2 | 2 years ago |
superman | 39014ec166 | 2 years ago |
superman | 9c8aae0983 | 2 years ago |
superman | c8b7df658b | 2 years ago |
superman | d1f83e5453 | 2 years ago |
superman | a2061e02b3 | 2 years ago |
superman | ce5129e629 | 2 years ago |
superman | cdfa061c44 | 2 years ago |
superman | 1a41e8afbf | 2 years ago |
superman | 51a9d3795d | 2 years ago |
superman | 3eb92c14fb | 2 years ago |
superman | 19d1ea14d7 | 2 years ago |
superman | 74e76d4196 | 2 years ago |
superman | b9e0f93135 | 2 years ago |
superman | 1d22870b9d | 2 years ago |
superman | 223a51d746 | 2 years ago |
superman | 8f7893bdaa | 2 years ago |
superman | 106c8a031c | 2 years ago |
superman | 05c6fc64e2 | 2 years ago |
superman | f7590b9598 | 2 years ago |
superman | 538c0f2eae | 2 years ago |
superman | d8158a02bb | 2 years ago |
superman | 7fa05582c7 | 2 years ago |
superman | ffc8f7b44e | 2 years ago |
superman | 71482284f7 | 2 years ago |
superman | f80a08835d | 2 years ago |
superman | 56e4ef8f38 | 2 years ago |
superman | b0907dba5a | 2 years ago |
superman | 0cf7976d15 | 2 years ago |
superman | fcc843036f | 2 years ago |
superman | 6d02df3045 | 2 years ago |
superman | 8eb9769b49 | 2 years ago |
superman | 0374764c6d | 2 years ago |
superman | e4958abbd0 | 2 years ago |
superman | d876e7f939 | 2 years ago |
superman | 2b4c3e504f | 2 years ago |
superman | cbc7923968 | 2 years ago |
superman | ff582356b3 | 2 years ago |
superman | 60e393b825 | 2 years ago |
superman | 26ed0d515b | 2 years ago |
superman | b28fe437ca | 2 years ago |
superman | 9f356e9c50 | 2 years ago |
superman | bdba89def3 | 2 years ago |
superman | b9b892159f | 2 years ago |
superman | 983cce6f7a | 2 years ago |
superman | f37195497a | 2 years ago |
superman | 6835b05db7 | 2 years ago |
superman | 27c77b0d61 | 2 years ago |
superman | 3d4aa516ad | 2 years ago |
superman | 4ccb735360 | 2 years ago |
superman | c565adc486 | 2 years ago |
superman | ac0b5e4d24 | 2 years ago |
superman | 4091c41216 | 2 years ago |
superman | 2ea85d24fd | 2 years ago |
superman | d23c948c26 | 2 years ago |
superman | b370e1ef15 | 2 years ago |
superman | 67d7466ab9 | 2 years ago |
superman | dd6f4044a6 | 2 years ago |
Kevin.King-王凯壮 | 5ddf614560 | 2 years ago |
Kevin.King | 1a692e797d | 2 years ago |
Kevin.King | 9a2301a2d4 | 2 years ago |
superman | b9953b4a57 | 2 years ago |
superman | c2e0e7c315 | 2 years ago |
superman | 9608658cf3 | 2 years ago |
superman | ab08aee745 | 2 years ago |
lidongy-李东原 | 036ab7c420 | 2 years ago |
lidongy | 113be29b5a | 2 years ago |
superman | 0e0de8a44e | 2 years ago |
superman | 1b1386e768 | 2 years ago |
superman | 7f7c657ef0 | 2 years ago |
superman | 509dce8634 | 2 years ago |
superman | 9d941d4752 | 2 years ago |
superman | 192d0f1ea7 | 2 years ago |
superman | 1a419e850f | 2 years ago |
superman | aa856c22ce | 2 years ago |
superman | 59c88f509a | 2 years ago |
superman | e4bd8579cc | 2 years ago |
superman | 835d390e0f | 2 years ago |
superman | 1dd8e44cea | 2 years ago |
superman | ae50373a9e | 2 years ago |
superman | d36004d602 | 2 years ago |
superman | 89f2e538a1 | 2 years ago |
superman | fe7d94218b | 2 years ago |
superman | 53b1f53df3 | 2 years ago |
Aries.Lsy | 3cf2570797 | 2 years ago |
Aries.lsy | 10175ebf04 | 2 years ago |
superman | 01cc513199 | 2 years ago |
superman | 8d25853607 | 2 years ago |
superman | 7140f7b272 | 2 years ago |
superman | fa2a6e1430 | 2 years ago |
superman | 9a32d7760c | 2 years ago |
superman | 511d35d46d | 2 years ago |
superman | 67020b7045 | 2 years ago |
Aries.Lsy | 7c784d0160 | 2 years ago |
Aries.lsy | 65f48022e3 | 2 years ago |
superman | 3b54b1335f | 2 years ago |
superman | 13ba866422 | 2 years ago |
superman | 3a18f06fba | 2 years ago |
superman | 253e9ef25f | 2 years ago |
superman | c3d17b31d7 | 2 years ago |
Aries.Lsy | 539db173ee | 2 years ago |
Aries.lsy | 73df01d70c | 2 years ago |
superman | dd7ab65c83 | 2 years ago |
superman | 46e696f1b0 | 2 years ago |
superman | 492ca6de6e | 2 years ago |
superman | 0e8e60c6ea | 2 years ago |
superman | 1cc72982e7 | 2 years ago |
superman | da38744180 | 2 years ago |
superman | 2b1175ebda | 2 years ago |
superman | 3573c5f7ef | 2 years ago |
superman | 60ed51c891 | 2 years ago |
superman | ef8470c7a0 | 2 years ago |
superman | c94b32c715 | 2 years ago |
superman | d73b4349ed | 2 years ago |
superman | 68b644e707 | 2 years ago |
superman | 322382ebdb | 2 years ago |
superman | 9216c94185 | 2 years ago |
superman | 479387e37c | 2 years ago |
superman | 17427c2f09 | 2 years ago |
superman | 66ec554eb8 | 2 years ago |
superman | 46e0f73cda | 2 years ago |
superman | 17529d0c1f | 2 years ago |
superman | 97d7523c7d | 2 years ago |
superman | 8ee8cff88b | 2 years ago |
superman | 3184f78887 | 2 years ago |
superman | edc0239032 | 2 years ago |
superman | be5f831ad7 | 2 years ago |
superman | 44350b97b0 | 2 years ago |
superman | f2593249e7 | 2 years ago |
superman | 5b677a0b05 | 2 years ago |
superman | 2f212dc34e | 2 years ago |
superman | c77ed41d84 | 2 years ago |
superman | e5a3d57d5d | 2 years ago |
superman | 3b1b68a365 | 2 years ago |
superman | a40e7ecac1 | 3 years ago |
superman | f31d9e3f6a | 3 years ago |
superman | 947454ed76 | 3 years ago |
superman | df920c8fa5 | 3 years ago |
superman | 6a86956e2c | 3 years ago |
Cauchy.Ke | 55bc265ebf | 3 years ago |
Cauchy.Ke | 274e3d2142 | 3 years ago |
superman | 0bc2f9a1e2 | 3 years ago |
superman | 813c4b39bd | 3 years ago |
superman | abf27e0aee | 3 years ago |
superman | 90c9d5bfe1 | 3 years ago |
superman | d293085be5 | 3 years ago |
superman | 5ebadb61f6 | 3 years ago |
superman | 4be4303838 | 3 years ago |
superman | 1c7f525615 | 3 years ago |
superman | b908665cf5 | 3 years ago |
superman | adc578aabf | 3 years ago |
superman | 6c66dd63a3 | 3 years ago |
superman | 3ddc00d932 | 3 years ago |
superman | 475f3361a2 | 3 years ago |
superman | 1759574fbf | 3 years ago |
superman | 1a217658f5 | 3 years ago |
superman | fb5bf32865 | 3 years ago |
superman | 301c90997f | 3 years ago |
superman | 70e2ec0c54 | 3 years ago |
superman | 7ea907eaf7 | 3 years ago |
superman | 6b415c34d6 | 3 years ago |
superman | 829605fc8d | 3 years ago |
superman | c2a0b89c26 | 3 years ago |
superman | 4d302b4d55 | 3 years ago |
superman | 602e18c413 | 3 years ago |
superman | 4fd7b3c4ec | 3 years ago |
superman | 387a4560de | 3 years ago |
superman | ee695a5244 | 3 years ago |
superman | a8014846ff | 3 years ago |
superman | 3f7d04aee8 | 3 years ago |
superman | 69400a7adb | 3 years ago |
superman | 1533ba30ed | 3 years ago |
superman | 7fc4ba93db | 3 years ago |
superman | fcae560189 | 3 years ago |
superman | a2dfccaeb6 | 3 years ago |
superman | 1a2e031246 | 3 years ago |
superman | 731a4abeaf | 3 years ago |
superman | fb46ab33f0 | 3 years ago |
superman | 2c75cf6584 | 3 years ago |
superman | 80e1f9edb2 | 3 years ago |
superman | cc0b2b6bf7 | 3 years ago |
superman | cafa78d5ea | 3 years ago |
superman | 370dfcf3e6 | 3 years ago |
superman | c3579b8751 | 3 years ago |
superman | 12144d97e2 | 3 years ago |
superman | 887a0991bd | 3 years ago |
superman | 4343477e19 | 3 years ago |
superman | 86c123eefc | 3 years ago |
superman | 5249f646b2 | 3 years ago |
superman | f9ec95c3c8 | 3 years ago |
superman | 4963d2ccdc | 3 years ago |
superman | cd88d217b1 | 3 years ago |
superman | 3adb90e015 | 3 years ago |
superman | 543413f6d9 | 3 years ago |
superman | b52daaa0fd | 3 years ago |
superman | 93d8636221 | 3 years ago |
superman | 796749d980 | 3 years ago |
superman | d0c0221f29 | 3 years ago |
superman | eea6bdab04 | 3 years ago |
superman | 2f91541aed | 3 years ago |
superman | 229bbd7c5b | 3 years ago |
superman | 826f312495 | 3 years ago |
superman | ab387fac07 | 3 years ago |
superman | 5ee901acaf | 3 years ago |
superman | 12030f0885 | 3 years ago |
superman | f28f63e82f | 3 years ago |
superman | 6e69d326b3 | 3 years ago |
superman | cac29926b6 | 3 years ago |
superman | 6bd505f1d3 | 3 years ago |
superman | 36d8310eeb | 3 years ago |
superman | 9ab54787ce | 3 years ago |
superman | 7ae8feb2ca | 3 years ago |
superman | 4c8bba50ff | 3 years ago |
61 changed files with 1442 additions and 4431 deletions
@ -1,13 +1,3 @@
|
||||
module.exports = api => { |
||||
const { plugins, presets, sourceType } = require("@fui/babel-preset-fineui").configs.base(api); |
||||
|
||||
return { |
||||
compact: false, |
||||
presets, |
||||
sourceType, |
||||
plugins: [ |
||||
...plugins, |
||||
"@babel/plugin-proposal-logical-assignment-operators", |
||||
], |
||||
}; |
||||
module.exports = function (api) { |
||||
return require("@fui/babel-preset-fineui").configs.base(api) |
||||
}; |
||||
|
@ -1,68 +0,0 @@
|
||||
import { model, Model } from '@core/core'; |
||||
|
||||
type RootInfo = { |
||||
url: string; // api url
|
||||
prefix: string; // 路径前缀
|
||||
root: string; // 根文件夹名称
|
||||
}; |
||||
|
||||
export const ROOT_INFO_MAP: Record<string, RootInfo> = { |
||||
// 证书 resources/certificates/
|
||||
certificates: { |
||||
url: '/v10/certificates/all', |
||||
prefix: 'resources/', |
||||
root: 'certificates', |
||||
}, |
||||
}; |
||||
|
||||
@model() |
||||
export class FileChooserModel extends Model { |
||||
static xtype = 'dec.dcm.model.components.file_chooser'; |
||||
|
||||
private options: { |
||||
root: string; |
||||
}; |
||||
|
||||
state() { |
||||
return { |
||||
keyword: '', // 搜索关键字
|
||||
items: [], // 文件项
|
||||
}; |
||||
} |
||||
|
||||
actions = { |
||||
/** |
||||
* 请求获取items |
||||
* @param callback 回调 |
||||
*/ |
||||
requestGetItems: (callback?: Function) => { |
||||
const { keyword } = this.model; |
||||
const { url, prefix, root } = ROOT_INFO_MAP[this.options.root]; |
||||
const requestUrl = `${url}?keyword=${encodeURIComponent(keyword)}`; |
||||
Dec.reqGetHandle(requestUrl, '', (data) => { |
||||
this.model.items = data |
||||
.concat({ |
||||
id: root, |
||||
text: prefix + root, |
||||
value: prefix + root, |
||||
isParent: true, |
||||
}) |
||||
.map((item) => ({ |
||||
...item, |
||||
value: prefix + item.path, |
||||
open: item.id === root || BI.isKey(keyword), |
||||
})); |
||||
BI.isFunction(callback) && callback(); |
||||
}); |
||||
}, |
||||
|
||||
/** |
||||
* 设置keyword |
||||
* @param value |
||||
*/ |
||||
setKeyword: (value: string) => { |
||||
this.model.keyword = value; |
||||
this.requestGetItems(); |
||||
}, |
||||
}; |
||||
} |
@ -1,183 +0,0 @@
|
||||
import { EVENT_CHANGE } from './../collapse/collapse'; |
||||
import { shortcut, store } from '@core/core'; |
||||
import { SignEditor, MultiLayerSingleLevelTree, SearchEditor, Button, Editor } from '@fui/core'; |
||||
import { FileChooserModel } from './file_chooser.model'; |
||||
|
||||
@shortcut() |
||||
@store(FileChooserModel, { |
||||
props(this: FileChooser) { |
||||
return this.options; |
||||
}, |
||||
}) |
||||
export class FileChooser extends BI.Widget { |
||||
static xtype = 'dec.dcm.components.file_chooser'; |
||||
|
||||
props = { |
||||
width: 300, |
||||
root: '', // 含义见model中的RootInfo
|
||||
watermark: '', |
||||
value: '', |
||||
}; |
||||
|
||||
model: FileChooserModel['model']; |
||||
store: FileChooserModel['store']; |
||||
watch = { |
||||
items: (value) => { |
||||
this.fileTree.populate(value); |
||||
}, |
||||
}; |
||||
|
||||
textEditor: SignEditor; |
||||
keywordEditor: SearchEditor; |
||||
fileTree: MultiLayerSingleLevelTree; |
||||
sureButton: Button; |
||||
|
||||
render() { |
||||
const { width, watermark, value } = this.options; |
||||
|
||||
return { |
||||
type: BI.VerticalAdaptLayout.xtype, |
||||
height: 24, |
||||
items: [ |
||||
{ |
||||
type: BI.SignEditor.xtype, |
||||
cls: 'bi-border-bottom bi-focus-shadow', |
||||
width, |
||||
height: 22, |
||||
watermark, |
||||
title: value, |
||||
value, |
||||
ref: (_ref: SignEditor) => { |
||||
this.textEditor = _ref; |
||||
}, |
||||
listeners: [ |
||||
{ |
||||
eventName: BI.SignEditor.EVENT_CHANGE, |
||||
action: () => { |
||||
const value = this.textEditor.getValue(); |
||||
this.setValue(value); |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
el: { |
||||
type: BI.Button.xtype, |
||||
|
||||
text: BI.i18nText('Dec-Basic_Choose_File'), |
||||
clear: true, |
||||
handler: () => { |
||||
this.openFileChoosePopover(); |
||||
}, |
||||
}, |
||||
lgap: 10, |
||||
}, |
||||
], |
||||
}; |
||||
} |
||||
|
||||
getValue(): string { |
||||
return this.textEditor.getValue(); |
||||
} |
||||
|
||||
setValue(value: string) { |
||||
this.options.value = value; |
||||
this.textEditor.text.setTitle(value); |
||||
this.textEditor.setValue(value); |
||||
} |
||||
|
||||
/** |
||||
* 打开文件选择弹窗 |
||||
*/ |
||||
private openFileChoosePopover() { |
||||
// 重置搜索关键词
|
||||
this.store.setKeyword(''); |
||||
// 创建并显示窗口
|
||||
const popoverName = BI.UUID(); |
||||
BI.Popovers.create( |
||||
popoverName, |
||||
{ |
||||
header: BI.i18nText('Dec-Data_Set_File_Select_Server_File'), |
||||
body: { |
||||
type: BI.VTapeLayout.xtype, |
||||
items: [ |
||||
{ |
||||
type: BI.SearchEditor.xtype, |
||||
ref: (ref: SearchEditor) => { |
||||
this.keywordEditor = ref; |
||||
}, |
||||
height: 24, |
||||
value: this.model.keyword, |
||||
listeners: [ |
||||
{ |
||||
eventName: BI.SearchEditor.EVENT_CHANGE, |
||||
action: () => { |
||||
const value = this.keywordEditor.getValue(); |
||||
this.store.setKeyword(value); |
||||
}, |
||||
}, |
||||
{ |
||||
eventName: BI.SearchEditor.EVENT_CLEAR, |
||||
action: () => { |
||||
this.store.setKeyword(''); |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
{ |
||||
el: { |
||||
type: BI.MultiLayerSingleLevelTree.xtype, |
||||
ref: (ref: MultiLayerSingleLevelTree) => { |
||||
this.fileTree = ref; |
||||
}, |
||||
keywordGetter: () => this.model.keyword, |
||||
items: this.model.items, |
||||
listeners: [ |
||||
{ |
||||
eventName: BI.MultiLayerSingleLevelTree.EVENT_CHANGE, |
||||
action: () => { |
||||
this.sureButton.setEnable(true); |
||||
}, |
||||
}, |
||||
], |
||||
}, |
||||
tgap: 15, |
||||
}, |
||||
{ |
||||
type: BI.RightVerticalAdaptLayout.xtype, |
||||
height: 24, |
||||
vgap: 10, |
||||
items: [ |
||||
{ |
||||
type: BI.Button.xtype, |
||||
text: BI.i18nText('BI-Basic_Cancel'), |
||||
level: 'ignore', |
||||
handler: () => { |
||||
BI.Popovers.remove(popoverName); |
||||
}, |
||||
}, |
||||
{ |
||||
el: { |
||||
type: BI.Button.xtype, |
||||
ref: (ref: Button) => { |
||||
this.sureButton = ref; |
||||
}, |
||||
text: BI.i18nText('BI-Basic_OK'), |
||||
disabled: true, |
||||
handler: () => { |
||||
const value = this.fileTree.getValue()[0]; |
||||
this.setValue(value); |
||||
BI.Popovers.remove(popoverName); |
||||
}, |
||||
}, |
||||
lgap: 10, |
||||
}, |
||||
], |
||||
}, |
||||
], |
||||
}, |
||||
}, |
||||
this |
||||
).show(popoverName); |
||||
} |
||||
} |
@ -1,13 +0,0 @@
|
||||
.data-conf-file { |
||||
.x-icon{ |
||||
width: 48px; |
||||
height: 48px; |
||||
} |
||||
} |
||||
|
||||
.data-keytab-file { |
||||
.x-icon{ |
||||
width: 48px; |
||||
height: 48px; |
||||
} |
||||
} |
@ -1,35 +0,0 @@
|
||||
import { model, Model } from '@core/core'; |
||||
|
||||
type UploadParam = { |
||||
keytabPath: string; |
||||
krb5ConfPath: string; |
||||
principal: string; |
||||
} |
||||
|
||||
@model() |
||||
export class FileUploadModel extends Model { |
||||
static xtype = 'dec.dcm.model.components.file_upload'; |
||||
|
||||
private options: { |
||||
inter: string; |
||||
} |
||||
|
||||
state() { |
||||
return { |
||||
uploadUrl: '', |
||||
fileName: '', |
||||
}; |
||||
} |
||||
|
||||
actions = { |
||||
setFileInfo: (params: UploadParam) => { |
||||
const inter = this.options.inter; |
||||
|
||||
this.model.uploadUrl = Dec.Utils.getEncodeURL(Dec.fineServletURL + inter, "", params); |
||||
}, |
||||
|
||||
setFileName:(v: string) => { |
||||
this.model.fileName = v; |
||||
} |
||||
} |
||||
} |
@ -1,327 +0,0 @@
|
||||
import { shortcut, store } from '@core/core'; |
||||
import { SignEditor, MultiLayerSingleLevelTree, SearchEditor, Button, Editor, Label } from '@fui/core'; |
||||
import { FileUploadModel } from './file_upload.model'; |
||||
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
||||
import './file_upload.less'; |
||||
|
||||
const api = new ApiFactory().create(); |
||||
|
||||
@shortcut() |
||||
@store(FileUploadModel, { |
||||
props(this: FileUpload) { |
||||
return this.options; |
||||
}, |
||||
}) |
||||
export class FileUpload extends BI.Widget { |
||||
public static xtype = "dec.dcm.components.file_upload"; |
||||
public static EVENT_CHECK_SUCCESS = 'EVENT_CHECK_SUCCESS'; |
||||
public static EVENT_CLEAR_FILE = 'EVENT_CLEAR_FILE'; |
||||
|
||||
public props = { |
||||
watermark: '', |
||||
value: '', |
||||
processId: '', |
||||
disabled: false, |
||||
inter: '', |
||||
access: '', |
||||
iconCls: '' |
||||
}; |
||||
|
||||
model: FileUploadModel['model']; |
||||
store: FileUploadModel['store']; |
||||
watch = { |
||||
uploadUrl: function () { |
||||
this.uploader.setUrl(this.model.uploadUrl); |
||||
}, |
||||
}; |
||||
|
||||
public textEditor: SignEditor; |
||||
public keywordEditor: SearchEditor; |
||||
public fileTree: MultiLayerSingleLevelTree; |
||||
public sureButton: Button; |
||||
public infoLabel: Label; |
||||
|
||||
public render() { |
||||
const { width, watermark, value, processId, inter } = this.options; |
||||
let self = this; |
||||
const processName = BI.concat("process-", processId); |
||||
const processClass = BI.concat(".process-", processId); |
||||
this.setFileInfo({ |
||||
keytabPath: '', |
||||
principal:'', |
||||
krb5ConfPath: '', |
||||
}); |
||||
|
||||
return { |
||||
type: BI.VerticalLayout.xtype, |
||||
items:[{ |
||||
type: BI.FloatLeftLayout.xtype, |
||||
items: [ |
||||
{ |
||||
type: BI.SignEditor.xtype, |
||||
cls: 'bi-border-bottom bi-focus-shadow', |
||||
width: 300, |
||||
height: 22, |
||||
watermark, |
||||
disabled: true, |
||||
value, |
||||
ref: (_ref: SignEditor) => { |
||||
this.textEditor = _ref; |
||||
}, |
||||
listeners: [ |
||||
{ |
||||
eventName: BI.SignEditor.EVENT_CHANGE, |
||||
action: () => { |
||||
const value = this.textEditor.getValue(); |
||||
this.setValue(value); |
||||
}, |
||||
}, |
||||
], |
||||
}, { |
||||
type: BI.Button.xtype, |
||||
width: 100, |
||||
_lgap: 10, |
||||
iconCls: "upload-font", |
||||
level: "ignore", |
||||
ghost: true, |
||||
ref: (_ref: Button) => { |
||||
this.uploadButton = _ref; |
||||
}, |
||||
text: BI.i18nText('Dec-Basic_Choose_File'), |
||||
handler: () => { |
||||
this.uploader.select(); |
||||
}, |
||||
}, |
||||
], |
||||
}, { |
||||
type: BI.FloatLeftLayout.xtype, |
||||
tgap: 8, |
||||
invisible: true, |
||||
ref: (_ref) => { |
||||
this.fileInfo = _ref; |
||||
}, |
||||
items: [ |
||||
{ |
||||
type: BI.VerticalLayout.xtype, |
||||
cls: "bi-border", |
||||
items: [{ |
||||
type: BI.HTapeLayout.xtype, |
||||
height: 68, |
||||
width: 300, |
||||
items: [{ |
||||
el: { |
||||
type: BI.IconLabel.xtype, |
||||
cls: this.options.iconCls, |
||||
}, |
||||
width: 48, |
||||
lgap: 8, |
||||
}, { |
||||
el: { |
||||
type: BI.VerticalLayout.xtype, |
||||
items : [{ |
||||
type: BI.Label.xtype, |
||||
width: 200, |
||||
height: 20, |
||||
textAlign: "left", |
||||
ref: (_ref: Label) => { |
||||
this.fileName = _ref; |
||||
}, |
||||
},{ |
||||
type: BI.VerticalAdaptLayout.xtype, |
||||
items: [{ |
||||
type: BI.Label.xtype, |
||||
cls: "bi-tips", |
||||
height: 20, |
||||
rgap: 3, |
||||
ref: (_ref: Label) => { |
||||
this.fileSize = _ref; |
||||
}, |
||||
}, { |
||||
type: BI.Label.xtype, |
||||
cls: "bi-tips", |
||||
height: 20, |
||||
ref: (_ref: Label) => { |
||||
this.fileModified = _ref; |
||||
}, |
||||
}] |
||||
|
||||
}], |
||||
|
||||
}, |
||||
tgap: 14, |
||||
lgap: 4, |
||||
}, { |
||||
el: { |
||||
type: BI.IconButton.xtype, |
||||
cls: "default-delete-font", |
||||
handler: function () { |
||||
NProgress.set(0.0); |
||||
self.xhr.abort(); |
||||
self.store.setFileName(''); |
||||
self.clearInfo(); |
||||
self.fireEvent(FileUpload.EVENT_CLEAR_FILE); |
||||
|
||||
}, |
||||
}, |
||||
rgap: 10, |
||||
}] |
||||
}, { |
||||
type: BI.VerticalLayout.xtype, |
||||
cls: processName, |
||||
width: 300, |
||||
height: 1, |
||||
}] |
||||
|
||||
}, { |
||||
el :{ |
||||
type: BI.VerticalLayout.xtype, |
||||
cls: "bi-error", |
||||
ref: (_ref: any) => { |
||||
this.errorInfo = _ref; |
||||
}, |
||||
invisible: true, |
||||
items : [{ |
||||
type: BI.Label.xtype, |
||||
height: 20, |
||||
textAlign: "left", |
||||
ref: (_ref: Label) => { |
||||
this.errorCode = _ref; |
||||
}, |
||||
},{ |
||||
type: BI.Label.xtype, |
||||
height: 20, |
||||
textAlign: "left", |
||||
ref: (_ref: Label) => { |
||||
this.errorMsg = _ref; |
||||
}, |
||||
}, { |
||||
type: BI.VerticalAdaptLayout.xtype, |
||||
rgap: 5, |
||||
items: [ |
||||
{ |
||||
type: BI.Label.xtype, |
||||
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip1'), |
||||
},{ |
||||
type: BI.TextButton.xtype, |
||||
cls: "bi-high-light bi-high-light-border-bottom", |
||||
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip2'), |
||||
handler: function () { |
||||
window.open(Dec.system[DecCst.Hyperlink.DECISION_HYPERLINK_CONFIG][DecCst.Hyperlink.KERBEROS_CONF_HELP]); |
||||
}, |
||||
},{ |
||||
type: BI.Label.xtype, |
||||
text: BI.i18nText('Dec-Dcm_Connection_File_Upload_ErrorTip3'), |
||||
} |
||||
], |
||||
},], |
||||
}, |
||||
vgap: 4, |
||||
lgap: 8, |
||||
} |
||||
], |
||||
}, { |
||||
type: BI.MultifileEditor.xtype, |
||||
ref: (ref:any) => { |
||||
self.uploader = ref; |
||||
}, |
||||
url: this.model.uploadUrl, |
||||
accept: this.options.accept, |
||||
listeners: [ |
||||
{ |
||||
// 选择文件
|
||||
eventName: BI.MultifileEditor.EVENT_CHANGE, |
||||
action: function (files) { |
||||
self.options.attachId = ''; |
||||
const fileInfo = files.files[0]; |
||||
self.setInfo(fileInfo); |
||||
self.store.setFileName(fileInfo.fileName); |
||||
this.upload(); |
||||
NProgress.configure({ parent: processClass, minimum: 0.0 }); |
||||
}, |
||||
}, |
||||
{ |
||||
// 上传进度刷新
|
||||
eventName: BI.MultifileEditor.EVENT_PROGRESS, |
||||
action: function (progress) { |
||||
let rate = progress.loaded/progress.total; |
||||
NProgress.set(rate); |
||||
}, |
||||
}, |
||||
{ |
||||
// 开始上传文件
|
||||
eventName: BI.MultifileEditor.EVENT_UPLOADSTART, |
||||
action: function (progressEvent, xhr) { |
||||
self.xhr = xhr; |
||||
}, |
||||
}, |
||||
{ |
||||
// 上传文件完毕
|
||||
eventName: BI.MultifileEditor.EVENT_UPLOADED, |
||||
action: function () { |
||||
const uploadedInfo = this.getValue(); |
||||
const failed = BI.some(uploadedInfo, function (index, file) { |
||||
if (file.data.errorCode) { |
||||
BI.Msg.toast(uploadedInfo[0].filename + BI.i18nText('Dec-Dcm_Connection_File_Upload_Error'), { |
||||
level: "error", |
||||
}); |
||||
self.setErrorInfo(file.data) |
||||
return true; |
||||
} |
||||
}); |
||||
const key = self.options.processId +'Path'; |
||||
!failed && self.setValue(uploadedInfo[0].data.kerberosInfo[key]); |
||||
!failed && self.fireEvent(FileUpload.EVENT_CHECK_SUCCESS, uploadedInfo[0].data); |
||||
!failed && BI.Msg.toast(uploadedInfo[0].filename + BI.i18nText('Dec-Dcm_Connection_File_Upload_Success'),{ |
||||
level: "success" |
||||
}); |
||||
NProgress.configure({ parent: 'body'}); |
||||
|
||||
}, |
||||
}, |
||||
], |
||||
}] |
||||
|
||||
}; |
||||
} |
||||
|
||||
public getValue(): string { |
||||
return this.options.value; |
||||
} |
||||
|
||||
public setValue(value: string) { |
||||
this.options.value = value; |
||||
this.textEditor.text.setTitle(value); |
||||
this.textEditor.setValue(value); |
||||
} |
||||
|
||||
public setInfo(info: any) { |
||||
this.uploadButton.setEnable(false); |
||||
this.fileInfo.setVisible(true); |
||||
this.textEditor.setValue(info.fileName); |
||||
this.fileName.setText(info.fileName); |
||||
this.fileSize.setText(Dec.Utils.getByteWidthUnit(info.size)); |
||||
this.fileModified.setText(BI.getDate().print("%Y-%X-%d %H:%M:%S")) |
||||
} |
||||
|
||||
public clearInfo() { |
||||
this.uploadButton.setEnable(true); |
||||
this.fileInfo.setVisible(false); |
||||
this.errorInfo.setVisible(false); |
||||
this.textEditor.setValue(''); |
||||
this.options.attachId = ''; |
||||
} |
||||
|
||||
public setErrorInfo(errorInfo: any) { |
||||
this.errorInfo.setVisible(true); |
||||
this.errorCode.setText(BI.i18nText("Dec-Dcm_Connection_File_Upload_ErrorCode") + ":"+ errorInfo.errorCode); |
||||
this.errorMsg.setText(BI.i18nText("Dec-Dcm_Connection_File_Upload_ErrorMsg") + ":" + errorInfo.errorMessage); |
||||
} |
||||
|
||||
public setEnable(v) { |
||||
this.uploadButton._setEnable(v); |
||||
} |
||||
|
||||
public setFileInfo(params) { |
||||
this.store.setFileInfo(params); |
||||
} |
||||
} |
@ -1,41 +0,0 @@
|
||||
import { shortcut } from '@core/core'; |
||||
import { BubbleCombo, BubblePopupView, IconButton } from '@fui/core'; |
||||
|
||||
@shortcut() |
||||
export class TipsCombo extends BI.Widget { |
||||
public static xtype = 'dec.dcm.tips.combo'; |
||||
|
||||
public props: BubblePopupView['props'] & IconButton['props'] = { |
||||
trigger: 'hover', |
||||
direction: 'top' |
||||
}; |
||||
|
||||
private bubbleCombo: BubbleCombo; |
||||
|
||||
private bubbleComboPopup: BubblePopupView; |
||||
|
||||
public render() { |
||||
const { direction, trigger, el } = this.options; |
||||
|
||||
return { |
||||
type: BI.BubbleCombo.xtype, |
||||
trigger, |
||||
direction, |
||||
el: { |
||||
type: BI.IconButton.xtype, |
||||
cls: "detail-font", |
||||
}, |
||||
popup: { |
||||
type: BI.BubblePopupView.xtype, |
||||
ref: (_ref: BubblePopupView) => { |
||||
this.bubbleComboPopup = _ref; |
||||
}, |
||||
el, |
||||
}, |
||||
listeners: [], |
||||
ref: (_ref: BubbleCombo) => { |
||||
this.bubbleCombo = _ref; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,52 +0,0 @@
|
||||
/* |
||||
https://work.fineres.com/browse/REPORT-91724 用于参数统一校验
|
||||
*/ |
||||
import { ILLEGAL_STRINGS } from "./constant"; |
||||
export type CheckResult = { |
||||
legal: boolean, |
||||
errorMsg: string, |
||||
} |
||||
export const CHECK_CORRECT: CheckResult = { |
||||
legal: true, |
||||
errorMsg: "", |
||||
}; |
||||
|
||||
/** |
||||
* 检测非法字符,返回错误提示 |
||||
* @param value 要校验的字符串 |
||||
*/ |
||||
export function checkIllegalStrings(value: string): CheckResult { |
||||
// 后端传入的校验开关,如果没传,那也默认开启
|
||||
const enabled = Dec.system.enableParameterVerify ?? true; |
||||
let result = CHECK_CORRECT; |
||||
if (enabled) { |
||||
// 关键字不区分大小写
|
||||
ILLEGAL_STRINGS.every(s => { |
||||
const sIndex = value.toLowerCase().indexOf(s); |
||||
if (sIndex !== -1) { |
||||
result = { |
||||
legal: false, |
||||
errorMsg: `${BI.i18nText("Dec-Basic_Check_Illegal_Strings")}${value.substr(sIndex, s.length)}`, |
||||
}; |
||||
|
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
}); |
||||
|
||||
return result; |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
|
||||
export function checkIllegalStringsInWidgetAndShowError(widget: any) { |
||||
const value = widget.getValue(); |
||||
const result = checkIllegalStrings(value); |
||||
if (!result.legal) { |
||||
widget.showError(result.errorMsg); |
||||
} |
||||
|
||||
return result.legal; |
||||
} |
@ -1,15 +0,0 @@
|
||||
/** |
||||
* 参数检验的非法字符数组,由于不区分大小写,统一用小写 |
||||
*/ |
||||
export const ILLEGAL_STRINGS = [ |
||||
"\"", |
||||
"<", |
||||
">", |
||||
"&", |
||||
"/script", |
||||
"javascript:", |
||||
"onblur", |
||||
"getruntime", |
||||
"processbuilder", |
||||
"java.lang.processimpl", |
||||
]; |
@ -1 +0,0 @@
|
||||
export { checkIllegalStringsInWidgetAndShowError, checkIllegalStrings } from "./checkIllegalStrings/checkIllegalStrings" |
@ -1,24 +0,0 @@
|
||||
BI.point("dec.dcm.model.connection", "createNewConnection", () => { |
||||
Dec.Utils.saveFocusPoint({ |
||||
id: "E73325", |
||||
title: "新建数据连接", |
||||
}); |
||||
}); |
||||
|
||||
BI.point("dec.dcm.model.title_maintain", "setTestEvent", () => { |
||||
Dec.Utils.saveFocusPoint({ |
||||
id: "E73328", |
||||
title: "测试数据连接", |
||||
}); |
||||
}); |
||||
|
||||
BI.point("dec.dcm.model.maintain_form", "addConnection", function () { |
||||
Dec.Utils.saveFocusPoint({ |
||||
id: "E8827", |
||||
title: "保存数据连接", |
||||
body: { |
||||
datebaseType: this.model.datebaseTypeSelected, |
||||
databaseName: this.model.connectionSelected, |
||||
}, |
||||
}); |
||||
}); |
@ -1 +0,0 @@
|
||||
BI.constant('dec.constant.connection.list', []); |
@ -1,17 +0,0 @@
|
||||
import { DATEBASE_FILTER_TYPE } from "@constants/constant"; |
||||
|
||||
BI.constant('dec.constant.database.filter.type', [ |
||||
{ |
||||
text: BI.i18nText('Dec-Dcm_Connection_Commonly'), |
||||
value: DATEBASE_FILTER_TYPE.COMMONLY, |
||||
selected: true, |
||||
}, |
||||
{ |
||||
text: BI.i18nText('Dec-Dcm_Connection_All'), |
||||
value: DATEBASE_FILTER_TYPE.ALL, |
||||
}, |
||||
{ |
||||
text: BI.i18nText('Dec-Dcm_Connection_Other'), |
||||
value: DATEBASE_FILTER_TYPE.OTHER, |
||||
}, |
||||
]); |
File diff suppressed because it is too large
Load Diff
@ -1,96 +0,0 @@
|
||||
import { shortcut } from '@core/core'; |
||||
import { ApiFactory } from 'src/modules/crud/apiFactory'; |
||||
|
||||
const api = new ApiFactory().create(); |
||||
|
||||
@shortcut() |
||||
export class TimeOutSetting extends BI.Widget { |
||||
public static xtype = 'dec.dcm.page.timeout.setting'; |
||||
|
||||
public props = { |
||||
value: 0, |
||||
}; |
||||
|
||||
beforeRender(cb: Function) { |
||||
const self = this; |
||||
api.getTimeOut().then(res => { |
||||
self.props.value = res.data.count; |
||||
cb(); |
||||
}); |
||||
} |
||||
|
||||
public render() { |
||||
const { value } = this.props; |
||||
const self = this; |
||||
|
||||
return { |
||||
type: 'bi.vtape', |
||||
cls: 'bi-background', |
||||
items: [{ |
||||
type: 'dec.setting.header', |
||||
height: 40, |
||||
listeners: [{ |
||||
eventName: 'EVENT_CANCEL', |
||||
action: function () { |
||||
self.fireEvent('EVENT_CHANGE'); |
||||
}, |
||||
}, { |
||||
eventName: 'EVENT_SAVE', |
||||
action: function () { |
||||
api.putTimeOut(Number(self.editor.getValue())); |
||||
self.fireEvent('EVENT_CHANGE'); |
||||
}, |
||||
}], |
||||
}, { |
||||
type: 'bi.vertical', |
||||
cls: 'bi-card', |
||||
vgap: 10, |
||||
items: [ |
||||
{ |
||||
el: { |
||||
type: 'bi.vertical_adapt', |
||||
cls: 'bi-border-bottom', |
||||
height: 40, |
||||
items: [{ |
||||
type: 'bi.label', |
||||
textAlign: 'left', |
||||
width: 120, |
||||
cls: 'dec-font-weight-bold', |
||||
text: BI.i18nText('Dec-Dcm_Connection_Timeout_Detection'), |
||||
}] |
||||
}, tgap: -10, hgap: 16, |
||||
}, |
||||
{ |
||||
type: 'bi.vertical_adapt', |
||||
hgap: 16, |
||||
items: [{ |
||||
type: 'dec.label.editor.item', |
||||
text: BI.i18nText('Dec-Over_Time'), |
||||
textWidth: 100, |
||||
editorWidth: 80, |
||||
allowBlank: false, |
||||
value: value, |
||||
validationChecker: function(v) { |
||||
return BI.isPositiveInteger(v); |
||||
}, |
||||
errorText: BI.i18nText('BI-Please_Input_Positive_Integer'), |
||||
ref: function (_ref) { |
||||
self.editor = _ref; |
||||
}, |
||||
}, { |
||||
el: { |
||||
type: 'bi.label', |
||||
text: BI.i18nText('Dec-Dcm_Connection_Timeout_Millisecond'), |
||||
}, |
||||
lgap: 10, |
||||
}] |
||||
|
||||
}, |
||||
] |
||||
}], |
||||
ref: function (_ref) { |
||||
self.setting = _ref; |
||||
}, |
||||
}; |
||||
} |
||||
} |
Loading…
Reference in new issue