|
@@ -1,79 +1,79 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="mc-wrapper">
|
|
<div class="mc-wrapper">
|
|
|
<div class="mc-toolbar">
|
|
<div class="mc-toolbar">
|
|
|
- <el-button type="primary" size="small" icon="el-icon-plus" @click="openCreateDialog">新建字段</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-plus" @click="openCreateDialog">{{ $t('新建字段') }}</el-button>
|
|
|
<span class="mc-toolbar-switch">
|
|
<span class="mc-toolbar-switch">
|
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
|
- :title="`确定${sysMetaEnabled ? '停用' : '启用'}系统元数据吗?`"
|
|
|
|
|
- confirm-button-text="确定"
|
|
|
|
|
|
|
+ :title="$t('确定停用系统元数据吗', { action: $t(sysMetaEnabled ? '停用' : '启用') })"
|
|
|
|
|
+ :confirm-button-text="$t('确定')"
|
|
|
@confirm="confirmToggle"
|
|
@confirm="confirmToggle"
|
|
|
>
|
|
>
|
|
|
<el-switch slot="reference" :value="sysMetaEnabled" @change="onToggleSystem" />
|
|
<el-switch slot="reference" :value="sysMetaEnabled" @change="onToggleSystem" />
|
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
|
- <span class="mc-toolbar-label">启用系统元数据</span>
|
|
|
|
|
|
|
+ <span class="mc-toolbar-label">{{ $t('启用系统元数据') }}</span>
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<el-table :data="fields" size="small" stripe style="width: 100%;" height="calc(100vh - 330px)">
|
|
<el-table :data="fields" size="small" stripe style="width: 100%;" height="calc(100vh - 330px)">
|
|
|
- <el-table-column label="字段名称" min-width="120" prop="name" />
|
|
|
|
|
- <el-table-column label="字段类型" width="100" align="center">
|
|
|
|
|
|
|
+ <el-table-column :label="$t('字段名称')" min-width="120" prop="name" />
|
|
|
|
|
+ <el-table-column :label="$t('字段类型')" width="100" align="center">
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
<el-tag size="mini" :type="typeTagType(row.type)">{{ typeLabel(row.type) }}</el-tag>
|
|
<el-tag size="mini" :type="typeTagType(row.type)">{{ typeLabel(row.type) }}</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="类型" width="90" align="center">
|
|
|
|
|
|
|
+ <el-table-column :label="$t('类型')" width="90" align="center">
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
<el-tag size="mini" :type="row.isSystem ? 'warning' : 'success'">
|
|
<el-tag size="mini" :type="row.isSystem ? 'warning' : 'success'">
|
|
|
- {{ row.isSystem ? '系统' : '自定义' }}
|
|
|
|
|
|
|
+ {{ row.isSystem ? $t('系统') : $t('自定义') }}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="120" fixed="right">
|
|
|
|
|
|
|
+ <el-table-column :label="$t('操作')" width="120" fixed="right">
|
|
|
<template v-slot="{ row }">
|
|
<template v-slot="{ row }">
|
|
|
- <el-button type="text" size="mini" @click="openEditDialog(row)" style="margin-right: 12px;">编辑</el-button>
|
|
|
|
|
- <el-button v-if="!row.isSystem" type="text" size="mini" @click="onDeleteClick(row)" style="color: #F56C6C;">删除</el-button>
|
|
|
|
|
|
|
+ <el-button type="text" size="mini" @click="openEditDialog(row)" style="margin-right: 12px;">{{ $t('编辑') }}</el-button>
|
|
|
|
|
+ <el-button v-if="!row.isSystem" type="text" size="mini" @click="onDeleteClick(row)" style="color: #F56C6C;">{{ $t('删除') }}</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
|
|
<!-- 删除确认弹窗 -->
|
|
<!-- 删除确认弹窗 -->
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
- title="确认删除"
|
|
|
|
|
|
|
+ :title="$t('确认删除')"
|
|
|
:visible.sync="deleteDialogVisible"
|
|
:visible.sync="deleteDialogVisible"
|
|
|
width="400px"
|
|
width="400px"
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
append-to-body
|
|
append-to-body
|
|
|
@keyup.enter.native="confirmDelete"
|
|
@keyup.enter.native="confirmDelete"
|
|
|
>
|
|
>
|
|
|
- <span>确定删除「{{ deleteRow ? deleteRow.name : '' }}」字段吗?</span>
|
|
|
|
|
|
|
+ <span>{{$t('确定删除字段', { name: deleteRow ? deleteRow.name : '' })}}</span>
|
|
|
<span slot="footer">
|
|
<span slot="footer">
|
|
|
- <el-button size="small" @click="deleteDialogVisible = false">取 消</el-button>
|
|
|
|
|
- <el-button size="small" type="danger" :loading="deleteLoading" @click="confirmDelete">删除</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" @click="deleteDialogVisible = false">{{ $t('取消') }}</el-button>
|
|
|
|
|
+ <el-button size="small" type="danger" :loading="deleteLoading" @click="confirmDelete">{{ $t('删除') }}</el-button>
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
<!-- 新建/编辑弹窗 -->
|
|
<!-- 新建/编辑弹窗 -->
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
- :title="dialogMode === 'create' ? '新建元数据字段' : '编辑元数据字段'"
|
|
|
|
|
|
|
+ :title="$t(dialogMode === 'create' ? '新建元数据字段' : '编辑元数据字段')"
|
|
|
:visible.sync="dialogVisible"
|
|
:visible.sync="dialogVisible"
|
|
|
width="500px"
|
|
width="500px"
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
append-to-body
|
|
append-to-body
|
|
|
>
|
|
>
|
|
|
<el-form ref="fieldForm" :model="form" :rules="rules" label-width="80px" size="small">
|
|
<el-form ref="fieldForm" :model="form" :rules="rules" label-width="80px" size="small">
|
|
|
- <el-form-item label="字段名称" prop="name">
|
|
|
|
|
- <el-input v-model="form.name" placeholder="如:文档分类" maxlength="20" />
|
|
|
|
|
|
|
+ <el-form-item :label="$t('字段名称')" prop="name">
|
|
|
|
|
+ <el-input v-model="form.name" :placeholder="$t('如:文档分类')" maxlength="20" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="字段类型" prop="type">
|
|
|
|
|
|
|
+ <el-form-item :label="$t('字段类型')" prop="type">
|
|
|
<el-radio-group v-model="form.type" :disabled="dialogMode === 'edit'">
|
|
<el-radio-group v-model="form.type" :disabled="dialogMode === 'edit'">
|
|
|
- <el-radio-button label="text">文本</el-radio-button>
|
|
|
|
|
- <el-radio-button label="date">日期</el-radio-button>
|
|
|
|
|
|
|
+ <el-radio-button label="text">{{ $t('文本') }}</el-radio-button>
|
|
|
|
|
+ <el-radio-button label="date">{{ $t('日期') }}</el-radio-button>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<span slot="footer">
|
|
<span slot="footer">
|
|
|
- <el-button size="small" @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
- <el-button size="small" type="primary" :loading="submitLoading" @click="submitForm">确 定</el-button>
|
|
|
|
|
|
|
+ <el-button size="small" @click="dialogVisible = false">{{ $t('取消') }}</el-button>
|
|
|
|
|
+ <el-button size="small" type="primary" :loading="submitLoading" @click="submitForm">{{ $t('确定') }}</el-button>
|
|
|
</span>
|
|
</span>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</div>
|
|
</div>
|
|
@@ -96,8 +96,8 @@ export default {
|
|
|
type: 'text'
|
|
type: 'text'
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
- name: [{ required: true, message: '请输入字段名称', trigger: 'blur' }],
|
|
|
|
|
- type: [{ required: true, message: '请选择字段类型', trigger: 'change' }]
|
|
|
|
|
|
|
+ name: [{ required: true, message: this.$t('请输入字段名称'), trigger: 'blur' }],
|
|
|
|
|
+ type: [{ required: true, message: this.$t('请选择字段类型'), trigger: 'change' }]
|
|
|
},
|
|
},
|
|
|
submitLoading: false,
|
|
submitLoading: false,
|
|
|
deleteDialogVisible: false,
|
|
deleteDialogVisible: false,
|
|
@@ -115,7 +115,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
typeLabel(type) {
|
|
typeLabel(type) {
|
|
|
- const map = { text: '文本', date: '日期' }
|
|
|
|
|
|
|
+ const map = { text: this.$t('文本'), date: this.$t('日期') }
|
|
|
return map[type] || type
|
|
return map[type] || type
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -204,4 +204,4 @@ export default {
|
|
|
font-size: 13px;
|
|
font-size: 13px;
|
|
|
color: #606266;
|
|
color: #606266;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|