Commit 0c2cf7aa authored by 姬鋆屾's avatar 姬鋆屾

parent 3c40b99c
...@@ -294,3 +294,8 @@ a { ...@@ -294,3 +294,8 @@ a {
text-align: right; text-align: right;
word-break: break-word; word-break: break-word;
} }
.el-button--primary {
background: linear-gradient(90deg, #5ab6ff, #2e9aff) !important;
color: #fff !important;
text-align: center !important;
}
...@@ -332,3 +332,8 @@ a { ...@@ -332,3 +332,8 @@ a {
} }
} }
} }
.el-button--primary {
background: linear-gradient(90deg, #5ab6ff, #2e9aff) !important;
color: #fff !important;
text-align: center !important;
}
<template> <template>
<el-table <el-table
size='small' size="small"
:data="tableData" :data="tableData"
:row-key="handleRowKeyMethod" :row-key="handleRowKeyMethod"
:span-method="handleSpanMethod" :span-method="handleSpanMethod"
...@@ -9,113 +9,124 @@ ...@@ -9,113 +9,124 @@
@sort-change="handleSortChange" @sort-change="handleSortChange"
@row-click="handleRowClick" @row-click="handleRowClick"
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
:empty-text='emptyText' :empty-text="emptytxt ? emptytxt : emptyText"
border border
style="width: 100%"> style="width: 100%"
>
<el-table-column
v-for="column in columns"
:key="column.prop"
:type="column.type"
:index="handleIndexMethod"
:selectable="handleSelectableMethod"
:prop="column.prop"
:label="column.label"
:width="column.width"
:sortable="column.sortable"
:show-overflow-tooltip="column.tooltip"
:align="column.align || 'left'"
:formatter="column.formatter"
:reserve-selection="column.reserveSelection"
:subColumns="column.subColumns"
:fixed="column.fixed"
>
<el-table-column <el-table-column
v-for='column in columns' v-for="sunColumn in column.subColumns"
:key='column.prop' :key="sunColumn.prop"
:type="column.type" :type="sunColumn.type"
:index="handleIndexMethod" :prop="sunColumn.prop"
:selectable="handleSelectableMethod" :label="sunColumn.label"
:prop="column.prop" :width="sunColumn.width"
:label="column.label" :sortable="sunColumn.sortable"
:width="column.width" :align="sunColumn.align || 'left'"
:sortable="column.sortable" :formatter="sunColumn.formatter"
:show-overflow-tooltip="column.tooltip" />
:align="column.align || 'left'" </el-table-column>
:formatter='column.formatter'
:reserve-selection='column.reserveSelection'
:subColumns='column.subColumns'
:fixed="column.fixed"
>
<el-table-column
v-for='sunColumn in column.subColumns'
:key='sunColumn.prop'
:type="sunColumn.type"
:prop="sunColumn.prop"
:label="sunColumn.label"
:width="sunColumn.width"
:sortable="sunColumn.sortable"
:align="sunColumn.align || 'left'"
:formatter='sunColumn.formatter'
/>
</el-table-column>
</el-table> </el-table>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
handleRowKeyMethod: { handleRowKeyMethod: {
type: Function, type: Function,
required: false, required: false,
default: row => { return row.id } default: (row) => {
return row.id;
},
}, },
handleSelectableMethod: { handleSelectableMethod: {
type: Function, type: Function,
required: false, required: false,
default: () => {} default: () => {},
}, },
handleIndexMethod: { handleIndexMethod: {
type: Function, type: Function,
required: false, required: false,
default: () => {} default: () => {},
}, },
handleSpanMethod: { handleSpanMethod: {
type: Function, type: Function,
required: false, required: false,
default: () => {} default: () => {},
}, },
handleSelectionChange: { handleSelectionChange: {
type: Function, type: Function,
required: false, required: false,
default: () => {} default: () => {},
}, },
handleRowClick: { handleRowClick: {
type: Function, type: Function,
required: false, required: false,
default: () => {} default: () => {},
}, },
handleSortChange: { handleSortChange: {
type: Function, type: Function,
required: false, required: false,
default: () => {} default: () => {},
}, },
tableRowClassName: { tableRowClassName: {
type: Function, type: Function,
required: false, required: false,
default: () => {} default: () => {},
}, },
loading: { loading: {
type: Boolean, type: Boolean,
required: false, required: false,
default: true default: true,
}, },
tableData: { tableData: {
type: Array, type: Array,
required: false, required: false,
default: () => [] default: () => [],
}, },
columns: { columns: {
type: Array, type: Array,
required: false, required: false,
default: ()=> [], default: () => [],
} },
}, },
computed: { computed: {
emptyText() { emptyText() {
return (!this.loading && !this.tableData.length) ? '暂无数据' : '加载中...' return !this.loading && !this.tableData.length ? "暂无数据" : "加载中...";
}, },
}, },
methods:{ mounted() {
console.log(this.tableData);
console.log(this.loading);
},
watch: {
tableData(val) {
val.length == 0 || val.length > 0
? (this.emptytxt = "暂无数据")
: (this.emptytxt = "加载中...");
},
}, },
methods: {},
data() { data() {
return {} return {
} emptytxt: "",
} };
},
};
</script> </script>
<template> <template>
<div :style="menuPageCss" class="pages page-layout"> <div :style="menuPageCss" class="pages page-layout">
<LayoutHeader v-if="menuPage!=='left'" @changePath="changePath"></LayoutHeader> <LayoutHeader
<LayoutHeaderLeft @toggle="toggle" :isOpen="isOpen" v-if="menuPage==='left'" /> v-if="menuPage !== 'left'"
<div style="padding:20px"> @changePath="changePath"
<router-view :class="{'active': !isOpen}" /> ></LayoutHeader>
</div> <LayoutHeaderLeft
@toggle="toggle"
:isOpen="isOpen"
v-if="menuPage === 'left'"
/>
<div style="padding:20px">
<router-view :class="{ active: !isOpen }" />
</div> </div>
</div>
</template> </template>
<script> <script>
import LayoutHeader from "../components/Header"; import LayoutHeader from "../components/Header";
import LayoutHeaderLeft from "../components/HeaderLeft"; import LayoutHeaderLeft from "../components/HeaderLeft";
import TabPane from '../components/tabPane.vue' import TabPane from "../components/tabPane.vue";
const isPC = /(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent); const isPC = /(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent);
//菜单位置:取值: left :菜单在左面, top :菜单在上面 //菜单位置:取值: left :菜单在左面, top :菜单在上面
const MenuPage = "top"; const MenuPage = "top";
export default { export default {
components: { components: {
LayoutHeader, LayoutHeader,
LayoutHeaderLeft, LayoutHeaderLeft,
TabPane TabPane,
},
data() {
return {
isOpen: isPC,
menuPage: MenuPage,
isfresh: true,
path: "",
};
},
computed: {
menuPageCss() {
//左面和顶面菜单切换时,动态计划相关css参数
return {
"--padding-top": this.menuPage === "left" ? "60px" : "0px",
"--margin-left": this.menuPage === "left" ? "200px" : "0px",
};
}, },
data() { },
return { methods: {
isOpen: isPC, toggle() {
menuPage: MenuPage, this.isOpen = !this.isOpen;
isfresh:true,
path:''
}
}, },
computed: { changePath(e) {
menuPageCss() { this.path = e;
//左面和顶面菜单切换时,动态计划相关css参数
return {
"--padding-top": this.menuPage === "left" ? "60px" : "0px",
"--margin-left": this.menuPage === "left" ? "200px" : "0px",
}
}
},
methods: {
toggle() {
this.isOpen = !this.isOpen;
},
changePath(e){
this.path = e
}
}, },
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
.page { .page {
min-height: calc(100vh - 100px); min-height: calc(100vh - 100px);
width: 100%; width: 100%;
position: relative; position: relative;
background: #fff; background: #fff;
// var(--padding-top) 5px 5px 5px; // var(--padding-top) 5px 5px 5px;
padding: 20px; padding: 20px;
// margin-left: 60px; // margin-left: 60px;
&.active { &.active {
margin-left: var(--margin-left); margin-left: var(--margin-left);
} }
} }
.page-layout { .page-layout {
background: #eee; background: #eee;
} }
</style>
</style>
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