Browse Source

KERNEL-14124 fix: 解决报错,调整打包

es6
Zhenfei.Li 2 years ago
parent
commit
9358010b47
  1. 230
      src/widget/datepane/datepane.js
  2. 230
      src/widget/datetimepane/datetimepane.js
  3. 2
      src/widget/dynamicdatetime/dynamicdatetime.timeselect.js
  4. 4
      webpack/attachments.js

230
src/widget/datepane/datepane.js

@ -67,21 +67,21 @@ export class DynamicDatePane extends Widget {
const value = this.switcher.getValue()[0]; const value = this.switcher.getValue()[0];
this.dateTab.setSelect(value); this.dateTab.setSelect(value);
switch (value) { switch (value) {
case DynamicDatePane.Static: case DynamicDatePane.Static:
date = DynamicDateHelper.getCalculation(this.dynamicPane.getValue()); date = DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
this.ymd.setValue({ this.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth() + 1, month: date.getMonth() + 1,
day: date.getDate(), day: date.getDate(),
}); });
break; break;
case DynamicDatePane.Dynamic: case DynamicDatePane.Dynamic:
this.dynamicPane.setValue({ this.dynamicPane.setValue({
year: 0, year: 0,
}); });
break; break;
default: default:
break; break;
} }
this.fireEvent(DynamicDatePane.EVENT_CHANGE); this.fireEvent(DynamicDatePane.EVENT_CHANGE);
}, },
@ -101,92 +101,92 @@ export class DynamicDatePane extends Widget {
showIndex: DynamicDatePane.Static, showIndex: DynamicDatePane.Static,
cardCreator: v => { cardCreator: v => {
switch (v) { switch (v) {
case DynamicDatePane.Static: case DynamicDatePane.Static:
return { return {
type: StaticDatePaneCard.xtype, type: StaticDatePaneCard.xtype,
min: o.minDate, min: o.minDate,
max: o.maxDate, max: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
listeners: [ listeners: [
{ {
eventName: "EVENT_CHANGE", eventName: "EVENT_CHANGE",
action: () => { action: () => {
this.fireEvent(DynamicDatePane.EVENT_CHANGE); this.fireEvent(DynamicDatePane.EVENT_CHANGE);
},
}, },
{
eventName: "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW",
action: () => {
this.fireEvent(DynamicDatePane.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
},
}
],
ref: _ref => {
this.ymd = _ref;
}, },
{ };
eventName: "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW", case DynamicDatePane.Dynamic:
action: () => { default:
this.fireEvent(DynamicDatePane.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW); return {
type: VTapeLayout.xtype,
items: [
{
type: DynamicDateCard.xtype,
min: o.minDate,
max: o.maxDate,
ref: _ref => {
this.dynamicPane = _ref;
},
}, },
} {
], el: {
ref: _ref => { type: CenterLayout.xtype,
this.ymd = _ref; items: [
}, {
}; type: TextButton.xtype,
case DynamicDatePane.Dynamic: cls: "bi-high-light bi-border-top",
default: shadow: true,
return { text: i18nText("BI-Basic_Clear"),
type: VTapeLayout.xtype, textHeight: 23,
items: [ listeners: [
{ {
type: DynamicDateCard.xtype, eventName: TextButton.EVENT_CHANGE,
min: o.minDate, action: () => {
max: o.maxDate, this.setValue();
ref: _ref => { this.fireEvent(DynamicDatePane.EVENT_CHANGE);
this.dynamicPane = _ref; },
}, }
}, ],
{ },
el: { {
type: CenterLayout.xtype, type: TextButton.xtype,
items: [ cls: "bi-border-left bi-high-light bi-border-top",
{ textHeight: 23,
type: TextButton.xtype, shadow: true,
cls: "bi-high-light bi-border-top", text: i18nText("BI-Basic_OK"),
shadow: true, listeners: [
text: i18nText("BI-Basic_Clear"), {
textHeight: 23, eventName: TextButton.EVENT_CHANGE,
listeners: [ action: () => {
{ const type = this.dateTab.getSelect();
eventName: TextButton.EVENT_CHANGE, if (type === DynamicDateCombo.Dynamic) {
action: () => { this.dynamicPane.checkValidation(true) &&
this.setValue();
this.fireEvent(DynamicDatePane.EVENT_CHANGE);
},
}
],
},
{
type: TextButton.xtype,
cls: "bi-border-left bi-high-light bi-border-top",
textHeight: 23,
shadow: true,
text: i18nText("BI-Basic_OK"),
listeners: [
{
eventName: TextButton.EVENT_CHANGE,
action: () => {
const type = this.dateTab.getSelect();
if (type === DynamicDateCombo.Dynamic) {
this.dynamicPane.checkValidation(true) &&
this.fireEvent( this.fireEvent(
DynamicDatePopup.EVENT_CHANGE DynamicDatePopup.EVENT_CHANGE
); );
} else { } else {
this.fireEvent(DynamicDatePane.EVENT_CHANGE); this.fireEvent(DynamicDatePane.EVENT_CHANGE);
} }
}, },
} }
], ],
} }
], ],
}, },
height: 24, height: 24,
} }
], ],
}; };
} }
}, },
} }
@ -204,11 +204,11 @@ export class DynamicDatePane extends Widget {
_checkValue(v) { _checkValue(v) {
switch (v.type) { switch (v.type) {
case DynamicDateCombo.Dynamic: case DynamicDateCombo.Dynamic:
return isNotEmptyObject(v.value); return isNotEmptyObject(v.value);
case DynamicDateCombo.Static: case DynamicDateCombo.Static:
default: default:
return true; return true;
} }
} }
@ -233,21 +233,21 @@ export class DynamicDatePane extends Widget {
this.switcher.setValue(type); this.switcher.setValue(type);
this.dateTab.setSelect(type); this.dateTab.setSelect(type);
switch (type) { switch (type) {
case DynamicDateCombo.Dynamic: case DynamicDateCombo.Dynamic:
this.dynamicPane.setValue(value); this.dynamicPane.setValue(value);
break; break;
case DynamicDateCombo.Static: case DynamicDateCombo.Static:
default: default:
if (this._checkValueValid(value)) { if (this._checkValueValid(value)) {
const date = getDate(); const date = getDate();
this.ymd.setValue({ this.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth() + 1, month: date.getMonth() + 1,
}); });
} else { } else {
this.ymd.setValue(value); this.ymd.setValue(value);
} }
break; break;
} }
} }

230
src/widget/datetimepane/datetimepane.js

@ -69,21 +69,21 @@ export class DynamicDateTimePane extends Widget {
let date; let date;
this.dateTab.setSelect(value); this.dateTab.setSelect(value);
switch (value) { switch (value) {
case DynamicDateTimePane.Static: case DynamicDateTimePane.Static:
date = DynamicDateHelper.getCalculation(this.dynamicPane.getValue()); date = DynamicDateHelper.getCalculation(this.dynamicPane.getValue());
this.ymd.setValue({ this.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth() + 1, month: date.getMonth() + 1,
day: date.getDate(), day: date.getDate(),
}); });
break; break;
case DynamicDateTimePane.Dynamic: case DynamicDateTimePane.Dynamic:
this.dynamicPane.setValue({ this.dynamicPane.setValue({
year: 0, year: 0,
}); });
break; break;
default: default:
break; break;
} }
this.fireEvent(DynamicDateTimePane.EVENT_CHANGE); this.fireEvent(DynamicDateTimePane.EVENT_CHANGE);
}, },
@ -103,92 +103,92 @@ export class DynamicDateTimePane extends Widget {
showIndex: DynamicDateTimePane.Static, showIndex: DynamicDateTimePane.Static,
cardCreator: v => { cardCreator: v => {
switch (v) { switch (v) {
case DynamicDateTimePane.Static: case DynamicDateTimePane.Static:
return { return {
type: StaticDateTimePaneCard.xtype, type: StaticDateTimePaneCard.xtype,
min: o.minDate, min: o.minDate,
max: o.maxDate, max: o.maxDate,
behaviors: o.behaviors, behaviors: o.behaviors,
listeners: [ listeners: [
{ {
eventName: "EVENT_CHANGE", eventName: "EVENT_CHANGE",
action: () => { action: () => {
this.fireEvent(DynamicDateTimePane.EVENT_CHANGE); this.fireEvent(DynamicDateTimePane.EVENT_CHANGE);
},
}, },
{
eventName: "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW",
action: () => {
this.fireEvent(DynamicDateTimePane.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW);
},
}
],
ref: _ref => {
this.ymd = _ref;
}, },
{ };
eventName: "EVENT_BEFORE_YEAR_MONTH_POPUPVIEW", case DynamicDateTimePane.Dynamic:
action: () => { default:
this.fireEvent(DynamicDateTimePane.EVENT_BEFORE_YEAR_MONTH_POPUPVIEW); return {
type: VTapeLayout.xtype,
items: [
{
type: DynamicDateCard.xtype,
min: o.minDate,
max: o.maxDate,
ref: _ref => {
this.dynamicPane = _ref;
},
}, },
} {
], el: {
ref: _ref => { type: CenterLayout.xtype,
this.ymd = _ref; items: [
}, {
}; type: TextButton.xtype,
case DynamicDateTimePane.Dynamic: cls: "bi-high-light bi-border-top",
default: shadow: true,
return { text: i18nText("BI-Basic_Clear"),
type: VTapeLayout.xtype, textHeight: 23,
items: [ listeners: [
{ {
type: DynamicDateCard.xtype, eventName: TextButton.EVENT_CHANGE,
min: o.minDate, action: () => {
max: o.maxDate, this.setValue();
ref: _ref => { this.fireEvent(DynamicDatePane.EVENT_CHANGE);
this.dynamicPane = _ref; },
}, }
}, ],
{ },
el: { {
type: CenterLayout.xtype, type: TextButton.xtype,
items: [ cls: "bi-border-left bi-high-light bi-border-top",
{ textHeight: 23,
type: TextButton.xtype, shadow: true,
cls: "bi-high-light bi-border-top", text: i18nText("BI-Basic_OK"),
shadow: true, listeners: [
text: i18nText("BI-Basic_Clear"), {
textHeight: 23, eventName: TextButton.EVENT_CHANGE,
listeners: [ action: () => {
{ const type = this.dateTab.getSelect();
eventName: TextButton.EVENT_CHANGE, if (type === DynamicDateCombo.Dynamic) {
action: () => { this.dynamicPane.checkValidation(true) &&
this.setValue();
this.fireEvent(DynamicDatePane.EVENT_CHANGE);
},
}
],
},
{
type: TextButton.xtype,
cls: "bi-border-left bi-high-light bi-border-top",
textHeight: 23,
shadow: true,
text: i18nText("BI-Basic_OK"),
listeners: [
{
eventName: TextButton.EVENT_CHANGE,
action: () => {
const type = this.dateTab.getSelect();
if (type === DynamicDateCombo.Dynamic) {
this.dynamicPane.checkValidation(true) &&
this.fireEvent( this.fireEvent(
DynamicDatePane.EVENT_CHANGE DynamicDatePane.EVENT_CHANGE
); );
} else { } else {
this.fireEvent(DynamicDatePane.EVENT_CHANGE); this.fireEvent(DynamicDatePane.EVENT_CHANGE);
} }
}, },
} }
], ],
} }
], ],
}, },
height: 24, height: 24,
} }
], ],
}; };
} }
}, },
} }
@ -206,11 +206,11 @@ export class DynamicDateTimePane extends Widget {
_checkValue(v) { _checkValue(v) {
switch (v.type) { switch (v.type) {
case DynamicDateCombo.Dynamic: case DynamicDateCombo.Dynamic:
return isNotEmptyObject(v.value); return isNotEmptyObject(v.value);
case DynamicDateCombo.Static: case DynamicDateCombo.Static:
default: default:
return true; return true;
} }
} }
@ -235,21 +235,21 @@ export class DynamicDateTimePane extends Widget {
this.switcher.setValue(type); this.switcher.setValue(type);
this.dateTab.setSelect(type); this.dateTab.setSelect(type);
switch (type) { switch (type) {
case DynamicDateTimePane.Dynamic: case DynamicDateTimePane.Dynamic:
this.dynamicPane.setValue(value); this.dynamicPane.setValue(value);
break; break;
case DynamicDateTimePane.Static: case DynamicDateTimePane.Static:
default: default:
if (this._checkValueValid(value)) { if (this._checkValueValid(value)) {
const date = getDate(); const date = getDate();
this.ymd.setValue({ this.ymd.setValue({
year: date.getFullYear(), year: date.getFullYear(),
month: date.getMonth() + 1, month: date.getMonth() + 1,
}); });
} else { } else {
this.ymd.setValue(value); this.ymd.setValue(value);
} }
break; break;
} }
} }

2
src/widget/dynamicdatetime/dynamicdatetime.timeselect.js

@ -113,7 +113,7 @@ export class DynamicDateTimeSelect extends Widget {
{ {
eventName: SignEditor.EVENT_CHANGE, eventName: SignEditor.EVENT_CHANGE,
action: () => { action: () => {
const value = this._autoSwitch(this.getValue(), DynamicDateTimeSelect.MINUTE); const value = this._autoSwitch(this.minute.getValue(), DynamicDateTimeSelect.MINUTE);
this.minute.setValue(value); this.minute.setValue(value);
}, },
} }

4
webpack/attachments.js

@ -6,6 +6,7 @@ const fixCompact = "./dist/fix/fix.compact.js";
const workerCompact = './dist/fix/worker.compact.js'; const workerCompact = './dist/fix/worker.compact.js';
const lodashJs = "src/core/1.lodash.js"; const lodashJs = "src/core/1.lodash.js";
const jqueryJs = "src/core/platform/web/jquery/_jquery.js"; const jqueryJs = "src/core/platform/web/jquery/_jquery.js";
const popperJs = "src/core/controller/popper.js";
const runtimePolyfill = ["@babel/polyfill", "es6-promise/auto"]; const runtimePolyfill = ["@babel/polyfill", "es6-promise/auto"];
@ -19,6 +20,8 @@ const basicAttachmentMap = {
"src/less/theme/**/*.less", "src/less/theme/**/*.less",
lodashJs, lodashJs,
jqueryJs, jqueryJs,
popperJs,
"src/bundle.js",
// "src/core/**/*.js", // "src/core/**/*.js",
// "src/data/**/*.js", // "src/data/**/*.js",
]), ]),
@ -238,7 +241,6 @@ const demo = [].concat(
basicAttachmentMap.core, basicAttachmentMap.core,
basicAttachmentMap.fix, basicAttachmentMap.fix,
basicAttachmentMap.config, basicAttachmentMap.config,
sync(["src/bundle.js"]),
basicAttachmentMap.base, basicAttachmentMap.base,
basicAttachmentMap.case, basicAttachmentMap.case,
basicAttachmentMap.widget, basicAttachmentMap.widget,

Loading…
Cancel
Save