|
@@ -48,17 +48,18 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
- import { defineComponent, computed, onMounted, ref } from 'vue';
|
|
|
|
|
|
+ import { defineComponent, computed, onMounted, ref, h } from 'vue';
|
|
import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
|
|
import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useModal } from '/@/components/Modal';
|
|
import { useModal } from '/@/components/Modal';
|
|
import { uploadApi } from '/@/api/sys/upload';
|
|
import { uploadApi } from '/@/api/sys/upload';
|
|
import SetpaswordModal from './setpaswordModal.vue';
|
|
import SetpaswordModal from './setpaswordModal.vue';
|
|
import DetailsModal from './detailsModal.vue';
|
|
import DetailsModal from './detailsModal.vue';
|
|
|
|
+import { Switch } from 'ant-design-vue';
|
|
// import DelListModal from './delListModal.vue';
|
|
// import DelListModal from './delListModal.vue';
|
|
import { Alert } from 'ant-design-vue';
|
|
import { Alert } from 'ant-design-vue';
|
|
// import { h } from 'vue';
|
|
// import { h } from 'vue';
|
|
- import { ListApi, delApi, preDelApi, getNumByStaff } from '/@/api/staff/list';
|
|
|
|
|
|
+ import { ListApi, delApi, preDelApi, updateApi, getNumByStaff } from '/@/api/staff/list';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
// import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
// import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
import { RoleEnum } from '/@/enums/roleEnum';
|
|
import { RoleEnum } from '/@/enums/roleEnum';
|
|
@@ -95,17 +96,12 @@
|
|
});
|
|
});
|
|
|
|
|
|
const columns: BasicColumn[] = [
|
|
const columns: BasicColumn[] = [
|
|
- {
|
|
|
|
- title: 'ID',
|
|
|
|
- dataIndex: 'id',
|
|
|
|
- fixed: 'left',
|
|
|
|
- width: 60,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: t('routes.staff.userId'),
|
|
|
|
- dataIndex: 'userName',
|
|
|
|
- width: 150,
|
|
|
|
- },
|
|
|
|
|
|
+ // {
|
|
|
|
+ // title: 'ID',
|
|
|
|
+ // dataIndex: 'id',
|
|
|
|
+ // fixed: 'left',
|
|
|
|
+ // width: 60,
|
|
|
|
+ // },
|
|
// {
|
|
// {
|
|
// title: t('routes.staff.deptName'),
|
|
// title: t('routes.staff.deptName'),
|
|
// dataIndex: 'companyName',
|
|
// dataIndex: 'companyName',
|
|
@@ -121,6 +117,11 @@
|
|
dataIndex: 'nickName',
|
|
dataIndex: 'nickName',
|
|
width: 120,
|
|
width: 120,
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: t('routes.staff.userId'),
|
|
|
|
+ dataIndex: 'userName',
|
|
|
|
+ width: 150,
|
|
|
|
+ },
|
|
// {
|
|
// {
|
|
// title: '手机',
|
|
// title: '手机',
|
|
// dataIndex: 'phone',
|
|
// dataIndex: 'phone',
|
|
@@ -143,7 +144,30 @@
|
|
dataIndex: 'createTime',
|
|
dataIndex: 'createTime',
|
|
slots: { customRender: 'createTime' },
|
|
slots: { customRender: 'createTime' },
|
|
width: 130,
|
|
width: 130,
|
|
|
|
+ },{
|
|
|
|
+ title: '状态',
|
|
|
|
+ dataIndex: 'status',
|
|
|
|
+ width: 80,
|
|
|
|
+ customRender: ({ record }) => {
|
|
|
|
+ if (!Reflect.has(record, 'status')) {
|
|
|
|
+ record.pendingStatus = false;
|
|
|
|
+ }
|
|
|
|
+ return h(Switch, {
|
|
|
|
+ checked: record.status == 1 ? true : false,
|
|
|
|
+ checkedChildren: '启用',
|
|
|
|
+ unCheckedChildren: '禁用',
|
|
|
|
+ loading: false,
|
|
|
|
+ onChange: async (checked: boolean) => {
|
|
|
|
+ record.pendingStatus = true;
|
|
|
|
+ const newStatus = checked?1:0;
|
|
|
|
+ await updateApi({...record,status:newStatus});
|
|
|
|
+ Reflect.set(record, 'status', checked);
|
|
|
|
+ createMessage.success(t('common.optSuccess'));
|
|
|
|
+ reload()
|
|
|
|
+ },
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
+ },
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
dataIndex: '',
|
|
dataIndex: '',
|