Browse Source

详情弹窗回显bug处理

noToken
安虹睿 1 year ago
parent
commit
b2bdf4b1ab
  1. 184
      PC/InterFace.Dash/src/components/currenDescriptions/index copy.vue
  2. 57
      PC/InterFace.Dash/src/components/currenDescriptions/index.vue
  3. 7
      PC/InterFace.Dash/src/mixins/TableMixins.js
  4. 23
      PC/InterFace.Dash/src/views/menuList/IncomingData.vue

184
PC/InterFace.Dash/src/components/currenDescriptions/index copy.vue

@ -0,0 +1,184 @@
<template>
<el-descriptions
class="currenDescriptionsPage"
:title="title"
:column="column"
:direction="direction"
:colon="colon"
:border="border"
v-loading="currenDescriptionsLoading"
>
<template>
<el-descriptions-item
:label="item.label"
v-for="(item, index) in tabsDesTions"
:key="index"
:labelStyle="{'text-align': 'right','padding-right':'10px'}"
>
<span v-if="item.type && item.type == 'date'">{{
propsData[item.prop] | formatOnlyDate
}}</span>
<span v-else-if="item.type && item.type == 'dateTime'">{{
propsData[item.prop] | formatDate
}}</span>
<span v-else-if="item.type && item.type == 'objectDateTime'">{{
propsData[item.prop]?propsData[item.prop][item.showProp]:"" | formatDate
}}</span>
<span v-else-if="item.type && item.type == 'object'">
{{ propsData[item.prop]?propsData[item.prop][item.showProp]:"" }}
</span>
<span v-else-if="item.type && item.type == 'filter'">
{{ propsData[item.prop] | trigger(item.filters,"label", item.dictType) }}
</span>
<span v-else-if="item.type && item.type == 'objectFilter'">
{{ propsData[item.prop]?propsData[item.prop][item.showProp]:false | trigger(item.filters,"label") }}
</span>
<span v-else-if="item.type && item.type == 'percent'">
{{ propsData[item.prop] +'%' }}
</span>
<span v-else-if="item.type && item.type == 'uploadPictureCard'">
<div id="uploadPictureCardRef">{{propsData[item.prop] | formatDatePicture}}</div>
</span>
<span v-else-if="item.type == 'filterList'" >
{{ propsData[item.prop] | triggerList(item.filters, "label") }}
</span>
<!-- 文本域 -->
<span v-else-if="item.type == 'textarea'">
<template>
<el-input
:type="item.type"
v-model="propsData[item.prop]"
:rows="item.rows"
:readonly="item.readonly"
></el-input>
</template>
</span>
<span v-else>{{ propsData[item.prop] ? propsData[item.prop] + "" : propsData[item.prop] }}</span>
</el-descriptions-item>
</template>
<el-descriptions-item
v-for="item in descriptionsData"
:label="item.label"
:key="item.label"
>{{ item.data }}</el-descriptions-item
>
<slot></slot>
</el-descriptions>
</template>
<script>
import { parseTime } from "@/utils/formatTime"
import { formatTimeStrToStr } from "@/utils/formatTime"
import { fileStorage } from "@/api/wms-api"
let that
export default {
name:'curren-descriptions',
data () {
return {
//
blobName: '',
currenDescriptionsLoading: false
}
},
mounted(){
console.log(85,this.tabsDesTions)
},
beforeCreate () {
that = this;
},
filters: {
formatDate (time) {
if (time == null) {
return '-'
}
return formatTimeStrToStr(time)
},
formatOnlyDate (time) {
var date = new Date(time);
return parseTime(date).substring(0,10)
},
formatDatePicture(val) {
if (val !== undefined && that.blobName !== val) {
that.blobName = val
that.currenDescriptionsLoading = true
fileStorage({blobName: val}).then(res => {
var byteString = atob(res.bytes)
var arrayBuffer = new ArrayBuffer(byteString.length) //
var intArray = new Uint8Array(arrayBuffer) //
for (var i = 0; i < byteString.length; i++) {
intArray[i] = byteString.charCodeAt(i)
}
const blob = new Blob([intArray], { type: '' })
var img = new Image()
img.width="100"
img.height="100"
img.src = URL.createObjectURL(blob)
var otest = document.getElementById("uploadPictureCardRef")
otest.innerHTML = ''
otest.appendChild(img)
that.currenDescriptionsLoading = false
}).catch(err => {
console.log(err)
that.currenDescriptionsLoading = false
})
}
}
},
props: {
title: {
type: String,
default: ''
},
colon: {
type: Boolean,
default: true
},
column: {
type: Number,
default: 1
},
border: {
type: Boolean,
default: false
},
descriptionsData: {
type: Array,
default: () => {
return []
}
},
direction: {
type: String,
default: 'horizontal'
},
tabsDesTions: {
type: Array,
default: () => {
return []
}
},
propsData: {
type: Object,
default: () => {
return {}
}
}
}
}
</script>
<style lang="scss">
.currenDescriptionsPage{
th{
min-width: 200px !important;
width: auto;
}
td{
span{
display: inline-block;
max-height: 150px;
overflow: auto;
}
}
}
</style>

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

@ -15,45 +15,25 @@
:key="index" :key="index"
:labelStyle="{'text-align': 'right','padding-right':'10px'}" :labelStyle="{'text-align': 'right','padding-right':'10px'}"
> >
<span v-if="item.type && item.type == 'date'">{{ <!-- 时间转换 -->
propsData[item.prop] | formatOnlyDate <span v-if="item.apiBaseType && item.apiBaseType == 'datetime'">{{
}}</span>
<span v-else-if="item.type && item.type == 'dateTime'">{{
propsData[item.prop] | formatDate propsData[item.prop] | formatDate
}}</span> }}</span>
<span v-else-if="item.type && item.type == 'objectDateTime'">{{ <!-- 枚举 -->
propsData[item.prop]?propsData[item.prop][item.showProp]:"" | formatDate <span v-else-if="item.isEnums">
}}</span> {{ initApiEnumList(item,propsData[item.prop]) }}
<span v-else-if="item.type && item.type == 'object'">
{{ propsData[item.prop]?propsData[item.prop][item.showProp]:"" }}
</span>
<span v-else-if="item.type && item.type == 'filter'">
{{ propsData[item.prop] | trigger(item.filters,"label", item.dictType) }}
</span>
<span v-else-if="item.type && item.type == 'objectFilter'">
{{ propsData[item.prop]?propsData[item.prop][item.showProp]:false | trigger(item.filters,"label") }}
</span> </span>
<span v-else-if="item.type && item.type == 'percent'"> <!-- 布尔 -->
{{ propsData[item.prop] +'%' }} <span v-else-if="item.apiBaseType == 'boolean'">
{{ propsData[item.prop] ? '是' : '否' }}
</span> </span>
<span v-else-if="item.type && item.type == 'uploadPictureCard'"> <!-- 数值 -->
<div id="uploadPictureCardRef">{{propsData[item.prop] | formatDatePicture}}</div> <span v-else-if="item.apiBaseType == 'number'">
{{ propsData[item.prop] }}
</span> </span>
<span v-else-if="item.type == 'filterList'" > <span v-else>
{{ propsData[item.prop] | triggerList(item.filters, "label") }} {{ propsData[item.prop] ? propsData[item.prop] + "" : propsData[item.prop] }}
</span> </span>
<!-- 文本域 -->
<span v-else-if="item.type == 'textarea'">
<template>
<el-input
:type="item.type"
v-model="propsData[item.prop]"
:rows="item.rows"
:readonly="item.readonly"
></el-input>
</template>
</span>
<span v-else>{{ propsData[item.prop] ? propsData[item.prop] + "" : propsData[item.prop] }}</span>
</el-descriptions-item> </el-descriptions-item>
</template> </template>
<el-descriptions-item <el-descriptions-item
@ -161,6 +141,16 @@ export default {
} }
} }
},
methods:{
//
initApiEnumList(item,data){
let _item_enumList = {}
item.enums_list.forEach((item,key)=>{
_item_enumList[item.value] = item.label
})
return _item_enumList[data] || '未定义'
},
} }
} }
</script> </script>
@ -175,6 +165,7 @@ export default {
display: inline-block; display: inline-block;
max-height: 150px; max-height: 150px;
overflow: auto; overflow: auto;
min-width: 200px;
} }
} }
} }

7
PC/InterFace.Dash/src/mixins/TableMixins.js

@ -187,13 +187,14 @@ export const tableMixins = {
let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base let _url = this.URLOption_detail ? this.URLOption_detail : this.URLOption_base
getDetailed(val.id, _url) getDetailed(val.id, _url)
.then(res=>{ .then(res=>{
// 表头处理
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/'))
this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName),'detail_api')
// 打印使用的全部数据存储 // 打印使用的全部数据存储
this.tableDataDetails = JSON.parse(JSON.stringify(res)) this.tableDataDetails = JSON.parse(JSON.stringify(res))
// 数据处理
this.propsData = res this.propsData = res
if (res.details) { if (res.details) {
// 表头处理
let _parentName = this.URLOption_detailList.substr(0,this.URLOption_detailList.indexOf('/'))
this.apiColumns_DetailsTable = this.initTableColumns(this.initApiColumnsForDto(res.details[0],_parentName),'detail_api')
if(this.$refs.currenDrawer_Ref){ if(this.$refs.currenDrawer_Ref){
this.$refs.currenDrawer_Ref.getDetailList(res,()=>{ this.$refs.currenDrawer_Ref.getDetailList(res,()=>{
this.inlineDialogCallback() this.inlineDialogCallback()

23
PC/InterFace.Dash/src/views/menuList/IncomingData.vue

@ -24,6 +24,29 @@
@overallSearchFormClick="overallSearchFormClick" @overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData" :httpOverallSearchData="httpOverallSearchData"
></tablePagination> ></tablePagination>
<!-- :buttonOperationList_left="buttonOperationClick_leftBase"
@buttonOperationClick_left="buttonOperationClick_left" -->
<!-- <curren-Drawer
ref="currenDrawer_Ref"
:title="apiColumns_DesTions"
@rowDrop="rowDrop"
:tableColumns="apiColumns_DetailsTable"
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
:Butttondata="[]"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@close-value="closeValue"
:totalCount="totalCountDetails"
:currentPage="oldSkipCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
:buttonOperationList_left="operationButtonsDetail"
></curren-Drawer> -->
<!-- 导出弹窗 --> <!-- 导出弹窗 -->
<exportDrop <exportDrop
v-if="displayDialog.exportDialog" v-if="displayDialog.exportDialog"

Loading…
Cancel
Save