Commit 7bcde15b authored by renjintao's avatar renjintao

plan

parent 6df819dd
<template>
<transition name="contextmenu-submenu-fade" v-if="show">
<transition name="contextmenu-submenu-fade">
<div ref="menu" :class="[commonClass.menu, 'menu', customClass]" :style="{left: style.left + 'px', top: style.top + 'px', minWidth: style.minWidth + 'px', zIndex: style.zIndex}" v-if="visible" @contextmenu="(e)=>e.preventDefault()">
<div class="menu_body">
<template v-for="(item,index) of items">
......@@ -54,6 +54,9 @@ import {
SUBMENU_OPEN_TREND_RIGHT,
COMPONENT_NAME
} from "../constant";
import {
getElementsByClassName
} from "../util";
export default {
name: "Submenu",
data() {
......@@ -78,13 +81,15 @@ export default {
style: {
left: 0,
top: 0,
zIndex: 2,
zIndex: 3,
minWidth: 150
},
customClass: null,
visible: false,
hasIcon: false,
openTrend: SUBMENU_OPEN_TREND_RIGHT
openTrend: SUBMENU_OPEN_TREND_RIGHT,
mouseListening: false,
mainMenuInstance: null,
};
},
props: {
......@@ -104,8 +109,12 @@ export default {
mounted() {
if (this.data != []) {
this.load(this.data)
this.addListener();
}
},
destroyed() {
this.removeListener();
},
methods: {
load(v) {
this.visible = true;
......@@ -194,13 +203,14 @@ export default {
};
this.activeSubmenu.instance.style.minWidth =
typeof item.minWidth === "number" ? item.minWidth : this.style.minWidth;
this.activeSubmenu.instance.style.zIndex = this.style.zIndex;
this.activeSubmenu.instance.style.zIndex = '9999';
this.activeSubmenu.instance.customClass =
typeof item.customClass === "string" ?
item.customClass :
this.customClass;
this.activeSubmenu.instance.$mount();
document.body.appendChild(this.activeSubmenu.instance.$el);
},
itemClick(item) {
if (!this.visible) {
......@@ -220,9 +230,34 @@ export default {
if (this.activeSubmenu.instance) {
this.activeSubmenu.instance.close();
}
this.$nextTick(() => {
this.$destroy();
});
this.$nextTick(() => {});
},
showBm() {
this.visible = true;
},
leaveBm() {
this.visible = false;
},
mouseClickListener(e) { //左键点击
this.close();
},
addListener() {
if (!this.mouseListening) {
document.addEventListener("click", this.mouseClickListener);
//document.addEventListener("mousedown", this.mouseDownListener);
//document.addEventListener("mousewheel", this.mousewheelListener);
this.mouseListening = true;
}
},
removeListener() {
if (this.mouseListening) {
document.removeEventListener("click", this.mouseClickListener);
//document.removeEventListener("mousedown", this.mouseDownListener);
//document.removeEventListener("mousewheel", this.mousewheelListener);
this.mouseListening = false;
}
}
},
watch: {
......@@ -232,6 +267,9 @@ export default {
this.load(this.data)
}
},
show(v) {
this.visible = v
}
},
};
</script>
......
......@@ -1824,6 +1824,7 @@ export default {
type: '类型',
attachment: '附件',
executor: '执行人',
upTitle:'上级名称'
},
project_main: {
creationTime: '创建时间',
......
......@@ -133,6 +133,10 @@ henq.toTree = (list, rootId, format, parentFiledName) => {
function toTree(data, parentId, level) {
let parents = data.filter(u => {
if(u[upId]=='')
{
u[upId]=null
}
return u[upId] == parentId
})
......
......@@ -4938,7 +4938,7 @@
"dependencies": {
"commander": {
"version": "2.14.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.14.1.tgz",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.14.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.14.1.tgz",
"integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
}
}
......@@ -5472,7 +5472,7 @@
},
"crc-32": {
"version": "1.2.0",
"resolved": "http://r.cnpmjs.org/crc-32/download/crc-32-1.2.0.tgz",
"resolved": "https://registry.npm.taobao.org/crc-32/download/crc-32-1.2.0.tgz",
"integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
"requires": {
"exit-on-epipe": "~1.0.1",
......@@ -7369,7 +7369,7 @@
},
"exit-on-epipe": {
"version": "1.0.1",
"resolved": "http://r.cnpmjs.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"resolved": "https://registry.npm.taobao.org/exit-on-epipe/download/exit-on-epipe-1.0.1.tgz",
"integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
},
"expand-brackets": {
......@@ -8020,7 +8020,7 @@
},
"frac": {
"version": "1.1.2",
"resolved": "http://r.cnpmjs.org/frac/download/frac-1.1.2.tgz",
"resolved": "https://registry.npm.taobao.org/frac/download/frac-1.1.2.tgz",
"integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
},
"fragment-cache": {
......@@ -15092,7 +15092,7 @@
},
"printj": {
"version": "1.1.2",
"resolved": "http://r.cnpmjs.org/printj/download/printj-1.1.2.tgz",
"resolved": "https://registry.npm.taobao.org/printj/download/printj-1.1.2.tgz",
"integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
},
"private": {
......@@ -20545,7 +20545,7 @@
},
"script-loader": {
"version": "0.7.2",
"resolved": "http://r.cnpmjs.org/script-loader/download/script-loader-0.7.2.tgz",
"resolved": "https://registry.npm.taobao.org/script-loader/download/script-loader-0.7.2.tgz",
"integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=",
"dev": true,
"requires": {
......@@ -21133,7 +21133,7 @@
},
"ssf": {
"version": "0.10.3",
"resolved": "http://r.cnpmjs.org/ssf/download/ssf-0.10.3.tgz",
"resolved": "https://registry.npm.taobao.org/ssf/download/ssf-0.10.3.tgz",
"integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=",
"requires": {
"frac": "~1.1.2"
......@@ -23788,7 +23788,7 @@
},
"wmf": {
"version": "1.0.2",
"resolved": "http://r.cnpmjs.org/wmf/download/wmf-1.0.2.tgz",
"resolved": "https://registry.npm.taobao.org/wmf/download/wmf-1.0.2.tgz",
"integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
},
"word-wrap": {
......@@ -23943,7 +23943,7 @@
},
"xlsx": {
"version": "0.15.6",
"resolved": "http://r.cnpmjs.org/xlsx/download/xlsx-0.15.6.tgz",
"resolved": "https://registry.npm.taobao.org/xlsx/download/xlsx-0.15.6.tgz?cache=0&sync_timestamp=1597272342311&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxlsx%2Fdownload%2Fxlsx-0.15.6.tgz",
"integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=",
"requires": {
"adler-32": "~1.2.0",
......@@ -23958,7 +23958,7 @@
"dependencies": {
"commander": {
"version": "2.17.1",
"resolved": "http://r.cnpmjs.org/commander/download/commander-2.17.1.tgz",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.17.1.tgz?cache=0&sync_timestamp=1595168224685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.17.1.tgz",
"integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
}
}
......
......@@ -15,7 +15,8 @@
</template> -->
<template slot="buttons">
<Button type="primary" @click="add(null)">新增</Button>
<Dropdown @on-click="show">
<Button @mouseenter.native="showBm" ref="showBtn" shape="circle" icon="md-settings"></Button>
<Dropdown @on-click="show" v-if="false">
<Button shape="circle" icon="md-settings"></Button>
<DropdownMenu slot="list">
<DropdownItem name="saveTemplate">存为模版</DropdownItem>
......@@ -31,6 +32,7 @@
</template>
</EditGrid>
</Card>
<Submenus :show="showStatu" :data="tempItems" :params="params"></Submenus>
<Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" />
</Modal>
......@@ -93,6 +95,12 @@ export default {
type: "selection",
align: 'center'
},
{
key: "upTitle",
title: this.l("upTitle"),
hide: true,
export: true,
},
{
key: "title",
title: this.l("title"),
......@@ -238,6 +246,10 @@ export default {
},
},
],
//setButon
showStatu: false, //控件是否显示
tempItems: [], //控件数据
params: {}, //控件坐标位置
//导出导入
exportTl: '项目目录',
ModalIm: false,
......@@ -391,6 +403,66 @@ export default {
m[name] && m[name](name);
},
saveTemplate() {
var that = this;
that.curId = that.eid;
that.row = that.data;
that.title = "保存模版";
that.detail = () => import("./saveTemplate");
that.modal = true;
},
useTemplate() {
var that = this;
that.curId = that.eid;
that.row = that.data;
that.title = "导入模版";
that.detail = () => import("./importTemplate");
that.modal = true;
},
down() {
this.exportTl = '项目目录-' + this.data.title;
this.$refs.grid.export2Excel()
},
importExcel() {
this.openModalIm()
},
showBm(event) {
let obj = event.target
let objSet = obj.getBoundingClientRect()
this.showStatu = true;
this.params = {
x: objSet.x,
y: objSet.bottom
};
console.log(event)
this.tempItems = [{
label: "存为模版",
onClick: () => {
this.saveTemplate()
},
}, {
label: "导入模版",
divided: true,
onClick: () => {
this.useTemplate()
},
},
{
label: "导出Excel",
icon: "md-cloud-download",
onClick: () => {
this.down()
},
},
{
label: "导入Excel",
icon: "md-cloud-upload",
onClick: () => {
this.importExcel()
},
}
];
},
//批量导入start
//导入功能
openModalIm() {
......
......@@ -9,6 +9,14 @@
<h2>Bmenu</h2>
<div @contextmenu="onCon" class="tc" style="width:120px;height:40px;line-height:40px;background:#f5f5f5;border:#ccc solid 1px; border-radius: 5px;">{{message}}</div>
</div>
<div class="mt50 pl10">
<h2>mouseenter</h2>
<p>
<Button @mouseenter.native="showBm" ref="showBtn" shape="circle" icon="ios-settings"></Button>
<div @mouseover="showBm" v-if="false" ref="showB" class="tc" style="width:120px;height:40px;line-height:40px;background:#f5f5f5;border:#ccc solid 1px; border-radius: 5px;">mouseenter打开菜单</div>
</p>
</div>
</div>
</template>
......@@ -43,13 +51,13 @@ export default {
this.tempItems = [{
label: "返回(B)",
onClick: () => {
this.showStatu = false;
alert("tttt")
},
}, {
label: "前进(F)",
disabled: true,
onClick: () => {
this.showStatu = false;
alert("11")
},
},
{
......@@ -57,13 +65,13 @@ export default {
divided: true,
icon: "el-icon-refresh",
onClick: () => {
this.showStatu = false;
alert("222")
},
},
{
label: "另存为(A)...",
onClick: () => {
this.showStatu = false;
alert("333")
},
},
{
......@@ -223,6 +231,79 @@ export default {
});
event.preventDefault();
},
showBm(event) {
let obj = event.target
let objSet = obj.getBoundingClientRect()
this.showStatu = true;
this.params = {
x: objSet.x,
y: objSet.bottom
};
console.log(event)
this.tempItems = [{
label: "返回(B)",
onClick: () => {
alert("11")
},
}, {
label: "前进(F)",
disabled: true,
onClick: () => {
alert("222")
},
},
{
label: "重新加载(R)",
divided: true,
icon: "el-icon-refresh",
onClick: () => {
alert("33")
},
},
{
label: "另存为(A)...",
onClick: () => {
alert("44")
},
},
{
label: "打印(P)...",
icon: "el-icon-printer",
onClick: () => {
alert("55")
},
},
{
label: "投射(C)...",
divided: true,
onClick: () => {
alert("66")
},
},
{
label: "使用网页翻译(T)",
divided: true,
minWidth: 0,
children: [{
label: "翻译成简体中文",
onClick: () => {
alert("77")
},
},
{
label: "翻译成繁体中文",
onClick: () => {
alert("88")
},
},
],
},
];
event.preventDefault();
},
leaveBm(event) {
this.showStatu = false;
}
},
};
</script>
......
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