123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734 |
- <template>
- <div class="autoBox box" style="min-height: 900px;position: relative;">
- <div class="crumbs">
- <div style="overflow: hidden">
- <el-breadcrumb separator-class="el-icon-arrow-right" style="float: left">
- <el-breadcrumb-item :to="{ path: 'home' }">{{$t('common.Home')}}</el-breadcrumb-item>
- <el-breadcrumb-item :to="{ path: 'resourceSharing' }" class="pointer">{{$t('common.ResourceSharing')}}</el-breadcrumb-item>
- <el-breadcrumb-item>{{$t('common.resourceResearchResourceIssue')}}</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- <div class="content">
- <div class="addLanguage">
- <i class="el-icon-orange" style="font-size: 30px;line-height: 50px;color: #E6A23C;vertical-align: middle;"></i>
- <span style="font-size: 18px;line-height: 50px;margin-left: 20px;vertical-align: middle;">{{$t('common.resourceLanguageVersion')}}</span>
- <!-- <i class="el-icon-plus" style="font-size: 30px;font-weight: 600;margin-left: 20px;line-height: 50px; color: #E6A23C;vertical-align: middle;"></i>-->
- <!-- <i class="el-icon-plus" style="font-size: 30px;font-weight: 600;margin-left: 20px;line-height: 50px; color: #E6A23C;vertical-align: middle;"-->
- <!-- @click="addTabDialog(editableTabsValue)"></i>-->
- </div>
- <div class="issue">
- <el-tabs v-model="editableTabsValue" type="card" closable @tab-remove="removeTab">
- <el-tab-pane
- v-for="(item, index) in languageList"
- :key="item.name"
- :label="$t(item.title)"
- :name="item.name"
- >
- <div style="width: 100%;padding: 0 150px;box-sizing: border-box">
- <el-form ref="form" :model="form" :rules="rules" label-width="140px">
- <!--资源类型 调研资源-->
- <el-form-item required :label="$t('common.resourceTheResourceType')">
- <!--<el-select style="width: 320px;" v-model="form.public.resourceTypeSelectValue1" :placeholder="$t('common.resource')" @change="resourceType">
- <el-option
- v-for="item in form.public.resourceTypeSelect"
- :label="item.value"
- :value="item">
- </el-option>
- </el-select>-->
- <el-input :value="$t('common.researchResource')" style="width: 320px;float: left;" disabled class="research"></el-input>
- <el-select v-model="form.public.resourceTypeSelectValue" :placeholder="$t('common.resourcePleaseSelectTheSecondaryType')" style="width: 320px;float: right;">
- <el-option
- v-for="item in form.public.resourceTypeSelect"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <!--媒体-->
- <el-form-item :label="$t('common.resourceResearchResourceMedia')">
- <el-upload
- class="upload-demo"
- action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_media"
- :before-upload="beforeUploadMedia"
- :on-remove="onRemoveMedia"
- :on-preview="onPreviewMedia"
- list-type="picture"
- :on-success="handleAvatarSuccessMedia"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}},{{$t('common.resourceUploadOne')}}</div>
- </el-upload>
- </el-form-item>
- <!--名称-->
- <el-form-item required :label="$t('common.resourceName')">
- <el-input v-model="form[item.language].name"
- :placeholder="$t('common.resourcePleaseEnterTheName')"
- ></el-input>
- </el-form-item>
- <!--所属单位-->
- <el-form-item required :label="$t('common.resourceSubordinateUnits')">
- <el-input v-model="form[item.language].affiliatedUnitName"
- :placeholder="$t('common.resourcePleaseEnterUnit')"
- ></el-input>
- </el-form-item>
- <!--国家-->
- <el-form-item required :label="$t('common.resourceCountries')">
- <el-select style="width: 320px;" v-model="form.public.resourceCountrySelectValue1" :placeholder="$t('common.resourcePleaseSelectContinent')" @change="resourceCountry">
- <el-option
- v-for="item in form.public.resourceCountrySelect"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- <el-select v-model="form.public.resourceCountrySelectValue2" :placeholder="$t('common.resourcePleaseSelectCountry')" style="width: 320px;float: right;">
- <el-option
- v-for="item in form.public.resourceCountrySelectValue1.data"
- :label="item.label"
- :value="item">
- </el-option>
- </el-select>
- </el-form-item>
- <!--联系人-->
- <el-form-item required :label="$t('common.resourceTheContact')">
- <el-input v-model="form[item.language].contactsName"
- :placeholder="$t('common.resourcePleaseEnterTheContactName')"
- ></el-input>
- </el-form-item>
- <!--联系电话-->
- <el-form-item :label="$t('common.resourceContactPhoneNumber')">
- <el-input v-model="form[item.language].contactsNumber"
- :placeholder="$t('common.resourcePleaseEnterYourContactNumber')"
- ></el-input>
- </el-form-item>
- <!--摘要-->
- <el-form-item :label="$t('common.resourceDetailsAbstract')">
- <el-input
- type="textarea"
- :placeholder="$t('common.resourcePleaseEnterSummary')"
- v-model="form[item.language].details"
- maxlength="500"
- show-word-limit
- rows="6"
- >
- </el-input>
- </el-form-item>
- <!--视频-->
- <el-form-item :label="$t('common.resourceResearchResourceVideo')">
- <el-upload
- class="upload-demo"
- action="/api/resourceshare/baseResearchResourcesInfos/uploadVideo"
- :before-upload="beforeUploadVideo"
- :on-remove="onRemoveVideo"
- :on-preview="onPreviewVideo"
- :on-success="handleAvatarSuccessVideo"
- :limit="1"
- :headers="myHeadersVideo"
- :file-list="fileList"
- :data="video"
- name="layuiVideo">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed')}}50MB,{{$t('common.resourceUploadOne')}}</div>
- </el-upload>
- </el-form-item>
- <!--附件-->
- <el-form-item :label="$t('common.resourceTheAttachment')">
- <el-upload
- class="upload-demo"
- action="/api/file/upload/attachment?module=BaseResearchResourcesInfoForm&attachmentBusinessType=base_research_resource_info_file"
- :before-upload="beforeUploadFile"
- :on-remove="onRemoveFile"
- :on-preview="onPreviewFile"
- :on-success="handleAvatarSuccessFile"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadPDF')}},{{$t('common.resourceFilesCannotExceed50Mb')}}</div>
- </el-upload>
- </el-form-item>
- <!--轮播图-->
- <el-form-item :label="$t('common.resourceSlideshow')">
- <el-upload
- class="upload-demo"
- action="/api/file/upload/img?module=BaseResearchResourcesEntityForm"
- :before-upload="beforeUploadBanner"
- :on-remove="onRemoveBanner"
- :on-preview="onPreviewBanner"
- list-type="picture"
- :on-success="handleAvatarSuccessBanner"
- :limit="1"
- :headers="myHeaders"
- :file-list="fileList">
- <el-button size="small" type="primary">{{$t('common.resourceSelectUploadFile')}}</el-button>
- <div slot="tip" class="el-upload__tip" style="display: inline-block;margin-left: 5px;">{{$t('common.resourceUploadJPGPNG')}},{{$t('common.resourceFilesCannotExceed10Mb')}}</div>
- </el-upload>
- </el-form-item>
- <el-form-item style="text-align: center;">
- <el-button style="margin-right: 50px;">{{$t('common.resourceCancel')}}</el-button>
- <el-button type="primary" @click="onSubmit">{{$t('common.resourceRelease')}}</el-button>
- </el-form-item>
- </el-form>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </div>
- <el-dialog
- :visible.sync="dialogVisible"
- width="60%"
- height="80%"
- :before-close="beforeClose">
- <div>
- <!-- <img :src="'api/file/pub/'+ dialogVisibleImg" alt="">-->
- <img :src="'api/file/pub/'+ dialogVisibleImg" alt="" style="width: 100%" v-show="dialogVisibleImg!=''">
- <video :src="'api/file/pub/'+ dialogVisibleVideo" style="width: 100%" v-show="dialogVisibleVideo!=''"
- type="video/mp4" controls="controls" width="100%" autoplay preload="auto"></video>
- <iframe :src="'api/file/pub/'+ dialogVisiblePdf" frameborder="0" v-show="dialogVisiblePdf!=''" style="width: 100%;height: 800px;"></iframe>
- </div>
- </el-dialog>
- <el-dialog
- :title="$t('common.resourceLanguageVersion')"
- :visible.sync="addLanguage"
- width="30%">
- <div>
- <el-select v-model="addLanguageValue">
- <el-option
- v-for="item in addLanguageOptions"
- :label="$t(item.label)"
- :value="item"
- :style="!item.label==languageList.title">
- </el-option>
- </el-select>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="languageClose">取 消</el-button>
- <el-button type="primary" @click="addTab">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import Base from "@/views/base/Base";
- import {getDicts} from '@/api/dict';
- import { saveOrUpdate,UpdateVideo } from "@/api/research/resource/baseResearchResourcesEntity";
- import { getToken ,resetToken} from '@/utils/auth'
- import { getTreeByLanguagePortal } from "@/api/operation/baseCityInformationDict";
- export default {
- name: "resourceSharingResourceIssue",
- extends: Base,
- data(){
- return{
- dialogVisible:false,
- dialogVisibleImg:'',
- dialogVisibleVideo:'',
- dialogVisiblePdf:'',
- addLanguage:false,
- addLanguageOptions: [
- {
- label: "common.Chinese",
- name: '1',
- value: 'CN',
- },
- {
- label: 'common.English',
- name: '2',
- value: 'EN',
- }
- ],
- addLanguageValue: '',
- video:{dir:'media'},
- myHeaders: {Authorization: ('Bearer ' +getToken())},
- myHeadersVideo: {Authorization: ('Bearer ' +getToken())},
- fileList:[],
- editableTabsValue: '1',
- languageList:[
- {
- title: "common.Chinese",
- name: '1',
- language: 'CN',
- },
- {
- title: 'common.English',
- name: '2',
- language: 'EN',
- }
- ],
- tabIndex: 2,
- form: {
- public:{
- resourceTypeSelectValue:'',
- resourceTypeSelect:[],
- resourceCountrySelectValue1:'',
- resourceCountrySelectValue2:'',
- resourceCountrySelectValue:'',
- resourceCountrySelect:[],
- },
- CN:{
- language:"ZH",
- reserveOne:2, // 资源类型
- researchResourcesType:'',
- name:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- researchResourceAbstract:'',
- researchResourcesMediaVideo:'',
- reserveTwo:'',//轮播图
- },
- EN:{
- language:"EN",
- reserveOne:2, // 资源类型
- researchResourcesType:'',
- name:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- researchResourceAbstract:'',
- researchResourcesMediaVideo:'',
- reserveTwo:'',//轮播图
- }
- },
- baseResearchResourcesInfo:{
- reserveOne:2, // 资源类型
- researchResourcesType:'',
- researchResourcesMedia:'',
- name:'',
- affiliatedUnitName:'',
- country:'',//国家
- continent:'',//大洲
- contactsName:'',
- contactsNumber:'',
- details:'',
- researchResourcesMediaVideo:'',
- fileAddress:'',
- reserveTwo:'',
- },
- mediaFileMap: new Map(),
- fileMap: new Map(),
- rules: {
- name: [
- { required: true},
- ],
- },
- }
- },
- mounted() {
- if (!this.$Cookies.get('token')){
- this.toView('resourceSharing',1)
- }else{
- this.initData();
- };
- },
- watch:{
- '$i18n.locale'(){
- this.initData();
- },
- },
- methods:{
- initData(){
- this.getData();
- },
- resourceType(data){
- let that = this;
- if (data.value === 'Research results' || data.value === '研究成果'){
- that.baseResearchResourcesInfo.reserveOne = 1;
- }else{
- that.baseResearchResourcesInfo.reserveOne = 2;
- }
- },
- resourceCountry(data){
- this.form.public.resourceTypeSelectValue2 = '';
- let that = this;
- },
- addTabDialog(){
- const that = this;
- that.addLanguage = true;
- },
- languageClose(){
- const that = this;
- that.addLanguage = false;
- },
- addTab(targetName) {
- const that = this;
- that.addLanguage = false;
- // let newTabName = ++this.tabIndex + '';
- // this.languageList.push({
- // title: 'New Tab',
- // name: newTabName,
- // content: 'New Tab content'
- // });
- // this.editableTabsValue = newTabName;
- },
- removeTab(targetName) {
- let tabs = this.languageList;
- let activeName = this.editableTabsValue;
- if (activeName === targetName) {
- tabs.forEach((tab, index) => {
- if (tab.name === targetName) {
- let nextTab = tabs[index + 1] || tabs[index - 1];
- if (nextTab) {
- activeName = nextTab.name;
- }
- }
- });
- }
- this.editableTabsValue = activeName;
- this.languageList = tabs.filter(tab => tab.name !== targetName);
- },
- onSubmit() {
- const that = this;
- //选择器
- that.form.CN.researchResourcesType = that.form.EN.researchResourcesType = that.form.public.resourceTypeSelectValue.value;
- that.form.CN.continent = that.form.EN.continent = that.form.public.resourceCountrySelectValue1.value;
- that.form.CN.country = that.form.EN.country = that.form.public.resourceCountrySelectValue2.value;
- let data = []
- data.push(that.form.CN)
- data.push(that.form.EN)
- let token = getToken();
- this.submitHandler((token) => {
- saveOrUpdate(
- JSON.stringify(data),
- JSON.stringify(that.mediaFileMap),
- JSON.stringify(that.fileMap),
- token
- ).then(result => {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- alert('发布成功');
- } else {
- alert('Release Success');
- }
- }).catch((error) => {
- this.resetToken();
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- alert('发布失败');
- } else {
- alert('Release Error');
- }
- });
- this.toResourceSharing()
- });
- },
- beforeUploadMedia(file) {
- var FileExt = file.name.replace(/.+\./, "");
- if (['jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- type: 'warning',
- message: '请上传jpg,png的图片!'
- });
- } else {
- this.$message({
- type: 'warning',
- message: 'Please upload the picture of jpg, png!'
- });
- }
- return false;
- }
- this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
- if (this.isLt2k === '0') {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '上传文件大小不能超过10M!',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Upload file size cannot exceed 10M!',
- type: 'error'
- });
- }
- return false;
- }
- },
- beforeUploadVideo(file) {
- const isLt200M = file.size / 1024 / 1024 < 200;
- if (['video/mp4'].indexOf(file.type) == -1) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- type: 'warning',
- message: '请上传mp4的视频!'
- });
- } else {
- this.$message({
- type: 'warning',
- message: 'Please upload the Video of MP4!'
- });
- }
- return false;
- }
- if (!isLt200M) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '上传文件大小不能超过200M!',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Upload file size cannot exceed 200M!',
- type: 'error'
- });
- }
- return false;
- }
- },
- beforeUploadFile(file) {
- var FileExt = file.name.replace(/.+\./, "");
- if (['pdf'].indexOf(FileExt.toLowerCase()) === -1) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- type: 'warning',
- message: '请上传pdf的附件!'
- });
- } else {
- this.$message({
- type: 'warning',
- message: 'Please upload the attachment of PDF!'
- });
- }
- return false;
- }
- this.isLt2k = file.size / 1024 / 1024 < 50 ? '1' : '0';
- if (this.isLt2k === '0') {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '上传文件大小不能超过50M!',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Upload file size cannot exceed 50M!',
- type: 'error'
- });
- }
- return false;
- }
- },
- beforeUploadBanner(file) {
- var FileExt = file.name.replace(/.+\./, "");
- if (['jpg', 'png'].indexOf(FileExt.toLowerCase()) === -1) {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- type: 'warning',
- message: '请上传jpg,png的图片!'
- });
- } else {
- this.$message({
- type: 'warning',
- message: 'Please upload the picture of jpg, png!'
- });
- }
- return false;
- }
- this.isLt2k = file.size / 1024 / 1024 < 10 ? '1' : '0';
- if (this.isLt2k === '0') {
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- this.$message({
- message: '上传文件大小不能超过10M!',
- type: 'error'
- });
- } else {
- this.$message({
- message: 'Upload file size cannot exceed 10M!',
- type: 'error'
- });
- }
- return false;
- }
- },
- onRemoveMedia() {
- if(this.editableTabsValue == 1){
- this.researchResourcesMediaVideo.delete("ZH")
- }else{
- this.researchResourcesMediaVideo.delete("EN")
- }
- },
- onRemoveVideo() {
- if(this.editableTabsValue == 1){
- this.form.ZH.researchResourcesMediaVideo = ''
- }else{
- this.form.EN.researchResourcesMediaVideo = ''
- }
- },
- onRemoveFile() {
- if(this.editableTabsValue == 1){
- this.fileMap.delete("ZH")
- }else{
- this.fileMap.delete("EN")
- }
- },
- onRemoveBanner() {
- if(this.editableTabsValue == 1){
- this.form.ZH.reserveTwo = ''
- }else{
- this.form.EN.reserveTwo = ''
- }
- },
- onPreviewMedia(file){
- this.dialogVisible = true;
- this.dialogVisibleImg = file.response.data.path;
- },
- onPreviewVideo(file){
- this.dialogVisible = true;
- this.dialogVisibleVideo = file.response.url;
- },
- onPreviewFile(file){
- console.log(file)
- this.dialogVisible = true;
- this.dialogVisiblePdf = file.response.data.path;
- },
- onPreviewBanner(file){
- this.dialogVisible = true;
- this.dialogVisibleImg = file.response.data;
- },
- handleAvatarSuccessMedia(res,file){
- /*if(this.editableTabsValue == 1){
- let url = res.data;
- this.form.CN.researchResultCover = JSON.stringify(url);
- this.form.CN.researchResultCover = this.form.CN.researchResultCover.replace(/"/g, "")
- }else{
- let url = res.data;
- this.form.EN.researchResultCover = JSON.stringify(url);
- this.form.EN.researchResultCover = this.form.CN.researchResultCover.replace(/"/g, "")
- }*/
- if(this.editableTabsValue == 1){
- this.mediaFileMap.set("ZH",res.data.attachmentId)
- }else{
- this.mediaFileMap.set("EN",res.data.attachmentId)
- }
- },
- handleAvatarSuccessVideo(res,file){
- if(this.editableTabsValue == 1){
- let url = res.url;
- this.form.CN.researchResourcesMediaVideo = JSON.stringify(url);
- this.form.CN.researchResourcesMediaVideo = this.form.CN.researchResourcesMediaVideo.replace(/"/g, "")
- }else{
- let url = res.data;
- this.form.EN.researchResourcesMediaVideo = JSON.stringify(url);
- this.form.EN.researchResourcesMediaVideo = this.form.CN.researchResourcesMediaVideo.replace(/"/g, "")
- }
- },
- handleAvatarSuccessFile(res,file){
- /*if(this.editableTabsValue == 1){
- let url = res.data;
- this.form.CN.researchResultFile = JSON.stringify(url);
- this.form.CN.researchResultFile = this.form.CN.researchResultFile.replace(/"/g, "")
- }else{
- let url = res.data;
- this.form.EN.researchResultFile = JSON.stringify(url);
- this.form.EN.researchResultFile = this.form.CN.researchResultFile.replace(/"/g, "")
- }*/
- if(this.editableTabsValue == 1){
- this.fileMap.set("ZH",res.data.attachmentId)
- }else{
- this.fileMap.set("EN",res.data.attachmentId)
- }
- },
- handleAvatarSuccessBanner(res,file){
- if(this.editableTabsValue == 1){
- let url = res.data;
- this.form.CN.reserveTwo = JSON.stringify(url);
- this.form.CN.reserveTwo = this.form.CN.reserveTwo.replace(/"/g, "")
- }else{
- let url = res.data;
- this.form.EN.reserveTwo = JSON.stringify(url);
- this.form.EN.reserveTwo = this.form.CN.reserveTwo.replace(/"/g, "")
- }
- },
- async getData(){
- const that = this;
- that.form.public.resourceCountrySelectValue1 = '';
- that.form.public.resourceCountrySelectValue2 = '';
- if (this.$i18n.locale.toUpperCase() == 'ZH') {
- await getDicts(
- "RESEARCH_RESOURCE_TYPE_DICT"
- ).then(result => {
- if (result.data) {
- that.form.public.resourceTypeSelect = result.data[0];
- }
- })
- await getTreeByLanguagePortal('ZH').then(result => {
- if (result.data) {
- let values = Object.values(result.data);
- that.form.public.resourceCountrySelect = values;
- }
- })
- }else if (this.$i18n.locale.toUpperCase() == 'EN'){
- await getDicts(
- "RESEARCH_RESOURCE_TYPE_DICT_EN"
- ).then(result => {
- if (result.data) {
- that.form.public.resourceTypeSelect = result.data[0];
- }
- })
- await getTreeByLanguagePortal('EN').then(result => {
- if (result.data) {
- let values = Object.values(result.data);
- that.form.public.resourceCountrySelect = values;
- }
- })
- }
- },
- toView(router, json) {
- clearInterval(this.timer);
- this.$router.push({ name: router, params: {key:json} });
- },
- beforeClose(done){
- this.dialogVisibleImg = '';
- this.dialogVisibleVideo = '';
- this.dialogVisiblePdf = '';
- done()
- },
- toResourceSharing(){
- this.toView('resourceSharing',1)
- },
- }
- }
- </script>
- <style scoped>
- .box {
- margin-top: 10px;
- background: #fff;
- /* height: 500px; */
- padding: 20px 0;
- }
- .crumbs {
- margin:0 20px;
- }
- .content{
- width: 100%;
- padding: 20px 10px;
- box-sizing: border-box;
- }
- .content .addLanguage{
- width: 100%;
- height: 50px;
- border-bottom: 1px solid #666666;
- }
- .content .issue{
- margin-top: 15px;
- }
- </style>
- <style>
- .research input[type=text].el-input__inner{
- color: red;
- }
- </style>
|