- 新增 CuteProductLineSelect 组件API接口 - 重命名 SystemComponentController 为 CuteProductLineSelectProApi - 迁移部门选择数据源接口到新API路径 - 更新前端组件导入路径和API调用方式 - 修改 CuteDeptTree 组件分页大小限制 - 为文件上传组件添加上传方式配置选项 - 调整字典详情和定时任务模块的API导入路径
30 lines
798 B
JavaScript
30 lines
798 B
JavaScript
import Vue from 'vue'
|
|
import { get as getDictDetail } from '@/api/system/dict-detail'
|
|
|
|
export default class Dict {
|
|
constructor(dict) {
|
|
this.dict = dict
|
|
}
|
|
|
|
async init(names, completeCallback) {
|
|
if (names === undefined || name === null) {
|
|
throw new Error('need Dict names')
|
|
}
|
|
const ps = []
|
|
names.forEach(n => {
|
|
Vue.set(this.dict.dict, n, {})
|
|
Vue.set(this.dict.label, n, {})
|
|
Vue.set(this.dict, n, [])
|
|
ps.push(getDictDetail(n).then(data => {
|
|
this.dict[n].splice(0, 0, ...data.content)
|
|
data.content.forEach(d => {
|
|
Vue.set(this.dict.dict[n], d.value, d)
|
|
Vue.set(this.dict.label[n], d.value, d.label)
|
|
})
|
|
}))
|
|
})
|
|
await Promise.all(ps)
|
|
completeCallback()
|
|
}
|
|
}
|