liuzhen лет назад: 5
Родитель
Сommit
ed5b8dfaf7

+ 19 - 0
CallCenterWeb.UI/src/api/subjectManagement/subjectManagement.js

@@ -164,4 +164,23 @@ export function addpic(params) {
164 164
     params
165 165
   })
166 166
 }
167
+//删除图片图片
168
+export function deletepic(id) {
169
+  return request({
170
+    url: 'api/Background/delete',
171
+    method: 'post',
172
+    data:{
173
+      id
174
+    }
175
+  })
176
+}
177
+
178
+//自定义图片保存
179
+export function saveBCI(data) {
180
+  return request({
181
+    url: 'api/Background/update',
182
+    method: 'post',
183
+    data
184
+  })
185
+}
167 186
 

+ 193 - 55
CallCenterWeb.UI/src/views/subjectManagement/backgroundImg/index.vue

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <el-card>
3
-    <el-tabs v-model="activeName" @tab-click="handleClick">
3
+    <el-tabs v-model="activeName" @tab-click="handleClickTab">
4 4
       <el-tab-pane label="电脑端" name="1">
5 5
         <span class="bgi">自定义背景</span>
6 6
         <el-upload
@@ -14,18 +14,47 @@
14 14
           :on-error="uploadError"
15 15
           list-type="picture"
16 16
           :show-file-list="false"
17
-          :file-list="fileList"
17
+          :file-list="fileListName"
18 18
         >
19 19
           <el-button size="small" type="primary">点击上传</el-button>
20 20
         </el-upload>
21 21
       </el-tab-pane>
22
-      <el-tab-pane label="手机端" name="2">手机端</el-tab-pane>
23
-      <div>
24
-          <ul>
25
-              <li v-for="item in imgData" :key="item.id">
26
-                  <img :src="item.src" alt="" srcset="">
27
-              </li>
28
-          </ul>
22
+      <el-tab-pane label="手机端" name="2">
23
+        <span class="bgi">自定义背景</span>
24
+        <el-upload
25
+          class="upload-demo"
26
+          name="files"
27
+          :action="uploadData.uploadUrl"
28
+          :data="uploadData.uploaderFiles"
29
+          :headers="{'Authorization': token}"
30
+          :on-success="uploadSuccess"
31
+          :on-remove="uploadRemove"
32
+          :on-error="uploadError"
33
+          list-type="picture"
34
+          :show-file-list="false"
35
+          :file-list="fileListName"
36
+        >
37
+          <el-button size="small" type="primary">点击上传</el-button>
38
+        </el-upload>
39
+      </el-tab-pane>
40
+      <div class="imgList">
41
+        <ul>
42
+          <li v-for="item in imgData" :key="item.id">
43
+            <img :src="item.src" alt srcset @click="handleClick(item.id,item.fileId)" />
44
+            <i
45
+              class="el-icon-delete"
46
+              :class="clickClass == item.id?'':'active'"
47
+              ref="delete"
48
+              @click="handleDelete(item.id)"
49
+            ></i>
50
+            <i
51
+              class="el-icon-success"
52
+              :class="clickClass == item.id?'':'active'"
53
+              ref="delete"
54
+              @click="handleDelete(item.id)"
55
+            ></i>
56
+          </li>
57
+        </ul>
29 58
       </div>
30 59
     </el-tabs>
31 60
     <pagination
@@ -34,33 +63,45 @@
34 63
       :pageindex.sync="pageParams.pageindex"
35 64
       :pagesize.sync="pageParams.pagesize"
36 65
       class="pagination"
37
-      @pagination="getList" />
66
+      @pagination="getList"
67
+    />
68
+    <div class="footer">
69
+      <el-button type="primary" @click="submit">确定</el-button>
70
+    </div>
38 71
   </el-card>
39 72
 </template>
40 73
 <script>
41 74
 import { mapGetters } from "vuex";
42
-import Pagination from '@/components/Pagination' // 对el-pagination 二次封装
43
-import {getPicture, addpic} from '@/api/subjectManagement/subjectManagement'
75
+import Pagination from "@/components/Pagination"; // 对el-pagination 二次封装
76
+import {
77
+  getPicture,
78
+  addpic,
79
+  deletepic,
80
+  saveBCI,
81
+} from "@/api/subjectManagement/subjectManagement";
44 82
 export default {
45
-//   name:'Pagination',
46
-components: {
47
-    Pagination
83
+  //   name:'Pagination',
84
+  components: {
85
+    Pagination,
48 86
   },
49 87
   computed: {
50 88
     ...mapGetters(["token"]),
51 89
   },
52 90
   created() {
53
-      this.getList()
91
+    this.getList();
54 92
   },
55 93
   data() {
56 94
     return {
57 95
       activeName: "1",
58 96
       fileList: [],
59
-      imgData:[],
97
+      fileListName: [],
98
+      clickClass: "-1",
99
+      fileId: "",
100
+      imgData: [],
60 101
       pageParams: {
61 102
         pageindex: 1, // 当前第几页
62 103
         pagesize: Number(this.$store.getters.serverConfig.PAGESIZE), // 每页几条数据
63
-        total: 0 // 总共多少数据
104
+        total: 0, // 总共多少数据
64 105
       },
65 106
       uploadData: {
66 107
         // 文件上传数据
@@ -73,8 +114,9 @@ components: {
73 114
     };
74 115
   },
75 116
   methods: {
76
-    handleClick(tab, event,val) {
77
-      console.log(tab, event,val);
117
+    handleClickTab(tab, event, val) {
118
+      this.activeName=tab.name
119
+      this.getList()
78 120
     },
79 121
     // 文件上传
80 122
     uploadSuccess(response, file, fileList) {
@@ -82,15 +124,15 @@ components: {
82 124
         response.data.map((item) => {
83 125
           this.fileList.push(item.F_Id);
84 126
         });
85
-        const params={
86
-            fife:this.fileList.toString(),
87
-            type:this.activeName
88
-        }
89
-        addpic(params).then(response=>{
90
-            if(response.state=='success'){
91
-                this.getList()
92
-            }
93
-        })
127
+        const params = {
128
+          fife: this.fileList.toString(),
129
+          type: this.activeName,
130
+        };
131
+        addpic(params).then((response) => {
132
+          if (response.state == "success") {
133
+            this.getList();
134
+          }
135
+        });
94 136
       } else {
95 137
         this.$message.error(response.message);
96 138
       }
@@ -102,40 +144,136 @@ components: {
102 144
       this.fileList = [];
103 145
     },
104 146
     // 获取图片列表
105
-    getList(){
106
-        const params={
107
-            type:this.activeName,
108
-            pageindex: this.pageParams.pageindex, // 第几页
109
-            pagesize: this.pageParams.pagesize, // 每页几条信息
147
+    getList() {
148
+      const params = {
149
+        type: this.activeName,
150
+        pageindex: this.pageParams.pageindex, // 第几页
151
+        pagesize: this.pageParams.pagesize, // 每页几条信息
152
+      };
153
+      getPicture(params).then((response) => {
154
+        if (response.state == "success") {
155
+          this.pageParams.total = response.total;
156
+          this.imgData = [];
157
+          response.rows.map((item) => {
158
+            if(item.F_Default==1){
159
+              this.clickClass=item.F_ID
160
+            }
161
+            this.imgData.push({
162
+              id: item.F_ID,
163
+              src: item.FileUrl.length>0?item.FileUrl[0].F_Url:'',
164
+              fileId: item.FileUrl.length>0?item.FileUrl[0].F_Id:'',
165
+            });
166
+          });
110 167
         }
111
-        getPicture(params).then(response=>{
112
-            if(response.state=='success'){
113
-                response.rows.map(item=>{
114
-                    this.imgData.push({
115
-                        id:item.FileUrl[0].F_Id,
116
-                        src:item.FileUrl[0].F_Url,
117
-                    })
118
-                })
168
+      });
169
+    },
170
+    //删除图片
171
+    handleDelete(id) {
172
+      this.$confirm("确定要删除该图片吗, 是否继续?", "提示", {
173
+        confirmButtonText: "确定",
174
+        cancelButtonText: "取消",
175
+        type: "warning",
176
+      })
177
+        .then(() => {
178
+          deletepic(id).then((response) => {
179
+            if (response.state.toLowerCase() === "success") {
180
+              this.getList();
181
+              this.$message.success("删除成功!");
119 182
             }
183
+          });
120 184
         })
121
-    }
185
+        .catch(() => {
186
+          this.$message({
187
+            type: "info",
188
+            message: "已取消删除",
189
+          });
190
+        });
191
+    },
192
+    //点击图片操作
193
+    handleClick(id, fileId) {
194
+      this.clickClass = id;
195
+      this.fileId = fileId;
196
+    },
197
+    //自定义图片保存
198
+    submit() {
199
+      if (this.clickClass == -1) {
200
+        this.$message.info("请选择图片");
201
+        return;
202
+      }
203
+      this.$confirm("确定要使用该图片吗, 是否继续?", "提示", {
204
+        confirmButtonText: "确定",
205
+        cancelButtonText: "取消",
206
+        type: "warning",
207
+      })
208
+        .then(() => {
209
+          const params = {
210
+            F_ID: this.clickClass,
211
+            F_File: this.fileId,
212
+            F_Type: this.activeName,
213
+            F_Default: 1,
214
+          };
215
+          saveBCI(params)
216
+            .then((response) => {
217
+              if (response.state == "success") {
218
+                this.$message.success("自定义背景成功");
219
+              }
220
+            })
221
+            .catch(() => {
222
+              this.$message.error("出错了!");
223
+            });
224
+        })
225
+        .catch(() => {
226
+          this.$message({
227
+            type: "info",
228
+            message: "已取消使用",
229
+          });
230
+        });
231
+    },
122 232
   },
123 233
 };
124 234
 </script>
125 235
 <style lang="scss" scoped>
126
-ul{
127
-    li{
128
-        margin: 0;
129
-        padding: 0;
130
-        width: 20%;
131
-        height: 20%;
132
-        list-style: none;
133
-        img{
134
-            display: block;
135
-            width: 100%;
136
-            height: 100%;
137
-        }
236
+ul {
237
+  padding: 0;
238
+  margin: 0;
239
+  li {
240
+    position: relative;
241
+    display: inline-block;
242
+    padding: 0;
243
+    margin: 20px 30px 0 0;
244
+    width: 16%;
245
+    height: 180px;
246
+    list-style: none;
247
+    img {
248
+      width: 100%;
249
+      height: 100%;
250
+      cursor: pointer;
138 251
     }
252
+  }
253
+}
254
+.imgList {
255
+  margin-top: 40px;
256
+  .el-icon-delete {
257
+    position: absolute;
258
+    right: 15px;
259
+    top: 5px;
260
+    cursor: pointer;
261
+    color: red;
262
+  }
263
+  .el-icon-success {
264
+    color: #1989fa;
265
+    position: absolute;
266
+    top: 50%;
267
+    left: 50%;
268
+    transform: translate(-50%, -50%);
269
+  }
270
+  .active {
271
+    display: none;
272
+  }
273
+}
274
+.footer {
275
+  float: right;
276
+  margin: 20px 30px 20px 0;
139 277
 }
140 278
 .bgi {
141 279
   float: left;

+ 21 - 6
CallCenterWeb.UI/src/views/subjectManagement/surveyArea/addOrEdit.vue

@@ -134,11 +134,11 @@ export default {
134 134
             F_City: this.ruleForm.city && this.ruleForm.city[0],
135 135
             F_County: this.ruleForm.city[1] && this.ruleForm.city[1],
136 136
             F_IsYes: this.ruleForm.isYes,
137
-            F_Subject: this.ruleForm.subject,
137
+            F_Subject: this.checkdivdata.length>0?this.checkdivdata.toString():'',
138 138
             F_Tips: this.ruleForm.tips,
139 139
             F_IsRepeat: this.ruleForm.isRepeat,
140 140
             F_Width: this.ruleForm.width,
141
-            F_Skipping: this.ruleForm.skipping,
141
+            F_Skipping: this.skippingData.length>0?this.skippingData.toString():'',
142 142
           };
143 143
 
144 144
           // 添加
@@ -184,7 +184,7 @@ export default {
184 184
         content: {
185 185
           content: topicAssociation, // 传递的组件对象
186 186
           parent: this, // 当前的vue对象
187
-          data: { rowid: "" }, // props
187
+          data: { rowid: "" ,checkdivdata:this.checkdivdata}, // props
188 188
         },
189 189
         area: ["80%", "80%"],
190 190
         title: "题目关联区域",
@@ -198,7 +198,7 @@ export default {
198 198
           content: {
199 199
             content: skipping, // 传递的组件对象
200 200
             parent: this, // 当前的vue对象
201
-            data: { rowid: this.checkdivdata }, // props
201
+            data: { rowid: this.checkdivdata,skippingList:this.skippingData }, // props
202 202
           },
203 203
           area: ["80%", "80%"],
204 204
           title: "跳题逻辑区域",
@@ -213,8 +213,23 @@ export default {
213 213
       getSurveyDetail(params).then((response) => {
214 214
         if (response.state.toLowerCase() === "success") {
215 215
           const res = response.data;
216
-          this.ruleForm.position = res.F_Name;
217
-          this.ruleForm.des = res.F_Des;
216
+          this.ruleForm.tips=res.F_Tips
217
+          this.ruleForm.isYes=res.F_IsYes.toString()
218
+          this.ruleForm.isRepeat=res.F_IsRepeat.toString()
219
+          this.ruleForm.width=res.F_Width
220
+          console.log(res.F_City)
221
+          if(res.F_City){
222
+            this.ruleForm.city.push(res.F_City)
223
+          }
224
+          if(res.F_County){
225
+            this.ruleForm.city.push(res.F_County)
226
+          }
227
+          if(res.F_Subject){
228
+            this.checkdivdata=res.F_Subject.split(',').map(Number)
229
+          }
230
+          if(res.F_Skipping){
231
+            this.skippingData=res.F_Skipping.split(',').map(Number)
232
+          }
218 233
         }
219 234
       });
220 235
     },

+ 2 - 2
CallCenterWeb.UI/src/views/subjectManagement/surveyArea/index.vue

@@ -11,7 +11,7 @@
11 11
       <el-table-column prop="F_Province" label="省" align="center" min-width=""/>
12 12
       <el-table-column prop="F_City" label="市" align="center" min-width=""/>
13 13
       <el-table-column prop="F_County" label="县" align="center" min-width=""/>
14
-      <el-table-column prop="F_Township" label="乡" align="center" min-width=""/>
14
+      <!-- <el-table-column prop="F_Township" label="乡" align="center" min-width=""/> -->
15 15
       <el-table-column prop="F_Tips" label="提示" align="center" min-width=""/>
16 16
       <el-table-column prop="F_Width" label="宽度" align="center" min-width=""/>
17 17
       <el-table-column label="操作" width="160" align="center" class-name="oparate_btn" fixed="right">
@@ -106,7 +106,7 @@ export default {
106 106
           parent: this, // 当前的vue对象
107 107
           data: { 'rowid': editId }// props
108 108
         },
109
-        area: ['40%', '70%'],
109
+        area: ['80%', '90%'],
110 110
         title: '编辑区域管理'
111 111
       })
112 112
     },

+ 119 - 62
CallCenterWeb.UI/src/views/subjectManagement/surveyArea/skipping.vue

@@ -1,76 +1,133 @@
1 1
 <template>
2
-    <el-card>
3
-        <el-row>
4
-            <el-col :span="12">
5
-                <div style="padding-top:15px" v-for=" item in subjectData" :key="item.F_ID">
6
-                    <div>
7
-                        <el-checkbox-group v-model="checkList">
8
-                            <el-checkbox label="复选框 A"></el-checkbox>
9
-                            <el-checkbox label="复选框 B"></el-checkbox>
10
-                            <el-checkbox label="复选框 C"></el-checkbox>
11
-                        </el-checkbox-group>
12
-                    </div>
13
-                    <div>
14
-                        <el-radio v-model="radio" label="1">备选项</el-radio>
15
-                        <el-radio v-model="radio" label="2">备选项</el-radio>
16
-                    </div>
17
-                    <div>
2
+  <el-card>
3
+    <el-row>
4
+      <el-col :span="12">
5
+        <div style="padding-top:15px" v-for=" (item,index) in subjectData" :key="item.F_ID">
6
+          <div v-if="item.F_Type==124">
7
+            <div class="skipping">{{item.F_Name}}</div>
8
+            <el-checkbox-group
9
+              v-model="modelData[index].value1"
10
+              v-for="item in item.optionInputs"
11
+              :key="item.F_ID"
12
+            >
13
+              <el-checkbox :label="item.F_ID">{{item.F_Name}}</el-checkbox>
14
+            </el-checkbox-group>
15
+          </div>
16
+          <div v-else-if="item.F_Type==123">
17
+            <div class="skipping">{{item.F_Name}}</div>
18
+            <el-radio-group
19
+              v-model="modelData[index].value2"
20
+              v-for="item in item.optionInputs"
21
+              :key="item.F_ID"
22
+            >
23
+              <el-radio :label="item.F_ID">{{item.F_Name}}</el-radio>
24
+            </el-radio-group>
25
+          </div>
26
+          <!-- <div v-else>
18 27
                         <el-input></el-input>
19
-                    </div>
20
-                </div>
21
-            </el-col>
22
-            <el-col :span="13">
23
-                <el-button type="primary" class="submit" @click="submit">确定</el-button>
24
-            </el-col>
25
-        </el-row>
26
-        
27
-    </el-card>
28
+          </div>-->
29
+        </div>
30
+      </el-col>
31
+      <el-col :span="13">
32
+        <el-button type="primary" class="submit" @click="submit">确定</el-button>
33
+      </el-col>
34
+    </el-row>
35
+  </el-card>
28 36
 </template>
29 37
 <script>
30
-import {getsubjectAndOp} from '@/api/subjectManagement/subjectManagement'
38
+import { getsubjectAndOp } from "@/api/subjectManagement/subjectManagement";
31 39
 export default {
32
-    props:{
33
-        layerid: {
34
-        type: String,
35
-        default: ''
36
-        },
37
-        rowid:{
38
-            type:Array,
39
-            default:[]
40
-        }
40
+  props: {
41
+    layerid: {
42
+      type: String,
43
+      default: "",
41 44
     },
42
-    data() {
43
-        return {
44
-            radio:'',
45
-            checkList:[],
46
-            subjectData:[],//题目数据
47
-        }
45
+    rowid: {
46
+      type: Array,
47
+      default: [],
48 48
     },
49
-    created() {
50
-        console.log(this.rowid)
51
-        this.getList(this.rowid)
49
+    skippingList: {
50
+      type: Array,
51
+      default: [],
52 52
     },
53
-    methods:{
54
-        getList(){
55
-            const params={
56
-                ids:this.rowid.toString()
57
-            }
58
-            getsubjectAndOp(params).then(response=>{
59
-                if(response.state=='success'){
60
-                    this.subjectData=response.rows
53
+  },
54
+  data() {
55
+    return {
56
+      radio: "",
57
+      checkList: [],
58
+      subjectData: [], //题目数据
59
+      modelData: [], //model数据
60
+      skippingData: [], //跳题数据
61
+    };
62
+  },
63
+  created() {
64
+    this.getList(this.rowid);
65
+    if (this.skippingList.length > 0) {
66
+      this.skippingData = this.skippingList;
67
+    }
68
+  },
69
+  methods: {
70
+    getList() {
71
+      const params = {
72
+        ids: this.rowid.toString(),
73
+      };
74
+      getsubjectAndOp(params).then((response) => {
75
+        if (response.state == "success") {
76
+          this.subjectData = response.rows;
77
+          var len = this.subjectData.length;
78
+          for (var i = 0; i < len; i++) {
79
+            var item = { value1: [], value2: "" };
80
+            this.modelData.push(item);
81
+          }
82
+          var m = 0;
83
+          this.subjectData.map((item) => {
84
+            if (item.F_Type == 123) {
85
+              item.optionInputs.map((item, index) => {
86
+                var j = this.skippingData.indexOf(item.F_ID);
87
+                if (j != -1) {
88
+                  this.modelData[m].value2 = this.skippingData[j];
61 89
                 }
62
-            })
63
-        },
64
-        submit(){
65
-            this.$parent.$layer.close(this.layerid)
66
-            this.$parent.checkdivdata=this.checkdiv
67
-            console.log(this.$parent.checkdivdata)
90
+              });
91
+            } else if (item.F_Type == 124) {
92
+              item.optionInputs.map((item, index) => {
93
+                var j = this.skippingData.indexOf(item.F_ID);
94
+                if (j != -1) {
95
+                  this.modelData[m].value1.push(this.skippingData[j]);
96
+                }
97
+              });
98
+            }
99
+            if (m < this.subjectData.length) {
100
+              m += 1;
101
+            }
102
+          });
68 103
         }
69
-    }
70
-}
104
+      });
105
+    },
106
+    submit() {
107
+      this.skippingData = [];
108
+      for (var i = 0; i < this.subjectData.length; i++) {
109
+        console.log(this.modelData[i].value1);
110
+        if (this.modelData[i].value1.length > 0) {
111
+          this.modelData[i].value1.map((item) => {
112
+            this.skippingData.push(item);
113
+          });
114
+        }
115
+        if (this.modelData[i].value2) {
116
+          this.skippingData.push(this.modelData[i].value2);
117
+        }
118
+      }
119
+      this.$parent.skippingData = this.skippingData;
120
+      this.$parent.$layer.close(this.layerid);
121
+    },
122
+  },
123
+  mounted() {},
124
+};
71 125
 </script>
72 126
 <style lang="scss" scoped>
73
-.submit{
74
-    margin-top: 20px;
127
+.submit {
128
+  margin-top: 20px;
129
+}
130
+.skipping {
131
+  margin: 10px 0;
75 132
 }
76 133
 </style>

+ 8 - 1
CallCenterWeb.UI/src/views/subjectManagement/surveyArea/topicAssociation.vue

@@ -23,7 +23,11 @@ export default {
23 23
         layerid: {
24 24
         type: String,
25 25
         default: ''
26
-        }
26
+        },
27
+        checkdivdata: {
28
+        type: Array,
29
+        default: []
30
+        },
27 31
     },
28 32
     data() {
29 33
         return {
@@ -33,6 +37,9 @@ export default {
33 37
     },
34 38
     created() {
35 39
         this.getList()
40
+        if(this.checkdivdata.length>0){
41
+            this.checkdiv=this.checkdivdata
42
+        }
36 43
     },
37 44
     methods:{
38 45
         getList(){