Commit 96c0b428 authored by 姬鋆屾's avatar 姬鋆屾

推表格适配

parent 663e32af
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
:empty-text="emptytxt ? emptytxt : emptyText" :empty-text="emptytxt ? emptytxt : emptyText"
border border
:height="height"
style="width: 100%" style="width: 100%"
> >
<el-table-column <el-table-column
...@@ -50,9 +51,9 @@ ...@@ -50,9 +51,9 @@
<script> <script>
export default { export default {
props: { props: {
toggleRowSelection:{ toggleRowSelection: {
type:Array, type: Array,
default:()=>[] default: () => [],
}, },
handleRowKeyMethod: { handleRowKeyMethod: {
type: Function, type: Function,
...@@ -116,15 +117,17 @@ export default { ...@@ -116,15 +117,17 @@ export default {
required: false, required: false,
default: () => [], default: () => [],
}, },
height: {
type: String,
required: false,
},
}, },
computed: { computed: {
emptyText() { emptyText() {
return !this.loading && !this.tableData.length ? "暂无数据" : "加载中..."; return !this.loading && !this.tableData.length ? "暂无数据" : "加载中...";
}, },
}, },
created(){ created() {},
},
watch: { watch: {
tableData(val) { tableData(val) {
val.length == 0 || val.length > 0 val.length == 0 || val.length > 0
...@@ -140,15 +143,15 @@ export default { ...@@ -140,15 +143,15 @@ export default {
// console.log(val); // console.log(val);
// } // }
}, },
toggleRowSelection:{ toggleRowSelection: {
handler:function(v){ handler: function(v) {
v.forEach(element => { v.forEach((element) => {
this.$refs.eltable.toggleRowSelection(element,true) this.$refs.eltable.toggleRowSelection(element, true);
}); });
}, },
deep:true, deep: true,
immediate:true immediate: true,
} },
}, },
methods: {}, methods: {},
data() { data() {
......
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
:tableData="data.data" :tableData="data.data"
:columns="config.columns" :columns="config.columns"
:loading="data.loading" :loading="data.loading"
:height="config.height"
:tableRowClassName="config.methods.tableRowClassName" :tableRowClassName="config.methods.tableRowClassName"
:handleSpanMethod="config.methods.handleSpanMethod" :handleSpanMethod="config.methods.handleSpanMethod"
:handleSortChange="config.methods.handleSortChange" :handleSortChange="config.methods.handleSortChange"
...@@ -256,7 +257,7 @@ import DataTreeTable from "@/components/DataTreeTable.vue"; ...@@ -256,7 +257,7 @@ import DataTreeTable from "@/components/DataTreeTable.vue";
import TabPane from "@/components/tabPane.vue"; import TabPane from "@/components/tabPane.vue";
export default { export default {
props: { props: {
toggleRowSelection:{ toggleRowSelection: {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
......
...@@ -351,6 +351,7 @@ export default { ...@@ -351,6 +351,7 @@ export default {
saveUrl: "/perform/dept/conf/save", saveUrl: "/perform/dept/conf/save",
}, },
config: { config: {
height: "580",
isshowTabPane: false, isshowTabPane: false,
search: [], search: [],
columns: [ columns: [
...@@ -381,7 +382,6 @@ export default { ...@@ -381,7 +382,6 @@ export default {
}; };
}, },
methods: { methods: {
handleRowClick(val) { handleRowClick(val) {
val.check = !val.check; val.check = !val.check;
val.check val.check
...@@ -567,7 +567,7 @@ export default { ...@@ -567,7 +567,7 @@ export default {
} }
.content { .content {
width: 100%; width: 100%;
height:auto; height: auto;
border: 1px solid #e4e7ed; border: 1px solid #e4e7ed;
border-top: 0; border-top: 0;
padding: 20px; padding: 20px;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<Field <Field
label="联系电话:" label="联系电话:"
prop="phone" prop="phone"
maxLength="11" :maxLength="11"
v-model="form.phone" v-model="form.phone"
placeholder="请输入联系电话" placeholder="请输入联系电话"
/> />
...@@ -148,6 +148,7 @@ export default { ...@@ -148,6 +148,7 @@ export default {
this.deptArr = []; this.deptArr = [];
} }
}); });
console.log(this.tableConfig);
// this.getData(); // this.getData();
}, },
data() { data() {
...@@ -173,6 +174,7 @@ export default { ...@@ -173,6 +174,7 @@ export default {
config: { config: {
isshowTabPane: false, isshowTabPane: false,
search: [], search: [],
height: "550",
columns: [ columns: [
{ type: "index", label: "序号", width: 50 }, { type: "index", label: "序号", width: 50 },
......
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