diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 1cb36fad..29eebc4e 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -24,6 +24,19 @@ const lineHeightStyle = new lineHeightAttributor("lineHeight", "line-height", { scope: Parchment.Scope.INLINE, whitelist: ["1", "1.5", "2", "3", "4"] }); +const toolbarOptions = [ + ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线 + ["blockquote", "code-block"], // 引用 代码块 + [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表 + [{ indent: "-1" }, { indent: "+1" }], // 缩进 + [{ size: [false,"18px"] }], // 字体大小 + [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题 + [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 + [{ align: [] }], // 对齐方式 + [{ lineheight: ['initial', '1', '1.5', '2', '3', '4'] }], + ["clean"], // 清除文本格式 + ["link", "image"] + ] Quill.register({ 'formats/lineHeight': lineHeightStyle }, true) export default { name: "Editor", @@ -33,6 +46,10 @@ export default { type: String, default: "", }, + toobar:{ + type: Boolean, + default: true + }, placeholder: { type: String, default: "请输入长度大于100个字符的内容", @@ -68,19 +85,7 @@ export default { }, // 工具栏配置 toolbar: { - container:[ - ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线 - ["blockquote", "code-block"], // 引用 代码块 - [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表 - [{ indent: "-1" }, { indent: "+1" }], // 缩进 - [{ size: [false,"18px"] }], // 字体大小 - [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题 - [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 - [{ align: [] }], // 对齐方式 - [{ lineheight: ['initial', '1', '1.5', '2', '3', '4'] }], - ["clean"], // 清除文本格式 - ["link", "image"] // 链接、图片、视频, "video" - ], + container:this.toobar? toolbarOptions:[], handlers: { image: function(value) { if (value) { diff --git a/src/utils/datetime.js b/src/utils/datetime.js index 8a71be1b..64735195 100644 --- a/src/utils/datetime.js +++ b/src/utils/datetime.js @@ -3,7 +3,7 @@ // fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); // } // let o = { -// 'M+': new date(date).getMonth() +1, +// 'M+': new date(date).getMonth() +1, // 'd+': date.getDate(), // 'h+': date.getHours(), // 'm+': date.getMinutes(), @@ -70,11 +70,16 @@ export function formatDate(date){ // 秒转时分秒 export function formatSeconds(value) { let result = parseInt(value) - let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600); - let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60)); - let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60)); + let d= Math.floor(result / (3600*24)); + let last=Math.floor(result % (3600*24)); + let h = Math.floor(last / 3600) < 10 ? '0' + Math.floor(last / 3600) : Math.floor(last / 3600); + let m = Math.floor((last / 60 % 60)) < 10 ? '0' + Math.floor((last / 60 % 60)) : Math.floor((last / 60 % 60)); + let s = Math.floor((last % 60)) < 10 ? '0' + Math.floor((last % 60)) : Math.floor((last % 60)); let res = ''; + if(d>0){ + res += `${d}天`; + } if(h !== '00'){ res += `${h}小时`; } diff --git a/src/views/manage/TeacherList.vue b/src/views/manage/TeacherList.vue index df835fc0..47d9c06c 100644 --- a/src/views/manage/TeacherList.vue +++ b/src/views/manage/TeacherList.vue @@ -1,31 +1,38 @@ -
+
-
+
@@ -146,8 +153,8 @@ - - + + @@ -161,7 +168,7 @@ - 取 消 + 关 闭 diff --git a/src/views/manage/teacherDetails.vue b/src/views/manage/teacherDetails.vue index 74555056..b1378a1f 100644 --- a/src/views/manage/teacherDetails.vue +++ b/src/views/manage/teacherDetails.vue @@ -82,51 +82,29 @@
- - + + - + - + - + - + - + - + - + - +