Browse Source

明细添加字段设置功能

master
安虹睿 1 year ago
parent
commit
b5ab349b8f
  1. 12
      Code/Fe/src/components/filterForDetailPage/index.vue
  2. 14
      Code/Fe/src/components/tablePagination/index.vue
  3. 3
      Code/Fe/src/mixins/TableHeaderMixins.js
  4. 11
      Code/Fe/src/mixins/TableMixins.js
  5. 9
      Code/Fe/src/utils/detailsPageColumns_api/index.js
  6. 13
      Code/Fe/src/views/interfaceBoard/TestSchool.vue

12
Code/Fe/src/components/filterForDetailPage/index.vue

@ -20,6 +20,8 @@
:currenButtonData="currenButtonData" :currenButtonData="currenButtonData"
:tableData="tableData" :tableData="tableData"
:tableLoading="Loading.tableLoading" :tableLoading="Loading.tableLoading"
@rowDrop="rowDropForDetail"
:rowSource="'detailPage_api'"
:tableColumns="listColumns" :tableColumns="listColumns"
:totalCount="totalCount" :totalCount="totalCount"
:multipleSelection="multipleSelection" :multipleSelection="multipleSelection"
@ -46,7 +48,7 @@
label="操作" label="操作"
:align="'center'" :align="'center'"
width="150" width="150"
fixed="right" fixed="left"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="item in operaButtons" style="margin: 0 10px;"> <span v-for="item in operaButtons" style="margin: 0 10px;">
@ -181,7 +183,9 @@ props: {
showHandleButtons:{ showHandleButtons:{
type:Array, type:Array,
default:() => { default:() => {
return ['showParent','fresh','filter'];//'add','edit' 'delete' //'add','edit' 'delete'
// showParentfreshfilterfield
return ['showParent','fresh','filter','field'];
} }
}, },
// 2 // 2
@ -215,6 +219,9 @@ mounted(){
this.initHandleButtons() this.initHandleButtons()
}, },
methods: { methods: {
rowDropForDetail(data,type){
this.$emit("rowDropForDetail", data,type)
},
// //
initHandleButtons(){ initHandleButtons(){
// //
@ -222,6 +229,7 @@ methods: {
if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())} if(this.showHandleButtons.indexOf('add') >= 0){_arr_header.push(this.defaultAddBtn())}
if(this.showHandleButtons.indexOf('fresh') >= 0){_arr_header.push(this.defaultFreshBtn())} if(this.showHandleButtons.indexOf('fresh') >= 0){_arr_header.push(this.defaultFreshBtn())}
if(this.showHandleButtons.indexOf('filter') >= 0){_arr_header.push(this.defaultFilterBtn())} if(this.showHandleButtons.indexOf('filter') >= 0){_arr_header.push(this.defaultFilterBtn())}
if(this.showHandleButtons.indexOf('field') >= 0){_arr_header.push(this.defaultFieldSettingBtn())}
this.currenButtonData = _arr_header this.currenButtonData = _arr_header
// //

14
Code/Fe/src/components/tablePagination/index.vue

@ -34,6 +34,7 @@
:tableColumns="tableColumns" :tableColumns="tableColumns"
:visible="rowDropVisible" :visible="rowDropVisible"
@closeRowDrop="closeRowDrop" @closeRowDrop="closeRowDrop"
:source="rowSource"
></rowDrop> ></rowDrop>
<!-- 列表 --> <!-- 列表 -->
<div class="uTableOuter" ref="uTableOuterRef" :style="{height:uTableOuterHeight + 'px',overflow:'hidden'}"> <div class="uTableOuter" ref="uTableOuterRef" :style="{height:uTableOuterHeight + 'px',overflow:'hidden'}">
@ -194,6 +195,11 @@ export default {
default: () => { default: () => {
return Function; return Function;
} }
},
// -
rowSource:{
type:String,
default:'list_api'
} }
}, },
data () { data () {
@ -257,9 +263,11 @@ export default {
}) })
}, },
methods: { methods: {
rowDrop(data) { rowDrop(data,type) {
this.$emit('rowDrop',data) this.$emit('rowDrop',data,type)
this.isUpdate = !this.isUpdate this.$nextTick(()=>{
this.isUpdate = !this.isUpdate
})
}, },
// //
topbutton (val,item) { topbutton (val,item) {

3
Code/Fe/src/mixins/TableHeaderMixins.js

@ -301,12 +301,13 @@ export const TableHeaderMixins = {
* 表头字段设置 * 表头字段设置
* @param {*} data 数据 * @param {*} data 数据
* @param {*} type 设置来源 * @param {*} type 设置来源
* list_api: 表头来自api的列表 detail_api: 表头来自api列表的明细 * list_api: 表头来自api的列表 detail_api: 表头来自api列表的明细 detailPage_api表头来自api的明细页面列表
* list: 表头固定的列表 detail: 表头固定列表的明细 * list: 表头固定的列表 detail: 表头固定列表的明细
*/ */
rowDrop(data,type) { rowDrop(data,type) {
if(!type || type == 'list_api'){ this.apiColumns_Table = data } if(!type || type == 'list_api'){ this.apiColumns_Table = data }
if(type && type == 'detail_api'){ this.apiColumns_DetailsTable = data } if(type && type == 'detail_api'){ this.apiColumns_DetailsTable = data }
if(type && type == 'detailPage_api'){ this.apiColumns_DetailsPage = data }
if(type && type == 'list'){ this.tableColumns = data } if(type && type == 'list'){ this.tableColumns = data }
if(type && type == 'detail'){ this.detailsTableColumns = data } if(type && type == 'detail'){ this.detailsTableColumns = data }
} }

11
Code/Fe/src/mixins/TableMixins.js

@ -42,6 +42,7 @@ export const tableMixins = {
apiColumns_Table:null, apiColumns_Table:null,
apiColumns_DesTions:null, apiColumns_DesTions:null,
apiColumns_DetailsTable:null, apiColumns_DetailsTable:null,
apiColumns_DetailsPage:null,
//主表-列表 //主表-列表
URLOption_base:allUrlOption[this.$route.name].baseURL, URLOption_base:allUrlOption[this.$route.name].baseURL,
//主表-明细 //主表-明细
@ -54,12 +55,12 @@ export const tableMixins = {
}, },
methods: { methods: {
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题 // 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api){ initApiColumns(table,des,detailsTable,detailsPage){
// 赋值表头数据 // 赋值表头数据
this.apiColumns_Table = this.initTableColumns(tableColumns_api[this.$route.name]) this.apiColumns_Table = this.initTableColumns(table[this.$route.name])
this.apiColumns_DesTions = tabsDesTions_api[this.$route.name] this.apiColumns_DesTions = des[this.$route.name]
this.apiColumns_DetailsTable = this.initTableColumns(detailsTableColumns_api[this.$route.name],'detail_api') this.apiColumns_DetailsTable = this.initTableColumns(detailsTable[this.$route.name],'detail_api')
this.apiColumns_DetailsPage = this.initTableColumns(detailsPage[this.$route.name],'detailPage_api')
}, },
//渲染数据 //渲染数据
paging(callback) { paging(callback) {

9
Code/Fe/src/utils/detailsPageColumns_api/index.js

@ -0,0 +1,9 @@
// 此文件为【明细 - 列表】表头从接口缓存的表头
import { initFromApiColumnsLable } from '@/utils/index'
// 测试数据
export const TestSchool = [
{ label: initFromApiColumnsLable('TestStudentDetailStudentName'), prop: "studentName" },
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
]

13
Code/Fe/src/views/interfaceBoard/TestSchool.vue

@ -66,8 +66,9 @@
></newAndEdiDialog> ></newAndEdiDialog>
<!-- 明细查询页面 --> <!-- 明细查询页面 -->
<filterForDetailPage <filterForDetailPage
v-if="filterForDetailShow" @rowDropForDetail="rowDrop"
:listColumns="apiColumns_DetailsTable" v-if="filterForDetailShow && apiColumns_DetailsPage"
:listColumns="apiColumns_DetailsPage"
:parentColumns="apiColumns_Table" :parentColumns="apiColumns_Table"
@closeDialog="changeFilterForDetailShow" @closeDialog="changeFilterForDetailShow"
></filterForDetailPage> ></filterForDetailPage>
@ -92,8 +93,8 @@ import { filterSelectMixins } from '@/mixins/filter-Select'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import * as tableColumns_api from "@/utils/tableColumns_api/index" // import * as tableColumns_api from "@/utils/tableColumns_api/index" //
import * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" // import * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" //
import * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" // import * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" //-
import * as detailsPageColumns_api from "@/utils/detailsPageColumns_api/index" //
export default { export default {
name: "TestSchool", name: "TestSchool",
@ -127,8 +128,6 @@ export default {
this.defaultFilterBtn(),// this.defaultFilterBtn(),//
this.defaultFilterForDetailBtn()// this.defaultFilterForDetailBtn()//
], ],
//
filterForDetailShow:false,
// //
CreateFormData: { CreateFormData: {
schoolName:null, schoolName:null,
@ -176,7 +175,7 @@ export default {
}; };
}, },
mounted() { mounted() {
this.initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api) this.initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api,detailsPageColumns_api)
this.paging(); this.paging();
}, },
} }

Loading…
Cancel
Save