瀏覽代碼

添加功能

lex-xin 6 月之前
父節點
當前提交
dcf8f49b0c

+ 2 - 2
dev-dist/sw.js

@@ -67,7 +67,7 @@ if (!self.define) {
     });
   };
 }
-define(['./workbox-bb0550c6'], (function (workbox) { 'use strict';
+define(['./workbox-88bf3160'], (function (workbox) { 'use strict';
 
   self.skipWaiting();
   workbox.clientsClaim();
@@ -82,7 +82,7 @@ define(['./workbox-bb0550c6'], (function (workbox) { 'use strict';
     "revision": "3ca0b8505b4bec776b69afdba2768812"
   }, {
     "url": "index.html",
-    "revision": "0.dc551p1sjbg"
+    "revision": "0.edsfn33bd8"
   }], {});
   workbox.cleanupOutdatedCaches();
   workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

+ 1 - 1
public/version.json

@@ -1 +1 @@
-{"version":1724872791500}
+{"version":1725954844986}

+ 16 - 0
src/components/CDatePicker/index.tsx

@@ -17,6 +17,19 @@ export default defineComponent({
     timerValue: {
       type: Array,
       default: [] as any
+    },
+    // 
+    placeholder: {
+      type: String,
+      default: '选择日期时间'
+    },
+    startPlaceholder: {
+      type: String,
+      default: '结束日期时间'
+    },
+    endPlaceholder: {
+      type: String,
+      default: '开始日期时间'
     }
   },
   setup(props, { emit, attrs }) {
@@ -48,6 +61,9 @@ export default defineComponent({
             separator={props.separator}
             type={props.type as any}
             onUpdate:value={updateTimer}
+            placeholder={props.placeholder}
+            startPlaceholder={props.startPlaceholder}
+            endPlaceholder={props.endPlaceholder}
             onFocus={() => {
               isFocus.value = true;
             }}

+ 5 - 0
src/utils/searchArray.ts

@@ -22,3 +22,8 @@ export const resourceTypeArray = getValueForKey(constant.resourceType);
 
 // 训练状态
 export const trainingStatusArray = getValueForKey(constant.trainingStatus);
+/**
+ * @description: 评测难度
+ * 入门:BEGINNER/进阶:ADVANCED/大师:PERFORMER")
+ */
+export const evaluateDifficultArray = getValueForKey(constant.evaluateDifficult)

+ 13 - 1
src/views/setting/components/schoolInfo/index.tsx

@@ -144,6 +144,7 @@ export default defineComponent({
               <NButton
                 type="primary"
                 text
+                disabled={btnStatus(row)}
                 onClick={() => {
                   data.resetMessage = `重置"${row.nickname}"的密码,是否继续?`;
                   data.resetVisiable = true;
@@ -156,7 +157,7 @@ export default defineComponent({
               {row.status === 'ACTIVATION' ? (
                 <>
                   <NButton
-                    disabled={row.id === user.info.id}
+                    disabled={row.id === user.info.id || btnStatus(row)}
                     type="primary"
                     text
                     onClick={() => handleChange(row)}>
@@ -182,11 +183,22 @@ export default defineComponent({
                   解冻
                 </NButton>
               )}
+
             </NSpace>
           )
         }
       ];
     };
+
+
+    const btnStatus = (row: any) => {
+      // 管理员
+      if(user.info.teacherJobType === "ADMIN" && ["ADMIN", "HEADMASTER"].includes(row.jobType)) {
+        return true
+      }
+      return false
+    }
+
     const getAreaList = async () => {
       const res = await api_sysAreaQueryAllProvince();
       if (res?.code === 200) {

+ 118 - 5
src/views/studentList/components/evaluationRecords.tsx

@@ -5,6 +5,9 @@ import {
   NDataTable,
   NForm,
   NFormItem,
+  NInput,
+  NInputGroup,
+  NInputNumber,
   NModal,
   NNumberAnimation,
   NSpace,
@@ -25,6 +28,9 @@ import TheEmpty from '/src/components/TheEmpty';
 import { initCache, setCache } from '/src/hooks/use-async';
 import { iframeDislableKeyboard } from '/src/utils';
 import { modalClickMask } from '/src/state';
+// import SearchInput from '/src/components/searchInput';
+import CSelect from '/src/components/CSelect';
+import { evaluateDifficultArray } from '/src/utils/searchArray';
 export default defineComponent({
   name: 'student-practiceData',
   props: {
@@ -40,8 +46,8 @@ export default defineComponent({
   setup(props) {
     const userStore = useUserStore();
     const chartRef = ref<HTMLDivElement | null>(null);
-    const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
-    const practiceFlag = ref(true);
+    // const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);
+    // const practiceFlag = ref(true);
     const payForm = reactive({
       height: '360px',
       width: '100%',
@@ -60,6 +66,14 @@ export default defineComponent({
         rows: 10,
         pageTotal: 4
       },
+      searchForm: {
+        musicSheetName: '',
+        heardLevel: null, //
+        userMusicFlag: null, // 是否生成作品
+        minScore: null,
+        maxScore: null,
+        musicStartTime: []
+      },
       tableList: [] as any,
       goCourseVisiable: false
     });
@@ -130,6 +144,20 @@ export default defineComponent({
           }
         },
         {
+          title: '生成作品',
+          key: 'integrity',
+          render(row: any) {
+            return <span>{row.userMusicFlag ? '是' : '否'}</span>;
+          }
+        },
+        {
+          title: '生成时间',
+          key: 'userMusicTime',
+          render(row: any) {
+            return <span>{row.userMusicTime || '--'}</span>;
+          }
+        },
+        {
           title: '操作',
           key: 'id',
           render(row: any) {
@@ -148,9 +176,16 @@ export default defineComponent({
       ];
     };
     const getList = async () => {
+      const { musicStartTime, ...temp } = state.searchForm;
       const res = await getPracticeRecordList({
         userId: props.studentId,
         ...state.pagination,
+        ...temp,
+        ...getTimes(
+          musicStartTime,
+          ['userMusicStartTime', 'userMusicEndTime'],
+          'YYYY-MM-DD'
+        ),
         classGroupId: props.classGroupId,
         feature: 'EVALUATION',
         ...getTimes(timer.value, ['startTime', 'endTime'], 'YYYY-MM-DD')
@@ -159,7 +194,6 @@ export default defineComponent({
       state.pagination.pageTotal = res.data.total;
     };
     const gotoRecode = (row: any) => {
-      console.log(row.id, 'gotoRecode');
       const tockn = userStore.getToken;
       reportSrc.value =
         vaildMusicScoreUrl() +
@@ -181,6 +215,14 @@ export default defineComponent({
         getNowDateAndMonday(new Date().getTime()),
         getNowDateAndSunday(new Date().getTime())
       ];
+      state.searchForm = {
+        musicSheetName: '',
+        heardLevel: null, //
+        userMusicFlag: null, // 是否生成作品
+        minScore: null,
+        maxScore: null,
+        musicStartTime: []
+      };
       search();
       setCache({
         current: { timer: timer.value },
@@ -197,18 +239,89 @@ export default defineComponent({
     const iframeRef = ref();
     onMounted(() => {
       getList();
-      console.log(props.studentId);
     });
     return () => (
       <>
-        <NForm label-placement="left" inline>
+        <NForm label-placement="left" inline style="flex-wrap: wrap;">
           <NFormItem>
             <CDatePicker
               v-model:value={timer.value}
               separator={'至'}
               type="daterange"
+              class={styles.datePicker}
+              startPlaceholder="评测开始时间"
+              endPlaceholder="评测结束时间"
               timerValue={timer.value}></CDatePicker>
           </NFormItem>
+          <NFormItem>
+            <NInput
+              placeholder="请输入曲目名称"
+              v-model:value={state.searchForm.musicSheetName}
+            />
+            {/* v-model:value={state.searchForm.keyword} */}
+            {/* <SearchInput
+              {...{ placeholder: '请输入曲目名称' }}
+              class={styles.searchInput}
+              style={{ width: '160px' }}
+              // searchWord={state.searchForm.keyword}
+              // onChangeValue={(val: string) =>
+              //   (state.searchForm.keyword = val)
+              // }
+            ></SearchInput> */}
+          </NFormItem>
+
+          <NFormItem>
+            <CSelect
+              {...({
+                options: evaluateDifficultArray,
+                placeholder: '请输入评测难度',
+                clearable: true,
+                inline: true
+              } as any)}
+              v-model:value={state.searchForm.heardLevel}></CSelect>
+          </NFormItem>
+          <NFormItem>
+            <div class={styles.inputRangeSection}>
+              <NInputNumber
+                placeholder="最小分值"
+                min={0}
+                max={state.searchForm.maxScore || 100}
+                showButton={false}
+                v-model:value={state.searchForm.minScore}></NInputNumber>
+              <span class={styles.pair}>-</span>
+              <NInputNumber
+                placeholder="最大分值"
+                min={state.searchForm.minScore || 0}
+                max={100}
+                showButton={false}
+                v-model:value={state.searchForm.maxScore}></NInputNumber>
+            </div>
+          </NFormItem>
+
+          <NFormItem>
+            <CSelect
+              {...({
+                options: [
+                  { label: '是', value: true },
+                  { label: '否', value: false }
+                ],
+                placeholder: '请选择是否生成作品',
+                clearable: true,
+                inline: true
+              } as any)}
+              v-model:value={state.searchForm.userMusicFlag}></CSelect>
+          </NFormItem>
+
+          <NFormItem>
+            <CDatePicker
+              v-model:value={state.searchForm.musicStartTime}
+              separator={'至'}
+              class={styles.datePicker}
+              type="daterange"
+              startPlaceholder="生成开始时间"
+              endPlaceholder="生成结束时间"
+              timerValue={state.searchForm.musicStartTime}></CDatePicker>
+          </NFormItem>
 
           <NFormItem>
             <NSpace justify="end">

+ 26 - 0
src/views/studentList/index.module.less

@@ -12,6 +12,32 @@
   }
 }
 
+.datePicker {
+  :global {
+    .n-input {
+      width: 290px !important;
+    }
+  }
+}
+
+.inputRangeSection {
+  display: flex;
+  align-items: center;
+
+  .pair {
+    font-size: max(15px, 13Px);
+    color: rgba(0, 0, 0, 0.4);
+    line-height: 21px;
+    padding: 0 6px;
+  }
+
+  :global {
+    .n-input-number {
+      width: 92px;
+    }
+  }
+}
+
 .infoListWrap {
   min-height: calc(100vh - 150px) !important
 }

+ 1 - 1
vite.config.ts

@@ -23,7 +23,7 @@ function resolve(dir: string) {
 }
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
-const proxyUrl = 'https://test.kt.colexiu.com/';
+const proxyUrl = 'https://dev.kt.colexiu.com/';
 // const proxyUrl = 'https://test.kt.colexiu.com';
 // const proxyUrl = 'http://192.168.3.14:7989';
 const now = new Date().getTime();