zan-choose-dialog
Advanced tools
Comparing version 4.5.7 to 4.5.8
@@ -24,2 +24,6 @@ 'use strict'; | ||
var _get = require('lodash/get'); | ||
var _get2 = _interopRequireDefault(_get); | ||
var _compatible = require('../compatible'); | ||
@@ -33,5 +37,3 @@ | ||
// 已上架商品 | ||
var NOT_SUPPORTTED_GOODS_TYPE = [10, 31, 35]; | ||
var NOT_SUPPORTTED_GOODS_TYPE = [10, 31, 35]; // 已上架商品 | ||
function getConfig(config) { | ||
@@ -49,2 +51,37 @@ var canSelectRow = function canSelectRow(data) { | ||
var isSuperStore = (0, _get2['default'])(config, 'isSuperStore', false); | ||
// 新建url,零售/微商城区分 | ||
var createGoodsUrl = isSuperStore ? (0, _url2['default'])('/goods/goods/shop#/add', 'store', config.url) : (0, _url2['default'])('/showcase/goods/edit', 'www', config.url); | ||
var actions = [{ | ||
type: 'button', | ||
align: 'left', | ||
label: '新建', | ||
href: createGoodsUrl, | ||
target: '_blank', | ||
rel: 'noopener noreferer' | ||
}, { | ||
type: 'button', | ||
align: 'left', | ||
label: '草稿管理', | ||
href: (0, _url2['default'])('/showcase/goods#list&is_display=0', 'www', config.url), | ||
target: '_blank', | ||
rel: 'noopener noreferer' | ||
}, { | ||
type: 'button', | ||
align: 'left', | ||
label: '刷新', | ||
onClick: function onClick(evt, context) { | ||
context.refresh(); | ||
} | ||
}, { | ||
type: 'search', | ||
align: 'right' | ||
}]; | ||
// 零售环境去掉草稿管理,因为零售没有草稿管理页面 | ||
if (isSuperStore) { | ||
actions.splice(1, 1); | ||
} | ||
return { | ||
@@ -134,29 +171,5 @@ title: '已上架商品', | ||
actions: [{ | ||
type: 'button', | ||
align: 'left', | ||
label: '新建', | ||
href: (0, _url2['default'])('/showcase/goods/edit', 'www', config.url), | ||
target: '_blank', | ||
rel: 'noopener noreferer' | ||
}, { | ||
type: 'button', | ||
align: 'left', | ||
label: '草稿管理', | ||
href: (0, _url2['default'])('/showcase/goods#list&is_display=0', 'www', config.url), | ||
target: '_blank', | ||
rel: 'noopener noreferer' | ||
}, { | ||
type: 'button', | ||
align: 'left', | ||
label: '刷新', | ||
onClick: function onClick(evt, context) { | ||
context.refresh(); | ||
} | ||
}, { | ||
type: 'search', | ||
align: 'right' | ||
}] | ||
actions: actions | ||
}; | ||
} | ||
module.exports = exports['default']; |
{ | ||
"name": "zan-choose-dialog", | ||
"version": "4.5.7", | ||
"version": "4.5.8", | ||
"description": "这是一个React组件", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
1223855
34232