Plat Admin

viewRecyclingBins.vue 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <template>
  2. <div class="app-container">
  3. <div class="box-container">
  4. <div class="contain-title">查看回收内容</div>
  5. </div>
  6. <div class="content-container contentBox">
  7. <el-form :model="ruleForm2" status-icon ref="ruleForm2" label-width="100px" class="demo-ruleForm formTable">
  8. <div class="formWidth">
  9. <el-form-item label="标题" prop="title">
  10. <span>{{ruleForm2.title}}</span>
  11. </el-form-item>
  12. <el-form-item label="作者/来源" prop="source">
  13. {{ruleForm2.source}}
  14. </el-form-item>
  15. <el-form-item label="相关专家" prop="professors">
  16. {{ruleForm2.professors}}
  17. </el-form-item>
  18. <el-form-item label="相关机构" prop="orgs">
  19. {{ruleForm2.orgs}}
  20. </el-form-item>
  21. <el-form-item label="相关企业" prop="comps">
  22. {{ruleForm2.comps}}
  23. </el-form-item>
  24. </div>
  25. <el-form-item label="文章正文" prop="cnt" class="editBox">
  26. <div class="editContent" v-html="ruleForm2.cnt"></div>
  27. </el-form-item>
  28. <el-form-item class="deleTime">
  29. 最后删除时间:{{modifyTime}}
  30. </el-form-item>
  31. <el-form-item class="publishButton">
  32. <el-button type="primary" @click="restore">恢复</el-button>
  33. <el-button @click="completeDelete">彻底删除</el-button>
  34. </el-form-item>
  35. </el-form>
  36. <div class="fileBox">
  37. <img :src="ruleForm2.imgUrl" alt="" class="fileImg">
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import { inquireContentUrl, restoreUrl, thoroughDeleteSingleUrl } from '@/api/content'
  44. import { parseTime } from '@/utils/index'
  45. export default {
  46. data() {
  47. return {
  48. modifyTime: '',
  49. id: '',
  50. ruleForm2: {
  51. title: '',
  52. source: '',
  53. cnt: '',
  54. imgUrl: '',
  55. catalog: '',
  56. professors: '',
  57. orgs: '',
  58. comps: ''
  59. }
  60. }
  61. },
  62. created() {
  63. const id = this.$route.query.id
  64. this.id = id
  65. this.$http.get(inquireContentUrl, { id }, (response) => {
  66. if (response.success && response.data) {
  67. const info = response.data
  68. this.ruleForm2 = {
  69. catalog: info.catalog,
  70. cnt: info.cnt,
  71. title: info.title,
  72. source: info.source,
  73. imgUrl: info.imgUrl,
  74. professors: '',
  75. orgs: '',
  76. comps: ''
  77. }
  78. this.modifyTime = parseTime(info.modifyTime).substr(0, 19)
  79. }
  80. })
  81. },
  82. methods: {
  83. restore(formName) {
  84. this.$confirm(`确定恢复${this.ruleForm2.title}内容?`, '提示', {
  85. confirmButtonText: '确定',
  86. cancelButtonText: '取消',
  87. type: 'warning',
  88. center: true
  89. }).then(() => {
  90. this.$http.get(restoreUrl, { id: this.id }, response => {
  91. if (response.success) {
  92. if (response.data) {
  93. this.$router.go(-1)
  94. this.$message({
  95. message: '恢复成功',
  96. type: 'success'
  97. })
  98. } else {
  99. this.$http.get(inquireContentUrl, { id: this.id }, (response) => {
  100. if (response.success && response.data) {
  101. const info = response.data
  102. if (!info.actived) {
  103. this.$message({
  104. message: '状态改变',
  105. type: 'warning'
  106. })
  107. }
  108. }
  109. })
  110. }
  111. }
  112. })
  113. }).catch(() => {
  114. })
  115. },
  116. completeDelete() {
  117. this.$confirm('确定彻底删除该条回收站内容?', '提示', {
  118. confirmButtonText: '确定',
  119. cancelButtonText: '取消',
  120. type: 'warning',
  121. center: true
  122. }).then(() => {
  123. this.$http.get(thoroughDeleteSingleUrl, { id: this.id }, response => {
  124. if (response.success) {
  125. this.$router.go(-1)
  126. this.$message({
  127. message: '删除成功',
  128. type: 'success'
  129. })
  130. }
  131. })
  132. }).catch(() => {
  133. })
  134. }
  135. }
  136. }
  137. </script>
  138. <style rel="stylesheet/scss" lang="scss" scoped>
  139. .deleTime {
  140. text-align: right
  141. }
  142. .formTable {
  143. width: 943px
  144. }
  145. .formWidth {
  146. width: 500px
  147. }
  148. .content-container {
  149. position: relative;
  150. }
  151. .fileBox {
  152. position: absolute;
  153. top: 20px;
  154. left: 550px;
  155. text-align: center
  156. }
  157. .editContent {
  158. height: 500px;
  159. border: 1px solid #409EFF;
  160. overflow: hidden;
  161. }
  162. .publishButton {
  163. text-align: center;
  164. }
  165. .fileImg {
  166. width: 400px;
  167. height: 200px;
  168. border: 1px solid #409EFF;
  169. }
  170. </style>