Commit d4f7452d by 蒋勇

d

parent 3ea749c5
......@@ -27,7 +27,7 @@
<div class="scroll-outer" ref="scrollOuter" @DOMMouseScroll="handlescroll" @mousewheel="handlescroll">
<div ref="scrollBody" class="scroll-body" :style="{left: tagBodyLeft + 'px'}">
<transition-group name="taglist-moving-animation">
<Tag
<Tag style="border:none"
type="dot"
v-for="(item, index) in list"
ref="tagsPageOpened"
......
......@@ -189,12 +189,15 @@ export default {
edittingText: "",
searchValue: "",
searchKey: "",
tblheight:300
tblheight: 300
};
},
methods: {
getHeight(){
return window.innerHeight - this.$refs.tablesMain.$el.offsetTop - 160
setHeight(h) {
return this.tblheight=h;
},
getHeight() {
return window.innerHeight - this.$refs.tablesMain.$el.offsetTop - 202;
},
advSearch() {
this.$emit("on-adv-search");
......@@ -261,14 +264,13 @@ export default {
props: {
type: btninfo.type,
disabled:
params.row.isSystem &&
(btninfo.key == "delete")
params.row.isSystem && btninfo.key == "delete"
? true
: false
},
on: {
click: () => {
vmobj.$emit("on-exec", btninfo.key, params.row,btninfo);
vmobj.$emit("on-exec", btninfo.key, params.row, btninfo);
}
}
},
......@@ -305,7 +307,7 @@ export default {
it.type == "selection";
});
if (!ft || (ft && ft.length == 0)) {
this.insideColumns.unshift({
this.insideColumns.unshift({
type: "selection",
width: 60,
align: "center"
......@@ -390,17 +392,15 @@ export default {
//if (this.searchable) this.handleSearch();
}
},
create(){
},
create() {},
mounted() {
this.handleColumns(this.columns);
this.setDefaultSearchKey();
this.handleTableData();
this.tblheight=this.getHeight()
$(window).resize(()=>{
this.tblheight=this.getHeight()
})
// this.tblheight = this.getHeight();
// $(window).resize(() => {
// this.tblheight = this.getHeight();
// });
},
computed: {
searchcols: function() {
......
......@@ -10,7 +10,9 @@
</div>
</split-pane>
</div>
<div slot="right" class="pane right-pane"></div>
<div slot="right" class="pane right-pane">
<slot name="right"></slot>
</div>
</split-pane>
</div>
</template>
......
<template>
<div class="split-pane-page-wrapper">
<split-pane v-model="offset" @on-moving="handleMoving">
<div slot="left" class="pane left-pane">
<slot name="left"></slot>
</div>
<div slot="right" class="pane right-pane">
<slot name="right"></slot>
</div>
</split-pane>
</div>
</template>
<script>
import SplitPane from '_c/split-pane'
import Icons from '_c/icons'
export default {
name: 'split_pane_page',
components: {
SplitPane,
Icons
},
data () {
return {
offset: 0.2,
offsetVertical: '250px'
}
},
methods: {
handleMoving (e) {
console.log(e.atMin, e.atMax)
}
}
}
</script>
<style lang="less">
.split-pane-page-wrapper{
height: 100%;
.pane{
width: 100%;
height: 100%;
&.left-pane{
}
&.right-pane{
}
&.top-pane{
}
&.bottom-pane{
}
}
}
</style>
<template>
<div>
<div style="height:100%">
<Card style="height:100%">
<Drawer
placement="right"
......@@ -47,7 +47,7 @@
>{{ bt.title }}</Button>
</template>
</tables>
<div style="text-align:center">
<div style="text-align:center;margin-top:10px">
<Page
:total="pageInfo.total"
:page-size-opts="[15,30,50,100,200,500]"
......@@ -204,6 +204,9 @@ export default {
};
},
methods: {
setHeight(h) {
return this.$refs.tables.setHeight(h);
},
ondrawvisable(v) {
if (v) {
this.initZIndex = this.initZIndex;
......
<template>
<i-switch v-model="switch1" size="large" :true-color="truecolor" :false-color="falsecolor">
<i-switch v-model="switch1" size="large" :true-color="truecolor" :false-color="falsecolor" @on-change="onchange">
<span slot="open">{{ openlabel}}</span>
<span slot="close">{{closelabel}}</span>
</i-switch>
......@@ -23,11 +23,13 @@ export default {
truecolor:String,
falsecolor:String,
openlabel:String,
closelabel:String
closelabel:String,
propname:String
},
data() {
return {
switch1: this.value,
currentprop:this.propname
};
},
watch: {
......@@ -38,6 +40,7 @@ export default {
methods: {
onchange(v) {
this.$emit("change", this.switch1);
this.$emit("changewithprop", this.switch1,this.currentprop);
}
},
created() {
......
......@@ -76,6 +76,8 @@
:closelabel="ctl.closetext"
:truecolor="ctl.truecolor"
:falsecolor="ctl.falsecolor"
:propname="ctl.prop"
@changewithprop="controlCtl"
></Switchs>
</template>
<template v-if="ctl.type=='checkgroup'">
......@@ -216,6 +218,8 @@
:closelabel="ctl.closetext"
:truecolor="ctl.truecolor"
:falsecolor="ctl.falsecolor"
:propname="ctl.prop"
@changewithprop="controlCtl"
></Switchs>
</template>
<template v-if="ctl.type=='checkgroup'">
......@@ -331,9 +335,12 @@ export default {
},
computed: {},
methods: {
controlCtl(v, prop) {
this.$emit("controlctl",v,prop,this)
},
setHeight() {
let domel = this.$refs.formcard.$el;
let h = window.innerHeight - domel.offsetTop;
let h = window.innerHeight - domel.offsetTop - 3;
console.log("=======================", h);
$(domel).css("height", h + "px");
},
......@@ -399,17 +406,17 @@ export default {
return;
}
m.ctls.forEach(ctl => {
this.$set(this.ctlVisable, ctl.prop, true);
this.$set(this.ctlVisable, ctl.prop, ctl.isHide?false:true);
if (ctl.rules && ctl.rules.length >= 0) {
console.log(
"ctl.rules========================",
ctl.prop,
ctl.rules
);
// console.log(
// "ctl.rules========================",
// ctl.prop,
// ctl.rules
// );
ctl.rules.forEach(r => {
if (r.iscustom) {
console.log("validate................");
// console.log("validate................");
r.validator = this["validatex"];
}
});
......@@ -427,8 +434,8 @@ export default {
} else if (ctl.type == "number") {
this.$set(this.formModel, ctl.prop, 0);
} else {
console.log("=============");
console.log("=============", ctl.prop);
// console.log("=============");
// console.log("=============", ctl.prop);
this.$set(
this.formModel,
ctl.prop,
......
<template>
<div id="orgcard">
<div id="orgcard" style="height:100%">
<Card style="height:100%">
<Alert type="warning">
<template slot="desc">
当前节点:
{{currentData?currentData.title:"请选择操作节点"}}
</template>
</Alert>
<Tree v-if="!isupdate" :data="treedata" :render="renderContent" class="ptree"></Tree>
<Drawer
ref="eddrawer"
......@@ -11,7 +17,7 @@
width="70"
@on-visible-change="ondrawvisable"
>
<NodeForm ref="nodeform" :fminfo="nodeinfo">
<NodeForm ref="nodeform" :fminfo="nodeinfo" @controlctl="controlctl">
<template v-slot:default="slotProps">
<Button type="text" @click="doexec('ok',slotProps.fm)">保存</Button>
<Button type="text" @click="doexec('cancel',slotProps.fm)">取消</Button>
......@@ -25,6 +31,7 @@
import { getApp, saveAuths, findAuthsByRoles } from "@/api/meta";
import NodeForm from "./forms.vue";
import config from "@/config";
export default {
name: "jsoneditor",
props: {
......@@ -47,13 +54,72 @@ export default {
return {
isupdate: false,
currentData: null,
orgpath: "/root",
code: "root",
treedata: [],
treedataclone: [],
originalMetaInfo: [
{
title: "基本信息",
key: "baseinfo",
cols: 1,
ctls: [
{
type: "input",
label: "序号",
prop: "seq",
placeHolder: "请输入序号",
style: { width: "165px" },
rules: [{ required: true, message: " ", trigger: "blur" }]
},
{
type: "input",
label: "编码",
prop: "code",
placeHolder: "请输入编码",
style: "",
rules: [{ required: true, message: " ", trigger: "blur" }]
},
{
type: "input",
label: "标题",
prop: "title",
placeHolder: "请输入节点标题",
style: "",
rules: [{ required: true, message: " ", trigger: "blur" }],
default: "点击修改"
}
]
},
{
title: "节点路径",
key: "baseinfo",
cols: 2,
ctls: [
{
type: "input",
label: "KEY",
prop: "nodeKey",
placeHolder: "请输入编码",
disabled: true,
style: "",
rules: []
},
{
type: "input",
label: "路径",
prop: "orgpath",
placeHolder: "",
disabled: true,
style: "",
rules: []
}
]
}
],
originalRoot: {
title: "使用者定义",
code: "root",
expand: true,
orgpath: "/root",
render: (h, { root, node, data }) => {
return h(
"span",
......@@ -121,68 +187,35 @@ export default {
type: "default",
size: "small"
},
nodeinfo: {
name: "节点编辑",
main: [
{
title: "基本信息",
key: "baseinfo",
cols: 1,
ctls: [
{
type: "input",
label: "标题",
prop: "title",
placeHolder: "请输入节点标题",
style: "",
rules: [{ required: true, message: " ", trigger: "blur" }],
default: "点击修改"
},
{
type: "input",
label: "编码",
prop: "code",
placeHolder: "请输入编码",
style: "",
rules: [{ required: true, message: " ", trigger: "blur" }]
}
]
}
],
lists: null
}
nodeinfo: {},
treeheight: 0
};
},
mounted() {
this.initTree();
this.$nextTick(() => {
this.setHeight();
});
$(window).resize(() => {
this.setHeight();
});
},
created() {
if (this.metainfo) {
this.nodeinfo = Object.assign(this.nodeinfo, this.metainfo);
this.nodeinfo.main = this.nodeinfo.main.concat(this.originalMetaInfo);
}
window.modiTreeNodeByCode = function(treedata, newobj, parentitem) {
treedata.forEach(item => {
if (item.nodeKey == newobj.nodeKey) {
item = Object.assign(item, newobj);
return;
}
if (item.children) {
if (parentitem) {
item.orgpath = parentitem.orgpath + "/" + item.code;
} else {
item.orgpath = item.code;
}
item.children.sort((item1, item2) => {
return item1.seq < item2.seq;
});
modiTreeNodeByCode(item.children, newobj);
modiTreeNodeByCode(item.children, newobj,item);
} else {
if (parentitem) {
item.orgpath = parentitem.orgpath + "/" + item.code;
......@@ -194,26 +227,37 @@ export default {
};
},
methods: {
ondrawvisable() {},
setCtlVisable(prop, b) {
this.$refs.nodeform.setCtlVisable(prop, b);
},
controlctl(v, prop, fm) {
this.$emit("controlctl", v, prop, fm);
},
ondrawvisable(v) {
this.$emit("drawaction", v, this.$refs.nodeform);
},
resetForm() {
this.$refs.nodeform.resetForm();
this.$refs.nodeform.formModel.children = [];
},
refreshTree() {
this.isupdate = true;
this.$nextTick(() => {
this.isupdate = false;
});
},
doexec(k, fm) {
if (k == "ok") {
this.$refs.nodeform.validate(v => {
console.log(v);
if (v) {
this.isupdate = true;
let modiobj = this.$refs.nodeform.getNewModel();
modiTreeNodeByCode(this.treedata, modiobj,null);
modiTreeNodeByCode(this.treedata, modiobj, null);
this.showedform = false;
this.$emit("modisave", this.treedata, modiobj);
this.resetForm();
console.log(this.treedata);
this.$nextTick(() => {
this.isupdate = false;
});
//this.refreshTree()//使用者调用刷新
}
});
} else {
......@@ -247,6 +291,7 @@ export default {
this.originalRoot,
originalData[0]
);
console.log(originalData);
console.log(
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,",
this.originalRoot
......@@ -264,6 +309,7 @@ export default {
let el = $orgcard.get()[0];
let h = window.innerHeight - el.offsetTop - 30;
$orgcard.css("height", h + "px");
this.treeheight = h;
},
renderContent(h, { root, node, data }) {
return h(
......@@ -279,7 +325,12 @@ export default {
"span",
{
on: {
click: () => {
click: $event => {
$("span", ".ptree").removeClass("spansel");
$($event.target)
.parent()
.parent()
.addClass("spansel");
this.onselnode(node, data);
}
}
......@@ -358,6 +409,7 @@ export default {
.ptree span:hover {
background-color: lightgray;
}
.spansel {
background-color: lightgray;
}
......
<template>
<div>
<OrgEditor :initData="initData" :metainfo="metainfo"></OrgEditor>
<div id="orgdiv">
<SplitPanel>
<OrgEditor
slot="left"
ref="orgtree"
:initData="initData"
:metainfo="metainfo"
@controlctl="controlctl"
@drawaction="drawaction"
></OrgEditor>
<UserInfo ref="userinfo" slot="right"></UserInfo>
</SplitPanel>
</div>
</template>
<script>
import { getApp, saveAuths, findAuthsByRoles } from "@/api/meta";
import OrgEditor from "@/view/components/tables/forms/jsoneditor.vue";
import SplitPanel from "@/view/components/split-pane2/split-pane2.vue";
import UserInfo from "./userinfo_page.vue";
import config from "@/config";
export default {
name: "treeinfo_page",
props: {},
components: {
OrgEditor
OrgEditor,
SplitPanel,
UserInfo
},
data() {
return {
......@@ -19,74 +33,41 @@ export default {
name: "节点编辑",
main: [
{
title: "基本信息",
key: "baseinfo",
cols: 1,
ctls: [
{
type: "input",
label: "序号",
prop: "seq",
placeHolder: "请输入序号",
style: { width: "165px" },
rules: [{ required: true, message: " ", trigger: "blur" }]
},
{
type: "input",
label: "编码",
prop: "code",
placeHolder: "请输入编码",
style: "",
rules: [{ required: true, message: " ", trigger: "blur" }]
},
{
type: "input",
label: "标题",
prop: "title",
placeHolder: "请输入节点标题",
style: "",
rules: [{ required: true, message: " ", trigger: "blur" }],
default: "点击修改"
}
]
},
{
title: "节点路径",
title: "授权信息",
key: "baseinfo",
cols: 2,
ctls: [
{
type: "input",
label: "KEY",
prop: "nodeKey",
placeHolder: "请输入编码",
disabled: true,
style: "",
rules: []
type: "switch",
label: "是否岗位",
prop: "isPosition",
opentext: "是",
closetext: "否",
trurcolor: "",
falsecolor: "",
placeHolder: "",
style: ""
},
{
type: "input",
label: "路径",
prop: "orgpath",
type: "switch",
label: "是否负责人",
prop: "isMain",
opentext: "是",
closetext: "否",
trurcolor: "",
falsecolor: "",
placeHolder: "",
disabled: true,
style: "",
rules: []
}
]
},
{
title: "授权信息",
key: "baseinfo",
cols: 2,
ctls: [
isHide: true
},
{
type: "input",
label: "兼职",
label: "监控",
prop: "orgtag",
placeHolder: "输入兼职的部门编码,逗号分隔",
placeHolder: "输入监控的部门编码(非岗位),逗号分隔",
style: "",
rules: []
rules: [],
isHide: true
},
{
type: "model-select",
......@@ -96,7 +77,8 @@ export default {
prop: "roles",
labelField: "name",
valueField: "id",
style: { "margin-left": "10px", width: "165px" }
style: { "margin-left": "10px", width: "165px" },
isHide: true
}
]
}
......@@ -105,14 +87,53 @@ export default {
}
};
},
mounted() {},
mounted() {
this.$nextTick(() => {
this.setHeight();
});
$(window).resize(() => {
this.$nextTick(() => {
this.setHeight();
});
});
},
methods: {
setHeight() {
let $orgdiv = $("#orgdiv");
let el = $orgdiv.get()[0];
let h = window.innerHeight - el.offsetTop;
$orgdiv.css("height", h + "px");
this.$refs.userinfo.setHeight(h-120)
},
drawaction(v, fm) {
if (fm.formModel.isPosition) {
fm.setCtlVisable("isMain", true);
fm.setCtlVisable("orgtag", true);
fm.setCtlVisable("roles", true);
} else {
fm.setCtlVisable("isMain", false);
fm.setCtlVisable("orgtag", false);
fm.setCtlVisable("roles", false);
}
},
controlctl(v, prop, fm) {
if (prop == "isPosition") {
if (v) {
fm.setCtlVisable("isMain", true);
fm.setCtlVisable("orgtag", true);
fm.setCtlVisable("roles", true);
} else {
fm.setCtlVisable("isMain", false);
fm.setCtlVisable("orgtag", false);
fm.setCtlVisable("roles", false);
}
}
},
initData(cbk) {
cbk([
{
title: "目录",
code: "root",
orgpath:"/root",
expand: true,
roles: []
}
......
......@@ -22,6 +22,9 @@ export default {
BizTable
},
methods: {
setHeight(h){
this.$refs.bt.setHeight(h)
},
onnew() {
this.$refs.bt.setFormCtlVisable("userName", 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