|
@@ -3,23 +3,23 @@
|
|
|
<test v-model="queryParams" :form-config="queryForm"></test>
|
|
|
|
|
|
<el-table :data="tableList" v-loading="loading">
|
|
|
- <el-table-column label="所属行业" align="center" prop="appName" />
|
|
|
- <el-table-column label="产品名称" align="center" prop="name" />
|
|
|
- <el-table-column label="产品ID" align="center" prop="productId" />
|
|
|
- <el-table-column label="设备类型" align="center" prop="deviceType" width="120" />
|
|
|
- <el-table-column label="协议类型" align="center" prop="protocolType" width="120" />
|
|
|
- <el-table-column label="数据格式" align="center" prop="dataFormat" width="120" />
|
|
|
- <el-table-column label="厂商名称" align="center" prop="manufacturerName" />
|
|
|
- <el-table-column label="操作" align="center" width="80">
|
|
|
+ <el-table-column :label="$t('Internet_of_things.product.appName')" align="center" prop="appName" />
|
|
|
+ <el-table-column :label="$t('Internet_of_things.product.name')" align="center" prop="name" />
|
|
|
+ <el-table-column :label="$t('Internet_of_things.product.productId')" align="center" prop="productId" />
|
|
|
+ <el-table-column :label="$t('Internet_of_things.product.deviceType')" align="center" prop="deviceType" width="120" />
|
|
|
+ <el-table-column :label="$t('Internet_of_things.product.protocolType')" align="center" prop="protocolType" width="120" />
|
|
|
+ <el-table-column :label="$t('Internet_of_things.product.dataFormat')" align="center" prop="dataFormat" width="120" />
|
|
|
+ <el-table-column :label="$t('Internet_of_things.product.manufacturerName')" align="center" prop="manufacturerName" />
|
|
|
+ <el-table-column :label="$t('operation')" align="center" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
+ <el-button type="text" @click="handleDelete(scope.row)">{{ $t('delete') }}</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
|
- <el-dialog title="创建产品" v-if="open" :visible.sync="open" width="30%">
|
|
|
+ <el-dialog :title="$t('Internet_of_things.product.addProduct')" v-if="open" :visible.sync="open" width="30%">
|
|
|
<test ref="test" v-model="dialogParams" :form-config="dialogForm" :insideRules="dialogRules"></test>
|
|
|
</el-dialog>
|
|
|
</el-card>
|
|
@@ -45,11 +45,11 @@ export default {
|
|
|
},
|
|
|
queryForm: {
|
|
|
keyword: {
|
|
|
- label: '关键字',
|
|
|
+ label: this.$t('Internet_of_things.product.keyword'),
|
|
|
span: 6,
|
|
|
},
|
|
|
tdaApplicationId: {
|
|
|
- label: '行业',
|
|
|
+ label: this.$t('Internet_of_things.product.industry'),
|
|
|
span: 6,
|
|
|
type: 'select',
|
|
|
data: [],
|
|
@@ -57,7 +57,7 @@ export default {
|
|
|
labelName: 'appName',
|
|
|
},
|
|
|
deviceType: {
|
|
|
- label: '设备类型',
|
|
|
+ label: this.$t('Internet_of_things.product.deviceType'),
|
|
|
span: 6,
|
|
|
type: 'select',
|
|
|
data: [],
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
labelName: 'label',
|
|
|
},
|
|
|
manufacturerName: {
|
|
|
- label: '厂商名称',
|
|
|
+ label: this.$t('Internet_of_things.product.manufacturerName'),
|
|
|
span: 6,
|
|
|
type: 'select',
|
|
|
data: [],
|
|
@@ -88,7 +88,7 @@ export default {
|
|
|
otherButton: {
|
|
|
list: [
|
|
|
{
|
|
|
- name: '创建产品',
|
|
|
+ name: this.$t('Internet_of_things.product.addProduct'),
|
|
|
methodsText: 'add',
|
|
|
type: 'primary',
|
|
|
add: () => {
|
|
@@ -113,19 +113,18 @@ export default {
|
|
|
},
|
|
|
dialogForm: {
|
|
|
loadingStatus: false,
|
|
|
- loadingText: '请稍后',
|
|
|
tdaApplicationId: {
|
|
|
- label: '所属行业',
|
|
|
+ label: this.$t('Internet_of_things.product.appName'),
|
|
|
type: 'select',
|
|
|
data: [],
|
|
|
keyName: 'id',
|
|
|
labelName: 'appName',
|
|
|
},
|
|
|
name: {
|
|
|
- label: '产品名称',
|
|
|
+ label: this.$t('Internet_of_things.product.name'),
|
|
|
},
|
|
|
protocolType: {
|
|
|
- label: '协议类型',
|
|
|
+ label: this.$t('Internet_of_things.product.protocolType'),
|
|
|
type: 'select',
|
|
|
span: 2,
|
|
|
data: [{ label: 'MQTT', value: 'MQTT' }],
|
|
@@ -134,7 +133,7 @@ export default {
|
|
|
disabled: true,
|
|
|
},
|
|
|
dataFormat: {
|
|
|
- label: '数据格式',
|
|
|
+ label: this.$t('Internet_of_things.product.dataFormat'),
|
|
|
type: 'select',
|
|
|
span: 2,
|
|
|
data: [{ label: 'json', value: 'json' }],
|
|
@@ -143,14 +142,14 @@ export default {
|
|
|
disabled: true,
|
|
|
},
|
|
|
manufacturerName: {
|
|
|
- label: '厂商名称',
|
|
|
+ label: this.$t('Internet_of_things.product.manufacturerName'),
|
|
|
type: 'select',
|
|
|
data: [],
|
|
|
keyName: 'value',
|
|
|
labelName: 'label',
|
|
|
},
|
|
|
deviceType: {
|
|
|
- label: '设备类型',
|
|
|
+ label: this.$t('Internet_of_things.product.deviceType'),
|
|
|
type: 'select',
|
|
|
data: [],
|
|
|
keyName: 'value',
|
|
@@ -160,14 +159,14 @@ export default {
|
|
|
align: 'center',
|
|
|
list: [
|
|
|
{
|
|
|
- name: '取消',
|
|
|
+ name: this.$t('cancelText'),
|
|
|
methodsText: 'cancel',
|
|
|
cancel: () => {
|
|
|
this.open = false
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
- name: '确定',
|
|
|
+ name: this.$t('submitText'),
|
|
|
methodsText: 'submit',
|
|
|
type: 'primary',
|
|
|
submit: () => {
|
|
@@ -178,12 +177,12 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
dialogRules: {
|
|
|
- tdaApplicationId: [{ required: true, message: '请选择所属行业', trigger: 'change' }],
|
|
|
- name: [{ required: true, message: '请输入产品名称', trigger: 'blur' }],
|
|
|
- protocolType: [{ required: true, message: '请选择协议类型', trigger: 'change' }],
|
|
|
- dataFormat: [{ required: true, message: '请选择数据格式', trigger: 'change' }],
|
|
|
- manufacturerName: [{ required: true, message: '请选择厂商名称', trigger: 'change' }],
|
|
|
- deviceType: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
|
|
|
+ tdaApplicationId: [{ required: true, message: this.$t('Internet_of_things.product.tdaApplicationIdRules'), trigger: 'change' }],
|
|
|
+ name: [{ required: true, message: this.$t('Internet_of_things.product.nameRules'), trigger: 'blur' }],
|
|
|
+ protocolType: [{ required: true, message: this.$t('Internet_of_things.product.protocolTypeRules'), trigger: 'change' }],
|
|
|
+ dataFormat: [{ required: true, message: this.$t('Internet_of_things.product.dataFormatRules'), trigger: 'change' }],
|
|
|
+ manufacturerName: [{ required: true, message: this.$t('Internet_of_things.product.manufacturerNameRules'), trigger: 'change' }],
|
|
|
+ deviceType: [{ required: true, message: this.$t('Internet_of_things.product.deviceTypeRules'), trigger: 'change' }],
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -255,7 +254,7 @@ export default {
|
|
|
this.dialogForm.loadingStatus = true
|
|
|
API.tdaProductAdd(this.dialogParams).then(
|
|
|
() => {
|
|
|
- this.msgSuccess('添加成功')
|
|
|
+ this.msgSuccess(this.$t('addSuccess'))
|
|
|
this.open = false
|
|
|
this.dialogForm.loadingStatus = false
|
|
|
this.getList()
|
|
@@ -274,13 +273,13 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
handleDelete(row) {
|
|
|
- this.$confirm('请问是否删除产品:' + row.name, '警告', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '确定',
|
|
|
+ this.$confirm(this.$t('askDeleteData'), {
|
|
|
+ confirmButtonText: this.$t('submitText'),
|
|
|
+ cancelButtonText: this.$t('cancelText'),
|
|
|
type: 'warning',
|
|
|
}).then(() => {
|
|
|
API.tdaProductDelete({ id: row.id }).then(() => {
|
|
|
- this.msgSuccess('删除成功')
|
|
|
+ this.msgSuccess(this.$t('deleteSuccess'))
|
|
|
this.getList()
|
|
|
})
|
|
|
})
|