Browse Source

主表带字段版本暂存

master
安虹睿 1 year ago
parent
commit
0b8fbab1db
  1. 3
      Code/Fe/public/config.js
  2. 4
      Code/Fe/src/api/wms-interface.js
  3. 559
      Code/Fe/src/components/commonTabel-drawer copy/index.vue
  4. 122
      Code/Fe/src/components/commonTabel-drawer copy/style/index.scss
  5. 30
      Code/Fe/src/components/commonTabel-drawer/index.vue
  6. 7
      Code/Fe/src/components/filterForDetailPage/index.vue
  7. 31
      Code/Fe/src/components/rowDrop/index.vue
  8. 10
      Code/Fe/src/components/tablePagination/index.vue
  9. 45
      Code/Fe/src/components/umyTable/index.vue
  10. 45
      Code/Fe/src/mixins/TableMixins.js
  11. 6
      Code/Fe/src/mixins/mixins.js
  12. 36
      Code/Fe/src/permission.js
  13. 2
      Code/Fe/src/utils/baseData/urlOption.js
  14. 2
      Code/Fe/src/utils/defaultButtons.js
  15. 2
      Code/Fe/src/utils/tableColumns_api/index.js
  16. 2
      Code/Fe/src/views/dashboard/index.vue
  17. 13
      Code/Fe/src/views/interfaceBoard/TestSchool.vue

3
Code/Fe/public/config.js

@ -1,6 +1,7 @@
// dev_win // dev_win
window.SITE_CONFIG['base'] = 'http://dev.ccwin-in.com:60069' window.SITE_CONFIG['base'] = 'http://dev.ccwin-in.com:60069'
window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-configuration' window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-localization'
// window.SITE_CONFIG['columnsApiNames'] = '/api/abp/application-configuration'
window.SITE_CONFIG['columnsApiNamesZh'] = 'Winin' window.SITE_CONFIG['columnsApiNamesZh'] = 'Winin'
window.SITE_CONFIG['isAutoLogin'] = false window.SITE_CONFIG['isAutoLogin'] = false
window.SITE_CONFIG['isSinglePage'] = false window.SITE_CONFIG['isSinglePage'] = false

4
Code/Fe/src/api/wms-interface.js

@ -7,7 +7,9 @@ let colum_url = localStorage.getItem('columnsApiNames')
export function getInterfaceBoard() { export function getInterfaceBoard() {
return request({ return request({
method:'get', method:'get',
url: base_api + colum_url url: base_api + colum_url,
params:{CultureName:'zh-Hans'}
// params:{IncludeLocalizationResources:true}
}) })
} }

559
Code/Fe/src/components/commonTabel-drawer copy/index.vue

@ -0,0 +1,559 @@
<template>
<el-drawer
v-loading="DrawerLoading"
v-if="drawer"
:visible="true"
:close-on-press-escape="false"
:wrapperClosable="false"
:with-header="false"
:modal="false"
size="100%"
>
<div class="drawer-heder">
<div class="heder-left">
<!-- <div class="heder-img">
<img
src="@/assets/img/drawerHeader.png"
alt=""
style="width: 100%; height: 100%"
/>
</div> -->
<div class="header-text">
<span>{{ propsData[title[0].prop] }}</span>
<span>{{ title[0].label }}</span>
</div>
</div>
<div class="heder-right">
<curren-Button
:Butttondata="Butttondata"
@tableButtonClick="tableButtonClick"
>
<template>
<el-dropdown
trigger="click"
@command="handleCommand"
v-if="JSON.stringify(dropdownData) != '{}'"
>
<el-button size="mini" icon="el-icon-more"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(item, index) in dropdownData"
:key="index"
:command="item.command"
>{{ item.label }}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</template>
</curren-Button>
</div>
</div>
<div class="drawer-main">
<curren-tabs
:tabsData="dropdownTabs"
:activeName="firstTabs"
type="border-card"
@handleClick="handleClick"
>
<template slot-scope="scope">
<curren-descriptions
border
v-if="scope.value == 'xq'"
:column="column"
:direction="direction"
:colon="false"
:tabsDesTions="tabsDesTions"
:propsData="propsData"
>
</curren-descriptions>
<!-- currenTableDetails 组件 明细中带分页功能 -->
<umyTable
v-if="scope.value == 'mx'"
:tableBorder="true"
:tableData="propsData.details"
:propsData="propsData"
:tableColumns="tableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
:setUTableHeight="260"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 明细页码 -->
<pagination
v-if="scope.value == 'mx'"
:totalCount="totalCount"
:pagesizeProps="MaxResultCount"
@SizeChange="alterResultCountDetails"
@CurrentChange="alertoldSkipCountDetails"
:currentPageProps="currentPage"
></pagination>
<!-- 新增汇总 表头 区分明细表头使用 summaryTableColumns -->
<umyTable
v-if="scope.value == 'hz'"
:tableBorder="true"
:tableData="propsData.summaryDetails"
:tableColumns="summaryTableColumns.length == 0 ? tableColumns : summaryTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:setUTableHeight="210"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展 -->
<umyTable
v-if="
scope.value == zdyValue &&
scope.value != 'xq' &&
scope.value != 'mx' &&
scope.value != 'hz' &&
scope.value != 'zwlcj'
"
:tableBorder="true"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
@buttonClick="buttonClick"
:setUTableHeight="210"
>
<template>
<slot></slot>
</template>
</umyTable>
<!-- 自定义扩展tree的形式 目前使用位置物品清单信息-子物品层级 todo:待优化-->
<currenTable
v-if="
scope.value == zdyValue &&
scope.value == 'zwlcj'
"
:tableLoading="tableLoading"
:tableData="otherData"
:tableColumns="zdyTableColumns"
:selectionTable="selectionTable"
:requiredRules="false"
@sortChange="sortChange"
@handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog"
:treeProps="{children: 'children', hasChildren: 'hasChildren'}"
@buttonClick="buttonClick"
>
<template>
<slot></slot>
</template>
</currenTable>
</template>
</curren-tabs>
</div>
<div class="drawer-Shut" @click="drawerShut">
<el-button type="danger" size="mini">关闭</el-button>
</div>
</el-drawer>
</template>
<script>
import { getListByItemcode,byItem,byProduct,byComponent,bySupplierCode,byLocation,byLocationCode,
relationByLocationCode,byComponentCJ,purRecNoteCustomInfo,EnumPurchaseReceiptInspect
} from "@/api/wms-api"
import currenButton from "@/components/currenButton"
import currenDescriptions from "@/components/currenDescriptions"
import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination"
export default {
name: 'currenTabel-drawer',
components: {
pagination,
currenButton,
currenDescriptions,
currenTabs,
currenTable,
},
props: {
title: {
type: Array,
default: () => {
return []
}
},
DrawerLoading: {
type: Boolean,
default: true
},
drawer: {
type: Boolean,
default: false
},
dropdownData: {
type: Object,
default: () => {
return {}
}
},
propsData: {
type: Object,
default: () => {
return {}
}
},
tabsDesTions: {
type: Array,
default: () => {
return []
}
},
dropdownTabsData: {
type: Array,
default: () => {
return []
}
},
tableLoading: {
type: Boolean,
default: false
},
tableColumns: {
type: Array,
default: () => {
return []
}
},
summaryTableColumns: {
type: Array,
default: () => {
return []
}
},
Butttondata: {
type: Array,
default: () => {
return [{
type: 'warning',
icon: 'el-icon-edit',
label: '编辑',
name: 'edit',
size: 'mini'
}]
}
},
selectionTable: {
type: Boolean,
default: false
},
MaxResultCount: {
type: Number,
default: 0
},
totalCount: {
type: Number,
default: 0
},
currentPage: {
type: Number,
default: 0
},
// 2
column: {
type: Number,
default: 2
},
//
direction: {
type: String,
default: 'horizontal'
},
// tabs
firstTabs: {
type: String,
default: 'xq'
}
},
computed: {
dropdownTabs () {
// tabs
if (this.dropdownTabsData.length !== 0) {
return this.dropdownTabsData
} else {
//
if (Object.keys(this.propsData).length != 0) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
},
{
label: "汇总",
name: 'hz'
}]
if (this.propsData.details == undefined || !this.propsData.details.length) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
}]
return this.initDropdownTabsData
}
if (this.propsData.summaryDetails == undefined || !this.propsData.summaryDetails.length ) {
this.initDropdownTabsData = [{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
}]
return this.initDropdownTabsData
}
}
return this.initDropdownTabsData
}
},
},
mounted () {
},
data () {
return {
otherData:[], // tabs
zdyTableColumns:[], //
zdyValue:'', //
// firstTabs:'xq',
initDropdownTabsData:[
{
label: "详情",
name: 'xq'
},
{
label: "明细",
name: 'mx'
},
{
label: "汇总",
name: 'hz'
}
]
}
},
methods: {
handleCommand (command) {
this.$emit('handleCommand', command)
},
drawerShut () {
this.$emit('drawerShut', false)
},
tableButtonClick (val) {
this.$emit('drawerbutton', val)
},
//
sortChange (data) {
this.$emit('sortChange', data)
},
//selection
handleSelectionChange (val) {
this.$emit("handleSelectionChange", val)
},
//nameemit
inlineDialog (row) {
this.$emit("inlineDialog", row)
},
//emit
alterResultCountDetails (val) {
this.$emit('alterResultCountDetails', val)
},
//emit
alertoldSkipCountDetails (val) {
this.$emit('alertoldSkipCountDetails', val)
},
buttonClick(row) {
this.$emit("buttonClick", row);
},
// tabs
handleClick (val) {
this.$emit("currenTabsChange", val);//tab
this.zdyValue = val.name
this.dropdownTabsData.forEach( item => {
if (item.name == val.name) {
let parent = this.$parent
parent.tableLoading = true
//
parent.firstTabs = val.name
if (val.name == 'xq' || val.name == 'mx' || val.name == 'hz') {
this.zdyTableColumns = []
this.otherData = []
parent.tableLoading = false
} else {
this.zdyTableColumns = []
this.otherData = []
// this.firstTabs = val.name
// tab
if (item.functionName == 'getListByItemcode') {
let params = {
itemCode: this.propsData.code
}
getListByItemcode(params, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byItem') {
byItem(this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byProduct') {
byProduct({product:this.propsData.product}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byComponent') {
byComponent({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ----
else if (item.functionName == 'byComponentCJ') {
this.otherData = []
byComponentCJ({component:this.propsData.component}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.recursion(this.otherData)
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'bySupplierCode') {
bySupplierCode({supplierCode:this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocation') {
byLocation(this.propsData.code==null?this.propsData.locationCode:this.propsData.code, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
this.o
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
} else if (item.functionName == 'byLocationCode') {
byLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let itemData = []
itemData.push(res)
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = itemData
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// ---
else if (item.functionName == 'relationByLocationCode') {
relationByLocationCode({locationCode: this.propsData.code}, item.url).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.tableLoading = false
}).catch(err => {
console.log(err)
parent.tableLoading = false
})
}
// -, ,
else if(item.functionName == "purRecNoteCustomInfo"){
parent.Loading.DrawerLoading = true
purRecNoteCustomInfo( item.url,this.propsData.id).then(res => {
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = res
parent.Loading.DrawerLoading = false
}).catch(err => {
console.log(err)
parent.Loading.DrawerLoading = false
})
}
// 退-TAB-
else if(item.functionName == "customerDismantleBackFlushNote"){
let zdyTableColumnsJSON = JSON.parse(JSON.stringify(this.$isTableColumns[item.tableColumns]));
delete zdyTableColumnsJSON[0].type
this.zdyTableColumns = zdyTableColumnsJSON
this.otherData = this.propsData.noteAndBackFlushDetails
}
}
}
})
},
//
recursion(val){
val.forEach(item => {
if(item.componentDTOs) {
item.children = item.componentDTOs
this.recursion(item.componentDTOs)
}
})
}
}
}
</script>
<style lang="scss" scoped>
// el-drawer
@import "./style/index.scss";
</style>

122
Code/Fe/src/components/commonTabel-drawer copy/style/index.scss

@ -0,0 +1,122 @@
.el-drawer__wrapper {
z-index: 10 !important;
position: absolute;
left: 32%;
overflow: visible;
// height:calc(100% - 28px);
// top: 14px;
// right:14px
::v-deep .el-drawer {
height: 100%;
overflow: visible;
box-shadow: 0 8px 10px -5px rgb(0 0 0 / 15%), 0 16px 24px 2px rgb(0 0 0 / 9%), 0 6px 30px 5px rgb(0 0 0 / 7%);
.el-drawer__body {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.drawer-heder {
display: flex;
padding: 15px 10px;
justify-content: space-between;
align-items: center;
.heder-left {
display: flex;
justify-content: space-between;
.heder-img {
width: 40px;
height: 40px;
margin-right: 10px;
}
.header-text {
padding:0 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
span:nth-child(1) {
color: #333;
font-size: 22px;
}
span:nth-child(2) {
color: #999;
font-size: 16px;
}
}
}
}
.Descriptions {
padding: 0 10px;
}
.drawer-main {
// padding-top: 20px;
flex: 1;
overflow: hidden;
// background-color: #efefef;
padding: 10px 20px 20px 30px;
border-top: solid 5px #f6f6f6;
.el-tabs {
height: 100%;
display: flex;
flex-direction: column;
.el-tabs__header{
// padding-bottom: 5px ;
.el-tabs__nav{
z-index: auto !important;
}
}
.el-tabs__content {
flex: 1;
.el-tab-pane {
width: 100%;
height: 100%;
overflow-y: auto;
}
.el-descriptions-item__label {
padding-right: 40px;
}
}
}
}
.drawer-Shut {
width: 35px;
height: 100px;
position: absolute;
top: 200px;
left: -35px;
.el-button {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
::v-deep span {
font-size: 12px;
letter-spacing: 10px;
writing-mode: tb-rl;
}
}
}
}
}
}
::v-deep .el-tabs__nav-wrap::after{
content: unset !important;
}

30
Code/Fe/src/components/commonTabel-drawer/index.vue

@ -66,7 +66,20 @@
:propsData="propsData" :propsData="propsData"
> >
</curren-descriptions> </curren-descriptions>
<rowDrop
@radio="rowDrop"
:tableColumns="tableColumns"
:visible="rowDropVisible"
@closeRowDrop="closeRowDrop"
></rowDrop>
<!-- currenTableDetails 组件 明细中带分页功能 --> <!-- currenTableDetails 组件 明细中带分页功能 -->
<!-- 字段设置弹窗 -->
<!-- <div
class="mx-header"
v-if="scope.value == 'mx'"
>
<el-button @click="columnsSettingHandle()">字段设置</el-button>
</div> -->
<umyTable <umyTable
v-if="scope.value == 'mx'" v-if="scope.value == 'mx'"
:tableBorder="true" :tableBorder="true"
@ -175,6 +188,7 @@ import currenDescriptions from "@/components/currenDescriptions"
import currenTabs from "@/components/currenTabs" import currenTabs from "@/components/currenTabs"
import currenTable from "@/components/currenTable" import currenTable from "@/components/currenTable"
import pagination from "@/components/Pagination" import pagination from "@/components/Pagination"
import rowDrop from "@/components/rowDrop/index.vue"
export default { export default {
name: 'currenTabel-drawer', name: 'currenTabel-drawer',
components: { components: {
@ -183,6 +197,7 @@ export default {
currenDescriptions, currenDescriptions,
currenTabs, currenTabs,
currenTable, currenTable,
rowDrop
}, },
props: { props: {
title: { title: {
@ -331,6 +346,8 @@ export default {
}, },
data () { data () {
return { return {
// -
rowDropVisible: false,
otherData:[], // tabs otherData:[], // tabs
zdyTableColumns:[], // zdyTableColumns:[], //
zdyValue:'', // zdyValue:'', //
@ -352,7 +369,18 @@ export default {
} }
}, },
methods: { methods: {
rowDrop(data) {
this.$emit('rowDrop',data)
// this.isUpdate = !this.isUpdate
},
//
columnsSettingHandle(){
this.rowDropVisible = !this.rowDropVisible
},
//
closeRowDrop() {
this.rowDropVisible = false
},
handleCommand (command) { handleCommand (command) {
this.$emit('handleCommand', command) this.$emit('handleCommand', command)
}, },

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

@ -46,6 +46,7 @@
label="操作" label="操作"
:align="'center'" :align="'center'"
width="150" width="150"
fixed="right"
> >
<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;">
@ -198,6 +199,8 @@ data () {
return { return {
dialogShow:true, dialogShow:true,
URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//- URLOption_detailList:allUrlOption[this.$route.name].detailListURL,//-
URLOption_masterId:allUrlOption[this.$route.name].masterId || 'masterId',//-id
URLOption_masterName:allUrlOption[this.$route.name].masterName,//-//-title
URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//- URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,//-
currenButtonData: [],// currenButtonData: [],//
operaButtons:[],// operaButtons:[],//
@ -256,10 +259,10 @@ methods: {
}, },
// //
showParentHandleForDetail(data){ showParentHandleForDetail(data){
this.showParentTitle = `[${data.studentName}] 主表信息` this.showParentTitle = `${data[this.URLOption_masterName]} 主表信息`
this.showParentDialog = true this.showParentDialog = true
this.showParentLoading = true this.showParentLoading = true
getListDesById(this.URLOption_parent,data.masterId) getListDesById(this.URLOption_parent,data[this.URLOption_masterId])
.then(res => { .then(res => {
this.showParentTableData = res this.showParentTableData = res
this.showParentLoading = false this.showParentLoading = false

31
Code/Fe/src/components/rowDrop/index.vue

@ -54,12 +54,14 @@ export default {
}, },
data() { data() {
return { return {
historyTableColumns:null,
name: null, name: null,
oldData: null, oldData: null,
newData: null, newData: null,
dataList: [], dataList: [],
// allSelect hasSelect NoSelect // allSelect hasSelect NoSelect
allSeletType:'NoSelect', allSeletType:'NoSelect',
userName:JSON.parse(localStorage.getItem('currentUserInfo')).userName
} }
}, },
props: { props: {
@ -77,8 +79,9 @@ export default {
}, },
}, },
mounted() { mounted() {
this.formatData(this.tableColumns) this.historyTableColumns = JSON.parse(JSON.stringify(this.tableColumns))
this.initSelectSta() this.formatData(this.tableColumns)
this.initSelectSta()
}, },
methods: { methods: {
reset() { reset() {
@ -88,10 +91,11 @@ export default {
type: 'warning', type: 'warning',
cancelButtonClass:'rowDropNotHideItem' cancelButtonClass:'rowDropNotHideItem'
}).then(() => { }).then(() => {
// set // set this.$store.getters.name.userName
localStorage.setItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name, JSON.stringify([])) localStorage.setItem('tableColumns_' + this.userName + '_' + this.$route.name, JSON.stringify([]))
localStorage.removeItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name) localStorage.removeItem('tableColumns_' + this.userName + '_' + this.$route.name)
let _resetCol = this.$isTableColumns[this.$route.name] // let _resetCol = this.$isTableColumns[this.$route.name]
let _resetCol = this.historyTableColumns
_resetCol.forEach(item => { _resetCol.forEach(item => {
item.istrue = true item.istrue = true
}) })
@ -110,16 +114,16 @@ export default {
formatData (val) { formatData (val) {
this.dataList = JSON.parse(JSON.stringify(val)) this.dataList = JSON.parse(JSON.stringify(val))
this.dataList.forEach(item => { this.dataList.forEach(item => {
if (item.istrue == undefined) { if (item.istrue == undefined) {
item.istrue = true item.istrue = true
} }
}) })
}, },
save () { save () {
this.$forceUpdate() this.$forceUpdate()
this.$emit('radio',this.dataList) this.$emit('radio',this.dataList)
// + // +
localStorage.setItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name, JSON.stringify(this.dataList)) localStorage.setItem('tableColumns_' + this.userName + '_' + this.$route.name, JSON.stringify(this.dataList))
}, },
dragstart(value) { dragstart(value) {
this.oldData = value this.oldData = value
@ -149,9 +153,12 @@ export default {
}, },
// item // item
rediochange(index){ rediochange(index){
this.dataList[index].istrue = !this.dataList[index].istrue // this.dataList[index].istrue = !this.dataList[index].istrue
this.$set(this.dataList[index],'istrue', !this.dataList[index].istrue)
this.initSelectSta() this.initSelectSta()
this.save() this.$nextTick(()=>{
this.save()
})
}, },
// //
initSelectSta(){ initSelectSta(){

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

@ -49,6 +49,7 @@
@sortChange="sortChange" @sortChange="sortChange"
@handleSelectionChange="handleSelectionChange" @handleSelectionChange="handleSelectionChange"
@inlineDialog="inlineDialog" @inlineDialog="inlineDialog"
:buttonOperationList="buttonOperationList"
@buttonOperationClick="buttonOperationClick" @buttonOperationClick="buttonOperationClick"
:tableBorder="true" :tableBorder="true"
:firstFixed="true" :firstFixed="true"
@ -107,6 +108,11 @@ export default {
return [] return []
} }
}, },
//
buttonOperationList:{
type: Array,
default: null,
},
// //
tableData: { tableData: {
type: Array, type: Array,
@ -325,6 +331,10 @@ export default {
buttonOperationClick(row, index, label) { buttonOperationClick(row, index, label) {
this.$emit("buttonOperationClick", row, index, label); this.$emit("buttonOperationClick", row, index, label);
}, },
//table
buttonOperationClick(row, item, index) {
this.$emit("buttonOperationClick", row, item, index);
},
// //
// /showSearchOverall // /showSearchOverall
getShowSearchOverall(val){ getShowSearchOverall(val){

45
Code/Fe/src/components/umyTable/index.vue

@ -19,6 +19,27 @@
header-row-class-name="uTableHeader" header-row-class-name="uTableHeader"
> >
<!-- :tree-props="treeProps" height 不能共存 此组件暂不支持tree的格式--> <!-- :tree-props="treeProps" height 不能共存 此组件暂不支持tree的格式-->
<!-- 操作列 -->
<u-table-column
v-if="buttonOperationList"
:fixed="'left'"
:width="120"
:align="'center'"
:header-align="'center'"
>
<template #header>
<span>操作</span>
</template>
<template slot-scope="scope">
<el-button
v-for="(itemButton, indexButton) in buttonOperationList"
:key="indexButton"
type="text"
size="mini"
@click="buttonOperationClick(scope.row, itemButton, indexButton)"
>{{itemButton.label}}</el-button>
</template>
</u-table-column>
<u-table-column v-if="selectionTable" fixed="left" type="selection" :reserve-selection="true" /> <u-table-column v-if="selectionTable" fixed="left" type="selection" :reserve-selection="true" />
<u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" /> <u-table-column v-if="isShowIndex" type="index" fixed="left" label="序号" width="50" />
<template v-for="(item, index) in TableSize"> <template v-for="(item, index) in TableSize">
@ -257,18 +278,6 @@
>{{item.label}}</el-button> >{{item.label}}</el-button>
</div> </div>
<!-- </el-form-item> --> <!-- </el-form-item> -->
<!-- table表添加操作列 -->
<div v-if="item.type == 'buttonOperation'">
<el-button
class="buttonOperation-btn"
v-for="(itemButton, indexButton) in item.buttonText.split('|')"
:key="indexButton"
type="text"
size="mini"
@click="buttonOperationClick(scope.row, item.buttonName.split('|')[indexButton])"
>{{itemButton}}</el-button>
</div>
<span v-if="item.type == 'object'"> <span v-if="item.type == 'object'">
{{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }} {{ scope.row[item.prop] ? scope.row[item.prop][item.showProp] : "" }}
</span> </span>
@ -432,6 +441,11 @@ export default {
}, },
}, },
props: { props: {
//
buttonOperationList:{
type: Array,
default: null,
},
// //
showOverflowTooltip:{ showOverflowTooltip:{
type: Boolean, type: Boolean,
@ -867,8 +881,8 @@ export default {
this.$emit("buttonClick", row, index, label); this.$emit("buttonClick", row, index, label);
}, },
//table //table
buttonOperationClick(row, label) { buttonOperationClick(row, item, index) {
this.$emit("buttonOperationClick", row, label); this.$emit("buttonOperationClick", row, item, index);
}, },
}, },
}; };
@ -911,9 +925,6 @@ export default {
.el-table__fixed-right::before { .el-table__fixed-right::before {
z-index: auto !important; z-index: auto !important;
} }
.buttonOperation-btn{
padding: 0;
}
.spamHover { .spamHover {
color: #409eff; color: #409eff;
cursor: pointer; cursor: pointer;

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

@ -38,6 +38,10 @@ export const tableMixins = {
tableDataDetails:[], tableDataDetails:[],
//默认tag //默认tag
firstTabs:'xq', firstTabs:'xq',
// api的表头原始数据
apiColumns_Table_copy:null,
apiColumns_DesTions_copy:null,
apiColumns_DetailsTable_copy:null,
// api的表头数据 // api的表头数据
apiColumns_Table:null, apiColumns_Table:null,
apiColumns_DesTions:null, apiColumns_DesTions:null,
@ -46,9 +50,34 @@ export const tableMixins = {
URLOption_base:allUrlOption[this.$route.name].baseURL, URLOption_base:allUrlOption[this.$route.name].baseURL,
//主表-明细 //主表-明细
URLOption_detail:allUrlOption[this.$route.name].detailURL, URLOption_detail:allUrlOption[this.$route.name].detailURL,
// 主表-操作列
operationButtonsTable:[{label:'查看详情',name:'info'}]
} }
}, },
mounted() {
// 用于api表头的字段设置监听同步
window.addEventListener('setItemEvent', (item) => {
if (item.key.indexOf('tableColumns') > -1) {
if(JSON.parse(item.newValue).length <= 0){
this.apiColumns_Table = this.apiColumns_Table_copy[this.$route.name]
}else{
this.apiColumns_Table = JSON.parse(item.newValue)
}
}
})
},
methods: { methods: {
// 获取通过api的表头数据,不可以在初始化处理,因为接口返回问题
initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api){
// 复制一份原始数据(目的:字段设置恢复)
this.apiColumns_Table_copy = JSON.parse(JSON.stringify(tableColumns_api))
this.apiColumns_DesTions_copy = JSON.parse(JSON.stringify(tabsDesTions_api))
this.apiColumns_DetailsTable_copy = JSON.parse(JSON.stringify(detailsTableColumns_api))
// 赋值表头数据
this.apiColumns_Table = this.initTableColumns(tableColumns_api[this.$route.name])
this.apiColumns_DesTions = tabsDesTions_api[this.$route.name]
this.apiColumns_DetailsTable = detailsTableColumns_api[this.$route.name]
},
//渲染数据 //渲染数据
paging(callback) { paging(callback) {
this.Loading.tableLoading = true; this.Loading.tableLoading = true;
@ -212,13 +241,18 @@ export const tableMixins = {
/** /**
* *
* @param {*} row 当前行数据 * @param {*} row 当前行数据
* @param {*} label 按钮name * @param {*} item 按钮信息
* @param {*} index 按钮索引
*/ */
buttonOperationClick(row, label) { buttonOperationClick(row, item, index) {
// 获取当前行数据,赋值给 propsData // 获取当前行数据,赋值给 propsData
this.propsData = row this.propsData = row
// 查看详情
if (label == "edit") { if (item.name == "info") {
this.inlineDialog(row)
}
// 编辑
if (item.name == "edit") {
this.formTitle = this.$route.meta.title + "编辑"; this.formTitle = this.$route.meta.title + "编辑";
this.formReveal = false this.formReveal = false
this.theEvent = "edit" this.theEvent = "edit"
@ -234,7 +268,8 @@ export const tableMixins = {
} }
this.displayDialog.editDialog = true this.displayDialog.editDialog = true
} }
if (label == 'delete') { // 删除
if (item.name == 'delete') {
this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', { this.$confirm('此操作将永久删除该消息, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',

6
Code/Fe/src/mixins/mixins.js

@ -55,10 +55,10 @@ export const mixins = {
methods: { methods: {
// 结合默认及缓存中的列表tableColumns数据做初始化 // 结合默认及缓存中的列表tableColumns数据做初始化
initTableColumns(){ initTableColumns(){
let _list_defalut = this.$isTableColumns[this.$route.name] let _list_defalut = columnsData ? columnsData : this.$isTableColumns[this.$route.name]
if(!_list_defalut)return if(!_list_defalut)return
let _local = localStorage.getItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name) let _local = localStorage.getItem('tableColumns_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name)
let _list_local = JSON.parse(localStorage.getItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name)) let _list_local = JSON.parse(localStorage.getItem('tableColumns_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name))
let _new_list = [] //格式化后的数据 let _new_list = [] //格式化后的数据
// 如果没有缓存则直接为默认值 // 如果没有缓存则直接为默认值
if(!_local){ if(!_local){

36
Code/Fe/src/permission.js

@ -39,21 +39,23 @@ router.beforeEach(async (to, from, next) => {
isAutoLogin = JSON.parse(_url_isAutoLogin) isAutoLogin = JSON.parse(_url_isAutoLogin)
} }
let userInfo = localStorage.getItem('currentUserInfo') let userInfo = localStorage.getItem('currentUserInfo')
let _zh = localStorage.getItem('columnsApiNamesZh')
// 是否有用户信息: // 是否有用户信息:
// 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页) // 1、如果没有判断是否为自动登录(是自动登录则自动执行登录,账号密码为配置信息中的值,不是自动登录则跳到登录页)
// 2、如果有用户信息:则检查是否有api接口的表头数据,没有的话重新获取 // 2、如果有用户信息:则检查是否有api接口的表头数据,没有的话重新获取
if(!userInfo){ if(!userInfo){
if(isAutoLogin){ if(isAutoLogin || to.query.loginName){
let loginForm= { // let loginForm= {
userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"), // userNameOrEmailAddress:localStorage.getItem("userNameOrEmailAddress"),
password:localStorage.getItem("client_secret"), // password:localStorage.getItem("client_secret"),
// rememberMe:true, // // rememberMe:true,
// grant_type: 'password', // // grant_type: 'password',
// client_id: 'Auth_App', // // client_id: 'Auth_App',
} // }
// store.dispatch('user/login', loginForm).then(() => { // store.dispatch('user/login', loginForm).then(() => {
login(loginForm).then(()=>{ // login(loginForm).then(()=>{
getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{ getUsersByUserName(localStorage.getItem("userNameOrEmailAddress")).then(res=>{
// todo:currentUserInfo全程需要优化
localStorage.setItem("currentUserInfo", JSON.stringify(res)); localStorage.setItem("currentUserInfo", JSON.stringify(res));
}) })
.catch(err => { .catch(err => {
@ -61,16 +63,16 @@ router.beforeEach(async (to, from, next) => {
}) })
// 提前获取接口监控看板表头数据并存储 // 提前获取接口监控看板表头数据并存储
getInterfaceBoard().then(result => { getInterfaceBoard().then(result => {
localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values.Winin)); localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts));
next() next('/')
}) })
.catch(err => { .catch(err => {
console.log('获取表头失败,请重试') console.log('获取表头失败,请重试')
}) })
}) // })
.catch((error) => { // .catch((error) => {
console.log('登录失败') // console.log('登录失败')
}) // })
}else{ }else{
if (to.path != '/login') { if (to.path != '/login') {
next('/login') next('/login')
@ -84,8 +86,8 @@ router.beforeEach(async (to, from, next) => {
// const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames") // const _interfaceBoardColumnsNames = localStorage.getItem("interfaceBoardColumnsNames")
// if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){ // if( !_interfaceBoardColumnsNames || _interfaceBoardColumnsNames == 'undefined' || _interfaceBoardColumnsNames == 'null'){
getInterfaceBoard().then(result => { getInterfaceBoard().then(result => {
let _zh = localStorage.getItem('columnsApiNamesZh') // todo-new:columnsApiNamesZh配置的地址补全(evel)
localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.localization.values[_zh])); localStorage.setItem("interfaceBoardColumnsNames", JSON.stringify(result.resources[_zh].texts));
setTimeout(()=>{ setTimeout(()=>{
next() next()
},0) },0)

2
Code/Fe/src/utils/baseData/urlOption.js

@ -3,6 +3,8 @@ export const TestSchool = {
baseURL:'TestSchool/base',//主表-列表 baseURL:'TestSchool/base',//主表-列表
detailURL:'app/test-school',//主表-明细 + 明细-查看主表 detailURL:'app/test-school',//主表-明细 + 明细-查看主表
detailListURL:'TestStudentDetail/base',//明细-列表, detailListURL:'TestStudentDetail/base',//明细-列表,
masterId:'masterId',//明细获取主表信息的masterId(默认)
masterName:'studentName'//明细获取主表信息的title名称
// parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL // parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL
// deleteURL:null,//删除特殊URL // deleteURL:null,//删除特殊URL
// updataURL:null,//新增+编辑特殊URL(新增+编辑使用一个) // updataURL:null,//新增+编辑特殊URL(新增+编辑使用一个)

2
Code/Fe/src/utils/defaultButtons.js

@ -42,7 +42,7 @@ export function defaultExportBtn(option) {
// 字段设置 // 字段设置
export function defaultFieldSettingBtn(option) { export function defaultFieldSettingBtn(option) {
// todo:监听已经配置过的字段按钮更改状态特殊显示 // todo:监听已经配置过的字段按钮更改状态特殊显示
let _local = localStorage.getItem('tableColumns_' + this.$store.getters.name.userName + '_' + this.$route.name) let _local = localStorage.getItem('tableColumns_' + JSON.parse(localStorage.getItem('currentUserInfo')).userName + '_' + this.$route.name)
let _type = '' let _type = ''
let _num = 0 let _num = 0
if(_local){ if(_local){

2
Code/Fe/src/utils/tableColumns_api/index.js

@ -4,6 +4,6 @@ import { initFromApiColumnsLable } from '@/utils/index'
// 测试数据 // 测试数据
export const TestSchool = [ export const TestSchool = [
{ label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left", type: "name" }, { label: initFromApiColumnsLable('TestSchoolSchoolName'), prop: "schoolName", fixed: "left" },
{ label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" }, { label: initFromApiColumnsLable('TestStudentDetailOrderType'), prop: "orderType" },
] ]

2
Code/Fe/src/views/dashboard/index.vue

@ -178,7 +178,7 @@
display: flex; display: flex;
padding-top: 10px; padding-top: 10px;
.title{ .title{
width: 180px; width: 240px;
text-align: right; text-align: right;
font-weight: bold; font-weight: bold;
flex-shrink: 0; flex-shrink: 0;

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

@ -23,6 +23,8 @@
:primarySearchOption="primarySearchOption" :primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick" @overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData" :httpOverallSearchData="httpOverallSearchData"
@buttonOperationClick="buttonOperationClick"
:buttonOperationList="operationButtonsTable"
></tablePagination> ></tablePagination>
<curren-Drawer <curren-Drawer
:title="apiColumns_DesTions" :title="apiColumns_DesTions"
@ -110,6 +112,7 @@ export default {
isRedundance:true, isRedundance:true,
isDetailExport:true isDetailExport:true
}),// }),//
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),// this.defaultFreshBtn(),//
this.defaultFilterBtn(),// this.defaultFilterBtn(),//
this.defaultFilterForDetailBtn()// this.defaultFilterForDetailBtn()//
@ -163,17 +166,9 @@ export default {
}; };
}, },
mounted() { mounted() {
this.initApiColumns() this.initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api)
this.paging(); this.paging();
}, },
methods: {
// api
initApiColumns(){
this.apiColumns_Table = tableColumns_api[this.$route.name]
this.apiColumns_DesTions = tabsDesTions_api[this.$route.name]
this.apiColumns_DetailsTable = detailsTableColumns_api[this.$route.name]
},
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save