4 changed files with 399 additions and 300 deletions
@ -1,313 +1,417 @@ |
|||||
<template> |
<template> |
||||
<div class="app-container"> |
<div class="app-container"> |
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
<el-form |
||||
label-width="80px"> |
:model="queryParams" |
||||
<el-form-item label="数据源key" prop="dataSourceKey"> |
ref="queryForm" |
||||
<el-input v-model="queryParams.param.dataSourceKey" placeholder="请输入" clearable |
size="small" |
||||
@keyup.enter.native="handleQuery" /> |
:inline="true" |
||||
</el-form-item> |
v-show="showSearch" |
||||
<el-form-item> |
label-width="80px" |
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
> |
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
<el-form-item label="数据源key" prop="dataSourceKey"> |
||||
</el-form-item> |
<el-input |
||||
</el-form> |
v-model="queryParams.param.dataSourceKey" |
||||
<el-row :gutter="10" class="mb8"> |
placeholder="请输入" |
||||
<el-col :span="1.5"> |
clearable |
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button> |
@keyup.enter.native="handleQuery" |
||||
</el-col> |
/> |
||||
<el-col :span="1.5"> |
</el-form-item> |
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" |
<el-form-item> |
||||
@click="handleDelete">删除</el-button> |
<el-button |
||||
</el-col> |
type="primary" |
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
icon="el-icon-search" |
||||
</el-row> |
size="mini" |
||||
<el-table v-loading="loading" :data="listData" @selection-change="handleSelectionChange" max-height="600"> |
@click="handleQuery" |
||||
<el-table-column type="selection" width="55" align="center" /> |
>搜索</el-button |
||||
<el-table-column fixed label="类型" align="center" prop="name" min-width="100" > |
> |
||||
<template slot-scope="scope"> |
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
||||
<span v-if="scope.row.type == 0">MySQL</span> |
>重置</el-button |
||||
<span v-if="scope.row.type == 1">Oracle</span> |
> |
||||
</template> |
</el-form-item> |
||||
</el-table-column> |
</el-form> |
||||
<el-table-column fixed label="连接信息" align="center" prop="url" show-overflow-tooltip |
<el-row :gutter="10" class="mb8"> |
||||
min-width="100"> |
<el-col :span="1.5"> |
||||
</el-table-column> |
<el-button |
||||
<el-table-column fixed label="数据源kye" align="center" prop="dataSourceKey" show-overflow-tooltip |
type="primary" |
||||
min-width="80" /> |
plain |
||||
<el-table-column label="创建人/创建时间" align="center" min-width="140"> |
icon="el-icon-plus" |
||||
<template slot-scope="scope"> |
size="mini" |
||||
<div>{{scope.row.createBy}}</div> |
@click="handleAdd" |
||||
<span> |
>新增</el-button |
||||
{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }} |
> |
||||
</span> |
</el-col> |
||||
</template> |
<el-col :span="1.5"> |
||||
</el-table-column> |
<el-button |
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200"> |
type="danger" |
||||
<template slot-scope="scope"> |
plain |
||||
<el-button size="mini" type="text" icon="el-icon-edit" |
icon="el-icon-delete" |
||||
@click="handleUpdate(scope.row)">修改</el-button> |
size="mini" |
||||
<el-button size="mini" type="text" icon="el-icon-delete" |
:disabled="multiple" |
||||
@click="handleDelete(scope.row)">删除</el-button> |
@click="handleDelete" |
||||
</template> |
>删除</el-button |
||||
</el-table-column> |
> |
||||
</el-table> |
</el-col> |
||||
|
<right-toolbar |
||||
|
:showSearch.sync="showSearch" |
||||
|
@queryTable="getList" |
||||
|
></right-toolbar> |
||||
|
</el-row> |
||||
|
<el-table |
||||
|
v-loading="loading" |
||||
|
:data="listData" |
||||
|
@selection-change="handleSelectionChange" |
||||
|
max-height="600" |
||||
|
> |
||||
|
<el-table-column type="selection" width="55" align="center" /> |
||||
|
<el-table-column |
||||
|
fixed |
||||
|
label="类型" |
||||
|
align="center" |
||||
|
prop="name" |
||||
|
min-width="100" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.row.type == 0">MySQL</span> |
||||
|
<span v-if="scope.row.type == 1">Oracle</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed |
||||
|
label="连接信息" |
||||
|
align="center" |
||||
|
prop="url" |
||||
|
show-overflow-tooltip |
||||
|
min-width="100" |
||||
|
> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed |
||||
|
label="数据源kye" |
||||
|
align="center" |
||||
|
prop="dataSourceKey" |
||||
|
show-overflow-tooltip |
||||
|
min-width="80" |
||||
|
/> |
||||
|
<el-table-column label="创建人/创建时间" align="center" min-width="140"> |
||||
|
<template slot-scope="scope"> |
||||
|
<div>{{ scope.row.createBy }}</div> |
||||
|
<span> |
||||
|
{{ parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}") }} |
||||
|
</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
fixed="right" |
||||
|
label="操作" |
||||
|
align="center" |
||||
|
class-name="small-padding fixed-width" |
||||
|
width="200" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
>修改</el-button |
||||
|
> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-delete" |
||||
|
@click="handleDelete(scope.row)" |
||||
|
>删除</el-button |
||||
|
> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" |
<pagination |
||||
:limit.sync="queryParams.pageSize" @pagination="getList" /> |
v-show="total > 0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> |
||||
|
|
||||
<!-- 添加或修改公告对话框 --> |
<!-- 添加或修改公告对话框 --> |
||||
<el-dialog class="popup" :title="title" :visible.sync="open" width="780px" append-to-body> |
<el-dialog |
||||
<el-form ref="form" :model="form" :rules="rules" label-width="140px" class="formStep"> |
class="popup" |
||||
<el-form-item label="类型" prop="type"> |
:title="title" |
||||
<el-radio-group v-model="form.type"> |
:visible.sync="open" |
||||
<el-radio label="0">MySQL</el-radio> |
width="780px" |
||||
<el-radio label="1">Oracle</el-radio> |
append-to-body |
||||
</el-radio-group> |
> |
||||
</el-form-item> |
<el-form |
||||
<el-form-item label="连接信息" prop="url"> |
ref="form" |
||||
<el-input v-model="form.url" placeholder="请输入" /> |
:model="form" |
||||
</el-form-item> |
:rules="rules" |
||||
<el-form-item label="数据源key" prop="dataSourceKey"> |
label-width="140px" |
||||
<el-input v-model="form.dataSourceKey" placeholder="请输入" /> |
class="formStep" |
||||
</el-form-item> |
> |
||||
<el-form-item label="用户名" prop="username"> |
<el-form-item label="类型" prop="type"> |
||||
<el-input v-model="form.username" placeholder="请输入" /> |
<el-radio-group v-model="form.type"> |
||||
</el-form-item> |
<el-radio label="0">MySQL</el-radio> |
||||
<el-form-item label="密码" prop="password"> |
<el-radio label="1">Oracle</el-radio> |
||||
<el-input v-model="form.password" placeholder="请输入" /> |
</el-radio-group> |
||||
</el-form-item> |
</el-form-item> |
||||
</el-form> |
<el-form-item label="连接信息" prop="url"> |
||||
<div slot="footer" class="dialog-footer"> |
<el-input v-model="form.url" placeholder="请输入" /> |
||||
<el-button type="primary" @click="submitForm">确 定</el-button> |
</el-form-item> |
||||
<el-button @click="cancel">取 消</el-button> |
<el-form-item label="数据源key" prop="dataSourceKey"> |
||||
</div> |
<el-input v-model="form.dataSourceKey" placeholder="请输入" /> |
||||
</el-dialog> |
</el-form-item> |
||||
</div> |
<el-form-item label="用户名" prop="username"> |
||||
|
<el-input v-model="form.username" placeholder="请输入" /> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="密码" prop="password"> |
||||
|
<el-input v-model="form.password" placeholder="请输入" /> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
import { |
import { |
||||
dataSourcesList, |
dataSourcesList, |
||||
dataSourcesAdd, |
dataSourcesAdd, |
||||
dataSourcesUpd, |
dataSourcesUpd, |
||||
dataSourcesDel |
dataSourcesDel, |
||||
} from "@/api/member"; |
} from "@/api/member"; |
||||
export default { |
export default { |
||||
name: "Notice", |
name: "Notice", |
||||
dicts: ["sys_normal_disable", "sys_user_sex"], |
dicts: ["sys_normal_disable", "sys_user_sex"], |
||||
data() { |
data() { |
||||
return { |
return { |
||||
dataSourceList: [], |
dataSourceList: [], |
||||
queryParams:{ |
queryParams: { |
||||
param:{ |
pageNum: 1, |
||||
name: "", |
pageSize: 10, |
||||
} |
param: { |
||||
}, |
name: "", |
||||
listData:[], |
}, |
||||
title:'', |
}, |
||||
open: false, |
listData: [], |
||||
total:0, |
title: "", |
||||
form:{}, |
open: false, |
||||
loading:false, |
total: 0, |
||||
showSearch:true, |
form: {}, |
||||
multiple: false, |
loading: false, |
||||
// 表单校验 |
showSearch: true, |
||||
rules: { |
multiple: false, |
||||
type: [{ |
// 表单校验 |
||||
required: true, |
rules: { |
||||
message: "类型不能为空", |
type: [ |
||||
trigger: "blur", |
{ |
||||
}], |
required: true, |
||||
url: [{ |
message: "类型不能为空", |
||||
required: true, |
trigger: "blur", |
||||
message: "连接信息不能为空", |
}, |
||||
trigger: "blur", |
], |
||||
}], |
url: [ |
||||
dataSourceKey: [{ |
{ |
||||
required: true, |
required: true, |
||||
message: "数据源key不能为空", |
message: "连接信息不能为空", |
||||
trigger: "blur", |
trigger: "blur", |
||||
}], |
}, |
||||
username: [{ |
], |
||||
required: true, |
dataSourceKey: [ |
||||
message: "用户名不能为空", |
{ |
||||
trigger: "blur", |
required: true, |
||||
}], |
message: "数据源key不能为空", |
||||
password: [{ |
trigger: "blur", |
||||
required: true, |
}, |
||||
message: "密码不能为空", |
], |
||||
trigger: "blur", |
username: [ |
||||
}], |
{ |
||||
}, |
required: true, |
||||
}; |
message: "用户名不能为空", |
||||
}, |
trigger: "blur", |
||||
created() { |
}, |
||||
this.getList(); |
], |
||||
}, |
password: [ |
||||
methods: { |
{ |
||||
/** 查询公告列表 */ |
required: true, |
||||
getList() { |
message: "密码不能为空", |
||||
this.loading = true; |
trigger: "blur", |
||||
dataSourcesList(this.queryParams).then((res) => { |
}, |
||||
this.listData = res.data.list; |
], |
||||
this.total = res.data.total; |
}, |
||||
this.loading = false; |
}; |
||||
}); |
}, |
||||
}, |
created() { |
||||
// 取消按钮 |
this.getList(); |
||||
cancel() { |
}, |
||||
this.open = false; |
methods: { |
||||
this.reset(); |
/** 查询公告列表 */ |
||||
}, |
getList() { |
||||
// 表单重置 |
this.loading = true; |
||||
reset() { |
dataSourcesList(this.queryParams).then((res) => { |
||||
this.form = { |
this.listData = res.data.list; |
||||
"name": "", |
this.total = res.data.total; |
||||
"leader": "", |
this.loading = false; |
||||
"contactPhone": "", |
}); |
||||
"dataSourceId": '', |
}, |
||||
"status": "", |
// 取消按钮 |
||||
}; |
cancel() { |
||||
this.resetForm("form"); |
this.open = false; |
||||
}, |
this.reset(); |
||||
/** 搜索按钮操作 */ |
}, |
||||
handleQuery() { |
// 表单重置 |
||||
this.queryParams.pageNum = 1; |
reset() { |
||||
this.getList(); |
this.form = { |
||||
}, |
name: "", |
||||
/** 重置按钮操作 */ |
leader: "", |
||||
resetQuery() { |
contactPhone: "", |
||||
this.queryParams.param = { |
dataSourceId: "", |
||||
name: "", |
status: "", |
||||
}; |
}; |
||||
this.handleQuery(); |
this.resetForm("form"); |
||||
}, |
}, |
||||
// 多选框选中数据 |
/** 搜索按钮操作 */ |
||||
handleSelectionChange(selection) { |
handleQuery() { |
||||
this.ids = selection.map((item) => item.id); |
this.queryParams.pageNum = 1; |
||||
this.single = selection.length != 1; |
this.getList(); |
||||
this.multiple = !selection.length; |
}, |
||||
}, |
/** 重置按钮操作 */ |
||||
/** 新增按钮操作 */ |
resetQuery() { |
||||
handleAdd() { |
this.queryParams.param = { |
||||
this.reset(); |
name: "", |
||||
this.open = true; |
}; |
||||
this.title = "新增数据源"; |
this.handleQuery(); |
||||
}, |
}, |
||||
/** 修改按钮操作 */ |
// 多选框选中数据 |
||||
handleUpdate(row) { |
handleSelectionChange(selection) { |
||||
this.open = true; |
this.ids = selection.map((item) => item.id); |
||||
this.title = "修改数据源"; |
this.single = selection.length != 1; |
||||
this.form = JSON.parse(JSON.stringify(row)) |
this.multiple = !selection.length; |
||||
}, |
}, |
||||
/** 诊疗档案 */ |
/** 新增按钮操作 */ |
||||
submitForm: function() { |
handleAdd() { |
||||
this.$refs["form"].validate((valid) => { |
this.reset(); |
||||
if (valid) { |
this.open = true; |
||||
if (this.form.id != undefined) { |
this.title = "新增数据源"; |
||||
dataSourcesUpd(this.form).then((response) => { |
}, |
||||
this.$modal.msgSuccess("修改成功"); |
/** 修改按钮操作 */ |
||||
this.open = false; |
handleUpdate(row) { |
||||
this.getList(); |
this.open = true; |
||||
}); |
this.title = "修改数据源"; |
||||
} else { |
this.form = JSON.parse(JSON.stringify(row)); |
||||
dataSourcesAdd(this.form).then((response) => { |
}, |
||||
this.$modal.msgSuccess("新增成功"); |
/** 诊疗档案 */ |
||||
this.open = false; |
submitForm: function () { |
||||
this.getList(); |
this.$refs["form"].validate((valid) => { |
||||
}); |
if (valid) { |
||||
} |
if (this.form.id != undefined) { |
||||
} |
dataSourcesUpd(this.form).then((response) => { |
||||
}); |
this.$modal.msgSuccess("修改成功"); |
||||
}, |
this.open = false; |
||||
/** 删除按钮操作 */ |
this.getList(); |
||||
handleDelete(row) { |
}); |
||||
const idList = row.id ? [row.id] : this.ids; |
} else { |
||||
this.$modal |
dataSourcesAdd(this.form).then((response) => { |
||||
.confirm("是否确认删除当前选择的数据?") |
this.$modal.msgSuccess("新增成功"); |
||||
.then(function() { |
this.open = false; |
||||
return dataSourcesDel({ |
this.getList(); |
||||
idList: idList, |
}); |
||||
}); |
} |
||||
}) |
} |
||||
.then(() => { |
}); |
||||
this.getList(); |
}, |
||||
this.$modal.msgSuccess("删除成功"); |
/** 删除按钮操作 */ |
||||
}) |
handleDelete(row) { |
||||
.catch(() => {}); |
const idList = row.id ? [row.id] : this.ids; |
||||
}, |
this.$modal |
||||
}, |
.confirm("是否确认删除当前选择的数据?") |
||||
}; |
.then(function () { |
||||
|
return dataSourcesDel({ |
||||
|
idList: idList, |
||||
|
}); |
||||
|
}) |
||||
|
.then(() => { |
||||
|
this.getList(); |
||||
|
this.$modal.msgSuccess("删除成功"); |
||||
|
}) |
||||
|
.catch(() => {}); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
</script> |
</script> |
||||
<style scoped src="@/assets/styles/common.css"></style> |
<style scoped src="@/assets/styles/common.css"></style> |
||||
|
|
||||
<style scoped> |
<style scoped> |
||||
.div-title1 { |
.div-title1 { |
||||
font-size: 22px; |
font-size: 22px; |
||||
font-weight: bold; |
font-weight: bold; |
||||
margin-bottom: 10px; |
margin-bottom: 10px; |
||||
} |
} |
||||
|
|
||||
.div-title2 { |
.div-title2 { |
||||
font-size: 20px; |
font-size: 20px; |
||||
font-weight: bold; |
font-weight: bold; |
||||
margin-bottom: 10px; |
margin-bottom: 10px; |
||||
} |
} |
||||
|
|
||||
.div-title3 { |
.div-title3 { |
||||
font-size: 18px; |
font-size: 18px; |
||||
font-weight: bold; |
font-weight: bold; |
||||
margin-bottom: 10px; |
margin-bottom: 10px; |
||||
} |
} |
||||
|
|
||||
.span-but { |
.span-but { |
||||
display: inline-block; |
display: inline-block; |
||||
border-radius: 4px; |
border-radius: 4px; |
||||
border: 1px solid #dcdfe6; |
border: 1px solid #dcdfe6; |
||||
line-height: 32px; |
line-height: 32px; |
||||
padding: 0 15px; |
padding: 0 15px; |
||||
margin: 5px; |
margin: 5px; |
||||
} |
} |
||||
|
|
||||
.span-but-active { |
.span-but-active { |
||||
border: 1px solid #1890ff; |
border: 1px solid #1890ff; |
||||
} |
} |
||||
|
|
||||
.human-body { |
.human-body { |
||||
display: flex; |
display: flex; |
||||
flex-wrap: wrap; |
flex-wrap: wrap; |
||||
} |
} |
||||
|
|
||||
.human-body>>>.el-form-item { |
.human-body >>> .el-form-item { |
||||
width: 49%; |
width: 49%; |
||||
margin-right: 2%; |
margin-right: 2%; |
||||
} |
} |
||||
|
|
||||
.human-body>>>.el-form-item:nth-of-type(2n) { |
.human-body >>> .el-form-item:nth-of-type(2n) { |
||||
margin-right: 0; |
margin-right: 0; |
||||
} |
} |
||||
|
|
||||
.formStep1>>>.el-form-item__label {} |
.formStep1 >>> .el-form-item__label { |
||||
|
} |
||||
|
|
||||
.form-item-zd { |
.form-item-zd { |
||||
width: 100%; |
width: 100%; |
||||
text-align: left; |
text-align: left; |
||||
} |
} |
||||
|
|
||||
.form-item-age { |
.form-item-age { |
||||
display: flex; |
display: flex; |
||||
align-items: center; |
align-items: center; |
||||
} |
} |
||||
|
|
||||
.form-item-age span { |
.form-item-age span { |
||||
margin: 0 10px; |
margin: 0 10px; |
||||
} |
} |
||||
|
|
||||
.form-item-age>>>.el-input { |
.form-item-age >>> .el-input { |
||||
width: 100px; |
width: 100px; |
||||
} |
} |
||||
|
|
||||
>>>.el-drawer.rtl { |
>>> .el-drawer.rtl { |
||||
width: 50% !important; |
width: 50% !important; |
||||
} |
} |
||||
</style> |
</style> |
Loading…
Reference in new issue