|
|
@ -1,63 +1,154 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" |
|
|
|
label-width="80px"> |
|
|
|
<el-form |
|
|
|
:model="queryParams" |
|
|
|
ref="queryForm" |
|
|
|
size="small" |
|
|
|
:inline="true" |
|
|
|
v-show="showSearch" |
|
|
|
label-width="80px" |
|
|
|
> |
|
|
|
<el-form-item label="数据源key" prop="dataSourceKey"> |
|
|
|
<el-input v-model="queryParams.param.dataSourceKey" placeholder="请输入" clearable |
|
|
|
@keyup.enter.native="handleQuery" /> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.param.dataSourceKey" |
|
|
|
placeholder="请输入" |
|
|
|
clearable |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<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-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> |
|
|
|
</el-form> |
|
|
|
<el-row :gutter="10" class="mb8"> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
plain |
|
|
|
icon="el-icon-plus" |
|
|
|
size="mini" |
|
|
|
@click="handleAdd" |
|
|
|
>新增</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" |
|
|
|
@click="handleDelete">删除</el-button> |
|
|
|
<el-button |
|
|
|
type="danger" |
|
|
|
plain |
|
|
|
icon="el-icon-delete" |
|
|
|
size="mini" |
|
|
|
:disabled="multiple" |
|
|
|
@click="handleDelete" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
<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 |
|
|
|
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" > |
|
|
|
<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 |
|
|
|
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 |
|
|
|
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> |
|
|
|
<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"> |
|
|
|
<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> |
|
|
|
<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" |
|
|
|
:limit.sync="queryParams.pageSize" @pagination="getList" /> |
|
|
|
<pagination |
|
|
|
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-form ref="form" :model="form" :rules="rules" label-width="140px" class="formStep"> |
|
|
|
<el-dialog |
|
|
|
class="popup" |
|
|
|
:title="title" |
|
|
|
:visible.sync="open" |
|
|
|
width="780px" |
|
|
|
append-to-body |
|
|
|
> |
|
|
|
<el-form |
|
|
|
ref="form" |
|
|
|
:model="form" |
|
|
|
:rules="rules" |
|
|
|
label-width="140px" |
|
|
|
class="formStep" |
|
|
|
> |
|
|
|
<el-form-item label="类型" prop="type"> |
|
|
|
<el-radio-group v-model="form.type"> |
|
|
|
<el-radio label="0">MySQL</el-radio> |
|
|
@ -86,58 +177,70 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
import { |
|
|
|
dataSourcesList, |
|
|
|
dataSourcesAdd, |
|
|
|
dataSourcesUpd, |
|
|
|
dataSourcesDel |
|
|
|
} from "@/api/member"; |
|
|
|
export default { |
|
|
|
dataSourcesDel, |
|
|
|
} from "@/api/member"; |
|
|
|
export default { |
|
|
|
name: "Notice", |
|
|
|
dicts: ["sys_normal_disable", "sys_user_sex"], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
dataSourceList: [], |
|
|
|
queryParams:{ |
|
|
|
param:{ |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
param: { |
|
|
|
name: "", |
|
|
|
} |
|
|
|
}, |
|
|
|
listData:[], |
|
|
|
title:'', |
|
|
|
}, |
|
|
|
listData: [], |
|
|
|
title: "", |
|
|
|
open: false, |
|
|
|
total:0, |
|
|
|
form:{}, |
|
|
|
loading:false, |
|
|
|
showSearch:true, |
|
|
|
total: 0, |
|
|
|
form: {}, |
|
|
|
loading: false, |
|
|
|
showSearch: true, |
|
|
|
multiple: false, |
|
|
|
// 表单校验 |
|
|
|
rules: { |
|
|
|
type: [{ |
|
|
|
type: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "类型不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}], |
|
|
|
url: [{ |
|
|
|
}, |
|
|
|
], |
|
|
|
url: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "连接信息不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}], |
|
|
|
dataSourceKey: [{ |
|
|
|
}, |
|
|
|
], |
|
|
|
dataSourceKey: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "数据源key不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}], |
|
|
|
username: [{ |
|
|
|
}, |
|
|
|
], |
|
|
|
username: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "用户名不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}], |
|
|
|
password: [{ |
|
|
|
}, |
|
|
|
], |
|
|
|
password: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "密码不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}], |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
@ -162,11 +265,11 @@ |
|
|
|
// 表单重置 |
|
|
|
reset() { |
|
|
|
this.form = { |
|
|
|
"name": "", |
|
|
|
"leader": "", |
|
|
|
"contactPhone": "", |
|
|
|
"dataSourceId": '', |
|
|
|
"status": "", |
|
|
|
name: "", |
|
|
|
leader: "", |
|
|
|
contactPhone: "", |
|
|
|
dataSourceId: "", |
|
|
|
status: "", |
|
|
|
}; |
|
|
|
this.resetForm("form"); |
|
|
|
}, |
|
|
@ -198,10 +301,10 @@ |
|
|
|
handleUpdate(row) { |
|
|
|
this.open = true; |
|
|
|
this.title = "修改数据源"; |
|
|
|
this.form = JSON.parse(JSON.stringify(row)) |
|
|
|
this.form = JSON.parse(JSON.stringify(row)); |
|
|
|
}, |
|
|
|
/** 诊疗档案 */ |
|
|
|
submitForm: function() { |
|
|
|
submitForm: function () { |
|
|
|
this.$refs["form"].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.form.id != undefined) { |
|
|
@ -225,7 +328,7 @@ |
|
|
|
const idList = row.id ? [row.id] : this.ids; |
|
|
|
this.$modal |
|
|
|
.confirm("是否确认删除当前选择的数据?") |
|
|
|
.then(function() { |
|
|
|
.then(function () { |
|
|
|
return dataSourcesDel({ |
|
|
|
idList: idList, |
|
|
|
}); |
|
|
@ -237,77 +340,78 @@ |
|
|
|
.catch(() => {}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style scoped src="@/assets/styles/common.css"></style> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|
.div-title1 { |
|
|
|
.div-title1 { |
|
|
|
font-size: 22px; |
|
|
|
font-weight: bold; |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.div-title2 { |
|
|
|
.div-title2 { |
|
|
|
font-size: 20px; |
|
|
|
font-weight: bold; |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.div-title3 { |
|
|
|
.div-title3 { |
|
|
|
font-size: 18px; |
|
|
|
font-weight: bold; |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.span-but { |
|
|
|
.span-but { |
|
|
|
display: inline-block; |
|
|
|
border-radius: 4px; |
|
|
|
border: 1px solid #dcdfe6; |
|
|
|
line-height: 32px; |
|
|
|
padding: 0 15px; |
|
|
|
margin: 5px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.span-but-active { |
|
|
|
.span-but-active { |
|
|
|
border: 1px solid #1890ff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.human-body { |
|
|
|
.human-body { |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.human-body>>>.el-form-item { |
|
|
|
.human-body >>> .el-form-item { |
|
|
|
width: 49%; |
|
|
|
margin-right: 2%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.human-body>>>.el-form-item:nth-of-type(2n) { |
|
|
|
.human-body >>> .el-form-item:nth-of-type(2n) { |
|
|
|
margin-right: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.formStep1>>>.el-form-item__label {} |
|
|
|
.formStep1 >>> .el-form-item__label { |
|
|
|
} |
|
|
|
|
|
|
|
.form-item-zd { |
|
|
|
.form-item-zd { |
|
|
|
width: 100%; |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.form-item-age { |
|
|
|
.form-item-age { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.form-item-age span { |
|
|
|
.form-item-age span { |
|
|
|
margin: 0 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.form-item-age>>>.el-input { |
|
|
|
.form-item-age >>> .el-input { |
|
|
|
width: 100px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
>>>.el-drawer.rtl { |
|
|
|
>>> .el-drawer.rtl { |
|
|
|
width: 50% !important; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |