|
|
|
|
@ -54,28 +54,31 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="form.type===4" v-slot:url>
|
|
|
|
|
<template v-if="form.type===4 || form.type===1" v-slot:url>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>资讯链接:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-input v-model="form.url" placeholder="请输入跳转链接,例:/news/2025-07-02/146.html" clearable
|
|
|
|
|
style="width: 100%;"></el-input>
|
|
|
|
|
<el-select filterable remote v-model="form.url" :remote-method="remoteMethod" :loading="loading"
|
|
|
|
|
placeholder="请输入关键词查询资讯" clearable style="width: 100%;">
|
|
|
|
|
<el-option v-for="item in zixunList" :key="item.id" :label="item.title" :value="item.titleurl">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- <template v-slot:date>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>日期:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-date-picker v-model="form.date" style="width: 100%;"
|
|
|
|
|
type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期时间" align="right">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<!-- <template v-slot:date>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>日期:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-date-picker v-model="form.date" style="width: 100%;"
|
|
|
|
|
type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" placeholder="选择日期时间" align="right">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template> -->
|
|
|
|
|
<template v-slot:start_time>
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
@ -83,10 +86,8 @@
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>开始时间:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-date-picker v-model="form.start_time"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
type="datetime" placeholder="选择日期时间" align="right"
|
|
|
|
|
<el-date-picker v-model="form.start_time" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择日期时间" align="right"
|
|
|
|
|
:picker-options="pickerOptions">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
@ -98,16 +99,14 @@
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>截止时间:
|
|
|
|
|
</div>
|
|
|
|
|
<div class="xy-table-item-content">
|
|
|
|
|
<el-date-picker v-model="form.end_time"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
type="datetime" placeholder="选择日期时间" align="right"
|
|
|
|
|
<el-date-picker v-model="form.end_time" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择日期时间" align="right"
|
|
|
|
|
:picker-options="pickerOptions">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:content v-if="form.type===3 || form.type===4">
|
|
|
|
|
<template v-slot:content v-if="form.type===3">
|
|
|
|
|
<div class="xy-table-item">
|
|
|
|
|
<div class="xy-table-item-label" style="font-weight: bold">
|
|
|
|
|
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>内容:
|
|
|
|
|
@ -141,7 +140,7 @@
|
|
|
|
|
return {
|
|
|
|
|
isShow: false,
|
|
|
|
|
type: 'add',
|
|
|
|
|
id: '',
|
|
|
|
|
id: '',
|
|
|
|
|
showTinymce: false,
|
|
|
|
|
pickerOptions: {
|
|
|
|
|
shortcuts: [{
|
|
|
|
|
@ -166,21 +165,22 @@
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
type_options: [{
|
|
|
|
|
id: 1,
|
|
|
|
|
value: '课程'
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// id: 2,
|
|
|
|
|
// value: '课表'
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
value: '自定义事件'
|
|
|
|
|
}, {
|
|
|
|
|
id: 4,
|
|
|
|
|
value: '资讯'
|
|
|
|
|
}],
|
|
|
|
|
course_content_options:[],
|
|
|
|
|
id: 1,
|
|
|
|
|
value: '课程'
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// id: 2,
|
|
|
|
|
// value: '课表'
|
|
|
|
|
// },
|
|
|
|
|
{
|
|
|
|
|
id: 3,
|
|
|
|
|
value: '自定义事件'
|
|
|
|
|
}, {
|
|
|
|
|
id: 4,
|
|
|
|
|
value: '资讯'
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
course_content_options: [],
|
|
|
|
|
course_options: [],
|
|
|
|
|
canSelect: false,
|
|
|
|
|
form: {
|
|
|
|
|
@ -191,7 +191,7 @@
|
|
|
|
|
url: '',
|
|
|
|
|
// date: '',
|
|
|
|
|
start_time: '',
|
|
|
|
|
end_time: '',
|
|
|
|
|
end_time: '',
|
|
|
|
|
content: '',
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
@ -203,17 +203,52 @@
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择开始时间'
|
|
|
|
|
}],
|
|
|
|
|
end_time: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择结束时间'
|
|
|
|
|
}],
|
|
|
|
|
}
|
|
|
|
|
// end_time: [{
|
|
|
|
|
// required: true,
|
|
|
|
|
// message: '请选择结束时间'
|
|
|
|
|
// }],
|
|
|
|
|
},
|
|
|
|
|
zixunList:[],
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getCourseList()
|
|
|
|
|
this.getCourseList()
|
|
|
|
|
this.getZxList()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
remoteMethod(query) {
|
|
|
|
|
if (query !== '') {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.getZxList(query)
|
|
|
|
|
} else {
|
|
|
|
|
this.zixunList = [];
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getZxList(query) {
|
|
|
|
|
const proUrl = `${process.env.VUE_APP_PRO_API}`
|
|
|
|
|
var baseUrl = proUrl + '/e/extend/news.php'
|
|
|
|
|
try {
|
|
|
|
|
// 直接调用 axios.get(),传入接口地址和参数
|
|
|
|
|
const response = await axios.get(baseUrl, {
|
|
|
|
|
params: {
|
|
|
|
|
page: 1,
|
|
|
|
|
pagesize: 999,
|
|
|
|
|
keyword: query
|
|
|
|
|
}, // GET 参数(拼在 URL 后)
|
|
|
|
|
timeout: 5000 // 超时时间(毫秒)
|
|
|
|
|
});
|
|
|
|
|
// 请求成功,存储结果
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
this.zixunList = response.data.rows;
|
|
|
|
|
}
|
|
|
|
|
this.loading = false
|
|
|
|
|
console.log('GET 请求成功:', response);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
// 请求失败,处理错误
|
|
|
|
|
console.error('GET 请求失败:', error);
|
|
|
|
|
alert('请求失败:' + (error.response?.data?.msg || '网络错误'));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getCourseList() {
|
|
|
|
|
const res = await courseIndex({
|
|
|
|
|
page: 1,
|
|
|
|
|
@ -239,44 +274,45 @@
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.course_content_options = res.data
|
|
|
|
|
},
|
|
|
|
|
saveContent(e) {
|
|
|
|
|
this.form.content = e
|
|
|
|
|
},
|
|
|
|
|
saveContent(e) {
|
|
|
|
|
this.form.content = e
|
|
|
|
|
},
|
|
|
|
|
changeType(e) {
|
|
|
|
|
console.log("type", e)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
changeCourse(e) {
|
|
|
|
|
console.log("course", e)
|
|
|
|
|
console.log("course", e)
|
|
|
|
|
// 获取课表
|
|
|
|
|
if (this.form.type == 2) {
|
|
|
|
|
this.form.course_content_id = ''
|
|
|
|
|
this.getCourseContentList(e)
|
|
|
|
|
}
|
|
|
|
|
// 选择课程 自动填充
|
|
|
|
|
if(this.form.type==1){
|
|
|
|
|
this.course_options.map(item=>{
|
|
|
|
|
if(item.id===e){
|
|
|
|
|
this.form.title = item.name
|
|
|
|
|
this.form.start_time = item.start_date
|
|
|
|
|
this.form.end_time = item.end_date
|
|
|
|
|
}
|
|
|
|
|
// 选择课程 自动填充
|
|
|
|
|
if (this.form.type == 1) {
|
|
|
|
|
this.course_options.map(item => {
|
|
|
|
|
if (item.id === e) {
|
|
|
|
|
this.form.title = item.name
|
|
|
|
|
this.form.start_time = item.start_date?item.start_date+' 00:00:00':''
|
|
|
|
|
this.form.end_time = item.end_date?item.end_date+' 00:00:00':''
|
|
|
|
|
this.form.date = item.start_date
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.form.url = item.url
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeCourseContent(e) {
|
|
|
|
|
// 选择课表 自动填充
|
|
|
|
|
if(this.form.type==2){
|
|
|
|
|
this.course_content_options.map(item=>{
|
|
|
|
|
if(item.id===e){
|
|
|
|
|
this.form.title = item.theme
|
|
|
|
|
// 选择课表 自动填充
|
|
|
|
|
if (this.form.type == 2) {
|
|
|
|
|
this.course_content_options.map(item => {
|
|
|
|
|
if (item.id === e) {
|
|
|
|
|
this.form.title = item.theme
|
|
|
|
|
this.form.start_time = item.start_date
|
|
|
|
|
this.form.end_time = item.end_date
|
|
|
|
|
this.form.date = item.start_date
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.form.end_time = item.end_date
|
|
|
|
|
this.form.date = item.start_date
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
submit() {
|
|
|
|
|
@ -310,24 +346,24 @@
|
|
|
|
|
watch: {
|
|
|
|
|
isShow(newVal) {
|
|
|
|
|
if (newVal) {
|
|
|
|
|
if (this.type === 'editor') {
|
|
|
|
|
console.log("id",this.id)
|
|
|
|
|
if (this.type === 'editor') {
|
|
|
|
|
console.log("id", this.id)
|
|
|
|
|
this.getDetail()
|
|
|
|
|
}else{
|
|
|
|
|
this.showTinymce = true
|
|
|
|
|
} else {
|
|
|
|
|
this.showTinymce = true
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.id = ''
|
|
|
|
|
this.showTinymce = false
|
|
|
|
|
this.form = {
|
|
|
|
|
type: '',
|
|
|
|
|
course_id: '',
|
|
|
|
|
course_content_id: '',
|
|
|
|
|
title: '',
|
|
|
|
|
url: '',
|
|
|
|
|
date: '',
|
|
|
|
|
start_time: '',
|
|
|
|
|
end_time: '',
|
|
|
|
|
type: '',
|
|
|
|
|
course_id: '',
|
|
|
|
|
course_content_id: '',
|
|
|
|
|
title: '',
|
|
|
|
|
url: '',
|
|
|
|
|
date: '',
|
|
|
|
|
start_time: '',
|
|
|
|
|
end_time: '',
|
|
|
|
|
content: '',
|
|
|
|
|
}
|
|
|
|
|
this.$refs['dialog'].reset()
|
|
|
|
|
|