1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861 |
- <template>
- <div class="autoBox box">
- <div class="crumbs">
- <div style="overflow: hidden">
- <el-breadcrumb separator-class="el-icon-arrow-right" style="float: left">
- <el-breadcrumb-item :to="{ path: 'home' }">{{$t('common.Home')}}</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: 'realTimeInfo1' }" class="pointer">{{$t('common.NewsData')}}</el-breadcrumb-item>
- <el-breadcrumb-item>{{$t('common.resourceWantRelease')}}</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- <div class="content">
- <div class="addLanguage">
- <i class="el-icon-orange" style="font-size: 30px;line-height: 50px;color: #E6A23C;vertical-align: middle;"></i>
- <span style="font-size: 18px;line-height: 50px;margin-left: 20px;vertical-align: middle;">{{$t('common.resourceLanguageVersion')}}</span>
- <i class="el-icon-plus" style="font-size: 30px;font-weight: 900;margin-left: 20px;line-height: 50px; color: #E6A23C;vertical-align: middle;" @click="addTabDialog(languageTabsValue)"></i>
- </div>
- <div v-show="screen==0">
- <div class="issue">
- <el-tabs v-model="languageTabsValue" type="card" closable @tab-remove="removeTab">
- <el-tab-pane
- v-for="(item, index) in languageList"
- :key="item.name"
- :label="$t(item.label)"
- :name="item.name"
- >
- <div style="width: 100%;padding: 0 150px;box-sizing: border-box">
- <el-form ref="resultType" :model="resultForm.public" label-width="160px" :rules="resultTypeRules">
- <!--资源类型 研究成果-->
- <el-form-item :label="$t('common.resourceTheResourceType')" prop="resourceTypeSelectValue1">
- <el-select style="width: 320px;" v-model="resultForm.public.resourceTypeSelectValue1" :placeholder="$t('common.resource')" @change="resourceType">
- <el-option
- v-for="item in resultForm.public.resourceTypeSelect"
- :label="$t(item.label)"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('common.resourceTheResourceSubtype')" prop="resourceTypeSelectValue2">
- <el-select v-model="resultForm.public.resourceTypeSelectValue2" :placeholder="$t('common.resourcePleaseSelectTheSecondaryType')" style="width: 320px;">
- <el-option
- v-for="item in resultForm.public.resourceTypeSelectOption"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <el-form ref="resultForm" :model="resultForm[item.value]" label-width="160px" :rules="resultFormRules">
- <!--成果封面-->
- <el-form-item :label="$t('common.resourceResultsTheCover')">
- <el-upload
- class="upload-demo"
- action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_cover"
- :before-upload="beforeUploadCover"
- :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'coverFileMap')}"
- :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'coverFileMap')}"
- list-type="picture"
- :on-success="handleAvatarSuccess.bind(this,0,'coverFileMap')"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}}</div>
- </el-upload>
- </el-form-item>
- <!--名称-->
- <el-form-item :label="$t('common.resultsName')" prop="name">
- <el-input v-model="resultForm[item.value].name" maxlength="100" show-word-limit
- :placeholder="$t('common.resourcePleaseEnterTheName')"
- ></el-input>
- </el-form-item>
- <!--所属单位-->
- <el-form-item :label="$t('common.resourceSubordinateUnits')" prop="affiliatedUnitName">
- <el-input v-model="resultForm[item.value].affiliatedUnitName" maxlength="100" show-word-limit
- :placeholder="$t('common.resourcePleaseEnterUnit')"
- ></el-input>
- </el-form-item>
- <!--国家-->
- <!-- <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue2">
- <el-select style="width: 320px;" v-model="resultForm[item.value].resourceCountrySelectValue1" :placeholder="$t('common.resourcePleaseSelectContinent')">
- <el-option
- v-for="item in resultForm[item.value].resourceCountrySelect"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- <el-select v-model="resultForm[item.value].resourceCountrySelectValue2" :placeholder="$t('common.resourcePleaseSelectCountry')"
- :no-data-text="$i18n.locale=='zh'?'无数据':'no data'" style="width: 320px;float: right;">
- <el-option
- v-for="item in resultForm[item.value].resourceCountrySelectValue1.data"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item> -->
- <!-- 国家 -->
- <el-row>
- <el-col :span="12">
- <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue1">
- <el-select style="width: 320px;" v-model="resultForm[item.value].resourceCountrySelectValue1" :placeholder="$t('common.resourcePleaseSelectContinent')">
- <el-option
- v-for="item in resultForm[item.value].resourceCountrySelect"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="resourceCountrySelectValue2">
- <el-select v-model="resultForm[item.value].resourceCountrySelectValue2" :placeholder="$t('common.resourcePleaseSelectCountry')"
- :no-data-text="$i18n.locale=='zh'?'无数据':'no data'" style="width: 320px;float: right;">
- <el-option
- v-for="item in resultForm[item.value].resourceCountrySelectValue1.data"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <!--联系人-->
- <el-form-item :label="$t('common.resourceTheContact')">
- <el-input v-model="resultForm[item.value].contactsName" maxlength="100" show-word-limit
- :placeholder="$t('common.resourcePleaseEnterTheContactName')"
- ></el-input>
- </el-form-item>
- <!--联系电话-->
- <el-form-item :label="$t('common.resourceContactPhoneNumber')" prop="contactsNumber">
- <el-input v-model="resultForm[item.value].contactsNumber" maxlength="50" show-word-limit style="width: 500px;"
- :placeholder="$t('common.resourcePleaseEnterYourContactNumber')"
- ></el-input>
- </el-form-item>
- <!--摘要-->
- <el-form-item :label="$t('common.resourceDetailsAbstract')" prop="researchResultAbstract">
- <el-input
- type="textarea"
- :placeholder="$t('common.resourcePleaseEnterSummary')"
- v-model="resultForm[item.value].researchResultAbstract"
- maxlength="5000"
- show-word-limit
- rows="6"
- >
- </el-input>
- </el-form-item>
- <!--目录-->
- <!-- <el-form-item :label="$t('common.resourceDetailsDirectory')" required>
- <el-upload
- class="upload-demo"
- action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_catalog"
- :before-upload="beforeUploadCatalog"
- :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'catalogFileMap')}"
- :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'catalogFileMap')}"
- list-type="picture"
- :on-success="handleAvatarSuccess.bind(this,0,'catalogFileMap')"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}},{{$t('common.resourceUploadOne')}}</div>
- </el-upload>
- </el-form-item> -->
- <!--附件-->
- <el-form-item :label="$t('common.resourceTheAttachment')">
- <el-upload
- class="upload-demo"
- action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_file"
- :before-upload="beforeUploadFile"
- :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'fileMap')}"
- :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'fileMap')}"
- :on-success="handleAvatarSuccess.bind(this,0,'fileMap')"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadPDF')}},{{$t('common.resourceFilesCannotExceed50Mb')}}</div>
- </el-upload>
- </el-form-item>
- <el-form-item style="text-align: center;">
- <el-button style="margin-right: 50px;" type="primary" @click="onResultsVerify('resultForm','resultType')">{{$t('common.resourceRelease')}}</el-button>
- <el-button @click="toResource">{{$t('common.resourceCancel')}}</el-button>
- </el-form-item>
- </el-form>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- <div v-show="screen==1">
- <div class="issue">
- <el-tabs v-model="languageTabsValue" type="card" closable @tab-remove="removeTab">
- <el-tab-pane
- v-for="(item, index) in languageList"
- :key="item.name"
- :label="$t(item.label)"
- :name="item.name"
- >
- <div style="width: 100%;padding: 0 150px;box-sizing: border-box">
- <el-form ref="resourceType" :model="resourceForm.public" label-width="160px" :rules="resourceTypeRules">
- <!--资源类型 调研资源-->
- <el-form-item :label="$t('common.resourceTheResourceType')" prop="resourceTypeSelectValue1">
- <el-select style="width: 320px;" v-model="resourceForm.public.resourceTypeSelectValue1" :placeholder="$t('common.resource')" @change="resourceType">
- <el-option
- v-for="item in resourceForm.public.resourceTypeSelect"
- :label="$t(item.label)"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('common.resourceTheResourceSubtype')" prop="resourceTypeSelectValue2">
- <el-select v-model="resourceForm.public.resourceTypeSelectValue2" :placeholder="$t('common.resourcePleaseSelectTheSecondaryType')" style="width: 320px;">
- <el-option
- v-for="item in resourceForm.public.resourceTypeSelectOption"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <!--对接方式-->
- <el-form-item :label="$t('common.resourceDockingWay')" prop="radio">
- <el-radio-group v-model="resourceForm.public.radio">
- <el-radio :label="$t('common.resourceDockingOfTheUnit')"></el-radio>
- <el-radio :label="$t('common.resourceCooperationOrganizationDocking')"></el-radio>
- </el-radio-group>
- </el-form-item>
- </el-form>
- <el-form ref="resourceForm" :model="resourceForm[item.value]" label-width="160px" :rules="resourceFormRules">
- <!--资源媒体-->
- <el-form-item :label="$t('common.resourceMediaResources')" >
- <!-- <el-select v-model="resourceForm[item.value].resourceMediaSelectValue" :placeholder="$t('common.resourceThePicture')" @change="resourceType" style="width: 320px;">
- <el-option
- v-for="item in resourceForm[item.value].resourceMediaSelect"
- :label="$t(item.label)"
- :value="item">
- </el-option>
- </el-select> -->
- <el-upload
- class="upload-demo"
- action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
- :before-upload="beforeUploadCover"
- :on-remove="(file, fileList) => {onRemove(file, fileList, 1,'mediaFileMap')}"
- :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'mediaFileMap')}"
- :on-success="handleAvatarSuccess.bind(this,1,'mediaFileMap')"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}}</div>
- </el-upload>
- </el-form-item>
- <!-- <el-form-item :label="$t('common.resourceMediaResources')" >
- <el-select v-model="resourceForm[item.value].resourceMediaSelectValue" :placeholder="$t('common.resourceThePicture')" @change="resourceType" style="width: 320px;">
- <el-option
- v-for="item in resourceForm[item.value].resourceMediaSelect"
- :label="$t(item.label)"
- :value="item">
- </el-option>
- </el-select>
- <el-upload
- v-show="resourceForm[item.value].resourceMediaSelectValue.value=='图片'||resourceForm[item.value].resourceMediaSelectValue.value=='图片+视频'"
- class="upload-demo"
- action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
- :before-upload="beforeUploadCover"
- :on-remove="(file, fileList) => {onRemove(file, fileList, 1,'mediaFileMap')}"
- :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'mediaFileMap')}"
- :on-success="handleAvatarSuccess.bind(this,1,'mediaFileMap')"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed')}}10MB,{{$t('common.resourceUploadOne')}}</div>
- </el-upload>
- <el-upload
- v-show="resourceForm[item.value].resourceMediaSelectValue.value=='视频'||resourceForm[item.value].resourceMediaSelectValue.value=='图片+视频'"
- class="upload-demo"
- action="/api/resourceshare/baseResearchResourcesInfos/uploadVideo"
- :before-upload="beforeUploadVideo"
- :on-remove="(file, fileList) => {onPreview(file, fileList, 1,'videoFileMap')}"
- :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'videoFileMap')}"
- :on-success="handleAvatarSuccessVideo.bind(this,1,'videoFileMap')"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList"
- :data="video"
- name="layuiVideo">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadMp4')}},{{$t('common.resourceFilesCannotExceed50Mb')}},{{$t('common.resourceUploadOneVideo')}}</div>
- </el-upload>
- </el-form-item> -->
- <!--名称-->
- <el-form-item :label="$t('common.resourceName')" prop="name">
- <el-input v-model="resourceForm[item.value].name" maxlength="100" show-word-limit
- :placeholder="$t('common.resourcePleaseEnterTheName')"
- ></el-input>
- </el-form-item>
- <!--所属单位-->
- <el-form-item :label="$t('common.resourceSubordinateUnits')" prop="affiliatedUnitName">
- <el-input v-model="resourceForm[item.value].affiliatedUnitName" maxlength="100" show-word-limit
- :placeholder="$t('common.resourcePleaseEnterUnit')"
- ></el-input>
- </el-form-item>
- <!--地址-->
- <el-form-item :label="$t('common.resourceAddress')" prop="address">
- <el-input v-model="resourceForm[item.value].address" maxlength="100" show-word-limit
- :placeholder="$t('common.resourcePleaseEnterAddress')"
- ></el-input>
- </el-form-item>
- <!--国家-->
- <!-- <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue2">
- <el-select style="width: 320px;" v-model="resourceForm[item.value].resourceCountrySelectValue1"
- :no-data-text="$i18n.locale=='zh'?'无数据':'no data'"
- :placeholder="$t('common.resourcePleaseSelectContinent')">
- <el-option
- v-for="item in resourceForm[item.value].resourceCountrySelect"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- <el-select v-model="resourceForm[item.value].resourceCountrySelectValue2"
- :no-data-text="$i18n.locale=='zh'?'无数据':'no data'"
- :placeholder="$t('common.resourcePleaseSelectCountry')" style="width: 320px;float: right;">
- <el-option
- v-for="item in resourceForm[item.value].resourceCountrySelectValue1.data"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item> -->
- <!-- 国家 -->
- <el-row>
- <el-col :span="12">
- <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue1">
- <el-select style="width: 320px;" v-model="resourceForm[item.value].resourceCountrySelectValue1"
- :no-data-text="$i18n.locale=='zh'?'无数据':'no data'"
- :placeholder="$t('common.resourcePleaseSelectContinent')">
- <el-option
- v-for="item in resourceForm[item.value].resourceCountrySelect"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item prop="resourceCountrySelectValue2">
- <el-select v-model="resourceForm[item.value].resourceCountrySelectValue2"
- :no-data-text="$i18n.locale=='zh'?'无数据':'no data'"
- :placeholder="$t('common.resourcePleaseSelectCountry')" style="width: 320px;float: right;">
- <el-option
- v-for="item in resourceForm[item.value].resourceCountrySelectValue1.data"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <!--对接方式-->
- <!-- <el-form-item :label="$t('common.resourceDockingWay')" prop="radio">
- <el-radio-group v-model="resourceForm.public.radio">
- <el-radio :label="$t('common.resourceDockingOfTheUnit')"></el-radio>
- <el-radio :label="$t('common.resourceCooperationOrganizationDocking')"></el-radio>
- </el-radio-group>
- </el-form-item> -->
- <!--联系人-->
- <el-form-item :label="$t('common.resourceTheContact')" prop="contactsName">
- <el-input v-model="resourceForm[item.value].contactsName" maxlength="100" show-word-limit
- :placeholder="$t('common.resourcePleaseEnterTheContactName')"
- ></el-input>
- </el-form-item>
- <!--联系电话-->
- <el-form-item :label="$t('common.resourceContactPhoneNumber')" prop="contactsNumber">
- <el-input v-model="resourceForm[item.value].contactsNumber" maxlength="50" show-word-limit style="width: 500px;"
- :placeholder="$t('common.resourcePleaseEnterYourContactNumber')"
- ></el-input>
- </el-form-item>
- <!--邮箱-->
- <el-form-item :label="$t('common.resourceEmail')" prop="contactsEmail">
- <el-input v-model="resourceForm[item.value].contactsEmail" maxlength="100" show-word-limit
- :placeholder="$t('common.ContactinformationEmail')"
- ></el-input>
- </el-form-item>
- <!--详情介绍-->
- <el-form-item :label="$t('common.resourceDetailsAreIntroduced')">
- <div style="width: 100%;border: 1px solid rgba(204, 204, 204, 1);">
- <div style="width: 80px;height: 400px;float: left;text-align: center;">
- <span style="display: inline-block;margin-top: 150px">{{$t('common.resourceResourcesIsIntroduced')}}</span>
- </div>
- <div style="height: 100%;float: left;overflow: hidden;width: calc(100% - 81px);position: relative;">
- <layui-inline-ue
- label=""
- :cssStyle="{'width':'100%','height':'100%'}"
- @input="activityPreviewUe1"
- :value="resourceForm[item.value].activityPreviewUe1"
- ref="contentUe">
- </layui-inline-ue>
- </div>
- <div style="clear: both"></div>
- </div>
- <div style="width: 100%;border: 1px solid rgba(204, 204, 204, 1);margin-top: 80px;">
- <div style="width: 80px;height: 400px;float: left;text-align: center;">
- <span style="display: inline-block;margin-top: 150px">{{$t('common.resourceMattersNeedingAttention')}}</span>
- </div>
- <div style="height: 100%;float: left;overflow: hidden;width: calc(100% - 81px);position: relative;">
- <layui-inline-ue
- label=""
- :cssStyle="{'width':'100%','height':'100%'}"
- @input="activityPreviewUe2"
- :value="resourceForm[item.value].activityPreviewUe2"
- ref="contentUe">
- </layui-inline-ue>
- </div>
- <div style="clear: both"></div>
- </div>
- <!--<div v-for="(item,index) in "
- style="width: 100%;height: 200px;border: 1px solid rgba(204, 204, 204, 1);"
- :style="{marginTop: index==0?'0':'20px'}"
- >
- <div style="width: 80px;height: 200px;float: left;border-right: 1px solid rgba(204, 204, 204, 1);line-height: 100%;text-align: center;">
- <span style="line-height: 200px">注意事项</span>
- </div>
- <div style="height: 100%;float: left;overflow: hidden;width: calc(50% - 81px);">
- </div>
- <div style="clear: both"></div>
- </div>-->
- </el-form-item>
- <!--附件-->
- <!-- <el-form-item :label="$t('common.resourceTheAttachment')">
- <el-upload
- class="upload-demo"
- action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
- :before-upload="beforeUploadFile"
- :on-remove="(file, fileList) => {onRemove(file, fileList, 1,'fileMap')}"
- :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'fileMap')}"
- :on-success="handleAvatarSuccess.bind(this,1,'fileMap')"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadPDF')}},{{$t('common.resourceFilesCannotExceed50Mb')}}</div>
- </el-upload>
- </el-form-item> -->
- <el-form-item style="text-align: center;">
- <el-button style="margin-right: 50px;" type="primary" @click="onResourceVerify('resourceForm','resourceType')">{{$t('common.resourceRelease')}}</el-button>
- <el-button @click="toResource">{{$t('common.resourceCancel')}}</el-button>
- </el-form-item>
- </el-form>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </div>
- </div>
- <!--添加语言版本-->
- <el-dialog
- :title="$t('common.resourceLanguageVersion')"
- :visible.sync="addLanguageDialog"
- width="30%">
- <div style="width: 100%;">
- <el-select v-model="addLanguageValue" style="width: 70%" :placeholder="$t('common.resourcePleaseSelect')">
- <el-option
- v-for="(item,index) in addLanguageOptions"
- :label="$t(item.label)"
- :value="item"
- v-show="!item.added">
- </el-option>
- </el-select>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="languageClose">{{$t('common.cancel')}}</el-button>
- <el-button type="primary" @click="addTab">{{$t('common.submit')}}</el-button>
- </span>
- </el-dialog>
- <!--预览-->
- <el-dialog
- :visible.sync="dialogVisible"
- width="60%"
- height="80%"
- :before-close="beforeClose">
- <div>
- <!-- <img :src="'api/file/pub/'+ dialogVisibleImg" alt="">-->
- <img :src="'api/file/pub/'+ dialogVisibleImg" alt="" style="width: 100%" v-show="dialogVisibleImg!=''">
- <video :src="'api/file/pub/'+ dialogVisibleVideo" style="width: 100%" v-show="dialogVisibleVideo!=''"></video>
- <iframe :src="'api/file/pub/'+ dialogVisiblePdf" frameborder="0" v-show="dialogVisiblePdf!=''" style="width: 100%;height: 800px;"></iframe>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import Base from "@/views/base/Base";
- import {getDicts} from '@/api/dict';
- import { getToken ,resetToken} from '@/utils/auth'
- import LayuiInlineUe from '@/components/LayuiInlineUe'
- import { getTreeByLanguagePortal } from "@/api/operation/baseCityInformationDict";
- import { saveOrUpdateBaseResearchResultInfos } from "@/api/research/baseResearchResultEntity";
- import { saveOrUpdateBaseResearchResourcesInfos } from "@/api/research/resource/baseResearchResourcesEntity";
- import { saveOrUpdateCmsInformation } from "@/api/cms/cmsInformationEntity";
- import { addIntegral } from "@/utils/toCompleteTask";
- export default {
- name:"resourceform",
- extends: Base,
- components:{ LayuiInlineUe },
- data(){
- return{
- // 发布资源切换
- screen:0,
- // 上传视频附属data
- video:{dir:'media'},
- // 上传文件预览
- dialogVisible:false,
- dialogVisibleImg:'',
- dialogVisibleVideo:'',
- dialogVisiblePdf:'',
- //表单头信息
- myHeaders: {Authorization: ('Bearer ' +getToken())},
- fileList:[],
- // 已添加语言版本
- languageTabsValue: '1',
- languageList:[],
- tabIndex: 0,
- // 可添加语言版本
- addLanguageDialog:false,
- addLanguageValue: '',
- addLanguageOptions: [
- {
- label: "common.Chinese",
- name: '1',
- value: 'ZH',
- added: false,
- },
- {
- label: 'common.English',
- name: '2',
- value: 'EN',
- added: false,
- },
- ],
- // 语言字典列表
- languageDataList: [],
- // 表单数据对象
- resultForm:{
- public:{
- resourceTypeSelectValue1:'',
- resourceTypeSelectValue2:'',
- resourceTypeSelectOption:[],
- resourceTypeSelect:[
- {
- label:'common.resource',
- value:'研究成果',
- },
- {
- label:'common.researchResource',
- value:'调研资源',
- },
- ],
- fileMap: new Map(),
- coverFileMap: new Map(),
- catalogFileMap: new Map(),
- },
- template:{
- language:"EN",
- reserveOne:0, // 资源类型
- researchResultType:'',
- name:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- researchResultAbstract:'',
- resourceCountrySelectValue1:'',
- resourceCountrySelectValue2:'',
- resourceCountrySelect:[],
- fileMap: '',
- coverFileMap: '',
- catalogFileMap: '',
- },
- },
- resourceForm:{
- public:{
- resourceTypeSelectValue1:'',
- resourceTypeSelectValue2:'',
- resourceTypeSelectOption:[],
- resourceTypeSelect:[
- {
- label:'common.resource',
- value:'研究成果',
- },
- {
- label:'common.researchResource',
- value:'调研资源',
- },
- ],
- radio: '',
- radioList:[],
- mediaFileMap: new Map(),
- videoFileMap: new Map(),
- fileMap: new Map(),
- details:new Map(),
- mattersNeedingAttention:new Map(),
- },
- template:{
- language:"EN",
- reserveOne:1, // 资源类型
- researchResourcesType:'',
- name:'',
- address:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- contactsEmail: '',
- researchResultAbstract:'',
- dockingMode:'',
- resourceMediaSelectValue:'',
- resourceMediaSelect:[
- {
- label:'common.resourceResearchResourceImage',
- value:'图片',
- },
- {
- label:'common.resourceResearchResourceVideo',
- value:'视频',
- },
- {
- label:'common.resourceResearchResourceImageAndVideo',
- value:'图片+视频',
- },
- ],
- resourceCountrySelectValue1:'',
- resourceCountrySelectValue2:'',
- resourceCountrySelect:[],
- mediaFileMap: '',
- videoFileMap: '',
- fileMap: '',
- activityPreviewUe1:'',
- activityPreviewUe2:'',
- },
- },
- }
- },
- mounted() {
- // if(this.$route.query.key){
- // }
- this.initData();
- },
- watch:{
- '$i18n.locale'(){
- this.initData();
- this.forceUpdate()
- },
- 'screen'(){
- this.$refs.resultForm[0].resetFields()
- this.$refs.resourceForm[0].resetFields()
- }
- },
- computed:{
- resultTypeRules(){
- return{
- resourceTypeSelectValue1: [
- { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
- ],
- resourceTypeSelectValue2: [
- { required: true, message: this.$i18n.locale=='zh'?'请选择资源子类型':'Select the resource subtype', trigger: 'change' },
- ],
- }
- },
- resultFormRules(){
- return{
- // resultTheResourceType: [
- // { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
- // ],
- name: [
- { required: true, message: this.$i18n.locale=='zh'?'请输入名称':'Please enter the name', trigger: 'blur' },
- ],
- affiliatedUnitName: [
- { required: true, message: this.$i18n.locale=='zh'?'请输入所属单位':'Please enter the name of your employer', trigger: 'blur' },
- ],
- // contactsNumber: [
- // { pattern: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,
- // message: this.$i18n.locale=='zh'?'请输入合法的手机号':'Please enter a valid mobile phone number',
- // trigger: 'blur'
- // },
- // ],
- resourceCountrySelectValue1: [
- { required: true, message: this.$i18n.locale=='zh'?'请选择大洲':'Please select a continent', trigger: 'change' },
- ],
- // resourceCountrySelectValue2: [
- // { required: true, message: this.$i18n.locale=='zh'?'请选择大洲':'Please select a continent', trigger: 'change' },
- // ],
- resourceCountrySelectValue2: [
- { required: true, message: this.$i18n.locale=='zh'?'请选择国家':'Please select a country', trigger: 'change' },
- ],
- researchResultAbstract: [
- { required: true, message: this.$i18n.locale=='zh'?'请输入摘要':'Please enter an abstract', trigger: 'blur' },
- ],
- fileMap:[
- { required: true, message: this.$i18n.locale=='zh'?'请上传附件':'Please uploaded file ', trigger: 'change' },
- ],
- // resultDetailsDirectory: [
- // { required: true, message: this.$i18n.locale=='zh'?'请上传目录':'Please upload the directory', trigger: 'blur' },
- // ],
- // resultTheAttachment: [
- // { required: true, message: this.$i18n.locale=='zh'?'请上传附件':'Please upload the attachment.', trigger: 'blur' },
- // ],
- }
- },
- resourceTypeRules(){
- return{
- resourceTypeSelectValue1: [
- { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
- ],
- resourceTypeSelectValue2: [
- { required: true, message: this.$i18n.locale=='zh'?'请选择资源子类型':'Select the resource subtype', trigger: 'change' },
- ],
- radio:[
- { required: true, message: this.$i18n.locale=='zh'?'请选择对接方式':'Please select docking method', trigger: 'change' },
- ],
- }
- },
- resourceFormRules(){
- return{
- // resourceTheResourceType: [
- // { required: true, message: this.$i18n.locale=='zh'?'请输入活动名称':'Select the resource type', trigger: 'blur' },
- // ],
- name: [
- { required: true, message: this.$i18n.locale=='zh'?'请输入名称':'Please enter the name', trigger: 'blur' },
- ],
- affiliatedUnitName: [
- { required: true, message: this.$i18n.locale=='zh'?'请输入所属单位':'Please enter the name of your employer', trigger: 'blur' },
- ],
- // contactsNumber: [
- // { pattern: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,
- // message: this.$i18n.locale=='zh'?'请输入合法的手机号':'Please enter a valid mobile phone number',
- // trigger: 'blur'
- // },
- // ],
- address: [
- { required: true, message: this.$i18n.locale=='zh'?'请输入地址':'Please enter the address', trigger: 'blur' },
- ],
- resourceCountrySelectValue1: [
- { required: true, message: this.$i18n.locale=='zh'?'请选择大洲':'Please select a continent', trigger: 'change' },
- ],
- resourceCountrySelectValue2: [
- { required: true, message: this.$i18n.locale=='zh'?'请选择国家':'Please select a country', trigger: 'change' },
- ],
- resourceDetailsAreIntroduced: [
- { required: true, message: this.$i18n.locale=='zh'?'请输入详情介绍':'Please enter details', trigger: 'blur' },
- ],
- contactsEmail: [
- // { required: true, message: this.$t('common.PleaseEnter') + ' ' + this.$t('common.Email2'), trigger: 'blur' },
- { pattern: /^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*\.[a-z]{2,}$/, message: this.$t('common.Emailformatisnotcorrect'), trigger: 'blur' }
- ],
- contactsName:[
- { required: true, message: this.$i18n.locale=='zh'?'请输入联系人':'Please enter the name of the contact person', trigger: 'blur' },
- ],
- }
- },
- },
- methods:{
- async initData(){
- let flag = false
- this.languageList = []
- this.resetFrom()
- if(this.$i18n.locale.toUpperCase() == 'ZH'){
- this.addLanguageOptions = [
- {
- label: "common.Chinese",
- name: '1',
- value: 'ZH',
- added: false,
- },
- {
- label: 'common.English',
- name: '2',
- value: 'EN',
- added: false,
- },
- ],
- this.languageList.forEach((i)=>{
- if(i.value=='ZH'){
- flag = true;
- }
- })
- if(flag==false){
- this.addLanguageValue = {
- label: "common.Chinese",
- name: '1',
- value: 'ZH',
- added: false,
- };
- this.addTab();
- }
- }else if(this.$i18n.locale.toUpperCase() == 'EN'){
- this.addLanguageOptions = [
- {
- label: "common.English",
- name: '1',
- value: 'EN',
- added: false,
- },
- {
- label: "common.Chinese",
- name: '2',
- value: 'ZH',
- added: false,
- },
- ],
- this.languageList.forEach((i)=>{
- if(i.value=='EN'){
- flag = true;
- }
- })
- if(flag==false){
- this.addLanguageValue = {
- label: "common.English",
- name: '1',
- value: 'EN',
- added: false,
- };
- this.addTab();
- }
- }
- this.getData();
- },
- resetFrom(){
- this.resultForm={
- public:{
- resourceTypeSelectValue1:'',
- resourceTypeSelectValue2:'',
- resourceTypeSelectOption:[],
- resourceTypeSelect:[
- {
- label:'common.resource',
- value:'研究成果',
- },
- {
- label:'common.researchResource',
- value:'调研资源',
- },
- ],
- fileMap: new Map(),
- coverFileMap: new Map(),
- catalogFileMap: new Map(),
- },
- template:{
- language:"EN",
- reserveOne:0, // 资源类型
- researchResultType:'',
- name:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- researchResultAbstract:'',
- resourceCountrySelectValue1:'',
- resourceCountrySelectValue2:'',
- resourceCountrySelect:[],
- fileMap: '',
- coverFileMap: '',
- catalogFileMap: '',
- },
- }
- this.resourceForm={
- public:{
- resourceTypeSelectValue1:'',
- resourceTypeSelectValue2:'',
- resourceTypeSelectOption:[],
- resourceTypeSelect:[
- {
- label:'common.resource',
- value:'研究成果',
- },
- {
- label:'common.researchResource',
- value:'调研资源',
- },
- ],
- radio: '',
- radioList:[],
- mediaFileMap: new Map(),
- videoFileMap: new Map(),
- fileMap: new Map(),
- details:new Map(),
- mattersNeedingAttention:new Map(),
- },
- template:{
- language:"EN",
- reserveOne:1, // 资源类型
- researchResourcesType:'',
- name:'',
- address:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- contactsEmail: '',
- researchResultAbstract:'',
- dockingMode:'',
- resourceMediaSelectValue:'',
- resourceMediaSelect:[
- {
- label:'common.resourceResearchResourceImage',
- value:'图片',
- },
- {
- label:'common.resourceResearchResourceVideo',
- value:'视频',
- },
- {
- label:'common.resourceResearchResourceImageAndVideo',
- value:'图片+视频',
- },
- ],
- resourceCountrySelectValue1:'',
- resourceCountrySelectValue2:'',
- resourceCountrySelect:[],
- mediaFileMap: '',
- videoFileMap: '',
- fileMap: '',
- activityPreviewUe1:'',
- activityPreviewUe2:'',
- },
- }
- },
- // async initData(){
- // let flag = false
- // this.languageList.forEach((i)=>{
- // if(i.value=='ZH'){
- // flag = true;
- // }
- // })
- // if(flag==false){
- // this.addLanguageValue = {
- // label: "common.Chinese",
- // name: '1',
- // value: 'ZH',
- // added: false,
- // };
- // this.addTab();
- // }
- // this.getData();
- // },
- // 获取数据
- async getData(){
- const that = this;
- that.resultForm.public.resourceCountrySelectValue1 = '';
- that.resultForm.public.resourceCountrySelectValue2 = '';
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- await getDicts(
- "RESEARCH_RESULT_TYPE_DICT,RESEARCH_RESOURCE_TYPE_DICT,DOCKING_MODE_DICT"
- ).then(result => {
- if (result.data) {
- that.resultForm.public.resourceTypeSelectOption = result.data[0];
- that.resourceForm.public.resourceTypeSelectOption = result.data[1];
- that.resourceForm.public.radioList = result.data[2];
- }
- })
- await getTreeByLanguagePortal('ZH').then(result => {
- if (result.data) {
- let values = Object.values(result.data);
- that.resultForm.template.resourceCountrySelect = values;
- that.resourceForm.template.resourceCountrySelect = values;
- that.languageList.forEach((i)=>{
- that.resultForm[i.value].resourceCountrySelect = values;
- that.resourceForm[i.value].resourceCountrySelect = values;
- /*if(that.resultForm[i.value].resourceCountrySelectValue1==''){
- that.resultForm[i.value].resourceCountrySelectValue1 = values[0];
- that.resourceForm[i.value].resourceCountrySelectValue1 = values[0];
- }else{
- for(let o=0;o<that.resultForm[i.value].resourceCountrySelect.length;o++){
- if(that.resultForm[i.value].resourceCountrySelect[o].value==that.resultForm[i.value].resourceCountrySelectValue1.value){
- that.resultForm[i.value].resourceCountrySelectValue1 = that.resultForm[i.value].resourceCountrySelect[o];
- }
- }
- }*/
- })
- }
- })
- }else if (this.$i18n.locale.toUpperCase() == 'EN'){
- await getDicts(
- "RESEARCH_RESULT_TYPE_DICT_EN,RESEARCH_RESOURCE_TYPE_DICT_EN,DOCKING_MODE_DICT_EN"
- ).then(result => {
- if (result.data) {
- that.resultForm.public.resourceTypeSelectOption = result.data[0];
- that.resourceForm.public.resourceTypeSelectOption = result.data[1];
- that.resourceForm.public.radioList = result.data[2];
- }
- })
- await getTreeByLanguagePortal('EN').then(result => {
- if (result.data) {
- let values = Object.values(result.data);
- that.resultForm.template.resourceCountrySelect = values;
- that.resourceForm.template.resourceCountrySelect = values;
- that.languageList.forEach((i)=>{
- that.resultForm[i.value].resourceCountrySelect = values;
- that.resourceForm[i.value].resourceCountrySelect = values;
- /*if(that.resultForm[i.value].resourceCountrySelectValue1==''||that.resultForm[i.value].resourceCountrySelectValue1.length==0){
- that.resultForm[i.value].resourceCountrySelectValue1 = values[0];
- that.resourceForm[i.value].resourceCountrySelectValue1 = values[0];
- }else{
- for(let o=0;o<that.resultForm[i.value].resourceCountrySelect.length;o++){
- if(that.resultForm[i.value].resourceCountrySelect[o].value==that.resultForm[i.value].resourceCountrySelectValue1.value){
- that.resultForm[i.value].resourceCountrySelectValue1 = that.resultForm[i.value].resourceCountrySelect[o];
- }
- }
- }*/
- })
- }
- })
- }
- await getDicts(
- "LANGUAGE_DICT"
- ).then(result => {
- if (result.data) {
- that.languageDataList = result.data[0] || [];
- }
- })
- },
- // 添加语言版本
- addTabDialog(targetName) {
- const that = this;
- that.addLanguageDialog = true;
- },
- languageClose(){
- const that = this;
- that.addLanguageDialog = false;
- that.addLanguageValue = "";
- },
- addTab(targetName) {
- const that = this;
- if(that.addLanguageValue){
- let newTabName = ++this.tabIndex + '';
- that.languageList.push({
- label: that.addLanguageValue.label,
- name: that.addLanguageValue.name,
- value: that.addLanguageValue.value,
- });
- that.addLanguageOptions.forEach((i)=>{
- if(i.value == that.addLanguageValue.value){
- i.added = true;
- }
- });
- let resultForm = JSON.parse(JSON.stringify(that.resultForm.template));
- let resourceForm = JSON.parse(JSON.stringify(that.resourceForm.template));
- that.$set(that.resultForm,that.addLanguageValue.value,resultForm)
- that.$set(that.resourceForm,that.addLanguageValue.value,resourceForm)
- that.addLanguageValue = "";
- that.addLanguageDialog = false;
- // that.languageTabsValue = newTabName;
- }else{
- that.languageClose()
- }
- },
- removeTab(targetName) {
- const that = this;
- let tabs = that.languageList;
- let activeName = this.languageTabsValue;
- if (activeName === targetName) {
- tabs.forEach((i, index) => {
- if (i.name === targetName) {
- let nextTab = tabs[index + 1] || tabs[index - 1];
- if (nextTab) {
- activeName = nextTab.name;
- }
- }
- });
- }
- let delIndex = targetName-0-1;
- let delProperty = this.languageList[delIndex]
- delete this.resultForm[delProperty.value];
- delete this.resourceForm[delProperty.value];
- // delete resourceForm[]
- this.languageTabsValue = activeName;
- // this.languageTabsValue = tabs.filter(tab => tab.name !== targetName);
- this.languageList = tabs.filter(tab => tab.name !== targetName);
- this.addLanguageOptions.forEach((i, index) => {
- if (i.name === targetName) {
- i.added = false;
- }
- });
- },
- // 发布资源切换
- resourceType(data){
- let that = this;
- if (data.value === 'Research results' || data.value === '研究成果'){
- if(that.screen == 1){
- that.screen = 0;
- that.resultForm.public.resourceTypeSelectValue1 = {
- label:'common.resource',
- value:'研究成果',
- };
- that.resourceForm.public.resourceTypeSelectValue1 = '';
- }
- }else{
- if(that.screen == 0){
- that.screen = 1;
- that.resultForm.public.resourceTypeSelectValue1 = '';
- that.resourceForm.public.resourceTypeSelectValue1 = {
- label:'common.researchResource',
- value:'调研资源',
- };
- }
- }
- },
- //返回首页
- toResource(){
- this.toView('resourceSharing')
- },
- toView(router, json) {
- this.$router.push({ name: router, params: {key:json} });
- },
- // 上传文件验证
- beforeUploadCover(file) {
- var FileExt = file.name.replace(/.+\./, "");
- if (['jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- type: 'warning',
- message: '请上传JPG,PNG的图片!'
- });
- } else {
- this.$message({
- type: 'warning',
- message: 'Please upload the picture of JPG, PNG!'
- });
- }
- return false;
- }
- this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
- if (this.isLt2k === '0') {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '上传文件大小不能超过10M!',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Upload file size cannot exceed 10M!',
- type: 'error'
- });
- }
- return false;
- }
- },
- beforeUploadCatalog(file) {
- var FileExt = file.name.replace(/.+\./, "");
- if (['jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- type: 'warning',
- message: '请上传jpg,png的图片!'
- });
- } else {
- this.$message({
- type: 'warning',
- message: 'Please upload the picture of jpg, png!'
- });
- }
- return false;
- }
- this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
- if (this.isLt2k === '0') {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '上传文件大小不能超过10M!',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Upload file size cannot exceed 10M!',
- type: 'error'
- });
- }
- return false;
- }
- },
- beforeUploadFile(file) {
- var FileExt = file.name.replace(/.+\./, "");
- if (['pdf'].indexOf(FileExt.toLowerCase()) === -1) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- type: 'warning',
- message: '请上传PDF的附件!'
- });
- } else {
- this.$message({
- type: 'warning',
- message: 'Please upload the attachment of PDF!'
- });
- }
- return false;
- }
- this.isLt2k = file.size / 1024 / 1024 < 50 ? '1' : '0';
- if (this.isLt2k === '0') {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '上传文件大小不能超过50M!',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Upload file size cannot exceed 50M!',
- type: 'error'
- });
- }
- return false;
- }
- },
- beforeUploadVideo(file) {
- const isLt200M = file.size / 1024 / 1024 < 50;
- if (['video/mp4'].indexOf(file.type) == -1) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- type: 'warning',
- message: '请上传mp4的视频!'
- });
- } else {
- this.$message({
- type: 'warning',
- message: 'Please upload the Video of MP4!'
- });
- }
- return false;
- }
- if (!isLt200M) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '上传文件大小不能超过200M!',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Upload file size cannot exceed 200M!',
- type: 'error'
- });
- }
- return false;
- }
- },
- onRemove(file,fileList,status,ele) {
- console.log(1)
- let parameter = this.languageList[this.languageTabsValue-1].value
- if(status==0){
- // this.resultForm.public[ele].delete(this.languageList[this.languageTabsValue-1].value)
- this.resultForm[parameter][ele] = '';
- }else if(status==1){
- // this.resourceForm.public[ele].delete(this.languageList[this.languageTabsValue-1].value)
- this.resourceForm[parameter][ele] = '';
- }
- },
- handleAvatarSuccess(status,ele,res,file){
- //如果只选择一个英文会报错this.languageTabsValue 的值对应不上
- let parameter;
- if(this.languageList.length > 1){
- parameter = this.languageList[this.languageTabsValue-1].value
- }else{
- parameter = this.languageList[0].value
- }
- // let parameter = this.languageList[this.languageTabsValue-1].value
- if(status==0){
- // this.resultForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.data.attachmentId)
- this.resultForm[parameter][ele] = res.data.attachmentId
- }else if(status==1){
- // this.resourceForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.data.attachmentId)
- this.resourceForm[parameter][ele] = res.data.attachmentId
- }
- },
- handleAvatarSuccessVideo(status,ele,res,file){
- // this.resourceForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.url);
- let parameter = this.languageList[this.languageTabsValue-1].value
- this.resourceForm[parameter][ele] = res.url
- },
- onPreview(file,fileList,status,ele){
- console.log(2)
- this.dialogVisible = true;
- if(ele=='coverFileMap'||ele=='mediaFileMap'){
- this.dialogVisibleImg = file.response.data.path;
- }else if(ele=='catalogFileMap'){
- this.dialogVisibleImg = file.response.data.path;
- }else if(ele=='fileMap'){
- this.dialogVisiblePdf = file.response.data.path;
- }else if(ele=='videoFileMap'){
- this.dialogVisibleVideo = file.response.data.path;
- }
- },
- beforeClose(done){
- this.dialogVisibleImg = '';
- this.dialogVisibleVideo = '';
- this.dialogVisiblePdf = '';
- done()
- },
- forceUpdate(e){
- this.$forceUpdate();
- },
- //研究成果表单验证
- onResultsVerify(resultForm,resultType) {
- const that = this;
- let bool = true;
- let resourceBools = [];
- const p1 = new Promise((resolve, reject) => {
- that.$refs[resultType].forEach((i)=>{
- if(that.checkType){
- i.validate((valid) =>{
- resourceBools.push(valid)
- if(valid){
- resolve()
- }
- })
- }
- })
- })
- const p2 = new Promise((resolve, reject) => {
- that.$refs[resultForm].forEach((i)=>{
- if(that.checkType){
- i.validate((valid) =>{
- resourceBools.push(valid)
- if(valid){
- resolve()
- }
- })
- }
- })
- })
- resourceBools.some(item =>{
- if(item == false){
- bool = false
- return true;
- }
- })
- if(bool){
- // 表单验证通过,写业务代码
- Promise.all([p1, p2]).then( () => {
- that.onSubmitResults()
- })
- }else{
- that.$message({
- message: that.$i18n.locale.toUpperCase() == 'ZH'?'必填项未填!': 'The required fields are not filled in!',
- type: 'error'
- });
- }
- },
- //研究成果提交表单
- onSubmitResults(){
- let that = this
- let data = []
- that.languageList.forEach((i)=>{
- let resultForm = {
- language:'',
- reserveOne:0, // 资源类型
- researchResultType:'',
- name:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- researchResultAbstract:'',
- }
- resultForm.language = i.value;
- resultForm.researchResultType = that.resultForm.public.resourceTypeSelectValue2.value;
- resultForm.name = that.resultForm[i.value].name;
- resultForm.affiliatedUnitName = that.resultForm[i.value].affiliatedUnitName;
- resultForm.contactsName = that.resultForm[i.value].contactsName;
- resultForm.contactsNumber = that.resultForm[i.value].contactsNumber;
- resultForm.researchResultAbstract = that.resultForm[i.value].researchResultAbstract;
- resultForm.continent = that.resultForm[i.value].resourceCountrySelectValue1.value;
- resultForm.country = that.resultForm[i.value].resourceCountrySelectValue2.value;
- data.push(resultForm)
- if(that.resultForm[i.value].fileMap){
- this.resultForm.public.fileMap.set(i.value,that.resultForm[i.value].fileMap)
- }
- if(that.resultForm[i.value].coverFileMap){
- this.resultForm.public.coverFileMap.set(i.value,that.resultForm[i.value].coverFileMap)
- }
- if(that.resultForm[i.value].catalogFileMap){
- this.resultForm.public.catalogFileMap.set(i.value,that.resultForm[i.value].catalogFileMap)
- }
- });
- let token = getToken();
- this.submitHandler((token) => {
- saveOrUpdateBaseResearchResultInfos(
- JSON.stringify(data),
- JSON.stringify(that.resultForm.public.fileMap),
- JSON.stringify(that.resultForm.public.coverFileMap),
- JSON.stringify(that.resultForm.public.catalogFileMap),
- token
- ).then(result => {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '发布成功',
- type: 'success'
- });
- } else {
- this.$message({
- message: 'Release Success',
- type: 'success'
- });
- }
- this.toResource()
- }).catch((error) => {
- this.resetToken();
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '发布失败',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Release Error',
- type: 'error'
- });
- }
- this.toResource()
- });
- });
- },
- //调研资源表单验证
- onResourceVerify(resourceForm,resourceType){
- const that = this;
- let bool = true;
- let resourceBools = [];
- const p1 = new Promise((resolve, reject) => {
- that.$refs[resourceType].some((i)=>{
- if(that.checkType){
- i.validate((valid) =>{
- resourceBools.push(valid)
- if(valid){
- resolve()
- }
- })
- }
- })
- })
- const p2 = new Promise((resolve, reject) => {
- that.$refs[resourceForm].some((i)=>{
- if(that.checkType){
- i.validate((valid) =>{
- resourceBools.push(valid)
- if(valid){
- resolve()
- }
- })
- }
- })
- })
- resourceBools.some(item =>{
- if(item == false){
- bool = false
- return true;
- }
- })
- if(bool){
- // 表单验证通过,写业务代码
- Promise.all([p1, p2]).then( () => {
- that.onSubmitResource()
- })
- }else{
- that.$message({
- message: that.$i18n.locale.toUpperCase() == 'ZH'?'必填项未填!': 'The required fields are not filled in!',
- type: 'error'
- });
- }
- },
- //调研资源提交表单
- onSubmitResource(){
- const that = this;
- //选择器
- let data = []
- that.languageList.forEach((i)=>{
- let resourceForm = {
- language:'',
- reserveOne:1, // 资源类型
- researchResourcesType:'',
- name:'',
- address:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- contactsEmail: '',
- researchResultAbstract:'',
- dockingMode:'',
- details:'',
- mattersNeedingAttention:'',
- }
- resourceForm.language = i.value;
- // resourceForm.details = that.resourceForm[i.value].activityPreviewUe1;
- // resourceForm.mattersNeedingAttention = that.resourceForm[i.value].activityPreviewUe2;
- resourceForm.researchResourcesType = that.resourceForm.public.resourceTypeSelectValue2.value;
- resourceForm.name = that.resourceForm[i.value].name;
- resourceForm.address = that.resourceForm[i.value].address;
- resourceForm.affiliatedUnitName = that.resourceForm[i.value].affiliatedUnitName;
- resourceForm.contactsName = that.resourceForm[i.value].contactsName;
- resourceForm.contactsNumber = that.resourceForm[i.value].contactsNumber;
- resourceForm.contactsEmail = that.resourceForm[i.value].contactsEmail;
- resourceForm.researchResultAbstract = that.resourceForm[i.value].researchResultAbstract;
- resourceForm.continent = that.resourceForm[i.value].resourceCountrySelectValue1.value;
- resourceForm.country = that.resourceForm[i.value].resourceCountrySelectValue2.value;
- if(that.resourceForm.public.radioList.length!=0&&that.resourceForm.public.radioList.length!=undefined){
- if(that.resourceForm.public.radio==that.resourceForm.public.radioList[0].label){
- that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[0].value
- }else if(that.resourceForm.public.radio==that.resourceForm.public.radioList[1].label){
- that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[1].value
- }
- }
- resourceForm.dockingMode = that.resourceForm[i.value].dockingMode
- data.push(resourceForm)
- if(that.resourceForm[i.value].mediaFileMap){
- this.resourceForm.public.mediaFileMap.set(i.value,that.resourceForm[i.value].mediaFileMap)
- }
- if(that.resourceForm[i.value].videoFileMap){
- this.resourceForm.public.videoFileMap.set(i.value,that.resourceForm[i.value].videoFileMap)
- }
- if(that.resourceForm[i.value].fileMap){
- this.resourceForm.public.fileMap.set(i.value,that.resourceForm[i.value].fileMap)
- }
- if(that.resourceForm[i.value].activityPreviewUe1){
- this.resourceForm.public.details.set(i.value,that.resourceForm[i.value].activityPreviewUe1)
- }
- if(that.resourceForm[i.value].activityPreviewUe2){
- this.resourceForm.public.mattersNeedingAttention.set(i.value,that.resourceForm[i.value].activityPreviewUe2)
- }
- });
- let token = getToken();
- this.submitHandler((token) => {
- saveOrUpdateBaseResearchResourcesInfos(
- JSON.stringify(data),
- JSON.stringify(that.resourceForm.public.fileMap),
- JSON.stringify(that.resourceForm.public.mediaFileMap),
- JSON.stringify(that.resourceForm.public.videoFileMap),
- JSON.stringify(that.resourceForm.public.details),
- JSON.stringify(that.resourceForm.public.mattersNeedingAttention),
- token
- ).then(result => {
- // point_task_upload_resources_result
- //
- addIntegral("point_task_upload_resources_result", "30");
- var zhId = result.data.ZH;
- var enId = result.data.EN;
- that.saveInformation(enId,zhId,that.resourceForm);
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '发布成功',
- type: 'success'
- });
- } else {
- this.$message({
- message: 'Release Success!',
- type: 'success'
- });
- }
- this.toResource()
- }).catch((error) => {
- this.resetToken();
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '发布失败',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Release Error',
- type: 'error'
- });
- }
- this.toResource()
- });
- });
- },
- // onSubmitResource(formName){
- // const that = this;
- // that.$refs[formName][0].validate((valid) => {
- // if (valid) {
- // //选择器
- // let data = []
- // that.languageList.forEach((i)=>{
- // let resourceForm = {
- // language:'',
- // reserveOne:1, // 资源类型
- // researchResourcesType:'',
- // name:'',
- // address:'',
- // affiliatedUnitName:'',
- // country:'',//国家
- // continent:'',//大洲
- // contactsName:'',
- // contactsNumber:'',
- // contactsEmail: '',
- // researchResultAbstract:'',
- // dockingMode:'',
- // details:'',
- // mattersNeedingAttention:'',
- // }
- // resourceForm.language = i.value;
- // // resourceForm.details = that.resourceForm[i.value].activityPreviewUe1;
- // // resourceForm.mattersNeedingAttention = that.resourceForm[i.value].activityPreviewUe2;
- // resourceForm.researchResourcesType = that.resourceForm.public.resourceTypeSelectValue2.value;
- // resourceForm.name = that.resourceForm[i.value].name;
- // resourceForm.address = that.resourceForm[i.value].address;
- // resourceForm.affiliatedUnitName = that.resourceForm[i.value].affiliatedUnitName;
- // resourceForm.contactsName = that.resourceForm[i.value].contactsName;
- // resourceForm.contactsNumber = that.resourceForm[i.value].contactsNumber;
- // resourceForm.contactsEmail = that.resourceForm[i.value].contactsEmail;
- // resourceForm.researchResultAbstract = that.resourceForm[i.value].researchResultAbstract;
- // resourceForm.continent = that.resourceForm[i.value].resourceCountrySelectValue1.value;
- // resourceForm.country = that.resourceForm[i.value].resourceCountrySelectValue2.value;
- // if(that.resourceForm.public.radioList.length!=0&&that.resourceForm.public.radioList.length!=undefined){
- // if(that.resourceForm.public.radio==that.resourceForm.public.radioList[0].label){
- // that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[0].value
- // }else if(that.resourceForm.public.radio==that.resourceForm.public.radioList[1].label){
- // that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[1].value
- // }
- // }
- // resourceForm.dockingMode = that.resourceForm[i.value].dockingMode
- // data.push(resourceForm)
- // if(that.resourceForm[i.value].mediaFileMap){
- // this.resourceForm.public.mediaFileMap.set(i.value,that.resourceForm[i.value].mediaFileMap)
- // }
- // if(that.resourceForm[i.value].videoFileMap){
- // this.resourceForm.public.videoFileMap.set(i.value,that.resourceForm[i.value].videoFileMap)
- // }
- // if(that.resourceForm[i.value].fileMap){
- // this.resourceForm.public.fileMap.set(i.value,that.resourceForm[i.value].fileMap)
- // }
- // if(that.resourceForm[i.value].activityPreviewUe1){
- // this.resourceForm.public.details.set(i.value,that.resourceForm[i.value].activityPreviewUe1)
- // }
- // if(that.resourceForm[i.value].activityPreviewUe2){
- // this.resourceForm.public.mattersNeedingAttention.set(i.value,that.resourceForm[i.value].activityPreviewUe2)
- // }
- // });
- // let token = getToken();
- // this.submitHandler((token) => {
- // saveOrUpdateBaseResearchResourcesInfos(
- // JSON.stringify(data),
- // JSON.stringify(that.resourceForm.public.fileMap),
- // JSON.stringify(that.resourceForm.public.mediaFileMap),
- // JSON.stringify(that.resourceForm.public.videoFileMap),
- // JSON.stringify(that.resourceForm.public.details),
- // JSON.stringify(that.resourceForm.public.mattersNeedingAttention),
- // token
- // ).then(result => {
- // var zhId = result.data.ZH;
- // var enId = result.data.EN;
- // that.saveInformation(enId,zhId,that.resourceForm);
- // if (this.$i18n.locale.toUpperCase() == 'ZH') {
- // this.$message({
- // message: '发布成功',
- // type: 'success'
- // });
- // } else {
- // this.$message({
- // message: 'Release Success!',
- // type: 'success'
- // });
- // }
- // this.toResource()
- // }).catch((error) => {
- // this.resetToken();
- // if (this.$i18n.locale.toUpperCase() == 'ZH') {
- // this.$message({
- // message: '发布失败',
- // type: 'error'
- // });
- // } else {
- // this.$message({
- // message: 'Release Error',
- // type: 'error'
- // });
- // }
- // this.toResource()
- // });
- // });
- // } else {
- // if (this.$i18n.locale.toUpperCase() == 'ZH') {
- // this.$message({
- // message: '必填项未填!',
- // type: 'error'
- // });
- // } else {
- // this.$message({
- // message: 'The required fields are not filled in!',
- // type: 'error'
- // });
- // }
- // }
- // });
- // },
- saveInformation(enId,zhId,resourceForm){
- if (zhId != "" && zhId != undefined && zhId != 'undefined') {
- let cmsInformationInfo = {
- title: "资源介绍",
- typeDict: "1",
- businessType : "base_research_resource_info",
- businessId : zhId,
- topFlag: "0",
- weight: "1",
- publishChannelDict: "2",
- havePicture: "y",
- picturePosition: "L",
- content: resourceForm["ZH"].activityPreviewUe1,
- contentHtml: resourceForm["ZH"].activityPreviewUe1,
- sourceDict: "1",
- informationStatusDict: "1",
- language: "ZH",
- }
- let token = getToken();
- saveOrUpdateCmsInformation(JSON.stringify(cmsInformationInfo), token)
- let cmsInformationInfo2 = {
- title: "注意事项",
- typeDict: "1",
- businessType : "base_research_resource_info",
- businessId : zhId,
- topFlag: "0",
- weight: "1",
- publishChannelDict: "2",
- havePicture: "y",
- picturePosition: "L",
- content: resourceForm["ZH"].activityPreviewUe2,
- contentHtml : resourceForm["ZH"].activityPreviewUe2,
- sourceDict: "1",
- informationStatusDict: "1",
- language: "ZH",
- }
- saveOrUpdateCmsInformation(JSON.stringify(cmsInformationInfo2), token)
- }
- if (enId != "" && enId != undefined && enId != 'undefined') {
- let cmsInformationInfo = {
- title: "Resources Introduction",
- typeDict: "1",
- businessType : "base_research_resource_info",
- businessId : enId,
- topFlag: "0",
- weight: "1",
- publishChannelDict: "2",
- havePicture: "y",
- picturePosition: "L",
- content: resourceForm["EN"].activityPreviewUe1,
- contentHtml: resourceForm["EN"].activityPreviewUe1,
- sourceDict: "1",
- informationStatusDict: "1",
- language: "EN",
- }
- let token = getToken();
- saveOrUpdateCmsInformation(JSON.stringify(cmsInformationInfo), token)
- let cmsInformationInfo2 = {
- title: "Cautions",
- typeDict: "1",
- businessType : "base_research_resource_info",
- businessId : enId,
- topFlag: "0",
- weight: "1",
- publishChannelDict: "2",
- havePicture: "y",
- picturePosition: "L",
- content: resourceForm["EN"].activityPreviewUe2,
- contentHtml: resourceForm["EN"].activityPreviewUe2,
- sourceDict: "1",
- informationStatusDict: "1",
- language: "EN",
- }
- saveOrUpdateCmsInformation(JSON.stringify(cmsInformationInfo2), token)
- }
- },
- //富文本
- activityPreviewUe1(data){
- let ele = this.languageList[this.languageTabsValue-0-1].value
- this.resourceForm[ele].activityPreviewUe1 = data;
- },
- activityPreviewUe2(data){
- let ele = this.languageList[this.languageTabsValue-0-1].value
- this.resourceForm[ele].activityPreviewUe2 = data;
- },
- }
- }
- </script>
- <style scoped>
- .box {
- margin-top: 10px;
- background: #fff;
- /* height: 500px; */
- padding: 20px 0;
- }
- .crumbs {
- margin:0 20px;
- }
- .content{
- width: 100%;
- padding: 20px 10px;
- box-sizing: border-box;
- }
- .content .addLanguage{
- width: 100%;
- height: 50px;
- border-bottom: 1px solid #666666;
- }
- .content .issue{
- margin-top: 15px;
- }
- </style>
|