Commit e1a46b7917110f8fbb7441834aa0f895dbfd6076

Authored by ww
1 parent 9aeadb7d

feat: implement select diffirent device page size

... ... @@ -5027,11 +5027,12 @@ App.prototype.loadFile = function (id, sameWindow, file, success, force) {
5027 5027 function getSaveContent() {
5028 5028 defHttp.get('/yt/configuration/center/getConfigurationInfo/'+Editor.configurationId)
5029 5029 .then(function (response) {
5030   - console.log(response)
5031   - response.pageFlag = 'phone'
  5030 + console.log({response})
  5031 + const { configurationContentList: [ data = {}] = [] } = response || {}
  5032 + const phoneFlag = data.platform
5032 5033 const pageSizeControl = PageSetupDialog.getFormats
5033 5034 PageSetupDialog.getFormats = function () {
5034   - if (response.pageFlag === 'phone') {
  5035 + if (phoneFlag === 'phone') {
5035 5036 return [
5036 5037 {key: 'iPhone 8', title: 'iPhone 8', format: new mxRectangle(0, 0, 375, 667)},
5037 5038 {key: 'iPhone 8 Plus', title: 'iPhone 8 Plus', format: new mxRectangle(0, 0, 415, 737)},
... ...
... ... @@ -2067,31 +2067,31 @@ PageSetupDialog.getFormats = function()
2067 2067 {
2068 2068 // HACK thingsKit 页面尺寸控制
2069 2069
2070   - // return [
2071   - // {key: '1920 * 1080', title: '1920 * 1080(推荐尺寸)', format: new mxRectangle(0, 0, 1080, 1920)},
2072   - // {key: '1060 * 520', title: '1060 * 520', format: new mxRectangle(0, 0, 520, 1060)},
2073   - // {key: '1440 * 900', title: '1440 * 900', format: new mxRectangle(0, 0, 900, 1440)},
2074   - // {key: '1366 * 768', title: '1366* 768', format: new mxRectangle(0, 0, 768, 1366)},
2075   - // {key: 'custom', title: mxResources.get('custom'), format: null}
2076   - // ]
2077   - return [{key: 'letter', title: 'US-Letter (8,5" x 11")', format: mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},
2078   - {key: 'legal', title: 'US-Legal (8,5" x 14")', format: new mxRectangle(0, 0, 850, 1400)},
2079   - {key: 'tabloid', title: 'US-Tabloid (11" x 17")', format: new mxRectangle(0, 0, 1100, 1700)},
2080   - {key: 'executive', title: 'US-Executive (7" x 10")', format: new mxRectangle(0, 0, 700, 1000)},
2081   - {key: 'a0', title: 'A0 (841 mm x 1189 mm)', format: new mxRectangle(0, 0, 3300, 4681)},
2082   - {key: 'a1', title: 'A1 (594 mm x 841 mm)', format: new mxRectangle(0, 0, 2339, 3300)},
2083   - {key: 'a2', title: 'A2 (420 mm x 594 mm)', format: new mxRectangle(0, 0, 1654, 2336)},
2084   - {key: 'a3', title: 'A3 (297 mm x 420 mm)', format: new mxRectangle(0, 0, 1169, 1654)},
2085   - {key: 'a4', title: 'A4 (210 mm x 297 mm)', format: mxConstants.PAGE_FORMAT_A4_PORTRAIT},
2086   - {key: 'a5', title: 'A5 (148 mm x 210 mm)', format: new mxRectangle(0, 0, 583, 827)},
2087   - {key: 'a6', title: 'A6 (105 mm x 148 mm)', format: new mxRectangle(0, 0, 413, 583)},
2088   - {key: 'a7', title: 'A7 (74 mm x 105 mm)', format: new mxRectangle(0, 0, 291, 413)},
2089   - {key: 'b4', title: 'B4 (250 mm x 353 mm)', format: new mxRectangle(0, 0, 980, 1390)},
2090   - {key: 'b5', title: 'B5 (176 mm x 250 mm)', format: new mxRectangle(0, 0, 690, 980)},
2091   - {key: '16-9', title: '16:9 (1600 x 900)', format: new mxRectangle(0, 0, 900, 1600)},
2092   - {key: '16-10', title: '16:10 (1920 x 1200)', format: new mxRectangle(0, 0, 1200, 1920)},
2093   - {key: '4-3', title: '4:3 (1600 x 1200)', format: new mxRectangle(0, 0, 1200, 1600)},
2094   - {key: 'custom', title: mxResources.get('custom'), format: null}];
  2070 + return [
  2071 + {key: '1920 * 1080', title: '1920 * 1080(推荐尺寸)', format: new mxRectangle(0, 0, 1080, 1920)},
  2072 + {key: '1060 * 520', title: '1060 * 520', format: new mxRectangle(0, 0, 520, 1060)},
  2073 + {key: '1440 * 900', title: '1440 * 900', format: new mxRectangle(0, 0, 900, 1440)},
  2074 + {key: '1366 * 768', title: '1366* 768', format: new mxRectangle(0, 0, 768, 1366)},
  2075 + {key: 'custom', title: mxResources.get('custom'), format: null}
  2076 + ]
  2077 + // return [{key: 'letter', title: 'US-Letter (8,5" x 11")', format: mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},
  2078 + // {key: 'legal', title: 'US-Legal (8,5" x 14")', format: new mxRectangle(0, 0, 850, 1400)},
  2079 + // {key: 'tabloid', title: 'US-Tabloid (11" x 17")', format: new mxRectangle(0, 0, 1100, 1700)},
  2080 + // {key: 'executive', title: 'US-Executive (7" x 10")', format: new mxRectangle(0, 0, 700, 1000)},
  2081 + // {key: 'a0', title: 'A0 (841 mm x 1189 mm)', format: new mxRectangle(0, 0, 3300, 4681)},
  2082 + // {key: 'a1', title: 'A1 (594 mm x 841 mm)', format: new mxRectangle(0, 0, 2339, 3300)},
  2083 + // {key: 'a2', title: 'A2 (420 mm x 594 mm)', format: new mxRectangle(0, 0, 1654, 2336)},
  2084 + // {key: 'a3', title: 'A3 (297 mm x 420 mm)', format: new mxRectangle(0, 0, 1169, 1654)},
  2085 + // {key: 'a4', title: 'A4 (210 mm x 297 mm)', format: mxConstants.PAGE_FORMAT_A4_PORTRAIT},
  2086 + // {key: 'a5', title: 'A5 (148 mm x 210 mm)', format: new mxRectangle(0, 0, 583, 827)},
  2087 + // {key: 'a6', title: 'A6 (105 mm x 148 mm)', format: new mxRectangle(0, 0, 413, 583)},
  2088 + // {key: 'a7', title: 'A7 (74 mm x 105 mm)', format: new mxRectangle(0, 0, 291, 413)},
  2089 + // {key: 'b4', title: 'B4 (250 mm x 353 mm)', format: new mxRectangle(0, 0, 980, 1390)},
  2090 + // {key: 'b5', title: 'B5 (176 mm x 250 mm)', format: new mxRectangle(0, 0, 690, 980)},
  2091 + // {key: '16-9', title: '16:9 (1600 x 900)', format: new mxRectangle(0, 0, 900, 1600)},
  2092 + // {key: '16-10', title: '16:10 (1920 x 1200)', format: new mxRectangle(0, 0, 1200, 1920)},
  2093 + // {key: '4-3', title: '4:3 (1600 x 1200)', format: new mxRectangle(0, 0, 1200, 1600)},
  2094 + // {key: 'custom', title: mxResources.get('custom'), format: null}];
2095 2095 };
2096 2096
2097 2097 /**
... ...