refactor: 修改请求实例,把axios实例挂载到vue对象上

main
wu.jian2 2 years ago
parent 26842aa4bb
commit ca4a79e742

@ -9,11 +9,11 @@ import store from './store'
import router from './router'
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/styles/index.scss'
import * as $dataRoomAxios from 'data-room-ui/js/utils/http.js'
import { registerConfig } from '@gcpaas/data-room-ui'
import remoteComponents from '@/remoteComponents/exports.js'
import customDatasetComponents from '@/customDatasetComponents/exports.js'
Vue.use(ElementUI, { size: 'mini' })
registerConfig(
{
routers: {
@ -62,6 +62,7 @@ registerConfig(
promise.polyfill()
// 自定义指令
Vue.use(ElementUI, { size: 'mini' })
Vue.prototype.$dataRoomAxios = $dataRoomAxios
Vue.config.productionTip = false
/* eslint-disable no-new */

@ -423,7 +423,7 @@ export default {
},
getDataList () {
this.loading = true
get('/bigScreen/design/page', {
this.$dataRoomAxios.get('/bigScreen/design/page', {
parentCode: this.code || null,
current: this.current,
size: this.size,

@ -122,7 +122,7 @@ export default {
}]
: []
this.hideUploadImgBtn = this.fileList.length !== 0
get('/bigScreen/design/bg/list').then(list => {
this.$dataRoomAxios.get('/bigScreen/design/bg/list').then(list => {
this.bgImgList = list
})
},

@ -365,7 +365,6 @@ export default {
this.pageInfo.pageConfig.refreshConfig = []
}
this.form = { ...this.pageInfo.pageConfig }
console.log('this.form', this.form)
this.drawerVisible = true
if (this.pageInfo.chartList.length === 0) {
this.pageInfo.pageConfig.refreshConfig = []

@ -186,7 +186,7 @@ export default {
},
getDataList () {
this.loading = true
get('/bigScreen/file', {
this.$dataRoomAxios.get('/bigScreen/file', {
module: this.code,
current: this.current,
size: this.size,
@ -203,7 +203,7 @@ export default {
},
//
getCatalogList () {
get('/bigScreen/type/list/resourceCatalog')
this.$dataRoomAxios.get('/bigScreen/type/list/resourceCatalog')
.then((data) => {
this.options = data
})

@ -275,7 +275,7 @@ export default {
]),
//
permission () {
get(`/bigScreen/permission/check/${this.pageCode}`).then(res => {
this.$dataRoomAxios.get(`/bigScreen/permission/check/${this.pageCode}`).then(res => {
this.hasPermission = res
if (res) {
this.init()

@ -134,8 +134,8 @@
</template>
<script>
import { get, post } from 'data-room-ui/js/utils/http'
import Icon from 'data-room-ui/assets/images/dataSourceIcon/export'
// import { get, post } from 'data-room-ui/js/utils/http'
// import Icon from 'data-room-ui/assets/images/dataSourceIcon/export'
import _ from 'lodash'
export default {
name: 'CatalogEditForm',
@ -185,7 +185,7 @@ export default {
},
//
getCatalogList () {
get(`/bigScreen/type/list/${this.catalogType}`)
this.$dataRoomAxios.get(`/bigScreen/type/list/${this.catalogType}`)
.then((data) => {
this.tableList = data
})
@ -198,7 +198,7 @@ export default {
return
}
if (!this.currentCatalog.id) {
post('/bigScreen/type/add',
this.$dataRoomAxios.post('/bigScreen/type/add',
{
...this.currentCatalog,
type: this.catalogType
@ -208,7 +208,7 @@ export default {
}).catch(() => {
})
} else {
post('/bigScreen/type/update', { ...this.currentCatalog, type: this.type || 'bigScreenCatalog' }).then(data => {
this.$dataRoomAxios('/bigScreen/type/update', { ...this.currentCatalog, type: this.type || 'bigScreenCatalog' }).then(data => {
this.catalogVisible = false
this.getCatalogList()
}).catch(() => {
@ -236,7 +236,7 @@ export default {
type: 'warning',
customClass: 'bs-el-message-box'
}).then(async () => {
post(`/bigScreen/type/delete/${catalog.id}`).then(() => {
this.$dataRoomAxios.post(`/bigScreen/type/delete/${catalog.id}`).then(() => {
this.$message({
type: 'success',
message: '删除成功'

@ -110,7 +110,7 @@
</template>
<script>
import { get, post } from 'data-room-ui/js/utils/http'
// import { get, post } from 'data-room-ui/js/utils/http'
import Icon from 'data-room-ui/assets/images/dataSourceIcon/export'
export default {
name: 'EditForm',
@ -226,7 +226,7 @@ export default {
this.formVisible = true
this.$nextTick(() => {
if (code) {
get(`/bigScreen/design/info/code/${code}`).then((resp) => {
this.$dataRoomAxios.get(`/bigScreen/design/info/code/${code}`).then((resp) => {
this.$set(this, 'title', resp.name)
this.$set(this.dataForm, 'name', resp.name)
this.$set(this.dataForm, 'chartList', resp.chartList)
@ -284,8 +284,8 @@ export default {
return
}
const addOrUpdateHandel = !this.dataForm.code
? (form) => post('/bigScreen/design/add', form)
: (form) => post('/bigScreen/design/update', form)
? (form) => this.$dataRoomAxios.post('/bigScreen/design/add', form)
: (form) => this.$dataRoomAxios.post('/bigScreen/design/update', form)
const form = {
className: 'com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO',
chartList: this.dataForm.chartList,

@ -213,7 +213,7 @@ export default {
methods: {
getDataList () {
this.loading = true
get('/bigScreen/design/page', {
this.$dataRoomAxios.get('/bigScreen/design/page', {
parentCode: this.code || null,
current: this.current,
size: this.size,
@ -265,7 +265,7 @@ export default {
customClass: 'bs-el-message-box'
})
.then(async () => {
post(`/bigScreen/design/delete/${screen.code}`)
this.$dataRoomAxios.post(`/bigScreen/design/delete/${screen.code}`)
.then(() => {
this.$message({
type: 'success',
@ -290,7 +290,7 @@ export default {
customClass: 'bs-el-message-box'
})
.then(async () => {
post(`/bigScreen/design/copy/${screen.code}`)
this.$dataRoomAxios.post(`/bigScreen/design/copy/${screen.code}`)
.then(() => {
this.$message({
type: 'success',

@ -111,7 +111,7 @@
</div>
</template>
<script>
import { get, post } from '../../packages/js/utils/http'
// import { get, post } from '../../packages/js/utils/http'
import _ from 'lodash'
export default {
@ -182,7 +182,7 @@ export default {
return
}
if (!this.currentCatalog.id) {
post('/bigScreen/type/add',
this.$dataRoomAxios.post('/bigScreen/type/add',
{
...this.currentCatalog,
type: this.type || 'bigScreenCatalog'
@ -195,7 +195,7 @@ export default {
}).catch(() => {
})
} else {
post('/bigScreen/type/update', { ...this.currentCatalog, type: this.type || 'bigScreenCatalog' }).then(data => {
this.$dataRoomAxios.post('/bigScreen/type/update', { ...this.currentCatalog, type: this.type || 'bigScreenCatalog' }).then(data => {
this.catalogVisible = false
this.getCatalogList()
}).catch(() => {
@ -225,7 +225,7 @@ export default {
type: 'warning',
customClass: 'bs-el-message-box'
}).then(async () => {
post(`/bigScreen/type/delete/${catalog.id}`).then(() => {
this.$dataRoomAxios.post(`/bigScreen/type/delete/${catalog.id}`).then(() => {
this.$message({
type: 'success',
message: '删除成功'
@ -242,7 +242,7 @@ export default {
//
getCatalogList () {
this.pageLoading = true
get(`/bigScreen/type/list/${this.type}`).then(data => {
this.$dataRoomAxios.get(`/bigScreen/type/list/${this.type}`).then(data => {
this.catalogList = data
}).catch(() => {
}).finally(() => {

@ -268,7 +268,7 @@ export default {
},
//
openCascader () {
post('/bigScreen/category/tree', { searchKey: '', typeList: ['catalog'], sort: false }).then(data => {
this.$dataRoomAxios.post('/bigScreen/category/tree', { searchKey: '', typeList: ['catalog'], sort: false }).then(data => {
const list = [{ name: '根目录', code: '', children: data }]
this.catalogList = list
}).catch(() => {
@ -290,7 +290,7 @@ export default {
this.$nextTick(() => {
if (this.dataForm.type === 'bigScreen') {
if (code) {
get(`/${this.dataForm.type}/design/info/code/${code}`).then((resp) => {
this.$dataRoomAxios.get(`/${this.dataForm.type}/design/info/code/${code}`).then((resp) => {
this.$set(this, 'title', resp.name)
this.$set(this.dataForm, 'name', resp.name)
this.$set(this.dataForm, 'chartList', resp.chartList)
@ -347,8 +347,8 @@ export default {
return
}
const addOrUpdateHandel = !this.dataForm.code
? (form) => post('/bigScreen/design/add', form)
: (form) => post('/bigScreen/design/update', form)
? (form) => this.$dataRoomAxios.post('/bigScreen/design/add', form)
: (form) => this.$dataRoomAxios.post('/bigScreen/design/update', form)
const form = {
className: 'com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO',
chartList: this.dataForm.chartList,

@ -240,7 +240,7 @@ import Icon from 'data-room-ui/assets/images/pageIcon/export'
import { getPageType } from './utils'
import _ from 'lodash'
// import axios from 'axios'
import { post } from 'data-room-ui/js/utils/http'
// import { post } from 'data-room-ui/js/utils/http'
import IconSvg from 'data-room-ui/SvgIcon'
let dashBoardPageCode = null
export default {
@ -363,7 +363,7 @@ export default {
//
openCascader (node) {
const excludeCategory = node.type === 'catalog' && !this.isAdd ? node.code : undefined
post('/bigScreen/category/tree', { searchKey: '', typeList: ['catalog'], excludeCategory, sort: false }).then(data => {
this.$dataRoomAxios.post('/bigScreen/category/tree', { searchKey: '', typeList: ['catalog'], excludeCategory, sort: false }).then(data => {
const list = [{ name: '根目录', code: '', children: data }]
this.catalogList = list
}).catch(() => {
@ -476,7 +476,7 @@ export default {
// ()
getDataList () {
this.pageLoading = true
post('/bigScreen/category/tree', { searchKey: this.searchKey, sort: this.sort }).then(data => {
this.$dataRoomAxios.post('/bigScreen/category/tree', { searchKey: this.searchKey, sort: this.sort }).then(data => {
this.pageDesignList = data
// addModel
if (this.$route.query.add) {
@ -574,7 +574,7 @@ export default {
// },
//
copyPege (nodeData, node) {
post(`/${nodeData.type}/design/copy/${nodeData.code}`).then(() => {
this.$dataRoomAxios.post(`/${nodeData.type}/design/copy/${nodeData.code}`).then(() => {
this.getDataList()
})
},
@ -587,7 +587,7 @@ export default {
useIt (pageTemplateId, parentNode, type) {
this.templateLoading = true
const className = 'com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO'
post(`/bigScreen/${type}/design/add/template`, {
this.$dataRoomAxios.post(`/bigScreen/${type}/design/add/template`, {
pageTemplateId,
parentCode: parentNode.code,
type,
@ -659,7 +659,7 @@ export default {
return
}
if (this.isAdd) {
post('/bigScreen/category/add',
this.$dataRoomAxios.post('/bigScreen/category/add',
{
...this.catalogData,
id: '',
@ -673,7 +673,7 @@ export default {
}).catch(() => {
})
} else {
post('/bigScreen/category/update', { ...this.catalogData, excludeCategory: this.catalogData.code }).then(data => {
this.$dataRoomAxios.post('/bigScreen/category/update', { ...this.catalogData, excludeCategory: this.catalogData.code }).then(data => {
this.catalogVisible = false
this.getDataList()
}).catch(() => {
@ -691,7 +691,7 @@ export default {
type: 'warning',
customClass: 'bs-el-message-box'
}).then(async () => {
post(url).then(() => {
this.$dataRoomAxios.post(url).then(() => {
this.$message({
type: 'success',
message: '删除成功'

@ -143,20 +143,6 @@ export default {
}
}
},
// beforeRouteEnter (to, from, next) {
// // 访
// const code = to.query.code
// get(`/bigScreen/permission/check/${code}`).then(res => {
// if (res) {
// next(vm => {
// // vuex store
// vm.$store.commit('bigScreen/resetStoreData')
// })
// } else {
// next('/notPermission')
// }
// })
// },
beforeRouteLeave (to, from, next) {
// vuex store
this.$store.commit('bigScreen/resetStoreData')
@ -186,7 +172,7 @@ export default {
'changeChartConfig'
]),
permission () {
get(`/bigScreen/permission/check/${this.pageCode}`).then(res => {
this.$dataRoomAxios.get(`/bigScreen/permission/check/${this.pageCode}`).then(res => {
this.hasPermission = res
if (res) {
this.init()

@ -136,7 +136,7 @@
</template>
<script>
import { get, post } from 'data-room-ui/js/utils/http'
// import { get, post } from 'data-room-ui/js/utils/http'
export default {
name: 'CatalogEditForm',
components: {
@ -180,7 +180,7 @@ export default {
},
//
getCatalogList () {
get(`/bigScreen/type/list/${this.catalogType}`)
this.$dataRoomAxios.get(`/bigScreen/type/list/${this.catalogType}`)
.then((data) => {
this.tableList = data
this.dataList = data
@ -195,7 +195,7 @@ export default {
return
}
if (!this.currentCatalog.id) {
post('/bigScreen/type/add',
this.$dataRoomAxios.post('/bigScreen/type/add',
{
...this.currentCatalog,
type: this.catalogType
@ -205,7 +205,7 @@ export default {
}).catch(() => {
})
} else {
post('/bigScreen/type/update', { ...this.currentCatalog, type: this.catalogType }).then(data => {
this.$dataRoomAxios.post('/bigScreen/type/update', { ...this.currentCatalog, type: this.catalogType }).then(data => {
this.catalogVisible = false
this.getCatalogList()
}).catch(() => {
@ -233,7 +233,7 @@ export default {
type: 'warning',
customClass: 'bs-el-message-box'
}).then(async () => {
post(`/bigScreen/type/delete/${catalog.id}`).then(() => {
this.$dataRoomAxios.post(`/bigScreen/type/delete/${catalog.id}`).then(() => {
this.$message({
type: 'success',
message: '删除成功'

@ -113,7 +113,7 @@
</template>
<script>
import { get, post } from 'data-room-ui/js/utils/http'
// import { get, post } from 'data-room-ui/js/utils/http'
import Icon from 'data-room-ui/assets/images/dataSourceIcon/export'
export default {
name: 'EditForm',
@ -236,7 +236,7 @@ export default {
this.formVisible = true
this.$nextTick(() => {
if (code) {
get(`/bigScreen/bizComponent/info/${code}`).then((resp) => {
this.$dataRoomAxios.get(`/bigScreen/bizComponent/info/${code}`).then((resp) => {
this.$set(this, 'title', resp.name)
this.$set(this.dataForm, 'name', resp.name)
this.$set(this.dataForm, 'code', resp.code)
@ -259,7 +259,7 @@ export default {
this.formVisible = true
this.$nextTick(() => {
if (code) {
get(`/bigScreen/design/info/code/${code}`).then((resp) => {
this.$dataRoomAxios.get(`/bigScreen/design/info/code/${code}`).then((resp) => {
this.$set(this, 'title', resp.name)
this.$set(this.dataForm, 'name', resp.name)
this.$set(this.dataForm, 'chartList', resp.chartList)
@ -321,8 +321,8 @@ export default {
return
}
const addOrUpdateHandel = !this.dataForm.code
? (form) => post('/bigScreen/bizComponent/add', form)
: (form) => post('/bigScreen/bizComponent/update', form)
? (form) => this.$dataRoomAxios.post('/bigScreen/bizComponent/add', form)
: (form) => this.$dataRoomAxios.post('/bigScreen/bizComponent/update', form)
const form = {
className: 'com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO',
id: this.dataForm.id,
@ -369,8 +369,8 @@ export default {
return
}
const addOrUpdateHandel = !this.dataForm.code
? (form) => post('/bigScreen/design/add', form)
: (form) => post('/bigScreen/design/update', form)
? (form) => this.$dataRoomAxios.post('/bigScreen/design/add', form)
: (form) => this.$dataRoomAxios.post('/bigScreen/design/update', form)
const form = {
className: 'com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO',
chartList: this.dataForm.chartList,

@ -283,7 +283,7 @@ export default {
},
//
getCatalogList () {
get(`/bigScreen/type/list/${this.catalogType}`)
this.$dataRoomAxios.get(`/bigScreen/type/list/${this.catalogType}`)
.then((data) => {
this.catalogList = data
})
@ -292,7 +292,7 @@ export default {
getDataList () {
this.loading = true
if (this.catalogInfo === 'component') {
get('/bigScreen/design/page', {
this.$dataRoomAxios.get('/bigScreen/design/page', {
parentCode: this.catalogCode || null,
current: this.current,
size: this.size,
@ -307,7 +307,7 @@ export default {
this.loading = false
})
} else {
get('/bigScreen/bizComponent/page', {
this.$dataRoomAxios.get('/bigScreen/bizComponent/page', {
current: this.current,
size: this.size,
// searchKey: this.searchKey,

@ -61,6 +61,7 @@ export default {
]
}).then(() => {
//
// eslint-disable-next-line no-undef
this.map = new AMap.Map(`map-${this.config.code}`, {
resizeEnable: true, //
lang: this.customize.lang,
@ -72,12 +73,16 @@ export default {
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.MapType', 'AMap.Geolocation']
})
this.loading = false
// eslint-disable-next-line no-undef
this.map.addControl(new AMap.ToolBar())
//
// eslint-disable-next-line no-undef
this.map.addControl(new AMap.Scale())
//
// eslint-disable-next-line no-undef
this.map.addControl(new AMap.MapType())
//
// eslint-disable-next-line no-undef
this.map.addControl(new AMap.Geolocation())
let marker = null //
if (this.customize.markerSpan) {
@ -104,9 +109,11 @@ export default {
this.map.remove(marker)
}
//
// eslint-disable-next-line no-undef
marker = new AMap.Marker({
position: [this.customize.markerLng, this.customize.markerLat],
content: markerContent,
// eslint-disable-next-line no-undef
offset: new AMap.Pixel(0, 0) // 使
})

@ -110,7 +110,7 @@
</template>
<script>
import { get, post } from 'data-room-ui/js/utils/http'
// import { get, post } from 'data-room-ui/js/utils/http'
import Icon from 'data-room-ui/assets/images/dataSourceIcon/export'
export default {
name: 'EditForm',
@ -208,7 +208,7 @@ export default {
this.formVisible = true
this.$nextTick(() => {
if (code) {
get(`/bigScreen/design/info/code/${code}`).then((resp) => {
this.$dataRoomAxios.get(`/bigScreen/design/info/code/${code}`).then((resp) => {
this.$set(this, 'title', resp.name)
this.$set(this.dataForm, 'name', resp.name)
this.$set(this.dataForm, 'chartList', resp.chartList)
@ -269,8 +269,8 @@ export default {
return
}
const addOrUpdateHandel = !this.dataForm.code
? (form) => post('/bigScreen/design/add', form)
: (form) => post('/bigScreen/design/update', form)
? (form) => this.$dataRoomAxios.post('/bigScreen/design/add', form)
: (form) => this.$dataRoomAxios.post('/bigScreen/design/update', form)
const form = {
className: 'com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO',
chartList: this.dataForm.chartList,

@ -168,7 +168,7 @@
</div>
</template>
<script>
import { get, post, download } from 'data-room-ui/js/utils/http'
// import { get, post, download } from 'data-room-ui/js/utils/http'
import { pageMixins } from 'data-room-ui/js/mixins/page'
import EditForm from './EditForm.vue'
export default {
@ -253,7 +253,7 @@ export default {
}
},
getOptions () {
get('/bigScreen/file/getAllFileSuffix').then((data) => {
this.$dataRoomAxios.get('/bigScreen/file/getAllFileSuffix').then((data) => {
this.options = []
this.options.push({ label: '全部', value: '' })
// data
@ -263,7 +263,7 @@ export default {
},
getDataList () {
this.loading = true
get('/bigScreen/file', {
this.$dataRoomAxios.get('/bigScreen/file', {
module: this.catalogInfo.page.code,
current: this.current,
size: this.size,
@ -282,7 +282,7 @@ export default {
window.open(screen.url, '_blank')
},
downLoad (screen) {
download(`/bigScreen/file/download/${screen.id}`)
this.$dataRoomAxios.download(`/bigScreen/file/download/${screen.id}`)
},
del (screen) {
this.$confirm('确定删除该资源?', '提示', {
@ -292,7 +292,7 @@ export default {
customClass: 'bs-el-message-box'
})
.then(async () => {
post(`/bigScreen/file/delete/${screen.id}`)
this.$dataRoomAxios.post(`/bigScreen/file/delete/${screen.id}`)
.then(() => {
this.$message({
type: 'success',

@ -118,7 +118,7 @@
</div>
</template>
<script>
import { get, post } from '../../packages/js/utils/http'
// import { get, post } from '../../packages/js/utils/http'
import _ from 'lodash'
export default {
@ -208,7 +208,7 @@ export default {
return
}
if (!this.currentCatalog.id) {
post('/bigScreen/type/add', {
this.$dataRoomAxios.post('/bigScreen/type/add', {
...this.currentCatalog,
type: 'resourceCatalog'
})
@ -221,7 +221,7 @@ export default {
})
.catch(() => {})
} else {
post('/bigScreen/type/update', {
this.$dataRoomAxios.post('/bigScreen/type/update', {
...this.currentCatalog,
type: 'resourceCatalog'
})
@ -253,7 +253,7 @@ export default {
customClass: 'bs-el-message-box'
})
.then(async () => {
post(`/bigScreen/type/delete/${catalog.id}`)
this.$dataRoomAxios.post(`/bigScreen/type/delete/${catalog.id}`)
.then(() => {
this.$message({
type: 'success',
@ -273,7 +273,7 @@ export default {
//
getCatalogList () {
this.pageLoading = true
get('/bigScreen/type/list/resourceCatalog')
this.$dataRoomAxios.get('/bigScreen/type/list/resourceCatalog')
.then((data) => {
this.catalogList = data
})

@ -98,7 +98,7 @@ export default {
//
getTemplateList (type) {
this.type = type
get('/bigScreen/template/list', {
this.$dataRoomAxios.get('/bigScreen/template/list', {
type
}).then((list) => {
this.templateList = list
@ -126,7 +126,7 @@ export default {
}).then(() => {
const className = this.type === 'com.gccloud.dataroom.core.module.manage.dto.DataRoomPageDTO'
this.innerLoading = true
post(`/bigScreen/${this.type}/design/get/template`, {
this.$dataRoomAxios.post(`/bigScreen/${this.type}/design/get/template`, {
pageTemplateId: id,
name: this.pageInfo.name,
code: this.pageInfo.code,

@ -4,7 +4,7 @@ import 'data-room-ui/assets/style/common/index.scss'
import 'data-room-ui/assets/style/bsTheme.scss'
// 大屏 vuex store数据
import bigScreenStore from 'data-room-ui/js/store'
import dataRoomStore from 'data-room-ui/js/store'
// 注册基础配置
import registerConfig from 'data-room-ui/js/utils/registerConfig'
// 更新主题
@ -39,10 +39,6 @@ const components = [
DataSourceManagement
]
const $bigScreen = {
bigScreenStore
}
function install (Vue) {
components.map(component => {
Vue.component(component.name, component)
@ -59,7 +55,7 @@ export {
BigScreenDesign,
DataSetManagement,
DataSourceManagement,
$bigScreen,
dataRoomStore,
registerConfig,
updateTheme
}
@ -74,7 +70,7 @@ export default {
BigScreenDesign,
DataSetManagement,
DataSourceManagement,
$bigScreen,
dataRoomStore,
registerConfig,
updateTheme
}

@ -1,28 +1,26 @@
import { get, post } from 'data-room-ui/js/utils/http'
import Vue from 'vue'
// 大屏详情
export function getScreenInfo (code) {
return get(`/bigScreen/design/info/code/${code}`)
return Vue.prototype.$dataRoomAxios.get(`/bigScreen/design/info/code/${code}`)
}
// 保存更新大屏
export function saveScreen (data) {
return post('/bigScreen/design/update', data)
return Vue.prototype.$dataRoomAxios.post('/bigScreen/design/update', data)
}
// 根据数据集获取数据集详情
export function getDataSetDetails (id) {
return get('/dataset/datasetInfo/' + id)
return Vue.prototype.$dataRoomAxios.get('/dataset/datasetInfo/' + id)
}
// 模拟后端返回自定义主题配置
export function getThemeConfig () {
return get('https://mock.mengxuegu.com/mock/64239ff6e24b4b4cfeaca5ea/example/theme')
return Vue.prototype.$dataRoomAxios.get('https://mock.mengxuegu.com/mock/64239ff6e24b4b4cfeaca5ea/example/theme')
}
// 根据数据集id获取数据
export function getDataByDataSetId (dataSetId) {
return post('/dataset/execute', {
return Vue.prototype.$dataRoomAxios.post('/dataset/execute', {
dataSetId,
params: []
})
@ -30,24 +28,24 @@ export function getDataByDataSetId (dataSetId) {
// 得到图表详情
export function getChatInfo (params) {
return post('/bigScreen/chart/data/list', params)
return Vue.prototype.$dataRoomAxios.post('/bigScreen/chart/data/list', params)
}
// 得到图表的更新数据
export function getUpdateChartInfo (params) {
return post('/bigScreen/chart/data/chart', params)
return Vue.prototype.$dataRoomAxios.post('/bigScreen/chart/data/chart', params)
}
// 业务组件列表
export function getBizComponentPage (params) {
return get('/bigScreen/bizComponent/page', params)
return Vue.prototype.$dataRoomAxios.get('/bigScreen/bizComponent/page', params)
}
// 根据code获得业务组件的信息
export function getBizComponentInfo (code) {
return get(`/bigScreen/bizComponent/info/${code}`)
return Vue.prototype.$dataRoomAxios.get(`/bigScreen/bizComponent/info/${code}`)
}
// 更新业务组件
export function updateBizComponent (params) {
return post('/bigScreen/bizComponent/update', params)
return Vue.prototype.$dataRoomAxios.post('/bigScreen/bizComponent/update', params)
}

@ -1,80 +1,81 @@
/*!
* 标签管理
*/
import { get, post } from 'data-room-ui/js/utils/http'
// import { get, post } from 'data-room-ui/js/utils/http'
import Vue from 'vue'
/**
* 获取标签列表
* @returns {*}
*/
const getLabelList = () => get('/label/getLabelList')
const getLabelList = () => Vue.prototype.$dataRoomAxios.get('/label/getLabelList')
/**
* 获取标签
* @param data
* @returns {*}
*/
const labelList = (data) => get('/label/list', data)
const labelList = (data) => Vue.prototype.$dataRoomAxios.get('/label/list', data)
/**
* 获取标签分类
* @returns {*}
*/
const getLabelType = () => get('/label/getLabelType')
const getLabelType = () => Vue.prototype.$dataRoomAxios.get('/label/getLabelType')
/**
* 根据种类移除标签
* @param data
* @returns {*}
*/
const removeLabelByType = (data) => post('/label/removeLabelByType', data)
const removeLabelByType = (data) => Vue.prototype.$dataRoomAxios.post('/label/removeLabelByType', data)
/**
* 移除标签
* @param id
* @returns {*}
*/
const removeLabel = (id = '-1') => get(`/label/removeLabel/${id}`)
const removeLabel = (id = '-1') => Vue.prototype.$dataRoomAxios.get(`/label/removeLabel/${id}`)
/**
* 检查重复标签
* @param data
* @returns {*}
*/
const checkRepeatLabel = (data) => post('/label/checkRepeat', data)
const checkRepeatLabel = (data) => Vue.prototype.$dataRoomAxios.post('/label/checkRepeat', data)
/**
* 新增/修改标签
* @param data
* @returns {*}
*/
const addOrUpdateLabel = (data) => post('/label/addOrUpdateLabel', data)
const addOrUpdateLabel = (data) => Vue.prototype.$dataRoomAxios.post('/label/addOrUpdateLabel', data)
/**
* 获取标签详情
* @param id
* @returns {*}
*/
const getLabelDetail = (id = '-1') => get(`/label/getLabelDetail/${id}`)
const getLabelDetail = (id = '-1') => Vue.prototype.$dataRoomAxios.get(`/label/getLabelDetail/${id}`)
/**
* 修改标签种类
* @param data
* @returns {*}
*/
const updateLabelType = (data) => post('/label/updateLabelType', data)
const updateLabelType = (data) => Vue.prototype.$dataRoomAxios.post('/label/updateLabelType', data)
/**
* 根据标签id获取数据集id列表
* @param id
*/
const getDataSetIdListByLabelId = (id = '-1') => get(`/label/queryDataSetIdList/${id}`)
const getDataSetIdListByLabelId = (id = '-1') => Vue.prototype.$dataRoomAxios.get(`/label/queryDataSetIdList/${id}`)
/**
* 根据数据集id获取标签列表
* @param id
*/
const getLabelListByDatasetId = (id = '-1') => get(`/label/queryDataSetLabelList/${id}`)
const getLabelListByDatasetId = (id = '-1') => Vue.prototype.$dataRoomAxios.get(`/label/queryDataSetLabelList/${id}`)
export {
getLabelList,

@ -1,15 +1,14 @@
/*!
* 数据源管理
*/
import { get, post } from 'data-room-ui/js/utils/http'
import Vue from 'vue'
/**
* 修改数据源
* @param params
* @param flag
* @returns {*}
*/
const add = (params = {}, flag = false) => post('/datasource/add', params, flag)
const add = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/datasource/add', params, flag)
/**
* 修改数据源
@ -17,7 +16,7 @@ const add = (params = {}, flag = false) => post('/datasource/add', params, flag)
* @param flag
* @returns {*}
*/
const update = (params = {}, flag = false) => post('/datasource/update', params, flag)
const update = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/datasource/update', params, flag)
/**
* 数据源名称校验
@ -25,7 +24,7 @@ const update = (params = {}, flag = false) => post('/datasource/update', params,
* @param flag
* @returns {*}
*/
const checkRepeat = (params = {}, flag = false) => post('/datasource/checkRepeat', params, flag)
const checkRepeat = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/datasource/checkRepeat', params, flag)
/**
* 数据源连接测试
@ -33,7 +32,7 @@ const checkRepeat = (params = {}, flag = false) => post('/datasource/checkRepeat
* @param flag
* @returns {*}
*/
const sourceLinkTest = (params = {}, flag = false) => post('/datasource/testConnect', params, flag)
const sourceLinkTest = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/datasource/testConnect', params, flag)
/**
* 获取数据源列表
@ -41,7 +40,7 @@ const sourceLinkTest = (params = {}, flag = false) => post('/datasource/testConn
* @param flag
* @returns {*}
*/
const datasourcePage = (params = {}, flag = false) => get('/datasource/page', params, flag)
const datasourcePage = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.get('/datasource/page', params, flag)
/**
* 获取数据源列表
@ -49,7 +48,7 @@ const datasourcePage = (params = {}, flag = false) => get('/datasource/page', pa
* @param flag
* @returns {*}
*/
const datasourceList = (params = {}, flag = false) => get('/datasource/list', params, flag)
const datasourceList = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.get('/datasource/list', params, flag)
/**
* 删除数据源
@ -57,7 +56,7 @@ const datasourceList = (params = {}, flag = false) => get('/datasource/list', pa
* @param flag
* @returns {*}
*/
const sourceRemove = (id = '-1', flag = false) => post(`/datasource/delete/${id}`, {}, flag)
const sourceRemove = (id = '-1', flag = false) => Vue.prototype.$dataRoomAxios.post(`/datasource/delete/${id}`, {}, flag)
/**
* 获取数据源下表列表
@ -65,7 +64,7 @@ const sourceRemove = (id = '-1', flag = false) => post(`/datasource/delete/${id}
* @param flag
* @returns {*}
*/
const getSourceTable = (id = '-1', flag = false) => get(`/datasource/getTableList/${id}`, {}, flag)
const getSourceTable = (id = '-1', flag = false) => Vue.prototype.$dataRoomAxios.get(`/datasource/getTableList/${id}`, {}, flag)
/**
* 获取数据源下视图列表
@ -73,7 +72,7 @@ const getSourceTable = (id = '-1', flag = false) => get(`/datasource/getTableLis
* @param flag
* @returns {*}
*/
const getSourceView = (id = '-1', flag = false) => get(`/datasource/getViewList/${id}`, {}, flag)
const getSourceView = (id = '-1', flag = false) => Vue.prototype.$dataRoomAxios.get(`/datasource/getViewList/${id}`, {}, flag)
/**
* 获取数据源下表字段列表
@ -82,7 +81,7 @@ const getSourceView = (id = '-1', flag = false) => get(`/datasource/getViewList/
* @param flag
* @returns {Promise<*>}
*/
const getTableFieldList = (sourceId = '-1', tableName = '', flag = false) => get(`/datasource/getFieldList/table/${sourceId}/${tableName}`, {}, flag)
const getTableFieldList = (sourceId = '-1', tableName = '', flag = false) => Vue.prototype.$dataRoomAxios.get(`/datasource/getFieldList/table/${sourceId}/${tableName}`, {}, flag)
/**
* 获取数据源下视图字段列表
@ -91,7 +90,7 @@ const getTableFieldList = (sourceId = '-1', tableName = '', flag = false) => get
* @param flag
* @returns {Promise<*>}
*/
const getViewFieldList = (sourceId = '-1', viewName = '', flag = false) => get(`/datasource/getFieldList/view/${sourceId}/${viewName}`, {}, flag)
const getViewFieldList = (sourceId = '-1', viewName = '', flag = false) => Vue.prototype.$dataRoomAxios.get(`/datasource/getFieldList/view/${sourceId}/${viewName}`, {}, flag)
export {
add,

@ -1,7 +1,7 @@
/*!
* 数据集管理
*/
import { get, post } from 'data-room-ui/js/utils/http'
import Vue from 'vue'
/**
* 数据集分页查询
@ -9,7 +9,7 @@ import { get, post } from 'data-room-ui/js/utils/http'
* @param flag
* @returns {*}
*/
const datasetPage = (params = {}, flag = false) => get('/dataset/page', params, flag)
const datasetPage = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.get('/dataset/page', params, flag)
/**
* 数据集列表查询
@ -17,7 +17,7 @@ const datasetPage = (params = {}, flag = false) => get('/dataset/page', params,
* @param flag
* @returns {*}
*/
const datasetList = (params = {}, flag = false) => get('/dataset/list', params, flag)
const datasetList = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.get('/dataset/list', params, flag)
/**
* 数据集名称校验
@ -25,7 +25,7 @@ const datasetList = (params = {}, flag = false) => get('/dataset/list', params,
* @param flag
* @returns {*}
*/
const nameCheckRepeat = (params = {}, flag = false) => post('/dataset/checkRepeat', params, flag)
const nameCheckRepeat = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/dataset/checkRepeat', params, flag)
/**
* 数据集新增
@ -33,7 +33,7 @@ const nameCheckRepeat = (params = {}, flag = false) => post('/dataset/checkRepea
* @param flag
* @returns {*}
*/
const datasetAdd = (params = {}, flag = false) => post('/dataset/add', params, flag)
const datasetAdd = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/dataset/add', params, flag)
/**
* 数据集修改
@ -41,7 +41,7 @@ const datasetAdd = (params = {}, flag = false) => post('/dataset/add', params, f
* @param flag
* @returns {*}
*/
const datasetUpdate = (params = {}, flag = false) => post('/dataset/update', params, flag)
const datasetUpdate = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/dataset/update', params, flag)
/**
* 删除数据集
@ -49,7 +49,7 @@ const datasetUpdate = (params = {}, flag = false) => post('/dataset/update', par
* @param flag
* @returns {*}
*/
const datasetRemove = (id = '-1', flag = false) => post(`/dataset/delete/${id}`, {}, flag)
const datasetRemove = (id = '-1', flag = false) => Vue.prototype.$dataRoomAxios.post(`/dataset/delete/${id}`, {}, flag)
/**
* 数据集执行
@ -57,7 +57,7 @@ const datasetRemove = (id = '-1', flag = false) => post(`/dataset/delete/${id}`,
* @param flag
* @returns {*}
*/
const datasetExecuteTest = (params = {}, flag = false) => post('/dataset/execute/test', params, flag)
const datasetExecuteTest = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/dataset/execute/test', params, flag)
/**
* 获取数据集详情
@ -66,7 +66,7 @@ const datasetExecuteTest = (params = {}, flag = false) => post('/dataset/execute
* @returns {*}
*/
const getDataset = (id = '-1', flag = false) => get(`/dataset/info/${id}`, {}, flag)
const getDataset = (id = '-1', flag = false) => Vue.prototype.$dataRoomAxios.get(`/dataset/info/${id}`, {}, flag)
/**
* 获取数据集分类
@ -74,7 +74,7 @@ const getDataset = (id = '-1', flag = false) => get(`/dataset/info/${id}`, {}, f
* @param flag
* @returns {*}
*/
const getCategoryTree = (params = {}, flag = false) => get('/category/queryTreeList', params, flag)
const getCategoryTree = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.get('/category/queryTreeList', params, flag)
/**
* 新增分类树节点
@ -82,7 +82,7 @@ const getCategoryTree = (params = {}, flag = false) => get('/category/queryTreeL
* @param flag
* @returns {*}
*/
const categoryAdd = (params = {}, flag = false) => post('/category/add', params, flag)
const categoryAdd = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/category/add', params, flag)
/**
* 编辑分类树节点
@ -90,7 +90,7 @@ const categoryAdd = (params = {}, flag = false) => post('/category/add', params,
* @param flag
* @returns {*}
*/
const categoryUpdate = (params = {}, flag = false) => post('/category/update', params, flag)
const categoryUpdate = (params = {}, flag = false) => Vue.prototype.$dataRoomAxios.post('/category/update', params, flag)
/**
* 删除分类树节点
@ -98,7 +98,7 @@ const categoryUpdate = (params = {}, flag = false) => post('/category/update', p
* @param flag
* @returns {*}
*/
const categoryRemove = (id = '-1', flag = false) => post(`/category/delete/${id}`, {}, flag)
const categoryRemove = (id = '-1', flag = false) => Vue.prototype.$dataRoomAxios.post(`/category/delete/${id}`, {}, flag)
export {
datasetPage,

Loading…
Cancel
Save