拆分回显悬浮数据显示修改

This commit is contained in:
caoyang
2022-04-06 16:00:46 +08:00
parent 1cc4f5803d
commit 27016f4f0b
4 changed files with 69 additions and 10 deletions
@@ -184,7 +184,7 @@
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
}) })
} }
console.log('columns',this.columns) // console.log('columns',this.columns)
} }
}) })
}, },
@@ -206,7 +206,9 @@
pageNo: pageNo + '', pageNo: pageNo + '',
pageSize: pageSize + '' pageSize: pageSize + ''
} }
if(!params.info_id){
params.info_id=this.infoId
}
// console.log('parmsss',params) // console.log('parmsss',params)
this.loading = true this.loading = true
postAction(this.url.tableList, params).then((res) => { postAction(this.url.tableList, params).then((res) => {
@@ -13,13 +13,14 @@
:maxTagTextLength="2" :maxTagTextLength="2"
:placeholder="placeholder" :placeholder="placeholder"
:getPopupContainer="getParentContainer" :getPopupContainer="getParentContainer"
:maxTagPlaceholder="content+'...'"
optionFilterProp="children" optionFilterProp="children"
:filterOption="filterOption"> :filterOption="filterOption">
<a-select-option <a-select-option
v-for="(item,index) in dictOptions" v-for="(item,index) in dictOptions"
:key="index" :key="index"
:value="item.value"> :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.text || item.label "> <span style="display: inline-block;width: 100%" :title="item.text || item.label">
{{ item.text || item.label }} {{ item.text || item.label }}
</span> </span>
</a-select-option> </a-select-option>
@@ -54,7 +55,8 @@
return { return {
dictOptions: [], dictOptions: [],
tagType:"", tagType:"",
arrayValue:!this.value?[]:this.value.split(this.spliter) arrayValue:!this.value?[]:this.value.split(this.spliter),
content:''
} }
}, },
created() { created() {
@@ -81,6 +83,19 @@
this.arrayValue = [] this.arrayValue = []
}else{ }else{
this.arrayValue = this.value.split(this.spliter) this.arrayValue = this.value.split(this.spliter)
let arrayValue=JSON.parse(JSON.stringify(this.arrayValue))
let item = []
this.dictOptions.forEach(res=>{
arrayValue.forEach((val,index)=>{
if (res.value == val&&index!=0){
item.push(res.text || res.label)
}
})
this.content=item.join(',')
})
console.log('value111',this.content)
} }
} }
}, },
@@ -106,18 +121,25 @@
}, },
onChange (selectedValue) { onChange (selectedValue) {
let content = [] let content = []
let item = []
this.dictOptions.forEach(res=>{ this.dictOptions.forEach(res=>{
selectedValue.forEach(val=>{ selectedValue.forEach((val,index)=>{
if (res.value == val){ if (res.value == val){
content.push(res.text || res.label) content.push(res.text || res.label)
if(index!=0){
item.push(res.text || res.label)
}
} }
}) })
this.content=item.join(',')
}) })
this.$emit('change', selectedValue.join(this.spliter)); this.$emit('change', selectedValue.join(this.spliter));
this.$emit('changeQuery', content.join(this.spliter),this.db_field_name); this.$emit('changeQuery', content.join(this.spliter),this.db_field_name);
}, },
setCurrentDictOptions(dictOptions){ setCurrentDictOptions(dictOptions){
this.dictOptions = dictOptions this.dictOptions = dictOptions
}, },
getCurrentDictOptions(){ getCurrentDictOptions(){
return this.dictOptions return this.dictOptions
@@ -200,7 +200,7 @@
</a-col> </a-col>
<a-col :span="12" v-else-if="item.field_show_type === '0'"> <a-col :span="12" v-else-if="item.field_show_type === '0'">
<div class="box-title-text" :title="item.db_field_txt"> <div class="box-title-text box-tree-text" :title="item.db_field_txt">
<div class="title-text"> <div class="title-text">
<span class="Required" v-if="item.field_must_input == 1">*</span> <span class="Required" v-if="item.field_must_input == 1">*</span>
<span class="title-text-text">{{item.db_field_txt}}</span> <span class="title-text-text">{{item.db_field_txt}}</span>
@@ -208,12 +208,14 @@
<a-form-model-item class="itemModel" :prop="item.db_field_name"> <a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-tree-select <a-tree-select
v-model="formInline[item.db_field_name]" v-model="formInline[item.db_field_name]"
:maxTagCount="1"
style="width: 100%" style="width: 100%"
:tree-data="item.tree" :tree-data="item.tree"
tree-checkable tree-checkable
:placeholder="$t('PleaseSelect')+item.db_field_txt" :placeholder="$t('PleaseSelect')+item.db_field_txt"
@change="changeTree"
/> />
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -541,7 +543,9 @@
] ]
}, },
numberFlag:false, numberFlag:false,
itemVal:{} itemVal:{},
contentTrees:'',
} }
}, },
props:{ props:{
@@ -642,7 +646,7 @@
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ueditor.setContent(item.itemContent) this.$refs.ueditor.setContent(item.itemContent)
}) })
console.log('ineciem',index,item) // console.log('ineciem',index,item)
}, },
//删除按钮 //删除按钮
splitDelete(item,index){ splitDelete(item,index){
@@ -660,7 +664,6 @@
//保存 //保存
splitSave(){ splitSave(){
// console.log('vallll',this.contentList) // console.log('vallll',this.contentList)
console.log('formInline',this.formInline)
this.$refs.splitEditForm.validate(valid=>{ this.$refs.splitEditForm.validate(valid=>{
if(valid){ if(valid){
this.submitFlag=true this.submitFlag=true
@@ -943,6 +946,9 @@
message: res.db_field_txt + this.$t('cannotEmpty'), message: res.db_field_txt + this.$t('cannotEmpty'),
trigger: 'blur' trigger: 'blur'
}) })
} else if (res.field_show_type === '4' || res.field_show_type === '6' || } else if (res.field_show_type === '4' || res.field_show_type === '6' ||
res.field_show_type === '5' || res.field_show_type === '7' res.field_show_type === '5' || res.field_show_type === '7'
) { ) {
@@ -1017,6 +1023,7 @@
getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => { getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => {
if (res.success) { if (res.success) {
this.formInline = res.result this.formInline = res.result
// console.log('form11111',this.formInline) // console.log('form11111',this.formInline)
} }
}) })
@@ -1039,6 +1046,14 @@
this.formInline[value + '_id'] = id this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
}, },
//树结果选择
changeTree(value, label, extra){
// console.log('changeValue',value, label, extra)
let labelValues = label
labelValues.shift()
this.contentTrees= labelValues.join(',')
},
//正则替换小数点 //正则替换小数点
limitNumber(value) { limitNumber(value) {
@@ -1269,4 +1284,10 @@
} }
} }
} }
.box-tree-text{
.ant-select-selection--multiple{
height: 32px;
overflow-y: auto;
}
}
</style> </style>
@@ -293,8 +293,21 @@
deleteNode(){ deleteNode(){
} }
},
computed:{
}, },
mounted() { mounted() {
// let widthBrown = document.documentElement.offsetWidth || document.body.offsetWidth
// let client = document.querySelector('.split-detail-table .ant-table-content').getBoundingClientRect()
// let width = widthBrown - client.left
// console.log('width111',width)
//
// document.querySelector('.split-detail-table .ant-table-content').style.width=width+'px'
// window.fullHeight = document.documentElement.clientHeight
// that.fullHeight = window.fullHeight
this.infoId=this.$route.query.infoId this.infoId=this.$route.query.infoId
// console.log('info',this.$route.query) // console.log('info',this.$route.query)
this.loadMenuData() this.loadMenuData()
@@ -1092,6 +1105,7 @@
.split-detail-right{ .split-detail-right{
padding-left: 20px; padding-left: 20px;
flex: 1; flex: 1;
.split-detail-search-header{ .split-detail-search-header{
margin-bottom: 20px; margin-bottom: 20px;
.table-page-search-submitButtons{ .table-page-search-submitButtons{