12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391 |
- <template>
- <div class="autoBox box">
- <div class="crumbs">
- <el-breadcrumb separator="/">
- <el-breadcrumb-item :to="{ path: 'home' }">{{
- $t("common.Home")
- }}
- </el-breadcrumb-item>
- <el-breadcrumb-item>{{ $t("common.Guestbook") }}</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- <!-- 留言字典 -->
- <div style="margin-top: 20px">
- <div
- style="
- margin-left: 20px;
- width: 1160px;
- background-color: rgb(247, 247, 247);
- "
- >
- <div
- style="
- width: 100%;
- line-height: 50px;
- border-bottom: 1px solid #f4f4f4;
- word-break: break-all;
- "
- v-if="classifiedMessage"
- >
- <span
- style="
- font-size: 14px;
- font-weight: 700;
- color: #000;
- margin-left: 20px;
- "
- >{{ $t(classifiedMessage.value) }}</span
- >
- <span
- style="
- margin-left: 15px;
- font-size: 14px;
- font-weight: 400;
- word-break: break-all;
- "
- :class="
- dictParam.classifiedMessage == item.id ? 'lable1' : 'lable2'
- "
- v-for="(item, e) in classifiedMessage.item"
- @click="changeDictParam('classifiedMessage', item.id)"
- class="cursor"
- >{{
- item.name == "common.All" ? $t("common.All") : item.name
- }}</span
- >
- </div>
- <div
- style="
- width: 100%;
- line-height: 50px;
- border-bottom: 1px solid #f4f4f4;
- word-break: break-all;
- "
- v-if="questionType"
- >
- <span
- style="
- font-size: 14px;
- font-weight: 700;
- color: #000;
- margin-left: 20px;
- "
- >{{ $t(questionType.value) }}</span
- >
- <span
- style="margin-left: 15px; font-size: 14px; font-weight: 400"
- :class="dictParam.questionType == item.id ? 'lable1' : 'lable2'"
- v-for="(item, e) in questionType.item"
- @click="changeDictParam('questionType', item.id)"
- class="cursor"
- >{{
- item.name == "common.All" ? $t("common.All") : item.name
- }}</span
- >
- </div>
- </div>
- </div>
- <!-- 查询 -->
- <!-- <div style="margin: 30px 0;">
- <el-input :placeholder="$t('common.Keywords')" class="input-with-select" style="width: 500px;margin-left: 25px;border: 1px solid rgb(48, 84, 140);"></el-input>
- <el-button class="cursor" slot="append" type="primary" style="background-color: #30548c;color: #ffffff;border-radius:0;border: 1px solid rgb(48, 84, 140);height: 42px;"
- >{{$t('common.Search')}}</el-button>
- </div> -->
- <!-- 热门留言按钮 -->
- <div style="margin: 20px 0 0 20px">
- <ul>
- <li
- id="1"
- @click="changeActive($event)"
- :class="active == 1 ? 'active' : ''"
- >
- {{ $t("common.All") }}
- </li>
- <li
- id="2"
- @click="changeActive($event)"
- :class="active == 2 ? 'active' : ''"
- >
- {{ $t("common.Hotcomments") }}
- </li>
- <li
- id="3"
- @click="changeActive($event)"
- :class="active == 3 ? 'active' : ''"
- >
- {{ $t("common.Mymessage") }}
- </li>
- <li
- id="4"
- @click="changeActive($event)"
- :class="active == 4 ? 'active' : ''"
- >
- {{ $t("common.myCollections") }}
- </li>
- <!-- 我要留言按钮 -->
- <span
- style="float: right; margin-right: 50px"
- class="active addClass"
- @click="getList"
- >+ {{ $t("common.giveComments") }}</span
- >
- </ul>
- </div>
- <!-- 留言内容 -->
- <div style="margin: 20px auto; width: 92%; border-top: 1px solid #aaaaaa">
- <div class="messageBox" v-for="(item, index) in initData">
- <!-- <div class="messageBox" style="cursor: pointer;" @click="toView('developmentDetails',item)"> @click="toView('developmentDetails',item)"-->
- <!-- 问 -->
- <div style="height: 70px; padding: 0 30px">
- <div
- style="
- float: left;
- width: 40px;
- height: 40px;
- border-radius: 50%;
- background: #e3bb03;
- margin-top: 15px;
- text-align: center;
- "
- >
- <img
- v-if="$i18n.locale == 'zh'"
- src="@/assets/img/helpCenter/ask.png"
- alt=""
- style="width: 100%; border-radius: 50%"
- />
- <img
- v-if="$i18n.locale == 'en'"
- src="@/assets/img/helpCenter/q.png"
- alt=""
- style="width: 100%; border-radius: 50%"
- />
- <!-- <span style="color:#fff;font-size: 20px;font-weight: 700;line-height: 36px;">{{$t('common.Q')}}</span> -->
- </div>
- <span
- style="
- float: left;
- width: 90%;
- font-size: 24px;
- margin-left: 20px;
- line-height: 70px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- "
- >
- {{ item.title }}
- <span v-if="active == 3 && item.status == 1 && $i18n.locale == 'zh'"
- >(已回复)</span
- >
- <span v-if="active == 3 && item.status == 1 && $i18n.locale == 'en'"
- >(Replied)</span
- >
- <span v-if="active == 3 && item.status != 1 && $i18n.locale == 'zh'"
- >(未回复)</span
- >
- <span v-if="active == 3 && item.status != 1 && $i18n.locale == 'en'"
- >(No Reply)</span
- >
- </span>
- </div>
- <div>
- <div style="width: 92%; float: right">
- <div style="display: block">
- <span
- style="
- float: left;
- color: #00d6e8;
- width: 70%;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- font-size: 14px;
- "
- >
- <img
- v-if="item.imagesPath"
- :src="imageAddPath(item.imagesPath)"
- alt=""
- style="width: 20px; height: 20px; border-radius: 50%"
- />
- {{ item.userName }}
- </span>
- <span style="float: right; color: #c1c1c1; font-size: 14px"
- >{{ $t("common.MessageTime") }}:<span>
- {{ item.createDate }}
- </span></span
- >
- </div>
- <div style="margin: 50px 0">
- <p v-html="item.content" style="font-size: 16px"></p>
- </div>
- <div style="margin: 50px 0">
- <div
- style="
- background-color: #fcecd5;
- color: #ecac90;
- font-size: 12px;
- line-height: 18px;
- text-align: center;
- height: 20px;
- border-radius: 15px;
- float: left;
- margin-right: 20px;
- padding: 0 10px;
- "
- >
- {{ item.columnNameParent }}
- </div>
- <div
- style="
- background-color: #fcecd5;
- color: #ecac90;
- font-size: 12px;
- line-height: 18px;
- text-align: center;
- height: 20px;
- border-radius: 15px;
- float: left;
- margin-right: 20px;
- padding: 0 10px;
- "
- >
- {{ item.columnName }}
- </div>
- <!-- <span style="float:right;margin-left:34px;color:#c1c1c1"><span style="color:#000">{{item.replyStatus}} </span>{{$t('common.Reply')}}</span> -->
- <!-- <span style="float:right;margin-left:34px;color:#c1c1c1"><span style="color:#000">{{item.collectNum}} </span>{{$t('common.Collect')}}</span> -->
- <span
- style="
- float: right;
- margin-left: 34px;
- color: #c1c1c1;
- font-size: 14px;
- "
- >
- <span style="color: #000">{{ item.likeNum }} </span>
- {{ $t("common.Praise") }}
- </span>
- <span
- class="share cursor"
- :style="item.ifcommon ? 'color: #66b1ff;' : 'color:#c1c1c1'"
- style="margin-right: 20px; float: right; font-size: 14px"
- ref="likeclick"
- @click="shareChange(item.id, item)"
- >
- <i
- class="el-icon-star-off"
- :style="item.ifcommon ? 'color: #66b1ff;' : '#c1c1c1'"
- ></i>
- {{ item.ifcommon ? $t("common.Liked") : $t("common.Tolike") }}
- </span>
- <span
- class="share cursor"
- :style="
- item.ifcommonCollect ? 'color: #66b1ff;' : 'color:#c1c1c1'
- "
- style="margin-right: 20px; float: right; font-size: 14px"
- ref="likeclick"
- @click="collect(item, item.ifcommonCollect)"
- >
- <i
- class="el-icon-star-off"
- :style="item.ifcommonCollect ? 'color: #66b1ff;' : '#c1c1c1'"
- ></i>
- {{
- $i18n.locale == "zh"
- ? item.ifcommonCollect
- ? "已收藏"
- : "收藏"
- : item.ifcommonCollect
- ? "Already collected"
- : " Collection"
- }}
- </span>
- </div>
- <!-- <el-button type="primary" @click="deleteMess(index)" style="position: relative;right: 0;">删除</el-button> -->
- </div>
- <div style="clear: both"></div>
- </div>
- <!-- 平台回复 -->
- <div class="Platform" v-if="item.replyStatus == 1">
- <div
- style="
- height: 70px;
- background: #f1f4f9;
- border-bottom: 1px solid #e1e2e6;
- padding: 0 30px;
- "
- >
- <!-- 答 -->
- <div
- style="
- float: left;
- width: 40px;
- height: 40px;
- border-radius: 50%;
- background: #279eb2;
- margin-top: 15px;
- text-align: center;
- "
- >
- <img
- v-if="$i18n.locale == 'zh'"
- src="@/assets/img/helpCenter/answer.png"
- alt=""
- style="width: 100%; border-radius: 50%"
- />
- <img
- v-if="$i18n.locale == 'en'"
- src="@/assets/img/helpCenter/A.png"
- alt=""
- style="width: 100%; border-radius: 50%"
- />
- <!-- <span style="color:#fff;font-size: 20px;font-weight: 700;line-height: 36px;">{{$t('common.A')}}</span> -->
- </div>
- <span
- style="
- float: left;
- font-size: 20px;
- color: #3c5375;
- font-weight: 700;
- margin-left: 20px;
- line-height: 70px;
- "
- >GEIDCP {{ $t("common.PlatformReply") }}</span
- >
- </div>
- <div
- style="
- border-bottom: 1px dotted #aaaaaa;
- width: 92%;
- margin: auto;
- float: right;
- "
- v-for="(
- i, index
- ) in item.baseDevelopmentCooperationReplyMessageList"
- >
- <div style="margin: 30px 0">
- <div>
- <span
- style="
- float: right;
- color: #c1c1c1;
- width: 18%;
- margin-top: 10px;
- "
- >{{ $t("common.ReplyTime") }}:<span>{{
- formatDate(i.updateDate)
- }}</span></span
- >
- <p
- style="float: left; width: 70%; font-size: 16px"
- v-html="i.content"
- ></p>
- <div style="clear: both"></div>
- </div>
- <!-- <div>-->
- <!-- <span style="float:right;margin-left:34px;color:#c1c1c1"><span style="color:#000">{{i.collectNum}} </span>{{$t('common.Collect')}}</span> -->
- <!-- <span style="float:right;margin-left:34px;color:#c1c1c1;font-size: 14px;"><span style="color:#000">{{i.likeNum}} </span>{{$t('common.Praise')}}</span>-->
- <!-- </div>-->
- </div>
- </div>
- <div style="clear: both"></div>
- </div>
- </div>
- </div>
- <!-- 分页 -->
- <div
- style="position: relative; width: 100%; height: 200px"
- v-if="initData.length > 0"
- >
- <el-pagination
- style="
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- "
- background
- layout="prev, pager, next"
- :total="totalNum"
- :page-size="6"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- >
- </el-pagination>
- </div>
- <!-- 我要留言 -->
- <el-dialog
- :title="$t('common.ToleaveMessage')"
- :visible.sync="dialogVisible"
- width="40%"
- >
- <el-form :inline="true" :model="formInline" class="demo-form-inline">
- <el-form-item :label="$t('common.Messageclassification') + ':'">
- <el-select
- v-model="formInline.MessageClassification"
- :placeholder="$t('common.PleaseSelect')"
- v-on:change="getShowId($event)"
- >
- <el-option
- v-for="(list, index) in classList"
- :label="list.name"
- :value="list.id"
- style="display: block; width: 100%"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('common.Messagetypes') + ':'">
- <el-select
- v-model="formInline.MessageType"
- :placeholder="$t('common.PleaseSelect')"
- v-on:change="mess2getShowId($event)"
- >
- <el-option
- v-for="(type, index) in typeList"
- :label="type.name"
- :value="type.id"
- style="display: block; width: 100%"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <el-form>
- <el-form-item
- :label="$t('common.ToleaveMessage') + ':'"
- :required="true"
- >
- <el-input
- type="text"
- :placeholder="$t('common.InputContent')"
- maxlength="200"
- show-word-limit
- v-model="formInline.title"
- style="width: 90%"
- >
- </el-input>
- </el-form-item>
- </el-form>
- <el-input
- type="textarea"
- :rows="2"
- :placeholder="$t('common.InputContent')"
- maxlength="200"
- show-word-limit
- v-model="formInline.textarea"
- >
- </el-input>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisibleClose()">{{
- $t("common.Cancel")
- }}</el-button>
- <el-button type="primary" @click="publish()"
- >{{ $t("common.OK") }}
- </el-button>
- </span>
- </el-dialog>
- <!-- 登录提示 -->
- <el-dialog
- :title="$i18n.locale == 'zh' ? '提示' : 'Reminder'"
- :visible.sync="toViewLogin"
- :width="$i18n.locale == 'zh' ? '500px' : '750px'"
- :height="$i18n.locale == 'zh' ? '300px' : '386px'"
- :before-close="toViewLoginChange"
- >
- <div style="width: 100%; height: 100%">
- <img
- src="@/assets/img/loginTips.png"
- alt=""
- style="width: 180px; height: 180px; margin-left: 20px"
- />
- <div
- style="float: right; margin-right: 20px"
- :style="
- $i18n.locale == 'zh'
- ? 'width: 49%;margin-top: 10px;'
- : 'width: 453px;margin-top: -25px;'
- "
- >
- <div
- style="
- font-size: 20px;
- font-weight: normal;
- color: #333333;
- font-family: HiraginoSansGB-W3, HiraginoSansGB;
- line-height: 40px;
- "
- >
- {{ $t("common.ReminderFirst") }}
- </div>
- <div
- style="
- font-size: 16px;
- font-family: HiraginoSansGB-W3, HiraginoSansGB;
- font-weight: normal;
- color: #666666;
- line-height: 30px;
- "
- >
- {{ $t("common.ReminderSecond") }}
- <span style="color: #0091ff; font-size: 18px">{{ num }}</span>
- {{ $t("common.ReminderThird") }}
- </div>
- <div
- style="
- font-size: 14px;
- font-family: HiraginoSansGB-W3, HiraginoSansGB;
- font-weight: normal;
- color: #666666;
- line-height: 30px;
- "
- >
- {{ $t("common.ReminderForth") }}
- </div>
- <div
- style="
- font-size: 14px;
- font-family: HiraginoSansGB-W3, HiraginoSansGB;
- height: 33px;
- line-height: 60px;
- font-weight: normal;
- color: #0091ff;
- "
- >
- <span
- style="margin-left: 40px"
- class="cursor"
- @click="toView('login')"
- >
- {{ $t("common.ReminderFifth") }}
- </span>
- <span
- style="margin-left: 10px"
- class="cursor"
- @click="toView('Register')"
- >
- {{ $t("common.ReminderSixth") }}
- </span>
- </div>
- </div>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import Base from "@/views/base/Base";
- import Screen from "@/components/screen";
- import developmentDetails from "./development/developmentDetails";
- import {
- getMessage,
- getsCustomized,
- getsCustomizedMy,
- getColumnTree,
- saveOrUpdate,
- clickLike,
- getMessagesByCollect,
- } from "@/api/baseDevelopment";
- import {
- getFollowModeNumlByModelId,
- getFollowModelNumByUser,
- saveFollowModel,
- } from "@/api/operation/basePortalModelFollowInfo";
- import {getFollowModeNumlByModelIdAndUserId} from "@/api/operation/basePortalModelFollowInfo";
- import {getToken} from "@/utils/auth";
- import {formatDate} from "@/utils/formatUtils";
- import {addIntegral, addGrowth} from "@/utils/toCompleteTask";
- import {getUserPointPage} from "@/api/user";
- import _ from "lodash";
- export default {
- name: "developmentCooperation",
- extends: Base,
- components: {Screen},
- data() {
- return {
- dictParam: {
- classifiedMessage: "all",
- questionType: "all",
- },
- //留言内容的查询条件
- params: {
- pageNo: 1,
- pageSize: 6,
- language: "",
- queryType: 1,
- replyStatus: 1,
- // status:'',
- createBy: null,
- },
- //留言分类
- classifiedMessage: {
- value: "common.Messageclassification",
- item: [],
- },
- //问题类型
- questionType: {
- value: "common.Problemtypes",
- item: [],
- },
- //字典的查询条件
- paramsDict: {
- language: "",
- },
- //留言点赞
- likeId: {
- id: "",
- },
- ifcommon: false,
- replyMess: [],
- active: 1,
- num: 0,
- totalNum: 0,
- total: 0,
- centerDialogVisible: false,
- dialogVisible: false,
- formInline: {
- MessageClassification: "",
- MessageType: "",
- title: "",
- textarea: "",
- },
- toViewLogin: false,
- pageNo: 1,
- screen1: {
- item: [],
- },
- screen2: {
- item: [],
- },
- initData: [],
- classList: [],
- typeList: [],
- indexId: 0,
- status: "",
- indexId2: 0,
- indexNum: 0,
- baseDevelopmentCooperationMessage: {
- id: this.indexId,
- columnId: "",
- title: "",
- content: "",
- likeNum: "",
- clickNum: "",
- collectNum: "",
- replyStatus: "",
- membershipPermissionType: "",
- status: "",
- createBy: "",
- createDate: "",
- updateBy: "",
- updateDate: "",
- userName: "",
- columnName: "",
- columnNameParent: "",
- },
- user: {
- umsUser: {},
- },
- collectId: "",
- giveLikeId: "",
- pointStatus: null,
- isToken: null,
- };
- },
- watch: {
- "$i18n.locale"() {
- this.getMessages();
- this.getDict();
- this.changeActive(this.active);
- },
- //toViewLogin变量检查是否进行跳转
- toViewLogin() {
- if (this.toViewLogin == true) {
- this.loginTipsChange();
- this.changeActive();
- this.liked();
- }
- },
- },
- mounted() {
- this.user = JSON.parse(window.localStorage.getItem("user"));
- window.localStorage.setItem("router", "developmentCooperation");
- //获取留言字典
- this.getDict();
- //获取留言消息
- this.getMessages();
- this.judgeState()
- },
- methods: {
- judgeState() {
- this.isToken = getToken()
- if (this.isToken) {
- getUserPointPage().then((res) => {
- this.pointStatus = res.data.umsUserPoints[0].pointStatus
- })
- }
- },
- //获取留言信息
- getMessages: function () {
- this.params.language = this.$i18n.locale.toUpperCase();
- getsCustomized(this.params).then((res) => {
- this.initData = [];
- this.totalNum = res.data.page.totalCount - 0;
- this.getMyCollecModel(res.data.baseDevelopmentCooperationMessages);
- this.initData = [];
- this.initData = res.data.baseDevelopmentCooperationMessages;
- this.initData.forEach((i) => {
- i.createDate = i.createDate
- ? formatDate(i.createDate, "YYYY-MM-DD")
- : "";
- });
- });
- },
- getMyCollecModel(baseDevelopmentCooperationMessages) {
- baseDevelopmentCooperationMessages.forEach((i) => {
- if (this.$Cookies.get("token")) {
- let user = window.localStorage.getItem("user");
- var users = JSON.parse(user);
- let MyCollecModel = {
- modelType: "developmentCooperation",
- userId: users.userId,
- modelEntityId: i.id,
- };
- getFollowModeNumlByModelIdAndUserId(
- i.id,
- "developmentCooperation",
- this.userId
- ).then((res) => {
- // i.ifcommon = res.data;
- this.$set(i, "ifcommonCollect", res.data);
- });
- }
- });
- },
- dialogVisibleClose() {
- this.formInline.MessageClassification = "";
- this.formInline.MessageType = "";
- this.dialogVisible = false;
- },
- //图片地址补全
- imageAddPath(path) {
- const origin = document.location.origin;
- // console.log(origin + "/common/opt/file/pub/" + path)
- return origin + "/api/file/pub/" + path;
- },
- //选项切换
- changeDictParam(type, id) {
- if (type == "classifiedMessage") {
- this.dictParam.classifiedMessage = id;
- for (let index in this.classifiedMessage.item) {
- if (id == "all") {
- this.questionType = this.classifiedMessage.item[0].children;
- this.params.columnId = null;
- } else if (
- this.classifiedMessage.item[index].id ==
- this.dictParam.classifiedMessage
- ) {
- this.questionType = this.classifiedMessage.item[index].children;
- this.params.columnId = id;
- }
- }
- } else if ((type = "questionType")) {
- this.dictParam.questionType = id;
- if (id == "all") {
- this.params.columnId = null;
- } else {
- this.params.columnId = id;
- }
- }
- this.getMessages();
- },
- //登录跳转
- loginTipsChange() {
- const that = this;
- this.num = 5;
- this.timer = setInterval(function () {
- if (that.num > 0) {
- that.num--;
- } else {
- if (that.toViewLogin == true) {
- clearInterval(that.timer);
- that.toView("login");
- } else {
- clearInterval(that.timer);
- }
- }
- }, 1000);
- },
- // 判断未登录跳转是否关闭
- toViewLoginChange(done) {
- this.toViewLogin = false;
- this.num = 5;
- clearInterval(this.timer);
- },
- // 分页
- handleCurrentChange(val) {
- this.pageNo = val;
- this.params.pageNo = this.pageNo;
- if (this.active == 1) {
- this.params.createBy = null;
- this.params.queryType = 1;
- this.params.replyStatus = 1;
- this.getMessages();
- } else if (this.active == 2) {
- this.params.createBy = null;
- this.params.queryType = 2;
- this.params.replyStatus = 1;
- this.getMessages();
- } else if (this.active == 3) {
- this.params.replyStatus = null;
- this.params.queryType = 3;
- // let user = window.localStorage.getItem("user");
- if (!this.$Cookies.get("token")) {
- this.toViewLogin = true;
- } else {
- // var users = JSON.parse(user);
- // this.params.createBy = users.userId;
- let token = getToken();
- this.getMessagesMy(token);
- }
- } else if (this.active == 4) {
- this.params.queryType = 4;
- if (!this.$Cookies.get("token")) {
- this.toViewLogin = true;
- } else {
- // var users = JSON.parse(user);
- // this.params.createBy = users.userId;
- let token = getToken();
- this.getMessagesByCollect(token);
- }
- }
- },
- handleSizeChange(val) {
- console.log(`每页 ${val} 条`);
- },
- //分页索引接着上一页的索引
- indexMethod(index) {
- return (this.page - 1) * 10 + index + 1;
- },
- //选项卡列表
- getList() {
- let user = window.localStorage.getItem("user");
- if (!this.$Cookies.get("token")) {
- this.toViewLogin = true;
- } else {
- this.dialogVisible = true;
- var params = {
- language: this.$i18n.locale.toUpperCase(),
- };
- getColumnTree(params).then((res) => {
- this.classList = res.data;
- this.indexId = this.classList[0].id;
- });
- }
- },
- //留言分类选项卡
- getShowId(val) {
- this.indexId = val;
- let i = 0;
- for (i = 0; i < this.classList.length; i++) {
- if (this.classList[i].id == this.indexId) {
- this.indexNum = i;
- break;
- }
- }
- this.typeList = this.classList[this.indexNum].children;
- this.formInline.MessageType = "";
- },
- mess2getShowId(val) {
- this.indexId2 = val;
- },
- //获取留言字典
- getDict() {
- this.paramsDict.language = this.$i18n.locale.toUpperCase();
- var that = this;
- that.classifiedMessage = {};
- getColumnTree(this.paramsDict).then((res) => {
- //留言分类处理
- if (this.$i18n.locale == "zh") {
- that.classifiedMessage = {
- value: "留言类型",
- item: [],
- };
- } else if (this.$i18n.locale == "en") {
- that.classifiedMessage = {
- value: "Message Classification",
- item: [],
- };
- }
- that.classifiedMessage.item = res.data;
- for (let index in that.classifiedMessage.item) {
- if (index == "remove") {
- break;
- }
- if (this.$i18n.locale == "zh") {
- var chidren = {
- value: "问题类型",
- item: [],
- };
- } else if (this.$i18n.locale == "en") {
- var chidren = {
- value: "Problem Types",
- item: [],
- };
- }
- chidren.item = that.classifiedMessage.item[index].children;
- chidren.item.unshift({
- name: "common.All",
- selected: 1,
- id: "all",
- });
- that.classifiedMessage.item[index].children = chidren;
- }
- that.questionType = that.classifiedMessage.item[0].children;
- that.classifiedMessage.item.unshift({
- name: "common.All",
- selected: 1,
- id: "all",
- });
- that.classifiedMessage.item[0].children =
- that.classifiedMessage.item[1].children;
- });
- },
- changeActive(i) {
- this.active = i.currentTarget.id;
- if (this.active == 1) {
- this.params.pageNo = 1;
- this.params.createBy = null;
- this.params.queryType = 1;
- this.params.replyStatus = 1;
- this.getMessages();
- } else if (this.active == 2) {
- this.params.pageNo = 1;
- this.params.createBy = null;
- this.params.queryType = 2;
- this.params.replyStatus = 1;
- this.getMessages();
- } else if (this.active == 3) {
- this.params.pageNo = 1;
- this.params.replyStatus = null;
- this.params.queryType = 3;
- // let user = window.localStorage.getItem("user");
- if (!this.$Cookies.get("token")) {
- this.toViewLogin = true;
- } else {
- // var users = JSON.parse(user);
- // this.params.createBy = users.userId;
- let token = getToken();
- this.getMessagesMy(token);
- }
- } else if (this.active == 4) {
- this.params.pageNo = 1;
- this.params.queryType = 4;
- if (!this.$Cookies.get("token")) {
- this.toViewLogin = true;
- } else {
- // var users = JSON.parse(user);
- // this.params.createBy = users.userId;
- let token = getToken();
- this.getMessagesByCollect(token);
- }
- }
- },
- getMessagesByCollect: function (token) {
- this.params.language = this.$i18n.locale.toUpperCase();
- getMessagesByCollect(this.params, token).then((res) => {
- if (res.data.baseDevelopmentCooperationMessages) {
- let newData = [];
- this.totalNum = res.data.page.totalCount - 0;
- this.getMyCollecModel(res.data.baseDevelopmentCooperationMessages);
- this.initData = [];
- this.initData = res.data.baseDevelopmentCooperationMessages;
- this.initData.forEach((i) => {
- i.createDate = i.createDate
- ? formatDate(i.createDate, "YYYY-MM-DD")
- : "";
- });
- } else {
- this.initData = [];
- }
- });
- },
- getMessagesMy: function (token) {
- this.params.language = this.$i18n.locale.toUpperCase();
- getsCustomizedMy(this.params, token).then((res) => {
- let newData = [];
- this.totalNum = res.data.page.totalCount - 0;
- this.getMyCollecModel(res.data.baseDevelopmentCooperationMessages);
- this.initData = [];
- this.initData = res.data.baseDevelopmentCooperationMessages;
- this.initData.forEach((i) => {
- i.createDate = i.createDate
- ? formatDate(i.createDate, "YYYY-MM-DD")
- : "";
- i.ifcommon = false;
- });
- });
- },
- // 收藏状态改变
- // collect(item, ifcommonCollect) {
- // this.collectId = item.id;
- // if (ifcommonCollect) {
- // this.saveFollowModelDo("unfollow", item);
- // } else {
- // this.saveFollowModelDo("follow", item);
- // }
- // },
- collect: _.throttle(function (item, ifcommonCollect) {
- this.collectId = item.createBy;
- if (this.collectId == this.user.userId) {
- this.$message({
- message: this.$i18n.locale == "zh" ? "不可收藏" : "Not Collect",
- type: "warning",
- });
- } else {
- if (ifcommonCollect) {
- this.saveFollowModelDo("unfollow", item);
- } else {
- this.saveFollowModelDo("follow", item);
- }
- }
- }, 3000),
- // 点赞状态改变
- // shareChange(id, item) {
- // if (!item.ifcommon) {
- // item.ifcommon = !item.ifcommon;
- // }
- // this.$forceUpdate();
- // this.likeId.id = id;
- // if (item.ifcommon) {
- // this.liked("unlike", item);
- // } else {
- // this.liked("liked", item);
- // }
- // },
- shareChange: _.throttle(function (id, item) {
- this.giveLikeId = item.createBy;
- if (this.giveLikeId == this.user.userId) {
- this.$message({
- message: this.$i18n.locale == "zh" ? "不可点赞" : "Not Liked",
- type: "warning",
- });
- } else {
- if (!item.ifcommon) {
- item.ifcommon = !item.ifcommon;
- }
- this.$forceUpdate();
- this.likeId.id = id;
- if (item.ifcommon) {
- this.liked("unlike", item);
- } else {
- this.liked("liked", item);
- }
- }
- }, 3000),
- //收藏操作方法
- saveFollowModelDo: function (followType, item) {
- let user = window.localStorage.getItem("user");
- if (!this.$Cookies.get("token")) {
- // this.$message.warning("请先登录");
- // this.$confirm('检测到您未登录,是否登录')
- // .then(_ => {
- // this.toView('login');
- // })
- // .catch(_ => {});
- this.toViewLogin = true;
- } else {
- var users = JSON.parse(user);
- var token = "" + getToken();
- var projectId = item.id;
- var userId = users.userId;
- // 接口逻辑
- this.submitHandler((token) => {
- saveFollowModel(
- projectId,
- "developmentCooperation",
- userId,
- followType,
- token
- )
- .then((result) => {
- // console.log(result);
- if (followType == "unfollow") {
- if (this.$i18n.locale == "zh") {
- this.$message({
- message: "取消收藏",
- type: "success",
- });
- } else {
- this.$message({
- message: "cancel coilection",
- type: "success",
- });
- }
- } else {
- if (this.user.umsUser.userUsertypeDict !== "2" && this.pointStatus == 'y') {
- addGrowth("message_is_saved");
- }
- if (this.$i18n.locale == "zh") {
- this.$message({
- message: "已收藏",
- type: "success",
- });
- } else {
- this.$message({
- message: "Already collected",
- type: "success",
- });
- }
- }
- this.ifcommon = !this.ifcommon;
- let token = getToken();
- if (this.active == 1) {
- this.params.pageNo = 1;
- this.params.createBy = null;
- this.params.queryType = 1;
- this.params.replyStatus = 1;
- this.getMessages();
- } else if (this.active == 2) {
- this.params.pageNo = 1;
- this.params.createBy = null;
- this.params.queryType = 2;
- this.params.replyStatus = 1;
- this.getMessages();
- } else if (this.active == 3) {
- this.params.pageNo = 1;
- this.params.replyStatus = null;
- this.params.queryType = 3;
- // let user = window.localStorage.getItem("user");
- if (!this.$Cookies.get("token")) {
- this.toViewLogin = true;
- } else {
- // var users = JSON.parse(user);
- // this.params.createBy = users.userId;
- let token = getToken();
- this.getMessagesMy(token);
- }
- } else if (this.active == 4) {
- this.params.pageNo = 1;
- this.params.queryType = 4;
- if (!this.$Cookies.get("token")) {
- this.toViewLogin = true;
- } else {
- // var users = JSON.parse(user);
- // this.params.createBy = users.userId;
- let token = getToken();
- this.getMessagesByCollect(token);
- }
- }
- this.resetToken();
- })
- .catch((error) => {
- // 此处你的业务代码
- });
- });
- }
- },
- //点赞
- liked(type, item) {
- let list = {
- id:this.likeId.id,
- userId:this.user.userId,
- }
- clickLike(list).then((res) => {
- if (res.status == 200) {
- if (this.user.umsUser.userUsertypeDict !== "2" && this.pointStatus == 'y') {
- addGrowth("the_message_was_liked");
- }
- this.$message({
- message: this.$i18n.locale == "zh" ? "已点赞" : "Liked of success",
- type: "success",
- });
- item.likeNum++;
- // item.ifcommon = !item.ifcommon;
- this.$forceUpdate();
- }
- this.resetToken();
- });
- },
- //留言方法
- publish: function () {
- if (!this.$Cookies.get("token")) {
- this.toViewLogin = true;
- } else {
- console.log(this.indexId2);
- //留言内容
- this.baseDevelopmentCooperationMessage.content =
- this.formInline.textarea;
- this.baseDevelopmentCooperationMessage.columnId = this.indexId2;
- this.baseDevelopmentCooperationMessage.title = this.formInline.title;
- if (this.baseDevelopmentCooperationMessage.title == "") {
- alert(
- this.$i18n.locale == "zh" ? "标题不能为空" : "Title cannot be empty"
- );
- return;
- }
- // let user = window.localStorage.getItem("user");
- // var users = JSON.parse(user);
- // this.baseDevelopmentCooperationMessage.createBy = users.userId;
- console.log(this.baseDevelopmentCooperationMessage);
- var token = "" + getToken();
- //发送留言
- if (this.baseDevelopmentCooperationMessage.content) {
- if (this.formInline.MessageClassification) {
- if (this.formInline.MessageType) {
- this.submitHandler((token) => {
- saveOrUpdate(
- JSON.stringify(this.baseDevelopmentCooperationMessage),
- token
- )
- .then((res) => {
- if (this.user.umsUser.userUsertypeDict !== "2" && this.pointStatus == 'y') {
- addIntegral(
- "point_task_development_cooperation_message",
- "3"
- );
- }
- // alert(res.msg);
- this.$message({
- message:
- this.$i18n.locale == "zh"
- ? "发送成功"
- : "Sent successfully",
- type: "success",
- });
- })
- .catch((error) => {
- this.$message({
- message:
- this.$i18n.locale == "zh" ? "保存失败" : "Save failed",
- type: "error",
- });
- });
- this.formInline = {};
- this.dialogVisible = false;
- this.resetToken();
- });
- } else {
- this.$message("请选择留言类型");
- }
- } else {
- this.$message("请选择留言分类");
- }
- } else {
- this.$message(this.$t("common.Pleasefillinthecontentfirst"));
- }
- }
- },
- toView(router, json) {
- console.log(json);
- clearInterval(this.timer);
- this.$router.push({
- name: router,
- id: "",
- query: {
- key: json,
- },
- });
- },
- },
- };
- </script>
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style scoped>
- body {
- margin: 0;
- }
- .box {
- margin-top: 10px;
- background: #fff;
- /* height: 500px; */
- padding: 20px 0;
- }
- .crumbs {
- margin-left: 20px;
- }
- .box >>> .el-textarea__inner {
- min-height: 220px !important;
- max-height: 220px !important;
- }
- ul li {
- background: #e9eef2;
- width: 136px;
- text-align: center;
- }
- ul li,
- .addClass {
- display: inline-block;
- height: 42px;
- padding: 0 30px;
- font-size: 14px;
- line-height: 42px;
- /* background-color: #30548c; */
- cursor: pointer;
- }
- .addClass:active {
- border: 1px solid #0079ef;
- }
- .active {
- background-color: #30548c;
- color: #fff;
- }
- .messageBox {
- padding: 0px 0 0 0;
- border-bottom: 1px dashed #aaaaaa;
- }
- .lable1,
- .lable2 {
- padding: 5px;
- color: #666;
- white-space: nowrap;
- }
- .lable1 {
- border-radius: 30px;
- background: #feead5;
- color: #fe8150;
- }
- .Platform {
- width: 100%;
- margin: 20px 0;
- /* border-top: 3px solid #a9bcd4; */
- border-bottom: 3px solid #34547b;
- }
- </style>
|