提交 a90bc129 authored 作者: taojinlong's avatar taojinlong

fix: 数据集移动

上级 7dfe9ccf
......@@ -46,10 +46,10 @@ public class DataSetTableController {
}
}
@ApiOperation("重命名")
@PostMapping("rename")
public void rename(@RequestBody DataSetTableRequest request) throws Exception {
dataSetTableService.rename(request);
@ApiOperation("修改")
@PostMapping("alter")
public void alter(@RequestBody DataSetTableRequest request) throws Exception {
dataSetTableService.alter(request);
}
@ApiOperation("删除")
......
......@@ -251,12 +251,9 @@ public class DataSetTableService {
return datasetTable;
}
public void rename(DataSetTableRequest request)throws Exception {
public void alter(DataSetTableRequest request)throws Exception {
checkName(request);
DatasetTable datasetTable = new DatasetTable();
datasetTable.setId(request.getId());
datasetTable.setName(request.getName());
datasetTableMapper.updateByPrimaryKeySelective(datasetTable);
datasetTableMapper.updateByPrimaryKeySelective(request);
}
public void delete(String id) throws Exception {
......
......@@ -43,9 +43,9 @@ export function addTable(data) {
})
}
export function rename(data) {
export function alter(data) {
return request({
url: '/dataset/table/rename',
url: '/dataset/table/alter',
method: 'post',
loading: true,
data
......
......@@ -341,7 +341,7 @@
</template>
<script>
import { loadTable, getScene, addGroup, delGroup, addTable, delTable, post, isKettleRunning, rename} from '@/api/dataset/dataset'
import { loadTable, getScene, addGroup, delGroup, addTable, delTable, post, isKettleRunning, alter} from '@/api/dataset/dataset'
import GroupMoveSelector from './GroupMoveSelector'
import DsMoveSelector from './DsMoveSelector'
......@@ -419,23 +419,12 @@ export default {
}
},
computed: {
// sceneData: function() {
// // this.tableTree()
// // console.log(this.$store.state.dataset.sceneData)
// this.refreshNodeBy(this.currGroup.id)
// return this.$store.state.dataset.sceneData
// }
},
created() {
this.kettleState()
},
watch: {
search(val) {
// if (val && val !== '') {
// this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) })))
// } else {
// this.tableData = JSON.parse(JSON.stringify(this.tables))
// }
this.$emit('switchComponent', { name: '' })
this.tData = []
this.expandedArray = []
......@@ -526,7 +515,6 @@ export default {
},
saveGroup(group) {
// console.log(group);
this.$refs['groupForm'].validate((valid) => {
if (valid) {
addGroup(group).then(res => {
......@@ -536,15 +524,9 @@ export default {
type: 'success',
showClose: true
})
// this.tree(this.groupForm)
this.refreshNodeBy(group.pid)
})
} else {
// this.$message({
// message: this.$t('commons.input_error'),
// type: 'error',
// showClose: true
// })
return false
}
})
......@@ -555,7 +537,7 @@ export default {
this.$refs['tableForm'].validate((valid) => {
if (valid) {
table.isRename = true
rename(table).then(response => {
alter(table).then(response => {
this.closeTable()
this.$message({
message: this.$t('dataset.save_success'),
......@@ -787,14 +769,10 @@ export default {
}
},
saveMoveDs() {
// if (this.tDs && this.tDs.type === 'group') {
// return
// }
this.dsForm.sceneId = this.tDs.id
this.dsForm.isRename = true
addTable(this.dsForm).then(res => {
alter(this.dsForm).then(res => {
this.closeMoveDs()
// this.tableTree()
this.refreshNodeBy(this.dsForm.sceneId)
})
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论