1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243 |
- <template>
- <div
- style="width: 100%; background: #fff; min-height: 700px"
- class="userCenterAuthenticationPersonal"
- >
- <div
- v-show="$i18n.locale == 'zh'"
- style="
- height: 80px;
- line-height: 80px;
- margin-top: 20px;
- margin: 0 20px;
- color: #666;
- font-size: 15px;
- border-bottom: 1px solid #bcbcbc;
- "
- >
- 添加项目
- <!-- <span style="float: right;margin-top: 27px;"> <i class="el-icon-edit"></i> 修改</span> -->
- </div>
- <div v-show="$i18n.locale == 'zh'" style="width: 900px">
- <el-form
- ref="form"
- :model="baseProjectView"
- label-width="160px"
- class="demo-ruleForm"
- style="margin-left: 100px; margin-top: 20px; width: 900px"
- :rules="chineseFormRules"
- >
- <el-form-item label="项目名称(原语言):" prop="name">
- <el-input
- v-model="baseProjectView.originalLanguageProjectName"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="项目名称(中文):" prop="chineseLanguageProjectName">
- <el-input
- v-model="baseProjectView.chineseLanguageProjectName"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="项目名称(英文):" prop="englishLanguageProjectName">
- <el-input
- v-model="baseProjectView.englishLanguageProjectName"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="项目业主:" prop="projectOwner">
- <el-input
- v-model="baseProjectView.projectOwner"
- :disabled="false"
- style="width: 70%"
- maxlength="50"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="项目已有合作方:" prop="projectPartner">
- <el-input
- v-model="baseProjectView.projectPartner"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item :required="true" label="大洲:" prop="continentCountry">
- <el-select
- v-model="baseProjectView.continentCountry"
- placeholder="请选择或输入大洲"
- filterable
- multiple
- :disabled="false"
- style="width: 70%"
- >
- <el-option
- v-for="item in continentCountryDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :required="true" label="国家:" prop="unitCountry">
- <el-select
- v-model="baseProjectView.unitCountry"
- placeholder="请选择或输入国家"
- filterable
- multiple
- style="width: 70%"
- >
- <el-option
- v-for="item in unitCountryDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="城市:" prop='name'>
- <el-select v-model="baseProjectView.reserveOne" placeholder="请选择城市" style="width: 70%;">
- <el-option
- v-for="item in reserveOnes"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false">
- </el-option>
- </el-select>
- </el-form-item> -->
- <el-form-item
- :required="true"
- label="项目门类:"
- prop="technicalCategories"
- >
- <el-select
- v-model="baseProjectView.technicalCategories"
- placeholder="请选择门类"
- style="width: 70%"
- >
- <el-option
- v-for="item in technicalCategoriesDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :required="true" label="技术范围:" prop="technicalScope">
- <el-select
- v-model="baseProjectView.technicalScope"
- placeholder="请选择范围"
- style="width: 70%"
- >
- <el-option
- v-for="item in technicalScopeDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :required="true" label="当前阶段:" prop="phaseType">
- <el-select
- v-model="baseProjectView.phaseType"
- placeholder="请选择当前阶段"
- style="width: 70%"
- >
- <el-option
- v-for="item in phaseTypeDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="项目标签:" prop="name">
- <!-- <el-input v-model="baseProjectView.projectLabel" :disabled="false" style="width: 70%;"></el-input> -->
- <div>
- <el-tag
- :key="index"
- style="margin-right: 5px"
- v-for="(tag, index) in systemLabel"
- :disable-transitions="false"
- :type="tag.type"
- effect="plain"
- >
- {{ tag.label }}
- </el-tag>
- </div>
- <el-button type="success" @click="dialogVisibles()"
- >选择标签</el-button
- >
- </el-form-item>
- <el-form-item label="项目描述:" prop="name">
- <el-input
- type="textarea"
- :rows="10"
- v-model="baseProjectView.projectDescription"
- :placeholder="this.textareaMessaage"
- :disabled="false"
- style="width: 70%; min-height: 100px"
- maxlength="500"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="项目评估:" prop="name">
- <el-input
- type="textarea"
- v-model="baseProjectView.projectRequirements"
- :disabled="false"
- style="width: 70%"
- maxlength="500"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="项目附件:">
- <el-upload
- class="upload-demo"
- drag
- action="/api/file/upload/attachment?module=BaseProjectInfoForm&attachmentBusinessType=base_project_info"
- :on-change="handleChange"
- :on-success="handleAvatarSuccessAnnex"
- :on-preview="handlePreview"
- :headers="myHeaders"
- :on-remove="handleRemove"
- :before-upload="beforeUpload"
- :file-list="fileList"
- multiple
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- 将文件拖到此处,或<em>点击上传</em>
- </div>
- <div class="el-upload__tip" slot="tip">
- 提示:请上传ZIP,PDF,DOC,DOCX,XLS,XLSX格式的附件,文件不能超过50MB
- </div>
- </el-upload>
- </el-form-item>
- <el-form-item label="封面图片:" style="position: relative">
- <el-upload
- class="avatar-uploader"
- action="/api/file/upload/attachment?module=BaseProjectInfoForm&attachmentBusinessType=base_project_info_banner"
- :show-file-list="false"
- :headers="myHeaders"
- :on-success="photoSuccess"
- >
- <img
- v-if="path != ''"
- :src="'/api/file/pub/' + path"
- class="avatar"
- />
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
- <div
- slot="tip"
- class="el-upload__tip"
- style="display: inline-block; margin-left: 5px"
- >
- {{ $t("common.resourceHint")
- }}{{ $t("common.resourceUploadJPGPNG") }},{{
- $t("common.resourceFilesCannotExceed10Mb")
- }},{{ $t("common.resourceUploadOne") }}
- </div>
- </el-upload>
- </el-form-item>
- <el-form-item label="信息是否公开:">
- <el-radio-group v-model="baseProjectView.messageOpenType">
- <el-radio
- :label="item.value"
- :key="item.value"
- v-for="(item, index) in isCreateNewUser"
- >{{ item.label }}</el-radio
- >
- </el-radio-group>
- </el-form-item>
- </el-form>
- </div>
- <div v-show="$i18n.locale == 'zh'" style="height: 200px">
- <div style="margin-top: 100px">
- <el-button type="warning" style="margin-left: 300px" @click="save"
- >保存</el-button
- >
- <el-button type="primary" style="margin-left: 30px" @click="close"
- >关闭</el-button
- >
- </div>
- </div>
- <div v-if="dialogVisible && $i18n.locale == 'zh'">
- <userCenterAddTag
- v-bind:systemLabel="systemLabel"
- :mergeSelectedLabels="mergeSelectedLabels"
- @closeMain="closeMain"
- ></userCenterAddTag>
- <!-- :mergeSelectedLabels="mergeSelectedLabels" -->
- </div>
- <div
- v-show="$i18n.locale == 'en'"
- style="
- height: 80px;
- line-height: 80px;
- margin-top: 20px;
- margin: 0 20px;
- color: #666;
- font-size: 15px;
- border-bottom: 1px solid #bcbcbc;
- "
- >
- Add Project
- </div>
- <div v-show="$i18n.locale == 'en'" style="width: 900px">
- <el-form
- ref="form"
- :model="baseProjectView"
- label-width="160px"
- class="demo-ruleForm"
- style="margin-left: 100px; margin-top: 20px; width: 900px"
- :rules="englishFormRules"
- >
- <el-form-item label="Project name (original language):" prop="name">
- <el-input
- v-model="baseProjectView.originalLanguageProjectName"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item
- label="Project name (Chinese):"
- prop="chineseLanguageProjectName"
- >
- <el-input
- v-model="baseProjectView.chineseLanguageProjectName"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item
- label="Project name (English):"
- prop="englishLanguageProjectName"
- >
- <el-input
- v-model="baseProjectView.englishLanguageProjectName"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="Project owner:" prop="projectOwner">
- <el-input
- v-model="baseProjectView.projectOwner"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="Project partners:" prop="projectPartner">
- <el-input
- v-model="baseProjectView.projectPartner"
- :disabled="false"
- style="width: 70%"
- maxlength="100"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item
- :required="true"
- label="Continent:"
- prop="continentCountry"
- >
- <el-select
- v-model="baseProjectView.continentCountry"
- multiple
- :placeholder="placehoders"
- :disabled="false"
- style="width: 70%"
- >
- <el-option
- v-for="item in continentCountryDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :required="true" label="Country:" prop="unitCountry">
- <el-select
- v-model="baseProjectView.unitCountry"
- multiple
- :placeholder="placehoders"
- style="width: 70%"
- >
- <el-option
- v-for="item in unitCountryDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item label="city:" prop='name'>
- <el-select v-model="baseProjectView.reserveOne" placeholder="Please select a city" style="width: 70%;">
- <el-option
- v-for="item in reserveOnes"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false">
- </el-option>
- </el-select>
- </el-form-item> -->
- <el-form-item
- :required="true"
- label="Project category:"
- prop="technicalCategories"
- >
- <el-select
- v-model="baseProjectView.technicalCategories"
- placeholder="Please select the category"
- style="width: 70%"
- >
- <el-option
- v-for="item in technicalCategoriesDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- :required="true"
- label="Technology:"
- prop="technicalScope"
- >
- <el-select
- v-model="baseProjectView.technicalScope"
- placeholder="Please select a range"
- style="width: 70%"
- >
- <el-option
- v-for="item in technicalScopeDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item :required="true" label="Current stage:" prop="phaseType">
- <el-select
- v-model="baseProjectView.phaseType"
- placeholder="Please select current stage"
- style="width: 70%"
- >
- <el-option
- v-for="item in phaseTypeDicts"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- :disabled="false"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="Tag:" prop="name">
- <div>
- <el-tag
- :key="index"
- style="margin-right: 5px"
- v-for="(tag, index) in systemLabel"
- :disable-transitions="false"
- :type="tag.type"
- effect="plain"
- >
- {{ tag.label }}
- </el-tag>
- </div>
- <el-button type="success" @click="dialogVisibles()"
- >Add tag</el-button
- >
- </el-form-item>
- <el-form-item label="Project description:" prop="name">
- <el-input
- :rows="10"
- type="textarea"
- v-model="baseProjectView.projectDescription"
- :placeholder="this.textareaMessaageEn"
- :disabled="false"
- resize="800"
- style="width: 70%"
- maxlength="500"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="Project Evaluation:" prop="name">
- <el-input
- type="textarea"
- v-model="baseProjectView.projectRequirements"
- :disabled="false"
- style="width: 70%"
- maxlength="500"
- show-word-limit
- ></el-input>
- </el-form-item>
- <el-form-item label="Project attachment:">
- <el-upload
- class="upload-demo"
- drag
- action="/api/file/upload/attachment?module=BaseProjectInfoForm&attachmentBusinessType=base_project_info"
- :on-change="handleChange"
- :on-success="handleAvatarSuccessAnnex"
- :on-preview="handlePreview"
- :headers="myHeaders"
- :on-remove="handleRemove"
- :before-upload="beforeUpload"
- :file-list="fileList"
- multiple
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- Drag the file here, or<em>Click upload</em>
- </div>
- <div class="el-upload__tip" slot="tip">
- Hint: Please upload the attachment of ZIP,PDF,DOC,DOCX,XLS and
- XLSX, The file cannot exceed 50MB
- </div>
- </el-upload>
- </el-form-item>
-
- <el-form-item label="Cover image:" style="position: relative">
- <el-upload
- class="avatar-uploader"
- action="/api/file/upload/attachment?module=BaseProjectInfoForm&attachmentBusinessType=base_project_info_banner"
- :show-file-list="false"
- :headers="myHeaders"
- :on-success="photoSuccess"
- >
- <!-- <img v-if="path != ''" :src="'/api/file/pub/'+path" class="avatar"> -->
- <img
- v-if="path != ''"
- :src="'/api/file/pub/' + path"
- class="avatar"
- />
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
- <div
- slot="tip"
- class="el-upload__tip"
- style="display: inline-block; margin-left: 5px"
- >
- {{ $t("common.resourceHint")
- }}{{ $t("common.resourceUploadJPGPNG") }},{{
- $t("common.resourceFilesCannotExceed10Mb")
- }},{{ $t("common.resourceUploadOne") }}
- </div>
- </el-upload>
- </el-form-item>
- <el-form-item label="Disclose project to public:">
- <el-radio-group v-model="baseProjectView.messageOpenType">
- <el-radio
- :label="item.value"
- :key="item.value"
- v-for="(item, index) in isCreateNewUserEn"
- >{{ item.label }}</el-radio
- >
- </el-radio-group>
- </el-form-item>
- </el-form>
- </div>
- <div v-show="$i18n.locale == 'en'" style="height: 200px">
- <div style="margin-top: 100px">
- <el-button type="warning" style="margin-left: 300px" @click="save"
- >Save</el-button
- >
- <el-button type="primary" style="margin-left: 30px" @click="close"
- >Close</el-button
- >
- </div>
- </div>
- <div v-if="dialogVisible && $i18n.locale == 'en'">
- <userCenterAddTag
- v-bind:systemLabel="systemLabel"
- :mergeSelectedLabels="mergeSelectedLabels"
- @closeMain="closeMain"
- ></userCenterAddTag>
- </div>
- </div>
- </template>
- <script>
- import { regionDataPlus } from "element-china-area-data";
- import ue from "@/components/ue";
- import userCenterAddTag from "./userCenterAddTag";
- import Base from "@/views/base/Base";
- import { getDicts } from "@/api/dict";
- import {
- getTreeByLanguagePortal,
- getAllCountryAndCity,
- } from "@/api/operation/baseCityInformationDict";
- import {
- saveOrUpdate,
- getBaseProjectBizViewById,
- } from "@/api/project/baseProjectInfo";
- import { getToken, resetToken } from "@/utils/auth";
- import { searchFiles } from "@/api/file";
- import { addIntegral, addGrowth } from "@/utils/toCompleteTask";
- export default {
- name: "userCenteraddMaintenanceJournalInformations",
- extends: Base,
- components: {
- ue,
- userCenterAddTag,
- },
- data() {
- return {
- placehoders: "Please select",
- textareaMessaage:
- "项目描述可包含但不限于以下方面:\n" +
- "(一)项目意义\n" +
- "(二)项目方案\n" +
- "(三)项目进展\n" +
- "(四)当前需求\n" +
- " ...",
- textareaMessaageEn:
- "Please add project description that may include but not limited to the subjects such as:\n" +
- "1.Project significance\n" +
- "2.Project plan\n" +
- "3.Project progress\n" +
- "4.Project Demand\n" +
- " ...",
- fileList: [],
- myHeaders: { Authorization: "Bearer " + getToken() },
- isCreateNewUser: [
- { label: "是", value: "Y" },
- { label: "否(只对合作组织公开)", value: "N" },
- ],
- isCreateNewUserEn: [
- { label: "Yes", value: "Y" },
- { label: "No (Visible only to GEIDCO)", value: "N" },
- ],
- informationsClass: "1",
- dialogVisible: false,
- ifDiaslog: "",
- title: "",
- options: regionDataPlus,
- selectedOptions: [],
- systemLabel: [],
- mergeSelectedLabels: [],
- baseProjectView: {
- originalLanguageProjectName: "",
- englishLanguageProjectName: "",
- chineseLanguageProjectName: "",
- projectOwner: "",
- projectPartner: "",
- projectLabel: "",
- projectDescription: "",
- projectRequirements: "",
- region: "普通用户",
- date1: "2018-05-19",
- date3: "2018-05-19",
- date2: "2020-05-25 11:20:23",
- delivery: false,
- type: [],
- resource: "",
- desc: "",
- startData: "",
- id: this.$route.params.key,
- projectNum: "",
- projectName: "",
- projectConsultantId: "",
- setUpDate: new Date(),
- setDownDate: "",
- technicalCategories: "",
- technicalScope: "",
- phaseType: "",
- releaseStatus: "0",
- approveStatus: "",
- publishingChannels: "1",
- continentCountry: "",
- unitCountry: "",
- unitInfo: "",
- recommendFlag: "n",
- messageOpenType: "Y",
- status: "",
- childCount: "",
- entityZh: "",
- entityEn: "",
- entityFr: "",
- entityDe: "",
- entityEs: "",
- entityJa: "",
- entityAr: "",
- entityRu: "",
- createBy: "",
- createDate: new Date(),
- updateBy: "",
- updateDate: "",
- reserveOne: "",
- reserveTwo: "",
- reserveThree: "",
- reserveFour: "",
- reserveFive: "",
- },
- continentCountryDicts: [],
- unitCountryDicts: [],
- reserveOnes: [],
- technicalCategoriesDicts: [],
- technicalScopeDicts: [],
- phaseTypeDicts: [],
- languageDicts: [],
- imageUrl: "",
- form: {},
- files: [],
- imgList: [],
- path: "",
- user: {
- umsUser: {},
- },
- };
- },
- watch: {
- // "baseProjectView.continentCountry"() {
- // this.continentCountryDicts.forEach((i) => {
- // if (this.baseProjectView.continentCountry == i.value) {
- // this.unitCountryDicts = i.data;
- // }
- // });
- // },
- // "baseProjectView.unitCountry"() {
- // this.unitCountryDicts.forEach((i) => {
- // if (this.baseProjectView.unitCountry == i.value) {
- // this.reserveOnes= i.data;
- // }
- // })
- // },
- "$i18n.locale"() {
- this.initData();
- // this.getBaseProject();
- },
- },
- mounted() {
- this.initData();
- },
- computed: {
- englishFormRules() {
- return {
- // resultTheResourceType: [
- // { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
- // ],
- chineseLanguageProjectName: [
- {
- required: true,
- message: "please input chineseLanguageProjectName",
- trigger: "change",
- },
- ],
- projectOwner: [
- {
- required: true,
- message: "please input projectOwner",
- trigger: "change",
- },
- ],
- projectPartner: [
- {
- required: true,
- message: "please input projectPartner",
- trigger: "change",
- },
- ],
- continentCountry: [
- {
- required: true,
- message: "please select continentCountry",
- trigger: "change",
- },
- ],
- unitCountry: [
- {
- required: true,
- message: "please select unitCountry",
- trigger: "change",
- },
- ],
- technicalCategories: [
- {
- required: true,
- message: "please select technicalCategories",
- trigger: "change",
- },
- ],
- technicalScope: [
- {
- required: true,
- message: "please select technicalScope",
- trigger: "change",
- },
- ],
- phaseType: [
- {
- required: true,
- message: "please select phaseType",
- trigger: "change",
- },
- ],
- englishLanguageProjectName: [
- {
- required: true,
- message: "please input englishLanguageProjectName",
- trigger: "change",
- },
- ],
- };
- },
- chineseFormRules() {
- return {
- // resultTheResourceType: [
- // { required: true, message: this.$i18n.locale=='zh'?'请选择资源类型':'Select the resource type', trigger: 'change' },
- // ],
- chineseLanguageProjectName: [
- {
- required: true,
- message: "请输入项目名称(中文)",
- trigger: "change",
- },
- ],
- projectOwner: [
- { required: true, message: "请输入项目业主", trigger: "change" },
- ],
- projectPartner: [
- { required: true, message: "请输入项目合作方", trigger: "change" },
- ],
- continentCountry: [
- { required: true, message: "请选择大洲", trigger: "change" },
- ],
- unitCountry: [
- { required: true, message: "请选择国家", trigger: "change" },
- ],
- technicalCategories: [
- { required: true, message: "请选择项目门类", trigger: "change" },
- ],
- technicalScope: [
- { required: true, message: "请选择技术范围", trigger: "change" },
- ],
- phaseType: [
- { required: true, message: "请选择当前阶段", trigger: "change" },
- ],
- englishLanguageProjectName: [
- {
- required: true,
- message: "请输入项目名称(英文)",
- trigger: "change",
- },
- ],
- };
- },
- },
- methods: {
- initData() {
- this.user = JSON.parse(window.localStorage.getItem("user"));
- },
- searchFiles() {
- var _that = this;
- var file1 = {
- attachmentBusinessId: _that.baseProjectView.reserveFive,
- attachmentBusinessType: "base_project_info",
- };
- var file2 = {
- attachmentBusinessId: _that.baseProjectView.reserveFive,
- attachmentBusinessType: "base_project_info_banner",
- };
- _that.path = "";
- searchFiles(file2).then((result) => {
- _that.path = result.data.attachmentInfos[0].attachmentSavePath;
- });
- _that.fileList = [];
- searchFiles(file1).then((result) => {
- result.data.attachmentInfos.forEach((i) => {
- var fileTo = {
- name: i.attachmentName,
- url: i.attachmentSavePath,
- uid: i.id,
- };
- _that.fileList.push(fileTo);
- _that.files.push(i.id);
- console.log(_that.files + "_that.files");
- });
- });
- },
- initData() {
- var _that = this;
- var language = _that.$i18n.locale.toUpperCase();
- if (_that.baseProjectView.id != null) {
- getBaseProjectBizViewById(_that.baseProjectView.id, language).then(
- (result) => {
- _that.baseProjectView = result.data
- ? result.data.baseProjectBizView
- : {};
- _that.baseProjectView.continentCountry =
- _that.baseProjectView.continentCountry.split(",");
- _that.baseProjectView.unitCountry =
- _that.baseProjectView.unitCountry.split(",");
- _that.searchFiles();
- }
- );
- }
- _that.continentCountryDicts = [];
- _that.unitCountryDicts = [];
- var language = _that.$i18n.locale.toUpperCase();
- getAllCountryAndCity().then((result) => {
- var allCountry = result.data.allCountry;
- var unitCountryDictsValue = [];
- if (_that.$i18n.locale == "zh") {
- allCountry.forEach((i) => {
- var j = {};
- j.data = [];
- j.value = i.country_iso_code;
- j.label = i.country_name;
- unitCountryDictsValue.push(j);
- });
- _that.unitCountryDicts = unitCountryDictsValue;
- }
- if (_that.$i18n.locale == "en") {
- allCountry.forEach((i) => {
- var j = {};
- j.data = [];
- j.value = i.country_iso_code;
- j.label = i.country_name_en;
- unitCountryDictsValue.push(j);
- });
- _that.unitCountryDicts = unitCountryDictsValue;
- }
- }),
- getTreeByLanguagePortal(language).then((result) => {
- var keys = Object.keys(result.data);
- for (var i = 0; i < keys.length; i++) {
- _that.continentCountryDicts.push(result.data[keys[i]]);
- }
- });
- // getTreeByLanguagePortal(language).then(result => {
- // var keys = Object.keys(result.data);
- // _that.continentCountryDicts = [];
- // for(var i = 0;i < keys.length;i++){
- // _that.continentCountryDicts.push(result.data[keys[i]]);
- // }
- // if (_that.baseProjectView.continentCountry != null) {
- // _that.continentCountryDicts.forEach((i) => {
- // if (_that.baseProjectView.continentCountry == i.value) {
- // _that.unitCountryDicts = i.data;
- // }
- // });
- // }
- // if (_that.baseProjectView.unitCountry != null) {
- // _that.unitCountryDicts.forEach((i) => {
- // if (_that.baseProjectView.unitCountry == i.value) {
- // _that.reserveOnes= i.data;
- // }
- // })
- // }
- // })
- if (_that.$i18n.locale.toUpperCase() == "ZH") {
- getDicts(
- "PROJECT_CATEGORIES_DICT,TECHNICAL_SCOPE_DICT,PHASE_TYPE_DICT,LANGUAGE_DICT"
- ).then((result) => {
- var data = result.data;
- if (data) {
- _that.technicalCategoriesDicts = result.data[0] || [];
- _that.technicalScopeDicts = result.data[1] || [];
- _that.phaseTypeDicts = result.data[2] || [];
- _that.languageDicts = result.data[3] || [];
- }
- });
- }
- if (_that.$i18n.locale.toUpperCase() == "EN") {
- getDicts(
- "PROJECT_CATEGORIES_DICT_EN,TECHNICAL_SCOPE_DICT_EN,PHASE_TYPE_DICT_EN,LANGUAGE_DICT"
- ).then((result) => {
- var data = result.data;
- if (data) {
- _that.technicalCategoriesDicts = result.data[0] || [];
- _that.technicalScopeDicts = result.data[1] || [];
- _that.phaseTypeDicts = result.data[2] || [];
- _that.languageDicts = result.data[3] || [];
- }
- });
- }
- },
- // 下载文件方法file参数为已上传文件的信息,其实就是取得fileList里的值
- handlePreview(file, fileList) {
- document.location.href = "http://localhost:8080/api/file/pub/" + file.url;
- },
- handleRemove(file, fileList) {
- this.files.forEach((i) => {
- if (i == file.uid) {
- var index = this.files.indexOf(i);
- this.files.splice(index, 1);
- }
- });
- },
- handleAvatarSuccessAnnex(res, file) {
- this.files.push(res.data.attachmentId);
- },
- beforeUpload(file) {
- var FileExt = file.name.replace(/.+\./, "");
- if (
- ["zip", "pdf", "doc", "docx", "excel", "xls", "xlsx"].indexOf(
- FileExt.toLowerCase()
- ) === -1
- ) {
- if (this.$i18n.locale.toUpperCase() == "ZH") {
- this.$message({
- type: "warning",
- message: "请上传zip,pdf,word,excel的附件!",
- });
- } else {
- this.$message({
- type: "warning",
- message:
- "Please upload the attachment of zip, PDF, word and excel!",
- });
- }
- this.fileList.splice(this.fileList.indexOf(file), 1);
- return false;
- }
- this.isLt2k = file.size / 1024 / 1024 < 2 ? "1" : "0";
- if (this.isLt2k === "0") {
- if (this.$i18n.locale.toUpperCase() == "ZH") {
- this.$message({
- message: "上传文件大小不能超过2M!",
- type: "error",
- });
- } else {
- this.$message({
- message: "Upload file size cannot exceed 2m!",
- type: "error",
- });
- }
- this.fileList.splice(this.fileList.indexOf(file), 1);
- return false;
- }
- },
- save: function () {
- this.baseProjectView.reserveFour = this.$i18n.locale.toUpperCase();
- this.baseProjectView.id = this.$route.params.key;
- this.baseProjectView.updateDate = new Date();
- if (this.baseProjectView.continentCountry) {
- var continentCountry = "";
- console.log("this.baseProjectView.continentCountry",this.baseProjectView.continentCountry)
- this.baseProjectView.continentCountry.forEach((item) => {
- continentCountry = continentCountry + item + ",";
- });
- this.baseProjectView.continentCountry = continentCountry;
- }
- if (this.baseProjectView.unitCountry) {
- var unitCountry = "";
- this.baseProjectView.unitCountry.forEach((item) => {
- unitCountry = unitCountry + item + ",";
- });
- this.baseProjectView.unitCountry = unitCountry;
- }
- this.baseProjectView.continentCountry =
- this.baseProjectView.continentCountry.substring(
- this.baseProjectView.continentCountry.length - 1
- ) == ","
- ? this.baseProjectView.continentCountry.substring(
- 0,
- this.baseProjectView.continentCountry.length - 1
- )
- : this.baseProjectView.continentCountry;
- this.baseProjectView.unitCountry =
- this.baseProjectView.unitCountry.substring(
- this.baseProjectView.unitCountry.length - 1
- ) == ","
- ? this.baseProjectView.unitCountry.substring(
- 0,
- this.baseProjectView.unitCountry.length - 1
- )
- : this.baseProjectView.unitCountry;
- let token = getToken();
- this.submitHandler((token) => {
- saveOrUpdate(
- JSON.stringify(this.baseProjectView),
- JSON.stringify(Array.from(this.files)),
- JSON.stringify(Array.from(this.imgList)),
- token
- )
- .then((result) => {
- if (this.user.umsUser.userUsertypeDict !== "2") {
- addIntegral("point_task_upload_resources_project", "50");
- addGrowth("point_task_upload_resources_project");
- }
- if (this.$i18n.locale.toUpperCase() == "ZH") {
- alert("项目保存成功");
- } else {
- alert("Project saved successfully");
- }
- this.baseProjectView = {};
- this.$router.go(-1); //返回上一层
- })
- .catch((error) => {
- // 此处你的业务代码
- this.resetToken();
- });
- });
- },
- close() {
- this.$router.go(-1);
- },
- closeMain(val) {
- this.mergeSelectedLabels = [];
- val.forEach((element, index) => {
- this.mergeSelectedLabels.push(element.label);
- });
- this.systemLabel = val;
- this.baseProjectView.projectLabel = JSON.stringify(
- this.mergeSelectedLabels
- )
- .replace(/\[|]/g, "")
- .replace(/\"/g, "");
- this.dialogVisible = false;
- },
- goAithentication(num) {
- this.$router.go(-1); //返回上一层
- },
- handleChange(file, fileList) {
- this.fileList = fileList.slice(-3);
- },
- photoSuccess(res, file) {
- this.imgList = [];
- this.path = res.data.path;
- this.imgList.push(res.data.attachmentId);
- },
- dialogVisibles() {
- this.dialogVisible = true;
- },
- // beforeAvatarUpload(file) {
- // const isJPG = file.type === 'image/jpeg';
- // const isLt2M = file.size / 1024 / 1024 < 2;
- // if (!isJPG) {
- // this.$message.error('上传头像图片只能是 JPG 格式!');
- // }
- // if (!isLt2M) {
- // this.$message.error('上传头像图片大小不能超过 2MB!');
- // }
- // return isJPG && isLt2M;
- // },
- },
- };
- </script>
- <style scoped>
- .el-button {
- width: 200px;
- height: 45px;
- }
- .authenticationBox1 {
- margin-left: 35px;
- margin-right: 150px;
- height: 100px;
- border: 1px solid rgba(153, 153, 153, 1);
- border-radius: 10px;
- margin-top: 50px;
- position: relative;
- }
- .authenticationBox2 {
- margin: 50px 150px 0 35px;
- height: 100px;
- border: 1px solid rgba(153, 153, 153, 1);
- border-radius: 10px;
- position: relative;
- }
- .authenticationBox1:hover,
- .authenticationBox2:hover {
- border: 1px solid #ff8400;
- }
- .avatar-uploader .el-upload {
- border: 1px dashed #d9d9d9;
- border-radius: 6px;
- cursor: pointer;
- position: relative;
- overflow: hidden;
- }
- .avatar-uploader .el-upload:hover {
- border-color: #409eff;
- }
- .userCenterAuthenticationPersonal >>> .el-upload {
- border: 1px solid rgba(204, 204, 204, 1);
- }
- .avatar-uploader-icon {
- font-size: 28px;
- color: #8c939d;
- width: 178px;
- height: 178px;
- line-height: 178px;
- text-align: center;
- }
- .avatar {
- width: 178px;
- height: 178px;
- display: block;
- }
- /deep/.el-textarea__inner {
- display: block;
- resize: vertical;
- padding: 5px 15px;
- line-height: 3;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- width: 100%;
- font-size: inherit;
- color: #606266;
- background-color: #fff;
- background-image: none;
- border: 1px solid #dcdfe6;
- border-radius: 4px;
- -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
- transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
- }
- /*.el-textarea/deep/::-webkit-input-placeholder {*/
- /* color: red;*/
- /*}*/
- /*.el-textarea/deep/::-moz-input-placeholder {*/
- /* color: red;*/
- /*}*/
- /*.el-textarea/deep/::-ms-input-placeholder {*/
- /* color: red;*/
- /*}*/
- </style>
|