|
@@ -1,21 +1,34 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="60px" :insertSlotArr="[1]">
|
|
|
- <div class="scoped-textarea" slot="OI1">
|
|
|
- <div class="st-text">洪楼科技</div>
|
|
|
- <tinymce ref="refContent" v-model="content" :height="500" />
|
|
|
+ <div class="scoped-textarea" slot="OI1">
|
|
|
+ <div class="st-top">
|
|
|
+ <div class="t">资讯内容:</div>
|
|
|
+ <div :class="isConShow ? 'r t2' : 'r'" @click="isConShow = !isConShow">{{isConShow ? '收起' : '展开'}}</div>
|
|
|
+ </div>
|
|
|
+ <div :class="isConShow ? 'st-content show' : 'st-content'">
|
|
|
+ <div class="st-text">洪楼科技</div>
|
|
|
+ <tinymce ref="refContent" v-model="content" :height="800" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</base-form>
|
|
|
<div class="xl-form scoped-bottom">
|
|
|
+ <el-button class="xl-form-btn t4" @click="openSI">从文中选封面图</el-button>
|
|
|
+ <el-button class="xl-form-btn t1" @click="close('confirm')">保存</el-button>
|
|
|
<el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
|
|
|
- <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
|
|
|
</div>
|
|
|
+ <select-img
|
|
|
+ :isShow="isSIShow"
|
|
|
+ :imgTempArr="imgTempArr"
|
|
|
+ @close="closeSI"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import SelectImg from './components/popup/SelectImg'
|
|
|
import Tinymce from '@/components/Tinymce'
|
|
|
export default {
|
|
|
- components: { Tinymce },
|
|
|
+ components: { Tinymce, SelectImg },
|
|
|
mixins,
|
|
|
data() {
|
|
|
return {
|
|
@@ -23,6 +36,9 @@ export default {
|
|
|
loading: true,
|
|
|
cObj: {},
|
|
|
content: '',
|
|
|
+ isConShow: false,
|
|
|
+ imgTempArr: [],
|
|
|
+ isSIShow: false,
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
@@ -40,9 +56,33 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ openSI () {
|
|
|
+ let regex = new RegExp(/src="https:\/\/img2.honglounews.com([^"]*?)(png|jpg)/g)
|
|
|
+ let s = this.content.match(regex)
|
|
|
+ if (!s) {
|
|
|
+ this.$msgw('未找到图片,请先检查~')
|
|
|
+ this.isConShow = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let imgTempArr = []
|
|
|
+ for (var i = 0; i < s.length; i++) {
|
|
|
+ imgTempArr.push(s[i].replace('src="', ''))
|
|
|
+ }
|
|
|
+ this.imgTempArr = imgTempArr
|
|
|
+ this.isSIShow = true
|
|
|
+ },
|
|
|
+ closeSI (str) {
|
|
|
+ this.isSIShow = false
|
|
|
+ if (str) {
|
|
|
+ const oldform = this.$refs.ruleForm.baseForm
|
|
|
+ this.setDefaultValue({...oldform, pri_image: str})
|
|
|
+ }
|
|
|
+ },
|
|
|
getDef() {
|
|
|
const params = { ...this.cObj }
|
|
|
const disabled = false
|
|
|
+ if (!params.author) params.author = '洪楼Plus'
|
|
|
+ if (!params.hide_status) params.hide_status = '1'
|
|
|
const remoteOptionsIds = []
|
|
|
if (params.estate_list) {
|
|
|
params.estate_id_list = params.estate_list.map(item => {
|
|
@@ -59,8 +99,8 @@ export default {
|
|
|
{ label: '作者', key: 'author', class: 'c-2', rules: 1 },
|
|
|
{ label: '主图', key: 'pri_image', type: 'cuImg', rules: 1,
|
|
|
options: {
|
|
|
- w: 500,
|
|
|
- h: 350,
|
|
|
+ w: 375,
|
|
|
+ h: 262,
|
|
|
}, class: 'c-2' },
|
|
|
{ label: '状态', key: 'hide_status', rules: 1, type: 'select', class: 'c-2', options: this.$dictData.hide_status },
|
|
|
{ label: '时间', key: 'create_at', rules: 1, type: 'datePicker', type2: 'date', class: 'c-2'},
|
|
@@ -156,12 +196,61 @@ export default {
|
|
|
::v-deep .el-date-editor.el-input {
|
|
|
width: 100%;
|
|
|
}
|
|
|
+
|
|
|
+ ::v-deep .img-upload {
|
|
|
+ height: 180px;
|
|
|
+ overflow: hidden;
|
|
|
+ .icon {
|
|
|
+ width: 280px;
|
|
|
+ }
|
|
|
+ .img {
|
|
|
+ width: 280px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.scoped-textarea {
|
|
|
width: 100%;
|
|
|
position: relative;
|
|
|
- margin-bottom: 20px;
|
|
|
+ .st-top {
|
|
|
+ padding-bottom: 10px;
|
|
|
+ user-select: none;
|
|
|
+ .t {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #2d8cf0;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ .r {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ color: #fff;
|
|
|
+ padding: 4px 10px;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #2d8cf0;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ &.t2 {
|
|
|
+ background: #19be6b;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .st-content {
|
|
|
+ height: 0;
|
|
|
+ transition: 1s;
|
|
|
+ overflow: hidden;
|
|
|
+ .st-text {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+ &.show {
|
|
|
+ height: 800px;
|
|
|
+ .st-text {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.st-text {
|
|
|
position: absolute;
|
|
|
bottom: 1px;
|