Merge remote-tracking branch 'yudao/dev' into dev
commit
521b521d07
|
@ -22,6 +22,6 @@ export const getLeave = async (id: number) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得请假申请分页
|
// 获得请假申请分页
|
||||||
export const getLeavePage = async (params) => {
|
export const getLeavePage = async (params: PageParam) => {
|
||||||
return await request.get({ url: '/bpm/oa/leave/page', params })
|
return await request.get({ url: '/bpm/oa/leave/page', params })
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ declare module '@vue/runtime-core' {
|
||||||
Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
|
Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
|
||||||
Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
|
Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
|
||||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||||
|
ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
|
||||||
|
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||||
ElBadge: typeof import('element-plus/es')['ElBadge']
|
ElBadge: typeof import('element-plus/es')['ElBadge']
|
||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
||||||
|
@ -70,14 +72,19 @@ declare module '@vue/runtime-core' {
|
||||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||||
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
|
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
|
||||||
|
ElSpace: typeof import('element-plus/es')['ElSpace']
|
||||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||||
ElTable: typeof import('element-plus/es')['ElTable']
|
ElTable: typeof import('element-plus/es')['ElTable']
|
||||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||||
|
ElTableV2: typeof import('element-plus/es')['ElTableV2']
|
||||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
||||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
ElTabs: typeof import('element-plus/es')['ElTabs']
|
||||||
ElTag: typeof import('element-plus/es')['ElTag']
|
ElTag: typeof import('element-plus/es')['ElTag']
|
||||||
|
ElTimeline: typeof import('element-plus/es')['ElTimeline']
|
||||||
|
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
|
||||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||||
ElTree: typeof import('element-plus/es')['ElTree']
|
ElTree: typeof import('element-plus/es')['ElTree']
|
||||||
|
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
||||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
ElUpload: typeof import('element-plus/es')['ElUpload']
|
||||||
Error: typeof import('./../components/Error/src/Error.vue')['default']
|
Error: typeof import('./../components/Error/src/Error.vue')['default']
|
||||||
FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default']
|
FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default']
|
||||||
|
|
|
@ -6,6 +6,7 @@ export {}
|
||||||
declare global {
|
declare global {
|
||||||
const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE']
|
const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE']
|
||||||
const EffectScope: typeof import('vue')['EffectScope']
|
const EffectScope: typeof import('vue')['EffectScope']
|
||||||
|
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
|
||||||
const computed: typeof import('vue')['computed']
|
const computed: typeof import('vue')['computed']
|
||||||
const createApp: typeof import('vue')['createApp']
|
const createApp: typeof import('vue')['createApp']
|
||||||
const customRef: typeof import('vue')['customRef']
|
const customRef: typeof import('vue')['customRef']
|
||||||
|
|
|
@ -1,56 +1,107 @@
|
||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<Dialog title="发起 OA 请假流程" v-model="dialogVisible">
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<el-form
|
||||||
<Form :schema="allSchemas.formSchema" :rules="rules" ref="formRef" />
|
ref="formRef"
|
||||||
<!-- 按钮:保存 -->
|
:model="formData"
|
||||||
<XButton
|
:rules="formRules"
|
||||||
type="primary"
|
label-width="80px"
|
||||||
:title="t('action.save')"
|
v-loading="formLoading"
|
||||||
:loading="actionLoading"
|
>
|
||||||
@click="submitForm"
|
<el-form-item label="请假类型" prop="type">
|
||||||
/>
|
<el-select v-model="formData.type" placeholder="请选择请假类型" clearable>
|
||||||
</ContentWrap>
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="formData.startTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="请选择开始时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
|
<el-date-picker
|
||||||
|
clearable
|
||||||
|
v-model="formData.endTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="请选择结束时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原因" prop="reason">
|
||||||
|
<el-input v-model="formData.reason" type="textarea" placeholder="请输请假原因" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { FormExpose } from '@/components/Form'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
// import XEUtils from 'xe-utils'
|
|
||||||
|
|
||||||
// 业务相关的 import
|
|
||||||
import * as LeaveApi from '@/api/bpm/leave'
|
import * as LeaveApi from '@/api/bpm/leave'
|
||||||
import { rules, allSchemas } from './leave.data'
|
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { push } = useRouter() // 路由
|
|
||||||
|
|
||||||
// 表单参数
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const actionLoading = ref(false) // 按钮 Loading
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
const formRef = ref<FormExpose>() // 表单 Ref
|
const formData = ref({
|
||||||
|
type: undefined,
|
||||||
|
reason: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
type: [{ required: true, message: '请假类型不能为空', trigger: 'blur' }],
|
||||||
|
reason: [{ required: true, message: '请假原因不能为空', trigger: 'change' }],
|
||||||
|
startTime: [{ required: true, message: '请假开始时间不能为空', trigger: 'change' }],
|
||||||
|
endTime: [{ required: true, message: '请假结束时间不能为空', trigger: 'change' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
// 提交按钮
|
/** 打开弹窗 */
|
||||||
|
const open = async () => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
resetForm()
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
const elForm = unref(formRef)?.getElFormRef()
|
// 校验表单
|
||||||
if (!elForm) return
|
if (!formRef) return
|
||||||
elForm.validate(async (valid) => {
|
const valid = await formRef.value.validate()
|
||||||
if (!valid) {
|
if (!valid) return
|
||||||
return
|
// 提交请求
|
||||||
}
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
// 设置提交中
|
const data = formData.value as unknown as LeaveApi.LeaveVO
|
||||||
actionLoading.value = true
|
await LeaveApi.createLeave(data)
|
||||||
const data = unref(formRef)?.formModel as LeaveApi.LeaveVO
|
message.success('新增成功')
|
||||||
// data.startTime = XEUtils.toDateString(data.startTime, 'yyyy-MM-dd HH:mm:ss')
|
dialogVisible.value = false
|
||||||
// data.endTime = XEUtils.toDateString(data.endTime, 'yyyy-MM-dd HH:mm:ss')
|
// 发送操作成功的事件
|
||||||
data.startTime = Date.parse(new Date(data.startTime).toString()).toString()
|
emit('success')
|
||||||
data.endTime = Date.parse(new Date(data.endTime).toString()).toString()
|
} finally {
|
||||||
// 添加的提交
|
formLoading.value = false
|
||||||
await LeaveApi.createLeave(data)
|
}
|
||||||
message.success(t('common.createSuccess'))
|
}
|
||||||
// 关闭窗口
|
|
||||||
push('/bpm/oa/leave')
|
/** 重置表单 */
|
||||||
} finally {
|
const resetForm = () => {
|
||||||
actionLoading.value = false
|
formData.value = {
|
||||||
}
|
type: undefined,
|
||||||
})
|
reason: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,42 +1,40 @@
|
||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<Dialog title="详情" v-model="modelVisible" :scroll="true" :max-height="200">
|
||||||
<!-- 详情 -->
|
<el-descriptions border :column="1">
|
||||||
<Descriptions :schema="allSchemas.detailSchema" :data="formData" />
|
<el-descriptions-item label="请假类型">
|
||||||
<el-button @click="routerReturn" type="primary">返回</el-button>
|
<dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="detailData.type" />
|
||||||
</ContentWrap>
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="开始时间">
|
||||||
|
{{ formatDate(detailData.startTime) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="结束时间">
|
||||||
|
{{ formatDate(detailData.endTime) }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="原因">
|
||||||
|
{{ detailData.reason }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// 业务相关的 import
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { formatDate } from '@/utils/formatTime'
|
||||||
import * as LeaveApi from '@/api/bpm/leave'
|
import * as LeaveApi from '@/api/bpm/leave'
|
||||||
import { allSchemas } from '@/views/bpm/oa/leave/leave.data'
|
|
||||||
import { useRouter } from 'vue-router'
|
|
||||||
const router = useRouter()
|
|
||||||
const { query } = useRoute() // 查询参数
|
|
||||||
const message = useMessage() // 消息弹窗
|
|
||||||
|
|
||||||
const id = ref() // 请假编号
|
const modelVisible = ref(false) // 弹窗的是否展示
|
||||||
// 表单参数
|
const detailLoading = ref(false) // 表单的加载中
|
||||||
const formData = ref({
|
const detailData = ref() // 详情数据
|
||||||
startTime: undefined,
|
|
||||||
endTime: undefined,
|
|
||||||
type: undefined,
|
|
||||||
reason: undefined
|
|
||||||
})
|
|
||||||
|
|
||||||
const routerReturn = () => {
|
/** 打开弹窗 */
|
||||||
router.back()
|
const open = async (data: LeaveApi.LeaveVO) => {
|
||||||
}
|
modelVisible.value = true
|
||||||
|
// 设置数据
|
||||||
onMounted(() => {
|
detailLoading.value = true
|
||||||
id.value = query.id
|
try {
|
||||||
if (!id.value) {
|
detailData.value = data
|
||||||
message.error('未传递 id 参数,无法查看 OA 请假信息')
|
} finally {
|
||||||
return
|
detailLoading.value = false
|
||||||
}
|
}
|
||||||
// 获得请假信息
|
}
|
||||||
LeaveApi.getLeave(id.value).then((data) => {
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
formData.value = data
|
|
||||||
})
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,83 +1,236 @@
|
||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<XTable @register="registerTable">
|
<!-- 搜索工作栏 -->
|
||||||
<template #toolbar_buttons>
|
<el-form
|
||||||
<!-- 操作:发起请假 -->
|
class="-mb-15px"
|
||||||
<XButton type="primary" preIcon="ep:plus" title="发起请假" @click="handleCreate()" />
|
:model="queryParams"
|
||||||
</template>
|
ref="queryFormRef"
|
||||||
<template #actionbtns_default="{ row }">
|
:inline="true"
|
||||||
<!-- 操作: 取消请假 -->
|
label-width="68px"
|
||||||
<XTextButton
|
>
|
||||||
preIcon="ep:delete"
|
<el-form-item label="请假类型" prop="type">
|
||||||
title="取消请假"
|
<el-select
|
||||||
v-hasPermi="['bpm:oa-leave:create']"
|
v-model="queryParams.type"
|
||||||
v-if="row.result === 1"
|
placeholder="请选择请假类型"
|
||||||
@click="cancelLeave(row)"
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="申请时间" prop="createTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.createTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-240px"
|
||||||
/>
|
/>
|
||||||
<!-- 操作: 详情 -->
|
</el-form-item>
|
||||||
<XTextButton preIcon="ep:view" :title="t('action.detail')" @click="handleDetail(row)" />
|
<el-form-item label="结果" prop="result">
|
||||||
<!-- 操作: 审批进度 -->
|
<el-select v-model="queryParams.result" placeholder="请选择结果" clearable class="!w-240px">
|
||||||
<XTextButton preIcon="ep:edit-pen" title="审批进度" @click="handleProcessDetail(row)" />
|
<el-option
|
||||||
</template>
|
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)"
|
||||||
</XTable>
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="原因" prop="reason">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.reason"
|
||||||
|
placeholder="请输入原因"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button type="primary" plain @click="handleCreate()">
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 发起请假
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
<!-- 列表 -->
|
||||||
// 全局相关的 import
|
<ContentWrap>
|
||||||
import { ElMessageBox } from 'element-plus'
|
<el-table v-loading="loading" :data="list">
|
||||||
// 业务相关的 import
|
<el-table-column label="申请编号" align="center" prop="id" />
|
||||||
import { allSchemas } from './leave.data'
|
<el-table-column label="状态" align="center" prop="result">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="scope.row.result" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="开始时间"
|
||||||
|
align="center"
|
||||||
|
prop="startTime"
|
||||||
|
width="180"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="结束时间"
|
||||||
|
align="center"
|
||||||
|
prop="endTime"
|
||||||
|
width="180"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
|
<el-table-column label="请假类型" align="center" prop="type">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="scope.row.type" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="原因" align="center" prop="reason" />
|
||||||
|
<el-table-column
|
||||||
|
label="申请时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
width="180"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
|
<el-table-column label="操作" align="center" width="200">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleDetail(scope.row)"
|
||||||
|
v-hasPermi="['bpm:oa-leave:query']"
|
||||||
|
>
|
||||||
|
详情
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="handleProcessDetail(scope.row)"
|
||||||
|
v-hasPermi="['bpm:oa-leave:query']"
|
||||||
|
>
|
||||||
|
进度
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="cancelLeave(scope.row)"
|
||||||
|
v-hasPermi="['bpm:oa-leave:create']"
|
||||||
|
v-if="scope.row.result === 1"
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:详情 -->
|
||||||
|
<LeaveDetail ref="detailRef" />
|
||||||
|
<!-- 表单弹窗:添加 -->
|
||||||
|
<LeaveForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts" name="BpmOALeave">
|
||||||
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import * as LeaveApi from '@/api/bpm/leave'
|
import * as LeaveApi from '@/api/bpm/leave'
|
||||||
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
||||||
|
import LeaveDetail from './detail.vue'
|
||||||
const { t } = useI18n() // 国际化
|
import LeaveForm from './create.vue'
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { push } = useRouter() // 路由
|
const router = useRouter() // 路由
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
const [registerTable, { reload }] = useXTable({
|
const loading = ref(true) // 列表的加载中
|
||||||
allSchemas: allSchemas,
|
const total = ref(0) // 列表的总页数
|
||||||
getListApi: LeaveApi.getLeavePage
|
const list = ref([]) // 列表的数据
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
type: undefined,
|
||||||
|
result: undefined,
|
||||||
|
reason: undefined,
|
||||||
|
createTime: []
|
||||||
})
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
|
||||||
// 发起请假
|
/** 查询列表 */
|
||||||
const handleCreate = () => {
|
const getList = async () => {
|
||||||
push({
|
loading.value = true
|
||||||
name: 'OALeaveCreate'
|
try {
|
||||||
})
|
const data = await LeaveApi.getLeavePage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消请假
|
/** 搜索按钮操作 */
|
||||||
const cancelLeave = (row) => {
|
const handleQuery = () => {
|
||||||
ElMessageBox.prompt('请输入取消原因', '取消流程', {
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const handleCreate = () => {
|
||||||
|
formRef.value.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 详情操作 */
|
||||||
|
const detailRef = ref()
|
||||||
|
const handleDetail = (data: LeaveApi.LeaveVO) => {
|
||||||
|
detailRef.value.open(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 取消请假操作 */
|
||||||
|
const cancelLeave = async (row) => {
|
||||||
|
// 二次确认
|
||||||
|
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
|
||||||
confirmButtonText: t('common.ok'),
|
confirmButtonText: t('common.ok'),
|
||||||
cancelButtonText: t('common.cancel'),
|
cancelButtonText: t('common.cancel'),
|
||||||
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
||||||
inputErrorMessage: '取消原因不能为空'
|
inputErrorMessage: '取消原因不能为空'
|
||||||
}).then(async ({ value }) => {
|
|
||||||
await ProcessInstanceApi.cancelProcessInstance(row.id, value)
|
|
||||||
message.success('取消成功')
|
|
||||||
reload()
|
|
||||||
})
|
})
|
||||||
|
// 发起取消
|
||||||
|
await ProcessInstanceApi.cancelProcessInstance(row.id, value)
|
||||||
|
message.success('取消成功')
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 详情
|
/** 审批进度 */
|
||||||
const handleDetail = (row) => {
|
|
||||||
push({
|
|
||||||
name: 'OALeaveDetail',
|
|
||||||
query: {
|
|
||||||
id: row.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 审批进度
|
|
||||||
const handleProcessDetail = (row) => {
|
const handleProcessDetail = (row) => {
|
||||||
push({
|
router.push({
|
||||||
name: 'BpmProcessInstanceDetail',
|
name: 'BpmProcessInstanceDetail',
|
||||||
query: {
|
query: {
|
||||||
id: row.processInstanceId
|
id: row.processInstanceId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,91 +0,0 @@
|
||||||
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
|
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
|
||||||
|
|
||||||
// 表单校验
|
|
||||||
export const rules = reactive({
|
|
||||||
startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
|
|
||||||
endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }],
|
|
||||||
type: [{ required: true, message: '请假类型不能为空', trigger: 'change' }]
|
|
||||||
})
|
|
||||||
|
|
||||||
// crudSchemas
|
|
||||||
const crudSchemas = reactive<VxeCrudSchema>({
|
|
||||||
primaryKey: 'id',
|
|
||||||
primaryType: 'id',
|
|
||||||
primaryTitle: '申请编号',
|
|
||||||
action: true,
|
|
||||||
actionWidth: '260',
|
|
||||||
searchSpan: 8,
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
title: t('common.status'),
|
|
||||||
field: 'result',
|
|
||||||
dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
|
|
||||||
dictClass: 'number',
|
|
||||||
isSearch: true,
|
|
||||||
isForm: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('common.startTimeText'),
|
|
||||||
field: 'startTime',
|
|
||||||
formatter: 'formatDay',
|
|
||||||
table: {
|
|
||||||
width: 180
|
|
||||||
},
|
|
||||||
detail: {
|
|
||||||
dateFormat: 'YYYY-MM-DD'
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
component: 'DatePicker'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('common.endTimeText'),
|
|
||||||
field: 'endTime',
|
|
||||||
formatter: 'formatDay',
|
|
||||||
table: {
|
|
||||||
width: 180
|
|
||||||
},
|
|
||||||
detail: {
|
|
||||||
dateFormat: 'YYYY-MM-DD'
|
|
||||||
},
|
|
||||||
form: {
|
|
||||||
component: 'DatePicker'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '请假类型',
|
|
||||||
field: 'type',
|
|
||||||
dictType: DICT_TYPE.BPM_OA_LEAVE_TYPE,
|
|
||||||
dictClass: 'number',
|
|
||||||
isSearch: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '原因',
|
|
||||||
field: 'reason',
|
|
||||||
isSearch: true,
|
|
||||||
componentProps: {
|
|
||||||
type: 'textarea',
|
|
||||||
rows: 4
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '申请时间',
|
|
||||||
field: 'createTime',
|
|
||||||
formatter: 'formatDate',
|
|
||||||
table: {
|
|
||||||
width: 180
|
|
||||||
},
|
|
||||||
isSearch: true,
|
|
||||||
search: {
|
|
||||||
show: true,
|
|
||||||
itemRender: {
|
|
||||||
name: 'XDataTimePicker'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isForm: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
|
|
@ -1,205 +1,186 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<doc-alert title="自动回复" url="https://doc.iocoder.cn/mp/auto-reply/" />
|
||||||
<doc-alert title="自动回复" url="https://doc.iocoder.cn/mp/auto-reply/" />
|
|
||||||
|
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-form
|
<el-form
|
||||||
class="-mb-15px"
|
class="-mb-15px"
|
||||||
:model="queryParams"
|
:model="queryParams"
|
||||||
ref="queryFormRef"
|
ref="queryFormRef"
|
||||||
:inline="true"
|
:inline="true"
|
||||||
label-width="68px"
|
label-width="68px"
|
||||||
>
|
>
|
||||||
<el-form-item label="公众号" prop="accountId">
|
<el-form-item label="公众号" prop="accountId">
|
||||||
<el-select v-model="queryParams.accountId" placeholder="请选择公众号" class="!w-240px">
|
<el-select v-model="queryParams.accountId" placeholder="请选择公众号" class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="item in accountList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- tab 切换 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-tabs v-model="type" @tab-change="handleTabChange">
|
||||||
|
<!-- 操作工具栏 -->
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['mp:auto-reply:create']"
|
||||||
|
v-if="type !== '1' || list.length <= 0"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" />新增
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<!-- tab 项 -->
|
||||||
|
<el-tab-pane name="1">
|
||||||
|
<template #label>
|
||||||
|
<span><Icon icon="ep:star-off" /> 关注时回复</span>
|
||||||
|
</template>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane name="2">
|
||||||
|
<template #label>
|
||||||
|
<span><Icon icon="ep:chat-line-round" /> 消息回复</span>
|
||||||
|
</template>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane name="3">
|
||||||
|
<template #label>
|
||||||
|
<span><Icon icon="ep:news" /> 关键词回复</span>
|
||||||
|
</template>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<el-table v-loading="loading" :data="list">
|
||||||
|
<el-table-column
|
||||||
|
label="请求消息类型"
|
||||||
|
align="center"
|
||||||
|
prop="requestMessageType"
|
||||||
|
v-if="type === '2'"
|
||||||
|
/>
|
||||||
|
<el-table-column label="关键词" align="center" prop="requestKeyword" v-if="type === '3'" />
|
||||||
|
<el-table-column label="匹配类型" align="center" prop="requestMatch" v-if="type === '3'">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.MP_AUTO_REPLY_REQUEST_MATCH" :value="scope.row.requestMatch" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="回复消息类型" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.MP_MESSAGE_TYPE" :value="scope.row.responseMessageType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="回复内容" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<div v-if="scope.row.responseMessageType === 'text'">{{ scope.row.responseContent }}</div>
|
||||||
|
<div v-else-if="scope.row.responseMessageType === 'voice'">
|
||||||
|
<WxVoicePlayer :url="scope.row.responseMediaUrl" />
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.responseMessageType === 'image'">
|
||||||
|
<a target="_blank" :href="scope.row.responseMediaUrl">
|
||||||
|
<img :src="scope.row.responseMediaUrl" style="width: 100px" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-else-if="
|
||||||
|
scope.row.responseMessageType === 'video' ||
|
||||||
|
scope.row.responseMessageType === 'shortvideo'
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<WxVideoPlayer :url="scope.row.responseMediaUrl" style="margin-top: 10px" />
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.responseMessageType === 'news'">
|
||||||
|
<WxNews :articles="scope.row.responseArticles" />
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.responseMessageType === 'music'">
|
||||||
|
<WxMusic
|
||||||
|
:title="scope.row.responseTitle"
|
||||||
|
:description="scope.row.responseDescription"
|
||||||
|
:thumb-media-url="scope.row.responseThumbMediaUrl"
|
||||||
|
:music-url="scope.row.responseMusicUrl"
|
||||||
|
:hq-music-url="scope.row.responseHqMusicUrl"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
link
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['mp:auto-reply:update']"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
link
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['mp:auto-reply:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<!-- 添加或修改自动回复的对话框 -->
|
||||||
|
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
||||||
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="消息类型" prop="requestMessageType" v-if="type === '2'">
|
||||||
|
<el-select v-model="form.requestMessageType" placeholder="请选择">
|
||||||
|
<template v-for="dict in getDictOptions(DICT_TYPE.MP_MESSAGE_TYPE)" :key="dict.value">
|
||||||
|
<el-option
|
||||||
|
v-if="requestMessageTypes.includes(dict.value)"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="匹配类型" prop="requestMatch" v-if="type === '3'">
|
||||||
|
<el-select v-model="form.requestMatch" placeholder="请选择匹配类型" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in accountList"
|
v-for="dict in getDictOptions(DICT_TYPE.MP_AUTO_REPLY_REQUEST_MATCH)"
|
||||||
:key="item.id"
|
:key="dict.value"
|
||||||
:label="item.name"
|
:label="dict.label"
|
||||||
:value="item.id"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item label="关键词" prop="requestKeyword" v-if="type === '3'">
|
||||||
<el-button @click="handleQuery"><Icon icon="ep:search" />搜索</el-button>
|
<el-input v-model="form.requestKeyword" placeholder="请输入内容" clearable />
|
||||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" />重置</el-button>
|
</el-form-item>
|
||||||
|
<el-form-item label="回复消息">
|
||||||
|
<WxReplySelect :objData="objData" v-if="hackResetWxReplySelect" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</ContentWrap>
|
<template #footer>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
<!-- tab 切换 -->
|
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
||||||
<ContentWrap>
|
</template>
|
||||||
<el-tabs v-model="type" @tab-change="handleTabChange">
|
</el-dialog>
|
||||||
<!-- 操作工具栏 -->
|
</ContentWrap>
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['mp:auto-reply:create']"
|
|
||||||
v-if="type !== '1' || list.length <= 0"
|
|
||||||
><Icon icon="ep:plus" />新增
|
|
||||||
</el-button>
|
|
||||||
</el-col>
|
|
||||||
<!-- <right-toolbar v-model:showSearch="showSearch" @query-table="getList" /> -->
|
|
||||||
</el-row>
|
|
||||||
<!-- tab 项 -->
|
|
||||||
<el-tab-pane name="1">
|
|
||||||
<template #label>
|
|
||||||
<span><Icon icon="ep:star-off" /> 关注时回复</span>
|
|
||||||
</template>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane name="2">
|
|
||||||
<template #label>
|
|
||||||
<span><Icon icon="ep:chat-line-round" /> 消息回复</span>
|
|
||||||
</template>
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane name="3">
|
|
||||||
<template #label>
|
|
||||||
<span><Icon icon="ep:news" /> 关键词回复</span>
|
|
||||||
</template>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</ContentWrap>
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<ContentWrap>
|
|
||||||
<el-table v-loading="loading" :data="list">
|
|
||||||
<el-table-column
|
|
||||||
label="请求消息类型"
|
|
||||||
align="center"
|
|
||||||
prop="requestMessageType"
|
|
||||||
v-if="type === '2'"
|
|
||||||
/>
|
|
||||||
<el-table-column label="关键词" align="center" prop="requestKeyword" v-if="type === '3'" />
|
|
||||||
<el-table-column label="匹配类型" align="center" prop="requestMatch" v-if="type === '3'">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag
|
|
||||||
:type="DICT_TYPE.MP_AUTO_REPLY_REQUEST_MATCH"
|
|
||||||
:value="scope.row.requestMatch"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="回复消息类型" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :type="DICT_TYPE.MP_MESSAGE_TYPE" :value="scope.row.responsType" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="回复内容" align="center">
|
|
||||||
<template #default="scope">
|
|
||||||
<div v-if="scope.row.responsType === 'text'">{{ scope.row.responseContent }}</div>
|
|
||||||
<div v-else-if="scope.row.responsType === 'voice'">
|
|
||||||
<WxVoicePlayer :url="scope.row.responseMediaUrl" />
|
|
||||||
</div>
|
|
||||||
<div v-else-if="scope.row.responsType === 'image'">
|
|
||||||
<a target="_blank" :href="scope.row.responseMediaUrl">
|
|
||||||
<img :src="scope.row.responseMediaUrl" style="width: 100px" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else-if="
|
|
||||||
scope.row.responsType === 'video' || scope.row.responsType === 'shortvideo'
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<WxVideoPlayer :url="scope.row.responseMediaUrl" style="margin-top: 10px" />
|
|
||||||
</div>
|
|
||||||
<div v-else-if="scope.row.responsType === 'news'">
|
|
||||||
<WxNews :articles="scope.row.responseArticles" />
|
|
||||||
</div>
|
|
||||||
<div v-else-if="scope.row.responsType === 'music'">
|
|
||||||
<WxMusic
|
|
||||||
:title="scope.row.responseTitle"
|
|
||||||
:description="scope.row.responseDescription"
|
|
||||||
:thumb-media-url="scope.row.responseThumbMediaUrl"
|
|
||||||
:music-url="scope.row.responseMusicUrl"
|
|
||||||
:hq-music-url="scope.row.responseHqMusicUrl"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
label="创建时间"
|
|
||||||
align="center"
|
|
||||||
prop="createTime"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
width="180"
|
|
||||||
>
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.createTime }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button
|
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
link
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['mp:auto-reply:update']"
|
|
||||||
><Icon icon="ep:edit" />修改
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
size="small"
|
|
||||||
type="primary"
|
|
||||||
link
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['mp:auto-reply:delete']"
|
|
||||||
><Icon icon="ep:delete" />删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<!-- 添加或修改自动回复的对话框 -->
|
|
||||||
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="消息类型" prop="requestMessageType" v-if="type === '2'">
|
|
||||||
<el-select v-model="form.requestMessageType" placeholder="请选择">
|
|
||||||
<template v-for="dict in getDictOptions(DICT_TYPE.MP_MESSAGE_TYPE)" :key="dict.value">
|
|
||||||
<el-option
|
|
||||||
v-if="requestMessageTypes.includes(dict.value)"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="匹配类型" prop="requestMatch" v-if="type === '3'">
|
|
||||||
<el-select
|
|
||||||
v-model="form.requestMatch"
|
|
||||||
placeholder="请选择匹配类型"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in getDictOptions(DICT_TYPE.MP_AUTO_REPLY_REQUEST_MATCH)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="parseInt(dict.value)"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="关键词" prop="requestKeyword" v-if="type === '3'">
|
|
||||||
<el-input v-model="form.requestKeyword" placeholder="请输入内容" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="回复消息">
|
|
||||||
<WxReplySelect :objData="objData" v-if="hackResetWxReplySelect" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<span class="dialog-footer">
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
|
||||||
</span>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</ContentWrap>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
<script setup name="MpAutoReply">
|
||||||
<script setup>
|
|
||||||
import { ref, reactive, onMounted, nextTick } from 'vue'
|
import { ref, reactive, onMounted, nextTick } from 'vue'
|
||||||
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue'
|
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue'
|
||||||
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue'
|
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue'
|
||||||
|
@ -341,14 +322,14 @@ const handleUpdate = (row) => {
|
||||||
getAutoReply(row.id).then((data) => {
|
getAutoReply(row.id).then((data) => {
|
||||||
// 设置属性
|
// 设置属性
|
||||||
form.value = { ...data }
|
form.value = { ...data }
|
||||||
delete form.value['responsType']
|
delete form.value['responseMessageType']
|
||||||
delete form.value['responseContent']
|
delete form.value['responseContent']
|
||||||
delete form.value['responseMediaId']
|
delete form.value['responseMediaId']
|
||||||
delete form.value['responseMediaUrl']
|
delete form.value['responseMediaUrl']
|
||||||
delete form.value['responseDescription']
|
delete form.value['responseDescription']
|
||||||
delete form.value['responseArticles']
|
delete form.value['responseArticles']
|
||||||
objData.value = {
|
objData.value = {
|
||||||
type: data.responsType,
|
type: data.responseMessageType,
|
||||||
accountId: queryParams.accountId,
|
accountId: queryParams.accountId,
|
||||||
content: data.responseContent,
|
content: data.responseContent,
|
||||||
mediaId: data.responseMediaId,
|
mediaId: data.responseMediaId,
|
||||||
|
@ -376,7 +357,7 @@ const handleSubmit = () => {
|
||||||
|
|
||||||
// 处理回复消息
|
// 处理回复消息
|
||||||
const form = { ...form.value }
|
const form = { ...form.value }
|
||||||
form.responsType = objData.value.type
|
form.responseMessageType = objData.value.type
|
||||||
form.responseContent = objData.value.content
|
form.responseContent = objData.value.content
|
||||||
form.responseMediaId = objData.value.mediaId
|
form.responseMediaId = objData.value.mediaId
|
||||||
form.responseMediaUrl = objData.value.url
|
form.responseMediaUrl = objData.value.url
|
||||||
|
|
|
@ -197,10 +197,8 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<el-button @click="cancelVideo">取 消</el-button>
|
||||||
<el-button @click="cancelVideo">取 消</el-button>
|
<el-button type="primary" @click="submitVideo">提 交</el-button>
|
||||||
<el-button type="primary" @click="submitVideo">提 交</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<el-input v-model="formData.name" placeholder="请输入岗位标题" />
|
<el-input v-model="formData.name" placeholder="请输入岗位标题" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="岗位编码" prop="code">
|
<el-form-item label="岗位编码" prop="code">
|
||||||
<el-input :model-value="formData.code" placeholder="请输入岗位编码" height="150px" />
|
<el-input v-model="formData.code" placeholder="请输入岗位编码" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="formData.status" placeholder="请选择状态" clearable>
|
<el-select v-model="formData.status" placeholder="请选择状态" clearable>
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
<el-input v-model="formData.name" placeholder="请输入角色名称" />
|
<el-input v-model="formData.name" placeholder="请输入角色名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色标识" prop="code">
|
<el-form-item label="角色标识" prop="code">
|
||||||
<el-input :model-value="formData.code" placeholder="请输入角色标识" height="150px" />
|
<el-input v-model="formData.code" placeholder="请输入角色标识" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="显示顺序" prop="sort">
|
<el-form-item label="显示顺序" prop="sort">
|
||||||
<el-input :model-value="formData.sort" placeholder="请输入显示顺序" height="150px" />
|
<el-input v-model="formData.sort" placeholder="请输入显示顺序" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态" prop="status">
|
<el-form-item label="状态" prop="status">
|
||||||
<el-select v-model="formData.status" placeholder="请选择状态" clearable>
|
<el-select v-model="formData.status" placeholder="请选择状态" clearable>
|
||||||
|
|
Loading…
Reference in New Issue