Commit 21f0ce55 authored by 姬鋆屾's avatar 姬鋆屾

tui

parent abff457e
...@@ -92,6 +92,34 @@ export default { ...@@ -92,6 +92,34 @@ export default {
}, 300); }, 300);
}); });
}, },
// 默认拉取数据
async getTable() {
try {
await this.beforeFecth();
} catch (error) {
return;
}
this.tableData.loading = true;
this.$post("/attendance/stat/summary", this.query, {
cancelToken: this.source.token,
})
.then(({ data }) => {
this.tableData = this.beforeRender(
Object.assign({}, this.tableData, data)
);
this.afterRender(this.tableData);
})
.catch((error) => {
if (error.message == "自动取消ajax操作") return;
this.$message.error(error.message);
})
.then((data) => {
clearTimeout(this.loadingTimer);
this.loadingTimer = setTimeout(() => {
this.tableData.loading = false;
}, 300);
});
},
// 复制一个数组或对象 // 复制一个数组或对象
util_copy(data) { util_copy(data) {
if (typeof data !== "object") return data; if (typeof data !== "object") return data;
......
...@@ -28,6 +28,14 @@ ...@@ -28,6 +28,14 @@
@click="setdialog" @click="setdialog"
>表格设置</el-button >表格设置</el-button
> >
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="restTable"
>重新汇总</el-button
>
</LayoutTable> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<!-- 表格设置 --> <!-- 表格设置 -->
...@@ -101,6 +109,9 @@ export default { ...@@ -101,6 +109,9 @@ export default {
return "-"; return "-";
} }
}, },
restTable() {
this.getTable();
},
afterRender(data) { afterRender(data) {
this.addColumn = getdiffdate( this.addColumn = getdiffdate(
this.query.summaryTimeStart, this.query.summaryTimeStart,
...@@ -129,7 +140,6 @@ export default { ...@@ -129,7 +140,6 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
beforeRender(row) { beforeRender(row) {
console.log(row.data);
row.data.forEach((element) => { row.data.forEach((element) => {
if ( if (
element.attendanceStaffStatEntities && element.attendanceStaffStatEntities &&
......
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