Commit 64d8735e authored by 周远喜's avatar 周远喜

Merge branch 'master' of http://git.mes123.com/zhouyx/mes-ui

parents 973dbeae d97107be
<template> <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 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"> <div class="menu_body">
<template v-for="(item,index) of items"> <template v-for="(item,index) of items">
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
item.divided?'menu_item__divided':null item.divided?'menu_item__divided':null
]" :key="index" v-if="item.disabled"> ]" :key="index" v-if="item.disabled">
<div class="menu_item_icon" v-if="hasIcon"> <div class="menu_item_icon" v-if="hasIcon">
<i :class="item.icon" v-if="item.icon"></i> <Icon v-if="item.icon" :type="item.icon" />
</div> </div>
<span class="menu_item_label">{{item.label}}</span> <span class="menu_item_label">{{item.label}}</span>
<div class="menu_item_expand_icon"></div> <div class="menu_item_expand_icon"></div>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
item.divided?'menu_item__divided':null item.divided?'menu_item__divided':null
]" :key="index" @mouseenter="($event)=>enterItem($event,item,index)" v-else-if="item.children"> ]" :key="index" @mouseenter="($event)=>enterItem($event,item,index)" v-else-if="item.children">
<div class="menu_item_icon" v-if="hasIcon"> <div class="menu_item_icon" v-if="hasIcon">
<i :class="item.icon" v-if="item.icon"></i> <Icon v-if="item.icon" :type="item.icon" />
</div> </div>
<span class="menu_item_label">{{item.label}}</span> <span class="menu_item_label">{{item.label}}</span>
<div class="menu_item_expand_icon"></div> <div class="menu_item_expand_icon"></div>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
item.divided?'menu_item__divided':null item.divided?'menu_item__divided':null
]" :key="index" @mouseenter="($event)=>enterItem($event,item,index)" @click="itemClick(item)" v-else> ]" :key="index" @mouseenter="($event)=>enterItem($event,item,index)" @click="itemClick(item)" v-else>
<div class="menu_item_icon" v-if="hasIcon"> <div class="menu_item_icon" v-if="hasIcon">
<i :class="item.icon" v-if="item.icon"></i> <Icon v-if="item.icon" :type="item.icon" />
</div> </div>
<span class="menu_item_label">{{item.label}}</span> <span class="menu_item_label">{{item.label}}</span>
<div class="menu_item_expand_icon"></div> <div class="menu_item_expand_icon"></div>
...@@ -54,6 +54,9 @@ import { ...@@ -54,6 +54,9 @@ import {
SUBMENU_OPEN_TREND_RIGHT, SUBMENU_OPEN_TREND_RIGHT,
COMPONENT_NAME COMPONENT_NAME
} from "../constant"; } from "../constant";
import {
getElementsByClassName
} from "../util";
export default { export default {
name: "Submenu", name: "Submenu",
data() { data() {
...@@ -78,13 +81,15 @@ export default { ...@@ -78,13 +81,15 @@ export default {
style: { style: {
left: 0, left: 0,
top: 0, top: 0,
zIndex: 2, zIndex: 3,
minWidth: 150 minWidth: 150
}, },
customClass: null, customClass: null,
visible: false, visible: false,
hasIcon: false, hasIcon: false,
openTrend: SUBMENU_OPEN_TREND_RIGHT openTrend: SUBMENU_OPEN_TREND_RIGHT,
mouseListening: false,
mainMenuInstance: null,
}; };
}, },
props: { props: {
...@@ -104,8 +109,12 @@ export default { ...@@ -104,8 +109,12 @@ export default {
mounted() { mounted() {
if (this.data != []) { if (this.data != []) {
this.load(this.data) this.load(this.data)
this.addListener();
} }
}, },
destroyed() {
this.removeListener();
},
methods: { methods: {
load(v) { load(v) {
this.visible = true; this.visible = true;
...@@ -194,13 +203,14 @@ export default { ...@@ -194,13 +203,14 @@ export default {
}; };
this.activeSubmenu.instance.style.minWidth = this.activeSubmenu.instance.style.minWidth =
typeof item.minWidth === "number" ? item.minWidth : this.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 = this.activeSubmenu.instance.customClass =
typeof item.customClass === "string" ? typeof item.customClass === "string" ?
item.customClass : item.customClass :
this.customClass; this.customClass;
this.activeSubmenu.instance.$mount(); this.activeSubmenu.instance.$mount();
document.body.appendChild(this.activeSubmenu.instance.$el); document.body.appendChild(this.activeSubmenu.instance.$el);
}, },
itemClick(item) { itemClick(item) {
if (!this.visible) { if (!this.visible) {
...@@ -220,9 +230,34 @@ export default { ...@@ -220,9 +230,34 @@ export default {
if (this.activeSubmenu.instance) { if (this.activeSubmenu.instance) {
this.activeSubmenu.instance.close(); this.activeSubmenu.instance.close();
} }
this.$nextTick(() => { this.$nextTick(() => {});
this.$destroy(); },
}); 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: { watch: {
...@@ -232,6 +267,9 @@ export default { ...@@ -232,6 +267,9 @@ export default {
this.load(this.data) this.load(this.data)
} }
}, },
show(v) {
this.visible = v
}
}, },
}; };
</script> </script>
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
<script> <script>
import XLSX from "xlsx"; import XLSX from "xlsx";
import Api from '@/plugins/request'
import { import {
Switch Switch
} from "view-design"; } from "view-design";
...@@ -82,6 +83,7 @@ export default { ...@@ -82,6 +83,7 @@ export default {
formatList: ["xlsx"], formatList: ["xlsx"],
columnsImport: [], columnsImport: [],
departArr: [], //部门list departArr: [], //部门list
usersArr: [],
sheetNames: [], //excel的表明 sheetNames: [], //excel的表明
workBook: {}, workBook: {},
openDatas: [], openDatas: [],
...@@ -129,9 +131,21 @@ export default { ...@@ -129,9 +131,21 @@ export default {
this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => { this.$api.get(`${systemUrl}/Department/GetDepartments`).then((r) => {
this.departArr = r.result.items; this.departArr = r.result.items;
}); });
this.$api.get(`${systemUrl}/user/getuserlist`)
.then((r) => {
if (r.success) {
this.usersArr = r.result
}
})
//导出对列表头进行预加载end //导出对列表头进行预加载end
}, },
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
await store.dispatch("loadUsers"); // 加载数据字典
},
mounted() { mounted() {
//if (this.eid > 0) { //if (this.eid > 0) {
// this.load(this.eid); // this.load(this.eid);
...@@ -144,6 +158,7 @@ export default { ...@@ -144,6 +158,7 @@ export default {
this.tdHeightExcel = window.screenHeight - 180; this.tdHeightExcel = window.screenHeight - 180;
})(); })();
}; };
}, },
methods: { methods: {
//重新处理colum //重新处理colum
...@@ -198,6 +213,8 @@ export default { ...@@ -198,6 +213,8 @@ export default {
temData = this.$u.clone(this.$refs.comExcel.excelData); temData = this.$u.clone(this.$refs.comExcel.excelData);
} }
let arrTitleUse = []; ////使用数据字典的字段 let arrTitleUse = []; ////使用数据字典的字段
let arrUseName = []; ////使用单个用户字段
let arrUseNames = []; ////使用多用户字段
temColPage.forEach((elCode) => { temColPage.forEach((elCode) => {
if (elCode.code) { if (elCode.code) {
arrTitleUse.push({ arrTitleUse.push({
...@@ -205,6 +222,18 @@ export default { ...@@ -205,6 +222,18 @@ export default {
code: elCode.code, code: elCode.code,
}); });
} }
if (elCode.type == "user") {
arrUseName.push({
key: elCode.key,
code: elCode.type,
});
}
if (elCode.type == "users") {
arrUseNames.push({
key: elCode.key,
code: elCode.type,
});
}
}); });
let useData = []; //重新组织list列表数据 let useData = []; //重新组织list列表数据
temData.forEach((elData, index) => { temData.forEach((elData, index) => {
...@@ -215,7 +244,7 @@ export default { ...@@ -215,7 +244,7 @@ export default {
useData.push(objTm); useData.push(objTm);
}); });
//对列表里的部门及数据字典项进行处理 //对列表里的部门及数据字典项、用户等进行处理
useData.forEach((eles) => { useData.forEach((eles) => {
//如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id //如果导入文件没有departmentid,但存在departmentTitle的话,通过title获取id
if ( if (
...@@ -247,7 +276,32 @@ export default { ...@@ -247,7 +276,32 @@ export default {
} }
}); });
} }
//人员名称转换为userid,如果查不到此人员,则为空
arrUseName.forEach((euser) => {
if (eles[euser.key] && eles[euser.key] != "" && eles[euser.key] != null) {
this.usersArr.forEach(eluser => {
if (eles[euser.key] == eluser.name) {
eles[euser.key] = eluser.id
}
})
}
});
//多个名称转换为数组
arrUseNames.forEach((eusers) => {
if (eles[eusers.key] && eles[eusers.key] != "" && eles[eusers.key] != null) {
let arruserstemp = this.$u.clone(eles[eusers.key].split(',') || eles[eusers.key].split(','))
let tempUserIds = []
arruserstemp.forEach(eltempUsers => {
this.usersArr.forEach(elusers => {
if (eltempUsers == elusers.name) {
tempUserIds.push(elusers.id)
}
})
})
eles[eusers.key] = tempUserIds
}
});
arrTitleUse.forEach((elem) => { arrTitleUse.forEach((elem) => {
if ( if (
eles[elem.key] && eles[elem.key] &&
...@@ -436,6 +490,7 @@ export default { ...@@ -436,6 +490,7 @@ export default {
this.dataIm = formatList; this.dataIm = formatList;
this.batchImportUrl = url; this.batchImportUrl = url;
}, },
l(key) { l(key) {
key = "user" + "." + key; key = "user" + "." + key;
return this.$t(key); return this.$t(key);
......
...@@ -1824,6 +1824,8 @@ export default { ...@@ -1824,6 +1824,8 @@ export default {
type: '类型', type: '类型',
attachment: '附件', attachment: '附件',
executor: '执行人', executor: '执行人',
upTitle:'上级名称',
deliverable:"交付物",
}, },
project_main: { project_main: {
creationTime: '创建时间', creationTime: '创建时间',
...@@ -2020,6 +2022,7 @@ export default { ...@@ -2020,6 +2022,7 @@ export default {
deliverable: "交付物", deliverable: "交付物",
upId: '父级', upId: '父级',
title: '标题', title: '标题',
upTitle:'上级名称',
status: '状态', status: '状态',
note: '描述', note: '描述',
startDate: '开始日期', startDate: '开始日期',
......
...@@ -133,6 +133,10 @@ henq.toTree = (list, rootId, format, parentFiledName) => { ...@@ -133,6 +133,10 @@ henq.toTree = (list, rootId, format, parentFiledName) => {
function toTree(data, parentId, level) { function toTree(data, parentId, level) {
let parents = data.filter(u => { let parents = data.filter(u => {
if(u[upId]=='')
{
u[upId]=null
}
return u[upId] == parentId return u[upId] == parentId
}) })
......
...@@ -4938,7 +4938,7 @@ ...@@ -4938,7 +4938,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.14.1", "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=" "integrity": "sha1-IjUSPjevjKPGXfRbAm29NXsBuao="
} }
} }
...@@ -5472,7 +5472,7 @@ ...@@ -5472,7 +5472,7 @@
}, },
"crc-32": { "crc-32": {
"version": "1.2.0", "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=", "integrity": "sha1-yy224puIUI4y2d0OwWk+e0Ghggg=",
"requires": { "requires": {
"exit-on-epipe": "~1.0.1", "exit-on-epipe": "~1.0.1",
...@@ -7369,7 +7369,7 @@ ...@@ -7369,7 +7369,7 @@
}, },
"exit-on-epipe": { "exit-on-epipe": {
"version": "1.0.1", "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=" "integrity": "sha1-C92S6H1ShdJn2qgXHQ6wYVlolpI="
}, },
"expand-brackets": { "expand-brackets": {
...@@ -8020,7 +8020,7 @@ ...@@ -8020,7 +8020,7 @@
}, },
"frac": { "frac": {
"version": "1.1.2", "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=" "integrity": "sha1-PXT39keMiKG1AgMG10fcYxPHTQs="
}, },
"fragment-cache": { "fragment-cache": {
...@@ -15092,7 +15092,7 @@ ...@@ -15092,7 +15092,7 @@
}, },
"printj": { "printj": {
"version": "1.1.2", "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=" "integrity": "sha1-2Q3rKXWoufYA+zoclOP0xTx4oiI="
}, },
"private": { "private": {
...@@ -20545,7 +20545,7 @@ ...@@ -20545,7 +20545,7 @@
}, },
"script-loader": { "script-loader": {
"version": "0.7.2", "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=", "integrity": "sha1-IBbbb4byX1z1baOJFdgzeLsWa6c=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -21133,7 +21133,7 @@ ...@@ -21133,7 +21133,7 @@
}, },
"ssf": { "ssf": {
"version": "0.10.3", "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=", "integrity": "sha1-jq4fwpyQpVLnkhII+BiS1vd6yys=",
"requires": { "requires": {
"frac": "~1.1.2" "frac": "~1.1.2"
...@@ -23788,7 +23788,7 @@ ...@@ -23788,7 +23788,7 @@
}, },
"wmf": { "wmf": {
"version": "1.0.2", "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=" "integrity": "sha1-fRnWIQcaCMK9xrfmiKnENSmMwto="
}, },
"word-wrap": { "word-wrap": {
...@@ -23943,7 +23943,7 @@ ...@@ -23943,7 +23943,7 @@
}, },
"xlsx": { "xlsx": {
"version": "0.15.6", "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=", "integrity": "sha1-Rh+EHW2eoag3XizSRr8jrs4IodU=",
"requires": { "requires": {
"adler-32": "~1.2.0", "adler-32": "~1.2.0",
...@@ -23958,7 +23958,7 @@ ...@@ -23958,7 +23958,7 @@
"dependencies": { "dependencies": {
"commander": { "commander": {
"version": "2.17.1", "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=" "integrity": "sha1-vXerfebelCBc6sxy8XFtKfIKd78="
} }
} }
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
</template> --> </template> -->
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="add(null)">新增</Button> <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> <Button shape="circle" icon="md-settings"></Button>
<DropdownMenu slot="list"> <DropdownMenu slot="list">
<DropdownItem name="saveTemplate">存为模版</DropdownItem> <DropdownItem name="saveTemplate">存为模版</DropdownItem>
...@@ -31,9 +32,11 @@ ...@@ -31,9 +32,11 @@
</template> </template>
</EditGrid> </EditGrid>
</Card> </Card>
<Submenus :show="showStatu" :data="tempItems" :params="params"></Submenus>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" /> <component :is="detail" :eid="curId" :v="row" @on-close="cancel" @on-ok="ok" />
</Modal> </Modal>
<ImportExcel ref="importExcel" @on-get-data="getData" :modalTitle="temTitle" :columns="columns" :open="ModalIm" @on-cancel="ModalImCancel" @on-ok="ok" />
</div> </div>
</template> </template>
...@@ -77,7 +80,6 @@ export default { ...@@ -77,7 +80,6 @@ export default {
}, },
modal: false, modal: false,
title: "新增", title: "新增",
exportTl: '项目目录',
detail: null, detail: null,
curId: null, curId: null,
list: [], list: [],
...@@ -93,6 +95,12 @@ export default { ...@@ -93,6 +95,12 @@ export default {
type: "selection", type: "selection",
align: 'center' align: 'center'
}, },
{
key: "upTitle",
title: this.l("upTitle"),
hide: true,
export: true,
},
{ {
key: "title", key: "title",
title: this.l("title"), title: this.l("title"),
...@@ -238,6 +246,14 @@ export default { ...@@ -238,6 +246,14 @@ export default {
}, },
}, },
], ],
//setButon
showStatu: false, //控件是否显示
tempItems: [], //控件数据
params: {}, //控件坐标位置
//导出导入
exportTl: '项目目录',
ModalIm: false,
temTitle: "项目目录",
}; };
}, },
mounted() { mounted() {
...@@ -376,13 +392,118 @@ export default { ...@@ -376,13 +392,118 @@ export default {
that.modal = true; that.modal = true;
}, },
} }
//导出excel
if (name == 'down') { if (name == 'down') {
this.exportTl = '项目目录-' + this.data.title; this.exportTl = '项目目录-' + this.data.title;
this.$refs.grid.export2Excel() this.$refs.grid.export2Excel()
} }
if (name == 'importExcel') {
this.openModalIm()
}
m[name] && m[name](name); 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() {
this.ModalIm = true
},
ModalImCancel() {
this.ModalIm = false
},
getData(val) {
let url = `${material}/projectplan/importplans`;
this.$refs.importExcel.deelData(url, this.columns, this.formatMethod(val))
},
//根据页面二次处理数据
formatMethod(val) {
let tempData = this.$u.clone(val);
let tempList = [];
tempData.forEach((ele) => {
let obj = {
projectId: this.eid,
upTitle: ele.upTitle ? ele.upTitle : null,
title: ele.title ? ele.title : '',
status: 0,
type: ele.type ? ele.type : 0, //?
startDate: ele.startDate ? ele.startDate : "", //?
endDate: ele.endDate ? ele.endDate : "", //?
direction: ele.direction ? ele.direction : 0,
executor: ele.executor ? ele.executor : [], //?
deliverable: ele.deliverable ? ele.deliverable : 0
};
if (ele.title && ele.title != '') {
obj.ico = false
} else {
obj.ico = true
}
tempList.push(obj);
});
return tempList
},
//批量导入end
l(key) { l(key) {
let vkey = "project_plan" + "." + key; let vkey = "project_plan" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
......
...@@ -9,6 +9,14 @@ ...@@ -9,6 +9,14 @@
<h2>Bmenu</h2> <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 @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>
<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> </div>
</template> </template>
...@@ -43,13 +51,13 @@ export default { ...@@ -43,13 +51,13 @@ export default {
this.tempItems = [{ this.tempItems = [{
label: "返回(B)", label: "返回(B)",
onClick: () => { onClick: () => {
this.showStatu = false; alert("tttt")
}, },
}, { }, {
label: "前进(F)", label: "前进(F)",
disabled: true, disabled: true,
onClick: () => { onClick: () => {
this.showStatu = false; alert("11")
}, },
}, },
{ {
...@@ -57,13 +65,13 @@ export default { ...@@ -57,13 +65,13 @@ export default {
divided: true, divided: true,
icon: "el-icon-refresh", icon: "el-icon-refresh",
onClick: () => { onClick: () => {
this.showStatu = false; alert("222")
}, },
}, },
{ {
label: "另存为(A)...", label: "另存为(A)...",
onClick: () => { onClick: () => {
this.showStatu = false; alert("333")
}, },
}, },
{ {
...@@ -223,6 +231,79 @@ export default { ...@@ -223,6 +231,79 @@ export default {
}); });
event.preventDefault(); 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> </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