userCenterMyActivityIssue.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. <template>
  2. <div class="container-box">
  3. <div class="filter-box">
  4. <el-radio-group v-model="auditStatusDict" id="radioGroup">
  5. <el-radio-button label="">{{$i18n.locale=='en'? 'All': '全部'}}({{listTotal}})</el-radio-button>
  6. <!-- <el-radio-button label="1">{{$i18n.locale=='en'? 'Drafts':'草稿'}}({{numMap[1]}})</el-radio-button>-->
  7. <el-radio-button label="2">{{$t('common.ToAudit')}}({{numMap[2]}})</el-radio-button>
  8. <el-radio-button label="3">{{$t('common.Approved')}}({{numMap[3]}})</el-radio-button>
  9. <el-radio-button label="4">{{$t('common.notApproved')}}({{numMap[4]}})</el-radio-button>
  10. </el-radio-group>
  11. <div>
  12. <div style="display: inline-block;margin-right: 10px;">
  13. <el-select v-model="activityTypeDict" style="width: 150px;">
  14. <el-option
  15. v-for="item in activityTypeDictList"
  16. :key="item.value"
  17. :label="item.label"
  18. :value="item.value"
  19. :disabled="false">
  20. </el-option>
  21. </el-select>
  22. </div>
  23. <div style="display: inline-block;">
  24. <el-input :placeholder="$t('common.keywordSearch')"
  25. v-model="searchInput" class="input-with-select" maxlength="100" show-word-limit @change="search">
  26. <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
  27. </el-input>
  28. </div>
  29. </div>
  30. </div>
  31. <div v-show="listData.length!=0&&listData.length!=undefined">
  32. <div style="min-height: 20px;">
  33. <div v-for="(item,index) in listData"
  34. style="width: 430px;height: 281px;"
  35. :style="{float:index%2==0?'left':'right',marginTop:index!=0&&index!=1?'20px':'0'}"
  36. id="list">
  37. <div style="width: 100%;height: 146px;position: relative">
  38. <img v-if="item.activityLogo" :src="'api/file/pub/'+ item.activityLogo" alt="" style="width: 100%;height: 100%;">
  39. <img v-else :src="'api/file/pub/'+'/def/def1.png'" alt="" style="width: 100%;height: 100%;">
  40. <span style="position: absolute;top: 0;left: 0;width: 82px;height: 25px;display: inline-block;background-color: #ff9933;color: white;text-align: center;line-height: 25px;">
  41. {{item.activityTypeDict==1?$t("common.Activity"):$t("common.Dynamic")}}
  42. </span>
  43. </div>
  44. <div style="width: 100%;height: calc(100% - 146px);border: 1px solid #f2f2f2;box-sizing: border-box;padding-left: 8px;">
  45. <p style="margin: 7px 0 0 0;font-size: 16px;font-weight: 600;height: 42px;" class="twoLine">{{item.activityName}}</p>
  46. <p style="margin: 7px 0 0 0;font-size: 12px;">
  47. <span>{{item.activityPlace}}</span>
  48. <!--报名时间-->
  49. <!--<span style="margin-left: 50px;">{{item.registrationTime}}</span>-->
  50. <!--活动时间-->
  51. <span style="margin-left: 50px;">{{formatDate(item.activityStartTime)}}--{{formatDate(item.activityEndTime)}}</span>
  52. </p>
  53. <p style="margin: 7px 0 0 0;font-size: 12px;">
  54. <span style="display: inline-block;width: 100%;" class="oneLine" :title="item.activityIntroductionUe">{{item.activityIntroductionUe}}</span>
  55. </p>
  56. <!--操作按钮-->
  57. <p style="margin: 7px 0 0 0;font-size: 12px;color: #1990fe;text-align: right;" class="hoverShow">
  58. <span style="margin-right: 25px;cursor: pointer;" @click="showDetails(item)">{{$t('common.look')}}</span>
  59. <span style="margin-right: 25px;cursor: pointer;" @click="change(item)">{{$t('common.edit')}}</span>
  60. <span style="margin-right: 10px;cursor: pointer;" @click="dele(item)">{{$t('common.delete')}}</span>
  61. </p>
  62. </div>
  63. </div>
  64. <div style="clear: both;"></div>
  65. </div>
  66. <div style="width: 100%;text-align: center;">
  67. <el-pagination
  68. style="margin-top: 20px"
  69. layout="prev, pager, next"
  70. @current-change="currentChange"
  71. :page-size="10"
  72. :total="totalNum">
  73. </el-pagination>
  74. </div>
  75. </div>
  76. <ul style="margin:30px;width: 90%;" v-show="listData.length==0||listData.length==undefined">
  77. <img v-if="this.$i18n.locale.toUpperCase()=='ZH'" src="@/assets/img/noData.png" alt=""
  78. style="width: 100%;height: 100%;">
  79. <img v-if="this.$i18n.locale.toUpperCase()=='EN'" src="@/assets/img/noDataEn.png" alt=""
  80. style="width: 100%;height: 100%;">
  81. </ul>
  82. <el-dialog
  83. :title="$i18n.locale=='zh'?'活动信息':'activity information'"
  84. center
  85. :visible.sync="detailDialog"
  86. width="1000px"
  87. class="detailDialog"
  88. :before-close="beforeClose">
  89. <div style="height: 80%;font-size: 16px;font-weight: 700">
  90. <div style="height: 60px;line-height: 60px;margin-left: 30px;margin-right: 30px; border-bottom: 1px solid rgba(228, 228, 228, 1);">
  91. <span>{{$i18n.locale=='zh'?'语言版本':'Language Version'}}</span>
  92. </div>
  93. <div style="width: 100%;padding: 0 150px;box-sizing: border-box;font-size: 14px;font-weight: 400;margin-top: 30px;">
  94. <el-tabs v-model="editableTabsValue" type="card" closable>
  95. <el-tab-pane
  96. v-for="(item, index) in detaile"
  97. :key="item.language"
  98. :label="item.language=='ZH'?$t('common.Chinese'):$t('common.English')"
  99. >
  100. <div style="width: 100%;;box-sizing: border-box">
  101. <el-collapse v-model="activeNames" >
  102. <!-- 基本信息 -->
  103. <el-collapse-item name="3">
  104. <template slot="title">
  105. <span style="color: red;margin-right: 3px;">* </span> {{$t('common.BasicInformation')}}
  106. </template>
  107. <el-form ref="externalFormData" label-width="200px"
  108. class="demo-ruleForm"
  109. style="margin-top: 20px;width: 1000px;">
  110. <!-- 类型 -->
  111. <el-form-item :label="$t('common.Type')" >
  112. <el-input v-show="$i18n.locale=='zh'&&item.activityTypeDict=='1'" value="委员会活动" style="width: 320px;float: left;" disabled></el-input>
  113. <el-input v-show="$i18n.locale=='en'&&item.activityTypeDict=='1'" value="Committee activities" style="width: 320px;float: left;" disabled></el-input>
  114. <el-input v-show="$i18n.locale=='zh'&&item.activityTypeDict=='2'" value="委员会动态" style="width: 320px;float: left;" disabled></el-input>
  115. <el-input v-show="$i18n.locale=='en'&&item.activityTypeDict=='2'" value="Committee dynamics" style="width: 320px;float: left;" disabled></el-input>
  116. </el-form-item>
  117. <!-- 委员会 -->
  118. <el-form-item :label="$t('common.Committee')" >
  119. <el-input :value="item.committeeName" style="width: 320px;float: left;" disabled></el-input>
  120. </el-form-item>
  121. <!-- v-model="" -->
  122. <!-- 活动时间 -->
  123. <el-form-item :label="$t('common.ActivityTime')" style="display: block;">
  124. <el-input :value="item.activityTime" style="width: 320px;float: left;" disabled></el-input>
  125. </el-form-item>
  126. <!-- 活动地点 -->
  127. <el-form-item :label="$t('common.Venue')">
  128. <el-input :value="item.activityPlace" style="width: 320px;float: left;" disabled></el-input>
  129. </el-form-item>
  130. <!-- 报名时间 -->
  131. <el-form-item :label="$t('common.RegistrationTime')">
  132. <el-input :value="item.registrationTime" style="width: 320px;float: left;" disabled></el-input>
  133. </el-form-item>
  134. <!-- 报名链接 -->
  135. <el-form-item :label="$t('common.RegistrationLink')">
  136. <el-input :value="item.registrationUrl" style="width: 320px;float: left;" disabled></el-input>
  137. </el-form-item>
  138. <!-- 相关附件 -->
  139. <!--<el-form-item :label="$t('common.RelatedAttachments')" prop='LegalRepresentative'>
  140. <el-input :value="item.registrationUrl" style="width: 320px;float: left;" disabled></el-input>
  141. </el-form-item>-->
  142. </el-form>
  143. </el-collapse-item>
  144. <!--活动信息-->
  145. <el-collapse-item name="1">
  146. <template slot="title">
  147. <span style="color: red;margin-right: 3px;">* </span> {{$t('common.ActivityInformation')}}
  148. </template>
  149. <el-form ref="externalFormData2" label-width="200px" class="demo-ruleForm"
  150. style="margin-top: 20px;width: 1000px;">
  151. <!-- 名称 -->
  152. <el-form-item :label="$t('common.Name')">
  153. <el-input :value="item.activityName" style="width: 320px;float: left;" disabled></el-input>
  154. </el-form-item>
  155. <!-- 封面 -->
  156. <el-form-item :label="$t('common.Cover')" style="position: relative;">
  157. <img :src="'api/file/pub/'+item.activityLogo" style="width: 180px;height: 180px;">
  158. </el-form-item>
  159. <!-- 简介 -->
  160. <el-form-item :label="$t('common.Introduction')" style="display: block;">
  161. <el-input :value="item.activityIntroductionUe" style="width: 320px;float: left;" disabled></el-input>
  162. </el-form-item>
  163. </el-form>
  164. </el-collapse-item>
  165. <!-- 详情 -->
  166. <el-collapse-item name="2">
  167. <template slot="title">
  168. <span style="color: red;margin-right: 3px;">* </span> {{$t('common.ActivitiesInfo')}}
  169. </template>
  170. <el-form ref="externalFormData2" label-width="200px" class="demo-ruleForm"
  171. style="margin-top: 20px;width: 1000px;">
  172. <el-form-item :label="$t('common.ActivityPreview')" v-show="item.activityPreviewUe">
  173. <div style="width: 320px;height: 320px;overflow: auto;border: 1px solid #ddd;" v-html="item.activityPreviewUe"></div>
  174. </el-form-item>
  175. <el-form-item :label="$t('common.ActivityReview')" v-show="item.activityReviewUe">
  176. <div style="width: 320px;height: 320px;overflow: auto;border: 1px solid #ddd;" v-html="item.activityReviewUe"></div>
  177. </el-form-item>
  178. </el-form>
  179. </el-collapse-item>
  180. </el-collapse>
  181. </div>
  182. </el-tab-pane>
  183. </el-tabs>
  184. </div>
  185. </div>
  186. </el-dialog>
  187. </div>
  188. </template>
  189. <script>
  190. import Base from "@/views/base/Base";
  191. import {getDicts} from "@/api/dict";
  192. import {formatDate} from "@/utils/formatUtils";
  193. import { get } from '@/api/committee/committeeActivityInfo'
  194. import { del } from '@/api/committee/committeeActivityEntity'
  195. import { getActivityByIdForWeb } from "@/api/meeting/meetingApply";
  196. export default {
  197. name: "userCenterMyActivityIssue",
  198. extends: Base,
  199. data() {
  200. return {
  201. language:'',
  202. userId: JSON.parse(localStorage.getItem('user')).userId,
  203. // 检索
  204. auditStatusDict:'',
  205. searchInput:'',
  206. activityTypeDict:null,
  207. activityTypeDictList:[],
  208. // 分页
  209. cureentPage: 1,
  210. totalNum: 0,
  211. // 数据
  212. listData:[],
  213. numMap:[],
  214. // listTotal:0,
  215. // 查看
  216. detaile:[],
  217. detailDialog:false,
  218. editableTabsValue:'0',
  219. activeNames: ['1','2','3'],
  220. }
  221. },
  222. mounted() {
  223. const that = this;
  224. this.$nextTick(function () {
  225. if(this.$i18n.locale=='zh'){
  226. getDicts('COMMITTEE_ACTIVITY_TYPE').then(res => {
  227. that.activityTypeDictList = res.data[0];
  228. let arr = {
  229. label:"全部类型",
  230. value:null,
  231. }
  232. that.activityTypeDictList.unshift(arr)
  233. })
  234. }else if(this.$i18n.locale=='en'){
  235. getDicts('COMMITTEE_ACTIVITY_TYPE_EN').then(res => {
  236. that.activityTypeDictList = res.data[0];
  237. let arr = {
  238. label:"All",
  239. value:null,
  240. }
  241. that.activityTypeDictList.unshift(arr)
  242. })
  243. }
  244. that.getActivity();
  245. })
  246. this.getNumber()
  247. },
  248. watch:{
  249. "$i18n.locale"() {
  250. this.numMap = [];
  251. this.cureentPage = 1;
  252. this.$nextTick(function () {
  253. if(this.$i18n.locale=='zh'){
  254. getDicts('COMMITTEE_ACTIVITY_TYPE').then(res => {
  255. this.activityTypeDictList = res.data[0];
  256. let arr = {
  257. label:"全部类型",
  258. value:null,
  259. }
  260. this.activityTypeDictList.unshift(arr)
  261. })
  262. }else if(this.$i18n.locale=='en'){
  263. getDicts('COMMITTEE_ACTIVITY_TYPE_EN').then(res => {
  264. this.activityTypeDictList = res.data[0];
  265. let arr = {
  266. label:"All",
  267. value:null,
  268. }
  269. this.activityTypeDictList.unshift(arr)
  270. })
  271. }
  272. this.getActivity();
  273. })
  274. },
  275. 'auditStatusDict'(val,oldVal){
  276. this.getActivity();
  277. },
  278. 'activityTypeDict'(val,oldVal){
  279. this.getActivity();
  280. },
  281. },
  282. computed : {
  283. 'listTotal'(){
  284. let num = (this.numMap[1]-0)+(this.numMap[2]-0)+(this.numMap[3]-0)+(this.numMap[4]-0);
  285. if( (typeof num) === 'number' && window.isNaN(num)){
  286. num = 0
  287. }
  288. return num
  289. }
  290. },
  291. methods: {
  292. // 获取数据
  293. getActivity() {
  294. const that = this;
  295. let params = {
  296. pageNo: this.cureentPage,
  297. pageSize: 10,
  298. language: this.$i18n.locale.toUpperCase(),
  299. activityName:this.searchInput,
  300. activityTypeDict:this.activityTypeDict,
  301. status:this.auditStatusDict,
  302. };
  303. getActivityByIdForWeb(params).then(res => {
  304. if (res.data) {
  305. if (res.data.page) {
  306. this.totalNum = Number(res.data.page.totalCount);
  307. if (res.data.page.list) {
  308. that.listData = res.data.page.list;
  309. that.listData.forEach((i)=>{
  310. if(i.activityIntroductionUe){
  311. i.activityIntroductionUe = i.activityIntroductionUe.replace(/<[^>]+>/ig, '')
  312. }
  313. i.activityStartTime = i.activityStartTime ? formatDate(i.activityStartTime, "YYYY-MM-DD") : "";
  314. i.activityEndTime = i.activityEndTime ? formatDate(i.activityEndTime, "YYYY-MM-DD") : "";
  315. })
  316. } else {
  317. that.listData = []
  318. }
  319. }else{
  320. that.listData = []
  321. }
  322. if(that.numMap.length==0){
  323. if (res.data.numMap) {
  324. that.numMap = res.data.numMap
  325. }else{
  326. that.numMap = {
  327. 1: "0",
  328. 2: "0",
  329. 3: "0",
  330. 4: "0",
  331. }
  332. }
  333. }
  334. } else {
  335. that.listData = []
  336. }
  337. })
  338. },
  339. // 输入关键字检索
  340. search(){
  341. this.getActivity()
  342. },
  343. // 查看
  344. showDetails(ele){
  345. const that = this;
  346. let id = ele.entityId;
  347. this.detailDialog = true;
  348. get(id).then(result => {
  349. let data = result.data.committeeActivityInfos;
  350. that.detaile = [];
  351. if(data) {
  352. that.detaile = data;
  353. // var reg = /<[^>]+>/ig;
  354. that.detaile.forEach((i)=>{
  355. if(i.activityIntroductionUe){
  356. i.activityIntroductionUe = i.activityIntroductionUe.replace(/<[^>]+>/ig, '')
  357. }
  358. })
  359. }
  360. }).catch(error => {
  361. this.detailDialog = false;
  362. });
  363. },
  364. beforeClose(done){
  365. this.detaile = []
  366. this.detailDialog=false
  367. done()
  368. },
  369. // 修改
  370. change(ele){
  371. const that = this;
  372. let id = {
  373. id: ele.entityId
  374. };
  375. this.toView('nationalregionalCommissionsEventRelease',id)
  376. },
  377. // 删除
  378. dele(ele){
  379. const that = this;
  380. let id = ele.entityId;
  381. if(that.$i18n.locale=='zh'){
  382. this.$confirm('确定删除该记录吗?', '提示', {
  383. confirmButtonText: '确定',
  384. cancelButtonText: '取消',
  385. type: 'warning'
  386. }).then(() => {
  387. del(id).then(result => {
  388. let data = result.data
  389. }).then(() => {
  390. that.$message({
  391. type: 'success',
  392. message: '删除成功!'
  393. })
  394. }).then(() => {
  395. that.numMap = [];
  396. that.getActivity()
  397. }).catch(() => {
  398. that.$message({
  399. type: 'info',
  400. message: '已取消删除'
  401. })
  402. })
  403. }).catch(() => {
  404. that.$message({
  405. type: 'info',
  406. message: '已取消删除'
  407. });
  408. });
  409. }else{
  410. this.$confirm('Are you sure to delete this record?', 'message', {
  411. confirmButtonText: 'OK',
  412. cancelButtonText: 'Cancel',
  413. type: 'warning'
  414. }).then(() => {
  415. del(id).then(result => {
  416. let data = result.data
  417. }).then(() => {
  418. that.$message({
  419. type: 'success',
  420. message: 'successfully delete!'
  421. })
  422. }).catch(() => {
  423. that.$message({
  424. type: 'info',
  425. message: 'Cancelled Delete'
  426. })
  427. })
  428. }).catch(() => {
  429. that.$message({
  430. type: 'info',
  431. message: 'Cancelled Delete'
  432. });
  433. });
  434. }
  435. },
  436. toView(router,json){
  437. this.$router.push({
  438. name:router,
  439. query:json
  440. })
  441. },
  442. // 分页
  443. currentChange(p) {
  444. this.cureentPage = p;
  445. this.getActivity();
  446. },
  447. }
  448. }
  449. </script>
  450. <style scoped>
  451. .oneLine{
  452. /* 隐藏溢出元素 */
  453. overflow: hidden;
  454. /* 单行显示 */
  455. white-space: nowrap;
  456. /* 溢出显示省略号 */
  457. text-overflow: ellipsis;
  458. }
  459. .twoLine{
  460. overflow : hidden;
  461. text-overflow: ellipsis;
  462. display: -webkit-box;
  463. -webkit-line-clamp: 2;
  464. -webkit-box-orient: vertical;
  465. }
  466. .container-box {
  467. padding: 20px;
  468. }
  469. .filter-box {
  470. display: flex;
  471. justify-content: space-between;
  472. padding: 20px 0;
  473. }
  474. /deep/ #radioGroup .el-radio-button__inner{
  475. border: none;
  476. }
  477. /deep/ #radioGroup .el-radio-button.is-active .el-radio-button__inner{
  478. background-color: white;
  479. color: #ff3b00;
  480. box-shadow: none;
  481. }
  482. .hoverShow{
  483. display: none;
  484. }
  485. #list:hover .hoverShow{
  486. display: block;
  487. }
  488. .detailDialog /deep/ .el-input.is-disabled .el-input__inner{
  489. color: black;
  490. }
  491. </style>