提交 08153b1f authored 作者: junjie's avatar junjie

feat(frontend):数据集 视图 名称长度限制

上级 4e7d0173
...@@ -3,6 +3,7 @@ import request from '@/utils/request' ...@@ -3,6 +3,7 @@ import request from '@/utils/request'
export function validateLic() { export function validateLic() {
return request({ return request({
url: '/anonymous/license/validate', url: '/anonymous/license/validate',
method: 'get' method: 'get',
hideMsg: true
}) })
} }
...@@ -275,7 +275,8 @@ export default { ...@@ -275,7 +275,8 @@ export default {
select_module: '选择模块', select_module: '选择模块',
default_module: '默认模块' default_module: '默认模块'
}, },
datasource: '数据连接' datasource: '数据连接',
char_can_not_more_50: '名称不能超过50字符'
}, },
documentation: { documentation: {
documentation: '文档', documentation: '文档',
......
...@@ -262,12 +262,14 @@ export default { ...@@ -262,12 +262,14 @@ export default {
}, },
groupFormRules: { groupFormRules: {
name: [ name: [
{ required: true, message: this.$t('commons.input_content'), trigger: 'change' } { required: true, message: this.$t('commons.input_content'), trigger: 'change' },
{ max: 50, message: this.$t('commons.char_can_not_more_50'), trigger: 'change' }
] ]
}, },
tableFormRules: { tableFormRules: {
name: [ name: [
{ required: true, message: this.$t('commons.input_content'), trigger: 'change' } { required: true, message: this.$t('commons.input_content'), trigger: 'change' },
{ max: 50, message: this.$t('commons.char_can_not_more_50'), trigger: 'change' }
] ]
}, },
selectTableFlag: false, selectTableFlag: false,
...@@ -366,11 +368,11 @@ export default { ...@@ -366,11 +368,11 @@ export default {
this.groupTree(this.groupForm) this.groupTree(this.groupForm)
}) })
} else { } else {
this.$message({ // this.$message({
message: this.$t('commons.input_content'), // message: this.$t('commons.input_content'),
type: 'error', // type: 'error',
showClose: true // showClose: true
}) // })
return false return false
} }
}) })
...@@ -392,11 +394,11 @@ export default { ...@@ -392,11 +394,11 @@ export default {
this.$store.dispatch('chart/setTable', null) this.$store.dispatch('chart/setTable', null)
}) })
} else { } else {
this.$message({ // this.$message({
message: this.$t('commons.input_content'), // message: this.$t('commons.input_content'),
type: 'error', // type: 'error',
showClose: true // showClose: true
}) // })
return false return false
} }
}) })
...@@ -545,7 +547,7 @@ export default { ...@@ -545,7 +547,7 @@ export default {
}, },
createChart() { createChart() {
if (!this.table.name) { if (!this.table.name || this.table.name === '') {
this.$message({ this.$message({
message: this.$t('chart.name_can_not_empty'), message: this.$t('chart.name_can_not_empty'),
type: 'error', type: 'error',
...@@ -553,6 +555,14 @@ export default { ...@@ -553,6 +555,14 @@ export default {
}) })
return return
} }
if (this.table.name.length > 50) {
this.$message({
showClose: true,
message: this.$t('commons.char_can_not_more_50'),
type: 'error'
})
return
}
const view = {} const view = {}
view.name = this.table.name view.name = this.table.name
view.title = this.table.name view.title = this.table.name
......
...@@ -181,6 +181,22 @@ export default { ...@@ -181,6 +181,22 @@ export default {
} }
}, },
save() { save() {
if (!this.name || this.name === '') {
this.$message({
showClose: true,
message: this.$t('dataset.pls_input_name'),
type: 'error'
})
return
}
if (this.name.length > 50) {
this.$message({
showClose: true,
message: this.$t('commons.char_can_not_more_50'),
type: 'error'
})
return
}
const table = { const table = {
id: this.param.tableId, id: this.param.tableId,
name: this.name, name: this.name,
......
...@@ -158,6 +158,22 @@ export default { ...@@ -158,6 +158,22 @@ export default {
save() { save() {
// console.log(this.checkTableList); // console.log(this.checkTableList);
// console.log(this.scene); // console.log(this.scene);
if (!this.name || this.name === '') {
this.$message({
showClose: true,
message: this.$t('dataset.pls_input_name'),
type: 'error'
})
return
}
if (this.name.length > 50) {
this.$message({
showClose: true,
message: this.$t('commons.char_can_not_more_50'),
type: 'error'
})
return
}
const table = { const table = {
id: this.param.tableId, id: this.param.tableId,
name: this.name, name: this.name,
......
...@@ -245,6 +245,14 @@ export default { ...@@ -245,6 +245,14 @@ export default {
}) })
return return
} }
if (this.name.length > 50) {
this.$message({
showClose: true,
message: this.$t('commons.char_can_not_more_50'),
type: 'error'
})
return
}
const table = { const table = {
id: this.param.tableId, id: this.param.tableId,
name: this.name, name: this.name,
......
...@@ -86,6 +86,9 @@ ...@@ -86,6 +86,9 @@
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('rename',data,node)"> <el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('rename',data,node)">
{{ $t('dataset.rename') }} {{ $t('dataset.rename') }}
</el-dropdown-item> </el-dropdown-item>
<!-- <el-dropdown-item icon="el-icon-right" :command="beforeClickMore('move',data,node)">-->
<!-- {{$t('dataset.move_to')}}-->
<!-- </el-dropdown-item>-->
<el-dropdown-item icon="el-icon-delete" :command="beforeClickMore('delete',data,node)"> <el-dropdown-item icon="el-icon-delete" :command="beforeClickMore('delete',data,node)">
{{ $t('dataset.delete') }} {{ $t('dataset.delete') }}
</el-dropdown-item> </el-dropdown-item>
...@@ -147,6 +150,12 @@ ...@@ -147,6 +150,12 @@
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<!-- <el-button type="primary" size="mini" plain>
{{ $t('dataset.update') }}
</el-button>
<el-button type="primary" size="mini" plain>
{{ $t('dataset.process') }}
</el-button> -->
</el-row> </el-row>
<el-row> <el-row>
<el-form> <el-form>
...@@ -198,6 +207,9 @@ ...@@ -198,6 +207,9 @@
<el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('editTable',data,node)"> <el-dropdown-item icon="el-icon-edit-outline" :command="beforeClickMore('editTable',data,node)">
{{ $t('dataset.rename') }} {{ $t('dataset.rename') }}
</el-dropdown-item> </el-dropdown-item>
<!-- <el-dropdown-item icon="el-icon-right" :command="beforeClickMore('move',data,node)">-->
<!-- {{$t('dataset.move_to')}}-->
<!-- </el-dropdown-item>-->
<el-dropdown-item icon="el-icon-delete" :command="beforeClickMore('deleteTable',data,node)"> <el-dropdown-item icon="el-icon-delete" :command="beforeClickMore('deleteTable',data,node)">
{{ $t('dataset.delete') }} {{ $t('dataset.delete') }}
</el-dropdown-item> </el-dropdown-item>
...@@ -213,6 +225,10 @@ ...@@ -213,6 +225,10 @@
<el-form-item :label="$t('commons.name')" prop="name"> <el-form-item :label="$t('commons.name')" prop="name">
<el-input v-model="tableForm.name" /> <el-input v-model="tableForm.name" />
</el-form-item> </el-form-item>
<!-- <el-form-item :label="$t('dataset.mode')" prop="mode">-->
<!-- <el-radio v-model="tableForm.mode" label="0">{{ $t('dataset.direct_connect') }}</el-radio>-->
<!-- <el-radio v-model="tableForm.mode" label="1">{{ $t('dataset.sync_data') }}</el-radio>-->
<!-- </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="mini" @click="closeTable()">{{ $t('dataset.cancel') }}</el-button> <el-button size="mini" @click="closeTable()">{{ $t('dataset.cancel') }}</el-button>
...@@ -226,7 +242,7 @@ ...@@ -226,7 +242,7 @@
</template> </template>
<script> <script>
import { loadTable, getScene, addGroup, delGroup, addTable, delTable, groupTree, isKettleRunning } from '@/api/dataset/dataset' import { loadTable, getScene, addGroup, delGroup, addTable, delTable, groupTree } from '@/api/dataset/dataset'
export default { export default {
name: 'Group', name: 'Group',
...@@ -257,16 +273,14 @@ export default { ...@@ -257,16 +273,14 @@ export default {
}, },
groupFormRules: { groupFormRules: {
name: [ name: [
{ required: true, message: this.$t('commons.input_content'), trigger: 'change' } { required: true, message: this.$t('commons.input_content'), trigger: 'change' },
{ max: 50, message: this.$t('commons.char_can_not_more_50'), trigger: 'change' }
] ]
}, },
tableFormRules: { tableFormRules: {
name: [ name: [
{ required: true, message: this.$t('commons.input_content'), trigger: 'change' }, { required: true, message: this.$t('commons.input_content'), trigger: 'change' },
{ min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur' } { max: 50, message: this.$t('commons.char_can_not_more_50'), trigger: 'change' }
],
mode: [
{ required: true, message: this.$t('commons.input_content'), trigger: 'change' }
] ]
} }
} }
...@@ -366,11 +380,11 @@ export default { ...@@ -366,11 +380,11 @@ export default {
this.tree(this.groupForm) this.tree(this.groupForm)
}) })
} else { } else {
this.$message({ // this.$message({
message: this.$t('commons.input_content'), // message: this.$t('commons.input_error'),
type: 'error', // type: 'error',
showClose: true // showClose: true
}) // })
return false return false
} }
}) })
...@@ -394,6 +408,11 @@ export default { ...@@ -394,6 +408,11 @@ export default {
this.$store.dispatch('dataset/setTable', null) this.$store.dispatch('dataset/setTable', null)
}) })
} else { } else {
// this.$message({
// message: this.$t('commons.input_content'),
// type: 'error',
// showClose: true
// })
return false return false
} }
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论