lex hace 2 años
padre
commit
8fb87fb6df

BIN
src/common/images/icon-upload-close.png


BIN
src/common/images/icon-upload.png


+ 48 - 0
src/components/o-upload-all/index.module.less

@@ -0,0 +1,48 @@
+.uploader-section {
+  display: flex;
+  align-items: center;
+  box-sizing: border-box;
+  position: relative;
+  .img-close {
+    position: absolute;
+    top: 5px;
+    right: 12px;
+    z-index: 99;
+    font-size: 13px;
+    background-color: rgba(0, 0, 0, 0.2);
+    color: #fff;
+    font-weight: bold;
+    width: 18px;
+    height: 18px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    border-radius: 50%;
+  }
+
+  .uploader {
+    position: relative;
+    &.default {
+      :global {
+        .van-uploader__upload {
+          width: 102px;
+          height: 94px;
+          background-color: #fff;
+        }
+      }
+      .previewImg {
+        width: 102px;
+        height: 94px;
+        border-radius: 10px;
+        overflow: hidden;
+      }
+    }
+    :global {
+      .van-uploader__upload-icon,
+      .van-icon__image {
+        width: 100%;
+        height: 100%;
+      }
+    }
+  }
+}

+ 228 - 0
src/components/o-upload-all/index.tsx

@@ -0,0 +1,228 @@
+import { closeToast, Icon, Image, showLoadingToast, showToast, Uploader } from 'vant'
+import { defineComponent, ref } from 'vue'
+import styles from './index.module.less'
+import { useCustomFieldValue } from '@vant/use'
+import { postMessage } from '@/helpers/native-message'
+import umiRequest from 'umi-request'
+import iconUploader from '@common/images/icon-upload.png'
+import iconUploadClose from '@common/images/icon-upload-close.png'
+import request from '@/helpers/request'
+import { getOssUploadUrl, state } from '@/state'
+
+export default defineComponent({
+  name: 'col-upload',
+  props: {
+    modelValue: {
+      type: Array,
+      default: () => []
+    },
+    deletable: {
+      type: Boolean,
+      default: true
+    },
+    maxCount: {
+      type: Number,
+      default: 1
+    },
+    native: {
+      // 是否原生上传
+      type: Boolean,
+      default: false
+    },
+    uploadSize: {
+      // 上传图片大小
+      type: Number,
+      default: 5
+    },
+    accept: {
+      type: String,
+      default: 'image/*'
+    },
+    onUploadChange: {
+      type: Function,
+      default: (url: string) => {}
+    },
+    bucket: {
+      type: String,
+      default: 'daya'
+    },
+    uploadIcon: {
+      type: String,
+      default: iconUploader
+    },
+    size: {
+      type: String,
+      default: 'default'
+    }
+  },
+  methods: {
+    nativeUpload() {
+      postMessage(
+        {
+          api: 'chooseFile',
+          content: { type: 'img', max: 1, bucket: this.bucket }
+        },
+        (res: any) => {
+          console.log(res, 'fileUrl')
+          this.$emit('update:modelValue', [...this.modelValue, res.fileUrl])
+        }
+      )
+    },
+    beforeRead(file: any) {
+      console.log(file, 'beforeRead')
+      const isLt2M = file.size / 1024 / 1024 < this.uploadSize
+      if (!isLt2M) {
+        showToast(`上传文件大小不能超过 ${this.uploadSize}MB`)
+        return false
+      }
+      return true
+    },
+    beforeDelete(file: any, detail: { index: any }) {
+      // this.dataModel.splice(detail.index, 1)
+      return true
+    },
+    async afterRead(file: any, detail: any) {
+      try {
+        file.status = 'uploading'
+        file.message = '上传中...'
+        await this.uploadFile(file.file)
+      } catch (error) {
+        closeToast()
+      }
+    },
+    onClose(e: any) {
+      this.$emit('update:modelValue', null)
+      this.onUploadChange()
+      e.stopPropagation()
+    },
+    async getFile(file: any) {
+      try {
+        await this.uploadFile(file)
+      } catch {
+        //
+      }
+    },
+    async uploadFile(file: any) {
+      // 上传文件
+      try {
+        // 获取签名
+        if (state.platformType === 'SCHOOL') {
+          state.platformApi = '/api-school'
+        } else if (state.platformType === 'TEACHER') {
+          state.platformApi = '/api-teacher'
+        } else if (state.platformType === 'STUDENT') {
+          state.platformApi = '/api-student'
+        }
+        const signUrl = state.platformApi + '/open/getUploadSign'
+        const tempName = file.name || ''
+        const fileName = tempName && tempName.replace(/ /gi, '_')
+        const key = new Date().getTime() + fileName
+        console.log(file)
+
+        const res = await request.post(signUrl, {
+          data: {
+            filename: fileName,
+            bucketName: this.bucket,
+            postData: {
+              filename: fileName,
+              acl: 'public-read',
+              key: key,
+              unknowValueField: []
+            }
+          }
+        })
+        showLoadingToast({
+          message: '加载中...',
+          forbidClick: true,
+          loadingType: 'spinner',
+          duration: 0
+        })
+        const obj = {
+          policy: res.data.policy,
+          signature: res.data.signature,
+          key: key,
+          KSSAccessKeyId: res.data.kssAccessKeyId,
+          acl: 'public-read',
+          name: fileName
+        }
+        const formData = new FormData()
+        for (const key in obj) {
+          formData.append(key, obj[key])
+        }
+        formData.append('file', file, fileName)
+        await umiRequest(getOssUploadUrl(this.bucket), {
+          method: 'POST',
+          data: formData
+        })
+        console.log(getOssUploadUrl(this.bucket) + key)
+        const uploadUrl = getOssUploadUrl(this.bucket) + key
+        closeToast()
+        // 判断是否是多选
+        this.$emit('update:modelValue', [...this.modelValue, uploadUrl])
+        this.onUploadChange([...this.modelValue, uploadUrl])
+      } catch (error) {
+        console.log(error, 'uploadFile')
+      }
+    }
+  },
+  render() {
+    useCustomFieldValue(() => this.modelValue)
+
+    return (
+      <div class={styles['uploader-section']}>
+        {this.modelValue.length > 0 &&
+          this.modelValue.map((item: any) => (
+            <div class={[styles.uploader, styles[this.size]]}>
+              {/* 删除按钮 */}
+              {this.deletable && (
+                <Icon name="cross" onClick={this.onClose} class={styles['img-close']} />
+              )}
+              <div class={['van-uploader__upload']}>
+                <Image src={item} class={styles.previewImg} fit="cover" />
+              </div>
+            </div>
+          ))}
+
+        {this.native ? (
+          this.maxCount > 1 ? (
+            <div class={[styles.uploader, styles[this.size]]} onClick={this.nativeUpload}>
+              {this.modelValue ? (
+                <Image
+                  fit="cover"
+                  position="center"
+                  class={styles.uploadImg}
+                  src={this.modelValue as any}
+                />
+              ) : (
+                <Icon name={this.uploadIcon} size="32" />
+              )}
+            </div>
+          ) : (
+            ''
+          )
+        ) : this.maxCount > 1 ? (
+          <Uploader
+            class={[styles.uploader, styles[this.size]]}
+            afterRead={this.afterRead}
+            beforeRead={this.beforeRead}
+            beforeDelete={this.beforeDelete}
+            uploadIcon={this.uploadIcon}
+            disabled={this.modelValue.length === this.maxCount}
+            accept={this.accept}
+          />
+        ) : (
+          <Uploader
+            class={[styles.uploader, styles[this.size]]}
+            afterRead={this.afterRead}
+            beforeRead={this.beforeRead}
+            beforeDelete={this.beforeDelete}
+            uploadIcon={this.uploadIcon}
+            accept={this.accept}
+          >
+            <Icon name={this.uploadIcon} class={['van-uploader__upload']} size="32" />
+          </Uploader>
+        )}
+      </div>
+    )
+  }
+})

+ 16 - 0
src/router/routes-school.ts

@@ -285,6 +285,22 @@ export default [
         meta: {
         meta: {
           title: '考勤规则'
           title: '考勤规则'
         }
         }
+      },
+      {
+        path: '/orchestra-story',
+        name: 'orchestra-story',
+        component: () => import('@/school/orchestra-story/index'),
+        meta: {
+          title: '乐团事迹'
+        }
+      },
+      {
+        path: '/story-operation',
+        name: 'story-operation',
+        component: () => import('@/school/orchestra-story/story-operation/index'),
+        meta: {
+          title: '添加事迹'
+        }
       }
       }
 
 
       //
       //

+ 9 - 4
src/school/approval-manage/course-adjust.tsx

@@ -145,6 +145,11 @@ export default defineComponent({
         reset()
         reset()
         setTimeout(() => {
         setTimeout(() => {
           showToast('调整成功')
           showToast('调整成功')
+          if (browser().isApp) {
+            postMessage({ api: 'back' })
+          } else {
+            router.back()
+          }
         }, 100)
         }, 100)
       } catch (e: any) {
       } catch (e: any) {
         showToast(e.message)
         showToast(e.message)
@@ -177,21 +182,21 @@ export default defineComponent({
                 is-link
                 is-link
               />
               />
               <Field
               <Field
-                label="课程开始日期"
+                label="课日期"
                 inputAlign="right"
                 inputAlign="right"
                 readonly
                 readonly
                 isLink
                 isLink
-                placeholder="请选择课程开始日期"
+                placeholder="请选择课日期"
                 onClick={() => (state.showPopoverTime = true)}
                 onClick={() => (state.showPopoverTime = true)}
                 modelValue={forms.classDate ? dayjs(forms.classDate).format('YYYY-MM-DD') : ''}
                 modelValue={forms.classDate ? dayjs(forms.classDate).format('YYYY-MM-DD') : ''}
               />
               />
 
 
               <Field
               <Field
-                label="课程开始时间"
+                label="课时间"
                 inputAlign="right"
                 inputAlign="right"
                 readonly
                 readonly
                 isLink
                 isLink
-                placeholder="请选择课程开始时间"
+                placeholder="请选择课时间"
                 modelValue={forms.startTime ? dayjs(forms.startTime).format('HH:mm') : ''}
                 modelValue={forms.startTime ? dayjs(forms.startTime).format('HH:mm') : ''}
                 onClick={() => {
                 onClick={() => {
                   let freeTimeCount = 0
                   let freeTimeCount = 0

+ 2 - 1
src/school/companion-teacher/companion-teacher-register.tsx

@@ -199,7 +199,8 @@ export default defineComponent({
               paramName: 'qr_code_expire_hours'
               paramName: 'qr_code_expire_hours'
             }
             }
           })
           })
-          if (dayjs(Number(state.t)).isBefore(dayjs().add(data.paramValue, 'hour'))) {
+
+          if (dayjs(Number(state.t)).add(data.paramValue, 'hour').isBefore(dayjs())) {
             showDialog({
             showDialog({
               title: '提示',
               title: '提示',
               message: '二维码已失效',
               message: '二维码已失效',

+ 17 - 3
src/school/companion-teacher/index.tsx

@@ -106,8 +106,6 @@ export default defineComponent({
           res.data.schoolName +
           res.data.schoolName +
           '&t=' +
           '&t=' +
           +new Date()
           +new Date()
-
-        console.log(form.url)
       } catch {
       } catch {
         //
         //
       }
       }
@@ -289,7 +287,23 @@ export default defineComponent({
         >
         >
           <OHeader border={false}>
           <OHeader border={false}>
             {{
             {{
-              right: () => <Icon name="plus" size={19} onClick={() => (form.showQrcode = true)} />
+              right: () => (
+                <Icon
+                  name="plus"
+                  size={19}
+                  onClick={() => {
+                    form.url =
+                      location.origin +
+                      '/orchestra-school/#/companion-teacher-register?id=' +
+                      form.schoolId +
+                      '&name=' +
+                      form.schoolName +
+                      '&t=' +
+                      +new Date()
+                    form.showQrcode = true
+                  }}
+                />
+              )
             }}
             }}
           </OHeader>
           </OHeader>
           <OSearch
           <OSearch

+ 17 - 1
src/school/manage-teacher/index.tsx

@@ -246,7 +246,23 @@ export default defineComponent({
         >
         >
           <OHeader border={false}>
           <OHeader border={false}>
             {{
             {{
-              right: () => <Icon name="plus" size={19} onClick={() => (form.showQrcode = true)} />
+              right: () => (
+                <Icon
+                  name="plus"
+                  size={19}
+                  onClick={() => {
+                    form.url =
+                      location.origin +
+                      '/orchestra-school/#/manage-teacher-register?id=' +
+                      form.schoolId +
+                      '&name=' +
+                      form.schoolName +
+                      '&t=' +
+                      +new Date()
+                    form.showQrcode = true
+                  }}
+                />
+              )
             }}
             }}
           </OHeader>
           </OHeader>
           <OSearch
           <OSearch

+ 1 - 1
src/school/manage-teacher/manage-teacher-register.tsx

@@ -127,7 +127,7 @@ export default defineComponent({
               paramName: 'qr_code_expire_hours'
               paramName: 'qr_code_expire_hours'
             }
             }
           })
           })
-          if (dayjs(Number(state.t)).isBefore(dayjs().add(data.paramValue, 'hour'))) {
+          if (dayjs(Number(state.t)).add(data.paramValue, 'hour').isBefore(dayjs())) {
             showDialog({
             showDialog({
               title: '提示',
               title: '提示',
               message: '二维码已失效',
               message: '二维码已失效',

BIN
src/school/orchestra-story/images/icon-edit.png


BIN
src/school/orchestra-story/images/icon-step-calendar.png


BIN
src/school/orchestra-story/images/icon-step.png


BIN
src/school/orchestra-story/images/icon-upload-video-cover.png


BIN
src/school/orchestra-story/images/icon-upload-video.png


BIN
src/school/orchestra-story/images/icon-upload.png


+ 78 - 0
src/school/orchestra-story/index.module.less

@@ -0,0 +1,78 @@
+.cellGroup {
+  margin: 12px 13px 0;
+  overflow: hidden;
+  border-radius: 10px;
+  :global {
+    .van-cell {
+      font-size: 16px;
+      color: #333333;
+      padding: 16px 12px;
+    }
+  }
+}
+
+.storySteps {
+  background-color: transparent;
+  padding-top: 20px;
+  margin-left: 8px;
+
+  :global {
+    .van-step--vertical {
+      padding-right: 13px;
+      &::after {
+        border-width: 0 !important;
+      }
+    }
+  }
+
+  .stepTimes {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    font-size: 20px;
+    font-weight: bold;
+    color: #333333;
+
+    .stepEdit {
+      font-size: 14px;
+      font-weight: 400;
+      color: #777777;
+      display: flex;
+      align-items: center;
+      :global {
+        .van-icon {
+          font-size: 14px;
+          margin-right: 3px;
+        }
+      }
+    }
+  }
+
+  .content {
+    padding-top: 8px;
+    font-size: 14px;
+    color: #666666;
+    line-height: 20px;
+  }
+
+  .storySwipe {
+    padding-top: 6px;
+    --van-swipe-indicator-size: 8px;
+
+    .swipeImg {
+      width: 100%;
+      height: 200px;
+      border-radius: 10px;
+      overflow: hidden;
+    }
+  }
+
+  .iconActive {
+    width: 18px;
+    height: 18px;
+  }
+  .iconInactive {
+    width: 12px;
+    height: 12px;
+  }
+}

+ 220 - 0
src/school/orchestra-story/index.tsx

@@ -0,0 +1,220 @@
+import OHeader from '@/components/o-header'
+import {
+  Cell,
+  CellGroup,
+  Icon,
+  Image,
+  List,
+  Picker,
+  Popup,
+  Step,
+  Steps,
+  Swipe,
+  SwipeItem
+} from 'vant'
+import { defineComponent, onMounted, reactive } from 'vue'
+import { useRoute, useRouter } from 'vue-router'
+import styles from './index.module.less'
+import iconEdit from './images/icon-edit.png'
+import iconStep from './images/icon-step.png'
+import iconStepCalendar from './images/icon-step-calendar.png'
+import request from '@/helpers/request'
+import { state as baseState } from '@/state'
+import OFullRefresh from '@/components/o-full-refresh'
+import OEmpty from '@/components/o-empty'
+
+export default defineComponent({
+  name: 'orchestra-story',
+  setup() {
+    const route = useRoute()
+    const router = useRouter()
+    const state = reactive({
+      orchestraStatus: false,
+      orchestraList: [] as any,
+      selectOrchestra: {} as any,
+      isClick: false,
+      list: [] as any,
+      listState: {
+        dataShow: true, // 判断是否有数据
+        loading: false,
+        finished: false,
+        refreshing: false,
+        height: 0 // 页面头部高度,为了处理下拉刷新用的
+      },
+      params: {
+        type: null,
+        page: 1,
+        rows: 20
+      }
+    })
+
+    // 获取乐团列表
+    const getOrchestras = async () => {
+      try {
+        const { data } = await request.post('/api-school/orchestra/page', {
+          data: {
+            page: 1,
+            rows: 100,
+            schoolId: baseState.user.data.school.id
+          }
+        })
+        const temps = data.rows || []
+        const s = [] as any
+        temps.forEach((item: any) => {
+          s.push({
+            text: item.name,
+            value: item.id
+          })
+        })
+        state.orchestraList = [...s]
+
+        // 判断是否有乐团
+        if (s.length > 0) {
+          state.selectOrchestra = s[0]
+
+          getList()
+        }
+      } catch {
+        //
+      }
+    }
+
+    const getList = async () => {
+      try {
+        if (state.isClick) return
+        state.isClick = true
+        const res = await request.post('/api-school/orchestraStory/page', {
+          data: {
+            orchestraId: state.selectOrchestra.value
+          }
+        })
+        state.listState.loading = false
+        state.listState.refreshing = false
+        const result = res.data || {}
+        // 处理重复请求数据
+        if (state.list.length > 0 && result.current === 1) {
+          return
+        }
+        state.list = state.list.concat(result.rows || [])
+        state.listState.finished = result.current >= result.pages
+        state.params.page = result.current + 1
+        state.listState.dataShow = state.list.length > 0
+        state.isClick = false
+      } catch {
+        state.listState.dataShow = false
+        state.listState.finished = true
+        state.listState.refreshing = false
+        state.isClick = false
+      }
+    }
+
+    const onRefresh = () => {
+      state.params.page = 1
+      state.list = []
+      state.listState.dataShow = true // 判断是否有数据
+      state.listState.loading = false
+      state.listState.finished = false
+      getList()
+    }
+
+    onMounted(async () => {
+      getOrchestras()
+    })
+    return () => (
+      <div class={styles.orchestraStory}>
+        <OHeader>
+          {{
+            right: () => (
+              <span
+                style={{ color: '#777777' }}
+                onClick={() => {
+                  router.push('/story-operation')
+                }}
+              >
+                添加
+              </span>
+            )
+          }}
+        </OHeader>
+
+        {state.orchestraList.length > 0 && (
+          <CellGroup inset class={styles.cellGroup}>
+            <Cell
+              title={state.selectOrchestra.text || ' '}
+              isLink
+              center
+              onClick={() => (state.orchestraStatus = true)}
+            ></Cell>
+          </CellGroup>
+        )}
+
+        {state.listState.dataShow ? (
+          <OFullRefresh
+            v-model:modelValue={state.listState.refreshing}
+            onRefresh={onRefresh}
+            style={{
+              minHeight: `calc(100vh - ${state.listState.height}px)`
+            }}
+          >
+            <List
+              v-model:loading={state.listState.loading}
+              finished={state.listState.finished}
+              finishedText=" "
+              class={[styles.liveList]}
+              onLoad={getList}
+              immediateCheck={false}
+            >
+              <Steps direction="vertical" class={styles.storySteps}>
+                {state.list.map((item: any) => (
+                  <Step
+                    v-slots={{
+                      'inactive-icon': () => <Image src={iconStep} class={styles.iconInactive} />,
+                      'active-icon': () => (
+                        <Image src={iconStepCalendar} class={styles.iconActive} />
+                      )
+                    }}
+                  >
+                    <div class={styles.stepTimes}>
+                      <div class={styles.stepTime}>11:07:06</div>
+                      <span class={styles.stepEdit}>
+                        <Icon name={iconEdit} />
+                        编辑
+                      </span>
+                    </div>
+                    <p class={styles.content}>乐团正式交付</p>
+
+                    <Swipe class={styles.storySwipe}>
+                      <SwipeItem>
+                        <Image
+                          src={
+                            'https://lanhu-dds-backend.oss-cn-beijing.aliyuncs.com/merge_image/imgs/756ce648617644ef90bf4556417c5fa7_mergeImage.png'
+                          }
+                          class={styles.swipeImg}
+                        />
+                      </SwipeItem>
+                    </Swipe>
+                  </Step>
+                ))}
+              </Steps>
+            </List>
+          </OFullRefresh>
+        ) : (
+          <OEmpty btnStatus={false} tips="暂无事迹" />
+        )}
+
+        <Popup v-model:show={state.orchestraStatus} position="bottom" round>
+          <Picker
+            columns={state.orchestraList}
+            onCancel={() => (state.orchestraStatus = false)}
+            onConfirm={(val: any) => {
+              state.selectOrchestra = val.selectedOptions[0]
+              state.orchestraStatus = false
+
+              onRefresh()
+            }}
+          />
+        </Popup>
+      </div>
+    )
+  }
+})

+ 76 - 0
src/school/orchestra-story/story-operation/index.module.less

@@ -0,0 +1,76 @@
+.cellGroup {
+  margin: 12px 13px;
+  border-radius: 10px;
+  overflow: hidden;
+  --van-uploader-size: 94px;
+  :global {
+    .van-cell {
+      padding: 18px 15px;
+      font-size: 16px;
+      color: #333333;
+    }
+    .van-cell__right-icon {
+      font-size: 13px;
+      font-weight: bold;
+      color: #d8d8d8;
+    }
+  }
+
+  .title {
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    .nums {
+      font-size: 14px;
+      color: #999999;
+    }
+  }
+
+  :global {
+    .van-cell {
+      font-size: 16px;
+      padding: 18px 12px;
+    }
+    .van-cell__value {
+      color: #333;
+    }
+
+    .van-radio-group {
+      justify-content: flex-end;
+    }
+  }
+
+  // .radioSection {
+  //   position: relative;
+  //   min-width: 32px;
+  //   justify-content: center;
+  // }
+
+  // .radioItem {
+  //   position: absolute;
+  //   top: 0;
+  //   left: 0;
+  //   right: 0;
+  //   bottom: 0;
+  //   opacity: 0;
+  // }
+
+  // .radioSection + .radioSection {
+  //   margin-left: 12px;
+  // }
+}
+
+.uploader {
+  :global {
+    .van-uploader__upload {
+      width: 102px;
+      height: 94px;
+      background-color: #fff;
+    }
+    .van-uploader__upload-icon,
+    .van-icon__image {
+      width: 100%;
+      height: 100%;
+    }
+  }
+}

+ 221 - 0
src/school/orchestra-story/story-operation/index.tsx

@@ -0,0 +1,221 @@
+import OSticky from '@/components/o-sticky'
+import request from '@/helpers/request'
+import dayjs from 'dayjs'
+import {
+  Button,
+  Cell,
+  CellGroup,
+  closeToast,
+  DatePicker,
+  Field,
+  Picker,
+  Popup,
+  Radio,
+  RadioGroup,
+  showLoadingToast,
+  showToast,
+  Tag,
+  Uploader
+} from 'vant'
+import { getOssUploadUrl } from '@/state'
+import umiRequest from 'umi-request'
+import { defineComponent, onMounted, reactive } from 'vue'
+import styles from './index.module.less'
+import iconUpload from '../images/icon-upload.png'
+import iconUploadVideo from '../images/icon-upload-video.png'
+import iconUploadVideoCover from '../images/icon-upload-video-cover.png'
+import OUploadAll from '@/components/o-upload-all'
+
+export default defineComponent({
+  name: 'story-operation',
+  setup() {
+    const forms = reactive({
+      bucket: 'daya',
+      content: '',
+      orchestraStatus: false,
+      orchestraList: [] as any,
+      selectOrchestra: {} as any,
+      createTime: new Date() as any,
+      createTimeStatus: false,
+      currentDate: [dayjs().format('YYYY'), dayjs().format('MM'), dayjs().format('DD')],
+      storyType: 'IMAGE',
+      attachments: [] as any, //群发消息附件
+
+      video: [] as any,
+      videoCover: [] as any
+    })
+
+    // 获取乐团列表
+    const getOrchestras = async () => {
+      try {
+        const { data } = await request.post('/api-school/orchestra/page', {
+          data: {
+            page: 1,
+            rows: 100
+          }
+        })
+        const temps = data.rows || []
+        const s = [] as any
+        temps.forEach((item: any) => {
+          s.push({
+            text: item.name,
+            value: item.id
+          })
+        })
+        forms.orchestraList = [...s]
+
+        // 判断是否有乐团
+        if (s.length > 0) {
+          forms.selectOrchestra = s[0]
+        }
+      } catch {
+        //
+      }
+    }
+
+    onMounted(() => {
+      getOrchestras()
+    })
+    return () => (
+      <div class={styles.storyOperation}>
+        <CellGroup inset class={styles.cellGroup}>
+          <Field
+            inputAlign="right"
+            label="所属乐团"
+            modelValue={forms.selectOrchestra.text}
+            placeholder="请选择所属乐团"
+            onClick={() => {
+              forms.orchestraStatus = true
+            }}
+            readonly
+            isLink
+          />
+          <Field
+            inputAlign="right"
+            label="发送时间"
+            modelValue={forms.createTime ? dayjs(forms.createTime).format('YYYY-MM-DD') : ''}
+            placeholder="请选择发送时间"
+            onClick={() => {
+              forms.createTimeStatus = true
+            }}
+            readonly
+            isLink
+            class={styles.inputForm}
+          />
+        </CellGroup>
+
+        <CellGroup inset class={styles.cellGroup}>
+          <Cell title="事迹内容">
+            {{
+              title: () => (
+                <div class={styles.title}>
+                  <div class={styles.name}>退团原因</div>
+                  <div class={styles.nums}>{forms.content.length || 0}/200</div>
+                </div>
+              ),
+              label: () => (
+                <Field
+                  style={{ padding: '0', marginTop: '12px' }}
+                  placeholder="请输入乐团事迹内容"
+                  type="textarea"
+                  rows={3}
+                  v-model={forms.content}
+                  maxlength={200}
+                />
+              )
+            }}
+          </Cell>
+        </CellGroup>
+
+        <CellGroup inset class={styles.cellGroup}>
+          <Cell title="事迹资料类型" center>
+            {{
+              value: () => (
+                <RadioGroup
+                  checked-color="#FF8057"
+                  v-model={forms.storyType}
+                  direction="horizontal"
+                >
+                  <Radio class={styles.radioItem} name={'IMAGE'}>
+                    图片
+                  </Radio>
+                  <Radio class={styles.radioItem} name={'VIDEO'}>
+                    视频
+                  </Radio>
+                </RadioGroup>
+              )
+            }}
+          </Cell>
+          {forms.storyType === 'IMAGE' && (
+            <Cell center>
+              {{
+                title: () => (
+                  <OUploadAll
+                    style={{ marginBottom: '12px' }}
+                    v-model:modelValue={forms.attachments}
+                    // maxCount={9}
+                    uploadIcon={iconUpload}
+                  />
+                )
+              }}
+            </Cell>
+          )}
+          {forms.storyType === 'VIDEO' && (
+            <Cell center titleStyle={{ display: 'flex' }}>
+              {{
+                title: () => (
+                  <>
+                    <OUploadAll
+                      style={{ marginBottom: '12px' }}
+                      v-model:modelValue={forms.videoCover}
+                      accept="video/*"
+                      uploadIcon={iconUploadVideo}
+                      deletable={false}
+                    />
+
+                    <OUploadAll
+                      style={{ marginBottom: '12px' }}
+                      v-model:modelValue={forms.videoCover}
+                      uploadIcon={iconUploadVideoCover}
+                    />
+                  </>
+                )
+              }}
+            </Cell>
+          )}
+        </CellGroup>
+
+        <OSticky position="bottom">
+          <div class={'btnGroup'}>
+            <Button round block type="primary">
+              保存
+            </Button>
+          </div>
+        </OSticky>
+
+        <Popup v-model:show={forms.createTimeStatus} position="bottom" round>
+          <DatePicker
+            maxDate={new Date()}
+            v-model={forms.currentDate}
+            onConfirm={(val: any) => {
+              const selectedValues = val.selectedValues.join('-')
+              forms.createTime = dayjs(selectedValues).toDate()
+              forms.createTimeStatus = false
+            }}
+          />
+        </Popup>
+
+        <Popup v-model:show={forms.orchestraStatus} position="bottom" round>
+          <Picker
+            columns={forms.orchestraList}
+            onCancel={() => (forms.orchestraStatus = false)}
+            onConfirm={(val: any) => {
+              forms.selectOrchestra = val.selectedOptions[0]
+              forms.orchestraStatus = false
+            }}
+          />
+        </Popup>
+      </div>
+    )
+  }
+})

+ 2 - 2
src/school/train-planning/modal/timer/index.tsx

@@ -194,10 +194,10 @@ export default defineComponent({
           {state.useTimer.map((item: any) => (
           {state.useTimer.map((item: any) => (
             <Cell
             <Cell
               center
               center
-              title={`${dayjs(item.startTime).format('HH:mm')}~${dayjs(item.endTime).format(
+              value={`${dayjs(item.startTime).format('HH:mm')}~${dayjs(item.endTime).format(
                 'HH:mm'
                 'HH:mm'
               )}`}
               )}`}
-              value="可选时间"
+              title="可选时间"
             ></Cell>
             ></Cell>
           ))}
           ))}