|
@@ -0,0 +1,129 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-popover
|
|
|
+ placement="left"
|
|
|
+ width="800"
|
|
|
+ trigger="click"
|
|
|
+ v-model="popoverShow"
|
|
|
+ >
|
|
|
+ <div style="display: flex;justify-content: space-between">
|
|
|
+ <el-input style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" size="small" class="input-with-select inline-16 layout_search__panel" clearable>
|
|
|
+ </el-input>
|
|
|
+ <el-button type="primary" size="small" @click="onSelect">{{$t(`确定`)}}</el-button>
|
|
|
+ </div>
|
|
|
+ <tableList ref="table" height="600px" style="margin-top: 10px" :checkbox="true" :layout="tablecols" :data="list" :opwidth="200" :custom="true" @selectionChange="selectionChange"
|
|
|
+ >
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
+ <div v-if="scope.column.columnname === 'tag'">
|
|
|
+ <div v-if="scope.column.data.tag_sys.length > 0 || scope.column.data.tag.length > 0">
|
|
|
+ <div v-for="item in scope.column.data.tag_sys" :key="item.index" style="float: left;margin-left: 5px;margin-bottom: 5px">
|
|
|
+ <el-tag color="#3874F6" size="mini" type="primary" effect="dark">
|
|
|
+ <span>{{$t(item)}}</span>
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ <div v-for="item in scope.column.data.tag" :key="item.index" style="float: left;margin-left: 5px;margin-bottom: 5px">
|
|
|
+ <el-tag color="#FA8C16" size="mini" type="warning" effect="dark">
|
|
|
+ <span>{{$t(item)}}</span>
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <p v-else>--</p>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="scope.column.columnname === 'industry'">
|
|
|
+ <span
|
|
|
+ v-if="
|
|
|
+ JSON.stringify(scope.column.data.industry) !== '[]' &&
|
|
|
+ scope.column.data.industry
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ v-for="item in scope.column.data.industry"
|
|
|
+ :key="item.index"
|
|
|
+ style="float: left; margin-left: 5px; margin-bottom: 5px"
|
|
|
+ >
|
|
|
+ <el-tag size="mini" effect="dark">
|
|
|
+ <span>{{ $t(item) }}</span>
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </span>
|
|
|
+ <div v-else>--</div>
|
|
|
+ </div>
|
|
|
+ <p v-else>{{scope.column.data[scope.column.columnname]?$t(scope.column.data[scope.column.columnname]):'--'}}</p>
|
|
|
+ </template>
|
|
|
+ </tableList>
|
|
|
+ <div class="container normal-panel" style="text-align:right">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[20, 50, 100, 200]"
|
|
|
+ :page-size="50"
|
|
|
+ layout="total,sizes, prev, pager, next, jumper"
|
|
|
+ :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <el-button slot="reference" style="float: left" @click="onShow" size="small" type="primary" icon="el-icon-plus">{{$t(btnTitle)}}</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import tableList from '@/components/table/index5';
|
|
|
+export default {
|
|
|
+ name: "index",
|
|
|
+ props:["tablecols","btnTitle","param",'selectData'],
|
|
|
+ components:{tableList},
|
|
|
+ data(){
|
|
|
+ return {
|
|
|
+ popoverShow:false,
|
|
|
+ list:[],
|
|
|
+ select:[],
|
|
|
+ total:0,
|
|
|
+ currentPage:0,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ onShow(){
|
|
|
+ // this.popoverShow = true
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ async listData(){
|
|
|
+ const res = await this.$api.requested(this.param)
|
|
|
+ this.list = res.data
|
|
|
+ this.total = res.total
|
|
|
+ this.currentPage = res.pageNumber
|
|
|
+ console.log(this.selectData,'selectData')
|
|
|
+ this.selectData.forEach(item=>{
|
|
|
+ this.list.forEach((k,index)=>{
|
|
|
+ if (item.sys_enterpriseid == k.sys_enterpriseid){
|
|
|
+ this.list.splice(index,1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log(this.list,'列表数据')
|
|
|
+ },
|
|
|
+ selectionChange(row){
|
|
|
+ this.select = [...row,...this.selectData]
|
|
|
+ },
|
|
|
+ onSelect(){
|
|
|
+ this.popoverShow = false
|
|
|
+ this.$emit('onSelect',this.select)
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ // console.log(`每页 ${val} 条`);
|
|
|
+ this.param.content.pageSize = val
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ // console.log(`当前页: ${val}`);
|
|
|
+ this.param.content.pageNumber = val
|
|
|
+ this.listData()
|
|
|
+ },
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|