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)
delApiLog(row.id).then(response => {
if (response.success) {
this.$message.success('删除成功')
this.getList()
}
})
}).catch(() => {
})
},
......
<template>
<div>
<el-card class="box-card" shadow="always">
<div slot="header" class="clearfix">
<span>{{ title }}</span>
<el-button-group style="float: right;">
<el-button size="mini" icon="el-icon-plus" round @click="submitForm" :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled">{{loadingOptions.loadingText}}</el-button>
<el-button size="mini" icon="el-icon-plus" round :loading="loadingOptions.loading" :disabled="loadingOptions.isDisabled" @click="submitForm">{{ loadingOptions.loadingText }}</el-button>
<el-button size="mini" icon="el-icon-back" round @click="showCard">返回</el-button>
</el-button-group>
</div>
......@@ -18,36 +17,35 @@
:label="api.apiName"
:value="api.id"
:disabled="api.status === '0'"
></el-option>
/>
</el-select>
</el-form-item>
<el-form-item label="脱敏名称" prop="maskName">
<el-input v-model="form.maskName" placeholder="请输入脱敏名称" />
</el-form-item>
<el-form-item label="脱敏字段规则配置" prop="rules">
<el-table :data="resParamList" stripe border
<el-table
:data="resParamList"
stripe
border
:max-height="300"
style="width: 100%; margin: 15px 0;">
style="width: 100%; margin: 15px 0;"
>
<el-table-column label="序号" width="55" align="center">
<template slot-scope="scope">
<span>{{ scope.$index +1 }}</span>
</template>
</el-table-column>
<el-table-column prop="fieldName" label="字段名称" align="center" show-overflow-tooltip >
<el-table-column prop="fieldName" label="字段名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" @click="fieldRule(scope.row.fieldName)">{{scope.row.fieldName}}</el-button>
<el-button type="text" @click="fieldRule(scope.row.fieldName)">{{ scope.row.fieldName }}</el-button>
</template>
</el-table-column>
<el-table-column prop="remark" label="描述" align="center" show-overflow-tooltip >
</el-table-column>
<el-table-column prop="dataType" label="数据类型" align="center" show-overflow-tooltip >
</el-table-column>
<el-table-column prop="exampleValue" label="示例值" align="center" show-overflow-tooltip >
</el-table-column>
<el-table-column prop="cipherType" label="脱敏类型" align="center" show-overflow-tooltip >
</el-table-column>
<el-table-column prop="cryptType" label="规则类型" align="center" show-overflow-tooltip >
</el-table-column>
<el-table-column prop="remark" label="描述" align="center" show-overflow-tooltip />
<el-table-column prop="dataType" label="数据类型" align="center" show-overflow-tooltip />
<el-table-column prop="exampleValue" label="示例值" align="center" show-overflow-tooltip />
<el-table-column prop="cipherType" label="脱敏类型" align="center" show-overflow-tooltip />
<el-table-column prop="cryptType" label="规则类型" align="center" show-overflow-tooltip />
</el-table>
</el-form-item>
<el-form-item label="状态" prop="status">
......@@ -56,7 +54,7 @@
v-for="dict in statusOptions"
:key="dict.id"
:label="dict.itemText"
>{{dict.itemValue}}</el-radio>
>{{ dict.itemValue }}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
......@@ -68,7 +66,7 @@
<el-dialog :title="cipher.title" :visible.sync="cipher.open" width="400px" append-to-body>
<el-form ref="form2" :model="form2" :rules="rules2" label-width="80px">
<el-form-item label="字段名称" prop="fieldName">
<el-input v-model="form2.fieldName" placeholder="请输入字段名称" :disabled="true"/>
<el-input v-model="form2.fieldName" placeholder="请输入字段名称" :disabled="true" />
</el-form-item>
<el-form-item label="脱敏类型" prop="cipherType">
<el-select v-model="form2.cipherType" clearable placeholder="请选择脱敏类型" @change="cipherTypeSelectChanged">
......@@ -77,7 +75,7 @@
:key="dict.id"
:label="dict.itemValue"
:value="dict.itemText"
></el-option>
/>
</el-select>
</el-form-item>
<el-form-item label="规则类型" prop="cryptType">
......@@ -87,7 +85,7 @@
:key="dict.id"
:label="dict.itemValue"
:value="dict.itemText"
></el-option>
/>
</el-select>
</el-form-item>
</el-form>
......@@ -98,7 +96,6 @@
</el-dialog>
</div>
</el-card>
</div>
</template>
<script>
......@@ -110,17 +107,13 @@ export default {
props: {
data: {
type: Object,
default: function () {
default: function() {
return {}
}
}
},
data () {
data() {
return {
classCardbody: {
overflow: 'auto',
height: document.body.offsetHeight - 240 + 'px'
},
title: '数据API脱敏新增',
// 展示切换
showOptions: {
......@@ -185,7 +178,7 @@ export default {
}
}
},
created () {
created() {
this.getDicts('sys_common_status').then(response => {
if (response.success) {
this.statusOptions = response.data
......@@ -209,29 +202,29 @@ export default {
})
},
methods: {
showCard () {
showCard() {
this.$emit('showCard', this.showOptions)
},
getDataApiList () {
getDataApiList() {
listDataApi().then(response => {
if (response.success) {
this.apiOptions = response.data
}
})
},
apiSelectChanged (val) {
this.resParamList = this.apiOptions.find(function (item) {
apiSelectChanged(val) {
this.resParamList = this.apiOptions.find(function(item) {
return item.id === val
}).resParams
},
fieldRule (fieldName) {
fieldRule(fieldName) {
this.cipher.open = true
this.form2.fieldName = fieldName
this.form2.cipherType = undefined
this.form2.cryptType = undefined
this.cryptTypeOptions = []
},
cipherTypeSelectChanged (val) {
cipherTypeSelectChanged(val) {
this.form2.cryptType = undefined
this.cryptTypeOptions = []
if (val === '1') {
......@@ -242,8 +235,8 @@ export default {
this.cryptTypeOptions = this.algorithmCryptoOptions
}
},
submitFieldCipherForm () {
let fieldRuleIndex = this.form.rules.findIndex((item) => {
submitFieldCipherForm() {
const fieldRuleIndex = this.form.rules.findIndex((item) => {
return item.fieldName === this.form2.fieldName
})
if (fieldRuleIndex !== -1) {
......@@ -253,21 +246,21 @@ export default {
if (this.form2.cipherType && this.form2.cryptType) {
this.form.rules.push(this.form2)
}
let cipher = this.cipherTypeOptions.find((item) => {
const cipher = this.cipherTypeOptions.find((item) => {
return item.itemText === this.form2.cipherType
})
let crypt = this.cryptTypeOptions.find((item) => {
const crypt = this.cryptTypeOptions.find((item) => {
return item.itemText === this.form2.cryptType
})
let fieldParamIndex = this.resParamList.findIndex((item) => {
const fieldParamIndex = this.resParamList.findIndex((item) => {
return item.fieldName === this.form2.fieldName
})
let resParam = Object.assign({}, this.resParamList[fieldParamIndex], { cipherType: (cipher && cipher.itemValue) || undefined, cryptType: (crypt && crypt.itemValue) || undefined })
const resParam = Object.assign({}, this.resParamList[fieldParamIndex], { cipherType: (cipher && cipher.itemValue) || undefined, cryptType: (crypt && crypt.itemValue) || undefined })
this.$set(this.resParamList, fieldParamIndex, resParam)
this.cipher.open = false
},
/** 提交按钮 */
submitForm: function () {
submitForm: function() {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.rules.length <= 0) {
......
......@@ -301,9 +301,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delApiMask(row.id)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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">
<div class="body-wrapper">
<el-tree
ref="type"
:data="typeOptions"
......@@ -9,12 +10,30 @@
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) {
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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