|
@@ -114,135 +114,37 @@
|
|
|
</style>
|
|
</style>
|
|
|
<template>
|
|
<template>
|
|
|
<section>
|
|
<section>
|
|
|
- <p><span>精品导读></span>新增文章</p>
|
|
|
|
|
|
|
+ <p><span>作业管理></span>查看作业</p>
|
|
|
<div class="content" v-loading='loading' element-loading-background="rgba(0, 0, 0, 0)">
|
|
<div class="content" v-loading='loading' element-loading-background="rgba(0, 0, 0, 0)">
|
|
|
- <!-- <div class="title">新增会议</div> -->
|
|
|
|
|
- <el-form
|
|
|
|
|
- ref="form"
|
|
|
|
|
- size="small"
|
|
|
|
|
- label-width="140px"
|
|
|
|
|
- class="over_y"
|
|
|
|
|
- :model="form"
|
|
|
|
|
- :rules="rules"
|
|
|
|
|
- >
|
|
|
|
|
- <el-form-item label="文章名称:" prop="name">
|
|
|
|
|
- <el-input
|
|
|
|
|
- placeholder="请输入文章名称"
|
|
|
|
|
- v-model="form.name"
|
|
|
|
|
- clearable
|
|
|
|
|
- ></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-row>
|
|
|
|
|
- <el-col :span="10">
|
|
|
|
|
- <el-form-item label="文章来源:" prop="journal_id">
|
|
|
|
|
- <el-select :disabled='disabled'
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- v-model="form.journal_id"
|
|
|
|
|
- filterable
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="(item, index) in journalList"
|
|
|
|
|
- :key="index"
|
|
|
|
|
- :label="item.name"
|
|
|
|
|
- :value="item.id"
|
|
|
|
|
- ></el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
|
|
+ <el-form ref="form" :model="form" label-width="80px">
|
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="作业名称">
|
|
|
|
|
+ <el-input v-model="form.filename" placeholder=""></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
|
|
- <el-form-item label="作者:" prop="author">
|
|
|
|
|
- <el-input v-model="form.author" placeholder=""> </el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <a :href="form.dlink" target="_blank"><el-button type="primary">下載</el-button></a>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <el-form-item label="作者单位:" prop="">
|
|
|
|
|
- <el-input v-model="form.author_unit" placeholder=""> </el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="10" >
|
|
|
|
|
- <el-form-item label="出版时间:" prop="publish_time">
|
|
|
|
|
- <el-date-picker
|
|
|
|
|
- v-model="form.publish_time"
|
|
|
|
|
- type="date"
|
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
|
- range-separator="至"
|
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
|
- end-placeholder="结束日期"
|
|
|
|
|
- >
|
|
|
|
|
- </el-date-picker>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="6">
|
|
|
|
|
- <el-form-item label="出版信息:" prop="">
|
|
|
|
|
- <el-input v-model="form.publish_info" placeholder=""> </el-input>
|
|
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
|
+ <el-col :span="12">
|
|
|
|
|
+ <el-form-item label="狀態">
|
|
|
|
|
+ <el-select v-model="form.status" placeholder="">
|
|
|
|
|
+ <el-option label="未批改" :value="0"></el-option>
|
|
|
|
|
+ <el-option label="已批改" :value="1"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <el-form-item label="DOI信息:" prop="">
|
|
|
|
|
- <el-input v-model="form.doi" placeholder=""> </el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
|
+ <el-col :span="4" :offset="20">
|
|
|
|
|
+ <el-button type="primary" @click="save">保存</el-button>
|
|
|
|
|
+ <el-button type="normal" @click='$router.go(-1)'>返回</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
- <el-form-item label="文章简介:">
|
|
|
|
|
- <el-input
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- v-model="form.desc"
|
|
|
|
|
- :rows="3"
|
|
|
|
|
- placeholder="请输入文章简介"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="封面图:" prop="img">
|
|
|
|
|
- <el-upload
|
|
|
|
|
- class="avatar-uploader"
|
|
|
|
|
- action="/api/admin/uploadfile"
|
|
|
|
|
- :show-file-list="false"
|
|
|
|
|
- :on-progress='handleAvatarProgress'
|
|
|
|
|
- :on-success="handleAvatarSuccess"
|
|
|
|
|
- >
|
|
|
|
|
- <img v-if="form.img" :src="form.img" class="avatar" />
|
|
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
|
|
- </el-upload>
|
|
|
|
|
- <span style="font-size: 12px; color: red"
|
|
|
|
|
- >建议图片尺寸为:210*160, 图片大小请控制在2M以内!</span
|
|
|
|
|
- >
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="文章详情:">
|
|
|
|
|
- <!-- <fuEditor :value="form.content" ref="editor"></fuEditor> -->
|
|
|
|
|
- <vue-ueditor-wrap ref="editor" v-model="form.content" :config="myConfig"></vue-ueditor-wrap>
|
|
|
|
|
-
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item style="position: fixed; bottom: 20px; right: 60px">
|
|
|
|
|
- <el-button type="primary" @click="view">预览</el-button>
|
|
|
|
|
- <el-button type="success" @click="save(2)">发布</el-button>
|
|
|
|
|
- <!-- <el-button type="default" @click="save(1)">保存</el-button> -->
|
|
|
|
|
- <el-button type='info' plain @click="$router.go(-1)">返回</el-button>
|
|
|
|
|
- <!-- <el-button type="danger" plain>删除</el-button> -->
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-dialog
|
|
|
|
|
- title=""
|
|
|
|
|
- :visible.sync="open"
|
|
|
|
|
- width="414px">
|
|
|
|
|
- <div class="preview">
|
|
|
|
|
- <p class="aname">{{form.name}}</p>
|
|
|
|
|
- <div class="ainfo">
|
|
|
|
|
- <img width="100" :src="form.img" alt="">
|
|
|
|
|
- <p>
|
|
|
|
|
- 发布单位:{{journal_name}} <br>
|
|
|
|
|
- 作者:{{form.author}} <br>
|
|
|
|
|
- 发表时间:{{form.publish_time}}
|
|
|
|
|
- </p>
|
|
|
|
|
- </div>
|
|
|
|
|
- <b>文章简介</b>
|
|
|
|
|
- <div class="adesc">{{form.desc}}</div>
|
|
|
|
|
- <b>文章内容</b>
|
|
|
|
|
- <div v-html="form.content"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <!-- <span slot="footer" class="dialog-footer">
|
|
|
|
|
- <el-button type="primary" @click="open = false">确 定</el-button>
|
|
|
|
|
- </span> -->
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
</section>
|
|
</section>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -252,102 +154,33 @@ export default {
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- // msg: '<h2>Vue + UEditor + v-model双向绑定</h2>',
|
|
|
|
|
- myConfig: {
|
|
|
|
|
- // 编辑器自动被内容撑高
|
|
|
|
|
- autoHeightEnabled: true,
|
|
|
|
|
- // 初始容器高度
|
|
|
|
|
- initialFrameHeight: 500,
|
|
|
|
|
- // 初始容器宽度
|
|
|
|
|
- initialFrameWidth: '100%',
|
|
|
|
|
- // 上传文件接口,实现上传图片功能必须的配置,这个地址会在后端配置的时候产生,此处先放上结果
|
|
|
|
|
- serverUrl: '/api/admin/ueditor/upload',
|
|
|
|
|
- },
|
|
|
|
|
- form: {},
|
|
|
|
|
- journalList: [],
|
|
|
|
|
- journal_name:'',
|
|
|
|
|
- imageUrl: "",
|
|
|
|
|
- open:false,
|
|
|
|
|
loading:false,
|
|
loading:false,
|
|
|
- rules: {
|
|
|
|
|
- name: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
|
|
|
|
- journal_id: [
|
|
|
|
|
- { required: true, message: "请选择来源", trigger: "change" },
|
|
|
|
|
- ],
|
|
|
|
|
- author: [{ required: true, message: "请选择模板", trigger: "blur" }],
|
|
|
|
|
- publish_time: [
|
|
|
|
|
- { required: true, message: "发布时间", trigger: "blur" },
|
|
|
|
|
- ],
|
|
|
|
|
- img: [{ required: true, message: "封面图", trigger: "blur" }],
|
|
|
|
|
- },
|
|
|
|
|
- disabled:false
|
|
|
|
|
|
|
+ form:{}
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- //封面
|
|
|
|
|
- handleAvatarProgress(){
|
|
|
|
|
- this.loading=true
|
|
|
|
|
- },
|
|
|
|
|
- handleAvatarSuccess(res, file) {
|
|
|
|
|
- // this.form.img = file.response.data;
|
|
|
|
|
- this.$set(this.form,'img',file.response.data)
|
|
|
|
|
- this.loading=false
|
|
|
|
|
- },
|
|
|
|
|
- //主讲人
|
|
|
|
|
- handleAvatarSuccess1(index, res, file) {
|
|
|
|
|
- var speaker = this.form.speaker[index];
|
|
|
|
|
- speaker.img = file.response.data;
|
|
|
|
|
- this.$set(this.form.speaker, index, speaker);
|
|
|
|
|
- // console.log(this.form.img)
|
|
|
|
|
- },
|
|
|
|
|
- beforeAvatarUpload() {},
|
|
|
|
|
- handleClick() {},
|
|
|
|
|
- addSpeaker() {
|
|
|
|
|
- this.form.speaker.push({ name: "", intruduce: "" });
|
|
|
|
|
- },
|
|
|
|
|
- gopage(size) {
|
|
|
|
|
- if (size) {
|
|
|
|
|
- this.form.page_size = size;
|
|
|
|
|
- }
|
|
|
|
|
- this.form.page = this.$refs.pageButton.page;
|
|
|
|
|
- this.getData();
|
|
|
|
|
- },
|
|
|
|
|
- getData() {
|
|
|
|
|
- this.$api.searchJournalList().then((res) => {
|
|
|
|
|
- this.journalList = res.data.data;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ getData(){
|
|
|
let id = this.$route.query.id;
|
|
let id = this.$route.query.id;
|
|
|
if (id) {
|
|
if (id) {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- this.$api.getArticle({ id: id }).then((res) => {
|
|
|
|
|
|
|
+ this.$api.getHomeWorkInfo({ id: id }).then((res) => {
|
|
|
this.form = res.data.data;
|
|
this.form = res.data.data;
|
|
|
- this.loading = false;
|
|
|
|
|
|
|
+ this.$api.getWorkInfo({fsid:res.data.data.fs_id}).then((res)=>{
|
|
|
|
|
+ this.form.dlink = res.data.data.dlink;
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ })
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- /**预览 */
|
|
|
|
|
- view(){
|
|
|
|
|
- // console.log(this.$refs.editor)
|
|
|
|
|
- var content=this.$refs.editor.innerValue
|
|
|
|
|
-
|
|
|
|
|
- this.form.content=content;
|
|
|
|
|
- let journal=this.journalList.filter(item=>item.id == this.form.journal_id)
|
|
|
|
|
- if(journal.length>0){
|
|
|
|
|
- this.journal_name=journal[0].name
|
|
|
|
|
- }
|
|
|
|
|
- this.open=true;
|
|
|
|
|
- },
|
|
|
|
|
save(status) {
|
|
save(status) {
|
|
|
let id = this.$route.query.id;
|
|
let id = this.$route.query.id;
|
|
|
let parm = this.form;
|
|
let parm = this.form;
|
|
|
- parm.status=status
|
|
|
|
|
- var content=this.$refs.editor.innerValue
|
|
|
|
|
- parm.content=content;
|
|
|
|
|
this.$refs["form"].validate((valid) => {
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
if (id) {
|
|
if (id) {
|
|
|
parm.id = id;
|
|
parm.id = id;
|
|
|
- this.$api.updateArticle(parm).then((res) => {
|
|
|
|
|
|
|
+ parm.status = String(parm.status)
|
|
|
|
|
+ this.$api.updateHomeWork(parm).then((res) => {
|
|
|
if (res.data.code == 0) {
|
|
if (res.data.code == 0) {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: "success",
|
|
type: "success",
|
|
@@ -359,44 +192,15 @@ export default {
|
|
|
this.$message.error(status==1?"保存失败!":"发布失败!");
|
|
this.$message.error(status==1?"保存失败!":"发布失败!");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- } else {
|
|
|
|
|
- this.$api.addArticle(parm).then((res) => {
|
|
|
|
|
- if (res.data.code == 0) {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- type: "success",
|
|
|
|
|
- message: status==1?"保存成功!":"发布成功!",
|
|
|
|
|
- });
|
|
|
|
|
- this.$router.go(-1)
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.error(status==1?"保存失败!":"发布失败!");
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error("有必填项没有填!");
|
|
this.$message.error("有必填项没有填!");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- del(id) {
|
|
|
|
|
- this.$confirm("确定删除吗", "提示", {
|
|
|
|
|
- type: "warning",
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- this.$api.deleteEnterprise({ id: id }).then((res) => {
|
|
|
|
|
- this.$message({
|
|
|
|
|
- message: "删除成功",
|
|
|
|
|
- type: "success",
|
|
|
|
|
- });
|
|
|
|
|
- this.getData();
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
|
- if(this.$route.query.jid){
|
|
|
|
|
- this.form.journal_id=Number(this.$route.query.jid)
|
|
|
|
|
- this.disabled=true
|
|
|
|
|
- }
|
|
|
|
|
- this.getData();
|
|
|
|
|
|
|
+ this.getData()
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|