Commit 7d41f37e by Lyan

页面入口

parent 92ac8b8b
......@@ -469,6 +469,12 @@ img {
.el-select,.el-date-editor{
width: 100%;
}
.edui-editor{
z-index: 1!important;
}
.edui-editor-iframeholder{
min-height: 300px!important;
}
}
.el-form-item{
margin-bottom:32px;
......@@ -582,6 +588,7 @@ img {
}
}
}
}
}
}
......
......@@ -36,11 +36,19 @@ const mainRoutes = {
// 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理!
{ path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } },
{ path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } },
{ path: '/picture-add-or-update', component: _import('modules/info/picture-add-or-update'), name: 'picture-add-or-update', meta: { title: '图片资讯管理', isTab: true } },
{ path: '/news-add-or-update', component: _import('modules/info/news-add-or-update'), name: 'news-add-or-update', meta: { title: '文章管理', isTab: true } },
{ path: '/indexcarouselmanage-add-or-update', component: _import('modules/info/indexcarouselmanage-add-or-update'), name: 'indexcarouselmanage-add-or-update', meta: { title: '首页轮播管理', isTab: true } },
{ path: '/newtopic-add-or-update', component: _import('modules/info/newtopic-add-or-update'), name: 'newtopic-add-or-update', meta: { title: '深度专题管理', isTab: true } },
{ path: '/newsmovie-add-or-update', component: _import('modules/info/newsmovie-add-or-update'), name: 'newsmovie-add-or-update', meta: { title: '视频管理', isTab: true } }
{ path: '/picture-add-or-update', component: _import('modules/info/picture-add-or-update'), name: 'picture-add-or-update', meta: { title: '图片资讯添加/编辑', isTab: true } },
{ path: '/news-add-or-update', component: _import('modules/info/news-add-or-update'), name: 'news-add-or-update', meta: { title: '文章添加/编辑', isTab: true } },
{ path: '/indexcarouselmanage-add-or-update', component: _import('modules/info/indexcarouselmanage-add-or-update'), name: 'indexcarouselmanage-add-or-update', meta: { title: '首页轮播添加/编辑', isTab: true } },
{ path: '/newtopic-add-or-update', component: _import('modules/info/newtopic-add-or-update'), name: 'newtopic-add-or-update', meta: { title: '深度专题添加/编辑', isTab: true } },
{ path: '/newsmovie-add-or-update', component: _import('modules/info/newsmovie-add-or-update'), name: 'newsmovie-add-or-update', meta: { title: '视频添加/编辑', isTab: true } },
{ path: '/medical-add-or-update', component: _import('modules/medical/medical-add-or-update'), name: 'medical-add-or-update', meta: { title: '医疗添加/编辑', isTab: true } },
{ path: '/logistics-add-or-update', component: _import('modules/logistics/logistics-add-or-update'), name: 'logistics-add-or-update', meta: { title: '物流添加/编辑', isTab: true } },
{ path: '/center-add-or-update', component: _import('modules/party/center-add-or-update'), name: 'center-add-or-update', meta: { title: '中央和总局精神添加/编辑', isTab: true } },
{ path: '/topicnews-add-or-update', component: _import('modules/party/topicnews-add-or-update'), name: 'topicnews-add-or-update', meta: { title: '活动报道/编辑', isTab: true } },
{ path: '/rules-add-or-update', component: _import('modules/party/rules-add-or-update'), name: 'rules-add-or-update', meta: { title: '规章制度添加/编辑', isTab: true } },
{ path: '/hotFlow-add-or-update', component: _import('modules/party/hotFlow-add-or-update'), name: 'hotFlow-add-or-update', meta: { title: '热点关注添加/编辑', isTab: true } },
{ path: '/policy-add-or-update', component: _import('modules/policy/policy-add-or-update'), name: 'policy-add-or-update', meta: { title: '政策法规添加/编辑', isTab: true } }
],
beforeEnter (to, from, next) {
let token = Vue.cookie.get('token')
......
......@@ -81,7 +81,182 @@ export const menuData = {
'list': null
}
]
},
{
'menuId': 7,
'parentId': 1,
'parentName': null,
'name': '物流管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'suoding',
'orderNum': 0,
'open': null,
'list': [
{
'menuId': 8,
'parentId': 1,
'parentName': null,
'name': '物流管理',
'url': 'logistics/logistics',
'perms': 'manage:logistics:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
}
]
},
{
'menuId': 9,
'parentId': 1,
'parentName': null,
'name': '医疗管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'suoding',
'orderNum': 0,
'open': null,
'list': [
{
'menuId': 10,
'parentId': 1,
'parentName': null,
'name': '医疗管理',
'url': 'medical/medical',
'perms': 'manage:logistics:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
}
]
},
{
'menuId': 11,
'parentId': 1,
'parentName': null,
'name': '党办资讯管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'suoding',
'orderNum': 0,
'open': null,
'list': [
{
'menuId': 12,
'parentId': 1,
'parentName': null,
'name': '规章制度',
'url': 'party/rules',
'perms': 'manage:logistics:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
},
{
'menuId': 13,
'parentId': 1,
'parentName': null,
'name': '中央和总局精神',
'url': 'party/center',
'perms': 'manage:logistics:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
},
{
'menuId': 14,
'parentId': 1,
'parentName': null,
'name': '活动报道',
'url': 'party/topicnews',
'perms': 'manage:logistics:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
},
{
'menuId': 15,
'parentId': 1,
'parentName': null,
'name': '热点关注',
'url': 'party/hotFlow',
'perms': 'manage:logistics:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
}
]
},
{
'menuId': 16,
'parentId': 1,
'parentName': null,
'name': '政策法规管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'suoding',
'orderNum': 0,
'open': null,
'list': [
{
'menuId': 17,
'parentId': 1,
'parentName': null,
'name': '政策法规管理',
'url': 'policy/policy',
'perms': 'manage:policy:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
}
]
},
{
'menuId': 18,
'parentId': 1,
'parentName': null,
'name': '标准服务提供商管理',
'url': null,
'perms': null,
'type': 0,
'icon': 'suoding',
'orderNum': 0,
'open': null,
'list': [
{
'menuId': 19,
'parentId': 1,
'parentName': null,
'name': '提供商管理',
'url': 'service/partners',
'perms': 'manage:logistics:save',
'type': 1,
'icon': null,
'orderNum': 1,
'open': null,
'list': null
}
]
}
],
permissions: [
'manage:picture:save',
......
......@@ -111,7 +111,7 @@
left: 0;
.site-content__wrapper{
width: 1440px;
width: 100%;
background-image: url(~@/assets/img/u0.gif);
background-size: 100% 100%;
min-height: 0;
......
......@@ -28,7 +28,7 @@
width="100%" height="100%" frameborder="0" scrolling="yes">
</iframe>
<keep-alive v-else>
<router-view v-if="item.name === mainTabsActiveName" :key="key" />
<router-view v-if="item.name === mainTabsActiveName" />
</keep-alive>
</el-card>
</el-tab-pane>
......@@ -36,7 +36,7 @@
<!-- 主入口标签页 e -->
<el-card v-else :body-style="siteContentViewHeight" >
<keep-alive>
<router-view :key="key" />
<router-view />
</keep-alive>
</el-card>
</main>
......
......@@ -82,18 +82,16 @@
methods: {
// 路由操作
routeHandle (route) {
console.log(332323)
console.log(route)
if (route.meta.isTab) {
// tab选中, 不存在先添加
var tab = this.mainTabs.filter(item => item.name === route.name)[0]
if (!tab) {
// if (route.meta.isDynamic) {
// route = this.dynamicMenuRoutes.filter(item => item.name === route.name)[0]
// if (!route) {
// return console.error('未能找到可用标签页!')
// }
// }
if (route.meta.isDynamic) {
route = this.dynamicMenuRoutes.filter(item => item.name === route.name)[0]
if (!route) {
return console.error('未能找到可用标签页!')
}
}
tab = {
menuId: route.meta.menuId || route.name,
name: route.name,
......@@ -103,11 +101,7 @@
params: route.params,
query: route.query
}
console.log(232323)
console.log(tab)
console.log(this.mainTabs)
this.mainTabs = this.mainTabs.concat(tab)
console.log(this.mainTabs)
}
this.menuActiveName = tab.menuId + ''
this.mainTabsActiveName = tab.name
......
......@@ -3,10 +3,10 @@
<div class="title">首页轮播图管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题'></el-input>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small"></el-input>
</el-form-item>
<el-form-item label='状态' prop='status'>
<el-select v-model="dataForm.status" placeholder="请选择状态">
<el-select v-model="dataForm.status" placeholder="请选择状态" size="small">
<el-option
v-for="item in statusList"
:key="item.value"
......@@ -16,7 +16,7 @@
</el-select>
</el-form-item>
<el-form-item label='类别' prop='classnum'>
<el-select v-model="dataForm.classnum" placeholder="请选择类别">
<el-select v-model="dataForm.classnum" placeholder="请选择类别" size="small">
<el-option
v-for="item in classnumList"
:key="item.value"
......@@ -25,8 +25,8 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label='级别' prop='pictureLevel'>
<el-select v-model="dataForm.pictureLevel" placeholder="请输入级别">
<el-form-item label='级别' prop='levels' size="small">
<el-select v-model="dataForm.levels" placeholder="请输入级别">
<el-option
v-for="item in levelList"
:key="item"
......@@ -35,7 +35,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label='发布日期' prop='releaseDate'>
<el-form-item label='发布日期' prop='releaseDate' size="small">
<el-date-picker
size="small"
v-model="releaseDate"
......@@ -61,12 +61,14 @@
prop="levels"
header-align="center"
align="center"
width="50px"
label="等级">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
:show-overflow-tooltip="true"
label="标题">
</el-table-column>
<el-table-column
......@@ -85,12 +87,14 @@
prop="starttimeIndex"
header-align="center"
align="center"
:show-overflow-tooltip="true"
sortable
label="首页添加时间">
</el-table-column>
<el-table-column
prop="updatetimeIndex"
header-align="center"
:show-overflow-tooltip="true"
align="center"
sortable
label="首页修改时间">
......@@ -198,7 +202,7 @@
label: '小轮播'
}
],
releaseDate: ''
releaseDate: []
}
},
activated () {
......@@ -330,4 +334,7 @@
.el-table .cell, .el-table th div {
padding-right: 0;
}
.add-btn>.el-button{
width: 135px!important;
}
</style>
\ No newline at end of file
......@@ -94,7 +94,7 @@
</template>
<script>
import Ueditor from './temps/ueditor'
import Ueditor from '../temps/ueditor'
export default {
components: {
Ueditor
......@@ -179,27 +179,20 @@
title: ''
}
},
watch: {
areaId: {
handler (newVal, oldVal) {
if (this.$refs.cascader) {
var children = this.$refs.cascader.getCheckedNodes()
if (children[0].children.length < 1) {
this.$refs.cascader.dropDownVisible = false
}
}
}
}
},
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
} else {
this.clearInp()
}
this.title = !this.$route.query.id ? '添加文章' : '修改文章'
},
created () {
this.getClassList([])
},
mounted () {
// this.ueditor.value = this.dataForm.content
},
methods: {
init (id) {
this.dataForm.id = id || 0
......@@ -257,7 +250,7 @@
'levels': this.dataForm.levels,
'directpath': this.dataForm.directpath,
'pic': this.dataForm.pic,
'content': this.$refs.ue.getUEContent(),
'content': this.dataForm.content,
'classid': this.dataForm.classid,
'cclassid': this.dataForm.cclassid,
'ishead': this.dataForm.ishead,
......@@ -350,7 +343,14 @@
this.$refs['dataForm'].resetFields()
this.imgUrlStr = ''
this.dialogVisible = false
this.$refs.ue.setClearUEContent('')
this.ueditor.value = ''
},
// 更新父子组件内容
editorReady (instance) {
instance.setContent(this.dataForm.content)
instance.addListener('contentChange', () => {
this.dataForm.content = instance.getContent()
})
}
}
}
......
......@@ -24,8 +24,8 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label='级别' prop='pictureLevel'>
<el-select v-model="dataForm.pictureLevel" placeholder="请输入级别" size="small">
<el-form-item label='级别' prop='levels'>
<el-select v-model="dataForm.levels" placeholder="请输入级别" size="small">
<el-option
v-for="item in piclevelList"
:key="item"
......@@ -66,7 +66,7 @@
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
>
<el-table-column
prop="levels"
header-align="center"
......@@ -171,7 +171,13 @@
data () {
return {
dataForm: {
key: ''
'title': '',
'levels': '',
'author': '',
'editor': '',
'keyword': '',
'status': '',
'auditor': ''
},
dataList: [],
pageIndex: 1,
......@@ -194,8 +200,8 @@
}
],
piclevelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
updateDate: '',
releaseDate: ''
updateDate: [],
releaseDate: []
}
},
activated () {
......
......@@ -10,8 +10,8 @@
<el-form-item label="跳转至:" prop="directpath">
<el-input v-model="dataForm.directpath" placeholder="请输入跳转地址"></el-input>
</el-form-item>
<el-form-item label="子类" prop="newtmpid">
<el-select v-model="dataForm.classid" @change="getClassList([dataForm.classid])" style='width:121px!important'>
<el-form-item label="子类" prop="classid">
<el-select v-model="dataForm.classid">
<el-option
v-for="item in classidList"
:key="item.id"
......@@ -21,12 +21,12 @@
</el-select>
</el-form-item>
<el-form-item label="专题模板" prop="newtmpid">
<el-select v-model="dataForm.classid" style='width:121px!important'>
<el-select v-model="dataForm.newtmpid" >
<el-option
v-for="item in classidList"
:key="item.id"
:label="item.name"
:value="item.id">
v-for="(item, i) in newtmList"
:key="i"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
......@@ -61,11 +61,11 @@
</el-upload>
</el-form-item>
<el-form-item label="专题简介:" prop="brief">
<el-input type="textarea" v-model="dataForm.brief" placeholder="请输入简介"></el-input>
<el-form-item label="专题简介:" prop="shortcontent">
<el-input type="textarea" v-model="dataForm.shortcontent" placeholder="请输入简介"></el-input>
</el-form-item>
<el-form-item label="头部内容:" prop="brief">
<el-input type="textarea" v-model="dataForm.brief" placeholder="请输入简介"></el-input>
<el-form-item label="头部内容:" prop="headad">
<el-input type="textarea" v-model="dataForm.headad" placeholder="请输入简介"></el-input>
</el-form-item>
<el-form-item label="专题描述:" prop="content" >
<Ueditor :value="ueditor.value" :config="ueditor.config" ref="ue"></Ueditor>
......@@ -83,7 +83,7 @@
</template>
<script>
import Ueditor from './temps/ueditor'
import Ueditor from '../temps/ueditor'
export default {
components: {
Ueditor
......@@ -97,20 +97,15 @@
dataForm: {
id: 0,
title: '',
titleOld: '',
keyword: '',
brief: '',
author: '',
source: '',
levels: '',
directpath: '',
pic: '',
content: '',
ishead: '1',
showtime: '',
classid: '',
cclassid: '',
cclassname: ''
newtmpid: '',
levels: '',
showtime: '',
ppath: '',
content: '',
shortcontent: '',
headad: ''
},
cclassidStr: undefined,
dataRule: {
......@@ -120,25 +115,19 @@
titleOld: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
keyword: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
brief: [
headad: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
author: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
source: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
levels: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
directpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
pic: [
ppic: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// content: [
......@@ -147,10 +136,10 @@
classid: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
ishead: [
showtime: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
showtime: [
shortcontent: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
},
......@@ -165,30 +154,29 @@
id: [],
classidList: [],
cclassidList: [],
newtmList: [
{
label: '蓝色魅力',
value: 1
}
],
title: ''
}
},
watch: {
areaId: {
handler (newVal, oldVal) {
if (this.$refs.cascader) {
var children = this.$refs.cascader.getCheckedNodes()
if (children[0].children.length < 1) {
this.$refs.cascader.dropDownVisible = false
}
}
}
}
},
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
}
this.title = !this.$route.query.id ? '添加文章' : '修改文章'
this.title = !this.$route.query.id ? '添加深度专题' : '修改深度专题'
},
created () {
this.getClassList([])
},
mounted () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
}
},
methods: {
init (id) {
this.dataForm.id = id || 0
......@@ -201,28 +189,19 @@
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.title = data.news.title
this.dataForm.titleOld = data.news.titleOld
this.dataForm.keyword = data.news.keyword
this.dataForm.brief = data.news.brief
this.dataForm.author = data.news.author
this.dataForm.source = data.news.source
this.dataForm.levels = data.news.levels
this.dataForm.directpath = data.news.directpath
this.dataForm.pic = data.news.pic
this.dataForm.content = data.news.content
let classArr = []
if (data.news.cclassid === '' || data.news.cclassid === null) {
classArr.push(data.news.classid)
} else {
classArr.push(data.news.classid)
classArr.push(data.news.cclassid)
}
this.cclassidArr = classArr
this.dataForm.ishead = data.news.ishead
this.dataForm.showtime = data.news.showtime
this.imgUrlStr = data.news.pic
this.dataForm = data.newtopic
// this.dataForm.title = data.newtopic.title
// this.dataForm.headad = data.newtopic.headad
// this.dataForm.directpath = data.newtopic.directpath
// this.dataForm.ppath = data.newtopic.ppath
// this.dataForm.content = data.newtopic.content
// this.dataForm.shortcontent = data.newtopic.shortcontent
// this.dataForm.showtime = data.newtopic.showtime
// this.dataForm.newtmpid = data.newtopic.newtmpid
// this.dataForm.classid = data.newtopic.classid
this.imgUrlStr = data.newtopic.ppath
this.dialogVisible = true
this.$refs.ue.setClearUEContent(data.newtopic.content)
}
})
}
......@@ -238,18 +217,14 @@
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'title': this.dataForm.title,
'titleOld': this.dataForm.titleOld,
'keyword': this.dataForm.keyword,
'brief': this.dataForm.brief,
'author': this.dataForm.author,
'source': this.dataForm.source,
'levels': this.dataForm.levels,
'directpath': this.dataForm.directpath,
'pic': this.dataForm.pic,
'content': this.$refs.ue.getUEContent(),
'classid': this.dataForm.classid,
'cclassid': this.dataForm.cclassid,
'ishead': this.dataForm.ishead,
'newtmpid': this.dataForm.newtmpid,
'headad': this.dataForm.headad,
'levels': this.dataForm.levels,
'ppath': this.dataForm.ppath,
'content': this.dataForm.content,
'shortcontent': this.dataForm.shortcontent,
'showtime': this.dataForm.showtime
})
}).then(({data}) => {
......@@ -273,7 +248,7 @@
// 获取栏目列表
getClassList (id) {
this.$http({
url: this.$http.adornUrl(`/office/newtopic/getNewsClassList`),
url: this.$http.adornUrl(`/office/newsclass/getNewsClassList`),
method: 'post',
data: id
}).then(({data}) => {
......@@ -321,7 +296,7 @@
})
.then(res => {
console.log(res)
this.dataForm.pic = res.data.data
this.dataForm.ppath = res.data.data
}).catch(err => {
console.log(err)
})
......@@ -340,6 +315,13 @@
this.imgUrlStr = ''
this.dialogVisible = false
this.$refs.ue.setClearUEContent('')
},
// 更新父子组件内容
editorReady (instance) {
instance.setContent(this.dataForm.content)
instance.addListener('contentChange', () => {
this.dataForm.content = instance.getContent()
})
}
}
}
......
......@@ -15,8 +15,8 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label='级别' prop='pictureLevel'>
<el-select v-model="dataForm.pictureLevel" placeholder="请输入级别">
<el-form-item label='级别' prop='levels'>
<el-select v-model="dataForm.levels" placeholder="请输入级别">
<el-option
v-for="item in levelList"
:key="item"
......@@ -25,7 +25,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label='发布日期' prop='releaseDate'>
<el-form-item label='发布日期' prop='releaseDate' >
<el-date-picker
size="small"
v-model="releaseDate"
......@@ -80,12 +80,6 @@
label="发布时间">
</el-table-column>
<el-table-column
prop="keyword"
header-align="center"
align="center"
label="关键字">
</el-table-column>
<el-table-column
prop="editor"
header-align="center"
align="center"
......@@ -177,7 +171,7 @@
}
],
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
releaseDate: ''
releaseDate: []
}
},
activated () {
......@@ -186,13 +180,14 @@
methods: {
// 获取数据列表
getDataList () {
console.log(this.releaseDate[0])
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/newtopic/list'),
method: 'post',
data: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'page': this.pageIndex + '',
'limit': this.pageSize + '',
'title': this.dataForm.title,
'status': this.dataForm.status,
'levels': this.dataForm.levels,
......@@ -228,7 +223,7 @@
// 新增 / 修改
addOrUpdateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'newstopic-add-or-update', query: {id: id}})
this.$router.push({name: 'newtopic-add-or-update', query: {id: id}})
})
},
// 删除
......@@ -260,6 +255,42 @@
}
})
})
},
// 审核
checkHandle (id, status) {
let str = ''
if (status === 1) {
str = '成功'
} else {
str = '失败'
}
this.$confirm(`确定对[id=${id}]进行['审核${str}']操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/newtopic/verify'),
method: 'post',
data: this.$http.adornData({
'id': id,
'status': status
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
......
......@@ -34,7 +34,7 @@
<el-form-item label='级别' prop='pictureLevel'>
<el-select v-model="dataForm.pictureLevel" placeholder="请输入级别" size="small">
<el-option
v-for="item in piclevelList"
v-for="item in pictureLevel"
:key="item"
:label="item"
:value="item">
......@@ -147,14 +147,14 @@
label: '成功'
}
],
piclevelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
pictureLevel: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
pictureTypeList: [
{
value: '1',
label: '图片信息'
}
],
releaseDate: ''
releaseDate: []
}
},
......
<template>
<div class="mod-config">
<div class="title">{{title}}</div>
<div class="form-list">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<div class="base-info">基本信息</div>
<el-form-item label="原始标题:" prop="oldtitle">
<el-input v-model="dataForm.oldtitle" placeholder="请输入显示标题"></el-input>
</el-form-item>
<el-form-item label="显示标题:" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入显示标题"></el-input>
</el-form-item>
<el-form-item label='类别:' prop='type'>
<el-select v-model="dataForm.type" placeholder="请输入级别" size="small">
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.typeName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label='级别:' prop='level'>
<el-select v-model="dataForm.level" placeholder="请输入级别">
<el-option
v-for="item in levelList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="跳转至:" prop="jumpath">
<el-input v-model="dataForm.jumpath" placeholder="请输入跳转地址"></el-input>
</el-form-item>
<el-form-item label="关键字:" prop="keyword">
<el-input v-model="dataForm.keyword" placeholder="请输入关键字"></el-input>
</el-form-item>
<el-form-item label="稿源:" prop="source">
<el-input v-model="dataForm.source" placeholder="请输入稿源"></el-input>
</el-form-item>
<el-form-item label="作者:" prop="author">
<el-input v-model="dataForm.author" placeholder="请输入作者"></el-input>
</el-form-item>
<el-form-item label="发布日期" prop="releasetime">
<el-date-picker
v-model="dataForm.releasetime"
value-format='yyyy-MM-dd'
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="实施日期" prop="implementationtime">
<el-date-picker
v-model="dataForm.implementationtime"
value-format='yyyy-MM-dd'
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="备注:" prop="remarks">
<el-input type="textarea" v-model="dataForm.remarks" placeholder="请输入简介"></el-input>
</el-form-item>
<el-form-item label="内容:" prop="content" >
<Ueditor @ready="editorReady" :value="ueditor.value" :config="ueditor.config" ref="ue"></Ueditor>
<!-- <el-input v-model="dataForm.content" placeholder="请输入内容"></el-input> -->
</el-form-item>
</el-form>
</div>
<div class="sub-btn">
<span slot='footer' class='dialog-footer'>
<el-button @click='clearInp()'>重置</el-button>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button>
</span>
</div>
</div>
</template>
<script>
import Ueditor from '../temps/ueditor'
export default {
components: {
Ueditor
},
data () {
return {
defaultProps: {
children: 'children',
label: 'label'
},
dataForm: {
id: 0,
title: '',
keyword: '',
author: '',
source: '',
level: '',
jumpath: '',
content: '',
releasetime: '',
implementationtime: '',
type: '',
remarks: '',
oldtitle: ''
},
cclassidStr: undefined,
dataRule: {
oldtitle: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
title: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
level: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
keyword: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
jumpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
author: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
source: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
releasetime: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
implementationtime: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// content: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
remarks: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
},
ueditor: {
value: '',
config: {}
},
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
id: [],
typeList: [
{
id: 1,
typeName: '标准'
},
{
id: 2,
typeName: '指南&案例'
},
{
id: 3,
typeName: '政策法规&行业资讯'
},
{
id: 4,
typeName: '常见问题'
}
],
title: ''
}
},
activated () {
if (this.$route.query.id) {
this.init(this.$route.query.id)
}
this.title = !this.$route.query.id ? '新增' : '修改'
},
created () {
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/office/logistics/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.logistics
this.ueditor.value = this.dataForm.content
}
})
}
})
},
// 更新父子组件内容
editorReady (instance) {
instance.setContent(this.dataForm.content)
instance.addListener('contentChange', () => {
this.dataForm.content = instance.getContent()
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/office/logistics/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'oldtitle': this.dataForm.oldtitle,
'title': this.dataForm.title,
'type': this.dataForm.type,
'keyword': this.dataForm.keyword,
'author': this.dataForm.author,
'source': this.dataForm.source,
'level': this.dataForm.level,
'jumpath': this.dataForm.jumpath,
'content': this.dataForm.content,
'remarks': this.dataForm.remarks,
'releasetime': this.dataForm.releasetime,
'implementationtime': this.dataForm.implementationtime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
clearInp () {
this.$refs['dataForm'].resetFields()
this.imgUrlStr = ''
this.dialogVisible = false
this.$refs.ue.setClearUEContent('')
}
}
}
</script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
<template>
<div class="mod-config mod-list-form">
<div class="title">医疗管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small"></el-input>
</el-form-item>
<el-form-item label='类别' prop='type'>
<el-select v-model="dataForm.type" placeholder="请输入级别" size="small">
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.typeName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label='关键字' prop='keyword'>
<el-input v-model='dataForm.keyword' placeholder='请输入关键字' size="small"></el-input>
</el-form-item>
<el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button v-if="isAuth('manage:news:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button>
</div>
<div class="table-list">
<el-table
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
prop="level"
header-align="center"
align="center"
label="级别">
</el-table-column>
<el-table-column
prop="type"
header-align="center"
align="center"
label="类别">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
label="标题">
</el-table-column>
<el-table-column
prop="author"
header-align="center"
align="center"
label="编辑">
</el-table-column>
<el-table-column
prop="releasetime"
header-align="center"
align="center"
sortable
label="创建日期">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
data () {
return {
dataForm: {
title: '',
type: '',
keyword: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
typeList: [
{
id: 1,
typeName: '标准'
},
{
id: 2,
typeName: '指南&案例'
},
{
id: 3,
typeName: '政策法规&行业资讯'
},
{
id: 4,
typeName: '常见问题'
}
]
}
},
activated () {
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/logistics/list'),
method: 'post',
data: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'title': this.dataForm.title,
'type': this.dataForm.typ,
'keyword': this.dataForm.keyword
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'logistics-add-or-update', query: {id: id}})
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/logistics/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
}
}
}
</script>
<template>
<div class="mod-config">
<div class="title">{{title}}</div>
<div class="form-list">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
<div class="base-info">基本信息</div>
<el-form-item label="标题:" prop="title">
<el-input v-model="dataForm.title" placeholder="请输入显示标题"></el-input>
</el-form-item>
<el-form-item label='类别:' prop='type'>
<el-select v-model="dataForm.type" placeholder="请输入级别" size="small">
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.typeName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label='级别:' prop='level'>
<el-select v-model="dataForm.level" placeholder="请输入级别">
<el-option
v-for="item in levelList"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="跳转至:" prop="jumpath">
<el-input v-model="dataForm.jumpath" placeholder="请输入跳转地址"></el-input>
</el-form-item>
<el-form-item label="关键字:" prop="keyword">
<el-input v-model="dataForm.keyword" placeholder="请输入关键字"></el-input>
</el-form-item>
<el-form-item label="稿源:" prop="source">
<el-input v-model="dataForm.source" placeholder="请输入稿源"></el-input>
</el-form-item>
<el-form-item label="作者:" prop="author">
<el-input v-model="dataForm.author" placeholder="请输入作者"></el-input>
</el-form-item>
<el-form-item label="发布日期" prop="releasetime">
<el-date-picker
v-model="dataForm.releasetime"
value-format='yyyy-MM-dd'
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="实施日期" prop="implementationtime">
<el-date-picker
v-model="dataForm.implementationtime"
value-format='yyyy-MM-dd'
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="备注:" prop="remarks">
<el-input type="textarea" v-model="dataForm.remarks" placeholder="请输入简介"></el-input>
</el-form-item>
<el-form-item label="内容:" prop="content" >
<Ueditor @ready="editorReady" :value="ueditor.value" :config="ueditor.config" ref="ue"></Ueditor>
<!-- <el-input v-model="dataForm.content" placeholder="请输入内容"></el-input> -->
</el-form-item>
</el-form>
</div>
<div class="sub-btn">
<span slot='footer' class='dialog-footer'>
<el-button @click='clearInp()'>重置</el-button>
<el-button type='primary' @click='dataFormSubmit()'>确定</el-button>
</span>
</div>
</div>
</template>
<script>
import Ueditor from '../temps/ueditor'
export default {
components: {
Ueditor
},
data () {
return {
defaultProps: {
children: 'children',
label: 'label'
},
dataForm: {
id: 0,
title: '',
keyword: '',
author: '',
source: '',
level: '',
jumpath: '',
content: '',
releasetime: '',
implementationtime: '',
type: '',
remarks: ''
},
cclassidStr: undefined,
dataRule: {
title: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
level: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
keyword: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
jumpath: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
author: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
source: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
releasetime: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
implementationtime: [
{ required: true, message: '不能为空', trigger: 'blur' }
],
// content: [
// { required: true, message: '不能为空', trigger: 'blur' }
// ],
remarks: [
{ required: true, message: '不能为空', trigger: 'blur' }
]
},
ueditor: {
value: '',
config: {}
},
levelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
id: [],
typeList: [],
title: ''
}
},
activated () {
},
created () {
this.getMedicalTypeList()
if (this.$route.query.id) {
this.init(this.$route.query.id)
}
this.title = !this.$route.query.id ? '新增' : '修改'
},
mounted () {
this.clearInp()
},
methods: {
init (id) {
this.dataForm.id = id || 0
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/office/medical/info/${this.dataForm.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.medical
// this.dataForm.title = data.medical
// this.dataForm.keyword = data.news.keyword
// this.dataForm.author = data.news.author
// this.dataForm.source = data.news.source
// this.dataForm.level = data.news.level
// this.dataForm.directpath = data.news.directpath
// this.dataForm.pic = data.news.pic
this.Ueditor.value = this.dataForm.content
}
})
}
})
},
// 更新父子组件内容
editorReady (instance) {
instance.setContent(this.dataForm.content)
instance.addListener('contentChange', () => {
this.dataForm.content = instance.getContent()
})
},
// 表单提交
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/office/medical/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'title': this.dataForm.title,
'type': this.dataForm.type,
'keyword': this.dataForm.keyword,
'author': this.dataForm.author,
'source': this.dataForm.source,
'level': this.dataForm.level,
'jumpath': this.dataForm.jumpath,
'content': this.$refs.ue.getUEContent(),
'remarks': this.dataForm.remarks,
'releasetime': this.dataForm.releasetime,
'implementationtime': this.dataForm.implementationtime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
},
// 获取医疗管理列表
getMedicalTypeList () {
this.$http({
url: this.$http.adornUrl('/office/medical/getMedicalTypeList'),
method: 'get'
}).then(({data}) => {
if (data && data.code === 0) {
this.typeList = data.list
} else {
this.typeList = []
}
})
},
clearInp () {
this.$refs['dataForm'].resetFields()
this.imgUrlStr = ''
this.dialogVisible = false
this.$refs.ue.resetContent()
}
}
}
</script>
<style scoped>
.form-list{
padding-left: 4%!important;
}
.el-form-item__content{
width: 50%;
}
.el-select,.el-input{
width: 241px!important;
}
.edui-editor{
width: 100%;
}
</style>
\ No newline at end of file
<template>
<div class="mod-config mod-list-form">
<div class="title">医疗管理</div>
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label='标题' prop='title'>
<el-input v-model='dataForm.title' placeholder='请输入标题' size="small"></el-input>
</el-form-item>
<el-form-item label='类别' prop='type'>
<el-select v-model="dataForm.type" placeholder="请输入级别" size="small">
<el-option
v-for="item in typeList"
:key="item.id"
:label="item.typeName"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-button class="seach-btn" @click="getDataList()" type="primary" size="small">搜索</el-button>
</el-form>
<div class="add-btn">
<el-button v-if="isAuth('manage:news:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button>
</div>
<div class="table-list">
<el-table
:data="dataList"
v-loading="dataListLoading"
@selection-change="selectionChangeHandle"
style="width: 100%;">
<el-table-column
prop="levels"
header-align="center"
align="center"
label="级别">
</el-table-column>
<el-table-column
prop="type"
header-align="center"
align="center"
label="类别">
</el-table-column>
<el-table-column
prop="title"
header-align="center"
align="center"
label="标题">
</el-table-column>
<el-table-column
prop="editor"
header-align="center"
align="center"
label="编辑">
</el-table-column>
<el-table-column
prop="createDate"
header-align="center"
align="center"
sortable
label="创建日期">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑</el-button>
<el-button type="text" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
</div>
</template>
<script>
export default {
data () {
return {
dataForm: {
title: '',
type: ''
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
dataListSelections: [],
typeList: []
}
},
activated () {
this.getMedicalTypeList()
this.getDataList()
},
methods: {
// 获取数据列表
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.adornUrl('/office/medical/list'),
method: 'post',
data: this.$http.adornParams({
'page': this.pageIndex,
'limit': this.pageSize,
'title': this.dataForm.title,
'type': this.dataForm.type
})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.page.list
this.totalPage = data.page.totalCount
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
},
// 每页数
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
// 当前页
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// 多选
selectionChangeHandle (val) {
this.dataListSelections = val
},
// 新增 / 修改
addOrUpdateHandle (id) {
this.$nextTick(() => {
this.$router.push({name: 'medical-add-or-update', query: {id: id}})
})
},
// 删除
deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/office/medical/delete'),
method: 'post',
data: this.$http.adornData(ids, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
},
// 获取医疗管理列表
getMedicalTypeList () {
this.$http({
url: this.$http.adornUrl('/office/medical/getMedicalTypeList'),
method: 'get'
}).then(({data}) => {
if (data && data.code === 0) {
this.typeList = data.list
} else {
this.typeList = []
}
})
}
}
}
</script>
......@@ -351,6 +351,13 @@
this.imgUrlStr = ''
this.dialogVisible = false
this.$refs.ue.setClearUEContent('')
},
// 更新父子组件内容
editorReady (instance) {
instance.setContent(this.dataForm.content)
instance.addListener('contentChange', () => {
this.dataForm.content = instance.getContent()
})
}
}
}
......
......@@ -7,33 +7,57 @@
<script>
import ueditor from 'ueditor'
export default {
name: 'UE',
data () {
return {
editor: null
editor: null,
instance: null,
ready: false
}
},
props: {
value: '',
config: {}
},
watch: {
value: function (val, oldVal) {
if (val != null && this.ready) {
this.instance = ueditor.getEditor('editor', this.config)
this.instance.setContent(val)
}
}
},
mounted () {
this.ue = ueditor.getEditor('editor', this.config)
// this.ue.addListener('ready', function () { this.ue.setContent(this.value) })
this.initEditor()
},
destroyed () {
this.ue.destroy()
// // 组件销毁的时候,要销毁 UEditor 实例
// if (this.instance !== null && this.instance.destroy) {
// this.instance.destroy()
// }
this.instance = ueditor.delEditor('editor')
this.instance.destroy()
},
methods: {
getUEContent () {
// 获取内容方法
return this.ue.getContent()
initEditor () {
// dom元素已经挂载上去了
this.$nextTick(() => {
this.instance = ueditor.getEditor('editor', this.config)
// 绑定事件,当 UEditor 初始化完成后,将编辑器实例通过自定义的 ready 事件交出去
this.instance.addListener('ready', () => {
this.ready = true
this.$emit('ready', this.instance)
})
})
},
setClearUEContent (text) {
// 获取内容方法
return this.ue.setContent(text)
setText (con) {
this.instance = ueditor.getEditor('editor', this.config)
this.instance.setContent(con)
}
}
}
</script>
<style scoped>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment