格式化代码

This commit is contained in:
yanyizhou
2021-11-29 17:35:45 +08:00
parent 119d1afb61
commit 2f9e9c0b12
@@ -32,7 +32,7 @@
</div> </div>
</div> </div>
</div> </div>
<el-collapse-item :name="item.label" @click.native="handleChange1(item.label)"> <el-collapse-item :name="item.label" @click.native="handleChange1(item.label)">
<template slot="title"> <template slot="title">
<div class="modular-header" v-if="item.label === '基础信息'"> <div class="modular-header" v-if="item.label === '基础信息'">
<div class="modular-header-title"><i class="icon-modular-title"/><span>{{ item.label }}</span></div> <div class="modular-header-title"><i class="icon-modular-title"/><span>{{ item.label }}</span></div>
@@ -42,7 +42,7 @@
</div> </div>
</template> </template>
<div class="modular-content"> <div class="modular-content">
<template v-if="item.label === '基础信息'" > <template v-if="item.label === '基础信息'">
<div class="details-content-modular basic-information" style="border-top:none"> <div class="details-content-modular basic-information" style="border-top:none">
<div class="basic-information-content"> <div class="basic-information-content">
<!-- <p><label style=" margin-right: 150px;">标准类别</label><span>{{ sarStandardsInfoEO.standSort || '-' }}</span></p>--> <!-- <p><label style=" margin-right: 150px;">标准类别</label><span>{{ sarStandardsInfoEO.standSort || '-' }}</span></p>-->
@@ -58,9 +58,12 @@
<p class="half files-title" <p class="half files-title"
> >
<label style=" margin-right: 102px;">{{ child.attrName }}</label> <label style=" margin-right: 102px;">{{ child.attrName }}</label>
<template v-if="child.value && child.value.length > 0" v-for="(file, fileIndex) in child1Func(child.value)"> <template v-if="child.value && child.value.length > 0"
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
title="下载" title="下载"
@click="downloadFile(file.id)" @click="downloadFile(file.id)"
@@ -85,10 +88,13 @@
icon="icon-separate" icon="icon-separate"
>标准分解单 >标准分解单
</el-button> </el-button>
<el-button v-if="child.value && child.value.length > 1" style="color:#409EFF;border: 1px solid #409EFF;background: rgba(64, 158, 255, 0.1);" <el-button v-if="child.value && child.value.length > 1"
class="decomposition-btn" icon="icon-relation" @click="relateEvent1(child.value)">更多</el-button> 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>
</template> </template>
<template v-if="child.value === null" >-</template> <template v-if="child.value === null">-</template>
</p> </p>
</template> </template>
<p><label style=" margin-right: 150px;">中文名称</label><span>{{ <p><label style=" margin-right: 150px;">中文名称</label><span>{{
@@ -110,7 +116,8 @@
standMap[sarStandardsInfoEO.standNature] || '-' standMap[sarStandardsInfoEO.standNature] || '-'
}}</span></p> }}</span></p>
<p class="half" v-if="saveStandType === 'INLAND_STAND'"><label style=" margin-right: 150px;">标准体系</label><span>{{ <p class="half" v-if="saveStandType === 'INLAND_STAND'"><label
style=" margin-right: 150px;">标准体系</label><span>{{
sarStandardsInfoEO.standSystem || '-' sarStandardsInfoEO.standSystem || '-'
}}</span></p> }}</span></p>
<p class="half"> <p class="half">
@@ -120,7 +127,7 @@
</p> </p>
<template v-for="(child, childIndex) in item.child2"> <template v-for="(child, childIndex) in item.child2">
<p class="half"> <p class="half">
<label style=" margin-right: 143px;">{{child.attrName}}</label> <label style=" margin-right: 143px;">{{ child.attrName }}</label>
<span>{{ child.value || '-' }}</span> <span>{{ child.value || '-' }}</span>
</p> </p>
</template> </template>
@@ -390,7 +397,9 @@
<template v-if="child.attrField === 'XGD' || child.attrField === 'FBGBJBD' || child.attrField === 'BPG' <template v-if="child.attrField === 'XGD' || child.attrField === 'FBGBJBD' || child.attrField === 'BPG'
|| child.attrField === 'SSG'|| child.attrField === 'ZQYJG'|| child.attrField === 'CA' || child.attrField === 'SSG'|| child.attrField === 'ZQYJG'|| child.attrField === 'CA'
|| child.attrField === 'JDWJ' || child.attrField === 'GLWJ'"> || child.attrField === 'JDWJ' || child.attrField === 'GLWJ'">
<a @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{ file.oldFileName | ellipsis }}</a> <a @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{
file.oldFileName | ellipsis
}}</a>
<i <i
title="下载" title="下载"
@click="downloadFile(file.id)" @click="downloadFile(file.id)"
@@ -411,7 +420,9 @@
<!-- <span class="time-text">上传时间:{{ dateFormat(file.modifyTime) }}</span>--> <!-- <span class="time-text">上传时间:{{ dateFormat(file.modifyTime) }}</span>-->
</template> </template>
<template v-else> <template v-else>
<a @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{ file.oldFileName | ellipsis }}</a> <a @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{
file.oldFileName | ellipsis
}}</a>
<i <i
title="下载" title="下载"
@click="downloadFile(file.id)" @click="downloadFile(file.id)"
@@ -742,7 +753,7 @@
label="符合性状态" label="符合性状态"
width="100"> width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.complianceRequire ? (scope.row.complianceRequire === '1' ? '是' : '否') : '-'}} {{ scope.row.complianceRequire ? (scope.row.complianceRequire === '1' ? '是' : '否') : '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@@ -1061,7 +1072,8 @@
style="margin-bottom: 10px;line-height: 20px;max-height: 300px" style="margin-bottom: 10px;line-height: 20px;max-height: 300px"
> >
{{ index + 1 }}. {{ index + 1 }}.
<a style="font-size: 16px;color: #409EFF;cursor: pointer" @click="openFileInPdf(file.id, file.oldFileName)" target="_blank" :title="file.oldFileName">{{ file.oldFileName }}</a> <a style="font-size: 16px;color: #409EFF;cursor: pointer" @click="openFileInPdf(file.id, file.oldFileName)"
target="_blank" :title="file.oldFileName">{{ file.oldFileName }}</a>
<i <i
title="下载" title="下载"
@click="downloadFile(file.id)" @click="downloadFile(file.id)"
@@ -1404,10 +1416,10 @@ export default {
RelatedTermsSelect RelatedTermsSelect
}, },
filters: { filters: {
ellipsis (value) { ellipsis(value) {
if (!value) return '' if (!value) return ''
if (value.length > 12) { if (value.length > 12) {
return value.slice(0,12) + '...' return value.slice(0, 12) + '...'
} }
return value return value
} }
@@ -1416,7 +1428,7 @@ export default {
return { return {
activeNames: ['基础信息'], activeNames: ['基础信息'],
activeState: true, activeState: true,
itemExistList:[], itemExistList: [],
interpretationContent: '', interpretationContent: '',
relatedTermsDrawerVisible: false, relatedTermsDrawerVisible: false,
btnLoading: false, btnLoading: false,
@@ -1444,8 +1456,8 @@ export default {
knowType: '', knowType: '',
KnowTitle: '', KnowTitle: '',
knowIdList: '', knowIdList: '',
order:'', order: '',
orderBy:'', orderBy: '',
total7: 0, total7: 0,
page7: 1, page7: 1,
pageSize7: this.$store.getters.userInfo.configContent, pageSize7: this.$store.getters.userInfo.configContent,
@@ -1712,28 +1724,28 @@ export default {
props: {}, props: {},
watch: {}, watch: {},
methods: { methods: {
child1Func(child1){ child1Func(child1) {
const list = [] const list = []
if(child1 && child1.length > 1){ if (child1 && child1.length > 1) {
list.push(child1[0]) list.push(child1[0])
return list return list
} }
return child1 return child1
}, },
handleChange(val) { handleChange(val) {
console.log(val) console.log('1724', val)
}, },
handleChange1(val) { handleChange1(val) {
if(val && val === '基础信息'){ if (val && val === '基础信息') {
this.activeState = true; this.activeState = true;
} }
}, },
judgeSuffix(fileName){ judgeSuffix(fileName) {
if ('pdf'===fileName.substring(fileName.lastIndexOf('.') + 1)){ if ('pdf' === fileName.substring(fileName.lastIndexOf('.') + 1)) {
return true; return true;
}else return false; } else return false;
}, },
ocrFunction(file){ ocrFunction(file) {
return "ocr" return "ocr"
}, },
FormatDate(date) { FormatDate(date) {
@@ -2328,8 +2340,8 @@ export default {
_this: this _this: this
}, res => { }, res => {
this.sarStandardsInfoEO = res.data || {} this.sarStandardsInfoEO = res.data || {}
this.itemExistList=this.sarStandardsInfoEO.attrInfoMap.itemExistList; this.itemExistList = this.sarStandardsInfoEO.attrInfoMap.itemExistList;
console.log("hllo",this.sarStandardsInfoEO); console.log("hllo", this.sarStandardsInfoEO);
if (this.sarStandardsInfoEO.issueTime != null && this.sarStandardsInfoEO.issueTime !== '') { if (this.sarStandardsInfoEO.issueTime != null && this.sarStandardsInfoEO.issueTime !== '') {
this.sarStandardsInfoEO.issueTime = this.sarStandardsInfoEO.issueTime.split(' ')[0] this.sarStandardsInfoEO.issueTime = this.sarStandardsInfoEO.issueTime.split(' ')[0]
} }
@@ -2455,7 +2467,7 @@ export default {
_this: this _this: this
}, res => { }, res => {
console.log("res.data",res.data); console.log("res.data", res.data);
if (res.data) { if (res.data) {
let fileObj = {} let fileObj = {}
fileObj.fileId = res.data.attId fileObj.fileId = res.data.attId
@@ -2553,9 +2565,9 @@ export default {
}.bind(this) }.bind(this)
}) })
}, },
sort(column){ sort(column) {
this.order=column.order; this.order = column.order;
this.orderBy=column.prop; this.orderBy = column.prop;
this.selectSarStandItems(); this.selectSarStandItems();
}, },
// 分解单----查看标准条款相关 // 分解单----查看标准条款相关
@@ -2564,7 +2576,7 @@ export default {
this.standItemSearch.fileType = this.fileType this.standItemSearch.fileType = this.fileType
this.$http.get('SarStandItems/sar-stand-items/querySarItemAndInterpretation', { this.$http.get('SarStandItems/sar-stand-items/querySarItemAndInterpretation', {
...this.standItemSearch, ...this.standItemSearch,
pageSize: this.pageSize7, page: this.page7,order:this.order,orderBy:this.orderBy pageSize: this.pageSize7, page: this.page7, order: this.order, orderBy: this.orderBy
}, {}, res => { }, {}, res => {
this.selectedItemList = [] this.selectedItemList = []
if (res.ok) { if (res.ok) {
@@ -2617,9 +2629,9 @@ export default {
this.standItemSearch.parts = '' this.standItemSearch.parts = ''
this.standItemSearch.nameOrRequest = '' this.standItemSearch.nameOrRequest = ''
this.standItemSearch.fileType = '' this.standItemSearch.fileType = ''
this.standItemSearch.itemsName='' this.standItemSearch.itemsName = ''
this.standItemSearch.ZCCSSRQ='' this.standItemSearch.ZCCSSRQ = ''
this.standItemSearch.XCXSSRQ='' this.standItemSearch.XCXSSRQ = ''
this.selectSarStandItems() this.selectSarStandItems()
}, },
inputChange() { inputChange() {
@@ -2918,7 +2930,7 @@ export default {
collectResId: this.sarStandardsInfoEO.id, collectResId: this.sarStandardsInfoEO.id,
collectTitle: collectTitle, collectTitle: collectTitle,
collectType: this.$route.params.pageType, // 国内收藏type collectType: this.$route.params.pageType, // 国内收藏type
userId : this.$store.getters.userInfo.userId userId: this.$store.getters.userInfo.userId
} }
this.$http.postData('person/personCollect', personCollect, { this.$http.postData('person/personCollect', personCollect, {
@@ -2931,7 +2943,7 @@ export default {
}) })
} }
}, },
relateEvent1(list){ relateEvent1(list) {
this.relateDialog1 = true this.relateDialog1 = true
this.relateNowList1 = list this.relateNowList1 = list
}, },
@@ -3082,7 +3094,7 @@ export default {
this.setMap(res.data.SARPROPERTY) // 标准性质 this.setMap(res.data.SARPROPERTY) // 标准性质
}, e => { }, e => {
}) })
Promise.all([this.queryDisplayLocation(), this.selectStandMessage(), this.getAddFormFieldList()]).then ((values) => { Promise.all([this.queryDisplayLocation(), this.selectStandMessage(), this.getAddFormFieldList()]).then((values) => {
const [displayLocation, standEO, formFieldList] = values const [displayLocation, standEO, formFieldList] = values
const dynamicFormField = standEO ? standEO.attrInfoMap : {} const dynamicFormField = standEO ? standEO.attrInfoMap : {}
formFieldList.forEach((field) => { formFieldList.forEach((field) => {
@@ -3120,34 +3132,34 @@ export default {
console.log(displayLocation) console.log(displayLocation)
displayLocation.forEach(location => { displayLocation.forEach(location => {
// 动态属性字段-FBGBJBD 单独添加至基础信息 // 动态属性字段-FBGBJBD 单独添加至基础信息
const list = displayLocation.filter ( item => item.label === '过程稿件'); const list = displayLocation.filter(item => item.label === '过程稿件');
console.log() 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'] = []
}else { } else {
const childList = list[0].child.filter ( item => item.attrField === 'FBGBJBD'); const childList = list[0].child.filter(item => item.attrField === 'FBGBJBD');
location['child1'] = childList location['child1'] = childList
} }
} }
// 动态属性字段-SYRZ 单独添加至基础信息 // 动态属性字段-SYRZ 单独添加至基础信息
const list2 = displayLocation.filter ( item => item.label === '适用范围'); const list2 = displayLocation.filter(item => item.label === '适用范围');
if(location.label === '基础信息' && list2 && list2.length > 0){ if (location.label === '基础信息' && list2 && list2.length > 0) {
if (!list2[0].child) { if (!list2[0].child) {
location['child2'] = [] location['child2'] = []
}else { } else {
const childList = list2[0].child.filter ( item => item.attrField === 'SYRZ'); const childList = list2[0].child.filter(item => item.attrField === 'SYRZ');
location['child2'] = childList location['child2'] = childList
} }
} }
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 !== '过程稿件') {
const childList = displayLocation[i].child.filter ( item => item.value !== null && item.value !== ''); const childList = displayLocation[i].child.filter(item => item.value !== null && item.value !== '');
if(childList.length === 0){ if (childList.length === 0) {
displayLocation.splice(i,1) displayLocation.splice(i, 1)
} }
} }
} }
@@ -3159,7 +3171,7 @@ export default {
if (['DATE_PICKER', 'SEL_OPTION', 'INPUT_NUM'].includes(field.attrType)) { if (['DATE_PICKER', 'SEL_OPTION', 'INPUT_NUM'].includes(field.attrType)) {
half.push(field) half.push(field)
} else { } else {
if(field.attrField && field.attrField !== 'FBGBJBD' && field.attrField !== 'SYRZ'){ if (field.attrField && field.attrField !== 'FBGBJBD' && field.attrField !== 'SYRZ') {
one.push(field) one.push(field)
} }
} }
@@ -3247,11 +3259,11 @@ export default {
} }
} }
/deep/ .el-collapse{ /deep/ .el-collapse {
border: none; border: none;
} }
/deep/ .el-collapse-item__wrap{ /deep/ .el-collapse-item__wrap {
border: none; border: none;
} }
@@ -3417,6 +3429,7 @@ export default {
width: 100%; width: 100%;
height: 50px; height: 50px;
border-bottom: 1px solid #E5E5E5; border-bottom: 1px solid #E5E5E5;
.modular-header-title { .modular-header-title {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
@@ -3431,8 +3444,7 @@ export default {
background-position: center center; background-position: center center;
background-image: url("~assets/images/shangqi/standardDetails/modular-title.png"); background-image: url("~assets/images/shangqi/standardDetails/modular-title.png");
position: relative; position: relative;
top: 2px; top: 2px;;
;
} }
& > span { & > span {
@@ -3732,7 +3744,8 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
} }
.over{
.over {
word-break: break-all; word-break: break-all;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;