Commit 0507bb2a authored by kangzhenfei's avatar kangzhenfei

saas--数据资源管理ok

parent 5cb32912
...@@ -908,8 +908,11 @@ export default { ...@@ -908,8 +908,11 @@ export default {
},//多租户-服务器数据源 },//多租户-服务器数据源
host: { host: {
id: '', id: '',
name: '数据源名称', name: '描述',//'数据源名称',
ip: '服务器地址', os: "操作系统",
ip: 'Ip',//'服务器地址',
domain: "域名",
supportDatabaseType: "支持的数据库",
user: '用户名', user: '用户名',
password: '密码', password: '密码',
port: 'ssh端口', port: 'ssh端口',
......
...@@ -8,10 +8,25 @@ ...@@ -8,10 +8,25 @@
</Col> </Col>
</Row> </Row>
<Row> <Row>
<Col :span="24">
<FormItem :label="l('os')" prop="os">
<Input v-model="entity.os"></Input>
</FormItem>
</Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('ip')" prop="ip"> <FormItem :label="l('ip')" prop="ip">
<Input v-model="entity.ip"></Input> <Input v-model="entity.ip"></Input>
</FormItem> </FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('domain')" prop="domain">
<Input v-model="entity.domain"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('supportDatabaseType')" prop="supportDatabaseType">
<Input v-model="entity.supportDatabaseType"></Input>
</FormItem>
</Col> </Col>
</Row> </Row>
<Row> <Row>
...@@ -63,6 +78,9 @@ export default { ...@@ -63,6 +78,9 @@ export default {
name: [{ required: true, message: '必填', trigger: 'blur' }], name: [{ required: true, message: '必填', trigger: 'blur' }],
ip: [{ required: true, message: '必填', trigger: 'blur' }], ip: [{ required: true, message: '必填', trigger: 'blur' }],
user: [{ required: true, message: '必填', trigger: 'blur' }], user: [{ required: true, message: '必填', trigger: 'blur' }],
os: [{ required: true, message: '必填', trigger: 'blur' }],
domain: [{ required: true, message: '必填', trigger: 'blur' }],
supportDatabaseType: [{ required: true, message: '必填', trigger: 'blur' }],
password: [{ required: true, message: '必填', trigger: 'blur' }] password: [{ required: true, message: '必填', trigger: 'blur' }]
} }
} }
......
import Api from '@/plugins/request' import Api from '@/plugins/request'
export default { export default {
index:`${authUrl}/api/services/app/host/paged`, // index:`${authUrl}/api/services/app/host/paged`,
index:`${systemNew}api/services/app/host/paged`, //new
paged(params){ paged(params){
// return Api.post(`${authUrl}/api/services/app/host/paged`,params); systemNew
return Api.post(`${authUrl}/api/services/app/host/paged`,params); return Api.post(`${systemNew}api/services/app/host/paged`,params);
}, },
get(params){ get(params){
return Api.get(`${systemNew}api/services/app/host/get`,params);
return Api.get(`${authUrl}/api/services/app/host/get`,params);
}, },
create(params){ create(params){
return Api.post(`${systemNew}api/services/app/host/create`,params);
return Api.post(`${authUrl}/api/services/app/host/create`,params);
}, },
update(params){ update(params){
return Api.post(`${authUrl}/api/services/app/host/update`,params); return Api.post(`${systemNew}api/services/app/host/update`,params);
}, },
//删除: //删除:
delete(params) { delete(params) {
return Api.delete(`${authUrl}/api/services/app/host/delete`,{params:params}); return Api.delete(`${systemNew}api/services/app/host/delete`,{params:params});
}, },
} }
\ No newline at end of file
<template> <template>
<div class="detail"> <div class="detail">
<Row>
<Row> <Filed :span="24" :name="l('name')">{{entity.name}}</Filed>
<Filed :span="24" :name="l('name')">{{entity.name}}</Filed> <Filed :span="24" :name="l('os')">{{entity.os}}</Filed>
<Filed :span="24" :name="l('ip')">{{entity.ip}}</Filed> <Filed :span="24" :name="l('ip')">{{entity.ip}}</Filed>
<Filed :span="24" :name="l('user')">{{entity.user}}</Filed> <Filed :span="24" :name="l('domain')">{{entity.domain}}</Filed>
<Filed :span="24" :name="l('password')">{{entity.password}}</Filed> <Filed :span="24" :name="l('supportDatabaseType')">{{entity.supportDatabaseType}}</Filed>
<Filed :span="24" :name="l('port')">{{entity.port}}</Filed> <Filed :span="24" :name="l('user')">{{entity.user}}</Filed>
</Row> <Filed :span="24" :name="l('password')">{{entity.password}}</Filed>
<Filed :span="24" :name="l('port')">{{entity.port}}</Filed>
</div> </Row>
</div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
entity: {}, entity: {},
rules: { // rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }], // name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: '必填', trigger: 'blur' }] // code: [{ required: true, message: "必填", trigger: "blur" }]
} // }
} };
}, },
props: { props: {
eid: Number eid: Number
}, },
methods: { methods: {
load(v) { load(v) {
Api.get({ id: v }).then(r => { Api.get({ id: v }).then(r => {
this.entity = r.result; this.entity = r.result;
this.$emit('on-load') this.$emit("on-load");
}) });
}, },
handleClose() { handleClose() {
this.$emit('on-close') this.$emit("on-close");
}, },
l(key) { l(key) {
key = "host" + "." + key; key = "host" + "." + key;
return this.$t(key) return this.$t(key);
}
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
} }
},
watch: {
eid(v) {
if (v != 0) {
this.load(v);
}
}
}
} }
}
};
</script> </script>
\ No newline at end of file
...@@ -6,11 +6,26 @@ ...@@ -6,11 +6,26 @@
<Input v-model="entity.name"></Input> <Input v-model="entity.name"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24">
<FormItem :label="l('os')" prop="os">
<Input v-model="entity.os"></Input>
</FormItem>
</Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('ip')" prop="ip"> <FormItem :label="l('ip')" prop="ip">
<Input v-model="entity.ip"></Input> <Input v-model="entity.ip"></Input>
</FormItem> </FormItem>
</Col> </Col>
<Col :span="24">
<FormItem :label="l('domain')" prop="domain">
<Input v-model="entity.domain"></Input>
</FormItem>
</Col>
<Col :span="24">
<FormItem :label="l('supportDatabaseType')" prop="supportDatabaseType">
<Input v-model="entity.supportDatabaseType"></Input>
</FormItem>
</Col>
<Col :span="24"> <Col :span="24">
<FormItem :label="l('user')" prop="user"> <FormItem :label="l('user')" prop="user">
<Input v-model="entity.user"></Input> <Input v-model="entity.user"></Input>
...@@ -35,7 +50,7 @@ ...@@ -35,7 +50,7 @@
</template> </template>
<script> <script>
import Api from './api' import Api from './api'
export default { export default {
name: 'Edit', name: 'Edit',
data() { data() {
return { return {
...@@ -43,8 +58,11 @@ export default { ...@@ -43,8 +58,11 @@ export default {
entity: { name: '', ip: '', user: '', password: '', port: 22, id: 0 }, entity: { name: '', ip: '', user: '', password: '', port: 22, id: 0 },
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }], name: [{ required: true, message: '必填', trigger: 'blur' }],
os: [{ required: true, message: '必填', trigger: 'blur' }],
ip: [{ required: true, message: '必填', trigger: 'blur' }], ip: [{ required: true, message: '必填', trigger: 'blur' }],
user: [{ required: true, message: '必填', trigger: 'blur' }], user: [{ required: true, message: '必填', trigger: 'blur' }],
domain: [{ required: true, message: '必填', trigger: 'blur' }],
supportDatabaseType: [{ required: true, message: '必填', trigger: 'blur' }],
password: [{ required: true, message: '必填', trigger: 'blur' }] password: [{ required: true, message: '必填', trigger: 'blur' }]
} }
} }
......
<template> <template>
<div> <div>
<DataGrid :columns="columns" ref="grid" :action="action"><template slot="easySearch"><Form ref="formInline" :model="easySearch" inline><FormItem prop="keys"><Input placeholder="请输入数据源/服务器/用户" class="w200" v-model="easySearch.keys.value" /> </FormItem> <DataGrid :columns="columns" ref="grid" :action="action">
<FormItem><Button type="primary" @click="search">查询</Button></FormItem> <template slot="easySearch">
</Form></template> <Form ref="formInline" :model="easySearch" inline>
<template slot="searchForm"> <FormItem prop="keys">
<Search /> <Input placeholder="请输入数据源/服务器/用户" class="w200" v-model="easySearch.keys.value" />
</template> </FormItem>
<template slot="buttons"> <FormItem>
<Button type="primary" @click="addModal=true">新增</Button> <Button type="primary" @click="search">查询</Button>
</template> </FormItem>
</DataGrid> </Form>
<Modal v-model="addModal" width="720px" title="新增" footer-hide> </template>
<Add @on-close="cancel" @on-ok="addOk" /> <template slot="searchForm">
</Modal> <Search />
<Modal v-model="editModal" width="720px" title="编辑" footer-hide> </template>
<Edit :eid="curId" @on-close="cancel" @on-ok="addOk" /> <template slot="buttons">
</Modal> <Button type="primary" @click="addModal=true">新增</Button>
<Modal v-model="detailModal" width="720px" title="详情"> </template>
<Detail :eid="curId" /> </DataGrid>
</Modal> <Modal v-model="addModal" width="720px" title="新增" footer-hide>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" <Add @on-close="cancel" @on-ok="addOk" />
@on-cancel="cancel"> </Modal>
<p>确定删除?</p> <Modal v-model="editModal" width="720px" title="编辑" footer-hide>
</Modal> <Edit :eid="curId" @on-close="cancel" @on-ok="addOk" />
</div> </Modal>
<Modal v-model="detailModal" width="720px" title="详情">
<Detail :eid="curId" />
</Modal>
<Modal v-model="deletelModal" title="删除" @on-ok="removeOk" @on-cancel="cancel">
<p>确定删除?</p>
</Modal>
</div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
import Add from './add' import Add from "./add";
import Edit from './edit' import Edit from "./edit";
import Detail from './detail' import Detail from "./detail";
import Search from './search' import Search from "./search";
export default { export default {
name: 'list', name: "list",
components:{ components: {
Add,Edit,Detail,Search Add,
Edit,
Detail,
Search
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys:{op:"name,ip,user",value:null} keys: { op: "name,ip,user", value: null }
}, },
addModal: false, addModal: false,
editModal: false, editModal: false,
detailModal: false, detailModal: false,
deletelModal: false, deletelModal: false,
curId: 0, curId: 0,
columns: [ columns: [
{ key:"id",title:this.l("id") ,hide:true ,align:"left" }, { key: "id", title: this.l("id"), hide: true, align: "left" },
{ key:"name",title:this.l("name") ,align:"left" ,easy:true ,high:true }, {
{ key:"ip",title:this.l("ip") ,align:"left" ,easy:true ,high:true }, key: "name",
{ key:"user",title:this.l("user") ,align:"left" ,easy:true ,high:true }, title: this.l("name"),
{ key:"password",title:this.l("password") ,align:"left" }, align: "left",
{ key:"port",title:this.l("port") ,align:"left" ,high:true }, easy: true,
{ key:"creationTime",title:this.l("creationTime") ,hide:true ,align:"left" }, high: true
{ key:"creatorUserId",title:this.l("creatorUserId") ,hide:true ,align:"left" }, },
{ key:"lastModificationTime",title:this.l("lastModificationTime") ,hide:true ,align:"left" }, {
{ key:"lastModifierUserId",title:this.l("lastModifierUserId") ,hide:true ,align:"left" }, key: "os",
{ key:"isDeleted",title:this.l("isDeleted") ,hide:true ,align:"left" }, title: this.l("os"),
{ key:"deletionTime",title:this.l("deletionTime") ,hide:true ,align:"left" }, align: "left",
{ key:"deleterUserId",title:this.l("deleterUserId") ,hide:true ,align:"left" }, easy: true,
{ high: true
title: '操作', },
key: 'id', {
width: 140, key: "ip",
align: 'center', title: this.l("ip"),
render: (h, params) => { align: "left",
return h('div', { class: "action" }, [ easy: true,
h('op', { attrs: { oprate: 'detail' }, on: { click: () => this.detail(params.row.id) } }, '查看'), high: true
h('op', { attrs: { oprate: 'edit'}, on: { click: () => this.edit(params.row.id) } }, '编辑'), },
h('op', { attrs: { oprate: 'remove' }, on: { click: () => this.remove(params.row.id) } }, '删除') {
]) key: "domain",
} title: this.l("domain"),
}, align: "left",
easy: true,
high: true
},
{
key: "supportDatabaseType",
title: this.l("supportDatabaseType"),
align: "left",
easy: true,
high: true
},
{
key: "user",
title: this.l("user"),
align: "left",
easy: true,
high: true
},
{ key: "password", title: this.l("password"), align: "left" },
{ key: "port", title: this.l("port"), align: "left", high: true },
{
key: "creationTime",
title: this.l("creationTime"),
hide: true,
align: "left"
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
hide: true,
align: "left"
},
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
hide: true,
align: "left"
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
hide: true,
align: "left"
},
{
key: "isDeleted",
title: this.l("isDeleted"),
hide: true,
align: "left"
},
{
key: "deletionTime",
title: this.l("deletionTime"),
hide: true,
align: "left"
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
hide: true,
align: "left"
},
{
title: "操作",
key: "id",
width: 140,
align: "center",
render: (h, params) => {
return h("div", { class: "action" }, [
h(
"op",
{
attrs: { oprate: "detail" },
on: { click: () => this.detail(params.row.id) }
},
"查看"
),
h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.edit(params.row.id) }
},
"编辑"
),
h(
"op",
{
attrs: { oprate: "remove" },
on: { click: () => this.remove(params.row.id) }
},
"删除"
)
]);
}
}
] ]
} };
}, },
mounted(){ mounted() {
this.$refs.grid.load() this.$refs.grid.load();
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch('loadDictionary') // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods:{ methods: {
addOk() { addOk() {
this.$refs.grid.load() this.$refs.grid.load();
this.addModal = false this.addModal = false;
this.detailModal = false this.detailModal = false;
this.editModal = false; this.editModal = false;
this.curId = 0; this.curId = 0;
}, },
search() { search() {
this.$refs.grid.reload(this.easySearch) this.$refs.grid.reload(this.easySearch);
}, },
detail(id) { detail(id) {
this.detailModal = true; this.detailModal = true;
this.curId = id; this.curId = id;
}, },
edit(id) { edit(id) {
this.editModal = true; this.editModal = true;
this.curId = id; this.curId = id;
}, },
remove(id) { remove(id) {
this.deletelModal = true; this.deletelModal = true;
this.curId = id; this.curId = id;
}, },
removeOk() { removeOk() {
Api.delete({ id: this.curId }).then((r) => { Api.delete({ id: this.curId }).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.deletelModal = false;
this.$Message.success('删除成功')
}
})
},
removeCancel() {
this.deletelModal = false; this.deletelModal = false;
}, this.$Message.success("删除成功");
cancel() { }
this.curId = 0; });
this.addModal = false },
this.detailModal = false removeCancel() {
this.editModal = false; this.deletelModal = false;
this.deletedlModal = false; },
}, cancel() {
l(key) { this.curId = 0;
/* this.addModal = false;
this.detailModal = false;
this.editModal = false;
this.deletedlModal = false;
},
l(key) {
/*
host:{ host:{
id:'', id:'',
name:'数据源名称', name:'数据源名称',
...@@ -142,13 +247,17 @@ keys:{op:"name,ip,user",value:null} ...@@ -142,13 +247,17 @@ keys:{op:"name,ip,user",value:null}
isDeleted:'是否删除', isDeleted:'是否删除',
deletionTime:'删除时间', deletionTime:'删除时间',
deleterUserId:'删除人', deleterUserId:'删除人',
creationTime: "2020-03-26 15:07:43"
domain: "域名"
os: "操作系统"
supportDatabaseType: "支持的数据库"
} }
*/ */
let vkey = "host" + "." + key; let vkey = "host" + "." + key;
return this.$t(vkey)||key return this.$t(vkey) || key;
} }
} }
} };
</script> </script>
<style lang="less"> <style lang="less">
</style> </style>
\ No newline at end of file
...@@ -10,7 +10,8 @@ let address=systemApi.dev; ...@@ -10,7 +10,8 @@ let address=systemApi.dev;
//let address=systemApi.local; //let address=systemApi.local;
window.systemUrl = `http://${address}:10000/system`; //System-api 系统管理(基础数据) window.systemUrl = `http://${address}:10000/system`; //System-api 系统管理(基础数据)
window.system=`http://${address}:10000/auth`;//多租户后台系统 window.system =`http://${address}:10000/auth`;//多租户后台系统
window.systemNew =`http://${address}:10130/`;//多租户后台系统-new 10130/platform/host/paged
window.authUrl = `http://${address}:10010`; //Authentication-api //统一登陆认证 window.authUrl = `http://${address}:10010`; //Authentication-api //统一登陆认证
window.designUrl = `http://${address}:10000/process`; // 工艺规程 window.designUrl = `http://${address}:10000/process`; // 工艺规程
window.PlanUrl = `http://${address}:10000/plan`; //订单 window.PlanUrl = `http://${address}:10000/plan`; //订单
......
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