Elements-SY

modify

......@@ -4,7 +4,7 @@
<sidebar class="sidebar-container"
:style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }" />
<div :class="{ hasTagsView: needTagsView }" class="main-container">
<div :class="{ 'fixed-header': fixedHeader }">
<div :class="{ 'fixed-header': fixedHeader }" ref="headerRef">
<navbar />
<tags-view v-if="needTagsView" />
</div>
......
......@@ -13,32 +13,42 @@ const state = {
};
const mutations = {
TOGGLE_SIDEBAR: state => {
state.sidebar.opened = !state.sidebar.opened
state.sidebar.withoutAnimation = false
TOGGLE_SIDEBAR: (state) => {
state.sidebar.opened = !state.sidebar.opened;
state.sidebar.withoutAnimation = false;
if (state.sidebar.opened) {
//Cookies.set('sidebarStatus', 1)
localStorage.setItem('sidebarStatus', 1)
localStorage.setItem("sidebarStatus", 1);
} else {
// Cookies.set('sidebarStatus', 0)
localStorage.setItem('sidebarStatus', 0)
localStorage.setItem("sidebarStatus", 0);
}
},
CLOSE_SIDEBAR: (state, withoutAnimation) => {
//Cookies.set('sidebarStatus', 0)
localStorage.setItem('sidebarStatus', 0)
state.sidebar.opened = false
state.sidebar.withoutAnimation = withoutAnimation
localStorage.setItem("sidebarStatus", 0);
state.sidebar.opened = false;
state.sidebar.withoutAnimation = withoutAnimation;
},
TOGGLE_DEVICE: (state, device) => {
state.device = device
state.device = device;
},
SET_SIZE: (state, size) => {
state.size = size
state.size = size;
//Cookies.set('size', size)
localStorage.setItem('size', size)
localStorage.setItem("size", size);
},
SET_APPHEADERBLOCKCH: (state, height) => {
state.headerBlockClientHeight = height;
},
<<<<<<< HEAD
}
=======
SET_APPMAINBLOCKCH: (state, height) => {
state.appMainBlockClientHeight = height;
},
};
>>>>>>> test
const actions = {
toggleSideBar({ commit }) {
......@@ -53,6 +63,15 @@ const actions = {
setSize({ commit }, size) {
commit("SET_SIZE", size);
},
<<<<<<< HEAD
=======
setAppHeaderBlockCH({ commit }, height) {
commit("SET_APPHEADERBLOCKCH", height);
},
setAppMainBlockCH({ commit }, height) {
commit("SET_APPMAINBLOCKCH", height);
},
>>>>>>> test
};
export default {
......
......@@ -424,21 +424,12 @@ export function restTableHeight($refs) {
if (key == "ylTable") {
$refs[key].$children.map((item) => {
if (item.$el.id == "group-btn") {
// console.log("group-btn:", getPropertyValue(item.$el));
// table表格组合按钮
heigth += getPropertyValue(item.$el);
heigth += item.$el.clientHeight;
} else if (item.$el.className == "el-pagination is-background") {
// table表格组合分页
if (item.$el.offsetParent.className == "pagination-container") {
// console.log(
// "pagination:",
// getPropertyValue(item.$el.offsetParent)
// );
// console.log(
// "paginationClientHeight:",
// getPropertyValue(item.$el.offsetParent.clientHeight)
// );
heigth += getPropertyValue(item.$el.offsetParent);
heigth += item.$el.offsetParent.clientHeight;
}
......@@ -448,22 +439,14 @@ export function restTableHeight($refs) {
if ($refs[key].hasOwnProperty("$el")) {
heigth += $refs[key].$el.clientHeight;
heigth += getPropertyValue($refs[key].$el);
// console.log(
// "ruleForm:",
// $refs[key].$el.clientHeight,
// getPropertyValue($refs[key].$el)
// );
} else {
// console.log("ruleForm:", $refs[key]);
heigth += $refs[key].$el.clientHeight;
heigth += getPropertyValue($refs[key]);
}
}
} else if (key == "formHeaderRef") {
// console.log("formHeaderRef:", getPropertyValue($refs[key]));
heigth += getPropertyValue($refs[key]);
}
});
// console.log("heigth:", heigth);
return heigth;
}
......
......@@ -844,13 +844,17 @@ export default {
} else {
//未请求到数据
if (this.infoForm.route != null && this.infoForm.route != '' && this.infoForm.route != ' ') {
//航线不为空,获取该航线下无日期通用维度设置
findDestinationFltRuleByFlightNo({
let params = {
purposeOfFlightNo: this.infoForm.fltNo,
flightRoute: this.infoForm.route,
flightRouteListStr: this.$route.params.route,
status: this.$route.params.status
}).then(response => {
}
if(this.$route.params.handle == "updated"){
delete params.flightRoute
}
//航线不为空,获取该航线下无日期通用维度设置
findDestinationFltRuleByFlightNo(params).then(response => {
this.routeList = response.data.routeList
if (response.data.list.length > 0) {
//查询到通用维度,去除id status,航线赋值,航线优先级赋值
......
......@@ -858,7 +858,7 @@ export default {
goFlightAllocConfig(val) {
let obj = {
id: ' ',
handle: 'update',
handle: 'updated',
fltNo: val.fltNo,
fltDate: val.fltDate ? val.fltDate : null,
route: val.route,
......
export const formConfig = [
{
label: "原航班",
type: "Input",
name: "originOfFlightNo",
prop: "originOfFlightNo",
placeholder: "请输入原航班号",
span: 5,
trigger: "blur",
labelWidth: "55px",
},
{
label: "修改时间 从",
type: "Date",
name: "startTime",
prop: "startTime",
placeholder: "请选择开始时间",
// rules: { required: true, message: "请选择开始时间", trigger: "blur" },
format: "yyyy-MM-dd",
colWidth: "23%",
inputWidth: "100%",
},
{
label: "到",
type: "Date",
name: "endTime",
prop: "endTime",
placeholder: "请选择结束时间",
// rules: { required: true, message: "请选择结束时间", trigger: "blur" },
format: "yyyy-MM-dd",
colWidth: "20%",
labelWidth: "20px",
inputWidth: "100%",
},
{
label: "规则状态",
type: "Select",
name: "status",
prop: "status",
placeholder: "请选择状态",
options: {
data: [
{
value: "1",
label: "有效",
},
{
value: "0",
label: "无效",
},
],
},
colWidth: "18%",
labelWidth: "70px",
inputWidth: "100%",
},
];
export const editFormConfig = [
{
label: "航班号",
type: "Search",
name: "route",
prop: "fltNo",
placeholder: "请输入航班号",
rules: {
required: true,
message: "请输入航班号",
trigger: ["change", "blur"],
},
http: {
url: "/dictionary/queryRouteByFltNo",
method: "post",
data: {
fltNo: "",
},
},
},
{
label: "",
type: "inputNumber",
name: "count",
prop: "count",
placeholder: "+",
min: 0,
max: 7,
with: "50px",
},
{
label: "航线优先级",
type: "Input",
name: "route",
prop: "fltNum",
placeholder: "请选择航线优先级",
trigger: "focus",
},
{
label: "爆仓是否继续配舱",
type: "Checkbox",
name: "checked",
prop: "checked",
disabled: false,
},
];
<template>
<div ref="formHeaderRef" class="form-header container">
<el-row>
<el-col>
<yl-form
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
:inline="false"
formWidth="auto"
@blur="blurEvent"
/>
</el-col>
</el-row>
<yl-table
ref="ylTable"
:attrs="tableAttr"
:loadingTable="tableAttr.loadingTable"
:columns="columns"
:tableData="tableData"
:pageConfig="pageConfig"
@sizeChange="handleSizeChange"
@currentChange="handleCurrentChange"
@search="searchBtn"
@add="addBtn"
>
</yl-table>
</div>
</template>
<script>
import YlForm from "@/components/YlForm";
import YlTable from "@/components/YlTable";
import { formConfig } from "./formConfig";
import { tableAttr, columnHeader } from "./tableConfig";
import { restTableHeight, sortList } from "@/utils";
import store from '@/store'
import {
findAllEtesRules, // ET86查询
deleteEtesRuleById, // 删除
} from "@/api/et86";
export default {
components: {
YlForm,
YlTable,
},
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: {
// 表单参数
status: "有效",
},
pageConfig: {
// 分页配置项
isPagination: true,
total: 0,
pageData: {
page: 1,
size: 10,
},
},
tableAttr: tableAttr, // table配置项
columns: columnHeader(this.indexAdd, this.viewRow, this.editRow, this.deleteRow), // 表头
tableData: [], // 表格数据
};
},
created() {
// ET86查询
this.$nextTick(() => {
this.searchBtn();
});
},
mounted() {
this.$nextTick(() => {
this.tableAttr.maxHeight =
window.innerHeight - restTableHeight(this.$refs);
});
console.log(store.getters.appHeaderBlockClientHeight)
},
methods: {
// ET86查询
queryFindAllEtesRules() {
const { page, size } = this.pageConfig.pageData;
let params = {
originOfFlightNo: this.queryForm.originOfFlightNo,
updateTimeStart: this.queryForm.startTime
? this.queryForm.startTime
: "",
updateTimeEnd: this.queryForm.endTime ? this.queryForm.endTime : "",
limitStart: (page - 1) * size,
limitSize: size,
status: this.queryForm.status,
};
if (this.queryForm.status == "有效") {
params.status = "1";
}
this.tableAttr.loadingTable = true;
findAllEtesRules(params)
.then((res) => {
this.tableAttr.loadingTable = false;
const { code, data } = res;
if (code == 200) {
const valid = data.list.filter((item) => item.status == "1"); // 有效
const invalid = data.list.filter((item) => item.status == "0"); // 无效
this.tableData = valid.concat(invalid);
this.pageConfig.total = data.total;
}
})
.catch(() => {});
},
// 失焦事件
blurEvent({ originOfFlightNo }) {
this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo);
},
// 搜索
searchBtn() {
this.pageConfig.pageData.page = 1;
this.pageConfig.pageData.size = 10;
this.$refs.ruleForm.handleSearch("ruleForm", (val) => {
this.queryFindAllEtesRules();
});
},
// 翻页序号递增
indexAdd(index){
const page = this.pageConfig.pageData.page // 当前页码
const pagesize = this.pageConfig.pageData.size // 每页条数
return index + 1 + (page - 1) * pagesize
},
//条数变化
handleSizeChange(e) {
this.pageConfig.pageData.size = e;
this.pageConfig.pageData.page = 1;
this.queryFindAllEtesRules();
},
//页码变化
handleCurrentChange(e) {
this.pageConfig.pageData.page = e;
this.queryFindAllEtesRules();
},
// 添加
addBtn(item) {
this.$router.push({
path: "/edit",
query: {
name: "add",
},
});
},
// 重置表单
restForm() {
this.$refs.ruleForm.resetFields("ruleForm");
},
// 查看
viewRow({ row }) {
this.$router.push({
path: "/edit",
query: {
name: "view",
id: row.id,
status: row.status,
},
});
},
// 编辑
editRow({ row }) {
this.$router.push({
path: "/edit",
query: {
name: "edit",
id: row.id,
status: row.status,
},
});
},
// 删除
deleteRow({ row }) {
this.$confirm("是否确认删除? 删除后该规则设置为无效,不可恢复", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
})
.then(() => {
deleteEtesRuleById({ id: row.id }).then((res) => {
const { code, msg } = res;
if (code == 200) {
this.searchBtn();
this.msgSuccess("删除成功!");
} else {
this.msgError(msg || "删除失败");
}
});
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped></style>
......@@ -300,7 +300,7 @@ export default {
queryRoute(obj).then(res => {
if (res.code === 200) {
res.data.list.map(item=>{
if(item.isEtesRoute == "N"){
if(item.isEtesRoute == "N" || item.isEtesRoute == null){
item.isEtesRoute = false;
}else{
item.isEtesRoute = true;
......