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

Loading…
Cancel
Save