Commit 65cc5e3253620ae44678dd4707ca2e4deecd0db5

Authored by ww
1 parent 721c38b4

feat: update page size options

... ... @@ -5027,6 +5027,30 @@ 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'
  5032 + const pageSizeControl = PageSetupDialog.getFormats
  5033 + PageSetupDialog.getFormats = function () {
  5034 + if (response.pageFlag === 'phone') {
  5035 + return [
  5036 + {key: 'iPhone 8', title: 'iPhone 8', format: new mxRectangle(0, 0, 375, 667)},
  5037 + {key: 'iPhone 8 Plus', title: 'iPhone 8 Plus', format: new mxRectangle(0, 0, 415, 737)},
  5038 + {key: 'iPhone X/XS', title: 'iPhone X/XS', format: new mxRectangle(0, 0, 376, 813)},
  5039 + {key: 'iPhone XR/XS Max', title: 'iPhone XR/XS Max', format: new mxRectangle(0, 0, 415, 897)},
  5040 + {key: 'iPad 4', title: 'iPad 4', format: new mxRectangle(0, 0, 709, 1025)},
  5041 + {key: 'Galaxy S9', title: 'Galaxy S9', format: new mxRectangle(0, 0, 361, 741)},
  5042 + {key: 'Galaxy S10E', title: 'Galaxy S10E', format: new mxRectangle(0, 0, 361, 741)},
  5043 + {key: 'Galaxy S10E', title: 'Galaxy S10E', format: new mxRectangle(0, 0, 361, 741)},
  5044 + {key: 'Galaxy S10/S10+', title: 'Galaxy S10/S10+', format: new mxRectangle(0, 0, 413, 870)},
  5045 + {key: 'Pixel 2', title: 'Pixel 2', format: new mxRectangle(0, 0, 413, 732)},
  5046 + {key: 'Pixel 3', title: 'Pixel 3', format: new mxRectangle(0, 0, 413, 825)},
  5047 + {key: 'Pixel 3', title: 'Pixel 3', format: new mxRectangle(0, 0, 413, 825)},
  5048 + {key: 'Pixel XL', title: 'Pixel XL', format: new mxRectangle(0, 0, 413, 848)},
  5049 + {key: 'custom', title: mxResources.get('custom'), format: null}
  5050 + ]
  5051 + }
  5052 + return pageSizeControl.apply(this, arguments)
  5053 + }
5030 5054 Editor.configurationName = response.configurationName + ".drawio";
5031 5055 if(response.configurationContentList.length > 0){
5032 5056 response.configurationContentList.forEach((item)=>{
... ...
... ... @@ -2065,6 +2065,15 @@ PageSetupDialog.addPageFormatPanel = function(div, namePostfix, pageFormat, page
2065 2065 */
2066 2066 PageSetupDialog.getFormats = function()
2067 2067 {
  2068 + // HACK thingsKit 页面尺寸控制
  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 + // ]
2068 2077 return [{key: 'letter', title: 'US-Letter (8,5" x 11")', format: mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},
2069 2078 {key: 'legal', title: 'US-Legal (8,5" x 14")', format: new mxRectangle(0, 0, 850, 1400)},
2070 2079 {key: 'tabloid', title: 'US-Tabloid (11" x 17")', format: new mxRectangle(0, 0, 1100, 1700)},
... ...