flat: 修改些条件
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<basic-container>
|
||||
<jl-go-back></jl-go-back>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<avue-form :option="formOption" v-model="form" @submit="handleSubmit" ref="form">
|
||||
<template slot="policyFileUrl">
|
||||
<basic-container>
|
||||
<jl-go-back></jl-go-back>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<avue-form :option="formOption" v-model="form" @submit="handleSubmit" ref="form">
|
||||
<template slot="policyFileUrl">
|
||||
<div class="policyFileUrlWrapper">
|
||||
<div class="uploadWrapperAb">
|
||||
<el-upload
|
||||
@@ -13,270 +13,273 @@
|
||||
:show-file-list="false"
|
||||
:http-request="allUpload"
|
||||
:multiple="false"
|
||||
><el-button size="small" type="primary">点击上传</el-button></el-upload>
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<avue-input disabled v-model="policyFileUrl" placeholder="点击上传文件"></avue-input>
|
||||
</div>
|
||||
</template>
|
||||
</avue-form>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<Tinymce v-model="form.note" ref="tinymce" style="height: 100%;"></Tinymce>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</basic-container>
|
||||
</template>
|
||||
<script>
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
import { quillEditor } from "vue-quill-editor";
|
||||
|
||||
|
||||
import { addNews, getNewsDetail, editNews } from "@/api/manage/news"
|
||||
import { putFile } from "@/api/resource/oss";
|
||||
import Tinymce from "@/components/Tinymce";
|
||||
import {getClassifyDic} from '@/api/help/article/classify'
|
||||
|
||||
const toolbarItems = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ header: 1 }, { header: 2 }], // 1、2 级标题
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ script: "sub" }, { script: "super" }], // 上标/下标
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
// [{'direction': 'rtl'}], // 文本方向
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ font: [] }], // 字体种类
|
||||
[{ align: [] }], // 对齐方式
|
||||
["clean"], // 清除文本格式
|
||||
["image"], // 链接、图片、视频
|
||||
]
|
||||
export default {
|
||||
components: { quillEditor, Tinymce},
|
||||
props: {
|
||||
id: Number,
|
||||
type: String
|
||||
},
|
||||
mounted() {
|
||||
this.onload()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
policyFileUrl: '',
|
||||
putFile,
|
||||
imageUrl: '',
|
||||
ruleForm: {
|
||||
content: null,
|
||||
},
|
||||
form: {
|
||||
note: ''
|
||||
},
|
||||
description:'',
|
||||
formOption: {
|
||||
// labelWidth:120,
|
||||
column: [
|
||||
{
|
||||
"label": "服务时间",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "createTime",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务时间"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务发起人",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "fromName",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务发起人"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务对象",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "toName",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务对象"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务主题",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "serveTheme",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务主题"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务内容",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "serveContent",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务内容"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "备注1",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "bak1",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入备注1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "政策文件地址",
|
||||
prop: "policyFileUrl",
|
||||
span: 24,
|
||||
labelWidth: 120,
|
||||
hide: true,
|
||||
slot: true,
|
||||
formslot: true,
|
||||
showWordLimit: true,
|
||||
</avue-form>
|
||||
|
||||
},
|
||||
]
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<Tinymce v-model="form.note" ref="tinymce" style="height: 100%;"></Tinymce>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</basic-container>
|
||||
</template>
|
||||
<script>
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
import {quillEditor} from "vue-quill-editor";
|
||||
|
||||
|
||||
import {addNews, getNewsDetail, editNews} from "@/api/manage/news"
|
||||
import {putFile} from "@/api/resource/oss";
|
||||
import Tinymce from "@/components/Tinymce";
|
||||
import {getClassifyDic} from '@/api/help/article/classify'
|
||||
|
||||
const toolbarItems = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{header: 1}, {header: 2}], // 1、2 级标题
|
||||
[{list: "ordered"}, {list: "bullet"}], // 有序、无序列表
|
||||
[{script: "sub"}, {script: "super"}], // 上标/下标
|
||||
[{indent: "-1"}, {indent: "+1"}], // 缩进
|
||||
// [{'direction': 'rtl'}], // 文本方向
|
||||
[{size: ["small", false, "large", "huge"]}], // 字体大小
|
||||
[{header: [1, 2, 3, 4, 5, 6, false]}], // 标题
|
||||
[{color: []}, {background: []}], // 字体颜色、字体背景颜色
|
||||
[{font: []}], // 字体种类
|
||||
[{align: []}], // 对齐方式
|
||||
["clean"], // 清除文本格式
|
||||
["image"], // 链接、图片、视频
|
||||
]
|
||||
export default {
|
||||
components: {quillEditor, Tinymce},
|
||||
props: {
|
||||
id: Number,
|
||||
type: String
|
||||
},
|
||||
mounted() {
|
||||
this.onload()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
policyFileUrl: '',
|
||||
putFile,
|
||||
imageUrl: '',
|
||||
ruleForm: {
|
||||
content: null,
|
||||
},
|
||||
form: {
|
||||
note: ''
|
||||
},
|
||||
description: '',
|
||||
formOption: {
|
||||
// labelWidth:120,
|
||||
column: [
|
||||
{
|
||||
"label": "服务时间",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "createTime",
|
||||
format: "yyyy-MM-dd",
|
||||
valueFormat: "yyyy-MM-dd",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务时间"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务发起人",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "fromName",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务发起人"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务对象",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "toName",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务对象"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务主题",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "serveTheme",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务主题"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务内容",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "serveContent",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务内容"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "备注1",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "bak1",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入备注1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "政策文件地址",
|
||||
prop: "policyFileUrl",
|
||||
span: 24,
|
||||
labelWidth: 120,
|
||||
hide: true,
|
||||
slot: true,
|
||||
formslot: true,
|
||||
showWordLimit: true,
|
||||
|
||||
},
|
||||
editorOption: {
|
||||
modules: {
|
||||
toolbar: {
|
||||
container: toolbarItems,
|
||||
handlers: {
|
||||
'image': function (value) {
|
||||
if (value) {
|
||||
document.querySelector('.avatar-uploader input').click()
|
||||
} else {
|
||||
this.quill.format('image', false);
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
editorOption: {
|
||||
modules: {
|
||||
toolbar: {
|
||||
container: toolbarItems,
|
||||
handlers: {
|
||||
'image': function (value) {
|
||||
if (value) {
|
||||
document.querySelector('.avatar-uploader input').click()
|
||||
} else {
|
||||
this.quill.format('image', false);
|
||||
}
|
||||
},//工具菜单栏配置
|
||||
},
|
||||
placeholder: "请在这里编写文章内容", //提示
|
||||
readyOnly: false, //是否只读
|
||||
theme: "snow", //主题 snow/bubble
|
||||
syntax: true, //语法检测
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 值发生变化
|
||||
onEditorChange(editor) {
|
||||
this.content = editor.html;
|
||||
}
|
||||
}
|
||||
},//工具菜单栏配置
|
||||
},
|
||||
handleSubmit(form, done) {
|
||||
// this.form['note'] = this.$refs.tinymce.getContent()
|
||||
|
||||
if(this.form.note.length>64*512){
|
||||
this.$message.error('文章内容不能超过64KB!');
|
||||
done()
|
||||
}
|
||||
else{
|
||||
if (this.type == 'add') {
|
||||
addNews(
|
||||
this.form.articleTitle,
|
||||
this.form.headPic,
|
||||
this.form.articleSrc,
|
||||
this.form.articleSrcUrl,
|
||||
this.form.author,
|
||||
this.form.description,
|
||||
this.form.note,
|
||||
this.form.type
|
||||
).then(() => {
|
||||
this.$message.success('添加成功');
|
||||
this.$router.go(-1);
|
||||
})
|
||||
}
|
||||
else if (this.type == 'edit') {
|
||||
editNews(
|
||||
this.id,
|
||||
this.form.articleTitle,
|
||||
this.form.headPic,
|
||||
this.form.articleSrc,
|
||||
this.form.articleSrcUrl,
|
||||
this.form.author,
|
||||
this.form.description,
|
||||
this.form.note,
|
||||
this.form.type
|
||||
).then(() => {
|
||||
this.$message.success('修改成功');
|
||||
done()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
/*上传图片*/
|
||||
handleAvatarSuccess(res) {
|
||||
let quill = this.$refs.QuillEditor.quill
|
||||
let length = quill.getSelection().index;//获取光标所在位置
|
||||
quill.insertEmbed(length, 'image', res.data.link)
|
||||
quill.setSelection(length + 1)//光标后移一位
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPG = ["image/png", "image/jpeg", "image/svg+xml", "image/gif"].indexOf(file.type) != -1;
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isJPG) {
|
||||
this.$message.error('上传图片格式不正确');
|
||||
}
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传图片大小不能超过 2MB!');
|
||||
}
|
||||
return isJPG && isLt2M;
|
||||
},
|
||||
onload() {
|
||||
if (this.id && this.type == 'edit') {
|
||||
getNewsDetail(this.id).then(res => {
|
||||
this.form = res.data.data;
|
||||
this.description=this.form.description;
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
placeholder: "请在这里编写文章内容", //提示
|
||||
readyOnly: false, //是否只读
|
||||
theme: "snow", //主题 snow/bubble
|
||||
syntax: true, //语法检测
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.avatar-uploader {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ql-editor {
|
||||
height: 400px;
|
||||
}
|
||||
.policyFileUrlWrapper {
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 值发生变化
|
||||
onEditorChange(editor) {
|
||||
this.content = editor.html;
|
||||
},
|
||||
handleSubmit(form, done) {
|
||||
// this.form['note'] = this.$refs.tinymce.getContent()
|
||||
|
||||
if (this.form.note.length > 64 * 512) {
|
||||
this.$message.error('文章内容不能超过64KB!');
|
||||
done()
|
||||
} else {
|
||||
if (this.type == 'add') {
|
||||
addNews(
|
||||
this.form.articleTitle,
|
||||
this.form.headPic,
|
||||
this.form.articleSrc,
|
||||
this.form.articleSrcUrl,
|
||||
this.form.author,
|
||||
this.form.description,
|
||||
this.form.note,
|
||||
this.form.type
|
||||
).then(() => {
|
||||
this.$message.success('添加成功');
|
||||
this.$router.go(-1);
|
||||
})
|
||||
} else if (this.type == 'edit') {
|
||||
editNews(
|
||||
this.id,
|
||||
this.form.articleTitle,
|
||||
this.form.headPic,
|
||||
this.form.articleSrc,
|
||||
this.form.articleSrcUrl,
|
||||
this.form.author,
|
||||
this.form.description,
|
||||
this.form.note,
|
||||
this.form.type
|
||||
).then(() => {
|
||||
this.$message.success('修改成功');
|
||||
done()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
/*上传图片*/
|
||||
handleAvatarSuccess(res) {
|
||||
let quill = this.$refs.QuillEditor.quill
|
||||
let length = quill.getSelection().index;//获取光标所在位置
|
||||
quill.insertEmbed(length, 'image', res.data.link)
|
||||
quill.setSelection(length + 1)//光标后移一位
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPG = ["image/png", "image/jpeg", "image/svg+xml", "image/gif"].indexOf(file.type) != -1;
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isJPG) {
|
||||
this.$message.error('上传图片格式不正确');
|
||||
}
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传图片大小不能超过 2MB!');
|
||||
}
|
||||
return isJPG && isLt2M;
|
||||
},
|
||||
onload() {
|
||||
if (this.id && this.type == 'edit') {
|
||||
getNewsDetail(this.id).then(res => {
|
||||
this.form = res.data.data;
|
||||
this.description = this.form.description;
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.avatar-uploader {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ql-editor {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.policyFileUrlWrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -286,5 +289,4 @@
|
||||
z-index: 99;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -867,9 +867,9 @@ export default {
|
||||
column: [{
|
||||
label: '服务时间',
|
||||
prop: 'createTime',
|
||||
type: 'datetime',
|
||||
format: "yyyy-MM-dd HH:mm:ss",
|
||||
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
||||
type: 'date',
|
||||
format: "yyyy-MM-dd",
|
||||
valueFormat: "yyyy-MM-dd",
|
||||
}, {
|
||||
label: '服务发起人',
|
||||
prop: 'fromName'
|
||||
|
||||
@@ -51,6 +51,7 @@ export default {
|
||||
dicData: this.depTree,
|
||||
props: {
|
||||
label: "title",
|
||||
value: 'value'
|
||||
},
|
||||
checkStrictly: true,
|
||||
slot: true,
|
||||
|
||||
@@ -140,7 +140,7 @@ import {
|
||||
detail,
|
||||
getDept,
|
||||
removeDept,
|
||||
upload, getDeptMyTree,
|
||||
upload, getDeptMyTree, getDeptAllTree,
|
||||
} from "@/api/tenant/talents";
|
||||
import {getWorkTypes, getLabelList} from "@/api/tenant/common";
|
||||
import {mapGetters} from "vuex";
|
||||
@@ -196,6 +196,7 @@ export default {
|
||||
obj: {},
|
||||
depTree: [],
|
||||
excelForm: {isCovered: 1},
|
||||
AllTree: [],
|
||||
};
|
||||
},
|
||||
components: {addGroups, transferGroups, Resume, ied, TextTooltip},
|
||||
@@ -271,6 +272,7 @@ export default {
|
||||
dicData: this.depTree,
|
||||
props: {
|
||||
label: "title",
|
||||
value: 'value'
|
||||
},
|
||||
checkStrictly: true,
|
||||
span: 24,
|
||||
@@ -489,6 +491,7 @@ export default {
|
||||
dicData: this.depTree,
|
||||
props: {
|
||||
label: "title",
|
||||
value: 'value'
|
||||
},
|
||||
checkStrictly: true,
|
||||
slot: true,
|
||||
@@ -594,11 +597,10 @@ export default {
|
||||
let params = {
|
||||
tenantId: '000000'
|
||||
}
|
||||
let resData = await getDeptMyTree(params)
|
||||
// let resData = await getDeptMyTree(params)
|
||||
let resData = await getDeptAllTree(params)
|
||||
if (resData.data.code === 200) {
|
||||
this.depTree = resData.data.data
|
||||
console.log(this.depTree)
|
||||
|
||||
}
|
||||
},
|
||||
getWorkTypes() {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<basic-container>
|
||||
<jl-go-back></jl-go-back>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<avue-form :option="formOption" v-model="form" @submit="handleSubmit" ref="form">
|
||||
<template slot="policyFileUrl">
|
||||
<basic-container>
|
||||
<jl-go-back></jl-go-back>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<avue-form :option="formOption" v-model="form" @submit="handleSubmit" ref="form">
|
||||
<template slot="policyFileUrl">
|
||||
<div class="policyFileUrlWrapper">
|
||||
<div class="uploadWrapperAb">
|
||||
<el-upload
|
||||
@@ -13,270 +13,273 @@
|
||||
:show-file-list="false"
|
||||
:http-request="allUpload"
|
||||
:multiple="false"
|
||||
><el-button size="small" type="primary">点击上传</el-button></el-upload>
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
</div>
|
||||
<avue-input disabled v-model="policyFileUrl" placeholder="点击上传文件"></avue-input>
|
||||
</div>
|
||||
</template>
|
||||
</avue-form>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<Tinymce v-model="form.note" ref="tinymce" style="height: 100%;"></Tinymce>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</basic-container>
|
||||
</template>
|
||||
<script>
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
import { quillEditor } from "vue-quill-editor";
|
||||
|
||||
|
||||
import { addNews, getNewsDetail, editNews } from "@/api/manage/news"
|
||||
import { putFile } from "@/api/resource/oss";
|
||||
import Tinymce from "@/components/Tinymce";
|
||||
import {getClassifyDic} from '@/api/help/article/classify'
|
||||
|
||||
const toolbarItems = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{ header: 1 }, { header: 2 }], // 1、2 级标题
|
||||
[{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
|
||||
[{ script: "sub" }, { script: "super" }], // 上标/下标
|
||||
[{ indent: "-1" }, { indent: "+1" }], // 缩进
|
||||
// [{'direction': 'rtl'}], // 文本方向
|
||||
[{ size: ["small", false, "large", "huge"] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
[{ font: [] }], // 字体种类
|
||||
[{ align: [] }], // 对齐方式
|
||||
["clean"], // 清除文本格式
|
||||
["image"], // 链接、图片、视频
|
||||
]
|
||||
export default {
|
||||
components: { quillEditor, Tinymce},
|
||||
props: {
|
||||
id: Number,
|
||||
type: String
|
||||
},
|
||||
mounted() {
|
||||
this.onload()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
policyFileUrl: '',
|
||||
putFile,
|
||||
imageUrl: '',
|
||||
ruleForm: {
|
||||
content: null,
|
||||
},
|
||||
form: {
|
||||
note: ''
|
||||
},
|
||||
description:'',
|
||||
formOption: {
|
||||
// labelWidth:120,
|
||||
column: [
|
||||
{
|
||||
"label": "服务时间",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "createTime",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务时间"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务发起人",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "fromName",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务发起人"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务对象",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "toName",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务对象"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务主题",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "serveTheme",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务主题"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务内容",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "serveContent",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务内容"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "备注1",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "bak1",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入备注1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "政策文件地址",
|
||||
prop: "policyFileUrl",
|
||||
span: 24,
|
||||
labelWidth: 120,
|
||||
hide: true,
|
||||
slot: true,
|
||||
formslot: true,
|
||||
showWordLimit: true,
|
||||
</avue-form>
|
||||
|
||||
},
|
||||
]
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<Tinymce v-model="form.note" ref="tinymce" style="height: 100%;"></Tinymce>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</basic-container>
|
||||
</template>
|
||||
<script>
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
import {quillEditor} from "vue-quill-editor";
|
||||
|
||||
|
||||
import {addNews, getNewsDetail, editNews} from "@/api/manage/news"
|
||||
import {putFile} from "@/api/resource/oss";
|
||||
import Tinymce from "@/components/Tinymce";
|
||||
import {getClassifyDic} from '@/api/help/article/classify'
|
||||
|
||||
const toolbarItems = [
|
||||
["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
|
||||
["blockquote", "code-block"], // 引用 代码块
|
||||
[{header: 1}, {header: 2}], // 1、2 级标题
|
||||
[{list: "ordered"}, {list: "bullet"}], // 有序、无序列表
|
||||
[{script: "sub"}, {script: "super"}], // 上标/下标
|
||||
[{indent: "-1"}, {indent: "+1"}], // 缩进
|
||||
// [{'direction': 'rtl'}], // 文本方向
|
||||
[{size: ["small", false, "large", "huge"]}], // 字体大小
|
||||
[{header: [1, 2, 3, 4, 5, 6, false]}], // 标题
|
||||
[{color: []}, {background: []}], // 字体颜色、字体背景颜色
|
||||
[{font: []}], // 字体种类
|
||||
[{align: []}], // 对齐方式
|
||||
["clean"], // 清除文本格式
|
||||
["image"], // 链接、图片、视频
|
||||
]
|
||||
export default {
|
||||
components: {quillEditor, Tinymce},
|
||||
props: {
|
||||
id: Number,
|
||||
type: String
|
||||
},
|
||||
mounted() {
|
||||
this.onload()
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
policyFileUrl: '',
|
||||
putFile,
|
||||
imageUrl: '',
|
||||
ruleForm: {
|
||||
content: null,
|
||||
},
|
||||
form: {
|
||||
note: ''
|
||||
},
|
||||
description: '',
|
||||
formOption: {
|
||||
// labelWidth:120,
|
||||
column: [
|
||||
{
|
||||
"label": "服务时间",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "createTime",
|
||||
format: "yyyy-MM-dd",
|
||||
valueFormat: "yyyy-MM-dd",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务时间"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务发起人",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "fromName",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务发起人"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务对象",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "toName",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务对象"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务主题",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "serveTheme",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务主题"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "服务内容",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "serveContent",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入服务内容"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "备注1",
|
||||
"span": 24,
|
||||
labelWidth: 100,
|
||||
"prop": "bak1",
|
||||
"rules": [
|
||||
{
|
||||
"required": true,
|
||||
"message": "请输入备注1"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "政策文件地址",
|
||||
prop: "policyFileUrl",
|
||||
span: 24,
|
||||
labelWidth: 120,
|
||||
hide: true,
|
||||
slot: true,
|
||||
formslot: true,
|
||||
showWordLimit: true,
|
||||
|
||||
},
|
||||
editorOption: {
|
||||
modules: {
|
||||
toolbar: {
|
||||
container: toolbarItems,
|
||||
handlers: {
|
||||
'image': function (value) {
|
||||
if (value) {
|
||||
document.querySelector('.avatar-uploader input').click()
|
||||
} else {
|
||||
this.quill.format('image', false);
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
editorOption: {
|
||||
modules: {
|
||||
toolbar: {
|
||||
container: toolbarItems,
|
||||
handlers: {
|
||||
'image': function (value) {
|
||||
if (value) {
|
||||
document.querySelector('.avatar-uploader input').click()
|
||||
} else {
|
||||
this.quill.format('image', false);
|
||||
}
|
||||
},//工具菜单栏配置
|
||||
},
|
||||
placeholder: "请在这里编写文章内容", //提示
|
||||
readyOnly: false, //是否只读
|
||||
theme: "snow", //主题 snow/bubble
|
||||
syntax: true, //语法检测
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 值发生变化
|
||||
onEditorChange(editor) {
|
||||
this.content = editor.html;
|
||||
}
|
||||
}
|
||||
},//工具菜单栏配置
|
||||
},
|
||||
handleSubmit(form, done) {
|
||||
// this.form['note'] = this.$refs.tinymce.getContent()
|
||||
|
||||
if(this.form.note.length>64*512){
|
||||
this.$message.error('文章内容不能超过64KB!');
|
||||
done()
|
||||
}
|
||||
else{
|
||||
if (this.type == 'add') {
|
||||
addNews(
|
||||
this.form.articleTitle,
|
||||
this.form.headPic,
|
||||
this.form.articleSrc,
|
||||
this.form.articleSrcUrl,
|
||||
this.form.author,
|
||||
this.form.description,
|
||||
this.form.note,
|
||||
this.form.type
|
||||
).then(() => {
|
||||
this.$message.success('添加成功');
|
||||
this.$router.go(-1);
|
||||
})
|
||||
}
|
||||
else if (this.type == 'edit') {
|
||||
editNews(
|
||||
this.id,
|
||||
this.form.articleTitle,
|
||||
this.form.headPic,
|
||||
this.form.articleSrc,
|
||||
this.form.articleSrcUrl,
|
||||
this.form.author,
|
||||
this.form.description,
|
||||
this.form.note,
|
||||
this.form.type
|
||||
).then(() => {
|
||||
this.$message.success('修改成功');
|
||||
done()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
/*上传图片*/
|
||||
handleAvatarSuccess(res) {
|
||||
let quill = this.$refs.QuillEditor.quill
|
||||
let length = quill.getSelection().index;//获取光标所在位置
|
||||
quill.insertEmbed(length, 'image', res.data.link)
|
||||
quill.setSelection(length + 1)//光标后移一位
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPG = ["image/png", "image/jpeg", "image/svg+xml", "image/gif"].indexOf(file.type) != -1;
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isJPG) {
|
||||
this.$message.error('上传图片格式不正确');
|
||||
}
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传图片大小不能超过 2MB!');
|
||||
}
|
||||
return isJPG && isLt2M;
|
||||
},
|
||||
onload() {
|
||||
if (this.id && this.type == 'edit') {
|
||||
getNewsDetail(this.id).then(res => {
|
||||
this.form = res.data.data;
|
||||
this.description=this.form.description;
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
placeholder: "请在这里编写文章内容", //提示
|
||||
readyOnly: false, //是否只读
|
||||
theme: "snow", //主题 snow/bubble
|
||||
syntax: true, //语法检测
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.avatar-uploader {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ql-editor {
|
||||
height: 400px;
|
||||
}
|
||||
.policyFileUrlWrapper {
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 值发生变化
|
||||
onEditorChange(editor) {
|
||||
this.content = editor.html;
|
||||
},
|
||||
handleSubmit(form, done) {
|
||||
// this.form['note'] = this.$refs.tinymce.getContent()
|
||||
|
||||
if (this.form.note.length > 64 * 512) {
|
||||
this.$message.error('文章内容不能超过64KB!');
|
||||
done()
|
||||
} else {
|
||||
if (this.type == 'add') {
|
||||
addNews(
|
||||
this.form.articleTitle,
|
||||
this.form.headPic,
|
||||
this.form.articleSrc,
|
||||
this.form.articleSrcUrl,
|
||||
this.form.author,
|
||||
this.form.description,
|
||||
this.form.note,
|
||||
this.form.type
|
||||
).then(() => {
|
||||
this.$message.success('添加成功');
|
||||
this.$router.go(-1);
|
||||
})
|
||||
} else if (this.type == 'edit') {
|
||||
editNews(
|
||||
this.id,
|
||||
this.form.articleTitle,
|
||||
this.form.headPic,
|
||||
this.form.articleSrc,
|
||||
this.form.articleSrcUrl,
|
||||
this.form.author,
|
||||
this.form.description,
|
||||
this.form.note,
|
||||
this.form.type
|
||||
).then(() => {
|
||||
this.$message.success('修改成功');
|
||||
done()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
/*上传图片*/
|
||||
handleAvatarSuccess(res) {
|
||||
let quill = this.$refs.QuillEditor.quill
|
||||
let length = quill.getSelection().index;//获取光标所在位置
|
||||
quill.insertEmbed(length, 'image', res.data.link)
|
||||
quill.setSelection(length + 1)//光标后移一位
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPG = ["image/png", "image/jpeg", "image/svg+xml", "image/gif"].indexOf(file.type) != -1;
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isJPG) {
|
||||
this.$message.error('上传图片格式不正确');
|
||||
}
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传图片大小不能超过 2MB!');
|
||||
}
|
||||
return isJPG && isLt2M;
|
||||
},
|
||||
onload() {
|
||||
if (this.id && this.type == 'edit') {
|
||||
getNewsDetail(this.id).then(res => {
|
||||
this.form = res.data.data;
|
||||
this.description = this.form.description;
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.avatar-uploader {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ql-editor {
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.policyFileUrlWrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -286,5 +289,4 @@
|
||||
z-index: 99;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -870,9 +870,9 @@ export default {
|
||||
column: [{
|
||||
label: '服务时间',
|
||||
prop: 'createTime',
|
||||
type: 'datetime',
|
||||
format: "yyyy-MM-dd HH:mm:ss",
|
||||
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
||||
type: 'date',
|
||||
format: "yyyy-MM-dd",
|
||||
valueFormat: "yyyy-MM-dd",
|
||||
}, {
|
||||
label: '服务发起人',
|
||||
prop: 'fromName'
|
||||
|
||||
@@ -51,6 +51,7 @@ export default {
|
||||
dicData: this.depTree,
|
||||
props: {
|
||||
label: "title",
|
||||
value: 'value'
|
||||
},
|
||||
checkStrictly: true,
|
||||
slot: true,
|
||||
|
||||
@@ -271,6 +271,7 @@ export default {
|
||||
dicData: this.depTree,
|
||||
props: {
|
||||
label: "title",
|
||||
value: 'value'
|
||||
},
|
||||
checkStrictly: true,
|
||||
span: 24,
|
||||
|
||||
@@ -51,6 +51,7 @@ export default {
|
||||
dicData: this.depTree,
|
||||
props: {
|
||||
label: "title",
|
||||
value: 'value'
|
||||
},
|
||||
checkStrictly: true,
|
||||
slot: true,
|
||||
|
||||
@@ -273,6 +273,7 @@ export default {
|
||||
dicData: this.depTree,
|
||||
props: {
|
||||
label: "title",
|
||||
value: 'value'
|
||||
},
|
||||
checkStrictly: true,
|
||||
span: 24,
|
||||
@@ -496,6 +497,7 @@ export default {
|
||||
dicData: this.depTree,
|
||||
props: {
|
||||
label: "title",
|
||||
value: 'value'
|
||||
},
|
||||
checkStrictly: true,
|
||||
slot: true,
|
||||
|
||||
@@ -137,6 +137,7 @@ import {
|
||||
wageOptionsWithNoMonth,
|
||||
educationState,
|
||||
} from "@/common/dic";
|
||||
import {dateFormat} from "@/util/date";
|
||||
|
||||
const validateTel = (rule, value, callback) => {
|
||||
if (isvalidatemobile(value)[0]) {
|
||||
@@ -354,8 +355,9 @@ export default {
|
||||
valueFormat: "yyyy-MM-dd 00:00:00",
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
const oneDay = 1000 * 60 * 60 * 24
|
||||
return !(
|
||||
time.getTime() > Date.now() &&
|
||||
time.getTime() + oneDay > Date.now() &&
|
||||
(!self.endTime ||
|
||||
(time.getTime() < self.endTime &&
|
||||
time.getTime() > self.endTime - 2678400000)) &&
|
||||
|
||||
@@ -474,8 +474,9 @@ export default {
|
||||
valueFormat: "yyyy-MM-dd 00:00:00",
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
const oneDay = 1000 * 60 * 60 * 24
|
||||
return !(
|
||||
time.getTime() > Date.now() &&
|
||||
time.getTime() + oneDay > Date.now() &&
|
||||
(!self.endTime ||
|
||||
(time.getTime() < self.endTime &&
|
||||
time.getTime() > self.endTime - 2678400000)) &&
|
||||
|
||||
Reference in New Issue
Block a user