Browse Source

v1.1.0需求开发

刘洋 1 year ago
parent
commit
3a367072da

+ 1 - 0
src/api/api-types/exam.d.ts

@@ -46,6 +46,7 @@ export namespace Exam {
     enable: boolean
     rejectReason: boolean
     scoreEffective: string
+    markSite?: string
   }
 
   /** 新增/修改考试 */

+ 3 - 0
src/api/api-types/marking.d.ts

@@ -52,6 +52,7 @@ export namespace Marking {
   type SetCustomQueryConfig = BaseDefine<{ name: string; params: CustomQuery }>
 
   type GetCustomQueryConfigList = BaseDefine<{ name: string }, { name: string; params: CustomQuery }[]>
+  type DeleteCustomQuery = BaseDefine<any, any>
 
   /** 自定义查询 - 浏览 */
   type ViewCustomQuery = BaseDefine<{ taskId: number }>
@@ -328,6 +329,8 @@ export namespace Marking {
     setCustomQueryConfig: SetCustomQueryConfig
     /** 自定义查询 - 获取快捷查询列表 */
     getCustomQueryConfigList: GetCustomQueryConfigList
+    /** 删除快捷查询 */
+    deleteCustomQuery: DeleteCustomQuery
     /** 自定义查询 - 浏览 */
     viewCustomQuery: ViewCustomQuery
     /** 自定义查询 - 修改卷型 */

+ 1 - 0
src/api/api-types/message.d.ts

@@ -12,6 +12,7 @@ export namespace Message {
     sendUserId: number
     sendUserName: string
     unReadCount: number
+    sendUserRole?: any
   }
   /** 历史消息 */
   type GetMessageHistory = BaseDefine<{ sendUserId: number }, BaseMessageResponse[]>

+ 1 - 0
src/api/api-types/user.d.ts

@@ -57,6 +57,7 @@ export namespace User {
     role: ROLE
     subjectCode: string
     enable: boolean
+    stage?: string
   }
 
   interface ResponseUserInfo extends BaseUserInfo {

+ 2 - 0
src/api/marking.ts

@@ -13,6 +13,8 @@ const MarkingApi: DefineApiModule<Marking.ApiMap> = {
   },
   /** 自定义查询 - 获取快捷查询列表 */
   getCustomQueryConfigList: '/api/custom/query/list',
+  /** 删除快捷查询 */
+  deleteCustomQuery: '/api/custom/query/remove',
   /** 自定义查询 - 浏览 */
   viewCustomQuery: '/api/custom/query/view',
   /** 自定义查询 - 修改卷型 */

+ 18 - 4
src/components/shared/message/MessageList.vue

@@ -40,7 +40,7 @@
             <el-icon><close /></el-icon>
           </div> -->
         </div>
-        <div class="p-base" style="height: calc(100% - 221px)">
+        <div class="p-base" :style="{ height: isFromMyLeader ? 'calc(100% - 221px)' : 'calc(100% - 111px)' }">
           <!-- <pre
             class="full-h radius-base p-extra-base scroll-y-auto message-info-content"
             @click="onContentClick"
@@ -66,7 +66,7 @@
             </div>
           </div>
         </div>
-        <div class="p-base" style="padding-top: 0">
+        <div v-if="isFromMyLeader" class="p-base" style="padding-top: 0">
           <div class="p-base radius-base overflow-hidden msg-content-box">
             <div style="height: calc(100% - 18px)" class="scroll-y-auto">
               <content-edit-able
@@ -82,9 +82,17 @@
         <div class="p-base flex items-center justify-between">
           <!-- <el-button size="small" type="primary" :disabled="!currentMessage" @click="onReply">回复</el-button> -->
           <!-- <el-button size="small" plain :disabled="!currentMessage" @click="toggleHistory">历史消息</el-button> -->
-          <el-button v-if="showSendPaper" size="small" plain @click="sendCurrentPaper">发送当前试卷</el-button>
+          <el-button v-if="showSendPaper && isFromMyLeader" size="small" plain @click="sendCurrentPaper"
+            >发送当前试卷</el-button
+          >
           <span v-else></span>
-          <el-button size="small" type="primary" :disabled="!allowSend" :loading="sendLoading" @click="onSendMessage"
+          <el-button
+            v-if="isFromMyLeader"
+            size="small"
+            type="primary"
+            :disabled="!allowSend"
+            :loading="sendLoading"
+            @click="onSendMessage"
             >发送</el-button
           >
         </div>
@@ -169,6 +177,12 @@ const showHistory = ref<boolean>(false)
 const { fetch: getMessageList, result: messageList } = useFetch('getMessageList')
 
 const currentMessage = ref<MessageType>()
+const isFromOther = computed(() => {
+  return mainStore?.myUserInfo?.id != currentMessage.value?.sendUserId
+})
+const isFromMyLeader = computed(() => {
+  return isFromOther.value && currentMessage.value?.sendUserRole === 'DEPUTY'
+})
 function scrollToBottom() {
   let scrollHeight = historyMsgWrap.value.scrollHeight
   if (scrollHeight > 200) {

+ 4 - 5
src/hooks/useOptions.ts

@@ -265,11 +265,10 @@ const useOptions = (
           // (t) => dataModel[t] || (t === 'group' && (isAdmin.value || isChief.value))
 
           (t) => {
-            console.log(t, dataModel[t])
-            console.log(
-              Array.isArray(dataModel[t]) ? dataModel[t].length > 0 : !!dataModel[t],
-              t === 'group' && (isAdmin.value || isChief.value || isExpert.value || isLeader.value)
-            )
+            // console.log(
+            //   Array.isArray(dataModel[t]) ? dataModel[t].length > 0 : !!dataModel[t],
+            //   t === 'group' && (isAdmin.value || isChief.value || isExpert.value || isLeader.value)
+            // )
             return (
               (Array.isArray(dataModel[t]) ? dataModel[t].length > 0 : !!dataModel[t]) ||
               (t === 'group' && (isAdmin.value || isChief.value || isExpert.value || isLeader.value))

+ 3 - 0
src/modules/admin-exam/edit-exam/index.vue

@@ -44,6 +44,7 @@ const initModel: ExtractApiParams<'saveExamInfo'> = {
   enable: true,
   rejectReason: true,
   // scoreEffective: 'FINAL_MARK',
+  markSite: '',
 }
 
 const model = reactive<ExtractApiParams<'saveExamInfo'>>(initModel)
@@ -71,6 +72,7 @@ const rules: EpFormRules = {
   userNameCollect: [{ required: true, message: '是否收集用户姓名' }],
   // scoreEffective: [{ required: true, message: '分析计算取值方式' }],
   enable: [{ required: true, message: '是否启用考试' }],
+  markSite: [{ required: true, message: '请填写评卷点' }],
 }
 
 const span8 = defineColumn(_, '', { span: 8 })
@@ -101,6 +103,7 @@ const items: EpFormItem[] = [
   span8({ label: '用户姓名收集', slotType: 'select', prop: 'userNameCollect', slot: { options: TrueOrFalse } }),
   // span8({ label: '分析计算取值', slotType: 'select', prop: 'scoreEffective', slot: { options: scoreEffectiveOption } }),
   span8({ label: '状态', slotType: 'select', prop: 'enable', slot: { options: StatusMap } }),
+  span8({ label: '评卷点', slotType: 'input', prop: 'markSite' }),
 ]
 
 /** 编辑模式 */

+ 16 - 0
src/modules/admin-user/bulk-add-user/index.vue

@@ -79,6 +79,7 @@ const rules = computed<EpFormRules>(() => {
       { pattern: /[0-9a-zA-Z~!@#¥%&\*]/, message: '密码限制"数字、字母、~!@#¥%&\*"' },
     ],
     enable: [{ required: true, message: '请选择用户状态' }],
+    stage: [{ required: true, message: '请选择评卷阶段' }],
     markingGroupAccounts: [
       { required: true, message: '请填写分组账号数量' },
       { type: 'number', min: 0, max: 999999, message: '分组账号数量限制0-999999之间' },
@@ -251,6 +252,21 @@ const items = computed<EpFormItem[]>(() => {
         placeholder: '设置用户密码',
       },
     }),
+    span7({
+      rowKey: 'row-8',
+      label: '阶段',
+      slotType: 'select',
+      prop: 'stage',
+      slot: {
+        placeholder: '选择阶段',
+        options: [
+          { label: 'SAMPLE_A', value: 'SAMPLE_A' },
+          { label: 'SAMPLE_B', value: 'SAMPLE_B' },
+          { label: '强制考核卷', value: 'FORCE' },
+          { label: '正评', value: 'FORMAL' },
+        ],
+      },
+    }),
     span7({
       rowKey: 'row-9',
       label: '状态',

+ 16 - 0
src/modules/admin-user/edit-user/index.vue

@@ -54,6 +54,7 @@ const initModel: ExtractApiParams<'saveUserInfo'> = {
   name: '',
   password: '',
   enable: true,
+  stage: '',
 }
 
 const model = reactive<any>(initModel)
@@ -75,6 +76,7 @@ const rules = computed<EpFormRules>(() => {
       { pattern: /[0-9a-zA-Z~!@#¥%&\*]/, message: '密码限制"数字、字母、~!@#¥%&\*"' },
     ],
     enable: [{ required: true, message: '请选择用户状态' }],
+    stage: [{ required: true, message: '请选择评卷阶段' }],
     name: [{ type: 'string', max: 50, message: '用户名称限制50字以内' }],
   }
 })
@@ -224,6 +226,20 @@ const items = computed<EpFormItem[]>(() => {
         placeholder: '设置用户姓名',
       },
     },
+    {
+      label: '阶段',
+      slotType: 'select',
+      prop: 'stage',
+      slot: {
+        placeholder: '选择阶段',
+        options: [
+          { label: 'SAMPLE_A', value: 'SAMPLE_A' },
+          { label: 'SAMPLE_B', value: 'SAMPLE_B' },
+          { label: '强制考核卷', value: 'FORCE' },
+          { label: '正评', value: 'FORMAL' },
+        ],
+      },
+    },
     {
       label: '状态',
       slotType: 'select',

+ 43 - 4
src/modules/marking/inquiry/index.vue

@@ -10,7 +10,7 @@
         <template #form-item-short>
           <div class="flex items-center" style="width: 100%">
             <span style="color: #666; width: 60px; font-size: 12px">快捷方式</span>
-            <base-select
+            <!-- <base-select
               v-model="shortQueryConfigIndex"
               class="flex-1"
               clearable
@@ -18,7 +18,34 @@
               :options="customQueryConfigList?.map((v, i) => ({ label: v.name, value: i }))"
               @clear="fastParamClear"
               @change="fastParamChange"
-            ></base-select>
+            ></base-select> -->
+            <el-select
+              v-model="shortQueryConfigIndex"
+              class="flex-1"
+              clearable
+              value-key="secretNumber"
+              @clear="fastParamClear"
+              @change="fastParamChange"
+            >
+              <el-option v-for="(v, i) in customQueryConfigList" :key="i" :label="v.name" :value="i">
+                <div class="flex items-center justify-between">
+                  <span>{{ v.name }}</span>
+                  <el-popconfirm
+                    width="220"
+                    confirm-button-text="确定"
+                    cancel-button-text="取消"
+                    title="是否删除该快捷方式?"
+                    @confirm="deleteFastQuery(v, i)"
+                  >
+                    <template #reference>
+                      <el-button type="primary" style="height: 26px" size="small" @click.stop="() => {}"
+                        >删除</el-button
+                      >
+                    </template>
+                  </el-popconfirm>
+                </div>
+              </el-option>
+            </el-select>
           </div>
         </template>
       </base-form>
@@ -40,7 +67,7 @@
 /** 阅卷-自定义查询 */
 import { computed, reactive, ref, watch, inject } from 'vue'
 import { useRouter } from 'vue-router'
-import { ElButton, ElInput } from 'element-plus'
+import { ElButton, ElInput, ElSelect, ElOption, ElPopconfirm, ElMessage } from 'element-plus'
 import { omit } from 'lodash-es'
 import { filterEmpty } from '@/utils/common'
 import BaseForm from '@/components/element/BaseForm.vue'
@@ -79,7 +106,7 @@ const model = reactive<FormModel>({
   subjectCode: dataModel.subject,
   mainNumber: dataModel.question,
   markingGroupNumber: dataModel.group,
-  checked: void 0,
+  checked: false,
   arbitration: false,
   markerId: void 0,
   scoreEnd: void 0,
@@ -455,6 +482,18 @@ const onSetCustomQueryConfig = async () => {
     console.error(error)
   }
 }
+const deleteFastQuery = (v: any, i: number) => {
+  console.log(i, shortQueryConfigIndex.value)
+  useFetch('deleteCustomQuery')
+    .fetch({ id: v.id })
+    .then(() => {
+      ElMessage.success('删除成功')
+      if (i == shortQueryConfigIndex.value) {
+        shortQueryConfigIndex.value = void 0
+        getCustomQueryConfigList()
+      }
+    })
+}
 </script>
 
 <style scoped lang="scss">

+ 11 - 10
src/modules/monitor/training-monitoring/index.vue

@@ -126,16 +126,17 @@ const columns = computed<EpTableColumn<TableDataType>[]>(() => {
     {
       type: 'selection',
       selectable(row: any) {
-        let canCheck =
-          (((currentDataType === 'SAMPLE_A' && row.stage === 'SAMPLE_A') ||
-            (currentDataType === 'SAMPLE_B' && row.stage === 'SAMPLE_B')) &&
-            row.needAudit) ||
-          (currentDataType === 'FORCE' &&
-            row.stage === 'FORCE' &&
-            row.needAudit &&
-            !!row.forceGroupMarkerId &&
-            row.forceGroupNumber == curForceGroupNumber)
-        return !!row.markerId && canCheck
+        // let canCheck =
+        //   (((currentDataType === 'SAMPLE_A' && row.stage === 'SAMPLE_A') ||
+        //     (currentDataType === 'SAMPLE_B' && row.stage === 'SAMPLE_B')) &&
+        //     row.needAudit) ||
+        //   (currentDataType === 'FORCE' &&
+        //     row.stage === 'FORCE' &&
+        //     row.needAudit &&
+        //     !!row.forceGroupMarkerId &&
+        //     row.forceGroupNumber == curForceGroupNumber)
+        // return !!row.markerId && canCheck
+        return !!row.markerId && !!row.enableAudit
       },
       width: 60,
       fixed: 'left',