|
@@ -0,0 +1,272 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ :center="true"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="500px"
|
|
|
+ class="bindingFormDialog"
|
|
|
+ >
|
|
|
+ <div class="a-d-top">
|
|
|
+ <div class="a-d-topTit">
|
|
|
+ <div>另存为模板</div>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="a_d_t_input">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入标题"
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ v-model="text"
|
|
|
+ @submit.native.prevent="search()"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ :disabled="loading"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ @click="search()"
|
|
|
+ type="primary"
|
|
|
+ >搜索</el-button
|
|
|
+ >
|
|
|
+ </div> -->
|
|
|
+ <div class="a-d-t-right">
|
|
|
+ <span @click.stop="close()">×</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="bfd_box" v-loading="loading" label-position="top">
|
|
|
+ <el-form :model="form" :rules="rules" ref="ruleForm">
|
|
|
+ <div style="display: flex;width: 100%;justify-content: space-between;">
|
|
|
+ <el-form-item label="模板名称" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入模板名称" style="width: 300px;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属学科" prop="subject">
|
|
|
+ <el-select v-model="form.subject" placeholder="请选择所属学科" style="width: 300px;">
|
|
|
+ <el-option
|
|
|
+ v-for="item in subjectList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <!-- <el-input v-model="form.subject" placeholder="请输入所属学科" style="width: 300px;"></el-input> -->
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="模板简介(40字以内)" prop="brief">
|
|
|
+ <el-input type="textarea" v-model="form.brief" style="width: 100%;" :rows="3" :maxlength="40" resize="none" placeholder="请输入模板简介"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="权限管理" style="display: flex;flex-direction: column;align-items: flex-start;">
|
|
|
+ <div>公开到社区:<el-switch v-model="form.permissions"></el-switch></div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div class="bfd_bottom">
|
|
|
+ <el-button @click="close()">取消</el-button>
|
|
|
+ <el-button type="primary" @click="submitBtn('ruleForm')">保存</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ emits: ["success"],
|
|
|
+ props: {
|
|
|
+ dataList:{
|
|
|
+ type:Array,
|
|
|
+ default:()=>{return []}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ userId: this.$route.query["userid"],
|
|
|
+ oid: this.$route.query["oid"],
|
|
|
+ org: this.$route.query["org"],
|
|
|
+ subjectList:[
|
|
|
+ {value:'1',label:'语文'},
|
|
|
+ {value:'2',label:'数学'},
|
|
|
+ {value:'3',label:'英语'},
|
|
|
+ {value:'4',label:'科学'},
|
|
|
+ {value:'5',label:'物理'},
|
|
|
+ {value:'6',label:'化学'},
|
|
|
+ {value:'7',label:'生物'},
|
|
|
+ {value:'8',label:'历史'},
|
|
|
+ {value:'9',label:'地理'},
|
|
|
+ {value:'10',label:'政治'},
|
|
|
+
|
|
|
+ ],
|
|
|
+ form:{
|
|
|
+ name:"",
|
|
|
+ subject:"",
|
|
|
+ brief:"",
|
|
|
+ permissions:false,
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ name:[{required:true,message:"请输入课程名称",trigger:"blur"}],
|
|
|
+ subject:[{required:true,message:"请输入所属学科",trigger:"blur"}]
|
|
|
+ },
|
|
|
+
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ open(_json) {
|
|
|
+ this.form = {
|
|
|
+ name:"",
|
|
|
+ subject:"",
|
|
|
+ brief:"",
|
|
|
+ permissions:false,
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.form = {
|
|
|
+ name:"",
|
|
|
+ subject:"",
|
|
|
+ brief:"",
|
|
|
+ permissions:false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ search(){
|
|
|
+
|
|
|
+ },
|
|
|
+ submitBtn(ref) {
|
|
|
+ this.$refs[ref].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let params = {
|
|
|
+ title:this.form.name,
|
|
|
+ subject:this.form.subject,
|
|
|
+ uid:this.userId,
|
|
|
+ brief:this.form.brief,
|
|
|
+ per:this.form.permissions?0:1,
|
|
|
+ jsonData:JSON.stringify(this.dataList),
|
|
|
+ }
|
|
|
+ return console.log(params)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.bindingFormDialog >>> .el-dialog {
|
|
|
+ min-width: 700px;
|
|
|
+
|
|
|
+ height: 500px;
|
|
|
+ box-shadow: 0px 0 8px 0px #555555;
|
|
|
+ border-radius: 8px;
|
|
|
+ background-color: #fff;
|
|
|
+ /* top: 0px; */
|
|
|
+ /* margin: 0 auto; */
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.bindingFormDialog >>> .el-dialog__body {
|
|
|
+ height: 100%;
|
|
|
+ min-width: 700px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding-bottom: 50px;
|
|
|
+ padding-top: 10px;
|
|
|
+}
|
|
|
+.bindingFormDialog >>> .el-dialog__header {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+
|
|
|
+.a-d-top {
|
|
|
+ /* background: #adadad; */
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 54px;
|
|
|
+ border-radius: 8px 8px 0 0;
|
|
|
+ user-select: none;
|
|
|
+ border-bottom: 1px #ccc solid;
|
|
|
+}
|
|
|
+.a-d-top >>> .el-input__inner {
|
|
|
+ width: 320px;
|
|
|
+ height: 32px;
|
|
|
+}
|
|
|
+.a-d-top >>> .el-input__icon {
|
|
|
+ line-height: 32px;
|
|
|
+}
|
|
|
+
|
|
|
+.a-d-topTit {
|
|
|
+ /* width: 171px; */
|
|
|
+ /* margin-left: 20px; */
|
|
|
+ height: 32px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 5px;
|
|
|
+ line-height: 22px;
|
|
|
+ justify-content: center;
|
|
|
+ /* text-align: left; */
|
|
|
+}
|
|
|
+
|
|
|
+.a-d-t-right {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ margin-right: 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ color: black !important;
|
|
|
+}
|
|
|
+
|
|
|
+.a-d-t-right > span {
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+ border-radius: 25px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ /* align-items: center; */
|
|
|
+ font-size: 22px;
|
|
|
+ color: #fff;
|
|
|
+ /* background-color: #adadad; */
|
|
|
+ cursor: pointer;
|
|
|
+ /* background-color: #e6e6e6; */
|
|
|
+ color: #adadad;
|
|
|
+}
|
|
|
+
|
|
|
+.bfd_box {
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 80px);
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.bfd_bottom {
|
|
|
+ width: 100%;
|
|
|
+ height: calc(40px);
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+}
|
|
|
+
|
|
|
+.bfd_b_left {
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.a_d_t_input {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+/* .bfd_b_right {
|
|
|
+ width: 200px;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+} */
|
|
|
+</style>
|