|
|
@@ -33,27 +33,27 @@
|
|
|
</el-radio-group>
|
|
|
<!-- <el-button v-teacher-permission="{role:'teacher'}" plain type="warning">添加发布</el-button>-->
|
|
|
<el-popover v-model:visible="showPopover" :width="160" placement="bottom">
|
|
|
- <div class="selNoticeType">
|
|
|
- <div class="noticeTypeIcon" style="color: #E38800">
|
|
|
+ <div class="sel-notice-type">
|
|
|
+ <div :style="{color:themeColor.orange}" class="notice-type-icon">
|
|
|
公告
|
|
|
</div>
|
|
|
- <div class="noticeTypeTxt" @click="selAndInitNotice('announce')">
|
|
|
+ <div class="notice-type-txt" @click="selAndInitNotice('announce')">
|
|
|
发布公告
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="selNoticeType">
|
|
|
- <div class="noticeTypeIcon" style="color:#1989FA;">
|
|
|
+ <div class="sel-notice-type">
|
|
|
+ <div :style="{color:themeColor.blue}" class="notice-type-icon">
|
|
|
作业
|
|
|
</div>
|
|
|
- <div class="noticeTypeTxt" @click="selAndInitNotice('homework')">
|
|
|
+ <div class="notice-type-txt" @click="selAndInitNotice('homework')">
|
|
|
发布作业
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="selNoticeType">
|
|
|
- <div class="noticeTypeIcon" style="color: #F56C6C">
|
|
|
+ <div class="sel-notice-type">
|
|
|
+ <div :style="{color:themeColor.red}" class="notice-type-icon">
|
|
|
考试
|
|
|
</div>
|
|
|
- <div class="noticeTypeTxt" @click="selAndInitNotice('test')">
|
|
|
+ <div class="notice-type-txt" @click="selAndInitNotice('test')">
|
|
|
发布考试
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -73,33 +73,104 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ v-model="showNewNoticeDialog"
|
|
|
+ :title="newNoticeType.title"
|
|
|
+ width="40%"
|
|
|
+ >
|
|
|
+ <div class="new-notice-content">
|
|
|
+ <div class="new-notice-item">
|
|
|
+ <span>创建者: </span>
|
|
|
+ <div class="flex-vc">
|
|
|
+ <span>kenny 67</span>
|
|
|
+ <div :style="{backgroundColor:newNoticeType.color}" class="mini-name-icon">刘</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="new-notice-item">
|
|
|
+ <span>所属课程:</span>
|
|
|
+ <div>软件工程与计算 I 2021</div>
|
|
|
+ </div>
|
|
|
+ <div class="new-notice-item">
|
|
|
+ <span>发布时间:</span>
|
|
|
+ <div>2021年12月15日 18时30分</div>
|
|
|
+ </div>
|
|
|
+ <div class="content-description-area">
|
|
|
+ <span>内容描述:</span>
|
|
|
+ <el-input
|
|
|
+ v-model="newNoticeInfo.noticeDescription"
|
|
|
+ :rows="4"
|
|
|
+ placeholder="内容描述"
|
|
|
+ type="textarea"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="new-notice-item">
|
|
|
+ <span>优先级: </span>
|
|
|
+ <div>
|
|
|
+ <el-radio v-model="newNoticeInfo.priority" border label="1" size="large">重要</el-radio>
|
|
|
+ <el-radio v-model="newNoticeInfo.priority" border label="2" size="large">一般</el-radio>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="new-notice-item">
|
|
|
+ <span>附件:  </span>
|
|
|
+ <div></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="new-notice-btn">
|
|
|
+ <el-button style="margin-right: 32px" type="primary">确认</el-button>
|
|
|
+ <el-button type="danger">取消</el-button>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import GlobalHeader from "../../../src/components/GlobalHeader";
|
|
|
import NoticeItem from "./components/NoticeItem";
|
|
|
-import {ref} from "vue";
|
|
|
-
|
|
|
-const newNoticeType = ref("");
|
|
|
-const showNewNoticeModel = ref(false);
|
|
|
+import {reactive, ref} from "vue";
|
|
|
|
|
|
+const newNoticeType = reactive({type: "", title: "", color: ""});
|
|
|
+const showNewNoticeDialog = ref(false);
|
|
|
+const themeColor = {
|
|
|
+ orange: "#E38800",
|
|
|
+ blue: "#1989FA",
|
|
|
+ red: "#F56C6C"
|
|
|
+};
|
|
|
const noticeTypeMap = {
|
|
|
- announce: "公告",
|
|
|
- homework: "作业",
|
|
|
- test: "考试"
|
|
|
+ //Use policy objects to remove if-else judgments
|
|
|
+ announce: {type: "公告", title: "发布公告", color: themeColor.orange},
|
|
|
+ homework: {type: "作业", title: "发布作业", color: themeColor.blue},
|
|
|
+ test: {type: "考试", title: "发布考试", color: themeColor.red}
|
|
|
};
|
|
|
|
|
|
const tabName = ref("notice");
|
|
|
const showPopover = ref(false);
|
|
|
|
|
|
const selAndInitNotice = (noticeType) => {
|
|
|
- newNoticeType.value = noticeTypeMap[noticeType];
|
|
|
- showNewNoticeModel.value = true;
|
|
|
-
|
|
|
+ //Copy properties from source object to target object
|
|
|
+ Object.assign(newNoticeType, noticeTypeMap[noticeType]);
|
|
|
+ showNewNoticeDialog.value = true;
|
|
|
};
|
|
|
|
|
|
|
|
|
+const newNoticeInfo = reactive({noticeDescription: "", priority: "1", fileList: []});
|
|
|
+
|
|
|
+//newNoticeInfo to post
|
|
|
+const postNoticeInfo = {
|
|
|
+ userId: 1,
|
|
|
+ courseId: 1,
|
|
|
+ noticeType: newNoticeType.type,
|
|
|
+ releaseTime: "",
|
|
|
+ noticeDescription: "",
|
|
|
+ priority: 1,
|
|
|
+ fileList: []//undecided
|
|
|
+};
|
|
|
+
|
|
|
const noticeInfoList = [
|
|
|
{
|
|
|
mode: "考试",
|
|
|
@@ -136,4 +207,7 @@ const courseInfo = {
|
|
|
<style scoped>
|
|
|
@import "style/CourseDetail.css";
|
|
|
|
|
|
+.el-radio.is-bordered {
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
</style>
|