Skip to content

Commit 092d564

Browse files
committed
add AI agent for TIS
1 parent 972e774 commit 092d564

12 files changed

+3131
-2996
lines changed

src/base/datax.add.step4.component.ts

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export class SelectedTabsComponent extends BasicFormComponent {
193193
throw new Error("descriptor can not be null");
194194
}
195195
// ,targetItemDesc_batch_source_process_extend
196-
console.log([meta, this.dataXReaderTargetName,this.descriptor]);
196+
// console.log([meta, this.dataXReaderTargetName,this.descriptor]);
197197
let detailId = meta.id;
198198
let pluginMeta: PluginType[]
199199
= [dataXReaderSubFormPluginMeta(
@@ -405,7 +405,6 @@ export class SelectedTabsComponent extends BasicFormComponent {
405405
// 设置所选table的表以及 表的列
406406
// 文档:https://angular.io/docs/ts/latest/guide/forms.html
407407
@Component({
408-
// templateUrl: '/runtime/addapp.htm'
409408
selector: "datax-reader-table-select",
410409
template: `
411410
<tis-steps *ngIf="createModel && this.dto.headerStepShow" [type]="stepType" [step]="0"></tis-steps>
@@ -452,10 +451,7 @@ export class SelectedTabsComponent extends BasicFormComponent {
452451
</ng-template>
453452
</nz-spin>
454453
`
455-
, styles: [
456-
`
457-
`
458-
]
454+
, styles: [``]
459455
})
460456
export class DataxAddStep4Component extends BasicDataXAddComponent implements OnInit, AfterViewInit {
461457
errorItem: Item = Item.create([]);
@@ -484,13 +480,6 @@ export class DataxAddStep4Component extends BasicDataXAddComponent implements On
484480
writerDesc: Array<Descriptor> = [];
485481
tabFormErrors: Map<string, Array<IFieldError>>;
486482

487-
// savePlugin = new EventEmitter<any>();
488-
489-
490-
491-
492-
493-
494483
/**
495484
*
496485
* @param baseCpt
@@ -510,32 +499,25 @@ export class DataxAddStep4Component extends BasicDataXAddComponent implements On
510499
}
511500
let subFieldForms: Map<string /*tableName*/, Array<Item>> = new Map();
512501
let subFormHetero: HeteroList = hList[0];
513-
// console.log(subFormHetero);
514502
let item: Item = null;
515503
let subForm: Array<Item> = null;
516-
// let desc: Descriptor = subFormHetero.descriptors.get(this.dto.readerDescriptor.impl);
517-
518504
if (!readerDescriptorImpl) {
519505
item = subFormHetero.items[0];
520506
if (!item) {
521507
throw new Error("readerDescriptorImpl is undefined and first item also is undefined");
522508
}
523509
readerDescriptorImpl = item.impl;
524510
}
525-
526511
if (!readerDescriptorImpl) {
527512
throw new Error("readerDescriptorImpl can not be undefined");
528513
}
529-
//console.log([subFormHetero.descriptors,readerDescriptorImpl]);
530514
let desc: Descriptor = subFormHetero.descriptors.get(readerDescriptorImpl);
531515
if (!desc) {
532-
// console.log(subFormHetero.descriptors.keys());
533516
throw new Error("readerDescriptorImpl:" + readerDescriptorImpl);
534517
}
535518

536519
for (let itemIdx = 0; itemIdx < subFormHetero.items.length; itemIdx++) {
537520
item = subFormHetero.items[itemIdx];
538-
// console.log([subFormHetero.items, itemIdx ,item]);
539521
for (let tabKey in item.vals) {
540522
/**==========================
541523
*START: 删除历史脏数据保护措施
@@ -553,9 +535,7 @@ export class DataxAddStep4Component extends BasicDataXAddComponent implements On
553535
// item.wrapItemVals();
554536
// @ts-ignore
555537
subForm = item.vals[tabKey];
556-
// console.log([tabKey, subForm]);
557-
// Item.wrapItemPropVal(v, at);
558-
console.log([tabKey,subForm]);
538+
// console.log([tabKey,subForm]);
559539
subFieldForms.set(tabKey, subForm);
560540
}
561541
break;
@@ -565,13 +545,13 @@ export class DataxAddStep4Component extends BasicDataXAddComponent implements On
565545
throw new Error("readerDescriptorImpl:" + readerDescriptorImpl + ",desc:" + desc.impl + " must has subForm");
566546
}
567547

568-
// console.log(subFieldForms);
569548
subFieldFormsCallback(subFieldForms, subFormHetero, desc);
570549
}
571550
);
572551
}
573552

574-
constructor(tisService: TISService, modalService: NzModalService, private drawerService: NzDrawerService, r: Router, route: ActivatedRoute, notification: NzNotificationService) {
553+
constructor(tisService: TISService, modalService: NzModalService
554+
, private drawerService: NzDrawerService, r: Router, route: ActivatedRoute, notification: NzNotificationService) {
575555
super(tisService, modalService, r, route, notification);
576556
}
577557

src/base/datax.worker.add.step0.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ export class DataxWorkerAddStep0Component extends BasicFormComponent implements
116116
require: true,
117117
appendParams: appendParams
118118
};
119-
// console.log([pluginDesc,pluginCategory]);
120119

121-
// console.log(dto);
122120
let containTplRewriterPlugin = dto.typedPluginCount[PowerjobCptType.JobTplAppOverwrite];
123121
let modelRef = PluginsComponent.openPluginDialog({
124122
opt: opt,

src/common/ds.quick.manager.component.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,6 @@ export class DatasourceQuickManagerComponent extends BasicFormComponent implemen
156156
this.hasSaved = true;
157157
let newDb: DataBaseMeta = {id: db.dbId, name: db.name, iconEndtype: pluginDesc.endtype};
158158
this.dsList = [newDb, ...this.dsList];
159-
// let origin = {'key': `${db.dbId}`, 'title': db.name, 'children': []};
160-
// origin[KEY_DB_ID] = `${db.dbId}`;
161-
// // KEY_DB_ID
162-
// let newNode: NzTreeNodeOptions[] = [origin];
163-
// this.nodes = newNode.concat(this.nodes);
164-
//
165-
// let e = {'type': NodeType.DB, 'dbId': `${db.dbId}`};
166-
// // console.log([db, e, newNode]);
167-
// this.treeNodeClicked = true;
168-
// this.onEvent(e);
169-
// this.addDBNode(db);
170-
// this.notify.success("成功", `数据库${db.name}添加成功`, {nzDuration: 6000});
171159
});
172160
}
173161

src/common/plugin/item-prop-val.component.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,17 @@ import {createDrawer} from "../ds.quick.manager.component";
114114
</ng-container>
115115
<ng-container *ngSwitchCase="6">
116116
<!--select-->
117+
117118
<nz-select [attr.data-testid]="_pp.key" [disabled]="disabled" [(ngModel)]="_pp.primary"
118-
[name]="_pp.key"
119+
[name]="_pp.key" [nzCustomTemplate]="selOptsTpl"
119120
(ngModelChange)="inputValChange(_pp,$event)" nzAllowClear>
120121
<nz-option nzCustomContent *ngFor="let e of _pp.options" [nzLabel]="e.name"
121-
[nzValue]="e.name">
122-
<span *ngIf="e.endType" nzTheme="fill" nz-icon nz [nzType]="e.endType"></span> {{e.name}}
122+
[nzValue]="e.name" [nzDisabled]="false" [nzTitle]="e.endType" >
123+
{{e.name}}
123124
</nz-option>
124125
</nz-select>
126+
127+
<ng-template #selOptsTpl let-opt> <span nz-icon style="font-size: 18px" [nzType]="opt.nzTitle" nzTheme="fill" ></span> {{ opt.nzLabel}}</ng-template>
125128
</ng-container>
126129
<ng-container *ngSwitchCase="7">
127130
<!--PASSWORD-->
@@ -413,6 +416,11 @@ export class ItemPropValComponent extends BasicFormComponent implements AfterCon
413416
return (this._pp && this._pp.pk && this._pp.updateModel) || this._disabled || this._pp.readonly;
414417
}
415418

419+
getOptionEndType(opt: any, pp: ItemPropVal): string {
420+
// 通过 nzValue 找到对应的 option 对象
421+
console.log(opt);
422+
return 'folder'; // 如果找不到,返回默认图标
423+
}
416424

417425
@Input() set pp(item: ItemPropVal) {
418426
// console.log(item);
@@ -670,6 +678,9 @@ export class ItemPropValComponent extends BasicFormComponent implements AfterCon
670678
}
671679

672680
reloadSelectableItems() {
681+
if (!this._pluginImpl) {
682+
throw new Error("prop _pluginImpl can not be null");
683+
}
673684
let url = "/coredefine/corenodemanage.ajax";
674685
this.httpPost(url, `action=plugin_action&emethod=get_fresh_enum_field&impl=${this._pluginImpl}&field=${this._pp.key}`)
675686
.then((r) => {

0 commit comments

Comments
 (0)