|
@@ -1,15 +1,15 @@
|
|
|
<template>
|
|
|
<div class="page page-full border bg padding">
|
|
|
<el-form inline ref="queryRef" @keyup.enter="getList(1)">
|
|
|
- <el-form-item label="关键字:" prop="keyWord">
|
|
|
- <el-input v-model="params.keyWord" placeholder="请输入关键字" clearable style="width: 240px" />
|
|
|
+ <el-form-item :label="$t('message.property.attribute.form.keyword') + ':'" prop="keyWord">
|
|
|
+ <el-input v-model="params.keyWord" :placeholder="$t('message.property.attribute.form.keywordPlaceholder')" clearable style="width: 240px" />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" class="ml10" @click="getList(1)">
|
|
|
<el-icon>
|
|
|
<ele-Search />
|
|
|
</el-icon>
|
|
|
- 查询
|
|
|
+ {{ $t('message.tableI18nAction.query') }}
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -17,13 +17,13 @@
|
|
|
<el-icon>
|
|
|
<ele-FolderAdd />
|
|
|
</el-icon>
|
|
|
- 新增属性
|
|
|
+ {{ $t('message.property.attribute.actions.add') }}
|
|
|
</el-button>
|
|
|
<el-button type="info" @click="batchdel()" v-auth="'batchdel'">
|
|
|
<el-icon>
|
|
|
<ele-FolderAdd />
|
|
|
</el-icon>
|
|
|
- 删除
|
|
|
+ {{ $t('message.tableI18nAction.delete') }}
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -55,15 +55,15 @@
|
|
|
<div class="page page-full">
|
|
|
<el-table :data="tableData" @selection-change="handleSelectionChange" style="width: 100%" row-key="id" v-loading="loading">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column prop="id" v-col="'id'" label="ID" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="name" v-col="'name'" label="字段名称" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="title" v-col="'title'" label="字段标题" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="types" v-col="'types'" label="字段类型" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="createdAt" v-col="'createdAt'" label="创建时间" width="160" align="center"></el-table-column>
|
|
|
- <el-table-column label="操作" width="200" align="center">
|
|
|
+ <el-table-column prop="id" v-col="'id'" :label="$t('message.tableI18nColumn.id')" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="name" v-col="'name'" :label="$t('message.property.attribute.columns.fieldName')" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="title" v-col="'title'" :label="$t('message.property.attribute.columns.fieldTitle')" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="types" v-col="'types'" :label="$t('message.property.attribute.columns.fieldType')" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="createdAt" v-col="'createdAt'" :label="$t('message.property.attribute.columns.createdAt')" width="160" align="center"></el-table-column>
|
|
|
+ <el-table-column :label="$t('message.tableI18nColumn.operation')" width="200" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-button size="small" text v-auth="'edit'" type="warning" @click="addOrEdit(scope.row)">编辑</el-button>
|
|
|
- <el-button size="small" text v-auth="'del'" type="info" @click="del(scope.row)">删除</el-button>
|
|
|
+ <el-button size="small" text v-auth="'edit'" type="warning" @click="addOrEdit(scope.row)">{{ $t('message.tableI18nAction.edit') }}</el-button>
|
|
|
+ <el-button size="small" text v-auth="'del'" type="info" @click="del(scope.row)">{{ $t('message.tableI18nAction.delete') }}</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -87,6 +87,7 @@ import { useSearch } from '/@/hooks/useCommon'
|
|
|
import { Folder } from '@element-plus/icons-vue'
|
|
|
|
|
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
|
|
+import { useI18n } from 'vue-i18n'
|
|
|
import EditForm from './edit.vue'
|
|
|
interface Tree {
|
|
|
label: string
|
|
@@ -100,6 +101,7 @@ const defaultProps = {
|
|
|
}
|
|
|
|
|
|
const queryRef = ref()
|
|
|
+const { t } = useI18n()
|
|
|
const router = useRouter()
|
|
|
const productData = ref([])
|
|
|
const mergedData = ref()
|
|
@@ -197,24 +199,24 @@ const buildTree = (category: any, productData: any) => {
|
|
|
return treeNode
|
|
|
}
|
|
|
const batchdel = () => {
|
|
|
- ElMessageBox.confirm('是否确认要批量删除这些数据吗?', '提示', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
+ ElMessageBox.confirm(t('message.property.attribute.messages.batchDeleteConfirm'), t('message.property.attribute.messages.tips'), {
|
|
|
+ confirmButtonText: t('message.property.attribute.messages.confirm'),
|
|
|
+ cancelButtonText: t('message.property.attribute.messages.cancel'),
|
|
|
type: 'warning',
|
|
|
}).then(async () => {
|
|
|
await device.dev_asset_metadata.delete({ ids: ids.value })
|
|
|
- ElMessage.success('删除成功')
|
|
|
+ ElMessage.success(t('message.property.attribute.messages.deleteSuccess'))
|
|
|
getList()
|
|
|
})
|
|
|
}
|
|
|
const del = (row: any) => {
|
|
|
- ElMessageBox.confirm('是否确认删除名称为:"' + row.name + '"的数据项?', '提示', {
|
|
|
- confirmButtonText: '确认',
|
|
|
- cancelButtonText: '取消',
|
|
|
+ ElMessageBox.confirm(t('message.property.attribute.messages.deleteItemConfirm', { name: row.name }), t('message.property.attribute.messages.tips'), {
|
|
|
+ confirmButtonText: t('message.property.attribute.messages.confirm'),
|
|
|
+ cancelButtonText: t('message.property.attribute.messages.cancel'),
|
|
|
type: 'warning',
|
|
|
}).then(async () => {
|
|
|
await device.dev_asset_metadata.delete({ ids: row.id })
|
|
|
- ElMessage.success('删除成功')
|
|
|
+ ElMessage.success(t('message.property.attribute.messages.deleteSuccess'))
|
|
|
getList()
|
|
|
})
|
|
|
}
|