已创建调令搜索、操作等

master
xy 2 years ago
parent bb7ec0cf18
commit 86e300b41c

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

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

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

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

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

Loading…
Cancel
Save