李志伟 2 年前
父节点
当前提交
9d3ff43551

+ 47
- 45
src/components/Question/drawer.vue 查看文件

1
 <template>
1
 <template>
2
-  <div>
3
-    <el-drawer
4
-      ref="drawer"
5
-      :show-close="false"
6
-      :wrapper-closable="false"
7
-      :title="answer.answerId ?'编辑答案' : '添加答案'"
8
-      :before-close="handleClose"
9
-      :visible.sync="dialog"
10
-      direction="ltr"
11
-      custom-class="demo-drawer"
12
-    >
13
-      <div class="demo-drawer__content">
14
-        <el-form ref="form" :model="form" :rules="rules" style="margin:20px">
15
-          <el-form-item label="答案:" prop="content" :label-width="formLabelWidth">
16
-            <el-input v-model="form.content" placeholder="请输入答案(必填)">
17
-              <el-select
18
-                slot="prepend"
19
-                v-model="form.optCode"
20
-                filterable
21
-                allow-create
22
-                default-first-option
23
-                style="width:100px"
24
-                placeholder="请选择"
25
-              >
26
-                <el-option
27
-                  v-for="item in options"
28
-                  :key="item.value"
29
-                  :label="item.label"
30
-                  :value="item.value"
31
-                />
32
-              </el-select>
33
-            </el-input>
34
-          </el-form-item>
35
-          <el-form-item label="分数:" prop="score" :label-width="formLabelWidth">
36
-            <el-input v-model="form.score" placeholder="请输入分数" />
37
-          </el-form-item>
38
-          <el-form-item style="text-align:center">
39
-            <el-button @click="handleClose">取 消</el-button>
40
-            <el-button type="primary" @click="onSubmit('form')">确 定</el-button>
41
-          </el-form-item>
42
-        </el-form>
43
-      </div>
44
-    </el-drawer>
45
-  </div>
2
+  <el-drawer
3
+    ref="drawer"
4
+    :show-close="false"
5
+    :wrapper-closable="false"
6
+    :title="answer.answerId ? '编辑答案' : '添加答案'"
7
+    :before-close="handleClose"
8
+    :visible.sync="dialog"
9
+    direction="ltr"
10
+    custom-class="demo-drawer"
11
+  >
12
+    <div class="demo-drawer__content">
13
+      <el-form ref="form" :model="form" :rules="rules" style="margin: 20px">
14
+        <el-form-item
15
+          label="答案:"
16
+          prop="content"
17
+          :label-width="formLabelWidth"
18
+        >
19
+          <el-input v-model="form.content" placeholder="请输入答案(必填)">
20
+            <el-select
21
+              slot="prepend"
22
+              v-model="form.optCode"
23
+              filterable
24
+              allow-create
25
+              default-first-option
26
+              style="width: 100px"
27
+              placeholder="请选择"
28
+            >
29
+              <el-option
30
+                v-for="item in options"
31
+                :key="item.value"
32
+                :label="item.label"
33
+                :value="item.value"
34
+              />
35
+            </el-select>
36
+          </el-input>
37
+        </el-form-item>
38
+        <el-form-item label="分数:" prop="score" :label-width="formLabelWidth">
39
+          <el-input v-model="form.score" placeholder="请输入分数" />
40
+        </el-form-item>
41
+        <el-form-item style="text-align: center">
42
+          <el-button @click="handleClose">取 消</el-button>
43
+          <el-button type="primary" @click="onSubmit('form')">确 定</el-button>
44
+        </el-form-item>
45
+      </el-form>
46
+    </div>
47
+  </el-drawer>
46
 </template>
48
 </template>
47
 <script>
49
 <script>
48
 import { saveAnswer, UpdateAnswer } from '@/api/answer'
50
 import { saveAnswer, UpdateAnswer } from '@/api/answer'
52
     questionId: String,
54
     questionId: String,
53
     answer: {
55
     answer: {
54
       type: Object,
56
       type: Object,
55
-      default: () => {}
57
+      default: () => { }
56
     }
58
     }
57
   },
59
   },
58
   data() {
60
   data() {

+ 37
- 22
src/components/Question/edit.vue 查看文件

6
     <el-form ref="form" :model="form" label-width="90px">
6
     <el-form ref="form" :model="form" label-width="90px">
7
       <el-form-item label="题目:">
7
       <el-form-item label="题目:">
8
         <el-input v-model="form.content" placeholder="请输入问题名(必填)">
8
         <el-input v-model="form.content" placeholder="请输入问题名(必填)">
9
-          <el-select slot="prepend" v-model="form.questionType" style="width:100px" placeholder="请选择">
9
+          <el-select
10
+            slot="prepend"
11
+            v-model="form.questionType"
12
+            style="width: 100px"
13
+            placeholder="请选择"
14
+          >
10
             <el-option label="单选题" value="radio" />
15
             <el-option label="单选题" value="radio" />
11
             <el-option label="多选题" value="checkBox" />
16
             <el-option label="多选题" value="checkBox" />
12
             <el-option label="简答题" value="textarea" />
17
             <el-option label="简答题" value="textarea" />
17
         <el-button type="primary" @click="onSubmit">确定</el-button>
22
         <el-button type="primary" @click="onSubmit">确定</el-button>
18
       </el-form-item>
23
       </el-form-item>
19
     </el-form>
24
     </el-form>
20
-    <el-card v-if="questionId && form.questionType !== 'textarea'" shadow="never" body-style="padding:0" class="box-card">
25
+    <el-card
26
+      v-if="questionId && form.questionType !== 'textarea'"
27
+      shadow="never"
28
+      body-style="padding:0"
29
+      class="box-card"
30
+    >
21
       <div slot="header" class="clearfix">
31
       <div slot="header" class="clearfix">
22
-        <h3 style="float:left">答案列表</h3>
32
+        <h3 style="float: left">答案列表</h3>
23
         <el-button
33
         <el-button
24
           type="primary"
34
           type="primary"
25
           style="float: right"
35
           style="float: right"
27
           @click="onAddAnswer"
37
           @click="onAddAnswer"
28
         >添加答案</el-button>
38
         >添加答案</el-button>
29
       </div>
39
       </div>
30
-      <ul style="list-style-type: none;margin:24px 0 24px -40px">
31
-        <li v-for="answer in form.answerList" :key="answer.answerId" class="answerli">
32
-          <div style="flex:1;width: 100%;overflow: hidden;display: flex;" @click="handleEdit(answer)">
33
-            <span style="width:45px">{{ answer.optCode }}</span>
34
-            <span style="flex:1">{{ answer.content }}</span>
35
-            <span style="width:30px">{{ answer.score }}分</span>
40
+      <ul style="list-style-type: none; margin: 24px 0 24px -40px">
41
+        <li
42
+          v-for="answer in form.answerList"
43
+          :key="answer.answerId"
44
+          class="answerli"
45
+        >
46
+          <div
47
+            style="flex: 1; overflow: hidden; display: flex"
48
+            @click="handleEdit(answer)"
49
+          >
50
+            <span style="width: 45px">{{ answer.optCode }}</span>
51
+            <span style="flex: 1">{{ answer.content }}</span>
52
+            <span style="width: 30px">{{ answer.score }}分</span>
36
           </div>
53
           </div>
37
           <el-popconfirm
54
           <el-popconfirm
38
-            style="width:30px;margin-left:8px"
55
+            style="width: 30px; margin-left: 8px"
39
             icon="el-icon-info"
56
             icon="el-icon-info"
40
             icon-color="red"
57
             icon-color="red"
41
             title="确定删除这个答案吗?"
58
             title="确定删除这个答案吗?"
42
             @onConfirm="handleDelete(answer)"
59
             @onConfirm="handleDelete(answer)"
43
           >
60
           >
44
-            <el-button slot="reference" type="text" class="deleteQuestion" style="color:red">删除</el-button>
61
+            <el-button
62
+              slot="reference"
63
+              type="text"
64
+              class="deleteQuestion"
65
+              style="color: red"
66
+            >删除</el-button>
45
           </el-popconfirm>
67
           </el-popconfirm>
46
         </li>
68
         </li>
47
       </ul>
69
       </ul>
57
   </div>
79
   </div>
58
 </template>
80
 </template>
59
 <script>
81
 <script>
60
-
61
 import { saveQuestion, UpdateQuestion, getQuestionDetail } from '@/api/question'
82
 import { saveQuestion, UpdateQuestion, getQuestionDetail } from '@/api/question'
62
 import { deleteAnswer } from '@/api/answer'
83
 import { deleteAnswer } from '@/api/answer'
63
 import QuestionDrawer from '@/components/Question/drawer.vue'
84
 import QuestionDrawer from '@/components/Question/drawer.vue'
67
     QuestionDrawer
88
     QuestionDrawer
68
   },
89
   },
69
   props: {
90
   props: {
91
+    // 题目id
70
     questionId: {
92
     questionId: {
71
       type: String,
93
       type: String,
72
       required: true
94
       required: true
73
     },
95
     },
96
+    // 题库id
74
     queId: {
97
     queId: {
75
       type: String,
98
       type: String,
76
       required: true
99
       required: true
143
         this.form = res.data
166
         this.form = res.data
144
       })
167
       })
145
     },
168
     },
146
-    // 转换特征数组数据格式
147
-    handleToString(list) {
148
-      const nameList = []
149
-      list?.map(item => {
150
-        nameList.push(item.name)
151
-      })
152
-      return nameList.toString()
153
-    },
154
     // 非空判断方法
169
     // 非空判断方法
155
     handelNull() {
170
     handelNull() {
156
       if (this.form.questionType) {
171
       if (this.form.questionType) {
190
   width: 100%;
205
   width: 100%;
191
   overflow: hidden;
206
   overflow: hidden;
192
   display: flex;
207
   display: flex;
193
-  line-height:40px;
208
+  line-height: 40px;
194
   background-color: white;
209
   background-color: white;
195
-  padding:0 8px;
210
+  padding: 0 8px;
196
   border: 1px solid #f0f2f5;
211
   border: 1px solid #f0f2f5;
197
 }
212
 }
198
 .answerli:hover {
213
 .answerli:hover {

+ 31
- 14
src/views/course/index.vue 查看文件

13
         style="margin-right: 20px"
13
         style="margin-right: 20px"
14
         @change="dateChange"
14
         @change="dateChange"
15
       />
15
       />
16
-      <div style="float:right">
16
+      <div style="float: right">
17
         <el-button type="primary" @click="onSearch">查询</el-button>
17
         <el-button type="primary" @click="onSearch">查询</el-button>
18
         <el-button @click="onReset">重置</el-button>
18
         <el-button @click="onReset">重置</el-button>
19
-        <el-button type="primary" icon="el-icon-plus" @click="handleAdd">新建课程</el-button>
19
+        <el-button type="primary" icon="el-icon-plus" @click="handleAdd">
20
+          新建课程
21
+        </el-button>
20
       </div>
22
       </div>
21
     </el-card>
23
     </el-card>
22
     <el-table stripe :data="tableData" border style="width: 100%">
24
     <el-table stripe :data="tableData" border style="width: 100%">
23
       <el-table-column align="center" prop="title" label="课程名称" />
25
       <el-table-column align="center" prop="title" label="课程名称" />
24
       <el-table-column align="center" prop="subTitle" label="课程简介" />
26
       <el-table-column align="center" prop="subTitle" label="课程简介" />
25
       <el-table-column align="center" prop="startDate" label="开始时间">
27
       <el-table-column align="center" prop="startDate" label="开始时间">
26
-        <template slot-scope="scope">{{ formate(scope.row.startDate) }}</template>
28
+        <template slot-scope="scope">{{
29
+          formate(scope.row.startDate)
30
+        }}</template>
27
       </el-table-column>
31
       </el-table-column>
28
       <el-table-column align="center" prop="endDate" label="结束时间">
32
       <el-table-column align="center" prop="endDate" label="结束时间">
29
         <template slot-scope="scope">{{ formate(scope.row.endDate) }}</template>
33
         <template slot-scope="scope">{{ formate(scope.row.endDate) }}</template>
30
       </el-table-column>
34
       </el-table-column>
31
       <el-table-column align="center" prop="state" label="状态" width="100">
35
       <el-table-column align="center" prop="state" label="状态" width="100">
32
         <template slot-scope="scope">
36
         <template slot-scope="scope">
33
-          {{ scope.row.state === 1 ? '发布' : '未发布' }}
37
+          {{ scope.row.state === 1 ? "发布" : "未发布" }}
34
         </template>
38
         </template>
35
       </el-table-column>
39
       </el-table-column>
36
       <el-table-column align="center" label="操作" min-width="100" width="280">
40
       <el-table-column align="center" label="操作" min-width="100" width="280">
37
         <template slot-scope="scope">
41
         <template slot-scope="scope">
38
-          <el-button style="margin-right:1em" type="text" @click="toggleState(scope.row)">{{ scope.row.state === 1 ? '取消发布' : '发布' }}</el-button>
39
-          <el-link :underline="false" style="margin-right:1em" type="primary">
42
+          <el-button
43
+            style="margin-right: 1em"
44
+            type="text"
45
+            @click="toggleState(scope.row)"
46
+          >
47
+            {{ scope.row.state === 1 ? "取消发布" : "发布" }}
48
+          </el-button>
49
+          <el-link :underline="false" style="margin-right: 1em" type="primary">
40
             <router-link
50
             <router-link
41
-              :to="{path:'course/edit',query: { courseId: scope.row.courseId }}"
42
-            >编辑</router-link>
51
+              :to="{
52
+                path: 'course/edit',
53
+                query: { courseId: scope.row.courseId },
54
+              }"
55
+            >
56
+              编辑
57
+            </router-link>
43
           </el-link>
58
           </el-link>
44
           <el-popconfirm
59
           <el-popconfirm
45
             icon="el-icon-info"
60
             icon="el-icon-info"
47
             title="确定要删除该课程吗?"
62
             title="确定要删除该课程吗?"
48
             @onConfirm="handleDelete(scope.row)"
63
             @onConfirm="handleDelete(scope.row)"
49
           >
64
           >
50
-            <el-link slot="reference" :underline="false" type="danger">删除</el-link>
65
+            <el-link slot="reference" :underline="false" type="danger">
66
+              删除
67
+            </el-link>
51
           </el-popconfirm>
68
           </el-popconfirm>
52
         </template>
69
         </template>
53
       </el-table-column>
70
       </el-table-column>
54
     </el-table>
71
     </el-table>
55
     <el-pagination
72
     <el-pagination
56
-      v-show="Total!==0"
57
-      style="float:right; margin:20px 0"
73
+      v-show="Total !== 0"
74
+      style="float: right; margin: 20px 0"
58
       :total="Total"
75
       :total="Total"
59
       :current-page="currentPage"
76
       :current-page="currentPage"
60
       :page-size="pageSize"
77
       :page-size="pageSize"
61
-      :page-sizes="[pageSize, 20, 35,40,50,80,100]"
78
+      :page-sizes="[pageSize, 20, 35, 40, 50, 80, 100]"
62
       layout="total, prev, pager, next, sizes"
79
       layout="total, prev, pager, next, sizes"
63
       @size-change="handleSizeChange"
80
       @size-change="handleSizeChange"
64
       @current-change="handleCurrentChange"
81
       @current-change="handleCurrentChange"
153
             })
170
             })
154
             this.onSearch()
171
             this.onSearch()
155
           })
172
           })
156
-        }).catch(() => {})
173
+        }).catch(() => { })
157
       } else {
174
       } else {
158
         this.$confirm('是否将本课程发布,发布后移动端将显示相关信息?', '提示', {
175
         this.$confirm('是否将本课程发布,发布后移动端将显示相关信息?', '提示', {
159
           confirmButtonText: '确定',
176
           confirmButtonText: '确定',
167
             })
184
             })
168
             this.onSearch()
185
             this.onSearch()
169
           })
186
           })
170
-        }).catch(() => {})
187
+        }).catch(() => { })
171
       }
188
       }
172
     },
189
     },
173
     onReset() {
190
     onReset() {

+ 60
- 29
src/views/photoWall/index.vue 查看文件

4
       <div class="text item">
4
       <div class="text item">
5
         <el-row>
5
         <el-row>
6
           <el-col :span="18">
6
           <el-col :span="18">
7
-            <div v-show="packId" style="padding:16px">
8
-              <p style="margin-left:8px">
7
+            <div v-show="packId" style="padding: 16px">
8
+              <p style="margin-left: 8px">
9
                 {{ currentPack }}
9
                 {{ currentPack }}
10
                 <upload-image-list
10
                 <upload-image-list
11
-                  style="margin-left:8px;display:inline-block"
11
+                  style="margin-left: 8px; display: inline-block"
12
                   @handleChange="handleChange"
12
                   @handleChange="handleChange"
13
-                /></p>
14
-              <div v-for="item in images" :key="item.attchId" style="display:inline-block;position:relative;margin:16px">
15
-                <el-card :body-style="{ padding: '0px', height:'100%' }" style="width:320px; height:280px;text-align:center;border:0">
16
-                  <el-image fit="cover" :preview-src-list="[item.url]" :src="item.url" style="height: calc(100% - 40px); display:block" />
17
-                  <div style="width:100%;height:40px"><div class="imgbtn"><i class="el-icon-more" /></div><div class="imgbtn" style="color:red;font-size:14px" @click="deletePhoto(item)"><i class="el-icon-delete" style="margin-right:6px" />删除</div></div>
13
+                />
14
+              </p>
15
+              <div
16
+                v-for="item in images"
17
+                :key="item.attchId"
18
+                style="display: inline-block; position: relative; margin: 16px"
19
+              >
20
+                <el-card
21
+                  :body-style="{ padding: '0px', height: '100%' }"
22
+                  style="
23
+                    width: 320px;
24
+                    height: 280px;
25
+                    text-align: center;
26
+                    border: 0;
27
+                  "
28
+                >
29
+                  <el-image
30
+                    fit="cover"
31
+                    :preview-src-list="[item.url]"
32
+                    :src="item.url"
33
+                    style="height: calc(100% - 40px); display: block"
34
+                  />
35
+                  <div style="width: 100%; height: 40px">
36
+                    <div class="imgbtn"><i class="el-icon-more" /></div>
37
+                    <div
38
+                      class="imgbtn"
39
+                      style="color: red; font-size: 14px"
40
+                      @click="deletePhoto(item)"
41
+                    >
42
+                      <i class="el-icon-delete" style="margin-right: 6px" />删除
43
+                    </div>
44
+                  </div>
18
                 </el-card>
45
                 </el-card>
19
               </div>
46
               </div>
20
             </div>
47
             </div>
21
           </el-col>
48
           </el-col>
22
           <el-col :span="6">
49
           <el-col :span="6">
23
-            <el-card style="border: 0;box-shadow: none;">
50
+            <el-card style="border: 0; box-shadow: none">
24
               <div slot="header">
51
               <div slot="header">
25
                 <span>照片墙分组</span>
52
                 <span>照片墙分组</span>
26
               </div>
53
               </div>
28
                 v-for="tag in dynamicTags"
55
                 v-for="tag in dynamicTags"
29
                 :key="tag"
56
                 :key="tag"
30
                 closable
57
                 closable
31
-                style="margin-bottom:8px"
32
-                :type="currentPack===tag?'':'info' "
58
+                style="margin-bottom: 8px"
59
+                :type="currentPack === tag ? '' : 'info'"
33
                 :disable-transitions="false"
60
                 :disable-transitions="false"
34
                 @close="handleClose(tag)"
61
                 @close="handleClose(tag)"
35
                 @click="handleCurrent(tag)"
62
                 @click="handleCurrent(tag)"
42
                 v-model="inputValue"
69
                 v-model="inputValue"
43
                 class="input-new-tag"
70
                 class="input-new-tag"
44
                 size="small"
71
                 size="small"
45
-                style="width:200px"
72
+                style="width: 200px"
46
                 @keyup.enter.native="handleInputConfirm"
73
                 @keyup.enter.native="handleInputConfirm"
47
                 @blur="handleInputConfirm"
74
                 @blur="handleInputConfirm"
48
               />
75
               />
70
   },
97
   },
71
   data() {
98
   data() {
72
     return {
99
     return {
73
-      deleteImg: require('../../assets/delete.png'),
74
-      activeNames: ['1'],
75
-      // 图片数据源
76
-      attachList: [],
77
       // 分组名数组 字符串数组
100
       // 分组名数组 字符串数组
78
       dynamicTags: [],
101
       dynamicTags: [],
79
       inputVisible: false,
102
       inputVisible: false,
100
   methods: {
123
   methods: {
101
     // 图片上传成功会执行一次 每张图片都会执行一次
124
     // 图片上传成功会执行一次 每张图片都会执行一次
102
     handleChange(val) {
125
     handleChange(val) {
103
-      saveAttachment({ attchType: 'image', packId: this.packId, packName: this.currentPack, url: val }).then(() => {
104
-        getAttachmentList({ attchType: 'image', packId: this.packId, pageSize: 999 }).then(res => {
126
+      saveAttachment({
127
+        attchType: 'image',
128
+        packId: this.packId,
129
+        packName: this.currentPack,
130
+        url: val
131
+      }).then(() => {
132
+        getAttachmentList({
133
+          attchType: 'image',
134
+          packId: this.packId,
135
+          pageSize: 999
136
+        }).then(res => {
105
           this.images = res.data.records
137
           this.images = res.data.records
106
         })
138
         })
107
       })
139
       })
163
     },
195
     },
164
     // 添加分组
196
     // 添加分组
165
     handleInputConfirm() {
197
     handleInputConfirm() {
166
-      const inputValue = this.inputValue
167
-      if (inputValue) {
168
-        saveAttchPack({ name: inputValue }).then(() => {
198
+      if (this.inputValue) {
199
+        saveAttchPack({ name: this.inputValue }).then(() => {
169
           this.$message({
200
           this.$message({
170
             type: 'success',
201
             type: 'success',
171
             message: '添加成功'
202
             message: '添加成功'
211
   line-height: 40px;
242
   line-height: 40px;
212
   display: inline-block;
243
   display: inline-block;
213
   &:first-child {
244
   &:first-child {
214
-    border-right:1px solid #f0f0f0 ;
245
+    border-right: 1px solid #f0f0f0;
215
   }
246
   }
216
 }
247
 }
217
 .mask {
248
 .mask {
222
   left: 0;
253
   left: 0;
223
 
254
 
224
   &:hover {
255
   &:hover {
225
-    background-color: rgba(0,0,0,.2);
256
+    background-color: rgba(0, 0, 0, 0.2);
226
   }
257
   }
227
-  &:hover .maskImg{
228
-    opacity:1
258
+  &:hover .maskImg {
259
+    opacity: 1;
229
   }
260
   }
230
   .maskImg {
261
   .maskImg {
231
-    position:absolute;
232
-    left:calc( 50% - 8px );
233
-    top:calc( 50% - 8px );
234
-    width:16px;
262
+    position: absolute;
263
+    left: calc(50% - 8px);
264
+    top: calc(50% - 8px);
265
+    width: 16px;
235
     opacity: 0;
266
     opacity: 0;
236
   }
267
   }
237
 }
268
 }

+ 20
- 7
src/views/questionnaire/edit.vue 查看文件

1
 <template>
1
 <template>
2
   <div class="body_edit">
2
   <div class="body_edit">
3
-    <el-form ref="form" :inline="true" :rules="rules" :model="questionnaireForm" label-width="100px">
3
+    <el-form
4
+      ref="form"
5
+      :inline="true"
6
+      :rules="rules"
7
+      :model="questionnaireForm"
8
+      label-width="100px"
9
+    >
4
       <h3>问卷详情</h3>
10
       <h3>问卷详情</h3>
5
       <el-form-item v-if="!queId" label="问卷名称:" prop="name">
11
       <el-form-item v-if="!queId" label="问卷名称:" prop="name">
6
-        <el-input v-model="questionnaireForm.name" style="width:700px" />
12
+        <el-input v-model="questionnaireForm.name" style="width: 700px" />
7
       </el-form-item>
13
       </el-form-item>
8
       <el-form-item v-else label="问卷名称:" prop="name">
14
       <el-form-item v-else label="问卷名称:" prop="name">
9
-        <el-input v-model="questionnaireForm.name" style="width:400px" />
15
+        <el-input v-model="questionnaireForm.name" style="width: 400px" />
10
       </el-form-item>
16
       </el-form-item>
11
       <el-form-item class="editBottomItem">
17
       <el-form-item class="editBottomItem">
12
         <el-button type="primary" @click="onSubmit('form')">保存</el-button>
18
         <el-button type="primary" @click="onSubmit('form')">保存</el-button>
13
-        <el-button v-show="queId" type="primary" @click="dialogVisible = true">查看二维码</el-button>
14
-        <el-button v-show="queId" type="primary" @click="downloadQrcode">下载二维码</el-button>
19
+        <el-button
20
+          v-show="queId"
21
+          type="primary"
22
+          @click="dialogVisible = true"
23
+        >查看二维码</el-button>
24
+        <el-button
25
+          v-show="queId"
26
+          type="primary"
27
+          @click="downloadQrcode"
28
+        >下载二维码</el-button>
15
         <el-button @click="onCancel">取消</el-button>
29
         <el-button @click="onCancel">取消</el-button>
16
       </el-form-item>
30
       </el-form-item>
17
     </el-form>
31
     </el-form>
19
       title="二维码"
33
       title="二维码"
20
       :visible.sync="dialogVisible"
34
       :visible.sync="dialogVisible"
21
       width="320px"
35
       width="320px"
22
-      style="text-align:center"
36
+      style="text-align: center"
23
     >
37
     >
24
       <img
38
       <img
25
         style="width: 160px; height: 160px"
39
         style="width: 160px; height: 160px"
103
     this.toUrl()
117
     this.toUrl()
104
   },
118
   },
105
   methods: {
119
   methods: {
106
-    showQcode() {},
107
     onCancel() {
120
     onCancel() {
108
       this.$router.go(-1)
121
       this.$router.go(-1)
109
     },
122
     },

+ 0
- 1
src/views/questionnaire/index.vue 查看文件

36
         </template>
36
         </template>
37
       </el-table-column>
37
       </el-table-column>
38
     </el-table>
38
     </el-table>
39
-    <div v-show="false" id="qrcode" ref="qrcode" />
40
     <el-pagination
39
     <el-pagination
41
       v-show="Total!==0"
40
       v-show="Total!==0"
42
       style="float:right; margin:20px 0"
41
       style="float:right; margin:20px 0"

+ 51
- 22
src/views/signIn/edit.vue 查看文件

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <el-card class="box-card" style="text-align:center" shadow="never">
3
+    <el-card class="box-card" style="text-align: center" shadow="never">
4
       <el-row :gutter="20" style="padding-top: 20px">
4
       <el-row :gutter="20" style="padding-top: 20px">
5
         <el-col :span="12">
5
         <el-col :span="12">
6
-          <h2>{{ signId ? '修改' : '新建' }}签到</h2>
6
+          <h2>{{ signId ? "修改" : "新建" }}签到</h2>
7
           <el-form
7
           <el-form
8
             ref="signForm"
8
             ref="signForm"
9
             :model="signForm"
9
             :model="signForm"
10
             :rules="rules"
10
             :rules="rules"
11
             label-width="7vw"
11
             label-width="7vw"
12
-            style="width:80%;margin:auto"
12
+            style="width: 80%; margin: auto"
13
             class="demo-signForm"
13
             class="demo-signForm"
14
           >
14
           >
15
             <el-form-item label="签到名称" prop="name">
15
             <el-form-item label="签到名称" prop="name">
21
                 format="yyyy-MM-dd HH:mm"
21
                 format="yyyy-MM-dd HH:mm"
22
                 type="datetime"
22
                 type="datetime"
23
                 placeholder="选择日期时间"
23
                 placeholder="选择日期时间"
24
-                style="width:100%"
24
+                style="width: 100%"
25
               />
25
               />
26
             </el-form-item>
26
             </el-form-item>
27
             <el-form-item label="结束时间" prop="endTime">
27
             <el-form-item label="结束时间" prop="endTime">
29
                 v-model="signForm.endTime"
29
                 v-model="signForm.endTime"
30
                 format="yyyy-MM-dd HH:mm"
30
                 format="yyyy-MM-dd HH:mm"
31
                 type="datetime"
31
                 type="datetime"
32
-                style="width:100%"
32
+                style="width: 100%"
33
                 placeholder="选择日期时间"
33
                 placeholder="选择日期时间"
34
               />
34
               />
35
             </el-form-item>
35
             </el-form-item>
36
-            <el-form-item label-width="0">
36
+            <el-form-item v-show="signId" label-width="0">
37
               <img
37
               <img
38
                 style="width: 100px; height: 100px"
38
                 style="width: 100px; height: 100px"
39
                 :src="imgURL"
39
                 :src="imgURL"
41
               >
41
               >
42
             </el-form-item>
42
             </el-form-item>
43
             <el-form-item label-width="0">
43
             <el-form-item label-width="0">
44
-              <el-button
45
-                type="primary"
46
-                @click="submitForm('signForm')"
47
-              >{{ !signId?'新建':'修改' }}</el-button>
48
-              <el-button v-show="signId" type="primary" @click="downloadQrcode">下载二维码</el-button>
44
+              <el-button type="primary" @click="submitForm('signForm')">{{
45
+                !signId ? "新建" : "修改"
46
+              }}</el-button>
47
+              <el-button v-show="signId" type="primary" @click="downloadQrcode">
48
+                下载二维码
49
+              </el-button>
49
               <el-button @click="$router.go(-1)">返回</el-button>
50
               <el-button @click="$router.go(-1)">返回</el-button>
50
             </el-form-item>
51
             </el-form-item>
51
           </el-form>
52
           </el-form>
58
             :model="signForm"
59
             :model="signForm"
59
             :rules="rules"
60
             :rules="rules"
60
             label-width="7vw"
61
             label-width="7vw"
61
-            style="width:80%;margin:auto"
62
+            style="width: 80%; margin: auto"
62
             class="demo-signForm"
63
             class="demo-signForm"
63
           >
64
           >
64
             <el-form-item label="学期">
65
             <el-form-item label="学期">
65
-              <el-checkbox v-model="checkAllTerm" :indeterminate="isIndeterminateTerm" @change="handleCheckAllTermChange">全选</el-checkbox>
66
-              <el-checkbox-group v-model="checkedTerms" @change="handleCheckedTermsChange">
67
-                <el-checkbox v-for="item in termList" :key="item.termId" :label="item.termId">{{ item.name }}</el-checkbox>
66
+              <el-checkbox
67
+                v-model="checkAllTerm"
68
+                :indeterminate="isIndeterminateTerm"
69
+                @change="handleCheckAllTermChange"
70
+              >
71
+                全选
72
+              </el-checkbox>
73
+              <el-checkbox-group
74
+                v-model="checkedTerms"
75
+                @change="handleCheckedTermsChange"
76
+              >
77
+                <el-checkbox
78
+                  v-for="item in termList"
79
+                  :key="item.termId"
80
+                  :label="item.termId"
81
+                >{{ item.name }}
82
+                </el-checkbox>
68
               </el-checkbox-group>
83
               </el-checkbox-group>
69
             </el-form-item>
84
             </el-form-item>
70
             <el-form-item label="班级">
85
             <el-form-item label="班级">
71
-              <el-checkbox v-if="classList.length!==0" v-model="checkAllClass" :indeterminate="isIndeterminateClass" @change="handleCheckAllClassChange">全选</el-checkbox>
72
-              <el-checkbox-group v-model="checkedClasss" @change="handleCheckedClasssChange">
73
-                <el-checkbox v-for="item in classList" :key="item.classId" :label="item.classId">{{ item.name }}</el-checkbox>
86
+              <el-checkbox
87
+                v-if="classList.length !== 0"
88
+                v-model="checkAllClass"
89
+                :indeterminate="isIndeterminateClass"
90
+                @change="handleCheckAllClassChange"
91
+              >全选</el-checkbox>
92
+              <el-checkbox-group
93
+                v-model="checkedClasss"
94
+                @change="handleCheckedClasssChange"
95
+              >
96
+                <el-checkbox
97
+                  v-for="item in classList"
98
+                  :key="item.classId"
99
+                  :label="item.classId"
100
+                >{{ item.name }}</el-checkbox>
74
               </el-checkbox-group>
101
               </el-checkbox-group>
75
             </el-form-item>
102
             </el-form-item>
76
             <el-form-item label-width="0">
103
             <el-form-item label-width="0">
172
         .then((res) => {
199
         .then((res) => {
173
           this.signForm = res.data
200
           this.signForm = res.data
174
         })
201
         })
175
-        .catch((e) => {})
202
+        .catch((e) => { })
176
     }
203
     }
177
     getSchoolTermList().then((res) => {
204
     getSchoolTermList().then((res) => {
178
       this.termList = res.data.records
205
       this.termList = res.data.records
265
       this.$refs[formName].validate((valid) => {
292
       this.$refs[formName].validate((valid) => {
266
         if (valid) {
293
         if (valid) {
267
           if (this.signForm.startTime > this.signForm.endTime) {
294
           if (this.signForm.startTime > this.signForm.endTime) {
268
-            this.$message.success('结束时间不能小于开始时间')
295
+            this.$message.error('结束时间不能小于开始时间')
269
           } else if (this.signId) {
296
           } else if (this.signId) {
270
             UpdateSignIn(this.signForm, this.signId)
297
             UpdateSignIn(this.signForm, this.signId)
271
               .then((res) => {
298
               .then((res) => {
272
                 this.$message.success('修改成功')
299
                 this.$message.success('修改成功')
273
                 this.$router.go(-1)
300
                 this.$router.go(-1)
274
               })
301
               })
275
-              .catch((e) => {})
302
+              .catch((e) => { })
276
           } else {
303
           } else {
277
             saveSignIn(this.signForm)
304
             saveSignIn(this.signForm)
278
               .then((e) => {
305
               .then((e) => {
279
                 this.$message.success('保存成功')
306
                 this.$message.success('保存成功')
280
                 this.$router.go(-1)
307
                 this.$router.go(-1)
281
               })
308
               })
282
-              .catch((e) => {})
309
+              .catch((e) => { })
283
           }
310
           }
284
         } else {
311
         } else {
285
           return false
312
           return false
287
       })
314
       })
288
     },
315
     },
289
     // 生成二维码
316
     // 生成二维码
317
+    // 二维码相关代码查看复工复产系统 E:\work\ubpa\pc-admin 看森哥写的
318
+    // 我这个太老了不要用了
290
     qrcode(val) {
319
     qrcode(val) {
291
       // eslint-disable-next-line no-unused-vars
320
       // eslint-disable-next-line no-unused-vars
292
       const qrcode = new QRCode('qrcode', {
321
       const qrcode = new QRCode('qrcode', {

+ 1
- 1
vue.config.js 查看文件

33
     open: true,
33
     open: true,
34
     proxy: {
34
     proxy: {
35
       '/api': {
35
       '/api': {
36
-        target: 'http://192.168.89.147:8088',
36
+        target: 'http://192.168.89.25:8080',
37
         changeOrigin: true
37
         changeOrigin: true
38
       }
38
       }
39
     }
39
     }