mirror of
https://github.com/dataease/dataease.git
synced 2026-05-24 06:18:10 +08:00
Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
@@ -4,13 +4,13 @@
|
||||
<svg-icon class-name="international-icon" icon-class="language" />
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :disabled="language==='zh'" command="zh">
|
||||
<el-dropdown-item :disabled="language==='zh_CN'" command="zh_CN">
|
||||
简体
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="language==='tw'" command="tw">
|
||||
<el-dropdown-item :disabled="language==='zh_TW'" command="zh_TW">
|
||||
繁体
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="language==='en'" command="en">
|
||||
<el-dropdown-item :disabled="language==='en_US'" command="en_US">
|
||||
English
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item :disabled="language==='es'" command="es">
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
{{ message }}
|
||||
</div>
|
||||
</div>
|
||||
<chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table')" :ref="element.propValue.id" class="chart-class" :chart="chart" />
|
||||
<table-normal v-if="requestStatus==='success'&&chart.type && chart.type.includes('table')" :chart="chart" class="table-class" />
|
||||
<chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" />
|
||||
<table-normal v-if="requestStatus==='success'&&chart.type && chart.type.includes('table')" :ref="element.propValue.id" :chart="chart" class="table-class" />
|
||||
<label-normal v-if="requestStatus==='success'&&chart.type && chart.type.includes('text')" :ref="element.propValue.id" :chart="chart" class="table-class" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -16,6 +17,7 @@
|
||||
import { viewData } from '@/api/panel/panel'
|
||||
import ChartComponent from '@/views/chart/components/ChartComponent.vue'
|
||||
import TableNormal from '@/views/chart/components/table/TableNormal'
|
||||
import LabelNormal from '../../../views/chart/components/normal/LabelNormal'
|
||||
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
@@ -33,7 +35,7 @@ import {
|
||||
|
||||
export default {
|
||||
name: 'UserView',
|
||||
components: { ChartComponent, TableNormal },
|
||||
components: { ChartComponent, TableNormal, LabelNormal },
|
||||
props: {
|
||||
element: {
|
||||
type: Object
|
||||
|
||||
@@ -4,13 +4,11 @@ import Cookies from 'js-cookie'
|
||||
import elementEnLocale from 'element-ui/lib/locale/lang/en' // element-ui lang
|
||||
import elementZhLocale from 'element-ui/lib/locale/lang/zh-CN'// element-ui lang
|
||||
import elementTWLocale from 'element-ui/lib/locale/lang/zh-TW'// element-ui lang
|
||||
import elementEsLocale from 'element-ui/lib/locale/lang/es'// element-ui lang
|
||||
import elementJaLocale from 'element-ui/lib/locale/lang/ja'// element-ui lang
|
||||
|
||||
import enLocale from './en'
|
||||
import zhLocale from './zh'
|
||||
import twLocale from './tw'
|
||||
import esLocale from './es'
|
||||
import jaLocale from './ja'
|
||||
|
||||
import fuZh from 'fit2cloud-ui/src/locale/lang/zh-CN' // 加载fit2cloud的内容
|
||||
|
||||
import fuEn from 'fit2cloud-ui/src/locale/lang/en_US' // 加载fit2cloud的内容
|
||||
@@ -18,27 +16,19 @@ import fuEn from 'fit2cloud-ui/src/locale/lang/en_US' // 加载fit2cloud的内
|
||||
Vue.use(VueI18n)
|
||||
|
||||
const messages = {
|
||||
en: {
|
||||
en_US: {
|
||||
...enLocale,
|
||||
...elementEnLocale,
|
||||
...fuEn
|
||||
},
|
||||
zh: {
|
||||
zh_CN: {
|
||||
...zhLocale,
|
||||
...elementZhLocale,
|
||||
...fuZh
|
||||
},
|
||||
tw: {
|
||||
zh_TW: {
|
||||
...twLocale,
|
||||
...elementTWLocale
|
||||
},
|
||||
es: {
|
||||
...esLocale,
|
||||
...elementEsLocale
|
||||
},
|
||||
ja: {
|
||||
...jaLocale,
|
||||
...elementJaLocale
|
||||
}
|
||||
}
|
||||
export function getLanguage() {
|
||||
@@ -53,7 +43,7 @@ export function getLanguage() {
|
||||
return locale
|
||||
}
|
||||
}
|
||||
return 'zh'
|
||||
return 'zh_CN'
|
||||
}
|
||||
const i18n = new VueI18n({
|
||||
// set locale
|
||||
|
||||
@@ -87,6 +87,7 @@ export default {
|
||||
password_error: '密码不小于6位'
|
||||
},
|
||||
commons: {
|
||||
close: '关闭',
|
||||
icon: '图标',
|
||||
all: '全部',
|
||||
enable: '启用',
|
||||
|
||||
@@ -67,7 +67,6 @@ Vue.use(message)
|
||||
Vue.config.productionTip = false
|
||||
|
||||
Vue.prototype.hasDataPermission = function(pTarget, pSource) {
|
||||
debugger
|
||||
if (pSource && pTarget) {
|
||||
return pSource.indexOf(pTarget) > -1
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { resetRouter } from '@/router'
|
||||
import { format } from '@/utils/formatUi'
|
||||
import { getLanguage } from '@/lang/index'
|
||||
import Cookies from 'js-cookie'
|
||||
import router from '@/router'
|
||||
const getDefaultState = () => {
|
||||
return {
|
||||
token: getToken(),
|
||||
@@ -101,6 +102,9 @@ const actions = {
|
||||
commit('SET_PERMISSIONS', permissions)
|
||||
|
||||
commit('SET_LANGUAGE', language)
|
||||
|
||||
// axios.defaults.headers.common['Accept-Language'] = language || 'zh_CN'
|
||||
// document.querySelector('html').setAttribute('lang', language || 'zh_CN')
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
@@ -155,6 +159,7 @@ const actions = {
|
||||
setLanguage({ commit }, language) {
|
||||
languageApi(language).then(() => {
|
||||
commit('SET_LANGUAGE', language)
|
||||
router.go(0)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,10 @@ service.interceptors.request.use(
|
||||
if ((linkToken = getLinkToken()) !== null) {
|
||||
config.headers[LinkTokenKey] = linkToken
|
||||
}
|
||||
|
||||
if (i18n.locale) {
|
||||
config.headers['Accept-Language'] = i18n.locale
|
||||
}
|
||||
// 增加loading
|
||||
|
||||
config.loading && tryShowLoading(store.getters.currentPath)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
<script>
|
||||
import { hexColorToRGBA } from '../../chart/util'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
|
||||
export default {
|
||||
name: 'LabelNormal',
|
||||
@@ -83,6 +84,10 @@ export default {
|
||||
mounted() {
|
||||
this.init()
|
||||
this.calcHeight()
|
||||
// 监听元素变动事件
|
||||
eventBus.$on('resizing', (componentId) => {
|
||||
this.chartResize()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
@@ -94,14 +99,14 @@ export default {
|
||||
},
|
||||
calcHeight() {
|
||||
const that = this
|
||||
setTimeout(function() {
|
||||
// const currentHeight = document.documentElement.clientHeight
|
||||
// const tableMaxHeight = currentHeight - 56 - 40 - 84 - that.$refs.title.offsetHeight - 20
|
||||
const currentHeight = that.$refs.tableContainer.offsetHeight
|
||||
const contentHeight = currentHeight - that.$refs.title.offsetHeight
|
||||
that.height = contentHeight + 'px'
|
||||
that.content_class.height = that.height
|
||||
}, 10)
|
||||
this.$nextTick(function() {
|
||||
if (that.$refs.tableContainer) {
|
||||
const currentHeight = that.$refs.tableContainer.offsetHeight
|
||||
const contentHeight = currentHeight - that.$refs.title.offsetHeight
|
||||
that.height = contentHeight + 'px'
|
||||
that.content_class.height = that.height
|
||||
}
|
||||
})
|
||||
},
|
||||
initStyle() {
|
||||
if (this.chart.customAttr) {
|
||||
@@ -135,6 +140,10 @@ export default {
|
||||
this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
|
||||
}
|
||||
}
|
||||
},
|
||||
chartResize() {
|
||||
// 指定图表的配置项和数据
|
||||
this.calcHeight()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
<script>
|
||||
import { hexColorToRGBA } from '../../chart/util'
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
|
||||
export default {
|
||||
name: 'TableNormal',
|
||||
@@ -91,6 +92,10 @@ export default {
|
||||
mounted() {
|
||||
this.init()
|
||||
this.calcHeight()
|
||||
// 监听元素变动事件
|
||||
eventBus.$on('resizing', (componentId) => {
|
||||
this.chartResize()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
@@ -111,23 +116,23 @@ export default {
|
||||
},
|
||||
calcHeight() {
|
||||
const that = this
|
||||
setTimeout(function() {
|
||||
// const currentHeight = document.documentElement.clientHeight
|
||||
// const tableMaxHeight = currentHeight - 56 - 40 - 84 - that.$refs.title.offsetHeight - 20
|
||||
const currentHeight = that.$refs.tableContainer.offsetHeight
|
||||
const tableMaxHeight = currentHeight - that.$refs.title.offsetHeight
|
||||
let tableHeight
|
||||
if (that.chart.data) {
|
||||
tableHeight = (that.chart.data.tableRow.length + 2) * 36
|
||||
} else {
|
||||
tableHeight = 0
|
||||
this.$nextTick(function() {
|
||||
if (that.$refs.tableContainer) {
|
||||
const currentHeight = that.$refs.tableContainer.offsetHeight
|
||||
const tableMaxHeight = currentHeight - that.$refs.title.offsetHeight
|
||||
let tableHeight
|
||||
if (that.chart.data) {
|
||||
tableHeight = (that.chart.data.tableRow.length + 2) * 36
|
||||
} else {
|
||||
tableHeight = 0
|
||||
}
|
||||
if (tableHeight > tableMaxHeight) {
|
||||
that.height = tableMaxHeight + 'px'
|
||||
} else {
|
||||
that.height = 'auto'
|
||||
}
|
||||
}
|
||||
if (tableHeight > tableMaxHeight) {
|
||||
that.height = tableMaxHeight + 'px'
|
||||
} else {
|
||||
that.height = 'auto'
|
||||
}
|
||||
}, 10)
|
||||
})
|
||||
},
|
||||
initStyle() {
|
||||
if (this.chart.customAttr) {
|
||||
@@ -207,6 +212,11 @@ export default {
|
||||
})
|
||||
// 返回一个二维数组的表尾合计(不要平均值,就不要在数组中添加)
|
||||
return [means]
|
||||
},
|
||||
|
||||
chartResize() {
|
||||
// 指定图表的配置项和数据
|
||||
this.calcHeight()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
<div v-if="valid" class="auth-root-class">
|
||||
<span slot="footer">
|
||||
|
||||
<el-button v-if="!form.enablePwd" v-clipboard:copy="form.uri" v-clipboard:success="onCopy" v-clipboard:error="onError" type="primary">复制链接</el-button>
|
||||
<el-button v-if="form.enablePwd" v-clipboard:copy="form.uri + ' 密码: '+ form.pwd" v-clipboard:success="onCopy" v-clipboard:error="onError" type="primary">复制链接及密码</el-button>
|
||||
<el-button v-if="!form.enablePwd" v-clipboard:copy="form.uri" v-clipboard:success="onCopy" v-clipboard:error="onError" size="mini" type="primary">复制链接</el-button>
|
||||
<el-button v-if="form.enablePwd" v-clipboard:copy="form.uri + ' 密码: '+ form.pwd" v-clipboard:success="onCopy" v-clipboard:error="onError" size="mini" type="primary">复制链接及密码</el-button>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
</el-tabs>
|
||||
<div class="auth-root-class">
|
||||
<span slot="footer">
|
||||
<el-button @click="cancel">{{ $t('commons.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="save">{{ $t('commons.confirm') }}</el-button>
|
||||
<el-button size="mini" @click="cancel">{{ $t('commons.cancel') }}</el-button>
|
||||
<el-button type="primary" size="mini" @click="save">{{ $t('commons.confirm') }}</el-button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -362,6 +362,10 @@ export default {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.ms-main-container {
|
||||
height: calc(100vh - 91px);
|
||||
}
|
||||
|
||||
.de-header {
|
||||
height: 35px !important;
|
||||
border-bottom: 1px solid #E6E6E6;
|
||||
|
||||
@@ -30,7 +30,10 @@
|
||||
<el-row>
|
||||
<span class="header-title">
|
||||
{{ $t('panel.panel') }}
|
||||
<el-button style="float: right;padding-right: 7px;" type="text" icon="el-icon-circle-plus" @click="showEditPanel(newFolder)" />
|
||||
<!-- <el-button style="float: right;padding-right: 7px;" type="text" @click="showEditPanel(newFolder)" />-->
|
||||
<el-button style="float: right;" type="primary" size="mini" @click="showEditPanel(newFolder)">
|
||||
{{ $t('panel.groupAdd') }}
|
||||
</el-button>
|
||||
</span>
|
||||
</el-row>
|
||||
<el-col class="custom-tree-container">
|
||||
@@ -331,12 +334,14 @@ export default {
|
||||
this.editPanel.panelInfo.name = this.$t('panel.panelAdd')
|
||||
this.editPanel.panelInfo.pid = param.data.id
|
||||
this.editPanel.panelInfo.level = param.data.level + 1
|
||||
this.editPanel.panelInfo.panelType = 'self'
|
||||
break
|
||||
case 'newFirstFolder':
|
||||
this.editPanel.titlePre = this.$t('commons.create')
|
||||
this.editPanel.panelInfo.name = ''
|
||||
this.editPanel.panelInfo.pid = null
|
||||
this.editPanel.panelInfo.level = 0
|
||||
this.editPanel.panelInfo.panelType = 'self'
|
||||
break
|
||||
case 'edit':
|
||||
case 'rename':
|
||||
|
||||
@@ -28,11 +28,13 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.organization')" prop="dept">
|
||||
<treeselect
|
||||
ref="deptTreeSelect"
|
||||
v-model="form.deptId"
|
||||
:options="depts"
|
||||
:load-options="loadDepts"
|
||||
:auto-load-root-options="false"
|
||||
:placeholder="$t('user.choose_org')"
|
||||
@open="filterData"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.role')" prop="roleIds">
|
||||
@@ -257,6 +259,15 @@ export default {
|
||||
},
|
||||
backToList() {
|
||||
this.$router.push({ name: '用户管理' })
|
||||
},
|
||||
filterData(instanceId) {
|
||||
const results = this.depts.map(node => {
|
||||
if (node.hasChildren) {
|
||||
node.children = null
|
||||
}
|
||||
return node
|
||||
})
|
||||
this.depts = results
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ export default {
|
||||
}
|
||||
],
|
||||
searchConfig: {
|
||||
useQuickSearch: false,
|
||||
useQuickSearch: true,
|
||||
quickPlaceholder: '按姓名搜索',
|
||||
components: [
|
||||
{ field: 'nick_name', label: '姓名', component: 'FuComplexInput' },
|
||||
|
||||
Reference in New Issue
Block a user