developmentCooperation.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391
  1. <template>
  2. <div class="autoBox box">
  3. <div class="crumbs">
  4. <el-breadcrumb separator="/">
  5. <el-breadcrumb-item :to="{ path: 'home' }">{{
  6. $t("common.Home")
  7. }}
  8. </el-breadcrumb-item>
  9. <el-breadcrumb-item>{{ $t("common.Guestbook") }}</el-breadcrumb-item>
  10. </el-breadcrumb>
  11. </div>
  12. <!-- 留言字典 -->
  13. <div style="margin-top: 20px">
  14. <div
  15. style="
  16. margin-left: 20px;
  17. width: 1160px;
  18. background-color: rgb(247, 247, 247);
  19. "
  20. >
  21. <div
  22. style="
  23. width: 100%;
  24. line-height: 50px;
  25. border-bottom: 1px solid #f4f4f4;
  26. word-break: break-all;
  27. "
  28. v-if="classifiedMessage"
  29. >
  30. <span
  31. style="
  32. font-size: 14px;
  33. font-weight: 700;
  34. color: #000;
  35. margin-left: 20px;
  36. "
  37. >{{ $t(classifiedMessage.value) }}</span
  38. >
  39. <span
  40. style="
  41. margin-left: 15px;
  42. font-size: 14px;
  43. font-weight: 400;
  44. word-break: break-all;
  45. "
  46. :class="
  47. dictParam.classifiedMessage == item.id ? 'lable1' : 'lable2'
  48. "
  49. v-for="(item, e) in classifiedMessage.item"
  50. @click="changeDictParam('classifiedMessage', item.id)"
  51. class="cursor"
  52. >{{
  53. item.name == "common.All" ? $t("common.All") : item.name
  54. }}</span
  55. >
  56. </div>
  57. <div
  58. style="
  59. width: 100%;
  60. line-height: 50px;
  61. border-bottom: 1px solid #f4f4f4;
  62. word-break: break-all;
  63. "
  64. v-if="questionType"
  65. >
  66. <span
  67. style="
  68. font-size: 14px;
  69. font-weight: 700;
  70. color: #000;
  71. margin-left: 20px;
  72. "
  73. >{{ $t(questionType.value) }}</span
  74. >
  75. <span
  76. style="margin-left: 15px; font-size: 14px; font-weight: 400"
  77. :class="dictParam.questionType == item.id ? 'lable1' : 'lable2'"
  78. v-for="(item, e) in questionType.item"
  79. @click="changeDictParam('questionType', item.id)"
  80. class="cursor"
  81. >{{
  82. item.name == "common.All" ? $t("common.All") : item.name
  83. }}</span
  84. >
  85. </div>
  86. </div>
  87. </div>
  88. <!-- 查询 -->
  89. <!-- <div style="margin: 30px 0;">
  90. <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>
  91. <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;"
  92. >{{$t('common.Search')}}</el-button>
  93. </div> -->
  94. <!-- 热门留言按钮 -->
  95. <div style="margin: 20px 0 0 20px">
  96. <ul>
  97. <li
  98. id="1"
  99. @click="changeActive($event)"
  100. :class="active == 1 ? 'active' : ''"
  101. >
  102. {{ $t("common.All") }}
  103. </li>
  104. <li
  105. id="2"
  106. @click="changeActive($event)"
  107. :class="active == 2 ? 'active' : ''"
  108. >
  109. {{ $t("common.Hotcomments") }}
  110. </li>
  111. <li
  112. id="3"
  113. @click="changeActive($event)"
  114. :class="active == 3 ? 'active' : ''"
  115. >
  116. {{ $t("common.Mymessage") }}
  117. </li>
  118. <li
  119. id="4"
  120. @click="changeActive($event)"
  121. :class="active == 4 ? 'active' : ''"
  122. >
  123. {{ $t("common.myCollections") }}
  124. </li>
  125. <!-- 我要留言按钮 -->
  126. <span
  127. style="float: right; margin-right: 50px"
  128. class="active addClass"
  129. @click="getList"
  130. >+ {{ $t("common.giveComments") }}</span
  131. >
  132. </ul>
  133. </div>
  134. <!-- 留言内容 -->
  135. <div style="margin: 20px auto; width: 92%; border-top: 1px solid #aaaaaa">
  136. <div class="messageBox" v-for="(item, index) in initData">
  137. <!-- <div class="messageBox" style="cursor: pointer;" @click="toView('developmentDetails',item)"> @click="toView('developmentDetails',item)"-->
  138. <!-- 问 -->
  139. <div style="height: 70px; padding: 0 30px">
  140. <div
  141. style="
  142. float: left;
  143. width: 40px;
  144. height: 40px;
  145. border-radius: 50%;
  146. background: #e3bb03;
  147. margin-top: 15px;
  148. text-align: center;
  149. "
  150. >
  151. <img
  152. v-if="$i18n.locale == 'zh'"
  153. src="@/assets/img/helpCenter/ask.png"
  154. alt=""
  155. style="width: 100%; border-radius: 50%"
  156. />
  157. <img
  158. v-if="$i18n.locale == 'en'"
  159. src="@/assets/img/helpCenter/q.png"
  160. alt=""
  161. style="width: 100%; border-radius: 50%"
  162. />
  163. <!-- <span style="color:#fff;font-size: 20px;font-weight: 700;line-height: 36px;">{{$t('common.Q')}}</span> -->
  164. </div>
  165. <span
  166. style="
  167. float: left;
  168. width: 90%;
  169. font-size: 24px;
  170. margin-left: 20px;
  171. line-height: 70px;
  172. overflow: hidden;
  173. text-overflow: ellipsis;
  174. white-space: nowrap;
  175. "
  176. >
  177. {{ item.title }}
  178. <span v-if="active == 3 && item.status == 1 && $i18n.locale == 'zh'"
  179. >(已回复)</span
  180. >
  181. <span v-if="active == 3 && item.status == 1 && $i18n.locale == 'en'"
  182. >(Replied)</span
  183. >
  184. <span v-if="active == 3 && item.status != 1 && $i18n.locale == 'zh'"
  185. >(未回复)</span
  186. >
  187. <span v-if="active == 3 && item.status != 1 && $i18n.locale == 'en'"
  188. >(No Reply)</span
  189. >
  190. </span>
  191. </div>
  192. <div>
  193. <div style="width: 92%; float: right">
  194. <div style="display: block">
  195. <span
  196. style="
  197. float: left;
  198. color: #00d6e8;
  199. width: 70%;
  200. overflow: hidden;
  201. text-overflow: ellipsis;
  202. white-space: nowrap;
  203. font-size: 14px;
  204. "
  205. >
  206. <img
  207. v-if="item.imagesPath"
  208. :src="imageAddPath(item.imagesPath)"
  209. alt=""
  210. style="width: 20px; height: 20px; border-radius: 50%"
  211. />
  212. {{ item.userName }}
  213. </span>
  214. <span style="float: right; color: #c1c1c1; font-size: 14px"
  215. >{{ $t("common.MessageTime") }}:<span>
  216. {{ item.createDate }}
  217. </span></span
  218. >
  219. </div>
  220. <div style="margin: 50px 0">
  221. <p v-html="item.content" style="font-size: 16px"></p>
  222. </div>
  223. <div style="margin: 50px 0">
  224. <div
  225. style="
  226. background-color: #fcecd5;
  227. color: #ecac90;
  228. font-size: 12px;
  229. line-height: 18px;
  230. text-align: center;
  231. height: 20px;
  232. border-radius: 15px;
  233. float: left;
  234. margin-right: 20px;
  235. padding: 0 10px;
  236. "
  237. >
  238. {{ item.columnNameParent }}
  239. </div>
  240. <div
  241. style="
  242. background-color: #fcecd5;
  243. color: #ecac90;
  244. font-size: 12px;
  245. line-height: 18px;
  246. text-align: center;
  247. height: 20px;
  248. border-radius: 15px;
  249. float: left;
  250. margin-right: 20px;
  251. padding: 0 10px;
  252. "
  253. >
  254. {{ item.columnName }}
  255. </div>
  256. <!-- <span style="float:right;margin-left:34px;color:#c1c1c1"><span style="color:#000">{{item.replyStatus}} </span>{{$t('common.Reply')}}</span> -->
  257. <!-- <span style="float:right;margin-left:34px;color:#c1c1c1"><span style="color:#000">{{item.collectNum}} </span>{{$t('common.Collect')}}</span> -->
  258. <span
  259. style="
  260. float: right;
  261. margin-left: 34px;
  262. color: #c1c1c1;
  263. font-size: 14px;
  264. "
  265. >
  266. <span style="color: #000">{{ item.likeNum }} </span>
  267. {{ $t("common.Praise") }}
  268. </span>
  269. <span
  270. class="share cursor"
  271. :style="item.ifcommon ? 'color: #66b1ff;' : 'color:#c1c1c1'"
  272. style="margin-right: 20px; float: right; font-size: 14px"
  273. ref="likeclick"
  274. @click="shareChange(item.id, item)"
  275. >
  276. <i
  277. class="el-icon-star-off"
  278. :style="item.ifcommon ? 'color: #66b1ff;' : '#c1c1c1'"
  279. ></i>
  280. {{ item.ifcommon ? $t("common.Liked") : $t("common.Tolike") }}
  281. </span>
  282. <span
  283. class="share cursor"
  284. :style="
  285. item.ifcommonCollect ? 'color: #66b1ff;' : 'color:#c1c1c1'
  286. "
  287. style="margin-right: 20px; float: right; font-size: 14px"
  288. ref="likeclick"
  289. @click="collect(item, item.ifcommonCollect)"
  290. >
  291. <i
  292. class="el-icon-star-off"
  293. :style="item.ifcommonCollect ? 'color: #66b1ff;' : '#c1c1c1'"
  294. ></i>
  295. {{
  296. $i18n.locale == "zh"
  297. ? item.ifcommonCollect
  298. ? "已收藏"
  299. : "收藏"
  300. : item.ifcommonCollect
  301. ? "Already collected"
  302. : " Collection"
  303. }}
  304. </span>
  305. </div>
  306. <!-- <el-button type="primary" @click="deleteMess(index)" style="position: relative;right: 0;">删除</el-button> -->
  307. </div>
  308. <div style="clear: both"></div>
  309. </div>
  310. <!-- 平台回复 -->
  311. <div class="Platform" v-if="item.replyStatus == 1">
  312. <div
  313. style="
  314. height: 70px;
  315. background: #f1f4f9;
  316. border-bottom: 1px solid #e1e2e6;
  317. padding: 0 30px;
  318. "
  319. >
  320. <!-- 答 -->
  321. <div
  322. style="
  323. float: left;
  324. width: 40px;
  325. height: 40px;
  326. border-radius: 50%;
  327. background: #279eb2;
  328. margin-top: 15px;
  329. text-align: center;
  330. "
  331. >
  332. <img
  333. v-if="$i18n.locale == 'zh'"
  334. src="@/assets/img/helpCenter/answer.png"
  335. alt=""
  336. style="width: 100%; border-radius: 50%"
  337. />
  338. <img
  339. v-if="$i18n.locale == 'en'"
  340. src="@/assets/img/helpCenter/A.png"
  341. alt=""
  342. style="width: 100%; border-radius: 50%"
  343. />
  344. <!-- <span style="color:#fff;font-size: 20px;font-weight: 700;line-height: 36px;">{{$t('common.A')}}</span> -->
  345. </div>
  346. <span
  347. style="
  348. float: left;
  349. font-size: 20px;
  350. color: #3c5375;
  351. font-weight: 700;
  352. margin-left: 20px;
  353. line-height: 70px;
  354. "
  355. >GEIDCP {{ $t("common.PlatformReply") }}</span
  356. >
  357. </div>
  358. <div
  359. style="
  360. border-bottom: 1px dotted #aaaaaa;
  361. width: 92%;
  362. margin: auto;
  363. float: right;
  364. "
  365. v-for="(
  366. i, index
  367. ) in item.baseDevelopmentCooperationReplyMessageList"
  368. >
  369. <div style="margin: 30px 0">
  370. <div>
  371. <span
  372. style="
  373. float: right;
  374. color: #c1c1c1;
  375. width: 18%;
  376. margin-top: 10px;
  377. "
  378. >{{ $t("common.ReplyTime") }}:<span>{{
  379. formatDate(i.updateDate)
  380. }}</span></span
  381. >
  382. <p
  383. style="float: left; width: 70%; font-size: 16px"
  384. v-html="i.content"
  385. ></p>
  386. <div style="clear: both"></div>
  387. </div>
  388. <!-- <div>-->
  389. <!-- <span style="float:right;margin-left:34px;color:#c1c1c1"><span style="color:#000">{{i.collectNum}} </span>{{$t('common.Collect')}}</span> -->
  390. <!-- <span style="float:right;margin-left:34px;color:#c1c1c1;font-size: 14px;"><span style="color:#000">{{i.likeNum}} </span>{{$t('common.Praise')}}</span>-->
  391. <!-- </div>-->
  392. </div>
  393. </div>
  394. <div style="clear: both"></div>
  395. </div>
  396. </div>
  397. </div>
  398. <!-- 分页 -->
  399. <div
  400. style="position: relative; width: 100%; height: 200px"
  401. v-if="initData.length > 0"
  402. >
  403. <el-pagination
  404. style="
  405. position: absolute;
  406. left: 50%;
  407. top: 50%;
  408. transform: translate(-50%, -50%);
  409. "
  410. background
  411. layout="prev, pager, next"
  412. :total="totalNum"
  413. :page-size="6"
  414. @size-change="handleSizeChange"
  415. @current-change="handleCurrentChange"
  416. >
  417. </el-pagination>
  418. </div>
  419. <!-- 我要留言 -->
  420. <el-dialog
  421. :title="$t('common.ToleaveMessage')"
  422. :visible.sync="dialogVisible"
  423. width="40%"
  424. >
  425. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  426. <el-form-item :label="$t('common.Messageclassification') + ':'">
  427. <el-select
  428. v-model="formInline.MessageClassification"
  429. :placeholder="$t('common.PleaseSelect')"
  430. v-on:change="getShowId($event)"
  431. >
  432. <el-option
  433. v-for="(list, index) in classList"
  434. :label="list.name"
  435. :value="list.id"
  436. style="display: block; width: 100%"
  437. ></el-option>
  438. </el-select>
  439. </el-form-item>
  440. <el-form-item :label="$t('common.Messagetypes') + ':'">
  441. <el-select
  442. v-model="formInline.MessageType"
  443. :placeholder="$t('common.PleaseSelect')"
  444. v-on:change="mess2getShowId($event)"
  445. >
  446. <el-option
  447. v-for="(type, index) in typeList"
  448. :label="type.name"
  449. :value="type.id"
  450. style="display: block; width: 100%"
  451. ></el-option>
  452. </el-select>
  453. </el-form-item>
  454. </el-form>
  455. <el-form>
  456. <el-form-item
  457. :label="$t('common.ToleaveMessage') + ':'"
  458. :required="true"
  459. >
  460. <el-input
  461. type="text"
  462. :placeholder="$t('common.InputContent')"
  463. maxlength="200"
  464. show-word-limit
  465. v-model="formInline.title"
  466. style="width: 90%"
  467. >
  468. </el-input>
  469. </el-form-item>
  470. </el-form>
  471. <el-input
  472. type="textarea"
  473. :rows="2"
  474. :placeholder="$t('common.InputContent')"
  475. maxlength="200"
  476. show-word-limit
  477. v-model="formInline.textarea"
  478. >
  479. </el-input>
  480. <span slot="footer" class="dialog-footer">
  481. <el-button @click="dialogVisibleClose()">{{
  482. $t("common.Cancel")
  483. }}</el-button>
  484. <el-button type="primary" @click="publish()"
  485. >{{ $t("common.OK") }}
  486. </el-button>
  487. </span>
  488. </el-dialog>
  489. <!-- 登录提示 -->
  490. <el-dialog
  491. :title="$i18n.locale == 'zh' ? '提示' : 'Reminder'"
  492. :visible.sync="toViewLogin"
  493. :width="$i18n.locale == 'zh' ? '500px' : '750px'"
  494. :height="$i18n.locale == 'zh' ? '300px' : '386px'"
  495. :before-close="toViewLoginChange"
  496. >
  497. <div style="width: 100%; height: 100%">
  498. <img
  499. src="@/assets/img/loginTips.png"
  500. alt=""
  501. style="width: 180px; height: 180px; margin-left: 20px"
  502. />
  503. <div
  504. style="float: right; margin-right: 20px"
  505. :style="
  506. $i18n.locale == 'zh'
  507. ? 'width: 49%;margin-top: 10px;'
  508. : 'width: 453px;margin-top: -25px;'
  509. "
  510. >
  511. <div
  512. style="
  513. font-size: 20px;
  514. font-weight: normal;
  515. color: #333333;
  516. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  517. line-height: 40px;
  518. "
  519. >
  520. {{ $t("common.ReminderFirst") }}
  521. </div>
  522. <div
  523. style="
  524. font-size: 16px;
  525. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  526. font-weight: normal;
  527. color: #666666;
  528. line-height: 30px;
  529. "
  530. >
  531. {{ $t("common.ReminderSecond") }}
  532. <span style="color: #0091ff; font-size: 18px">{{ num }}</span>
  533. {{ $t("common.ReminderThird") }}
  534. </div>
  535. <div
  536. style="
  537. font-size: 14px;
  538. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  539. font-weight: normal;
  540. color: #666666;
  541. line-height: 30px;
  542. "
  543. >
  544. {{ $t("common.ReminderForth") }}
  545. </div>
  546. <div
  547. style="
  548. font-size: 14px;
  549. font-family: HiraginoSansGB-W3, HiraginoSansGB;
  550. height: 33px;
  551. line-height: 60px;
  552. font-weight: normal;
  553. color: #0091ff;
  554. "
  555. >
  556. <span
  557. style="margin-left: 40px"
  558. class="cursor"
  559. @click="toView('login')"
  560. >
  561. {{ $t("common.ReminderFifth") }}
  562. </span>
  563. <span
  564. style="margin-left: 10px"
  565. class="cursor"
  566. @click="toView('Register')"
  567. >
  568. {{ $t("common.ReminderSixth") }}
  569. </span>
  570. </div>
  571. </div>
  572. </div>
  573. </el-dialog>
  574. </div>
  575. </template>
  576. <script>
  577. import Base from "@/views/base/Base";
  578. import Screen from "@/components/screen";
  579. import developmentDetails from "./development/developmentDetails";
  580. import {
  581. getMessage,
  582. getsCustomized,
  583. getsCustomizedMy,
  584. getColumnTree,
  585. saveOrUpdate,
  586. clickLike,
  587. getMessagesByCollect,
  588. } from "@/api/baseDevelopment";
  589. import {
  590. getFollowModeNumlByModelId,
  591. getFollowModelNumByUser,
  592. saveFollowModel,
  593. } from "@/api/operation/basePortalModelFollowInfo";
  594. import {getFollowModeNumlByModelIdAndUserId} from "@/api/operation/basePortalModelFollowInfo";
  595. import {getToken} from "@/utils/auth";
  596. import {formatDate} from "@/utils/formatUtils";
  597. import {addIntegral, addGrowth} from "@/utils/toCompleteTask";
  598. import {getUserPointPage} from "@/api/user";
  599. import _ from "lodash";
  600. export default {
  601. name: "developmentCooperation",
  602. extends: Base,
  603. components: {Screen},
  604. data() {
  605. return {
  606. dictParam: {
  607. classifiedMessage: "all",
  608. questionType: "all",
  609. },
  610. //留言内容的查询条件
  611. params: {
  612. pageNo: 1,
  613. pageSize: 6,
  614. language: "",
  615. queryType: 1,
  616. replyStatus: 1,
  617. // status:'',
  618. createBy: null,
  619. },
  620. //留言分类
  621. classifiedMessage: {
  622. value: "common.Messageclassification",
  623. item: [],
  624. },
  625. //问题类型
  626. questionType: {
  627. value: "common.Problemtypes",
  628. item: [],
  629. },
  630. //字典的查询条件
  631. paramsDict: {
  632. language: "",
  633. },
  634. //留言点赞
  635. likeId: {
  636. id: "",
  637. },
  638. ifcommon: false,
  639. replyMess: [],
  640. active: 1,
  641. num: 0,
  642. totalNum: 0,
  643. total: 0,
  644. centerDialogVisible: false,
  645. dialogVisible: false,
  646. formInline: {
  647. MessageClassification: "",
  648. MessageType: "",
  649. title: "",
  650. textarea: "",
  651. },
  652. toViewLogin: false,
  653. pageNo: 1,
  654. screen1: {
  655. item: [],
  656. },
  657. screen2: {
  658. item: [],
  659. },
  660. initData: [],
  661. classList: [],
  662. typeList: [],
  663. indexId: 0,
  664. status: "",
  665. indexId2: 0,
  666. indexNum: 0,
  667. baseDevelopmentCooperationMessage: {
  668. id: this.indexId,
  669. columnId: "",
  670. title: "",
  671. content: "",
  672. likeNum: "",
  673. clickNum: "",
  674. collectNum: "",
  675. replyStatus: "",
  676. membershipPermissionType: "",
  677. status: "",
  678. createBy: "",
  679. createDate: "",
  680. updateBy: "",
  681. updateDate: "",
  682. userName: "",
  683. columnName: "",
  684. columnNameParent: "",
  685. },
  686. user: {
  687. umsUser: {},
  688. },
  689. collectId: "",
  690. giveLikeId: "",
  691. pointStatus: null,
  692. isToken: null,
  693. };
  694. },
  695. watch: {
  696. "$i18n.locale"() {
  697. this.getMessages();
  698. this.getDict();
  699. this.changeActive(this.active);
  700. },
  701. //toViewLogin变量检查是否进行跳转
  702. toViewLogin() {
  703. if (this.toViewLogin == true) {
  704. this.loginTipsChange();
  705. this.changeActive();
  706. this.liked();
  707. }
  708. },
  709. },
  710. mounted() {
  711. this.user = JSON.parse(window.localStorage.getItem("user"));
  712. window.localStorage.setItem("router", "developmentCooperation");
  713. //获取留言字典
  714. this.getDict();
  715. //获取留言消息
  716. this.getMessages();
  717. this.judgeState()
  718. },
  719. methods: {
  720. judgeState() {
  721. this.isToken = getToken()
  722. if (this.isToken) {
  723. getUserPointPage().then((res) => {
  724. this.pointStatus = res.data.umsUserPoints[0].pointStatus
  725. })
  726. }
  727. },
  728. //获取留言信息
  729. getMessages: function () {
  730. this.params.language = this.$i18n.locale.toUpperCase();
  731. getsCustomized(this.params).then((res) => {
  732. this.initData = [];
  733. this.totalNum = res.data.page.totalCount - 0;
  734. this.getMyCollecModel(res.data.baseDevelopmentCooperationMessages);
  735. this.initData = [];
  736. this.initData = res.data.baseDevelopmentCooperationMessages;
  737. this.initData.forEach((i) => {
  738. i.createDate = i.createDate
  739. ? formatDate(i.createDate, "YYYY-MM-DD")
  740. : "";
  741. });
  742. });
  743. },
  744. getMyCollecModel(baseDevelopmentCooperationMessages) {
  745. baseDevelopmentCooperationMessages.forEach((i) => {
  746. if (this.$Cookies.get("token")) {
  747. let user = window.localStorage.getItem("user");
  748. var users = JSON.parse(user);
  749. let MyCollecModel = {
  750. modelType: "developmentCooperation",
  751. userId: users.userId,
  752. modelEntityId: i.id,
  753. };
  754. getFollowModeNumlByModelIdAndUserId(
  755. i.id,
  756. "developmentCooperation",
  757. this.userId
  758. ).then((res) => {
  759. // i.ifcommon = res.data;
  760. this.$set(i, "ifcommonCollect", res.data);
  761. });
  762. }
  763. });
  764. },
  765. dialogVisibleClose() {
  766. this.formInline.MessageClassification = "";
  767. this.formInline.MessageType = "";
  768. this.dialogVisible = false;
  769. },
  770. //图片地址补全
  771. imageAddPath(path) {
  772. const origin = document.location.origin;
  773. // console.log(origin + "/common/opt/file/pub/" + path)
  774. return origin + "/api/file/pub/" + path;
  775. },
  776. //选项切换
  777. changeDictParam(type, id) {
  778. if (type == "classifiedMessage") {
  779. this.dictParam.classifiedMessage = id;
  780. for (let index in this.classifiedMessage.item) {
  781. if (id == "all") {
  782. this.questionType = this.classifiedMessage.item[0].children;
  783. this.params.columnId = null;
  784. } else if (
  785. this.classifiedMessage.item[index].id ==
  786. this.dictParam.classifiedMessage
  787. ) {
  788. this.questionType = this.classifiedMessage.item[index].children;
  789. this.params.columnId = id;
  790. }
  791. }
  792. } else if ((type = "questionType")) {
  793. this.dictParam.questionType = id;
  794. if (id == "all") {
  795. this.params.columnId = null;
  796. } else {
  797. this.params.columnId = id;
  798. }
  799. }
  800. this.getMessages();
  801. },
  802. //登录跳转
  803. loginTipsChange() {
  804. const that = this;
  805. this.num = 5;
  806. this.timer = setInterval(function () {
  807. if (that.num > 0) {
  808. that.num--;
  809. } else {
  810. if (that.toViewLogin == true) {
  811. clearInterval(that.timer);
  812. that.toView("login");
  813. } else {
  814. clearInterval(that.timer);
  815. }
  816. }
  817. }, 1000);
  818. },
  819. // 判断未登录跳转是否关闭
  820. toViewLoginChange(done) {
  821. this.toViewLogin = false;
  822. this.num = 5;
  823. clearInterval(this.timer);
  824. },
  825. // 分页
  826. handleCurrentChange(val) {
  827. this.pageNo = val;
  828. this.params.pageNo = this.pageNo;
  829. if (this.active == 1) {
  830. this.params.createBy = null;
  831. this.params.queryType = 1;
  832. this.params.replyStatus = 1;
  833. this.getMessages();
  834. } else if (this.active == 2) {
  835. this.params.createBy = null;
  836. this.params.queryType = 2;
  837. this.params.replyStatus = 1;
  838. this.getMessages();
  839. } else if (this.active == 3) {
  840. this.params.replyStatus = null;
  841. this.params.queryType = 3;
  842. // let user = window.localStorage.getItem("user");
  843. if (!this.$Cookies.get("token")) {
  844. this.toViewLogin = true;
  845. } else {
  846. // var users = JSON.parse(user);
  847. // this.params.createBy = users.userId;
  848. let token = getToken();
  849. this.getMessagesMy(token);
  850. }
  851. } else if (this.active == 4) {
  852. this.params.queryType = 4;
  853. if (!this.$Cookies.get("token")) {
  854. this.toViewLogin = true;
  855. } else {
  856. // var users = JSON.parse(user);
  857. // this.params.createBy = users.userId;
  858. let token = getToken();
  859. this.getMessagesByCollect(token);
  860. }
  861. }
  862. },
  863. handleSizeChange(val) {
  864. console.log(`每页 ${val} 条`);
  865. },
  866. //分页索引接着上一页的索引
  867. indexMethod(index) {
  868. return (this.page - 1) * 10 + index + 1;
  869. },
  870. //选项卡列表
  871. getList() {
  872. let user = window.localStorage.getItem("user");
  873. if (!this.$Cookies.get("token")) {
  874. this.toViewLogin = true;
  875. } else {
  876. this.dialogVisible = true;
  877. var params = {
  878. language: this.$i18n.locale.toUpperCase(),
  879. };
  880. getColumnTree(params).then((res) => {
  881. this.classList = res.data;
  882. this.indexId = this.classList[0].id;
  883. });
  884. }
  885. },
  886. //留言分类选项卡
  887. getShowId(val) {
  888. this.indexId = val;
  889. let i = 0;
  890. for (i = 0; i < this.classList.length; i++) {
  891. if (this.classList[i].id == this.indexId) {
  892. this.indexNum = i;
  893. break;
  894. }
  895. }
  896. this.typeList = this.classList[this.indexNum].children;
  897. this.formInline.MessageType = "";
  898. },
  899. mess2getShowId(val) {
  900. this.indexId2 = val;
  901. },
  902. //获取留言字典
  903. getDict() {
  904. this.paramsDict.language = this.$i18n.locale.toUpperCase();
  905. var that = this;
  906. that.classifiedMessage = {};
  907. getColumnTree(this.paramsDict).then((res) => {
  908. //留言分类处理
  909. if (this.$i18n.locale == "zh") {
  910. that.classifiedMessage = {
  911. value: "留言类型",
  912. item: [],
  913. };
  914. } else if (this.$i18n.locale == "en") {
  915. that.classifiedMessage = {
  916. value: "Message Classification",
  917. item: [],
  918. };
  919. }
  920. that.classifiedMessage.item = res.data;
  921. for (let index in that.classifiedMessage.item) {
  922. if (index == "remove") {
  923. break;
  924. }
  925. if (this.$i18n.locale == "zh") {
  926. var chidren = {
  927. value: "问题类型",
  928. item: [],
  929. };
  930. } else if (this.$i18n.locale == "en") {
  931. var chidren = {
  932. value: "Problem Types",
  933. item: [],
  934. };
  935. }
  936. chidren.item = that.classifiedMessage.item[index].children;
  937. chidren.item.unshift({
  938. name: "common.All",
  939. selected: 1,
  940. id: "all",
  941. });
  942. that.classifiedMessage.item[index].children = chidren;
  943. }
  944. that.questionType = that.classifiedMessage.item[0].children;
  945. that.classifiedMessage.item.unshift({
  946. name: "common.All",
  947. selected: 1,
  948. id: "all",
  949. });
  950. that.classifiedMessage.item[0].children =
  951. that.classifiedMessage.item[1].children;
  952. });
  953. },
  954. changeActive(i) {
  955. this.active = i.currentTarget.id;
  956. if (this.active == 1) {
  957. this.params.pageNo = 1;
  958. this.params.createBy = null;
  959. this.params.queryType = 1;
  960. this.params.replyStatus = 1;
  961. this.getMessages();
  962. } else if (this.active == 2) {
  963. this.params.pageNo = 1;
  964. this.params.createBy = null;
  965. this.params.queryType = 2;
  966. this.params.replyStatus = 1;
  967. this.getMessages();
  968. } else if (this.active == 3) {
  969. this.params.pageNo = 1;
  970. this.params.replyStatus = null;
  971. this.params.queryType = 3;
  972. // let user = window.localStorage.getItem("user");
  973. if (!this.$Cookies.get("token")) {
  974. this.toViewLogin = true;
  975. } else {
  976. // var users = JSON.parse(user);
  977. // this.params.createBy = users.userId;
  978. let token = getToken();
  979. this.getMessagesMy(token);
  980. }
  981. } else if (this.active == 4) {
  982. this.params.pageNo = 1;
  983. this.params.queryType = 4;
  984. if (!this.$Cookies.get("token")) {
  985. this.toViewLogin = true;
  986. } else {
  987. // var users = JSON.parse(user);
  988. // this.params.createBy = users.userId;
  989. let token = getToken();
  990. this.getMessagesByCollect(token);
  991. }
  992. }
  993. },
  994. getMessagesByCollect: function (token) {
  995. this.params.language = this.$i18n.locale.toUpperCase();
  996. getMessagesByCollect(this.params, token).then((res) => {
  997. if (res.data.baseDevelopmentCooperationMessages) {
  998. let newData = [];
  999. this.totalNum = res.data.page.totalCount - 0;
  1000. this.getMyCollecModel(res.data.baseDevelopmentCooperationMessages);
  1001. this.initData = [];
  1002. this.initData = res.data.baseDevelopmentCooperationMessages;
  1003. this.initData.forEach((i) => {
  1004. i.createDate = i.createDate
  1005. ? formatDate(i.createDate, "YYYY-MM-DD")
  1006. : "";
  1007. });
  1008. } else {
  1009. this.initData = [];
  1010. }
  1011. });
  1012. },
  1013. getMessagesMy: function (token) {
  1014. this.params.language = this.$i18n.locale.toUpperCase();
  1015. getsCustomizedMy(this.params, token).then((res) => {
  1016. let newData = [];
  1017. this.totalNum = res.data.page.totalCount - 0;
  1018. this.getMyCollecModel(res.data.baseDevelopmentCooperationMessages);
  1019. this.initData = [];
  1020. this.initData = res.data.baseDevelopmentCooperationMessages;
  1021. this.initData.forEach((i) => {
  1022. i.createDate = i.createDate
  1023. ? formatDate(i.createDate, "YYYY-MM-DD")
  1024. : "";
  1025. i.ifcommon = false;
  1026. });
  1027. });
  1028. },
  1029. // 收藏状态改变
  1030. // collect(item, ifcommonCollect) {
  1031. // this.collectId = item.id;
  1032. // if (ifcommonCollect) {
  1033. // this.saveFollowModelDo("unfollow", item);
  1034. // } else {
  1035. // this.saveFollowModelDo("follow", item);
  1036. // }
  1037. // },
  1038. collect: _.throttle(function (item, ifcommonCollect) {
  1039. this.collectId = item.createBy;
  1040. if (this.collectId == this.user.userId) {
  1041. this.$message({
  1042. message: this.$i18n.locale == "zh" ? "不可收藏" : "Not Collect",
  1043. type: "warning",
  1044. });
  1045. } else {
  1046. if (ifcommonCollect) {
  1047. this.saveFollowModelDo("unfollow", item);
  1048. } else {
  1049. this.saveFollowModelDo("follow", item);
  1050. }
  1051. }
  1052. }, 3000),
  1053. // 点赞状态改变
  1054. // shareChange(id, item) {
  1055. // if (!item.ifcommon) {
  1056. // item.ifcommon = !item.ifcommon;
  1057. // }
  1058. // this.$forceUpdate();
  1059. // this.likeId.id = id;
  1060. // if (item.ifcommon) {
  1061. // this.liked("unlike", item);
  1062. // } else {
  1063. // this.liked("liked", item);
  1064. // }
  1065. // },
  1066. shareChange: _.throttle(function (id, item) {
  1067. this.giveLikeId = item.createBy;
  1068. if (this.giveLikeId == this.user.userId) {
  1069. this.$message({
  1070. message: this.$i18n.locale == "zh" ? "不可点赞" : "Not Liked",
  1071. type: "warning",
  1072. });
  1073. } else {
  1074. if (!item.ifcommon) {
  1075. item.ifcommon = !item.ifcommon;
  1076. }
  1077. this.$forceUpdate();
  1078. this.likeId.id = id;
  1079. if (item.ifcommon) {
  1080. this.liked("unlike", item);
  1081. } else {
  1082. this.liked("liked", item);
  1083. }
  1084. }
  1085. }, 3000),
  1086. //收藏操作方法
  1087. saveFollowModelDo: function (followType, item) {
  1088. let user = window.localStorage.getItem("user");
  1089. if (!this.$Cookies.get("token")) {
  1090. // this.$message.warning("请先登录");
  1091. // this.$confirm('检测到您未登录,是否登录')
  1092. // .then(_ => {
  1093. // this.toView('login');
  1094. // })
  1095. // .catch(_ => {});
  1096. this.toViewLogin = true;
  1097. } else {
  1098. var users = JSON.parse(user);
  1099. var token = "" + getToken();
  1100. var projectId = item.id;
  1101. var userId = users.userId;
  1102. // 接口逻辑
  1103. this.submitHandler((token) => {
  1104. saveFollowModel(
  1105. projectId,
  1106. "developmentCooperation",
  1107. userId,
  1108. followType,
  1109. token
  1110. )
  1111. .then((result) => {
  1112. // console.log(result);
  1113. if (followType == "unfollow") {
  1114. if (this.$i18n.locale == "zh") {
  1115. this.$message({
  1116. message: "取消收藏",
  1117. type: "success",
  1118. });
  1119. } else {
  1120. this.$message({
  1121. message: "cancel coilection",
  1122. type: "success",
  1123. });
  1124. }
  1125. } else {
  1126. if (this.user.umsUser.userUsertypeDict !== "2" && this.pointStatus == 'y') {
  1127. addGrowth("message_is_saved");
  1128. }
  1129. if (this.$i18n.locale == "zh") {
  1130. this.$message({
  1131. message: "已收藏",
  1132. type: "success",
  1133. });
  1134. } else {
  1135. this.$message({
  1136. message: "Already collected",
  1137. type: "success",
  1138. });
  1139. }
  1140. }
  1141. this.ifcommon = !this.ifcommon;
  1142. let token = getToken();
  1143. if (this.active == 1) {
  1144. this.params.pageNo = 1;
  1145. this.params.createBy = null;
  1146. this.params.queryType = 1;
  1147. this.params.replyStatus = 1;
  1148. this.getMessages();
  1149. } else if (this.active == 2) {
  1150. this.params.pageNo = 1;
  1151. this.params.createBy = null;
  1152. this.params.queryType = 2;
  1153. this.params.replyStatus = 1;
  1154. this.getMessages();
  1155. } else if (this.active == 3) {
  1156. this.params.pageNo = 1;
  1157. this.params.replyStatus = null;
  1158. this.params.queryType = 3;
  1159. // let user = window.localStorage.getItem("user");
  1160. if (!this.$Cookies.get("token")) {
  1161. this.toViewLogin = true;
  1162. } else {
  1163. // var users = JSON.parse(user);
  1164. // this.params.createBy = users.userId;
  1165. let token = getToken();
  1166. this.getMessagesMy(token);
  1167. }
  1168. } else if (this.active == 4) {
  1169. this.params.pageNo = 1;
  1170. this.params.queryType = 4;
  1171. if (!this.$Cookies.get("token")) {
  1172. this.toViewLogin = true;
  1173. } else {
  1174. // var users = JSON.parse(user);
  1175. // this.params.createBy = users.userId;
  1176. let token = getToken();
  1177. this.getMessagesByCollect(token);
  1178. }
  1179. }
  1180. this.resetToken();
  1181. })
  1182. .catch((error) => {
  1183. // 此处你的业务代码
  1184. });
  1185. });
  1186. }
  1187. },
  1188. //点赞
  1189. liked(type, item) {
  1190. let list = {
  1191. id:this.likeId.id,
  1192. userId:this.user.userId,
  1193. }
  1194. clickLike(list).then((res) => {
  1195. if (res.status == 200) {
  1196. if (this.user.umsUser.userUsertypeDict !== "2" && this.pointStatus == 'y') {
  1197. addGrowth("the_message_was_liked");
  1198. }
  1199. this.$message({
  1200. message: this.$i18n.locale == "zh" ? "已点赞" : "Liked of success",
  1201. type: "success",
  1202. });
  1203. item.likeNum++;
  1204. // item.ifcommon = !item.ifcommon;
  1205. this.$forceUpdate();
  1206. }
  1207. this.resetToken();
  1208. });
  1209. },
  1210. //留言方法
  1211. publish: function () {
  1212. if (!this.$Cookies.get("token")) {
  1213. this.toViewLogin = true;
  1214. } else {
  1215. console.log(this.indexId2);
  1216. //留言内容
  1217. this.baseDevelopmentCooperationMessage.content =
  1218. this.formInline.textarea;
  1219. this.baseDevelopmentCooperationMessage.columnId = this.indexId2;
  1220. this.baseDevelopmentCooperationMessage.title = this.formInline.title;
  1221. if (this.baseDevelopmentCooperationMessage.title == "") {
  1222. alert(
  1223. this.$i18n.locale == "zh" ? "标题不能为空" : "Title cannot be empty"
  1224. );
  1225. return;
  1226. }
  1227. // let user = window.localStorage.getItem("user");
  1228. // var users = JSON.parse(user);
  1229. // this.baseDevelopmentCooperationMessage.createBy = users.userId;
  1230. console.log(this.baseDevelopmentCooperationMessage);
  1231. var token = "" + getToken();
  1232. //发送留言
  1233. if (this.baseDevelopmentCooperationMessage.content) {
  1234. if (this.formInline.MessageClassification) {
  1235. if (this.formInline.MessageType) {
  1236. this.submitHandler((token) => {
  1237. saveOrUpdate(
  1238. JSON.stringify(this.baseDevelopmentCooperationMessage),
  1239. token
  1240. )
  1241. .then((res) => {
  1242. if (this.user.umsUser.userUsertypeDict !== "2" && this.pointStatus == 'y') {
  1243. addIntegral(
  1244. "point_task_development_cooperation_message",
  1245. "3"
  1246. );
  1247. }
  1248. // alert(res.msg);
  1249. this.$message({
  1250. message:
  1251. this.$i18n.locale == "zh"
  1252. ? "发送成功"
  1253. : "Sent successfully",
  1254. type: "success",
  1255. });
  1256. })
  1257. .catch((error) => {
  1258. this.$message({
  1259. message:
  1260. this.$i18n.locale == "zh" ? "保存失败" : "Save failed",
  1261. type: "error",
  1262. });
  1263. });
  1264. this.formInline = {};
  1265. this.dialogVisible = false;
  1266. this.resetToken();
  1267. });
  1268. } else {
  1269. this.$message("请选择留言类型");
  1270. }
  1271. } else {
  1272. this.$message("请选择留言分类");
  1273. }
  1274. } else {
  1275. this.$message(this.$t("common.Pleasefillinthecontentfirst"));
  1276. }
  1277. }
  1278. },
  1279. toView(router, json) {
  1280. console.log(json);
  1281. clearInterval(this.timer);
  1282. this.$router.push({
  1283. name: router,
  1284. id: "",
  1285. query: {
  1286. key: json,
  1287. },
  1288. });
  1289. },
  1290. },
  1291. };
  1292. </script>
  1293. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1294. <style scoped>
  1295. body {
  1296. margin: 0;
  1297. }
  1298. .box {
  1299. margin-top: 10px;
  1300. background: #fff;
  1301. /* height: 500px; */
  1302. padding: 20px 0;
  1303. }
  1304. .crumbs {
  1305. margin-left: 20px;
  1306. }
  1307. .box >>> .el-textarea__inner {
  1308. min-height: 220px !important;
  1309. max-height: 220px !important;
  1310. }
  1311. ul li {
  1312. background: #e9eef2;
  1313. width: 136px;
  1314. text-align: center;
  1315. }
  1316. ul li,
  1317. .addClass {
  1318. display: inline-block;
  1319. height: 42px;
  1320. padding: 0 30px;
  1321. font-size: 14px;
  1322. line-height: 42px;
  1323. /* background-color: #30548c; */
  1324. cursor: pointer;
  1325. }
  1326. .addClass:active {
  1327. border: 1px solid #0079ef;
  1328. }
  1329. .active {
  1330. background-color: #30548c;
  1331. color: #fff;
  1332. }
  1333. .messageBox {
  1334. padding: 0px 0 0 0;
  1335. border-bottom: 1px dashed #aaaaaa;
  1336. }
  1337. .lable1,
  1338. .lable2 {
  1339. padding: 5px;
  1340. color: #666;
  1341. white-space: nowrap;
  1342. }
  1343. .lable1 {
  1344. border-radius: 30px;
  1345. background: #feead5;
  1346. color: #fe8150;
  1347. }
  1348. .Platform {
  1349. width: 100%;
  1350. margin: 20px 0;
  1351. /* border-top: 3px solid #a9bcd4; */
  1352. border-bottom: 3px solid #34547b;
  1353. }
  1354. </style>