Commit eebc6381 by yuwei

项目初始化

parent d3df4c3b
......@@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* <p>
......@@ -31,9 +30,4 @@ public class TypeDto implements Serializable {
@ApiModelProperty(value = "标准类别名称")
@NotBlank(message = "标准类别名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
private String gbTypeName;
@ApiModelProperty(value = "状态")
@NotNull(message = "状态不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
private String status;
@ApiModelProperty(value = "备注")
private String remark;
}
......@@ -263,9 +263,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delApiLog(row.id)
this.$message.success('删除成功')
this.getList()
delApiLog(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -301,9 +301,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delApiMask(row.id)
this.$message.success('删除成功')
this.getList()
delApiMask(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -329,9 +329,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataApi(row.id)
this.$message.success('删除成功')
this.getList()
delDataApi(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -309,9 +309,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataService(row.id)
this.$message.success('删除成功')
this.getList()
delDataService(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -262,9 +262,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataServiceLog(row.id)
this.$message.success('删除成功')
this.getList()
delDataServiceLog(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -300,9 +300,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delChangeRecord(row.id)
this.$message.success('删除成功')
this.getList()
delChangeRecord(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -317,9 +317,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataSource(row.id)
this.$message.success('删除成功')
this.getList()
delDataSource(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -254,9 +254,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delLog(row.id)
this.$message.success('删除成功')
this.getList()
delLog(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -272,9 +272,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delLog(row.id)
this.$message.success('删除成功')
this.getList()
delLog(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -374,9 +374,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delJob(row.id)
this.$message.success('删除成功')
this.getList()
delJob(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -282,9 +282,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delLog(row.id)
this.$message.success('删除成功')
this.getList()
delLog(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
<template>
<el-row :gutter="20">
<el-col :span="4">
<el-col :span="6">
<el-card class="box-card tree-wrapper" shadow="always">
<el-tree
ref="type"
:data="typeOptions"
node-key="id"
empty-text="加载中,请稍后"
:props="defaultProps"
default-expand-all
:expand-on-click-node="false"
@node-click="handleNodeClick"
/>
<div class="body-wrapper">
<el-tree
ref="type"
:data="typeOptions"
node-key="id"
empty-text="加载中,请稍后"
:props="defaultProps"
default-expand-all
highlight-current
:expand-on-click-node="false"
@node-click="handleNodeClick"
>
<template slot-scope="{ node, data }">
<span v-if="node.level === 1" class="custom-tree-node" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)">
<span><i class="el-icon-folder tree-folder" />{{ node.label }}</span>
<span class="tree-bts">
<i v-show="data.show" class="el-icon-circle-plus-outline" @click="() => handleAddType()" />
</span>
</span>
<span v-else class="custom-tree-node" @mouseenter="mouseenter(data)" @mouseleave="mouseleave(data)">
<span>{{ node.label }}</span>
<span class="tree-bts">
<i v-show="data.show" class="el-icon-edit-outline" @click="() => handleEditType(data)" />
<i v-show="data.show" class="el-icon-delete" @click="() => handleDelType(data)" />
</span>
</span>
</template>
</el-tree>
</div>
</el-card>
</el-col>
<el-col :span="20">
<el-col :span="18">
<el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="标准编码" prop="gbCode">
......@@ -180,11 +199,27 @@
/>
</el-card>
</el-col>
<!-- 数据标准类别对话框 -->
<el-dialog :title="dialog.title" :visible.sync="dialog.open" width="400px" append-to-body>
<el-form ref="dialogForm" :model="dialogForm" :rules="dialogRules" label-width="80px">
<el-form-item label="类别编码" prop="gbTypeCode">
<el-input v-model="dialogForm.gbTypeCode" placeholder="请输入类别编码" />
</el-form-item>
<el-form-item label="类别名称" prop="gbTypeName">
<el-input v-model="dialogForm.gbTypeName" placeholder="请输入类别名称" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitDialogForm">确 定</el-button>
<el-button @click="dialog.open = false">取 消</el-button>
</div>
</el-dialog>
</el-row>
</template>
<script>
import { listDataDictType, addDataDictType, updateDataDictType, pageDataDict, delDataDict } from '@/api/standard/datadict'
import { listDataDictType, addDataDictType, updateDataDictType, delDataDictType, pageDataDict, delDataDict } from '@/api/standard/datadict'
export default {
name: 'DataDictList',
......@@ -243,6 +278,21 @@ export default {
defaultProps: {
children: 'children',
label: 'gbTypeName'
},
dialog: {
// 是否显示弹出层
open: false,
// 弹出层标题
title: '数据标准类别'
},
dialogForm: {},
dialogRules: {
gbTypeCode: [
{ required: true, message: '类别编码不能为空', trigger: 'blur' }
],
gbTypeName: [
{ required: true, message: '类别名称不能为空', trigger: 'blur' }
]
}
}
},
......@@ -252,8 +302,8 @@ export default {
this.statusOptions = response.data
}
})
this.getList()
this.getTree()
this.getList()
},
mounted() {
this.initCols()
......@@ -266,14 +316,85 @@ export default {
const tree = {}
tree.gbTypeName = '数据标准类别'
tree.children = data
this.typeOptions = []
this.typeOptions.push(tree)
}
})
},
/** 节点单击事件 */
handleNodeClick(data) {
this.queryParams.typeId = data.id
this.getList()
if (data.id) {
this.queryParams.typeId = data.id
this.getList()
}
},
handleAddType() {
this.dialog.open = true
this.dialogForm = {
gbTypeCode: '',
gbTypeName: ''
}
},
submitDialogForm() {
this.$refs['dialogForm'].validate(valid => {
if (valid) {
if (this.dialogForm.id) {
updateDataDictType(this.dialogForm).then(response => {
if (response.success) {
this.$message.success('保存成功')
this.dialog.open = false
this.getTree()
} else {
this.$message.error('保存失败')
}
}).catch(error => {
this.$message.error(error.msg || '保存失败')
})
} else {
addDataDictType(this.dialogForm).then(response => {
if (response.success) {
this.$message.success('保存成功')
this.dialog.open = false
this.getTree()
} else {
this.$message.error('保存失败')
}
}).catch(error => {
this.$message.error(error.msg || '保存失败')
})
}
}
})
},
/** 树节点鼠标移入移出 */
mouseenter(data) {
this.$set(data, 'show', true)
},
mouseleave(data) {
this.$set(data, 'show', false)
},
handleEditType(data) {
this.dialog.open = true
this.dialogForm = {
id: data.id,
gbTypeCode: data.gbTypeCode,
gbTypeName: data.gbTypeName
}
},
handleDelType(data) {
this.$confirm('选中数据将被永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataDictType(data.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getTree()
}
})
}).catch(() => {
})
},
/** 查询数据源列表 */
getList() {
......@@ -309,7 +430,13 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.$refs['queryForm'].resetFields()
this.queryParams = {
pageNum: 1,
pageSize: 20,
typeId: '',
gbCode: '',
gbName: ''
}
this.handleQuery()
},
/** 刷新列表 */
......@@ -361,9 +488,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataDict(row.id)
this.$message.success('删除成功')
this.getList()
delDataDict(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......@@ -409,5 +539,25 @@ export default {
}
.tree-wrapper {
overflow-y: auto;
.body-wrapper {
margin: -10px;
::v-deep .custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
.tree-folder {
margin-right: 5px;
color: rgb(246 207 7);
}
.tree-bts {
i {
margin-right: 10px;
padding: 0px;
}
}
}
}
}
</style>
......@@ -310,9 +310,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delConfig(row.id)
this.$message.success('删除成功')
this.getList()
delConfig(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -239,9 +239,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDept(row.id)
this.$message.success('删除成功')
this.getList()
delDept(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -363,9 +363,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDict(row.id)
this.$message.success('删除成功')
this.getList()
delDict(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -336,9 +336,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDictItem(row.id)
this.$message.success('删除成功')
this.getList()
delDictItem(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -260,9 +260,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delMenu(row.id)
this.$message.success('删除成功')
this.getList()
delMenu(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -301,9 +301,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delPost(row.id)
this.$message.success('删除成功')
this.getList()
delPost(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -308,9 +308,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delRole(row.id)
this.$message.success('删除成功')
this.getList()
delRole(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -385,9 +385,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delUser(row.id)
this.$message.success('删除成功')
this.getList()
delUser(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
......@@ -301,9 +301,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDataSet(row.id)
this.$message.success('删除成功')
this.getList()
delDataSet(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment