Commit fea76448 authored by tyn's avatar tyn

merge

parent 6ecde536
......@@ -3,11 +3,13 @@
<!-- tab列表 -->
<div class="dsk-tab-items-container">
<div class="dsk-tab-items-container-inner">
<div class="dsk-tab-item" v-for="item of tabs" :key="item.id" :class="{'tab-current' : item.value == currentValue}">
<div class="dsk-tab-item-name" @click="tabChoose(item)">{{item.name}}</div>
<div class="dsk-tab-item" v-for="item of tabs" :key="item.id"
:class="{'tab-current' : item.value == currentValue,'tab-is-disabled' : item.disabled || comDisabled}">
<div class="dsk-tab-item-name" @click="item.disabled || comDisabled ? '' : tabChoose(item)">{{item.name}}</div>
</div>
<!-- 下滑条 -->
<div class="dsk-tab-sliding-bar" v-if="tabs.length" :style="{width : `${silidingBarWidth}px`,transform : `translateX(${silidingBarLeft}px)`}">
<div class="dsk-tab-sliding-bar" v-if="tabs.length && this.showTabsSlidingbar && !comDisabled"
:style="{width : `${silidingBarWidth}px`,transform : `translateX(${silidingBarLeft}px)`}">
</div>
</div>
</div>
......@@ -25,6 +27,10 @@ export default {
required: true,
type: Array,
default: () => []
},
disabled: {
type: Boolean,
default: false
}
},
watch: {
......@@ -32,6 +38,12 @@ export default {
handler(newValue) {
this.initSlidingBar();
}
},
// 全部禁用不显示滚动条
disabled: {
handler(newValue) {
this.comDisabled = newValue ? true : false;
}
}
},
model: {
......@@ -41,7 +53,8 @@ export default {
data() {
return {
silidingBarLeft: 0,
silidingBarWidth: 0
silidingBarWidth: 0,
comDisabled: this.disabled ? true : false
};
},
//可访问data属性
......@@ -50,7 +63,13 @@ export default {
},
//计算集
computed: {
showTabsSlidingbar() {
const current = this.tabs.find(item => item.value == this.currentValue);
if (current) {
return current.disabled ? false : true;
}
return false;
}
},
//方法集
methods: {
......@@ -124,6 +143,13 @@ export default {
font-weight: bold;
}
}
&.tab-is-disabled {
.dsk-tab-item-name {
color: #eee;
cursor: not-allowed;
}
}
}
.dsk-tab-sliding-bar {
......
......@@ -252,10 +252,11 @@ export default {
methods: {
async getactualMonths() {
try {
const formData = new FormData();
formData.append("projectId", this.comProjectId);
formData.append("id", this.id);
let data = await getActualMonthsApi(formData);
const params = {
projectId: this.comProjectId,
id: this.id
};
let data = await getActualMonthsApi(params);
data.forEach(item => {
item.value = item;
item.label = item.substring(1, 4) + '-' + item.substring(5, 6);
......
......@@ -3,7 +3,7 @@
<div class="project-cost-ledger-detail-inner">
<project-detail-header :current="current" :breadCrumbTree="createProjectBreadCrumbTree"></project-detail-header>
<!-- tab切换栏 -->
<dsk-tab-toggle v-model="current" :tabs="toggleTabs" @tabToggle="tabToggle"></dsk-tab-toggle>
<dsk-tab-toggle v-model="current" :tabs="toggleTabs" @tabToggle="tabToggle" :disabled="tabsDisabled"></dsk-tab-toggle>
<!-- tab切换组件容器 -->
<div class="project-cost-ledger-detail-module">
<!-- 放入组件 v-if current == ‘xxxx’ 详情变量 this.detailInfo 需要深度监听-->
......@@ -70,6 +70,7 @@ export default {
cbStage: 0,
cbType: 1
},
tabsDisabled: false,
toggleTabs: [
{
value: "basicEngineeringInformation",
......@@ -161,6 +162,7 @@ export default {
},
async getProjectQuery() {
try {
this.tabsDisabled = true;
const { query } = this.$route;
// if (!query.projectId) return this.$message.error("缺少项目id");
this.projectId = query.projectId;
......@@ -172,6 +174,7 @@ export default {
// 默认命中工程项目信息
this.current = "basicEngineeringInformation";
};
this.tabsDisabled = false;
} catch (error) {
console.log(error);
}
......
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