bzkf30 2 年 前
コミット
1155cb22e1
共有7 個のファイルを変更した81 個の追加19 個の削除を含む
  1. 3 0
      components.d.ts
  2. 5 1
      src/pages/jcxx/xxxx/components/AddAndEdit.vue
  3. 11 2
      src/pages/jcxx/xxxx/index.vue
  4. 23 11
      src/pages/kcgl/ssys/index.vue
  5. 1 1
      src/store/user.ts
  6. 29 0
      src/utils/common-util.js
  7. 9 4
      tsconfig.json

+ 3 - 0
components.d.ts

@@ -9,6 +9,7 @@ declare module '@vue/runtime-core' {
     ElButton: typeof import('element-plus/es')['ElButton']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
+    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
@@ -22,6 +23,8 @@ declare module '@vue/runtime-core' {
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
     ElProgress: typeof import('element-plus/es')['ElProgress']
+    ElRadio: typeof import('element-plus/es')['ElRadio']
+    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']

+ 5 - 1
src/pages/jcxx/xxxx/components/AddAndEdit.vue

@@ -89,7 +89,7 @@ const rules = reactive<FormRules>({
   sm_brief: [{ required: true, message: "请输入学校风采", trigger: "blur" }],
 });
 
-const emit = defineEmits(["update"]);
+const emit = defineEmits(["update", "load"]);
 const submitForm = async (formEl: FormInstance | undefined) => {
   if (!formEl) return;
   await formEl.validate(async (valid, fields) => {
@@ -97,12 +97,14 @@ const submitForm = async (formEl: FormInstance | undefined) => {
       let data = {
         school_main: ruleForm,
       };
+      emit("load", true);
       if (props.current == "") {
         await schoolAdd(data);
       } else {
         data = Object.assign({ id: props.current }, data);
         await schoolEdit(data);
       }
+      emit("load", false);
       ElMessage.success("保存成功!");
       emit("update", 1);
     } else {
@@ -129,11 +131,13 @@ watch(
 );
 
 async function initDetailInfo(id: string) {
+  emit("load", true);
   let data = await schoolDetail({ id });
   let key: keyof typeof ruleForm;
   for (key in ruleForm) {
     ruleForm[key] = data.one_info[key];
   }
+  emit("load", false);
 }
 
 function handleUpdate(data: string) {

+ 11 - 2
src/pages/jcxx/xxxx/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 学校信息(局端) -->
-  <div class="schoolInfo-jd">
+  <div class="schoolInfo-jd" v-loading="loading">
     <div class="searchDiv flex">
       <el-form ref="ruleFormRef" :inline="true" :model="ruleForm" class="demo-form-inline">
         <el-form-item label="学校名称:" prop="keyword">
@@ -61,7 +61,7 @@
     </div>
 
     <el-dialog width="900px" v-model="dialogVisible" :title="dialogTitle" @close="handleClose" custom-class="commonDialog" :show-close="false" :close-on-click-modal="false">
-      <add-and-edit v-if="dialogType==1" :periodData="periodData" :tinymceShow="dialogVisible" :current="currentSchoolId" @update="handleClose"></add-and-edit>
+      <add-and-edit v-if="dialogType==1" :periodData="periodData" :tinymceShow="dialogVisible" :current="currentSchoolId" @update="handleClose" @load="handleLoad"></add-and-edit>
       <detail v-if="dialogType==2" :current="currentSchoolId" @update="handleClose"></detail>
     </el-dialog>
   </div>
@@ -78,6 +78,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import { getFullUrl } from "~/utils/helper";
 import { init } from "echarts";
 
+const loading = ref(false);
 const ruleFormRef = ref<FormInstance>();
 const ruleForm = reactive({
   keyword: "",
@@ -114,9 +115,11 @@ async function initData(flag = "") {
     keyword: ruleForm.keyword,
     sm_period: ruleForm.sm_period,
   };
+  loading.value = true;
   let data = await schoolList(obj);
   total.value = parseInt(data.total_rows);
   tableData.value = data.page_data;
+  loading.value = false;
 
   if (flag == "1") {
     periodData.value = data.table_structure.field.sm_period.option;
@@ -165,6 +168,7 @@ const handleRemove = async (id: string) => {
     buttonSize: "default",
   })
     .then(async () => {
+      loading.value = true;
       if (id != undefined && id != "") {
         await schoolDelete({ id });
       } else {
@@ -175,6 +179,7 @@ const handleRemove = async (id: string) => {
         await schoolDelete({ id: arr });
       }
       ElMessage.success("删除成功!");
+      loading.value = false;
       initData();
     })
     .catch(() => {});
@@ -195,6 +200,10 @@ const handleDownload = () => {
 
   download("/school/main/index", obj);
 };
+
+const handleLoad = (val: boolean) => {
+  loading.value = val;
+};
 </script>
 
 <style lang="scss" scoped>

+ 23 - 11
src/pages/kcgl/ssys/index.vue

@@ -42,25 +42,37 @@
         <div class="flex">
           <el-button size="default" type="success" @click="handleDownload">导出</el-button>
         </div>
-        <!-- <img src="/images/print.png" alt="" /> -->
+        <div>
+          <img src="/images/print.png" alt="" />
+        </div>
       </div>
       <div class="tableList">
         <div class="tableDiv">
           <el-table ref="multipleTableRef" :data="tableData" height="100%" style="width: 100%" @selection-change="handleSelectionChange">
             <el-table-column type="selection" width="55" />
             <el-table-column prop="sm_name" width="200" label="学校" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="sm_name" width="200" label="课程名称" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="sm_name" width="" label="年级" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="ks_name" width="200" label="课程名称" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="grade_name" width="" label="年级" show-overflow-tooltip></el-table-column>
             <el-table-column prop="sm_name" width="" label="班级" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="sm_name" width="" label="学科" show-overflow-tooltip></el-table-column>
+            <el-table-column prop="subject_name" width="" label="学科" show-overflow-tooltip></el-table-column>
             <el-table-column prop="sm_name" width="" label="学生数" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="sm_name" width="" label="创建人" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="sm_name" width="" label="时间" show-overflow-tooltip></el-table-column>
-            <el-table-column label="操作" width="80">
+            <el-table-column prop="ks_zjjsxm" width="" label="创建人" show-overflow-tooltip></el-table-column>
+            <el-table-column width="180" label="时间" show-overflow-tooltip>
+              <template #default="scope">
+                {{dealWithDateTime(scope.row.create_dateline * 1000)}}
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="80" v-if="activeTab==1">
               <template #default="scope">
                 <el-button text size="default" type="primary" @click="handleAudit(scope.row.id)">审核</el-button>
               </template>
             </el-table-column>
+            <el-table-column label="状态" width="80" v-else>
+              <template #default="scope">
+                <span v-if="activeTab==2" style="color: #26D48A;">已通过</span>
+                <span v-if="activeTab==3" style="color: #FF0000;">未通过</span>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
         <div class="paginationDiv">
@@ -78,6 +90,7 @@
 <script setup >
 import { reactive, ref, onMounted } from "vue";
 import { download } from "~/utils/request";
+import { dealWithDateTime } from "~/utils/common-util.js"
 import { gradeList, subjectList, ssyskcList } from "./api.js";
 import detail from "./detail.vue";
 
@@ -140,10 +153,9 @@ async function initData() {
     keyword: ruleForm.keyword,
     ks_status: activeTab.value,
   };
-  // let data = await ssyskcList(obj);
-  // total.value = parseInt(data.total_rows);
-  // tableData.value = data.page_data;
-  tableData.value = [{}, {}]
+  let data = await ssyskcList(obj);
+  total.value = parseInt(data.total_rows);
+  tableData.value = data.page_data;
 }
 
 const dialogVisible = ref(false);

+ 1 - 1
src/store/user.ts

@@ -49,7 +49,7 @@ export const user = // JSON.parse(localStorage.getItem('userInfo') as string)
         "user_class_num": "0",
         "last_token": "",
         "last_login": null,
-        "token": "598eDb_aHcLO5hD1yFXK1rQvoAC99D8vGX1D3GA9w_aS5WAs0P6HkymJ5dw6bsucJBCmOLbPrgp_b9Jg72Biq982NE4FEs9N28",
+        "token": "13fanZkoe1DvUk_acIlY_bGO0oOTf_aVnyPBx74X9SzZQk52gwnyVPojK3bDERZ9kBNRU5X0eM_b06Djmrgeru76I_aZM1k6JRwc",
         "setting": {
             "sitename": "站点名称",
             "sitedomain": "http://localhost/",

+ 29 - 0
src/utils/common-util.js

@@ -0,0 +1,29 @@
+export function dealWithDateTime(_param) {
+  if (_param === '' || _param === null || _param === undefined) {
+    return '';
+  }
+  let date = new Date(_param);
+  let year = date.getFullYear();
+  let month = date.getMonth();
+  month = month + 1;
+  if (month < 10) {
+    month = '0' + month;
+  }
+  let day = date.getDate();
+  if (day < 10) {
+    day = '0' + day;
+  }
+  let hour = date.getHours();
+  if (hour < 10) {
+    hour = '0' + hour;
+  }
+  let minute = date.getMinutes();
+  if (minute < 10) {
+    minute = '0' + minute;
+  }
+  let second = date.getSeconds();
+  if (second < 10) {
+    second = '0' + second;
+  }
+  return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
+}

+ 9 - 4
tsconfig.json

@@ -18,8 +18,12 @@
     "declaration": false,
     "baseUrl": "./",
     "paths": {
-      "~/*":["src/*"],
-      "~/utils/*":["src/utils/*"],
+      "~/*": [
+        "src/*"
+      ],
+      "~/utils/*": [
+        "src/utils/*"
+      ],
     },
     "allowJs": true
   },
@@ -27,11 +31,12 @@
     "src/**/*.ts",
     "src/**/*.d.ts",
     "src/**/*.tsx",
-    "src/**/*.vue"
+    "src/**/*.vue",
+    "src/utils/common-util.js"
   ],
   "references": [
     {
       "path": "./tsconfig.node.json"
     }
   ]
-}
+}