dusenyao 3 rokov pred
rodič
commit
346c54babb

+ 4 - 4
babel.config.js

@@ -1,9 +1,9 @@
 module.exports = {
-  presets: ["@vue/cli-plugin-babel/preset"],
+  presets: ['@vue/cli-plugin-babel/preset'],
   env: {
     development: {
       // 解决Vue热加载编译速度慢问题
-      plugins: ["dynamic-import-node"],
-    },
-  },
+      plugins: ['dynamic-import-node']
+    }
+  }
 };

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 329 - 193
package-lock.json


+ 13 - 13
package.json

@@ -3,15 +3,15 @@
   "version": "0.1.0",
   "private": true,
   "scripts": {
-    "serve": "vue-cli-service serve",
+    "dev": "vue-cli-service serve",
     "build": "vue-cli-service build",
     "test:unit": "vue-cli-service test:unit",
     "lint": "eslint --ext .js,.vue src",
     "lint:css": "stylelint **/*.{html,vue,css,sass,scss,less}"
   },
   "dependencies": {
-    "axios": "^0.24.0",
-    "core-js": "^3.20.3",
+    "axios": "^0.26.0",
+    "core-js": "^3.21.0",
     "element-ui": "^2.15.6",
     "js-cookie": "^3.0.1",
     "normalize.css": "^8.0.1",
@@ -21,9 +21,9 @@
     "vuex": "^3.6.2"
   },
   "devDependencies": {
-    "@babel/core": "^7.16.7",
-    "@babel/eslint-parser": "^7.16.5",
-    "@babel/preset-env": "^7.16.8",
+    "@babel/core": "^7.17.2",
+    "@babel/eslint-parser": "^7.17.0",
+    "@babel/preset-env": "^7.16.11",
     "@rushstack/eslint-patch": "^1.1.0",
     "@vue/cli-plugin-babel": "~4.5.15",
     "@vue/cli-plugin-eslint": "~4.5.15",
@@ -33,23 +33,23 @@
     "@vue/cli-service": "~4.5.15",
     "@vue/eslint-config-prettier": "^7.0.0",
     "@vue/test-utils": "^1.3.0",
-    "babel-jest": "^27.4.6",
+    "babel-jest": "^27.5.1",
     "babel-loader": "^8.2.3",
     "babel-plugin-dynamic-import-node": "^2.3.3",
     "eslint": "^7.32.0",
     "eslint-plugin-prettier": "^4.0.0",
-    "eslint-plugin-vue": "^8.3.0",
+    "eslint-plugin-vue": "^8.4.1",
     "html-webpack-plugin": "^5.3.1",
-    "postcss": "^8.4.5",
+    "postcss": "^8.4.6",
     "postcss-html": "^1.3.0",
     "prettier": "2.5.1",
-    "sass": "^1.48.0",
-    "sass-loader": "^10.2.0",
+    "sass": "^1.49.7",
+    "sass-loader": "^10.2.1",
     "script-ext-html-webpack-plugin": "^2.1.5",
-    "stylelint": "^14.0.1",
+    "stylelint": "14.4.0",
     "stylelint-config-prettier": "^9.0.3",
     "stylelint-config-recess-order": "^3.0.0",
-    "stylelint-config-recommended-vue": "^1.1.0",
+    "stylelint-config-recommended-vue": "^1.3.0",
     "stylelint-config-sass-guidelines": "^9.0.1",
     "stylelint-config-standard-scss": "^3.0.0",
     "stylelint-declaration-block-no-ignored-properties": "^2.5.0",

+ 15 - 0
src/api/list.js

@@ -59,3 +59,18 @@ export function PageQueryOrgStudentUserList(data) {
     data
   });
 }
+
+/**
+ * 分页查询机构配额列表
+ * @param { Object } data
+ */
+export function PageQueryOrgQuotaList(data) {
+  let params = getRequestParameter('live_quota_manager-PageQueryOrgQuotaList');
+
+  return request({
+    method: 'post',
+    url: process.env.VUE_APP_FileServer,
+    params,
+    data
+  });
+}

+ 5 - 0
src/layouts/components/LayoutHeader.vue

@@ -95,6 +95,11 @@ export default {
           path: '/settings/index/LiveRoomConfig',
           name: '系统配置',
           isShow: is_inner
+        },
+        {
+          path: '/quota',
+          name: '配额管理',
+          isShow: is_inner
         }
       ];
 

+ 16 - 0
src/router/index.js

@@ -192,6 +192,22 @@ const routes = [
     ]
   },
   {
+    path: '/quota',
+    component: Layout,
+    meta: { title: '配额管理' },
+    redirect: '/quota/index',
+    children: [
+      {
+        path: 'index',
+        component: () => import('@/views/quota')
+      },
+      {
+        path: 'usageRecord',
+        component: () => import('@/views/quota/UsageRecord.vue')
+      }
+    ]
+  },
+  {
     path: '*',
     redirect: '/404'
   }

+ 21 - 0
src/views/quota/UsageRecord.vue

@@ -0,0 +1,21 @@
+<template>
+  <div class="usage-record"></div>
+</template>
+
+<script>
+export default {
+  name: 'UsageRecord',
+  data() {
+    return {};
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+@import '~@/styles/mixin';
+
+.usage-record {
+  @include container;
+  @include pagination;
+}
+</style>

+ 88 - 0
src/views/quota/index.vue

@@ -0,0 +1,88 @@
+<template>
+  <div class="quota">
+    <div class="quota-list">
+      <el-table :data="data_list">
+        <el-table-column prop="org_name" label="机构" width="500" />
+        <el-table-column prop="quota_lave" label="剩余配额" width="160" />
+        <el-table-column prop="quota_used" label="累计已用" width="160" />
+        <el-table-column prop="quota_status" label="状态" width="160" />
+        <el-table-column label="操作">
+          <template slot-scope="{ row }">
+            <span>设置配额</span>
+            <span>{{ row.quota_status ? '停用' : '启用' }}</span>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <el-pagination
+      background
+      :page-sizes="[10, 20, 30, 40, 50]"
+      :page-size="page_capacity"
+      layout="prev, pager, next, total, sizes, jumper"
+      :total="total_count"
+      :current-page="cur_page"
+      @prev-click="changePage"
+      @next-click="changePage"
+      @current-change="changePage"
+      @size-change="changePageSize"
+    />
+  </div>
+</template>
+
+<script>
+import { PageQueryOrgQuotaList } from '@/api/list';
+
+export default {
+  name: 'QuotaList',
+  data() {
+    return {
+      data_list: [],
+      page_capacity: 10,
+      total_count: 0,
+      cur_page: 1
+    };
+  },
+  created() {
+    this.pageQueryOrgQuotaList();
+  },
+  methods: {
+    pageQueryOrgQuotaList() {
+      PageQueryOrgQuotaList({}).then(({ data_list, total_count, cur_page }) => {
+        this.data_list = data_list;
+        this.total_count = total_count;
+        this.cur_page = cur_page;
+      });
+    },
+    changePage(newPage) {
+      this.cur_page = newPage;
+      this.pageQueryOrgQuotaList();
+    },
+    changePageSize(pageSize) {
+      this.page_capacity = pageSize;
+      this.pageQueryOrgQuotaList();
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+@import '~@/styles/mixin';
+
+.quota {
+  @include container;
+  @include pagination;
+
+  padding: 24px 0 46px;
+
+  &-list {
+    @include list;
+
+    padding: 0 32px;
+
+    ::v-deep .el-table th.el-table__cell {
+      color: #000;
+    }
+  }
+}
+</style>

+ 2 - 2
stylelint.config.js

@@ -2,10 +2,10 @@ module.exports = {
   defaultSeverity: 'warning',
   extends: [
     'stylelint-config-standard-scss',
-    'stylelint-config-recommended-vue',
     'stylelint-config-sass-guidelines',
     'stylelint-config-recess-order',
-    'stylelint-config-prettier'
+    'stylelint-config-prettier',
+    'stylelint-config-recommended-vue'
   ],
   plugins: ['stylelint-declaration-block-no-ignored-properties'],
   rules: {

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov