zhaobao пре 3 година
родитељ
комит
5ad17aad00

+ 20 - 29
src/components/GroupCatSelector/index.vue

@@ -1,46 +1,37 @@
-<script lang="ts" setup name="FileUpload">
+<script lang="ts" setup name="GroupCatSelector">
 import { getGroupCatByList } from '@/api/system/groupCatApi'
-
-const props = withDefaults(defineProps<{
-  modelValue: number
-}>(), {
-  modelValue: 0,
-  size: 'default',
-})
-
 const emit = defineEmits(['update:modelValue'])
-
-const myValue = ref(0)
-watch(() => props.modelValue, (value) => {
-  myValue.value = value
-}, {
-  immediate: true,
-})
-
+interface Group {
+  groupCatId: number
+  groupCatTitle: number
+}
 const state = reactive({
   loading: false,
-  dataList: [],
+  groupCatId: 0,
+  dataList: [] as Group[],
 })
 
-onMounted(() => {})
-
 const getData = async () => {
   state.loading = true
   const { data } = await getGroupCatByList()
   state.loading = false
   state.dataList = data
 }
+const onChange = () => {
+  emit('update:modelValue', state.groupCatId)
+}
+onMounted(() => {
+  getData ()
+})
 </script>
 
 <template>
-  <el-select v-model="groupCatId" value-key="groupCatId" style="width: 100%" filterable placeholder="请选择部门类别">
-    <el-option-group>
-      <el-option
-        v-for="item in state.dataList"
-        :key="item.groupCatId"
-        :label="item.groupCatTitle"
-        :value="item.groupCatId"
-      />
-    </el-option-group>
+  <el-select v-model="state.groupCatId" v-loading="state.loading" style="width: 100%" filterable placeholder="请选择部门类别" value-key="groupCatId" @change="onChange">
+    <el-option
+      v-for="item in state.dataList"
+      :key="item.groupCatId"
+      :label="item.groupCatTitle"
+      :value="item.groupCatId"
+    />
   </el-select>
 </template>

+ 37 - 0
src/components/GroupSelector/index.vue

@@ -0,0 +1,37 @@
+<script lang="ts" setup name="GroupSelector">
+import { getGroupCatByList } from '@/api/system/groupCatApi'
+const emit = defineEmits(['update:modelValue'])
+interface Group {
+  groupCatId: number
+  groupCatTitle: number
+}
+const state = reactive({
+  loading: false,
+  groupCatId: 0,
+  dataList: [] as Group[],
+})
+
+const getData = async () => {
+  state.loading = true
+  const { data } = await getGroupCatByList()
+  state.loading = false
+  state.dataList = data
+}
+const onChange = () => {
+  emit('update:modelValue', state.groupCatId)
+}
+onMounted(() => {
+  getData ()
+})
+</script>
+
+<template>
+  <el-select v-model="state.groupCatId" v-loading="state.loading" style="width: 100%" filterable placeholder="请选择部门类别" value-key="groupCatId" @change="onChange">
+    <el-option
+      v-for="item in state.dataList"
+      :key="item.groupCatId"
+      :label="item.groupCatTitle"
+      :value="item.groupCatId"
+    />
+  </el-select>
+</template>

+ 37 - 0
src/components/PositionSelector/index.vue

@@ -0,0 +1,37 @@
+<script lang="ts" setup name="PositionSelector">
+import { getGroupCatByList } from '@/api/system/groupCatApi'
+const emit = defineEmits(['update:modelValue'])
+interface Group {
+  groupCatId: number
+  groupCatTitle: number
+}
+const state = reactive({
+  loading: false,
+  groupCatId: 0,
+  dataList: [] as Group[],
+})
+
+const getData = async () => {
+  state.loading = true
+  const { data } = await getGroupCatByList()
+  state.loading = false
+  state.dataList = data
+}
+const onChange = () => {
+  emit('update:modelValue', state.groupCatId)
+}
+onMounted(() => {
+  getData ()
+})
+</script>
+
+<template>
+  <el-select v-model="state.groupCatId" v-loading="state.loading" style="width: 100%" filterable placeholder="请选择部门类别" value-key="groupCatId" @change="onChange">
+    <el-option
+      v-for="item in state.dataList"
+      :key="item.groupCatId"
+      :label="item.groupCatTitle"
+      :value="item.groupCatId"
+    />
+  </el-select>
+</template>

+ 2 - 2
src/settings.ts

@@ -5,9 +5,9 @@ const globalSettings: Settings.all = {
   base: {
     // 服务API地址
     serverUrl: 'http://192.168.1.214:8080', // 正式环境
-    // devServerUrl: 'http://1.15.92.205:8080/', // 开发环境
+    devServerUrl: 'http://1.15.92.205:8080/', // 开发环境
     // devServerUrl: 'http://113.141.88.27:8000', // 开发环境
-    devServerUrl: 'http://127.0.0.1:8000',
+    // devServerUrl: 'http://192.168.3.253:8000',
     /**
      * websocket 地址
      * dev 开发环境

+ 2 - 0
src/types/components.d.ts

@@ -19,6 +19,7 @@ declare module '@vue/runtime-core' {
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     FixedActionBar: typeof import('./../components/FixedActionBar/index.vue')['default']
     GroupCatSelector: typeof import('./../components/GroupCatSelector/index.vue')['default']
+    GroupSelector: typeof import('./../components/GroupSelector/index.vue')['default']
     I18nSelector: typeof import('./../components/I18nSelector/index.vue')['default']
     IconPicker: typeof import('./../components/IconPicker/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
@@ -28,6 +29,7 @@ declare module '@vue/runtime-core' {
     PageHeader: typeof import('./../components/PageHeader/index.vue')['default']
     PageMain: typeof import('./../components/PageMain/index.vue')['default']
     PcasCascader: typeof import('./../components/PcasCascader/index.vue')['default']
+    PositionSelector: typeof import('./../components/PositionSelector/index.vue')['default']
     RouterLink: typeof import('vue-router')['RouterLink']
     RouterView: typeof import('vue-router')['RouterView']
     SearchBar: typeof import('./../components/SearchBar/index.vue')['default']

+ 5 - 4
src/utils/tool.ts

@@ -481,7 +481,7 @@ export function getQuarterEndDate() {
    * id 唯一id
    * parentId 父级id
    * childrenList 子级数组名 */
-export function packageTreeData(params: { data: any; id: any; parentId: any; children: any }) {
+export function packageTreeData(params: { data: any; id?: any; parentId?: any; children?: any }) {
   const treeArr = params && params.data || []
   const id = params && params.id || 'id'
   const parentId = params && params.parentId || 'parentId'
@@ -494,11 +494,11 @@ export function packageTreeData(params: { data: any; id: any; parentId: any; chi
   })
 }
 // 根据根id处理树结构
-export function getNestedChildren(arr: any = [], parent: any = 0) {
+export function getNestedChildren(arr: any = [], parent_id = 'parent_id', id = 'id', parent: any = 0) {
   const res: any[] = []
   for (const item of arr) {
-    if (item.parent_id === parent) {
-      const children = getNestedChildren(arr, item.id)
+    if (item[parent_id] === parent) {
+      const children = getNestedChildren(arr, item[id])
       if (children.length) {
         item.children = children
       }
@@ -507,6 +507,7 @@ export function getNestedChildren(arr: any = [], parent: any = 0) {
   }
   return res
 }
+
 // 风险类型
 export function riskType(val: string | number) {
   const strs = [

+ 0 - 151
src/views/app_center/apps/components/App.vue

@@ -1,151 +0,0 @@
-<route lang="yaml">
-meta:
-  enabled: false
-</route>
-
-<script lang="ts" setup>
-import { ElMessage } from 'element-plus'
-import type { FormInstance, FormRules } from 'element-plus'
-import { createApp, getAppById, updateApp } from '@/api/apps/appApi'
-const emit = defineEmits(['success'])
-
-const formRef = ref<FormInstance>()
-const formRules = ref<FormRules>({
-  appTitle: [{ required: true, message: '请输入appTitle', trigger: 'blur' }],
-  appCatTitle: [{ required: true, message: '请输入appCatTitle', trigger: 'blur' }],
-  appUrl: [{ required: true, message: '请输入appUrl', trigger: 'blur' }],
-  appCode: [{ required: true, message: '请输入app编码', trigger: 'blur' }],
-  appDesc: [{ required: true, message: '请输入描述', trigger: 'blur' }],
-})
-
-const state = reactive({
-  title: '',
-  dialogVisible: false,
-  loading: false,
-  formData: {
-    appId: 0,
-    appCode: '',
-    appTitle: '',
-    appCatTitle: '',
-    appCatId: 0,
-    appUrl: '',
-    appDesc: '',
-    appLogo: '',
-  },
-  actionType: 1,
-})
-
-onMounted(() => {})
-
-const getData = async (appId: number) => {
-  state.loading = true
-  const { data } = await getAppById(appId)
-  state.loading = false
-  state.formData = data
-}
-
-function onSubmit() {
-  formRef.value && formRef.value.validate(async (valid) => {
-    if (valid) {
-      if (state.actionType === 1) {
-        await createApp(state.formData)
-        state.dialogVisible = false
-        emit('success')
-      }
-      else {
-        await updateApp(state.formData)
-        state.dialogVisible = false
-        emit('success')
-      }
-      ElMessage.success({
-        message: '保存成功',
-        center: true,
-      })
-    }
-  })
-}
-
-function onCancel() {
-  state.dialogVisible = false
-}
-
-function resetFormData() {
-  state.formData = {
-    appId: 0,
-    appCode: '',
-    appTitle: '',
-    appCatTitle: '',
-    appCatId: 0,
-    appUrl: '',
-    appDesc: '',
-    appLogo: '',
-  }
-}
-
-defineExpose({
-  showAddModel() {
-    resetFormData()
-    state.title = '新增'
-    state.actionType = 1
-    state.dialogVisible = true
-  },
-  showEditModel(appId: number) {
-    resetFormData()
-    state.title = '编辑'
-    state.actionType = 2
-    state.dialogVisible = true
-    getData(appId)
-  },
-
-})
-</script>
-
-<template>
-  <div>
-    <el-dialog v-model="state.dialogVisible" :title="state.title" width="600px" :close-on-click-modal="false" append-to-body destroy-on-close>
-      <div v-loading="state.loading">
-        <el-form ref="formRef" :model="state.formData" :rules="formRules" label-width="120px" label-suffix=":">
-          <el-form-item label="标题" prop="appTitle">
-            <el-input v-model="state.formData.appTitle" />
-          </el-form-item>
-
-          <el-form-item label="分类" prop="appCatTitle">
-            <el-input v-model="state.formData.appCatTitle" readonly />
-          </el-form-item>
-
-          <el-form-item label="编码" prop="appCode">
-            <el-input v-model="state.formData.appCode" />
-          </el-form-item>
-
-          <el-form-item label="地址" prop="appUrl">
-            <el-input v-model="state.formData.appUrl" />
-          </el-form-item>
-
-          <el-form-item label="LOGO">
-            <el-image
-              style="width: 50px; height: 50px;border-radius:50%;"
-              :src="state.formData.appLogo"
-              :preview-src-list="[state.formData.appLogo]"
-            />
-          </el-form-item>
-          <el-form-item label="参数" prop="appParam">
-            <el-input v-model="state.formData.appParam" />
-          </el-form-item>
-
-          <el-form-item label="描述">
-            <el-input v-model="state.formData.appDesc" type="textarea" />
-          </el-form-item>
-        </el-form>
-      </div>
-
-      <template #footer>
-        <el-button size="large" @click="onCancel">
-          取消
-        </el-button>
-        <el-button type="primary" size="large" @click="onSubmit">
-          保存
-        </el-button>
-      </template>
-    </el-dialog>
-  </div>
-</template>

+ 0 - 0
src/views/app_center/apps/components/Permit.vue


+ 8 - 51
src/views/app_center/apps/index.vue

@@ -3,53 +3,11 @@ meta:
   enabled: false
 </route>
 
-<script lang="ts" setup>
-import App from './components/App.vue'
-import { getAppByList } from '@/api/apps/appApi'
-
-const state = reactive({
-  title: '',
-  dialogVisible: false,
-  loading: false,
-  dataList: {},
-  actionType: 1,
-})
-
-const getData = async () => {
-  state.loading = true
-  const { data } = await getAppByList({})
-  state.loading = false
-  state.dataList = data
-}
-
-onMounted(() => {
-  getData()
-})
-
-const appRef = ref()
-
-const onAppEdit = (data: any) => {
-  const appId = data.appId
-  appRef.value.showEditModel(appId)
-}
-
-const onAppPermit = (data: any) => {
-
-}
-</script>
-
 <template>
   <div>
-    <page-header title="应用中心">
-      <template #content>
-        <div>
-          便捷管理应用软件或应用服务
-        </div>
-      </template>
-    </page-header>
-
+    <page-header title="应用中心" content="便捷管理应用软件或应用服务" />
     <el-row :gutter="20" style="margin: 0 10px;">
-      <el-col v-for="(item, index) in state.dataList" :key="index" :lg="6" :md="8" :sm="12">
+      <el-col v-for="(item, index) in 12" :key="index" :lg="6" :md="8" :sm="12">
         <el-card shadow="hover" class="action-card">
           <div class="content">
             <div class="item">
@@ -61,25 +19,24 @@ const onAppPermit = (data: any) => {
             </div>
             <div class="item">
               <div class="name">
-                {{ item.appTitle }}
+                Hooray
               </div>
               <div class="intro">
-                {{ item.appDesc }}
+                前端开发工程师,10年+开发经验,可开发 Web / H5 / 小程序 等应用。前端开发工程师,10年+开发经验,可开发 Web / H5 / 小程序 等应用
               </div>
             </div>
           </div>
           <div class="action-bar">
-            <el-button text @click="onAppEdit(item)">
-              编辑
+            <el-button text>
+              操作一
             </el-button>
-            <el-button text @click="onAppPermit(item)">
-              权限配置
+            <el-button text>
+              操作二
             </el-button>
           </div>
         </el-card>
       </el-col>
     </el-row>
-    <App ref="appRef" @success="getDataList" />
   </div>
 </template>
 

+ 2 - 2
src/views/paas/log/index.vue

@@ -127,10 +127,10 @@ const menuSubmit = () => {
             </ElTree>
           </el-scrollbar>
         </template>
-        <DetailForm v-if="form.visible" :id="form.id" :parent-id="form.parentId" @on-submit="menuSubmit" />
+        <!-- <DetailForm v-if="form.visible" :id="form.id" :parent-id="form.parentId" @on-submit="menuSubmit" />
         <div v-else class="empty">
           请在左侧新增或编辑一个导航
-        </div>
+        </div> -->
       </LayoutContainer>
     </div>
   </div>

+ 10 - 5
src/views/system/group/components/Group.vue

@@ -23,10 +23,13 @@ const state = reactive({
   title: '',
   dialogVisible: false,
   loading: false,
+  groupParent: undefined,
   formData: {
     groupId: 0,
     groupName: '',
+    parentName: '',
     groupDesc: '',
+    groupCatId: 0,
   },
   actionType: 1,
 })
@@ -70,6 +73,8 @@ function resetFormData() {
     groupId: 0,
     groupName: '',
     groupDesc: '',
+    parentName: '',
+    groupCatId: 0,
   }
 }
 
@@ -96,20 +101,20 @@ defineExpose({
     <el-dialog v-model="state.dialogVisible" :title="state.title" width="600px" :close-on-click-modal="false" append-to-body destroy-on-close>
       <div v-loading="state.loading">
         <el-form ref="formRef" :model="state.formData" :rules="formRules" label-width="120px" label-suffix=":">
-          <el-form-item v-if="groupParent" label="上级部门">
-            <el-input v-model="formData.parentName" readonly />
+          <el-form-item v-if="state.groupParent" label="上级部门">
+            <el-input v-model="state.formData.parentName" readonly />
           </el-form-item>
 
           <el-form-item label="部门名称" prop="groupName">
-            <el-input v-model="formData.groupName" />
+            <el-input v-model="state.formData.groupName" />
           </el-form-item>
 
           <el-form-item label="类别" prop="groupCatId">
-            <group-cat-selector v-model="formData.groupCatId" />
+            <group-cat-selector v-model="state.formData.groupCatId" />
           </el-form-item>
 
           <el-form-item label="说明">
-            <el-input v-model="formData.groupDesc" :rows="5" type="textarea" show-word-limit maxlength="50" />
+            <el-input v-model="state.formData.groupDesc" :rows="5" type="textarea" show-word-limit maxlength="50" />
           </el-form-item>
         </el-form>
       </div>

+ 4 - 1
src/views/system/group/components/User.vue

@@ -32,6 +32,9 @@ const state = reactive({
   title: '',
   dialogVisible: false,
   loading: false,
+  viewData: {
+    isFixed: 1,
+  },
   formData: {
     gmId: 0,
     gmpId: 0,
@@ -143,7 +146,7 @@ defineExpose({
             <el-input v-model="state.formData.accountStaffNo" max="11" placeholder="输入工号" />
           </el-form-item>
 
-          <el-form-item v-show="viewData.isFixed !== 1" label="岗位" prop="positionId">
+          <el-form-item v-show="state.viewData.isFixed !== 1" label="岗位" prop="positionId">
             <position-selector v-model="state.formData.positionId" />
           </el-form-item>
 

+ 65 - 58
src/views/system/group/index.vue

@@ -1,11 +1,12 @@
 <script lang="ts" setup>
 import { ElMessage, ElMessageBox } from 'element-plus'
 import type Node from 'element-plus/es/components/tree/src/model/node'
-import User from './components/User.vue'
 import Group from './components/Group.vue'
+import User from './components/User.vue'
 import { deleteGroupById, getGroupByList } from '@/api/system/groupApi'
 import { getUserByPage } from '@/api/system/userApi'
-const { pagination, getParams, onSizeChange, onCurrentChange, onSortChange } = usePagination()
+import { packageTreeData } from '@/utils/tool'
+const { pagination, getParams, onSizeChange, onCurrentChange } = usePagination()
 
 interface TreeNode {
   label: string
@@ -25,26 +26,14 @@ const state = reactive({
   },
 })
 
-const leftTreeRef = ref()
+const menu = ref([])
 const getGroupList = async () => {
   const { data } = await getGroupByList()
-  const children: TreeNode[] = []
-  data.forEach((item: any) => {
-    return children.push({
-      label: item.modelTitle,
-      groupId: item.groupId,
-      isLeaf: true,
-    })
-  })
-  state.groups = [
-    {
-      label: '模型库',
-      isLeaf: false,
-      groupId: -1,
-      children,
-    },
-  ]
 
+  menu.value = packageTreeData({
+    data,
+    id: 'groupId',
+  })
   if (data && data.length > 0) {
     state.curGroupId = data[0].groupId
     const res = await getUserByPage({ groupId: state.curGroupId })
@@ -75,10 +64,6 @@ function currentChange(page = 1) {
   onCurrentChange(page).then(() => getUserList())
 }
 
-onMounted(() => {
-  getGroupList()
-})
-
 const onTreeNodeClick = (node: TreeNode) => {
   if (node.isLeaf) {
     state.curGroupId = node.groupId
@@ -88,11 +73,11 @@ const onTreeNodeClick = (node: TreeNode) => {
 
 const groupRef = ref()
 const onGroupAdd = (data: any) => {
-  groupRef.value.showAddModel()
+  groupRef.value.showAddModel(data)
 }
 
 const onGroupEdit = (data?: any) => {
-  groupRef.value.showAddModel()
+  groupRef.value.showAddModel(data)
 }
 const onGroupDelete = (node: Node, data: any) => {
   ElMessageBox.confirm(`确认删除「${data.label}」吗?`, '确认信息').then(async () => {
@@ -110,12 +95,14 @@ const onSearch = () => {
 }
 
 const accountTableRef = ref()
-const accountRef = ref()
 
-const onChangeStatus = (row: any) => { }
+const onChangeStatus = (row: any) => {
+  window.console.log(row)
+}
 const onCommand = (command: string, row: any) => {
   switch (command) {
     case 'GrantGroupAdd':
+      window.console.log(row)
       break
     case 'GrantGroupEdit':
       break
@@ -127,6 +114,17 @@ const onCommand = (command: string, row: any) => {
       break
   }
 }
+const userRef = ref('userRef')
+const onUserEdit = (row: any) => {
+  window.console.log(row)
+}
+const onUserDelete = (row: any) => {
+  window.console.log(row)
+}
+
+onMounted(() => {
+  getGroupList()
+})
 </script>
 
 <template>
@@ -136,7 +134,7 @@ const onCommand = (command: string, row: any) => {
       <LayoutContainer left-side-width="300px" hide-left-side-toggle>
         <template #leftSide>
           <el-scrollbar class="tree">
-            <ElTree ref="menuRef" :data="menu" default-expand-all>
+            <ElTree ref="menuRef" :data="menu" default-expand-all @node-click="onTreeNodeClick">
               <template #default="{ node, data }">
                 <div class="custom-tree-node">
                   <div class="label" :title="node.label">
@@ -144,7 +142,7 @@ const onCommand = (command: string, row: any) => {
                       <svg-icon name="uim:box" />
                     </el-icon>
                     <div class="text">
-                      {{ data.label }}
+                      {{ data.groupName }}
                     </div>
                   </div>
                   <div class="actions">
@@ -192,81 +190,95 @@ const onCommand = (command: string, row: any) => {
             </template>
           </tool-bar>
 
-          <el-table ref="accountTableRef" v-loading="state.loading" class="list-table" :data="state.userList" border stripe highlight-current-row height="100%">
+          <el-table ref="accountTableRef" v-loading="state.loading" class="list-table" :data="state.userList" border stripe highlight-current-row>
             <el-table-column type="index" align="center" label="序号" width="70" />
 
-            <el-table-column align="center" header-align="center" label="头像" width="50">
-              <template #default="row">
+            <el-table-column align="center" header-align="center" label="头像" width="100">
+              <template #default="{ row }">
                 <el-avatar :size="30" :src="row.accountAvatar" />
               </template>
             </el-table-column>
 
             <el-table-column align="center" width="100" label="账号">
-              <template #default="row">
+              <template #default="{ row }">
                 <span>{{ row.accountName }}</span>
               </template>
             </el-table-column>
 
             <el-table-column align="center" width="100" label="姓名">
-              <template #default="row">
+              <template #default="{ row }">
                 <span>{{ row.accountRealName }}</span>
               </template>
             </el-table-column>
 
             <el-table-column align="center" width="100" label="工号">
-              <template #default="row">
+              <template #default="{ row }">
                 <span>{{ row.accountStaffNo }}</span>
               </template>
             </el-table-column>
 
             <el-table-column align="center" width="120" label="联系方式">
-              <template #default="row">
+              <template #default="{ row }">
                 <span>{{ row.accountPhone }}</span>
               </template>
             </el-table-column>
 
             <el-table-column align="center" label="所在部门">
-              <template #default="row">
+              <template #default="{ row }">
                 <span>{{ row.groupName }}</span>
               </template>
             </el-table-column>
 
             <el-table-column align="center" width="100" label="岗位">
-              <template #default="row">
+              <template #default="{ row }">
                 <span>{{ row.positionName }}</span>
               </template>
             </el-table-column>
 
             <el-table-column align="center" label="状态" width="140">
-              <template #default="row">
-                <div v-if="row.isFixed !== 1">
-                  <el-switch v-model="scope.row.status" :loading="scope.row.loading" inline-prompt active-text="启用" inactive-text="禁用" :before-change="() => onChangeStatus(scope.row)" />
+              <template #default="scope">
+                <div v-if="scope.row.isFixed !== 1">
+                  <el-switch v-model="scope.row.status" :loading="scope.row.loading" inline-prompt active-text="启用" inactive-text="禁用" @before-change="() => onChangeStatus(scope.row)" />
                 </div>
               </template>
             </el-table-column>
 
-            <el-table-column label="操作" header-align="center" align="center" width="210">
-              <template #default="row">
-                <el-button size="mini" @click="onUserEdit(row)">修改</el-button>
-                <el-button v-if="row.isFixed !== 1" size="mini" type="danger" @click="onUserDelete(row)">删除</el-button>
-                <el-dropdown v-if="row.isFixed !== 1" @command="onCommand($event, row)">
+            <el-table-column label="操作" header-align="center" align="center" width="310">
+              <template #default="scope">
+                <el-button size="small" @click="onUserEdit(scope.row)">
+                  修改
+                </el-button>
+                <el-button v-if="scope.row.isFixed !== 1" size="small" type="danger" @click="onUserDelete(scope.row)">
+                  删除
+                </el-button>
+                <el-dropdown v-if="scope.row.isFixed !== 1" @command="onCommand($event, scope.row)">
                   <el-button size="small">
                     更多操作
                     <el-icon class="el-icon--right">
                       <svg-icon name="i-ep:arrow-down" />
                     </el-icon>
                   </el-button>
-                  <template #dropdown>
+                  <template #dropdown="{ row }">
                     <el-dropdown-menu>
-                      <template v-if="row.grantGroupId > 0">
-                        <el-dropdown-item command="GrantGroupEdit">编辑授权</el-dropdown-item>
-                        <el-dropdown-item command="GrantGroupDelete">解除授权</el-dropdown-item>
+                      <template v-if="row && row.grantGroupId > 0">
+                        <el-dropdown-item command="GrantGroupEdit">
+                          编辑授权
+                        </el-dropdown-item>
+                        <el-dropdown-item command="GrantGroupDelete">
+                          解除授权
+                        </el-dropdown-item>
                       </template>
                       <template v-else>
-                        <el-dropdown-item command="GrantGroupAdd">添加授权</el-dropdown-item>
+                        <el-dropdown-item command="GrantGroupAdd">
+                          添加授权
+                        </el-dropdown-item>
                       </template>
-                      <el-dropdown-item command="ResetPwd">重置密码</el-dropdown-item>
-                      <el-dropdown-item command="Permit">权限配置</el-dropdown-item>
+                      <el-dropdown-item command="ResetPwd">
+                        重置密码
+                      </el-dropdown-item>
+                      <el-dropdown-item command="Permit">
+                        权限配置
+                      </el-dropdown-item>
                     </el-dropdown-menu>
                   </template>
                 </el-dropdown>
@@ -274,7 +286,6 @@ const onCommand = (command: string, row: any) => {
             </el-table-column>
           </el-table>
           <el-pagination :current-page="pagination.page" :total="pagination.total" :page-size="pagination.size" :page-sizes="pagination.sizes" :layout="pagination.layout" :hide-on-single-page="false" class="pagination" background @current-change="currentChange" @size-change="sizeChange" />
-
         </div>
       </LayoutContainer>
     </div>
@@ -380,12 +391,8 @@ const onCommand = (command: string, row: any) => {
 
   :deep(.main) {
     .main-container {
-      display: flex;
-      flex-direction: column;
-      justify-content: center;
       width: 100%;
       height: 100%;
-      padding: 0;
     }
   }
 

+ 5 - 1
src/views/system/profile/company_profile.vue

@@ -25,7 +25,11 @@ const state = reactive({
   title: '',
   dialogVisible: false,
   loading: false,
-  formData: {},
+  formData: {
+    positionId: 0,
+    positionName: '',
+    positionDesc: '',
+  },
   actionType: 1,
 })