浏览代码

修改学生端交卷的参数,新增开放平台页面

XW 4 年之前
父节点
当前提交
496047b7d7

+ 2 - 2
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperTest.vue

@@ -469,7 +469,7 @@
                 this.WarmMessageisOpen = false
                 if (this.checkers.length) {
                     this.isLoading = true;
-                    let codes = this.$store.getters.getItemTitle.code.split('-')
+                    let codes = this.$store.getters.getItemTitle.scope == 'school' ? this.$store.getters.getItemTitle.school : this.$store.getters.getItemTitle.creatorId
                     let req = {
                         id: this.$store.getters.getItemTitle.id,
                         answer: this.checkers,
@@ -478,7 +478,7 @@
                         subjectId: this.$store.getters.getExamInfo.subject.id,
                         multipleRule: this.$store.getters.getExamInfo.multipleRule,
                         paperId: this.$store.getters.getPaperInfo.id,
-                        code: codes[1],
+                        code: codes,
                         scode: this.$store.getters.getItemTitle.scode
                     }
                     this.$api.studentWeb.SaveStuExamPaper(req).then(res => {

+ 2 - 2
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue

@@ -110,11 +110,11 @@
                 this.isLoad = true
                 if (this.$store.getters.getItemTitle.name !== undefined) {
                     let paper = this.$store.getters.getItemTitle
-                    let codes = this.$store.getters.getItemTitle.code.split('-')
+                    let codes = this.$store.getters.getItemTitle.scope == 'school' ? this.$store.getters.getItemTitle.school : this.$store.getters.getItemTitle.creatorId
                     let req = {
                         id: paper.id,
                         studentId: this.$store.state.userInfo.sub,
-                        code: codes[1],
+                        code: codes,
                         scode: paper.scode
                     }
                     this.paperCtn = paper.scope

+ 4 - 1
TEAMModelOS/ClientApp/src/view/settings/Index.vue

@@ -54,6 +54,7 @@
             </div>
             <SchoolMgmt v-if="activeTab === '1'" class="animated fadeIn"></SchoolMgmt>
             <OpenMgmt v-if="activeTab === '2'" class="animated fadeIn"></OpenMgmt>
+            <!-- <OpenMgmt2 v-if="activeTab === '2'" class="animated fadeIn"></OpenMgmt2> -->
         </div>
     </div>
 </template>
@@ -62,10 +63,12 @@
     //import "@/css/less-variable.less"
     import SchoolMgmt from './SchoolMgmt.vue'
     import OpenMgmt from './OpenMgmt.vue'
+    import OpenMgmt2 from './OpenMgmt2.vue';
     export default {
         components: {
             SchoolMgmt,
-            OpenMgmt
+            OpenMgmt,
+            OpenMgmt2
         },
         data() {
             return {

+ 93 - 0
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt2.css

@@ -0,0 +1,93 @@
+.open-mgmt {
+  display: flex;
+  height: 100%;
+}
+.open-mgmt .open-header {
+  width: 100%;
+  padding: 0 20px;
+  overflow: hidden;
+}
+.open-mgmt .open-header .open-action {
+  float: right;
+}
+.open-mgmt .open-header .open-action > div {
+  cursor: pointer;
+}
+.open-mgmt .open-mgmt-left {
+  width: 20%;
+}
+.open-mgmt .open-mgmt-left .open-left-list {
+  margin-left: 10px;
+}
+.open-mgmt .open-mgmt-left .open-left-list .open-list {
+  height: 70px;
+  line-height: 70px;
+  font-size: 16px;
+  padding-left: 10px;
+  font-weight: 300;
+  color: #fff;
+}
+.open-mgmt .open-mgmt-left .open-left-list .list-select {
+  background-image: linear-gradient(90deg, rgba(30, 30, 30, 0) 0%, rgba(110, 110, 110, 0.2) 50%, rgba(110, 110, 110, 0.4) 100%);
+}
+.open-mgmt .open-mgmt-right {
+  width: 80%;
+}
+.open-mgmt .open-mgmt-right .open-action {
+  display: flex;
+}
+.open-mgmt .open-mgmt-right .open-action > div:first-child {
+  margin-right: 20px;
+}
+.open-mgmt .open-mgmt-right .open-action > div > span {
+  display: inline-block;
+  margin-left: 5px;
+}
+.open-mgmt .open-mgmt-right .open-right-info {
+  display: flex;
+  height: 100%;
+}
+.open-mgmt .open-mgmt-right .open-right-info .open-info {
+  width: 30%;
+  padding: 20px 20px 20px 20px;
+}
+.open-mgmt .open-mgmt-right .open-right-info .open-info .ivu-form-item:not(:first-child) {
+  margin-top: 30px;
+}
+.open-mgmt .open-mgmt-right .open-right-info .open-info .api-token {
+  position: relative;
+}
+.open-mgmt .open-mgmt-right .open-right-info .open-info .api-token .api-icon {
+  position: absolute;
+  top: -33px;
+  right: 0;
+}
+.open-mgmt .open-mgmt-right .open-right-info .open-api {
+  width: 70%;
+  padding: 20px 20px 20px 20px;
+}
+.open-mgmt .open-mgmt-right .open-right-info .open-api .open-api-header {
+  height: 40px;
+}
+.open-list,
+.open-header,
+.open-info-header,
+.open-api-header {
+  border-bottom: 1px solid #424242;
+}
+.open-mgmt-left,
+.open-info {
+  border-right: 1px solid #424242;
+}
+.open-header,
+.open-info-header,
+.open-api-header {
+  color: #949494;
+  height: 40px;
+  line-height: 40px;
+  padding-left: 20px;
+}
+.open-action i,
+.api-icon i {
+  cursor: pointer;
+}

+ 120 - 0
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt2.less

@@ -0,0 +1,120 @@
+.open-mgmt{
+    display: flex;
+    height: 100%;
+
+    .open-header{
+        width: 100%;
+        padding: 0 20px;
+        
+        overflow: hidden;
+
+        .open-action{
+            float: right;
+
+            & > div{
+                cursor: pointer;
+            }
+        }
+    }
+
+    .open-mgmt-left{
+        width: 20%;
+
+        
+        .open-left-list{
+            margin-left: 10px;
+
+            .open-list{
+                height: 70px;
+                line-height: 70px;
+                font-size: 16px;
+                padding-left: 10px;
+                font-weight: 300;
+                color: #fff;
+            }
+            .list-select{
+                background-image: linear-gradient(90deg, 
+                                                rgba(30, 30, 30, 0) 0%, 
+                                                rgba(110, 110, 110, 0.2) 50%, 
+                                                rgba(110, 110, 110, 0.4) 100%);
+            }
+            
+        }
+    }
+    
+    .open-mgmt-right{
+        width: 80%;
+
+        .open-action{
+            display: flex;
+
+            & > div:first-child{
+                margin-right: 20px;
+                
+            }
+            & > div > span{
+                display: inline-block;
+                margin-left: 5px;
+            }
+        }
+
+        .open-right-info{
+            display: flex;
+            height: 100%;
+
+            .open-info{
+                width: 30%;
+                padding: 20px 20px 20px 20px;
+      
+                .ivu-form-item:not(:first-child){
+                    margin-top: 30px;
+                }
+
+                .api-token{
+                    position: relative;
+                    .api-icon{
+                        position: absolute;
+                        top: -33px;
+                        right: 0;
+
+                    }
+                }
+            }
+            
+            .open-api{
+                width: 70%;
+                padding: 20px 20px 20px 20px;
+
+                .open-api-header{
+                    height: 40px;
+                }
+            }
+        }
+    }
+}
+
+.open-list,
+.open-header,
+.open-info-header,
+.open-api-header{
+    border-bottom: 1px solid #424242;
+}
+
+.open-mgmt-left,
+.open-info{
+    border-right: 1px solid #424242;
+}
+
+.open-header,
+.open-info-header,
+.open-api-header{
+    color: #949494;
+    height: 40px;
+    line-height: 40px;
+    padding-left: 20px;
+}
+
+.open-action i,
+.api-icon i{
+    cursor: pointer;
+}

+ 176 - 0
TEAMModelOS/ClientApp/src/view/settings/OpenMgmt2.vue

@@ -0,0 +1,176 @@
+<template>
+    <div class="open-mgmt">
+        <!-- 列表 -->
+        <div class="open-mgmt-left">
+            <div class="open-header">
+                <span>开放平台列表</span>
+                <div class="open-action">
+                    <Icon type="md-add" size="18" style="margin-right: 10px" @click="editOpen(true)" />
+                    <Icon type="ios-create" size="18" style="margin-right: 10px" @click="editOpen(true)" />
+                    <Icon type="md-trash" size="18" @click="delOpen" />
+                </div>
+            </div>
+            <div class="open-left-list">
+                <div :class="['open-list', index == nowIndex ? 'list-select': '']"
+                     v-for="(item, index) in openList"
+                     :key="index"
+                     @click="list(index)"
+                >
+                    <span>{{ item.name }}</span>
+                </div>
+            </div>
+        </div>
+        <!-- 信息 -->
+        <div class="open-mgmt-right">
+            <div class="open-header">
+                <span>平台信息</span>
+                <div class="open-action" v-show="isEdit">
+                    <div @click="editMgmt(false)">
+                        <Icon type="md-checkmark-circle" size="18" />
+                        <span>保存平台</span>
+                    </div>
+                    <div @click="editMgmt(false)">
+                        <Icon type="md-close-circle" size="18" />
+                        <span>取消编辑</span>
+                    </div>
+                </div>
+            </div>
+            <div class="open-right-info">
+                <div class="open-info">
+                    <!-- 基本信息 -->
+                    <!-- <div class="open-info-header">
+                        <span>基本信息</span>
+                    </div> -->
+                    <div class="dark-iview-form disabled-iview-input">
+                        <Form :model="openMgInfo" label-position="top">
+                            <FormItem label="授权学校">
+                                <Input v-model="openMgInfo.school" disabled>XXXXXX学校</Input>
+                            </FormItem>
+                            <FormItem label="应用名称">
+                                <Input v-model="openMgInfo.name"></Input>
+                            </FormItem>
+                            <FormItem label="ApiToken" class="api-token" v-show="!isEdit">
+                                <div class="api-icon">
+                                    <Icon type="md-refresh" size="18" style="margin-right: 10px" />
+                                    <Icon type="ios-copy" size="18" />
+                                </div>
+                                <Input
+                                    v-model="openMgInfo.token"
+                                    type="textarea"
+                                    :autosize="{ minRows: 2, maxRows: 5 }"
+                                    disabled
+                                ></Input>
+                            </FormItem>
+                            <FormItem label="描述">
+                                <Input v-model="openMgInfo.des" type="textarea"></Input>
+                            </FormItem>
+                            <FormItem label="状态">
+                                <RadioGroup v-model="openMgInfo.type">
+                                    <Radio label="male">启用</Radio>
+                                    <Radio label="female">禁用</Radio>
+                                </RadioGroup>
+                            </FormItem>
+                        </Form>
+                    </div>
+                </div>
+                <div class="open-api dark-iview-table">
+                    <!-- Api列表 -->
+                    <!-- <div class="open-api-header">
+                        <span>Api列表</span>
+                    </div> -->
+                    <Table :columns="apiListCol" :data="apiList"></Table>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            // 开放平台列表
+            openList: [
+                {
+                    name: "fvrhrthtyjhtyhregr",
+                },
+                {
+                    name: "mfghgjyj",
+                }
+            ],
+            // 平台信息
+            openMgInfo:{
+                school: "XXXXXXXXXX学校",
+                name: "",
+                des: "",
+                type: "",
+                token: "zcnjkdfjoiwfjergerghwfhefvsojfoergjorhbnfbkdnvjeroiguitrghbfdvneavnesvbnrbnkbnbrgeirgre"
+            },
+            // api表头
+            apiListCol: [
+                {
+                    title: '全选',
+                    key: 'action',
+                    render: (h, params) => {
+                        return h('div', [
+                            h('Checkbox', {
+                                props: {
+                                    size: 'small'
+                                },
+                                style: {
+                                    // marginRight: '5px'
+                                },
+                                on: {
+                                    click: () => {
+                                        console.log(params);
+                                    }
+                                }
+                            }, 'View'),
+                        ]);
+                    }
+                },
+                {
+                    title: "接口名称",
+                    key: "name",
+                },
+                {
+                    title: "接口地址",
+                    key: "address",
+                },
+                {
+                    title: "请求方法",
+                    key: "method",
+                },
+                {
+                    title: "描述",
+                    key: "des",
+                },
+            ],
+            // api列表
+            apiList: [],
+            // 当前下标
+            nowIndex: 0,
+            isEdit: false,
+        }
+    },
+    methods: {
+        editOpen (type) {
+            this.isEdit = type
+        },
+        delOpen () {
+            this.openList
+        },
+        list (index) {
+            this.nowIndex = index
+        },
+        // 编辑平台信息
+        editMgmt (type) {
+            this.isEdit = type
+        }
+    }
+}
+</script>
+
+<style lang="less" scoped>
+    @import "./OpenMgmt2.less";
+</style>