fix(ts): 低风险类型修复并修复预览交互问题
- formatDate 入参放宽为 dayjs.ConfigType,删除冗余 formatDateByConfig - 多处 ref([]) 补精确数组类型(BPM/AI workflow/SMS log/DiyEditor 等) - 路由参数/模板 index 显式 Number(),Upload 响应补局部类型 - LeaveCreateData 局部扩展 startUserSelectAssignees,不污染共享 VO - 修复 mall 订单详情 formatDate.deliveryTime typo(发货时间行此前不显示) - 修复 FloatingActionButton 缺失 handleActive,预览态点击仅收起面板 ts:check 542 → 478,无新增类型错误master
parent
3f779091be
commit
bc25430fa5
|
|
@ -115,5 +115,7 @@ export const getOrderCountTrendComparison = (
|
||||||
|
|
||||||
/** 时间参数需要格式化, 确保接口能识别 */
|
/** 时间参数需要格式化, 确保接口能识别 */
|
||||||
const formatDateParam = (params: TradeTrendReqVO) => {
|
const formatDateParam = (params: TradeTrendReqVO) => {
|
||||||
return { times: [formatDate(params.times[0]), formatDate(params.times[1])] } as TradeTrendReqVO
|
return {
|
||||||
|
times: [formatDate(params.times[0]), formatDate(params.times[1])]
|
||||||
|
} as TradeTrendReqVO
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
v-for="(item, index) in property.list"
|
v-for="(item, index) in property.list"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="flex flex-col items-center"
|
class="flex flex-col items-center"
|
||||||
@click="handleActive(index)"
|
@click="handleActive"
|
||||||
>
|
>
|
||||||
<el-image :src="item.imgUrl" fit="contain" class="h-27px w-27px">
|
<el-image :src="item.imgUrl" fit="contain" class="h-27px w-27px">
|
||||||
<template #error>
|
<template #error>
|
||||||
|
|
@ -49,6 +49,10 @@ const expanded = ref(false)
|
||||||
const handleToggleFab = () => {
|
const handleToggleFab = () => {
|
||||||
expanded.value = !expanded.value
|
expanded.value = !expanded.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleActive = () => {
|
||||||
|
expanded.value = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
class="text-12px"
|
class="text-12px"
|
||||||
:style="{ color: property.fields.price.color }"
|
:style="{ color: property.fields.price.color }"
|
||||||
>
|
>
|
||||||
¥{{ fenToYuan(spu.price) }}
|
¥{{ fenToYuan(spu.price || 0) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -76,7 +76,9 @@ const spuList = ref<ProductSpuApi.Spu[]>([])
|
||||||
watch(
|
watch(
|
||||||
() => props.property.spuIds,
|
() => props.property.spuIds,
|
||||||
async () => {
|
async () => {
|
||||||
spuList.value = await ProductSpuApi.getSpuDetailList(props.property.spuIds)
|
spuList.value = props.property.spuIds
|
||||||
|
? await ProductSpuApi.getSpuDetailList(props.property.spuIds)
|
||||||
|
: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ const props = defineProps<{ modelValue: PromotionArticleProperty }>()
|
||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue'])
|
||||||
const formData = useVModel(props, 'modelValue', emit)
|
const formData = useVModel(props, 'modelValue', emit)
|
||||||
// 文章列表
|
// 文章列表
|
||||||
const articles = ref<ArticleApi.ArticleVO>([])
|
const articles = ref<ArticleApi.ArticleVO[]>([])
|
||||||
|
|
||||||
// 加载中
|
// 加载中
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@
|
||||||
ChildProcessMultiInstanceSourceTypeEnum.FIXED_QUANTITY
|
ChildProcessMultiInstanceSourceTypeEnum.FIXED_QUANTITY
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<el-input-number v-model="configForm.multiInstanceSource" :min="1" />
|
<el-input-number v-model="multiInstanceSourceNumber" :min="1" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="
|
v-if="
|
||||||
|
|
@ -453,6 +453,12 @@ const digitalFormFieldOptions = computed(() => {
|
||||||
const multiFormFieldOptions = computed(() => {
|
const multiFormFieldOptions = computed(() => {
|
||||||
return formFieldOptions.filter((item) => item.type === 'select' || item.type === 'checkbox')
|
return formFieldOptions.filter((item) => item.type === 'select' || item.type === 'checkbox')
|
||||||
})
|
})
|
||||||
|
const multiInstanceSourceNumber = computed({
|
||||||
|
get: () => Number(configForm.value.multiInstanceSource || 1),
|
||||||
|
set: (value?: number) => {
|
||||||
|
configForm.value.multiInstanceSource = String(value || '')
|
||||||
|
}
|
||||||
|
})
|
||||||
const childFormFieldOptions = ref()
|
const childFormFieldOptions = ref()
|
||||||
|
|
||||||
// 保存配置
|
// 保存配置
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
|
import type { ComponentPublicInstance } from 'vue'
|
||||||
import { SimpleFlowNode, NodeType, ConditionType, RouterSetting } from '../consts'
|
import { SimpleFlowNode, NodeType, ConditionType, RouterSetting } from '../consts'
|
||||||
import { useWatchNode, useDrawer, useNodeName } from '../node'
|
import { useWatchNode, useDrawer, useNodeName } from '../node'
|
||||||
import Condition from './components/Condition.vue'
|
import Condition from './components/Condition.vue'
|
||||||
|
|
@ -86,15 +87,18 @@ const currentNode = useWatchNode(props)
|
||||||
// 节点名称
|
// 节点名称
|
||||||
const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.ROUTER_BRANCH_NODE)
|
const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.ROUTER_BRANCH_NODE)
|
||||||
const routerGroups = ref<RouterSetting[]>([])
|
const routerGroups = ref<RouterSetting[]>([])
|
||||||
const nodeOptions = ref<any>([])
|
const nodeOptions = ref<Array<{ label: string; value: string }>>([])
|
||||||
const conditionRef = ref([])
|
type ConditionRef = ComponentPublicInstance & {
|
||||||
|
validate?: () => Promise<boolean>
|
||||||
|
}
|
||||||
|
const conditionRef = ref<Array<ConditionRef | Element | null>>([])
|
||||||
|
|
||||||
/** 保存配置 */
|
/** 保存配置 */
|
||||||
const saveConfig = async () => {
|
const saveConfig = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
let valid = true
|
let valid = true
|
||||||
for (const item of conditionRef.value) {
|
for (const item of conditionRef.value) {
|
||||||
if (item && !(await item.validate())) {
|
if (item && 'validate' in item && item.validate && !(await item.validate())) {
|
||||||
valid = false
|
valid = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -173,7 +177,7 @@ const deleteRouterGroup = (index: number) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 递归获取所有节点
|
// 递归获取所有节点
|
||||||
const getRouterNode = (node) => {
|
const getRouterNode = (node?: SimpleFlowNode) => {
|
||||||
// TODO 最好还需要满足以下要求
|
// TODO 最好还需要满足以下要求
|
||||||
// 并行分支、包容分支内部节点不能跳转到外部节点
|
// 并行分支、包容分支内部节点不能跳转到外部节点
|
||||||
// 条件分支节点可以向上跳转到外部节点
|
// 条件分支节点可以向上跳转到外部节点
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
<Icon
|
<Icon
|
||||||
icon="ep:delete"
|
icon="ep:delete"
|
||||||
:size="18"
|
:size="18"
|
||||||
@click="deleteHttpResponseSetting(setting.response!, index)"
|
@click="deleteHttpResponseSetting(setting.response!, Number(index))"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -132,10 +132,13 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {
|
||||||
// 文件上传成功
|
// 文件上传成功
|
||||||
const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => {
|
const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => {
|
||||||
message.success('上传成功')
|
message.success('上传成功')
|
||||||
|
const response = res as { data: string }
|
||||||
// 删除自身
|
// 删除自身
|
||||||
const index = fileList.value.findIndex((item) => item.response?.data === res.data)
|
const index = fileList.value.findIndex(
|
||||||
|
(item) => (item.response as { data?: string } | undefined)?.data === response.data
|
||||||
|
)
|
||||||
fileList.value.splice(index, 1)
|
fileList.value.splice(index, 1)
|
||||||
uploadList.value.push({ name: res.data, url: res.data })
|
uploadList.value.push({ name: response.data, url: response.data })
|
||||||
if (uploadList.value.length == uploadNumber.value) {
|
if (uploadList.value.length == uploadNumber.value) {
|
||||||
fileList.value.push(...uploadList.value)
|
fileList.value.push(...uploadList.value)
|
||||||
uploadList.value = []
|
uploadList.value = []
|
||||||
|
|
|
||||||
|
|
@ -135,10 +135,13 @@ interface UploadEmits {
|
||||||
const emit = defineEmits<UploadEmits>()
|
const emit = defineEmits<UploadEmits>()
|
||||||
const uploadSuccess: UploadProps['onSuccess'] = (res: any): void => {
|
const uploadSuccess: UploadProps['onSuccess'] = (res: any): void => {
|
||||||
message.success('上传成功')
|
message.success('上传成功')
|
||||||
|
const response = res as { data: string }
|
||||||
// 删除自身
|
// 删除自身
|
||||||
const index = fileList.value.findIndex((item) => item.response?.data === res.data)
|
const index = fileList.value.findIndex(
|
||||||
|
(item) => (item.response as { data?: string } | undefined)?.data === response.data
|
||||||
|
)
|
||||||
fileList.value.splice(index, 1)
|
fileList.value.splice(index, 1)
|
||||||
uploadList.value.push({ name: res.data, url: res.data })
|
uploadList.value.push({ name: response.data, url: response.data })
|
||||||
if (uploadList.value.length == uploadNumber.value) {
|
if (uploadList.value.length == uploadNumber.value) {
|
||||||
fileList.value.push(...uploadList.value)
|
fileList.value.push(...uploadList.value)
|
||||||
uploadList.value = []
|
uploadList.value = []
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export const useNProgress = () => {
|
||||||
await nextTick()
|
await nextTick()
|
||||||
const bar = document.getElementById('nprogress')?.getElementsByClassName('bar')[0] as ElRef
|
const bar = document.getElementById('nprogress')?.getElementsByClassName('bar')[0] as ElRef
|
||||||
if (bar) {
|
if (bar) {
|
||||||
bar.style.background = unref(primaryColor.value)
|
bar.style.background = unref(primaryColor.value) || ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ export const setupElementPlus = (app: App<Element>) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
components.forEach((component) => {
|
components.forEach((component) => {
|
||||||
app.component(component.name, component)
|
app.component(component.name!, component)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ const components = [
|
||||||
// 参考 http://www.form-create.com/v3/element-ui/auto-import.html 文档
|
// 参考 http://www.form-create.com/v3/element-ui/auto-import.html 文档
|
||||||
export const setupFormCreate = (app: App<Element>) => {
|
export const setupFormCreate = (app: App<Element>) => {
|
||||||
components.forEach((component) => {
|
components.forEach((component) => {
|
||||||
app.component(component.name, component)
|
app.component(component.name!, component)
|
||||||
})
|
})
|
||||||
formCreate.use(install)
|
formCreate.use(install)
|
||||||
app.use(formCreate)
|
app.use(formCreate)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ const HM_ID = import.meta.env.VITE_APP_BAIDU_CODE
|
||||||
const hm = document.createElement('script')
|
const hm = document.createElement('script')
|
||||||
hm.src = 'https://hm.baidu.com/hm.js?' + HM_ID
|
hm.src = 'https://hm.baidu.com/hm.js?' + HM_ID
|
||||||
const s = document.getElementsByTagName('script')[0]
|
const s = document.getElementsByTagName('script')[0]
|
||||||
s.parentNode.insertBefore(hm, s)
|
s.parentNode?.insertBefore(hm, s)
|
||||||
})()
|
})()
|
||||||
|
|
||||||
router.afterEach(function (to) {
|
router.afterEach(function (to) {
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ export const defaultShortcuts = [
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 时间日期转换
|
* 时间日期转换
|
||||||
* @param date 当前时间,new Date() 格式
|
* @param date 当前时间,支持 new Date()、字符串、时间戳、dayjs 等格式
|
||||||
* @param format 需要转换的时间格式字符串
|
* @param format 需要转换的时间格式字符串
|
||||||
* @description format 字符串随意,如 `YYYY-MM、YYYY-MM-DD`
|
* @description format 字符串随意,如 `YYYY-MM、YYYY-MM-DD`
|
||||||
* @description format 季度:"YYYY-MM-DD HH:mm:ss QQQQ"
|
* @description format 季度:"YYYY-MM-DD HH:mm:ss QQQQ"
|
||||||
|
|
@ -63,7 +63,7 @@ export const defaultShortcuts = [
|
||||||
* @description format 季度 + 星期 + 几周:"YYYY-MM-DD HH:mm:ss WWW QQQQ ZZZ"
|
* @description format 季度 + 星期 + 几周:"YYYY-MM-DD HH:mm:ss WWW QQQQ ZZZ"
|
||||||
* @returns 返回拼接后的时间字符串
|
* @returns 返回拼接后的时间字符串
|
||||||
*/
|
*/
|
||||||
export function formatDate(date: Date | string, format?: string): string {
|
export function formatDate(date: dayjs.ConfigType, format?: string): string {
|
||||||
// 日期不存在,则返回空
|
// 日期不存在,则返回空
|
||||||
if (!date) {
|
if (!date) {
|
||||||
return ''
|
return ''
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-for="(file, index) in modelData.list"
|
v-for="(file, index) in modelData.list"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="selectFile(index)"
|
@click="selectFile(Number(index))"
|
||||||
>
|
>
|
||||||
{{ file.name }}
|
{{ file.name }}
|
||||||
<span v-if="file.segments" class="ml-5px text-gray-500 text-12px">
|
<span v-if="file.segments" class="ml-5px text-gray-500 text-12px">
|
||||||
|
|
@ -141,7 +141,7 @@ const splitContent = async (file: any) => {
|
||||||
// 调用后端分段接口,获取文档的分段内容、字符数和 Token 数
|
// 调用后端分段接口,获取文档的分段内容、字符数和 Token 数
|
||||||
file.segments = await KnowledgeSegmentApi.splitContent(
|
file.segments = await KnowledgeSegmentApi.splitContent(
|
||||||
file.url,
|
file.url,
|
||||||
modelData.value.segmentMaxTokens
|
Number(modelData.value.segmentMaxTokens)
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取分段内容失败:', file, error)
|
console.error('获取分段内容失败:', file, error)
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
<Icon icon="ep:document" class="mr-8px text-[#409eff]" />
|
<Icon icon="ep:document" class="mr-8px text-[#409eff]" />
|
||||||
<span class="text-[13px] text-[#303133] break-all">{{ file.name }}</span>
|
<span class="text-[13px] text-[#303133] break-all">{{ file.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="danger" link @click="removeFile(index)" class="ml-2">
|
<el-button type="danger" link @click="removeFile(Number(index))" class="ml-2">
|
||||||
<Icon icon="ep:delete" />
|
<Icon icon="ep:delete" />
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -70,14 +70,28 @@ defineProps<{
|
||||||
provider: any
|
provider: any
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
type WorkflowParam = {
|
||||||
|
key: string
|
||||||
|
value: string
|
||||||
|
}
|
||||||
|
|
||||||
|
type StartNodeParameter = {
|
||||||
|
name: string
|
||||||
|
dataType: string
|
||||||
|
description?: string
|
||||||
|
disabled?: boolean
|
||||||
|
required?: boolean
|
||||||
|
defaultValue?: string
|
||||||
|
}
|
||||||
|
|
||||||
const tinyflowRef = ref()
|
const tinyflowRef = ref()
|
||||||
const workflowData = inject('workflowData') as Ref
|
const workflowData = inject('workflowData') as Ref
|
||||||
const showTestDrawer = ref(false)
|
const showTestDrawer = ref(false)
|
||||||
const params4Test = ref([])
|
const params4Test = ref<WorkflowParam[]>([])
|
||||||
const paramsOfStartNode = ref({})
|
const paramsOfStartNode = ref<Record<string, StartNodeParameter>>({})
|
||||||
const testResult = ref(null)
|
const testResult = ref(null)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const error = ref(null)
|
const error = ref<string | null>(null)
|
||||||
|
|
||||||
/** 展示工作流测试抽屉 */
|
/** 展示工作流测试抽屉 */
|
||||||
const testWorkflowModel = () => {
|
const testWorkflowModel = () => {
|
||||||
|
|
@ -96,8 +110,8 @@ const goRun = async () => {
|
||||||
|
|
||||||
// 获取参数定义
|
// 获取参数定义
|
||||||
const parameters = startNode.data?.parameters || []
|
const parameters = startNode.data?.parameters || []
|
||||||
const paramDefinitions = {}
|
const paramDefinitions: Record<string, string> = {}
|
||||||
parameters.forEach((param) => {
|
parameters.forEach((param: StartNodeParameter) => {
|
||||||
paramDefinitions[param.name] = param.dataType
|
paramDefinitions[param.name] = param.dataType
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -115,7 +129,8 @@ const goRun = async () => {
|
||||||
try {
|
try {
|
||||||
convertedParams[paramKey] = convertParamValue(value, dataType)
|
convertedParams[paramKey] = convertParamValue(value, dataType)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(`参数 ${paramKey} 转换失败: ${e.message}`)
|
const message = e instanceof Error ? e.message : String(e)
|
||||||
|
throw new Error(`参数 ${paramKey} 转换失败: ${message}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -127,7 +142,11 @@ const goRun = async () => {
|
||||||
const response = await WorkflowApi.testWorkflow(data)
|
const response = await WorkflowApi.testWorkflow(data)
|
||||||
testResult.value = response
|
testResult.value = response
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
error.value = err.response?.data?.message || '运行失败,请检查参数和网络连接'
|
const responseMessage =
|
||||||
|
err && typeof err === 'object' && 'response' in err
|
||||||
|
? (err as any).response?.data?.message
|
||||||
|
: undefined
|
||||||
|
error.value = responseMessage || '运行失败,请检查参数和网络连接'
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
@ -142,20 +161,20 @@ watch(showTestDrawer, (value) => {
|
||||||
|
|
||||||
// 获取参数定义
|
// 获取参数定义
|
||||||
const parameters = startNode.data?.parameters || []
|
const parameters = startNode.data?.parameters || []
|
||||||
const paramDefinitions = {}
|
const paramDefinitions: Record<string, StartNodeParameter> = {}
|
||||||
|
|
||||||
// 加入参数选项方便用户添加非必须参数
|
// 加入参数选项方便用户添加非必须参数
|
||||||
parameters.forEach((param) => {
|
parameters.forEach((param: StartNodeParameter) => {
|
||||||
paramDefinitions[param.name] = param
|
paramDefinitions[param.name] = param
|
||||||
})
|
})
|
||||||
|
|
||||||
function mergeIfRequiredButNotSet(target) {
|
function mergeIfRequiredButNotSet(target: WorkflowParam[]) {
|
||||||
let needPushList = []
|
let needPushList: WorkflowParam[] = []
|
||||||
for (let key in paramDefinitions) {
|
for (let key in paramDefinitions) {
|
||||||
let param = paramDefinitions[key]
|
let param = paramDefinitions[key]
|
||||||
|
|
||||||
if (param.required) {
|
if (param.required) {
|
||||||
let item = target.find((item) => item.key === key)
|
let item = target.find((item: WorkflowParam) => item.key === key)
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
needPushList.push({ key: param.name, value: param.defaultValue || '' })
|
needPushList.push({ key: param.name, value: param.defaultValue || '' })
|
||||||
|
|
@ -186,12 +205,12 @@ const addParam = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除参数项 */
|
/** 删除参数项 */
|
||||||
const removeParam = (index) => {
|
const removeParam = (index: number) => {
|
||||||
params4Test.value.splice(index, 1)
|
params4Test.value.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 类型转换函数 */
|
/** 类型转换函数 */
|
||||||
const convertParamValue = (value, dataType) => {
|
const convertParamValue = (value: string, dataType: string) => {
|
||||||
if (value === '') return null // 空值处理
|
if (value === '') return null // 空值处理
|
||||||
|
|
||||||
switch (dataType) {
|
switch (dataType) {
|
||||||
|
|
@ -210,7 +229,8 @@ const convertParamValue = (value, dataType) => {
|
||||||
try {
|
try {
|
||||||
return JSON.parse(value)
|
return JSON.parse(value)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(`JSON格式错误: ${e.message}`)
|
const message = e instanceof Error ? e.message : String(e)
|
||||||
|
throw new Error(`JSON格式错误: ${message}`)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
throw new Error(`不支持的类型: ${dataType}`)
|
throw new Error(`不支持的类型: ${dataType}`)
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,17 @@ const formRules = reactive({
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
// 审批相关:变量
|
// 审批相关:变量
|
||||||
|
type StartUserSelectTask = {
|
||||||
|
id: string
|
||||||
|
name: string
|
||||||
|
}
|
||||||
|
type LeaveCreateData = LeaveApi.LeaveVO & {
|
||||||
|
startUserSelectAssignees?: Record<string, number[]>
|
||||||
|
}
|
||||||
const processDefineKey = 'oa_leave' // 流程定义 Key
|
const processDefineKey = 'oa_leave' // 流程定义 Key
|
||||||
const startUserSelectTasks = ref([]) // 发起人需要选择审批人的用户任务列表
|
const startUserSelectTasks = ref<StartUserSelectTask[]>([]) // 发起人需要选择审批人的用户任务列表
|
||||||
const startUserSelectAssignees = ref({}) // 发起人选择审批人的数据
|
const startUserSelectAssignees = ref<Record<string, number[]>>({}) // 发起人选择审批人的数据
|
||||||
const tempStartUserSelectAssignees = ref({}) // 历史发起人选择审批人的数据,用于每次表单变更时,临时保存
|
const tempStartUserSelectAssignees = ref<Record<string, number[]>>({}) // 历史发起人选择审批人的数据,用于每次表单变更时,临时保存
|
||||||
const activityNodes = ref<ProcessInstanceApi.ApprovalNodeInfo[]>([]) // 审批节点信息
|
const activityNodes = ref<ProcessInstanceApi.ApprovalNodeInfo[]>([]) // 审批节点信息
|
||||||
const processDefinitionId = ref('')
|
const processDefinitionId = ref('')
|
||||||
|
|
||||||
|
|
@ -125,7 +132,7 @@ const submitForm = async () => {
|
||||||
// 2. 提交请求
|
// 2. 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const data = { ...formData.value } as unknown as LeaveApi.LeaveVO
|
const data = { ...formData.value } as unknown as LeaveCreateData
|
||||||
// 审批相关:设置指定审批人
|
// 审批相关:设置指定审批人
|
||||||
if (startUserSelectTasks.value?.length > 0) {
|
if (startUserSelectTasks.value?.length > 0) {
|
||||||
data.startUserSelectAssignees = startUserSelectAssignees.value
|
data.startUserSelectAssignees = startUserSelectAssignees.value
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import { dateFormatter, formatPast2 } from '@/utils/formatTime'
|
import { dateFormatter, formatPast2 } from '@/utils/formatTime'
|
||||||
import { ElMessageBox } from 'element-plus'
|
import { ElMessageBox } from 'element-plus'
|
||||||
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
||||||
import { CategoryApi } from '@/api/bpm/category'
|
import { CategoryApi, CategoryVO } from '@/api/bpm/category'
|
||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
|
|
||||||
// 它和【我的流程】的差异是,该菜单可以看全部的流程实例
|
// 它和【我的流程】的差异是,该菜单可以看全部的流程实例
|
||||||
|
|
@ -179,7 +179,7 @@ const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
const loading = ref(true) // 列表的加载中
|
const loading = ref(true) // 列表的加载中
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
const list = ref([]) // 列表的数据
|
const list = ref<ProcessInstanceApi.ProcessInstanceVO[]>([]) // 列表的数据
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
@ -191,7 +191,7 @@ const queryParams = reactive({
|
||||||
createTime: []
|
createTime: []
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const categoryList = ref([]) // 流程分类列表
|
const categoryList = ref<CategoryVO[]>([]) // 流程分类列表
|
||||||
const userList = ref<any[]>([]) // 用户列表
|
const userList = ref<any[]>([]) // 用户列表
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
|
|
@ -219,7 +219,7 @@ const resetQuery = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查看详情 */
|
/** 查看详情 */
|
||||||
const handleDetail = (row) => {
|
const handleDetail = (row: ProcessInstanceApi.ProcessInstanceVO) => {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'BpmProcessInstanceDetail',
|
name: 'BpmProcessInstanceDetail',
|
||||||
query: {
|
query: {
|
||||||
|
|
@ -229,7 +229,7 @@ const handleDetail = (row) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮操作 */
|
/** 取消按钮操作 */
|
||||||
const handleCancel = async (row) => {
|
const handleCancel = async (row: ProcessInstanceApi.ProcessInstanceVO) => {
|
||||||
// 二次确认
|
// 二次确认
|
||||||
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
|
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
|
||||||
confirmButtonText: t('common.ok'),
|
confirmButtonText: t('common.ok'),
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ defineOptions({ name: 'CrmProductDetail' })
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const id = route.params.id // 编号
|
const id = Number(route.params.id) // 编号
|
||||||
const loading = ref(true) // 加载中
|
const loading = ref(true) // 加载中
|
||||||
const product = ref<ProductApi.ProductVO>({} as ProductApi.ProductVO) // 详情
|
const product = ref<ProductApi.ProductVO>({} as ProductApi.ProductVO) // 详情
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const { currentRoute } = useRouter()
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const id = route.params.id // 编号
|
const id = Number(route.params.id) // 编号
|
||||||
const loading = ref(true) // 加载中
|
const loading = ref(true) // 加载中
|
||||||
const product = ref<ProductVO>({} as ProductVO) // 详情
|
const product = ref<ProductVO>({} as ProductVO) // 详情
|
||||||
const activeTab = ref('info') // 默认为 info 标签页
|
const activeTab = ref('info') // 默认为 info 标签页
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@
|
||||||
<el-descriptions-item v-if="formData.logisticsId" label="运单号: ">
|
<el-descriptions-item v-if="formData.logisticsId" label="运单号: ">
|
||||||
{{ formData.logisticsNo }}
|
{{ formData.logisticsNo }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item v-if="formatDate.deliveryTime" label="发货时间: ">
|
<el-descriptions-item v-if="formData.deliveryTime" label="发货时间: ">
|
||||||
{{ formatDate(formData.deliveryTime) }}
|
{{ formatDate(formData.deliveryTime) }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item v-for="item in 2" :key="item" label-class-name="no-colon" />
|
<el-descriptions-item v-for="item in 2" :key="item" label-class-name="no-colon" />
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(false) // 列表的加载中
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
const list = ref([]) // 列表的数据
|
const list = ref<SmsLogApi.SmsLogVO[]>([]) // 列表的数据
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
|
|
@ -212,7 +212,7 @@ const queryParams = reactive({
|
||||||
receiveTime: []
|
receiveTime: []
|
||||||
})
|
})
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
const channelList = ref([]) // 短信渠道列表
|
const channelList = ref<SmsChannelApi.SmsChannelVO[]>([]) // 短信渠道列表
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue