update 重构 彻底删除proxy用法 改为vue3官方推荐写法

This commit is contained in:
疯狂的狮子Li
2026-04-10 13:07:37 +08:00
parent eb62402423
commit 9acf52e8a7
144 changed files with 1264 additions and 1082 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<template v-if="isValueMatch(item.value)">
<span
v-if="
(item.elTagType === 'default' || item.elTagType === '') &&
((item.elTagType as string) === 'default' || (item.elTagType as string) === '') &&
(item.elTagClass === '' || item.elTagClass == null)
"
:key="item.value"
+20 -22
View File
@@ -15,15 +15,14 @@
<script setup lang="ts">
import '@wangeditor-next/editor/dist/css/style.css';
import { Editor as WangEditor, Toolbar as EditorToolbar } from '@wangeditor-next/editor-for-vue';
import type { IDomEditor, IEditorConfig, IToolbarConfig } from '@wangeditor-next/editor';
import { Editor as WangEditor, Toolbar as EditorToolbar } from '@wangeditor-next/editor-for-vue';
import { listByIds } from '@/api/system/oss';
import modal from '@/plugins/modal';
import { propTypes } from '@/utils/propTypes';
import { globalHeaders } from '@/utils/request';
import { listByIds } from '@/api/system/oss';
const OSS_MARKER_RE = /oss:\/\/([\w-]+)/g;
const props = defineProps({
/* 编辑器的内容 */
modelValue: propTypes.string,
@@ -42,7 +41,6 @@ const props = defineProps({
});
const emit = defineEmits(['update:modelValue']);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const editorRef = shallowRef<IDomEditor>();
const content = ref('');
@@ -123,7 +121,7 @@ const decodeOssContent = async (html: string): Promise<string> => {
const matches = [...html.matchAll(OSS_MARKER_RE)];
if (matches.length === 0) return html;
const ossIds = [...new Set(matches.map((m) => m[1]))];
const ossIds = [...new Set(matches.map(m => m[1]))];
try {
const res = await listByIds(ossIds.join(','));
@@ -144,14 +142,14 @@ const decodeOssContent = async (html: string): Promise<string> => {
const validateImageFile = (file: File) => {
const allowedTypes = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg', 'image/svg+xml'];
if (!allowedTypes.includes(file.type)) {
proxy?.$modal.msgError('图片格式错误!');
modal.msgError('图片格式错误!');
return false;
}
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {
proxy?.$modal.msgError(`上传图片大小不能超过 ${props.fileSize} MB!`);
modal.msgError(`上传图片大小不能超过 ${props.fileSize} MB!`);
return false;
}
}
@@ -162,14 +160,14 @@ const validateImageFile = (file: File) => {
const validateVideoFile = (file: File) => {
const allowedTypes = ['video/mp4', 'video/webm', 'video/ogg'];
if (!allowedTypes.includes(file.type)) {
proxy?.$modal.msgError('视频格式错误, 请上传 mp4/webm/ogg 格式!');
modal.msgError('视频格式错误, 请上传 mp4/webm/ogg 格式!');
return false;
}
if (props.videoSize) {
const isLt = file.size / 1024 / 1024 < props.videoSize;
if (!isLt) {
proxy?.$modal.msgError(`上传视频大小不能超过 ${props.videoSize} MB!`);
modal.msgError(`上传视频大小不能超过 ${props.videoSize} MB!`);
return false;
}
}
@@ -186,17 +184,17 @@ const getUploadImageMenuConfig = () => {
customUpload(file: File, insertFn: (url: string, alt?: string, href?: string) => void) {
if (!validateImageFile(file)) return;
proxy?.$modal.loading('正在上传图片,请稍候...');
modal.loading('正在上传图片,请稍候...');
const reader = new FileReader();
reader.onload = () => {
insertFn(reader.result as string, file.name);
proxy?.$modal.closeLoading();
modal.closeLoading();
};
reader.onerror = () => {
proxy?.$modal.msgError('图片插入失败');
proxy?.$modal.closeLoading();
modal.msgError('图片插入失败');
modal.closeLoading();
};
reader.readAsDataURL(file);
@@ -209,14 +207,14 @@ const getUploadImageMenuConfig = () => {
async customUpload(file: File, insertFn: (url: string, alt?: string, href?: string) => void) {
if (!validateImageFile(file)) return;
proxy?.$modal.loading('正在上传图片,请稍候...');
modal.loading('正在上传图片,请稍候...');
try {
const result = await uploadToOss(file);
insertFn(result.url, file.name, result.url);
} catch {
proxy?.$modal.msgError('图片上传失败');
modal.msgError('图片上传失败');
} finally {
proxy?.$modal.closeLoading();
modal.closeLoading();
}
}
};
@@ -227,14 +225,14 @@ const getUploadVideoMenuConfig = () => ({
async customUpload(file: File, insertFn: (url: string, poster?: string) => void) {
if (!validateVideoFile(file)) return;
proxy?.$modal.loading('正在上传视频,请稍候...');
modal.loading('正在上传视频,请稍候...');
try {
const result = await uploadToOss(file);
insertFn(result.url);
} catch {
proxy?.$modal.msgError('视频上传失败');
modal.msgError('视频上传失败');
} finally {
proxy?.$modal.closeLoading();
modal.closeLoading();
}
}
});
@@ -265,7 +263,7 @@ const syncReadOnly = () => {
watch(
() => props.modelValue,
async (value) => {
async value => {
const nextValue = value || '';
// 跳过由自身 emit 引起的回传
@@ -283,7 +281,7 @@ watch(
{ immediate: true }
);
watch(content, (value) => {
watch(content, value => {
if (isResolvingContent.value) return;
const encoded = encodeOssContent(value);
+14 -12
View File
@@ -47,8 +47,9 @@
</template>
<script setup lang="ts">
import { propTypes } from '@/utils/propTypes';
import { delOss, listByIds } from '@/api/system/oss';
import modal from '@/plugins/modal';
import { propTypes } from '@/utils/propTypes';
import { globalHeaders } from '@/utils/request';
const props = defineProps({
@@ -68,7 +69,6 @@ const props = defineProps({
disabled: propTypes.bool.def(false)
});
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const emit = defineEmits(['update:modelValue']);
const number = ref(0);
const uploadList = ref<any[]>([]);
@@ -94,7 +94,7 @@ watch(
let list: any[] = [];
if (Array.isArray(val)) {
list = val;
} else {
} else if (typeof val === 'string' || typeof val === 'number') {
const res = await listByIds(val);
list = res.data.map(oss => {
return {
@@ -103,6 +103,8 @@ watch(
ossId: oss.ossId
};
});
} else {
list = [];
}
// 然后将数组转为对象数组
fileList.value = list.map(item => {
@@ -126,36 +128,36 @@ const handleBeforeUpload = (file: any) => {
const fileExt = fileName[fileName.length - 1];
const isTypeOk = props.fileType.indexOf(fileExt) >= 0;
if (!isTypeOk) {
proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}格式文件!`);
modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}格式文件!`);
return false;
}
}
// 校检文件名是否包含特殊字符
if (file.name.includes(',')) {
proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!');
modal.msgError('文件名不正确,不能包含英文逗号!');
return false;
}
// 校检文件大小
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {
proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`);
modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`);
return false;
}
}
proxy?.$modal.loading('正在上传文件,请稍候...');
modal.loading('正在上传文件,请稍候...');
number.value++;
return true;
};
// 文件个数超出
const handleExceed = () => {
proxy?.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
};
// 上传失败
const handleUploadError = () => {
proxy?.$modal.msgError('上传文件失败');
modal.msgError('上传文件失败');
};
// 上传成功回调
@@ -169,8 +171,8 @@ const handleUploadSuccess = (res: any, file: UploadFile) => {
uploadedSuccessfully();
} else {
number.value--;
proxy?.$modal.closeLoading();
proxy?.$modal.msgError(res.msg);
modal.closeLoading();
modal.msgError(res.msg);
fileUploadRef.value?.handleRemove(file);
uploadedSuccessfully();
}
@@ -191,7 +193,7 @@ const uploadedSuccessfully = () => {
uploadList.value = [];
number.value = 0;
emit('update:modelValue', listToString(fileList.value));
proxy?.$modal.closeLoading();
modal.closeLoading();
}
};
+18 -14
View File
@@ -43,11 +43,12 @@
</template>
<script setup lang="ts">
import { compressAccurately } from 'image-conversion';
import { listByIds, delOss } from '@/api/system/oss';
import { OssVO } from '@/api/system/oss/types';
import modal from '@/plugins/modal';
import { propTypes } from '@/utils/propTypes';
import { globalHeaders } from '@/utils/request';
import { compressAccurately } from 'image-conversion';
const props = defineProps({
modelValue: {
@@ -74,7 +75,6 @@ const props = defineProps({
compressTargetSize: propTypes.number.def(300)
});
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const emit = defineEmits(['update:modelValue']);
const number = ref(0);
const uploadList = ref<any[]>([]);
@@ -142,46 +142,50 @@ const handleBeforeUpload = (file: any) => {
isImg = file.type.indexOf('image') > -1;
}
if (!isImg) {
proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}图片格式文件!`);
modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}图片格式文件!`);
return false;
}
if (file.name.includes(',')) {
proxy?.$modal.msgError('文件名不正确,不能包含英文逗号!');
modal.msgError('文件名不正确,不能包含英文逗号!');
return false;
}
if (props.fileSize) {
const isLt = file.size / 1024 / 1024 < props.fileSize;
if (!isLt) {
proxy?.$modal.msgError(`上传头像图片大小不能超过 ${props.fileSize} MB!`);
modal.msgError(`上传头像图片大小不能超过 ${props.fileSize} MB!`);
return false;
}
}
//压缩图片,开启压缩并且大于指定的压缩大小时才压缩
if (props.compressSupport && file.size / 1024 > props.compressTargetSize) {
proxy?.$modal.loading('正在上传图片,请稍候...');
modal.loading('正在上传图片,请稍候...');
number.value++;
return compressAccurately(file, props.compressTargetSize);
} else {
proxy?.$modal.loading('正在上传图片,请稍候...');
modal.loading('正在上传图片,请稍候...');
number.value++;
}
};
// 文件个数超出
const handleExceed = () => {
proxy?.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
};
// 上传成功回调
const handleUploadSuccess = (res: any, file: UploadFile) => {
if (res.code === 200) {
uploadList.value.push({ name: res.data.fileName, url: res.data.url, ossId: res.data.ossId });
uploadList.value.push({
name: res.data.fileName,
url: res.data.url,
ossId: res.data.ossId
});
uploadedSuccessfully();
} else {
number.value--;
proxy?.$modal.closeLoading();
proxy?.$modal.msgError(res.msg);
modal.closeLoading();
modal.msgError(res.msg);
imageUploadRef.value?.handleRemove(file);
uploadedSuccessfully();
}
@@ -207,14 +211,14 @@ const uploadedSuccessfully = () => {
uploadList.value = [];
number.value = 0;
emit('update:modelValue', listToString(fileList.value));
proxy?.$modal.closeLoading();
modal.closeLoading();
}
};
// 上传失败
const handleUploadError = () => {
proxy?.$modal.msgError('上传图片失败');
proxy?.$modal.closeLoading();
modal.msgError('上传图片失败');
modal.closeLoading();
};
// 预览
+1 -1
View File
@@ -14,8 +14,8 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import { useAppStore } from '@/store/modules/app';
import SvgIcon from '@/components/SvgIcon/index.vue';
import { useAppStore } from '@/store/modules/app';
const appStore = useAppStore();
const { locale } = useI18n();
+1 -1
View File
@@ -15,8 +15,8 @@
</template>
<script setup name="Pagination" lang="ts">
import { scrollTo } from '@/utils/scroll-to';
import { propTypes } from '@/utils/propTypes';
import { scrollTo } from '@/utils/scroll-to';
const props = defineProps({
total: propTypes.number,
+2 -3
View File
@@ -29,10 +29,9 @@
</el-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { ComponentInternalInstance } from 'vue';
import { ElForm, FormInstance } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { ref } from 'vue';
const emits = defineEmits(['submitCallback', 'cancelCallback']);
const props = defineProps({
title: {
+7 -3
View File
@@ -26,8 +26,12 @@
</div>
</template>
<script setup lang="ts">
import { useRoute } from 'vue-router';
import tab from '@/plugins/tab';
import router from '@/router';
import { propTypes } from '@/utils/propTypes';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const route = useRoute();
const props = defineProps({
status: propTypes.string.def(''),
pageType: propTypes.string.def(''),
@@ -66,7 +70,7 @@ const approvalButtonShow = computed(() => {
//返回
const goBack = () => {
proxy.$tab.closePage(proxy.$route);
proxy.$router.go(-1);
tab.closePage(route);
router.go(-1);
};
</script>
+7 -5
View File
@@ -98,12 +98,14 @@
</div>
</template>
<script setup lang="ts">
import { flowHisTaskList } from '@/api/workflow/instance';
import { propTypes } from '@/utils/propTypes';
import { listByIds } from '@/api/system/oss';
import { flowHisTaskList } from '@/api/workflow/instance';
import FlowChart from '@/components/Process/flowChart.vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { wf_task_status } = toRefs<any>(proxy?.useDict('wf_task_status'));
import download from '@/plugins/download';
import { useDict } from '@/utils/dict';
import { propTypes } from '@/utils/propTypes';
const { wf_task_status } = toRefs<any>(useDict('wf_task_status'));
const props = defineProps({
width: propTypes.string.def('80%'),
height: propTypes.string.def('100%')
@@ -146,7 +148,7 @@ const getIds = async (ids: string | number) => {
/** 下载按钮操作 */
const handleDownload = (ossId: string) => {
proxy?.$download.oss(ossId);
download.oss(ossId);
};
/**
+7 -1
View File
@@ -111,7 +111,13 @@ const applyTransform = () => {
};
const getBounds = () => {
if (!imageWrapperRef.value) return { minTranslateX: 0, maxTranslateX: 0, minTranslateY: 0, maxTranslateY: 0 };
if (!imageWrapperRef.value)
return {
minTranslateX: 0,
maxTranslateX: 0,
minTranslateY: 0,
maxTranslateY: 0
};
const imgRect = imageWrapperRef.value.getBoundingClientRect();
const containerRect = imageWrapperRef.value.parentElement?.getBoundingClientRect() ?? imgRect;
+19 -16
View File
@@ -87,11 +87,12 @@
</el-dialog>
</template>
<script setup lang="ts">
import { propTypes } from '@/utils/propTypes';
import { FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
import UserSelect from '@/components/UserSelect';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { getTask, taskOperation, currentTaskAllUser, terminationTask } from '@/api/workflow/task';
import { FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
import UserSelect from '@/components/UserSelect/index.vue';
import modal from '@/plugins/modal';
import { propTypes } from '@/utils/propTypes';
const props = defineProps({
width: propTypes.string.def('50%'),
height: propTypes.string.def('100%')
@@ -128,8 +129,10 @@ const task = ref<FlowTaskVO>({
nodeRatio: undefined,
version: undefined,
applyNode: undefined,
buttonList: []
});
buttonList: [],
businessCode: '',
businessTitle: ''
} as FlowTaskVO);
const open = (taskId: string) => {
visible.value = true;
@@ -153,7 +156,7 @@ const handleTransferTask = async data => {
message: '',
messageType: ['1']
});
await proxy?.$modal.confirm('是否确认提交?');
await modal.confirm('是否确认提交?');
loading.value = true;
buttonDisabled.value = true;
await taskOperation(taskOperationBo, 'transferTask').finally(() => {
@@ -162,9 +165,9 @@ const handleTransferTask = async data => {
});
visible.value = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
} else {
proxy?.$modal.msgWarning('请选择用户!');
modal.msgWarning('请选择用户!');
}
};
//加签
@@ -180,7 +183,7 @@ const addMultiInstanceUser = async data => {
message: '',
messageType: ['1']
});
await proxy?.$modal.confirm('是否确认提交?');
await modal.confirm('是否确认提交?');
loading.value = true;
buttonDisabled.value = true;
await taskOperation(taskOperationBo, 'addSignature').finally(() => {
@@ -189,14 +192,14 @@ const addMultiInstanceUser = async data => {
});
visible.value = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
} else {
proxy?.$modal.msgWarning('请选择用户!');
modal.msgWarning('请选择用户!');
}
};
//减签
const deleteMultiInstanceUser = async row => {
await proxy?.$modal.confirm('是否确认提交?');
await modal.confirm('是否确认提交?');
loading.value = true;
buttonDisabled.value = true;
const taskOperationBo = reactive<TaskOperationBo>({
@@ -211,7 +214,7 @@ const deleteMultiInstanceUser = async row => {
});
visible.value = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
};
//获取办理人
const handleTaskUser = async () => {
@@ -231,7 +234,7 @@ const handleTerminationTask = async () => {
taskId: task.value.id,
comment: ''
};
await proxy?.$modal.confirm('是否确认终止?');
await modal.confirm('是否确认终止?');
loading.value = true;
buttonDisabled.value = true;
await terminationTask(params).finally(() => {
@@ -240,7 +243,7 @@ const handleTerminationTask = async () => {
});
visible.value = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
};
/**
* 对外暴露子组件方法
+22 -24
View File
@@ -196,9 +196,8 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { ComponentInternalInstance } from 'vue';
import { ElForm } from 'element-plus';
import { ref } from 'vue';
import {
completeTask,
backProcess,
@@ -209,10 +208,9 @@ import {
currentTaskAllUser,
getNextNodeList
} from '@/api/workflow/task';
import UserSelect from '@/components/UserSelect';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
import { FlowCopyVo, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
import UserSelect from '@/components/UserSelect/index.vue';
import modal from '@/plugins/modal';
const userSelectCopyRef = ref<InstanceType<typeof UserSelect>>();
const transferTaskRef = ref<InstanceType<typeof UserSelect>>();
@@ -362,7 +360,7 @@ const handleCompleteTask = async () => {
}
});
if (verify) {
proxy?.$modal.msgWarning('请选择审批人!');
modal.msgWarning('请选择审批人!');
return false;
}
} else {
@@ -379,14 +377,14 @@ const handleCompleteTask = async () => {
});
form.value.flowCopyList = flowCopyList;
}
await proxy?.$modal.confirm('是否确认提交?');
await modal.confirm('是否确认提交?');
loading.value = true;
buttonDisabled.value = true;
try {
await completeTask(form.value);
dialog.visible = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
} finally {
loading.value = false;
buttonDisabled.value = false;
@@ -409,7 +407,7 @@ const handleBackProcessOpen = async () => {
/** 驳回流程 */
const handleBackProcess = async () => {
backForm.value.taskId = taskId.value;
await proxy?.$modal.confirm('是否确认驳回到申请人?');
await modal.confirm('是否确认驳回到申请人?');
loading.value = true;
backLoading.value = true;
backButtonDisabled.value = true;
@@ -421,7 +419,7 @@ const handleBackProcess = async () => {
backLoading.value = false;
backButtonDisabled.value = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
};
//取消
const cancel = async () => {
@@ -463,7 +461,7 @@ const addMultiInstanceUser = async data => {
message: form.value.message,
messageType: ['1']
});
await proxy?.$modal.confirm('是否确认提交?');
await modal.confirm('是否确认提交?');
loading.value = true;
buttonDisabled.value = true;
await taskOperation(taskOperationBo, 'addSignature').finally(() => {
@@ -472,14 +470,14 @@ const addMultiInstanceUser = async data => {
});
dialog.visible = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
} else {
proxy?.$modal.msgWarning('请选择用户!');
modal.msgWarning('请选择用户!');
}
};
//减签
const deleteMultiInstanceUser = async row => {
await proxy?.$modal.confirm('是否确认提交?');
await modal.confirm('是否确认提交?');
loading.value = true;
buttonDisabled.value = true;
const taskOperationBo = reactive<TaskOperationBo>({
@@ -494,7 +492,7 @@ const deleteMultiInstanceUser = async row => {
});
dialog.visible = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
};
//打开转办
const openTransferTask = () => {
@@ -509,7 +507,7 @@ const handleTransferTask = async data => {
message: form.value.message,
messageType: ['1']
});
await proxy?.$modal.confirm('是否确认提交?');
await modal.confirm('是否确认提交?');
loading.value = true;
buttonDisabled.value = true;
await taskOperation(taskOperationBo, 'transferTask').finally(() => {
@@ -518,9 +516,9 @@ const handleTransferTask = async data => {
});
dialog.visible = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
} else {
proxy?.$modal.msgWarning('请选择用户!');
modal.msgWarning('请选择用户!');
}
};
@@ -537,7 +535,7 @@ const handleDelegateTask = async data => {
message: form.value.message,
messageType: ['1']
});
await proxy?.$modal.confirm('是否确认提交?');
await modal.confirm('是否确认提交?');
loading.value = true;
buttonDisabled.value = true;
await taskOperation(taskOperationBo, 'delegateTask').finally(() => {
@@ -546,9 +544,9 @@ const handleDelegateTask = async data => {
});
dialog.visible = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
} else {
proxy?.$modal.msgWarning('请选择用户!');
modal.msgWarning('请选择用户!');
}
};
//终止任务
@@ -557,7 +555,7 @@ const handleTerminationTask = async () => {
taskId: taskId.value,
comment: form.value.message
};
await proxy?.$modal.confirm('是否确认终止?');
await modal.confirm('是否确认终止?');
loading.value = true;
buttonDisabled.value = true;
await terminationTask(params).finally(() => {
@@ -566,7 +564,7 @@ const handleTerminationTask = async () => {
});
dialog.visible = false;
emits('submitCallback');
proxy?.$modal.msgSuccess('操作成功');
modal.msgSuccess('操作成功');
};
const handleTaskUser = async () => {
const data = await currentTaskAllUser(taskId.value);
@@ -581,7 +579,7 @@ const handleTaskUser = async () => {
// 选择人员
const choosePeople = async data => {
if (!data.permissionFlag) {
proxy?.$modal.msgError('没有可选择的人员,请联系管理员!');
modal.msgError('没有可选择的人员,请联系管理员!');
}
popUserIds.value = data.permissionFlag;
nodeCode.value = data.nodeCode;
+1 -1
View File
@@ -36,8 +36,8 @@
</template>
<script setup lang="ts">
import { propTypes } from '@/utils/propTypes';
import cache from '@/plugins/cache';
import { propTypes } from '@/utils/propTypes';
const props = defineProps({
showSearch: propTypes.bool.def(true),
+12 -9
View File
@@ -9,8 +9,8 @@
>
<div class="p-2 role-select-shell">
<transition
:enter-active-class="proxy?.animate.searchAnimate.enter"
:leave-active-class="proxy?.animate.searchAnimate.leave"
:enter-active-class="animateConfig.searchAnimate.enter"
:leave-active-class="animateConfig.searchAnimate.leave"
>
<div v-show="showSearch">
<el-card shadow="hover" class="search-panel selector-card">
@@ -81,7 +81,7 @@
</vxe-column>
<vxe-column field="createTime" title="创建时间" align="center">
<template #default="scope">
<span>{{ proxy.parseTime(scope.row.createTime) }}</span>
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</vxe-column>
</vxe-table>
@@ -104,10 +104,14 @@
</template>
<script setup lang="ts">
import { RoleVO, RoleQuery } from '@/api/system/role/types';
import { VxeTableInstance } from 'vxe-table';
import useDialog from '@/hooks/useDialog';
import animateConfig from '@/animate';
import api from '@/api/system/role';
import { RoleVO, RoleQuery } from '@/api/system/role/types';
import useDialog from '@/hooks/useDialog';
import { useDict } from '@/utils/dict';
import { parseTime, addDateRange } from '@/utils/ruoyi';
interface PropType {
modelValue?: RoleVO[] | RoleVO | undefined;
multiple?: boolean;
@@ -120,14 +124,13 @@ const prop = withDefaults(defineProps<PropType>(), {
});
const emit = defineEmits(['update:modelValue', 'confirmCallBack']);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
const { sys_normal_disable } = toRefs<any>(useDict('sys_normal_disable'));
const roleList = ref<RoleVO[]>();
const loading = ref(true);
const showSearch = ref(true);
const total = ref(0);
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
const dateRange = ref<any>(['', '']);
const selectRoleList = ref<RoleVO[]>([]);
const roleDialog = useDialog({
@@ -171,7 +174,7 @@ const computedIds = data => {
*/
const getList = () => {
loading.value = true;
api.listRole(proxy?.addDateRange(queryParams.value, dateRange.value)).then(res => {
api.listRole(addDateRange(queryParams.value, dateRange.value)).then(res => {
roleList.value = res.data?.rows;
total.value = res.data?.total;
loading.value = false;
+5 -5
View File
@@ -35,12 +35,12 @@
</template>
<script setup lang="ts">
import { constantRoutes } from '@/router';
import { isHttp } from '@/utils/validate';
import { useAppStore } from '@/store/modules/app';
import { useSettingsStore } from '@/store/modules/settings';
import { usePermissionStore } from '@/store/modules/permission';
import { RouteRecordRaw } from 'vue-router';
import { constantRoutes } from '@/router';
import { useAppStore } from '@/store/modules/app';
import { usePermissionStore } from '@/store/modules/permission';
import { useSettingsStore } from '@/store/modules/settings';
import { isHttp } from '@/utils/validate';
// 顶部栏初始数
const visibleNumber = ref<number>(-1);
+1 -1
View File
@@ -24,7 +24,7 @@
class="mt-2 dept-tree"
:node-key="nodeKey"
:data="data"
:props="(treeProps as any)"
:props="treeProps as any"
:expand-on-click-node="false"
:filter-node-method="internalFilterNode"
highlight-current
+10 -8
View File
@@ -63,8 +63,8 @@
>
<div class="p-2user-select-main">
<transition
:enter-active-class="proxy?.animate.searchAnimate.enter"
:leave-active-class="proxy?.animate.searchAnimate.leave"
:enter-active-class="animateConfig.searchAnimate.enter"
:leave-active-class="animateConfig.searchAnimate.leave"
>
<div v-show="showSearch">
<el-card shadow="hover" class="search-panel selector-card">
@@ -167,11 +167,14 @@
</template>
<script setup lang="ts">
import { VxeTableInstance } from 'vxe-table';
import animateConfig from '@/animate';
import { DeptTreeVO, DeptVO } from '@/api/system/dept/types';
import api from '@/api/system/user';
import { UserQuery, UserVO } from '@/api/system/user/types';
import { DeptTreeVO, DeptVO } from '@/api/system/dept/types';
import { VxeTableInstance } from 'vxe-table';
import useDialog from '@/hooks/useDialog';
import { useDict } from '@/utils/dict';
import { addDateRange } from '@/utils/ruoyi';
interface PropType {
modelValue?: UserVO[] | UserVO | undefined;
@@ -187,14 +190,13 @@ const prop = withDefaults(defineProps<PropType>(), {
});
const emit = defineEmits(['update:modelValue', 'confirmCallBack']);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
const { sys_normal_disable } = toRefs<any>(useDict('sys_normal_disable'));
const userList = ref<UserVO[]>();
const loading = ref(true);
const showSearch = ref(true);
const total = ref(0);
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
const dateRange = ref<any>(['', '']);
const deptName = ref('');
const treeCollapsed = ref(false);
const deptOptions = ref<DeptTreeVO[]>([]);
@@ -269,7 +271,7 @@ const getTreeSelect = async () => {
const getList = async () => {
loading.value = true;
queryParams.value.userIds = prop.userIds;
const res = await api.listUser(proxy?.addDateRange(queryParams.value, dateRange.value));
const res = await api.listUser(addDateRange(queryParams.value, dateRange.value));
loading.value = false;
userList.value = res.data?.rows;
total.value = res.data?.total;