Commit dd71ae4c by 蒋勇

d

parent 8dc66ffd
...@@ -61,10 +61,10 @@ export const uploadImg = formData => { ...@@ -61,10 +61,10 @@ export const uploadImg = formData => {
}) })
} }
export const getOrgData = () => { export const getOrgs = () => {
return axios.request({ return axios.request({
url: 'get_org_data', url: '/web/common/companyCtl/getOrgs',
method: 'get' method: 'post'
}) })
} }
......
.custom-bread-crumb{ .custom-bread-crumb{
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
color:white
} }
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
background-color: black;
color:white;
.custom-content-con{ .custom-content-con{
float: right; float: right;
height: auto; height: auto;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
} }
.header-con{ .header-con{
background: #fff; background: #fff;
padding: 0 20px; padding: 0 0px;
width: 100%; width: 100%;
} }
.main-layout-con{ .main-layout-con{
......
...@@ -18,11 +18,14 @@ ...@@ -18,11 +18,14 @@
<language v-if="$config.useI18n" @on-lang-change="setLocal" style="margin-right: 10px;" :lang="local"/> <language v-if="$config.useI18n" @on-lang-change="setLocal" style="margin-right: 10px;" :lang="local"/>
<error-store v-if="$config.plugin['error-store'] && $config.plugin['error-store'].showInHeader" :has-read="hasReadErrorPage" :count="errorCount"></error-store> <error-store v-if="$config.plugin['error-store'] && $config.plugin['error-store'].showInHeader" :has-read="hasReadErrorPage" :count="errorCount"></error-store>
<fullscreen v-model="isFullscreen" style="margin-right: 10px;"/> <fullscreen v-model="isFullscreen" style="margin-right: 10px;"/>
<Tooltip content="切换多页签" placement="bottom">
<span style="cursor:pointer" @click="navTabShow=!navTabShow"><Icon style="font-size:22px;padding-right:10px" type="ios-albums-outline" /></span>
</Tooltip>
</header-bar> </header-bar>
</Header> </Header>
<Content class="main-content-con"> <Content class="main-content-con">
<Layout class="main-layout-con"> <Layout class="main-layout-con">
<div class="tag-nav-wrapper"> <div v-show="navTabShow" class="tag-nav-wrapper">
<tags-nav :value="$route" @input="handleClick" :list="tagNavList" @on-close="handleCloseTag"/> <tags-nav :value="$route" @input="handleClick" :list="tagNavList" @on-close="handleCloseTag"/>
</div> </div>
<Content class="content-wrapper"> <Content class="content-wrapper">
...@@ -68,7 +71,8 @@ export default { ...@@ -68,7 +71,8 @@ export default {
collapsed: false, collapsed: false,
minLogo, minLogo,
maxLogo, maxLogo,
isFullscreen: false isFullscreen: false,
navTabShow:true
} }
}, },
computed: { computed: {
......
...@@ -173,6 +173,10 @@ export default { ...@@ -173,6 +173,10 @@ export default {
searchPlace: { searchPlace: {
type: String, type: String,
default: "top" default: "top"
},
tblheight:{
type:Number,
default:300
} }
}, },
/** /**
...@@ -188,17 +192,10 @@ export default { ...@@ -188,17 +192,10 @@ export default {
edittingCellId: "", edittingCellId: "",
edittingText: "", edittingText: "",
searchValue: "", searchValue: "",
searchKey: "", searchKey: ""
tblheight: 300
}; };
}, },
methods: { methods: {
setHeight(h) {
return this.tblheight=h;
},
getHeight() {
return window.innerHeight - this.$refs.tablesMain.$el.offsetTop - 202;
},
advSearch() { advSearch() {
this.$emit("on-adv-search"); this.$emit("on-adv-search");
}, },
...@@ -397,10 +394,6 @@ export default { ...@@ -397,10 +394,6 @@ export default {
this.handleColumns(this.columns); this.handleColumns(this.columns);
this.setDefaultSearchKey(); this.setDefaultSearchKey();
this.handleTableData(); this.handleTableData();
// this.tblheight = this.getHeight();
// $(window).resize(() => {
// this.tblheight = this.getHeight();
// });
}, },
computed: { computed: {
searchcols: function() { searchcols: function() {
......
...@@ -135,15 +135,15 @@ export default [ ...@@ -135,15 +135,15 @@ export default [
}, },
component: () => import('@/view/userinfo/orginfo_page.vue') component: () => import('@/view/userinfo/orginfo_page.vue')
}, },
{ // {
path: 'user_info', // path: 'user_info',
name: 'user_info', // name: 'user_info',
meta: { // meta: {
icon: 'ios-man', // icon: 'ios-man',
title: '用户信息' // title: '用户信息'
}, // },
component: () => import('@/view/userinfo/userinfo_page.vue') // component: () => import('@/view/userinfo/userinfo_page.vue')
}, // },
{ {
path: 'role_info', path: 'role_info',
name: 'role_info_page', name: 'role_info_page',
......
<template> <template>
<div> <PageSpace @sizechange="sizechange">
<BizTable <template v-slot:default="{adjustHeight}">
ref="bt" <BizTable
:formatCol="formatCol" ref="bt"
metaName="app_info" :formatCol="formatCol"
packageName="common" metaName="app_info"
isMulti packageName="common"
:refvalidatemethod="validmethod" :tblheight="adjustHeight-120"
@onexec="onexec" isMulti
></BizTable> :refvalidatemethod="validmethod"
</div> @onexec="onexec"
:savebefore="beforesave"
:editbefore="beforedit"
:addbefore="beforeadd"
></BizTable>
</template>
</PageSpace>
</template> </template>
<script> <script>
import BizTable from "../components/tables/biztables"; import BizTable from "../components/tables/biztables";
import PageSpace from "@/view/components/pagespace/page_space.vue";
export default { export default {
name: "appinfo_page", name: "appinfo_page",
data() { data() {
return {}; return {};
}, },
components: { components: {
PageSpace,
BizTable BizTable
}, },
methods: { methods: {
sizechange(h){
console.log(h)
},
beforeadd(row, cbk) {
return cbk({ value: true, message: null });
},
beforedit(row, cbk) {
return cbk({ value: true, message: null });
},
beforesave(key, row, cbk) {
return cbk(row);
},
onexec(k, row) {}, onexec(k, row) {},
validmethod(rule, value, callback) { validmethod(rule, value, callback) {
if (rule.field == "functionJSON") { if (rule.field == "functionJSON") {
......
<template>
<div id="framediv">
<slot :adjustHeight="frameHeight"></slot>
</div>
</template>
<script>
export default {
name: "pagespace_page",
prop:{
tweak:Number
},
data() {
return {
frameHeight:0,
advalue:this.tweak?this.tweak:0
};
},
components: {
},
mounted(){
this.setHeight();
$(window).resize(()=>{
this.setHeight()
})
},
methods: {
setHeight(){
this.$nextTick(()=>{
let $framediv = $("#framediv");
let el = $framediv.get()[0];
let h = window.innerHeight - el.offsetTop-this.advalue;
this.frameHeight=h
})
console.log("h.............................",h)
this.$emit("sizechange",this.frameHeight)
}
}
};
</script>
<style>
</style>
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
searchable searchable
search-place="top" search-place="top"
:loading="tblloading" :loading="tblloading"
:tblheight="tblheight"
highlightRow highlightRow
v-model="tableData" v-model="tableData"
:columns="colswithauth" :columns="colswithauth"
...@@ -183,6 +184,10 @@ export default { ...@@ -183,6 +184,10 @@ export default {
}, },
addbefore: { addbefore: {
type: Function type: Function
},
tblheight: {
type: Number,
default: 300
} }
}, },
data() { data() {
......
...@@ -145,6 +145,7 @@ export default { ...@@ -145,6 +145,7 @@ export default {
this.currentData = data; this.currentData = data;
this.currentNode = node; this.currentNode = node;
this.rootNode = root; this.rootNode = root;
this.selclick(root,node,data)
} }
} }
}, },
...@@ -220,7 +221,7 @@ export default { ...@@ -220,7 +221,7 @@ export default {
item.orgpath = item.code; item.orgpath = item.code;
} }
item.children.sort((item1, item2) => { item.children.sort((item1, item2) => {
return item1.seq < item2.seq; return item1.seq > item2.seq;
}); });
modiTreeNodeByCode(item.children, newobj, item); modiTreeNodeByCode(item.children, newobj, item);
} else { } else {
...@@ -234,6 +235,9 @@ export default { ...@@ -234,6 +235,9 @@ export default {
}; };
}, },
methods: { methods: {
selclick(root,node,data){
this.$emit("onselnode",root,node,data)
},
setCtlVisable(prop, b) { setCtlVisable(prop, b) {
this.$refs.nodeform.setCtlVisable(prop, b); this.$refs.nodeform.setCtlVisable(prop, b);
}, },
...@@ -287,7 +291,7 @@ export default { ...@@ -287,7 +291,7 @@ export default {
initTree() { initTree() {
//异步加载 //异步加载
//按照当前公司加载组织结构,如果数据为空,那么就初始化一个根实体对象 //按照当前公司加载组织结构,如果数据为空,那么就初始化一个根实体对象
if (this.initData) { if (this.initData && this.treedata.length==0) {
this.initData(originalData => { this.initData(originalData => {
if ( if (
originalData && originalData &&
...@@ -345,7 +349,7 @@ export default { ...@@ -345,7 +349,7 @@ export default {
this.currentData = data; this.currentData = data;
this.currentNode = node; this.currentNode = node;
this.rootNode = root; this.rootNode = root;
this.selclick(root,node,data)
} }
} }
}, },
...@@ -415,6 +419,7 @@ export default { ...@@ -415,6 +419,7 @@ export default {
const parent = root.find(el => el.nodeKey === parentKey).node; const parent = root.find(el => el.nodeKey === parentKey).node;
const index = parent.children.indexOf(data); const index = parent.children.indexOf(data);
parent.children.splice(index, 1); parent.children.splice(index, 1);
this.$emit("deletenode",this.treedata,node)
}, },
findParentByNode(node) { findParentByNode(node) {
const parentKey = this.rootNode.find(el => el === node).parent; const parentKey = this.rootNode.find(el => el === node).parent;
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
:metainfo="metainfo" :metainfo="metainfo"
@controlctl="controlctl" @controlctl="controlctl"
@drawaction="drawaction" @drawaction="drawaction"
@modisave="orgsave"
@deletenode="orgsave"
@onselnode="onselnode"
></OrgEditor> ></OrgEditor>
<UserInfo <UserInfo
ref="userinfo" ref="userinfo"
...@@ -21,6 +24,7 @@ ...@@ -21,6 +24,7 @@
</template> </template>
<script> <script>
import { getApp, saveAuths, findAuthsByRoles } from "@/api/meta"; import { getApp, saveAuths, findAuthsByRoles } from "@/api/meta";
import { saveFormData, getOrgs } from "@/api/data";
import OrgEditor from "@/view/components/tables/forms/jsoneditor.vue"; import OrgEditor from "@/view/components/tables/forms/jsoneditor.vue";
import SplitPanel from "@/view/components/split-pane2/split-pane2.vue"; import SplitPanel from "@/view/components/split-pane2/split-pane2.vue";
import UserInfo from "./userinfo_page.vue"; import UserInfo from "./userinfo_page.vue";
...@@ -105,6 +109,26 @@ export default { ...@@ -105,6 +109,26 @@ export default {
}); });
}, },
methods: { methods: {
onselnode(root,node,data){
this.$refs.userinfo.searchWhere({opath:data.code})
},
orgsave(treedata, modidata) {
saveFormData("/web/common/companyCtl/setOrgs", {
orgJson: treedata,
curdata:modidata
}).then(res => {
let rtn = res.data;
console.log("ddddddddddddddddd", rtn);
if (rtn.status == 0) {
let treedata2 = rtn.data.orgJson;
console.log("save org...............................", treedata2);
this.$refs.orgtree.treedata = treedata2;
this.$refs.orgtree.refreshTree();
this.$Message.success("当前操作成功完成")
} else {
}
});
},
beforeadd(row, cbk) { beforeadd(row, cbk) {
if (!this.$refs.orgtree.currentData) { if (!this.$refs.orgtree.currentData) {
return cbk({ value: false, message: "请选择岗位节点" }); return cbk({ value: false, message: "请选择岗位节点" });
...@@ -130,7 +154,8 @@ export default { ...@@ -130,7 +154,8 @@ export default {
this.$refs.orgtree.currentData && this.$refs.orgtree.currentData &&
this.$refs.orgtree.currentData.isPosition this.$refs.orgtree.currentData.isPosition
) { ) {
row.opath = this.$refs.orgtree.currentData.orgpath; row.opath=this.$refs.orgtree.currentData.orgpath
row.ptags = this.$refs.orgtree.currentData.orgtag;
} }
console.log("before.save", key, row); console.log("before.save", key, row);
return cbk(row); return cbk(row);
...@@ -154,17 +179,19 @@ export default { ...@@ -154,17 +179,19 @@ export default {
} }
}, },
controlctl(v, prop, fm) { controlctl(v, prop, fm) {
if(prop=="isMain"){ if (prop == "isMain") {
let cnode=this.$refs.orgtree.currentNode let cnode = this.$refs.orgtree.currentNode;
let pnode=this.$refs.orgtree.findParentByNode(cnode) let pnode = this.$refs.orgtree.findParentByNode(cnode);
let fmodel=fm.formModel let fmodel = fm.formModel;
if(fmodel.orgtag && fmodel.orgtag.indexOf(pnode.code)<0){ if (fmodel.orgtag && fmodel.orgtag.indexOf(pnode.code) < 0) {
let ttmp=fmodel.orgtag.split(",").push(pnode.code).join(",") let ttmp = fmodel.orgtag
fmodel.orgtag=ttmp .split(",")
}else{ .push(pnode.code)
fmodel.orgtag=pnode.code .join(",");
fmodel.orgtag = ttmp;
} else {
fmodel.orgtag = pnode.code;
} }
} }
if (prop == "isPosition") { if (prop == "isPosition") {
if (v) { if (v) {
...@@ -179,13 +206,15 @@ export default { ...@@ -179,13 +206,15 @@ export default {
} }
}, },
initData(cbk) { initData(cbk) {
cbk([ getOrgs().then(res => {
{ let rtn = res.data;
title: "目录", if (rtn.status == 0) {
expand: true, let treedata2 = rtn.data.orgJson;
roles: [] cbk(treedata2);
}else{
throw new Error("获取组织数据出错")
} }
]); });
} }
} }
}; };
......
...@@ -51,6 +51,10 @@ export default { ...@@ -51,6 +51,10 @@ export default {
} }
}, },
methods: { methods: {
searchWhere(obj) {
this.$refs.bt.initWhere = obj;
this.$refs.bt.fetchData();
},
setHeight(h) { setHeight(h) {
this.$refs.bt.setHeight(h); this.$refs.bt.setHeight(h);
}, },
......
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