Browse Source

用户导入

hella_online_20240829
zhang_li 5 months ago
parent
commit
eca2457c22
  1. 21
      src/views/system/user/index.vue

21
src/views/system/user/index.vue

@ -90,9 +90,10 @@
</el-row> </el-row>
<!-- 添加或修改用户对话框 --> <!-- 添加或修改用户对话框 -->
<UserForm ref="formRef" @success="getList" /> <!-- <UserForm ref="formRef" @success="getList" /> -->
<!-- 用户导入对话框 --> <!-- 导入 -->
<UserImportForm ref="importFormRef" @success="getList" /> <ImportForm ref="importFormRef" url="/system/user/import" :updateIsDisable='true' :coverIsDisable='true' :mode='2' :importTemplateData="importTemplateData" @success="importSuccess" />
<!-- 分配角色 --> <!-- 分配角色 -->
<UserAssignRoleForm ref="assignRoleFormRef" @success="getList" /> <UserAssignRoleForm ref="assignRoleFormRef" @success="getList" />
</template> </template>
@ -105,6 +106,7 @@ import { CommonStatusEnum } from '@/utils/constants'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import UserForm from './UserForm.vue' import UserForm from './UserForm.vue'
import UserImportForm from './UserImportForm.vue' import UserImportForm from './UserImportForm.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import UserAssignRoleForm from './UserAssignRoleForm.vue' import UserAssignRoleForm from './UserAssignRoleForm.vue'
import DeptTree from './DeptTree.vue' import DeptTree from './DeptTree.vue'
@ -168,7 +170,11 @@ const importFormRef = ref()
const handleImport = () => { const handleImport = () => {
importFormRef.value.open() importFormRef.value.open()
} }
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '用户导入模版.xlsx'
})
/** 修改用户状态 */ /** 修改用户状态 */
const handleStatusChange = async (row: UserApi.UserVO) => { const handleStatusChange = async (row: UserApi.UserVO) => {
try { try {
@ -252,9 +258,14 @@ const assignRoleFormRef = ref()
const handleRole = (row: UserApi.UserVO) => { const handleRole = (row: UserApi.UserVO) => {
assignRoleFormRef.value.open(row) assignRoleFormRef.value.open(row)
} }
//
const importSuccess = () => {
getList()
}
/** 初始化 */ /** 初始化 */
onMounted(() => { onMounted(async() => {
getList() getList()
importTemplateData.templateUrl = await UserApi.importUserTemplate()
}) })
</script> </script>

Loading…
Cancel
Save