Prechádzať zdrojové kódy

Merge branch 'iteration-20241014' into develop

lex-xin 9 mesiacov pred
rodič
commit
03588ca320

+ 14 - 1
src/components/editor/index.tsx

@@ -8,6 +8,19 @@ import dayjs from 'dayjs'
 import { getUploadSign, onOnlyFileUpload } from '@/utils/oss-file-upload'
 import { getUploadSign, onOnlyFileUpload } from '@/utils/oss-file-upload'
 
 
 // type InsertFnType = (url: string, poster = '') => void
 // type InsertFnType = (url: string, poster = '') => void
+/** 生成 uuid */
+export const UUID = () => {
+  let d = new Date().getTime()
+  if (window.performance && typeof window.performance.now === "function") {
+     d += performance.now() //use high-precision timer if available
+  }
+  const uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
+     const r = (d + Math.random() * 16) % 16 | 0
+     d = Math.floor(d / 16)
+     return (c == "x" ? r : (r & 0x3) | 0x8).toString(16)
+  })
+  return uuid
+}
 
 
 export default defineComponent({
 export default defineComponent({
   name: 'editor',
   name: 'editor',
@@ -61,7 +74,7 @@ export default defineComponent({
       acl: 'public-read',
       acl: 'public-read',
       name: ''
       name: ''
     }) as any
     }) as any
-    const idKey = props.id || new Date().getTime()
+    const idKey = props.id || UUID()
     const loading = ref(false)
     const loading = ref(false)
     const ossUploadUrl = `https://${props.bucketName}.ks3-cn-beijing.ksyuncs.com/`
     const ossUploadUrl = `https://${props.bucketName}.ks3-cn-beijing.ksyuncs.com/`
     const changeEditor = ref(false)
     const changeEditor = ref(false)

+ 3 - 9
src/views/educational-manage/model/addMaterial.tsx

@@ -127,13 +127,7 @@ export default defineComponent({
           message: '请选择课程类型',
           message: '请选择课程类型',
           trigger: ['blur', 'change']
           trigger: ['blur', 'change']
         }
         }
-      ],
-      phaseGoals: [{
-        required: true, message: '请填写阶段目标' , trigger: ['blur', 'change', 'input']
-      }],
-      checkItem: [{
-        required: true, message: '请填写检查事项', trigger: ['blur', 'change', 'input']
-      }]
+      ]
     }
     }
     // const categoryList = inject('categoryList', { list: [] }).list || []
     // const categoryList = inject('categoryList', { list: [] }).list || []
     const submit = () => {
     const submit = () => {
@@ -317,7 +311,7 @@ export default defineComponent({
               )}
               )}
             </NSpace>
             </NSpace>
 
 
-            <NFormItem label="阶段目标" required labelPlacement="left" path="phaseGoals">
+            <NFormItem label="阶段目标" labelPlacement="left" path="phaseGoals">
               <Editor v-model:value={saveModel.phaseGoals}
               <Editor v-model:value={saveModel.phaseGoals}
                   editorType="simple"
                   editorType="simple"
                   maxLength={1000}
                   maxLength={1000}
@@ -333,7 +327,7 @@ export default defineComponent({
                     'divider'
                     'divider'
                   ]} />
                   ]} />
             </NFormItem>
             </NFormItem>
-            <NFormItem label="检查事项" required labelPlacement="left" path="checkItem">
+            <NFormItem label="检查事项" labelPlacement="left" path="checkItem">
             <Editor v-model:value={saveModel.checkItem}
             <Editor v-model:value={saveModel.checkItem}
                   maxLength={1000}
                   maxLength={1000}
                   editorType="simple"
                   editorType="simple"