ResourceSharingResultsIssue.vue 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153
  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: 'resourceSharing' }" class="pointer">{{$t('common.ResourceSharing')}}</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="140px" >
  28. <!--资源类型 研究成果-->
  29. <el-form-item :label="$t('common.resourceTheResourceType')" required>
  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-select v-model="resultForm.public.resourceTypeSelectValue2" :placeholder="$t('common.resourcePleaseSelectTheSecondaryType')" style="width: 320px;float: right;">
  38. <el-option
  39. v-for="item in resultForm.public.resourceTypeSelectOption"
  40. :label="item.label"
  41. :value="item">
  42. </el-option>
  43. </el-select>
  44. </el-form-item>
  45. </el-form>
  46. <el-form ref="resultForm" :model="resultForm[item.value]" label-width="140px" :rules="resultFormRules">
  47. <!--成果封面-->
  48. <el-form-item :label="$t('common.resourceResultsTheCover')">
  49. <el-upload
  50. class="upload-demo"
  51. action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_cover"
  52. :before-upload="beforeUploadCover"
  53. :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'coverFileMap')}"
  54. :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'coverFileMap')}"
  55. list-type="picture"
  56. :on-success="handleAvatarSuccess.bind(this,0,'coverFileMap')"
  57. :limit="1"
  58. :headers="myHeaders"
  59. :file-list="fileList">
  60. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  61. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}},{{$t('common.resourceUploadOne')}}</div>
  62. </el-upload>
  63. </el-form-item>
  64. <!--名称-->
  65. <el-form-item :label="$t('common.resourceName')" prop="name">
  66. <el-input v-model="resultForm[item.value].name"
  67. :placeholder="$t('common.resourcePleaseEnterTheName')"
  68. ></el-input>
  69. </el-form-item>
  70. <!--所属单位-->
  71. <el-form-item :label="$t('common.resourceSubordinateUnits')" prop="affiliatedUnitName">
  72. <el-input v-model="resultForm[item.value].affiliatedUnitName"
  73. :placeholder="$t('common.resourcePleaseEnterUnit')"
  74. ></el-input>
  75. </el-form-item>
  76. <!--国家-->
  77. <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue2">
  78. <el-select style="width: 320px;" v-model="resultForm[item.value].resourceCountrySelectValue1" :placeholder="$t('common.resourcePleaseSelectContinent')" @change="resourceCountry">
  79. <el-option
  80. v-for="item in resultForm[item.value].resourceCountrySelect"
  81. :label="item.label"
  82. :value="item">
  83. </el-option>
  84. </el-select>
  85. <el-select v-model="resultForm[item.value].resourceCountrySelectValue2" :placeholder="$t('common.resourcePleaseSelectCountry')" style="width: 320px;float: right;">
  86. <el-option
  87. v-for="item in resultForm[item.value].resourceCountrySelectValue1.data"
  88. :label="item.label"
  89. :value="item">
  90. </el-option>
  91. </el-select>
  92. </el-form-item>
  93. <!--联系人-->
  94. <el-form-item :label="$t('common.resourceTheContact')">
  95. <el-input v-model="resultForm[item.value].contactsName"
  96. :placeholder="$t('common.resourcePleaseEnterTheContactName')"
  97. ></el-input>
  98. </el-form-item>
  99. <!--联系电话-->
  100. <el-form-item :label="$t('common.resourceContactPhoneNumber')">
  101. <el-input v-model="resultForm[item.value].contactsNumber"
  102. :placeholder="$t('common.resourcePleaseEnterYourContactNumber')"
  103. ></el-input>
  104. </el-form-item>
  105. <!--摘要-->
  106. <el-form-item :label="$t('common.resourceDetailsAbstract')" prop="researchResultAbstract">
  107. <el-input
  108. type="textarea"
  109. :placeholder="$t('common.resourcePleaseEnterSummary')"
  110. v-model="resultForm[item.value].researchResultAbstract"
  111. maxlength="500"
  112. show-word-limit
  113. rows="6"
  114. >
  115. </el-input>
  116. </el-form-item>
  117. <!--目录-->
  118. <el-form-item :label="$t('common.resourceDetailsDirectory')" required>
  119. <el-upload
  120. class="upload-demo"
  121. action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_catalog"
  122. :before-upload="beforeUploadCatalog"
  123. :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'catalogFileMap')}"
  124. :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'catalogFileMap')}"
  125. list-type="picture"
  126. :on-success="handleAvatarSuccess.bind(this,0,'catalogFileMap')"
  127. :limit="1"
  128. :headers="myHeaders"
  129. :file-list="fileList">
  130. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  131. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}},{{$t('common.resourceUploadOne')}}</div>
  132. </el-upload>
  133. </el-form-item>
  134. <!--附件-->
  135. <el-form-item :label="$t('common.resourceTheAttachment')" required>
  136. <el-upload
  137. class="upload-demo"
  138. action="/api/file/upload/attachment?module=BaseResearchResultInfoForm&attachmentBusinessType=base_research_result_info_file"
  139. :before-upload="beforeUploadFile"
  140. :on-remove="(file, fileList) => {onRemove(file, fileList, 0,'fileMap')}"
  141. :on-preview="(file, fileList) => {onPreview(file, fileList, 0,'fileMap')}"
  142. :on-success="handleAvatarSuccess.bind(this,0,'fileMap')"
  143. :limit="1"
  144. :headers="myHeaders"
  145. :file-list="fileList">
  146. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  147. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadPDF')}},{{$t('common.resourceFilesCannotExceed50Mb')}}</div>
  148. </el-upload>
  149. </el-form-item>
  150. <el-form-item style="text-align: center;">
  151. <el-button style="margin-right: 50px;" @click="toResource">{{$t('common.resourceCancel')}}</el-button>
  152. <el-button type="primary" @click="onSubmitResults('resultForm')">{{$t('common.resourceRelease')}}</el-button>
  153. </el-form-item>
  154. </el-form>
  155. </div>
  156. </el-tab-pane>
  157. </el-tabs>
  158. </div>
  159. </div>
  160. <div v-show="screen==1">
  161. <div class="issue">
  162. <el-tabs v-model="languageTabsValue" type="card" closable @tab-remove="removeTab">
  163. <el-tab-pane
  164. v-for="(item, index) in languageList"
  165. :key="item.name"
  166. :label="$t(item.label)"
  167. :name="item.name"
  168. >
  169. <div style="width: 100%;padding: 0 150px;box-sizing: border-box">
  170. <el-form ref="resourceType" :model="resultForm.public" label-width="140px" >
  171. <!--资源类型 调研资源-->
  172. <el-form-item :label="$t('common.resourceTheResourceType')" required>
  173. <el-select style="width: 320px;" v-model="resourceForm.public.resourceTypeSelectValue1" :placeholder="$t('common.resource')" @change="resourceType">
  174. <el-option
  175. v-for="item in resourceForm.public.resourceTypeSelect"
  176. :label="$t(item.label)"
  177. :value="item">
  178. </el-option>
  179. </el-select>
  180. <el-select v-model="resourceForm.public.resourceTypeSelectValue2" :placeholder="$t('common.resourcePleaseSelectTheSecondaryType')" style="width: 320px;float: right;">
  181. <el-option
  182. v-for="item in resourceForm.public.resourceTypeSelectOption"
  183. :label="item.label"
  184. :value="item">
  185. </el-option>
  186. </el-select>
  187. </el-form-item>
  188. </el-form>
  189. <el-form ref="resourceForm" :model="resourceForm[item.value]" label-width="140px" :rules="resourceFormRules">
  190. <!--资源媒体-->
  191. <el-form-item :label="$t('common.resourceMediaResources')" >
  192. <el-select style="width: 100%;" v-model="resourceForm[item.value].resourceMediaSelectValue" :placeholder="$t('common.resourceThePicture')" @change="resourceType">
  193. <el-option
  194. v-for="item in resourceForm[item.value].resourceMediaSelect"
  195. :label="$t(item.label)"
  196. :value="item">
  197. </el-option>
  198. </el-select>
  199. <el-upload
  200. v-show="resourceForm[item.value].resourceMediaSelectValue.value=='图片'||resourceForm[item.value].resourceMediaSelectValue.value=='图片+视频'"
  201. class="upload-demo"
  202. action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
  203. :before-upload="beforeUploadCover"
  204. :on-remove="(file, fileList) => {onRemove(file, fileList, 1,'mediaFileMap')}"
  205. :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'mediaFileMap')}"
  206. :on-success="handleAvatarSuccess.bind(this,1,'mediaFileMap')"
  207. :limit="8"
  208. :headers="myHeaders"
  209. :file-list="fileList">
  210. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  211. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed')}}10MB,{{$t('common.resourceUploadEight')}}</div>
  212. </el-upload>
  213. <!--视频-->
  214. <el-upload
  215. v-show="resourceForm[item.value].resourceMediaSelectValue.value=='视频'||resourceForm[item.value].resourceMediaSelectValue.value=='图片+视频'"
  216. class="upload-demo"
  217. action="/api/resourceshare/baseResearchResourcesInfos/uploadVideo"
  218. :before-upload="beforeUploadVideo"
  219. :on-remove="(file, fileList) => {onPreview(file, fileList, 1,'videoFileMap')}"
  220. :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'videoFileMap')}"
  221. :on-success="handleAvatarSuccessVideo.bind(this,1,'videoFileMap')"
  222. :limit="1"
  223. :headers="myHeaders"
  224. :file-list="fileList"
  225. :data="video"
  226. name="layuiVideo">
  227. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  228. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadMp4')}},{{$t('common.resourceFilesCannotExceed50Mb')}},{{$t('common.resourceUploadOneVideo')}}</div>
  229. </el-upload>
  230. </el-form-item>
  231. <!--名称-->
  232. <el-form-item :label="$t('common.resourceName')" prop="name"
  233. :rules="[{ required: true, message: $i18n.locale=='zh'?'请输入名称':'Please enter the name', trigger: 'blur' }]">
  234. <el-input v-model="resourceForm[item.value].name"
  235. :placeholder="$t('common.resourcePleaseEnterTheName')"
  236. ></el-input>
  237. </el-form-item>
  238. <!--所属单位-->
  239. <el-form-item :label="$t('common.resourceSubordinateUnits')" prop="affiliatedUnitName"
  240. :rules="[{ required: true, message: $i18n.locale=='zh'?'请输入所属单位':'Please enter your affiliation', trigger: 'blur' }]">
  241. <el-input v-model="resourceForm[item.value].affiliatedUnitName"
  242. :placeholder="$t('common.resourcePleaseEnterUnit')"
  243. ></el-input>
  244. </el-form-item>
  245. <!--地址-->
  246. <el-form-item :label="$t('common.resourceAddress')" prop="address"
  247. :rules="[{ required: true, message: $i18n.locale=='zh'?'请输入地址':'Please enter the address', trigger: 'blur' }]">
  248. <el-input v-model="resourceForm[item.value].address"
  249. :placeholder="$t('common.resourcePleaseEnterUnit')"
  250. ></el-input>
  251. </el-form-item>
  252. <!--国家-->
  253. <el-form-item :label="$t('common.resourceCountries')" prop="resourceCountrySelectValue2">
  254. <el-select style="width: 320px;" v-model="resourceForm[item.value].resourceCountrySelectValue1" :placeholder="$t('common.resourcePleaseSelectContinent')" @change="resourceCountry">
  255. <el-option
  256. v-for="item in resourceForm[item.value].resourceCountrySelect"
  257. :label="item.label"
  258. :value="item">
  259. </el-option>
  260. </el-select>
  261. <el-select v-model="resourceForm[item.value].resourceCountrySelectValue2" :placeholder="$t('common.resourcePleaseSelectCountry')" style="width: 320px;float: right;">
  262. <el-option
  263. v-for="item in resourceForm[item.value].resourceCountrySelectValue1.data"
  264. :label="item.label"
  265. :value="item">
  266. </el-option>
  267. </el-select>
  268. </el-form-item>
  269. <!--对接方式-->
  270. <el-form-item :label="$t('common.resourceDockingWay')">
  271. <el-radio-group v-model="resourceForm.public.radioList">
  272. <el-radio :label="$t('common.resourceDockingOfTheUnit')"></el-radio>
  273. <el-radio :label="$t('common.resourceCooperationOrganizationDocking')"></el-radio>
  274. </el-radio-group>
  275. </el-form-item>
  276. <!--联系人-->
  277. <el-form-item :label="$t('common.resourceTheContact')">
  278. <el-input v-model="resourceForm[item.value].contactsName"
  279. :placeholder="$t('common.resourcePleaseEnterTheContactName')"
  280. ></el-input>
  281. </el-form-item>
  282. <!--联系电话-->
  283. <el-form-item :label="$t('common.resourceContactPhoneNumber')">
  284. <el-input v-model="resourceForm[item.value].contactsNumber"
  285. :placeholder="$t('common.resourcePleaseEnterYourContactNumber')"
  286. ></el-input>
  287. </el-form-item>
  288. <!--邮箱-->
  289. <el-form-item :label="$t('common.resourceEmail')">
  290. <el-input v-model="resourceForm[item.value].contactsEmail"
  291. :placeholder="$t('common.resourcePleaseEnterYourContactNumber')"
  292. ></el-input>
  293. </el-form-item>
  294. <!--详情介绍-->
  295. <el-form-item :label="$t('common.resourceDetailsAreIntroduced')" required>
  296. <div style="width: 100%;border: 1px solid rgba(204, 204, 204, 1);">
  297. <div style="width: 80px;height: 400px;float: left;text-align: center;">
  298. <span style="display: inline-block;margin-top: 150px">{{$t('common.resourceResourcesIsIntroduced')}}</span>
  299. </div>
  300. <div style="height: 100%;float: left;overflow: hidden;width: calc(100% - 81px);position: relative;">
  301. <layui-inline-ue
  302. label=""
  303. :cssStyle="{'width':'100%','height':'100%'}"
  304. @input="activityPreviewUe1"
  305. :value="resourceForm.activityPreviewUe1"
  306. ref="contentUe">
  307. </layui-inline-ue>
  308. </div>
  309. <div style="clear: both"></div>
  310. </div>
  311. <div style="width: 100%;border: 1px solid rgba(204, 204, 204, 1);margin-top: 80px;">
  312. <div style="width: 80px;height: 400px;float: left;text-align: center;">
  313. <span style="display: inline-block;margin-top: 150px">{{$t('common.resourceMattersNeedingAttention')}}</span>
  314. </div>
  315. <div style="height: 100%;float: left;overflow: hidden;width: calc(100% - 81px);position: relative;">
  316. <layui-inline-ue
  317. label=""
  318. :cssStyle="{'width':'100%','height':'100%'}"
  319. @input="activityPreviewUe2"
  320. :value="resourceForm.activityPreviewUe2"
  321. ref="contentUe">
  322. </layui-inline-ue>
  323. </div>
  324. <div style="clear: both"></div>
  325. </div>
  326. <!--<div v-for="(item,index) in "
  327. style="width: 100%;height: 200px;border: 1px solid rgba(204, 204, 204, 1);"
  328. :style="{marginTop: index==0?'0':'20px'}"
  329. >
  330. <div style="width: 80px;height: 200px;float: left;border-right: 1px solid rgba(204, 204, 204, 1);line-height: 100%;text-align: center;">
  331. <span style="line-height: 200px">注意事项</span>
  332. </div>
  333. <div style="height: 100%;float: left;overflow: hidden;width: calc(50% - 81px);">
  334. </div>
  335. <div style="clear: both"></div>
  336. </div>-->
  337. </el-form-item>
  338. <!--附件-->
  339. <el-form-item :label="$t('common.resourceTheAttachment')">
  340. <el-upload
  341. class="upload-demo"
  342. action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
  343. :before-upload="beforeUploadFile"
  344. :on-remove="(file, fileList) => {onPreview(file, fileList, 1,'fileMap')}"
  345. :on-preview="(file, fileList) => {onPreview(file, fileList, 1,'fileMap')}"
  346. :on-success="handleAvatarSuccess.bind(this,1,'fileMap')"
  347. :limit="1"
  348. :headers="myHeaders"
  349. :file-list="fileList">
  350. <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
  351. <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadPDF')}},{{$t('common.resourceFilesCannotExceed50Mb')}}</div>
  352. </el-upload>
  353. </el-form-item>
  354. <el-form-item style="text-align: center;">
  355. <el-button style="margin-right: 50px;" @click="toResource">{{$t('common.resourceCancel')}}</el-button>
  356. <el-button type="primary" @click="onSubmitResource('resourceForm')">{{$t('common.resourceRelease')}}</el-button>
  357. </el-form-item>
  358. </el-form>
  359. </div>
  360. </el-tab-pane>
  361. </el-tabs>
  362. </div>
  363. </div>
  364. </div>
  365. </div>
  366. <!--添加语言版本-->
  367. <el-dialog
  368. :title="$t('common.resourceLanguageVersion')"
  369. :visible.sync="addLanguageDialog"
  370. width="30%">
  371. <div style="width: 100%;">
  372. <el-select v-model="addLanguageValue" style="width: 70%" :placeholder="$t('common.resourcePleaseSelect')">
  373. <el-option
  374. v-for="(item,index) in addLanguageOptions"
  375. :label="$t(item.label)"
  376. :value="item"
  377. v-show="!item.added">
  378. </el-option>
  379. </el-select>
  380. </div>
  381. <span slot="footer" class="dialog-footer">
  382. <el-button @click="languageClose">{{$t('common.cancel')}}</el-button>
  383. <el-button type="primary" @click="addTab">{{$t('common.submit')}}</el-button>
  384. </span>
  385. </el-dialog>
  386. <!--预览-->
  387. <el-dialog
  388. :visible.sync="dialogVisible"
  389. width="60%"
  390. height="80%"
  391. :before-close="beforeClose">
  392. <div>
  393. <!-- <img :src="'api/file/pub/'+ dialogVisibleImg" alt="">-->
  394. <img :src="'api/file/pub/'+ dialogVisibleImg" alt="" style="width: 100%" v-show="dialogVisibleImg!=''">
  395. <video :src="'api/file/pub/'+ dialogVisibleVideo" style="width: 100%" v-show="dialogVisibleVideo!=''"></video>
  396. <iframe :src="'api/file/pub/'+ dialogVisiblePdf" frameborder="0" v-show="dialogVisiblePdf!=''" style="width: 100%;height: 800px;"></iframe>
  397. </div>
  398. </el-dialog>
  399. </div>
  400. </template>
  401. <script>
  402. import Base from "@/views/base/Base";
  403. import {getDicts} from '@/api/dict';
  404. import { getToken ,resetToken} from '@/utils/auth'
  405. import LayuiInlineUe from '@/components/LayuiInlineUe'
  406. import { getTreeByLanguagePortal } from "@/api/operation/baseCityInformationDict";
  407. import { saveOrUpdateBaseResearchResultInfos } from "@/api/research/baseResearchResultEntity";
  408. import { saveOrUpdateBaseResearchResourcesInfos } from "@/api/research/resource/baseResearchResourcesEntity";
  409. export default {
  410. name:"ResourceSharingResultsIssue",
  411. extends: Base,
  412. components:{ LayuiInlineUe },
  413. data(){
  414. return{
  415. // 发布资源切换
  416. screen:0,
  417. // 上传视频附属data
  418. video:{dir:'media'},
  419. // 上传文件预览
  420. dialogVisible:false,
  421. dialogVisibleImg:'',
  422. dialogVisibleVideo:'',
  423. dialogVisiblePdf:'',
  424. //表单头信息
  425. myHeaders: {Authorization: ('Bearer ' +getToken())},
  426. fileList:[],
  427. // 已添加语言版本
  428. languageTabsValue: '1',
  429. languageList:[],
  430. tabIndex: 0,
  431. // 可添加语言版本
  432. addLanguageDialog:false,
  433. addLanguageValue: '',
  434. addLanguageOptions: [
  435. {
  436. label: "common.Chinese",
  437. name: '1',
  438. value: 'ZH',
  439. added: false,
  440. },
  441. {
  442. label: 'common.English',
  443. name: '2',
  444. value: 'EN',
  445. added: false,
  446. },
  447. ],
  448. // 语言字典列表
  449. languageDataList: [],
  450. // 表单数据对象
  451. resultForm:{
  452. public:{
  453. resourceTypeSelectValue1:'',
  454. resourceTypeSelectValue2:'',
  455. resourceTypeSelectOption:[],
  456. resourceTypeSelect:[
  457. {
  458. label:'common.resource',
  459. value:'研究成果',
  460. },
  461. {
  462. label:'common.researchResource',
  463. value:'调研资源',
  464. },
  465. ],
  466. fileMap: new Map(),
  467. coverFileMap: new Map(),
  468. catalogFileMap: new Map(),
  469. },
  470. template:{
  471. language:"EN",
  472. reserveOne:0, // 资源类型
  473. researchResultType:'',
  474. name:'',
  475. affiliatedUnitName:'',
  476. country:'',//国家
  477. continent:'',//大洲
  478. contactsName:'',
  479. contactsNumber:'',
  480. researchResultAbstract:'',
  481. resourceCountrySelectValue1:'',
  482. resourceCountrySelectValue2:'',
  483. resourceCountrySelect:[],
  484. fileMap: '',
  485. coverFileMap: '',
  486. catalogFileMap: '',
  487. },
  488. },
  489. resourceForm:{
  490. public:{
  491. resourceTypeSelectValue1:'',
  492. resourceTypeSelectValue2:'',
  493. resourceTypeSelectOption:[],
  494. resourceTypeSelect:[
  495. {
  496. label:'common.resource',
  497. value:'研究成果',
  498. },
  499. {
  500. label:'common.researchResource',
  501. value:'调研资源',
  502. },
  503. ],
  504. radio: '1',
  505. radioList:[],
  506. mediaFileMap: new Map(),
  507. videoFileMap: new Map(),
  508. fileMap: new Map(),
  509. },
  510. template:{
  511. language:"EN",
  512. reserveOne:1, // 资源类型
  513. researchResourcesType:'',
  514. name:'',
  515. address:'',
  516. affiliatedUnitName:'',
  517. country:'',//国家
  518. continent:'',//大洲
  519. contactsName:'',
  520. contactsNumber:'',
  521. contactsEmail: '',
  522. researchResultAbstract:'',
  523. dockingMode:'',
  524. resourceMediaSelectValue:'',
  525. resourceMediaSelect:[
  526. {
  527. label:'common.resourceResearchResourceImage',
  528. value:'图片',
  529. },
  530. {
  531. label:'common.resourceResearchResourceVideo',
  532. value:'视频',
  533. },
  534. {
  535. label:'common.resourceResearchResourceImageAndVideo',
  536. value:'图片+视频',
  537. },
  538. ],
  539. resourceCountrySelectValue1:'',
  540. resourceCountrySelectValue2:'',
  541. resourceCountrySelect:[],
  542. mediaFileMap: '',
  543. videoFileMap: '',
  544. fileMap: '',
  545. },
  546. },
  547. }
  548. },
  549. mounted() {
  550. this.initData();
  551. },
  552. watch:{
  553. '$i18n.locale'(){
  554. this.initData();
  555. // this.forceUpdate()
  556. },
  557. 'screen'(){
  558. this.$refs.resultForm[0].resetFields()
  559. this.$refs.resourceForm[0].resetFields()
  560. }
  561. },
  562. computed:{
  563. resultFormRules(){
  564. return{
  565. // resultTheResourceType: [
  566. // { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
  567. // ],
  568. name: [
  569. { required: true, message: this.$i18n.locale=='zh'?'请输入名称':'Please enter the name', trigger: 'blur' },
  570. ],
  571. affiliatedUnitName: [
  572. { required: true, message: this.$i18n.locale=='zh'?'请输入所属单位':'Please enter your affiliation', trigger: 'blur' },
  573. ],
  574. resourceCountrySelectValue2: [
  575. { required: true, message: this.$i18n.locale=='zh'?'请选择国家':'Please select country', trigger: 'change' },
  576. ],
  577. researchResultAbstract: [
  578. { required: true, message: this.$i18n.locale=='zh'?'请输入摘要':'Please enter summary', trigger: 'blur' },
  579. ],
  580. // resultDetailsDirectory: [
  581. // { required: true, message: this.$i18n.locale=='zh'?'请上传目录':'Please upload the directory', trigger: 'blur' },
  582. // ],
  583. // resultTheAttachment: [
  584. // { required: true, message: this.$i18n.locale=='zh'?'请上传附件':'Please upload the attachment.', trigger: 'blur' },
  585. // ],
  586. }
  587. },
  588. resourceFormRules(){
  589. return{
  590. // resourceTheResourceType: [
  591. // { required: true, message: this.$i18n.locale=='zh'?'请输入活动名称':'Select the resource type', trigger: 'blur' },
  592. // ],
  593. name: [
  594. { required: true, message: this.$i18n.locale=='zh'?'请输入名称':'Please enter the name', trigger: 'blur' },
  595. ],
  596. affiliatedUnitName: [
  597. { required: true, message: this.$i18n.locale=='zh'?'请输入所属单位':'Please enter your affiliation', trigger: 'blur' },
  598. ],
  599. address: [
  600. { required: true, message: this.$i18n.locale=='zh'?'请输入地址':'Please enter the address', trigger: 'blur' },
  601. ],
  602. resourceCountrySelectValue2: [
  603. { required: true, message: this.$i18n.locale=='zh'?'请选择国家':'Please select country', trigger: 'change' },
  604. ],
  605. resourceDetailsAreIntroduced: [
  606. { required: true, message: this.$i18n.locale=='zh'?'请输入详情介绍':'Please enter details', trigger: 'blur' },
  607. ],
  608. }
  609. },
  610. },
  611. methods:{
  612. async initData(){
  613. await this.getData();
  614. let flag = false
  615. this.languageList.forEach((i)=>{
  616. if(i.value=='ZH'){
  617. flag = true;
  618. }
  619. })
  620. if(flag==false){
  621. this.addLanguageValue = {
  622. label: "common.Chinese",
  623. name: '1',
  624. value: 'ZH',
  625. added: false,
  626. };
  627. this.addTab();
  628. }
  629. },
  630. // 获取数据
  631. async getData(){
  632. const that = this;
  633. that.resultForm.public.resourceCountrySelectValue1 = '';
  634. that.resultForm.public.resourceCountrySelectValue2 = '';
  635. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  636. await getDicts(
  637. "RESEARCH_RESULT_TYPE_DICT,RESEARCH_RESOURCE_TYPE_DICT,DOCKING_MODE_DICTf"
  638. ).then(result => {
  639. if (result.data) {
  640. that.resultForm.public.resourceTypeSelectOption = result.data[0];
  641. that.resourceForm.public.resourceTypeSelectOption = result.data[1];
  642. that.resourceForm.public.radioList = result.data[2];
  643. }
  644. })
  645. await getTreeByLanguagePortal('ZH').then(result => {
  646. if (result.data) {
  647. let values = Object.values(result.data);
  648. that.resultForm.template.resourceCountrySelect = values;
  649. that.resourceForm.template.resourceCountrySelect = values;
  650. }
  651. })
  652. }else if (this.$i18n.locale.toUpperCase() == 'EN'){
  653. await getDicts(
  654. "RESEARCH_RESULT_TYPE_DICT_EN,RESEARCH_RESOURCE_TYPE_DICT_EN,DOCKING_MODE_DICT_EN"
  655. ).then(result => {
  656. if (result.data) {
  657. that.resultForm.public.resourceTypeSelectOption = result.data[0];
  658. that.resourceForm.public.resourceTypeSelectOption = result.data[1];
  659. that.resourceForm.public.radioList = result.data[2];
  660. }
  661. })
  662. await getTreeByLanguagePortal('EN').then(result => {
  663. if (result.data) {
  664. let values = Object.values(result.data);
  665. that.resultForm.template.resourceCountrySelect = values;
  666. that.resourceForm.template.resourceCountrySelect = values;
  667. }
  668. })
  669. }
  670. await getDicts(
  671. "LANGUAGE_DICT"
  672. ).then(result => {
  673. if (result.data) {
  674. that.languageDataList = result.data[0] || [];
  675. }
  676. })
  677. },
  678. // 添加语言版本
  679. addTabDialog(targetName) {
  680. const that = this;
  681. that.addLanguageDialog = true;
  682. },
  683. languageClose(){
  684. const that = this;
  685. that.addLanguageDialog = false;
  686. that.addLanguageValue = "";
  687. },
  688. addTab(targetName) {
  689. const that = this;
  690. if(that.addLanguageValue){
  691. let newTabName = ++this.tabIndex + '';
  692. that.languageList.push({
  693. label: that.addLanguageValue.label,
  694. name: that.addLanguageValue.name,
  695. value: that.addLanguageValue.value,
  696. });
  697. that.addLanguageOptions.forEach((i)=>{
  698. if(i.value == that.addLanguageValue.value){
  699. i.added = true;
  700. }
  701. });
  702. let resultForm = JSON.parse(JSON.stringify(that.resultForm.template));
  703. let resourceForm = JSON.parse(JSON.stringify(that.resourceForm.template));
  704. that.$set(that.resultForm,that.addLanguageValue.value,resultForm)
  705. that.$set(that.resourceForm,that.addLanguageValue.value,resourceForm)
  706. that.addLanguageValue = "";
  707. that.addLanguageDialog = false;
  708. that.languageTabsValue = newTabName;
  709. }else{
  710. that.languageClose()
  711. }
  712. },
  713. removeTab(targetName) {
  714. //****
  715. },
  716. // 发布资源切换
  717. resourceType(data){
  718. let that = this;
  719. if (data.value === 'Research results' || data.value === '研究成果'){
  720. if(that.screen == 1){
  721. that.screen = 0;
  722. that.resultForm.public.resourceTypeSelectValue1 = {
  723. label:'common.resource',
  724. value:'研究成果',
  725. };
  726. that.resourceForm.public.resourceTypeSelectValue1 = '';
  727. }
  728. }else{
  729. if(that.screen == 0){
  730. that.screen = 1;
  731. that.resultForm.public.resourceTypeSelectValue1 = '';
  732. that.resourceForm.public.resourceTypeSelectValue1 = {
  733. label:'common.researchResource',
  734. value:'调研资源',
  735. };
  736. }
  737. }
  738. },
  739. //返回首页
  740. toResource(){
  741. this.toView('resourceSharing')
  742. },
  743. toView(router, json) {
  744. this.$router.push({ name: router, params: {key:json} });
  745. },
  746. // 上传文件验证
  747. beforeUploadCover(file) {
  748. var FileExt = file.name.replace(/.+\./, "");
  749. if (['jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
  750. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  751. this.$message({
  752. type: 'warning',
  753. message: '请上传jpg,png的图片!'
  754. });
  755. } else {
  756. this.$message({
  757. type: 'warning',
  758. message: 'Please upload the picture of jpg, png!'
  759. });
  760. }
  761. return false;
  762. }
  763. this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
  764. if (this.isLt2k === '0') {
  765. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  766. this.$message({
  767. message: '上传文件大小不能超过10M!',
  768. type: 'error'
  769. });
  770. } else {
  771. this.$message({
  772. message: 'Upload file size cannot exceed 10M!',
  773. type: 'error'
  774. });
  775. }
  776. return false;
  777. }
  778. },
  779. beforeUploadCatalog(file) {
  780. var FileExt = file.name.replace(/.+\./, "");
  781. if (['jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
  782. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  783. this.$message({
  784. type: 'warning',
  785. message: '请上传jpg,png的图片!'
  786. });
  787. } else {
  788. this.$message({
  789. type: 'warning',
  790. message: 'Please upload the picture of jpg, png!'
  791. });
  792. }
  793. return false;
  794. }
  795. this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
  796. if (this.isLt2k === '0') {
  797. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  798. this.$message({
  799. message: '上传文件大小不能超过10M!',
  800. type: 'error'
  801. });
  802. } else {
  803. this.$message({
  804. message: 'Upload file size cannot exceed 10M!',
  805. type: 'error'
  806. });
  807. }
  808. return false;
  809. }
  810. },
  811. beforeUploadFile(file) {
  812. var FileExt = file.name.replace(/.+\./, "");
  813. if (['pdf'].indexOf(FileExt.toLowerCase()) === -1) {
  814. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  815. this.$message({
  816. type: 'warning',
  817. message: '请上传pdf的附件!'
  818. });
  819. } else {
  820. this.$message({
  821. type: 'warning',
  822. message: 'Please upload the attachment of PDF!'
  823. });
  824. }
  825. return false;
  826. }
  827. this.isLt2k = file.size / 1024 / 1024 < 50 ? '1' : '0';
  828. if (this.isLt2k === '0') {
  829. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  830. this.$message({
  831. message: '上传文件大小不能超过50M!',
  832. type: 'error'
  833. });
  834. } else {
  835. this.$message({
  836. message: 'Upload file size cannot exceed 50M!',
  837. type: 'error'
  838. });
  839. }
  840. return false;
  841. }
  842. },
  843. beforeUploadVideo(file) {
  844. const isLt200M = file.size / 1024 / 1024 < 50;
  845. if (['video/mp4'].indexOf(file.type) == -1) {
  846. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  847. this.$message({
  848. type: 'warning',
  849. message: '请上传mp4的视频!'
  850. });
  851. } else {
  852. this.$message({
  853. type: 'warning',
  854. message: 'Please upload the Video of MP4!'
  855. });
  856. }
  857. return false;
  858. }
  859. if (!isLt200M) {
  860. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  861. this.$message({
  862. message: '上传文件大小不能超过200M!',
  863. type: 'error'
  864. });
  865. } else {
  866. this.$message({
  867. message: 'Upload file size cannot exceed 200M!',
  868. type: 'error'
  869. });
  870. }
  871. return false;
  872. }
  873. },
  874. onRemove(file,fileList,status,ele) {
  875. let parameter = this.languageList[this.languageTabsValue-1].value
  876. if(status==0){
  877. // this.resultForm.public[ele].delete(this.languageList[this.languageTabsValue-1].value)
  878. this.resultForm[parameter][ele] = '';
  879. }else if(status==1){
  880. // this.resourceForm.public[ele].delete(this.languageList[this.languageTabsValue-1].value)
  881. this.resourceForm[parameter][ele] = '';
  882. }
  883. },
  884. handleAvatarSuccess(status,ele,res,file){
  885. let parameter = this.languageList[this.languageTabsValue-1].value
  886. if(status==0){
  887. // this.resultForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.data.attachmentId)
  888. this.resultForm[parameter][ele] = res.data.attachmentId
  889. }else if(status==1){
  890. // this.resourceForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.data.attachmentId)
  891. this.resourceForm[parameter][ele] = res.data.attachmentId
  892. }
  893. },
  894. handleAvatarSuccessVideo(status,ele,res,file){
  895. // this.resourceForm.public[ele].set(this.languageList[this.languageTabsValue-1].value,res.url);
  896. let parameter = this.languageList[this.languageTabsValue-1].value
  897. this.resourceForm[parameter][ele] = res.url
  898. },
  899. onPreview(file,fileList,status,ele){
  900. console.log(ele)
  901. console.log(file)
  902. this.dialogVisible = true;
  903. if(ele=='coverFileMap'||ele=='mediaFileMap'){
  904. this.dialogVisibleImg = file.response.data.path;
  905. }else if(ele=='catalogFileMap'){
  906. this.dialogVisibleImg = file.response.data.path;
  907. }else if(ele=='fileMap'){
  908. this.dialogVisiblePdf = file.response.data.path;
  909. }else if(ele=='videoFileMap'){
  910. this.dialogVisibleVideo = file.response.data.path;
  911. }
  912. },
  913. beforeClose(done){
  914. this.dialogVisibleImg = '';
  915. this.dialogVisibleVideo = '';
  916. this.dialogVisiblePdf = '';
  917. done()
  918. },
  919. forceUpdate(e){
  920. this.$forceUpdate();
  921. },
  922. //提交表单
  923. onSubmitResults(formName) {
  924. const that = this;
  925. that.$refs[formName][0].validate((valid) => {
  926. if (valid) {
  927. //选择器
  928. let resultForm = {
  929. language:'',
  930. reserveOne:0, // 资源类型
  931. researchResultType:'',
  932. name:'',
  933. affiliatedUnitName:'',
  934. country:'',//国家
  935. continent:'',//大洲
  936. contactsName:'',
  937. contactsNumber:'',
  938. researchResultAbstract:'',
  939. }
  940. let data = []
  941. that.languageList.forEach((i)=>{
  942. resultForm.language = i.value;
  943. resultForm.researchResultType = that.resultForm.public.resourceTypeSelectValue2.value;
  944. resultForm.continent = that.resultForm[i.value].resourceCountrySelectValue1.value;
  945. resultForm.country = that.resultForm[i.value].resourceCountrySelectValue2.value;
  946. data.push(resultForm)
  947. if(that.resultForm[i.value].fileMap){
  948. this.resultForm.public.fileMap.set(i.value,that.resultForm[i.value].fileMap)
  949. }
  950. if(that.resultForm[i.value].coverFileMap){
  951. this.resultForm.public.coverFileMap.set(i.value,that.resultForm[i.value].coverFileMap)
  952. }
  953. if(that.resultForm[i.value].catalogFileMap){
  954. this.resultForm.public.catalogFileMap.set(i.value,that.resultForm[i.value].catalogFileMap)
  955. }
  956. });
  957. let token = getToken();
  958. this.submitHandler((token) => {
  959. saveOrUpdateBaseResearchResultInfos(
  960. JSON.stringify(data),
  961. JSON.stringify(that.resultForm.public.fileMap),
  962. JSON.stringify(that.resultForm.public.coverFileMap),
  963. JSON.stringify(that.resultForm.public.catalogFileMap),
  964. token
  965. ).then(result => {
  966. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  967. this.$message({
  968. message: '发布成功',
  969. type: 'success'
  970. });
  971. } else {
  972. this.$message({
  973. message: 'Release Success',
  974. type: 'success'
  975. });
  976. }
  977. this.toResource()
  978. }).catch((error) => {
  979. this.resetToken();
  980. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  981. this.$message({
  982. message: '发布失败',
  983. type: 'error'
  984. });
  985. } else {
  986. this.$message({
  987. message: 'Release Error',
  988. type: 'error'
  989. });
  990. }
  991. this.toResource()
  992. });
  993. });
  994. } else {
  995. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  996. this.$message({
  997. message: '必填项未填!',
  998. type: 'error'
  999. });
  1000. } else {
  1001. this.$message({
  1002. message: 'The required fields are not filled in!',
  1003. type: 'error'
  1004. });
  1005. }
  1006. }
  1007. });
  1008. },
  1009. onSubmitResource(formName){
  1010. const that = this;
  1011. that.$refs[formName][0].validate((valid) => {
  1012. if (valid) {
  1013. //选择器
  1014. let resourceForm = {
  1015. language:'',
  1016. reserveOne:1, // 资源类型
  1017. researchResourcesType:'',
  1018. name:'',
  1019. address:'',
  1020. affiliatedUnitName:'',
  1021. country:'',//国家
  1022. continent:'',//大洲
  1023. contactsName:'',
  1024. contactsNumber:'',
  1025. contactsEmail: '',
  1026. researchResultAbstract:'',
  1027. dockingMode:'',
  1028. }
  1029. let data = []
  1030. that.languageList.forEach((i)=>{
  1031. resourceForm.language = i.value;
  1032. resourceForm.researchResourcesType = that.resourceForm.public.resourceTypeSelectValue2.value;
  1033. resourceForm.continent = that.resourceForm[i.value].resourceCountrySelectValue1.value;
  1034. resourceForm.country = that.resourceForm[i.value].resourceCountrySelectValue2.value;
  1035. if(that.resourceForm.public.radioList.length!=0&&that.resourceForm.public.radioList.length!=undefined){
  1036. if(that.resourceForm.public.radio==that.resourceForm.public.radioList[0].label){
  1037. that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[0].value
  1038. }else if(that.resourceForm.public.radio==that.resourceForm.public.radioList[1].label){
  1039. that.resourceForm[i.value].dockingMode = that.resourceForm.public.radioList[1].value
  1040. }
  1041. }
  1042. data.push(resourceForm)
  1043. if(that.resourceForm[i.value].mediaFileMap){
  1044. this.resourceForm.public.mediaFileMap.set(i.value,that.resourceForm[i.value].mediaFileMap)
  1045. }
  1046. if(that.resourceForm[i.value].videoFileMap){
  1047. this.resourceForm.public.videoFileMap.set(i.value,that.resourceForm[i.value].videoFileMap)
  1048. }
  1049. if(that.resourceForm[i.value].fileMap){
  1050. this.resourceForm.public.fileMap.set(i.value,that.resourceForm[i.value].fileMap)
  1051. }
  1052. });
  1053. let token = getToken();
  1054. this.submitHandler((token) => {
  1055. saveOrUpdateBaseResearchResourcesInfos(
  1056. JSON.stringify(data),
  1057. JSON.stringify(that.resourceForm.public.fileMap),
  1058. JSON.stringify(that.resourceForm.public.mediaFileMap),
  1059. JSON.stringify(that.resourceForm.public.videoFileMap),
  1060. token
  1061. ).then(result => {
  1062. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1063. this.$message({
  1064. message: '发布成功',
  1065. type: 'success'
  1066. });
  1067. } else {
  1068. this.$message({
  1069. message: 'Release Success!',
  1070. type: 'success'
  1071. });
  1072. }
  1073. this.toResource()
  1074. }).catch((error) => {
  1075. this.resetToken();
  1076. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1077. this.$message({
  1078. message: '发布失败',
  1079. type: 'error'
  1080. });
  1081. } else {
  1082. this.$message({
  1083. message: 'Release Error',
  1084. type: 'error'
  1085. });
  1086. }
  1087. this.toResource()
  1088. });
  1089. });
  1090. } else {
  1091. if (this.$i18n.locale.toUpperCase() == 'ZH') {
  1092. this.$message({
  1093. message: '必填项未填!',
  1094. type: 'error'
  1095. });
  1096. } else {
  1097. this.$message({
  1098. message: 'The required fields are not filled in!',
  1099. type: 'error'
  1100. });
  1101. }
  1102. }
  1103. });
  1104. },
  1105. }
  1106. }
  1107. </script>
  1108. <style scoped>
  1109. .box {
  1110. margin-top: 10px;
  1111. background: #fff;
  1112. /* height: 500px; */
  1113. padding: 20px 0;
  1114. }
  1115. .crumbs {
  1116. margin:0 20px;
  1117. }
  1118. .content{
  1119. width: 100%;
  1120. padding: 20px 10px;
  1121. box-sizing: border-box;
  1122. }
  1123. .content .addLanguage{
  1124. width: 100%;
  1125. height: 50px;
  1126. border-bottom: 1px solid #666666;
  1127. }
  1128. .content .issue{
  1129. margin-top: 15px;
  1130. }
  1131. </style>