更新2.1.2版本,优化部门、角色权限,增加上下级关系;增加登录、系统、短信日志;优化省市区编码

This commit is contained in:
孟帅
2023-01-25 11:49:21 +08:00
parent 11fad0132d
commit 93e0fe7250
190 changed files with 35896 additions and 7208 deletions

View File

@@ -20,7 +20,7 @@
<PlusOutlined />
</n-icon>
</template>
新建部门
添加部门
</n-button>
</n-space>
@@ -29,6 +29,7 @@
:data="data"
:row-key="rowKey"
:loading="loading"
:resizeHeightOffset="-20000"
default-expand-all
/>
</n-space>
@@ -37,7 +38,7 @@
v-model:show="showModal"
:show-icon="false"
preset="dialog"
:title="formParams?.id > 0 ? '编辑部门 #' + formParams?.id : '新建部门'"
:title="formParams?.id > 0 ? '编辑部门 #' + formParams?.id : '添加部门'"
>
<n-form
:model="formParams"
@@ -73,9 +74,9 @@
<n-input placeholder="请输入邮箱" v-model:value="formParams.email" />
</n-form-item>
<n-form-item label="排序" path="sort">
<n-input-number v-model:value="formParams.sort" clearable />
</n-form-item>
<!-- <n-form-item label="排序" path="sort">-->
<!-- <n-input-number v-model:value="formParams.sort" clearable />-->
<!-- </n-form-item>-->
<n-form-item label="状态" path="status">
<n-radio-group v-model:value="formParams.status" name="status">
@@ -198,18 +199,26 @@
const data = ref([]);
const columns: DataTableColumns<RowData> = [
{
type: 'selection',
},
{
title: '部门名称',
title: '部门',
key: 'name',
render(row) {
return h(
NTag,
{
type: 'info',
},
{
default: () => row.name,
}
);
},
width: 200,
},
{
title: '部门ID',
key: 'index',
width: 100,
},
// {
// title: '部门ID',
// key: 'index',
// width: 100,
// },
{
title: '部门编码',
key: 'code',
@@ -250,15 +259,15 @@
);
},
},
{
title: '排序',
key: 'sort',
width: 80,
},
// {
// title: '排序',
// key: 'sort',
// width: 80,
// },
{
title: '创建时间',
key: 'createdAt',
width: 200,
width: 150,
render: (rows, _) => {
return rows.createdAt; //timestampToTime();
},
@@ -300,7 +309,7 @@
function handleEdit(record: Recordable) {
showModal.value = true;
formParams.value = record;
formParams.value = cloneDeep(record);
formParams.value.children = null;
optionsDefaultValue.value = formParams.value.pid;
}

View File

@@ -5,17 +5,23 @@ export const columns = [
{
title: 'ID',
key: 'id',
width: 100,
width: 80,
},
{
title: '岗位名称',
key: 'name',
width: 100,
},
{
title: '岗位名称',
title: '岗位',
key: 'name',
width: 100,
render(row) {
return h(
NTag,
{
type: 'info',
},
{
default: () => row.name,
}
);
},
},
{
title: '岗位编码',
@@ -42,15 +48,15 @@ export const columns = [
);
},
},
{
title: '排序',
key: 'sort',
width: 100,
},
// {
// title: '排序',
// key: 'sort',
// width: 100,
// },
{
title: '创建时间',
key: 'createdAt',
width: 100,
width: 150,
render: (rows, _) => {
return rows.createdAt;
},

View File

@@ -30,7 +30,7 @@
<PlusOutlined />
</n-icon>
</template>
新建岗位
添加岗位
</n-button>
&nbsp;
<n-button type="error" @click="batchDelete" :disabled="batchDeleteDisabled">
@@ -48,7 +48,7 @@
v-model:show="showModal"
:show-icon="false"
preset="dialog"
:title="formParams?.id > 0 ? '编辑岗位 #' + formParams?.id : '新建岗位'"
:title="formParams?.id > 0 ? '编辑岗位 #' + formParams?.id : '添加岗位'"
>
<n-form
:model="formParams"
@@ -65,9 +65,9 @@
<n-input placeholder="请输入岗位编码" v-model:value="formParams.code" />
</n-form-item>
<n-form-item label="排序" path="sort">
<n-input-number v-model:value="formParams.sort" clearable />
</n-form-item>
<!-- <n-form-item label="排序" path="sort">-->
<!-- <n-input-number v-model:value="formParams.sort" clearable />-->
<!-- </n-form-item>-->
<n-form-item label="状态" path="status">
<n-radio-group v-model:value="formParams.status" name="status">
@@ -244,18 +244,14 @@
formBtnLoading.value = true;
formRef.value.validate((errors) => {
if (!errors) {
Edit(formParams.value)
.then((_res) => {
message.success('操作成功');
setTimeout(() => {
showModal.value = false;
reloadTable();
formParams.value = ref(resetFormParams);
});
})
.catch((e: Error) => {
message.error(e.message ?? '操作失败');
Edit(formParams.value).then((_res) => {
message.success('操作成功');
setTimeout(() => {
showModal.value = false;
reloadTable();
formParams.value = ref(resetFormParams);
});
});
} else {
message.error('请填写完整信息');
}
@@ -293,15 +289,11 @@
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
Delete({ id: checkedIds.value })
.then((_res) => {
console.log('_res:' + JSON.stringify(_res));
message.success('操作成功');
reloadTable();
})
.catch((e: Error) => {
message.error(e.message ?? '操作失败');
});
Delete({ id: checkedIds.value }).then((_res) => {
console.log('_res:' + JSON.stringify(_res));
message.success('操作成功');
reloadTable();
});
},
onNegativeClick: () => {
// message.error('取消');

View File

@@ -30,7 +30,7 @@
<PlusOutlined />
</n-icon>
</template>
新建用户
添加用户
</n-button>
<n-button
type="error"
@@ -52,7 +52,7 @@
v-model:show="showModal"
:show-icon="false"
preset="dialog"
:title="formParams?.id > 0 ? '编辑用户 #' + formParams?.id : '新建用户'"
:title="formParams?.id > 0 ? '编辑用户 #' + formParams?.id : '添加用户'"
:style="{
width: dialogWidth,
}"