Browse Source

高级筛选更改及备份+转义枚举值问题处理

noToken
安虹睿 1 year ago
parent
commit
e2a029a8c1
  1. 8
      PC/InterFace.Dash/src/components/currenDescriptions/index.vue
  2. 611
      PC/InterFace.Dash/src/components/searchOverall/index copy.vue
  3. 87
      PC/InterFace.Dash/src/components/searchOverall/index.vue
  4. 83
      PC/InterFace.Dash/src/components/searchOverall/style/index copy.scss
  5. 36
      PC/InterFace.Dash/src/components/searchOverall/style/index.scss
  6. 402
      PC/InterFace.Dash/src/components/tablePagination/index copy.vue
  7. 47
      PC/InterFace.Dash/src/components/tablePagination/index.vue
  8. 8
      PC/InterFace.Dash/src/components/umyTable/index.vue
  9. 8
      PC/UI.WinIn.FasterZ.Store/src/components/currenDescriptions/index.vue
  10. 611
      PC/UI.WinIn.FasterZ.Store/src/components/searchOverall/index copy.vue
  11. 87
      PC/UI.WinIn.FasterZ.Store/src/components/searchOverall/index.vue
  12. 83
      PC/UI.WinIn.FasterZ.Store/src/components/searchOverall/style/index copy.scss
  13. 36
      PC/UI.WinIn.FasterZ.Store/src/components/searchOverall/style/index.scss
  14. 402
      PC/UI.WinIn.FasterZ.Store/src/components/tablePagination/index copy.vue
  15. 51
      PC/UI.WinIn.FasterZ.Store/src/components/tablePagination/index.vue
  16. 8
      PC/UI.WinIn.FasterZ.Store/src/components/umyTable/index.vue

8
PC/InterFace.Dash/src/components/currenDescriptions/index.vue

@ -146,9 +146,11 @@ export default {
//
initApiEnumList(item,data){
let _item_enumList = {}
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
if(item.enums_list){
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
}
return _item_enumList[data] || '未定义'
},
}

611
PC/InterFace.Dash/src/components/searchOverall/index copy.vue

@ -0,0 +1,611 @@
<template>
<!-- 全面的筛选组件初级普通筛选 + 高级筛选按照配置来判断显示情况-->
<!-- todo:使用v-if每次重新赋值与接口查询保持一致 -->
<div
class="searchOverallComponent"
:style="{height:componentsHeight+'px',overflow:isShowMoreList ? 'unset' : 'hidden'}"
v-show="isShow"
>
<div
class="border-outer"
>
<!-- 整体背景遮罩 -->
<div
v-if="isShow && isShowMoreList"
class="fullPageCover"
:style="{height:searchOverallCoverHeight}"
></div>
<div class="title" v-if="isShowMoreList">高级筛选</div>
<!-- 普通筛选界面 -->
<searchPrimary
v-if="primarySearchOption && primarySearchOption.length > 0"
ref="searchPrimaryRef"
:showBaseButton="!isShowMoreList"
:primarySearchOption="primarySearchOption"
:primarySearchButton="isShowMoreList ? primarySearchButton : primarySearchAllButton"
@primarySearchButtonClick="primarySearchButtonClick"
@primarySearchBaseHandle="primarySearchBaseHandle"
>
<slot></slot>
</searchPrimary>
<!-- 高级筛选界面 -->
<div v-if="isShow && isShowMoreList" class="moreListOuter">
<curren-Form
class="navFilter"
size="medium"
labelWidth="0"
:searchData="moreListData"
>
<el-row :gutter="20">
<el-form-item
v-for="(item, index) in moreListData.filters"
:key="index"
>
<el-col :span="5">
<el-form-item
:prop="'filters.' + index + '.column'"
:rules="rules && rules.column ? rules.column : []"
>
<el-select
v-model="item.column"
placeholder="请选择筛选对象"
:disabled="item.hide"
:filterable="true"
@change="resetSelect(item)"
>
<el-option
v-for="(item, index) in tableColumnsOptions(tableColumns)"
:key="index"
:label="item.label"
:value="
item.showProp
? item.prop + '.' + item.showProp
: item.prop
"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item
:prop="'filters.' + index + '.action'"
>
<el-select
v-model="item.action"
placeholder="请选择条件"
:disabled="disabledAction || item.column == '' || item.hide ? true : false"
>
<!-- moreListOptions.action -->
<el-option
v-for="item in formatMoreListOptions(item.column) "
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item
:prop="'filters.' + index + '.value'"
:rules="rules && rules.value ? rules.value : []"
>
<el-select
v-if="Object.keys(inputOrSelect(item.column)).length > 0"
v-model="item.value"
placeholder="请选择内容"
:disabled="item.column == '' || item.hide ? true : false"
:filterable="true"
@change="inputOrSelect(item.column)"
clearable
>
<el-option
v-for="item in $staticOptions[
inputOrSelect(item.column).filters
]()"
:key="item.value"
:label="item.label"
:value="
typeof item.value == 'string'
? item.value
: String(item.value)
"
>
</el-option>
</el-select>
<!-- 日期时间 -->
<el-date-picker
v-else-if="getColumnType(item.column) == 'dateTime'"
type="datetime"
v-model="item.value"
:placeholder="'选择日期时间'"
style="width: 100%"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-ddTHH:mm:ss"
></el-date-picker>
<el-input
v-else
v-model="item.value"
placeholder="请输入内容"
:disabled="item.column == '' || item.hide ? true : false"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item
:prop="'filters.' + index + '.logic'"
>
<el-select
v-model="item.logic"
placeholder="请选择关系"
:disabled="disabledLogic || item.column == '' || item.hide ? true : false"
>
<el-option
v-for="item in moreListOptions.logic"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="1" v-if="!item.hide">
<!-- 删除条件按钮 -->
<el-button
type="danger"
icon="el-icon-minus"
circle
size="mini"
@click="moreListDelete(index,item)"
></el-button>
</el-col>
</el-form-item>
</el-row>
</curren-Form>
<!-- 添加筛选条件 -->
<div class="moreListPush-btn">
<span @click="moreListPush">+ 添加筛选条件</span>
</div>
<!-- 按钮 -->
<div class="moreListBaseBts" v-if="moreListbuttons && moreListbuttons.length > 0" >
<el-button
v-for="(item,index) in moreListbuttons"
:key="index"
:type="item.type"
:size="item.size || 'medium'"
@click="moreListButtonHandle(item)"
:icon="item.iconRight ? '' : item.icon"
>
{{ item.label }}
<!-- 自定义右侧图标 -->
<i
style="margin-left:0"
v-if="item.iconRight"
:class="['el-icon--right',item.icon]"
></i>
</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
import searchPrimary from "@/components/searchPrimary"
export default {
name:'searchOverallComponent',
components: {
searchPrimary,
},
watch:{
//
showSearchOverall(n){
// +
//
if(this.primarySearchOption.length <= 0){
this.changeSearchOverallShow(n)
this.changeMoreListShow(n)
return
}
//
if(n){
this.changeSearchOverallShow(n)
this.changeMoreListShow(false)
}
this.$nextTick(()=>{
if(n){
this.componentsHeight = this.getSearchPrimaryHeight() + 20
}else{
this.componentsHeight = 0
this.changeMoreListShow(false)
// setTimeout(()=>{
// this.changeSearchOverallShow(n)
// },500)
}
})
this.setOverallSearchData(this.httpOverallSearchData)
},
//
httpOverallSearchData(n,o){
this.setOverallSearchData(n)
},
isShowMoreList(){
this.setOverallSearchData(this.httpOverallSearchData)
}
},
props: {
//
searchOverallCoverHeight:{
type: String,
default: 'calc(100vh - 200px)'
},
//
disabledAction:{
type: Boolean,
default: false
},
//
disabledLogic:{
type: Boolean,
default: false
},
//
showSearchOverall:{
type: Boolean,
default: false
},
//
showMoreSearch:{
type: Boolean,
default: true
},
//
primarySearchOption: {
type: Array,
default: () => {
return []
}
},
//
primarySearchButton:{
type: Array,
default: () => {
return []
}
},
//
tableColumns: {
type: Array,
default: () => {
return []
}
},
//
httpOverallSearchData:{
type: Object,
default: null
},
//
filterActionOptions:{
type: Array,
default: null
},
},
data() {
return {
// ()
primarySearchAllButton:[],
//
isShowMoreList:false,
//
componentsHeight:0,
// showSearchOverall
isShow:false,
//
moreListbuttons: [
{ label: "搜索", type: "primary", name: "moreList-search" },
{ label: '重置', name: 'moreList-reset' },
{ label:'收起筛选', name:'moreList-up', type: 'text', icon:'el-icon-arrow-up', iconRight:true}
],
// /
moreListData: {filters:[]},
//
moreListOptions: {
action: [{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}, {
value: '>',
label: '大于'
}, {
value: '<',
label: '小于'
}, {
value: '>=',
label: '大于等于'
}, {
value: '<=',
label: '小于等于'
}, {
value: 'Like',
label: '包含'
}, {
value: 'NotLike',
label: '不包含'
},
// {
// value: 'In',
// label: ''
// }, {
// value: 'NotIn',
// label: ''
// }
],
logic: [
{
value: 'And',
label: '并且'
},
{
value: 'Or',
label: '或者'
}
],
},
// rules使rules
// todo:columnvalue
rules:{
// column: [
// { required: true, message: '', trigger: 'change' }
// ],
// value: [
// { required: true, message: '', trigger: 'blur' }
// ],
},
}
},
created() {
this.moreListPush()
},
mounted() {
// ()
this.setPrimarySearchAllButton()
},
methods: {
// ,使
getSearchPrimaryHeight(){
return document.getElementsByClassName('searchPrimaryComponent')[0].clientHeight
},
//
setPrimarySearchAllButton(){
let _more_btn = [{
label:'高级筛选',
name:'more',
type: 'text',
icon:'el-icon-arrow-down',
iconRight:true
}]
if(this.showMoreSearch){
this.primarySearchAllButton = _more_btn.concat(this.primarySearchButton)
}else{
this.primarySearchAllButton= this.primarySearchButton
}
},
//
primarySearchBaseHandle(item,data, option, that){
this.overallSearchFormClick(item,data, option, that)
},
//
primarySearchButtonClick( item,data, option,that){
// []
if(item.name == 'more'){
this.changeMoreListShow(true)
}
this.overallSearchFormClick(item,data, option, that)
},
//
moreListButtonHandle(item){
this.overallSearchFormClick(item)
},
// moreListtableColumns
tableColumnsOptions(val) {
const data = JSON.parse(JSON.stringify(val));
let num = 0
val.forEach((item, index) => {
if (item.showProp) {
data.splice(index - num, 1)
num++
}
})
return data
},
//
getColumnType(val) {
var columnsType = this.tableColumns.filter(item => item.prop == val)
if (columnsType.length > 0) {
if (columnsType[0].type) {
return columnsType[0].type
}
} else {
return ''
}
},
//
resetSelect(val) {
val.action = "=="
val.value = ""
},
//
formatMoreListOptions(val) {
// filterActionOptions
if(this.filterActionOptions){
this.moreListOptions.action = this.filterActionOptions
return this.moreListOptions.action
}
if (val) {
for(var i =0; i< this.tableColumns.length; i++) {
if (val == this.tableColumns[i].prop) {
if (this.tableColumns[i].filters) {
return this.moreListOptions.action.filter(item => item.value == '==' || item.value == '!=')
} else if (this.tableColumns[i].type == 'dateTime') {
return this.moreListOptions.action.filter(item =>
item.value == '==' ||
item.value == '!=' ||
item.value == '>' ||
item.value == '<' ||
item.value == '>=' ||
item.value == '<=' )
} else {
return this.moreListOptions.action
}
}
}
}
return this.moreListOptions.action
},
// moreListinputselect
inputOrSelect(val) {
let data
if (val) {
this.tableColumns.forEach((key) => {
if (val == key.prop) {
if (key.filters) {
data = key
} else {
data = {}
}
}
})
} else {
data = {}
}
return data
},
// -
moreListDelete(val,item) {
if (this.moreListData.filters.length == 1) {
this.$warningMsg('必须保留一条筛选条件!')
} else {
this.$confirm('您确定删除吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.moreListData.filters.splice(val, 1)
}).catch(() => {
// this.modalAppendToBody = false
});
}
this.overallSearchFormClick({name:'moreList-deleteRow'})
},
// -
moreListPush() {
let data = {
logic: "And",
column: "",
action: "==",
value: ""
}
this.moreListData.filters.push(data)
this.overallSearchFormClick({name:'moreList-addRow'})
},
//
resetMoreListData(){
this.moreListData = {filters:[]}
this.moreListPush()
},
//
setMoreListData(val){
this.moreListData = JSON.parse(JSON.stringify(val))
},
// +
resetOverallSearchData(){
if(this.$refs.searchPrimaryRef)this.$refs.searchPrimaryRef.resetPrimarySearchData();
this.resetMoreListData()
},
// +
setOverallSearchData(data){
//
if(data && data.params){
if(this.$refs.searchPrimaryRef)this.$refs.searchPrimaryRef.setPrimarySearchData(data.params)
}else{
if(this.$refs.searchPrimaryRef)this.$refs.searchPrimaryRef.resetPrimarySearchData()
}
//
if(data && data.moreList){
let _list = {filters:[]}
data.moreList.filters.forEach(item=>{
if(String(item.column).length > 0 && String(item.value).length > 0){
_list.filters.push(item)
}
})
if(_list.filters.length <= 0){
_list.filters.push({
logic: "And",
column: "",
action: "==",
value: ""
})
}
this.setMoreListData(_list)
}else{
this.resetMoreListData()
}
},
// -
changeMoreListShow(val){
this.isShowMoreList = val || false
//
if(!this.primarySearchOption || this.primarySearchOption.length <= 0){
//
if(!this.isShowMoreList){
this.isShow = false
this.$emit("getShowSearchOverall",this.isShow)
}
}
},
//
changeSearchOverallShow(val){
if(!val){
this.changeMoreListShow(false)
}
this.isShow = val || false
this.$emit("getShowSearchOverall",this.isShow)
},
//
overallSearchFormClick(item,data, option) {
//
//
if(item.name == 'moreList-up'){
this.changeMoreListShow(false)
}
// - || -
else if(item.name == "moreList-reset" || item.name == "reset"){
this.resetOverallSearchData()
}
//
let _searchPrimaryRef = this.$refs.searchPrimaryRef
let _options = {
item:item,
data_primary:_searchPrimaryRef ? _searchPrimaryRef.getPrimarySearchData() : null,
data_moreList:this.moreListData,
option_primary:this.primarySearchOption,
option_moreList:this.tableColumns,
vm_primary:_searchPrimaryRef,
vm_moreList:this
}
this.$emit("overallSearchFormClick",_options)
},
}
}
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
</style>

87
PC/InterFace.Dash/src/components/searchOverall/index.vue

@ -8,14 +8,15 @@
>
<div
class="border-outer"
ref="searchOverallComponent_inner"
>
<!-- 整体背景遮罩 -->
<div
<!-- <div
v-if="isShow && isShowMoreList"
class="fullPageCover"
:style="{height:searchOverallCoverHeight}"
></div>
<div class="title" v-if="isShowMoreList">高级筛选</div>
></div> -->
<!-- <div class="title" v-if="isShowMoreList">高级筛选</div> -->
<!-- 普通筛选界面 -->
<searchPrimary
v-if="primarySearchOption && primarySearchOption.length > 0"
@ -166,28 +167,42 @@
</el-form-item>
</el-row>
</curren-Form>
<!-- 添加筛选条件 -->
<div class="moreListPush-btn">
<span @click="moreListPush">+ 添加筛选条件</span>
</div>
<!-- 按钮 -->
<div class="moreListBaseBts" v-if="moreListbuttons && moreListbuttons.length > 0" >
<el-button
v-for="(item,index) in moreListbuttons"
:key="index"
:type="item.type"
:size="item.size || 'medium'"
@click="moreListButtonHandle(item)"
:icon="item.iconRight ? '' : item.icon"
>
{{ item.label }}
<!-- 自定义右侧图标 -->
<i
style="margin-left:0"
v-if="item.iconRight"
:class="['el-icon--right',item.icon]"
></i>
</el-button>
<div class="buttonsContent">
<div class="leftButtons">
<!-- 添加筛选条件 -->
<el-button size="small" @click="moreListPush(true)">+ 添加筛选条件</el-button>
<!-- 收起 -->
<el-button
type="text"
size="small"
@click="moreListButtonHandle({ label:'收起筛选', name:'moreList-up', type: 'text', icon:'el-icon-arrow-up', iconRight:true})"
>
收起筛选
<i
style="margin-left:0"
:class="['el-icon--right','el-icon-arrow-up']"
></i>
</el-button>
</div>
<!-- 按钮 -->
<div class="rightButtons" v-if="moreListbuttons && moreListbuttons.length > 0" >
<el-button
v-for="(item,index) in moreListbuttons"
:key="index"
:type="item.type"
:size="item.size || 'small'"
@click="moreListButtonHandle(item)"
:icon="item.iconRight ? '' : item.icon"
>
{{ item.label }}
<!-- 自定义右侧图标 -->
<i
style="margin-left:0"
v-if="item.iconRight"
:class="['el-icon--right',item.icon]"
></i>
</el-button>
</div>
</div>
</div>
</div>
@ -208,6 +223,13 @@ export default {
if(this.primarySearchOption.length <= 0){
this.changeSearchOverallShow(n)
this.changeMoreListShow(n)
this.$nextTick(()=>{
this.componentsHeight = this.getAllSearchInnerHeight() + 20
//
if(!n && this.$parent.changeTableHeight){
this.$parent.changeTableHeight()
}
})
return
}
//
@ -308,7 +330,7 @@ export default {
moreListbuttons: [
{ label: "搜索", type: "primary", name: "moreList-search" },
{ label: '重置', name: 'moreList-reset' },
{ label:'收起筛选', name:'moreList-up', type: 'text', icon:'el-icon-arrow-up', iconRight:true}
// { label:'', name:'moreList-up', type: 'text', icon:'el-icon-arrow-up', iconRight:true}
],
// /
moreListData: {filters:[]},
@ -382,6 +404,10 @@ export default {
getSearchPrimaryHeight(){
return document.getElementsByClassName('searchPrimaryComponent')[0].clientHeight
},
// ,使
getAllSearchInnerHeight(){
return this.$refs.searchOverallComponent_inner ? this.$refs.searchOverallComponent_inner.clientHeight : 0
},
//
setPrimarySearchAllButton(){
let _more_btn = [{
@ -505,7 +531,7 @@ export default {
this.overallSearchFormClick({name:'moreList-deleteRow'})
},
// -
moreListPush() {
moreListPush(handle) {
let data = {
logic: "And",
column: "",
@ -514,6 +540,12 @@ export default {
}
this.moreListData.filters.push(data)
this.overallSearchFormClick({name:'moreList-addRow'})
if(handle){
this.$nextTick(()=>{
this.componentsHeight = this.getAllSearchInnerHeight() + 20
this.$parent.changeTableHeight(this.getAllSearchInnerHeight())
})
}
},
//
resetMoreListData(){
@ -600,6 +632,7 @@ export default {
vm_primary:_searchPrimaryRef,
vm_moreList:this
}
console.log(101111111)
this.$emit("overallSearchFormClick",_options)
},
}

83
PC/InterFace.Dash/src/components/searchOverall/style/index copy.scss

@ -0,0 +1,83 @@
.searchOverallComponent{
height: 0;
transition:all 0.5s;
z-index: 1;
overflow: hidden;
.border-outer{
position: relative;
background: #f8f9fb;
padding: 10px 20px 0;
border: #eff0f2 solid 1px;
margin-bottom: 10px;
}
.fullPageCover{
position: absolute;
background: rgba(255, 255, 255, 0.2);
left: 0;
right: 0;
// height: calc(100vh - 200px);
cursor: no-drop;
}
.moreListOuter{
margin-top: 10px;
position: relative;
}
::v-deep .navFilter {
// display: flex;
// flex-direction: column;
// width: 100%;
// height: 100%;
max-height: 30vh;
overflow: auto;
.el-form {
// flex: 1;
// padding-left: 100px;
// padding-right: 100px;
display: flex;
align-content: flex-start;
flex-wrap: wrap;
overflow: hidden;
overflow-y: auto;
.el-row{
margin: 0 !important;
margin-left: -5px !important;
}
.el-select{
width: 100%;
}
}
}
.title{
padding: 10px 0 15px 0;
font-weight: bold;
color: #333;
}
.moreListPush-btn {
width: 100%;
padding-left: 5px;
color: rgb(64, 158, 255);
span {
cursor: pointer;
&:hover {
color: blue;
}
}
}
.moreListBaseBts{
padding: 20px 0;
}
}

36
PC/InterFace.Dash/src/components/searchOverall/style/index.scss

@ -31,7 +31,7 @@
// flex-direction: column;
// width: 100%;
// height: 100%;
max-height: 30vh;
max-height: 170px;
overflow: auto;
.el-form {
@ -62,22 +62,28 @@
color: #333;
}
.moreListPush-btn {
width: 100%;
padding-left: 5px;
color: rgb(64, 158, 255);
.buttonsContent{
justify-content: space-between;
display: flex;
padding-bottom: 20px;
width: 890px;
}
// .moreListPush-btn {
// width: 100%;
// padding-left: 5px;
// color: rgb(64, 158, 255);
span {
cursor: pointer;
// span {
// cursor: pointer;
&:hover {
color: blue;
}
}
}
// &:hover {
// color: blue;
// }
// }
// }
.moreListBaseBts{
padding: 20px 0;
}
// .moreListBaseBts{
// padding: 20px 0;
// }
}

402
PC/InterFace.Dash/src/components/tablePagination/index copy.vue

@ -0,0 +1,402 @@
<template>
<div class="tablePagination">
<!-- 头部按钮 -->
<div class="table-nav">
<curren-Button
ref="tablePagination_topNav"
:Butttondata="currenButtonData"
@tableButtonClick="topbutton"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:quicklySearchOption="quicklySearchOption"
>
</curren-Button>
<slot name="tableTopSlot"></slot>
</div>
<!-- 全面搜索普通+高级整合 -->
<searchOverall
ref="searchOverallRef"
:searchOverallCoverHeight="searchOverallCoverHeight"
:showSearchOverall="showSearchOverall"
@getShowSearchOverall="getShowSearchOverall"
:primarySearchOption="primarySearchOption"
:primarySearchButton="primarySearchButton"
:showMoreSearch="showMoreSearch"
:tableColumns="tableColumns"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
>
<!-- 插槽预留 -->
<slot name="searchPrimarySlot"></slot>
</searchOverall>
<!-- 字段设置弹窗 -->
<rowDrop
@radio="rowDrop"
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
:source="rowSource"
:innerMaxHeight="rowMaxHeight"
></rowDrop>
<!-- 列表 -->
<div class="uTableOuter" ref="uTableOuterRef" :style="{height:uTableOuterHeight + 'px',overflow:'hidden'}">
<umyTable
ref="tablePaginationTableRef"
:isUpdate="isUpdate"
:tableLoading="tableLoading"
:tableData="tableData"
:tableColumns="tableColumns | isTableColumns"
:isShowIndex="isShowIndex"
:selectionTable="tableSelection"
:setUTableHeight="setUTableHeight || uTableTopHeight"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
:buttonOperationList_left="buttonOperationList_left"
@buttonOperationClick_left="buttonOperationClick_left"
:buttonOperationList_right="buttonOperationList_right"
@buttonOperationClick_right="buttonOperationClick_right"
:tableBorder="true"
:firstFixed="true"
:cellStyle = "cellStyle"
:showOverflowTooltip="showOverflowTooltip"
>
<template>
<slot></slot>
</template>
</umyTable>
</div>
<!-- 页码 -->
<pagination
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
:currentPageProps="currentPageProps"
@SizeChange="alterResultCount"
@CurrentChange="alertoldSkipCount"
></pagination>
</div>
</template>
<script>
import currenButton from "@/components/currenButton"
import pagination from "@/components/Pagination"
import searchOverall from "@/components/searchOverall"
import rowDrop from "@/components/rowDrop/index.vue"
import { getParentNode } from '@/utils'
export default {
name: 'tablePagination',
components: {
pagination,
currenButton,
searchOverall,
rowDrop
},
props: {
rowMaxHeight:{
type:String,
default:'calc(90vh - 280px)'
},
//
searchOverallCoverHeight:{
type: String,
default: 'calc(100vh - 200px)'
},
// app-main100%
setUTableHeight: {
type: Number,
default: null
},
//
showOverflowTooltip:{
type: Boolean,
default: false,
},
//
quicklySearchOption:{
type: Object,
default: null
},
//
currenButtonData: {
type: Array,
default: () => {
return []
}
},
// ()
buttonOperationList_left:{
type: Array,
default: null,
},
// ()
buttonOperationList_right:{
type: Function,
default: null,
},
//
tableData: {
type: Array,
default: () => {
return []
}
},
// +
tableColumns: {
type: Array,
default: () => {
return []
}
},
//
tableSelection: {
type: Boolean,
default: false
},
// table
totalCount: {
type: Number,
default: 0
},
// tableloading
tableLoading: {
type: Boolean,
default: true
},
//
MaxResultCount: {
type: Number,
default: 0
},
//
currentPageProps: {
type: Number,
default: 1
},
//
isShowIndex: {
type: Boolean,
default: false,
},
//
multipleSelection: {
type: Array,
default: () => {
return []
}
},
//
//
primarySearchOption: {
type: Array,
default: () => {
return []
}
},
//
primarySearchButton: {
type: Array,
default: () => {
return []
}
},
//
showMoreSearch:{
type: Boolean,
default: true,
},
//
httpOverallSearchData:{
type: Object,
default: null
},
cellStyle: {
type: Function,
default: () => {
return Function;
}
},
// -
rowSource:{
type:String,
default:'list_api'
}
},
data () {
return {
//
rowDropVisible: false,
// table key
isUpdate: false,
// table
uTableTopHeight:165,
// table
uTableOuterHeight:null,
// table
uTableOuterHeight_init:null,
//table
Butttondata: [
{
type: 'danger',
icon: 'el-icon-delete',
label: '批量删除',
size: 'mini'
},
{
type: 'warning',
icon: 'el-icon-edit',
label: '批量修改状态',
size: 'mini'
},
{
type: 'success',
icon: 'el-icon-upload2',
label: '批量导出',
size: 'mini'
},
{
type: 'info',
icon: 'el-icon-printer',
label: '批量打印',
size: 'mini'
},
],
//
//
showSearchOverall:false,
}
},
mounted(){
this.uTableOuterHeight = this.$refs.tablePaginationTableRef.getTableHeight()
this.uTableOuterHeight_init = Number(JSON.stringify(this.uTableOuterHeight))
//
document.addEventListener('click',(e)=>{
if(!this.rowDropVisible)return
let _class = "rowDropNotHideItem"
let _hasParent = getParentNode(e.target,_class)
let _current_class = e.target._prevClass || e.target.className
let _hasCurrent = _current_class ? String(_current_class).includes(_class) : false
if(!_hasParent && !_hasCurrent){
this.closeRowDrop()
}
})
},
methods: {
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
this.$nextTick(()=>{
this.isUpdate = !this.isUpdate
})
},
//
topbutton (val,item) {
// + table +
if(val=="filter"){
this.showSearchOverall = !this.showSearchOverall
//
if(this.primarySearchOption && this.primarySearchOption.length > 0){
this.$nextTick(()=>{
let _search_height = this.$refs.searchOverallRef.getSearchPrimaryHeight()
if(this.showSearchOverall){
let _margin = 20
this.uTableOuterHeight = this.uTableOuterHeight_init - _search_height - _margin
setTimeout(()=>{
this.uTableTopHeight += _search_height + _margin
},0)
}else{
this.uTableOuterHeight = this.uTableOuterHeight_init
setTimeout(()=>{
this.uTableTopHeight = 165
},0)
}
})
}
}
//
else if (val == 'field') {
this.rowDropVisible = !this.rowDropVisible
}
this.$emit("topbutton", val,item)
},
// -
quicklySearchClick (val,option) {
this.$emit("quicklySearchClick", val,option,this.$refs.searchOverallRef)
},
// -
quicklySearchClear (val,option) {
//
let hasSearch = false
this.currenButtonData.forEach(item=>{
if(item.name == 'filter'){
hasSearch = true
return
}
})
this.$emit("quicklySearchClear", val,option,this.$refs.searchOverallRef,hasSearch )
},
//emit
alterResultCount (val) {
this.$emit('alterResultCount', val)
},
//emit
alertoldSkipCount (val) {
this.$emit('alertoldSkipCount', val)
},
//nameemit
inlineDialog (row) {
this.$emit("inlineDialog", row)
},
//selection
handleSelectionChange (val) {
this.$emit("handleSelectionChange", val)
},
//
sortChange (data) {
this.$emit('sortChange', data)
},
//table()
buttonOperationClick_left(row, item, index) {
this.$emit("buttonOperationClick_left", row, item, index);
},
//table()
buttonOperationClick_right(row, item, index) {
this.$emit("buttonOperationClick_right", row, item, index);
},
//
// /showSearchOverall
getShowSearchOverall(val){
this.showSearchOverall = val || false
},
//
overallSearchFormClick(options){
//
options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
this.$emit("overallSearchFormClick", options)
},
//
closeRowDrop() {
this.rowDropVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.uTableOuter{
transition:all 0.5s;
overflow: hidden;
}
.tablePagination {
width: 100%;
height: 100%;
background-color: #fff;
display: flex;
flex-direction: column;
.table-nav {
padding-bottom: 15px;
}
.el-table {
flex: 1;
}
}
</style>

47
PC/InterFace.Dash/src/components/tablePagination/index.vue

@ -296,27 +296,47 @@ export default {
if(this.primarySearchOption && this.primarySearchOption.length > 0){
this.$nextTick(()=>{
let _search_height = this.$refs.searchOverallRef.getSearchPrimaryHeight()
if(this.showSearchOverall){
let _margin = 20
this.uTableOuterHeight = this.uTableOuterHeight_init - _search_height - _margin
setTimeout(()=>{
this.uTableTopHeight += _search_height + _margin
},0)
}else{
this.uTableOuterHeight = this.uTableOuterHeight_init
setTimeout(()=>{
this.uTableTopHeight = 165
},0)
}
this.changeTableHeight(_search_height)
// if(this.showSearchOverall){
// let _margin = 20
// this.uTableOuterHeight = this.uTableOuterHeight_init - _search_height - _margin
// setTimeout(()=>{
// this.uTableTopHeight += _search_height + _margin
// },0)
// }else{
// this.uTableOuterHeight = this.uTableOuterHeight_init
// setTimeout(()=>{
// this.uTableTopHeight = 165
// },0)
// }
})
}
}
this.$nextTick(()=>{
let _search_height = this.$refs.searchOverallRef.getAllSearchInnerHeight()
this.changeTableHeight(_search_height)
})
}
//
else if (val == 'field') {
this.rowDropVisible = !this.rowDropVisible
}
this.$emit("topbutton", val,item)
},
// table
changeTableHeight(minusHeight=0){
if(this.showSearchOverall){
let _margin = 20
this.uTableOuterHeight = this.uTableOuterHeight_init - minusHeight - _margin
setTimeout(()=>{
this.uTableTopHeight = minusHeight + 165 + _margin
},0)
}else{
this.uTableOuterHeight = this.uTableOuterHeight_init
setTimeout(()=>{
this.uTableTopHeight = 165
},0)
}
},
// -
quicklySearchClick (val,option) {
this.$emit("quicklySearchClick", val,option,this.$refs.searchOverallRef)
@ -370,6 +390,7 @@ export default {
overallSearchFormClick(options){
//
options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
console.log(22222,options)
this.$emit("overallSearchFormClick", options)
},
//

8
PC/InterFace.Dash/src/components/umyTable/index.vue

@ -640,9 +640,11 @@ export default {
//
initApiEnumList(item,data){
let _item_enumList = {}
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
if(item.enums_list){
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
}
return _item_enumList[data] || '未定义'
},
// | | json

8
PC/UI.WinIn.FasterZ.Store/src/components/currenDescriptions/index.vue

@ -146,9 +146,11 @@ export default {
//
initApiEnumList(item,data){
let _item_enumList = {}
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
if(item.enums_list){
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
}
return _item_enumList[data] || '未定义'
},
}

611
PC/UI.WinIn.FasterZ.Store/src/components/searchOverall/index copy.vue

@ -0,0 +1,611 @@
<template>
<!-- 全面的筛选组件初级普通筛选 + 高级筛选按照配置来判断显示情况-->
<!-- todo:使用v-if每次重新赋值与接口查询保持一致 -->
<div
class="searchOverallComponent"
:style="{height:componentsHeight+'px',overflow:isShowMoreList ? 'unset' : 'hidden'}"
v-show="isShow"
>
<div
class="border-outer"
>
<!-- 整体背景遮罩 -->
<div
v-if="isShow && isShowMoreList"
class="fullPageCover"
:style="{height:searchOverallCoverHeight}"
></div>
<div class="title" v-if="isShowMoreList">高级筛选</div>
<!-- 普通筛选界面 -->
<searchPrimary
v-if="primarySearchOption && primarySearchOption.length > 0"
ref="searchPrimaryRef"
:showBaseButton="!isShowMoreList"
:primarySearchOption="primarySearchOption"
:primarySearchButton="isShowMoreList ? primarySearchButton : primarySearchAllButton"
@primarySearchButtonClick="primarySearchButtonClick"
@primarySearchBaseHandle="primarySearchBaseHandle"
>
<slot></slot>
</searchPrimary>
<!-- 高级筛选界面 -->
<div v-if="isShow && isShowMoreList" class="moreListOuter">
<curren-Form
class="navFilter"
size="medium"
labelWidth="0"
:searchData="moreListData"
>
<el-row :gutter="20">
<el-form-item
v-for="(item, index) in moreListData.filters"
:key="index"
>
<el-col :span="5">
<el-form-item
:prop="'filters.' + index + '.column'"
:rules="rules && rules.column ? rules.column : []"
>
<el-select
v-model="item.column"
placeholder="请选择筛选对象"
:disabled="item.hide"
:filterable="true"
@change="resetSelect(item)"
>
<el-option
v-for="(item, index) in tableColumnsOptions(tableColumns)"
:key="index"
:label="item.label"
:value="
item.showProp
? item.prop + '.' + item.showProp
: item.prop
"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item
:prop="'filters.' + index + '.action'"
>
<el-select
v-model="item.action"
placeholder="请选择条件"
:disabled="disabledAction || item.column == '' || item.hide ? true : false"
>
<!-- moreListOptions.action -->
<el-option
v-for="item in formatMoreListOptions(item.column) "
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item
:prop="'filters.' + index + '.value'"
:rules="rules && rules.value ? rules.value : []"
>
<el-select
v-if="Object.keys(inputOrSelect(item.column)).length > 0"
v-model="item.value"
placeholder="请选择内容"
:disabled="item.column == '' || item.hide ? true : false"
:filterable="true"
@change="inputOrSelect(item.column)"
clearable
>
<el-option
v-for="item in $staticOptions[
inputOrSelect(item.column).filters
]()"
:key="item.value"
:label="item.label"
:value="
typeof item.value == 'string'
? item.value
: String(item.value)
"
>
</el-option>
</el-select>
<!-- 日期时间 -->
<el-date-picker
v-else-if="getColumnType(item.column) == 'dateTime'"
type="datetime"
v-model="item.value"
:placeholder="'选择日期时间'"
style="width: 100%"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-ddTHH:mm:ss"
></el-date-picker>
<el-input
v-else
v-model="item.value"
placeholder="请输入内容"
:disabled="item.column == '' || item.hide ? true : false"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item
:prop="'filters.' + index + '.logic'"
>
<el-select
v-model="item.logic"
placeholder="请选择关系"
:disabled="disabledLogic || item.column == '' || item.hide ? true : false"
>
<el-option
v-for="item in moreListOptions.logic"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="1" v-if="!item.hide">
<!-- 删除条件按钮 -->
<el-button
type="danger"
icon="el-icon-minus"
circle
size="mini"
@click="moreListDelete(index,item)"
></el-button>
</el-col>
</el-form-item>
</el-row>
</curren-Form>
<!-- 添加筛选条件 -->
<div class="moreListPush-btn">
<span @click="moreListPush">+ 添加筛选条件</span>
</div>
<!-- 按钮 -->
<div class="moreListBaseBts" v-if="moreListbuttons && moreListbuttons.length > 0" >
<el-button
v-for="(item,index) in moreListbuttons"
:key="index"
:type="item.type"
:size="item.size || 'medium'"
@click="moreListButtonHandle(item)"
:icon="item.iconRight ? '' : item.icon"
>
{{ item.label }}
<!-- 自定义右侧图标 -->
<i
style="margin-left:0"
v-if="item.iconRight"
:class="['el-icon--right',item.icon]"
></i>
</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
import searchPrimary from "@/components/searchPrimary"
export default {
name:'searchOverallComponent',
components: {
searchPrimary,
},
watch:{
//
showSearchOverall(n){
// +
//
if(this.primarySearchOption.length <= 0){
this.changeSearchOverallShow(n)
this.changeMoreListShow(n)
return
}
//
if(n){
this.changeSearchOverallShow(n)
this.changeMoreListShow(false)
}
this.$nextTick(()=>{
if(n){
this.componentsHeight = this.getSearchPrimaryHeight() + 20
}else{
this.componentsHeight = 0
this.changeMoreListShow(false)
// setTimeout(()=>{
// this.changeSearchOverallShow(n)
// },500)
}
})
this.setOverallSearchData(this.httpOverallSearchData)
},
//
httpOverallSearchData(n,o){
this.setOverallSearchData(n)
},
isShowMoreList(){
this.setOverallSearchData(this.httpOverallSearchData)
}
},
props: {
//
searchOverallCoverHeight:{
type: String,
default: 'calc(100vh - 200px)'
},
//
disabledAction:{
type: Boolean,
default: false
},
//
disabledLogic:{
type: Boolean,
default: false
},
//
showSearchOverall:{
type: Boolean,
default: false
},
//
showMoreSearch:{
type: Boolean,
default: true
},
//
primarySearchOption: {
type: Array,
default: () => {
return []
}
},
//
primarySearchButton:{
type: Array,
default: () => {
return []
}
},
//
tableColumns: {
type: Array,
default: () => {
return []
}
},
//
httpOverallSearchData:{
type: Object,
default: null
},
//
filterActionOptions:{
type: Array,
default: null
},
},
data() {
return {
// ()
primarySearchAllButton:[],
//
isShowMoreList:false,
//
componentsHeight:0,
// showSearchOverall
isShow:false,
//
moreListbuttons: [
{ label: "搜索", type: "primary", name: "moreList-search" },
{ label: '重置', name: 'moreList-reset' },
{ label:'收起筛选', name:'moreList-up', type: 'text', icon:'el-icon-arrow-up', iconRight:true}
],
// /
moreListData: {filters:[]},
//
moreListOptions: {
action: [{
value: '==',
label: '等于'
}, {
value: '!=',
label: '不等于'
}, {
value: '>',
label: '大于'
}, {
value: '<',
label: '小于'
}, {
value: '>=',
label: '大于等于'
}, {
value: '<=',
label: '小于等于'
}, {
value: 'Like',
label: '包含'
}, {
value: 'NotLike',
label: '不包含'
},
// {
// value: 'In',
// label: ''
// }, {
// value: 'NotIn',
// label: ''
// }
],
logic: [
{
value: 'And',
label: '并且'
},
{
value: 'Or',
label: '或者'
}
],
},
// rules使rules
// todo:columnvalue
rules:{
// column: [
// { required: true, message: '', trigger: 'change' }
// ],
// value: [
// { required: true, message: '', trigger: 'blur' }
// ],
},
}
},
created() {
this.moreListPush()
},
mounted() {
// ()
this.setPrimarySearchAllButton()
},
methods: {
// ,使
getSearchPrimaryHeight(){
return document.getElementsByClassName('searchPrimaryComponent')[0].clientHeight
},
//
setPrimarySearchAllButton(){
let _more_btn = [{
label:'高级筛选',
name:'more',
type: 'text',
icon:'el-icon-arrow-down',
iconRight:true
}]
if(this.showMoreSearch){
this.primarySearchAllButton = _more_btn.concat(this.primarySearchButton)
}else{
this.primarySearchAllButton= this.primarySearchButton
}
},
//
primarySearchBaseHandle(item,data, option, that){
this.overallSearchFormClick(item,data, option, that)
},
//
primarySearchButtonClick( item,data, option,that){
// []
if(item.name == 'more'){
this.changeMoreListShow(true)
}
this.overallSearchFormClick(item,data, option, that)
},
//
moreListButtonHandle(item){
this.overallSearchFormClick(item)
},
// moreListtableColumns
tableColumnsOptions(val) {
const data = JSON.parse(JSON.stringify(val));
let num = 0
val.forEach((item, index) => {
if (item.showProp) {
data.splice(index - num, 1)
num++
}
})
return data
},
//
getColumnType(val) {
var columnsType = this.tableColumns.filter(item => item.prop == val)
if (columnsType.length > 0) {
if (columnsType[0].type) {
return columnsType[0].type
}
} else {
return ''
}
},
//
resetSelect(val) {
val.action = "=="
val.value = ""
},
//
formatMoreListOptions(val) {
// filterActionOptions
if(this.filterActionOptions){
this.moreListOptions.action = this.filterActionOptions
return this.moreListOptions.action
}
if (val) {
for(var i =0; i< this.tableColumns.length; i++) {
if (val == this.tableColumns[i].prop) {
if (this.tableColumns[i].filters) {
return this.moreListOptions.action.filter(item => item.value == '==' || item.value == '!=')
} else if (this.tableColumns[i].type == 'dateTime') {
return this.moreListOptions.action.filter(item =>
item.value == '==' ||
item.value == '!=' ||
item.value == '>' ||
item.value == '<' ||
item.value == '>=' ||
item.value == '<=' )
} else {
return this.moreListOptions.action
}
}
}
}
return this.moreListOptions.action
},
// moreListinputselect
inputOrSelect(val) {
let data
if (val) {
this.tableColumns.forEach((key) => {
if (val == key.prop) {
if (key.filters) {
data = key
} else {
data = {}
}
}
})
} else {
data = {}
}
return data
},
// -
moreListDelete(val,item) {
if (this.moreListData.filters.length == 1) {
this.$warningMsg('必须保留一条筛选条件!')
} else {
this.$confirm('您确定删除吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.moreListData.filters.splice(val, 1)
}).catch(() => {
// this.modalAppendToBody = false
});
}
this.overallSearchFormClick({name:'moreList-deleteRow'})
},
// -
moreListPush() {
let data = {
logic: "And",
column: "",
action: "==",
value: ""
}
this.moreListData.filters.push(data)
this.overallSearchFormClick({name:'moreList-addRow'})
},
//
resetMoreListData(){
this.moreListData = {filters:[]}
this.moreListPush()
},
//
setMoreListData(val){
this.moreListData = JSON.parse(JSON.stringify(val))
},
// +
resetOverallSearchData(){
if(this.$refs.searchPrimaryRef)this.$refs.searchPrimaryRef.resetPrimarySearchData();
this.resetMoreListData()
},
// +
setOverallSearchData(data){
//
if(data && data.params){
if(this.$refs.searchPrimaryRef)this.$refs.searchPrimaryRef.setPrimarySearchData(data.params)
}else{
if(this.$refs.searchPrimaryRef)this.$refs.searchPrimaryRef.resetPrimarySearchData()
}
//
if(data && data.moreList){
let _list = {filters:[]}
data.moreList.filters.forEach(item=>{
if(String(item.column).length > 0 && String(item.value).length > 0){
_list.filters.push(item)
}
})
if(_list.filters.length <= 0){
_list.filters.push({
logic: "And",
column: "",
action: "==",
value: ""
})
}
this.setMoreListData(_list)
}else{
this.resetMoreListData()
}
},
// -
changeMoreListShow(val){
this.isShowMoreList = val || false
//
if(!this.primarySearchOption || this.primarySearchOption.length <= 0){
//
if(!this.isShowMoreList){
this.isShow = false
this.$emit("getShowSearchOverall",this.isShow)
}
}
},
//
changeSearchOverallShow(val){
if(!val){
this.changeMoreListShow(false)
}
this.isShow = val || false
this.$emit("getShowSearchOverall",this.isShow)
},
//
overallSearchFormClick(item,data, option) {
//
//
if(item.name == 'moreList-up'){
this.changeMoreListShow(false)
}
// - || -
else if(item.name == "moreList-reset" || item.name == "reset"){
this.resetOverallSearchData()
}
//
let _searchPrimaryRef = this.$refs.searchPrimaryRef
let _options = {
item:item,
data_primary:_searchPrimaryRef ? _searchPrimaryRef.getPrimarySearchData() : null,
data_moreList:this.moreListData,
option_primary:this.primarySearchOption,
option_moreList:this.tableColumns,
vm_primary:_searchPrimaryRef,
vm_moreList:this
}
this.$emit("overallSearchFormClick",_options)
},
}
}
</script>
<style lang="scss" scoped>
@import "./style/index.scss";
</style>

87
PC/UI.WinIn.FasterZ.Store/src/components/searchOverall/index.vue

@ -8,14 +8,15 @@
>
<div
class="border-outer"
ref="searchOverallComponent_inner"
>
<!-- 整体背景遮罩 -->
<div
<!-- <div
v-if="isShow && isShowMoreList"
class="fullPageCover"
:style="{height:searchOverallCoverHeight}"
></div>
<div class="title" v-if="isShowMoreList">高级筛选</div>
></div> -->
<!-- <div class="title" v-if="isShowMoreList">高级筛选</div> -->
<!-- 普通筛选界面 -->
<searchPrimary
v-if="primarySearchOption && primarySearchOption.length > 0"
@ -166,28 +167,42 @@
</el-form-item>
</el-row>
</curren-Form>
<!-- 添加筛选条件 -->
<div class="moreListPush-btn">
<span @click="moreListPush">+ 添加筛选条件</span>
</div>
<!-- 按钮 -->
<div class="moreListBaseBts" v-if="moreListbuttons && moreListbuttons.length > 0" >
<el-button
v-for="(item,index) in moreListbuttons"
:key="index"
:type="item.type"
:size="item.size || 'medium'"
@click="moreListButtonHandle(item)"
:icon="item.iconRight ? '' : item.icon"
>
{{ item.label }}
<!-- 自定义右侧图标 -->
<i
style="margin-left:0"
v-if="item.iconRight"
:class="['el-icon--right',item.icon]"
></i>
</el-button>
<div class="buttonsContent">
<div class="leftButtons">
<!-- 添加筛选条件 -->
<el-button size="small" @click="moreListPush(true)">+ 添加筛选条件</el-button>
<!-- 收起 -->
<el-button
type="text"
size="small"
@click="moreListButtonHandle({ label:'收起筛选', name:'moreList-up', type: 'text', icon:'el-icon-arrow-up', iconRight:true})"
>
收起筛选
<i
style="margin-left:0"
:class="['el-icon--right','el-icon-arrow-up']"
></i>
</el-button>
</div>
<!-- 按钮 -->
<div class="rightButtons" v-if="moreListbuttons && moreListbuttons.length > 0" >
<el-button
v-for="(item,index) in moreListbuttons"
:key="index"
:type="item.type"
:size="item.size || 'small'"
@click="moreListButtonHandle(item)"
:icon="item.iconRight ? '' : item.icon"
>
{{ item.label }}
<!-- 自定义右侧图标 -->
<i
style="margin-left:0"
v-if="item.iconRight"
:class="['el-icon--right',item.icon]"
></i>
</el-button>
</div>
</div>
</div>
</div>
@ -208,6 +223,13 @@ export default {
if(this.primarySearchOption.length <= 0){
this.changeSearchOverallShow(n)
this.changeMoreListShow(n)
this.$nextTick(()=>{
this.componentsHeight = this.getAllSearchInnerHeight() + 20
//
if(!n && this.$parent.changeTableHeight){
this.$parent.changeTableHeight()
}
})
return
}
//
@ -308,7 +330,7 @@ export default {
moreListbuttons: [
{ label: "搜索", type: "primary", name: "moreList-search" },
{ label: '重置', name: 'moreList-reset' },
{ label:'收起筛选', name:'moreList-up', type: 'text', icon:'el-icon-arrow-up', iconRight:true}
// { label:'', name:'moreList-up', type: 'text', icon:'el-icon-arrow-up', iconRight:true}
],
// /
moreListData: {filters:[]},
@ -382,6 +404,10 @@ export default {
getSearchPrimaryHeight(){
return document.getElementsByClassName('searchPrimaryComponent')[0].clientHeight
},
// ,使
getAllSearchInnerHeight(){
return this.$refs.searchOverallComponent_inner ? this.$refs.searchOverallComponent_inner.clientHeight : 0
},
//
setPrimarySearchAllButton(){
let _more_btn = [{
@ -505,7 +531,7 @@ export default {
this.overallSearchFormClick({name:'moreList-deleteRow'})
},
// -
moreListPush() {
moreListPush(handle) {
let data = {
logic: "And",
column: "",
@ -514,6 +540,12 @@ export default {
}
this.moreListData.filters.push(data)
this.overallSearchFormClick({name:'moreList-addRow'})
if(handle){
this.$nextTick(()=>{
this.componentsHeight = this.getAllSearchInnerHeight() + 20
this.$parent.changeTableHeight(this.getAllSearchInnerHeight())
})
}
},
//
resetMoreListData(){
@ -600,6 +632,7 @@ export default {
vm_primary:_searchPrimaryRef,
vm_moreList:this
}
console.log(101111111)
this.$emit("overallSearchFormClick",_options)
},
}

83
PC/UI.WinIn.FasterZ.Store/src/components/searchOverall/style/index copy.scss

@ -0,0 +1,83 @@
.searchOverallComponent{
height: 0;
transition:all 0.5s;
z-index: 1;
overflow: hidden;
.border-outer{
position: relative;
background: #f8f9fb;
padding: 10px 20px 0;
border: #eff0f2 solid 1px;
margin-bottom: 10px;
}
.fullPageCover{
position: absolute;
background: rgba(255, 255, 255, 0.2);
left: 0;
right: 0;
// height: calc(100vh - 200px);
cursor: no-drop;
}
.moreListOuter{
margin-top: 10px;
position: relative;
}
::v-deep .navFilter {
// display: flex;
// flex-direction: column;
// width: 100%;
// height: 100%;
max-height: 30vh;
overflow: auto;
.el-form {
// flex: 1;
// padding-left: 100px;
// padding-right: 100px;
display: flex;
align-content: flex-start;
flex-wrap: wrap;
overflow: hidden;
overflow-y: auto;
.el-row{
margin: 0 !important;
margin-left: -5px !important;
}
.el-select{
width: 100%;
}
}
}
.title{
padding: 10px 0 15px 0;
font-weight: bold;
color: #333;
}
.moreListPush-btn {
width: 100%;
padding-left: 5px;
color: rgb(64, 158, 255);
span {
cursor: pointer;
&:hover {
color: blue;
}
}
}
.moreListBaseBts{
padding: 20px 0;
}
}

36
PC/UI.WinIn.FasterZ.Store/src/components/searchOverall/style/index.scss

@ -31,7 +31,7 @@
// flex-direction: column;
// width: 100%;
// height: 100%;
max-height: 30vh;
max-height: 170px;
overflow: auto;
.el-form {
@ -62,22 +62,28 @@
color: #333;
}
.moreListPush-btn {
width: 100%;
padding-left: 5px;
color: rgb(64, 158, 255);
.buttonsContent{
justify-content: space-between;
display: flex;
padding-bottom: 20px;
width: 890px;
}
// .moreListPush-btn {
// width: 100%;
// padding-left: 5px;
// color: rgb(64, 158, 255);
span {
cursor: pointer;
// span {
// cursor: pointer;
&:hover {
color: blue;
}
}
}
// &:hover {
// color: blue;
// }
// }
// }
.moreListBaseBts{
padding: 20px 0;
}
// .moreListBaseBts{
// padding: 20px 0;
// }
}

402
PC/UI.WinIn.FasterZ.Store/src/components/tablePagination/index copy.vue

@ -0,0 +1,402 @@
<template>
<div class="tablePagination">
<!-- 头部按钮 -->
<div class="table-nav">
<curren-Button
ref="tablePagination_topNav"
:Butttondata="currenButtonData"
@tableButtonClick="topbutton"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:quicklySearchOption="quicklySearchOption"
>
</curren-Button>
<slot name="tableTopSlot"></slot>
</div>
<!-- 全面搜索普通+高级整合 -->
<searchOverall
ref="searchOverallRef"
:searchOverallCoverHeight="searchOverallCoverHeight"
:showSearchOverall="showSearchOverall"
@getShowSearchOverall="getShowSearchOverall"
:primarySearchOption="primarySearchOption"
:primarySearchButton="primarySearchButton"
:showMoreSearch="showMoreSearch"
:tableColumns="tableColumns"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
>
<!-- 插槽预留 -->
<slot name="searchPrimarySlot"></slot>
</searchOverall>
<!-- 字段设置弹窗 -->
<rowDrop
@radio="rowDrop"
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
:source="rowSource"
:innerMaxHeight="rowMaxHeight"
></rowDrop>
<!-- 列表 -->
<div class="uTableOuter" ref="uTableOuterRef" :style="{height:uTableOuterHeight + 'px',overflow:'hidden'}">
<umyTable
ref="tablePaginationTableRef"
:isUpdate="isUpdate"
:tableLoading="tableLoading"
:tableData="tableData"
:tableColumns="tableColumns | isTableColumns"
:isShowIndex="isShowIndex"
:selectionTable="tableSelection"
:setUTableHeight="setUTableHeight || uTableTopHeight"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
:buttonOperationList_left="buttonOperationList_left"
@buttonOperationClick_left="buttonOperationClick_left"
:buttonOperationList_right="buttonOperationList_right"
@buttonOperationClick_right="buttonOperationClick_right"
:tableBorder="true"
:firstFixed="true"
:cellStyle = "cellStyle"
:showOverflowTooltip="showOverflowTooltip"
>
<template>
<slot></slot>
</template>
</umyTable>
</div>
<!-- 页码 -->
<pagination
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
:currentPageProps="currentPageProps"
@SizeChange="alterResultCount"
@CurrentChange="alertoldSkipCount"
></pagination>
</div>
</template>
<script>
import currenButton from "@/components/currenButton"
import pagination from "@/components/Pagination"
import searchOverall from "@/components/searchOverall"
import rowDrop from "@/components/rowDrop/index.vue"
import { getParentNode } from '@/utils'
export default {
name: 'tablePagination',
components: {
pagination,
currenButton,
searchOverall,
rowDrop
},
props: {
rowMaxHeight:{
type:String,
default:'calc(90vh - 280px)'
},
//
searchOverallCoverHeight:{
type: String,
default: 'calc(100vh - 200px)'
},
// app-main100%
setUTableHeight: {
type: Number,
default: null
},
//
showOverflowTooltip:{
type: Boolean,
default: false,
},
//
quicklySearchOption:{
type: Object,
default: null
},
//
currenButtonData: {
type: Array,
default: () => {
return []
}
},
// ()
buttonOperationList_left:{
type: Array,
default: null,
},
// ()
buttonOperationList_right:{
type: Function,
default: null,
},
//
tableData: {
type: Array,
default: () => {
return []
}
},
// +
tableColumns: {
type: Array,
default: () => {
return []
}
},
//
tableSelection: {
type: Boolean,
default: false
},
// table
totalCount: {
type: Number,
default: 0
},
// tableloading
tableLoading: {
type: Boolean,
default: true
},
//
MaxResultCount: {
type: Number,
default: 0
},
//
currentPageProps: {
type: Number,
default: 1
},
//
isShowIndex: {
type: Boolean,
default: false,
},
//
multipleSelection: {
type: Array,
default: () => {
return []
}
},
//
//
primarySearchOption: {
type: Array,
default: () => {
return []
}
},
//
primarySearchButton: {
type: Array,
default: () => {
return []
}
},
//
showMoreSearch:{
type: Boolean,
default: true,
},
//
httpOverallSearchData:{
type: Object,
default: null
},
cellStyle: {
type: Function,
default: () => {
return Function;
}
},
// -
rowSource:{
type:String,
default:'list_api'
}
},
data () {
return {
//
rowDropVisible: false,
// table key
isUpdate: false,
// table
uTableTopHeight:165,
// table
uTableOuterHeight:null,
// table
uTableOuterHeight_init:null,
//table
Butttondata: [
{
type: 'danger',
icon: 'el-icon-delete',
label: '批量删除',
size: 'mini'
},
{
type: 'warning',
icon: 'el-icon-edit',
label: '批量修改状态',
size: 'mini'
},
{
type: 'success',
icon: 'el-icon-upload2',
label: '批量导出',
size: 'mini'
},
{
type: 'info',
icon: 'el-icon-printer',
label: '批量打印',
size: 'mini'
},
],
//
//
showSearchOverall:false,
}
},
mounted(){
this.uTableOuterHeight = this.$refs.tablePaginationTableRef.getTableHeight()
this.uTableOuterHeight_init = Number(JSON.stringify(this.uTableOuterHeight))
//
document.addEventListener('click',(e)=>{
if(!this.rowDropVisible)return
let _class = "rowDropNotHideItem"
let _hasParent = getParentNode(e.target,_class)
let _current_class = e.target._prevClass || e.target.className
let _hasCurrent = _current_class ? String(_current_class).includes(_class) : false
if(!_hasParent && !_hasCurrent){
this.closeRowDrop()
}
})
},
methods: {
rowDrop(data,type) {
this.$emit('rowDrop',data,type)
this.$nextTick(()=>{
this.isUpdate = !this.isUpdate
})
},
//
topbutton (val,item) {
// + table +
if(val=="filter"){
this.showSearchOverall = !this.showSearchOverall
//
if(this.primarySearchOption && this.primarySearchOption.length > 0){
this.$nextTick(()=>{
let _search_height = this.$refs.searchOverallRef.getSearchPrimaryHeight()
if(this.showSearchOverall){
let _margin = 20
this.uTableOuterHeight = this.uTableOuterHeight_init - _search_height - _margin
setTimeout(()=>{
this.uTableTopHeight += _search_height + _margin
},0)
}else{
this.uTableOuterHeight = this.uTableOuterHeight_init
setTimeout(()=>{
this.uTableTopHeight = 165
},0)
}
})
}
}
//
else if (val == 'field') {
this.rowDropVisible = !this.rowDropVisible
}
this.$emit("topbutton", val,item)
},
// -
quicklySearchClick (val,option) {
this.$emit("quicklySearchClick", val,option,this.$refs.searchOverallRef)
},
// -
quicklySearchClear (val,option) {
//
let hasSearch = false
this.currenButtonData.forEach(item=>{
if(item.name == 'filter'){
hasSearch = true
return
}
})
this.$emit("quicklySearchClear", val,option,this.$refs.searchOverallRef,hasSearch )
},
//emit
alterResultCount (val) {
this.$emit('alterResultCount', val)
},
//emit
alertoldSkipCount (val) {
this.$emit('alertoldSkipCount', val)
},
//nameemit
inlineDialog (row) {
this.$emit("inlineDialog", row)
},
//selection
handleSelectionChange (val) {
this.$emit("handleSelectionChange", val)
},
//
sortChange (data) {
this.$emit('sortChange', data)
},
//table()
buttonOperationClick_left(row, item, index) {
this.$emit("buttonOperationClick_left", row, item, index);
},
//table()
buttonOperationClick_right(row, item, index) {
this.$emit("buttonOperationClick_right", row, item, index);
},
//
// /showSearchOverall
getShowSearchOverall(val){
this.showSearchOverall = val || false
},
//
overallSearchFormClick(options){
//
options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
this.$emit("overallSearchFormClick", options)
},
//
closeRowDrop() {
this.rowDropVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.uTableOuter{
transition:all 0.5s;
overflow: hidden;
}
.tablePagination {
width: 100%;
height: 100%;
background-color: #fff;
display: flex;
flex-direction: column;
.table-nav {
padding-bottom: 15px;
}
.el-table {
flex: 1;
}
}
</style>

51
PC/UI.WinIn.FasterZ.Store/src/components/tablePagination/index.vue

@ -296,27 +296,47 @@ export default {
if(this.primarySearchOption && this.primarySearchOption.length > 0){
this.$nextTick(()=>{
let _search_height = this.$refs.searchOverallRef.getSearchPrimaryHeight()
if(this.showSearchOverall){
let _margin = 20
this.uTableOuterHeight = this.uTableOuterHeight_init - _search_height - _margin
setTimeout(()=>{
this.uTableTopHeight += _search_height + _margin
},0)
}else{
this.uTableOuterHeight = this.uTableOuterHeight_init
setTimeout(()=>{
this.uTableTopHeight = 165
},0)
}
this.changeTableHeight(_search_height)
// if(this.showSearchOverall){
// let _margin = 20
// this.uTableOuterHeight = this.uTableOuterHeight_init - _search_height - _margin
// setTimeout(()=>{
// this.uTableTopHeight += _search_height + _margin
// },0)
// }else{
// this.uTableOuterHeight = this.uTableOuterHeight_init
// setTimeout(()=>{
// this.uTableTopHeight = 165
// },0)
// }
})
}
}
this.$nextTick(()=>{
let _search_height = this.$refs.searchOverallRef.getAllSearchInnerHeight()
this.changeTableHeight(_search_height)
})
}
//
else if (val == 'field') {
this.rowDropVisible = !this.rowDropVisible
}
this.$emit("topbutton", val,item)
},
// table
changeTableHeight(minusHeight=0){
if(this.showSearchOverall){
let _margin = 20
this.uTableOuterHeight = this.uTableOuterHeight_init - minusHeight - _margin
setTimeout(()=>{
this.uTableTopHeight = minusHeight + 165 + _margin
},0)
}else{
this.uTableOuterHeight = this.uTableOuterHeight_init
setTimeout(()=>{
this.uTableTopHeight = 165
},0)
}
},
// -
quicklySearchClick (val,option) {
this.$emit("quicklySearchClick", val,option,this.$refs.searchOverallRef)
@ -354,8 +374,8 @@ export default {
this.$emit('sortChange', data)
},
//table()
buttonOperationClick_left(row, index, label) {
this.$emit("buttonOperationClick_left", row, index, label);
buttonOperationClick_left(row, item, index) {
this.$emit("buttonOperationClick_left", row, item, index);
},
//table()
buttonOperationClick_right(row, item, index) {
@ -370,6 +390,7 @@ export default {
overallSearchFormClick(options){
//
options.vm_quickly = this.$refs.tablePagination_topNav.getQuicklySearchDom()
console.log(22222,options)
this.$emit("overallSearchFormClick", options)
},
//

8
PC/UI.WinIn.FasterZ.Store/src/components/umyTable/index.vue

@ -640,9 +640,11 @@ export default {
//
initApiEnumList(item,data){
let _item_enumList = {}
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
if(item.enums_list){
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
}
return _item_enumList[data] || '未定义'
},
// | | json

Loading…
Cancel
Save