Bladeren bron

审核角色数据接口

lrf 8 maanden geleden
bovenliggende
commit
1a336106c4

+ 8 - 0
src/lang/package/zh-cn/pages.js

@@ -701,5 +701,13 @@ export default {
     yearInfoStatusTitle: '年度信息审核',
     tabsBasic: '基本信息',
     tabsSec: '年度信息'
+  },
+  systemFunc: {
+    initES: '初始化ES',
+    cid: '修正导入数据',
+    ism: '初始化后台目录',
+    ium: '初始化用户目录',
+    ir: '初始化角色数据',
+    irm: '初始化角色菜单'
   }
 }

+ 40 - 0
src/store/api/systemFunc.js

@@ -0,0 +1,40 @@
+import { defineStore } from 'pinia'
+import { AxiosWrapper } from '@/utils/axios-wrapper'
+const url = '/system/func'
+const axios = new AxiosWrapper()
+
+export const SystemFuncStore = defineStore('systemFunc', () => {
+  const initES = async (payload) => {
+    const res = await axios.$get(`${url}/initES}`)
+    return res
+  }
+  const correctImportData = async () => {
+    const res = await axios.$get(`${url}/cid}`)
+    return res
+  }
+  const initSystemMenus = async () => {
+    const res = await axios.$get(`${url}/ism}`)
+    return res
+  }
+  const initUserMenus = async () => {
+    const res = await axios.$get(`${url}/ium}`)
+    return res
+  }
+  const initRoleData = async () => {
+    const res = await axios.$get(`${url}/ir}`)
+    return res
+  }
+  const initRoleMenus = async () => {
+    const res = await axios.$get(`${url}/irm}`)
+    return res
+  }
+
+  return {
+    initES,
+    correctImportData,
+    initSystemMenus,
+    initUserMenus,
+    initRoleData,
+    initRoleMenus
+  }
+})

+ 8 - 1
src/store/api/user/association.js

@@ -30,11 +30,18 @@ export const AssociationStore = defineStore('association', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 8 - 1
src/store/api/user/company.js

@@ -30,11 +30,18 @@ export const CompanyStore = defineStore('company', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 8 - 1
src/store/api/user/competition.js

@@ -30,11 +30,18 @@ export const CompetitionStore = defineStore('competition', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 8 - 1
src/store/api/user/expert.js

@@ -30,11 +30,18 @@ export const ExpertStore = defineStore('expert', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 8 - 1
src/store/api/user/incubator.js

@@ -30,11 +30,18 @@ export const IncubatorStore = defineStore('incubator', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 8 - 1
src/store/api/user/investment.js

@@ -30,11 +30,18 @@ export const InvestmentStore = defineStore('investment', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 8 - 1
src/store/api/user/school.js

@@ -30,11 +30,18 @@ export const SchoolStore = defineStore('school', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 8 - 1
src/store/api/user/state.js

@@ -30,11 +30,18 @@ export const StateStore = defineStore('state', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 8 - 1
src/store/api/user/unit.js

@@ -30,11 +30,18 @@ export const UnitStore = defineStore('unit', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const examine = async (payload) => {
+    const id = get(payload, 'id')
+    const status = get(payload, 'status')
+    const res = await axios.$post(`${url}/examine`, { id, status })
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
-    del
+    del,
+    examine
   }
 })

+ 1 - 1
src/store/api/user/user.js

@@ -44,6 +44,6 @@ export const UserStore = defineStore('users', () => {
     fetch,
     create,
     update,
-    del
+    del,
   }
 })

+ 0 - 1
src/views/home/index.vue

@@ -2,7 +2,6 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <!-- TODO: 修改成卡片式入口 -->
         <admin v-if="hasView('admin')"></admin>
       </el-col>
     </el-row>

+ 1 - 2
src/views/information/parts/role/association.vue

@@ -120,9 +120,8 @@ const statusFields = ref([
   { label: t('pages.association.brief'), model: 'brief', span: 3 }
 ])
 const exam = async (status) => {
-  // TODO: 单独审核接口
   const data = { id: get(form, 'value.id'), status }
-  const res = await store.update(data)
+  const res = await store.examine(data)
   if ($checkRes(res, true)) {
     search({ skip, limit })
     toClose()

+ 2 - 2
src/views/information/parts/role/company.vue

@@ -138,9 +138,9 @@ const statusFields = ref([
   { label: t('pages.company.brief'), model: 'brief', span: 3 }
 ])
 const exam = async (status) => {
-  // TODO: 单独审核接口
+  // 单独审核接口
   const data = { id: get(form, 'value.id'), status }
-  const res = await store.update(data)
+  const res = await store.examine(data)
   if ($checkRes(res, true)) {
     search({ skip, limit })
     toClose()

+ 2 - 2
src/views/information/parts/role/expert.vue

@@ -126,9 +126,9 @@ const statusFields = ref([
   { label: t('pages.expert.brief'), model: 'brief', span: 3 }
 ])
 const exam = async (status) => {
-  // TODO: 单独审核接口
+  // 单独审核接口
   const data = { id: get(form, 'value.id'), status }
-  const res = await store.update(data)
+  const res = await store.examine(data)
   if ($checkRes(res, true)) {
     search({ skip, limit })
     toClose()

+ 2 - 2
src/views/information/parts/role/incubator.vue

@@ -139,9 +139,9 @@ const statusFields = ref([
   { label: t('pages.incubator.brief'), model: 'brief', span: 3, type: 'editor' }
 ])
 const exam = async (status) => {
-  // TODO: 单独审核接口
+  // 单独审核接口
   const data = { id: get(form, 'value.id'), status }
-  const res = await store.update(data)
+  const res = await store.examine(data)
   if ($checkRes(res, true)) {
     search({ skip, limit })
     toClose()

+ 2 - 2
src/views/information/parts/role/investment.vue

@@ -133,9 +133,9 @@ const statusFields = ref([
   { label: t('pages.investment.brief'), model: 'brief', span: 3 }
 ])
 const exam = async (status) => {
-  // TODO: 单独审核接口
+  // 单独审核接口
   const data = { id: get(form, 'value.id'), status }
-  const res = await store.update(data)
+  const res = await store.examine(data)
   if ($checkRes(res, true)) {
     search({ skip, limit })
     toClose()

+ 2 - 2
src/views/information/parts/role/school.vue

@@ -119,9 +119,9 @@ const statusFields = ref([
   { label: t('pages.school.brief'), model: 'brief', span: 3 }
 ])
 const exam = async (status) => {
-  // TODO: 单独审核接口
+  // 单独审核接口
   const data = { id: get(form, 'value.id'), status }
-  const res = await store.update(data)
+  const res = await store.examine(data)
   if ($checkRes(res, true)) {
     search({ skip, limit })
     toClose()

+ 2 - 2
src/views/information/parts/role/state.vue

@@ -119,9 +119,9 @@ const statusFields = ref([
   { label: t('pages.state.brief'), model: 'brief', span: 3 }
 ])
 const exam = async (status) => {
-  // TODO: 单独审核接口
+  // 单独审核接口
   const data = { id: get(form, 'value.id'), status }
-  const res = await store.update(data)
+  const res = await store.examine(data)
   if ($checkRes(res, true)) {
     search({ skip, limit })
     toClose()

+ 2 - 2
src/views/information/parts/role/unit.vue

@@ -120,9 +120,9 @@ const statusFields = ref([
   { label: t('pages.unit.brief'), model: 'brief', span: 3 }
 ])
 const exam = async (status) => {
-  // TODO: 单独审核接口
+  // 单独审核接口
   const data = { id: get(form, 'value.id'), status }
-  const res = await store.update(data)
+  const res = await store.examine(data)
   if ($checkRes(res, true)) {
     search({ skip, limit })
     toClose()

+ 2 - 1
src/views/system/index.vue

@@ -22,7 +22,8 @@ const componentList = ref({
   'admin-menus': defineAsyncComponent(() => import('./parts/admin-menus.vue')),
   'user-menus': defineAsyncComponent(() => import('./parts/user-menus.vue')),
   dict: defineAsyncComponent(() => import('./parts/dict.vue')),
-  region: defineAsyncComponent(() => import('./parts/region.vue'))
+  region: defineAsyncComponent(() => import('./parts/region.vue')),
+  'system-func': defineAsyncComponent(() => import('./parts/system-func.vue')),
 })
 const value = ref()
 const viewComponent = ref()

+ 2 - 2
src/views/system/parts/admin-menus/parts/info.vue

@@ -30,9 +30,9 @@
       <el-form-item :label="$t('pages.menus.path')">
         <el-input v-model="form.path" :placeholder="$t('pages.menus.pathPh')"></el-input>
       </el-form-item>
-      <!-- <el-form-item :label="$t('pages.menus.component')">
+      <el-form-item :label="$t('pages.menus.component')">
         <el-input v-model="form.component" :placeholder="$t('pages.menus.componentPh')"></el-input>
-      </el-form-item> -->
+      </el-form-item>
     </template>
     <el-form-item :label="$t('pages.menus.order_num')">
       <el-input-number v-model="form.order_num"></el-input-number>

+ 55 - 0
src/views/system/parts/system-func.vue

@@ -0,0 +1,55 @@
+<template>
+  <el-row style="text-align: center">
+    <el-col :span="4">
+      <el-button type="primary" @click="toMethod('initES')">{{ $t('pages.systemFunc.initES') }}</el-button>
+    </el-col>
+    <el-col :span="4">
+      <el-button type="primary" @click="toMethod('cid')">{{ $t('pages.systemFunc.cid') }}</el-button>
+    </el-col>
+    <el-col :span="4">
+      <el-button type="primary" @click="toMethod('ism')">{{ $t('pages.systemFunc.ism') }}</el-button>
+    </el-col>
+    <el-col :span="4">
+      <el-button type="primary" @click="toMethod('ium')">{{ $t('pages.systemFunc.ium') }}</el-button>
+    </el-col>
+    <el-col :span="4">
+      <el-button type="primary" @click="toMethod('ir')">{{ $t('pages.systemFunc.ir') }}</el-button>
+    </el-col>
+    <el-col :span="4">
+      <el-button type="primary" @click="toMethod('irm')">{{ $t('pages.systemFunc.irm') }}</el-button>
+    </el-col>
+  </el-row>
+</template>
+
+<script setup>
+import { SystemFuncStore } from '@/store/api/systemFunc'
+const $checkRes = inject('$checkRes')
+const store = SystemFuncStore()
+const toMethod = async (method) => {
+  let res
+  switch (method) {
+    case 'initES':
+      res = await store.initES()
+      break
+    case 'cid':
+      res = await store.correctImportData()
+      break
+    case 'ism':
+      res = await store.initSystemMenus()
+      break
+    case 'ium':
+      res = await store.initUserMenus()
+      break
+    case 'ir':
+      res = await store.initRoleData()
+      break
+    case 'irm':
+      res = await store.initRoleMenus()
+      break
+    default:
+      break
+  }
+  $checkRes(res)
+}
+</script>
+<style scoped></style>