pull/13/head
qsh 1 year ago
commit 3454ff1bd5
  1. 2
      public/index.html
  2. 9
      src/api/question.js
  3. 174
      src/views/question/components/QuestionAddForm.vue
  4. 2
      src/views/question/components/QuestionForm.vue
  5. 22
      src/views/question/index.vue
  6. 3
      src/views/sch/place/index.vue

@ -95,12 +95,10 @@
<script src="/loading/index.js"></script> <script src="/loading/index.js"></script>
<script type="text/javascript"> <script type="text/javascript">
window._AMapSecurityConfig = { window._AMapSecurityConfig = {
// securityJsCode: '420463f2f8c849ab78b9d29548aff7d3'
securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab' securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab'
}; };
</script> </script>
<script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script> <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
<!-- <script src="https://webapi.amap.com/maps?v=1.4.15&key=ec6b7ebe38f7ff27126f7088d87a9091&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.Geocoder,AMap.Scale"></script> -->
<script src="https://webapi.amap.com/maps?v=1.4.15&key=713d839ff505943b0f18e6df45f3b0dc&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.Geocoder,AMap.Scale"></script> <script src="https://webapi.amap.com/maps?v=1.4.15&key=713d839ff505943b0f18e6df45f3b0dc&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.Geocoder,AMap.Scale"></script>
</body> </body>
</html> </html>

@ -24,3 +24,12 @@ export function updateQuestion(data) {
}); });
} }
export function addQuestion(data) {
return request({
url: '/driver-api/tdQuestion/duima/add',
method: 'put',
data: data
});
}

@ -0,0 +1,174 @@
<template>
<el-dialog title="试题" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="800px" @close="closeDialog">
<div>
<el-form ref="dialogForm" :model="dialogForm" :rules="dataRule" label-position="left" @keyup.enter.native="dialogFormSubmit()">
<el-row>
<el-col :span="24">
<el-form-item label="题目" prop="question">
<el-input v-model="dialogForm.question" maxlength="200" placeholder="请输入题目" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="选项" prop="question">
A:<el-input v-model="dialogForm.chooseA" maxlength="200" placeholder="请输入" clearable />
B:<el-input v-model="dialogForm.chooseB" maxlength="200" placeholder="请输入" clearable />
C:<el-input v-model="dialogForm.chooseC" maxlength="200" placeholder="请输入" clearable />
D:<el-input v-model="dialogForm.chooseD" maxlength="200" placeholder="请输入" clearable />
E:<el-input v-model="dialogForm.chooseE" maxlength="200" placeholder="请输入" clearable />
F:<el-input v-model="dialogForm.chooseF" maxlength="200" placeholder="请输入" clearable />
G:<el-input v-model="dialogForm.chooseG" maxlength="200" placeholder="请输入" clearable />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="答案" prop="trueAnswer">
<span>{{ dialogForm.trueAnswer }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="科目" prop="subject">
<span v-if="dialogForm.subject == 1">科一</span>
<span v-if="dialogForm.subject == 4">科四</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="精选500题" prop="isVip">
<el-radio-group v-model="dialogForm.isVip" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="精选600题" prop="isVip2">
<el-radio-group v-model="dialogForm.isVip2" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否易错题" prop="isError">
<el-radio-group v-model="dialogForm.isError" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否新规" prop="isNew">
<el-radio-group v-model="dialogForm.isNew" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否密卷1" prop="isExam1">
<el-radio-group v-model="dialogForm.isExam1" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否密卷2" prop="isExam2">
<el-radio-group v-model="dialogForm.isExam2" size="small">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="考点" prop="examKeys">
<el-input v-model="dialogForm.examKeys" maxlength="200" placeholder="请输入考点" clearable />
<span style="color:red;">包含多个考点,以英文";"分割</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button plain @click="(visible=false)">取消</el-button>
<el-button v-jclick type="primary" :disabled="!canSubmit" @click="dialogFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { addQuestion } from '@/api/question';
export default {
data () {
return {
visible: false,
canSubmit: true,
dialogForm: {
questionId: undefined,
isVip: 0,
isVip2: 0,
isError: 0,
isNew: 0,
isExam1: 0,
isExam2: 0,
examKeys: undefined
},
dataRule: {
schoolName: [{ required: true, message: '驾校名称不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
}
};
},
methods: {
init (info = undefined) {
// debugger
this.visible = true;
this.$nextTick(() => {
this.resetDialogForm();
// this.$refs['dialogForm'].resetFields();
if (info) {
this.dialogForm = this.deepClone(info);
}
});
},
resetDialogForm () {
this.dialogForm = {
questionId: undefined,
isVip: 0,
isVip2: 0,
isError: 0,
isNew: 0,
isExam1: 0,
isExam2: 0,
examKeys: undefined
};
},
closeDialog () {
this.$emit('update:dialogVisible', false);
},
//
dialogFormSubmit () {
this.$refs.dialogForm.validate((valid) => {
if (valid) {
updateQuestion(this.dialogForm).then(response => {
if (response.code == 200) {
this.$modal.msgSuccess('修改成功');
// this.visible = true;
}
});
}
});
}
}
};
</script>

@ -4,7 +4,7 @@
<el-form ref="dialogForm" :model="dialogForm" :rules="dataRule" label-position="left" @keyup.enter.native="dialogFormSubmit()"> <el-form ref="dialogForm" :model="dialogForm" :rules="dataRule" label-position="left" @keyup.enter.native="dialogFormSubmit()">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="题" prop="question"> <el-form-item label="题" prop="question">
<div>{{ dialogForm.question }}</div> <div>{{ dialogForm.question }}</div>
<img v-if="dialogForm.imageUrl" :src="dialogForm.imageUrl" width="100" alt=""> <img v-if="dialogForm.imageUrl" :src="dialogForm.imageUrl" width="100" alt="">
</el-form-item> </el-form-item>

@ -63,18 +63,21 @@
</el-table> </el-table>
<!-- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> --> <!-- <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> -->
<QuestionForm v-if="dialogVisible" ref="dialogForm" :dialog-visible="dialogVisible" @update="getList" /> <QuestionForm v-if="dialogVisible" ref="dialogForm" :dialog-visible="dialogVisible" @refreshDataList="getList" />
<QuestionAddForm v-if="dialogAddVisible" ref="dialogAddForm" :dialog-visible="dialogAddVisible" @refreshDataList="getList" />
</div> </div>
</template> </template>
<script> <script>
import { searchQuestion } from '@/api/question'; import { searchQuestion } from '@/api/question';
import QuestionForm from './components/QuestionForm.vue'; import QuestionForm from './components/QuestionForm.vue';
import QuestionAddForm from './components/QuestionAddForm.vue';
export default { export default {
name: 'Question', name: 'Question',
components: { components: {
QuestionForm QuestionForm, QuestionAddForm
}, },
data() { data() {
return { return {
@ -85,11 +88,12 @@ export default {
tableList: [], tableList: [],
// //
queryParams: { queryParams: {
question: '' question: '',
// carTypeId: 1001, carTypeId: 1001,
// subject: 1 subject: 1
}, },
dialogVisible: false dialogVisible: false,
dialogAddVisible: false
}; };
}, },
created() { created() {
@ -124,6 +128,12 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dialogForm.init(item); this.$refs.dialogForm.init(item);
}); });
},
handleAdd(item) {
this.dialogAddVisible = true;
this.$nextTick(() => {
this.$refs.dialogAddForm.init(item);
});
} }
} }
}; };

@ -281,7 +281,6 @@ export default {
}, },
// //
importMap() { importMap() {
// const url = 'https://webapi.amap.com/maps?v=1.4.15&key=f2f35d6adc4a16bb879d303cead56237&callback=onLoad';
const url = 'https://webapi.amap.com/maps?v=1.4.15&key=0e62be0896c6b8d27d453445f0fb8bc4&callback=onLoad'; const url = 'https://webapi.amap.com/maps?v=1.4.15&key=0e62be0896c6b8d27d453445f0fb8bc4&callback=onLoad';
var jsapi = document.createElement('script'); var jsapi = document.createElement('script');
jsapi.charset = 'utf-8'; jsapi.charset = 'utf-8';
@ -547,7 +546,7 @@ export default {
for (let i = 0; i < this.tableData.length; i++) { for (let i = 0; i < this.tableData.length; i++) {
const element = this.tableData[i]; const element = this.tableData[i];
const tempSchool = this.schoolList.filter((item) => item.schoolId === element.schoolId)[0]; const tempSchool = this.schoolList.filter((item) => item.schoolId === element.schoolId)[0];
if (!tempSchool.showInMap || !element.showInMap) { if (!element.schoolShow || !element.showInMap) {
continue; continue;
} }
const tmpMarker = new AMap.Marker({ const tmpMarker = new AMap.Marker({

Loading…
Cancel
Save