mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-15 14:24:39 +00:00
perf: 优化授权的资产
This commit is contained in:
@@ -5,7 +5,7 @@ import Switcher from '@/components/Form/FormFields/Switcher.vue'
|
||||
import rules from '@/components/Form/DataForm/rules'
|
||||
import BasicTree from '@/components/Form/FormFields/BasicTree.vue'
|
||||
import JsonEditor from '@/components/Form/FormFields/JsonEditor.vue'
|
||||
import { assignIfNot } from '@/utils/common'
|
||||
import { assignIfNot, capitalizeFirst } from '@/utils/common'
|
||||
import TagInput from '@/components/Form/FormFields/TagInput.vue'
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
import TransferSelect from '@/components/Form/FormFields/TransferSelect.vue'
|
||||
@@ -173,7 +173,7 @@ export class FormFieldGenerator {
|
||||
field = Object.assign(field, fieldMeta)
|
||||
field.el = el
|
||||
field.rules = rules
|
||||
field.label = field.label.toUpperCase()
|
||||
field.label = capitalizeFirst(field.label)
|
||||
_.set(field, 'attrs.error', '')
|
||||
Vue.$log.debug('Generate field: ', name, field)
|
||||
return field
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
ObjectRelatedFormatter
|
||||
} from '@/components/Table/TableFormatters'
|
||||
import i18n from '@/i18n/i18n'
|
||||
import { newURL, replaceAllUUID } from '@/utils/common'
|
||||
import { capitalizeFirst, newURL, replaceAllUUID } from '@/utils/common'
|
||||
import ColumnSettingPopover from './components/ColumnSettingPopover.vue'
|
||||
import LabelsFormatter from '@/components/Table/TableFormatters/LabelsFormatter.vue'
|
||||
|
||||
@@ -274,7 +274,7 @@ export default {
|
||||
col = this.addHelpTipsIfNeed(col)
|
||||
col = this.addFilterIfNeed(col)
|
||||
col = this.addOrderingIfNeed(col)
|
||||
col.label = col.label.toUpperCase()
|
||||
col.label = capitalizeFirst(col.label)
|
||||
return col
|
||||
},
|
||||
generateTotalColumns() {
|
||||
|
||||
@@ -27,7 +27,7 @@ Vue.prototype.$tr = (key) => {
|
||||
return i18n.t('' + key)
|
||||
}
|
||||
|
||||
axios.get(`/api/v1/settings/i18n/lina/?lang=${lang}`)
|
||||
axios.get(`/api/v1/settings/i18n/lina/?lang=${lang}&flat=0`)
|
||||
.then((res) => {
|
||||
if (res.status !== 200) {
|
||||
return
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
>
|
||||
<span slot="label">
|
||||
<i v-if="item.icon" :class="item.icon" class="fa " />
|
||||
{{ item.title }}
|
||||
{{ capitalizeFirst(item.title) }}
|
||||
<slot :tab="item.name" name="badge" />
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
@@ -42,6 +42,7 @@
|
||||
<script>
|
||||
import Page from '../Page/'
|
||||
import merge from 'webpack-merge'
|
||||
import { capitalizeFirst } from '@/utils/common'
|
||||
|
||||
const ACTIVE_TAB_KEY = 'activeTab'
|
||||
|
||||
@@ -62,7 +63,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true
|
||||
loading: true,
|
||||
capitalizeFirst: capitalizeFirst
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -415,4 +415,11 @@ export function formatFileSize(bytes) {
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
|
||||
}
|
||||
|
||||
export function capitalizeFirst(string) {
|
||||
if (!string) return string
|
||||
return string.split(' ').map(item => {
|
||||
return item[0].toUpperCase() + item.slice(1)
|
||||
}).join(' ')
|
||||
}
|
||||
|
||||
export { BASE_URL }
|
||||
|
||||
Reference in New Issue
Block a user