From 62d5e97eba5c85bab271b1ec629a36e4a3796b91 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Thu, 16 Nov 2023 16:25:25 +0800 Subject: [PATCH] upup --- src/api/task/ask.js | 38 ++ src/api/task/plan.js | 37 ++ src/views/task/list/components/addPlan.vue | 468 ++++++++++++++++++ src/views/task/list/components/addUnit.vue | 274 ++++++++-- .../list/components/answerQuestion copy.vue | 197 ++++++++ .../task/list/components/answerQuestion.vue | 189 +++++++ src/views/task/list/components/checkUnit.vue | 8 +- src/views/task/list/plan.vue | 260 ++++++++++ src/views/task/list/study.vue | 10 +- src/views/task/list/unit.vue | 41 +- 10 files changed, 1459 insertions(+), 63 deletions(-) create mode 100644 src/api/task/ask.js create mode 100644 src/api/task/plan.js create mode 100644 src/views/task/list/components/addPlan.vue create mode 100644 src/views/task/list/components/answerQuestion copy.vue create mode 100644 src/views/task/list/components/answerQuestion.vue create mode 100644 src/views/task/list/plan.vue diff --git a/src/api/task/ask.js b/src/api/task/ask.js new file mode 100644 index 0000000..da287e3 --- /dev/null +++ b/src/api/task/ask.js @@ -0,0 +1,38 @@ + +import request from '@/utils/request' + +export function listasklog(params) { + return request({ + url: '/api/admin/ask_log/index', + method: 'get', + params:params + }) +} + +export function save(data) { + return request({ + url: '/api/admin/ask_log/save', + method: 'post', + data + }) +} + +export function del(id) { + return request({ + url: '/api/admin/ask_log/destroy', + method: 'get', + params: { + id + } + }) +} + +export function get(id) { + return request({ + url: '/api/admin/ask_log/show', + method: 'get', + params: { + id + } + }) +} diff --git a/src/api/task/plan.js b/src/api/task/plan.js new file mode 100644 index 0000000..72f3cff --- /dev/null +++ b/src/api/task/plan.js @@ -0,0 +1,37 @@ +import request from '@/utils/request' + +export function listplan(params) { + return request({ + url: '/api/admin/mission-plan/index', + method: 'get', + params:params + }) +} + +export function save(data) { + return request({ + url: '/api/admin/mission-plan/save', + method: 'post', + data + }) +} + +export function del(id) { + return request({ + url: '/api/admin/mission-plan/destroy', + method: 'get', + params: { + id + } + }) +} + +export function get(id) { + return request({ + url: '/api/admin/mission-plan/show', + method: 'get', + params: { + id + } + }) +} diff --git a/src/views/task/list/components/addPlan.vue b/src/views/task/list/components/addPlan.vue new file mode 100644 index 0000000..99649bd --- /dev/null +++ b/src/views/task/list/components/addPlan.vue @@ -0,0 +1,468 @@ + + + + + + + *计划名称: + + + + + + + + + + *计划类型: + + + + + + + + + + + + + *开始日期: + + + + + + + + + + + *结束日期: + + + + + + + + + + + *任务数量: + + + + + + + + + + + 是否审批: + + + + 否 + 是 + + + + + + + + 审批人: + + + + + + + + + + + + + 附件: + + + + 点击上传 + + + + + + + + 说明: + + + + + + + + + + + + + + + + + diff --git a/src/views/task/list/components/addUnit.vue b/src/views/task/list/components/addUnit.vue index 6d37036..d5a18de 100644 --- a/src/views/task/list/components/addUnit.vue +++ b/src/views/task/list/components/addUnit.vue @@ -1,7 +1,17 @@ + :rules='rules' @submit="submit"> + + + + 计划名称: + + + + + + @@ -49,20 +59,96 @@ - - - - 是否审批: - - - - 否 - 是 - - + + + + + + 是否审批: + + + + 否 + 是 + + + + + + + + + 审批人: + + + + + + + + + + + + + + 附件: + + + + 点击上传 + + + + + + + + + 说明: + + + + + + + + + + + {{mission_type==2?'学习方式':'完成要求'}}: + + + + + + + + + + + + 建设题库 + + + + + + + + {{mission_type==2?'学习要求':'完成详情'}}: + + + + + - + + + + + + 参与用户选择: + + + + 人员 + 部门 + 组别 + + + + + + + + + + + + + + + + + + + + + + + + 全选 + + + + {{dept.name}} + + + + + + + + + + + 新增组别 + + + 删除 + 组别:{{item.name=mission_groups_name[index]}} + + 人员 + 部门 + + + + + + + + + + + + + + + + + - - + + + + + - + @@ -294,11 +448,15 @@ name: '需要答题' }], form: { - type: '', + type: '', + mission_name:'', name: '', unit_type: '', start_date: '', - end_date: '', + end_date: '', + lefts:'', + name7: 1, + is_need_answer:'', is_audit: 0, audit_admin_id: '', audit_status: 1, @@ -308,11 +466,10 @@ end_type: '', end_content: '', type: '', - name7: 1, accept_admin_ids: [], accept_department_ids: [], mission_groups: [], - is_need_answer:'' + ask:[] }, mission_groups_list: [{ name: '', @@ -357,10 +514,11 @@ methods: { openQs(){ this.$refs.addQuestion.qsShow=true - this.$refs.addQuestion.topicList = [] + this.$refs.addQuestion.topicList = this.form.ask }, submitQs(e){ console.log("e",e) + this.form.ask = e }, changeName7(e) { if (e) { @@ -447,10 +605,15 @@ const res = await get(this.id) this.form = { type: res?.type, - name: res?.name, + name: res?.name, + mission_name:res?.mission_name, unit_type: res?.unit_type, start_date: res?.start_date, - end_date: res?.end_date, + end_date: res?.end_date, + lefts:'', + name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res + .groups.length > 0 ? 3 : 1)), + is_need_answer:'', is_audit: res.audit_admin_id ? 1 : 0, audit_admin_id: res.audit_admin_id ? res.audit_admin_id : '', audit_status: res.audit_status?res.audit_status:1, @@ -458,13 +621,14 @@ content: res?.content, end_type: res?.end_type, end_content: res?.end_content, - name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res - .groups.length > 0 ? 3 : 1)), + accept_admin_ids: res?.accept_admin_ids, accept_department_ids: res?.accept_department_ids, mission_groups: res?.groups, - is_need_answer:'', - } + + ask:res.ask?res.ask:[] + } + this.mission_type = this.form.type this.mission_groups_list = [] for (var g of res.groups) { this.mission_groups_list.push({ @@ -593,18 +757,24 @@ diff --git a/src/views/task/list/components/answerQuestion.vue b/src/views/task/list/components/answerQuestion.vue new file mode 100644 index 0000000..48adf88 --- /dev/null +++ b/src/views/task/list/components/answerQuestion.vue @@ -0,0 +1,189 @@ + + + + + + 共{{askList.length}}题,答对{{correct}}题,正确率{{range}} + + + + + {{index+1}}、({{item.qsForm.type_name}}){{item.qsForm.title}} + + {{ans}} + + + + + + {{dom.id}}、{{dom.value}} + + + + + + + {{dom.id}}、{{dom.value}} + + + + + + + + + + + + + + 取消 + 确定 + + + 关闭 + + + + + + + + + + + + + + diff --git a/src/views/task/list/components/checkUnit.vue b/src/views/task/list/components/checkUnit.vue index 63bd989..0ac06af 100644 --- a/src/views/task/list/components/checkUnit.vue +++ b/src/views/task/list/components/checkUnit.vue @@ -1,6 +1,6 @@ - 任务信息 @@ -161,6 +161,12 @@ }, { id: 3, name: '提交文字与附件' + },{ + id: 4, + name: '查看即可' + }, { + id: 5, + name: '需要答题' }], auditStatusList:[{ id:0, diff --git a/src/views/task/list/plan.vue b/src/views/task/list/plan.vue new file mode 100644 index 0000000..bf9637f --- /dev/null +++ b/src/views/task/list/plan.vue @@ -0,0 +1,260 @@ + + + + + + + + + {{item.value}} + + + + 查询 + 添加 + + + + + + {select.page_size = e,getList()}" + @pageIndexChange="e => {select.page = e,getList()}" + :table-item="table"> + + + + + + + + + + diff --git a/src/views/task/list/study.vue b/src/views/task/list/study.vue index b4c561e..6f751d0 100644 --- a/src/views/task/list/study.vue +++ b/src/views/task/list/study.vue @@ -110,8 +110,10 @@ + 编辑 + 查看 - 提交问题 + @@ -259,8 +261,10 @@ label: "完成要求", prop: 'end_type', width: 180, - formatter: (cell, data, value, index) => { - return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : '')) + formatter: (cell, data, value, index) => { + return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : (value == 4 ? '查看即可' : (value == 5 ? '需要答题' : '')))) + + // return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : '')) } }, { label: "参与用户", diff --git a/src/views/task/list/unit.vue b/src/views/task/list/unit.vue index c6da8f3..e0b78f4 100644 --- a/src/views/task/list/unit.vue +++ b/src/views/task/list/unit.vue @@ -134,9 +134,11 @@ - 编辑 + 查看 - 提交检查 + 开始答题 + 提交检查 + @@ -150,7 +152,8 @@ - + + @@ -158,7 +161,8 @@ import addUnit from '../list/components/addUnit.vue' import showPatrol from '../list/components/showPatrol.vue' import addPatrol from '../list/components/addPatrol.vue' - import checkUnit from '../list/components/checkUnit.vue' + import checkUnit from '../list/components/checkUnit.vue' + import answerQuestion from '../list/components/answerQuestion.vue' import { listunit, del @@ -169,10 +173,12 @@ addUnit, showPatrol, addPatrol, - checkUnit + checkUnit, + answerQuestion }, data() { - return { + return { + askList:[], typeName: [{ type: 1, name: '专项任务' @@ -251,6 +257,22 @@ }, { id: 3, value: '网络安全' + }], + endTypeList: [{ + id: 1, + name: '提交文字' + }, { + id: 2, + name: '提交附件' + }, { + id: 3, + name: '提交文字与附件' + },{ + id: 4, + name: '查看即可' + }, { + id: 5, + name: '需要答题' }], table: [{ label: "标题", @@ -292,7 +314,7 @@ prop: 'end_type', width: 180, formatter: (cell, data, value, index) => { - return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : '')) + return value == 1 ? '提交文字' : (value == 2 ? '提交附件' : (value == 3 ? '提交文字与附件' : (value == 4 ? '查看即可' : (value == 5 ? '需要答题' : '')))) } }, { label: "参与人员", @@ -406,6 +428,11 @@ let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20; that.tableHeight = tableHeight; }, + openAsks(scope){ + this.$refs['answerQuestion'].mission_id=scope.id + this.$refs['answerQuestion'].askList = scope.ask + this.$refs['answerQuestion'].isShow=true + }, changeDate(e){ if(e){ this.select.start_date = e[0];