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

230
src/widget/datetimepane/datetimepane.js

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

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

@ -113,7 +113,7 @@ export class DynamicDateTimeSelect extends Widget {
{
eventName: SignEditor.EVENT_CHANGE,
action: () => {
const value = this._autoSwitch(this.getValue(), DynamicDateTimeSelect.MINUTE);
const value = this._autoSwitch(this.minute.getValue(), DynamicDateTimeSelect.MINUTE);
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 lodashJs = "src/core/1.lodash.js";
const jqueryJs = "src/core/platform/web/jquery/_jquery.js";
const popperJs = "src/core/controller/popper.js";
const runtimePolyfill = ["@babel/polyfill", "es6-promise/auto"];
@ -19,6 +20,8 @@ const basicAttachmentMap = {
"src/less/theme/**/*.less",
lodashJs,
jqueryJs,
popperJs,
"src/bundle.js",
// "src/core/**/*.js",
// "src/data/**/*.js",
]),
@ -238,7 +241,6 @@ const demo = [].concat(
basicAttachmentMap.core,
basicAttachmentMap.fix,
basicAttachmentMap.config,
sync(["src/bundle.js"]),
basicAttachmentMap.base,
basicAttachmentMap.case,
basicAttachmentMap.widget,

Loading…
Cancel
Save