Commit 11fdaf24 authored by tianhongyang's avatar tianhongyang

fix

parent c7498979
......@@ -4,12 +4,12 @@
:min-width="item.minWidth" :align="item.align?item.align:'left'" :fixed="item.fixed"
:sortable="item.sortable ?item.sortable=='custom'? 'custom':true : false" :resizable="false" :show-overflow-tooltip="item.showOverflowTooltip">
<template v-for="(child,index) of item.children">
<table-list-column :key="child.uid ? child.uid : index" :item="child">
<template v-for="(index, name) in $slots" :slot="name">
<slot :name="name" />
<table-list-column :key="child.uid" :item="child">
<template v-for="(fnName, slotName) in $slots" :slot="slotName">
<slot :name="slotName"></slot>
</template>
<template v-for="(index, name) in $scopedSlots" :slot="name" slot-scope="{row,$index}">
<slot :name="name" :data="child" :row="row" :index="$index"></slot>
<template v-for="(fnName, slotName) in $scopedSlots" :slot="slotName" slot-scope="scope">
<slot :name="slotName" :row="scope.row" :data="scope.data" :row-index="scope.rowIndex"></slot>
</template>
</table-list-column>
</template>
......@@ -35,12 +35,12 @@
<!-- 非自定义表头 -->
<template slot-scope="scope">
<!-- 有自定义插槽 -->
<slot v-if="item.slot" :name="item.prop" :row="scope.row" :index="scope.$index" :data="item">
<slot v-if="item.slot" :name="item.prop" :row="scope.row" :data="item" :row-index="scope.$index">
<!-- 默认取值 -->
{{ scope.row[item.prop] ? scope.row[item.prop] : '-' }}
</slot>
<!-- 操作栏 不需要设置slot-->
<slot v-else-if="item.prop == 'action-field-bar'" name="action-field-bar" :row="scope.row" :index="scope.$index" :data="item"></slot>
<slot v-else-if="item.prop == 'action-field-bar'" name="action-field-bar" :row="scope.row" :data="item" :row-index="scope.$index"></slot>
<!-- 没有插槽 -->
<span v-else>
{{ scope.row[item.prop] ? scope.row[item.prop] : '-' }}
......@@ -63,6 +63,9 @@ export default {
tableData: {
type: Array,
default: () => []
},
columIndex : {
type : Number,
}
},
watch: {
......@@ -111,7 +114,7 @@ export default {
}
// 不分页
return scope.$index + 1;
},
}
},
}
</script>
......
......@@ -12,15 +12,16 @@
<el-table-column type="index" v-if="isIndex" label="序号" :width="flexWidth(tableData)" align="left" :fixed="indexFixed" :resizable="false">
<template slot-scope="scope">{{pagingHandler(hasQueryParams,queryParams,scope)}}</template>
</el-table-column>
<!-- 列二次封装 -->
<template v-for="(item,index) of formColum">
<table-list-column v-if="item.use !== false" :key="item.uid ? item.uid : index" :tableData="tableData" :item="item">
<table-list-column v-if="item.use !== false" :key="item.uid" :tableData="tableData" :item="item">
<!-- 根据透传属性创建插槽 -->
<template v-for="(index, name) in $slots" :slot="name">
<slot :name="name" />
<template v-for="(fn, slotName) in $slots" :slot="slotName">
<slot :name="slotName"></slot>
</template>
<template v-for="(index, name) in $scopedSlots" :slot="name" slot-scope="{row,index}">
<slot :name="name" :data="item" :row="row" :index="index"></slot>
<template v-for="(fn, slotName) in $scopedSlots" :slot="slotName" slot-scope="scope">
<slot :name="slotName" :data="scope.data" :row="scope.row" :row-index="scope.rowIndex"></slot>
</template>
</table-list-column>
</template>
......@@ -44,7 +45,7 @@
<script>
import NoData from '@/components/NoData';
import TableListColumn from "@/components/TableListCom/components/TableListColumn";
import TableListColumn from "@/components/CustomTable/components/TableListColumn";
import { generateRandomLowerCaseLetter } from "@/utils";
export default {
name: "tableListCom",
......@@ -214,9 +215,6 @@ export default {
const container = this.$el;
if (container) {
// console.log(container.offsetHeight, "container.offsetHeight");
// 拿到可用视口高度
console.log(container.offsetHeight);
console.log(container.getBoundingClientRect());
containerMaxHeight = container.offsetHeight;
}
}
......
......@@ -41,9 +41,14 @@
<template slot="action-field-bar" slot-scope="scope">
<div class="project-action-field-bar" v-if="scope.row.id != '0'">
<span class="push-project">推送工程量</span>
{{scope}}
</div>
<span v-else>-</span>
</template>
<!-- 本月工程量 -->
<template slot="quantities" slot-scope="scope">
</template>
</custom-table>
</el-form>
</div>
......@@ -161,10 +166,10 @@ export default {
},
{
label: '实际成本', prop: "sjcb", align: "center", uid: v4(), children: [
{ label: '本月工程量', prop: "quantities", minWidth: "95", uid: v4() },
{ label: '截止本月工程量', prop: "totalQuantities", minWidth: "123", uid: v4() },
{ label: '本月采购单价', prop: "purchaseUnitPrice", minWidth: "109", uid: v4() },
{ label: '填写时间', prop: "createTime", minWidth: "109", uid: v4() },
{ label: '本月工程量', prop: "quantities", minWidth: "150", uid: v4(), slot: true },
{ label: '截止本月工程量', prop: "totalQuantities", minWidth: "150", uid: v4(), slot: true },
{ label: '本月采购单价', prop: "purchaseUnitPrice", minWidth: "150", uid: v4(), slot: true },
{ label: '填写时间', prop: "createTime", minWidth: "150", uid: v4(), slot: true },
]
},
{ label: '推送工程量', prop: "pushQuantities", width: "95", uid: v4() },
......
......@@ -193,8 +193,8 @@ export default {
const detail = await getProjectDetailApi(projectId);
if (detail.code == 200 && detail.data) {
if (detail.data.id) detail.data["projectId"] = detail.data.id;
detail.data["projectId"] = "1754425038355890177";
detail.data["cbStage"] = 0;
// detail.data["projectId"] = "1754425038355890177";
// detail.data["cbStage"] = 0;
this.detailInfo = detail.data;
}
} catch (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