Browse Source

[Fix][UI Next] Fix table of user-manage did not switch language correctly (#8302)

* [Fix][UI Next] Fix Security User Manage route was outdated

* [Fix][UI Next] Fix table of user-manage did not switch language correctly
3.0.0/version-upgrade
lilyzhou 3 years ago committed by GitHub
parent
commit
f93dceaf9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-ui-next/src/locales/modules/en_US.ts
  2. 2
      dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
  3. 12
      dolphinscheduler-ui-next/src/views/security/user-manage/use-table.tsx

2
dolphinscheduler-ui-next/src/locales/modules/en_US.ts

@ -623,6 +623,8 @@ const security = {
phone: 'Phone',
phone_rule_msg: 'Please enter valid phone number',
state: 'State',
state_enabled: 'Enabled',
state_disabled: 'Disabled',
create_time: 'Create Time',
update_time: 'Update Time',
operation: 'Operation',

2
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts

@ -620,6 +620,8 @@ const security = {
phone: '手机',
phone_rule_msg: '请输入正确的手机号',
state: '状态',
state_enabled: '启用',
state_disabled: '停用',
create_time: '创建时间',
update_time: '更新时间',
operation: '操作',

12
dolphinscheduler-ui-next/src/views/security/user-manage/use-table.tsx

@ -15,7 +15,7 @@
* limitations under the License.
*/
import { ref, watch, onBeforeMount } from 'vue'
import { ref, watch, onBeforeMount, computed } from 'vue'
import { NSpace, NTooltip, NButton, NIcon, NTag } from 'naive-ui'
import { EditOutlined, DeleteOutlined } from '@vicons/antd'
import { queryUserList } from '@/service/modules/users'
@ -28,7 +28,8 @@ type UseTableProps = {
function useColumns({ onEdit, onDelete }: UseTableProps) {
const { t } = useI18n()
const columns: any[] = [
const columns = computed(() =>
[
{
title: t('security.user.index'),
key: 'index',
@ -60,9 +61,9 @@ function useColumns({ onEdit, onDelete }: UseTableProps) {
key: 'state',
render: (rowData: any, rowIndex: number) => {
return rowData.state === 1 ? (
<NTag type='success'></NTag>
<NTag type='success'>{t('security.user.state_enabled')}</NTag>
) : (
<NTag type='error'></NTag>
<NTag type='error'>{t('security.user.state_disabled')}</NTag>
)
}
},
@ -135,8 +136,9 @@ function useColumns({ onEdit, onDelete }: UseTableProps) {
}
}
].map((d: any) => ({ ...d, width: d.width || 160 }))
)
const scrollX = columns.reduce((p, c) => p + c.width, 0)
const scrollX = columns.value.reduce((p, c) => p + c.width, 0)
return {
columns,

Loading…
Cancel
Save