Commit eebc6381 by yuwei

项目初始化

parent d3df4c3b
...@@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
* <p> * <p>
...@@ -31,9 +30,4 @@ public class TypeDto implements Serializable { ...@@ -31,9 +30,4 @@ public class TypeDto implements Serializable {
@ApiModelProperty(value = "标准类别名称") @ApiModelProperty(value = "标准类别名称")
@NotBlank(message = "标准类别名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class}) @NotBlank(message = "标准类别名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
private String gbTypeName; 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 { ...@@ -263,9 +263,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delApiLog(row.id) delApiLog(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -301,9 +301,12 @@ export default { ...@@ -301,9 +301,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delApiMask(row.id) delApiMask(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -329,9 +329,12 @@ export default { ...@@ -329,9 +329,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDataApi(row.id) delDataApi(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -309,9 +309,12 @@ export default { ...@@ -309,9 +309,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDataService(row.id) delDataService(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -262,9 +262,12 @@ export default { ...@@ -262,9 +262,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDataServiceLog(row.id) delDataServiceLog(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -300,9 +300,12 @@ export default { ...@@ -300,9 +300,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delChangeRecord(row.id) delChangeRecord(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -317,9 +317,12 @@ export default { ...@@ -317,9 +317,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDataSource(row.id) delDataSource(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -254,9 +254,12 @@ export default { ...@@ -254,9 +254,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delLog(row.id) delLog(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -272,9 +272,12 @@ export default { ...@@ -272,9 +272,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delLog(row.id) delLog(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -374,9 +374,12 @@ export default { ...@@ -374,9 +374,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delJob(row.id) delJob(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -282,9 +282,12 @@ export default { ...@@ -282,9 +282,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delLog(row.id) delLog(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
<template> <template>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="6">
<el-card class="box-card tree-wrapper" shadow="always"> <el-card class="box-card tree-wrapper" shadow="always">
<el-tree <div class="body-wrapper">
ref="type" <el-tree
:data="typeOptions" ref="type"
node-key="id" :data="typeOptions"
empty-text="加载中,请稍后" node-key="id"
:props="defaultProps" empty-text="加载中,请稍后"
default-expand-all :props="defaultProps"
:expand-on-click-node="false" default-expand-all
@node-click="handleNodeClick" 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-card>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="18">
<el-card class="box-card" shadow="always"> <el-card class="box-card" shadow="always">
<el-form ref="queryForm" :model="queryParams" :inline="true"> <el-form ref="queryForm" :model="queryParams" :inline="true">
<el-form-item label="标准编码" prop="gbCode"> <el-form-item label="标准编码" prop="gbCode">
...@@ -180,11 +199,27 @@ ...@@ -180,11 +199,27 @@
/> />
</el-card> </el-card>
</el-col> </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> </el-row>
</template> </template>
<script> <script>
import { listDataDictType, addDataDictType, updateDataDictType, pageDataDict, delDataDict } from '@/api/standard/datadict' import { listDataDictType, addDataDictType, updateDataDictType, delDataDictType, pageDataDict, delDataDict } from '@/api/standard/datadict'
export default { export default {
name: 'DataDictList', name: 'DataDictList',
...@@ -243,6 +278,21 @@ export default { ...@@ -243,6 +278,21 @@ export default {
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'gbTypeName' 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 { ...@@ -252,8 +302,8 @@ export default {
this.statusOptions = response.data this.statusOptions = response.data
} }
}) })
this.getList()
this.getTree() this.getTree()
this.getList()
}, },
mounted() { mounted() {
this.initCols() this.initCols()
...@@ -266,14 +316,85 @@ export default { ...@@ -266,14 +316,85 @@ export default {
const tree = {} const tree = {}
tree.gbTypeName = '数据标准类别' tree.gbTypeName = '数据标准类别'
tree.children = data tree.children = data
this.typeOptions = []
this.typeOptions.push(tree) this.typeOptions.push(tree)
} }
}) })
}, },
/** 节点单击事件 */ /** 节点单击事件 */
handleNodeClick(data) { handleNodeClick(data) {
this.queryParams.typeId = data.id if (data.id) {
this.getList() 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() { getList() {
...@@ -309,7 +430,13 @@ export default { ...@@ -309,7 +430,13 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.$refs['queryForm'].resetFields() this.queryParams = {
pageNum: 1,
pageSize: 20,
typeId: '',
gbCode: '',
gbName: ''
}
this.handleQuery() this.handleQuery()
}, },
/** 刷新列表 */ /** 刷新列表 */
...@@ -361,9 +488,12 @@ export default { ...@@ -361,9 +488,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDataDict(row.id) delDataDict(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
...@@ -409,5 +539,25 @@ export default { ...@@ -409,5 +539,25 @@ export default {
} }
.tree-wrapper { .tree-wrapper {
overflow-y: auto; 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> </style>
...@@ -310,9 +310,12 @@ export default { ...@@ -310,9 +310,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delConfig(row.id) delConfig(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -239,9 +239,12 @@ export default { ...@@ -239,9 +239,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDept(row.id) delDept(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -363,9 +363,12 @@ export default { ...@@ -363,9 +363,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDict(row.id) delDict(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -336,9 +336,12 @@ export default { ...@@ -336,9 +336,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDictItem(row.id) delDictItem(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -260,9 +260,12 @@ export default { ...@@ -260,9 +260,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delMenu(row.id) delMenu(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -301,9 +301,12 @@ export default { ...@@ -301,9 +301,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delPost(row.id) delPost(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -308,9 +308,12 @@ export default { ...@@ -308,9 +308,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delRole(row.id) delRole(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -385,9 +385,12 @@ export default { ...@@ -385,9 +385,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delUser(row.id) delUser(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).catch(() => {
}) })
}, },
......
...@@ -301,9 +301,12 @@ export default { ...@@ -301,9 +301,12 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
delDataSet(row.id) delDataSet(row.id).then(response => {
this.$message.success('删除成功') if (response.success) {
this.getList() this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => { }).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