|
@@ -44,17 +44,20 @@
|
|
|
</SmartLayoutSeparate>
|
|
</SmartLayoutSeparate>
|
|
|
<UserAccountUpdateModal @register="registerAccountModal" />
|
|
<UserAccountUpdateModal @register="registerAccountModal" />
|
|
|
<UserSetRole @register="registerSetRoleModal" />
|
|
<UserSetRole @register="registerSetRoleModal" />
|
|
|
|
|
+ <UserUseYnModal @register="registerUseYnModal" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { computed, ref, unref } from 'vue';
|
|
import { computed, ref, unref } from 'vue';
|
|
|
import { useI18n } from '@/hooks/web/useI18n';
|
|
import { useI18n } from '@/hooks/web/useI18n';
|
|
|
|
|
+ import { storeToRefs } from 'pinia';
|
|
|
|
|
|
|
|
import { useLoadDictItem } from '@/modules/smart-system/hooks/SysDictHooks';
|
|
import { useLoadDictItem } from '@/modules/smart-system/hooks/SysDictHooks';
|
|
|
import { useSizeSetting } from '@/hooks/setting/UseSizeSetting';
|
|
import { useSizeSetting } from '@/hooks/setting/UseSizeSetting';
|
|
|
import { hasPermission } from '@/utils/auth';
|
|
import { hasPermission } from '@/utils/auth';
|
|
|
import { useModal } from '@/components/Modal';
|
|
import { useModal } from '@/components/Modal';
|
|
|
|
|
+ import { useUserStore } from '@/store/modules/user';
|
|
|
|
|
|
|
|
import { SmartLayoutSeparate } from '@/components/SmartLayoutSeparate';
|
|
import { SmartLayoutSeparate } from '@/components/SmartLayoutSeparate';
|
|
|
import SysDeptTree from '@/modules/smart-system/components/SysDept/SysDeptTree.vue';
|
|
import SysDeptTree from '@/modules/smart-system/components/SysDept/SysDeptTree.vue';
|
|
@@ -68,6 +71,7 @@
|
|
|
} from '@/components/SmartTable';
|
|
} from '@/components/SmartTable';
|
|
|
import UserAccountUpdateModal from './account/UserAccountUpdateModal.vue';
|
|
import UserAccountUpdateModal from './account/UserAccountUpdateModal.vue';
|
|
|
import UserSetRole from './components/UserSetRole.vue';
|
|
import UserSetRole from './components/UserSetRole.vue';
|
|
|
|
|
+ import UserUseYnModal from './components/UserUseYnModal.vue';
|
|
|
|
|
|
|
|
import { getAddEditFormSchemas, getSearchSchemas, getTableColumns } from './UserListView.config';
|
|
import { getAddEditFormSchemas, getSearchSchemas, getTableColumns } from './UserListView.config';
|
|
|
import {
|
|
import {
|
|
@@ -89,6 +93,8 @@
|
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
const { warnMessage, errorMessage, createConfirm, successMessage } = useMessage();
|
|
const { warnMessage, errorMessage, createConfirm, successMessage } = useMessage();
|
|
|
const { getTableSize } = useSizeSetting();
|
|
const { getTableSize } = useSizeSetting();
|
|
|
|
|
+ const { getIsPlatformTenant } = storeToRefs(useUserStore());
|
|
|
|
|
+ const [registerUseYnModal, { openModal: openUseYnModal }] = useModal();
|
|
|
|
|
|
|
|
const { dictData: userTypeListRef } = useLoadDictItem(ref('SYSTEM_USER_TYPE'));
|
|
const { dictData: userTypeListRef } = useLoadDictItem(ref('SYSTEM_USER_TYPE'));
|
|
|
const getUserTypeMap = computed(() => {
|
|
const getUserTypeMap = computed(() => {
|
|
@@ -264,9 +270,18 @@
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const validateSelectRows = () => {
|
|
|
|
|
+ const rows = getCheckboxRecords();
|
|
|
|
|
+ if (!rows.length) {
|
|
|
|
|
+ warnMessage(t('common.notice.select'));
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return rows;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const [
|
|
const [
|
|
|
registerTable,
|
|
registerTable,
|
|
|
- { editByRowModal, getCheckboxRecords, query, deleteByCheckbox, showAddModal },
|
|
|
|
|
|
|
+ { editByRowModal, getCheckboxRecords, query, deleteByCheckbox, showAddModal, useYnByCheckbox },
|
|
|
] = useSmartTable({
|
|
] = useSmartTable({
|
|
|
columns: getTableColumns(),
|
|
columns: getTableColumns(),
|
|
|
stripe: true,
|
|
stripe: true,
|
|
@@ -376,9 +391,35 @@
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
code: 'useYnTrue',
|
|
code: 'useYnTrue',
|
|
|
|
|
+ props: {
|
|
|
|
|
+ onClick() {
|
|
|
|
|
+ if (!unref(getIsPlatformTenant)) {
|
|
|
|
|
+ useYnByCheckbox(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const rows = validateSelectRows();
|
|
|
|
|
+ if (!rows) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ openUseYnModal(true, { rows, useYn: true });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
code: 'useYnFalse',
|
|
code: 'useYnFalse',
|
|
|
|
|
+ props: {
|
|
|
|
|
+ onClick() {
|
|
|
|
|
+ if (!unref(getIsPlatformTenant)) {
|
|
|
|
|
+ useYnByCheckbox(true);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const rows = validateSelectRows();
|
|
|
|
|
+ if (!rows) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ openUseYnModal(true, { rows, useYn: false });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: t('system.views.user.button.resetPassword'),
|
|
name: t('system.views.user.button.resetPassword'),
|