Browse Source

添加学校编号

lex 1 year ago
parent
commit
14040c66f0

+ 4 - 2
src/school/orchestra/compontent/photo-create.tsx

@@ -68,7 +68,8 @@ export default defineComponent({
             data: {
               orchestraId: route.query.orchestraId,
               name: state.photoName,
-              parentId: route.query.parentId
+              parentId: route.query.parentId,
+              schoolId: route.query.schoolId
             }
           })
           // setTimeout(() => {
@@ -121,7 +122,8 @@ export default defineComponent({
           data: {
             ...state.params,
             orchestraId: route.query.orchestraId,
-            parentId: route.query.parentId
+            parentId: route.query.parentId,
+            schoolId: route.query.schoolId
           }
         })
         state.listState.loading = false

+ 21 - 16
src/school/orchestra/compontent/photo.tsx

@@ -68,7 +68,8 @@ export default defineComponent({
         if (state.selectType === 'add') {
           await request.post(baseState.platformApi + '/orchestraPhotoAlbum/save', {
             data: {
-              name: state.photoName
+              name: state.photoName,
+              schoolId: state.school.id
             }
           })
           state.status = false
@@ -163,7 +164,8 @@ export default defineComponent({
         query: {
           orchestraId: route.query.id,
           name: item.name,
-          parentId: item.id
+          parentId: item.id,
+          schoolId: item.schoolId
         }
       })
       // router.push({
@@ -226,20 +228,23 @@ export default defineComponent({
               </Cell>
             </CellGroup>
           )}
-          <div class={styles.btnGroup}>
-            <Button
-              icon="plus"
-              block
-              class={styles.addPhone}
-              onClick={() => {
-                state.photoName = ''
-                state.status = true
-                state.selectType = 'add'
-              }}
-            >
-              新建相册
-            </Button>
-          </div>
+          {((baseState.platformType === 'TEACHER' && !!state.schoolList.length) ||
+            baseState.platformType === 'SCHOOL') && (
+            <div class={styles.btnGroup}>
+              <Button
+                icon="plus"
+                block
+                class={styles.addPhone}
+                onClick={() => {
+                  state.photoName = ''
+                  state.status = true
+                  state.selectType = 'add'
+                }}
+              >
+                新建相册
+              </Button>
+            </div>
+          )}
         </OSticky>
         {/* <Sticky position="top" offsetTop={props.height} style={{ width: '100%' }}>
           <Cell class={styles.select} center isLink onClick={() => (state.schoolStatus = true)}>