fix: 页面字段/接口调整
This commit is contained in:
@@ -445,13 +445,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listConfig(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
|
||||
@@ -36,20 +36,20 @@ let queryParams = reactive({
|
||||
/**部门名称 */
|
||||
deptName: '',
|
||||
/**部门状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
});
|
||||
|
||||
/**查询参数重置 */
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
deptName: '',
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
});
|
||||
fnGetList();
|
||||
}
|
||||
|
||||
/**表格全展开行key */
|
||||
let expandedRowKeys: string[] = [];
|
||||
let expandedRowKeys: number[] = [];
|
||||
|
||||
/**表格状态类型 */
|
||||
type TabeStateType = {
|
||||
@@ -93,15 +93,15 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.dept.classSort'),
|
||||
dataIndex: 'orderNum',
|
||||
dataIndex: 'deptSort',
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: t('views.system.dept.status'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
@@ -165,12 +165,12 @@ let modalState: ModalStateType = reactive({
|
||||
deptName: '',
|
||||
email: '',
|
||||
leader: '',
|
||||
orderNum: 0,
|
||||
deptSort: 0,
|
||||
parentId: '100',
|
||||
ancestors: '',
|
||||
parentName: null,
|
||||
phone: '',
|
||||
status: '0',
|
||||
statusFlag: '0',
|
||||
},
|
||||
confirmLoading: false,
|
||||
treeData: [],
|
||||
@@ -386,14 +386,15 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listDept(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
const treeData = parseDataToTree(res.data, 'deptId');
|
||||
// 初始上级部门和展开编号key
|
||||
if (treeDataAll.length <= 0) {
|
||||
// 转换树状数据
|
||||
treeDataAll = treeData;
|
||||
// 展开编号key
|
||||
expandedRowKeys = [...new Set(res.data.map(item => item.parentId))];
|
||||
const parentIds: number[] = res.data.map((item: any) => item.parentId);
|
||||
expandedRowKeys = [...new Set(parentIds)];
|
||||
fnTableExpandedRowsAll(tableState.expandedRowAll);
|
||||
}
|
||||
tableState.data = treeData;
|
||||
@@ -436,9 +437,12 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.dept.status')" name="status">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.status')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -547,8 +551,11 @@ onMounted(() => {
|
||||
@expandedRowsChange="fnTableExpandedRowsChange"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.statusFlag"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'deptId'">
|
||||
<a-space :size="8" align="center">
|
||||
@@ -582,7 +589,7 @@ onMounted(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topRight" v-if="record.status !== '0'">
|
||||
<a-tooltip placement="topRight" v-if="record.statusFlag !== '0'">
|
||||
<template #title>{{
|
||||
t('views.system.dept.addClass')
|
||||
}}</template>
|
||||
@@ -643,19 +650,22 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.classSort')"
|
||||
name="orderNum"
|
||||
name="deptSort"
|
||||
>
|
||||
{{ modalState.from.orderNum }}
|
||||
{{ modalState.from.deptSort }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.dept.status')" name="status">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.status')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -755,9 +765,12 @@ onMounted(() => {
|
||||
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.dept.status')" name="status">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.status')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -767,10 +780,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dept.classSort')"
|
||||
name="orderNum"
|
||||
name="deptSort"
|
||||
>
|
||||
<a-input-number
|
||||
v-model:value="modalState.from.orderNum"
|
||||
v-model:value="modalState.from.deptSort"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
:step="1"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { getLocalColor, changePrimaryColor } from '@/hooks/useTheme';
|
||||
import { reactive, ref, onMounted, toRaw } from 'vue';
|
||||
import { PageContainer } from 'antdv-pro-layout';
|
||||
import { ProModal } from 'antdv-pro-modal';
|
||||
@@ -16,7 +15,7 @@ import {
|
||||
addData,
|
||||
updateData,
|
||||
} from '@/api/system/dict/data';
|
||||
import { getDictOptionselect, getType } from '@/api/system/dict/type';
|
||||
import { getDictOption, getType } from '@/api/system/dict/type';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useTabsStore from '@/store/modules/tabs';
|
||||
@@ -34,18 +33,6 @@ const dictId = route.params && (route.params.dictId as string);
|
||||
|
||||
const zh = currentLocale.value === 'zh_CN';
|
||||
|
||||
let color = ref<string>(getLocalColor());
|
||||
/**改变主题色 */
|
||||
function fnColorChange(e: Event) {
|
||||
const target = e.target as HTMLInputElement;
|
||||
if (target.nodeName === 'INPUT') {
|
||||
changePrimaryColor(target.value ?? '#1890ff');
|
||||
} else {
|
||||
changePrimaryColor();
|
||||
}
|
||||
color.value = getLocalColor();
|
||||
}
|
||||
|
||||
/**标签类型数据固定项 */
|
||||
const tagTypeOptions = ref([
|
||||
{ value: '', label: zh ? '普通文本' : 'Plain text' },
|
||||
@@ -85,9 +72,9 @@ let queryParams = reactive({
|
||||
/**字典名称 */
|
||||
dictType: '',
|
||||
/**数据标签 */
|
||||
dictLabel: '',
|
||||
dataLabel: '',
|
||||
/**数据状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
@@ -98,16 +85,16 @@ let queryParams = reactive({
|
||||
function fnQueryReset() {
|
||||
if (dictId && dictId !== '0') {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
dictLabel: '',
|
||||
status: undefined,
|
||||
dataLabel: '',
|
||||
statusFlag: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
} else {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
dictType: '',
|
||||
dictLabel: '',
|
||||
status: undefined,
|
||||
dataLabel: '',
|
||||
statusFlag: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
@@ -143,33 +130,33 @@ let tableState: TabeStateType = reactive({
|
||||
/**表格字段列 */
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: t('views.system.dictData.dictCode'),
|
||||
dataIndex: 'dictCode',
|
||||
title: t('views.system.dictData.dataId'),
|
||||
dataIndex: 'dataId',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.system.dictData.dictLabel'),
|
||||
dataIndex: 'dictLabel',
|
||||
title: t('views.system.dictData.dataLabel'),
|
||||
dataIndex: 'dataLabel',
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: t('views.system.dictData.dictValue'),
|
||||
dataIndex: 'dictValue',
|
||||
title: t('views.system.dictData.dataValue'),
|
||||
dataIndex: 'dataValue',
|
||||
align: 'left',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: t('views.system.dictData.dictSort'),
|
||||
dataIndex: 'dictSort',
|
||||
title: t('views.system.dictData.dataSort'),
|
||||
dataIndex: 'dataSort',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: t('views.system.dictData.status'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
title: t('views.system.dictData.statusFlag'),
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
@@ -185,7 +172,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('common.operate'),
|
||||
key: 'dictCode',
|
||||
key: 'dataId',
|
||||
align: 'left',
|
||||
},
|
||||
];
|
||||
@@ -249,15 +236,15 @@ let modalState: ModalStateType = reactive({
|
||||
openByEdit: false,
|
||||
title: '字典数据',
|
||||
from: {
|
||||
dictCode: undefined,
|
||||
dictLabel: '',
|
||||
dictSort: 0,
|
||||
dataId: undefined,
|
||||
dataLabel: '',
|
||||
dataSort: 0,
|
||||
dictType: 'sys_oper_type',
|
||||
dictValue: '',
|
||||
dataValue: '',
|
||||
tagClass: '',
|
||||
tagType: '',
|
||||
remark: '',
|
||||
status: '0',
|
||||
statusFlag: '0',
|
||||
createTime: 0,
|
||||
createBy: undefined,
|
||||
},
|
||||
@@ -268,20 +255,26 @@ let modalState: ModalStateType = reactive({
|
||||
const modalStateFrom = Form.useForm(
|
||||
modalState.from,
|
||||
reactive({
|
||||
dictLabel: [
|
||||
dictType: [
|
||||
{
|
||||
required: true,
|
||||
min: 1,
|
||||
max: 50,
|
||||
message: t('views.system.dictData.dictLabelPleac'),
|
||||
message: t('common.selectPlease'),
|
||||
},
|
||||
],
|
||||
dictValue: [
|
||||
dataLabel: [
|
||||
{
|
||||
required: true,
|
||||
min: 1,
|
||||
max: 50,
|
||||
message: t('views.system.dictData.dictValuePleac'),
|
||||
message: t('views.system.dictData.dataLabelPleac'),
|
||||
},
|
||||
],
|
||||
dataValue: [
|
||||
{
|
||||
required: true,
|
||||
min: 1,
|
||||
max: 50,
|
||||
message: t('views.system.dictData.dataValuePleac'),
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -299,10 +292,10 @@ function fnModalVisibleByVive(row: Record<string, string>) {
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 新增或者修改
|
||||
* @param dictCode 数据编号id, 不传为新增
|
||||
* @param dataId 数据编号id, 不传为新增
|
||||
*/
|
||||
function fnModalVisibleByEdit(dictCode?: string | number, record?: any) {
|
||||
if (!dictCode) {
|
||||
function fnModalVisibleByEdit(dataId?: string | number, record?: any) {
|
||||
if (!dataId) {
|
||||
modalStateFrom.resetFields();
|
||||
modalState.from.dictType = queryParams.dictType;
|
||||
modalState.title = t('views.system.dictData.addInfo');
|
||||
@@ -311,7 +304,7 @@ function fnModalVisibleByEdit(dictCode?: string | number, record?: any) {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
getData(dictCode).then(res => {
|
||||
getData(dataId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
@@ -335,7 +328,7 @@ function fnModalOk() {
|
||||
.then(() => {
|
||||
modalState.confirmLoading = true;
|
||||
const from = toRaw(modalState.from);
|
||||
const dictData = from.dictCode ? updateData(from) : addData(from);
|
||||
const dictData = from.dataId ? updateData(from) : addData(from);
|
||||
const key = 'dictData';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
dictData
|
||||
@@ -378,19 +371,19 @@ function fnModalCancel() {
|
||||
|
||||
/**
|
||||
* 字典删除
|
||||
* @param dictCode 字典代码
|
||||
* @param dataId 字典代码
|
||||
*/
|
||||
function fnRecordDelete(dictCode: string = '0') {
|
||||
if (dictCode === '0') {
|
||||
dictCode = tableState.selectedRowKeys.join(',');
|
||||
function fnRecordDelete(dataId: string = '0') {
|
||||
if (dataId === '0') {
|
||||
dataId = tableState.selectedRowKeys.join(',');
|
||||
}
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.system.dictData.delTip', { txt: dictCode }),
|
||||
content: t('views.system.dictData.delTip', { txt: dataId }),
|
||||
onOk() {
|
||||
const key = 'delData';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
delData(dictCode).then(res => {
|
||||
delData(dataId).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('views.system.dictData.delOk'),
|
||||
@@ -456,13 +449,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.pageNum = pageNum;
|
||||
}
|
||||
listData(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
@@ -478,20 +472,19 @@ function fnGetList(pageNum?: number) {
|
||||
|
||||
onMounted(() => {
|
||||
// 初始字典数据
|
||||
Promise.allSettled([
|
||||
getDict('sys_normal_disable'),
|
||||
getDictOptionselect(),
|
||||
]).then(resArr => {
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
dict.sysNormalDisable = resArr[0].value;
|
||||
}
|
||||
if (resArr[1].status === 'fulfilled') {
|
||||
const dicts = resArr[1].value;
|
||||
if (dicts.code === RESULT_CODE_SUCCESS) {
|
||||
dict.sysDictType = dicts.data;
|
||||
Promise.allSettled([getDict('sys_normal_disable'), getDictOption()]).then(
|
||||
resArr => {
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
dict.sysNormalDisable = resArr[0].value;
|
||||
}
|
||||
if (resArr[1].status === 'fulfilled') {
|
||||
const dicts = resArr[1].value;
|
||||
if (dicts.code === RESULT_CODE_SUCCESS) {
|
||||
dict.sysDictType = dicts.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
// 指定字典id列表数据
|
||||
if (dictId && dictId !== '0') {
|
||||
getType(dictId).then(res => {
|
||||
@@ -535,11 +528,11 @@ onMounted(() => {
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictLabel')"
|
||||
name="dictLabel"
|
||||
:label="t('views.system.dictData.dataLabel')"
|
||||
name="dataLabel"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.dictLabel"
|
||||
v-model:value="queryParams.dataLabel"
|
||||
allow-clear
|
||||
:placeholder="t('common.inputPlease')"
|
||||
></a-input>
|
||||
@@ -547,11 +540,11 @@ onMounted(() => {
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.status')"
|
||||
name="status"
|
||||
:label="t('views.system.dictData.statusFlag')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.sysNormalDisable"
|
||||
@@ -662,7 +655,7 @@ onMounted(() => {
|
||||
<!-- 表格列表 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="dictCode"
|
||||
row-key="dataId"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
@@ -676,10 +669,13 @@ onMounted(() => {
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.statusFlag"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'dictCode'">
|
||||
<template v-if="column.key === 'dataId'">
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.viewText') }}</template>
|
||||
@@ -695,7 +691,7 @@ onMounted(() => {
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record.dictCode, record)"
|
||||
@click.prevent="fnModalVisibleByEdit(record.dataId, record)"
|
||||
v-perms:has="['system:dict:edit']"
|
||||
>
|
||||
<template #icon><FormOutlined /></template>
|
||||
@@ -705,7 +701,7 @@ onMounted(() => {
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.dictCode)"
|
||||
@click.prevent="fnRecordDelete(record.dataId)"
|
||||
v-perms:has="['system:dict:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
@@ -753,20 +749,20 @@ onMounted(() => {
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictCode')"
|
||||
name="dictCode"
|
||||
:label="t('views.system.dictData.dataId')"
|
||||
name="dataId"
|
||||
>
|
||||
{{ modalState.from.dictCode }}
|
||||
{{ modalState.from.dataId }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.status')"
|
||||
name="status"
|
||||
:label="t('views.system.dictData.statusFlag')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -774,18 +770,18 @@ onMounted(() => {
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictLabel')"
|
||||
name="dictLabel"
|
||||
:label="t('views.system.dictData.dataLabel')"
|
||||
name="dataLabel"
|
||||
>
|
||||
{{ modalState.from.dictLabel }}
|
||||
{{ modalState.from.dataLabel }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictValue')"
|
||||
name="dictValue"
|
||||
:label="t('views.system.dictData.dataValue')"
|
||||
name="dataValue"
|
||||
>
|
||||
{{ modalState.from.dictValue }}
|
||||
{{ modalState.from.dataValue }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -818,16 +814,16 @@ onMounted(() => {
|
||||
>
|
||||
<DictTag
|
||||
:options="parseDataDict(modalState.from)"
|
||||
:value="modalState.from.dictValue"
|
||||
:value="modalState.from.dataValue"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictSort')"
|
||||
name="dictSort"
|
||||
:label="t('views.system.dictData.dataSort')"
|
||||
name="dataSort"
|
||||
>
|
||||
{{ modalState.from.dictSort }}
|
||||
{{ modalState.from.dataSort }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -875,24 +871,25 @@ onMounted(() => {
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictType')"
|
||||
name="dictType"
|
||||
v-bind="modalStateFrom.validateInfos.dictType"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.dictType"
|
||||
default-value="sys_oper_type"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.sysDictType"
|
||||
:disabled="true"
|
||||
:disabled="dictId !== '0'"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.status')"
|
||||
name="status"
|
||||
:label="t('views.system.dictData.statusFlag')"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
:options="dict.sysNormalDisable"
|
||||
@@ -904,27 +901,27 @@ onMounted(() => {
|
||||
<a-row>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictLabel')"
|
||||
name="dictLabel"
|
||||
v-bind="modalStateFrom.validateInfos.dictLabel"
|
||||
:label="t('views.system.dictData.dataLabel')"
|
||||
name="dataLabel"
|
||||
v-bind="modalStateFrom.validateInfos.dataLabel"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.dictLabel"
|
||||
v-model:value="modalState.from.dataLabel"
|
||||
allow-clear
|
||||
:placeholder="t('views.system.dictData.dictLabelPleac')"
|
||||
:placeholder="t('views.system.dictData.dataLabelPleac')"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictValue')"
|
||||
name="dictValue"
|
||||
v-bind="modalStateFrom.validateInfos.dictValue"
|
||||
:label="t('views.system.dictData.dataValue')"
|
||||
name="dataValue"
|
||||
v-bind="modalStateFrom.validateInfos.dataValue"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.dictValue"
|
||||
v-model:value="modalState.from.dataValue"
|
||||
allow-clear
|
||||
:placeholder="t('views.system.dictData.dictValuePleac')"
|
||||
:placeholder="t('views.system.dictData.dataValuePleac')"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -965,11 +962,11 @@ onMounted(() => {
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dictData.dictSort')"
|
||||
name="dictSort"
|
||||
:label="t('views.system.dictData.dataSort')"
|
||||
name="dataSort"
|
||||
>
|
||||
<a-input-number
|
||||
v-model:value="modalState.from.dictSort"
|
||||
v-model:value="modalState.from.dataSort"
|
||||
:min="0"
|
||||
:max="65535"
|
||||
:placeholder="t('common.inputPlease')"
|
||||
|
||||
@@ -46,7 +46,7 @@ let queryParams = reactive({
|
||||
/**字典类型 */
|
||||
dictType: '',
|
||||
/**字典状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
/**记录开始时间 */
|
||||
beginTime: '',
|
||||
/**记录结束时间 */
|
||||
@@ -62,7 +62,7 @@ function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
dictName: '',
|
||||
dictType: '',
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
pageNum: 1,
|
||||
@@ -119,8 +119,8 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.dict.dictSatus'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
},
|
||||
@@ -202,7 +202,7 @@ let modalState: ModalStateType = reactive({
|
||||
dictId: undefined,
|
||||
dictName: '',
|
||||
dictType: undefined,
|
||||
status: '0',
|
||||
statusFlag: '0',
|
||||
remark: undefined,
|
||||
},
|
||||
confirmLoading: false,
|
||||
@@ -446,13 +446,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listType(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
@@ -513,10 +514,10 @@ onMounted(() => {
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.dict.dictSatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -669,8 +670,8 @@ onMounted(() => {
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.statusFlag" />
|
||||
</template>
|
||||
<template v-if="column.key === 'dictId'">
|
||||
<a-space :size="8" align="center">
|
||||
@@ -740,10 +741,10 @@ onMounted(() => {
|
||||
<a-form-item :label="t('views.system.dict.dictType')" name="dictType">
|
||||
{{ modalState.from.dictType }}
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('views.system.dict.dictSatus')" name="status">
|
||||
<a-form-item :label="t('views.system.dict.dictSatus')" name="statusFlag">
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('views.system.dict.mark')" name="remark">
|
||||
@@ -800,9 +801,9 @@ onMounted(() => {
|
||||
allow-clear
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item :label="t('views.system.dict.dictSatus')" name="status">
|
||||
<a-form-item :label="t('views.system.dict.dictSatus')" name="statusFlag">
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
|
||||
@@ -34,11 +34,11 @@ let queryRangePicker = ref<[string, string]>(['', '']);
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**登录地址 */
|
||||
ipaddr: '',
|
||||
loginIp: '',
|
||||
/**登录账号 */
|
||||
userName: '',
|
||||
/**登录状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
/**开始时间 */
|
||||
beginTime: '',
|
||||
/**结束时间 */
|
||||
@@ -52,9 +52,9 @@ let queryParams = reactive({
|
||||
/**查询参数重置 */
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
ipaddr: '',
|
||||
loginIp: '',
|
||||
userName: '',
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
pageNum: 1,
|
||||
@@ -96,7 +96,7 @@ let tableState: TabeStateType = reactive({
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: t('views.system.log.login.operId'),
|
||||
dataIndex: 'loginId',
|
||||
dataIndex: 'id',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
@@ -108,7 +108,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.log.login.loginIp'),
|
||||
dataIndex: 'ipaddr',
|
||||
dataIndex: 'loginIp',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
},
|
||||
@@ -132,8 +132,8 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.log.login.status'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
},
|
||||
@@ -193,7 +193,7 @@ function fnTableSelectedRows(
|
||||
_: (string | number)[],
|
||||
rows: Record<string, string>[]
|
||||
) {
|
||||
tableState.selectedRowKeys = rows.map(item => item.loginId);
|
||||
tableState.selectedRowKeys = rows.map(item => item.id);
|
||||
// 针对单个登录账号解锁
|
||||
if (rows.length === 1) {
|
||||
tableState.selectedUserName = rows[0].userName;
|
||||
@@ -332,13 +332,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listSysLogLogin(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
@@ -369,10 +370,10 @@ onMounted(() => {
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.login.loginIp')"
|
||||
name="ipaddr"
|
||||
name="loginIp"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.ipaddr"
|
||||
v-model:value="queryParams.loginIp"
|
||||
allow-clear
|
||||
:maxlength="128"
|
||||
></a-input>
|
||||
@@ -393,10 +394,10 @@ onMounted(() => {
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.login.status')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysCommonStatus"
|
||||
>
|
||||
@@ -528,7 +529,7 @@ onMounted(() => {
|
||||
<!-- 表格列表 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="loginId"
|
||||
row-key="id"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
@@ -542,8 +543,8 @@ onMounted(() => {
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysCommonStatus" :value="record.status" />
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag :options="dict.sysCommonStatus" :value="record.statusFlag" />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
@@ -39,11 +39,11 @@ let queryParams = reactive({
|
||||
/**操作模块 */
|
||||
title: '',
|
||||
/**操作人员 */
|
||||
operName: '',
|
||||
operaBy: '',
|
||||
/**业务类型 */
|
||||
businessType: undefined,
|
||||
/**操作状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
/**开始时间 */
|
||||
beginTime: '',
|
||||
/**结束时间 */
|
||||
@@ -58,9 +58,9 @@ let queryParams = reactive({
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
title: '',
|
||||
operName: '',
|
||||
operaBy: '',
|
||||
businessType: undefined,
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
pageNum: 1,
|
||||
@@ -99,8 +99,8 @@ let tableState: TabeStateType = reactive({
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: t('views.system.log.operate.operId'),
|
||||
dataIndex: 'operId',
|
||||
align: 'center',
|
||||
dataIndex: 'id',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
@@ -118,33 +118,33 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.log.operate.operUser'),
|
||||
dataIndex: 'operName',
|
||||
dataIndex: 'operaBy',
|
||||
align: 'left',
|
||||
width: 120,
|
||||
},
|
||||
// {
|
||||
// title: t('views.system.log.operate.requestMe'),
|
||||
// dataIndex: 'requestMethod',
|
||||
// dataIndex: 'operaUrlMethod',
|
||||
// align: 'left',
|
||||
// width: 150,
|
||||
// },
|
||||
{
|
||||
title: t('views.system.log.operate.host'),
|
||||
dataIndex: 'operIp',
|
||||
align: 'center',
|
||||
dataIndex: 'operaIp',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: t('views.system.log.operate.operStatus'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: t('views.system.log.operate.operDate'),
|
||||
dataIndex: 'operTime',
|
||||
align: 'center',
|
||||
dataIndex: 'operaTime',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
customRender(opt) {
|
||||
if (+opt.value <= 0) return '';
|
||||
@@ -163,7 +163,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('common.operate'),
|
||||
key: 'operId',
|
||||
key: 'id',
|
||||
align: 'left',
|
||||
},
|
||||
];
|
||||
@@ -221,20 +221,19 @@ let modalState: ModalStateType = reactive({
|
||||
openByView: false,
|
||||
title: '操作日志',
|
||||
from: {
|
||||
operId: undefined,
|
||||
id: undefined,
|
||||
businessType: 0,
|
||||
deptName: '',
|
||||
method: '',
|
||||
operIp: '',
|
||||
operLocation: '',
|
||||
operMsg: '',
|
||||
operName: '',
|
||||
operParam: '',
|
||||
operTime: 0,
|
||||
operUrl: '',
|
||||
operType: 1,
|
||||
requestMethod: 'PUT',
|
||||
status: 1,
|
||||
operaMethod: '',
|
||||
operaIp: '',
|
||||
operaLocation: '',
|
||||
operaMsg: '',
|
||||
operaBy: '',
|
||||
operaParam: '',
|
||||
operaTime: 0,
|
||||
operaUrl: '',
|
||||
operaUrlMethod: 'PUT',
|
||||
statusFlag: 1,
|
||||
title: '',
|
||||
},
|
||||
});
|
||||
@@ -356,13 +355,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listSysLogOperate(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
@@ -415,10 +415,10 @@ onMounted(() => {
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.operUser')"
|
||||
name="operName"
|
||||
name="operaBy"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.operName"
|
||||
v-model:value="queryParams.operaBy"
|
||||
allow-clear
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
@@ -439,10 +439,10 @@ onMounted(() => {
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.operStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysCommonStatus"
|
||||
>
|
||||
@@ -565,7 +565,7 @@ onMounted(() => {
|
||||
<!-- 表格列表 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="operId"
|
||||
row-key="id"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
@@ -585,10 +585,13 @@ onMounted(() => {
|
||||
:value="record.businessType"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysCommonStatus" :value="record.status" />
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag
|
||||
:options="dict.sysCommonStatus"
|
||||
:value="record.statusFlag"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'operId'">
|
||||
<template v-if="column.key === 'id'">
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.viewText') }}</template>
|
||||
@@ -619,22 +622,22 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.operId')"
|
||||
name="operId"
|
||||
name="id"
|
||||
>
|
||||
{{ modalState.from.operId }}
|
||||
{{ modalState.from.id }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.operStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-tag :color="+modalState.from.status ? 'success' : 'error'">
|
||||
<a-tag :color="+modalState.from.statusFlag ? 'success' : 'error'">
|
||||
{{
|
||||
[
|
||||
t('views.system.log.operate.fail'),
|
||||
t('views.system.log.operate.suss'),
|
||||
][+modalState.from.status]
|
||||
][+modalState.from.statusFlag]
|
||||
}}
|
||||
</a-tag>
|
||||
</a-form-item>
|
||||
@@ -656,9 +659,9 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.operUser')"
|
||||
name="operName"
|
||||
name="operaBy"
|
||||
>
|
||||
{{ modalState.from.operName }} / {{ modalState.from.operIp }}
|
||||
{{ modalState.from.operaBy }} / {{ modalState.from.operaIp }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -666,19 +669,19 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.RequestIp')"
|
||||
name="operUrl"
|
||||
name="operaUrl"
|
||||
>
|
||||
{{ modalState.from.requestMethod }} -
|
||||
{{ modalState.from.operUrl }}
|
||||
{{ modalState.from.operaUrlMethod }} -
|
||||
{{ modalState.from.operaUrl }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.operTime')"
|
||||
name="operTime"
|
||||
name="operaTime"
|
||||
>
|
||||
<span v-if="+modalState.from.operTime > 0">
|
||||
{{ parseDateToStr(+modalState.from.operTime) }}
|
||||
<span v-if="+modalState.from.operaTime > 0">
|
||||
{{ parseDateToStr(+modalState.from.operaTime) }}
|
||||
</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -695,32 +698,32 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<!-- <a-form-item
|
||||
:label="t('views.system.log.operate.operMe')"
|
||||
name="method"
|
||||
name="operaMethod"
|
||||
>
|
||||
{{ modalState.from.method }}
|
||||
{{ modalState.from.operaMethod }}
|
||||
</a-form-item> -->
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.reqParam')"
|
||||
name="operParam"
|
||||
name="operaParam"
|
||||
:label-col="{ span: 3 }"
|
||||
:label-wrap="true"
|
||||
>
|
||||
<a-textarea
|
||||
v-model:value="modalState.from.operParam"
|
||||
v-model:value="modalState.from.operaParam"
|
||||
:auto-size="{ minRows: 2, maxRows: 6 }"
|
||||
:disabled="true"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:label="t('views.system.log.operate.operInfo')"
|
||||
name="operMsg"
|
||||
name="operaMsg"
|
||||
:label-col="{ span: 3 }"
|
||||
:label-wrap="true"
|
||||
>
|
||||
<a-textarea
|
||||
v-model:value="modalState.from.operMsg"
|
||||
v-model:value="modalState.from.operaMsg"
|
||||
:auto-size="{ minRows: 2, maxRows: 6 }"
|
||||
:disabled="true"
|
||||
/>
|
||||
|
||||
@@ -61,14 +61,14 @@ let queryParams = reactive({
|
||||
/**菜单名称 */
|
||||
menuName: undefined,
|
||||
/**状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
});
|
||||
|
||||
/**查询参数重置 */
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
menuName: '',
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
});
|
||||
fnGetList();
|
||||
}
|
||||
@@ -126,7 +126,7 @@ let tableColumns: ColumnsType = [
|
||||
title: t('views.system.menu.menuTitle'),
|
||||
dataIndex: 'icon',
|
||||
key: 'icon',
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
@@ -143,22 +143,22 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.menu.status'),
|
||||
dataIndex: 'visible',
|
||||
key: 'visible',
|
||||
dataIndex: 'visibleFlag',
|
||||
key: 'visibleFlag',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: t('views.system.menu.menuStatus'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'center',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: t('views.system.menu.createTime'),
|
||||
dataIndex: 'createTime',
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
customRender(opt) {
|
||||
if (+opt.value <= 0) return '';
|
||||
@@ -239,13 +239,13 @@ let modalState: ModalStateType = reactive({
|
||||
menuSort: 0,
|
||||
menuType: MENU_TYPE_BUTTON,
|
||||
component: '',
|
||||
path: '',
|
||||
menuPath: '',
|
||||
icon: '#',
|
||||
perms: '',
|
||||
isFrame: '1',
|
||||
isCache: '0',
|
||||
visible: '0',
|
||||
status: '0',
|
||||
frameFlag: '1',
|
||||
cacheFlag: '0',
|
||||
visibleFlag: '0',
|
||||
statusFlag: '0',
|
||||
createTime: 0,
|
||||
remark: '',
|
||||
parentType: '', // 标记禁止菜单类型添加目录和菜单
|
||||
@@ -280,7 +280,7 @@ const modalStateFrom = Form.useForm(
|
||||
message: t('views.system.menu.formLoc') + t('common.unableNull'),
|
||||
},
|
||||
],
|
||||
path: [
|
||||
menuPath: [
|
||||
{
|
||||
required: true,
|
||||
min: 1,
|
||||
@@ -370,11 +370,11 @@ function fnModalVisibleByEdit(
|
||||
function fnModalOk() {
|
||||
let validateNames = ['parentId', 'menuName'];
|
||||
if (modalState.from.menuType === MENU_TYPE_DIR) {
|
||||
validateNames.push('path');
|
||||
validateNames.push('menuPath');
|
||||
}
|
||||
if (modalState.from.menuType === MENU_TYPE_MENU) {
|
||||
validateNames.push('component');
|
||||
validateNames.push('path');
|
||||
validateNames.push('menuPath');
|
||||
validateNames.push('perms');
|
||||
}
|
||||
if (modalState.from.menuType === MENU_TYPE_BUTTON) {
|
||||
@@ -463,9 +463,7 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listMenu(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
// 过滤旧前端菜单
|
||||
res.data = res.data.filter(i => i.perms !== 'page');
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
menuListData = JSON.parse(JSON.stringify(res.data));
|
||||
// 初始上级菜单和展开编号key
|
||||
if (treeDataAll.length <= 0) {
|
||||
@@ -533,10 +531,10 @@ onMounted(() => {
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.menu.menuStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -648,17 +646,20 @@ onMounted(() => {
|
||||
<template v-if="column.key === 'icon'">
|
||||
<IconFont :type="record.icon" style="font-size: 18px"></IconFont>
|
||||
</template>
|
||||
<template v-if="column.key === 'visible'">
|
||||
<a-tag :color="+record.visible ? 'processing' : 'warning'">
|
||||
<template v-if="column.key === 'visibleFlag'">
|
||||
<a-tag :color="+record.visibleFlag ? 'processing' : 'warning'">
|
||||
{{
|
||||
[t('views.system.menu.hidden'), t('views.system.menu.show')][
|
||||
+record.visible
|
||||
+record.visibleFlag
|
||||
]
|
||||
}}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.statusFlag"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'menuId'">
|
||||
<a-space :size="8" align="center">
|
||||
@@ -812,8 +813,8 @@ onMounted(() => {
|
||||
:xs="24"
|
||||
v-if="modalState.from.menuType !== MENU_TYPE_BUTTON"
|
||||
>
|
||||
<a-form-item :label="t('views.system.menu.routerAdrr')" name="path">
|
||||
{{ modalState.from.path }}
|
||||
<a-form-item :label="t('views.system.menu.routerAdrr')" name="menuPath">
|
||||
{{ modalState.from.menuPath }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col
|
||||
@@ -833,11 +834,11 @@ onMounted(() => {
|
||||
|
||||
<a-row v-if="modalState.from.menuType !== MENU_TYPE_BUTTON">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.menu.local')" name="isFrame">
|
||||
<a-form-item :label="t('views.system.menu.local')" name="frameFlag">
|
||||
<a-tag color="default">
|
||||
{{
|
||||
[t('views.system.menu.no'), t('views.system.menu.yes')][
|
||||
+modalState.from.isFrame
|
||||
+modalState.from.frameFlag
|
||||
]
|
||||
}}
|
||||
</a-tag>
|
||||
@@ -846,24 +847,27 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.menu.pageCache')"
|
||||
name="isCache"
|
||||
name="cacheFlag"
|
||||
>
|
||||
<a-tag color="default">
|
||||
{{
|
||||
[
|
||||
t('views.system.menu.noCache'),
|
||||
t('views.system.menu.cache'),
|
||||
][+modalState.from.isCache]
|
||||
][+modalState.from.cacheFlag]
|
||||
}}
|
||||
</a-tag>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.menu.status')" name="visible">
|
||||
<a-form-item
|
||||
:label="t('views.system.menu.status')"
|
||||
name="visibleFlag"
|
||||
>
|
||||
<a-tag color="default">
|
||||
{{
|
||||
[t('views.system.menu.hidden'), t('views.system.menu.show')][
|
||||
+modalState.from.visible
|
||||
+modalState.from.visibleFlag
|
||||
]
|
||||
}}
|
||||
</a-tag>
|
||||
@@ -872,11 +876,11 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.menu.menuStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -1033,10 +1037,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.menu.routerAdrr')"
|
||||
name="path"
|
||||
v-bind="modalStateFrom.validateInfos.path"
|
||||
name="menuPath"
|
||||
v-bind="modalStateFrom.validateInfos.menuPath"
|
||||
>
|
||||
<a-input v-model:value="modalState.from.path" allow-clear>
|
||||
<a-input v-model:value="modalState.from.menuPath" allow-clear>
|
||||
<template #prefix>
|
||||
<a-tooltip placement="topLeft">
|
||||
<template #title>
|
||||
@@ -1057,9 +1061,9 @@ onMounted(() => {
|
||||
|
||||
<a-row v-if="modalState.from.menuType !== MENU_TYPE_BUTTON">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.menu.local')" name="isFrame">
|
||||
<a-form-item :label="t('views.system.menu.local')" name="frameFlag">
|
||||
<a-select
|
||||
v-model:value="modalState.from.isFrame"
|
||||
v-model:value="modalState.from.frameFlag"
|
||||
default-value="0"
|
||||
>
|
||||
<a-select-option key="0" value="0">{{
|
||||
@@ -1074,10 +1078,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.menu.pageCache')"
|
||||
name="isCache"
|
||||
name="cacheFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.isCache"
|
||||
v-model:value="modalState.from.cacheFlag"
|
||||
default-value="0"
|
||||
>
|
||||
<a-select-option key="0" value="0">{{
|
||||
@@ -1090,9 +1094,12 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.menu.status')" name="visible">
|
||||
<a-form-item
|
||||
:label="t('views.system.menu.status')"
|
||||
name="visibleFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.visible"
|
||||
v-model:value="modalState.from.visibleFlag"
|
||||
default-value="0"
|
||||
>
|
||||
<a-select-option key="0" value="0">{{
|
||||
@@ -1107,10 +1114,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.menu.menuStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
|
||||
@@ -37,7 +37,7 @@ let queryParams = reactive({
|
||||
/**岗位名称 */
|
||||
postName: '',
|
||||
/**岗位状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
@@ -49,7 +49,7 @@ function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
postCode: '',
|
||||
postName: '',
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
@@ -109,9 +109,9 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.post.positionStatus'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
@@ -193,7 +193,7 @@ let modalState: ModalStateType = reactive({
|
||||
postName: '',
|
||||
postCode: '',
|
||||
postSort: 0,
|
||||
status: '0',
|
||||
statusFlag: '0',
|
||||
remark: '',
|
||||
createTime: 0,
|
||||
},
|
||||
@@ -400,13 +400,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.pageNum = pageNum;
|
||||
}
|
||||
listPost(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
@@ -467,10 +468,10 @@ onMounted(() => {
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.post.positionStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -590,8 +591,8 @@ onMounted(() => {
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.statusFlag" />
|
||||
</template>
|
||||
<template v-if="column.key === 'postId'">
|
||||
<a-space :size="8" align="center">
|
||||
@@ -672,11 +673,11 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.post.positionStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -754,10 +755,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.post.positionStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
|
||||
@@ -481,7 +481,7 @@ function fnGetList() {
|
||||
listAllNeInfo({
|
||||
bandHost: true,
|
||||
}).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
tabState.panes = [];
|
||||
res.data.forEach((item: any, index: any) => {
|
||||
if (item.neType === 'OMC' || !Array.isArray(item.hosts)) return;
|
||||
|
||||
@@ -81,7 +81,7 @@ function fnGetList() {
|
||||
getPara5GFilee(),
|
||||
listNeInfo({
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 100,
|
||||
}),
|
||||
]).then(resArr => {
|
||||
// 已保存的配置
|
||||
@@ -89,11 +89,9 @@ function fnGetList() {
|
||||
state.from = resArr[0].data;
|
||||
}
|
||||
// 填充固定网元类型的ip
|
||||
if (
|
||||
resArr[1].code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(resArr[1].rows)
|
||||
) {
|
||||
for (const item of resArr[1].rows) {
|
||||
if (resArr[1].code === RESULT_CODE_SUCCESS) {
|
||||
const { rows } = resArr[1].data;
|
||||
for (const item of rows) {
|
||||
switch (item.neType) {
|
||||
case 'OMC':
|
||||
state.from.sbi.omc_ip = item.ip;
|
||||
|
||||
@@ -206,13 +206,13 @@ function fnGetList() {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
}).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (state.selectedRowKeys.length > 0) {
|
||||
state.selectedRowKeys = [];
|
||||
state.selectedRowOne = { neType: '' };
|
||||
}
|
||||
state.data = res.rows.filter(s => s.neType !== 'OMC');
|
||||
state.data = res.data.rows.filter((s: any) => s.neType !== 'OMC');
|
||||
}
|
||||
state.loading = false;
|
||||
});
|
||||
|
||||
@@ -194,12 +194,12 @@ function fnGetList() {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
}).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (state.selectedRowKeys.length > 0) {
|
||||
state.selectedRowKeys = [];
|
||||
}
|
||||
state.data = res.rows.filter(s => s.neType !== 'OMC');
|
||||
state.data = res.data.rows.filter((s: any) => s.neType !== 'OMC');
|
||||
}
|
||||
state.loading = false;
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ import { SizeType } from 'ant-design-vue/es/config-provider';
|
||||
import { MenuInfo } from 'ant-design-vue/es/menu/src/interface';
|
||||
import { ColumnsType } from 'ant-design-vue/es/table';
|
||||
import AuthUserSelect from './components/auth-user-select.vue';
|
||||
import { authUserAllocatedList, authUserChecked } from '@/api/system/role';
|
||||
import { authUserList, authUserChecked } from '@/api/system/role';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useTabsStore from '@/store/modules/tabs';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
@@ -36,7 +36,7 @@ let queryParams = reactive({
|
||||
/**登录账号 */
|
||||
userName: '',
|
||||
/**手机号码 */
|
||||
phonenumber: '',
|
||||
phone: '',
|
||||
/**用户状态 */
|
||||
status: undefined,
|
||||
/**角色ID */
|
||||
@@ -53,7 +53,7 @@ let queryParams = reactive({
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
userName: '',
|
||||
phonenumber: '',
|
||||
phone: '',
|
||||
status: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
@@ -105,7 +105,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.role.phone'),
|
||||
dataIndex: 'phonenumber',
|
||||
dataIndex: 'phone',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
@@ -285,14 +285,15 @@ function fnGetList(pageNum?: number) {
|
||||
if (pageNum) {
|
||||
queryParams.pageNum = pageNum;
|
||||
}
|
||||
authUserAllocatedList(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
authUserList(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
|
||||
tableState.loading = false;
|
||||
fnGetList(queryParams.pageNum - 1);
|
||||
@@ -347,10 +348,10 @@ onMounted(() => {
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.phone')"
|
||||
name="phonenumber"
|
||||
name="phone"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.phonenumber"
|
||||
v-model:value="queryParams.phone"
|
||||
allow-clear
|
||||
:maxlength="11"
|
||||
></a-input>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { message } from 'ant-design-vue/es';
|
||||
import { SizeType } from 'ant-design-vue/es/config-provider';
|
||||
import { ColumnsType } from 'ant-design-vue/es/table';
|
||||
import { ProModal } from 'antdv-pro-modal';
|
||||
import { authUserAllocatedList } from '@/api/system/role';
|
||||
import { authUserList } from '@/api/system/role';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
@@ -40,7 +40,7 @@ let queryParams = reactive({
|
||||
/**登录账号 */
|
||||
userName: '',
|
||||
/**手机号码 */
|
||||
phonenumber: '',
|
||||
phone: '',
|
||||
/**用户状态 */
|
||||
status: undefined,
|
||||
/**角色ID */
|
||||
@@ -57,7 +57,7 @@ let queryParams = reactive({
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
userName: '',
|
||||
phonenumber: '',
|
||||
phone: '',
|
||||
status: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
@@ -106,7 +106,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.role.phone'),
|
||||
dataIndex: 'phonenumber',
|
||||
dataIndex: 'phone',
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
@@ -176,14 +176,15 @@ function fnGetList(pageNum?: number) {
|
||||
if (pageNum) {
|
||||
queryParams.pageNum = pageNum;
|
||||
}
|
||||
authUserAllocatedList(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
authUserList(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
@@ -260,9 +261,9 @@ watch(
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.role.phone')" name="phonenumber">
|
||||
<a-form-item :label="t('views.system.role.phone')" name="phone">
|
||||
<a-input
|
||||
v-model:value="queryParams.phonenumber"
|
||||
v-model:value="queryParams.phone"
|
||||
allow-clear
|
||||
:maxlength="11"
|
||||
></a-input>
|
||||
|
||||
@@ -17,8 +17,8 @@ import {
|
||||
listRole,
|
||||
updateRole,
|
||||
} from '@/api/system/role';
|
||||
import { roleMenuTreeSelect, menuTreeSelect } from '@/api/system/menu';
|
||||
import { roleDeptTreeSelect } from '@/api/system/dept';
|
||||
import { menuTreeSelectRole, menuTreeSelect } from '@/api/system/menu';
|
||||
import { deptTreeRole } from '@/api/system/dept';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
@@ -56,7 +56,7 @@ let queryParams = reactive({
|
||||
/**角色键值 */
|
||||
roleKey: '',
|
||||
/**角色状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
/**记录开始时间 */
|
||||
beginTime: '',
|
||||
/**记录结束时间 */
|
||||
@@ -72,7 +72,7 @@ function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
roleName: '',
|
||||
roleKey: '',
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
pageNum: 1,
|
||||
@@ -135,8 +135,8 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.role.roleStatus'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
},
|
||||
@@ -258,7 +258,7 @@ let modalState: ModalStateType = reactive({
|
||||
roleName: '',
|
||||
roleKey: '',
|
||||
roleSort: 0,
|
||||
status: '0',
|
||||
statusFlag: '0',
|
||||
menuIds: [],
|
||||
deptIds: [],
|
||||
remark: '',
|
||||
@@ -320,7 +320,7 @@ function fnModalVisibleByVive(roleId: string | number) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
// 查询角色详细同时根据角色ID查询菜单下拉树结构
|
||||
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => {
|
||||
Promise.all([getRole(roleId), menuTreeSelectRole(roleId)]).then(resArr => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
|
||||
@@ -366,7 +366,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
|
||||
menuTreeSelect().then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
menuTree.checkedKeys = parseTreeKeys(res.data, 'id');
|
||||
menuTree.expandedKeys = parseTreeNodeKeys(res.data, 'id');
|
||||
menuTree.treeData = res.data;
|
||||
@@ -382,7 +382,7 @@ function fnModalVisibleByEdit(roleId?: string | number) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
// 查询角色详细同时根据角色ID查询菜单下拉树结构
|
||||
Promise.all([getRole(roleId), roleMenuTreeSelect(roleId)]).then(resArr => {
|
||||
Promise.all([getRole(roleId), menuTreeSelectRole(roleId)]).then(resArr => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
|
||||
@@ -570,7 +570,7 @@ function fnRecordDataScope(roleId: string | number) {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
modalState.confirmLoading = true;
|
||||
// 查询角色详细同时根据角色ID查询部门树结构
|
||||
Promise.all([getRole(roleId), roleDeptTreeSelect(roleId)])
|
||||
Promise.all([getRole(roleId), deptTreeRole(roleId)])
|
||||
.then(resArr => {
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
|
||||
modalState.from = Object.assign(modalState.from, resArr[0].data);
|
||||
@@ -619,7 +619,7 @@ function fnRecordAuthUser(row: Record<string, string>) {
|
||||
*/
|
||||
function fnRecordStatus(row: Record<string, string>) {
|
||||
const text =
|
||||
row.status === '1'
|
||||
row.statusFlag === '1'
|
||||
? t('views.system.role.open')
|
||||
: t('views.system.role.close');
|
||||
Modal.confirm({
|
||||
@@ -630,7 +630,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
}),
|
||||
onOk() {
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
changeRoleStatus(row.roleId, row.status).then(res => {
|
||||
changeRoleStatus(row.roleId, row.statusFlag).then(res => {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
@@ -650,7 +650,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
row.status = row.status === '1' ? '0' : '1';
|
||||
row.statusFlag = row.statusFlag === '1' ? '0' : '1';
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -732,13 +732,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listRole(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
if (
|
||||
tablePagination.total <=
|
||||
(queryParams.pageNum - 1) * tablePagination.pageSize &&
|
||||
@@ -796,10 +797,10 @@ onMounted(() => {
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.roleStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -935,14 +936,14 @@ onMounted(() => {
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<a-switch
|
||||
v-if="
|
||||
dict.sysNormalDisable.length > 0 &&
|
||||
record.roleId !== '1' &&
|
||||
record.roleId !== 1 &&
|
||||
hasPermissions(['system:role:edit'])
|
||||
"
|
||||
v-model:checked="record.status"
|
||||
v-model:checked="record.statusFlag"
|
||||
checked-value="1"
|
||||
:checked-children="dict.sysNormalDisable[0].label"
|
||||
un-checked-value="0"
|
||||
@@ -953,7 +954,7 @@ onMounted(() => {
|
||||
<DictTag
|
||||
v-else
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.status"
|
||||
:value="record.statusFlag"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'roleId'">
|
||||
@@ -968,7 +969,7 @@ onMounted(() => {
|
||||
<template #icon><ProfileOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip v-if="record.roleId !== '1'">
|
||||
<a-tooltip v-if="record.roleId !== 1">
|
||||
<template #title>{{ t('common.editText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@@ -978,7 +979,7 @@ onMounted(() => {
|
||||
<template #icon><FormOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip v-if="record.roleId !== '1'">
|
||||
<a-tooltip v-if="record.roleId !== 1">
|
||||
<template #title>{{ t('common.deleteText') }}</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@@ -988,7 +989,7 @@ onMounted(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topRight" v-if="record.roleId !== '1'">
|
||||
<a-tooltip placement="topRight" v-if="record.roleId !== 1">
|
||||
<template #title>{{
|
||||
t('views.system.role.distribute')
|
||||
}}</template>
|
||||
@@ -1000,7 +1001,7 @@ onMounted(() => {
|
||||
<template #icon><SecurityScanOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topRight" v-if="record.roleId !== '1'">
|
||||
<a-tooltip placement="topRight" v-if="record.roleId !== 1">
|
||||
<template #title>{{
|
||||
t('views.system.role.distributeUser')
|
||||
}}</template>
|
||||
@@ -1057,11 +1058,11 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.roleStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -1157,10 +1158,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.roleStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
@@ -1315,11 +1316,11 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.role.roleStatus')"
|
||||
name="status"
|
||||
name="statusFlag"
|
||||
>
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
@@ -58,9 +58,7 @@ function fnEdit(v: boolean) {
|
||||
|
||||
onMounted(() => {
|
||||
listMenu(toRaw({ status: 1 })).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
// 过滤旧前端菜单以及不是菜单类型以及路径为空
|
||||
res.data = res.data.filter(i => i.perms !== 'page' && i.menuType !== 'B');
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
state.options = parseDataToTree(res.data, 'menuId');
|
||||
const setDisabledAndComponent = (item:any) => {
|
||||
if (!item.component) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
updateUser,
|
||||
addUser,
|
||||
} from '@/api/system/user';
|
||||
import { deptTreeSelect } from '@/api/system/dept';
|
||||
import { deptTree } from '@/api/system/dept';
|
||||
import { saveAs } from 'file-saver';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
@@ -34,6 +34,7 @@ import useDictStore from '@/store/modules/dict';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { DataNode } from 'ant-design-vue/es/tree';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { uploadFile } from '@/api/tool/file';
|
||||
const { getDict } = useDictStore();
|
||||
const userStore = useUserStore();
|
||||
const { t } = useI18n();
|
||||
@@ -57,11 +58,11 @@ let queryParams = reactive({
|
||||
/**登录账号 */
|
||||
userName: '',
|
||||
/**手机号 */
|
||||
phonenumber: '',
|
||||
phone: '',
|
||||
/**部门ID */
|
||||
deptId: undefined,
|
||||
/**用户状态 */
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
/**记录开始时间 */
|
||||
beginTime: '',
|
||||
/**记录结束时间 */
|
||||
@@ -76,9 +77,9 @@ let queryParams = reactive({
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
userName: '',
|
||||
phonenumber: '',
|
||||
phone: '',
|
||||
deptId: undefined,
|
||||
status: undefined,
|
||||
statusFlag: undefined,
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
pageNum: 1,
|
||||
@@ -155,7 +156,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.user.loginTime'),
|
||||
dataIndex: 'loginDate',
|
||||
dataIndex: 'loginTime',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
customRender(opt) {
|
||||
@@ -165,8 +166,8 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: t('views.system.user.status'),
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
dataIndex: 'statusFlag',
|
||||
key: 'statusFlag',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
},
|
||||
@@ -253,14 +254,14 @@ let modalState: ModalStateType = reactive({
|
||||
password: '',
|
||||
deptId: '100',
|
||||
email: '',
|
||||
loginDate: 0,
|
||||
loginTime: 0,
|
||||
loginIp: '',
|
||||
nickName: '',
|
||||
phonenumber: '',
|
||||
phone: '',
|
||||
postIds: [],
|
||||
roleIds: [],
|
||||
sex: '0',
|
||||
status: '0',
|
||||
statusFlag: '0',
|
||||
remark: '',
|
||||
createTime: 0,
|
||||
},
|
||||
@@ -303,7 +304,7 @@ const modalStateFrom = Form.useForm(
|
||||
message: t('views.system.user.emailTip'),
|
||||
},
|
||||
],
|
||||
phonenumber: [
|
||||
phone: [
|
||||
{
|
||||
required: false,
|
||||
pattern: regExpMobile,
|
||||
@@ -330,12 +331,12 @@ function fnModalVisibleByVive(userId: string | number) {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
const roles = res.data.roles.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
const disabled = m.statusFlag === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
const disabled = m.statusFlag === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
@@ -371,12 +372,12 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
const roles = res.data.roles.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
const disabled = m.statusFlag === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
const disabled = m.statusFlag === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
@@ -403,12 +404,12 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
const roles = res.data.roles.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
const disabled = m.statusFlag === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
const disabled = m.statusFlag === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
@@ -433,7 +434,7 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalOk() {
|
||||
let validateName = ['nickName', 'email', 'phonenumber'];
|
||||
let validateName = ['nickName', 'email', 'phone'];
|
||||
if (!modalState.from.userId) {
|
||||
validateName.push('userName', 'password');
|
||||
}
|
||||
@@ -542,7 +543,7 @@ function fnRecordResetPwd(row: Record<string, string>) {
|
||||
*/
|
||||
function fnRecordStatus(row: Record<string, string>) {
|
||||
const text =
|
||||
row.status === '1'
|
||||
row.statusFlag === '1'
|
||||
? t('views.system.user.start')
|
||||
: t('views.system.user.stop');
|
||||
Modal.confirm({
|
||||
@@ -554,7 +555,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
onOk() {
|
||||
const key = 'changeUserStatus';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
changeUserStatus(row.userId, row.status).then(res => {
|
||||
changeUserStatus(row.userId, row.statusFlag).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${row.userName} ${t('common.msgSuccess', { msg: text })}`,
|
||||
@@ -572,7 +573,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
row.status = row.status === '1' ? '0' : '1';
|
||||
row.statusFlag = row.statusFlag === '1' ? '0' : '1';
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -617,26 +618,27 @@ function fnExportList() {
|
||||
title: t('common.tipTitle'),
|
||||
content: t('views.system.user.exportSure'),
|
||||
onOk() {
|
||||
const key = 'exportUser';
|
||||
message.loading({ content: t('common.loading'), key });
|
||||
exportUser(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.msgSuccess', {
|
||||
msg: t('views.system.user.export'),
|
||||
}),
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
saveAs(res.data, `user_${Date.now()}.xlsx`);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
});
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
exportUser(toRaw(queryParams))
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: t('common.msgSuccess', {
|
||||
msg: t('views.system.user.export'),
|
||||
}),
|
||||
duration: 3,
|
||||
});
|
||||
saveAs(res.data, `user_${Date.now()}.xlsx`);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -681,17 +683,30 @@ function fnModalUploadImportClose() {
|
||||
|
||||
/**对话框表格信息导入上传 */
|
||||
function fnModalUploadImportUpload(file: File) {
|
||||
// 发送请求
|
||||
const hide = message.loading(t('common.loading'), 0);
|
||||
uploadImportState.loading = true;
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('updateSupport', `${uploadImportState.updateSupport}`);
|
||||
importData(formData)
|
||||
formData.append('subPath', 'import');
|
||||
uploadFile(formData)
|
||||
.then(res => {
|
||||
uploadImportState.msg = res.msg?.replaceAll(/<br\/>+/g, '\r');
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
return res.data.filePath;
|
||||
}
|
||||
return '';
|
||||
})
|
||||
.catch((err: { code: number; msg: string }) => {
|
||||
message.error(` ${err.msg}`);
|
||||
.then(filePath => {
|
||||
if (filePath === '') return undefined;
|
||||
return importData(filePath, uploadImportState.updateSupport);
|
||||
})
|
||||
.then(res => {
|
||||
if (res === undefined) return;
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
uploadImportState.msg = res.msg?.replaceAll(/<br\/>+/g, '\r');
|
||||
} else {
|
||||
message.error(res.msg, 3);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
@@ -738,13 +753,14 @@ function fnGetList(pageNum?: number) {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listUser(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
const { total, rows } = res.data;
|
||||
tablePagination.total = total;
|
||||
tableState.data = rows;
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
@@ -756,8 +772,8 @@ let deptTreeData = ref<DataNode[]>([]);
|
||||
/**查询部门下拉树结构 */
|
||||
function fnGetDeptTree() {
|
||||
if (deptTreeData.value.length > 0) return;
|
||||
deptTreeSelect().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
deptTree().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
deptTreeData.value = res.data;
|
||||
}
|
||||
});
|
||||
@@ -849,10 +865,10 @@ onMounted(() => {
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.phone')"
|
||||
name="phonenumber"
|
||||
name="phone"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="queryParams.phonenumber"
|
||||
v-model:value="queryParams.phone"
|
||||
allow-clear
|
||||
:maxlength="11"
|
||||
:placeholder="t('common.inputPlease')"
|
||||
@@ -860,9 +876,9 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.user.status')" name="status">
|
||||
<a-form-item :label="t('views.system.user.status')" name="statusFlag">
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
v-model:value="queryParams.statusFlag"
|
||||
allow-clear
|
||||
:options="dict.sysNormalDisable"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
@@ -1001,18 +1017,18 @@ onMounted(() => {
|
||||
<template v-if="column.key === 'deptId'">
|
||||
{{ record.dept?.deptName }}
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<template v-if="column.key === 'statusFlag'">
|
||||
<DictTag
|
||||
v-if="
|
||||
record.userId === '1' || record.userName === userStore.userName
|
||||
record.userId === 1 || record.userName === userStore.userName
|
||||
"
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.status"
|
||||
:value="record.statusFlag"
|
||||
/>
|
||||
<a-switch
|
||||
v-else
|
||||
v-perms:has="['system:user:edit']"
|
||||
v-model:checked="record.status"
|
||||
v-model:checked="record.statusFlag"
|
||||
checked-value="1"
|
||||
:checked-children="dict.sysNormalDisable[0].label"
|
||||
un-checked-value="0"
|
||||
@@ -1022,7 +1038,7 @@ onMounted(() => {
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'userId'">
|
||||
<a-space :size="8" align="center" v-if="record.userId !== '1'">
|
||||
<a-space :size="8" align="center" v-if="record.userId !== 1">
|
||||
<a-tooltip>
|
||||
<template #title>{{ t('common.viewText') }}</template>
|
||||
<a-button
|
||||
@@ -1107,10 +1123,10 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.loginTime')"
|
||||
name="loginDate"
|
||||
name="loginTime"
|
||||
>
|
||||
<span v-if="+modalState.from.loginDate > 0">
|
||||
{{ parseDateToStr(+modalState.from.loginDate) }}
|
||||
<span v-if="+modalState.from.loginTime > 0">
|
||||
{{ parseDateToStr(+modalState.from.loginTime) }}
|
||||
</span>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -1154,10 +1170,10 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item :label="t('views.system.user.status')" name="status">
|
||||
<a-form-item :label="t('views.system.user.status')" name="statusFlag">
|
||||
<DictTag
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="modalState.from.status"
|
||||
:value="modalState.from.statusFlag"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -1167,9 +1183,9 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.phone')"
|
||||
name="phonenumber"
|
||||
name="phone"
|
||||
>
|
||||
{{ modalState.from.phonenumber }}
|
||||
{{ modalState.from.phone }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
@@ -1361,11 +1377,11 @@ onMounted(() => {
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
:label="t('views.system.user.phone')"
|
||||
name="phonenumber"
|
||||
v-bind="modalStateFrom.validateInfos.phonenumber"
|
||||
name="phone"
|
||||
v-bind="modalStateFrom.validateInfos.phone"
|
||||
>
|
||||
<IntlTelInput
|
||||
v-model:value="modalState.from.phonenumber"
|
||||
v-model:value="modalState.from.phone"
|
||||
allow-clear
|
||||
:maxlength="20"
|
||||
:placeholder="t('common.inputPlease')"
|
||||
@@ -1405,13 +1421,13 @@ onMounted(() => {
|
||||
:md="12"
|
||||
:xs="24"
|
||||
v-if="
|
||||
modalState.from.userId !== '1' &&
|
||||
modalState.from.userId !== 1 &&
|
||||
modalState.from.userId !== userStore.userId
|
||||
"
|
||||
>
|
||||
<a-form-item :label="t('views.system.user.status')" name="status">
|
||||
<a-form-item :label="t('views.system.user.status')" name="statusFlag">
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
v-model:value="modalState.from.statusFlag"
|
||||
default-value="0"
|
||||
:options="dict.sysNormalDisable"
|
||||
:placeholder="t('common.selectPlease')"
|
||||
|
||||
Reference in New Issue
Block a user