SqlServer企业配置
This commit is contained in:
parent
2128170f71
commit
7434c14171
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
VUE_APP_API_BASE_URL=http://zxx4.f3322.net:46000
|
VUE_APP_API_BASE_URL=http://zxx4.f3322.net:46000
|
||||||
VUE_APP_USER_MODEL3=AdminUser
|
VUE_APP_USER_MODEL=AdminUser
|
||||||
VUE_APP_USER_MODEL=BaseAdmin
|
VUE_APP_USER_MODEL2=BaseAdmin
|
||||||
|
VUE_APP_BEID=1
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
</vxe-form>
|
</vxe-form>
|
||||||
|
|
||||||
|
|
||||||
<div>
|
<div class="footerbar">
|
||||||
<a-button type="primary" @click="ok">确定</a-button>
|
<a-button type="primary" @click="ok">确定</a-button>
|
||||||
<a-button @click="cancel">取消</a-button>
|
<a-button @click="cancel">取消</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
</template>
|
</template>
|
||||||
<template #op="{ row }">
|
<template #op="{ row }">
|
||||||
<div class="oplinks">
|
<div class="oplinks">
|
||||||
|
<a @click.stop="pageEditSql(row)" title="SQL配置"><a-icon type="database" /></a>
|
||||||
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
|
<a @click.stop="pageEdit(row)" title="编辑"><a-icon type="edit" /></a>
|
||||||
<a @click.stop="pageDelete(row)" title="删除"><a-icon type="delete" /></a>
|
<a @click.stop="pageDelete(row)" title="删除"><a-icon type="delete" /></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -170,7 +171,7 @@ export default {
|
||||||
{ field: 'admin_count', width: 110, sortable: true, title: '用户数', showHeaderOverflow: true }, // 用户数
|
{ field: 'admin_count', width: 110, sortable: true, title: '用户数', showHeaderOverflow: true }, // 用户数
|
||||||
{ field: 'status', slots: { default: 'status' }, width: 80, sortable: true, title: '状态', showHeaderOverflow: true }, // 状态
|
{ field: 'status', slots: { default: 'status' }, width: 80, sortable: true, title: '状态', showHeaderOverflow: true }, // 状态
|
||||||
{ field: 'create_time', formatter: "formatDate", width: 160, sortable: true, title: '创建时间', showHeaderOverflow: true }, // 创建时间
|
{ field: 'create_time', formatter: "formatDate", width: 160, sortable: true, title: '创建时间', showHeaderOverflow: true }, // 创建时间
|
||||||
{ title: '操作', slots: { default: 'op' }, width: 120 }
|
{ title: '操作', slots: { default: 'op' }, width: 150 }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -290,6 +291,23 @@ export default {
|
||||||
}
|
}
|
||||||
this.$openPage("/BaseCompany/BaseCompanyUpdate/" + row[this.keyName]); // 打开页面
|
this.$openPage("/BaseCompany/BaseCompanyUpdate/" + row[this.keyName]); // 打开页面
|
||||||
},
|
},
|
||||||
|
pageEditSql(row) {
|
||||||
|
if (!row) { // 如果没有选中行
|
||||||
|
this.$mk.msg("请选择行"); // 提示
|
||||||
|
return; // 返回
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$mk.dialog.open({
|
||||||
|
page: () => import("./server"),
|
||||||
|
title: "修改SQL配置",
|
||||||
|
dataId: row[this.keyName],
|
||||||
|
callback: ({ success }) => {
|
||||||
|
success && this.$refs.xGrid.commitProxy('query')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
pageDelete(row) {
|
pageDelete(row) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,158 @@
|
||||||
|
<template>
|
||||||
|
<div class="page-body">
|
||||||
|
|
||||||
|
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
|
||||||
|
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||||
|
<template #myregion="{}">
|
||||||
|
<a-input-search placeholder="input search text" enter-button />
|
||||||
|
</template>
|
||||||
|
</vxe-form>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="footerbar">
|
||||||
|
<a-button type="primary" @click="ok">确定</a-button>
|
||||||
|
<a-button @click="cancel">取消</a-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BASE_URL from '@/services/base/api.js';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
i18n: require('./i18n'),
|
||||||
|
|
||||||
|
props: {
|
||||||
|
pageMode: {
|
||||||
|
type: String,
|
||||||
|
default: "edit"
|
||||||
|
},
|
||||||
|
dataId: {
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
|
||||||
|
// 页面数据变量
|
||||||
|
var pageData = {
|
||||||
|
|
||||||
|
actions: {
|
||||||
|
update: `${BASE_URL.BASE_URL}/SqlServer/v1/sql/server/update`,
|
||||||
|
get: `${BASE_URL.BASE_URL}/SqlServer/v1/sql/server/detail`
|
||||||
|
},
|
||||||
|
|
||||||
|
formOptions: {
|
||||||
|
data: {
|
||||||
|
company_id:0,
|
||||||
|
ipaddress:'',
|
||||||
|
port:'',
|
||||||
|
username:'',
|
||||||
|
password:'',
|
||||||
|
database:'',
|
||||||
|
},
|
||||||
|
|
||||||
|
titleWidth: 100,
|
||||||
|
titleAlign: 'right',
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
|
||||||
|
items: [
|
||||||
|
{ field: 'ipaddress', title: 'IP', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入IP' } } },
|
||||||
|
{ field: 'port', title: '端口', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入端口' } } },
|
||||||
|
{ field: 'username', title: '用户名', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入用户名' } } },
|
||||||
|
{ field: 'password', title: '密码', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入密码' } } },
|
||||||
|
{ field: 'database', title: '数据库', span: 24, itemRender: { name: '$input', props: { placeholder: '请输入数据库' } } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions);
|
||||||
|
|
||||||
|
return pageData;
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.dataId) {
|
||||||
|
this.$mk.post({
|
||||||
|
url: this.actions.get,
|
||||||
|
loading: "加载中...",
|
||||||
|
data: {
|
||||||
|
company_id: this.dataId
|
||||||
|
}
|
||||||
|
}).then(a => {
|
||||||
|
if(a.data && a.data.sql_server){
|
||||||
|
this.formOptions.data = a.data.sql_server;
|
||||||
|
}else{
|
||||||
|
this.formOptions.data.company_id = this.dataId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((a) => {
|
||||||
|
console.log(a)
|
||||||
|
//this.$mk.error(a.data.msg);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.formOptions.data.company_id = this.dataId;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
// 函数
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
loadData() {
|
||||||
|
},
|
||||||
|
|
||||||
|
ok() {
|
||||||
|
|
||||||
|
let save = () => {
|
||||||
|
let action = this.actions.update;
|
||||||
|
let postdata = Object.assign({}, this.formOptions.data);
|
||||||
|
|
||||||
|
postdata.company_id = this.dataId;
|
||||||
|
this.$mk.post({
|
||||||
|
url: action,
|
||||||
|
loading: "保存中...",
|
||||||
|
data: postdata,
|
||||||
|
useBigInt: true
|
||||||
|
}).then(() => {
|
||||||
|
this.$mk.success("保存成功");
|
||||||
|
this.$emit("callback", { success: true });
|
||||||
|
}).catch((a) => {
|
||||||
|
this.$mk.error(a.data.msg);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
this.$refs.xForm.validate((a) => {
|
||||||
|
|
||||||
|
if (a) {
|
||||||
|
let count = 0;
|
||||||
|
for (let name in a) {
|
||||||
|
a[name];
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
this.$mk.error(`存在${count}项错误,请检查`);
|
||||||
|
} else {
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel() {
|
||||||
|
this.$emit("callback", {});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 监听属性
|
||||||
|
watch: {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style></style>
|
||||||
|
|
@ -210,9 +210,27 @@ export default {
|
||||||
const loginRes = res.data
|
const loginRes = res.data
|
||||||
if (loginRes.code == 200) {
|
if (loginRes.code == 200) {
|
||||||
if (!this.isMiddleAdmin()) {
|
if (!this.isMiddleAdmin()) {
|
||||||
this.companyShow = true;
|
|
||||||
|
|
||||||
|
|
||||||
this.companyData = loginRes.data.company_switch;
|
this.companyData = loginRes.data.company_switch;
|
||||||
this.loginResult = loginRes;
|
this.loginResult = loginRes;
|
||||||
|
|
||||||
|
|
||||||
|
if (!this.companyData || !this.companyData.length) {
|
||||||
|
|
||||||
|
this.afterLoginSuccess({
|
||||||
|
token: this.loginResult.data.access_token,
|
||||||
|
access_expire: this.loginResult.data.access_expire,
|
||||||
|
uid: this.loginResult.data.uid,
|
||||||
|
loginResMsg: this.loginResult.msg
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.companyShow = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -260,7 +278,7 @@ export default {
|
||||||
.logo {
|
.logo {
|
||||||
height: 80px;
|
height: 80px;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
margin-bottom:10px;
|
margin-bottom: 10px;
|
||||||
// border: 1px solid black;
|
// border: 1px solid black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -273,14 +291,15 @@ export default {
|
||||||
// margin-left: 25%;
|
// margin-left: 25%;
|
||||||
// border: 1px solid black;
|
// border: 1px solid black;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-bottom:10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
i {
|
i {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right:0px;
|
right: 0px;
|
||||||
color:rgb(194, 194, 194);
|
color: rgb(194, 194, 194);
|
||||||
|
|
||||||
b {
|
b {
|
||||||
font-weight: 10;
|
font-weight: 10;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ export async function login(name, password) {
|
||||||
if (process.env.VUE_APP_USER_MODEL != "AdminUser") {
|
if (process.env.VUE_APP_USER_MODEL != "AdminUser") {
|
||||||
params.beid = parseInt(process.env.VUE_APP_BEID)
|
params.beid = parseInt(process.env.VUE_APP_BEID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(params)
|
||||||
return request(LOGIN.url, LOGIN.method, params)
|
return request(LOGIN.url, LOGIN.method, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue