Commit 6c916a78 by 蒋勇

d

parent a8177b90
...@@ -3,7 +3,7 @@ export default { ...@@ -3,7 +3,7 @@ export default {
* @description 配置显示在浏览器标签的title * @description 配置显示在浏览器标签的title
*/ */
title: '智慧中台 ', title: '智慧中台 ',
appkey:'1b306383-683c-4b1d-933f-c2eb709e412d', appkey:'7a7edc25-0363-48c1-bb8a-dbeb43be5264',
/** /**
* @description token在Cookie中存储的天数,默认1天 * @description token在Cookie中存储的天数,默认1天
*/ */
......
...@@ -30,6 +30,7 @@ class HttpRequest { ...@@ -30,6 +30,7 @@ class HttpRequest {
regrole=params.get("regrole") regrole=params.get("regrole")
this.confapp.regrole=regrole this.confapp.regrole=regrole
this.confapp.companykey=companykey this.confapp.companykey=companykey
this.confapp.paramappkey=appkey;//为了区分当前切换应用上下文后,进入的应用非平台应用
}catch(e){ }catch(e){
console.log(e) console.log(e)
} }
......
...@@ -52,7 +52,12 @@ export const hasChild = (item) => { ...@@ -52,7 +52,12 @@ export const hasChild = (item) => {
return item.children && item.children.length !== 0 return item.children && item.children.length !== 0
} }
const showThisMenuEle = (item, access) => { const showThisMenuEle = (item, access,user) => {
if(item.name=="sysmg" && !user.isSuper && user.isAdmin){
if(!config.paramappkey){
return false
}
}
if (item.meta && item.meta.access && item.meta.access.length) { if (item.meta && item.meta.access && item.meta.access.length) {
if (hasOneOf(item.meta.access, access)) return true if (hasOneOf(item.meta.access, access)) return true
else return false else return false
...@@ -62,7 +67,7 @@ const showThisMenuEle = (item, access) => { ...@@ -62,7 +67,7 @@ const showThisMenuEle = (item, access) => {
* @param {Array} list 通过路由列表得到菜单列表 * @param {Array} list 通过路由列表得到菜单列表
* @returns {Array} * @returns {Array}
*/ */
export const getMenuByRouter = (list, access) => { export const getMenuByRouter = (list, access,user) => {
let res = [] let res = []
forEach(list, item => { forEach(list, item => {
if (!item.meta || (item.meta && !item.meta.hideInMenu)) { if (!item.meta || (item.meta && !item.meta.hideInMenu)) {
...@@ -71,11 +76,11 @@ export const getMenuByRouter = (list, access) => { ...@@ -71,11 +76,11 @@ export const getMenuByRouter = (list, access) => {
name: item.name, name: item.name,
meta: item.meta meta: item.meta
} }
if ((hasChild(item) || (item.meta && item.meta.showAlways)) && showThisMenuEle(item, access)) { if ((hasChild(item) || (item.meta && item.meta.showAlways)) && showThisMenuEle(item, access,user)) {
obj.children = getMenuByRouter(item.children, access) obj.children = getMenuByRouter(item.children, access)
} }
if (item.meta && item.meta.href) obj.href = item.meta.href if (item.meta && item.meta.href) obj.href = item.meta.href
if (showThisMenuEle(item, access)) res.push(obj) if (showThisMenuEle(item, access,user)) res.push(obj)
} }
}) })
return res return res
......
...@@ -84,7 +84,7 @@ export default [ ...@@ -84,7 +84,7 @@ export default [
icon: 'ios-man', icon: 'ios-man',
title: '我的应用' title: '我的应用'
}, },
component: () => import('@/view/userinfo/tanentinfo_page.vue') component: () => import('@/view/appinfo/myappinfo_page.vue')
} }
] ]
}, },
...@@ -118,8 +118,8 @@ export default [ ...@@ -118,8 +118,8 @@ export default [
] ]
}, },
{ {
path: '/user', path: '/sysmg',
name: 'user', name: 'sysmg',
meta: { meta: {
icon: 'ios-settings', icon: 'ios-settings',
title: '系统管理' title: '系统管理'
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
hasReadErrorPage: false hasReadErrorPage: false
}, },
getters: { getters: {
menuList: (state, getters, rootState) => getMenuByRouter(routers, rootState.user.access), menuList: (state, getters, rootState) => getMenuByRouter(routers, rootState.user.access,rootState.user),
errorCount: state => state.errorList.length errorCount: state => state.errorList.length
}, },
mutations: { mutations: {
......
...@@ -20,9 +20,11 @@ export default { ...@@ -20,9 +20,11 @@ export default {
{ {
"title":"关键信息", "title":"关键信息",
ctls:[ ctls:[
{ "type": "input", "label": "昵称", "prop": "name", "placeHolder": "请输入昵称", "style": "", rules: [{ "required": true, "message": ' ', "trigger": 'blur' },] }, { "type": "input", "label": "应用名称", "prop": "name", "placeHolder": "请输入昵称", "style": "", rules: [{ "required": true, "message": ' ', "trigger": 'blur' },] },
{ "type": "input", "label": "邮件", "prop": "domainName", "placeHolder": "请输入邮件", "style": "", rules: [{ "required": true, "message": ' ', "trigger": 'blur' },] }, { "type": "input", "label": "路由域名", "prop": "domainName", "placeHolder": "请输入邮件", "style": "", rules: [{ "required": true, "message": ' ', "trigger": 'blur' },] },
{ "type": "input", "label": "帐户", "prop": "backend", "placeHolder": "请输入帐户名", "style": "", rules: [{ "required": true, "message": ' ', "trigger": 'blur' },] }, { "type": "input", "label": "后端服务", "prop": "backend", "placeHolder": "请输入帐户名", "style": "", rules: [{ "required": true, "message": ' ', "trigger": 'blur' },] },
{ "type": "input", "label": "后端服务", "prop": "backendx", "placeHolder": "请输入帐户名", "style": "", rules: [{ "required": true, "message": ' ', "trigger": 'blur' },] },
{ "type": "input", "label": "后端服务", "prop": "backendxx", "placeHolder": "请输入帐户名", "style": "", rules: [{ "required": true, "message": ' ', "trigger": 'blur' },] },
] ]
} }
], ],
......
...@@ -18,6 +18,8 @@ export default { ...@@ -18,6 +18,8 @@ export default {
avatarImgPath: '', avatarImgPath: '',
token: getToken(), token: getToken(),
access: '', access: '',
isAdmin:false,
isSuper:false,
hasGetInfo: false, hasGetInfo: false,
unreadCount: 0, unreadCount: 0,
messageUnreadList: [], messageUnreadList: [],
...@@ -26,6 +28,12 @@ export default { ...@@ -26,6 +28,12 @@ export default {
messageContentStore: {} messageContentStore: {}
}, },
mutations: { mutations: {
setAdmin(state, isadmin){
state.isAdmin=isadmin
},
setSuper(state, issuper){
state.isSuper=issuper
},
setAvatar (state, avatarPath) { setAvatar (state, avatarPath) {
state.avatarImgPath = avatarPath state.avatarImgPath = avatarPath
}, },
...@@ -87,6 +95,8 @@ export default { ...@@ -87,6 +95,8 @@ export default {
commit('setUserId', rtn.data.user.id) commit('setUserId', rtn.data.user.id)
commit('setAccess', ['super_admin', 'admin']) commit('setAccess', ['super_admin', 'admin'])
commit('setHasGetInfo', true) commit('setHasGetInfo', true)
commit('setAdmin',rtn.data.user.isAdmin)
commit('setSuper',rtn.data.user.isSuper)
resolve(rtn.data) resolve(rtn.data)
}else{ }else{
reject(rtn.data) reject(rtn.data)
...@@ -108,6 +118,8 @@ export default { ...@@ -108,6 +118,8 @@ export default {
commit('setUserId', rtn.data.id) commit('setUserId', rtn.data.id)
commit('setAccess', ['super_admin', 'admin']) commit('setAccess', ['super_admin', 'admin'])
commit('setHasGetInfo', true) commit('setHasGetInfo', true)
commit('setAdmin',rtn.data.isAdmin)
commit('setSuper',rtn.data.isSuper)
rtn.data.access= ['super_admin', 'admin'] rtn.data.access= ['super_admin', 'admin']
resolve(rtn.data) resolve(rtn.data)
}else{ }else{
......
<template>
<div>
<BizTable
ref="bt"
:formatCol="formatCol"
metaName="app_info"
packageName="common"
isMulti
></BizTable>
</div>
</template>
<script>
import BizTable from "../components/tables/biztables";
export default {
name: "myappinfo_page",
data() {
return {};
},
components: {
BizTable
},
methods: {
// onnew() {
// this.$refs.bt.setFormCtlVisable("userName", true);
// },
// onedit() {
// this.$refs.bt.setFormCtlVisable("userName", false);
// },
formatCol(row, key, index) {
// if (key == "roleName") {
// let rolestr = row.Roles.map(item => item.name).join(",");
// row.roles = row.Roles.map(item => item.id);
// return `<span>${rolestr}</span>`;
// }
// if (key == "isAdmin" || key == "isSuper") {
// return `<span>${row[key] ? "是" : "否"}</span>`;
// }
if (key == "created_at") {
return `<span>${new Date(row[key]).toLocaleString()}</span>`;
}
return row[key];
}
}
};
</script>
<style>
</style>
<template> <template>
<div> <div>
<Card style="height:100%"> <Card style="height:100%">
<Drawer placement="right" :closable="false" :mask-closable="false" v-model="showsearch" width="600"> <Drawer
placement="right"
:closable="false"
:mask-closable="false"
v-model="showsearch"
width="600"
>
<Forms ref="searchform" :fminfo="searchinfo" style="height:100%"> <Forms ref="searchform" :fminfo="searchinfo" style="height:100%">
<template v-slot:default="slotProps"> <template v-slot:default="slotProps">
<Button <Button
...@@ -54,8 +60,14 @@ ...@@ -54,8 +60,14 @@
</div> </div>
</div> </div>
<!-- <Button style="margin: 10px 0;" type="primary" @click="exportExcel">导出为Csv文件</Button> --> <!-- <Button style="margin: 10px 0;" type="primary" @click="exportExcel">导出为Csv文件</Button> -->
<Drawer placement="right" :closable="false" :mask-closable="false" v-model="showedform" width="70"> <Drawer
<Forms ref="edform" :fminfo="forminfo" style="height:100%"> placement="right"
:closable="false"
:mask-closable="false"
v-model="showedform"
width="70"
>
<Forms ref="edform" :fminfo="forminfo" style="height:100%" :refvalidatemethod="refvalidatemethod">
<template v-slot:default="slotProps"> <template v-slot:default="slotProps">
<Button <Button
v-for="bt in formbtns" v-for="bt in formbtns"
...@@ -101,7 +113,7 @@ export default { ...@@ -101,7 +113,7 @@ export default {
}, },
props: { props: {
packageName: String, packageName: String,
modelName:String, modelName: String,
metaName: { metaName: {
type: String, type: String,
default: "user_info" default: "user_info"
...@@ -130,6 +142,14 @@ export default { ...@@ -130,6 +142,14 @@ export default {
default() { default() {
return (row, key, index) => row[key]; return (row, key, index) => row[key];
} }
},
refvalidatemethod:{
type: Function,
default() {
return (rule, value, callback) => {
return callback();
};
}
} }
}, },
data() { data() {
...@@ -163,8 +183,8 @@ export default { ...@@ -163,8 +183,8 @@ export default {
}; };
}, },
methods: { methods: {
setFormCtlVisable(prop,isShow){ setFormCtlVisable(prop, isShow) {
this.$refs.edform.setCtlVisable(prop,isShow) this.$refs.edform.setCtlVisable(prop, isShow);
}, },
deepclone(objin) { deepclone(objin) {
let rtnstr = JSON.stringify(objin); let rtnstr = JSON.stringify(objin);
...@@ -235,8 +255,8 @@ export default { ...@@ -235,8 +255,8 @@ export default {
this.currentRow = null; this.currentRow = null;
}, 500); }, 500);
}, },
doexec(key, row,btninfo) { doexec(key, row, btninfo) {
this.$emit("onexec",key, row,btninfo) this.$emit("onexec", key, row, btninfo);
if (key == "delete") { if (key == "delete") {
this.currentRow = row; this.currentRow = row;
this.isdel = true; this.isdel = true;
...@@ -252,54 +272,61 @@ export default { ...@@ -252,54 +272,61 @@ export default {
if (key == "edit") { if (key == "edit") {
this.fm_status = "edit"; this.fm_status = "edit";
this.showedform = true; this.showedform = true;
this.$emit("onedit") this.$emit("onedit");
setTimeout(() => { setTimeout(() => {
this.$refs.edform.formModel = this.deepclone(row) this.$refs.edform.formModel = this.deepclone(row);
this.$refs.edform.activeChildTables(false) this.$refs.edform.activeChildTables(false);
}, 100); }, 100);
} }
if (key == "create") { if (key == "create") {
this.fm_status = "create"; this.fm_status = "create";
this.showedform = true; this.showedform = true;
this.$refs.edform.activeChildTables(true) this.$refs.edform.activeChildTables(true);
this.$emit("onnew") this.$emit("onnew");
} }
if (key == "save") { if (key == "save") {
if (this.clickcount["save"] == 0) { this.$refs.edform.validate(valid => {
this.clickcount["save"] = this.clickcount["save"] + 1; if (valid) {
let url = ""; if (this.clickcount["save"] == 0) {
let msg = ""; this.clickcount["save"] = this.clickcount["save"] + 1;
if (this.fm_status == "edit") { let url = "";
url = this.buildUrl("update"); let msg = "";
msg = "当前的更新操作已成功."; if (this.fm_status == "edit") {
} url = this.buildUrl("update");
if (this.fm_status == "create") { msg = "当前的更新操作已成功.";
url = this.buildUrl("create"); }
msg = "当前的新增操作已成功."; if (this.fm_status == "create") {
} url = this.buildUrl("create");
console.log("row........................save") msg = "当前的新增操作已成功.";
console.log(row) }
saveFormData(url, row).then(res => { console.log("row........................save");
let rtn = res.data; console.log(row);
console.log(rtn);
if (rtn.status == 0) { saveFormData(url, row).then(res => {
this.$refs.edform.resetForm(); let rtn = res.data;
this.fm_status = "normal"; console.log(rtn);
this.showedform = false; if (rtn.status == 0) {
this.clickcount["save"] = this.clickcount["save"] - 1; this.$refs.edform.resetForm();
this.$Message.success(msg); this.fm_status = "normal";
this.showedform = false;
this.fetchData(); this.clickcount["save"] = this.clickcount["save"] - 1;
this.$Message.success(msg);
this.fetchData();
} else {
this.fm_status = "normal";
this.showedform = false;
this.$Message.error("当前操作失败,请稍后重试或联系管理员.");
this.fetchData();
}
});
} else { } else {
this.fm_status = "normal"; this.$Message.warning("当前进行了重复的无效操作.");
this.showedform = false;
this.$Message.error("当前操作失败,请稍后重试或联系管理员.");
this.fetchData();
} }
}); }else{
} else { console.log("validate not pass.......")
this.$Message.warning("当前进行了重复的无效操作."); }
} });
} }
if (key == "cancel") { if (key == "cancel") {
this.fm_status = "normal"; this.fm_status = "normal";
...@@ -334,7 +361,9 @@ export default { ...@@ -334,7 +361,9 @@ export default {
}); });
}, },
buildUrl(methodName) { buildUrl(methodName) {
let modelname = this.modelName?this.modelName:this.metaName.split("_")[0]; let modelname = this.modelName
? this.modelName
: this.metaName.split("_")[0];
console.log(modelname, ">>>>>>>>>>>>>>>>>>"); console.log(modelname, ">>>>>>>>>>>>>>>>>>");
let url = let url =
"/web/" + this.packageName + "/" + modelname + "Ctl/" + methodName; "/web/" + this.packageName + "/" + modelname + "Ctl/" + methodName;
...@@ -363,9 +392,7 @@ export default { ...@@ -363,9 +392,7 @@ export default {
//从缓存中恢复查询条件 //从缓存中恢复查询条件
this.fetchData(); this.fetchData();
}, },
created() { created() {},
},
computed: { computed: {
searchinfo() { searchinfo() {
return this.metainfo["search"]; return this.metainfo["search"];
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
<Icon type="ios-paper-outline"/> <Icon type="ios-paper-outline"/>
{{forminfo.name}} {{forminfo.name}}
</p> </p>
<Form ref="ofm" :model="formModel" :rules="metaRules"> <Form ref="ofm" :model="formModel" :rules="metaRules" label-position="left">
<template v-if="forminfo.lists && forminfo.lists.length>0"> <template v-if="forminfo.lists && forminfo.lists.length>0">
<Tabs value="main"> <Tabs value="main">
<TabPane label="表单信息" name="main"> <TabPane label="表单信息" name="main">
<template v-for="group in forminfo.main"> <template v-for="group in forminfo.main">
<Divider orientation="left" :key="group.title">{{group.title}}</Divider> <Divider orientation="left" :key="group.title">{{group.title}}</Divider>
<Row type="flex" justify="start" :key="'r'+group.title"> <Row type="flex" justify="start" :key="'r'+group.title">
<Col :xs="2" :sm="4" :md="6" :lg="8" v-for="ctl in group.ctls" :key="ctl.prop" > <Col :xs="getCols(group.cols)" :sm="getCols(group.cols)" :md="getCols(group.cols)" :lg="getCols(group.cols)" v-for="ctl in group.ctls" :key="ctl.prop" >
<FormItem v-if="ctlVisable[ctl.prop]" :label="ctl.label" :prop="ctl.prop"> <FormItem v-if="ctlVisable[ctl.prop]" :label="ctl.label" :prop="ctl.prop">
<template v-if="ctl.type=='input'"> <template v-if="ctl.type=='input'">
<input v-model="formModel[ctl.prop]"> <input v-model="formModel[ctl.prop]">
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<template v-else v-for="group in forminfo.main"> <template v-else v-for="group in forminfo.main">
<Divider orientation="left" :key="group.title">{{group.title}}</Divider> <Divider orientation="left" :key="group.title">{{group.title}}</Divider>
<Row type="flex" justify="start" align="top" :key="'r'+group.title"> <Row type="flex" justify="start" align="top" :key="'r'+group.title">
<Col :xs="12" :sm="8" :md="6" :lg="6" v-for="ctl in group.ctls" :key="ctl.prop"> <Col :xs="getCols(group.cols)" :sm="getCols(group.cols)" :md="getCols(group.cols)" :lg="getCols(group.cols)" v-for="ctl in group.ctls" :key="ctl.prop">
<FormItem v-if="ctlVisable[ctl.prop]" :label="ctl.label" :prop="ctl.prop"> <FormItem v-if="ctlVisable[ctl.prop]" :label="ctl.label" :prop="ctl.prop">
<template v-if="ctl.type=='input'"> <template v-if="ctl.type=='input'">
<input v-model="formModel[ctl.prop]"> <input v-model="formModel[ctl.prop]">
...@@ -216,6 +216,13 @@ export default { ...@@ -216,6 +216,13 @@ export default {
} }
}, },
methods: { methods: {
getCols(cols){
let cs=cols?cols:2
return 24/cs
},
validate(cbk){
this.$refs.ofm.validate(cbk)
},
activeChildTables(vf){ activeChildTables(vf){
Object.keys(this.tabDisabled).forEach(k=>{ Object.keys(this.tabDisabled).forEach(k=>{
this.tabDisabled[k]=vf==false?vf:true this.tabDisabled[k]=vf==false?vf:true
......
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