123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <template>
- <div class="app-container">
- <div class="box-container">
- <div class="contain-title">查看回收内容</div>
- </div>
- <div class="content-container contentBox">
- <el-form :model="ruleForm2" status-icon ref="ruleForm2" label-width="100px" class="demo-ruleForm formTable">
- <div class="formWidth">
- <el-form-item label="标题" prop="title">
- <span>{{ruleForm2.title}}</span>
- </el-form-item>
- <el-form-item label="作者/来源" prop="source">
- {{ruleForm2.source}}
- </el-form-item>
- <el-form-item label="相关专家" prop="professors">
- {{ruleForm2.professors}}
- </el-form-item>
- <el-form-item label="相关机构" prop="orgs">
- {{ruleForm2.orgs}}
- </el-form-item>
- <el-form-item label="相关企业" prop="comps">
- {{ruleForm2.comps}}
- </el-form-item>
- </div>
- <el-form-item label="文章正文" prop="cnt" class="editBox">
- <div class="editContent" v-html="ruleForm2.cnt"></div>
- </el-form-item>
- <el-form-item class="deleTime">
- 最后删除时间:{{modifyTime}}
- </el-form-item>
- <el-form-item class="publishButton">
- <el-button type="primary" @click="restore">恢复</el-button>
- <el-button @click="completeDelete">彻底删除</el-button>
- </el-form-item>
- </el-form>
- <div class="fileBox">
- <img :src="ruleForm2.imgUrl" alt="" class="fileImg">
- </div>
- </div>
- </div>
- </template>
- <script>
- import { inquireContentUrl, restoreUrl, thoroughDeleteSingleUrl } from '@/api/content'
- import { parseTime } from '@/utils/index'
- export default {
- data() {
- return {
- modifyTime: '',
- id: '',
- ruleForm2: {
- title: '',
- source: '',
- cnt: '',
- imgUrl: '',
- catalog: '',
- professors: '',
- orgs: '',
- comps: ''
- }
- }
- },
- created() {
- const id = this.$route.query.id
- this.id = id
- this.$http.get(inquireContentUrl, { id }, (response) => {
- if (response.success && response.data) {
- const info = response.data
- this.ruleForm2 = {
- catalog: info.catalog,
- cnt: info.cnt,
- title: info.title,
- source: info.source,
- imgUrl: info.imgUrl,
- professors: '',
- orgs: '',
- comps: ''
- }
- this.modifyTime = parseTime(info.modifyTime).substr(0, 19)
- }
- })
- },
- methods: {
- restore(formName) {
- this.$confirm(`确定恢复${this.ruleForm2.title}内容?`, '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- center: true
- }).then(() => {
- this.$http.get(restoreUrl, { id: this.id }, response => {
- if (response.success) {
- if (response.data) {
- this.$router.go(-1)
- this.$message({
- message: '恢复成功',
- type: 'success'
- })
- } else {
- this.$http.get(inquireContentUrl, { id: this.id }, (response) => {
- if (response.success && response.data) {
- const info = response.data
- if (!info.actived) {
- this.$message({
- message: '状态改变',
- type: 'warning'
- })
- }
- }
- })
- }
- }
- })
- }).catch(() => {
- })
- },
- completeDelete() {
- this.$confirm('确定彻底删除该条回收站内容?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- center: true
- }).then(() => {
- this.$http.get(thoroughDeleteSingleUrl, { id: this.id }, response => {
- if (response.success) {
- this.$router.go(-1)
- this.$message({
- message: '删除成功',
- type: 'success'
- })
- }
- })
- }).catch(() => {
- })
- }
- }
- }
- </script>
- <style rel="stylesheet/scss" lang="scss" scoped>
- .deleTime {
- text-align: right
- }
- .formTable {
- width: 943px
- }
- .formWidth {
- width: 500px
- }
- .content-container {
- position: relative;
- }
- .fileBox {
- position: absolute;
- top: 20px;
- left: 550px;
- text-align: center
- }
- .editContent {
- height: 500px;
- border: 1px solid #409EFF;
- overflow: hidden;
- }
- .publishButton {
- text-align: center;
- }
- .fileImg {
- width: 400px;
- height: 200px;
- border: 1px solid #409EFF;
- }
- </style>
|