Commit f78e64d3 authored by tianhongyang's avatar tianhongyang

表头设置重复点击文字关闭浮层,项目详情菜单 bug fix

parent 136743d3
<template>
<div class="dsk-table-header-setting" @click="showHeaderSetting">
<div class="dsk-table-header-setting">
<div class="event-target-container" @click="showHeaderSetting">
<svg-icons :icon-class="'table-header-setting-icon'" :class-name="'table-header-setting-icon'"></svg-icons>
<div class="table-header-setting-text">表头设置</div>
</div>
<transition appear name="head" mode="out-in">
<setting-bar v-if="showHeaderSettingStatus" :settingList="settingList" @settingChange="settingChange"
@settingClose="showHeaderSettingStatus = false"></setting-bar>
......@@ -39,6 +41,10 @@ export default {
//方法集
methods: {
showHeaderSetting() {
if (this.showHeaderSettingStatus) {
this.showHeaderSettingStatus = false;
return;
};
this.showHeaderSettingStatus = true;
},
settingChange(use) {
......@@ -62,6 +68,11 @@ export default {
}
}
.event-target-container {
display: flex;
align-items: center;
}
.table-header-setting-icon {
cursor: pointer;
}
......
......@@ -2,7 +2,8 @@
<div class="feed-summary-container">
<div class="feed-summary-inner">
<div class="left-side-menu">
<project-side-menu :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive">
<project-side-menu :menuTree="menuTreeList" :menuOptions="menuOptions" :unique-opened="false" :default-active="defaultActive"
@select="menuSelect">
<template slot="房建类成本科目-1">
<img src="@/assets/images/projectCostLedger/icon_cost_detail_2.svg" alt="">
<div class="project-sub-menu-title-text">房建类成本科目</div>
......@@ -13,12 +14,31 @@
</template>
</project-side-menu>
</div>
<div class="right-table-list-container">
<div class="project-table-list-header">
<div class="project-table-list-haeder-left">
<el-date-picker v-model="recordDate" type="month" placeholder="选择月" format="yyyy年MM月" value-format="yyyy-MM"
class="project-record-date" @change="timeChange"></el-date-picker>
</div>
<div class="project-table-list-haeder-right">
<!-- 实体工程材料单位换算 -->
<el-button type="primary" size="medium" class="unit-conversion-btn" v-if="currentParentName.indexOf('实体工程材料') != -1">单位换算</el-button>
<!-- 填写实际成本 -->
<el-button type="primary" size="medium" class="actual-cost-btn" v-else>填写实际成本</el-button>
<!-- 表头设置组件 -->
<dsk-table-header-setting :settingList="formColum" @settingChange="settingChange"></dsk-table-header-setting>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import ProjectSideMenu from "@/views/projectCostLedger/detail/components/ProjectSideMenu";
import { getFeedSummaryMenuTreeApi } from "@/api/projectCostLedger";
import { getFeedSummaryMenuTreeApi, getFeedSummaryListApi } from "@/api/projectCostLedger";
import DskTableHeaderSetting from "@/components/DskTableHeaderSetting";
import TableListCom from "@/components/TableListCom";
import { v4 } from 'uuid';
export default {
name: "feedSummary",
props: {
......@@ -51,7 +71,9 @@ export default {
}
},
components: {
ProjectSideMenu
ProjectSideMenu,
DskTableHeaderSetting,
TableListCom
},
data() {
return {
......@@ -62,7 +84,15 @@ export default {
comProjectDetailInfo: {},
comProjectId: "",
defaultActive: "",
menuTreeList: []
menuTreeList: [],
// 列表表头
formColum: [
{ label: '序号', prop: "staticSerialNumber", type: "index", lock: true, fixed: false, uid: v4() },
],
// 当前查询的数据月份
recordDate: "",
// 当前选中子菜单的父类名称
currentParentName: ""
};
},
//可访问data属性
......@@ -97,8 +127,42 @@ export default {
} catch (error) {
}
},
async getFeedSummaryList(params = {}) {
try {
const list = await getFeedSummaryListApi(params);
if (list.code == 200 && list.data instanceof Array) {
}
} catch (error) {
}
},
menuSelect(currentId, currentTemp) {
const parentName = currentTemp.parent ? this.getCurrentType(currentTemp.parent) : currentId;
if (parentName) this.currentParentName = parentName;
},
getCurrentType(parent) {
if (parent.level == 2) {
return parent.nodeName;
}
if (parent.parent) {
return this.getCurrentType(parent.parent);
}
},
// 时间选择变化
timeChange(time) {
console.log(time);
},
// 表头设置变化
async settingChange(use) {
try {
this.formColum = use;
} catch (error) {
}
},
},
}
</script>
<style lang="scss" scoped>
......@@ -117,6 +181,69 @@ export default {
min-width: 220px;
height: 100%;
}
.right-table-list-container {
width: calc(100% - 220px);
height: 100%;
box-sizing: border-box;
background: #fff;
padding: 16px;
::v-deep .project-table-list-header {
margin-bottom: 16px;
display: flex;
align-items: center;
justify-content: space-between;
.project-table-list-haeder-left {
display: flex;
align-items: center;
.project-record-date {
width: 140px;
.el-input__inner {
height: 32px;
line-height: 32px;
padding: 0px 12px;
border-radius: 2px;
border-color: #dcdfe6;
font-size: 14px;
color: #232323;
font-weight: 350;
}
.el-input__suffix {
right: 12px;
.el-input__icon {
line-height: 32px;
width: auto;
}
}
.el-input__prefix {
display: none;
}
}
}
.project-table-list-haeder-right {
display: flex;
align-items: center;
.actual-cost-btn,
.unit-conversion-btn {
height: 32px;
display: flex;
align-items: center;
justify-content: center;
padding: 0px 12px;
background-color: #0081ff;
border-color: #0081ff;
border-radius: 4px;
color: #fff;
font-size: 14px;
font-weight: 350;
margin-right: 16px;
}
}
}
}
}
}
</style>
......@@ -3,7 +3,7 @@
<template>
<!-- 有下级菜单 -->
<template v-if="checkHasChidren">
<el-submenu :index="menuItem.nodeValue" ref="projectSubMenuItem" class="project-sub-menu-item"
<el-submenu :index="createMenuIndex(menuItem.nodeValue)" ref="projectSubMenuItem" class="project-sub-menu-item"
:class="`project-sub-menu-item-level-${menuItem.level}`" :disabled="menuItem.originData && menuItem.originData.disabled">
<template slot="title">
<!-- 预留插槽 -->
......@@ -20,8 +20,8 @@
</template>
<!-- 无子集菜单 -->
<template v-else>
<el-menu-item :index="menuItem.nodeValue" class="project-only-menu-item" :class="`project-only-menu-item-level-${menuItem.level}`"
:disabled="menuItem.originData && menuItem.originData.disabled">
<el-menu-item :index="createMenuIndex(menuItem.nodeValue)" class="project-only-menu-item"
:class="`project-only-menu-item-level-${menuItem.level}`" :disabled="menuItem.originData && menuItem.originData.disabled">
<template slot="title">
<div class="project-only-menu-title-container">
<!-- 预留插槽 -->
......@@ -79,6 +79,11 @@ export default {
}
styles["padding-left"] = `${paddingLeft}px`;
return styles;
},
createMenuIndex(index) {
if (index || index == "0") {
return index.toString();
}
}
},
}
......
<template>
<div class="project-side-menu-container">
<el-menu mode="vertical" class="project-side-menu-instance" :unique-opened="uniqueOpened" :default-active="comDefaultActive" @select="menuSelect"
@open="subMenuOpen" @close="subMenuClose" ref="customElMenu">
<el-menu mode="vertical" class="project-side-menu-instance" :unique-opened="uniqueOpened" :default-active="createMenuIndex(comDefaultActive)"
@select="menuSelect" @open="subMenuOpen" @close="subMenuClose" ref="customElMenu">
<template v-for="(item,index) of tempMenuTree">
<project-menu-item :menuItem="item" :key="item.nodeValue">
<template :slot="`${item.nodeName}-${item.level}`" slot-scope="scope">
......@@ -101,6 +101,11 @@ export default {
const result = this.getCurrentData(menuPath);
this.$emit("select", menuPath, result);
},
createMenuIndex(index) {
if (index || index == "0") {
return index.toString();
}
},
getCurrentData(only) {
const _tempTree = JSON.parse(JSON.stringify(this.tempMenuTree));
if (_tempTree) {
......
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