aldehyde 0.2.165 → 0.2.166
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/controls/action/utils.d.ts.map +1 -1
- package/lib/controls/action/utils.js +6 -0
- package/lib/controls/action/utils.js.map +1 -1
- package/lib/controls/file-view/drawer-file-view.d.ts +2 -2
- package/lib/controls/file-view/drawer-file-view.d.ts.map +1 -1
- package/lib/controls/file-view/drawer-file-view.js +10 -19
- package/lib/controls/file-view/drawer-file-view.js.map +1 -1
- package/lib/controls/file-view/index.d.ts +4 -2
- package/lib/controls/file-view/index.d.ts.map +1 -1
- package/lib/controls/file-view/index.js +74 -41
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +14 -6
- package/lib/layout2/header.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +1 -3
- package/lib/layout2/page.js.map +1 -1
- package/lib/layout2/type/layout.type.d.ts +1 -1
- package/lib/layout2/type/layout.type.d.ts.map +1 -1
- package/lib/layout2/util/menu.util.d.ts +1 -1
- package/lib/layout2/util/menu.util.d.ts.map +1 -1
- package/lib/layout2/util/menu.util.js +13 -4
- package/lib/layout2/util/menu.util.js.map +1 -1
- package/lib/table/index.css +4 -4
- package/lib/table/relation-table.d.ts +1 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +9 -3
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +4 -1
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +48 -7
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +9 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js +2 -0
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +18 -7
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/action/utils.tsx +8 -0
- package/src/aldehyde/controls/file-view/drawer-file-view.tsx +12 -15
- package/src/aldehyde/controls/file-view/index.tsx +132 -94
- package/src/aldehyde/index.tsx +5 -0
- package/src/aldehyde/layout2/header.tsx +15 -1
- package/src/aldehyde/layout2/page.tsx +1 -5
- package/src/aldehyde/layout2/type/layout.type.ts +1 -1
- package/src/aldehyde/layout2/util/menu.util.tsx +16 -6
- package/src/aldehyde/table/index.css +4 -4
- package/src/aldehyde/table/relation-table.tsx +9 -3
- package/src/aldehyde/tmpl/hcservice-v3.tsx +54 -14
- package/src/aldehyde/tmpl/interface.tsx +17 -1
- package/src/aldehyde/units/index.tsx +183 -169
|
@@ -371,17 +371,23 @@ class RelationTable extends React.PureComponent<
|
|
|
371
371
|
};
|
|
372
372
|
|
|
373
373
|
editRow = (record) => {};
|
|
374
|
-
delete = (record) => {
|
|
375
|
-
const { value, fieldGroupConfig, onChange } = this.props;
|
|
374
|
+
delete =async (record) => {
|
|
375
|
+
const { value, fieldGroupConfig, onChange,serverKey } = this.props;
|
|
376
376
|
//追加
|
|
377
|
-
const selectdDatas = [];
|
|
377
|
+
const selectdDatas:DtmplData[] = [];
|
|
378
|
+
const selectdCodes:string[] = [];
|
|
378
379
|
if (value) {
|
|
379
380
|
for (let v of value) {
|
|
380
381
|
if (v.code != record.code) {
|
|
381
382
|
selectdDatas.push(v);
|
|
383
|
+
selectdCodes.push(v.code);
|
|
382
384
|
}
|
|
383
385
|
}
|
|
384
386
|
}
|
|
387
|
+
//直接删除
|
|
388
|
+
if(fieldGroupConfig.deleteData){
|
|
389
|
+
let result: boolean = await HcserviceV3.deleteByCode(serverKey, fieldGroupConfig.id, selectdCodes);
|
|
390
|
+
}
|
|
385
391
|
onChange(fieldGroupConfig, selectdDatas);
|
|
386
392
|
};
|
|
387
393
|
|
|
@@ -718,16 +718,56 @@ export default class HcserviceV3 {
|
|
|
718
718
|
static download(serverKey: string, path) {
|
|
719
719
|
let vars = path.split("/");
|
|
720
720
|
let fileName = vars[vars.length - 1];
|
|
721
|
+
this.downloadDir(this.getFileUrl(serverKey, path),fileName);
|
|
722
|
+
// let vars = path.split("/");
|
|
723
|
+
// let fileName = vars[vars.length - 1];
|
|
724
|
+
// Units.downloadFile(
|
|
725
|
+
// this.getFileUrl(serverKey, path) + `&disposition=attachment`,
|
|
726
|
+
// fileName
|
|
727
|
+
// );
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
static downloadDir(path,fileName) {
|
|
731
|
+
|
|
732
|
+
// let fileName = this.getFileNameFrom(path);
|
|
721
733
|
Units.downloadFile(
|
|
722
|
-
|
|
723
|
-
|
|
734
|
+
path + `&disposition=attachment`,
|
|
735
|
+
fileName
|
|
724
736
|
);
|
|
725
737
|
}
|
|
726
738
|
|
|
727
739
|
static openfile(serverKey: string, path, toolbar) {
|
|
728
740
|
let vars = path.split("/");
|
|
729
741
|
let fileName = vars[vars.length - 1];
|
|
730
|
-
|
|
742
|
+
this.openfileDir(fileName,this.getFileUrl(serverKey, path),toolbar)
|
|
743
|
+
// Units.openFile(this.getFileUrl(serverKey, path), fileName, toolbar);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
static getFileNameFrom(path) {
|
|
747
|
+
if(!path){
|
|
748
|
+
return undefined;
|
|
749
|
+
}
|
|
750
|
+
let vars = path.split("/");
|
|
751
|
+
let fileName = vars[vars.length - 1];
|
|
752
|
+
return fileName;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
static getFileSuffixFrom(fileName) {
|
|
756
|
+
if(!fileName){
|
|
757
|
+
return undefined;
|
|
758
|
+
}
|
|
759
|
+
let ss=fileName.split('.');
|
|
760
|
+
if(ss.length>1){
|
|
761
|
+
return ss.pop();
|
|
762
|
+
}else{
|
|
763
|
+
return undefined;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
static openfileDir(path,fileName, toolbar) {
|
|
769
|
+
//let fileName = this.getFileNameFrom(path);
|
|
770
|
+
Units.openFile(path, fileName, toolbar);
|
|
731
771
|
}
|
|
732
772
|
|
|
733
773
|
static getFileUrl(serverKey: string, path) {
|
|
@@ -741,17 +781,17 @@ export default class HcserviceV3 {
|
|
|
741
781
|
return encodeUri;
|
|
742
782
|
}
|
|
743
783
|
|
|
744
|
-
static getFileTxtUrl(serverKey: string, path) {
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
}
|
|
784
|
+
// static getFileTxtUrl(serverKey: string, path) {
|
|
785
|
+
// const hydrocarbonToken = Units.hydrocarbonToken(
|
|
786
|
+
// Units.programCode(serverKey)
|
|
787
|
+
// );
|
|
788
|
+
// let url =
|
|
789
|
+
// Units.joinPath(
|
|
790
|
+
// Units.api(serverKey),
|
|
791
|
+
// Units.joinPath("/v3/files/text", path)
|
|
792
|
+
// ) + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
|
|
793
|
+
// return encodeURI(url);
|
|
794
|
+
// }
|
|
755
795
|
|
|
756
796
|
static async loadFileTxt(serverKey: string, path) {
|
|
757
797
|
let res = await Super.super({
|
|
@@ -231,6 +231,7 @@ export interface FieldGroupConfig extends OrderableTmplBase {
|
|
|
231
231
|
pointSourceId?: string;
|
|
232
232
|
classAddConfigs?: ClassAddConfig[];
|
|
233
233
|
defaultCriteriaValue?: object;
|
|
234
|
+
deleteData?:boolean;
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
export type SaveJumpType = "list" | "add" | "edit";
|
|
@@ -271,7 +272,8 @@ export type Comparator =
|
|
|
271
272
|
| "nogreater"
|
|
272
273
|
| "exclude"
|
|
273
274
|
| "noLess"
|
|
274
|
-
| "noGreater"
|
|
275
|
+
| "noGreater"
|
|
276
|
+
|"none1" |"none1n";
|
|
275
277
|
|
|
276
278
|
export type FieldAction = "add" | "delete" | "edit" | "detail" | "table";
|
|
277
279
|
|
|
@@ -525,6 +527,20 @@ export interface SubChartProps {
|
|
|
525
527
|
|
|
526
528
|
export type FileValueValid = true | "new" | "delete";
|
|
527
529
|
|
|
530
|
+
interface CommonFileValue {
|
|
531
|
+
type:'completeURL'|'relativePath'|'KKFile',
|
|
532
|
+
value:Object;
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
export interface CommonFilePath {
|
|
536
|
+
//type:'completeURL'|'relativePath'|'KKFile',
|
|
537
|
+
fileName?:string;
|
|
538
|
+
contentType?:string;//文件类型
|
|
539
|
+
path?:String;
|
|
540
|
+
iconPath?:string;
|
|
541
|
+
valid?:string;
|
|
542
|
+
};
|
|
543
|
+
|
|
528
544
|
export interface FileLoadInfo {
|
|
529
545
|
path: string;
|
|
530
546
|
fileName: string;
|