Commit 6c916a78 by 蒋勇

d

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