Commit cac28d7513752d5c0b7412983e7578e25177dd83

Authored by 周超
1 parent c60f4c61

问卷 用户 维度

src/views/QuestionBank/index.vue
... ... @@ -257,9 +257,20 @@
257 257 placeholder="请输入答案"
258 258 v-model="scope.row.optionContent"
259 259 class="optionInput"
  260 + style="width:68% !important"
260 261 >
261 262 <template slot="prepend">{{ scope.row.option }}</template>
262 263 </el-input>
  264 +
  265 + <el-input
  266 + placeholder="维度分值"
  267 + v-model="scope.row.score"
  268 + class="optionInput"
  269 + style="width:21% !important;margin-left:1%"
  270 + >
  271 + </el-input>
  272 +
  273 +
263 274 <i class="el-icon-circle-plus el-icon" @click="Addlist"></i>
264 275 <i
265 276 class="el-icon-remove el-icon"
... ... @@ -268,6 +279,7 @@
268 279 ></i>
269 280 </template>
270 281 </el-table-column>
  282 +
271 283 </el-table>
272 284 </el-form-item>
273 285 <el-form-item
... ...
src/views/TestPaper/ManualTestPaper.vue
1 1 <template>
2   - <div class="app-container">
3   - <el-row :gutter="20">
4   - <el-col :span="6" :style="{'height':contentHeight+'px'}">
5   - <div class="grid-content bg-purple">
6   - <el-tabs
7   - v-model="activeTab"
8   - style="padding: 0 20px"
9   - :stretch="true"
10   - >
11   - <el-tab-pane label="专业类" name="6"></el-tab-pane>
12   - <el-tab-pane label="测评类" name="1"></el-tab-pane>
13   - </el-tabs>
14   - <div style="padding:0 10px">
15   - <el-input size="small" placeholder="输入关键字搜索" v-model="parameter.keyWord"></el-input>
16   - </div>
17   - <draggable :options="{animation:380,filter:'.unmover'}" group="itxst" v-model="arr1" @end="end1"
18   - @add="RemoveHere" :move="onMove" class="infinite-list" :style="{'height':contentHeight-80+'px'}"
19   - infinite-scroll-disabled="disabled" v-infinite-scroll="load" style="overflow:auto">
20   - <li v-for="i in arr1" class="infinite-list-item" :key="i.id">{{ i.subject }}</li>
21   - <p v-if="loading" style="text-align: center;color: #cdcdcd;" class="unmover">加载中...</p>
22   - <p v-if="noMore" style="text-align: center;color: #cdcdcd;" class="unmover">没有更多了</p>
23   - </draggable>
  2 + <div class="app-container">
  3 + <el-row :gutter="20">
  4 + <el-col :span="6" :style="{'height':contentHeight+'px'}">
  5 + <div class="grid-content bg-purple">
  6 + <el-tabs v-model="activeTab" style="padding: 0 20px" :stretch="true">
  7 + <el-tab-pane label="专业类" name="6"></el-tab-pane>
  8 + <el-tab-pane label="测评类" name="1"></el-tab-pane>
  9 + </el-tabs>
  10 + <div style="padding:0 10px">
  11 + <el-input size="small" placeholder="输入关键字搜索" v-model="parameter.keyWord"></el-input>
  12 + </div>
  13 + <draggable :options="{animation:380,filter:'.unmover'}" group="itxst" v-model="arr1" @end="end1"
  14 + @add="RemoveHere" :move="onMove" class="infinite-list" :style="{'height':contentHeight-80+'px'}"
  15 + infinite-scroll-disabled="disabled" v-infinite-scroll="load" style="overflow:auto">
  16 + <li v-for="i in arr1" class="infinite-list-item" :key="i.id">{{ i.subject }}</li>
  17 + <p v-if="loading" style="text-align: center;color: #cdcdcd;" class="unmover">加载中...</p>
  18 + <p v-if="noMore" style="text-align: center;color: #cdcdcd;" class="unmover">没有更多了</p>
  19 + </draggable>
24 20  
25   - </div>
26   - </el-col>
27   - <el-col :span="10" :style="{'height':contentHeight+'px'}">
28   - <div class="grid-content bg-purple">
29   - <div class="areahead">
30   - <span v-show="!edit" style="font-weight: bold;">{{ TestPaper.TestPaperTitle }}</span>
31   - <el-input v-show="edit" style="width: 400px;" v-model="TestPaper.TestPaperTitle"></el-input>
32   - <i :class="{'el-icon-edit': !edit, 'el-icon-check': edit}" @click="edit = !edit"
33   - style="margin-left: 5px;cursor: pointer;"></i>
34   - </div>
35   - <draggable :options="{animation:380}" group="itxst" v-model="arr2" class="infinite-list" @end="end2"
36   - @add="ComeHere" :style="{'height':contentHeight-60+'px'}"
37   - style="overflow:auto;padding-top: 10px;">
38   - <li v-for="i in arr2" class="infinite-list-item">
39   - <label>[{{i.subjectName}}]{{ i.subject }}</label>
40   - <div v-for="item in JSON.parse(i.subjectContent)">
41   - <p class="option-p">{{item.option}}:{{item.optionContent}}</p>
42   - </div>
43   - </li>
44   - </li>
45   - </draggable>
46   - </div>
47   - </el-col>
48   - <el-col :span="8" :style="{'height':contentHeight+'px'}">
49   - <div class="grid-content bg-purple">
50   - <div class="areahead">组卷基本信息</div>
51   - <el-form ref="form" class="testPaper-manager" :rules="rules" :model="TestPaper" label-width="100px">
52   - <el-form-item label="试卷名称:" class="el-form-item-custom">
53   - {{TestPaper.TestPaperTitle}}
54   - </el-form-item>
55   - <el-form-item label="题目数量:" class="el-form-item-custom">
56   - {{arr2.length}}
57   - </el-form-item>
58   - <el-form-item label="题型数量:" class="el-form-item-custom">
59   - <span style="margin-right: 10px;">单选题:{{TestPaper.SingleNumber}}</span>
60   - <span style="margin-right: 10px;">多选题:{{TestPaper.MultipleNumber}}</span>
61   - <span style="margin-right: 10px;">主观题:{{TestPaper.SubjectiveNumber}}</span>
62   - </el-form-item>
63   - <el-form-item label="题目总分:" class="el-form-item-custom">
64   - {{TestPaper.TotalScore}}
65   - </el-form-item>
66   - <el-form-item label="分类" class="el-form-item-custom">
67   - <el-cascader class="testpaper-input" v-model="TestPaper.QuestionClassId"
68   - style="width:400px;margin-bottom: 20px;" :props="{emitPath:false}" :clearable=true
69   - :options="QuestionClass">
70   - </el-cascader>
71   - </el-form-item>
72   - <el-form-item label="试卷原价:" prop="OriginalPrice" v-show="false">
73   - <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
74   - v-model="TestPaper.OriginalPrice" :precision="0">
75   - <template slot="append">元</template>
76   - </el-input>
77   - </el-form-item>
78   - <el-form-item label="试卷价格:" prop="PresentPrice">
79   - <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
80   - v-model="TestPaper.PresentPrice">
81   - <template slot="append">元</template>
82   - </el-input>
83   - </el-form-item>
84   - <el-form-item label="会员价:" prop="MembershipPrice" v-show="false">
85   - <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
86   - v-model="TestPaper.MembershipPrice">
87   - <template slot="append">元</template>
88   - </el-input>
89   - </el-form-item>
90   - <el-form-item label="试卷简介:">
91   - <el-input class="testpaper-input" :rows="10" type="textarea" v-model="TestPaper.Describe">
92   - </el-input>
93   - </el-form-item>
94   - <el-button type="primary" style="float: right;" @click="SubmitTestPaper">保存
95   - </el-button>
96   - </el-form>
97   - </div>
98   - </el-col>
99   - </el-row>
100   - </div>
  21 + </div>
  22 + </el-col>
  23 + <el-col :span="10" :style="{'height':contentHeight+'px'}">
  24 + <div class="grid-content bg-purple">
  25 + <div class="areahead">
  26 + <span v-show="!edit" style="font-weight: bold;">{{ TestPaper.TestPaperTitle }}</span>
  27 + <el-input v-show="edit" style="width: 400px;" v-model="TestPaper.TestPaperTitle"></el-input>
  28 + <i :class="{'el-icon-edit': !edit, 'el-icon-check': edit}" @click="edit = !edit"
  29 + style="margin-left: 5px;cursor: pointer;"></i>
  30 + </div>
  31 + <draggable :options="{animation:380}" group="itxst" v-model="arr2" class="infinite-list" @end="end2"
  32 + @add="ComeHere" :style="{'height':contentHeight-60+'px'}" style="overflow:auto;padding-top: 10px;">
  33 + <li v-for="i in arr2" class="infinite-list-item">
  34 + <label>[{{i.subjectName}}]{{ i.subject }}</label>
  35 + <div v-for="item in JSON.parse(i.subjectContent)">
  36 + <p class="option-p">{{item.option}}:{{item.optionContent}}</p>
  37 + </div>
  38 + </li>
  39 + </li>
  40 + </draggable>
  41 + </div>
  42 + </el-col>
  43 + <el-col :span="8" :style="{'height':contentHeight+'px'}">
  44 + <div class="grid-content bg-purple">
  45 + <div class="areahead">组卷基本信息</div>
  46 + <el-form ref="form" class="testPaper-manager" :rules="rules" :model="TestPaper" label-width="100px">
  47 + <el-form-item label="试卷名称:" class="el-form-item-custom">
  48 + {{TestPaper.TestPaperTitle}}
  49 + </el-form-item>
  50 + <el-form-item label="题目数量:" class="el-form-item-custom">
  51 + {{arr2.length}}
  52 + </el-form-item>
  53 + <el-form-item label="题型数量:" class="el-form-item-custom">
  54 + <span style="margin-right: 10px;">单选题:{{TestPaper.SingleNumber}}</span>
  55 + <span style="margin-right: 10px;">多选题:{{TestPaper.MultipleNumber}}</span>
  56 + <span style="margin-right: 10px;">主观题:{{TestPaper.SubjectiveNumber}}</span>
  57 + </el-form-item>
  58 + <el-form-item label="题目总分:" class="el-form-item-custom">
  59 + {{TestPaper.TotalScore}}
  60 + </el-form-item>
  61 +
  62 +
  63 + <el-form-item label="分类" class="el-form-item-custom">
  64 + <el-cascader class="testpaper-input" v-model="TestPaper.QuestionClassId"
  65 + style="width:400px;margin-bottom: 20px;" :props="{emitPath:false}" :clearable=true
  66 + :options="QuestionClass">
  67 + </el-cascader>
  68 + </el-form-item>
  69 +
  70 + <el-form-item label="有效时间" required>
  71 + <el-form-item prop="date1">
  72 + <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange"
  73 + format="yyyy-MM-dd hh:mm:ss" range-separator="至" start-placeholder="开始时间" style="width:100%"
  74 + end-placeholder="结束时间">
  75 + </el-date-picker>
  76 + </el-form-item>
  77 + </el-form-item>
  78 + <el-form-item label="总时长控制" :prop="AnswerTime">
  79 + <el-input class="testpaper-input" type="number" placeholder="总时长控制(分钟)" v-model="TestPaper.AnswerTime">
  80 + </el-input>
  81 + </el-form-item>
  82 +
  83 + <el-form-item label="试卷原价:" prop="OriginalPrice" v-show="false">
  84 + <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
  85 + v-model="TestPaper.OriginalPrice" :precision="0">
  86 + <template slot="append">元</template>
  87 + </el-input>
  88 + </el-form-item>
  89 + <el-form-item label="试卷价格:" prop="PresentPrice" v-show="false">
  90 + <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
  91 + v-model="TestPaper.PresentPrice">
  92 + <template slot="append">元</template>
  93 + </el-input>
  94 + </el-form-item>
  95 + <el-form-item label="会员价:" prop="MembershipPrice" v-show="false">
  96 + <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
  97 + v-model="TestPaper.MembershipPrice">
  98 + <template slot="append">元</template>
  99 + </el-input>
  100 + </el-form-item>
  101 + <el-form-item label="试卷简介:">
  102 + <el-input class="testpaper-input" :rows="10" type="textarea" v-model="TestPaper.Describe">
  103 + </el-input>
  104 + </el-form-item>
  105 + <el-button type="primary" style="float: right;" @click="SubmitTestPaper">保存
  106 + </el-button>
  107 + </el-form>
  108 + </div>
  109 + </el-col>
  110 + </el-row>
  111 + </div>
101 112 </template>
102 113  
103 114 <script>
104   -import draggable from "vuedraggable";
105   -import { getQuestionClassList, getQuestionList } from "@/api/QuestionBank";
106   -import { EditTestPaper, GetToplevel } from "@/api/TestPaper";
107   -export default {
108   - //注册draggable组件
109   - components: {
110   - draggable,
111   - },
112   - data() {
113   - return {
114   - activeTab: "6",
115   - parameter: {
116   - pageIndex: 0,
117   - pageSize: 20,
118   - sort: "id",
119   - sortOrder: 1,
120   - keyWord: "",
121   - QuestionClassId: 6,
122   - status: 1,
123   - },
124   - contentHeight: 0,
125   - count: 0,
126   - edit: false,
127   - arr1: [],
128   - arr2: [],
129   - moveId: -1,
130   - TestPaper: {
131   - TestPaperTitle: "未命名试卷标题",
132   - TestPaperClassId: 0,
133   - TotalScore: 0,
134   - Describe: "",
135   - SingleNumber: 0,
136   - MultipleNumber: 0,
137   - SubjectiveNumber: 0,
138   - OriginalPrice: "0",
139   - PresentPrice: "0",
140   - MembershipPrice: "0",
141   - QuestionBankIds: [],
142   - },
143   - loading: false,
144   - rules: {
145   - OriginalPrice: [
146   - {
147   - required: true,
148   - message: "不能为空",
149   - },
150   - ],
151   - PresentPrice: [
152   - {
153   - required: true,
154   - message: "不能为空",
155   - },
156   - ],
157   - MembershipPrice: [
  115 + import draggable from "vuedraggable";
  116 + import { getQuestionClassList, getQuestionList } from "@/api/QuestionBank";
  117 + import { EditTestPaper, GetToplevel } from "@/api/TestPaper";
  118 + import { formatTime } from '@/utils/util'
  119 + export default {
  120 + //注册draggable组件
  121 + components: {
  122 + draggable,
  123 + },
  124 + data() {
  125 + return {
  126 + activeTab: "6",
  127 + parameter: {
  128 + pageIndex: 0,
  129 + pageSize: 20,
  130 + sort: "id",
  131 + sortOrder: 1,
  132 + keyWord: "",
  133 + QuestionClassId: 6,
  134 + status: 1,
  135 + },
  136 + contentHeight: 0,
  137 + count: 0,
  138 + edit: false,
  139 + arr1: [],
  140 + arr2: [],
  141 + moveId: -1,
  142 + TestPaper: {
  143 + TestPaperTitle: "未命名试卷标题",
  144 + TestPaperClassId: 0,
  145 + TotalScore: 0,
  146 + Describe: "",
  147 + SingleNumber: 0,
  148 + MultipleNumber: 0,
  149 + SubjectiveNumber: 0,
  150 + OriginalPrice: "0",
  151 + PresentPrice: "0",
  152 + MembershipPrice: "0",
  153 + QuestionBankIds: [],
  154 + },
  155 + loading: false,
  156 + rules: {
  157 + OriginalPrice: [
  158 + {
  159 + required: true,
  160 + message: "不能为空",
  161 + },
  162 + ],
  163 + PresentPrice: [
  164 + {
  165 + required: true,
  166 + message: "不能为空",
  167 + },
  168 + ],
  169 + MembershipPrice: [
  170 + {
  171 + required: true,
  172 + message: "不能为空",
  173 + },
  174 + ],
  175 + },
  176 + QuestionClass: [],
  177 + treeData: [
158 178 {
159   - required: true,
160   - message: "不能为空",
  179 + value: 0,
  180 + label: "全部",
161 181 },
162 182 ],
  183 + timeout: 0,
  184 + };
  185 + },
  186 + watch: {
  187 + activeTab() {
  188 + console.log("activeTab watch");
  189 + this.search();
163 190 },
164   - QuestionClass: [],
165   - treeData: [
166   - {
167   - value: 0,
168   - label: "全部",
  191 + "parameter.keyWord": {
  192 + handler() {
  193 + clearTimeout(this.timeout);
  194 + this.timeout = setTimeout(() => {
  195 + this.search();
  196 + }, 200);
169 197 },
170   - ],
171   - timeout: 0,
172   - };
173   - },
174   - watch: {
175   - activeTab() {
176   - console.log("activeTab watch");
177   - this.search();
178   - },
179   - "parameter.keyWord": {
180   - handler() {
181   - clearTimeout(this.timeout);
182   - this.timeout = setTimeout(() => {
183   - this.search();
184   - }, 200);
185 198 },
186 199 },
187   - },
188   - computed: {
189   - noMore() {
190   - return this.arr1.length >= this.count;
191   - },
192   - disabled() {
193   - return this.loading || this.noMore;
  200 + computed: {
  201 + noMore() {
  202 + return this.arr1.length >= this.count;
  203 + },
  204 + disabled() {
  205 + return this.loading || this.noMore;
  206 + },
194 207 },
195   - },
196   - created() {},
197   - mounted() {
198   - //计算页面内容区域的高度
199   - this.contentHeight = window.innerHeight - 90;
200   - this.getQuestionClassListHeadler();
201   - //this.GetList();
202   - },
203   - methods: {
204   - search() {
205   - this.parameter.pageIndex = 1;
206   - this.parameter.QuestionClassId = Number(this.activeTab);
207   - this.GetList();
  208 + created() { },
  209 + mounted() {
  210 + //计算页面内容区域的高度
  211 + this.contentHeight = window.innerHeight - 90;
  212 + this.getQuestionClassListHeadler();
  213 + //this.GetList();
208 214 },
209   - SubmitTestPaper() {
210   - if (this.arr2.length > 0) {
211   - EditTestPaper(this.TestPaper).then((res) => {
212   - if (res.data.code == 200) {
213   - this.$confirm("组卷成功!", "消息");
214   - } else {
215   - this.$confirm("组卷失败!", "消息");
  215 + methods: {
  216 + changetimestartend(val, aa) {
  217 + this.TestPaper.EffectiveStartTime = formatTime(val[0])
  218 + this.TestPaper.EffectiveEndTime = formatTime(val[1])
  219 + },
  220 + search() {
  221 + this.parameter.pageIndex = 1;
  222 + this.parameter.QuestionClassId = Number(this.activeTab);
  223 + this.GetList();
  224 + },
  225 + SubmitTestPaper() {
  226 + if (this.arr2.length > 0) {
  227 + EditTestPaper(this.TestPaper).then((res) => {
  228 + if (res.data.code == 200) {
  229 + this.$confirm("组卷成功!", "消息");
  230 + } else {
  231 + this.$confirm("组卷失败!", "消息");
  232 + }
  233 + });
  234 + } else {
  235 + this.$confirm("试题未有题目!", "消息");
  236 + }
  237 + },
  238 + load() {
  239 + this.loading = true;
  240 + this.parameter.pageIndex++;
  241 + this.GetList();
  242 + this.loading = false;
  243 + },
  244 + GetList() {
  245 + getQuestionList(this.parameter).then((res) => {
  246 + if (this.parameter.pageIndex == 1) {
  247 + this.arr1 = [];
216 248 }
  249 + res.data.data.rows.forEach((item, i) => {
  250 + this.arr1.push(item);
  251 + });
  252 + this.count = res.data.data.total;
  253 + this.$forceUpdate();
217 254 });
218   - } else {
219   - this.$confirm("试题未有题目!", "消息");
220   - }
221   - },
222   - load() {
223   - this.loading = true;
224   - this.parameter.pageIndex++;
225   - this.GetList();
226   - this.loading = false;
227   - },
228   - GetList() {
229   - getQuestionList(this.parameter).then((res) => {
230   - if (this.parameter.pageIndex == 1) {
231   - this.arr1 = [];
  255 + },
  256 + end1(e) {
  257 + var that = this;
  258 + if (that.arr1.length < 10) {
  259 + this.load();
232 260 }
233   - res.data.data.rows.forEach((item, i) => {
234   - this.arr1.push(item);
235   - });
236   - this.count = res.data.data.total;
237   - this.$forceUpdate();
238   - });
239   - },
240   - end1(e) {
241   - var that = this;
242   - if (that.arr1.length < 10) {
243   - this.load();
244   - }
245 261  
246   - var items = this.arr2.filter(function (m) {
247   - return m.id == that.moveId;
248   - });
  262 + var items = this.arr2.filter(function (m) {
  263 + return m.id == that.moveId;
  264 + });
249 265  
250   - //如果左边
251   - if (items.length < 2) return;
252   - this.arr2.splice(e.newDraggableIndex, 1);
  266 + //如果左边
  267 + if (items.length < 2) return;
  268 + this.arr2.splice(e.newDraggableIndex, 1);
253 269  
254   - // SingleNumber:0,
255   - // MultipleNumber:0,
256   - // SubjectiveNumber:0,
257   - },
258   - //从右边移除到左边
259   - RemoveHere(e) {
260   - if (e.item._underlying_vm_.subjectType == 1) {
261   - this.TestPaper.SingleNumber -= 1;
262   - }
263   - if (e.item._underlying_vm_.subjectType == 2) {
264   - this.TestPaper.MultipleNumber -= 1;
265   - }
266   - if (e.item._underlying_vm_.subjectType == 3) {
267   - this.TestPaper.SubjectiveNumber -= 1;
268   - }
269   - this.TestPaper.TotalScore -= e.item._underlying_vm_.fraction;
270   - this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
271   - },
272   - //从左边添加到右边
273   - ComeHere(e) {
274   - if (e.item._underlying_vm_.subjectType == 1) {
275   - this.TestPaper.SingleNumber += 1;
276   - }
277   - if (e.item._underlying_vm_.subjectType == 2) {
278   - this.TestPaper.MultipleNumber += 1;
279   - }
280   - if (e.item._underlying_vm_.subjectType == 3) {
281   - this.TestPaper.SubjectiveNumber += 1;
282   - }
283   - this.TestPaper.TotalScore += e.item._underlying_vm_.fraction;
  270 + // SingleNumber:0,
  271 + // MultipleNumber:0,
  272 + // SubjectiveNumber:0,
  273 + },
  274 + //从右边移除到左边
  275 + RemoveHere(e) {
  276 + if (e.item._underlying_vm_.subjectType == 1) {
  277 + this.TestPaper.SingleNumber -= 1;
  278 + }
  279 + if (e.item._underlying_vm_.subjectType == 2) {
  280 + this.TestPaper.MultipleNumber -= 1;
  281 + }
  282 + if (e.item._underlying_vm_.subjectType == 3) {
  283 + this.TestPaper.SubjectiveNumber -= 1;
  284 + }
  285 + this.TestPaper.TotalScore -= e.item._underlying_vm_.fraction;
  286 + this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
  287 + },
  288 + //从左边添加到右边
  289 + ComeHere(e) {
  290 + if (e.item._underlying_vm_.subjectType == 1) {
  291 + this.TestPaper.SingleNumber += 1;
  292 + }
  293 + if (e.item._underlying_vm_.subjectType == 2) {
  294 + this.TestPaper.MultipleNumber += 1;
  295 + }
  296 + if (e.item._underlying_vm_.subjectType == 3) {
  297 + this.TestPaper.SubjectiveNumber += 1;
  298 + }
  299 + this.TestPaper.TotalScore += e.item._underlying_vm_.fraction;
284 300  
285   - this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
286   - },
287   - //右边往左边拖动时的事件
288   - end2(e) {
289   - var that = this;
290   - var items = this.arr1.filter(function (m) {
291   - return m.id == that.moveId;
292   - });
293   - //如果左边
294   - if (items.length < 2) return;
295   - this.arr1.splice(e.newDraggableIndex, 1);
296   - },
297   - //move回调方法
298   - onMove(e, originalEvent) {
299   - //this.moveId = e.relatedContext.element.id;
300   - return true;
301   - },
302   - getQuestionClassListHeadler() {
303   - let _this = this;
304   - GetToplevel().then((res) => {
305   - var gettree = function (titem) {
306   - titem.children = [];
307   - let childrenList = res.data.data.filter(
308   - (u) => u.ParentId == titem.value
309   - );
310   - if (childrenList.length == 0) titem.children = undefined;
  301 + this.TestPaper.QuestionBankIds = this.arr2.map((u) => u.id);
  302 + },
  303 + //右边往左边拖动时的事件
  304 + end2(e) {
  305 + var that = this;
  306 + var items = this.arr1.filter(function (m) {
  307 + return m.id == that.moveId;
  308 + });
  309 + //如果左边
  310 + if (items.length < 2) return;
  311 + this.arr1.splice(e.newDraggableIndex, 1);
  312 + },
  313 + //move回调方法
  314 + onMove(e, originalEvent) {
  315 + //this.moveId = e.relatedContext.element.id;
  316 + return true;
  317 + },
  318 + getQuestionClassListHeadler() {
  319 + let _this = this;
  320 + GetToplevel().then((res) => {
  321 + var gettree = function (titem) {
  322 + titem.children = [];
  323 + let childrenList = res.data.data.filter(
  324 + (u) => u.ParentId == titem.value
  325 + );
  326 + if (childrenList.length == 0) titem.children = undefined;
  327 + res.data.data
  328 + .filter((u) => u.ParentId == titem.value)
  329 + .forEach((item, i) => {
  330 + var model = {
  331 + value: item.id,
  332 + label: item.ClassTitle,
  333 + };
  334 + gettree(model);
  335 + titem.children.push(model);
  336 + });
  337 + };
311 338 res.data.data
312   - .filter((u) => u.ParentId == titem.value)
  339 + .filter((u) => u.ParentId == 0)
313 340 .forEach((item, i) => {
314 341 var model = {
315 342 value: item.id,
316 343 label: item.ClassTitle,
317 344 };
318 345 gettree(model);
319   - titem.children.push(model);
  346 + _this.QuestionClass.push(model);
  347 + _this.treeData.push(model);
320 348 });
321   - };
322   - res.data.data
323   - .filter((u) => u.ParentId == 0)
324   - .forEach((item, i) => {
325   - var model = {
326   - value: item.id,
327   - label: item.ClassTitle,
328   - };
329   - gettree(model);
330   - _this.QuestionClass.push(model);
331   - _this.treeData.push(model);
332   - });
333   - });
  349 + });
  350 + },
334 351 },
335   - },
336   -};
  352 + };
337 353 </script>
338 354  
339 355 <style lang="scss" scoped>
340   -.el-row {
341   - /* margin-bottom: 20px; */
342   - &:last-child {
343   - margin-bottom: 0;
  356 + .el-row {
  357 +
  358 + /* margin-bottom: 20px; */
  359 + &:last-child {
  360 + margin-bottom: 0;
  361 + }
  362 + }
  363 +
  364 + .el-col {
  365 + border-radius: 4px;
344 366 }
345   -}
346   -.el-col {
347   - border-radius: 4px;
348   -}
349   -.bg-purple-dark {
350   - background: #99a9bf;
351   -}
352   -.bg-purple {
353   - background: #efefef;
354   -}
355   -.bg-purple-light {
356   - background: #e5e9f2;
357   -}
358   -.grid-content {
359   - border-radius: 4px;
360   - min-height: 36px;
361   - height: 100%;
362   -}
363   -.row-bg {
364   - padding: 10px 0;
365   - background-color: #f9fafc;
366   -}
367   -.infinite-list {
368   - list-style: none;
369   - margin: 0px;
370   - padding: 0px;
371   - &::-webkit-scrollbar {
372   - width: 6px;
  367 +
  368 + .bg-purple-dark {
  369 + background: #99a9bf;
  370 + }
  371 +
  372 + .bg-purple {
  373 + background: #efefef;
373 374 }
374   - //滚动条小方块
375   - &::-webkit-scrollbar-thumb {
376   - border-radius: 10px;
377   - background: #304156;
  375 +
  376 + .bg-purple-light {
  377 + background: #e5e9f2;
378 378 }
379   - //滚动条轨道
380   - &::-webkit-scrollbar-track {
381   - // border-radius: 10px;
382   - height: 100px;
383   - background: #cdcdcd;
  379 +
  380 + .grid-content {
  381 + border-radius: 4px;
  382 + min-height: 36px;
  383 + height: 100%;
384 384 }
385   - .infinite-list-item {
386   - padding: 10px;
387   - min-height: 60px;
388   - width: 95%;
389   - margin: auto;
390   - background-color: #fff;
391   - margin-bottom: 10px;
392   - border-radius: 5px;
393   - box-shadow: 0 0 5px #cdcdcd;
394   - &:first-child {
395   - margin-top: 10px;
  385 +
  386 + .row-bg {
  387 + padding: 10px 0;
  388 + background-color: #f9fafc;
  389 + }
  390 +
  391 + .infinite-list {
  392 + list-style: none;
  393 + margin: 0px;
  394 + padding: 0px;
  395 +
  396 + &::-webkit-scrollbar {
  397 + width: 6px;
  398 + }
  399 +
  400 + //滚动条小方块
  401 + &::-webkit-scrollbar-thumb {
  402 + border-radius: 10px;
  403 + background: #304156;
  404 + }
  405 +
  406 + //滚动条轨道
  407 + &::-webkit-scrollbar-track {
  408 + // border-radius: 10px;
  409 + height: 100px;
  410 + background: #cdcdcd;
  411 + }
  412 +
  413 + .infinite-list-item {
  414 + padding: 10px;
  415 + min-height: 60px;
  416 + width: 95%;
  417 + margin: auto;
  418 + background-color: #fff;
  419 + margin-bottom: 10px;
  420 + border-radius: 5px;
  421 + box-shadow: 0 0 5px #cdcdcd;
  422 +
  423 + &:first-child {
  424 + margin-top: 10px;
  425 + }
396 426 }
397 427 }
398   -}
399   -.option-p {
400   - line-height: 15px;
401   -}
402   -.areahead {
403   - text-align: center;
404   - height: 60px;
405   - line-height: 60px;
406   - border-bottom: 1px solid #cdcdcd;
407   -}
408   -.testPaper-manager {
409   - margin: 10px 20px 10px 10px;
410   -}
411   -.testPaper-manager .el-form-item {
412   - margin-bottom: 20px;
413   -}
414   -.el-form-item-custom {
415   - margin-bottom: 0px !important;
416   -}
417   -.testpaper-input {
418   - //max-width: 400px;
419   -}
420   -</style>
  428 +
  429 + .option-p {
  430 + line-height: 15px;
  431 + }
  432 +
  433 + .areahead {
  434 + text-align: center;
  435 + height: 60px;
  436 + line-height: 60px;
  437 + border-bottom: 1px solid #cdcdcd;
  438 + }
  439 +
  440 + .testPaper-manager {
  441 + margin: 10px 20px 10px 10px;
  442 + }
  443 +
  444 + .testPaper-manager .el-form-item {
  445 + margin-bottom: 20px;
  446 + }
  447 +
  448 + .el-form-item-custom {
  449 + margin-bottom: 0px !important;
  450 + }
  451 +
  452 + .testpaper-input {
  453 + //max-width: 400px;
  454 + }
  455 +</style>
421 456 \ No newline at end of file
... ...
src/views/TestPaper/TestPaperList.vue
... ... @@ -41,12 +41,12 @@
41 41 <span>{{ scope.row.TestPaperClassId | typeFilters}}</span>
42 42 </template>
43 43 </el-table-column>
44   - <el-table-column prop="name" label="原价" width="80" v-show="false">
  44 + <!-- <el-table-column prop="name" label="原价" width="80" v-show="false">
45 45 <template slot-scope="scope">
46 46 <span>{{ scope.row.OriginalPrice/100 }}</span>
47 47 </template>
48 48 </el-table-column>
49   - <el-table-column prop="name" label="现价" width="80">
  49 + <el-table-column prop="name" label="现价" width="80" v-show="false">
50 50 <template slot-scope="scope">
51 51 <span>{{ scope.row.PresentPrice/100 }}</span>
52 52 </template>
... ... @@ -55,7 +55,7 @@
55 55 <template slot-scope="scope">
56 56 <span>{{ scope.row.MembershipPrice/100 }}</span>
57 57 </template>
58   - </el-table-column>
  58 + </el-table-column> -->
59 59 <el-table-column prop="name" label="试卷说明" :show-overflow-tooltip=true>
60 60 <template slot-scope="scope">
61 61 <span>{{ scope.row.Describe }}</span>
... ... @@ -100,13 +100,25 @@
100 100 <el-option label="面试题" value="4"></el-option>
101 101 </el-select>
102 102 </el-form-item>
  103 + <el-form-item label="有效时间" required>
  104 + <el-form-item prop="date1">
  105 + <el-date-picker v-model="TestPaper.date" @change="changetimestartend" type="datetimerange"
  106 + format="yyyy-MM-dd hh:mm:ss" range-separator="至" start-placeholder="开始时间" style="width:100%"
  107 + end-placeholder="结束时间">
  108 + </el-date-picker>
  109 + </el-form-item>
  110 + </el-form-item>
  111 + <el-form-item label="总时长控制" :prop="AnswerTime">
  112 + <el-input class="testpaper-input" type="number" placeholder="总时长控制(分钟)" v-model="TestPaper.AnswerTime">
  113 + </el-input>
  114 + </el-form-item>
103 115 <el-form-item label="试卷原价:" prop="OriginalPrice" v-show="false">
104 116 <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
105 117 v-model="TestPaper.OriginalPrice" :precision="0">
106 118 <template slot="append">元</template>
107 119 </el-input>
108 120 </el-form-item>
109   - <el-form-item label="试卷价格:" prop="PresentPrice">
  121 + <el-form-item label="试卷价格:" prop="PresentPrice" v-show="false">
110 122 <el-input class="testpaper-input" oninput="value=value.replace(/[^0-9.]/g,'')"
111 123 v-model="TestPaper.PresentPrice">
112 124 <template slot="append">元</template>
... ... @@ -143,8 +155,7 @@
143 155 getTestPaperClassList
144 156 } from '@/api/TestPaper'
145 157 let that
146   - export default {
147   -
  158 + export default {
148 159 data() {
149 160 return {
150 161 parameter: {
... ... @@ -218,6 +229,10 @@
218 229 this.getQuestionClassListHeadler();
219 230 },
220 231 methods: {
  232 + changetimestartend(val, aa) {
  233 + this.TestPaper.EffectiveStartTime = formatTime(val[0])
  234 + this.TestPaper.EffectiveEndTime = formatTime(val[1])
  235 + },
221 236 closeClassDialog() {
222 237 this.dialogAddTestPaperVIsible = false
223 238 this.TestPaper= {
... ... @@ -309,6 +324,11 @@
309 324 })
310 325 } else if (value == 'update') {
311 326 this.dialogAddTestPaperVIsible = true
  327 + if (val.EffectiveStartTime && val.EffectiveEndTime) {
  328 + val.date = [];
  329 + val.date.push(val.EffectiveStartTime)
  330 + val.date.push(val.EffectiveEndTime)
  331 + }
312 332 this.TestPaper = val
313 333 }
314 334 }
... ...
src/views/user/userlist.vue
1 1 <template>
2 2 <div class="app-container">
3 3 <div class="seetingsDiv" style="">
4   - <div class="flex">
5   - <el-input placeholder="输入关键字搜索" v-model="query.keyword"></el-input>
6   - <el-button type="success" @click="search">搜索</el-button>
7   - <el-button v-if="selectedList.length" type="primary" @click="handleInviteInterview"
8   - >邀请面试</el-button
9   - >
  4 + <div class="flex" style="width:75%">
  5 +
  6 + <el-form :inline="true" class="demo-form-inline">
  7 + <el-form-item label="关键字">
  8 + <el-input placeholder="输入关键字搜索" v-model="query.keyword"></el-input>
  9 + </el-form-item>
  10 + <el-form-item label="最高学历">
  11 + <el-select v-model="query.xueli" placeholder="最高学历">
  12 + <el-option label="大专" value="shanghai"></el-option>
  13 + <el-option label="本科" value="beijing"></el-option>
  14 + </el-select>
  15 + </el-form-item>
  16 +
  17 + <el-form-item label="性别">
  18 + <el-select v-model="query.sex" placeholder="性别">
  19 + <el-option label="男" value="1"></el-option>
  20 + <el-option label="女" value="0"></el-option>
  21 + </el-select>
  22 + </el-form-item>
  23 +
  24 +
  25 + <el-form-item>
  26 + <el-button type="success" @click="search">搜索</el-button>
  27 + <el-button v-if="selectedList.length" type="primary" @click="handleInviteInterview"
  28 + >邀请面试</el-button
  29 + >
  30 + </el-form-item>
  31 + </el-form>
  32 +
  33 +
10 34 </div>
11 35 <el-upload
12 36 class="upload-demo"
13   - action="/api/Account/ImportUser"
  37 + action="/api/Account/importUsers?UserClassId=0"
14 38 multiple
15   - :limit="3"
  39 + :limit="1"
  40 + :show-file-list="false"
16 41 :on-exceed="handleExceed"
  42 + :on-success="handleSuccess"
17 43 :file-list="fileList"
18 44 >
19 45 <el-button size="small" type="primary">导入用户</el-button>
... ... @@ -39,7 +65,7 @@
39 65 width="50"
40 66 align="center"
41 67 ></el-table-column>
42   - <el-table-column prop="date" label="用户昵称">
  68 + <el-table-column prop="date" label="姓名">
43 69 <template slot-scope="scope">
44 70 <span>{{ scope.row.fullName }}</span>
45 71 </template>
... ... @@ -57,6 +83,12 @@
57 83 </template>
58 84 </el-table-column>
59 85  
  86 + <el-table-column prop="date" label="性别"> </el-table-column>
  87 + <el-table-column prop="date" label="毕业院校"> </el-table-column>
  88 + <el-table-column prop="date" label="最高学历"> </el-table-column>专业
  89 + <el-table-column prop="date" label="专业"> </el-table-column>
  90 +
  91 +
60 92 <el-table-column prop="date" label="注册时间">
61 93 <template slot-scope="scope">
62 94 <span>{{ scope.row.addTime.replace("T", " ") }}</span>
... ... @@ -100,6 +132,10 @@ export default {
100 132 search(){
101 133 this.GetUser();
102 134 },
  135 + handleSuccess(){
  136 + this.$message.success('导入完成!');
  137 + this.GetUser();
  138 + },
103 139 handleInviteInterview() {},
104 140 handleSelectionChange(val) {
105 141 console.log(val);
... ... @@ -131,9 +167,11 @@ export default {
131 167 display: flex;
132 168 align-items: center;
133 169 width: 100%;
134   - height: 60px;
  170 + padding-top:10px;
  171 + padding-left:10px;
  172 + /* height: 60px; */
135 173 background: #efefef;
136   - line-height: 60px;
  174 + /* line-height: 60px; */
137 175 border-radius: 5px;
138 176 box-shadow: 0 0 5px #cdcdcd;
139 177 justify-content: space-between;
... ...