fix: 请求地址,localStorage(key)优化
This commit is contained in:
@@ -4,11 +4,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
setup () {
|
setup () {
|
||||||
// 处理刷新后 $dayJs的时区变为默认的问题
|
// 处理刷新后 $dayJs的时区变为默认的问题
|
||||||
const timezone = localStorage.getItem('cn-sys-timezone') || ''
|
const timezone = localStorage.getItem(storageKey.sysTimezone) || ''
|
||||||
if (timezone) {
|
if (timezone) {
|
||||||
window.$dayJs.tz.setDefault(timezone)
|
window.$dayJs.tz.setDefault(timezone)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -41,6 +41,9 @@
|
|||||||
import { mapActions } from 'vuex'
|
import { mapActions } from 'vuex'
|
||||||
import { post, get } from '@/utils/http'
|
import { post, get } from '@/utils/http'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
name: 'Login',
|
name: 'Login',
|
||||||
@@ -63,18 +66,18 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
post('sys/login', { username: this.username, pin: this.pin }).then(
|
post(api.operationLog, { username: this.username, pin: this.pin }).then(
|
||||||
res => {
|
res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
if (!this.$_.isEmpty(res.data.lang)) {
|
if (!this.$_.isEmpty(res.data.lang)) {
|
||||||
localStorage.setItem('cn-language', res.data.lang)
|
localStorage.setItem(storageKey.language, res.data.lang)
|
||||||
}
|
}
|
||||||
if (!this.$_.isEmpty(res.data.theme)) {
|
if (!this.$_.isEmpty(res.data.theme)) {
|
||||||
localStorage.setItem('cn-theme', res.data.theme)
|
localStorage.setItem(storageKey.theme, res.data.theme)
|
||||||
}
|
}
|
||||||
res.loginSuccessPath = this.loginSuccessPath
|
res.loginSuccessPath = this.loginSuccessPath
|
||||||
this.loginSuccess(res)
|
this.loginSuccess(res)
|
||||||
localStorage.setItem('cn-username', this.username)
|
localStorage.setItem(storageKey.username, this.username)
|
||||||
} else if (res.code === 518005) {
|
} else if (res.code === 518005) {
|
||||||
this.$message.error(this.$t('Incorrect username or password'))
|
this.$message.error(this.$t('Incorrect username or password'))
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@@ -92,24 +95,24 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
appearance () {
|
appearance () {
|
||||||
get('/sys/appearance').then(res => {
|
get(api.appearance).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.appearanceOut(res.data)
|
this.appearanceOut(res.data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
appearanceOut (data) {
|
appearanceOut (data) {
|
||||||
if (this.$_.isEmpty(localStorage.getItem('cn-language'))) {
|
if (this.$_.isEmpty(localStorage.getItem(storageKey.language))) {
|
||||||
localStorage.setItem('cn-language', data.lang)
|
localStorage.setItem(storageKey.language, data.lang)
|
||||||
}
|
}
|
||||||
if (this.$_.isEmpty(localStorage.getItem('cn-sys-timezone'))) {
|
if (this.$_.isEmpty(localStorage.getItem(storageKey.sysTimezone))) {
|
||||||
localStorage.setItem('cn-sys-timezone', data.timezone)
|
localStorage.setItem(storageKey.sysTimezone, data.timezone)
|
||||||
}
|
}
|
||||||
if (this.$_.isEmpty(localStorage.getItem('cn-theme'))) {
|
if (this.$_.isEmpty(localStorage.getItem(storageKey.theme))) {
|
||||||
localStorage.setItem('cn-theme', data.theme)
|
localStorage.setItem(storageKey.theme, data.theme)
|
||||||
}
|
}
|
||||||
if (this.$_.isEmpty(localStorage.getItem('cn-date-format'))) {
|
if (this.$_.isEmpty(localStorage.getItem(storageKey.dateFormat))) {
|
||||||
localStorage.setItem('cn-date-format', data.dateFormat)
|
localStorage.setItem(storageKey.dateFormat, data.dateFormat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { defaultPageSize } from '@/utils/constants'
|
import { defaultPageSize } from '@/utils/constants'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'pagination',
|
name: 'pagination',
|
||||||
@@ -132,7 +133,7 @@ export default {
|
|||||||
this.pageSize = this.postPageSizes[0]
|
this.pageSize = this.postPageSizes[0]
|
||||||
this.resetPageSizes()
|
this.resetPageSizes()
|
||||||
} else {
|
} else {
|
||||||
const pageSize = localStorage.getItem('cn-pageSize-' + localStorage.getItem('cn-username') + '-' + this.tableId)
|
const pageSize = localStorage.getItem(storageKey.pageSize + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId)
|
||||||
if (pageSize != 'undefined' && pageSize != null) {
|
if (pageSize != 'undefined' && pageSize != null) {
|
||||||
this.pageSize = parseInt(pageSize)
|
this.pageSize = parseInt(pageSize)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import MyDatePicker from '../MyDatePicker'
|
import MyDatePicker from '../MyDatePicker'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DateTimeRange',
|
name: 'DateTimeRange',
|
||||||
@@ -113,9 +114,9 @@ export default {
|
|||||||
const myStartTime = ref(props.startTime)
|
const myStartTime = ref(props.startTime)
|
||||||
const myEndTime = ref(props.endTime)
|
const myEndTime = ref(props.endTime)
|
||||||
const timeArr = ref([myStartTime.value, myEndTime.value])
|
const timeArr = ref([myStartTime.value, myEndTime.value])
|
||||||
const address = localStorage.getItem('cn-sys-timezone')
|
const address = localStorage.getItem(storageKey.sysTimezone)
|
||||||
const utc = localStorage.getItem('cn-timezone-offset')
|
const utc = localStorage.getItem(storageKey.timezoneOffset)
|
||||||
const rangeHistory = ref(localStorage.getItem('date-range-history') ? JSON.parse(localStorage.getItem('date-range-history')) : [])
|
const rangeHistory = ref(localStorage.getItem(storageKey.dataRangeHistory) ? JSON.parse(localStorage.getItem(storageKey.dataRangeHistory)) : [])
|
||||||
const dateRangeValue = props.dateRange ? ref(props.dateRange) : ref(60)
|
const dateRangeValue = props.dateRange ? ref(props.dateRange) : ref(60)
|
||||||
const isCustom = ref(false)
|
const isCustom = ref(false)
|
||||||
const dateRangeArr = [
|
const dateRangeArr = [
|
||||||
@@ -235,7 +236,7 @@ export default {
|
|||||||
start: myStartTime.value,
|
start: myStartTime.value,
|
||||||
end: myEndTime.value
|
end: myEndTime.value
|
||||||
})
|
})
|
||||||
localStorage.setItem('date-range-history', JSON.stringify(rangeHistory.value))
|
localStorage.setItem(storageKey.dataRangeHistory, JSON.stringify(rangeHistory.value))
|
||||||
ctx.emit('change', myStartTime.value, myEndTime.value, dateRangeValue)
|
ctx.emit('change', myStartTime.value, myEndTime.value, dateRangeValue)
|
||||||
dropdownFlag.value = false
|
dropdownFlag.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { post } from '@/utils/http'
|
import { post } from '@/utils/http'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TopToolMoreOptions',
|
name: 'TopToolMoreOptions',
|
||||||
props: {
|
props: {
|
||||||
@@ -107,7 +109,7 @@ export default {
|
|||||||
if (this.paramsType) {
|
if (this.paramsType) {
|
||||||
form.append('type', this.paramsType)
|
form.append('type', this.paramsType)
|
||||||
}
|
}
|
||||||
form.append('language', localStorage.getItem('cn-language') ? localStorage.getItem('cn-language') : 'en')
|
form.append('language', localStorage.getItem(storageKey.language) ? localStorage.getItem(storageKey.language) : 'en')
|
||||||
post(this.importUrl, form, { 'Content-Type': 'multipart/form-data' }).then(response => {
|
post(this.importUrl, form, { 'Content-Type': 'multipart/form-data' }).then(response => {
|
||||||
if (response.code == 200 && response.msg == 'success') {
|
if (response.code == 200 && response.msg == 'success') {
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.importSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.importSuccess') })
|
||||||
@@ -127,7 +129,7 @@ export default {
|
|||||||
this.importFile = null
|
this.importFile = null
|
||||||
},
|
},
|
||||||
downloadTemplate () {
|
downloadTemplate () {
|
||||||
const language = localStorage.getItem('cn-language') || 'en' // 初始未选择默认 en 英文
|
const language = localStorage.getItem(storageKey.language) || 'en' // 初始未选择默认 en 英文
|
||||||
const fileName = this.exportFileName + '-' + this.$t('overall.template') + '-' + this.getTimeString() + '.json'
|
const fileName = this.exportFileName + '-' + this.$t('overall.template') + '-' + this.getTimeString() + '.json'
|
||||||
|
|
||||||
let url = null
|
let url = null
|
||||||
@@ -158,7 +160,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
params.pageSize = -1
|
params.pageSize = -1
|
||||||
params.language = localStorage.getItem('cn-language') || 'en'
|
params.language = localStorage.getItem(storageKey.language) || 'en'
|
||||||
|
|
||||||
this.export(this.exportUrl, params, this.exportFileName + '-' + this.getTimeString() + '.json')
|
this.export(this.exportUrl, params, this.exportFileName + '-' + this.getTimeString() + '.json')
|
||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
|
|||||||
@@ -91,6 +91,7 @@
|
|||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { get, put } from '@/utils/http'
|
import { get, put } from '@/utils/http'
|
||||||
import { entityType, storageKey } from '@/utils/constants'
|
import { entityType, storageKey } from '@/utils/constants'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Header',
|
name: 'Header',
|
||||||
@@ -104,7 +105,7 @@ export default {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
username: 'admin', // sessionStorage.getItem('cn-username'),
|
username: 'admin', // sessionStorage.getItem('cn-username'),
|
||||||
language: localStorage.getItem('cn-language') ? localStorage.getItem('cn-language') : 'en',
|
language: localStorage.getItem(storageKey.language) ? localStorage.getItem(storageKey.language) : 'en',
|
||||||
showChangePin: false,
|
showChangePin: false,
|
||||||
from: '', // entity类型
|
from: '', // entity类型
|
||||||
changePassForm: {
|
changePassForm: {
|
||||||
@@ -171,8 +172,8 @@ export default {
|
|||||||
this.showChangePin = false
|
this.showChangePin = false
|
||||||
},
|
},
|
||||||
changeLocal (lang) {
|
changeLocal (lang) {
|
||||||
if (lang !== localStorage.getItem('cn-language')) {
|
if (lang !== localStorage.getItem(storageKey.language)) {
|
||||||
localStorage.setItem('cn-language', lang)
|
localStorage.setItem(storageKey.language, lang)
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -181,10 +182,10 @@ export default {
|
|||||||
},
|
},
|
||||||
logout () {
|
logout () {
|
||||||
localStorage.removeItem(storageKey.token)
|
localStorage.removeItem(storageKey.token)
|
||||||
get('/logout')
|
get(api.logout)
|
||||||
},
|
},
|
||||||
refreshLang () {
|
refreshLang () {
|
||||||
this.language = localStorage.getItem('cn-language')
|
this.language = localStorage.getItem(storageKey.language)
|
||||||
this.$i18n.locale = this.language
|
this.$i18n.locale = this.language
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
@@ -196,7 +197,7 @@ export default {
|
|||||||
submit () {
|
submit () {
|
||||||
this.$refs.changePassForm.validate((valid) => {
|
this.$refs.changePassForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
put('sys/user/pin', { oldPin: this.changePassForm.oldPwd, newPin: this.changePassForm.newPwd }).then(res => {
|
put(api.pin, { oldPin: this.changePassForm.oldPwd, newPin: this.changePassForm.newPwd }).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.$message.success('Success')
|
this.$message.success('Success')
|
||||||
this.showChangePin = false
|
this.showChangePin = false
|
||||||
|
|||||||
@@ -70,11 +70,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'LeftMenu',
|
name: 'LeftMenu',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
systemName: localStorage.getItem('cn-sys-name'),
|
systemName: localStorage.getItem(storageKey.sysName),
|
||||||
logo: ''
|
logo: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -133,7 +133,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import rightBoxMixin from '@/mixins/right-box'
|
import rightBoxMixin from '@/mixins/right-box'
|
||||||
import { get, post, put } from '@/utils/http'
|
import { get, post, put } from '@/utils/http'
|
||||||
import { panelTypeAndRouteMapping } from '@/utils/constants'
|
import { panelTypeAndRouteMapping, storageKey } from '@/utils/constants'
|
||||||
import { api } from '@/utils/api'
|
import { api } from '@/utils/api'
|
||||||
import { VAceEditor } from 'vue3-ace-editor'
|
import { VAceEditor } from 'vue3-ace-editor'
|
||||||
import 'ace-builds/src-noconflict/mode-javascript'
|
import 'ace-builds/src-noconflict/mode-javascript'
|
||||||
@@ -149,7 +149,7 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
url: api.chart,
|
url: api.chart,
|
||||||
loginName: localStorage.getItem('cn-username'),
|
loginName: localStorage.getItem(storageKey.username),
|
||||||
panelTypeAndRouteMapping: panelTypeAndRouteMapping,
|
panelTypeAndRouteMapping: panelTypeAndRouteMapping,
|
||||||
rules: { // 表单校验规则
|
rules: { // 表单校验规则
|
||||||
name: [
|
name: [
|
||||||
@@ -355,7 +355,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isCurrentUser (username) {
|
isCurrentUser (username) {
|
||||||
return localStorage.getItem('cn-username') === username
|
return localStorage.getItem(storageKey.username) === username
|
||||||
},
|
},
|
||||||
/* 密码失去焦点 检验确认密码 */
|
/* 密码失去焦点 检验确认密码 */
|
||||||
pinBlur () {
|
pinBlur () {
|
||||||
@@ -397,7 +397,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
async getChartData (value) {
|
async getChartData (value) {
|
||||||
await get('/visual/chart?panelId=' + value).then(response => {
|
await get(api.chart, { panelId: value }).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.chartData = response.data.list
|
this.chartData = response.data.list
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,13 +57,16 @@
|
|||||||
<script>
|
<script>
|
||||||
import rightBoxMixin from '@/mixins/right-box'
|
import rightBoxMixin from '@/mixins/right-box'
|
||||||
import { get, post, put } from '@/utils/http'
|
import { get, post, put } from '@/utils/http'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'I18nBox',
|
name: 'I18nBox',
|
||||||
mixins: [rightBoxMixin],
|
mixins: [rightBoxMixin],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
url: 'sys/i18n',
|
url: api.i18nBox,
|
||||||
loginName: localStorage.getItem('cn-username'),
|
loginName: localStorage.getItem(storageKey.username),
|
||||||
rules: { // 表单校验规则
|
rules: { // 表单校验规则
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||||
@@ -88,7 +91,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isCurrentUser (username) {
|
isCurrentUser (username) {
|
||||||
return localStorage.getItem('cn-username') === username
|
return localStorage.getItem(storageKey.username) === username
|
||||||
},
|
},
|
||||||
/* 密码失去焦点 检验确认密码 */
|
/* 密码失去焦点 检验确认密码 */
|
||||||
pinBlur () {
|
pinBlur () {
|
||||||
@@ -130,7 +133,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getLangData () {
|
getLangData () {
|
||||||
get('sys/dict?type=lang&pageSize=-1').then(response => {
|
get(api.dict, { type: 'lang', pageSize: -1 }).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.langData = response.data.list
|
this.langData = response.data.list
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import rightBoxMixin from '@/mixins/right-box'
|
import rightBoxMixin from '@/mixins/right-box'
|
||||||
import { get, post, put } from '@/utils/http'
|
import { get, post, put } from '@/utils/http'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'userBox',
|
name: 'userBox',
|
||||||
mixins: [rightBoxMixin],
|
mixins: [rightBoxMixin],
|
||||||
@@ -64,7 +66,7 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
editRole: {},
|
editRole: {},
|
||||||
url: 'sys/role',
|
url: api.role,
|
||||||
rightBox: { model: { show: false } },
|
rightBox: { model: { show: false } },
|
||||||
rules: { // 表单校验规则
|
rules: { // 表单校验规则
|
||||||
name: [
|
name: [
|
||||||
@@ -110,7 +112,7 @@ export default {
|
|||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
self.menus = []
|
self.menus = []
|
||||||
if (self.editRole.id) {
|
if (self.editRole.id) {
|
||||||
get('/sys/role/menu/' + self.editRole.id).then(response => {
|
get(api.menu + self.editRole.id).then(response => {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
self.menus = response.data.menus
|
self.menus = response.data.menus
|
||||||
self.selectedIds = response.data.selectedIds
|
self.selectedIds = response.data.selectedIds
|
||||||
@@ -120,7 +122,7 @@ export default {
|
|||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
get('/sys/menu').then(response => {
|
get(api.sysMenu).then(response => {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
self.menus = response.data.list
|
self.menus = response.data.list
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -116,7 +116,9 @@
|
|||||||
<script>
|
<script>
|
||||||
import rightBoxMixin from '@/mixins/right-box'
|
import rightBoxMixin from '@/mixins/right-box'
|
||||||
import { get, post, put } from '@/utils/http'
|
import { get, post, put } from '@/utils/http'
|
||||||
import { themeData, langData } from '@/utils/constants'
|
import { themeData, langData, storageKey } from '@/utils/constants'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'UserBox',
|
name: 'UserBox',
|
||||||
mixins: [rightBoxMixin],
|
mixins: [rightBoxMixin],
|
||||||
@@ -131,8 +133,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
url: 'sys/user',
|
url: api.user,
|
||||||
loginName: localStorage.getItem('cn-username'),
|
loginName: localStorage.getItem(storageKey.username),
|
||||||
rules: { // 表单校验规则
|
rules: { // 表单校验规则
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||||
@@ -180,7 +182,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isCurrentUser (username) {
|
isCurrentUser (username) {
|
||||||
return localStorage.getItem('cn-username') === username
|
return localStorage.getItem(storageKey.username) === username
|
||||||
},
|
},
|
||||||
/* 密码失去焦点 检验确认密码 */
|
/* 密码失去焦点 检验确认密码 */
|
||||||
pinBlur () {
|
pinBlur () {
|
||||||
@@ -222,7 +224,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getRoleData () {
|
getRoleData () {
|
||||||
get('sys/role?pageSize=-1').then(response => {
|
get(api.role, { pageSize: -1 }).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.roleData = response.data.list
|
this.roleData = response.data.list
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
customTableTitle: Array, // 自定义的title
|
customTableTitle: Array, // 自定义的title
|
||||||
@@ -51,9 +52,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
const localStorageTitle = JSON.parse(localStorage.getItem('cn-tableTitle-' + localStorage.getItem('cn-username') + '-' + this.tableId))
|
const localStorageTitle = JSON.parse(localStorage.getItem(storageKey.tableTitle + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId))
|
||||||
if (localStorageTitle) {
|
if (localStorageTitle) {
|
||||||
localStorage.setItem('cn-tableTitle-' + localStorage.getItem('cn-username') + '-' + this.tableId, JSON.stringify(localStorageTitle))
|
localStorage.setItem(storageKey.tableTitle + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId, JSON.stringify(localStorageTitle))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -92,10 +93,8 @@ export default {
|
|||||||
// 点击第二个cancel
|
// 点击第二个cancel
|
||||||
save () {
|
save () {
|
||||||
this.$emit('update', this.custom)
|
this.$emit('update', this.custom)
|
||||||
localStorage.setItem(
|
localStorage.setItem(storageKey.tableTitle + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId,
|
||||||
'cn-tableTitle-' + localStorage.getItem('cn-username') + '-' + this.tableId,
|
JSON.stringify(this.custom))
|
||||||
JSON.stringify(this.custom)
|
|
||||||
)
|
|
||||||
this.esc()
|
this.esc()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
@header-dragend="dragend"
|
@header-dragend="dragend"
|
||||||
@sort-change="tableDataSort"
|
@sort-change="tableDataSort"
|
||||||
@selection-change="selectionChange"
|
@selection-change="selectionChange"
|
||||||
@select="select"
|
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:resizable="false"
|
:resizable="false"
|
||||||
@@ -69,7 +68,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="table-operation-all">
|
<div class="table-operation-all">
|
||||||
<el-checkbox v-model="checkboxAll" @change="builtinReportCheckbox(tableData)"></el-checkbox>
|
<el-checkbox v-model="checkboxAll" @change="selectAll(tableData)"></el-checkbox>
|
||||||
<div class="table-operation-all-span">
|
<div class="table-operation-all-span">
|
||||||
<span>{{ $t('overall.all') }}</span>
|
<span>{{ $t('overall.all') }}</span>
|
||||||
<div class="table-operation-back-down" :class="{'table-operation-all-checkbox': batchDow, 'table-operation-all-loading': loading}" @click="tableOperation(['download', this.checkboxIds, 'builtin'])">
|
<div class="table-operation-back-down" :class="{'table-operation-all-checkbox': batchDow, 'table-operation-all-loading': loading}" @click="tableOperation(['download', this.checkboxIds, 'builtin'])">
|
||||||
@@ -128,7 +127,7 @@ export default {
|
|||||||
this.checkboxAll = objs.length > 0 || objs.length === this.tableData.length
|
this.checkboxAll = objs.length > 0 || objs.length === this.tableData.length
|
||||||
this.batchDow = objs.length > 0
|
this.batchDow = objs.length > 0
|
||||||
},
|
},
|
||||||
builtinReportCheckbox (objs) {
|
selectAll (objs) {
|
||||||
if (objs) {
|
if (objs) {
|
||||||
objs.forEach(item => {
|
objs.forEach(item => {
|
||||||
this.$refs.dataTable.toggleAllSelection(item)
|
this.$refs.dataTable.toggleAllSelection(item)
|
||||||
|
|||||||
@@ -82,13 +82,14 @@
|
|||||||
<script>
|
<script>
|
||||||
import table from '@/mixins/table'
|
import table from '@/mixins/table'
|
||||||
import { put } from '@/utils/http'
|
import { put } from '@/utils/http'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'userTable',
|
name: 'userTable',
|
||||||
mixins: [table],
|
mixins: [table],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
loginName: localStorage.getItem('cn-username'),
|
loginName: localStorage.getItem(storageKey.username),
|
||||||
tableTitle: [ // 原始table列
|
tableTitle: [ // 原始table列
|
||||||
{
|
{
|
||||||
label: 'ID',
|
label: 'ID',
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { hasButton } from '@/permission'
|
import { hasButton } from '@/permission'
|
||||||
import { getMillisecond } from '@/utils/date-util'
|
import { getMillisecond } from '@/utils/date-util'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
@@ -42,7 +43,7 @@ export default {
|
|||||||
utcTimeToSysTime (str) { // utc 0 到系统设置的时区
|
utcTimeToSysTime (str) { // utc 0 到系统设置的时区
|
||||||
let date = ''
|
let date = ''
|
||||||
if (isNaN(str)) {
|
if (isNaN(str)) {
|
||||||
date = window.$dayJs(str).valueOf() + localStorage.getItem('cn-timezone-local-offset') * 60 * 60 * 1000
|
date = window.$dayJs(str).valueOf() + localStorage.getItem(storageKey.timezoneLocalOffset) * 60 * 60 * 1000
|
||||||
} else {
|
} else {
|
||||||
date = str
|
date = str
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import { get, del } from '@/utils/http'
|
|||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import pagination from '@/components/common/Pagination'
|
import pagination from '@/components/common/Pagination'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
pagination
|
pagination
|
||||||
@@ -120,7 +123,7 @@ export default {
|
|||||||
},
|
},
|
||||||
pageSize (val) {
|
pageSize (val) {
|
||||||
this.pageObj.pageSize = val
|
this.pageObj.pageSize = val
|
||||||
localStorage.setItem('cn-pageSize-' + localStorage.getItem('cn-username') + '-' + this.tableId, val)
|
localStorage.setItem(storageKey.pageSize + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId, val)
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
},
|
},
|
||||||
add () {
|
add () {
|
||||||
@@ -153,13 +156,13 @@ export default {
|
|||||||
let params = {}
|
let params = {}
|
||||||
if (n === 'builtin') {
|
if (n === 'builtin') {
|
||||||
fileName = 'builtinReport' + '-' + this.getTimeString() + '.zip' // 文件名称
|
fileName = 'builtinReport' + '-' + this.getTimeString() + '.zip' // 文件名称
|
||||||
url = '/report/job/batchDownloadPdf' // 批量 zip 下载
|
url = api.reportBatchDownloadPdf // 批量 zip 下载
|
||||||
params = {
|
params = {
|
||||||
ids: u
|
ids: u
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fileName = u.name + '.pdf' // 文件名称
|
fileName = u.name + '.pdf' // 文件名称
|
||||||
url = '/report/job/downloadPdf' // 单个 pdf 下载
|
url = api.reportDownloadPdf // 单个 pdf 下载
|
||||||
params = {
|
params = {
|
||||||
id: u.id
|
id: u.id
|
||||||
}
|
}
|
||||||
@@ -202,7 +205,7 @@ export default {
|
|||||||
const params = {
|
const params = {
|
||||||
id: u.id
|
id: u.id
|
||||||
}
|
}
|
||||||
axios.get('/report/job/view', { params: params }).then(res => {
|
axios.get(api.reportView, { params: params }).then(res => {
|
||||||
const prevWindow = window.open('', '')
|
const prevWindow = window.open('', '')
|
||||||
prevWindow.document.write(res.data)
|
prevWindow.document.write(res.data)
|
||||||
prevWindow.focus()
|
prevWindow.focus()
|
||||||
@@ -257,11 +260,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
const pageSize = localStorage.getItem('cn-pageSize-' + localStorage.getItem('cn-username') + '-' + this.tableId)
|
const pageSize = localStorage.getItem(storageKey.pageSize + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId)
|
||||||
if (pageSize && pageSize !== 'undefined') {
|
if (pageSize && pageSize !== 'undefined') {
|
||||||
this.pageObj.pageSize = pageSize
|
this.pageObj.pageSize = pageSize
|
||||||
}
|
}
|
||||||
let localStorageTableTitle = localStorage.getItem('cn-tableTitle-' + localStorage.getItem('cn-username') + '-' + this.tableId)
|
let localStorageTableTitle = localStorage.getItem(storageKey.tableTitle + '-' + localStorage.getItem(storageKey.username) + '-' + this.tableId)
|
||||||
localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : this.$refs.dataTable.tableTitle
|
localStorageTableTitle = localStorageTableTitle ? JSON.parse(localStorageTableTitle) : this.$refs.dataTable.tableTitle
|
||||||
this.tools.customTableTitle = this.$refs.dataTable.tableTitle.map((item, index) => { // 修复切换中英文的问题
|
this.tools.customTableTitle = this.$refs.dataTable.tableTitle.map((item, index) => { // 修复切换中英文的问题
|
||||||
if (localStorageTableTitle[index]) {
|
if (localStorageTableTitle[index]) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { createStore } from 'vuex'
|
import { createStore } from 'vuex'
|
||||||
import user from './modules/user'
|
import user from './modules/user'
|
||||||
import panel from './modules/panel'
|
import panel from './modules/panel'
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
const store = createStore({
|
const store = createStore({
|
||||||
modules: {
|
modules: {
|
||||||
@@ -9,7 +10,7 @@ const store = createStore({
|
|||||||
},
|
},
|
||||||
state () {
|
state () {
|
||||||
return {
|
return {
|
||||||
isShrink: localStorage.getItem('cn-left-menu-shrink') === 'true',
|
isShrink: localStorage.getItem(storageKey.leftMenuShrink) === 'true',
|
||||||
i18n: false,
|
i18n: false,
|
||||||
|
|
||||||
showEntityTypeSelector: false, // 在entity explore页面时,控制header显示实体类型选择框
|
showEntityTypeSelector: false, // 在entity explore页面时,控制header显示实体类型选择框
|
||||||
@@ -33,7 +34,7 @@ const store = createStore({
|
|||||||
mutations: {
|
mutations: {
|
||||||
isShrink (state) {
|
isShrink (state) {
|
||||||
state.isShrink = !state.isShrink
|
state.isShrink = !state.isShrink
|
||||||
localStorage.setItem('cn-left-menu-shrink', state.isShrink)
|
localStorage.setItem(storageKey.leftMenuShrink, state.isShrink)
|
||||||
},
|
},
|
||||||
loadI18n (state) {
|
loadI18n (state) {
|
||||||
state.i18n = true
|
state.i18n = true
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import { sortByOrderNum, getWelcomeMenu } from '@/permission'
|
|||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import utc from 'dayjs/plugin/utc'
|
import utc from 'dayjs/plugin/utc'
|
||||||
import { ElMessage } from 'element-plus' // dependent on utc plugin
|
import { ElMessage } from 'element-plus' // dependent on utc plugin
|
||||||
|
import { storageKey } from '@/utils/constants'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
|
|
||||||
dayjs.extend(utc)
|
dayjs.extend(utc)
|
||||||
|
|
||||||
const user = {
|
const user = {
|
||||||
@@ -45,15 +48,15 @@ const user = {
|
|||||||
loginSuccess (store, res) {
|
loginSuccess (store, res) {
|
||||||
console.info(res)
|
console.info(res)
|
||||||
window.$dayJs.tz.setDefault(res.data.timezone)
|
window.$dayJs.tz.setDefault(res.data.timezone)
|
||||||
localStorage.setItem('cn-token', res.data.token)
|
localStorage.setItem(storageKey.token, res.data.token)
|
||||||
localStorage.setItem('cn-sys-name', res.data.systemName)
|
localStorage.setItem(storageKey.sysName, res.data.systemName)
|
||||||
if (res.systemLogo) {
|
if (res.systemLogo) {
|
||||||
localStorage.setItem('cn-sys-logo', res.data.systemLogo)
|
localStorage.setItem(storageKey.sysLogo, res.data.systemLogo)
|
||||||
}
|
}
|
||||||
localStorage.setItem('cn-sys-timezone', res.data.timezone)
|
localStorage.setItem(storageKey.sysTimezone, res.data.timezone)
|
||||||
localStorage.setItem('cn-timezone-offset', dayjs.tz().utcOffset() / 60)
|
localStorage.setItem(storageKey.timezoneOffset, dayjs.tz().utcOffset() / 60)
|
||||||
localStorage.setItem('cn-timezone-local-offset', dayjs().utcOffset() / 60)
|
localStorage.setItem(storageKey.timezoneLocalOffset, dayjs().utcOffset() / 60)
|
||||||
post('/sys/user/permissions', { token: res.data.token }).then(res2 => {
|
post(api.permissions, { token: res.data.token }).then(res2 => {
|
||||||
const menuList = sortByOrderNum(res2.data.menus)
|
const menuList = sortByOrderNum(res2.data.menus)
|
||||||
store.commit('setMenuList', menuList)
|
store.commit('setMenuList', menuList)
|
||||||
store.commit('setButtonList', res2.data.buttons)
|
store.commit('setButtonList', res2.data.buttons)
|
||||||
@@ -90,9 +93,9 @@ const user = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
logoutSuccess (store, res) {
|
logoutSuccess (store, res) {
|
||||||
localStorage.removeItem('cn-username')
|
localStorage.removeItem(storageKey.username)
|
||||||
localStorage.removeItem('cn-username')
|
localStorage.removeItem(storageKey.username)
|
||||||
localStorage.removeItem('cn-token')
|
localStorage.removeItem(storageKey.token)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,15 +11,33 @@ import { storageKey } from '@/utils/constants'
|
|||||||
export const api = {
|
export const api = {
|
||||||
// 系统相关
|
// 系统相关
|
||||||
permission: '/sys/user/permissions',
|
permission: '/sys/user/permissions',
|
||||||
i18n: '/sys/i18n/lang',
|
|
||||||
dict: '/sys/dict',
|
dict: '/sys/dict',
|
||||||
user: '/sys/user',
|
logout: '/logout',
|
||||||
role: '/sys/role',
|
pin: 'sys/user/pin',
|
||||||
galaxyProxy: '/galaxy/setting',
|
appearance: '/sys/appearance',
|
||||||
|
permissions: '/sys/user/permissions',
|
||||||
operationLog: '/sys/log',
|
operationLog: '/sys/log',
|
||||||
|
// user
|
||||||
|
user: '/sys/user',
|
||||||
|
// role
|
||||||
|
role: '/sys/role',
|
||||||
|
menu: '/sys/role/menu/',
|
||||||
|
sysMenu: '/sys/menu/',
|
||||||
|
|
||||||
|
// i18n
|
||||||
|
i18n: '/sys/i18n/lang',
|
||||||
|
i18nBox: '/sys/i18n',
|
||||||
|
// chart
|
||||||
chartList: '/visual/chart/list',
|
chartList: '/visual/chart/list',
|
||||||
|
// galaxyProxy
|
||||||
|
galaxyProxy: '/galaxy/setting',
|
||||||
|
|
||||||
// 报告相关
|
// 报告相关
|
||||||
builtinReport: '/report/job',
|
reportJob: '/report/job',
|
||||||
|
reportTemp: '/report/temp',
|
||||||
|
reportBatchDownloadPdf: '/report/job/batchDownloadPdf',
|
||||||
|
reportDownloadPdf: '/report/job/downloadPdf',
|
||||||
|
reportView: '/report/job/view',
|
||||||
// 业务
|
// 业务
|
||||||
panel: '/visual/panel',
|
panel: '/visual/panel',
|
||||||
chart: '/visual/chart',
|
chart: '/visual/chart',
|
||||||
@@ -100,6 +118,12 @@ export const api = {
|
|||||||
overviewBasic: '/interface/detection/performance/detail/overview/basic',
|
overviewBasic: '/interface/detection/performance/detail/overview/basic',
|
||||||
metric: '/interface/detection/performance/detail/overview/metric'
|
metric: '/interface/detection/performance/detail/overview/metric'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// Dashboard
|
||||||
|
dashboard: {
|
||||||
|
DnsServiceInsights: {
|
||||||
|
alarmInfoCount: '/interface/dns/alarmInfoCount'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +196,7 @@ export async function getConfigJson () {
|
|||||||
|
|
||||||
export async function getPermission () {
|
export async function getPermission () {
|
||||||
const request = new Promise(resolve => {
|
const request = new Promise(resolve => {
|
||||||
post(api.permission, { token: localStorage.getItem('cn-token') }).then(response => {
|
post(api.permission, { token: localStorage.getItem(storageKey.token) }).then(response => {
|
||||||
resolve({
|
resolve({
|
||||||
menuList: sortByOrderNum(response.data.menus),
|
menuList: sortByOrderNum(response.data.menus),
|
||||||
buttonList: response.data.buttons,
|
buttonList: response.data.buttons,
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ export const storageKey = {
|
|||||||
username: 'cn-username',
|
username: 'cn-username',
|
||||||
sysName: 'cn-sys-name',
|
sysName: 'cn-sys-name',
|
||||||
sysLogo: 'cn-sys-logo',
|
sysLogo: 'cn-sys-logo',
|
||||||
|
pageSize: 'cn-pageSize',
|
||||||
|
sysTimezone: 'cn-sys-timezone',
|
||||||
|
tableTitle: 'cn-tableTitle',
|
||||||
|
dataRangeHistory: 'date-range-history',
|
||||||
tableTitlePrefix: 'cn-table-title',
|
tableTitlePrefix: 'cn-table-title',
|
||||||
tablePageSizePrefix: 'cn-page-size',
|
tablePageSizePrefix: 'cn-page-size',
|
||||||
leftMenuShrink: 'cn-left-menu-shrink',
|
leftMenuShrink: 'cn-left-menu-shrink',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import axios from 'axios'
|
|||||||
import { storageKey } from '@/utils/constants'
|
import { storageKey } from '@/utils/constants'
|
||||||
|
|
||||||
axios.interceptors.request.use(config => {
|
axios.interceptors.request.use(config => {
|
||||||
const token = localStorage.getItem('cn-token')
|
const token = localStorage.getItem(storageKey.token)
|
||||||
if (token) {
|
if (token) {
|
||||||
config.headers.Authorization = token // 请求头token
|
config.headers.Authorization = token // 请求头token
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ import unitConvert from '@/utils/unit-convert'
|
|||||||
import ChartTablePagination from '@/views/charts/charts/ChartTablePagination'
|
import ChartTablePagination from '@/views/charts/charts/ChartTablePagination'
|
||||||
import { get } from '@/utils/http'
|
import { get } from '@/utils/http'
|
||||||
import { getMillisecond } from '@/utils/date-util'
|
import { getMillisecond } from '@/utils/date-util'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'isAlarmInfo',
|
name: 'isAlarmInfo',
|
||||||
@@ -189,7 +190,7 @@ export default {
|
|||||||
this.tabHandleClickType === 'All' ? '' : this.tabHandleClickType
|
this.tabHandleClickType === 'All' ? '' : this.tabHandleClickType
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
get('/interface/dns/alarmInfoCount', {
|
get(api.dashboard.DnsServiceInsights.alarmInfoCount, {
|
||||||
...countQuery
|
...countQuery
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
@@ -221,7 +222,7 @@ export default {
|
|||||||
startTime: query.startTime,
|
startTime: query.startTime,
|
||||||
endTime: query.endTime
|
endTime: query.endTime
|
||||||
})
|
})
|
||||||
get('/interface/dns/alarmInfoCount', {
|
get(api.dashboard.DnsServiceInsights.alarmInfoCount, {
|
||||||
...query
|
...query
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div class="cn-builtin-left-menu" :class="{'cn-active': builtinId === ''}" @click="builtinTabs('', '')">
|
<div class="cn-builtin-left-menu" :class="{'cn-active': builtinId === ''}" @click="builtinTabs('', '')">
|
||||||
{{$t('dns.all')}}
|
{{$t('dns.all')}}
|
||||||
</div>
|
</div>
|
||||||
<div class="cn-builtin-left-menu" :class="{'cn-active': builtinId === item.id}" v-for="item in builtinReportLeftMenu" :key="item.id" @click="builtinTabs(item, item.id)">
|
<div class="cn-builtin-left-menu" :class="{'cn-active': builtinId === item.id}" v-for="item in builtinReportLeftMenu" :key="item.id" @click="builtinTabs(item.id)">
|
||||||
{{item.name}}
|
{{item.name}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,10 +56,10 @@ export default {
|
|||||||
name: 'Report',
|
name: 'Report',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
builtinReportLeftMenu: [],
|
builtinReportLeftMenu: [], // 左侧列表菜单数据
|
||||||
builtinColor: false,
|
builtinColor: false,
|
||||||
builtinId: '',
|
builtinId: '',
|
||||||
url: api.builtinReport,
|
url: api.reportJob,
|
||||||
blankObject: { // 空白对象
|
blankObject: { // 空白对象
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
@@ -78,20 +78,20 @@ export default {
|
|||||||
builtinReportTable
|
builtinReportTable
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
builtinReportData () {
|
queryGetTempData () {
|
||||||
get('/report/temp').then(res => {
|
get(api.reportTemp).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.builtinReportLeftMenu = res.data.list
|
this.builtinReportLeftMenu = res.data.list
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
builtinTabs (data, id) {
|
builtinTabs (id) {
|
||||||
this.builtinId = id
|
this.builtinId = id
|
||||||
this.getTableData({ name: data.name, tempId: data.id })
|
this.getTableData({ tempId: id })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.builtinReportData()
|
this.queryGetTempData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ import cnDataList from '@/components/table/CnDataList'
|
|||||||
import dataListMixin from '@/mixins/data-list'
|
import dataListMixin from '@/mixins/data-list'
|
||||||
import i18nTable from '@/components/table/settings/I18nTable'
|
import i18nTable from '@/components/table/settings/I18nTable'
|
||||||
import i18nBox from '@/components/rightBox/settings/I18nBox'
|
import i18nBox from '@/components/rightBox/settings/I18nBox'
|
||||||
|
import { api } from '@/utils/api'
|
||||||
import { put } from '@/utils/http'
|
import { put } from '@/utils/http'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -70,7 +71,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
url: 'sys/i18n',
|
url: api.i18n,
|
||||||
blankObject: { // 空白对象
|
blankObject: { // 空白对象
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user