mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-05 18:23:47 +08:00
@@ -36,10 +36,10 @@ export const employeeApi = {
|
||||
return postRequest('/employee/update', params);
|
||||
},
|
||||
/**
|
||||
* 更新登录人信息
|
||||
* 更新员工个人中心信息
|
||||
*/
|
||||
updateByLogin: (params) => {
|
||||
return postRequest('/employee/update/login', params);
|
||||
updateCenter: (params) => {
|
||||
return postRequest('/employee/update/center', params);
|
||||
},
|
||||
/**
|
||||
* 更新登录人头像
|
||||
@@ -77,25 +77,22 @@ export const employeeApi = {
|
||||
updateEmployeePassword: (param) => {
|
||||
return postEncryptRequest('/employee/update/password', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取密码复杂度
|
||||
*/
|
||||
getPasswordComplexityEnabled: () => {
|
||||
return getRequest('/employee/getPasswordComplexityEnabled');
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新员工禁用状态
|
||||
*/
|
||||
updateDisabled: (employeeId) => {
|
||||
return getRequest(`/employee/update/disabled/${employeeId}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询员工-根据部门id
|
||||
*/
|
||||
queryEmployeeByDeptId: (departmentId) => {
|
||||
return getRequest(`/employee/query/dept/${departmentId}`);
|
||||
return getRequest(`/employee/getAllEmployeeByDepartmentId/${departmentId}`);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" :options="optionList" @change="handleChange" />
|
||||
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" @change="handleChange" :disabled="disabled">
|
||||
<a-checkbox v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -22,19 +26,32 @@
|
||||
type: String,
|
||||
default: '200px',
|
||||
},
|
||||
// 禁用整个多选框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
// ------------ 枚举数据 加载和构建 ------------
|
||||
|
||||
const optionList = ref([]);
|
||||
function buildOptionList() {
|
||||
const valueDescList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
const valueList = smartEnumPlugin.getValueDescList(props.enumName);
|
||||
optionList.value = valueList.map((e) => Object.assign({}, { value: e.value, label: e.desc }));
|
||||
}
|
||||
|
||||
onMounted(buildOptionList);
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
// ------------ 数据选中 事件及其相关 ------------
|
||||
|
||||
@@ -43,11 +60,14 @@
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除这些选项
|
||||
selectValue.value = newValue.filter((item) => !props.hiddenOption.includes(item) && !props.disabledOption.includes(item));
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function handleChange(value) {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
-->
|
||||
<template>
|
||||
<template v-if="isButton">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid">
|
||||
<a-radio-button v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid" :disabled="disabled">
|
||||
<a-radio-button v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange">
|
||||
<a-radio v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-radio-group v-model:value="selectValue" @change="handleChange" :disabled="disabled">
|
||||
<a-radio v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
@@ -26,7 +26,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { ref, watch, onMounted, getCurrentInstance } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
enumName: String,
|
||||
@@ -43,19 +43,44 @@
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 禁用整个单选框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
const valueDescList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除该选项
|
||||
selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function handleChange(e) {
|
||||
emit('update:value', e.target.value);
|
||||
emit('change', e.target.value);
|
||||
|
||||
@@ -19,18 +19,18 @@
|
||||
@change="handleChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value">
|
||||
<a-select-option v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
|
||||
{{ item.desc }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue';
|
||||
import { ref, watch, onMounted, getCurrentInstance } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
enumName: String,
|
||||
value: [Number,String],
|
||||
value: [Number, String],
|
||||
width: {
|
||||
type: String,
|
||||
default: '100%',
|
||||
@@ -43,23 +43,44 @@
|
||||
type: String,
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用整个下拉选择框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项枚举值
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项枚举值
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
const valueDescList = ref([]);
|
||||
|
||||
onMounted(() => {
|
||||
const internalInstance = getCurrentInstance(); // 有效 全局
|
||||
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
|
||||
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
|
||||
});
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
selectValue.value = newValue;
|
||||
}
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除该选项
|
||||
selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function handleChange(value) {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
:allowClear="true"
|
||||
:size="size"
|
||||
@change="onChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in dictKeyCodeList" :key="item.keyCode" :value="item.keyCode">
|
||||
{{ item.keyName }}
|
||||
@@ -27,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch, defineExpose } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
defineExpose({
|
||||
@@ -49,7 +50,7 @@
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用标识
|
||||
disabledFlag: {
|
||||
disabled: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
|
||||
@@ -20,7 +20,12 @@
|
||||
@change="onChange"
|
||||
:disabled="disabled"
|
||||
>
|
||||
<a-select-option v-for="item in dictValueList" :key="item.valueCode" :value="item.valueCode">
|
||||
<a-select-option
|
||||
v-for="item in dictValueList"
|
||||
:key="item.valueCode"
|
||||
:value="item.valueCode"
|
||||
:disabled="disabledOption.includes(item.valueCode)"
|
||||
>
|
||||
{{ item.valueName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@@ -28,7 +33,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
const props = defineProps({
|
||||
@@ -50,10 +55,21 @@
|
||||
type: String,
|
||||
default: 'default',
|
||||
},
|
||||
// 禁用整个下拉选择框
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 需要禁用的选项字典值编码
|
||||
disabledOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
// 需要隐藏的选项字典值编码
|
||||
hiddenOption: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
|
||||
// -------------------------- 查询 字典数据 --------------------------
|
||||
@@ -61,7 +77,7 @@
|
||||
const dictValueList = ref([]);
|
||||
async function queryDict() {
|
||||
let res = await dictApi.valueList(props.keyCode);
|
||||
dictValueList.value = res.data;
|
||||
dictValueList.value = res.data.filter((item) => !props.hiddenOption.includes(item.valueCode));
|
||||
}
|
||||
|
||||
onMounted(queryDict);
|
||||
@@ -69,26 +85,24 @@
|
||||
// -------------------------- 选中 相关、事件 --------------------------
|
||||
|
||||
const selectValue = ref(props.value);
|
||||
|
||||
watch(
|
||||
() => props.value,
|
||||
(value) => {
|
||||
selectValue.value = value;
|
||||
}
|
||||
(newValue) => {
|
||||
// 如果传入的值是被禁用或被隐藏的选项,则移除这些选项
|
||||
if (Array.isArray(newValue)) {
|
||||
selectValue.value = newValue.filter((item) => !props.disabledOption.includes(item) && !props.hiddenOption.includes(item));
|
||||
} else {
|
||||
selectValue.value = props.hiddenOption.includes(newValue) || props.disabledOption.includes(newValue) ? undefined : newValue;
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
function onChange(value) {
|
||||
if (!value) {
|
||||
emit('update:value', []);
|
||||
emit('change', []);
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
} else {
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
}
|
||||
emit('update:value', value);
|
||||
emit('change', value);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -68,7 +68,15 @@
|
||||
// 原始表格列数据(复制一份最原始的columns集合,以供后续各个地方使用)
|
||||
let originalColumn = _.cloneDeep(props.modelValue);
|
||||
|
||||
onMounted(buildUserTableColumns);
|
||||
onMounted(() => {
|
||||
buildUserTableColumns();
|
||||
// 监听全屏事件 解决按下 ESC 退出全屏 fullScreenFlag 未改变导致下次第一下点击全屏无效的问题
|
||||
addEventListener('fullscreenchange', (event) => {
|
||||
if (document.fullscreenElement === null) {
|
||||
fullScreenFlag.value = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//构建用户的数据列
|
||||
async function buildUserTableColumns() {
|
||||
|
||||
@@ -9,46 +9,70 @@
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<a-modal :width="700" :open="visible" title="设置列" :destroyOnClose="true" :closable="false">
|
||||
<a-alert type="info" show-icon class="smart-margin-bottom10">
|
||||
<template #icon><smile-outlined /></template>
|
||||
<template #message> 可以通过拖拽行直接修改顺序哦;( <pushpin-outlined />为固定列,不可拖拽 )</template>
|
||||
</a-alert>
|
||||
<a-table
|
||||
id="smartTableColumnModalTable"
|
||||
rowKey="columnKey"
|
||||
row-class-name="column-row"
|
||||
:columns="tableColumns"
|
||||
:dataSource="tableData"
|
||||
:rowSelection="{ checkStrictly: false, selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
size="small"
|
||||
bordered
|
||||
>
|
||||
<template #bodyCell="{ text, record, index, column }">
|
||||
<template v-if="column.dataIndex === 'title'">
|
||||
<a-button type="text" :class="record.fixed ? '' : 'handle'" size="small" style="width: 100%; text-align: left">
|
||||
<template #icon v-if="!record.fixed"> <drag-outlined /> </template>
|
||||
<template #icon v-if="record.fixed"> <pushpin-outlined /> </template>
|
||||
{{ text }}
|
||||
</a-button>
|
||||
<a-modal :width="800" :open="visible" title="设置列" :destroyOnClose="true" :closable="false">
|
||||
<div v-if="!tableId">
|
||||
<a-alert type="error" show-icon class="smart-margin-bottom10">
|
||||
<template #message> 您尚未设置 TableOperator 组件的 tableId</template>
|
||||
</a-alert>
|
||||
<a-alert type="error" class="smart-margin-bottom10">
|
||||
<template #message>
|
||||
1. 请在 src\constants\support\table-id-const.js 中配置 tableId 常量
|
||||
<br />
|
||||
<br />
|
||||
2. 在自己的业务表格页面组件中使用如下:
|
||||
<br />
|
||||
导入: import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
<br />
|
||||
使用: {{ '<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.XXX" :refresh="queryData" />' }}
|
||||
<br />
|
||||
<br />
|
||||
3. 具体用法可参考员工管理
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'width'">
|
||||
<a-input-number v-model:value="record.width" style="width: 90px; margin-left: 10px; margin-right: 3px" size="small" />px
|
||||
</a-alert>
|
||||
</div>
|
||||
<div v-else>
|
||||
<a-alert type="info" show-icon class="smart-margin-bottom10">
|
||||
<template #icon><smile-outlined /></template>
|
||||
<template #message> 可以通过拖拽行直接修改顺序哦;( <pushpin-outlined />为固定列,不可拖拽 )</template>
|
||||
</a-alert>
|
||||
<a-table
|
||||
id="smartTableColumnModalTable"
|
||||
rowKey="columnKey"
|
||||
row-class-name="column-row"
|
||||
:columns="tableColumns"
|
||||
:dataSource="tableData"
|
||||
:rowSelection="{ checkStrictly: false, selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
size="small"
|
||||
bordered
|
||||
>
|
||||
<template #bodyCell="{ text, record, index, column }">
|
||||
<template v-if="column.dataIndex === 'title'">
|
||||
<a-button type="text" :class="record.fixed ? '' : 'handle'" size="small" style="width: 100%; text-align: left">
|
||||
<template #icon>
|
||||
<drag-outlined v-if="!record.fixed" />
|
||||
<pushpin-outlined v-else />
|
||||
</template>
|
||||
{{ text }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'width'">
|
||||
<a-input-number v-model:value="record.width" style="width: 90px; margin-left: 10px; margin-right: 3px" size="small" />px
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operate'">
|
||||
<div class="smart-table-operate" v-if="!record.fixed">
|
||||
<a-button @click="up(index)" v-show="index > 0" type="link" class="handle" size="small" style="margin-right: 12px"> 上移 </a-button>
|
||||
<a-button @click="down(index)" type="link" class="handle" size="small" v-show="index !== tableData.length - 1"> 下移</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operate'">
|
||||
<div class="smart-table-operate" v-if="!record.fixed">
|
||||
<a-button @click="up(index)" v-show="index > 0" type="link" class="handle" size="small" style="margin-right: 12px"> 上移 </a-button>
|
||||
<a-button @click="down(index)" type="link" class="handle" size="small" v-show="index !== tableData.length - 1"> 下移</a-button>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<a-button key="back" @click="hide">取消</a-button>
|
||||
<a-button key="submit" type="primary" :loading="submitLoading" @click="save">保存</a-button>
|
||||
<a-button key="back" :loading="submitLoading" @click="reset" danger style="margin-left: 20px">恢复默认</a-button>
|
||||
<a-button v-if="tableId" key="submit" type="primary" :loading="submitLoading" @click="save">保存</a-button>
|
||||
<a-button v-if="tableId" key="back" :loading="submitLoading" @click="reset" danger style="margin-left: 20px">恢复默认</a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
</template>
|
||||
@@ -67,7 +91,7 @@
|
||||
defineExpose({ show });
|
||||
|
||||
// ---------------- 显示 / 隐藏 --------------------
|
||||
let tableId = 1;
|
||||
let tableId = null;
|
||||
const visible = ref(false);
|
||||
//显示
|
||||
function show(columns, showTableId) {
|
||||
@@ -83,6 +107,9 @@
|
||||
|
||||
//获取用户的列数据
|
||||
async function getUserTableColumns(tableId, columns) {
|
||||
if (!tableId) {
|
||||
return;
|
||||
}
|
||||
SmartLoading.show();
|
||||
let userTableColumnArray = [];
|
||||
try {
|
||||
|
||||
@@ -21,7 +21,7 @@ export function privilegeDirective(el, binding) {
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
// 如果有权限,删除节点
|
||||
// 如果没有权限,删除节点
|
||||
if (!_.some(userPointsList, ['webPerms', binding.value])) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import _ from 'lodash';
|
||||
|
||||
const privilege = (value) => {
|
||||
// 超级管理员
|
||||
@@ -19,7 +20,7 @@ const privilege = (value) => {
|
||||
if (!userPointsList) {
|
||||
return false;
|
||||
}
|
||||
return userPointsList && userPointsList.includes(value);
|
||||
return _.some(userPointsList, ['apiPerms', value]);
|
||||
};
|
||||
|
||||
export default {
|
||||
|
||||
@@ -73,7 +73,7 @@ export const useUserStore = defineStore({
|
||||
}
|
||||
return localRead(localKey.USER_TOKEN);
|
||||
},
|
||||
getNeedUpdatePwdFlag(state){
|
||||
getNeedUpdatePwdFlag(state) {
|
||||
return state.needUpdatePwdFlag;
|
||||
},
|
||||
//是否初始化了 路由
|
||||
@@ -206,7 +206,7 @@ export const useUserStore = defineStore({
|
||||
// @ts-ignore
|
||||
menuTitle: route.meta.title,
|
||||
menuQuery: route.query,
|
||||
menuIcon:route.meta?.icon,
|
||||
menuIcon: route.meta?.icon,
|
||||
// @ts-ignore
|
||||
fromMenuName: from.name,
|
||||
fromMenuQuery: from.query,
|
||||
|
||||
@@ -11,17 +11,17 @@
|
||||
<a-card style="margin-bottom: 15px" size="small">
|
||||
<a-descriptions :title="noticeDetail.title" :column="4" size="small">
|
||||
<template #extra>
|
||||
<a-button v-if="!noticeDetail.publishFlag" type="primary" size="small" @click="onEdit">编辑</a-button>
|
||||
<a-button type="primary" size="small" @click="onEdit">编辑</a-button>
|
||||
</template>
|
||||
<a-descriptions-item label="分类">{{ noticeDetail.noticeTypeName }}</a-descriptions-item>
|
||||
<a-descriptions-item label="文号">{{ noticeDetail.documentNumber }}</a-descriptions-item>
|
||||
<a-descriptions-item label="文号">{{ noticeDetail.documentNumber ? noticeDetail.documentNumber : '无' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="来源">{{ noticeDetail.source }}</a-descriptions-item>
|
||||
<a-descriptions-item label="作者">{{ noticeDetail.author }}</a-descriptions-item>
|
||||
<a-descriptions-item label="页面浏览量">{{ noticeDetail.pageViewCount }}</a-descriptions-item>
|
||||
<a-descriptions-item label="用户浏览量">{{ noticeDetail.userViewCount }}</a-descriptions-item>
|
||||
<a-descriptions-item label="创建时间">{{ noticeDetail.createTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="发布时间">{{ noticeDetail.publishTime }}</a-descriptions-item>
|
||||
<a-descriptions-item label="定时发布">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="发布状态">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item>
|
||||
<a-descriptions-item label="删除状态">{{ noticeDetail.deletedFlag ? '已删除' : '未删除' }}</a-descriptions-item>
|
||||
<a-descriptions-item v-if="!$lodash.isEmpty(noticeDetail.attachment)" label="附件">
|
||||
<div class="file-list">
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</a-button-group>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
<a-row class="smart-query-form-row"> </a-row>
|
||||
<a-row class="smart-query-form-row" />
|
||||
</a-form>
|
||||
|
||||
<a-card size="small" :bordered="false">
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="创建人" class="smart-query-form-item">
|
||||
<a-input style="width: 100px" v-model:value="queryForm.createUserId" placeholder="创建人" />
|
||||
<a-input style="width: 100px" v-model:value="queryForm.createUserName" placeholder="创建人" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="是否删除" class="smart-query-form-item">
|
||||
@@ -91,6 +91,9 @@
|
||||
<template v-if="column.dataIndex === 'title'">
|
||||
<a @click="toDetail(record.noticeId)">{{ text }}</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'documentNumber'">
|
||||
{{ text ? text : '无' }}
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'allVisibleFlag'"> {{ text ? '全部可见' : '部分可见' }} </template>
|
||||
<template v-else-if="column.dataIndex === 'publishFlag'">
|
||||
{{ text ? '已发布' : '待发布' }}
|
||||
@@ -145,7 +148,7 @@
|
||||
noticeTypeId: undefined, //分类
|
||||
keywords: '', //标题、作者、来源
|
||||
documentNumber: '', //文号
|
||||
createUserId: undefined, //创建人
|
||||
createUserName: undefined, //创建人
|
||||
deletedFlag: undefined, //删除标识
|
||||
createTimeBegin: null, //创建-开始时间
|
||||
createTimeEnd: null, //创建-截止时间
|
||||
@@ -195,7 +198,7 @@
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '发布',
|
||||
title: '发布状态',
|
||||
dataIndex: 'publishFlag',
|
||||
width: 80,
|
||||
},
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
function setData(tableColumns, config) {
|
||||
//------------- 更新基础信息 -----------------
|
||||
if (config.insertAndUpdate) {
|
||||
formData.isSupportInsertAndUpdate = config.insertAndUpdate.isSupportInsertAndUpdate ? config.insertAndUpdate.isSupportInsertAndUpdate : true;
|
||||
formData.isSupportInsertAndUpdate = config.insertAndUpdate.isSupportInsertAndUpdate;
|
||||
formData.pageType = config.insertAndUpdate.pageType;
|
||||
formData.width = config.insertAndUpdate.width;
|
||||
formData.countPerLine = config.insertAndUpdate.countPerLine;
|
||||
|
||||
@@ -107,7 +107,8 @@
|
||||
<template v-if="column.dataIndex === 'enabledFlag'">
|
||||
<a-switch
|
||||
v-model:checked="record.enabledFlag"
|
||||
checked-children="已启用" un-checked-children="已禁用"
|
||||
checked-children="已启用"
|
||||
un-checked-children="已禁用"
|
||||
@change="(checked) => handleEnabledUpdate(checked, record)"
|
||||
:loading="record.enabledLoading"
|
||||
/>
|
||||
@@ -117,31 +118,31 @@
|
||||
<a-button v-privilege="'support:job:update'" @click="openUpdateModal(record)" type="link">编辑</a-button>
|
||||
<a-button v-privilege="'support:job:execute'" type="link" @click="openExecuteModal(record)">执行</a-button>
|
||||
<a-button v-privilege="'support:job:log:query'" @click="openJobLogModal(record.jobId, record.jobName)" type="link">记录</a-button>
|
||||
<a-button danger v-privilege="'support:job:log:delete'" @click="confirmDelete(record.jobId, record.jobName)" type="link">删除</a-button>
|
||||
<a-button danger v-privilege="'support:job:log:delete'" @click="confirmDelete(record.jobId, record.jobName)" type="link"
|
||||
>删除</a-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="queryJobList"
|
||||
@showSizeChange="queryJobList"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="queryJobList"
|
||||
@showSizeChange="queryJobList"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="已删除任务"><DeletedJobList /></a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
|
||||
</a-card>
|
||||
|
||||
<!-- 表单操作 -->
|
||||
@@ -152,7 +153,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {message, Modal} from 'ant-design-vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { jobApi } from '/@/api/support/job-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
@@ -163,7 +164,7 @@
|
||||
import { TRIGGER_TYPE_ENUM } from '/@/constants/support/job-const.js';
|
||||
import JobFormModal from './components/job-form-modal.vue';
|
||||
import JobLogListModal from './components/job-log-list-modal.vue';
|
||||
import {SmartLoading} from "/@/components/framework/smart-loading/index.js";
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading/index.js';
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
@@ -241,6 +242,8 @@
|
||||
},
|
||||
]);
|
||||
|
||||
const activeKey = ref('1');
|
||||
|
||||
// ---------------- 查询数据 -----------------------
|
||||
|
||||
const queryFormState = {
|
||||
@@ -333,7 +336,7 @@
|
||||
|
||||
// ------------------------------------ 删除操作 -------------------------------------
|
||||
|
||||
function confirmDelete(jobId, jobName){
|
||||
function confirmDelete(jobId, jobName) {
|
||||
Modal.confirm({
|
||||
title: '警告',
|
||||
content: `确定要删除【${jobName}】任务吗?`,
|
||||
@@ -347,15 +350,15 @@
|
||||
});
|
||||
}
|
||||
|
||||
async function deleteJob(jobId){
|
||||
try{
|
||||
async function deleteJob(jobId) {
|
||||
try {
|
||||
SmartLoading.show();
|
||||
await jobApi.deleteJob(jobId);
|
||||
message.success('删除成功!');
|
||||
queryJobList();
|
||||
}catch (e){
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
}finally {
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,16 @@
|
||||
<a-form-item label="登录账号" name="loginName">
|
||||
<a-input class="form-item" v-model:value.trim="form.loginName" placeholder="请输入登录账号" disabled />
|
||||
</a-form-item>
|
||||
<a-form-item label="部门" name="departmentId">
|
||||
<DepartmentTreeSelect
|
||||
class="form-item"
|
||||
ref="departmentTreeSelect"
|
||||
width="100%"
|
||||
:init="false"
|
||||
v-model:value="form.departmentId"
|
||||
disabled
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="员工名称" name="actualName">
|
||||
<a-input class="form-item" v-model:value.trim="form.actualName" placeholder="请输入员工名称" />
|
||||
</a-form-item>
|
||||
@@ -20,8 +30,11 @@
|
||||
<a-form-item label="手机号码" name="phone">
|
||||
<a-input class="form-item" v-model:value.trim="form.phone" placeholder="请输入手机号码" />
|
||||
</a-form-item>
|
||||
<a-form-item label="部门" name="departmentId">
|
||||
<DepartmentTreeSelect class="form-item" ref="departmentTreeSelect" width="100%" :init="false" v-model:value="form.departmentId" />
|
||||
<a-form-item label="邮箱" name="email">
|
||||
<a-input v-model:value.trim="form.email" placeholder="请输入邮箱" />
|
||||
</a-form-item>
|
||||
<a-form-item label="职务" name="positionId">
|
||||
<PositionSelect v-model:value="form.positionId" placeholder="请选择职务" />
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="remark">
|
||||
<a-textarea class="form-item" v-model:value="form.remark" placeholder="请输入备注" :rows="4" />
|
||||
@@ -65,6 +78,7 @@
|
||||
import { onMounted, reactive, ref } from 'vue';
|
||||
import { regular } from '/@/constants/regular-const.js';
|
||||
import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue';
|
||||
import PositionSelect from '/@/components/system/position-select/index.vue';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
import { loginApi } from '/@/api/system/login-api.js';
|
||||
import { useUserStore } from '/@/store/modules/system/user.js';
|
||||
@@ -93,10 +107,12 @@
|
||||
phone: '',
|
||||
// 部门id
|
||||
departmentId: undefined,
|
||||
// 是否启用
|
||||
disabledFlag: undefined,
|
||||
// 邮箱
|
||||
email: undefined,
|
||||
// 职务级别
|
||||
positionId: undefined,
|
||||
// 是否禁用
|
||||
disabledFlag: undefined,
|
||||
// 备注
|
||||
remark: '',
|
||||
};
|
||||
@@ -111,7 +127,7 @@
|
||||
{ pattern: regular.phone, message: '请输入正确的手机号码', trigger: 'blur' },
|
||||
],
|
||||
gender: [{ required: true, message: '性别不能为空' }],
|
||||
departmentId: [{ required: true, message: '部门不能为空' }],
|
||||
email: [{ required: true, message: '请输入邮箱' }],
|
||||
};
|
||||
// 头像地址
|
||||
let avatarUrl = ref();
|
||||
@@ -128,12 +144,13 @@
|
||||
form.employeeId = data.employeeId;
|
||||
form.loginName = data.loginName;
|
||||
form.actualName = data.actualName;
|
||||
form.email = data.email;
|
||||
form.gender = data.gender;
|
||||
form.phone = data.phone;
|
||||
form.departmentId = data.departmentId;
|
||||
form.disabledFlag = data.disabledFlag;
|
||||
form.email = data.email;
|
||||
form.positionId = data.positionId;
|
||||
form.remark = data.remark;
|
||||
form.disabledFlag = data.disabledFlag;
|
||||
// 头像展示
|
||||
avatarUrl.value = data.avatar;
|
||||
} catch (e) {
|
||||
@@ -187,7 +204,7 @@
|
||||
async function updateEmployee() {
|
||||
SmartLoading.show();
|
||||
try {
|
||||
await employeeApi.updateByLogin(form);
|
||||
await employeeApi.updateCenter(form);
|
||||
message.success('更新成功');
|
||||
// 重新获取详情,刷新整体缓存
|
||||
await getLoginInfo();
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
phone: undefined,
|
||||
roleIdList: undefined,
|
||||
positionId: undefined,
|
||||
email: undefined,
|
||||
};
|
||||
|
||||
let form = reactive(_.cloneDeep(formDefault));
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
let props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
defineEmits(['update:value']);
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
const props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
const props = defineProps({
|
||||
tree: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: () => [],
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
|
||||
Reference in New Issue
Block a user