14 changed files with 94 additions and 15 deletions
-
6src/store/modules/user.js
-
53src/utils/runtimeSiteConfig.js
-
5src/views/modules/board/sopBoard.vue
-
6src/views/modules/board/sopBoard_old.vue
-
3src/views/modules/print/printPackageLabelNoPreview2.js
-
3src/views/modules/print/print_outBox_label.js
-
3src/views/modules/print/print_outBox_label0327.js
-
3src/views/modules/print/print_package_TCPlabel-NOOREVIEW.js
-
3src/views/modules/print/print_package_label-NOOREVIEW.js
-
3src/views/modules/print/print_package_label.js
-
5static/config/index-prod.js
-
5static/config/index-qa.js
-
5static/config/index-uat.js
-
6static/config/index.js
@ -0,0 +1,53 @@ |
|||
/** |
|||
* 运行时站点配置(由 static/config 合并后的 config/index.js 注入)- rqrq |
|||
* 未配置时使用与原硬编码一致的默认值,便于生产在 dist 中补全 SITE_CONFIG 项 |
|||
*/ |
|||
|
|||
const DEFAULT_PRINT_ASSET_BASE = 'http://192.168.2.172:80/print' |
|||
const DEFAULT_UPLOAD_BASE = 'http://192.168.2.172/upload/' |
|||
const DEFAULT_SOP_FILE_BASE = 'http://192.168.2.172/sopFile/' |
|||
|
|||
function getSiteConfig () { |
|||
return typeof window !== 'undefined' && window.SITE_CONFIG ? window.SITE_CONFIG : {} |
|||
} |
|||
|
|||
/** |
|||
* LODOP 打印图片根路径(不含末尾 /)- rqrq |
|||
* @returns {string} |
|||
*/ |
|||
export function getPrintAssetBaseUrl () { |
|||
const v = getSiteConfig().printAssetBaseUrl |
|||
if (v) { |
|||
return String(v).replace(/\/+$/, '') |
|||
} |
|||
return DEFAULT_PRINT_ASSET_BASE |
|||
} |
|||
|
|||
/** |
|||
* 拼接打印资源完整 URL - rqrq |
|||
* @param {string} pathSegment 文件名或相对路径片段 |
|||
* @returns {string} |
|||
*/ |
|||
export function buildPrintImageUrl (pathSegment) { |
|||
const base = getPrintAssetBaseUrl() |
|||
const seg = pathSegment == null ? '' : String(pathSegment) |
|||
return base + '/' + seg.replace(/^\//, '') |
|||
} |
|||
|
|||
/** |
|||
* 上传根路径(建议带末尾 /)- rqrq |
|||
* @returns {string} |
|||
*/ |
|||
export function getUploadBaseUrl () { |
|||
const v = getSiteConfig().uploadBaseUrl |
|||
return v || DEFAULT_UPLOAD_BASE |
|||
} |
|||
|
|||
/** |
|||
* SOP 文件根路径(建议带末尾 /)- rqrq |
|||
* @returns {string} |
|||
*/ |
|||
export function getSopFileBaseUrl () { |
|||
const v = getSiteConfig().sopFileBaseUrl |
|||
return v || DEFAULT_SOP_FILE_BASE |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue