resourceform.vue 105 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861
  1. <template>
  2. <div class="autoBox box">
  3. <div class="crumbs">
  4. <div style="overflow: hidden">
  5. <el-breadcrumb separator-class="el-icon-arrow-right" style="float: left">
  6. <el-breadcrumb-item :to="{ path: 'home' }">{{$t('common.Home')}}</el-breadcrumb-item>
  7. <el-breadcrumb-item :to="{ path: 'realTimeInfo1' }" class="pointer">{{$t('common.NewsData')}}</el-breadcrumb-item>
  8. <el-breadcrumb-item>{{$t('common.resourceWantRelease')}}</el-breadcrumb-item>
  9. </el-breadcrumb>
  10. </div>
  11. <div class="content">
  12. <div class="addLanguage">
  13. <i class="el-icon-orange" style="font-size: 30px;line-height: 50px;color: #E6A23C;vertical-align: middle;"></i>
  14. <span style="font-size: 18px;line-height: 50px;margin-left: 20px;vertical-align: middle;">{{$t('common.resourceLanguageVersion')}}</span>
  15. <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>
  16. </div>
  17. <div v-show="screen==0">
  18. <div class="issue">
  19. <el-tabs v-model="languageTabsValue" type="card" closable @tab-remove="removeTab">
  20. <el-tab-pane
  21. v-for="(item, index) in languageList"
  22. :key="item.name"
  23. :label="$t(item.label)"
  24. :name="item.name"
  25. >
  26. <div style="width: 100%;padding: 0 150px;box-sizing: border-box">
  27. <el-form ref="resultType" :model="resultForm.public" label-width="160px" :rules="resultTypeRules">
  28. <!--资源类型 研究成果-->
  29. <el-form-item :label="$t('common.resourceTheResourceType')" prop="resourceTypeSelectValue1">
  30. <el-select style="width: 320px;" v-model="resultForm.public.resourceTypeSelectValue1" :placeholder="$t('common.resource')" @change="resourceType">
  31. <el-option
  32. v-for="item in resultForm.public.resourceTypeSelect"
  33. :label="$t(item.label)"
  34. :value="item">
  35. </el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item :label="$t('common.resourceTheResourceSubtype')" prop="resourceTypeSelectValue2">
  39. <el-select v-model="resultForm.public.resourceTypeSelectValue2" :placeholder="$t('common.resourcePleaseSelectTheSecondaryType')" style="width: 320px;">
  40. <el-option
  41. v-for="item in resultForm.public.resourceTypeSelectOption"
  42. :label="item.label"
  43. :value="item">
  44. </el-option>
  45. </el-select>
  46. </el-form-item>
  47. </el-form>
  48. <el-form ref="resultForm" :model="resultForm[item.value]" label-width="160px" :rules="resultFormRules">
  49. <!--成果封面-->
  50. <el-form-item :label="$t('common.resourceResultsTheCover')">
  51. <el-upload
  52. class="upload-demo"
  53. action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_cover"
  54. :before-upload="beforeUploadCover"
  55. :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'coverFileMap')}"
  56. :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'coverFileMap')}"
  57. list-type="picture"
  58. :on-success="handleAvatarSuccess.bind(this,0,'coverFileMap')"
  59. :limit="1"
  60. :headers="myHeaders"
  61. :file-list="fileList">
  62. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  63. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}}</div>
  64. </el-upload>
  65. </el-form-item>
  66. <!--名称-->
  67. <el-form-item :label="$t('common.resultsName')" prop="name">
  68. <el-input v-model="resultForm[item.value].name" maxlength="100" show-word-limit
  69. :placeholder="$t('common.resourcePleaseEnterTheName')"
  70. ></el-input>
  71. </el-form-item>
  72. <!--所属单位-->
  73. <el-form-item :label="$t('common.resourceSubordinateUnits')" prop="affiliatedUnitName">
  74. <el-input v-model="resultForm[item.value].affiliatedUnitName" maxlength="100" show-word-limit
  75. :placeholder="$t('common.resourcePleaseEnterUnit')"
  76. ></el-input>
  77. </el-form-item>
  78. <!--国家-->
  79. <!-- <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue2">
  80. <el-select style="width: 320px;" v-model="resultForm[item.value].resourceCountrySelectValue1" :placeholder="$t('common.resourcePleaseSelectContinent')">
  81. <el-option
  82. v-for="item in resultForm[item.value].resourceCountrySelect"
  83. :label="item.label"
  84. :value="item">
  85. </el-option>
  86. </el-select>
  87. <el-select v-model="resultForm[item.value].resourceCountrySelectValue2" :placeholder="$t('common.resourcePleaseSelectCountry')"
  88. :no-data-text="$i18n.locale=='zh'?'无数据':'no data'" style="width: 320px;float: right;">
  89. <el-option
  90. v-for="item in resultForm[item.value].resourceCountrySelectValue1.data"
  91. :label="item.label"
  92. :value="item">
  93. </el-option>
  94. </el-select>
  95. </el-form-item> -->
  96. <!-- 国家 -->
  97. <el-row>
  98. <el-col :span="12">
  99. <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue1">
  100. <el-select style="width: 320px;" v-model="resultForm[item.value].resourceCountrySelectValue1" :placeholder="$t('common.resourcePleaseSelectContinent')">
  101. <el-option
  102. v-for="item in resultForm[item.value].resourceCountrySelect"
  103. :label="item.label"
  104. :value="item">
  105. </el-option>
  106. </el-select>
  107. </el-form-item>
  108. </el-col>
  109. <el-col :span="12">
  110. <el-form-item prop="resourceCountrySelectValue2">
  111. <el-select v-model="resultForm[item.value].resourceCountrySelectValue2" :placeholder="$t('common.resourcePleaseSelectCountry')"
  112. :no-data-text="$i18n.locale=='zh'?'无数据':'no data'" style="width: 320px;float: right;">
  113. <el-option
  114. v-for="item in resultForm[item.value].resourceCountrySelectValue1.data"
  115. :label="item.label"
  116. :value="item">
  117. </el-option>
  118. </el-select>
  119. </el-form-item>
  120. </el-col>
  121. </el-row>
  122. <!--联系人-->
  123. <el-form-item :label="$t('common.resourceTheContact')">
  124. <el-input v-model="resultForm[item.value].contactsName" maxlength="100" show-word-limit
  125. :placeholder="$t('common.resourcePleaseEnterTheContactName')"
  126. ></el-input>
  127. </el-form-item>
  128. <!--联系电话-->
  129. <el-form-item :label="$t('common.resourceContactPhoneNumber')" prop="contactsNumber">
  130. <el-input v-model="resultForm[item.value].contactsNumber" maxlength="50" show-word-limit style="width: 500px;"
  131. :placeholder="$t('common.resourcePleaseEnterYourContactNumber')"
  132. ></el-input>
  133. </el-form-item>
  134. <!--摘要-->
  135. <el-form-item :label="$t('common.resourceDetailsAbstract')" prop="researchResultAbstract">
  136. <el-input
  137. type="textarea"
  138. :placeholder="$t('common.resourcePleaseEnterSummary')"
  139. v-model="resultForm[item.value].researchResultAbstract"
  140. maxlength="5000"
  141. show-word-limit
  142. rows="6"
  143. >
  144. </el-input>
  145. </el-form-item>
  146. <!--目录-->
  147. <!-- <el-form-item :label="$t('common.resourceDetailsDirectory')" required>
  148. <el-upload
  149. class="upload-demo"
  150. action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_catalog"
  151. :before-upload="beforeUploadCatalog"
  152. :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'catalogFileMap')}"
  153. :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'catalogFileMap')}"
  154. list-type="picture"
  155. :on-success="handleAvatarSuccess.bind(this,0,'catalogFileMap')"
  156. :limit="1"
  157. :headers="myHeaders"
  158. :file-list="fileList">
  159. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  160. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}},{{$t('common.resourceUploadOne')}}</div>
  161. </el-upload>
  162. </el-form-item> -->
  163. <!--附件-->
  164. <el-form-item :label="$t('common.resourceTheAttachment')">
  165. <el-upload
  166. class="upload-demo"
  167. action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_file"
  168. :before-upload="beforeUploadFile"
  169. :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'fileMap')}"
  170. :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'fileMap')}"
  171. :on-success="handleAvatarSuccess.bind(this,0,'fileMap')"
  172. :limit="1"
  173. :headers="myHeaders"
  174. :file-list="fileList">
  175. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  176. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadPDF')}},{{$t('common.resourceFilesCannotExceed50Mb')}}</div>
  177. </el-upload>
  178. </el-form-item>
  179. <el-form-item style="text-align: center;">
  180. <el-button style="margin-right: 50px;" type="primary" @click="onResultsVerify('resultForm','resultType')">{{$t('common.resourceRelease')}}</el-button>
  181. <el-button @click="toResource">{{$t('common.resourceCancel')}}</el-button>
  182. </el-form-item>
  183. </el-form>
  184. </div>
  185. </el-tab-pane>
  186. </el-tabs>
  187. </div>
  188. </div>
  189. <div v-show="screen==1">
  190. <div class="issue">
  191. <el-tabs v-model="languageTabsValue" type="card" closable @tab-remove="removeTab">
  192. <el-tab-pane
  193. v-for="(item, index) in languageList"
  194. :key="item.name"
  195. :label="$t(item.label)"
  196. :name="item.name"
  197. >
  198. <div style="width: 100%;padding: 0 150px;box-sizing: border-box">
  199. <el-form ref="resourceType" :model="resourceForm.public" label-width="160px" :rules="resourceTypeRules">
  200. <!--资源类型 调研资源-->
  201. <el-form-item :label="$t('common.resourceTheResourceType')" prop="resourceTypeSelectValue1">
  202. <el-select style="width: 320px;" v-model="resourceForm.public.resourceTypeSelectValue1" :placeholder="$t('common.resource')" @change="resourceType">
  203. <el-option
  204. v-for="item in resourceForm.public.resourceTypeSelect"
  205. :label="$t(item.label)"
  206. :value="item">
  207. </el-option>
  208. </el-select>
  209. </el-form-item>
  210. <el-form-item :label="$t('common.resourceTheResourceSubtype')" prop="resourceTypeSelectValue2">
  211. <el-select v-model="resourceForm.public.resourceTypeSelectValue2" :placeholder="$t('common.resourcePleaseSelectTheSecondaryType')" style="width: 320px;">
  212. <el-option
  213. v-for="item in resourceForm.public.resourceTypeSelectOption"
  214. :label="item.label"
  215. :value="item">
  216. </el-option>
  217. </el-select>
  218. </el-form-item>
  219. <!--对接方式-->
  220. <el-form-item :label="$t('common.resourceDockingWay')" prop="radio">
  221. <el-radio-group v-model="resourceForm.public.radio">
  222. <el-radio :label="$t('common.resourceDockingOfTheUnit')"></el-radio>
  223. <el-radio :label="$t('common.resourceCooperationOrganizationDocking')"></el-radio>
  224. </el-radio-group>
  225. </el-form-item>
  226. </el-form>
  227. <el-form ref="resourceForm" :model="resourceForm[item.value]" label-width="160px" :rules="resourceFormRules">
  228. <!--资源媒体-->
  229. <el-form-item :label="$t('common.resourceMediaResources')" >
  230. <!-- <el-select v-model="resourceForm[item.value].resourceMediaSelectValue" :placeholder="$t('common.resourceThePicture')" @change="resourceType" style="width: 320px;">
  231. <el-option
  232. v-for="item in resourceForm[item.value].resourceMediaSelect"
  233. :label="$t(item.label)"
  234. :value="item">
  235. </el-option>
  236. </el-select> -->
  237. <el-upload
  238. class="upload-demo"
  239. action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
  240. :before-upload="beforeUploadCover"
  241. :on-remove="(file, fileList) => {onRemove(file, fileList, 1,'mediaFileMap')}"
  242. :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'mediaFileMap')}"
  243. :on-success="handleAvatarSuccess.bind(this,1,'mediaFileMap')"
  244. :limit="1"
  245. :headers="myHeaders"
  246. :file-list="fileList">
  247. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  248. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}}</div>
  249. </el-upload>
  250. </el-form-item>
  251. <!-- <el-form-item :label="$t('common.resourceMediaResources')" >
  252. <el-select v-model="resourceForm[item.value].resourceMediaSelectValue" :placeholder="$t('common.resourceThePicture')" @change="resourceType" style="width: 320px;">
  253. <el-option
  254. v-for="item in resourceForm[item.value].resourceMediaSelect"
  255. :label="$t(item.label)"
  256. :value="item">
  257. </el-option>
  258. </el-select>
  259. <el-upload
  260. v-show="resourceForm[item.value].resourceMediaSelectValue.value=='图片'||resourceForm[item.value].resourceMediaSelectValue.value=='图片+视频'"
  261. class="upload-demo"
  262. action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
  263. :before-upload="beforeUploadCover"
  264. :on-remove="(file, fileList) => {onRemove(file, fileList, 1,'mediaFileMap')}"
  265. :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'mediaFileMap')}"
  266. :on-success="handleAvatarSuccess.bind(this,1,'mediaFileMap')"
  267. :limit="1"
  268. :headers="myHeaders"
  269. :file-list="fileList">
  270. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  271. <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>
  272. </el-upload>
  273. <el-upload
  274. v-show="resourceForm[item.value].resourceMediaSelectValue.value=='视频'||resourceForm[item.value].resourceMediaSelectValue.value=='图片+视频'"
  275. class="upload-demo"
  276. action="/api/resourceshare/baseResearchResourcesInfos/uploadVideo"
  277. :before-upload="beforeUploadVideo"
  278. :on-remove="(file, fileList) => {onPreview(file, fileList, 1,'videoFileMap')}"
  279. :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'videoFileMap')}"
  280. :on-success="handleAvatarSuccessVideo.bind(this,1,'videoFileMap')"
  281. :limit="1"
  282. :headers="myHeaders"
  283. :file-list="fileList"
  284. :data="video"
  285. name="layuiVideo">
  286. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  287. <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>
  288. </el-upload>
  289. </el-form-item> -->
  290. <!--名称-->
  291. <el-form-item :label="$t('common.resourceName')" prop="name">
  292. <el-input v-model="resourceForm[item.value].name" maxlength="100" show-word-limit
  293. :placeholder="$t('common.resourcePleaseEnterTheName')"
  294. ></el-input>
  295. </el-form-item>
  296. <!--所属单位-->
  297. <el-form-item :label="$t('common.resourceSubordinateUnits')" prop="affiliatedUnitName">
  298. <el-input v-model="resourceForm[item.value].affiliatedUnitName" maxlength="100" show-word-limit
  299. :placeholder="$t('common.resourcePleaseEnterUnit')"
  300. ></el-input>
  301. </el-form-item>
  302. <!--地址-->
  303. <el-form-item :label="$t('common.resourceAddress')" prop="address">
  304. <el-input v-model="resourceForm[item.value].address" maxlength="100" show-word-limit
  305. :placeholder="$t('common.resourcePleaseEnterAddress')"
  306. ></el-input>
  307. </el-form-item>
  308. <!--国家-->
  309. <!-- <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue2">
  310. <el-select style="width: 320px;" v-model="resourceForm[item.value].resourceCountrySelectValue1"
  311. :no-data-text="$i18n.locale=='zh'?'无数据':'no data'"
  312. :placeholder="$t('common.resourcePleaseSelectContinent')">
  313. <el-option
  314. v-for="item in resourceForm[item.value].resourceCountrySelect"
  315. :label="item.label"
  316. :value="item">
  317. </el-option>
  318. </el-select>
  319. <el-select v-model="resourceForm[item.value].resourceCountrySelectValue2"
  320. :no-data-text="$i18n.locale=='zh'?'无数据':'no data'"
  321. :placeholder="$t('common.resourcePleaseSelectCountry')" style="width: 320px;float: right;">
  322. <el-option
  323. v-for="item in resourceForm[item.value].resourceCountrySelectValue1.data"
  324. :label="item.label"
  325. :value="item">
  326. </el-option>
  327. </el-select>
  328. </el-form-item> -->
  329. <!-- 国家 -->
  330. <el-row>
  331. <el-col :span="12">
  332. <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue1">
  333. <el-select style="width: 320px;" v-model="resourceForm[item.value].resourceCountrySelectValue1"
  334. :no-data-text="$i18n.locale=='zh'?'无数据':'no data'"
  335. :placeholder="$t('common.resourcePleaseSelectContinent')">
  336. <el-option
  337. v-for="item in resourceForm[item.value].resourceCountrySelect"
  338. :label="item.label"
  339. :value="item">
  340. </el-option>
  341. </el-select>
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="12">
  345. <el-form-item prop="resourceCountrySelectValue2">
  346. <el-select v-model="resourceForm[item.value].resourceCountrySelectValue2"
  347. :no-data-text="$i18n.locale=='zh'?'无数据':'no data'"
  348. :placeholder="$t('common.resourcePleaseSelectCountry')" style="width: 320px;float: right;">
  349. <el-option
  350. v-for="item in resourceForm[item.value].resourceCountrySelectValue1.data"
  351. :label="item.label"
  352. :value="item">
  353. </el-option>
  354. </el-select>
  355. </el-form-item>
  356. </el-col>
  357. </el-row>
  358. <!--对接方式-->
  359. <!-- <el-form-item :label="$t('common.resourceDockingWay')" prop="radio">
  360. <el-radio-group v-model="resourceForm.public.radio">
  361. <el-radio :label="$t('common.resourceDockingOfTheUnit')"></el-radio>
  362. <el-radio :label="$t('common.resourceCooperationOrganizationDocking')"></el-radio>
  363. </el-radio-group>
  364. </el-form-item> -->
  365. <!--联系人-->
  366. <el-form-item :label="$t('common.resourceTheContact')" prop="contactsName">
  367. <el-input v-model="resourceForm[item.value].contactsName" maxlength="100" show-word-limit
  368. :placeholder="$t('common.resourcePleaseEnterTheContactName')"
  369. ></el-input>
  370. </el-form-item>
  371. <!--联系电话-->
  372. <el-form-item :label="$t('common.resourceContactPhoneNumber')" prop="contactsNumber">
  373. <el-input v-model="resourceForm[item.value].contactsNumber" maxlength="50" show-word-limit style="width: 500px;"
  374. :placeholder="$t('common.resourcePleaseEnterYourContactNumber')"
  375. ></el-input>
  376. </el-form-item>
  377. <!--邮箱-->
  378. <el-form-item :label="$t('common.resourceEmail')" prop="contactsEmail">
  379. <el-input v-model="resourceForm[item.value].contactsEmail" maxlength="100" show-word-limit
  380. :placeholder="$t('common.ContactinformationEmail')"
  381. ></el-input>
  382. </el-form-item>
  383. <!--详情介绍-->
  384. <el-form-item :label="$t('common.resourceDetailsAreIntroduced')">
  385. <div style="width: 100%;border: 1px solid rgba(204, 204, 204, 1);">
  386. <div style="width: 80px;height: 400px;float: left;text-align: center;">
  387. <span style="display: inline-block;margin-top: 150px">{{$t('common.resourceResourcesIsIntroduced')}}</span>
  388. </div>
  389. <div style="height: 100%;float: left;overflow: hidden;width: calc(100% - 81px);position: relative;">
  390. <layui-inline-ue
  391. label=""
  392. :cssStyle="{'width':'100%','height':'100%'}"
  393. @input="activityPreviewUe1"
  394. :value="resourceForm[item.value].activityPreviewUe1"
  395. ref="contentUe">
  396. </layui-inline-ue>
  397. </div>
  398. <div style="clear: both"></div>
  399. </div>
  400. <div style="width: 100%;border: 1px solid rgba(204, 204, 204, 1);margin-top: 80px;">
  401. <div style="width: 80px;height: 400px;float: left;text-align: center;">
  402. <span style="display: inline-block;margin-top: 150px">{{$t('common.resourceMattersNeedingAttention')}}</span>
  403. </div>
  404. <div style="height: 100%;float: left;overflow: hidden;width: calc(100% - 81px);position: relative;">
  405. <layui-inline-ue
  406. label=""
  407. :cssStyle="{'width':'100%','height':'100%'}"
  408. @input="activityPreviewUe2"
  409. :value="resourceForm[item.value].activityPreviewUe2"
  410. ref="contentUe">
  411. </layui-inline-ue>
  412. </div>
  413. <div style="clear: both"></div>
  414. </div>
  415. <!--<div v-for="(item,index) in "
  416. style="width: 100%;height: 200px;border: 1px solid rgba(204, 204, 204, 1);"
  417. :style="{marginTop: index==0?'0':'20px'}"
  418. >
  419. <div style="width: 80px;height: 200px;float: left;border-right: 1px solid rgba(204, 204, 204, 1);line-height: 100%;text-align: center;">
  420. <span style="line-height: 200px">注意事项</span>
  421. </div>
  422. <div style="height: 100%;float: left;overflow: hidden;width: calc(50% - 81px);">
  423. </div>
  424. <div style="clear: both"></div>
  425. </div>-->
  426. </el-form-item>
  427. <!--附件-->
  428. <!-- <el-form-item :label="$t('common.resourceTheAttachment')">
  429. <el-upload
  430. class="upload-demo"
  431. action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
  432. :before-upload="beforeUploadFile"
  433. :on-remove="(file, fileList) => {onRemove(file, fileList, 1,'fileMap')}"
  434. :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'fileMap')}"
  435. :on-success="handleAvatarSuccess.bind(this,1,'fileMap')"
  436. :limit="1"
  437. :headers="myHeaders"
  438. :file-list="fileList">
  439. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  440. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceHint')}}{{$t('common.resourceUploadPDF')}},{{$t('common.resourceFilesCannotExceed50Mb')}}</div>
  441. </el-upload>
  442. </el-form-item> -->
  443. <el-form-item style="text-align: center;">
  444. <el-button style="margin-right: 50px;" type="primary" @click="onResourceVerify('resourceForm','resourceType')">{{$t('common.resourceRelease')}}</el-button>
  445. <el-button @click="toResource">{{$t('common.resourceCancel')}}</el-button>
  446. </el-form-item>
  447. </el-form>
  448. </div>
  449. </el-tab-pane>
  450. </el-tabs>
  451. </div>
  452. </div>
  453. </div>
  454. </div>
  455. <!--添加语言版本-->
  456. <el-dialog
  457. :title="$t('common.resourceLanguageVersion')"
  458. :visible.sync="addLanguageDialog"
  459. width="30%">
  460. <div style="width: 100%;">
  461. <el-select v-model="addLanguageValue" style="width: 70%" :placeholder="$t('common.resourcePleaseSelect')">
  462. <el-option
  463. v-for="(item,index) in addLanguageOptions"
  464. :label="$t(item.label)"
  465. :value="item"
  466. v-show="!item.added">
  467. </el-option>
  468. </el-select>
  469. </div>
  470. <span slot="footer" class="dialog-footer">
  471. <el-button @click="languageClose">{{$t('common.cancel')}}</el-button>
  472. <el-button type="primary" @click="addTab">{{$t('common.submit')}}</el-button>
  473. </span>
  474. </el-dialog>
  475. <!--预览-->
  476. <el-dialog
  477. :visible.sync="dialogVisible"
  478. width="60%"
  479. height="80%"
  480. :before-close="beforeClose">
  481. <div>
  482. <!-- <img :src="'api/file/pub/'+ dialogVisibleImg" alt="">-->
  483. <img :src="'api/file/pub/'+ dialogVisibleImg" alt="" style="width: 100%" v-show="dialogVisibleImg!=''">
  484. <video :src="'api/file/pub/'+ dialogVisibleVideo" style="width: 100%" v-show="dialogVisibleVideo!=''"></video>
  485. <iframe :src="'api/file/pub/'+ dialogVisiblePdf" frameborder="0" v-show="dialogVisiblePdf!=''" style="width: 100%;height: 800px;"></iframe>
  486. </div>
  487. </el-dialog>
  488. </div>
  489. </template>
  490. <script>
  491. import Base from "@/views/base/Base";
  492. import {getDicts} from '@/api/dict';
  493. import { getToken ,resetToken} from '@/utils/auth'
  494. import LayuiInlineUe from '@/components/LayuiInlineUe'
  495. import { getTreeByLanguagePortal } from "@/api/operation/baseCityInformationDict";
  496. import { saveOrUpdateBaseResearchResultInfos } from "@/api/research/baseResearchResultEntity";
  497. import { saveOrUpdateBaseResearchResourcesInfos } from "@/api/research/resource/baseResearchResourcesEntity";
  498. import { saveOrUpdateCmsInformation } from "@/api/cms/cmsInformationEntity";
  499. import { addIntegral } from "@/utils/toCompleteTask";
  500. export default {
  501. name:"resourceform",
  502. extends: Base,
  503. components:{ LayuiInlineUe },
  504. data(){
  505. return{
  506. // 发布资源切换
  507. screen:0,
  508. // 上传视频附属data
  509. video:{dir:'media'},
  510. // 上传文件预览
  511. dialogVisible:false,
  512. dialogVisibleImg:'',
  513. dialogVisibleVideo:'',
  514. dialogVisiblePdf:'',
  515. //表单头信息
  516. myHeaders: {Authorization: ('Bearer ' +getToken())},
  517. fileList:[],
  518. // 已添加语言版本
  519. languageTabsValue: '1',
  520. languageList:[],
  521. tabIndex: 0,
  522. // 可添加语言版本
  523. addLanguageDialog:false,
  524. addLanguageValue: '',
  525. addLanguageOptions: [
  526. {
  527. label: "common.Chinese",
  528. name: '1',
  529. value: 'ZH',
  530. added: false,
  531. },
  532. {
  533. label: 'common.English',
  534. name: '2',
  535. value: 'EN',
  536. added: false,
  537. },
  538. ],
  539. // 语言字典列表
  540. languageDataList: [],
  541. // 表单数据对象
  542. resultForm:{
  543. public:{
  544. resourceTypeSelectValue1:'',
  545. resourceTypeSelectValue2:'',
  546. resourceTypeSelectOption:[],
  547. resourceTypeSelect:[
  548. {
  549. label:'common.resource',
  550. value:'研究成果',
  551. },
  552. {
  553. label:'common.researchResource',
  554. value:'调研资源',
  555. },
  556. ],
  557. fileMap: new Map(),
  558. coverFileMap: new Map(),
  559. catalogFileMap: new Map(),
  560. },
  561. template:{
  562. language:"EN",
  563. reserveOne:0, // 资源类型
  564. researchResultType:'',
  565. name:'',
  566. affiliatedUnitName:'',
  567. country:'',//国家
  568. continent:'',//大洲
  569. contactsName:'',
  570. contactsNumber:'',
  571. researchResultAbstract:'',
  572. resourceCountrySelectValue1:'',
  573. resourceCountrySelectValue2:'',
  574. resourceCountrySelect:[],
  575. fileMap: '',
  576. coverFileMap: '',
  577. catalogFileMap: '',
  578. },
  579. },
  580. resourceForm:{
  581. public:{
  582. resourceTypeSelectValue1:'',
  583. resourceTypeSelectValue2:'',
  584. resourceTypeSelectOption:[],
  585. resourceTypeSelect:[
  586. {
  587. label:'common.resource',
  588. value:'研究成果',
  589. },
  590. {
  591. label:'common.researchResource',
  592. value:'调研资源',
  593. },
  594. ],
  595. radio: '',
  596. radioList:[],
  597. mediaFileMap: new Map(),
  598. videoFileMap: new Map(),
  599. fileMap: new Map(),
  600. details:new Map(),
  601. mattersNeedingAttention:new Map(),
  602. },
  603. template:{
  604. language:"EN",
  605. reserveOne:1, // 资源类型
  606. researchResourcesType:'',
  607. name:'',
  608. address:'',
  609. affiliatedUnitName:'',
  610. country:'',//国家
  611. continent:'',//大洲
  612. contactsName:'',
  613. contactsNumber:'',
  614. contactsEmail: '',
  615. researchResultAbstract:'',
  616. dockingMode:'',
  617. resourceMediaSelectValue:'',
  618. resourceMediaSelect:[
  619. {
  620. label:'common.resourceResearchResourceImage',
  621. value:'图片',
  622. },
  623. {
  624. label:'common.resourceResearchResourceVideo',
  625. value:'视频',
  626. },
  627. {
  628. label:'common.resourceResearchResourceImageAndVideo',
  629. value:'图片+视频',
  630. },
  631. ],
  632. resourceCountrySelectValue1:'',
  633. resourceCountrySelectValue2:'',
  634. resourceCountrySelect:[],
  635. mediaFileMap: '',
  636. videoFileMap: '',
  637. fileMap: '',
  638. activityPreviewUe1:'',
  639. activityPreviewUe2:'',
  640. },
  641. },
  642. }
  643. },
  644. mounted() {
  645. // if(this.$route.query.key){
  646. // }
  647. this.initData();
  648. },
  649. watch:{
  650. '$i18n.locale'(){
  651. this.initData();
  652. this.forceUpdate()
  653. },
  654. 'screen'(){
  655. this.$refs.resultForm[0].resetFields()
  656. this.$refs.resourceForm[0].resetFields()
  657. }
  658. },
  659. computed:{
  660. resultTypeRules(){
  661. return{
  662. resourceTypeSelectValue1: [
  663. { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
  664. ],
  665. resourceTypeSelectValue2: [
  666. { required: true, message: this.$i18n.locale=='zh'?'请选择资源子类型':'Select the resource subtype', trigger: 'change' },
  667. ],
  668. }
  669. },
  670. resultFormRules(){
  671. return{
  672. // resultTheResourceType: [
  673. // { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
  674. // ],
  675. name: [
  676. { required: true, message: this.$i18n.locale=='zh'?'请输入名称':'Please enter the name', trigger: 'blur' },
  677. ],
  678. affiliatedUnitName: [
  679. { required: true, message: this.$i18n.locale=='zh'?'请输入所属单位':'Please enter the name of your employer', trigger: 'blur' },
  680. ],
  681. // contactsNumber: [
  682. // { 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}$/,
  683. // message: this.$i18n.locale=='zh'?'请输入合法的手机号':'Please enter a valid mobile phone number',
  684. // trigger: 'blur'
  685. // },
  686. // ],
  687. resourceCountrySelectValue1: [
  688. { required: true, message: this.$i18n.locale=='zh'?'请选择大洲':'Please select a continent', trigger: 'change' },
  689. ],
  690. // resourceCountrySelectValue2: [
  691. // { required: true, message: this.$i18n.locale=='zh'?'请选择大洲':'Please select a continent', trigger: 'change' },
  692. // ],
  693. resourceCountrySelectValue2: [
  694. { required: true, message: this.$i18n.locale=='zh'?'请选择国家':'Please select a country', trigger: 'change' },
  695. ],
  696. researchResultAbstract: [
  697. { required: true, message: this.$i18n.locale=='zh'?'请输入摘要':'Please enter an abstract', trigger: 'blur' },
  698. ],
  699. fileMap:[
  700. { required: true, message: this.$i18n.locale=='zh'?'请上传附件':'Please uploaded file ', trigger: 'change' },
  701. ],
  702. // resultDetailsDirectory: [
  703. // { required: true, message: this.$i18n.locale=='zh'?'请上传目录':'Please upload the directory', trigger: 'blur' },
  704. // ],
  705. // resultTheAttachment: [
  706. // { required: true, message: this.$i18n.locale=='zh'?'请上传附件':'Please upload the attachment.', trigger: 'blur' },
  707. // ],
  708. }
  709. },
  710. resourceTypeRules(){
  711. return{
  712. resourceTypeSelectValue1: [
  713. { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
  714. ],
  715. resourceTypeSelectValue2: [
  716. { required: true, message: this.$i18n.locale=='zh'?'请选择资源子类型':'Select the resource subtype', trigger: 'change' },
  717. ],
  718. radio:[
  719. { required: true, message: this.$i18n.locale=='zh'?'请选择对接方式':'Please select docking method', trigger: 'change' },
  720. ],
  721. }
  722. },
  723. resourceFormRules(){
  724. return{
  725. // resourceTheResourceType: [
  726. // { required: true, message: this.$i18n.locale=='zh'?'请输入活动名称':'Select the resource type', trigger: 'blur' },
  727. // ],
  728. name: [
  729. { required: true, message: this.$i18n.locale=='zh'?'请输入名称':'Please enter the name', trigger: 'blur' },
  730. ],
  731. affiliatedUnitName: [
  732. { required: true, message: this.$i18n.locale=='zh'?'请输入所属单位':'Please enter the name of your employer', trigger: 'blur' },
  733. ],
  734. // contactsNumber: [
  735. // { 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}$/,
  736. // message: this.$i18n.locale=='zh'?'请输入合法的手机号':'Please enter a valid mobile phone number',
  737. // trigger: 'blur'
  738. // },
  739. // ],
  740. address: [
  741. { required: true, message: this.$i18n.locale=='zh'?'请输入地址':'Please enter the address', trigger: 'blur' },
  742. ],
  743. resourceCountrySelectValue1: [
  744. { required: true, message: this.$i18n.locale=='zh'?'请选择大洲':'Please select a continent', trigger: 'change' },
  745. ],
  746. resourceCountrySelectValue2: [
  747. { required: true, message: this.$i18n.locale=='zh'?'请选择国家':'Please select a country', trigger: 'change' },
  748. ],
  749. resourceDetailsAreIntroduced: [
  750. { required: true, message: this.$i18n.locale=='zh'?'请输入详情介绍':'Please enter details', trigger: 'blur' },
  751. ],
  752. contactsEmail: [
  753. // { required: true, message: this.$t('common.PleaseEnter') + ' ' + this.$t('common.Email2'), trigger: 'blur' },
  754. { 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' }
  755. ],
  756. contactsName:[
  757. { required: true, message: this.$i18n.locale=='zh'?'请输入联系人':'Please enter the name of the contact person', trigger: 'blur' },
  758. ],
  759. }
  760. },
  761. },
  762. methods:{
  763. async initData(){
  764. let flag = false
  765. this.languageList = []
  766. this.resetFrom()
  767. if(this.$i18n.locale.toUpperCase() == 'ZH'){
  768. this.addLanguageOptions = [
  769. {
  770. label: "common.Chinese",
  771. name: '1',
  772. value: 'ZH',
  773. added: false,
  774. },
  775. {
  776. label: 'common.English',
  777. name: '2',
  778. value: 'EN',
  779. added: false,
  780. },
  781. ],
  782. this.languageList.forEach((i)=>{
  783. if(i.value=='ZH'){
  784. flag = true;
  785. }
  786. })
  787. if(flag==false){
  788. this.addLanguageValue = {
  789. label: "common.Chinese",
  790. name: '1',
  791. value: 'ZH',
  792. added: false,
  793. };
  794. this.addTab();
  795. }
  796. }else if(this.$i18n.locale.toUpperCase() == 'EN'){
  797. this.addLanguageOptions = [
  798. {
  799. label: "common.English",
  800. name: '1',
  801. value: 'EN',
  802. added: false,
  803. },
  804. {
  805. label: "common.Chinese",
  806. name: '2',
  807. value: 'ZH',
  808. added: false,
  809. },
  810. ],
  811. this.languageList.forEach((i)=>{
  812. if(i.value=='EN'){
  813. flag = true;
  814. }
  815. })
  816. if(flag==false){
  817. this.addLanguageValue = {
  818. label: "common.English",
  819. name: '1',
  820. value: 'EN',
  821. added: false,
  822. };
  823. this.addTab();
  824. }
  825. }
  826. this.getData();
  827. },
  828. resetFrom(){
  829. this.resultForm={
  830. public:{
  831. resourceTypeSelectValue1:'',
  832. resourceTypeSelectValue2:'',
  833. resourceTypeSelectOption:[],
  834. resourceTypeSelect:[
  835. {
  836. label:'common.resource',
  837. value:'研究成果',
  838. },
  839. {
  840. label:'common.researchResource',
  841. value:'调研资源',
  842. },
  843. ],
  844. fileMap: new Map(),
  845. coverFileMap: new Map(),
  846. catalogFileMap: new Map(),
  847. },
  848. template:{
  849. language:"EN",
  850. reserveOne:0, // 资源类型
  851. researchResultType:'',
  852. name:'',
  853. affiliatedUnitName:'',
  854. country:'',//国家
  855. continent:'',//大洲
  856. contactsName:'',
  857. contactsNumber:'',
  858. researchResultAbstract:'',
  859. resourceCountrySelectValue1:'',
  860. resourceCountrySelectValue2:'',
  861. resourceCountrySelect:[],
  862. fileMap: '',
  863. coverFileMap: '',
  864. catalogFileMap: '',
  865. },
  866. }
  867. this.resourceForm={
  868. public:{
  869. resourceTypeSelectValue1:'',
  870. resourceTypeSelectValue2:'',
  871. resourceTypeSelectOption:[],
  872. resourceTypeSelect:[
  873. {
  874. label:'common.resource',
  875. value:'研究成果',
  876. },
  877. {
  878. label:'common.researchResource',
  879. value:'调研资源',
  880. },
  881. ],
  882. radio: '',
  883. radioList:[],
  884. mediaFileMap: new Map(),
  885. videoFileMap: new Map(),
  886. fileMap: new Map(),
  887. details:new Map(),
  888. mattersNeedingAttention:new Map(),
  889. },
  890. template:{
  891. language:"EN",
  892. reserveOne:1, // 资源类型
  893. researchResourcesType:'',
  894. name:'',
  895. address:'',
  896. affiliatedUnitName:'',
  897. country:'',//国家
  898. continent:'',//大洲
  899. contactsName:'',
  900. contactsNumber:'',
  901. contactsEmail: '',
  902. researchResultAbstract:'',
  903. dockingMode:'',
  904. resourceMediaSelectValue:'',
  905. resourceMediaSelect:[
  906. {
  907. label:'common.resourceResearchResourceImage',
  908. value:'图片',
  909. },
  910. {
  911. label:'common.resourceResearchResourceVideo',
  912. value:'视频',
  913. },
  914. {
  915. label:'common.resourceResearchResourceImageAndVideo',
  916. value:'图片+视频',
  917. },
  918. ],
  919. resourceCountrySelectValue1:'',
  920. resourceCountrySelectValue2:'',
  921. resourceCountrySelect:[],
  922. mediaFileMap: '',
  923. videoFileMap: '',
  924. fileMap: '',
  925. activityPreviewUe1:'',
  926. activityPreviewUe2:'',
  927. },
  928. }
  929. },
  930. // async initData(){
  931. // let flag = false
  932. // this.languageList.forEach((i)=>{
  933. // if(i.value=='ZH'){
  934. // flag = true;
  935. // }
  936. // })
  937. // if(flag==false){
  938. // this.addLanguageValue = {
  939. // label: "common.Chinese",
  940. // name: '1',
  941. // value: 'ZH',
  942. // added: false,
  943. // };
  944. // this.addTab();
  945. // }
  946. // this.getData();
  947. // },
  948. // 获取数据
  949. async getData(){
  950. const that = this;
  951. that.resultForm.public.resourceCountrySelectValue1 = '';
  952. that.resultForm.public.resourceCountrySelectValue2 = '';
  953. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  954. await getDicts(
  955. "RESEARCH_RESULT_TYPE_DICT,RESEARCH_RESOURCE_TYPE_DICT,DOCKING_MODE_DICT"
  956. ).then(result => {
  957. if (result.data) {
  958. that.resultForm.public.resourceTypeSelectOption = result.data[0];
  959. that.resourceForm.public.resourceTypeSelectOption = result.data[1];
  960. that.resourceForm.public.radioList = result.data[2];
  961. }
  962. })
  963. await getTreeByLanguagePortal('ZH').then(result => {
  964. if (result.data) {
  965. let values = Object.values(result.data);
  966. that.resultForm.template.resourceCountrySelect = values;
  967. that.resourceForm.template.resourceCountrySelect = values;
  968. that.languageList.forEach((i)=>{
  969. that.resultForm[i.value].resourceCountrySelect = values;
  970. that.resourceForm[i.value].resourceCountrySelect = values;
  971. /*if(that.resultForm[i.value].resourceCountrySelectValue1==''){
  972. that.resultForm[i.value].resourceCountrySelectValue1 = values[0];
  973. that.resourceForm[i.value].resourceCountrySelectValue1 = values[0];
  974. }else{
  975. for(let o=0;o<that.resultForm[i.value].resourceCountrySelect.length;o++){
  976. if(that.resultForm[i.value].resourceCountrySelect[o].value==that.resultForm[i.value].resourceCountrySelectValue1.value){
  977. that.resultForm[i.value].resourceCountrySelectValue1 = that.resultForm[i.value].resourceCountrySelect[o];
  978. }
  979. }
  980. }*/
  981. })
  982. }
  983. })
  984. }else if (this.$i18n.locale.toUpperCase() == 'EN'){
  985. await getDicts(
  986. "RESEARCH_RESULT_TYPE_DICT_EN,RESEARCH_RESOURCE_TYPE_DICT_EN,DOCKING_MODE_DICT_EN"
  987. ).then(result => {
  988. if (result.data) {
  989. that.resultForm.public.resourceTypeSelectOption = result.data[0];
  990. that.resourceForm.public.resourceTypeSelectOption = result.data[1];
  991. that.resourceForm.public.radioList = result.data[2];
  992. }
  993. })
  994. await getTreeByLanguagePortal('EN').then(result => {
  995. if (result.data) {
  996. let values = Object.values(result.data);
  997. that.resultForm.template.resourceCountrySelect = values;
  998. that.resourceForm.template.resourceCountrySelect = values;
  999. that.languageList.forEach((i)=>{
  1000. that.resultForm[i.value].resourceCountrySelect = values;
  1001. that.resourceForm[i.value].resourceCountrySelect = values;
  1002. /*if(that.resultForm[i.value].resourceCountrySelectValue1==''||that.resultForm[i.value].resourceCountrySelectValue1.length==0){
  1003. that.resultForm[i.value].resourceCountrySelectValue1 = values[0];
  1004. that.resourceForm[i.value].resourceCountrySelectValue1 = values[0];
  1005. }else{
  1006. for(let o=0;o<that.resultForm[i.value].resourceCountrySelect.length;o++){
  1007. if(that.resultForm[i.value].resourceCountrySelect[o].value==that.resultForm[i.value].resourceCountrySelectValue1.value){
  1008. that.resultForm[i.value].resourceCountrySelectValue1 = that.resultForm[i.value].resourceCountrySelect[o];
  1009. }
  1010. }
  1011. }*/
  1012. })
  1013. }
  1014. })
  1015. }
  1016. await getDicts(
  1017. "LANGUAGE_DICT"
  1018. ).then(result => {
  1019. if (result.data) {
  1020. that.languageDataList = result.data[0] || [];
  1021. }
  1022. })
  1023. },
  1024. // 添加语言版本
  1025. addTabDialog(targetName) {
  1026. const that = this;
  1027. that.addLanguageDialog = true;
  1028. },
  1029. languageClose(){
  1030. const that = this;
  1031. that.addLanguageDialog = false;
  1032. that.addLanguageValue = "";
  1033. },
  1034. addTab(targetName) {
  1035. const that = this;
  1036. if(that.addLanguageValue){
  1037. let newTabName = ++this.tabIndex + '';
  1038. that.languageList.push({
  1039. label: that.addLanguageValue.label,
  1040. name: that.addLanguageValue.name,
  1041. value: that.addLanguageValue.value,
  1042. });
  1043. that.addLanguageOptions.forEach((i)=>{
  1044. if(i.value == that.addLanguageValue.value){
  1045. i.added = true;
  1046. }
  1047. });
  1048. let resultForm = JSON.parse(JSON.stringify(that.resultForm.template));
  1049. let resourceForm = JSON.parse(JSON.stringify(that.resourceForm.template));
  1050. that.$set(that.resultForm,that.addLanguageValue.value,resultForm)
  1051. that.$set(that.resourceForm,that.addLanguageValue.value,resourceForm)
  1052. that.addLanguageValue = "";
  1053. that.addLanguageDialog = false;
  1054. // that.languageTabsValue = newTabName;
  1055. }else{
  1056. that.languageClose()
  1057. }
  1058. },
  1059. removeTab(targetName) {
  1060. const that = this;
  1061. let tabs = that.languageList;
  1062. let activeName = this.languageTabsValue;
  1063. if (activeName === targetName) {
  1064. tabs.forEach((i, index) => {
  1065. if (i.name === targetName) {
  1066. let nextTab = tabs[index + 1] || tabs[index - 1];
  1067. if (nextTab) {
  1068. activeName = nextTab.name;
  1069. }
  1070. }
  1071. });
  1072. }
  1073. let delIndex = targetName-0-1;
  1074. let delProperty = this.languageList[delIndex]
  1075. delete this.resultForm[delProperty.value];
  1076. delete this.resourceForm[delProperty.value];
  1077. // delete resourceForm[]
  1078. this.languageTabsValue = activeName;
  1079. // this.languageTabsValue = tabs.filter(tab => tab.name !== targetName);
  1080. this.languageList = tabs.filter(tab => tab.name !== targetName);
  1081. this.addLanguageOptions.forEach((i, index) => {
  1082. if (i.name === targetName) {
  1083. i.added = false;
  1084. }
  1085. });
  1086. },
  1087. // 发布资源切换
  1088. resourceType(data){
  1089. let that = this;
  1090. if (data.value === 'Research results' || data.value === '研究成果'){
  1091. if(that.screen == 1){
  1092. that.screen = 0;
  1093. that.resultForm.public.resourceTypeSelectValue1 = {
  1094. label:'common.resource',
  1095. value:'研究成果',
  1096. };
  1097. that.resourceForm.public.resourceTypeSelectValue1 = '';
  1098. }
  1099. }else{
  1100. if(that.screen == 0){
  1101. that.screen = 1;
  1102. that.resultForm.public.resourceTypeSelectValue1 = '';
  1103. that.resourceForm.public.resourceTypeSelectValue1 = {
  1104. label:'common.researchResource',
  1105. value:'调研资源',
  1106. };
  1107. }
  1108. }
  1109. },
  1110. //返回首页
  1111. toResource(){
  1112. this.toView('resourceSharing')
  1113. },
  1114. toView(router, json) {
  1115. this.$router.push({ name: router, params: {key:json} });
  1116. },
  1117. // 上传文件验证
  1118. beforeUploadCover(file) {
  1119. var FileExt = file.name.replace(/.+\./, "");
  1120. if (['jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
  1121. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1122. this.$message({
  1123. type: 'warning',
  1124. message: '请上传JPG,PNG的图片!'
  1125. });
  1126. } else {
  1127. this.$message({
  1128. type: 'warning',
  1129. message: 'Please upload the picture of JPG, PNG!'
  1130. });
  1131. }
  1132. return false;
  1133. }
  1134. this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
  1135. if (this.isLt2k === '0') {
  1136. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1137. this.$message({
  1138. message: '上传文件大小不能超过10M!',
  1139. type: 'error'
  1140. });
  1141. } else {
  1142. this.$message({
  1143. message: 'Upload file size cannot exceed 10M!',
  1144. type: 'error'
  1145. });
  1146. }
  1147. return false;
  1148. }
  1149. },
  1150. beforeUploadCatalog(file) {
  1151. var FileExt = file.name.replace(/.+\./, "");
  1152. if (['jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
  1153. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1154. this.$message({
  1155. type: 'warning',
  1156. message: '请上传jpg,png的图片!'
  1157. });
  1158. } else {
  1159. this.$message({
  1160. type: 'warning',
  1161. message: 'Please upload the picture of jpg, png!'
  1162. });
  1163. }
  1164. return false;
  1165. }
  1166. this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
  1167. if (this.isLt2k === '0') {
  1168. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1169. this.$message({
  1170. message: '上传文件大小不能超过10M!',
  1171. type: 'error'
  1172. });
  1173. } else {
  1174. this.$message({
  1175. message: 'Upload file size cannot exceed 10M!',
  1176. type: 'error'
  1177. });
  1178. }
  1179. return false;
  1180. }
  1181. },
  1182. beforeUploadFile(file) {
  1183. var FileExt = file.name.replace(/.+\./, "");
  1184. if (['pdf'].indexOf(FileExt.toLowerCase()) === -1) {
  1185. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1186. this.$message({
  1187. type: 'warning',
  1188. message: '请上传PDF的附件!'
  1189. });
  1190. } else {
  1191. this.$message({
  1192. type: 'warning',
  1193. message: 'Please upload the attachment of PDF!'
  1194. });
  1195. }
  1196. return false;
  1197. }
  1198. this.isLt2k = file.size / 1024 / 1024 < 50 ? '1' : '0';
  1199. if (this.isLt2k === '0') {
  1200. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1201. this.$message({
  1202. message: '上传文件大小不能超过50M!',
  1203. type: 'error'
  1204. });
  1205. } else {
  1206. this.$message({
  1207. message: 'Upload file size cannot exceed 50M!',
  1208. type: 'error'
  1209. });
  1210. }
  1211. return false;
  1212. }
  1213. },
  1214. beforeUploadVideo(file) {
  1215. const isLt200M = file.size / 1024 / 1024 < 50;
  1216. if (['video/mp4'].indexOf(file.type) == -1) {
  1217. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1218. this.$message({
  1219. type: 'warning',
  1220. message: '请上传mp4的视频!'
  1221. });
  1222. } else {
  1223. this.$message({
  1224. type: 'warning',
  1225. message: 'Please upload the Video of MP4!'
  1226. });
  1227. }
  1228. return false;
  1229. }
  1230. if (!isLt200M) {
  1231. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1232. this.$message({
  1233. message: '上传文件大小不能超过200M!',
  1234. type: 'error'
  1235. });
  1236. } else {
  1237. this.$message({
  1238. message: 'Upload file size cannot exceed 200M!',
  1239. type: 'error'
  1240. });
  1241. }
  1242. return false;
  1243. }
  1244. },
  1245. onRemove(file,fileList,status,ele) {
  1246. console.log(1)
  1247. let parameter = this.languageList[this.languageTabsValue-1].value
  1248. if(status==0){
  1249. // this.resultForm.public[ele].delete(this.languageList[this.languageTabsValue-1].value)
  1250. this.resultForm[parameter][ele] = '';
  1251. }else if(status==1){
  1252. // this.resourceForm.public[ele].delete(this.languageList[this.languageTabsValue-1].value)
  1253. this.resourceForm[parameter][ele] = '';
  1254. }
  1255. },
  1256. handleAvatarSuccess(status,ele,res,file){
  1257. //如果只选择一个英文会报错this.languageTabsValue 的值对应不上
  1258. let parameter;
  1259. if(this.languageList.length > 1){
  1260. parameter = this.languageList[this.languageTabsValue-1].value
  1261. }else{
  1262. parameter = this.languageList[0].value
  1263. }
  1264. // let parameter = this.languageList[this.languageTabsValue-1].value
  1265. if(status==0){
  1266. // this.resultForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.data.attachmentId)
  1267. this.resultForm[parameter][ele] = res.data.attachmentId
  1268. }else if(status==1){
  1269. // this.resourceForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.data.attachmentId)
  1270. this.resourceForm[parameter][ele] = res.data.attachmentId
  1271. }
  1272. },
  1273. handleAvatarSuccessVideo(status,ele,res,file){
  1274. // this.resourceForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.url);
  1275. let parameter = this.languageList[this.languageTabsValue-1].value
  1276. this.resourceForm[parameter][ele] = res.url
  1277. },
  1278. onPreview(file,fileList,status,ele){
  1279. console.log(2)
  1280. this.dialogVisible = true;
  1281. if(ele=='coverFileMap'||ele=='mediaFileMap'){
  1282. this.dialogVisibleImg = file.response.data.path;
  1283. }else if(ele=='catalogFileMap'){
  1284. this.dialogVisibleImg = file.response.data.path;
  1285. }else if(ele=='fileMap'){
  1286. this.dialogVisiblePdf = file.response.data.path;
  1287. }else if(ele=='videoFileMap'){
  1288. this.dialogVisibleVideo = file.response.data.path;
  1289. }
  1290. },
  1291. beforeClose(done){
  1292. this.dialogVisibleImg = '';
  1293. this.dialogVisibleVideo = '';
  1294. this.dialogVisiblePdf = '';
  1295. done()
  1296. },
  1297. forceUpdate(e){
  1298. this.$forceUpdate();
  1299. },
  1300. //研究成果表单验证
  1301. onResultsVerify(resultForm,resultType) {
  1302. const that = this;
  1303. let bool = true;
  1304. let resourceBools = [];
  1305. const p1 = new Promise((resolve, reject) => {
  1306. that.$refs[resultType].forEach((i)=>{
  1307. if(that.checkType){
  1308. i.validate((valid) =>{
  1309. resourceBools.push(valid)
  1310. if(valid){
  1311. resolve()
  1312. }
  1313. })
  1314. }
  1315. })
  1316. })
  1317. const p2 = new Promise((resolve, reject) => {
  1318. that.$refs[resultForm].forEach((i)=>{
  1319. if(that.checkType){
  1320. i.validate((valid) =>{
  1321. resourceBools.push(valid)
  1322. if(valid){
  1323. resolve()
  1324. }
  1325. })
  1326. }
  1327. })
  1328. })
  1329. resourceBools.some(item =>{
  1330. if(item == false){
  1331. bool = false
  1332. return true;
  1333. }
  1334. })
  1335. if(bool){
  1336. // 表单验证通过,写业务代码
  1337. Promise.all([p1, p2]).then( () => {
  1338. that.onSubmitResults()
  1339. })
  1340. }else{
  1341. that.$message({
  1342. message: that.$i18n.locale.toUpperCase() == 'ZH'?'必填项未填!': 'The required fields are not filled in!',
  1343. type: 'error'
  1344. });
  1345. }
  1346. },
  1347. //研究成果提交表单
  1348. onSubmitResults(){
  1349. let that = this
  1350. let data = []
  1351. that.languageList.forEach((i)=>{
  1352. let resultForm = {
  1353. language:'',
  1354. reserveOne:0, // 资源类型
  1355. researchResultType:'',
  1356. name:'',
  1357. affiliatedUnitName:'',
  1358. country:'',//国家
  1359. continent:'',//大洲
  1360. contactsName:'',
  1361. contactsNumber:'',
  1362. researchResultAbstract:'',
  1363. }
  1364. resultForm.language = i.value;
  1365. resultForm.researchResultType = that.resultForm.public.resourceTypeSelectValue2.value;
  1366. resultForm.name = that.resultForm[i.value].name;
  1367. resultForm.affiliatedUnitName = that.resultForm[i.value].affiliatedUnitName;
  1368. resultForm.contactsName = that.resultForm[i.value].contactsName;
  1369. resultForm.contactsNumber = that.resultForm[i.value].contactsNumber;
  1370. resultForm.researchResultAbstract = that.resultForm[i.value].researchResultAbstract;
  1371. resultForm.continent = that.resultForm[i.value].resourceCountrySelectValue1.value;
  1372. resultForm.country = that.resultForm[i.value].resourceCountrySelectValue2.value;
  1373. data.push(resultForm)
  1374. if(that.resultForm[i.value].fileMap){
  1375. this.resultForm.public.fileMap.set(i.value,that.resultForm[i.value].fileMap)
  1376. }
  1377. if(that.resultForm[i.value].coverFileMap){
  1378. this.resultForm.public.coverFileMap.set(i.value,that.resultForm[i.value].coverFileMap)
  1379. }
  1380. if(that.resultForm[i.value].catalogFileMap){
  1381. this.resultForm.public.catalogFileMap.set(i.value,that.resultForm[i.value].catalogFileMap)
  1382. }
  1383. });
  1384. let token = getToken();
  1385. this.submitHandler((token) => {
  1386. saveOrUpdateBaseResearchResultInfos(
  1387. JSON.stringify(data),
  1388. JSON.stringify(that.resultForm.public.fileMap),
  1389. JSON.stringify(that.resultForm.public.coverFileMap),
  1390. JSON.stringify(that.resultForm.public.catalogFileMap),
  1391. token
  1392. ).then(result => {
  1393. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1394. this.$message({
  1395. message: '发布成功',
  1396. type: 'success'
  1397. });
  1398. } else {
  1399. this.$message({
  1400. message: 'Release Success',
  1401. type: 'success'
  1402. });
  1403. }
  1404. this.toResource()
  1405. }).catch((error) => {
  1406. this.resetToken();
  1407. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1408. this.$message({
  1409. message: '发布失败',
  1410. type: 'error'
  1411. });
  1412. } else {
  1413. this.$message({
  1414. message: 'Release Error',
  1415. type: 'error'
  1416. });
  1417. }
  1418. this.toResource()
  1419. });
  1420. });
  1421. },
  1422. //调研资源表单验证
  1423. onResourceVerify(resourceForm,resourceType){
  1424. const that = this;
  1425. let bool = true;
  1426. let resourceBools = [];
  1427. const p1 = new Promise((resolve, reject) => {
  1428. that.$refs[resourceType].some((i)=>{
  1429. if(that.checkType){
  1430. i.validate((valid) =>{
  1431. resourceBools.push(valid)
  1432. if(valid){
  1433. resolve()
  1434. }
  1435. })
  1436. }
  1437. })
  1438. })
  1439. const p2 = new Promise((resolve, reject) => {
  1440. that.$refs[resourceForm].some((i)=>{
  1441. if(that.checkType){
  1442. i.validate((valid) =>{
  1443. resourceBools.push(valid)
  1444. if(valid){
  1445. resolve()
  1446. }
  1447. })
  1448. }
  1449. })
  1450. })
  1451. resourceBools.some(item =>{
  1452. if(item == false){
  1453. bool = false
  1454. return true;
  1455. }
  1456. })
  1457. if(bool){
  1458. // 表单验证通过,写业务代码
  1459. Promise.all([p1, p2]).then( () => {
  1460. that.onSubmitResource()
  1461. })
  1462. }else{
  1463. that.$message({
  1464. message: that.$i18n.locale.toUpperCase() == 'ZH'?'必填项未填!': 'The required fields are not filled in!',
  1465. type: 'error'
  1466. });
  1467. }
  1468. },
  1469. //调研资源提交表单
  1470. onSubmitResource(){
  1471. const that = this;
  1472. //选择器
  1473. let data = []
  1474. that.languageList.forEach((i)=>{
  1475. let resourceForm = {
  1476. language:'',
  1477. reserveOne:1, // 资源类型
  1478. researchResourcesType:'',
  1479. name:'',
  1480. address:'',
  1481. affiliatedUnitName:'',
  1482. country:'',//国家
  1483. continent:'',//大洲
  1484. contactsName:'',
  1485. contactsNumber:'',
  1486. contactsEmail: '',
  1487. researchResultAbstract:'',
  1488. dockingMode:'',
  1489. details:'',
  1490. mattersNeedingAttention:'',
  1491. }
  1492. resourceForm.language = i.value;
  1493. // resourceForm.details = that.resourceForm[i.value].activityPreviewUe1;
  1494. // resourceForm.mattersNeedingAttention = that.resourceForm[i.value].activityPreviewUe2;
  1495. resourceForm.researchResourcesType = that.resourceForm.public.resourceTypeSelectValue2.value;
  1496. resourceForm.name = that.resourceForm[i.value].name;
  1497. resourceForm.address = that.resourceForm[i.value].address;
  1498. resourceForm.affiliatedUnitName = that.resourceForm[i.value].affiliatedUnitName;
  1499. resourceForm.contactsName = that.resourceForm[i.value].contactsName;
  1500. resourceForm.contactsNumber = that.resourceForm[i.value].contactsNumber;
  1501. resourceForm.contactsEmail = that.resourceForm[i.value].contactsEmail;
  1502. resourceForm.researchResultAbstract = that.resourceForm[i.value].researchResultAbstract;
  1503. resourceForm.continent = that.resourceForm[i.value].resourceCountrySelectValue1.value;
  1504. resourceForm.country = that.resourceForm[i.value].resourceCountrySelectValue2.value;
  1505. if(that.resourceForm.public.radioList.length!=0&&that.resourceForm.public.radioList.length!=undefined){
  1506. if(that.resourceForm.public.radio==that.resourceForm.public.radioList[0].label){
  1507. that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[0].value
  1508. }else if(that.resourceForm.public.radio==that.resourceForm.public.radioList[1].label){
  1509. that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[1].value
  1510. }
  1511. }
  1512. resourceForm.dockingMode = that.resourceForm[i.value].dockingMode
  1513. data.push(resourceForm)
  1514. if(that.resourceForm[i.value].mediaFileMap){
  1515. this.resourceForm.public.mediaFileMap.set(i.value,that.resourceForm[i.value].mediaFileMap)
  1516. }
  1517. if(that.resourceForm[i.value].videoFileMap){
  1518. this.resourceForm.public.videoFileMap.set(i.value,that.resourceForm[i.value].videoFileMap)
  1519. }
  1520. if(that.resourceForm[i.value].fileMap){
  1521. this.resourceForm.public.fileMap.set(i.value,that.resourceForm[i.value].fileMap)
  1522. }
  1523. if(that.resourceForm[i.value].activityPreviewUe1){
  1524. this.resourceForm.public.details.set(i.value,that.resourceForm[i.value].activityPreviewUe1)
  1525. }
  1526. if(that.resourceForm[i.value].activityPreviewUe2){
  1527. this.resourceForm.public.mattersNeedingAttention.set(i.value,that.resourceForm[i.value].activityPreviewUe2)
  1528. }
  1529. });
  1530. let token = getToken();
  1531. this.submitHandler((token) => {
  1532. saveOrUpdateBaseResearchResourcesInfos(
  1533. JSON.stringify(data),
  1534. JSON.stringify(that.resourceForm.public.fileMap),
  1535. JSON.stringify(that.resourceForm.public.mediaFileMap),
  1536. JSON.stringify(that.resourceForm.public.videoFileMap),
  1537. JSON.stringify(that.resourceForm.public.details),
  1538. JSON.stringify(that.resourceForm.public.mattersNeedingAttention),
  1539. token
  1540. ).then(result => {
  1541. // point_task_upload_resources_result
  1542. //
  1543. addIntegral("point_task_upload_resources_result", "30");
  1544. var zhId = result.data.ZH;
  1545. var enId = result.data.EN;
  1546. that.saveInformation(enId,zhId,that.resourceForm);
  1547. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1548. this.$message({
  1549. message: '发布成功',
  1550. type: 'success'
  1551. });
  1552. } else {
  1553. this.$message({
  1554. message: 'Release Success!',
  1555. type: 'success'
  1556. });
  1557. }
  1558. this.toResource()
  1559. }).catch((error) => {
  1560. this.resetToken();
  1561. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1562. this.$message({
  1563. message: '发布失败',
  1564. type: 'error'
  1565. });
  1566. } else {
  1567. this.$message({
  1568. message: 'Release Error',
  1569. type: 'error'
  1570. });
  1571. }
  1572. this.toResource()
  1573. });
  1574. });
  1575. },
  1576. // onSubmitResource(formName){
  1577. // const that = this;
  1578. // that.$refs[formName][0].validate((valid) => {
  1579. // if (valid) {
  1580. // //选择器
  1581. // let data = []
  1582. // that.languageList.forEach((i)=>{
  1583. // let resourceForm = {
  1584. // language:'',
  1585. // reserveOne:1, // 资源类型
  1586. // researchResourcesType:'',
  1587. // name:'',
  1588. // address:'',
  1589. // affiliatedUnitName:'',
  1590. // country:'',//国家
  1591. // continent:'',//大洲
  1592. // contactsName:'',
  1593. // contactsNumber:'',
  1594. // contactsEmail: '',
  1595. // researchResultAbstract:'',
  1596. // dockingMode:'',
  1597. // details:'',
  1598. // mattersNeedingAttention:'',
  1599. // }
  1600. // resourceForm.language = i.value;
  1601. // // resourceForm.details = that.resourceForm[i.value].activityPreviewUe1;
  1602. // // resourceForm.mattersNeedingAttention = that.resourceForm[i.value].activityPreviewUe2;
  1603. // resourceForm.researchResourcesType = that.resourceForm.public.resourceTypeSelectValue2.value;
  1604. // resourceForm.name = that.resourceForm[i.value].name;
  1605. // resourceForm.address = that.resourceForm[i.value].address;
  1606. // resourceForm.affiliatedUnitName = that.resourceForm[i.value].affiliatedUnitName;
  1607. // resourceForm.contactsName = that.resourceForm[i.value].contactsName;
  1608. // resourceForm.contactsNumber = that.resourceForm[i.value].contactsNumber;
  1609. // resourceForm.contactsEmail = that.resourceForm[i.value].contactsEmail;
  1610. // resourceForm.researchResultAbstract = that.resourceForm[i.value].researchResultAbstract;
  1611. // resourceForm.continent = that.resourceForm[i.value].resourceCountrySelectValue1.value;
  1612. // resourceForm.country = that.resourceForm[i.value].resourceCountrySelectValue2.value;
  1613. // if(that.resourceForm.public.radioList.length!=0&&that.resourceForm.public.radioList.length!=undefined){
  1614. // if(that.resourceForm.public.radio==that.resourceForm.public.radioList[0].label){
  1615. // that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[0].value
  1616. // }else if(that.resourceForm.public.radio==that.resourceForm.public.radioList[1].label){
  1617. // that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[1].value
  1618. // }
  1619. // }
  1620. // resourceForm.dockingMode = that.resourceForm[i.value].dockingMode
  1621. // data.push(resourceForm)
  1622. // if(that.resourceForm[i.value].mediaFileMap){
  1623. // this.resourceForm.public.mediaFileMap.set(i.value,that.resourceForm[i.value].mediaFileMap)
  1624. // }
  1625. // if(that.resourceForm[i.value].videoFileMap){
  1626. // this.resourceForm.public.videoFileMap.set(i.value,that.resourceForm[i.value].videoFileMap)
  1627. // }
  1628. // if(that.resourceForm[i.value].fileMap){
  1629. // this.resourceForm.public.fileMap.set(i.value,that.resourceForm[i.value].fileMap)
  1630. // }
  1631. // if(that.resourceForm[i.value].activityPreviewUe1){
  1632. // this.resourceForm.public.details.set(i.value,that.resourceForm[i.value].activityPreviewUe1)
  1633. // }
  1634. // if(that.resourceForm[i.value].activityPreviewUe2){
  1635. // this.resourceForm.public.mattersNeedingAttention.set(i.value,that.resourceForm[i.value].activityPreviewUe2)
  1636. // }
  1637. // });
  1638. // let token = getToken();
  1639. // this.submitHandler((token) => {
  1640. // saveOrUpdateBaseResearchResourcesInfos(
  1641. // JSON.stringify(data),
  1642. // JSON.stringify(that.resourceForm.public.fileMap),
  1643. // JSON.stringify(that.resourceForm.public.mediaFileMap),
  1644. // JSON.stringify(that.resourceForm.public.videoFileMap),
  1645. // JSON.stringify(that.resourceForm.public.details),
  1646. // JSON.stringify(that.resourceForm.public.mattersNeedingAttention),
  1647. // token
  1648. // ).then(result => {
  1649. // var zhId = result.data.ZH;
  1650. // var enId = result.data.EN;
  1651. // that.saveInformation(enId,zhId,that.resourceForm);
  1652. // if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1653. // this.$message({
  1654. // message: '发布成功',
  1655. // type: 'success'
  1656. // });
  1657. // } else {
  1658. // this.$message({
  1659. // message: 'Release Success!',
  1660. // type: 'success'
  1661. // });
  1662. // }
  1663. // this.toResource()
  1664. // }).catch((error) => {
  1665. // this.resetToken();
  1666. // if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1667. // this.$message({
  1668. // message: '发布失败',
  1669. // type: 'error'
  1670. // });
  1671. // } else {
  1672. // this.$message({
  1673. // message: 'Release Error',
  1674. // type: 'error'
  1675. // });
  1676. // }
  1677. // this.toResource()
  1678. // });
  1679. // });
  1680. // } else {
  1681. // if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1682. // this.$message({
  1683. // message: '必填项未填!',
  1684. // type: 'error'
  1685. // });
  1686. // } else {
  1687. // this.$message({
  1688. // message: 'The required fields are not filled in!',
  1689. // type: 'error'
  1690. // });
  1691. // }
  1692. // }
  1693. // });
  1694. // },
  1695. saveInformation(enId,zhId,resourceForm){
  1696. if (zhId != "" && zhId != undefined && zhId != 'undefined') {
  1697. let cmsInformationInfo = {
  1698. title: "资源介绍",
  1699. typeDict: "1",
  1700. businessType : "base_research_resource_info",
  1701. businessId : zhId,
  1702. topFlag: "0",
  1703. weight: "1",
  1704. publishChannelDict: "2",
  1705. havePicture: "y",
  1706. picturePosition: "L",
  1707. content: resourceForm["ZH"].activityPreviewUe1,
  1708. contentHtml: resourceForm["ZH"].activityPreviewUe1,
  1709. sourceDict: "1",
  1710. informationStatusDict: "1",
  1711. language: "ZH",
  1712. }
  1713. let token = getToken();
  1714. saveOrUpdateCmsInformation(JSON.stringify(cmsInformationInfo), token)
  1715. let cmsInformationInfo2 = {
  1716. title: "注意事项",
  1717. typeDict: "1",
  1718. businessType : "base_research_resource_info",
  1719. businessId : zhId,
  1720. topFlag: "0",
  1721. weight: "1",
  1722. publishChannelDict: "2",
  1723. havePicture: "y",
  1724. picturePosition: "L",
  1725. content: resourceForm["ZH"].activityPreviewUe2,
  1726. contentHtml : resourceForm["ZH"].activityPreviewUe2,
  1727. sourceDict: "1",
  1728. informationStatusDict: "1",
  1729. language: "ZH",
  1730. }
  1731. saveOrUpdateCmsInformation(JSON.stringify(cmsInformationInfo2), token)
  1732. }
  1733. if (enId != "" && enId != undefined && enId != 'undefined') {
  1734. let cmsInformationInfo = {
  1735. title: "Resources Introduction",
  1736. typeDict: "1",
  1737. businessType : "base_research_resource_info",
  1738. businessId : enId,
  1739. topFlag: "0",
  1740. weight: "1",
  1741. publishChannelDict: "2",
  1742. havePicture: "y",
  1743. picturePosition: "L",
  1744. content: resourceForm["EN"].activityPreviewUe1,
  1745. contentHtml: resourceForm["EN"].activityPreviewUe1,
  1746. sourceDict: "1",
  1747. informationStatusDict: "1",
  1748. language: "EN",
  1749. }
  1750. let token = getToken();
  1751. saveOrUpdateCmsInformation(JSON.stringify(cmsInformationInfo), token)
  1752. let cmsInformationInfo2 = {
  1753. title: "Cautions",
  1754. typeDict: "1",
  1755. businessType : "base_research_resource_info",
  1756. businessId : enId,
  1757. topFlag: "0",
  1758. weight: "1",
  1759. publishChannelDict: "2",
  1760. havePicture: "y",
  1761. picturePosition: "L",
  1762. content: resourceForm["EN"].activityPreviewUe2,
  1763. contentHtml: resourceForm["EN"].activityPreviewUe2,
  1764. sourceDict: "1",
  1765. informationStatusDict: "1",
  1766. language: "EN",
  1767. }
  1768. saveOrUpdateCmsInformation(JSON.stringify(cmsInformationInfo2), token)
  1769. }
  1770. },
  1771. //富文本
  1772. activityPreviewUe1(data){
  1773. let ele = this.languageList[this.languageTabsValue-0-1].value
  1774. this.resourceForm[ele].activityPreviewUe1 = data;
  1775. },
  1776. activityPreviewUe2(data){
  1777. let ele = this.languageList[this.languageTabsValue-0-1].value
  1778. this.resourceForm[ele].activityPreviewUe2 = data;
  1779. },
  1780. }
  1781. }
  1782. </script>
  1783. <style scoped>
  1784. .box {
  1785. margin-top: 10px;
  1786. background: #fff;
  1787. /* height: 500px; */
  1788. padding: 20px 0;
  1789. }
  1790. .crumbs {
  1791. margin:0 20px;
  1792. }
  1793. .content{
  1794. width: 100%;
  1795. padding: 20px 10px;
  1796. box-sizing: border-box;
  1797. }
  1798. .content .addLanguage{
  1799. width: 100%;
  1800. height: 50px;
  1801. border-bottom: 1px solid #666666;
  1802. }
  1803. .content .issue{
  1804. margin-top: 15px;
  1805. }
  1806. </style>