Commit 9d9f52f5 by ym

select

1 parent d30cbf63
......@@ -3,53 +3,53 @@
</template>
<script>
import { Postmate } from 'glsx-common'
import { Postmate } from "glsx-common";
export default {
name: 'GLExternal',
name: "GLExternal",
props: {
url: {
type: String,
required: true
required: true,
},
subscribe: {
type: Function,
default: null
}
default: null,
},
},
data() {
return {
container: null
}
container: null,
};
},
mounted() {
this.container = this.$refs['adapter-frame']
this.create()
this.container = this.$refs["adapter-frame"];
this.create();
},
methods: {
create() {
if (!this.url) throw new Error('url为空')
this.container.innerHTML = ''
if (!this.url) throw new Error("url为空");
this.container.innerHTML = "";
var postmate = new Postmate({
container: this.container,
url: this.url,
name: 'adapter-frame',
classListArray: ['gl-external-adapter-frame']
name: "adapter-frame",
classListArray: ["gl-external-adapter-frame"],
})
.then(child => {
child.get('height').then(height => {
child.frame.setAttribute('scrolling', 'no')
child.frame.style.height = `${height + 14}px`
})
this.subscribe && this.subscribe(child)
})
.catch(err => {
console.log(err)
throw new Error('连接失败: ' + this.url)
.then((child) => {
child.get("height").then((height) => {
child.frame.setAttribute("scrolling", "no");
child.frame.style.height = `${height}px`;
});
this.subscribe && this.subscribe(child);
})
}
}
}
.catch((err) => {
console.log(err);
throw new Error("连接失败: " + this.url);
});
},
},
};
</script>
<style>
.gl-external-adapter-frame {
......
<template>
<div class="glsx-table">
<el-table id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle">
<el-table style="width: 100%" id="initTable" :ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'" :data="getListApi ? data : tableData" :row-key="tableParams.mutiSelectUniqueKey || ''" v-loading="loading" :height="tableHeightValues" :border="border" :tableId="tableId" :highlight-current-row="true" :stripe="true" @sort-change="sortChange" @selection-change="handleSelect" :size="size" :header-cell-style="headerStyle">
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" type="selection" width="55" :selectable="checkSelectable" :reserve-selection="true"></el-table-column>
<el-table-column v-if="hasNum" align="center" width="60px" label="序号" type="index" :index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1"></el-table-column>
<el-table-column v-for="(item, index) in tableColumns" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :align="item.align || 'center'" :sortable="item.sortable">
......@@ -239,7 +239,8 @@ export default {
// 多选
handleSelect(val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val
this.mutiSelectArr[this.tableParams.mutiSelectName] = val;
this.$emit('selectionTable', val)
},
// 清空多选
......@@ -252,12 +253,8 @@ export default {
//navHeight 传值底部高度
var baseNavEle = document.querySelector('.scrm-base-nav')
var baseSubNavEle = document.querySelector('.scrm-base-sub-nav')
var baseNavEleHeight = 0
var baseSubNavEleHeight = 0
if (baseNavEle && baseNavEle) {
baseNavEleHeight = baseNavEle.clientHeight //60
baseSubNavEleHeight = baseSubNavEle.clientHeight //14
}
var baseNavEleHeight = baseNavEle?baseNavEle.clientHeight : 0;
var baseSubNavEleHeight = baseSubNavEle?baseSubNavEle.clientHeight : 0
let paginationHeight
if (document.querySelector('.el-pagination')) {
paginationHeight = document.querySelector('.el-pagination').clientHeight + 20
......@@ -334,7 +331,7 @@ export default {
this.getListApi && this.refreshTable()
}
}
</script>
</script>
<style>
.a-click {
......@@ -347,8 +344,6 @@ export default {
margin: 10px 0;
}
.glsx-table .line-ellipsis {
display: -webkit-box;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
/* -webkit-line-clamp: 2; */
......@@ -420,4 +415,4 @@ export default {
/* .hasTableContent .el-table__body-wrapper{
height: 100%;
} */
</style>
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!