Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
qiniu: {
bucket: 'd2p-demo',
getToken (custom) {
return request({
url: '/upload/qiniu/getToken',
method: 'get'
}).then(ret => {
return ret.data // {token:xxx,expires:xxx}
})
},
domain: 'http://d2p.file.veryreader.com'
}
})
// 自定义字段类型示例
d2CrudPlus.util.columnResolve.addTypes({
'time2': {
form: { component: { name: 'el-date-picker', props: { type: 'datetime' } } }, // 编辑时支持日期时间
search: { component: { props: { type: 'date' } } }, // 搜索时只支持日期
formatter (row, column, value, index) {
return value + '-->我是自定义字段类型:time2'
},
_handle (column) {
// 此方法主要将column中某些依赖的用户配置的属性放到默认配置中,比如数据字典的配置
if (column.dict != null) {
this.form.component.props.dict = column.dict
this.component.props.dict = column.dict
}
}
}
})
created () {
d2CrudPlus.util.dict.get(this.roomTypeDict).then((data) => {
this.roomTypes = data
})
d2CrudPlus.util.dict.get(this.roomStatusDict).then((data) => {
console.log('roomStatusDict:', data)
for (let item of data) {
this.roomStatuses[item.value] = item
}
this.$set(this.roomStatusDict, 'data', data)
this.loadData()
})
},
methods: {
created () {
d2CrudPlus.util.dict.get(this.roomTypeDict).then((data) => {
this.roomTypes = data
})
d2CrudPlus.util.dict.get(this.roomStatusDict).then((data) => {
console.log('roomStatusDict:', data)
for (let item of data) {
this.roomStatuses[item.value] = item
}
this.$set(this.roomStatusDict, 'data', data)
this.loadData()
})
},
methods: {