mirror of
https://gitee.com/ssssssss-team/magic-boot.git
synced 2026-05-15 00:00:02 +08:00
mb-list mb-form mb-xxx等 统一请求方法 列表(post) 保存(post) 删除(delete) 详情(get) 等
This commit is contained in:
@@ -38,7 +38,7 @@ common.handleDelete = (options) => {
|
||||
}).then(() => {
|
||||
request({
|
||||
url: url,
|
||||
method: 'post',
|
||||
method: 'delete',
|
||||
params: {
|
||||
id: id
|
||||
}
|
||||
@@ -167,4 +167,8 @@ common.loadConfig = async() => {
|
||||
})
|
||||
}
|
||||
|
||||
common.setDefaultValue = (obj, attr, value) => {
|
||||
obj[attr] = obj[attr] === undefined ? value : obj[attr]
|
||||
}
|
||||
|
||||
export default common
|
||||
|
||||
@@ -27,7 +27,7 @@ function appComponent(app, item){
|
||||
}
|
||||
|
||||
const install = (app) => {
|
||||
app.config.globalProperties.$get('/component/list', { size: 999999 }).then((res) => {
|
||||
app.config.globalProperties.$post('/component/list', { size: 999999 }).then((res) => {
|
||||
res.data.list.forEach(it => {
|
||||
appComponent(app, it)
|
||||
})
|
||||
|
||||
@@ -11,4 +11,4 @@ export default {
|
||||
filePrefix: '',
|
||||
visitedViews: reactive([]),
|
||||
tabValue: ref('')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import * as PlusIcons from '@element-plus/icons-vue'
|
||||
import VueUeditorWrap from 'vue-ueditor-wrap'
|
||||
import Treeselect from 'vue3-treeselect'
|
||||
import 'vue3-treeselect/dist/vue3-treeselect.css'
|
||||
import request from './request'
|
||||
import global from './global'
|
||||
import common from './common'
|
||||
@@ -19,6 +21,7 @@ const install = (app) => {
|
||||
}
|
||||
})
|
||||
app.config.globalProperties.$get = (url, data) => request({ url, params: data })
|
||||
app.config.globalProperties.$delete = (url, data) => request({ url, method: 'delete', params: data })
|
||||
app.config.globalProperties.$global = global
|
||||
app.config.globalProperties.$common = common
|
||||
app.config.globalProperties.$treeTable = treeTable
|
||||
@@ -26,5 +29,6 @@ const install = (app) => {
|
||||
app.component(`El${key}`, PlusIcons[key])
|
||||
}
|
||||
app.use(VueUeditorWrap)
|
||||
app.component('treeselect', Treeselect)
|
||||
}
|
||||
export default install
|
||||
|
||||
Reference in New Issue
Block a user