Elements-SY

modify

This diff is collapsed. Click to expand it.
......@@ -4,11 +4,11 @@
<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="headerBlock">
<navbar />
<tags-view v-if="needTagsView" />
</div>
<app-main />
<app-main ref="appMainBlock" />
<right-panel v-if="false">
<settings />
</right-panel>
......
......@@ -6,40 +6,45 @@ const WIDTH = 992 // refer to Bootstrap's responsive design
export default {
watch: {
$route(route) {
if (this.device === 'mobile' && this.sidebar.opened) {
store.dispatch('app/closeSideBar', { withoutAnimation: false })
if (this.device === "mobile" && this.sidebar.opened) {
store.dispatch("app/closeSideBar", { withoutAnimation: false });
}
}
},
},
beforeMount() {
window.addEventListener('resize', this.$_resizeHandler)
window.addEventListener("resize", this.$_resizeHandler);
},
beforeDestroy() {
window.removeEventListener('resize', this.$_resizeHandler)
window.removeEventListener("resize", this.$_resizeHandler);
},
mounted() {
const isMobile = this.$_isMobile()
const isMobile = this.$_isMobile();
if (isMobile) {
store.dispatch('app/toggleDevice', 'mobile')
store.dispatch('app/closeSideBar', { withoutAnimation: true })
store.dispatch("app/toggleDevice", "mobile");
store.dispatch("app/closeSideBar", { withoutAnimation: true });
}
this.getBlockCurrentHeight();
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_isMobile() {
const rect = body.getBoundingClientRect()
return rect.width - 1 < WIDTH
const rect = body.getBoundingClientRect();
return rect.width - 1 < WIDTH;
},
$_resizeHandler() {
if (!document.hidden) {
const isMobile = this.$_isMobile()
store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop')
const isMobile = this.$_isMobile();
store.dispatch("app/toggleDevice", isMobile ? "mobile" : "desktop");
if (isMobile) {
store.dispatch('app/closeSideBar', { withoutAnimation: true })
store.dispatch("app/closeSideBar", { withoutAnimation: true });
}
}
},
getBlockCurrentHeight(){;
// console.log(this.$refs.headerBlock, this.$refs.headerBlock.clientHeight);
// console.log(this.$refs.appMainBlock);
}
}
}
},
};
......
......@@ -72,20 +72,19 @@ export const constantRoutes = [
component: Layout,
hidden: true,
children: [
{
path: "/et86",
component: (resolve) =>
require(["@/views/allocationConfig/et86"], resolve),
name: "et86",
meta: { title: "ET86", icon: "user" },
children: [],
},
// {
// path: "/et86",
// component: (resolve) => require(["@/views/et86Config/et86RuleConfig"], resolve),
// name: "et86",
// meta: { title: "ET86", icon: "user" },
// children: [],
// },
{
path: "/edit",
component: (resolve) =>
require(["@/views/allocationConfig/et86/edit"], resolve),
require(["@/views/et86Config/et86RuleConfig/edit"], resolve),
name: "edit",
meta: { title: "编辑", icon: "user", noCache: false },
meta: { title: "ET86规则", icon: "user", noCache: false },
},
{
path: "/info/:handle/id=:id;routeStatus=:routeStatus;fltNo=:fltNo;route=:route;fltDate=:fltDate;status=:status",
......
......@@ -47,44 +47,6 @@ const permission = {
return new Promise((resolve) => {
// 向后端请求路由数据
getRouters().then((res) => {
const newUrl = [
{
id: 24,
name: "et86",
path: "/et86",
hidden: false,
component: "allocationConfig/et86",
meta: {
title: "ET86",
icon: "edit",
permissions: "allocation:rand:list",
noCache: false,
},
alwaysShow: false,
children: null,
},
{
id: 25,
name: "et86BlackStation",
path: "/et86BlackStation",
hidden: false,
component: "allocationConfig/et86BlackStation",
meta: {
title: "黑名单维护",
icon: "processing",
permissions: "allocation:rand:list",
noCache: false,
},
alwaysShow: false,
children: null,
},
];
res.data.map((item) => {
if (item.name == "AllocationConfig") {
item.children.push(newUrl[0]);
item.children.push(newUrl[1]);
}
});
res.data = hasPermi.routerPer(res.data);
const sdata = JSON.parse(JSON.stringify(res.data));
const rdata = JSON.parse(JSON.stringify(res.data));
......
......@@ -4,7 +4,7 @@ export const tableAttr = {
isDragSort: true, // 拖拽tableData数据一定要加id字段
maxHeight: 300,
btnCofig: {
isBtn: true,
isBtn: false,
btnGroup: [
{
type: "primary",
......
export const formConfig = [
{
label: "创建时间(从)",
label: "原航班",
type: "Input",
name: "originOfFlightNo",
prop: "originOfFlightNo",
placeholder: "请输入原航班号",
span: 6,
trigger: "blur",
},
{
label: "修改时间 从",
type: "Date",
name: "startTime",
prop: "startTime",
width: "140px",
placeholder: "请选择开始时间",
// rules: { required: true, message: "请选择开始时间", trigger: "blur" },
format: "yyyy-MM-dd",
colWidth: "25%",
inputWidth: "100%",
},
{
label: "创建时间(到)",
label: "",
type: "Date",
name: "endTime",
prop: "endTime",
width: "140px",
placeholder: "请选择结束时间",
// rules: { required: true, message: "请选择结束时间", trigger: "blur" },
format: "yyyy-MM-dd",
colWidth: "19%",
labelWidth: "20px",
inputWidth: "100%",
},
{
label: "规则状态",
type: "Select",
name: "status",
prop: "status",
width: "140px",
placeholder: "请选择状态",
options: {
data: [
{
value: "1",
label: "有效",
},
{
}, {
value: "0",
label: "无效",
},
......@@ -40,6 +50,9 @@ export const formConfig = [
label: "有效",
value: "1",
},
colWidth: "20%",
labelWidth: "70px",
inputWidth: "100%",
},
];
......
......@@ -6,6 +6,9 @@
ref="ruleForm"
:formConfig="formConfig"
:queryForm="queryForm"
:inline="false"
formWidth="auto"
@blur="blurEvent"
/>
</el-col>
</el-row>
......@@ -18,7 +21,6 @@
@sizeChange="handleSizeChange"
@currentChange="handleCurrentChange"
@search="searchBtn"
@restForm="restForm"
@add="addBtn"
>
</yl-table>
......@@ -41,10 +43,12 @@ export default {
data() {
return {
formConfig: formConfig, // 表单配置项
queryForm: { // 表单参数
queryForm: {
// 表单参数
status: "有效",
},
pageConfig: { // 分页配置项
pageConfig: {
// 分页配置项
isPagination: true,
total: 0,
pageData: {
......@@ -55,7 +59,6 @@ export default {
tableAttr: tableAttr, // table配置项
columns: columnHeader(this.viewRow, this.editRow, this.deleteRow), // 表头
tableData: [], // 表格数据
selectionList: [], // table复选框筛选集合
};
},
created() {
......@@ -69,20 +72,14 @@ export default {
// ET86查询
queryFindAllEtesRules(params) {
this.tableAttr.loadingTable = true;
findAllEtesRules(params)
.then((res) => {
findAllEtesRules(params).then((res) => {
this.tableAttr.loadingTable = false;
const { code, data } = res;
if (code == 200) {
this.tableData = data.list;
this.pageConfig.total = data.total;
}
})
.catch(() => {});
},
// table复选框事件
selectionTable(e) {
this.selectionList = e;
}).catch(() => {});
},
//条数变化
handleSizeChange(e) {
......@@ -96,14 +93,14 @@ export default {
this.searchBtn();
},
// 搜索
searchBtn(row) {
searchBtn() {
const { page, size } = this.pageConfig.pageData;
let params = {
createTimeStart: this.queryForm.startTime
? this.queryForm.startTime
: "",
createTimeEnd: this.queryForm.endTime ? this.queryForm.endTime : "",
limitStart: this.pageConfig.pageData.page,
limitSize: this.pageConfig.pageData.size,
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 == "有效") {
......@@ -133,7 +130,7 @@ export default {
query: {
name: "view",
id: row.id,
status: row.status
status: row.status,
},
});
},
......@@ -144,7 +141,7 @@ export default {
query: {
name: "edit",
id: row.id,
status: row.status
status: row.status,
},
});
},
......@@ -156,17 +153,21 @@ export default {
type: "warning",
center: true,
}).then(() => {
deleteEtesRuleById({ id: row.id }).then(res=>{
deleteEtesRuleById({ id: row.id }).then((res) => {
const { code, msg } = res;
if (code == 200) {
this.searchBtn();
this.msgSuccess("删除成功!");
}else{
this.msgError(msg || "删除失败");
}
})
}).catch(() => {});
if (code == 200) {
this.searchBtn();
this.msgSuccess("删除成功!");
} else {
this.msgError(msg || "删除失败");
}
});
}).catch(() => {});
},
// 失焦事件
blurEvent({ originOfFlightNo }){
this.queryForm.originOfFlightNo = this.upCase(originOfFlightNo)
}
},
};
</script>
......
......@@ -19,15 +19,15 @@ export const tableAttr = {
loading: false,
event: "search",
},
{
type: "info",
icon: "",
btnName: "重置",
size: "mini",
round: false,
loading: false,
event: "restForm",
},
// {
// type: "info",
// icon: "",
// btnName: "重置",
// size: "mini",
// round: false,
// loading: false,
// event: "restForm",
// },
{
type: "primary",
icon: "el-icon-plus",
......@@ -42,12 +42,6 @@ export const tableAttr = {
};
export const columnHeader = (viewRow, editRow, deleteRow) => [
{
type: "selection",
align: "center",
prop: "selection",
width: "50",
},
{
type: "index",
label: "序号",
prop: "id",
......@@ -55,26 +49,20 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [
width: "50",
},
{
label: "原航班",
label: "原航班",
prop: "originOfFlightNo",
align: "center",
minWidth: 100,
minWidth: 80,
},
{
label: "顺位航班",
label: "配载航班",
prop: "rankFltNoStr",
align: "center",
minWidth: 100,
},
{
label: "URSA包含",
prop: "includeUrsa",
align: "center",
minWidth: 100,
},
{
label: "URSA不包含",
prop: "notIncludeUrsa",
label: "航线",
prop: "rankFltRouteStr",
align: "center",
minWidth: 100,
},
......@@ -82,43 +70,30 @@ export const columnHeader = (viewRow, editRow, deleteRow) => [
label: "状态",
prop: "status",
align: "center",
minWidth: 100,
minWidth: 80,
render: (h, params) => {
const { row } = params;
return h("div", `${state[row.status]}`);
},
},
{
label: "创建时间",
prop: "createTime",
align: "center",
minWidth: 100,
sortable: true,
"sort-method": (a, b) => b.createTime - a.createTime,
},
{
label: "创建人",
prop: "createUserName",
align: "center",
minWidth: 100,
},
{
label: "修改时间",
prop: "updateTime",
align: "center",
minWidth: 100,
minWidth: 120,
// "sort-method": (a, b) => b.createTime - a.createTime,
},
{
label: "修改人",
prop: "updateUserName",
align: "center",
minWidth: 100,
minWidth: 80,
},
{
label: "操作",
prop: "operate",
align: "center",
minWidth: 120,
minWidth: 125,
fixed: "right",
render: (h, params) => {
return h("div", [
......