Przeglądaj źródła

Merge branch 'develop' of http://52.130.252.100:10000/TEAMMODEL/TEAMModelOS into develop

CrazyIter_Bin 1 rok temu
rodzic
commit
8d9a373014

+ 129 - 25
TEAMModelOS/ClientApp/src/view/signupActivity/createActivity.vue

@@ -137,19 +137,15 @@
                                                     </span>
                                                     </span>
                                                 </FormItem>
                                                 </FormItem>
                                                 <FormItem label="填报信息">
                                                 <FormItem label="填报信息">
-                                                    <CheckboxGroup v-model="contestData.sign.field">
+                                                    <CheckboxGroup v-model="fields">
                                                         <Checkbox v-for="(item, index) in infoArr" :key="index" :label="item.value">
                                                         <Checkbox v-for="(item, index) in infoArr" :key="index" :label="item.value">
                                                             <span>
                                                             <span>
                                                                 {{ item.label }}
                                                                 {{ item.label }}
+                                                                <Icon type="md-create" size="18" color="orange" v-show="index > 4" @click.stop.native.prevent="changeFiled(2, item)" />
                                                                 <Icon type="md-trash" size="16" color="#6e6e6e" v-show="item.value === item.label" @click.stop.native.prevent="delField(index)" />
                                                                 <Icon type="md-trash" size="16" color="#6e6e6e" v-show="item.value === item.label" @click.stop.native.prevent="delField(index)" />
                                                             </span>
                                                             </span>
                                                         </Checkbox>
                                                         </Checkbox>
-                                                        <Icon type="md-add-circle" @click="addInfoType = true" v-show="!addInfoType" size="18" />
-                                                        <div v-show="addInfoType">
-                                                            <Input v-model="addInfo" placeholder="自定义填报的信息" style="width: 300px"></Input>
-                                                            <Icon type="md-checkmark-circle" size="18" style="margin: 0 10px;" @click="addInform()" />
-                                                            <Icon type="md-close-circle" size="18" @click="addInfoType = false" />
-                                                        </div>
+                                                        <Icon type="md-add-circle" @click="changeFiled(1)" size="18" />
                                                     </CheckboxGroup>
                                                     </CheckboxGroup>
                                                 </FormItem>
                                                 </FormItem>
                                                 <FormItem label="参赛方式">
                                                 <FormItem label="参赛方式">
@@ -357,6 +353,47 @@
                 </div>
                 </div>
             </template>
             </template>
         </Drawer>
         </Drawer>
+        <Modal v-model="modalType" title="自定义填报信息" class="light-iview-form" @on-ok="addInform()">
+            <Form :label-width="100" :model="addInfoForm">
+                <FormItem label="信息名称">
+                    <Input v-model="addInfoForm.label" :disabled="addInfoType === 2" placeholder="自定义填报的信息" style="width: 300px"></Input>
+                </FormItem>
+                <FormItem label="报名时展示的填报格式">
+                    <RadioGroup v-model="addInfoForm.type">
+                        <Radio label="text">
+                            <span>文本</span>
+                        </Radio>
+                        <Radio label="select">
+                            <span>选择器</span>
+                        </Radio>
+                    </RadioGroup>
+                </FormItem>
+                <!-- <p v-show="addInfoForm.type === 'select'">请创建选项,无需选择,所有选项都会为老师展示</p> -->
+                <FormItem label="报名时可供选择的内容" v-show="addInfoForm.type === 'select'">
+                    <div>
+                        <Input v-model="addInfo" placeholder="请输入选项内容" style="width: 300px"></Input>
+                        <Icon type="md-add-circle" size="18" color="#1db40f" style="margin: 0 10px; cursor: pointer;" @click="changeFormValue('add')" />
+                        <!-- <Icon type="md-checkmark-circle" size="18" color="#1db40f" style="margin: 0 10px; cursor: pointer;" @click="changeFormValue('add')" /> -->
+                    </div>
+                    <span>报名时展示的内容:</span>
+                    <Select v-model="selectFileds" placeholder="仅作展示" style="width:300px" @on-select="selectFiledChange">
+                        <Option v-for="(item, index) in addInfoForm.item" :value="item" :key="index">
+                            {{ item }}
+                            <Icon type="md-trash" size="16" color="#9a9a9a" @click.stop.native.prevent="changeFormValue('delete', index)" />
+                        </Option>
+                    </Select>
+                    <!-- <RadioGroup v-model="animal">
+                        <Radio label="金斑蝶"></Radio>
+                        <Radio label="爪哇犀牛"></Radio>
+                        <Radio label="印度黑羚"></Radio>
+                    </RadioGroup> -->
+                    <!-- <span v-for="(item, index) in addInfoForm.item" :key="index" style="margin-right: 10px;">
+                        {{ item }}
+                        <Icon type="md-trash" size="16" color="#9a9a9a" @click="changeFormValue('delete', index)" />
+                    </span> -->
+                </FormItem>
+            </Form>
+        </Modal>
     </div>
     </div>
 </template>
 </template>
 
 
@@ -391,36 +428,52 @@ export default {
             current: 0,
             current: 0,
             infoArr: [
             infoArr: [
                 {
                 {
-                    value: 'name',
+                    field: 'name',
                     label: '姓名',
                     label: '姓名',
+                    type: "text",
+                    item: []
                 },
                 },
                 {
                 {
-                    value: 'sex',
+                    field: 'sex',
                     label: '性别',
                     label: '性别',
+                    type: "radio",
+                    item: []
                 },
                 },
                 {
                 {
-                    value: 'phone',
+                    field: 'phone',
                     label: '手机号码',
                     label: '手机号码',
+                    type: "text",
+                    item: []
                 },
                 },
                 {
                 {
-                    value: 'email',
+                    field: 'email',
                     label: '电子邮箱',
                     label: '电子邮箱',
+                    type: "text",
+                    item: []
                 },
                 },
                 {
                 {
-                    value: 'school',
+                    field: 'school',
                     label: '学校',
                     label: '学校',
+                    type: "select",
+                    item: []
                 },
                 },
-                {
+                /* {
                     value: 'duties',
                     value: 'duties',
                     label: '职务',
                     label: '职务',
-                },
+                    type: "text",
+                    item: []
+                }, */
                 {
                 {
-                    value: 'period',
+                    field: 'period',
                     label: '学段',
                     label: '学段',
+                    type: "text",
+                    item: []
                 },
                 },
                 {
                 {
-                    value: 'subject',
+                    field: 'subject',
                     label: '学科',
                     label: '学科',
+                    type: "text",
+                    item: []
                 },
                 },
             ],
             ],
             fileType: [
             fileType: [
@@ -500,7 +553,7 @@ export default {
             contestData: {
             contestData: {
                 modules: ['sign'],
                 modules: ['sign'],
                 sign: {
                 sign: {
-                    field: [], //填报信息
+                    fields: [], //填报信息
                     stime: '',
                     stime: '',
                     etime: '',
                     etime: '',
                     limit: 0, //报名人数
                     limit: 0, //报名人数
@@ -525,6 +578,7 @@ export default {
                     etime: '',
                     etime: '',
                 }, */
                 }, */
             },
             },
+            fields: [], //填报信息
             contestUpload: {
             contestUpload: {
                 stime: '',
                 stime: '',
                 etime: '',
                 etime: '',
@@ -555,8 +609,16 @@ export default {
             showTeachers: [], //展示老师列表
             showTeachers: [], //展示老师列表
             selTeachers: [], //选择的学校
             selTeachers: [], //选择的学校
             isUpload: false,
             isUpload: false,
-            addInfoType: false,
+            modalType: false,
+            addInfoType: 0, //0: 不编辑  1:新增填报  2:编辑已有的
             addInfo: '', //自定义填报信息
             addInfo: '', //自定义填报信息
+            addInfoForm: { //自定义信息类型
+                value: '',
+                label: '',
+                type: 'text',
+                item: [],
+            },
+            selectFileds: '',
             joinType: [
             joinType: [
                 {
                 {
                     value: 0,
                     value: 0,
@@ -909,6 +971,8 @@ export default {
                 // 3. 若有新创建的评审规则,需先保存,保存大活动时由后端一起保存
                 // 3. 若有新创建的评审规则,需先保存,保存大活动时由后端一起保存
                 this.saveActivity()
                 this.saveActivity()
             } else {
             } else {
+                this.createData.invitedSchools = []
+                this.contestData.sign.fields = []
                 this.showSchools.forEach(item => {
                 this.showSchools.forEach(item => {
                     if(this.selSchools.includes(item.id)) {
                     if(this.selSchools.includes(item.id)) {
                         this.createData.invitedSchools.push({
                         this.createData.invitedSchools.push({
@@ -918,6 +982,12 @@ export default {
                         })
                         })
                     }
                     }
                 })
                 })
+                this.fields.forEach(item => {
+                    let infos = this.infoArr.find(info => {
+                        return info.field === item
+                    })
+                    if(infos) this.contestData.sign.fields.push(infos)
+                })
                 this.current += 1
                 this.current += 1
             }
             }
         },
         },
@@ -1090,21 +1160,55 @@ export default {
             })
             })
             this.tabName = this.createData.modules[data.length - 1]
             this.tabName = this.createData.modules[data.length - 1]
         },
         },
+        changeFiled(type, data) {
+            if(type === 2) {
+                this.addInfoForm = data
+            } else {
+                this.addInfoForm = {
+                    field: '',
+                    label: '',
+                    type: 'text',
+                    item: [],
+                }
+            }
+            this.addInfoType = type
+            this.modalType = true
+        },
         addInform() {
         addInform() {
             let isHold =  this.infoArr.find(item => {
             let isHold =  this.infoArr.find(item => {
-                return item.label === this.addInfo
+                return item.label === this.addInfoForm.label
             })
             })
-            if(isHold) {
+            if(isHold && this.addInfoType === 1) {
                 this.$Message.warning('该信息已存在!')
                 this.$Message.warning('该信息已存在!')
             } else {
             } else {
-                this.infoArr.push({
-                    value: this.addInfo,
-                    label: this.addInfo,
-                })
-                this.addInfoType = false
+                if(this.addInfoType === 1) {
+                    this.addInfoForm.field = this.addInfoForm.label
+                    this.infoArr.push(this.addInfoForm)
+                } else {
+
+                }
+                this.modalType = false
+                this.addInfoType = 0
+                this.addInfo = ''
+                this.addInfoForm = {
+                    field: '',
+                    label: '',
+                    type: 'text',
+                    item: [],
+                }
+            }
+        },
+        changeFormValue(type, index) {
+            if(type === 'add' && this.addInfo) {
+                this.addInfoForm.item.push(this.addInfo)
                 this.addInfo = ''
                 this.addInfo = ''
+            } else if(type === 'delete') {
+                this.addInfoForm.item.splice(index, 1)
             }
             }
         },
         },
+        selectFiledChange(val) {
+            this.selectFileds = ''
+        },
         // 删除自定义填报信息
         // 删除自定义填报信息
         delField(index) {
         delField(index) {
             this.infoArr.splice(index, 1)
             this.infoArr.splice(index, 1)

+ 24 - 2
TEAMModelOS/ClientApp/src/view/signupActivity/infoGoing.vue

@@ -12,8 +12,8 @@
                     </span>
                     </span>
                     {{ actInfo.name }}
                     {{ actInfo.name }}
                 </p>
                 </p>
-                <div class="btn-box">
-                    <Button type="warning" size="small">删除</Button>
+                <div class="btn-box" v-show="isArea || actInfo.scope === 'school'">
+                    <Button type="warning" size="small" @click="delAct()">删除</Button>
                 </div>
                 </div>
                 <!-- <div class="btn-box">
                 <!-- <div class="btn-box">
                     <Steps :current="2" size="small">
                     <Steps :current="2" size="small">
@@ -655,6 +655,28 @@ export default {
                 }
                 }
             })
             })
         },
         },
+        delAct() {
+            this.$Modal.confirm({
+                title: '确定删除本次活动吗?',
+                // content: `确定删除本次活动吗?`,
+                onOk: () => {
+                    let params = {
+                        grant_type: 'delete',
+                        activityId: this.actInfo.id,
+                        owner: this.actInfo.owner,
+                        scope: this.actInfo.scope,
+                    }
+                    this.$api.areaActivity.manageAct(params).then(res => {
+                        if(res.code === 201) {
+                            this.$Message.success('删除成功')
+                            this.$router.go(-1)
+                        } else if(res.code === 200) {
+                            this.$Message.warning('删除失败')
+                        }
+                    })
+                }
+            })
+        },
         deleteApplica(data, index, type) {
         deleteApplica(data, index, type) {
             console.log(data, index);
             console.log(data, index);
             if(type === 'join') {
             if(type === 'join') {

+ 23 - 0
TEAMModelOS/ClientApp/src/view/signupActivity/infoReleased.vue

@@ -16,6 +16,7 @@
                     <template v-if="!actInfo.needConfirmed">
                     <template v-if="!actInfo.needConfirmed">
                         <Button type="success" size="small" @click="publishNow()">立即发布</Button>
                         <Button type="success" size="small" @click="publishNow()">立即发布</Button>
                         <Button type="primary" size="small">修改</Button>
                         <Button type="primary" size="small">修改</Button>
+                        <Button type="warning" size="small" @click="delAct()">删除</Button>
                     </template>
                     </template>
                     <template v-else>
                     <template v-else>
                         <Button type="success" size="small" @click="confirmedJoin(1)">加入</Button>
                         <Button type="success" size="small" @click="confirmedJoin(1)">加入</Button>
@@ -290,6 +291,28 @@ export default {
                 }
                 }
             })
             })
         },
         },
+        delAct() {
+            this.$Modal.confirm({
+                title: '确定删除本次活动吗?',
+                // content: `确定删除本次活动吗?`,
+                onOk: () => {
+                    let params = {
+                        grant_type: 'delete',
+                        activityId: this.actInfo.id,
+                        owner: this.actInfo.owner,
+                        scope: this.actInfo.scope,
+                    }
+                    this.$api.areaActivity.manageAct(params).then(res => {
+                        if(res.code === 201) {
+                            this.$Message.success('删除成功')
+                            this.$router.go(-1)
+                        } else if(res.code === 200) {
+                            this.$Message.warning('删除失败')
+                        }
+                    })
+                }
+            })
+        },
         confirmedJoin(type) {
         confirmedJoin(type) {
             this.$Modal.confirm({
             this.$Modal.confirm({
                 // title: '删除专家',
                 // title: '删除专家',

+ 0 - 1
TEAMModelOS/ClientApp/src/view/signupActivity/processActivity.vue

@@ -101,7 +101,6 @@ export default {
                         sasData.sas = this.$store.state.user.schoolProfile.blob_sas
                         sasData.sas = this.$store.state.user.schoolProfile.blob_sas
                     } */
                     } */
                     this.activityList = res.activities.map(item => {
                     this.activityList = res.activities.map(item => {
-                        console.log(item.sas);
                         item.startTime = this.$tools.formatTime(item.stime, 'yyyy-MM-dd')
                         item.startTime = this.$tools.formatTime(item.stime, 'yyyy-MM-dd')
                         item.endTime = this.$tools.formatTime(item.etime, 'yyyy-MM-dd')
                         item.endTime = this.$tools.formatTime(item.etime, 'yyyy-MM-dd')
                         item.poster = !item.poster ? require('@/assets/image/no-poster-cn1.png') : `${item.poster}?${item.sas}`
                         item.poster = !item.poster ? require('@/assets/image/no-poster-cn1.png') : `${item.poster}?${item.sas}`

+ 1 - 1
TEAMModelOS/Controllers/Common/ActivityController.cs

@@ -519,7 +519,7 @@ namespace TEAMModelOS.Controllers
                             if (response.Status==200)
                             if (response.Status==200)
                             {
                             {
                                 Activity activity = JsonDocument.Parse(response.Content).RootElement.ToObject<Activity>();
                                 Activity activity = JsonDocument.Parse(response.Content).RootElement.ToObject<Activity>();
-                                if (_scope.GetString().Equals("school")  && _owner.Equals(school))
+                                if (_scope.GetString().Equals("school")  && _owner.GetString().Equals(school))
                                 {
                                 {
                                     await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).DeleteItemStreamAsync(activity.id, new PartitionKey("Activity"));
                                     await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).DeleteItemStreamAsync(activity.id, new PartitionKey("Activity"));
                                     return Ok(new { code = 201, activity }) ; //删除成功
                                     return Ok(new { code = 201, activity }) ; //删除成功