已创建调令搜索、操作等

master
xy 2 years ago
parent bb7ec0cf18
commit 86e300b41c

@ -190,7 +190,7 @@ export default {
data() {
return {
isBtns: false,
tableHeight: null,
tableHeight: 630,
//document.documentElement.clientHeight -50 -37 - 20- 25 - 76,
isShowPage: true,
checkTable: this.tableItem.map((item) => item?.prop),
@ -218,7 +218,7 @@ export default {
let paginationHeight = 37; //
let topHeight = 50; //
this.tableHeight =
clientHeight - lxHeader_height - topHeight - paginationHeight - 20 - 25 + (this.isPage ? 0 : 36);
(clientHeight - lxHeader_height - topHeight - paginationHeight - 20 - 25 + (this.isPage ? 0 : 36)) || 630;
//console.log(this.tableHeight)
},
async getTableData(isRefresh = false) {

@ -552,7 +552,7 @@ export default {
<style scoped lang="scss">
@import "src/styles/scss/style";
$width: 100rem;
$height: 70rem;
$height: 74vh;
.mask {
background: #00000022;

@ -115,7 +115,7 @@
<div class="btns">
<Button type="primary" @click="submit"></Button>
<Button type="primary" ghost @click="reset"></Button>
<Button type="primary" ghost @click="clone"></Button>
<Button type="primary" ghost @click="clone"></Button>
</div>
</div>
</template>

@ -1,7 +1,7 @@
<template>
<div>
<div class="select-content">
<Button type="primary" @click="cloneTemplate"></Button>
<Button type="primary" @click="cloneTemplate"></Button>
<el-date-picker
size="small"
:clearable="false"
@ -481,38 +481,43 @@ export default {
},
cloneTemplate () {
this.$refs['listTable']?.getSelection()?.forEach((i) => {
delete i["equipment_id-span"];
delete i["_index"];
delete i["_rowKey"];
});
this.$prompt("请输入模板名称", "模板", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputValidator: (value) => {
return !!value;
},
inputErrorMessage: "请输入模板名称",
}).then(({ value }) => {
save({
table_name: "transfer_templates",
name: value,
content: JSON.stringify(
this.$refs['listTable']?.getSelection()?.map((i) => ({
equipment_id: i.equipment_id,
start_time: this.$moment(i.start_time).format("HH:mm"),
end_time: this.$moment(i.end_time).format("HH:mm"),
content: i.content,
level: i.level,
}))
),
}).then((_) => {
this.$message({
type: "success",
message: "保存成功",
});
});
});
let select = this.$refs['listTable']?.getSelection()?.map((i) => (
{
equipment_id: i.equipment_id,
start_time: this.$moment(i.start_time).format('HH:mm'),
end_time: this.$moment(i.end_time).format('HH:mm'),
content: i.content,
level: i.level,
}
));
this.$emit("cloneTransfers", select)
// this.$prompt("", "", {
// confirmButtonText: "",
// cancelButtonText: "",
// inputValidator: (value) => {
// return !!value;
// },
// inputErrorMessage: "",
// }).then(({ value }) => {
// save({
// table_name: "transfer_templates",
// name: value,
// content: JSON.stringify(
// this.$refs['listTable']?.getSelection()?.map((i) => ({
// equipment_id: i.equipment_id,
// start_time: this.$moment(i.start_time).format("HH:mm"),
// end_time: this.$moment(i.end_time).format("HH:mm"),
// content: i.content,
// level: i.level,
// }))
// ),
// }).then((_) => {
// this.$message({
// type: "success",
// message: "",
// });
// });
// });
},
async distributeTransfers () {

@ -121,20 +121,20 @@
<!-- @input="(e) => inputEndHandler(e, select.filter[0])"-->
<!-- />-->
<!-- </template>-->
<el-popover
placement="bottom-start"
width="200"
trigger="click">
<el-tree :data="equipments"
ref="elTree"
:props="{ children: 'children', label: 'name' }"
show-checkbox
@check-change="handleCheckChange">
</el-tree>
<Input :value="treeValue" slot="reference" style="width: 140px;margin-left: 6px;" readonly placeholder="搜索点位"></Input>
</el-popover>
<!-- <el-popover-->
<!-- placement="bottom-start"-->
<!-- width="200"-->
<!-- trigger="click">-->
<!-- <el-tree :data="equipments"-->
<!-- ref="elTree"-->
<!-- :props="{ children: 'children', label: 'name' }"-->
<!-- show-checkbox-->
<!-- @check-change="handleCheckChange">-->
<!-- </el-tree>-->
<!-- <Input :value="treeValue" slot="reference" style="width: 140px;margin-left: 6px;" readonly placeholder="搜索点位"></Input>-->
<!-- </el-popover>-->
<Button
style="margin-left: 10px"
type="primary"
@ -292,38 +292,51 @@
</div>
<!--$refs['drawer'].setId(row.id);
$refs['drawer'].show();-->
<xy-table
:span-method="objectSpanMethod"
:format-list-data="mergeData"
:btn-width="140"
:auths="auths_auth_mixin"
:delay-req="true"
:destroy-action="destroy"
ref="xyTable"
:border="true"
:action="index"
:req-opt="tableSelect"
:destroy-req-opt="select"
:table-item="table"
@detail="
<el-row :gutter="10">
<el-col :span="4">
<el-tree :data="equipments"
:style="{ 'max-height': treeHeight, 'overflow': 'scroll' }"
ref="elTree"
:props="{ children: 'children', label: 'name' }"
show-checkbox
@check-change="handleCheckChange">
</el-tree>
</el-col>
<el-col :span="20">
<xy-table
:span-method="objectSpanMethod"
:format-list-data="mergeData"
:btn-width="140"
:auths="auths_auth_mixin"
:delay-req="true"
:destroy-action="destroy"
ref="xyTable"
:border="true"
:action="index"
:req-opt="tableSelect"
:destroy-req-opt="select"
:table-item="table"
@detail="
(row) => {
$router.push({
path: $route.path + '/detail/' + row.id,
});
}
"
@editor="
@editor="
(row) => {
$refs['dialog'].setId(row.id);
$refs['dialog'].setType('editor');
$refs['dialog'].show();
}
"
>
<template #callback="{ row }">
<Button size="small" type="primary" @click="$refs['callbackList'].setId(row.id),$refs['callbackList'].show()"></Button>
</template>
</xy-table>
>
<template #callback="{ row }">
<Button size="small" type="primary" @click="$refs['callbackList'].setId(row.id),$refs['callbackList'].show()"></Button>
</template>
</xy-table>
</el-col>
</el-row>
<callbackList ref="callbackList"></callbackList>
</div>
@ -911,6 +924,10 @@ export default {
filter,
};
},
treeHeight () {
return (this.$refs['xyTable']?.tableHeight + 36 || 630) + 'px'
}
},
created() {
this.window.width = screen.availWidth * 0.95

Loading…
Cancel
Save