UNPKG

@aliretail/cuckoo-official-retailforce-form-combo

Version:
270 lines (265 loc) 6.06 kB
"use strict"; exports.__esModule = true; exports.tableList = exports.modeData = exports.host = exports.defaultImage = exports.cHost = exports.API = void 0; var host = window.__b_apiHost__ || "https://" + location.host; exports.host = host; var cHost = window.__c_apiHost__; exports.cHost = cHost; var API = { materialSearchURL: host + "/mall-portal/material/search", // 树形结构内容渲染接口 dirQueryURL: host + "/mall-portal/materialDir/query", // 获取上传oss信息的api的url getOssSignature: host + "/mall-portal/material/sign", uploadCallback: host + "/mall-portal/material/sign/callback", // 素材创建 materialCreate: host + "/mall-portal/material/create", // 目录创建 createMaterialDir: host + "/mall-portal/materialDir/create", // 目录删除 deleteMaterialDir: host + "/mall-portal/materialDir/delete", // 移动分组 changeMaterialDir: host + "/mall-portal/materialDir/transfer", // 目录更新 updateMaterialDir: host + "/mall-portal/materialDir/update" }; exports.API = API; var defaultImage = "https://img.alicdn.com/tfs/TB19MRkiSslXu8jSZFuXXXg7FXa-168-168.png"; exports.defaultImage = defaultImage; var tableList = { "1-2": { row: 3, col: 6, cell: 32, size: 2 }, // '1-3': { row: 2, col: 6, cell: 32, size: 3 }, // '1-4': { row: 1, col: 4, cell: 48, size: 4 }, "2-4": { row: 4, col: 6, cell: 32, size: 4 }, "l1-r2": { row: 3, col: 6, cell: 32, size: 3 }, // 't1-b2': { row: 6, col: 6, cell: 32, size: 3 }, // 'l1-r3': { row: 6, col: 6, cell: 32, size: 4 }, custom: { row: 6, col: 6, cell: 32 } }; exports.tableList = tableList; var baseSize = 32; // count: 格子数 // index:当前第几个 var calcSize = function calcSize(mode, index) { var layout = 6; var base = baseSize * (layout / mode); return { w: base, h: base, x: index * (base - 1), y: 0 }; }; // 拼图内置模板 var modeData = { // 一行两个 "1-2": [{ x: 0, y: 0, width: baseSize * 3, height: baseSize * 3, id: "OgsMqd1kM", tips: "360" }, { x: baseSize * 3 - 1, y: 0, width: baseSize * 3, height: baseSize * 3, id: "bN_iNWcqb", tips: "360" }], // 一行3个 // '1-3': [ // { // "x": 0, // "y": 0, // "width": baseSize * 2, // "height": baseSize * 2, // 'tips': '250', // "id": "fYpvqO_9L" // }, // { // "x": baseSize * 2 - 1, // "y": 0, // "width": 64, // "height": 64, // 'tips': '250', // "id": "dbGfgvHUc" // }, // { // "x": (baseSize * 2 - 1) * 2, // "y": 0, // "width": baseSize * 2, // "height": baseSize * 2, // 'tips': '250', // "id": "39qXcFF2O" // } // ], // 一行四个 // '1-4': [ // { // "x": 0, // "y": 0, // "width": baseSize * 1.5, // "height": baseSize * 1.5, // 'tips': '188', // "id": "qjD4uetTa" // }, // { // "x": baseSize * 1.5 - 1, // "y": 0, // "width": baseSize * 1.5, // "height": baseSize * 1.5, // 'tips': '188', // "id": "iSQMPMJrj" // }, // { // "x": (baseSize * 1.5 - 1) * 2, // "y": 0, // "width": baseSize * 1.5, // "height": baseSize * 1.5, // 'tips': '188', // "id": "ZVU7Gzn5o" // }, // { // "x": (baseSize * 1.5 - 1) * 3, // "y": 0, // "width": baseSize * 1.5, // "height": baseSize * 1.5, // 'tips': '188', // "id": "CxUolk0UH" // } // ], // 24"2-4": [{ x: 0, y: 0, width: baseSize * 3, height: baseSize * 2, tips: "360 * 240", id: "QECH_WVeJ" }, { x: baseSize * 3 - 1, y: 0, width: baseSize * 3, height: baseSize * 2, tips: "360 * 240", id: "pwcEL-JNi" }, { x: 0, y: baseSize * 2 - 1, width: baseSize * 3, height: baseSize * 2 + 1, tips: "360 * 240", id: "uw1IXgwWE" }, { x: baseSize * 3 - 1, y: baseSize * 2 - 1, width: baseSize * 3, height: baseSize * 2 + 1, tips: "360 * 240", id: "dEyODD4EI" }], //12 "l1-r2": [{ x: 0, y: 0, width: baseSize * 3, height: baseSize * 3, tips: "360", id: "B3Mr8_ggI" }, { x: baseSize * 3 - 1, y: 0, width: baseSize * 3, height: baseSize * 1.5, tips: "360 * 180", id: "rwZp8TOhA" }, { x: baseSize * 3 - 1, y: baseSize * 1.5 - 1, width: baseSize * 3, height: baseSize * 1.5 + 1, tips: "360 * 180", id: "jHOlWhInj" }] // 上一下二 // 't1-b2': [ // { // "x": 0, // "y": 0, // "width": baseSize * 6, // "height": baseSize * 3, // 'tips': '750 x 375', // "id": "nDubaU3SC" // }, // { // "x": 0, // "y": baseSize * 3 - 1, // "width": baseSize * 3 + 1, // "height": baseSize * 3, // 'tips': '375', // "id": "aiQSOWj-p" // }, // { // "x": baseSize * 3, // "y": baseSize * 3 - 1, // "width": baseSize * 3, // "height": baseSize * 3, // 'tips': '375', // "id": "iippMo8tr" // } // ], // 左一右三 // 'l1-r3': [ // { // "x": 0, // "y": 0, // "width": baseSize * 3 + 1, // "height": baseSize * 6, // 'tips': '375 x 750', // "id": "VcjiSEj-2" // }, // { // "x": baseSize * 3, // "y": 0, // "width": baseSize * 3, // "height": baseSize * 3 + 1, // 'tips': '375', // "id": "USj0ZSTTZ" // }, // { // "x": baseSize * 3, // "y": baseSize * 3, // "width": baseSize * 1.5 + 1, // "height": baseSize * 3, // 'tips': '188\nx\n375', // "id": "YH288lyeP" // }, // { // "x": baseSize * 4.5, // "y": baseSize * 3, // "width": baseSize * 1.5, // "height": baseSize * 3, // 'tips': '188\nx\n375', // "id": "GQyR_OtLL" // } // ], }; exports.modeData = modeData;