Commit 04aebc72652a16ff79c0bdac0d4bd4d8f99d870d
1 parent
430a7547
11
Showing
10 changed files
with
1503 additions
and
466 deletions
src/api/user.js
| ... | ... | @@ -165,10 +165,15 @@ export function UserInfo_List(params) { |
| 165 | 165 | url: `/UserInfo/List`, |
| 166 | 166 | method: 'get', |
| 167 | 167 | params |
| 168 | - }) | |
| 169 | - | |
| 168 | + }) | |
| 169 | +} | |
| 170 | 170 | |
| 171 | - | |
| 171 | +export function GetTypeSetting(params={}) { | |
| 172 | + return request({ | |
| 173 | + url: `/userType/GetTypeSetting`, | |
| 174 | + method: 'get', | |
| 175 | + params | |
| 176 | + }) | |
| 172 | 177 | } |
| 173 | 178 | //设置标签 |
| 174 | 179 | export function ChangeTags(params) { |
| ... | ... | @@ -177,4 +182,22 @@ export function UserInfo_List(params) { |
| 177 | 182 | method: 'post', |
| 178 | 183 | params |
| 179 | 184 | }) |
| 180 | -} | |
| 181 | 185 | \ No newline at end of file |
| 186 | +} | |
| 187 | + | |
| 188 | + | |
| 189 | +//用户列表 | |
| 190 | +export function UserTypeSettings(params) { | |
| 191 | + return request({ | |
| 192 | + url: `/userType/GetSettings`, | |
| 193 | + method: 'post', | |
| 194 | + params | |
| 195 | + }) | |
| 196 | +} | |
| 197 | + | |
| 198 | +export function saveTypeSetting(data) { | |
| 199 | + return request({ | |
| 200 | + url: `/userType/saveTypeSetting`, | |
| 201 | + method: 'post', | |
| 202 | + data | |
| 203 | + }) | |
| 204 | +} | |
| 182 | 205 | \ No newline at end of file | ... | ... |
src/utils/routerList.js
| ... | ... | @@ -230,6 +230,10 @@ export function getRoutes() { |
| 230 | 230 | title: '图片导入用户', |
| 231 | 231 | } |
| 232 | 232 | }, |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 233 | 237 | { |
| 234 | 238 | path: 'admin', |
| 235 | 239 | name: 'admin', |
| ... | ... | @@ -251,7 +255,18 @@ export function getRoutes() { |
| 251 | 255 | title: '系统管理', |
| 252 | 256 | icon: 'el-icon-s-platform' |
| 253 | 257 | }, |
| 254 | - children: [{ | |
| 258 | + children: [ | |
| 259 | + { | |
| 260 | + path: 'userdimset', | |
| 261 | + name: 'impouserdimsetrtuser', | |
| 262 | + | |
| 263 | + component: () => | |
| 264 | + import('@/views/user/userdimset'), | |
| 265 | + meta: { | |
| 266 | + title: '维度规则设置', | |
| 267 | + } | |
| 268 | + }, | |
| 269 | + { | |
| 255 | 270 | path: 'index', |
| 256 | 271 | name: 'index', |
| 257 | 272 | component: () => | ... | ... |
src/views/TestPaper/ManualTestPaper.vue
| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | <draggable :options="{animation:380,filter:'.unmover'}" group="itxst" v-model="arr1" @end="end1" |
| 19 | 19 | @add="RemoveHere" :move="onMove" class="infinite-list" :style="{'height':contentHeight-80+'px'}" |
| 20 | 20 | infinite-scroll-disabled="disabled" v-infinite-scroll="load" style="overflow:auto"> |
| 21 | - | |
| 21 | + | |
| 22 | 22 | <li v-for="i in arr1" class="infinite-list-item" :key="i.id" v-if="!classarr.some(o=>o == i.id)">{{ |
| 23 | 23 | i.subject }}</li> |
| 24 | 24 | <p v-if="loading" style="text-align: center;color: #cdcdcd;" class="unmover">加载中...</p> |
| ... | ... | @@ -69,17 +69,24 @@ |
| 69 | 69 | {{TestPaper.TotalScore || ''}} |
| 70 | 70 | </el-form-item> |
| 71 | 71 | |
| 72 | - | |
| 73 | - <el-form-item label="分类" class="el-form-item-custom"> | |
| 72 | + <el-form-item label="工种" prop="UserTypeOfWork" required class="el-form-item-custom" | |
| 73 | + style="margin-bottom: 20px !important;width:100%;"> | |
| 74 | + <el-select v-model="TestPaper.UserTypeOfWork" placeholder="请选择工种" style="width:100%"> | |
| 75 | + <el-option v-for="item in usertypelist" :label="item.name" :value="item.id"></el-option> | |
| 76 | + </el-select> | |
| 77 | + </el-form-item> | |
| 78 | + <el-form-item label="分类" class="el-form-item-custom" prop="QuestionClassId" > | |
| 74 | 79 | <el-cascader class="testpaper-input" v-model="TestPaper.QuestionClassId" |
| 75 | - style="width:400px;margin-bottom: 20px;" :props="{emitPath:false}" :clearable=true | |
| 80 | + style="width:100%;margin-bottom: 20px;" :props="{emitPath:false}" :clearable=true | |
| 76 | 81 | :options="QuestionClass"> |
| 77 | 82 | </el-cascader> |
| 78 | 83 | </el-form-item> |
| 79 | 84 | |
| 85 | + | |
| 86 | + | |
| 80 | 87 | <el-form-item label="有效时间" required> |
| 81 | - <el-form-item prop="date1"> | |
| 82 | - <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange" | |
| 88 | + <el-form-item prop="date"> | |
| 89 | + <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange" | |
| 83 | 90 | format="yyyy-MM-dd hh:mm:ss" range-separator="至" start-placeholder="开始时间" style="width:100%" |
| 84 | 91 | end-placeholder="结束时间"> |
| 85 | 92 | </el-date-picker> |
| ... | ... | @@ -120,19 +127,19 @@ |
| 120 | 127 | </el-row> |
| 121 | 128 | |
| 122 | 129 | |
| 123 | - | |
| 130 | + | |
| 124 | 131 | <el-dialog title="随机抽题" :visible.sync="dialogTableVisible"> |
| 132 | + | |
| 125 | 133 | <ul class="random-list"> |
| 126 | 134 | <li v-for="(item,index) in randomSubjectList" :key="index"> |
| 127 | 135 | <span>试题分类:</span> |
| 128 | - <el-cascader | |
| 129 | - style="flex:1" | |
| 130 | - v-model="item.QuestionClassId" | |
| 131 | - :options="randomQuestionTypeList" | |
| 132 | - clearable></el-cascader> | |
| 136 | + <el-cascader :multiple="false" style="flex:1" v-model="item.QuestionClassId" :options="randomQuestionTypeList" | |
| 137 | + clearable></el-cascader> | |
| 133 | 138 | <span style="margin-left:10px;">试题数量:</span> |
| 134 | - <el-input-number v-model="item.Count" :min="1" :max="100" label="描述文字" style="margin-left:10px;"></el-input-number> | |
| 135 | - <i class="el-icon-remove-outline" @click="changeSubjectCount(-1,index)" style="margin-left:10px;color:#f56c6c;"></i> | |
| 139 | + <el-input-number v-model="item.Count" :min="1" :max="100" label="描述文字" style="margin-left:10px;"> | |
| 140 | + </el-input-number> | |
| 141 | + <i class="el-icon-remove-outline" @click="changeSubjectCount(-1,index)" | |
| 142 | + style="margin-left:10px;color:#f56c6c;"></i> | |
| 136 | 143 | <i class="el-icon-circle-plus" @click="changeSubjectCount(1)" style="margin-left:10px;color:#67C23A;"></i> |
| 137 | 144 | </li> |
| 138 | 145 | </ul> |
| ... | ... | @@ -145,148 +152,171 @@ |
| 145 | 152 | </div> |
| 146 | 153 | </template> |
| 147 | 154 | <style lang="scss" scoped> |
| 148 | -.random-list { | |
| 149 | - display: flex; | |
| 150 | - flex-direction: column; | |
| 151 | - li { | |
| 152 | - margin-bottom: 20px; | |
| 155 | + .random-list { | |
| 153 | 156 | display: flex; |
| 154 | - align-items: center; | |
| 155 | - [class^="el-icon"] { | |
| 156 | - font-size: 24px; | |
| 157 | - cursor: pointer; | |
| 157 | + flex-direction: column; | |
| 158 | + | |
| 159 | + li { | |
| 160 | + margin-bottom: 20px; | |
| 161 | + display: flex; | |
| 162 | + align-items: center; | |
| 163 | + | |
| 164 | + [class^="el-icon"] { | |
| 165 | + font-size: 24px; | |
| 166 | + cursor: pointer; | |
| 167 | + } | |
| 158 | 168 | } |
| 159 | 169 | } |
| 160 | -} | |
| 161 | 170 | </style> |
| 162 | 171 | <script> |
| 163 | -import draggable from "vuedraggable"; | |
| 164 | -import { PostRandomGetQuestion, getQuestionList,getQuestionClassList } from "@/api/QuestionBank"; | |
| 165 | -import { GetQuestionClassByType } from "@/api/QuestionClass"; | |
| 166 | -import { EditTestPaper, GetToplevel } from "@/api/TestPaper"; | |
| 167 | -import { formatTime } from "@/utils/util"; | |
| 168 | -export default { | |
| 169 | - //注册draggable组件 | |
| 170 | - components: { | |
| 171 | - draggable, | |
| 172 | - }, | |
| 173 | - data() { | |
| 174 | - return { | |
| 175 | - randomSubjectList: [ | |
| 176 | - { | |
| 177 | - QuestionClassId: "", | |
| 178 | - Count: "", | |
| 179 | - }, | |
| 180 | - { | |
| 181 | - QuestionClassId: "", | |
| 182 | - Count: "", | |
| 183 | - }, | |
| 184 | - ], | |
| 185 | - randomQuestionTypeList: [], | |
| 186 | - dynamicValidateForm: { | |
| 187 | - domains: [ | |
| 172 | + import draggable from "vuedraggable"; | |
| 173 | + import { PostRandomGetQuestion, getQuestionList, getQuestionClassList } from "@/api/QuestionBank"; | |
| 174 | + import { GetQuestionClassByType } from "@/api/QuestionClass"; | |
| 175 | + import { EditTestPaper, GetToplevel } from "@/api/TestPaper"; | |
| 176 | + import { formatTime } from "@/utils/util"; | |
| 177 | + import { | |
| 178 | + GetTypeSetting | |
| 179 | + } from '@/api/user' | |
| 180 | + export default { | |
| 181 | + //注册draggable组件 | |
| 182 | + components: { | |
| 183 | + draggable, | |
| 184 | + }, | |
| 185 | + data() { | |
| 186 | + return { | |
| 187 | + randomSubjectList: [ | |
| 188 | 188 | { |
| 189 | - value: "", | |
| 189 | + QuestionClassId: "", | |
| 190 | + Count: "", | |
| 190 | 191 | }, |
| 191 | - ], | |
| 192 | - email: "", | |
| 193 | - }, | |
| 194 | - dialogTableVisible: false, | |
| 195 | - loadingType: false, | |
| 196 | - activeTab: "6", | |
| 197 | - parameter: { | |
| 198 | - pageIndex: 0, | |
| 199 | - pageSize: 20, | |
| 200 | - sort: "id", | |
| 201 | - sortOrder: 1, | |
| 202 | - keyWord: "", | |
| 203 | - QuestionClassId: 6, | |
| 204 | - status: 1, | |
| 205 | - }, | |
| 206 | - contentHeight: 0, | |
| 207 | - count: 0, | |
| 208 | - edit: false, | |
| 209 | - arr1: [], | |
| 210 | - arr2: [], | |
| 211 | - classarr: [], | |
| 212 | - moveId: -1, | |
| 213 | - TestPaper: { | |
| 214 | - TestPaperTitle: "未命名试卷标题", | |
| 215 | - TestPaperClassId: 0, | |
| 216 | - TotalScore: 0, | |
| 217 | - Describe: "", | |
| 218 | - SingleNumber: 0, | |
| 219 | - MultipleNumber: 0, | |
| 220 | - SubjectiveNumber: 0, | |
| 221 | - OriginalPrice: "0", | |
| 222 | - PresentPrice: "0", | |
| 223 | - MembershipPrice: "0", | |
| 224 | - QuestionBankIds: [], | |
| 225 | - }, | |
| 226 | - loading: false, | |
| 227 | - rules: { | |
| 228 | - OriginalPrice: [ | |
| 229 | 192 | { |
| 230 | - required: true, | |
| 231 | - message: "不能为空", | |
| 193 | + QuestionClassId: "", | |
| 194 | + Count: "", | |
| 232 | 195 | }, |
| 233 | 196 | ], |
| 234 | - PresentPrice: [ | |
| 235 | - { | |
| 236 | - required: true, | |
| 237 | - message: "不能为空", | |
| 238 | - }, | |
| 239 | - ], | |
| 240 | - MembershipPrice: [ | |
| 197 | + randomQuestionTypeList: [], | |
| 198 | + dynamicValidateForm: { | |
| 199 | + domains: [ | |
| 200 | + { | |
| 201 | + value: "", | |
| 202 | + }, | |
| 203 | + ], | |
| 204 | + email: "", | |
| 205 | + }, | |
| 206 | + usertypelist: [], //工种 | |
| 207 | + dialogTableVisible: false, | |
| 208 | + loadingType: false, | |
| 209 | + activeTab: "6", | |
| 210 | + parameter: { | |
| 211 | + pageIndex: 0, | |
| 212 | + pageSize: 20, | |
| 213 | + sort: "id", | |
| 214 | + sortOrder: 1, | |
| 215 | + keyWord: "", | |
| 216 | + QuestionClassId: 6, | |
| 217 | + status: 1, | |
| 218 | + }, | |
| 219 | + contentHeight: 0, | |
| 220 | + count: 0, | |
| 221 | + edit: false, | |
| 222 | + arr1: [], | |
| 223 | + arr2: [], | |
| 224 | + classarr: [], | |
| 225 | + moveId: -1, | |
| 226 | + TestPaper: { | |
| 227 | + TestPaperTitle: "未命名试卷标题", | |
| 228 | + TestPaperClassId: 0, | |
| 229 | + TotalScore: 0, | |
| 230 | + Describe: "", | |
| 231 | + SingleNumber: 0, | |
| 232 | + MultipleNumber: 0, | |
| 233 | + SubjectiveNumber: 0, | |
| 234 | + OriginalPrice: "0", | |
| 235 | + PresentPrice: "0", | |
| 236 | + MembershipPrice: "0", | |
| 237 | + QuestionBankIds: [], | |
| 238 | + }, | |
| 239 | + loading: false, | |
| 240 | + rules: { | |
| 241 | + OriginalPrice: [ | |
| 242 | + { | |
| 243 | + required: true, | |
| 244 | + message: "不能为空", | |
| 245 | + }, | |
| 246 | + ], | |
| 247 | + PresentPrice: [ | |
| 248 | + { | |
| 249 | + required: true, | |
| 250 | + message: "不能为空", | |
| 251 | + }, | |
| 252 | + ], | |
| 253 | + UserTypeOfWork: [ | |
| 254 | + { | |
| 255 | + required: true, | |
| 256 | + message: "请选择工种", | |
| 257 | + }, | |
| 258 | + ], QuestionClassId: [ | |
| 259 | + { | |
| 260 | + required: true, | |
| 261 | + message: "请选择分类", | |
| 262 | + }, | |
| 263 | + ],date: [ | |
| 264 | + { | |
| 265 | + required: true, | |
| 266 | + message: "请选择时间段", | |
| 267 | + }, | |
| 268 | + ], | |
| 269 | + }, | |
| 270 | + QuestionClass: [], | |
| 271 | + treeData: [ | |
| 241 | 272 | { |
| 242 | - required: true, | |
| 243 | - message: "不能为空", | |
| 273 | + value: 0, | |
| 274 | + label: "全部", | |
| 244 | 275 | }, |
| 245 | 276 | ], |
| 277 | + timeout: 0, | |
| 278 | + }; | |
| 279 | + }, | |
| 280 | + watch: { | |
| 281 | + activeTab() { | |
| 282 | + console.log("activeTab watch"); | |
| 283 | + this.search(); | |
| 246 | 284 | }, |
| 247 | - QuestionClass: [], | |
| 248 | - treeData: [ | |
| 249 | - { | |
| 250 | - value: 0, | |
| 251 | - label: "全部", | |
| 285 | + "parameter.keyWord": { | |
| 286 | + handler() { | |
| 287 | + clearTimeout(this.timeout); | |
| 288 | + this.timeout = setTimeout(() => { | |
| 289 | + this.search(); | |
| 290 | + }, 200); | |
| 252 | 291 | }, |
| 253 | - ], | |
| 254 | - timeout: 0, | |
| 255 | - }; | |
| 256 | - }, | |
| 257 | - watch: { | |
| 258 | - activeTab() { | |
| 259 | - console.log("activeTab watch"); | |
| 260 | - this.search(); | |
| 292 | + }, | |
| 261 | 293 | }, |
| 262 | - "parameter.keyWord": { | |
| 263 | - handler() { | |
| 264 | - clearTimeout(this.timeout); | |
| 265 | - this.timeout = setTimeout(() => { | |
| 266 | - this.search(); | |
| 267 | - }, 200); | |
| 294 | + computed: { | |
| 295 | + noMore() { | |
| 296 | + return this.arr1.length >= this.count; | |
| 297 | + }, | |
| 298 | + disabled() { | |
| 299 | + return this.loading || this.noMore; | |
| 268 | 300 | }, |
| 269 | 301 | }, |
| 270 | - }, | |
| 271 | - computed: { | |
| 272 | - noMore() { | |
| 273 | - return this.arr1.length >= this.count; | |
| 302 | + created() { | |
| 303 | + this.getQuestionClassListHeadler(); | |
| 304 | + this.getQuestionClassListHeadler2(); | |
| 305 | + | |
| 306 | + | |
| 307 | + GetTypeSetting({}).then(res => { | |
| 308 | + if (res.data) { | |
| 309 | + this.usertypelist = res.data || []; | |
| 310 | + } | |
| 311 | + }); | |
| 274 | 312 | }, |
| 275 | - disabled() { | |
| 276 | - return this.loading || this.noMore; | |
| 313 | + mounted() { | |
| 314 | + //计算页面内容区域的高度 | |
| 315 | + this.contentHeight = window.innerHeight - 90; | |
| 316 | + //this.GetList(); | |
| 277 | 317 | }, |
| 278 | - }, | |
| 279 | - created() { | |
| 280 | - this.getQuestionClassListHeadler(); | |
| 281 | - this.getQuestionClassListHeadler2(); | |
| 282 | - }, | |
| 283 | - mounted() { | |
| 284 | - //计算页面内容区域的高度 | |
| 285 | - this.contentHeight = window.innerHeight - 90; | |
| 286 | - //this.GetList(); | |
| 287 | - }, | |
| 288 | - methods: { | |
| 289 | - getSubTree(id, list) { | |
| 318 | + methods: { | |
| 319 | + getSubTree(id, list) { | |
| 290 | 320 | let result = []; |
| 291 | 321 | result = list.filter((t) => t.ParentId == id); |
| 292 | 322 | if (result.length) { |
| ... | ... | @@ -294,7 +324,7 @@ export default { |
| 294 | 324 | item.value = item.id; |
| 295 | 325 | item.label = item.ClassificationName; |
| 296 | 326 | item.children = this.getSubTree(item.id, list); |
| 297 | - if(!item.children || !item.children.length){ | |
| 327 | + if (!item.children || !item.children.length) { | |
| 298 | 328 | delete item.children; |
| 299 | 329 | } |
| 300 | 330 | return item; |
| ... | ... | @@ -306,12 +336,12 @@ export default { |
| 306 | 336 | let _this = this; |
| 307 | 337 | getQuestionClassList().then((res) => { |
| 308 | 338 | let alllist = res.data.data; |
| 309 | - let list = alllist.filter(t=>!t.ParentId); | |
| 339 | + let list = alllist.filter(t => !t.ParentId); | |
| 310 | 340 | list = list.map((t) => { |
| 311 | 341 | t.value = t.id; |
| 312 | 342 | t.label = t.ClassificationName; |
| 313 | - t.children = this.getSubTree(t.id,alllist); | |
| 314 | - if(!t.children || !t.children.length){ | |
| 343 | + t.children = this.getSubTree(t.id, alllist); | |
| 344 | + if (!t.children || !t.children.length) { | |
| 315 | 345 | delete t.children; |
| 316 | 346 | } |
| 317 | 347 | return t; |
| ... | ... | @@ -319,345 +349,359 @@ export default { |
| 319 | 349 | this.randomQuestionTypeList = list; |
| 320 | 350 | }); |
| 321 | 351 | }, |
| 322 | - randomCancel() { | |
| 323 | - this.dialogTableVisible = false; | |
| 324 | - }, | |
| 325 | - randomSubmit() { | |
| 326 | - let list = this.randomSubjectList; | |
| 327 | - if (list.findIndex((t) => !t.QuestionClassId || !t.QuestionClassId.length || !t.Count) > -1) { | |
| 328 | - this.$message.warning("参数不完整"); | |
| 329 | - return; | |
| 330 | - } | |
| 331 | - list = list.map(t=>{ | |
| 332 | - t.QuestionClassId = t.QuestionClassId.pop(); | |
| 333 | - return t; | |
| 334 | - }); | |
| 335 | - PostRandomGetQuestion(list).then((res) => { | |
| 336 | - let list = res.data.data; | |
| 337 | - this.arr2 = list; | |
| 352 | + randomCancel() { | |
| 338 | 353 | this.dialogTableVisible = false; |
| 339 | - if(!list.length){ | |
| 340 | - this.$message.warning('所选分类没有试题'); | |
| 354 | + }, | |
| 355 | + randomSubmit() { | |
| 356 | + var list = JSON.parse(JSON.stringify(this.randomSubjectList)); | |
| 357 | + if (list.findIndex((t) => !t.QuestionClassId || !t.QuestionClassId.length || !t.Count) > -1) { | |
| 358 | + this.$message.warning("参数不完整"); | |
| 359 | + return; | |
| 341 | 360 | } |
| 342 | - }); | |
| 343 | - }, | |
| 344 | - changeSubjectCount(type, index) { | |
| 345 | - if (type > 0) { | |
| 346 | - this.randomSubjectList.push({ | |
| 347 | - QuestionClassId: "", | |
| 348 | - Count: "", | |
| 361 | + | |
| 362 | + list = list.map(t => { | |
| 363 | + t.QuestionClassId = t.QuestionClassId.pop(); | |
| 364 | + return t; | |
| 349 | 365 | }); |
| 350 | - } else { | |
| 351 | - this.randomSubjectList.splice(index, 1); | |
| 352 | - } | |
| 353 | - }, | |
| 354 | - randomSubject() { | |
| 355 | - this.dialogTableVisible = true; | |
| 356 | - }, | |
| 357 | - submitForm(formName) { | |
| 358 | - this.$refs[formName].validate((valid) => { | |
| 359 | - if (valid) { | |
| 360 | - alert("submit!"); | |
| 366 | + PostRandomGetQuestion(list).then((res) => { | |
| 367 | + let list = res.data.data; | |
| 368 | + this.arr2 = list; | |
| 369 | + this.dialogTableVisible = false; | |
| 370 | + if (!list.length) { | |
| 371 | + this.$message.warning('所选分类没有试题'); | |
| 372 | + } | |
| 373 | + }); | |
| 374 | + }, | |
| 375 | + changeSubjectCount(type, index) { | |
| 376 | + if (type > 0) { | |
| 377 | + this.randomSubjectList.push({ | |
| 378 | + QuestionClassId: "", | |
| 379 | + Count: "", | |
| 380 | + }); | |
| 361 | 381 | } else { |
| 362 | - console.log("error submit!!"); | |
| 363 | - return false; | |
| 382 | + this.randomSubjectList.splice(index, 1); | |
| 364 | 383 | } |
| 365 | - }); | |
| 366 | - }, | |
| 367 | - resetForm(formName) { | |
| 368 | - this.$refs[formName].resetFields(); | |
| 369 | - }, | |
| 370 | - removeDomain(item) { | |
| 371 | - var index = this.dynamicValidateForm.domains.indexOf(item); | |
| 372 | - if (index !== -1) { | |
| 373 | - this.dynamicValidateForm.domains.splice(index, 1); | |
| 374 | - } | |
| 375 | - }, | |
| 376 | - addDomain() { | |
| 377 | - this.dynamicValidateForm.domains.push({ | |
| 378 | - value: "", | |
| 379 | - key: Date.now(), | |
| 380 | - }); | |
| 381 | - }, | |
| 382 | - changetimestartend(val, aa) { | |
| 383 | - this.TestPaper.EffectiveStartTime = formatTime(val[0]); | |
| 384 | - this.TestPaper.EffectiveEndTime = formatTime(val[1]); | |
| 385 | - }, | |
| 386 | - search() { | |
| 387 | - this.parameter.pageIndex = 1; | |
| 388 | - this.parameter.QuestionClassId = Number(this.activeTab); | |
| 389 | - this.GetList(); | |
| 390 | - }, | |
| 391 | - SubmitTestPaper() { | |
| 392 | - this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id); | |
| 393 | - var d = this.TestPaper; | |
| 394 | - if (this.arr2.length > 0) { | |
| 395 | - EditTestPaper(this.TestPaper).then((res) => { | |
| 396 | - if (res.data.code == 200) { | |
| 397 | - this.$confirm("组卷成功!", "消息"); | |
| 384 | + }, | |
| 385 | + randomSubject() { | |
| 386 | + this.dialogTableVisible = true; | |
| 387 | + }, | |
| 388 | + submitForm(formName) { | |
| 389 | + this.$refs[formName].validate((valid) => { | |
| 390 | + if (valid) { | |
| 391 | + alert("submit!"); | |
| 398 | 392 | } else { |
| 399 | - this.$confirm("组卷失败!", "消息"); | |
| 393 | + console.log("error submit!!"); | |
| 394 | + return false; | |
| 400 | 395 | } |
| 401 | 396 | }); |
| 402 | - } else { | |
| 403 | - this.$confirm("试题没有题目!", "消息"); | |
| 404 | - } | |
| 405 | - }, | |
| 406 | - load() { | |
| 407 | - this.loading = true; | |
| 408 | - this.parameter.pageIndex++; | |
| 409 | - this.GetList(); | |
| 410 | - this.loading = false; | |
| 411 | - }, | |
| 412 | - GetList() { | |
| 413 | - if (this.parameter.QuestionClassId == "1") { | |
| 414 | - if (!this.loadingType) | |
| 415 | - GetQuestionClassByType({ ClassType: 2 }).then((res) => { | |
| 416 | - var classarr = res.data.data || []; | |
| 417 | - this.arr1 = classarr.map((rs) => { | |
| 418 | - rs.subject = rs.subjectName = rs.ClassificationName; | |
| 419 | - rs.type = "wd"; | |
| 420 | - rs.subjectContent = "[]"; | |
| 421 | - return rs; | |
| 422 | - }); | |
| 423 | - this.loadingType = true; | |
| 424 | - }); | |
| 425 | - } else { | |
| 426 | - getQuestionList(this.parameter).then((res) => { | |
| 427 | - if (this.parameter.pageIndex == 1) { | |
| 428 | - this.arr1 = []; | |
| 397 | + }, | |
| 398 | + resetForm(formName) { | |
| 399 | + this.$refs[formName].resetFields(); | |
| 400 | + }, | |
| 401 | + removeDomain(item) { | |
| 402 | + var index = this.dynamicValidateForm.domains.indexOf(item); | |
| 403 | + if (index !== -1) { | |
| 404 | + this.dynamicValidateForm.domains.splice(index, 1); | |
| 405 | + } | |
| 406 | + }, | |
| 407 | + addDomain() { | |
| 408 | + this.dynamicValidateForm.domains.push({ | |
| 409 | + value: "", | |
| 410 | + key: Date.now(), | |
| 411 | + }); | |
| 412 | + }, | |
| 413 | + changetimestartend(val, aa) { | |
| 414 | + this.TestPaper.EffectiveStartTime = formatTime(val[0]); | |
| 415 | + this.TestPaper.EffectiveEndTime = formatTime(val[1]); | |
| 416 | + }, | |
| 417 | + search() { | |
| 418 | + this.parameter.pageIndex = 1; | |
| 419 | + this.parameter.QuestionClassId = Number(this.activeTab); | |
| 420 | + this.GetList(); | |
| 421 | + }, | |
| 422 | + SubmitTestPaper() { | |
| 423 | + | |
| 424 | + this.$refs['form'].validate((valid) => { | |
| 425 | + if (valid) { | |
| 426 | + this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id); | |
| 427 | + var d = this.TestPaper; | |
| 428 | + if (this.arr2.length > 0) { | |
| 429 | + EditTestPaper(this.TestPaper).then((res) => { | |
| 430 | + if (res.data.code == 200) { | |
| 431 | + this.$confirm("组卷成功!", "消息"); | |
| 432 | + } else { | |
| 433 | + this.$confirm("组卷失败!", "消息"); | |
| 434 | + } | |
| 435 | + }); | |
| 436 | + } else { | |
| 437 | + this.$confirm("试题没有题目!", "消息"); | |
| 438 | + } | |
| 439 | + } else { | |
| 440 | + | |
| 441 | + return false; | |
| 429 | 442 | } |
| 430 | - res.data.data.rows.forEach((item, i) => { | |
| 431 | - this.arr1.push(item); | |
| 432 | - }); | |
| 433 | - this.count = res.data.data.total; | |
| 434 | - this.$forceUpdate(); | |
| 435 | 443 | }); |
| 436 | - } | |
| 437 | - }, | |
| 438 | - end1(e) { | |
| 439 | - var that = this; | |
| 440 | - if (that.arr1.length < 10) { | |
| 441 | - this.load(); | |
| 442 | - } | |
| 443 | 444 | |
| 444 | - var items = this.arr2.filter(function (m) { | |
| 445 | - return m.id == that.moveId; | |
| 446 | - }); | |
| 447 | 445 | |
| 448 | - //如果左边 | |
| 449 | - if (items.length < 2) return; | |
| 450 | - this.arr2.splice(e.newDraggableIndex, 1); | |
| 451 | 446 | |
| 452 | - // SingleNumber:0, | |
| 453 | - // MultipleNumber:0, | |
| 454 | - // SubjectiveNumber:0, | |
| 455 | - }, | |
| 456 | - //从右边移除到左边 | |
| 457 | - RemoveHere(e) { | |
| 458 | - if (e.item._underlying_vm_.subjectType == 1) { | |
| 459 | - this.TestPaper.SingleNumber -= 1; | |
| 460 | - } | |
| 461 | - if (e.item._underlying_vm_.subjectType == 2) { | |
| 462 | - this.TestPaper.MultipleNumber -= 1; | |
| 463 | - } | |
| 464 | - if (e.item._underlying_vm_.subjectType == 3) { | |
| 465 | - this.TestPaper.SubjectiveNumber -= 1; | |
| 466 | - } | |
| 467 | - this.TestPaper.TotalScore -= e.item._underlying_vm_.fraction; | |
| 468 | - this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id); | |
| 469 | - }, | |
| 470 | - //从左边添加到右边 | |
| 471 | - ComeHere(e) { | |
| 472 | - var d = e.item._underlying_vm_; | |
| 473 | - if (e.item._underlying_vm_.subjectType == 1) { | |
| 474 | - this.TestPaper.SingleNumber += 1; | |
| 475 | - } | |
| 476 | - if (e.item._underlying_vm_.subjectType == 2) { | |
| 477 | - this.TestPaper.MultipleNumber += 1; | |
| 478 | - } | |
| 479 | - if (e.item._underlying_vm_.subjectType == 3) { | |
| 480 | - this.TestPaper.SubjectiveNumber += 1; | |
| 481 | - } | |
| 482 | - this.TestPaper.TotalScore += e.item._underlying_vm_.fraction; | |
| 483 | - | |
| 484 | - this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id); | |
| 485 | - | |
| 486 | - if (d.type == "wd") { | |
| 487 | - getQuestionList({ | |
| 488 | - QuestionClassId: d.id, | |
| 489 | - PageIndex: 1, | |
| 490 | - PageSize: 1000, | |
| 491 | - }).then((res) => { | |
| 492 | - var data = res.data.data.rows || []; | |
| 493 | - this.arr2 = this.arr2.filter((o) => o.type != "wd"); | |
| 494 | - // this.arr1.splice(this.arr1.findIndex(o=>o.id == d.id),1) | |
| 495 | - this.classarr.push(d.id); | |
| 496 | - // var test = this.arr2; | |
| 497 | - this.arr2.push(...data); | |
| 498 | - data.forEach((rs) => { | |
| 499 | - if (rs.subjectType == 1) { | |
| 500 | - this.TestPaper.SingleNumber += 1; | |
| 501 | - } | |
| 502 | - if (rs.subjectType == 2) { | |
| 503 | - this.TestPaper.MultipleNumber += 1; | |
| 504 | - } | |
| 505 | - if (rs.subjectType == 3) { | |
| 506 | - this.TestPaper.SubjectiveNumber += 1; | |
| 447 | + }, | |
| 448 | + load() { | |
| 449 | + this.loading = true; | |
| 450 | + this.parameter.pageIndex++; | |
| 451 | + this.GetList(); | |
| 452 | + this.loading = false; | |
| 453 | + }, | |
| 454 | + GetList() { | |
| 455 | + if (this.parameter.QuestionClassId == "1") { | |
| 456 | + if (!this.loadingType) | |
| 457 | + GetQuestionClassByType({ ClassType: 2 }).then((res) => { | |
| 458 | + var classarr = res.data.data || []; | |
| 459 | + this.arr1 = classarr.map((rs) => { | |
| 460 | + rs.subject = rs.subjectName = rs.ClassificationName; | |
| 461 | + rs.type = "wd"; | |
| 462 | + rs.subjectContent = "[]"; | |
| 463 | + return rs; | |
| 464 | + }); | |
| 465 | + this.loadingType = true; | |
| 466 | + }); | |
| 467 | + } else { | |
| 468 | + getQuestionList(this.parameter).then((res) => { | |
| 469 | + if (this.parameter.pageIndex == 1) { | |
| 470 | + this.arr1 = []; | |
| 507 | 471 | } |
| 472 | + res.data.data.rows.forEach((item, i) => { | |
| 473 | + this.arr1.push(item); | |
| 474 | + }); | |
| 475 | + this.count = res.data.data.total; | |
| 476 | + this.$forceUpdate(); | |
| 508 | 477 | }); |
| 478 | + } | |
| 479 | + }, | |
| 480 | + end1(e) { | |
| 481 | + var that = this; | |
| 482 | + if (that.arr1.length < 10) { | |
| 483 | + this.load(); | |
| 484 | + } | |
| 485 | + | |
| 486 | + var items = this.arr2.filter(function (m) { | |
| 487 | + return m.id == that.moveId; | |
| 509 | 488 | }); |
| 510 | - } | |
| 511 | - }, | |
| 512 | - //右边往左边拖动时的事件 | |
| 513 | - end2(e) { | |
| 514 | - var that = this; | |
| 515 | - var items = this.arr1.filter(function (m) { | |
| 516 | - return m.id == that.moveId; | |
| 517 | - }); | |
| 518 | - //如果左边 | |
| 519 | - if (items.length < 2) return; | |
| 520 | - this.arr1.splice(e.newDraggableIndex, 1); | |
| 521 | - }, | |
| 522 | - //move回调方法 | |
| 523 | - onMove(e, originalEvent) { | |
| 524 | - //this.moveId = e.relatedContext.element.id; | |
| 525 | - return true; | |
| 526 | - }, | |
| 527 | - getQuestionClassListHeadler() { | |
| 528 | - let _this = this; | |
| 529 | - GetToplevel().then((res) => { | |
| 530 | - var gettree = function (titem) { | |
| 531 | - titem.children = []; | |
| 532 | - let childrenList = res.data.data.filter( | |
| 533 | - (u) => u.ParentId == titem.value | |
| 534 | - ); | |
| 535 | - if (childrenList.length == 0) titem.children = undefined; | |
| 489 | + | |
| 490 | + //如果左边 | |
| 491 | + if (items.length < 2) return; | |
| 492 | + this.arr2.splice(e.newDraggableIndex, 1); | |
| 493 | + | |
| 494 | + // SingleNumber:0, | |
| 495 | + // MultipleNumber:0, | |
| 496 | + // SubjectiveNumber:0, | |
| 497 | + }, | |
| 498 | + //从右边移除到左边 | |
| 499 | + RemoveHere(e) { | |
| 500 | + if (e.item._underlying_vm_.subjectType == 1) { | |
| 501 | + this.TestPaper.SingleNumber -= 1; | |
| 502 | + } | |
| 503 | + if (e.item._underlying_vm_.subjectType == 2) { | |
| 504 | + this.TestPaper.MultipleNumber -= 1; | |
| 505 | + } | |
| 506 | + if (e.item._underlying_vm_.subjectType == 3) { | |
| 507 | + this.TestPaper.SubjectiveNumber -= 1; | |
| 508 | + } | |
| 509 | + this.TestPaper.TotalScore -= e.item._underlying_vm_.fraction; | |
| 510 | + this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id); | |
| 511 | + }, | |
| 512 | + //从左边添加到右边 | |
| 513 | + ComeHere(e) { | |
| 514 | + var d = e.item._underlying_vm_; | |
| 515 | + if (e.item._underlying_vm_.subjectType == 1) { | |
| 516 | + this.TestPaper.SingleNumber += 1; | |
| 517 | + } | |
| 518 | + if (e.item._underlying_vm_.subjectType == 2) { | |
| 519 | + this.TestPaper.MultipleNumber += 1; | |
| 520 | + } | |
| 521 | + if (e.item._underlying_vm_.subjectType == 3) { | |
| 522 | + this.TestPaper.SubjectiveNumber += 1; | |
| 523 | + } | |
| 524 | + this.TestPaper.TotalScore += e.item._underlying_vm_.fraction; | |
| 525 | + | |
| 526 | + this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id); | |
| 527 | + | |
| 528 | + if (d.type == "wd") { | |
| 529 | + getQuestionList({ | |
| 530 | + QuestionClassId: d.id, | |
| 531 | + PageIndex: 1, | |
| 532 | + PageSize: 1000, | |
| 533 | + }).then((res) => { | |
| 534 | + var data = res.data.data.rows || []; | |
| 535 | + data = data.filter(o => !this.arr2.find(d => d.id == o.id)); | |
| 536 | + this.arr2 = this.arr2.filter((o) => o.type != "wd"); | |
| 537 | + // this.arr1.splice(this.arr1.findIndex(o=>o.id == d.id),1) | |
| 538 | + this.classarr.push(d.id); | |
| 539 | + // var test = this.arr2; | |
| 540 | + this.arr2.push(...data); | |
| 541 | + data.forEach((rs) => { | |
| 542 | + if (rs.subjectType == 1) { | |
| 543 | + this.TestPaper.SingleNumber += 1; | |
| 544 | + } | |
| 545 | + if (rs.subjectType == 2) { | |
| 546 | + this.TestPaper.MultipleNumber += 1; | |
| 547 | + } | |
| 548 | + if (rs.subjectType == 3) { | |
| 549 | + this.TestPaper.SubjectiveNumber += 1; | |
| 550 | + } | |
| 551 | + }); | |
| 552 | + }); | |
| 553 | + } | |
| 554 | + }, | |
| 555 | + //右边往左边拖动时的事件 | |
| 556 | + end2(e) { | |
| 557 | + var that = this; | |
| 558 | + var items = this.arr1.filter(function (m) { | |
| 559 | + return m.id == that.moveId; | |
| 560 | + }); | |
| 561 | + //如果左边 | |
| 562 | + if (items.length < 2) return; | |
| 563 | + this.arr1.splice(e.newDraggableIndex, 1); | |
| 564 | + }, | |
| 565 | + //move回调方法 | |
| 566 | + onMove(e, originalEvent) { | |
| 567 | + //this.moveId = e.relatedContext.element.id; | |
| 568 | + return true; | |
| 569 | + }, | |
| 570 | + getQuestionClassListHeadler() { | |
| 571 | + let _this = this; | |
| 572 | + GetToplevel().then((res) => { | |
| 573 | + var gettree = function (titem) { | |
| 574 | + titem.children = []; | |
| 575 | + let childrenList = res.data.data.filter( | |
| 576 | + (u) => u.ParentId == titem.value | |
| 577 | + ); | |
| 578 | + if (childrenList.length == 0) titem.children = undefined; | |
| 579 | + res.data.data | |
| 580 | + .filter((u) => u.ParentId == titem.value) | |
| 581 | + .forEach((item, i) => { | |
| 582 | + var model = { | |
| 583 | + value: item.id, | |
| 584 | + label: item.ClassTitle, | |
| 585 | + }; | |
| 586 | + gettree(model); | |
| 587 | + titem.children.push(model); | |
| 588 | + }); | |
| 589 | + }; | |
| 536 | 590 | res.data.data |
| 537 | - .filter((u) => u.ParentId == titem.value) | |
| 591 | + .filter((u) => u.ParentId == 0) | |
| 538 | 592 | .forEach((item, i) => { |
| 539 | 593 | var model = { |
| 540 | 594 | value: item.id, |
| 541 | 595 | label: item.ClassTitle, |
| 542 | 596 | }; |
| 543 | 597 | gettree(model); |
| 544 | - titem.children.push(model); | |
| 598 | + _this.QuestionClass.push(model); | |
| 599 | + _this.treeData.push(model); | |
| 545 | 600 | }); |
| 546 | - }; | |
| 547 | - res.data.data | |
| 548 | - .filter((u) => u.ParentId == 0) | |
| 549 | - .forEach((item, i) => { | |
| 550 | - var model = { | |
| 551 | - value: item.id, | |
| 552 | - label: item.ClassTitle, | |
| 553 | - }; | |
| 554 | - gettree(model); | |
| 555 | - _this.QuestionClass.push(model); | |
| 556 | - _this.treeData.push(model); | |
| 557 | - }); | |
| 558 | - }); | |
| 601 | + }); | |
| 602 | + }, | |
| 559 | 603 | }, |
| 560 | - }, | |
| 561 | -}; | |
| 604 | + }; | |
| 562 | 605 | </script> |
| 563 | 606 | |
| 564 | 607 | <style lang="scss" scoped> |
| 565 | -.el-row { | |
| 566 | - /* margin-bottom: 20px; */ | |
| 567 | - &:last-child { | |
| 568 | - margin-bottom: 0; | |
| 608 | + .el-row { | |
| 609 | + | |
| 610 | + /* margin-bottom: 20px; */ | |
| 611 | + &:last-child { | |
| 612 | + margin-bottom: 0; | |
| 613 | + } | |
| 569 | 614 | } |
| 570 | -} | |
| 571 | - | |
| 572 | -.el-col { | |
| 573 | - border-radius: 4px; | |
| 574 | -} | |
| 575 | - | |
| 576 | -.bg-purple-dark { | |
| 577 | - background: #99a9bf; | |
| 578 | -} | |
| 579 | - | |
| 580 | -.bg-purple { | |
| 581 | - background: #efefef; | |
| 582 | -} | |
| 583 | - | |
| 584 | -.bg-purple-light { | |
| 585 | - background: #e5e9f2; | |
| 586 | -} | |
| 587 | - | |
| 588 | -.grid-content { | |
| 589 | - border-radius: 4px; | |
| 590 | - min-height: 36px; | |
| 591 | - height: 100%; | |
| 592 | -} | |
| 593 | - | |
| 594 | -.row-bg { | |
| 595 | - padding: 10px 0; | |
| 596 | - background-color: #f9fafc; | |
| 597 | -} | |
| 598 | - | |
| 599 | -.infinite-list { | |
| 600 | - list-style: none; | |
| 601 | - margin: 0px; | |
| 602 | - padding: 0px; | |
| 603 | - | |
| 604 | - &::-webkit-scrollbar { | |
| 605 | - width: 6px; | |
| 615 | + | |
| 616 | + .el-col { | |
| 617 | + border-radius: 4px; | |
| 618 | + } | |
| 619 | + | |
| 620 | + .bg-purple-dark { | |
| 621 | + background: #99a9bf; | |
| 622 | + } | |
| 623 | + | |
| 624 | + .bg-purple { | |
| 625 | + background: #efefef; | |
| 606 | 626 | } |
| 607 | 627 | |
| 608 | - //滚动条小方块 | |
| 609 | - &::-webkit-scrollbar-thumb { | |
| 610 | - border-radius: 10px; | |
| 611 | - background: #304156; | |
| 628 | + .bg-purple-light { | |
| 629 | + background: #e5e9f2; | |
| 612 | 630 | } |
| 613 | 631 | |
| 614 | - //滚动条轨道 | |
| 615 | - &::-webkit-scrollbar-track { | |
| 616 | - // border-radius: 10px; | |
| 617 | - height: 100px; | |
| 618 | - background: #cdcdcd; | |
| 632 | + .grid-content { | |
| 633 | + border-radius: 4px; | |
| 634 | + min-height: 36px; | |
| 635 | + height: 100%; | |
| 619 | 636 | } |
| 620 | 637 | |
| 621 | - .infinite-list-item { | |
| 622 | - padding: 10px; | |
| 623 | - min-height: 60px; | |
| 624 | - width: 95%; | |
| 625 | - margin: auto; | |
| 626 | - background-color: #fff; | |
| 627 | - margin-bottom: 10px; | |
| 628 | - border-radius: 5px; | |
| 629 | - box-shadow: 0 0 5px #cdcdcd; | |
| 630 | - | |
| 631 | - &:first-child { | |
| 632 | - margin-top: 10px; | |
| 638 | + .row-bg { | |
| 639 | + padding: 10px 0; | |
| 640 | + background-color: #f9fafc; | |
| 641 | + } | |
| 642 | + | |
| 643 | + .infinite-list { | |
| 644 | + list-style: none; | |
| 645 | + margin: 0px; | |
| 646 | + padding: 0px; | |
| 647 | + | |
| 648 | + &::-webkit-scrollbar { | |
| 649 | + width: 6px; | |
| 650 | + } | |
| 651 | + | |
| 652 | + //滚动条小方块 | |
| 653 | + &::-webkit-scrollbar-thumb { | |
| 654 | + border-radius: 10px; | |
| 655 | + background: #304156; | |
| 656 | + } | |
| 657 | + | |
| 658 | + //滚动条轨道 | |
| 659 | + &::-webkit-scrollbar-track { | |
| 660 | + // border-radius: 10px; | |
| 661 | + height: 100px; | |
| 662 | + background: #cdcdcd; | |
| 663 | + } | |
| 664 | + | |
| 665 | + .infinite-list-item { | |
| 666 | + padding: 10px; | |
| 667 | + min-height: 60px; | |
| 668 | + width: 95%; | |
| 669 | + margin: auto; | |
| 670 | + background-color: #fff; | |
| 671 | + margin-bottom: 10px; | |
| 672 | + border-radius: 5px; | |
| 673 | + box-shadow: 0 0 5px #cdcdcd; | |
| 674 | + | |
| 675 | + &:first-child { | |
| 676 | + margin-top: 10px; | |
| 677 | + } | |
| 633 | 678 | } |
| 634 | 679 | } |
| 635 | -} | |
| 636 | - | |
| 637 | -.option-p { | |
| 638 | - line-height: 15px; | |
| 639 | -} | |
| 640 | - | |
| 641 | -.areahead { | |
| 642 | - text-align: center; | |
| 643 | - height: 60px; | |
| 644 | - line-height: 60px; | |
| 645 | - border-bottom: 1px solid #cdcdcd; | |
| 646 | -} | |
| 647 | - | |
| 648 | -.testPaper-manager { | |
| 649 | - margin: 10px 20px 10px 10px; | |
| 650 | -} | |
| 651 | - | |
| 652 | -.testPaper-manager .el-form-item { | |
| 653 | - margin-bottom: 20px; | |
| 654 | -} | |
| 655 | - | |
| 656 | -.el-form-item-custom { | |
| 657 | - margin-bottom: 0px !important; | |
| 658 | -} | |
| 659 | - | |
| 660 | -.testpaper-input { | |
| 661 | - //max-width: 400px; | |
| 662 | -} | |
| 680 | + | |
| 681 | + .option-p { | |
| 682 | + line-height: 15px; | |
| 683 | + } | |
| 684 | + | |
| 685 | + .areahead { | |
| 686 | + text-align: center; | |
| 687 | + height: 60px; | |
| 688 | + line-height: 60px; | |
| 689 | + border-bottom: 1px solid #cdcdcd; | |
| 690 | + } | |
| 691 | + | |
| 692 | + .testPaper-manager { | |
| 693 | + margin: 10px 20px 10px 10px; | |
| 694 | + } | |
| 695 | + | |
| 696 | + .testPaper-manager .el-form-item { | |
| 697 | + margin-bottom: 20px; | |
| 698 | + } | |
| 699 | + | |
| 700 | + .el-form-item-custom { | |
| 701 | + margin-bottom: 0px !important; | |
| 702 | + } | |
| 703 | + | |
| 704 | + .testpaper-input { | |
| 705 | + //max-width: 400px; | |
| 706 | + } | |
| 663 | 707 | </style> |
| 664 | 708 | \ No newline at end of file | ... | ... |
src/views/TestPaper/TestPaperList.vue
| ... | ... | @@ -100,6 +100,15 @@ |
| 100 | 100 | <el-option label="面试题" value="4"></el-option> |
| 101 | 101 | </el-select> |
| 102 | 102 | </el-form-item> |
| 103 | + | |
| 104 | + | |
| 105 | + <el-form-item label="工种" class="el-form-item-custom"> | |
| 106 | + <el-select v-model="TestPaper.UserTypeOfWork" placeholder="请选择工种"> | |
| 107 | + <el-option v-for="item in usertypelist" :label="item.name" :value="item.id"></el-option> | |
| 108 | + </el-select> | |
| 109 | + </el-form-item> | |
| 110 | + | |
| 111 | + | |
| 103 | 112 | <el-form-item label="有效时间" required> |
| 104 | 113 | <el-form-item prop="date1"> |
| 105 | 114 | <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange" |
| ... | ... | @@ -155,6 +164,9 @@ |
| 155 | 164 | getTestPaperClassList, |
| 156 | 165 | DeleteTestPaper |
| 157 | 166 | } from '@/api/TestPaper' |
| 167 | + | |
| 168 | + import { GetTypeSetting | |
| 169 | + } from '@/api/user' | |
| 158 | 170 | import { formatTime } from '@/utils/util' |
| 159 | 171 | let that |
| 160 | 172 | export default { |
| ... | ... | @@ -174,6 +186,7 @@ |
| 174 | 186 | dialogAddTestPaperVIsible: false, |
| 175 | 187 | dialogQuestionVlsible: false, |
| 176 | 188 | QuestionClass: [], |
| 189 | + usertypelist:[], | |
| 177 | 190 | TestPaper: { |
| 178 | 191 | TestPaperTitle: "", |
| 179 | 192 | PlateClass: 4, |
| ... | ... | @@ -209,6 +222,12 @@ |
| 209 | 222 | getTestPaperClassList(parameter).then(res => { |
| 210 | 223 | this.list = res.data.data; |
| 211 | 224 | }); |
| 225 | + | |
| 226 | + GetTypeSetting({}).then(res=>{ | |
| 227 | + if(res.data){ | |
| 228 | + this.usertypelist = res.data || []; | |
| 229 | + } | |
| 230 | + }); | |
| 212 | 231 | }, |
| 213 | 232 | filters: { |
| 214 | 233 | typeFilters(val) { | ... | ... |
src/views/live/index.vue
| ... | ... | @@ -16,7 +16,6 @@ |
| 16 | 16 | }, |
| 17 | 17 | mounted() { |
| 18 | 18 | this.$nextTick(function () { |
| 19 | - | |
| 20 | 19 | var player = new TcPlayer("id_test_video", { |
| 21 | 20 | m3u8: `http://watch.t1j2.com/live/${this.streaName}.m3u8`, |
| 22 | 21 | flv: `http://watch.t1j2.com/live/${this.streaName}.flv`, //增加了一个 flv 的播放地址,用于PC平台的播放 请替换成实际可用的播放地址 | ... | ... |
src/views/login/index.vue
src/views/user/picuserimport.vue
| ... | ... | @@ -96,7 +96,7 @@ |
| 96 | 96 | > |
| 97 | 97 | </el-input> |
| 98 | 98 | <span v-if="!scope.row.edit" |
| 99 | - >{{ scope.row[item.prop] }}{{ scope.row.edit }}</span | |
| 99 | + >{{ scope.row[item.prop] }}</span | |
| 100 | 100 | > |
| 101 | 101 | </template> |
| 102 | 102 | </el-table-column> |
| ... | ... | @@ -298,6 +298,7 @@ export default { |
| 298 | 298 | this.multipleSelection = val; |
| 299 | 299 | console.log("selection:", this.multipleSelection); |
| 300 | 300 | }, |
| 301 | + | |
| 301 | 302 | //编辑 |
| 302 | 303 | handleEdit(index, row) { |
| 303 | 304 | if (row.ViewPath) { |
| ... | ... | @@ -305,13 +306,21 @@ export default { |
| 305 | 306 | }else{ |
| 306 | 307 | this.currentFilePath = ''; |
| 307 | 308 | } |
| 308 | - this.table_data = this.table_data.map(t=>{ | |
| 309 | - delete t.edit; | |
| 310 | - return t; | |
| 311 | - }) | |
| 312 | - this.table_data[index].edit = true; | |
| 313 | - this.table_data.push(this.table_data.pop()); | |
| 314 | - this.$forceUpdate(); | |
| 309 | + // debugger; | |
| 310 | + // if(this.table_data) | |
| 311 | + // this.table_data = this.table_data.map(t=>{ | |
| 312 | + // t.edit = false; | |
| 313 | + // return t; | |
| 314 | + // }) | |
| 315 | + this.table_data.forEach((o,i)=>{ | |
| 316 | + this.$set(this.table_data[i],'edit',i==index) | |
| 317 | + }); | |
| 318 | + // this.table_data = Object.assign({},this.table_data); | |
| 319 | + // this.table_data[index].edit = true; | |
| 320 | + // this.table_data.push(this.table_data.pop()); | |
| 321 | + // this.$forceUpdate(); | |
| 322 | + | |
| 323 | + // this.$set(this.table_data[index],'edit',true) | |
| 315 | 324 | }, |
| 316 | 325 | //删除 |
| 317 | 326 | handleDelete(index, row) { |
| ... | ... | @@ -423,7 +432,13 @@ export default { |
| 423 | 432 | }, |
| 424 | 433 | }; |
| 425 | 434 | </script> |
| 435 | +<style scoped> | |
| 436 | + /deep/.el-table__body-wrapper{ | |
| 437 | + height:92% !important; | |
| 438 | + } | |
| 439 | +</style> | |
| 426 | 440 | <style lang="scss" scoped> |
| 441 | + | |
| 427 | 442 | .main-box{ |
| 428 | 443 | display: flex; |
| 429 | 444 | } | ... | ... |
src/views/user/userdimset copy.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div style="padding: 10px"> | |
| 3 | + <div class="seetingsDiv" style=""> | |
| 4 | + <div class="flex" style="margin-top: 10px"> | |
| 5 | + <el-form :inline="true" class="demo-form-inline"> | |
| 6 | + <el-form-item label="关键字"> | |
| 7 | + <el-input | |
| 8 | + placeholder="输入关键字搜索" | |
| 9 | + v-model="query.keyword" | |
| 10 | + ></el-input> | |
| 11 | + </el-form-item> | |
| 12 | + | |
| 13 | + <el-form-item label="最高学历"> | |
| 14 | + <el-select v-model="query.xueli" placeholder="最高学历"> | |
| 15 | + <el-option label="大专" value="dazhuan"></el-option> | |
| 16 | + <el-option label="本科" value="benke"></el-option> | |
| 17 | + <el-option label="博士" value="boshi"></el-option> | |
| 18 | + </el-select> | |
| 19 | + </el-form-item> | |
| 20 | + | |
| 21 | + <el-form-item label="性别"> | |
| 22 | + <el-select v-model="query.sex" placeholder="性别"> | |
| 23 | + <el-option label="男" value="1"></el-option> | |
| 24 | + <el-option label="女" value="0"></el-option> | |
| 25 | + </el-select> | |
| 26 | + </el-form-item> | |
| 27 | + </el-form> | |
| 28 | + </div> | |
| 29 | + <div class="flex align-center" style="margin-top: 10px"> | |
| 30 | + <el-button type="success" @click="search">搜索</el-button> | |
| 31 | + <el-button size="mini" @click="handleshare()" type="primary" | |
| 32 | + >批量入库</el-button | |
| 33 | + > | |
| 34 | + <el-button size="mini" @click="handleAdd()" type="primary" | |
| 35 | + >新增一行</el-button | |
| 36 | + > | |
| 37 | + <el-upload | |
| 38 | + class="upload-demo" | |
| 39 | + ref="uploader" | |
| 40 | + action="/api//UserInfo/ResumeIdentification" | |
| 41 | + multiple | |
| 42 | + :headers="{ | |
| 43 | + Authorization: Authorization, | |
| 44 | + }" | |
| 45 | + :limit="100" | |
| 46 | + :show-file-list="false" | |
| 47 | + :on-exceed="handleExceed" | |
| 48 | + :on-success="handleSuccess" | |
| 49 | + > | |
| 50 | + <el-button size="small" type="primary">上传简历</el-button> | |
| 51 | + </el-upload> | |
| 52 | + </div> | |
| 53 | + </div> | |
| 54 | + <div class="main-box"> | |
| 55 | + | |
| 56 | + <table class="el-table__body"> | |
| 57 | + <thead class="has-gutter"> | |
| 58 | + <th> | |
| 59 | + <td>111</td> | |
| 60 | + <td>大师傅</td> | |
| 61 | + <td>的的的</td> | |
| 62 | + </th> | |
| 63 | + </thead> | |
| 64 | + | |
| 65 | + <tr> | |
| 66 | + <td>test禄口街道杀戮空间</td> | |
| 67 | + <td>test禄口街道杀戮空间</td> | |
| 68 | + <td>test禄口街道杀戮空间</td> | |
| 69 | + </tr> | |
| 70 | + </table> | |
| 71 | + </div> | |
| 72 | + <!-- <div class="page-box"> | |
| 73 | + <el-pagination | |
| 74 | + background | |
| 75 | + layout="prev, pager, next" | |
| 76 | + :total="queryResult.totalCount" | |
| 77 | + > | |
| 78 | + </el-pagination> | |
| 79 | + </div> --> | |
| 80 | + </div> | |
| 81 | +</template> | |
| 82 | + | |
| 83 | +<script> | |
| 84 | +import { | |
| 85 | + UserInfo_BatchToUser, | |
| 86 | + UserInfo_Delete, | |
| 87 | + UserInfo_Update, | |
| 88 | + UserInfo_List, | |
| 89 | +} from "@/api/user"; | |
| 90 | +export default { | |
| 91 | + data() { | |
| 92 | + return { | |
| 93 | + currentFilePath: "", | |
| 94 | + queryResult: {}, | |
| 95 | + queryModel: { | |
| 96 | + pageIndex: 1, | |
| 97 | + pageSize: 10, | |
| 98 | + }, | |
| 99 | + query: {}, | |
| 100 | + new_date_json: {}, //数据结构 | |
| 101 | + multipleSelection: [], //复选框,数据 | |
| 102 | + is_edit: true, //是否可编辑 | |
| 103 | + is_delete: true, //是否可删除 | |
| 104 | + selection: true, //是否需要复选框 | |
| 105 | + radio: false, //单选变色 | |
| 106 | + space_color: true, //隔行变色 | |
| 107 | + //表头信息 | |
| 108 | + table_columns: [ | |
| 109 | + { | |
| 110 | + prop: "FullName", | |
| 111 | + label: "技术", | |
| 112 | + width: "150", | |
| 113 | + }, | |
| 114 | + { | |
| 115 | + prop: "PhoneNumber", | |
| 116 | + label: "手机号", | |
| 117 | + width: "150", | |
| 118 | + }, | |
| 119 | + { | |
| 120 | + prop: "DateBirth", | |
| 121 | + label: "出生日期", | |
| 122 | + width: "180", | |
| 123 | + }, | |
| 124 | + { | |
| 125 | + prop: "Gender", | |
| 126 | + label: "性别", | |
| 127 | + width: "80", | |
| 128 | + }, | |
| 129 | + { | |
| 130 | + prop: "GraduationSchool", | |
| 131 | + label: "毕业学校", | |
| 132 | + width: "200", | |
| 133 | + }, | |
| 134 | + { | |
| 135 | + prop: "GraduationMajor", | |
| 136 | + label: "专业", | |
| 137 | + width: "200", | |
| 138 | + }, | |
| 139 | + { | |
| 140 | + prop: "Education", | |
| 141 | + label: "最高学历", | |
| 142 | + width: "", | |
| 143 | + }, | |
| 144 | + { | |
| 145 | + prop: "IntendedCity", | |
| 146 | + label: "城市", | |
| 147 | + width: "150", | |
| 148 | + }, | |
| 149 | + ], | |
| 150 | + //表格数据 | |
| 151 | + table_data: [], | |
| 152 | + }; | |
| 153 | + }, | |
| 154 | + methods: { | |
| 155 | + handleExceed() {}, | |
| 156 | + handleSuccess(res) { | |
| 157 | + this.$refs.uploader.clearFiles(); | |
| 158 | + this.search(); | |
| 159 | + }, | |
| 160 | + search() { | |
| 161 | + this.queryModel.pageIndex = 1; | |
| 162 | + this.getList(); | |
| 163 | + }, | |
| 164 | + getList() { | |
| 165 | + table_data = []; | |
| 166 | + // UserInfo_List(this.queryModel).then((res) => { | |
| 167 | + // this.queryResult = res.data; | |
| 168 | + // if (res.data.data && res.data.data.length) { | |
| 169 | + // res.data.data = res.data.data.map((t) => { | |
| 170 | + // t.DataJsonObj = JSON.parse(t.DataJson); | |
| 171 | + // return t; | |
| 172 | + // }); | |
| 173 | + // } | |
| 174 | + // this.table_data = res.data.data; | |
| 175 | + // }); | |
| 176 | + }, | |
| 177 | + //隔行变色 | |
| 178 | + tableRowClassName() { | |
| 179 | + //选取DOM节点 | |
| 180 | + var trs = this.$refs.mytable.$el | |
| 181 | + .getElementsByTagName("tbody")[0] | |
| 182 | + .getElementsByTagName("tr"); | |
| 183 | + for (var i in trs) { | |
| 184 | + if (i % 2 == 0) { | |
| 185 | + //当隔行变色未true时改变颜色 | |
| 186 | + if (this.space_color) { | |
| 187 | + trs[i].style.backgroundColor = "#f0f9eb"; | |
| 188 | + } else { | |
| 189 | + trs[i].style.backgroundColor = ""; | |
| 190 | + } | |
| 191 | + } | |
| 192 | + } | |
| 193 | + }, | |
| 194 | + | |
| 195 | + //多选框 | |
| 196 | + handleSelectionChange(val) { | |
| 197 | + this.multipleSelection = val; | |
| 198 | + console.log("selection:", this.multipleSelection); | |
| 199 | + }, | |
| 200 | + //编辑 | |
| 201 | + handleEdit(index, row) { | |
| 202 | + var model ; | |
| 203 | + this.table_data = this.table_data.map(t=>{ | |
| 204 | + delete t.edit; | |
| 205 | + return t; | |
| 206 | + }) | |
| 207 | + this.$set(this.table_data[index],'edit',true) | |
| 208 | + | |
| 209 | + | |
| 210 | + }, | |
| 211 | + //删除 | |
| 212 | + handleDelete(index, row) { | |
| 213 | + console.log(index, row); | |
| 214 | + | |
| 215 | + this.table_data.splice(index, 1); | |
| 216 | + // UserInfo_Delete(row.id); | |
| 217 | + // this.$message({ | |
| 218 | + // message: "删除成功!", | |
| 219 | + // type: "success", | |
| 220 | + // }); | |
| 221 | + }, | |
| 222 | + | |
| 223 | + handleshare(index, row) { | |
| 224 | + if (!row) { | |
| 225 | + this.table_data = []; | |
| 226 | + } else { | |
| 227 | + console.log(index, row); | |
| 228 | + this.table_data.splice(index, 1); | |
| 229 | + } | |
| 230 | + UserInfo_BatchToUser(row.id); | |
| 231 | + this.$message({ | |
| 232 | + message: "入库成功!", | |
| 233 | + type: "success", | |
| 234 | + }); | |
| 235 | + }, | |
| 236 | + | |
| 237 | + //保存 | |
| 238 | + handleSave(index, row) { | |
| 239 | + delete this.table_data[index].edit; | |
| 240 | + let formData = { ...row }; | |
| 241 | + delete formData.DataJsonObj; | |
| 242 | + UserInfo_Update(row); | |
| 243 | + this.table_data.push(this.table_data.pop()); | |
| 244 | + this.$forceUpdate(); | |
| 245 | + this.$message({ | |
| 246 | + message: "保存成功!", | |
| 247 | + type: "success", | |
| 248 | + }); | |
| 249 | + }, | |
| 250 | + handleCancelSave(index, row){ | |
| 251 | + delete this.table_data[index].edit; | |
| 252 | + if(this.currentFilePath == row.ViewPath){ | |
| 253 | + this.currentFilePath = ''; | |
| 254 | + } | |
| 255 | + this.table_data.push(this.table_data.pop()); | |
| 256 | + }, | |
| 257 | + handleAdd() { | |
| 258 | + var addDataJson = {}; | |
| 259 | + for (var key in this.new_date_json) { | |
| 260 | + if (key === "edit") { | |
| 261 | + delete addDataJson[key]; | |
| 262 | + } else if (key === "add") { | |
| 263 | + delete addDataJson[key]; | |
| 264 | + } else { | |
| 265 | + addDataJson[key] = ""; | |
| 266 | + } | |
| 267 | + } | |
| 268 | + addDataJson.edit = true; | |
| 269 | + addDataJson.add = true; | |
| 270 | + this.table_data.push(addDataJson); | |
| 271 | + }, | |
| 272 | + //初始化编辑属性 | |
| 273 | + initEditAttribute() { | |
| 274 | + var self = this; | |
| 275 | + var edit = self.edit; | |
| 276 | + }, | |
| 277 | + initAddDataJson(dataArray) { | |
| 278 | + //新增时,初始化数据结构 | |
| 279 | + var dataJson = dataArray; | |
| 280 | + var newDateJson = {}; | |
| 281 | + for (var key in dataJson) { | |
| 282 | + if (key === "edit") { | |
| 283 | + newDateJson[key] = "true"; | |
| 284 | + } else { | |
| 285 | + newDateJson[key] = ""; | |
| 286 | + } | |
| 287 | + } | |
| 288 | + newDateJson["add"] = true; | |
| 289 | + this.new_date_json = newDateJson; | |
| 290 | + }, | |
| 291 | + }, | |
| 292 | + created() { | |
| 293 | + this.getList(); | |
| 294 | + }, | |
| 295 | + mounted: function () { | |
| 296 | + this.initEditAttribute(); | |
| 297 | + //确保方法在页面渲染后调用 | |
| 298 | + this.$nextTick(function () { | |
| 299 | + /////方法 | |
| 300 | + this.tableRowClassName(); | |
| 301 | + }); | |
| 302 | + }, | |
| 303 | + watch: { | |
| 304 | + space_color: function () { | |
| 305 | + //监听数据变化 | |
| 306 | + this.$nextTick(function () { | |
| 307 | + /////方法 | |
| 308 | + this.tableRowClassName(); | |
| 309 | + }); | |
| 310 | + }, | |
| 311 | + table_data: function () { | |
| 312 | + //监听数据变化f | |
| 313 | + this.$nextTick(function () { | |
| 314 | + /////方法 | |
| 315 | + this.tableRowClassName(); | |
| 316 | + }); | |
| 317 | + }, | |
| 318 | + }, | |
| 319 | +}; | |
| 320 | +</script> | |
| 321 | +<style lang="scss" scoped> | |
| 322 | +.main-box{ | |
| 323 | + display: flex; | |
| 324 | +} | |
| 325 | +.doc-view { | |
| 326 | + margin-left: 10px; | |
| 327 | + width: 100%; | |
| 328 | + flex: 1; | |
| 329 | + overflow: hidden; | |
| 330 | +} | |
| 331 | +.el-table__expanded-cell { | |
| 332 | + padding: 10px; | |
| 333 | +} | |
| 334 | +.demo-table-expand { | |
| 335 | + display: flex; | |
| 336 | + justify-content: space-between; | |
| 337 | + flex-wrap: wrap; | |
| 338 | + box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); | |
| 339 | + padding: 20px; | |
| 340 | + border-radius: 10px; | |
| 341 | +} | |
| 342 | +.demo-table-expand .el-form-item { | |
| 343 | + margin-bottom: 10px !important; | |
| 344 | + min-width: 20%; | |
| 345 | + max-width: 50%; | |
| 346 | +} | |
| 347 | +.demo-form-inline { | |
| 348 | + display: flex; | |
| 349 | + align-items: center; | |
| 350 | +} | |
| 351 | +.el-form--inline .el-form-item { | |
| 352 | + display: flex; | |
| 353 | + align-items: center; | |
| 354 | + margin-bottom: 0; | |
| 355 | +} | |
| 356 | +.aligin-center { | |
| 357 | + align-items: center; | |
| 358 | +} | |
| 359 | +.seetingsDiv { | |
| 360 | + display: flex; | |
| 361 | + align-items: center; | |
| 362 | + width: 100%; | |
| 363 | + height: auto; | |
| 364 | + padding: 30px; | |
| 365 | + background: #efefef; | |
| 366 | + /* line-height: 60px; */ | |
| 367 | + border-radius: 5px; | |
| 368 | + box-shadow: 0 0 5px #cdcdcd; | |
| 369 | + justify-content: space-between; | |
| 370 | + flex-wrap: wrap; | |
| 371 | + margin-bottom: 20px; | |
| 372 | +} | |
| 373 | + | |
| 374 | +.seetingsDiv button { | |
| 375 | + height: 40px; | |
| 376 | + background-color: #304156; | |
| 377 | + border: 0px; | |
| 378 | + margin-left: 10px; | |
| 379 | + box-shadow: 0 0 5px #cdcdcd; | |
| 380 | + float: none; | |
| 381 | + margin-right: 10px; | |
| 382 | + margin-top: 0; | |
| 383 | +} | |
| 384 | +</style> | |
| 0 | 385 | \ No newline at end of file | ... | ... |
src/views/user/userdimset.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div style="padding: 10px"> | |
| 3 | + <div class="seetingsDiv" style=""> | |
| 4 | + <div class="flex" style="margin-top: 10px"> | |
| 5 | + <el-alert title="分别设置各种岗位分值区间 具体标签自动生成 规则:当某种性格/能力标签 大于 或小于分值区间标签自动贴上! 如:感性 感性高 感性低" type="success" | |
| 6 | + :closable="false"> | |
| 7 | + </el-alert> | |
| 8 | + </div> | |
| 9 | + <div class="flex align-center" style="margin-top: 10px"> | |
| 10 | + <el-button type="success" @click="saveSetting">保存</el-button> | |
| 11 | + </div> | |
| 12 | + </div> | |
| 13 | + <div class="main-box" style="padding:100px"> | |
| 14 | + | |
| 15 | + <el-table ref="mytable" :data="table_data" style="width: 100%;display:block" border> | |
| 16 | + <el-table-column width="155" label="性格" prop="title" align="center"> | |
| 17 | + <template slot-scope="{row}"> | |
| 18 | + | |
| 19 | + <el-input size="small" v-model="row.title" placeholder="请输入标题"> | |
| 20 | + </el-input> | |
| 21 | + | |
| 22 | + </template> | |
| 23 | + </el-table-column> | |
| 24 | + <el-table-column align="center" v-for="(item, index, key) in table_columns" :item="item" :key="key" | |
| 25 | + :index="index" :label="item"> | |
| 26 | + <template slot-scope="{row}"> | |
| 27 | + <el-col :span="11"> | |
| 28 | + <el-input size="small" v-model="row[item].start" placeholder="请输入开始分值"> | |
| 29 | + </el-input> | |
| 30 | + </el-col> | |
| 31 | + <el-col class="line" :span="2">-</el-col> | |
| 32 | + <el-col :span="11"> | |
| 33 | + <el-input size="small" v-model="row[item].end" placeholder="请输入结束分值"> | |
| 34 | + </el-input> | |
| 35 | + </el-col> | |
| 36 | + <!-- <el-input | |
| 37 | + size="small" | |
| 38 | + v-model="row[item].start" | |
| 39 | + placeholder="请输入开始分值" | |
| 40 | + > | |
| 41 | + </el-input> | |
| 42 | + - <el-input | |
| 43 | + size="small" | |
| 44 | + v-model="row[item].end" | |
| 45 | + placeholder="请输入结束分值" | |
| 46 | +> | |
| 47 | +</el-input> --> | |
| 48 | + <!-- <el-input v-if="scope.row[item]" | |
| 49 | + size="small" | |
| 50 | + v-model="scope.row[item].end" | |
| 51 | + :placeholder="'请输入结束分值" | |
| 52 | + > | |
| 53 | + </el-input> --> | |
| 54 | + </template> | |
| 55 | + </el-table-column> | |
| 56 | + <!-- <el-table-column label="操作" align="center" width="300" > | |
| 57 | + <template slot-scope="scope"> | |
| 58 | + <el-button | |
| 59 | + size="mini" | |
| 60 | + :plain="true" | |
| 61 | + type="danger" | |
| 62 | + style="margin-left: 10px" | |
| 63 | + @click="handleDelete(scope.$index, scope.row)" | |
| 64 | + >删除</el-button | |
| 65 | + > | |
| 66 | + </template> | |
| 67 | + </el-table-column> --> | |
| 68 | + </el-table> | |
| 69 | + | |
| 70 | + <el-table ref="mytable_gdf" :data="table_gdfdata" style="width: 100%;display:block" :show-header="false" border> | |
| 71 | + <el-table-column width="155" label="能力" prop="title" align="center"> | |
| 72 | + <template slot-scope="{row}"> | |
| 73 | + | |
| 74 | + <el-input size="small" v-model="row.title" placeholder="请输入标题"> | |
| 75 | + </el-input> | |
| 76 | + | |
| 77 | + </template> | |
| 78 | + </el-table-column> | |
| 79 | + <el-table-column align="center" v-for="(item, index, key) in table_columns" :item="item" :key="key" | |
| 80 | + :index="index" :label="item"> | |
| 81 | + <template slot-scope="{row}"> | |
| 82 | + <el-input size="small" v-model="row[item].start" placeholder="请输入值"> | |
| 83 | + </el-input> | |
| 84 | + </template> | |
| 85 | + </el-table-column> | |
| 86 | + <!-- <el-table-column label="操作" align="center" width="300" > | |
| 87 | + <template slot-scope="scope"> | |
| 88 | + <el-button | |
| 89 | + size="mini" | |
| 90 | + :plain="true" | |
| 91 | + type="danger" | |
| 92 | + style="margin-left: 10px" | |
| 93 | + @click="handleDelete(scope.$index, scope.row)" | |
| 94 | + >删除</el-button | |
| 95 | + > | |
| 96 | + </template> | |
| 97 | + </el-table-column> --> | |
| 98 | + </el-table> | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + <el-table ref="mytable1" :data="table_nldata" style="width: 100%;display:block;margin-top:20px;" border> | |
| 103 | + <el-table-column width="155" label="能力" prop="title" align="center"> | |
| 104 | + <template slot-scope="{row}"> | |
| 105 | + | |
| 106 | + <el-input size="small" v-model="row.title" placeholder="请输入标题"> | |
| 107 | + </el-input> | |
| 108 | + | |
| 109 | + </template> | |
| 110 | + </el-table-column> | |
| 111 | + <el-table-column align="center" :label="'能力分值规则'"> | |
| 112 | + <template slot-scope="{row}"> | |
| 113 | + | |
| 114 | + | |
| 115 | + <el-col :span="11"> | |
| 116 | + <el-input size="small" v-model="row.scoreStart" placeholder="请输入开始分值"> | |
| 117 | + </el-input> | |
| 118 | + </el-col> | |
| 119 | + <el-col class="line" :span="2">-</el-col> | |
| 120 | + <el-col :span="11"> | |
| 121 | + <el-input size="small" v-model="row.scoreEnd" placeholder="请输入结束分值"> | |
| 122 | + </el-input> | |
| 123 | + </el-col> | |
| 124 | + </template> | |
| 125 | + </el-table-column> | |
| 126 | + </el-table> | |
| 127 | + | |
| 128 | + | |
| 129 | + <el-table ref="mytable2" :data="table_stardata" style="width: 100%;display:block" border> | |
| 130 | + <el-table-column width="155" label="星级" prop="title" align="center"> | |
| 131 | + <template slot-scope="{row}"> | |
| 132 | + | |
| 133 | + <el-input size="small" v-model="row.title" placeholder="请输入标题"> | |
| 134 | + </el-input> | |
| 135 | + | |
| 136 | + </template> | |
| 137 | + </el-table-column> | |
| 138 | + <el-table-column align="center" v-for="(item, index, key) in table_columns" :item="item" :key="key" | |
| 139 | + :index="index" :label="item"> | |
| 140 | + <template slot-scope="{row}"> | |
| 141 | + <el-col :span="11"> | |
| 142 | + <el-input size="small" v-model="row[item].start" placeholder="请输入开始分值"> | |
| 143 | + </el-input> | |
| 144 | + </el-col> | |
| 145 | + <el-col class="line" :span="2">-</el-col> | |
| 146 | + <el-col :span="11"> | |
| 147 | + <el-input size="small" v-model="row[item].end" placeholder="请输入结束分值"> | |
| 148 | + </el-input> | |
| 149 | + </el-col> | |
| 150 | + <!-- <el-input | |
| 151 | + size="small" | |
| 152 | + v-model="row[item].start" | |
| 153 | + placeholder="请输入开始分值" | |
| 154 | + > | |
| 155 | + </el-input> | |
| 156 | + - <el-input | |
| 157 | + size="small" | |
| 158 | + v-model="row[item].end" | |
| 159 | + placeholder="请输入结束分值" | |
| 160 | +> | |
| 161 | +</el-input> --> | |
| 162 | + <!-- <el-input v-if="scope.row[item]" | |
| 163 | + size="small" | |
| 164 | + v-model="scope.row[item].end" | |
| 165 | + :placeholder="'请输入结束分值" | |
| 166 | + > | |
| 167 | + </el-input> --> | |
| 168 | + </template> | |
| 169 | + </el-table-column> | |
| 170 | + <!-- <el-table-column label="操作" align="center" width="300" > | |
| 171 | + <template slot-scope="scope"> | |
| 172 | + <el-button | |
| 173 | + size="mini" | |
| 174 | + :plain="true" | |
| 175 | + type="danger" | |
| 176 | + style="margin-left: 10px" | |
| 177 | + @click="handleDelete(scope.$index, scope.row)" | |
| 178 | + >删除</el-button | |
| 179 | + > | |
| 180 | + </template> | |
| 181 | + </el-table-column> --> | |
| 182 | + </el-table> | |
| 183 | + | |
| 184 | + | |
| 185 | + </div> | |
| 186 | + | |
| 187 | + </div> | |
| 188 | + </div> | |
| 189 | +</template> | |
| 190 | + | |
| 191 | +<script> | |
| 192 | + import { | |
| 193 | + UserInfo_BatchToUser, | |
| 194 | + UserInfo_Delete, | |
| 195 | + UserInfo_Update, | |
| 196 | + UserInfo_List, | |
| 197 | + UserTypeSettings, | |
| 198 | + saveTypeSetting | |
| 199 | + } from "@/api/user"; | |
| 200 | + export default { | |
| 201 | + data() { | |
| 202 | + return { | |
| 203 | + currentFilePath: "", | |
| 204 | + queryResult: {}, | |
| 205 | + queryModel: { | |
| 206 | + pageIndex: 1, | |
| 207 | + pageSize: 10, | |
| 208 | + }, | |
| 209 | + | |
| 210 | + query: {}, | |
| 211 | + new_date_json: {}, //数据结构 | |
| 212 | + multipleSelection: [], //复选框,数据 | |
| 213 | + is_edit: true, //是否可编辑 | |
| 214 | + is_delete: true, //是否可删除 | |
| 215 | + selection: true, //是否需要复选框 | |
| 216 | + radio: false, //单选变色 | |
| 217 | + space_color: true, //隔行变色 | |
| 218 | + | |
| 219 | + //表头信息 | |
| 220 | + table_columns: [ | |
| 221 | + // { | |
| 222 | + // prop: "", | |
| 223 | + // label: "", | |
| 224 | + // width: "150", | |
| 225 | + // }, | |
| 226 | + // { | |
| 227 | + // prop: "PhoneNumber", | |
| 228 | + // label: "手机号", | |
| 229 | + // width: "150", | |
| 230 | + // }, | |
| 231 | + // { | |
| 232 | + // prop: "DateBirth", | |
| 233 | + // label: "出生日期", | |
| 234 | + // width: "180", | |
| 235 | + // }, | |
| 236 | + // { | |
| 237 | + // prop: "Gender", | |
| 238 | + // label: "性别", | |
| 239 | + // width: "80", | |
| 240 | + // }, | |
| 241 | + // { | |
| 242 | + // prop: "GraduationSchool", | |
| 243 | + // label: "毕业学校", | |
| 244 | + // width: "200", | |
| 245 | + // }, | |
| 246 | + // { | |
| 247 | + // prop: "GraduationMajor", | |
| 248 | + // label: "专业", | |
| 249 | + // width: "200", | |
| 250 | + // }, | |
| 251 | + // { | |
| 252 | + // prop: "Education", | |
| 253 | + // label: "最高学历", | |
| 254 | + // width: "", | |
| 255 | + // }, | |
| 256 | + // { | |
| 257 | + // prop: "IntendedCity", | |
| 258 | + // label: "城市", | |
| 259 | + // width: "150", | |
| 260 | + // }, | |
| 261 | + ], | |
| 262 | + //表格数据 | |
| 263 | + table_data: [], //性格 | |
| 264 | + table_nldata: [], //能力 规则 | |
| 265 | + table_stardata: [], //星级分值规则 | |
| 266 | + table_gdfdata: [] //高低分 | |
| 267 | + }; | |
| 268 | + }, | |
| 269 | + methods: { | |
| 270 | + saveSetting() { | |
| 271 | + var saveForm = { | |
| 272 | + xg: this.table_data || [], //性格 | |
| 273 | + nl: this.table_nldata || [], //能力 规则 | |
| 274 | + star: this.table_stardata || [], //星级分值规则 | |
| 275 | + gdf: this.table_gdfdata || [] //高低分 | |
| 276 | + }; | |
| 277 | + saveTypeSetting({ Value: JSON.stringify(saveForm) }).then(res => { | |
| 278 | + if (res.data && res.data > 0) { | |
| 279 | + this.$message({ | |
| 280 | + message: "更新成功!", | |
| 281 | + type: "success", | |
| 282 | + }); | |
| 283 | + } | |
| 284 | + else { | |
| 285 | + | |
| 286 | + this.$message({ | |
| 287 | + message: "更新失败!", | |
| 288 | + type: "warning", | |
| 289 | + }); | |
| 290 | + | |
| 291 | + } | |
| 292 | + }); | |
| 293 | + }, | |
| 294 | + handleExceed() { }, | |
| 295 | + handleSuccess(res) { | |
| 296 | + this.$refs.uploader.clearFiles(); | |
| 297 | + this.search(); | |
| 298 | + }, | |
| 299 | + search() { | |
| 300 | + this.queryModel.pageIndex = 1; | |
| 301 | + this.getList(); | |
| 302 | + }, | |
| 303 | + getList() { | |
| 304 | + UserTypeSettings({}).then((res) => { | |
| 305 | + | |
| 306 | + if (res.data) { | |
| 307 | + this.table_columns = res.data.columns; | |
| 308 | + this.table_data = res.data.list || []; | |
| 309 | + this.table_nldata = res.data.nlList || []; | |
| 310 | + this.table_stardata = res.data.starList || []; | |
| 311 | + this.table_gdfdata = res.data.gdList || []; | |
| 312 | + | |
| 313 | + } | |
| 314 | + | |
| 315 | + }); | |
| 316 | + }, | |
| 317 | + //隔行变色 | |
| 318 | + tableRowClassName() { | |
| 319 | + //选取DOM节点 | |
| 320 | + var trs = this.$refs.mytable.$el | |
| 321 | + .getElementsByTagName("tbody")[0] | |
| 322 | + .getElementsByTagName("tr"); | |
| 323 | + for (var i in trs) { | |
| 324 | + if (i % 2 == 0) { | |
| 325 | + //当隔行变色未true时改变颜色 | |
| 326 | + if (this.space_color) { | |
| 327 | + trs[i].style.backgroundColor = "#f0f9eb"; | |
| 328 | + } else { | |
| 329 | + trs[i].style.backgroundColor = ""; | |
| 330 | + } | |
| 331 | + } | |
| 332 | + } | |
| 333 | + }, | |
| 334 | + | |
| 335 | + //多选框 | |
| 336 | + handleSelectionChange(val) { | |
| 337 | + this.multipleSelection = val; | |
| 338 | + console.log("selection:", this.multipleSelection); | |
| 339 | + }, | |
| 340 | + //编辑 | |
| 341 | + handleEdit(index, row) { | |
| 342 | + var model; | |
| 343 | + this.table_data = this.table_data.map(t => { | |
| 344 | + delete t.edit; | |
| 345 | + return t; | |
| 346 | + }) | |
| 347 | + this.$set(this.table_data[index], 'edit', true) | |
| 348 | + | |
| 349 | + | |
| 350 | + }, | |
| 351 | + //删除 | |
| 352 | + handleDelete(index, row) { | |
| 353 | + console.log(index, row); | |
| 354 | + | |
| 355 | + this.table_data.splice(index, 1); | |
| 356 | + // UserInfo_Delete(row.id); | |
| 357 | + // this.$message({ | |
| 358 | + // message: "删除成功!", | |
| 359 | + // type: "success", | |
| 360 | + // }); | |
| 361 | + }, | |
| 362 | + | |
| 363 | + handleshare(index, row) { | |
| 364 | + if (!row) { | |
| 365 | + this.table_data = []; | |
| 366 | + } else { | |
| 367 | + console.log(index, row); | |
| 368 | + this.table_data.splice(index, 1); | |
| 369 | + } | |
| 370 | + UserInfo_BatchToUser(row.id); | |
| 371 | + this.$message({ | |
| 372 | + message: "入库成功!", | |
| 373 | + type: "success", | |
| 374 | + }); | |
| 375 | + }, | |
| 376 | + | |
| 377 | + //保存 | |
| 378 | + handleSave(index, row) { | |
| 379 | + delete this.table_data[index].edit; | |
| 380 | + let formData = { ...row }; | |
| 381 | + delete formData.DataJsonObj; | |
| 382 | + UserInfo_Update(row); | |
| 383 | + this.table_data.push(this.table_data.pop()); | |
| 384 | + this.$forceUpdate(); | |
| 385 | + this.$message({ | |
| 386 | + message: "保存成功!", | |
| 387 | + type: "success", | |
| 388 | + }); | |
| 389 | + }, | |
| 390 | + handleCancelSave(index, row) { | |
| 391 | + delete this.table_data[index].edit; | |
| 392 | + if (this.currentFilePath == row.ViewPath) { | |
| 393 | + this.currentFilePath = ''; | |
| 394 | + } | |
| 395 | + this.table_data.push(this.table_data.pop()); | |
| 396 | + }, | |
| 397 | + handleAdd() { | |
| 398 | + var addDataJson = {}; | |
| 399 | + for (var key in this.new_date_json) { | |
| 400 | + if (key === "edit") { | |
| 401 | + delete addDataJson[key]; | |
| 402 | + } else if (key === "add") { | |
| 403 | + delete addDataJson[key]; | |
| 404 | + } else { | |
| 405 | + addDataJson[key] = ""; | |
| 406 | + } | |
| 407 | + } | |
| 408 | + addDataJson.edit = true; | |
| 409 | + addDataJson.add = true; | |
| 410 | + this.table_data.push(addDataJson); | |
| 411 | + }, | |
| 412 | + //初始化编辑属性 | |
| 413 | + initEditAttribute() { | |
| 414 | + var self = this; | |
| 415 | + var edit = self.edit; | |
| 416 | + }, | |
| 417 | + initAddDataJson(dataArray) { | |
| 418 | + //新增时,初始化数据结构 | |
| 419 | + var dataJson = dataArray; | |
| 420 | + var newDateJson = {}; | |
| 421 | + for (var key in dataJson) { | |
| 422 | + if (key === "edit") { | |
| 423 | + newDateJson[key] = "true"; | |
| 424 | + } else { | |
| 425 | + newDateJson[key] = ""; | |
| 426 | + } | |
| 427 | + } | |
| 428 | + newDateJson["add"] = true; | |
| 429 | + this.new_date_json = newDateJson; | |
| 430 | + }, | |
| 431 | + }, | |
| 432 | + created() { | |
| 433 | + this.getList(); | |
| 434 | + }, | |
| 435 | + mounted: function () { | |
| 436 | + this.initEditAttribute(); | |
| 437 | + //确保方法在页面渲染后调用 | |
| 438 | + this.$nextTick(function () { | |
| 439 | + /////方法 | |
| 440 | + this.tableRowClassName(); | |
| 441 | + }); | |
| 442 | + }, | |
| 443 | + watch: { | |
| 444 | + // space_color: function () { | |
| 445 | + // //监听数据变化 | |
| 446 | + // this.$nextTick(function () { | |
| 447 | + // /////方法 | |
| 448 | + // this.tableRowClassName(); | |
| 449 | + // }); | |
| 450 | + // }, | |
| 451 | + // table_data: function () { | |
| 452 | + // //监听数据变化f | |
| 453 | + // this.$nextTick(function () { | |
| 454 | + // /////方法 | |
| 455 | + // this.tableRowClassName(); | |
| 456 | + // }); | |
| 457 | + // }, | |
| 458 | + }, | |
| 459 | + }; | |
| 460 | +</script> | |
| 461 | +<style lang="scss" scoped> | |
| 462 | + .main-box { | |
| 463 | + /* display: flex; */ | |
| 464 | + } | |
| 465 | + | |
| 466 | + .doc-view { | |
| 467 | + margin-left: 10px; | |
| 468 | + width: 100%; | |
| 469 | + flex: 1; | |
| 470 | + overflow: hidden; | |
| 471 | + } | |
| 472 | + | |
| 473 | + .el-table__expanded-cell { | |
| 474 | + padding: 10px; | |
| 475 | + } | |
| 476 | + | |
| 477 | + .demo-table-expand { | |
| 478 | + display: flex; | |
| 479 | + justify-content: space-between; | |
| 480 | + flex-wrap: wrap; | |
| 481 | + box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); | |
| 482 | + padding: 20px; | |
| 483 | + border-radius: 10px; | |
| 484 | + } | |
| 485 | + | |
| 486 | + .demo-table-expand .el-form-item { | |
| 487 | + margin-bottom: 10px !important; | |
| 488 | + min-width: 20%; | |
| 489 | + max-width: 50%; | |
| 490 | + } | |
| 491 | + | |
| 492 | + .demo-form-inline { | |
| 493 | + display: flex; | |
| 494 | + align-items: center; | |
| 495 | + } | |
| 496 | + | |
| 497 | + .el-form--inline .el-form-item { | |
| 498 | + display: flex; | |
| 499 | + align-items: center; | |
| 500 | + margin-bottom: 0; | |
| 501 | + } | |
| 502 | + | |
| 503 | + .aligin-center { | |
| 504 | + align-items: center; | |
| 505 | + } | |
| 506 | + | |
| 507 | + .seetingsDiv { | |
| 508 | + display: flex; | |
| 509 | + align-items: center; | |
| 510 | + width: 100%; | |
| 511 | + height: auto; | |
| 512 | + padding: 30px; | |
| 513 | + background: #efefef; | |
| 514 | + /* line-height: 60px; */ | |
| 515 | + border-radius: 5px; | |
| 516 | + box-shadow: 0 0 5px #cdcdcd; | |
| 517 | + justify-content: space-between; | |
| 518 | + flex-wrap: wrap; | |
| 519 | + margin-bottom: 20px; | |
| 520 | + } | |
| 521 | + | |
| 522 | + .seetingsDiv button { | |
| 523 | + height: 40px; | |
| 524 | + background-color: #304156; | |
| 525 | + border: 0px; | |
| 526 | + margin-left: 10px; | |
| 527 | + box-shadow: 0 0 5px #cdcdcd; | |
| 528 | + float: none; | |
| 529 | + margin-right: 10px; | |
| 530 | + margin-top: 0; | |
| 531 | + } | |
| 532 | +</style> | |
| 0 | 533 | \ No newline at end of file | ... | ... |
src/views/user/userlist.vue
| ... | ... | @@ -28,10 +28,10 @@ |
| 28 | 28 | </el-form-item> |
| 29 | 29 | |
| 30 | 30 | <el-form-item label="推荐指数"> |
| 31 | - <el-rate v-model="query.stars" text-color="#ff9900" style="margin-top:10px;"> | |
| 31 | + <el-rate v-model="query.stars" text-color="#ff9900" style="margin-top:10px;" show-score :allow-half="true" :max="7" :score-template="query.stars <0?'无':query.stars+' 星' "> | |
| 32 | 32 | </el-rate> |
| 33 | 33 | </el-form-item> |
| 34 | - | |
| 34 | + | |
| 35 | 35 | |
| 36 | 36 | <el-form-item> |
| 37 | 37 | <el-button type="success" @click="search">搜索</el-button> |
| ... | ... | @@ -93,10 +93,14 @@ |
| 93 | 93 | |
| 94 | 94 | </template> |
| 95 | 95 | </el-table-column> |
| 96 | - <el-table-column prop="date" label="系统推荐" width="150px" sortable> | |
| 96 | + <el-table-column prop="date" label="系统推荐" width="220px" sortable> | |
| 97 | 97 | <template slot-scope="scope"> |
| 98 | - <el-rate v-model="scope.row.stars" disabled text-color="#ff9900" size="small"> | |
| 99 | - </el-rate> | |
| 98 | + | |
| 99 | + <el-tooltip class="item" effect="dark" :content="scope.row.stars+' 星'" placement="top-start"> | |
| 100 | + <el-rate v-model="scope.row.stars" show-score :allow-half="true" :max="7" disabled text-color="#ff9900" size="mini" > | |
| 101 | + </el-rate> | |
| 102 | + </el-tooltip> | |
| 103 | + | |
| 100 | 104 | </template> |
| 101 | 105 | </el-table-column> |
| 102 | 106 | <el-table-column prop="date" label="电话号码" width="100"> |
| ... | ... | @@ -290,9 +294,9 @@ |
| 290 | 294 | <el-input v-model="adminUserInfo.byyx" placeholder="请输入毕业院校" style="width: 40%"></el-input> |
| 291 | 295 | </el-form-item> |
| 292 | 296 | <el-form-item label="系统推荐" style="margin-top: 40px" prop="stars"> |
| 293 | - <el-rate style="width: 40%" v-model="adminUserInfo.stars" :texts="['不推荐', '一般', '满意', '很满意', '极力推荐']" | |
| 294 | - show-text> | |
| 295 | - </el-rate> | |
| 297 | + <el-rate style="width: 40%" v-model="adminUserInfo.stars" show-score :allow-half="true" :max="7" :texts="['0星', '半星', '1星', '1星半', '2星', '2星半', '3星', '2星半', '4星', '4星半', '5星', '5星半', '6星', '6星半', '7星']" | |
| 298 | + show-text :score-template="adminUserInfo.stars+' 星'"> | |
| 299 | + </el-rate> | |
| 296 | 300 | </el-form-item> |
| 297 | 301 | <el-form-item label="面试进度"> |
| 298 | 302 | <el-select v-model="adminUserInfo.process" placeholder="进度"> | ... | ... |