Explorar o código

处理添加应用表单

zhousheng %!s(int64=4) %!d(string=hai) anos
pai
achega
9a75287ed9
Modificáronse 1 ficheiros con 32 adicións e 246 borrados
  1. 32 246
      TEAMModelOS/ClientApp/src/view/settings/OpenMgmt.vue

+ 32 - 246
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt.vue

@@ -74,13 +74,30 @@
                     <FormItem label="app_secret:" prop="secret">
                     <FormItem label="app_secret:" prop="secret">
                         <Input v-model="formValidate.secret" placeholder="请输入app_secret"></Input>
                         <Input v-model="formValidate.secret" placeholder="请输入app_secret"></Input>
                     </FormItem>
                     </FormItem>
-                    <FormItem label="应用图标:" prop="desc">
+                    <FormItem label="应用图标:">
                         <Upload>
                         <Upload>
                             <Button icon="ios-cloud-upload-outline">点击上传图片</Button>
                             <Button icon="ios-cloud-upload-outline">点击上传图片</Button>
                         </Upload>
                         </Upload>
                     </FormItem>
                     </FormItem>
+                    <FormItem label="功能模块" prop="model">
+                        <CheckboxGroup v-model="formValidate.model">
+                            <Checkbox label="模块一"></Checkbox>
+                            <Checkbox label="模块二"></Checkbox>
+                            <Checkbox label="模块三"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                            <Checkbox label="模块四"></Checkbox>
+                        </CheckboxGroup>
+                    </FormItem>
+                    <FormItem label="限制连接次数:" prop="num">
+                        <Select v-model="formValidate.num" :autosize="{minRows: 2,maxRows: 5}" placeholder="不限制"></Select>
+                    </FormItem>
                     <FormItem label="账号ID:" prop="id">
                     <FormItem label="账号ID:" prop="id">
-                        <Input v-model="formValidate.desc"  :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入账号ID"></Input>
+                        <Input v-model="formValidate.id" :autosize="{minRows: 2,maxRows: 5}" placeholder="请输入账号ID"></Input>
                     </FormItem>
                     </FormItem>
                     <FormItem>
                     <FormItem>
                         <Button type="primary">提交</Button>
                         <Button type="primary">提交</Button>
@@ -131,15 +148,13 @@
                         slot: 'action',
                         slot: 'action',
                     }
                     }
                 ],
                 ],
-                  formValidate: {
+                formValidate: {
                     name: '',
                     name: '',
-                    mail: '',
-                    city: '',
-                    gender: '',
-                    interest: [],
-                    date: '',
-                    time: '',
-                    desc: ''
+                    key: '',
+                    secret: '',
+                    id: '',
+                    model: [],
+                    num:0
                 },
                 },
                 ruleValidate: {
                 ruleValidate: {
                     name: [
                     name: [
@@ -151,23 +166,15 @@
                     secret: [
                     secret: [
                         { required: true, message: '请输入app_secret', trigger: 'change' }
                         { required: true, message: '请输入app_secret', trigger: 'change' }
                     ],
                     ],
-                    gender: [
-                        { required: true, message: 'Please select gender', trigger: 'change' }
+                    id: [
+                        { required: true, message: '请输入使用者ID', trigger: 'change' }
                     ],
                     ],
-                    interest: [
-                        { required: true, type: 'array', min: 1, message: 'Choose at least one hobby', trigger: 'change' },
-                        { type: 'array', max: 2, message: 'Choose two hobbies at best', trigger: 'change' }
+                    num: [
+                        { required: true, type: 'number', min: 1,message: '请输入使用者ID', trigger: 'change' }
                     ],
                     ],
-                    date: [
-                        { required: true, type: 'date', message: 'Please select the date', trigger: 'change' }
+                    model: [
+                        { required: true, type: 'array', min: 1, message: '选择需要的功能模块', trigger: 'change' }
                     ],
                     ],
-                    time: [
-                        { required: true, type: 'string', message: 'Please select time', trigger: 'change' }
-                    ],
-                    desc: [
-                        { required: true, message: 'Please enter a personal introduction', trigger: 'blur' },
-                        { type: 'string', min: 20, message: 'Introduce no less than 20 words', trigger: 'blur' }
-                    ]
                 }
                 }
             }
             }
         },
         },
@@ -202,193 +209,11 @@
                 return y + '-' + m + '-' + d;
                 return y + '-' + m + '-' + d;
             },
             },
             changePage() {
             changePage() {
-                // The simulated data is changed directly here, and the actual usage scenario should fetch the data from the server
                 this.tableData1 = this.mockTableData1();
                 this.tableData1 = this.mockTableData1();
             },
             },
-            async initTeacherInfo() {
-                let teacherInfo = await this.getTeacherInfo()
-                this.teacherInfo = teacherInfo
-                this.mySchoolList = teacherInfo.schools || []
-                this.originMySchoolList = JSON.parse(JSON.stringify(this.mySchoolList))
-            },
-
-            /* 前往学校 */
-            onGoSchool(school) {
-                this.curSchoolItem = school
-                this.goSchoolModal = true
-            },
-
-            /* 获取老师的个人清单信息 */
-            getTeacherInfo() {
-                return new Promise((r, j) => {
-                    //this.isLoading = true
-                    this.$api.schoolSetting.getTeacherInfo({
-                        id_token: localStorage.getItem('id_token')
-                    }).then(
-                        (res) => {
-                            if (!res.error) {
-                                r(res)
-                                //this.isLoading = false
-                            }
-                        },
-                        (err) => {
-                            console.log(err)
-                            this.$Message.error("数据获取失败!")
-                        }
-                    )
-                })
-
-            },
-
-            /* 获取老师所在学校的信息 */
-            getTeacherSchoolInfo(code) {
-                return new Promise((r, j) => {
-                    this.$api.schoolSetting.getTeacherSchoolInfo({
-                        id_token: localStorage.getItem('id_token'),
-                        school_code: code
-                    }).then(
-                        (res) => {
-                            if (!res.error) {
-                                r(res)
-                            }
-                        },
-                        (err) => {
-                            this.$Message.error("数据获取失败!")
-                        }
-                    )
-                })
-            },
-
-            /* 获取所有授权学校列表 */
-            getAllShoolList() {
-                this.$api.schoolSetting.getSchoolList().then(
-                    (res) => {
-                        if (!res.error) {
-                            this.schoolList = res.schools || []
-                            this.originSchoolList = JSON.parse(JSON.stringify(res.schools))
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error("数据获取失败!")
-                    }
-                )
-            },
-
-            /* 申请加入学校 */
-            onJoinSchool(item) {
-                this.$Modal.confirm({
-                    title: this.$t('settings.modalTip4'),
-                    content: this.$t('settings.modalTip5') + item.name + ' ?',
-                    onOk: () => {
-                        this.$api.schoolSetting.joinSchool({
-                            grant_type: 'request',
-                            school_code: item.id,
-                            school_name: item.name
-                        }).then(
-                            (res) => {
-                                console.log(res)
-                                if (!res.error) {
-                                    this.$Message.success(this.$t('settings.submitSucTips'))
-                                    this.initTeacherInfo()
-                                    this.getAllShoolList()
-                                }
-                            },
-                            (err) => {
-                                this.$Message.error(this.$t('settings.submitFailTips'))
-                            }
-                        )
-                    },
-                    onCancel: () => {
-                    }
-                })
-            },
-
-            /* 同意邀请 */
-            onConfirmJoin(item) {
-                console.log(item)
-                this.$Modal.confirm({
-                    title: this.$t('settings.modalTip4'),
-                    content: this.$t('settings.modalTip5') + item.name + ' ?',
-                    onOk: () => {
-                        this.$api.schoolSetting.joinSchool({
-                            grant_type: 'join',
-                            school_code: item.schoolId,
-                            school_name: item.name
-                        }).then(
-                            async (res) => {
-                                console.log(res)
-                                if (!res.error) {
-                                    this.$Message.success(this.$t('settings.joinSucTips'))
-                                    // 如果之前用户没有加入任何学校
-                                    if (this.mySchoolList.length && this.mySchoolList.filter(i => i.status === 'join').length === 0) {
-                                        let teacherInfo = await this.getTeacherInfo()
-                                        let schoolCode = item.schoolId
-                                        let schoolInfo = await this.getTeacherSchoolInfo(schoolCode)
-                                        this.$EventBus.$emit('onChangeSchool', {
-                                            user: teacherInfo,
-                                            schoolCode: schoolCode,
-                                            isFirst: true
-                                        })
-                                        this.$EventBus.$off('onChangeSchool')
-                                    } else {
-                                        this.initTeacherInfo()
-                                    }
-                                }
-                            },
-                            (err) => {
-                                this.$Message.error(this.$t('settings.submitFailTips'))
-                            }
-                        )
-                    },
-                    onCancel: () => {
-                    }
-                })
-            },
-
-            /* 前往学校 */
-            async onChangeSchool() {
-                console.log('触发切换学校')
-                this.$EventBus.$emit('onChangeSchool', {
-                    user: this.teacherInfo,
-                    schoolCode: this.curSchoolItem.schoolId
-                })
-                this.goSchoolModal = false
-            },
-
-            /* 搜索我的学校 */
-            onSearchChange(val) {
-                this.mySchoolList = this.originMySchoolList.length ? this.originMySchoolList.filter(item => item.name.indexOf(this.mySchoolSearch) > -1) : []
-            },
-
-            /* 搜索学校清单 */
-            onSearchList(val) {
-                this.schoolList = this.originSchoolList.length ? this.originSchoolList.filter(item => item.name.indexOf(this.schoolListSearch) > -1) : []
-            },
-
         },
         },
         computed: {
         computed: {
-            statusFilter() {
-                return status => {
-                    return status === 'join' ? this.$t('settings.status1') : status === 'invite' ? this.$t('settings.status2') : this.$t('settings.status3')
-                }
-            },
-            bgFilter() {
-                return status => {
-                    return status === 'join' ? '#1CC0F3' : status === 'invite' ? '#ea6223' : '#019eff'
-                }
-            },
-            tbStatusFilter() {
-                return id => {
-                    // 判断当前学校是否已加入
-                    let isJoin = this.mySchoolList.filter(i => i.status === 'join').map(j => j.schoolId).indexOf(id) > -1
-                    let isInvite = this.mySchoolList.filter(i => i.status === 'invite').map(j => j.schoolId).indexOf(id) > -1
-                    let isRequest = this.mySchoolList.filter(i => i.status === 'request').map(j => j.schoolId).indexOf(id) > -1
-                    return isJoin ? this.$t('settings.status1') : isInvite ? this.$t('settings.status2') : isRequest ? this.$t('settings.status3') : this.$t('settings.requestJoin')
-                }
-            },
-            curSchool() {
-                return this.$store.state.userInfo.schoolCode
-            }
+
         }
         }
     }
     }
 </script>
 </script>
@@ -487,46 +312,7 @@
     background: #5C5A5A;
     background: #5C5A5A;
     }
     }
     }
     }
-    }
 
 
-    .go-school-modal {
-        .ivu-modal-content
 
 
-    {
-        background: #3f3f3f;
-        color: #b6b6b6;
-    }
-
-    p {
-        text-align: center;
-        font-size: 16px;
-        margin: 10px 0;
-        &:first-child
-
-    {
-        font-size: 20px;
-        font-weight: bold;
-        color: #1CC0F3;
-        margin: 30px 0;
-    }
-
-    &:nth-child(3) {
-        color: #fff;
-        font-weight: bold;
-        font-size: 18px;
-        margin: 20px 0;
-    }
-
-    }
-
-    .ivu-btn {
-        background: #1CC0F3;
-        color: #fff;
-        border-radius: 0;
-        width: 80%;
-        height: 45px;
-        margin: 30px 10%;
-        border: none;
-    }
     }
     }
 </style>
 </style>