马宇豪
2023-08-16 a8ef7c1a4b2ab6acd91a0520e6258bd753d17f20
src/views/system/user/index.vue
@@ -38,7 +38,7 @@
                </el-table-column>
                <el-table-column prop="positionId" label="职务" show-overflow-tooltip>
                    <template #default="scope">
                        {{ parseNumber(scope.row.positionId) }}
                        {{ scope.row.positions?.map(i=>i.positionName).join('、') }}
                    </template>
                </el-table-column>
<!--                <el-table-column prop="type" label="职务" show-overflow-tooltip>-->
@@ -46,7 +46,7 @@
<!--                        {{ `${userTypeList.find(item => item.id === scope.row.type)?.name}` }}-->
<!--                    </template>-->
<!--                </el-table-column>-->
                <el-table-column prop="department.depName" label="部门" show-overflow-tooltip></el-table-column>
                <el-table-column prop="depName" label="部门" show-overflow-tooltip></el-table-column>
                <el-table-column prop="phone" label="手机号" show-overflow-tooltip></el-table-column>
                <el-table-column prop="email" label="邮箱" show-overflow-tooltip></el-table-column>
                <el-table-column prop="status" label="用户状态" show-overflow-tooltip>
@@ -56,9 +56,11 @@
                    </template>
                </el-table-column>
                <el-table-column prop="gmtCreate" label="创建时间" show-overflow-tooltip></el-table-column>
                <el-table-column label="操作" width="100">
                <el-table-column label="操作" width="200">
                    <template #default="scope">
                        <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenUserDialog('查看', scope.row)">查看</el-button>
                        <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onOpenUserDialog('修改', scope.row)">修改</el-button>
                        <el-button size="small" text type="primary" @click="onCertificate(scope.row)">证书管理</el-button>
                        <el-button style="color: red" :disabled="scope.row.userName === 'admin'" size="small" text type="primary" @click="onRowDel(scope.row)">删除</el-button>
                    </template>
                </el-table-column>
@@ -69,6 +71,7 @@
            <br />
        </el-card>
        <userDialog ref="userRef" @getUserList="initUserTableData" />
        <dialog-certificate ref="ctfRef" @getUserList="initUserTableData"></dialog-certificate>
    </div>
</template>
@@ -76,6 +79,7 @@
import { toRefs, reactive, onMounted, ref, defineComponent } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import userDialog from '/@/views/system/user/component/userDialog.vue';
import dialogCertificate from "/@/views/system/user/component/dialogCertificate.vue";
import { userApi } from '/@/api/systemManage/user';
import { dutyApi } from '/@/api/systemManage/duty';
import { departmentApi } from '/@/api/systemManage/department';
@@ -121,9 +125,10 @@
export default defineComponent({
    name: 'systemUser',
    components: { userDialog },
    components: { userDialog,dialogCertificate },
    setup() {
        const userRef = ref();
        const ctfRef = ref()
        const state = reactive<TableDataState>({
            userTableData: {
                data: [],
@@ -213,6 +218,10 @@
            userRef.value.openDialog(type, value, state.departmentList, state.roleList, state.dutyList);
        };
        const onCertificate = (value: any)=>{
          ctfRef.value.openDialog(value);
        }
        // 删除用户
        const onRowDel = (row: TableDataRow) => {
            ElMessageBox.confirm(`此操作将永久删除账户名称:“${row.realName}”,是否继续?`, '提示', {
@@ -257,7 +266,9 @@
        });
        return {
            userRef,
            ctfRef,
            onOpenUserDialog,
            onCertificate,
            onRowDel,
            parseNumber,
            onHandleSizeChange,