Commit d851c946 by chenwq

bug修复,common包来源修改

1 parent cd638a04
......@@ -9,16 +9,16 @@
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
import { Http, utils } from 'glsx-common'
// import { Http, utils } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
export const fetchConfig = function(isEnv = true, common) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
let params = { moduleName: 'commodity', mockUrl: 'http://oss-config.dev.glsx.com.cn/mock/64489a52ad0aa72e7cd2bd3d/commodity/config', env: 'test', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params)
return common.utils.getConfig(params)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res)
}
......
......@@ -14,7 +14,7 @@ Vue.use(GLTable)
Vue.use(GLTableButton)
Vue.use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig()
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig(false, common)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......
......@@ -134,6 +134,7 @@ export default {
},
mounted() {
this.keyDown()
this.routeInfo = this.$route.query
this.routeInfo.editType != 'add' ? this.getInfo() : ''
this.$utils.getOptionsList(this, 'editFormData', false)
......@@ -142,6 +143,17 @@ export default {
},
methods: {
keyDown() {
document.onkeydown = function () {
var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
if (typeof evt.stopPropagation == 'function') evt.stopPropagation()
return false
}
return true
}
},
getInfo() {
let params = {
upgradeGoodsId: this.routeInfo.info.upgradeGoodsId
......@@ -160,7 +172,7 @@ export default {
},
validateProduct(goodsCode) {
let isFlag = goodsCode != '太阳膜'
let AttrList = isFlag ? ['售价/元', '最低售价/元', '产品成本/元'] : ['产品类型','质保年限']
let AttrList = isFlag ? ['售价/元', '最低售价/元', '产品成本/元'] : ['产品类型', '质保年限']
this.changeFormAttr('editFormData', 'isHide', AttrList, false)
if (!isFlag)
return (val, attr) => {
......@@ -199,8 +211,8 @@ export default {
minSellPrice: '',
productCost: '',
warningValue: '',
giftCost:'',
warrantyPeriod:''
giftCost: '',
warrantyPeriod: ''
}
},
changeFormAttr(formName, attrName, labelList, attrValue) {
......@@ -279,7 +291,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => {})
.catch(() => { })
} else {
this.cancelJump()
}
......
......@@ -59,7 +59,7 @@ export default {
},
{
label: '所属系列',
prop: 'goodsCode',
prop: 'goodsCodeName',
width: '100'
},
{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!