Merge branch 'master' of http://gitea.xxhhcty.xyz:8080/zcdsj/factory_web
This commit is contained in:
commit
8a8a70b439
|
|
@ -12,7 +12,7 @@
|
||||||
<div class="scTable-table" :style="{ height: _table_height }">
|
<div class="scTable-table" :style="{ height: _table_height }">
|
||||||
<el-table v-bind="$attrs" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable"
|
<el-table v-bind="$attrs" :data="tableData" :row-key="rowKey" :key="toggleIndex" ref="scTable"
|
||||||
:height="height == 'auto' ? null : '100%'" :size="config.size" :border="config.border" :stripe="config.stripe"
|
:height="height == 'auto' ? null : '100%'" :size="config.size" :border="config.border" :stripe="config.stripe"
|
||||||
:summary-method="remoteSummary ? remoteSummaryMethod : summaryMethod" @sort-change="sortChange"
|
:summary-method="remoteSummary ? remoteSummaryMethod : summaryMethod" :expand-row-keys="expandRowKeys" @sort-change="sortChange"
|
||||||
@filter-change="filterChange" @selection-change="selectionChange">
|
@filter-change="filterChange" @selection-change="selectionChange">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<template v-for="(item, index) in userColumn" :key="index">
|
<template v-for="(item, index) in userColumn" :key="index">
|
||||||
|
|
@ -97,6 +97,7 @@ export default {
|
||||||
columnSetting,
|
columnSetting,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
expendShow:{ type: Boolean, default: false },
|
||||||
tableName: { type: String, default: "" },
|
tableName: { type: String, default: "" },
|
||||||
apiObj: { type: Object, default: () => { } },
|
apiObj: { type: Object, default: () => { } },
|
||||||
params: { type: Object, default: () => ({}) },
|
params: { type: Object, default: () => ({}) },
|
||||||
|
|
@ -134,6 +135,9 @@ export default {
|
||||||
this.tableData = this.data;
|
this.tableData = this.data;
|
||||||
this.total = this.tableData.length;
|
this.total = this.tableData.length;
|
||||||
},
|
},
|
||||||
|
expendShow(){
|
||||||
|
this.toggleExpandAll();
|
||||||
|
},
|
||||||
apiObj() {
|
apiObj() {
|
||||||
this.tableParams = this.params;
|
this.tableParams = this.params;
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
@ -161,6 +165,7 @@ export default {
|
||||||
emptyText: "暂无数据",
|
emptyText: "暂无数据",
|
||||||
toggleIndex: 0,
|
toggleIndex: 0,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
expandRowKeys:[],
|
||||||
total: 0,
|
total: 0,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
prop: null,
|
prop: null,
|
||||||
|
|
@ -522,6 +527,19 @@ export default {
|
||||||
sort(prop, order) {
|
sort(prop, order) {
|
||||||
this.$refs.scTable.sort(prop, order);
|
this.$refs.scTable.sort(prop, order);
|
||||||
},
|
},
|
||||||
|
// 控制展开/收起所有行
|
||||||
|
toggleExpandAll() {
|
||||||
|
const isExpandAll = this.expandRowKeys.length === this.$refs.scTable.data.length;
|
||||||
|
if (isExpandAll) {
|
||||||
|
this.expandRowKeys = []; // 收起所有
|
||||||
|
} else {
|
||||||
|
this.expandRowKeys = this.$refs.scTable.data.map(item => item.id); // 展开所有
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 每次展开状态变化时更新 expandRowKeys
|
||||||
|
handleExpandChange(row, expandedRows) {
|
||||||
|
this.expandRowKeys = expandedRows.map(row => row.is); // 根据实际的唯一标识
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -7,23 +7,21 @@
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add(10)"
|
@click="table_add(10)"
|
||||||
v-auth="'handover.create'"
|
v-auth="'handover.create'"
|
||||||
>新增</el-button
|
>新增</el-button>
|
||||||
>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add(20)"
|
@click="table_add(20)"
|
||||||
v-auth="'handover.create'"
|
v-auth="'handover.create'"
|
||||||
v-if="mgroup_name!=='切片'&&mgroup_name!=='拉单丝'&&mgroup_name!=='一次复丝'&&mgroup_name!=='二次复丝'&&mgroup_name!=='切丝排版'"
|
v-if="mgroup_name!=='切片'&&mgroup_name!=='拉单丝'&&mgroup_name!=='一次复丝'&&mgroup_name!=='二次复丝'&&mgroup_name!=='切丝排版'"
|
||||||
>返工</el-button
|
>返工</el-button>
|
||||||
>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="table_add(50)"
|
@click="table_add(50)"
|
||||||
v-auth="'handover.create'"
|
v-auth="'handover.create'"
|
||||||
>改版</el-button
|
>改版</el-button>
|
||||||
>
|
<el-button type="primary" @click="expendChange">{{changeText}}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<el-select
|
<el-select
|
||||||
|
|
@ -61,7 +59,7 @@
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:params="params"
|
:params="params"
|
||||||
:query="query"
|
:query="query"
|
||||||
default-expand-all
|
:expendShow="expendCode"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="#"
|
label="#"
|
||||||
|
|
@ -289,8 +287,10 @@ export default {
|
||||||
mlogId: "",
|
mlogId: "",
|
||||||
mgroupId: "",
|
mgroupId: "",
|
||||||
processId: "",
|
processId: "",
|
||||||
|
changeText: "展开",
|
||||||
processCate: "",
|
processCate: "",
|
||||||
printer_name: "",
|
printer_name: "",
|
||||||
|
expendCode:false,
|
||||||
printVisible:false,
|
printVisible:false,
|
||||||
backDialogVisible: false,
|
backDialogVisible: false,
|
||||||
mgroup_name:'',
|
mgroup_name:'',
|
||||||
|
|
@ -313,6 +313,14 @@ export default {
|
||||||
this.getMgroupOptions();
|
this.getMgroupOptions();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
expendChange(){
|
||||||
|
this.expendCode = !this.expendCode;
|
||||||
|
if(this.expendCode){
|
||||||
|
this.changeText="收起"
|
||||||
|
}else{
|
||||||
|
this.changeText="展开"
|
||||||
|
}
|
||||||
|
},
|
||||||
//获取工段列表
|
//获取工段列表
|
||||||
getMgroupOptions() {
|
getMgroupOptions() {
|
||||||
let that = this;
|
let that = this;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue