feat: There is no way the,

This commit is contained in:
super_liu
2021-11-08 17:51:12 +08:00
parent c0fa07e8dd
commit 381c5bc125
2 changed files with 84 additions and 69 deletions
@@ -39,9 +39,9 @@
<p class="half" style="color: #C42626;"><label style=" margin-right: 171px;">企标号</label><span>{{ sarStandardsInfoEO.standCode }}</span></p> <p class="half" style="color: #C42626;"><label style=" margin-right: 171px;">企标号</label><span>{{ sarStandardsInfoEO.standCode }}</span></p>
<template v-for="(child, childIndex) in item.child1"> <template v-for="(child, childIndex) in item.child1">
<p class="half files-title" <p class="half files-title"
v-for="(file, fileIndex) in child1Func(child.value)"
> >
<label style=" margin-right: 102px;">{{ child.attrName }}</label> <label style=" margin-right: 102px;">{{ child.attrName }}</label>
<template v-for="(file, fileIndex) in child1Func(child.value)">
<span> <span>
<a style="font-size: 16px;color: #409EFF;cursor: pointer" @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{ file.oldFileName | ellipsis }}</a> <a style="font-size: 16px;color: #409EFF;cursor: pointer" @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{ file.oldFileName | ellipsis }}</a>
<i <i
@@ -70,6 +70,8 @@
<!-- </el-button>--> <!-- </el-button>-->
<el-button v-if="child.value.length > 1" style="color:#409EFF;border: 1px solid #409EFF;background: rgba(64, 158, 255, 0.1);" <el-button v-if="child.value.length > 1" style="color:#409EFF;border: 1px solid #409EFF;background: rgba(64, 158, 255, 0.1);"
class="decomposition-btn" icon="icon-relation" @click="relateEvent1(child.value)">更多</el-button> class="decomposition-btn" icon="icon-relation" @click="relateEvent1(child.value)">更多</el-button>
</template>
<template v-if="child.value || child.value.length === 0">-</template>
</p> </p>
</template> </template>
<p><label style=" margin-right: 157px;">中文名称</label><span>{{ sarStandardsInfoEO.standName || '-' }}</span></p> <p><label style=" margin-right: 157px;">中文名称</label><span>{{ sarStandardsInfoEO.standName || '-' }}</span></p>
@@ -1168,6 +1170,7 @@ export default {
methods: { methods: {
child1Func(child1){ child1Func(child1){
const list = [] const list = []
console.log(child1)
if(child1 && child1.length > 1){ if(child1 && child1.length > 1){
list.push(child1[0]) list.push(child1[0])
return list return list
@@ -2130,6 +2133,7 @@ export default {
const [displayLocation, {attrInfoMap: dynamicFormField}, formFieldList] = values const [displayLocation, {attrInfoMap: dynamicFormField}, formFieldList] = values
// const relatedPlansRes = await this.queryRelatedPlans() // const relatedPlansRes = await this.queryRelatedPlans()
// const relatedPlans = relatedPlansRes.list // const relatedPlans = relatedPlansRes.list
console.log(formFieldList)
formFieldList.forEach((field) => { formFieldList.forEach((field) => {
displayLocation.forEach((location) => { displayLocation.forEach((location) => {
location.isShowImp = '0' location.isShowImp = '0'
@@ -2157,12 +2161,14 @@ export default {
// } // }
} }
} }
if (location.label === '文本信息') { if (location.label === '过程稿件') {
location.isShowImp = '0' location.isShowImp = '0'
} }
}) })
}) })
console.log(displayLocation)
for (let i = 0; i < displayLocation.length; i++) { for (let i = 0; i < displayLocation.length; i++) {
// sss // sss
if(displayLocation[i].label !== '基础信息' && displayLocation[i].label !== '过程稿件'){ if(displayLocation[i].label !== '基础信息' && displayLocation[i].label !== '过程稿件'){
@@ -2176,13 +2182,16 @@ export default {
displayLocation.forEach(location => { displayLocation.forEach(location => {
// 动态属性字段-FBGBJBD 单独添加至基础信息 // 动态属性字段-FBGBJBD 单独添加至基础信息
const list = displayLocation.filter ( item => item.label === '过程稿件'); const list = displayLocation.filter ( item => item.label === '过程稿件');
console.log(list)
if(location.label === '基础信息' && list && list.length > 0){ if(location.label === '基础信息' && list && list.length > 0){
if (!list[0].child) { if (!list[0].child) {
location['child1'] = [] location['child1'] = []
}else { }else {
console.log(list)
const childList = list[0].child.filter ( item => item.attrField === 'FBGBUSS'); const childList = list[0].child.filter ( item => item.attrField === 'FBGBUSS');
console.log(childList)
console.log(childList.length)
location['child1'] = childList location['child1'] = childList
console.log(location['child1'])
} }
} }
@@ -2196,6 +2205,7 @@ export default {
}) })
console.log(fieldOthers) console.log(fieldOthers)
location.child = [...fieldOthers, ...fieldsIsTextAreaOrFile].sort(this.compare('orderNum')) location.child = [...fieldOthers, ...fieldsIsTextAreaOrFile].sort(this.compare('orderNum'))
console.log(location)
}) })
console.log(displayLocation) console.log(displayLocation)
this.dynamicFormField = displayLocation this.dynamicFormField = displayLocation
@@ -57,9 +57,9 @@
<!-- <p><label style=" margin-right: 150px;">标准年份</label><span>{{ sarStandardsInfoEO.standYear || '-' }}</span></p>--> <!-- <p><label style=" margin-right: 150px;">标准年份</label><span>{{ sarStandardsInfoEO.standYear || '-' }}</span></p>-->
<template v-for="(child, childIndex) in item.child1"> <template v-for="(child, childIndex) in item.child1">
<p class="half files-title" <p class="half files-title"
v-for="(file, fileIndex) in child1Func(child.value)"
> >
<label style=" margin-right: 102px;">{{ child.attrName }}</label> <label style=" margin-right: 102px;">{{ child.attrName }}</label>
<template v-for="(file, fileIndex) in child1Func(child.value)">
<span> <span>
<a style="font-size: 16px;color: #409EFF;cursor: pointer" @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{ file.oldFileName | ellipsis }}</a> <a style="font-size: 16px;color: #409EFF;cursor: pointer" @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{ file.oldFileName | ellipsis }}</a>
<i <i
@@ -88,6 +88,8 @@
</el-button> </el-button>
<el-button v-if="child.value.length > 1" style="color:#409EFF;border: 1px solid #409EFF;background: rgba(64, 158, 255, 0.1);" <el-button v-if="child.value.length > 1" style="color:#409EFF;border: 1px solid #409EFF;background: rgba(64, 158, 255, 0.1);"
class="decomposition-btn" icon="icon-relation" @click="relateEvent1(child.value)">更多</el-button> class="decomposition-btn" icon="icon-relation" @click="relateEvent1(child.value)">更多</el-button>
</template>
<template v-if="child.value || child.value.length === 0">-</template>
</p> </p>
</template> </template>
<p><label style=" margin-right: 150px;">中文名称</label><span>{{ <p><label style=" margin-right: 150px;">中文名称</label><span>{{
@@ -3112,18 +3114,10 @@
}) })
}) })
for (let i = 0; i < displayLocation.length; i++) {
// sss
if(displayLocation[i].label !== '基础信息' && displayLocation[i].label !== '过程稿件'){
const childList = displayLocation[i].child.filter ( item => item.value !== null && item.value !== '');
if(childList.length === 0){
displayLocation.splice(i,1)
}
}
}
displayLocation.forEach(location => { displayLocation.forEach(location => {
// 动态属性字段-FBGBJBD 单独添加至基础信息 // 动态属性字段-FBGBJBD 单独添加至基础信息
const list = displayLocation.filter ( item => item.label === '过程稿件'); const list = displayLocation.filter ( item => item.label === '过程稿件');
console.log()
if(location.label === '基础信息' && list && list.length > 0){ if(location.label === '基础信息' && list && list.length > 0){
if (!list[0].child) { if (!list[0].child) {
location['child1'] = [] location['child1'] = []
@@ -3167,6 +3161,17 @@
location.half = half location.half = half
location.showAll = false location.showAll = false
}) })
for (let i = 0; i < displayLocation.length; i++) {
// sss
if(displayLocation[i].label !== '基础信息' && displayLocation[i].label !== '过程稿件'){
const childList = displayLocation[i].child.filter ( item => item.value !== null && item.value !== '');
if(childList.length === 0){
displayLocation.splice(i,1)
}
}
}
this.$http.get('sarLawsAttrDetailedList/sar-laws-attr-detailed-list', { this.$http.get('sarLawsAttrDetailedList/sar-laws-attr-detailed-list', {
id: this.$route.params.id id: this.$route.params.id
}, { }, {