16 changed files with 117 additions and 28 deletions
@ -1,5 +1,5 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="org.nl.wms.decision_manage.service.dao.mapper.StSectStrategyMapper"> |
|||
<mapper namespace="org.nl.wms.decision_manage.service.sectStrategy.dao.mapper.StSectStrategyMapper"> |
|||
|
|||
</mapper> |
|||
|
@ -0,0 +1,34 @@ |
|||
import Vue from 'vue' |
|||
import { tableEnum as getEnumDetail } from '@/views/system/dict/enumDetail' |
|||
|
|||
// tableEnums: ['st_ivt_bsrealstorattr#stor_name#stor_code'],
|
|||
export default class TableEnum { |
|||
constructor(tableEnum) { |
|||
this.tableEnum = tableEnum |
|||
} |
|||
|
|||
async init(names, completeCallback) { |
|||
if (names === undefined || name === null) { |
|||
throw new Error('need TableEnum names') |
|||
} |
|||
const ps = [] |
|||
names.forEach(n => { |
|||
const split = n.split('#') |
|||
const code = split[0] |
|||
const label = split[1] |
|||
const value = split[2] |
|||
Vue.set(this.tableEnum.tableEnum, code, {}) |
|||
Vue.set(this.tableEnum.label, code, {}) |
|||
Vue.set(this.tableEnum, code, []) |
|||
ps.push(getEnumDetail({ 'code': code, 'label': label, 'value': value }).then(data => { |
|||
this.tableEnum[code].splice(0, 0, ...data) |
|||
data.forEach(d => { |
|||
Vue.set(this.tableEnum.tableEnum[code], d.value, d) |
|||
Vue.set(this.tableEnum.label[code], d.value, d.label) |
|||
}) |
|||
})) |
|||
}) |
|||
await Promise.all(ps) |
|||
completeCallback() |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
import TableEnum from './TableEnum' |
|||
|
|||
const install = function(Vue) { |
|||
Vue.mixin({ |
|||
data() { |
|||
if (this.$options.tableEnums instanceof Array) { |
|||
const tableEnum = { |
|||
tableEnum: {}, |
|||
label: {} |
|||
} |
|||
return { |
|||
tableEnum |
|||
} |
|||
} |
|||
return {} |
|||
}, |
|||
created() { |
|||
if (this.$options.tableEnums instanceof Array) { |
|||
new TableEnum(this.tableEnum).init(this.$options.tableEnums, () => { |
|||
this.$nextTick(() => { |
|||
this.$emit('dictReady') |
|||
}) |
|||
}) |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
export default { install } |
@ -0,0 +1,22 @@ |
|||
import request from '@/utils/request' |
|||
|
|||
export function get(code) { |
|||
const params = { |
|||
code |
|||
} |
|||
return request({ |
|||
url: 'api/dict/getStatusEnum', |
|||
method: 'get', |
|||
params |
|||
}) |
|||
} |
|||
|
|||
export function tableEnum(params) { |
|||
return request({ |
|||
url: 'api/dict/getTableEnum', |
|||
method: 'get', |
|||
params |
|||
}) |
|||
} |
|||
|
|||
export default { get, tableEnum } |
Loading…
Reference in new issue