zhangqiOMG 2 years ago
parent
commit
9f56864ea0

+ 4 - 1
src/components/layout/index.vue

@@ -35,7 +35,10 @@ import webSocket from '../webSocket/index.vue'
 import { useRouter } from "vue-router";
 const router = useRouter()
 
-
+// watch(() => router.currentRoute.value,(to, from) => {
+//   rotTabs.saveRoute(to)
+//   store.appData(to.name)
+// })
 </script>
 <style>
 .site-layout-content {

+ 34 - 3
src/components/layout/modules/header.vue

@@ -32,13 +32,44 @@
 </template>
 
 <script setup>
-import {ref} from 'vue'
-import { UserOutlined, DownOutlined,BellOutlined,QuestionCircleOutlined, LogoutOutlined} from '@ant-design/icons-vue';
+import {ref,createVNode} from 'vue'
+import { UserOutlined, DownOutlined,BellOutlined,QuestionCircleOutlined, LogoutOutlined,ExclamationCircleOutlined} from '@ant-design/icons-vue';
 import { useAuthStore } from '@/stores/modules/auth'
 import { storeToRefs } from 'pinia'
+import { Modal } from 'ant-design-vue';
+import { useRouter } from "vue-router";
+const router = useRouter()
+import Api from '@/api/api'
 const store = useAuthStore()
 let { accountList,nowAccount } = storeToRefs(store)
-const accountItemClick= ()=>{}
+const accountItemClick = (account,bool)=>{
+  nowAccount.value = account
+
+  let data = {
+    "classname": "sysmanage.develop.userauthforweb.userauth",
+    "method": "query_userauth",
+    "content": {
+      "place": 1
+    },
+    "systemappid": ""
+  }
+  auth(data)
+  if (!bool)
+   return router.go(0)
+}
+const loginOut = ()=>{
+  Modal.confirm({
+    title: '注意',
+    icon: createVNode(ExclamationCircleOutlined),
+    content: '确定登出当前账号吗?',
+    okText: '确认',
+    cancelText: '取消',
+    onOk () {
+      Api.loginout({})
+      router.push({path:'/'})
+    }
+  });
+}
 </script>
 <style scoped>
 .sw-header{

+ 2 - 2
src/components/layout/modules/historyTabs.vue

@@ -32,9 +32,9 @@ const onChange = (val)=>{
   router.push({name:val})
 }
 watch(() => router.currentRoute.value,(to, from) => {
-  console.log(to, from)
+  console.log(to.meta.name)
   rotTabs.saveRoute(to)
-  store.appData(to.name)
+  store.appData(to.meta.name)
   activeKey.value = to.meta.name
 })
 </script>

+ 1 - 0
src/stores/modules/auth.js

@@ -84,6 +84,7 @@ export const useAuthStore = defineStore('auth', {
         }
       }
       this.app = findApp(this.system,appName)
+      console.log(this.app,'---')
     },
     // 设置默认账号
     defaultAccount (account) {

+ 2 - 4
src/system/moduleNormal/roleManage/detail/index.vue

@@ -32,8 +32,7 @@ const mainAreaData = ref([])
 const roleData = ref({})
 const mianData = async ()=>{
   const res = await Api.requested({
-   "classname": "manager.role.role",
-    "method": "query_roleMain",
+    "id":20230608102202,
     "content": {
       "nocache":true,
       "roleid": router.currentRoute.value.query.id
@@ -88,8 +87,7 @@ const reloadPassword = ()=>{
     content: `确定重置当前账号密码吗?`,
     async onOk() {
       const res = await Api.requested({
-        "classname": "manager.users.users",
-        "method": "resetPassword",
+        "id":20230608104602,
         "content": {
           "userid": router.currentRoute.value.query.id
         }

+ 2 - 3
src/system/moduleNormal/roleManage/detail/modules/addAuth.vue

@@ -10,7 +10,7 @@
       :closable="false"
       @close="onClose"
     >
-      <normalTable rowKey="systemappid" size="small" :filterMultiple="true" :param="{method:'query_appselect',classname:'manager.role.role',content:{pageNumber:1,pageSize:10}}" :columns="utils.TBLayout('AuthAppsTable')" @onSelect="onSelect"></normalTable>
+      <normalTable rowKey="systemappid" size="small" :filterMultiple="true" :param="{id:20230608102402,content:{pageNumber:1,pageSize:10}}" :columns="utils.TBLayout('AuthAppsTable')" @onSelect="onSelect"></normalTable>
 
       <a-button :disabled="optionSelect.length == 0" class="mt-10" type="primary" @click="addOptions">添加选中</a-button>
       <normalTable ref="app" rowKey="optionid" size="small" :filterMultiple="false" :param="appParam" :columns="columns" @onSelect="onSelectOptions" :noQuery="true"></normalTable>
@@ -49,8 +49,7 @@
   }
   const authData = async ()=>{
     const res = await Api.requested({
-      "classname":"manager.role.role",
-      "method":"query_appselect",
+      "id":20230608102402,
       "content":{
         "pageNumber":1,
         "pageSize":10,

+ 3 - 6
src/system/moduleNormal/userManage/detail/index.vue

@@ -34,8 +34,7 @@ const mainAreaData = ref([])
 const userData = ref({})
 const mianData = async ()=>{
   const res = await Api.requested({
-    "classname": "manager.users.users",
-    "method": "query_userMain",
+    "id":20230608104202,
     "content": {
       "nocache":true,
       "userid": router.currentRoute.value.query.id
@@ -72,8 +71,7 @@ const changeUserStatus = (message,isactive)=>{
     content: `确定${message}当前账号吗?`,
     async onOk() {
       const res = await Api.requested({
-        "classname": "manager.users.users",
-        "method": "changeStatus",
+        "id":20230608104502,
         "content": {
           "userid": router.currentRoute.value.query.id,
           "isactive": isactive
@@ -94,8 +92,7 @@ const reloadPassword = ()=>{
     content: `确定重置当前账号密码吗?`,
     async onOk() {
       const res = await Api.requested({
-        "classname": "manager.users.users",
-        "method": "resetPassword",
+        "id":20230608104602,
         "content": {
           "userid": router.currentRoute.value.query.id
         }

+ 1 - 0
src/utils/utils.js

@@ -27,6 +27,7 @@ export default {
     try {
       // 获取应用数据
       const store = useAuthStore()
+      console.log(store)
       let apps = store.app
       // 获取当前应用表格数据
       let tablecols = apps.meta.tables[appname].tablecols.map(e=>{