Merge remote-tracking branch 'yudao/dev' into dev
						commit
						6662b04d12
					
				| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
{
 | 
			
		||||
  "name": "yudao-ui-admin-vue3",
 | 
			
		||||
  "version": "1.7.1-snapshot.1961",
 | 
			
		||||
  "version": "1.7.2-snapshot",
 | 
			
		||||
  "description": "基于vue3、vite4、element-plus、typesScript",
 | 
			
		||||
  "author": "xingyu",
 | 
			
		||||
  "private": false,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -272,7 +272,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
 | 
			
		|||
      {
 | 
			
		||||
        path: '/manager/task-assign-rule',
 | 
			
		||||
        component: () => import('@/views/bpm/taskAssignRule/index.vue'),
 | 
			
		||||
        name: 'BpmTaskAssignRule',
 | 
			
		||||
        name: 'BpmTaskAssignRuleList',
 | 
			
		||||
        meta: {
 | 
			
		||||
          noCache: true,
 | 
			
		||||
          hidden: true,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,10 +1,22 @@
 | 
			
		|||
import type { RouteLocationNormalized, Router, RouteRecordNormalized } from 'vue-router'
 | 
			
		||||
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
 | 
			
		||||
import type { Router, RouteLocationNormalized, RouteRecordNormalized } from 'vue-router'
 | 
			
		||||
import { isUrl } from '@/utils/is'
 | 
			
		||||
import { omit, cloneDeep } from 'lodash-es'
 | 
			
		||||
import { cloneDeep, omit } from 'lodash-es'
 | 
			
		||||
 | 
			
		||||
const modules = import.meta.glob('../views/**/*.{vue,tsx}')
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 注册一个异步组件
 | 
			
		||||
 * @param componentPath 例:/bpm/oa/leave/detail
 | 
			
		||||
 */
 | 
			
		||||
export const registerComponent = (componentPath: string) => {
 | 
			
		||||
  for (const item in modules) {
 | 
			
		||||
    if (item.includes(componentPath)) {
 | 
			
		||||
      // 使用异步组件的方式来动态加载组件
 | 
			
		||||
      // @ts-ignore
 | 
			
		||||
      return defineAsyncComponent(modules[item])
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
/* Layout */
 | 
			
		||||
export const Layout = () => import('@/layout/Layout.vue')
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,10 +44,13 @@ import { CommonStatusEnum } from '@/utils/constants'
 | 
			
		|||
import * as FormApi from '@/api/bpm/form'
 | 
			
		||||
import FcDesigner from '@form-create/designer'
 | 
			
		||||
import { encodeConf, encodeFields, setConfAndFields } from '@/utils/formCreate'
 | 
			
		||||
import { useTagsViewStore } from '@/store/modules/tagsView'
 | 
			
		||||
 | 
			
		||||
const { t } = useI18n() // 国际化
 | 
			
		||||
const message = useMessage() // 消息
 | 
			
		||||
const { query } = useRoute() // 路由
 | 
			
		||||
const { push, currentRoute } = useRouter() // 路由
 | 
			
		||||
const { query } = useRoute() // 路由信息
 | 
			
		||||
const { delView } = useTagsViewStore() // 视图操作
 | 
			
		||||
 | 
			
		||||
const designer = ref() // 表单设计器
 | 
			
		||||
const dialogVisible = ref(false) // 弹窗是否展示
 | 
			
		||||
| 
						 | 
				
			
			@ -88,10 +91,16 @@ const submitForm = async () => {
 | 
			
		|||
      message.success(t('common.updateSuccess'))
 | 
			
		||||
    }
 | 
			
		||||
    dialogVisible.value = false
 | 
			
		||||
    close()
 | 
			
		||||
  } finally {
 | 
			
		||||
    formLoading.value = false
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
/** 关闭按钮 */
 | 
			
		||||
const close = () => {
 | 
			
		||||
  delView(unref(currentRoute))
 | 
			
		||||
  push('/bpm/manager/form')
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** 初始化 **/
 | 
			
		||||
onMounted(async () => {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,26 +2,33 @@
 | 
			
		|||
  <ContentWrap>
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <el-form
 | 
			
		||||
      class="-mb-15px"
 | 
			
		||||
      :model="queryParams"
 | 
			
		||||
      ref="queryFormRef"
 | 
			
		||||
      :inline="true"
 | 
			
		||||
      :model="queryParams"
 | 
			
		||||
      class="-mb-15px"
 | 
			
		||||
      label-width="68px"
 | 
			
		||||
    >
 | 
			
		||||
      <el-form-item label="表单名" prop="name">
 | 
			
		||||
        <el-input
 | 
			
		||||
          v-model="queryParams.name"
 | 
			
		||||
          placeholder="请输入表单名"
 | 
			
		||||
          clearable
 | 
			
		||||
          @keyup.enter="handleQuery"
 | 
			
		||||
          class="!w-240px"
 | 
			
		||||
          clearable
 | 
			
		||||
          placeholder="请输入表单名"
 | 
			
		||||
          @keyup.enter="handleQuery"
 | 
			
		||||
        />
 | 
			
		||||
      </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="openForm" v-hasPermi="['bpm:form:create']">
 | 
			
		||||
          <Icon icon="ep:plus" class="mr-5px" /> 新增
 | 
			
		||||
        <el-button @click="handleQuery">
 | 
			
		||||
          <Icon class="mr-5px" icon="ep:search" />
 | 
			
		||||
          搜索
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button @click="resetQuery">
 | 
			
		||||
          <Icon class="mr-5px" icon="ep:refresh" />
 | 
			
		||||
          重置
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-hasPermi="['bpm:form:create']" plain type="primary" @click="openForm">
 | 
			
		||||
          <Icon class="mr-5px" icon="ep:plus" />
 | 
			
		||||
          新增
 | 
			
		||||
        </el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
| 
						 | 
				
			
			@ -30,38 +37,38 @@
 | 
			
		|||
  <!-- 列表 -->
 | 
			
		||||
  <ContentWrap>
 | 
			
		||||
    <el-table v-loading="loading" :data="list">
 | 
			
		||||
      <el-table-column label="编号" align="center" prop="id" />
 | 
			
		||||
      <el-table-column label="表单名" align="center" prop="name" />
 | 
			
		||||
      <el-table-column label="状态" align="center" prop="status">
 | 
			
		||||
      <el-table-column align="center" label="编号" prop="id" />
 | 
			
		||||
      <el-table-column align="center" label="表单名" prop="name" />
 | 
			
		||||
      <el-table-column align="center" label="状态" prop="status">
 | 
			
		||||
        <template #default="scope">
 | 
			
		||||
          <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="备注" align="center" prop="remark" />
 | 
			
		||||
      <el-table-column align="center" label="备注" prop="remark" />
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        label="创建时间"
 | 
			
		||||
        align="center"
 | 
			
		||||
        prop="createTime"
 | 
			
		||||
        :formatter="dateFormatter"
 | 
			
		||||
        align="center"
 | 
			
		||||
        label="创建时间"
 | 
			
		||||
        prop="createTime"
 | 
			
		||||
      />
 | 
			
		||||
      <el-table-column label="操作" align="center">
 | 
			
		||||
      <el-table-column align="center" label="操作">
 | 
			
		||||
        <template #default="scope">
 | 
			
		||||
          <el-button
 | 
			
		||||
            v-hasPermi="['bpm:form:update']"
 | 
			
		||||
            link
 | 
			
		||||
            type="primary"
 | 
			
		||||
            @click="openForm(scope.row.id)"
 | 
			
		||||
            v-hasPermi="['bpm:form:update']"
 | 
			
		||||
          >
 | 
			
		||||
            编辑
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button link @click="openDetail(scope.row.id)" v-hasPermi="['bpm:form:query']">
 | 
			
		||||
          <el-button v-hasPermi="['bpm:form:query']" link @click="openDetail(scope.row.id)">
 | 
			
		||||
            详情
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
            v-hasPermi="['bpm:form:delete']"
 | 
			
		||||
            link
 | 
			
		||||
            type="danger"
 | 
			
		||||
            @click="handleDelete(scope.row.id)"
 | 
			
		||||
            v-hasPermi="['bpm:form:delete']"
 | 
			
		||||
          >
 | 
			
		||||
            删除
 | 
			
		||||
          </el-button>
 | 
			
		||||
| 
						 | 
				
			
			@ -70,27 +77,28 @@
 | 
			
		|||
    </el-table>
 | 
			
		||||
    <!-- 分页 -->
 | 
			
		||||
    <Pagination
 | 
			
		||||
      :total="total"
 | 
			
		||||
      v-model:page="queryParams.pageNo"
 | 
			
		||||
      v-model:limit="queryParams.pageSize"
 | 
			
		||||
      v-model:page="queryParams.pageNo"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
  </ContentWrap>
 | 
			
		||||
 | 
			
		||||
  <!-- 表单详情的弹窗 -->
 | 
			
		||||
  <Dialog title="表单详情" v-model="detailVisible" width="800">
 | 
			
		||||
    <form-create :rule="detailData.rule" :option="detailData.option" />
 | 
			
		||||
  <Dialog v-model="detailVisible" title="表单详情" width="800">
 | 
			
		||||
    <form-create :option="detailData.option" :rule="detailData.rule" />
 | 
			
		||||
  </Dialog>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts" name="BpmForm">
 | 
			
		||||
<script lang="ts" name="BpmForm" setup>
 | 
			
		||||
import { DICT_TYPE } from '@/utils/dict'
 | 
			
		||||
import { dateFormatter } from '@/utils/formatTime'
 | 
			
		||||
import * as FormApi from '@/api/bpm/form'
 | 
			
		||||
import { setConfAndFields2 } from '@/utils/formCreate'
 | 
			
		||||
 | 
			
		||||
const message = useMessage() // 消息弹窗
 | 
			
		||||
const { t } = useI18n() // 国际化
 | 
			
		||||
const { push } = useRouter() // 路由
 | 
			
		||||
const { currentRoute, push } = useRouter() // 路由
 | 
			
		||||
 | 
			
		||||
const loading = ref(true) // 列表的加载中
 | 
			
		||||
const total = ref(0) // 列表的总页数
 | 
			
		||||
| 
						 | 
				
			
			@ -128,12 +136,16 @@ const resetQuery = () => {
 | 
			
		|||
 | 
			
		||||
/** 添加/修改操作 */
 | 
			
		||||
const openForm = (id?: number) => {
 | 
			
		||||
  push({
 | 
			
		||||
    name: 'BpmFormEditor',
 | 
			
		||||
    query: {
 | 
			
		||||
  const toRouter: { name: string; query?: { id: number } } = {
 | 
			
		||||
    name: 'BpmFormEditor'
 | 
			
		||||
  }
 | 
			
		||||
  // 表单新建的时候id传的是event需要排除
 | 
			
		||||
  if (typeof id === 'number') {
 | 
			
		||||
    toRouter.query = {
 | 
			
		||||
      id
 | 
			
		||||
    }
 | 
			
		||||
  })
 | 
			
		||||
  }
 | 
			
		||||
  push(toRouter)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/** 删除按钮操作 */
 | 
			
		||||
| 
						 | 
				
			
			@ -162,7 +174,16 @@ const openDetail = async (rowId: number) => {
 | 
			
		|||
  // 弹窗打开
 | 
			
		||||
  detailVisible.value = true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**表单保存返回后重新加载列表 */
 | 
			
		||||
watch(
 | 
			
		||||
  () => currentRoute.value,
 | 
			
		||||
  () => {
 | 
			
		||||
    getList()
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    immediate: true
 | 
			
		||||
  }
 | 
			
		||||
)
 | 
			
		||||
/** 初始化 **/
 | 
			
		||||
onMounted(() => {
 | 
			
		||||
  getList()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,7 @@
 | 
			
		|||
        <el-input v-model="formData.name" placeholder="请输入组名" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="描述">
 | 
			
		||||
        <el-input v-model="formData.name" placeholder="请输入描述" type="textarea" />
 | 
			
		||||
        <el-input v-model="formData.description" placeholder="请输入描述" type="textarea" />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="成员" prop="memberUserIds">
 | 
			
		||||
        <el-select v-model="formData.memberUserIds" multiple placeholder="请选择成员">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <ContentWrap>
 | 
			
		||||
    <el-descriptions border :column="1">
 | 
			
		||||
    <el-descriptions :column="1" border>
 | 
			
		||||
      <el-descriptions-item label="请假类型">
 | 
			
		||||
        <dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="detailData.type" />
 | 
			
		||||
      </el-descriptions-item>
 | 
			
		||||
| 
						 | 
				
			
			@ -21,6 +21,7 @@ import { DICT_TYPE } from '@/utils/dict'
 | 
			
		|||
import { formatDate } from '@/utils/formatTime'
 | 
			
		||||
import { propTypes } from '@/utils/propTypes'
 | 
			
		||||
import * as LeaveApi from '@/api/bpm/leave'
 | 
			
		||||
 | 
			
		||||
const { query } = useRoute() // 查询参数
 | 
			
		||||
 | 
			
		||||
const props = defineProps({
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +35,7 @@ const queryId = query.id as unknown as number // 从 URL 传递过来的 id 编
 | 
			
		|||
const getInfo = async () => {
 | 
			
		||||
  detailLoading.value = true
 | 
			
		||||
  try {
 | 
			
		||||
    detailData.value = await LeaveApi.getLeave(queryId || props.id)
 | 
			
		||||
    detailData.value = await LeaveApi.getLeave(props.id || queryId)
 | 
			
		||||
  } finally {
 | 
			
		||||
    detailLoading.value = false
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,81 +2,78 @@
 | 
			
		|||
  <ContentWrap>
 | 
			
		||||
    <!-- 审批信息 -->
 | 
			
		||||
    <el-card
 | 
			
		||||
      class="box-card"
 | 
			
		||||
      v-loading="processInstanceLoading"
 | 
			
		||||
      v-for="(item, index) in runningTasks"
 | 
			
		||||
      :key="index"
 | 
			
		||||
      v-loading="processInstanceLoading"
 | 
			
		||||
      class="box-card"
 | 
			
		||||
    >
 | 
			
		||||
      <template #header>
 | 
			
		||||
        <span class="el-icon-picture-outline">审批任务【{{ item.name }}】</span>
 | 
			
		||||
      </template>
 | 
			
		||||
      <el-col :span="16" :offset="6">
 | 
			
		||||
      <el-col :offset="6" :span="16">
 | 
			
		||||
        <el-form
 | 
			
		||||
          :ref="'form' + index"
 | 
			
		||||
          :model="auditForms[index]"
 | 
			
		||||
          :rules="auditRule"
 | 
			
		||||
          label-width="100px"
 | 
			
		||||
        >
 | 
			
		||||
          <el-form-item label="流程名" v-if="processInstance && processInstance.name">
 | 
			
		||||
          <el-form-item v-if="processInstance && processInstance.name" label="流程名">
 | 
			
		||||
            {{ processInstance.name }}
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
          <el-form-item label="流程发起人" v-if="processInstance && processInstance.startUser">
 | 
			
		||||
          <el-form-item v-if="processInstance && processInstance.startUser" label="流程发起人">
 | 
			
		||||
            {{ processInstance.startUser.nickname }}
 | 
			
		||||
            <el-tag type="info" size="small">{{ processInstance.startUser.deptName }}</el-tag>
 | 
			
		||||
            <el-tag size="small" type="info">{{ processInstance.startUser.deptName }}</el-tag>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
          <el-form-item label="审批建议" prop="reason">
 | 
			
		||||
            <el-input
 | 
			
		||||
              type="textarea"
 | 
			
		||||
              v-model="auditForms[index].reason"
 | 
			
		||||
              placeholder="请输入审批建议"
 | 
			
		||||
              type="textarea"
 | 
			
		||||
            />
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-form>
 | 
			
		||||
        <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
 | 
			
		||||
          <el-button type="success" @click="handleAudit(item, true)">
 | 
			
		||||
            <Icon icon="ep:select" /> 通过
 | 
			
		||||
            <Icon icon="ep:select" />
 | 
			
		||||
            通过
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button type="danger" @click="handleAudit(item, false)">
 | 
			
		||||
            <Icon icon="ep:close" /> 不通过
 | 
			
		||||
            <Icon icon="ep:close" />
 | 
			
		||||
            不通过
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button type="primary" @click="openTaskUpdateAssigneeForm(item.id)">
 | 
			
		||||
            <Icon icon="ep:edit" /> 转办
 | 
			
		||||
            <Icon icon="ep:edit" />
 | 
			
		||||
            转办
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button type="primary" @click="handleDelegate(item)">
 | 
			
		||||
            <Icon icon="ep:position" /> 委派
 | 
			
		||||
            <Icon icon="ep:position" />
 | 
			
		||||
            委派
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button type="warning" @click="handleBack(item)">
 | 
			
		||||
            <Icon icon="ep:back" /> 回退
 | 
			
		||||
            <Icon icon="ep:back" />
 | 
			
		||||
            回退
 | 
			
		||||
          </el-button>
 | 
			
		||||
        </div>
 | 
			
		||||
      </el-col>
 | 
			
		||||
    </el-card>
 | 
			
		||||
 | 
			
		||||
    <!-- 申请信息 -->
 | 
			
		||||
    <el-card class="box-card" v-loading="processInstanceLoading">
 | 
			
		||||
    <el-card v-loading="processInstanceLoading" class="box-card">
 | 
			
		||||
      <template #header>
 | 
			
		||||
        <span class="el-icon-document">申请信息【{{ processInstance.name }}】</span>
 | 
			
		||||
      </template>
 | 
			
		||||
      <!-- 情况一:流程表单 -->
 | 
			
		||||
      <el-col v-if="processInstance?.processDefinition?.formType === 10" :span="16" :offset="6">
 | 
			
		||||
      <el-col v-if="processInstance?.processDefinition?.formType === 10" :offset="6" :span="16">
 | 
			
		||||
        <form-create
 | 
			
		||||
          ref="fApi"
 | 
			
		||||
          :rule="detailForm.rule"
 | 
			
		||||
          :option="detailForm.option"
 | 
			
		||||
          v-model="detailForm.value"
 | 
			
		||||
          :option="detailForm.option"
 | 
			
		||||
          :rule="detailForm.rule"
 | 
			
		||||
        />
 | 
			
		||||
      </el-col>
 | 
			
		||||
      <!-- 情况二:流程表单 -->
 | 
			
		||||
      <!-- 情况二:业务表单 -->
 | 
			
		||||
      <div v-if="processInstance?.processDefinition?.formType === 20">
 | 
			
		||||
        <router-link
 | 
			
		||||
          :to="
 | 
			
		||||
            processInstance.processDefinition.formCustomViewPath +
 | 
			
		||||
            '?id=' +
 | 
			
		||||
            processInstance.businessKey
 | 
			
		||||
          "
 | 
			
		||||
        >
 | 
			
		||||
          <el-button type="primary"><Icon icon="ep:view" /> 点击查看</el-button>
 | 
			
		||||
        </router-link>
 | 
			
		||||
        <BusinessFormComponent :id="processInstance.businessKey" />
 | 
			
		||||
      </div>
 | 
			
		||||
    </el-card>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -85,18 +82,18 @@
 | 
			
		|||
 | 
			
		||||
    <!-- 高亮流程图 -->
 | 
			
		||||
    <ProcessInstanceBpmnViewer
 | 
			
		||||
      :id="id"
 | 
			
		||||
      :process-instance="processInstance"
 | 
			
		||||
      :loading="processInstanceLoading"
 | 
			
		||||
      :tasks="tasks"
 | 
			
		||||
      :id="`${id}`"
 | 
			
		||||
      :bpmn-xml="bpmnXML"
 | 
			
		||||
      :loading="processInstanceLoading"
 | 
			
		||||
      :process-instance="processInstance"
 | 
			
		||||
      :tasks="tasks"
 | 
			
		||||
    />
 | 
			
		||||
 | 
			
		||||
    <!-- 弹窗:转派审批人 -->
 | 
			
		||||
    <TaskUpdateAssigneeForm ref="taskUpdateAssigneeFormRef" @success="getDetail" />
 | 
			
		||||
  </ContentWrap>
 | 
			
		||||
</template>
 | 
			
		||||
<script setup lang="ts" name="BpmProcessInstanceDetail">
 | 
			
		||||
<script lang="ts" name="BpmProcessInstanceDetail" setup>
 | 
			
		||||
import { useUserStore } from '@/store/modules/user'
 | 
			
		||||
import { setConfAndFields2 } from '@/utils/formCreate'
 | 
			
		||||
import type { ApiAttrs } from '@form-create/element-ui/types/config'
 | 
			
		||||
| 
						 | 
				
			
			@ -106,6 +103,8 @@ import * as TaskApi from '@/api/bpm/task'
 | 
			
		|||
import TaskUpdateAssigneeForm from './TaskUpdateAssigneeForm.vue'
 | 
			
		||||
import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue'
 | 
			
		||||
import ProcessInstanceTaskList from './ProcessInstanceTaskList.vue'
 | 
			
		||||
import { registerComponent } from '@/utils/routerHelper'
 | 
			
		||||
 | 
			
		||||
const { query } = useRoute() // 查询参数
 | 
			
		||||
const message = useMessage() // 消息弹窗
 | 
			
		||||
const { proxy } = getCurrentInstance() as any
 | 
			
		||||
| 
						 | 
				
			
			@ -186,6 +185,7 @@ const getDetail = () => {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
/** 加载流程实例 */
 | 
			
		||||
const BusinessFormComponent = ref(null) // 异步组件
 | 
			
		||||
const getProcessInstance = async () => {
 | 
			
		||||
  try {
 | 
			
		||||
    processInstanceLoading.value = true
 | 
			
		||||
| 
						 | 
				
			
			@ -210,10 +210,12 @@ const getProcessInstance = async () => {
 | 
			
		|||
        fApi.value?.fapi?.resetBtn.show(false)
 | 
			
		||||
        fApi.value?.fapi?.disabled(true)
 | 
			
		||||
      })
 | 
			
		||||
    } else {
 | 
			
		||||
      BusinessFormComponent.value = registerComponent(data.processDefinition.formCustomViewPath)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 加载流程图
 | 
			
		||||
    bpmnXML.value = await DefinitionApi.getProcessDefinitionBpmnXML(processDefinition.id)
 | 
			
		||||
    bpmnXML.value = await DefinitionApi.getProcessDefinitionBpmnXML(processDefinition.id as number)
 | 
			
		||||
  } finally {
 | 
			
		||||
    processInstanceLoading.value = false
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,46 +5,53 @@
 | 
			
		|||
  <!-- 搜索 -->
 | 
			
		||||
  <ContentWrap>
 | 
			
		||||
    <el-form
 | 
			
		||||
      class="-mb-15px"
 | 
			
		||||
      :model="queryParams"
 | 
			
		||||
      ref="queryFormRef"
 | 
			
		||||
      :inline="true"
 | 
			
		||||
      :model="queryParams"
 | 
			
		||||
      class="-mb-15px"
 | 
			
		||||
      label-width="68px"
 | 
			
		||||
    >
 | 
			
		||||
      <el-form-item label="表名称" prop="tableName">
 | 
			
		||||
        <el-input
 | 
			
		||||
          v-model="queryParams.tableName"
 | 
			
		||||
          placeholder="请输入表名称"
 | 
			
		||||
          clearable
 | 
			
		||||
          @keyup.enter="handleQuery"
 | 
			
		||||
          class="!w-240px"
 | 
			
		||||
          clearable
 | 
			
		||||
          placeholder="请输入表名称"
 | 
			
		||||
          @keyup.enter="handleQuery"
 | 
			
		||||
        />
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
      <el-form-item label="表描述" prop="tableComment">
 | 
			
		||||
        <el-input
 | 
			
		||||
          v-model="queryParams.tableComment"
 | 
			
		||||
          placeholder="请输入表描述"
 | 
			
		||||
          clearable
 | 
			
		||||
          @keyup.enter="handleQuery"
 | 
			
		||||
          class="!w-240px"
 | 
			
		||||
          clearable
 | 
			
		||||
          placeholder="请输入表描述"
 | 
			
		||||
          @keyup.enter="handleQuery"
 | 
			
		||||
        />
 | 
			
		||||
      </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"
 | 
			
		||||
          end-placeholder="结束日期"
 | 
			
		||||
          start-placeholder="开始日期"
 | 
			
		||||
          type="daterange"
 | 
			
		||||
          value-format="YYYY-MM-dd HH:mm:ss"
 | 
			
		||||
        />
 | 
			
		||||
      </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" v-hasPermi="['infra:codegen:create']" @click="openImportTable()">
 | 
			
		||||
          <Icon icon="ep:zoom-in" class="mr-5px" /> 导入
 | 
			
		||||
        <el-button @click="handleQuery">
 | 
			
		||||
          <Icon class="mr-5px" icon="ep:search" />
 | 
			
		||||
          搜索
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button @click="resetQuery">
 | 
			
		||||
          <Icon class="mr-5px" icon="ep:refresh" />
 | 
			
		||||
          重置
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button v-hasPermi="['infra:codegen:create']" type="primary" @click="openImportTable()">
 | 
			
		||||
          <Icon class="mr-5px" icon="ep:zoom-in" />
 | 
			
		||||
          导入
 | 
			
		||||
        </el-button>
 | 
			
		||||
      </el-form-item>
 | 
			
		||||
    </el-form>
 | 
			
		||||
| 
						 | 
				
			
			@ -53,75 +60,75 @@
 | 
			
		|||
  <!-- 列表 -->
 | 
			
		||||
  <ContentWrap>
 | 
			
		||||
    <el-table v-loading="loading" :data="list">
 | 
			
		||||
      <el-table-column label="数据源" align="center">
 | 
			
		||||
      <el-table-column align="center" label="数据源">
 | 
			
		||||
        <template #default="scope">
 | 
			
		||||
          {{
 | 
			
		||||
            dataSourceConfigList.find((config) => config.id === scope.row.dataSourceConfigId)?.name
 | 
			
		||||
          }}
 | 
			
		||||
        </template>
 | 
			
		||||
      </el-table-column>
 | 
			
		||||
      <el-table-column label="表名称" align="center" prop="tableName" width="200" />
 | 
			
		||||
      <el-table-column align="center" label="表名称" prop="tableName" width="200" />
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        label="表描述"
 | 
			
		||||
        align="center"
 | 
			
		||||
        prop="tableComment"
 | 
			
		||||
        :show-overflow-tooltip="true"
 | 
			
		||||
        align="center"
 | 
			
		||||
        label="表描述"
 | 
			
		||||
        prop="tableComment"
 | 
			
		||||
        width="200"
 | 
			
		||||
      />
 | 
			
		||||
      <el-table-column label="实体" align="center" prop="className" width="200" />
 | 
			
		||||
      <el-table-column align="center" label="实体" prop="className" width="200" />
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        :formatter="dateFormatter"
 | 
			
		||||
        align="center"
 | 
			
		||||
        label="创建时间"
 | 
			
		||||
        align="center"
 | 
			
		||||
        prop="createTime"
 | 
			
		||||
        width="180"
 | 
			
		||||
        :formatter="dateFormatter"
 | 
			
		||||
      />
 | 
			
		||||
      <el-table-column
 | 
			
		||||
        label="更新时间"
 | 
			
		||||
        :formatter="dateFormatter"
 | 
			
		||||
        align="center"
 | 
			
		||||
        label="更新时间"
 | 
			
		||||
        prop="createTime"
 | 
			
		||||
        width="180"
 | 
			
		||||
        :formatter="dateFormatter"
 | 
			
		||||
      />
 | 
			
		||||
      <el-table-column label="操作" align="center" width="300px" fixed="right">
 | 
			
		||||
      <el-table-column align="center" fixed="right" label="操作" width="300px">
 | 
			
		||||
        <template #default="scope">
 | 
			
		||||
          <el-button
 | 
			
		||||
            v-hasPermi="['infra:codegen:preview']"
 | 
			
		||||
            link
 | 
			
		||||
            type="primary"
 | 
			
		||||
            @click="handlePreview(scope.row)"
 | 
			
		||||
            v-hasPermi="['infra:codegen:preview']"
 | 
			
		||||
          >
 | 
			
		||||
            预览
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
            v-hasPermi="['infra:codegen:update']"
 | 
			
		||||
            link
 | 
			
		||||
            type="primary"
 | 
			
		||||
            @click="handleUpdate(scope.row.id)"
 | 
			
		||||
            v-hasPermi="['infra:codegen:update']"
 | 
			
		||||
          >
 | 
			
		||||
            编辑
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
            v-hasPermi="['infra:codegen:delete']"
 | 
			
		||||
            link
 | 
			
		||||
            type="danger"
 | 
			
		||||
            @click="handleDelete(scope.row.id)"
 | 
			
		||||
            v-hasPermi="['infra:codegen:delete']"
 | 
			
		||||
          >
 | 
			
		||||
            删除
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
            v-hasPermi="['infra:codegen:update']"
 | 
			
		||||
            link
 | 
			
		||||
            type="primary"
 | 
			
		||||
            @click="handleSyncDB(scope.row)"
 | 
			
		||||
            v-hasPermi="['infra:codegen:update']"
 | 
			
		||||
          >
 | 
			
		||||
            同步
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
            v-hasPermi="['infra:codegen:download']"
 | 
			
		||||
            link
 | 
			
		||||
            type="primary"
 | 
			
		||||
            @click="handleGenTable(scope.row)"
 | 
			
		||||
            v-hasPermi="['infra:codegen:download']"
 | 
			
		||||
          >
 | 
			
		||||
            生成代码
 | 
			
		||||
          </el-button>
 | 
			
		||||
| 
						 | 
				
			
			@ -130,25 +137,26 @@
 | 
			
		|||
    </el-table>
 | 
			
		||||
    <!-- 分页 -->
 | 
			
		||||
    <Pagination
 | 
			
		||||
      :total="total"
 | 
			
		||||
      v-model:page="queryParams.pageNo"
 | 
			
		||||
      v-model:limit="queryParams.pageSize"
 | 
			
		||||
      v-model:page="queryParams.pageNo"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
  </ContentWrap>
 | 
			
		||||
 | 
			
		||||
  <!-- 弹窗:导入表 -->
 | 
			
		||||
  <ImportTable ref="importRef" success="getList" />
 | 
			
		||||
  <ImportTable ref="importRef" @success="getList" />
 | 
			
		||||
  <!-- 弹窗:预览代码 -->
 | 
			
		||||
  <PreviewCode ref="previewRef" />
 | 
			
		||||
</template>
 | 
			
		||||
<script setup lang="ts" name="InfraCodegen">
 | 
			
		||||
<script lang="ts" name="InfraCodegen" setup>
 | 
			
		||||
import { dateFormatter } from '@/utils/formatTime'
 | 
			
		||||
import download from '@/utils/download'
 | 
			
		||||
import * as CodegenApi from '@/api/infra/codegen'
 | 
			
		||||
import * as DataSourceConfigApi from '@/api/infra/dataSourceConfig'
 | 
			
		||||
import ImportTable from './ImportTable.vue'
 | 
			
		||||
import PreviewCode from './PreviewCode.vue'
 | 
			
		||||
 | 
			
		||||
const message = useMessage() // 消息弹窗
 | 
			
		||||
const { t } = useI18n() // 国际化
 | 
			
		||||
const { push } = useRouter() // 路由跳转
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -171,6 +171,7 @@ const loadEchartOptions = (stats) => {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
onBeforeMount(() => {
 | 
			
		||||
  // TODO @hiiwbs 微信,优化使用 Echart 组件
 | 
			
		||||
  readRedisInfo()
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -93,7 +93,6 @@
 | 
			
		|||
    </el-table-column>
 | 
			
		||||
  </el-table>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import WxVideoPlayer from '@/views/mp/components/wx-video-play/main.vue'
 | 
			
		||||
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue'
 | 
			
		||||
| 
						 | 
				
			
			@ -114,5 +113,3 @@ const emit = defineEmits<{
 | 
			
		|||
  (e: 'on-delete', v: number)
 | 
			
		||||
}>()
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped></style>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
// 消息类型(Follow: 关注时回复;Message: 消息回复;Keyword: 关键词回复)
 | 
			
		||||
// 作为tab.name,enum的数字不能随意修改,与api参数相关
 | 
			
		||||
// 作为 tab.name,enum 的数字不能随意修改,与 api 参数相关
 | 
			
		||||
export enum MsgType {
 | 
			
		||||
  Follow = 1,
 | 
			
		||||
  Message = 2,
 | 
			
		||||
| 
						 | 
				
			
			@ -31,6 +31,7 @@ export interface ReplyForm {
 | 
			
		|||
  responseHqMusicUrl?: string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO @Dhb52:ObjData 这个类名可以在看看,ObjData 有点通用
 | 
			
		||||
export interface ObjData {
 | 
			
		||||
  type: ReplyType
 | 
			
		||||
  accountId?: number
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -49,11 +49,12 @@
 | 
			
		|||
      :loading="loading"
 | 
			
		||||
      :list="list"
 | 
			
		||||
      :msg-type="msgType"
 | 
			
		||||
      @on-update="(id) => onUpdate(id)"
 | 
			
		||||
      @on-delete="(id) => onDelete(id)"
 | 
			
		||||
      @on-update="onUpdate"
 | 
			
		||||
      @on-delete="onDelete"
 | 
			
		||||
    />
 | 
			
		||||
 | 
			
		||||
    <!-- 添加或修改自动回复的对话框 -->
 | 
			
		||||
    <!-- TODO @Dhb52 -->
 | 
			
		||||
    <el-dialog :title="dialogTitle" v-model="showFormDialog" width="800px" destroy-on-close>
 | 
			
		||||
      <el-form ref="formRef" :model="replyForm" :rules="rules" label-width="80px">
 | 
			
		||||
        <el-form-item label="消息类型" prop="requestMessageType" v-if="msgType === MsgType.Message">
 | 
			
		||||
| 
						 | 
				
			
			@ -70,7 +71,7 @@
 | 
			
		|||
        <el-form-item label="匹配类型" prop="requestMatch" v-if="msgType === MsgType.Keyword">
 | 
			
		||||
          <el-select v-model="replyForm.requestMatch" placeholder="请选择匹配类型" clearable>
 | 
			
		||||
            <el-option
 | 
			
		||||
              v-for="dict in getDictOptions(DICT_TYPE.MP_AUTO_REPLY_REQUEST_MATCH)"
 | 
			
		||||
              v-for="dict in getIntDictOptions(DICT_TYPE.MP_AUTO_REPLY_REQUEST_MATCH)"
 | 
			
		||||
              :key="dict.value"
 | 
			
		||||
              :label="dict.label"
 | 
			
		||||
              :value="dict.value"
 | 
			
		||||
| 
						 | 
				
			
			@ -95,26 +96,19 @@
 | 
			
		|||
import WxReplySelect from '@/views/mp/components/wx-reply/main.vue'
 | 
			
		||||
import WxAccountSelect from '@/views/mp/components/wx-account-select/main.vue'
 | 
			
		||||
import * as MpAutoReplyApi from '@/api/mp/autoReply'
 | 
			
		||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
 | 
			
		||||
import { DICT_TYPE, getDictOptions, getIntDictOptions } from '@/utils/dict'
 | 
			
		||||
import { ContentWrap } from '@/components/ContentWrap'
 | 
			
		||||
import type { TabPaneName } from 'element-plus'
 | 
			
		||||
import ReplyTable from './components/ReplyTable.vue'
 | 
			
		||||
import { MsgType, ReplyForm, ObjData } from './components/types'
 | 
			
		||||
const message = useMessage() // 消息
 | 
			
		||||
 | 
			
		||||
const message = useMessage()
 | 
			
		||||
 | 
			
		||||
const formRef = ref()
 | 
			
		||||
 | 
			
		||||
const msgType = ref<MsgType>(MsgType.Keyword)
 | 
			
		||||
// 允许选择的请求消息类型
 | 
			
		||||
const RequestMessageTypes = ['text', 'image', 'voice', 'video', 'shortvideo', 'location', 'link']
 | 
			
		||||
// 遮罩层
 | 
			
		||||
const loading = ref(true)
 | 
			
		||||
// 总条数
 | 
			
		||||
const total = ref(0)
 | 
			
		||||
// 自动回复列表
 | 
			
		||||
const list = ref<any[]>([])
 | 
			
		||||
 | 
			
		||||
const msgType = ref<MsgType>(MsgType.Keyword) // 消息类型
 | 
			
		||||
const RequestMessageTypes = ['text', 'image', 'voice', 'video', 'shortvideo', 'location', 'link'] // 允许选择的请求消息类型
 | 
			
		||||
const loading = ref(true) // 遮罩层
 | 
			
		||||
const total = ref(0) // 总条数
 | 
			
		||||
const list = ref<any[]>([]) // 自动回复列表
 | 
			
		||||
const formRef = ref() // 表单 ref
 | 
			
		||||
// 查询参数
 | 
			
		||||
interface QueryParams {
 | 
			
		||||
  pageNo: number
 | 
			
		||||
| 
						 | 
				
			
			@ -127,13 +121,9 @@ const queryParams: QueryParams = reactive({
 | 
			
		|||
  accountId: undefined
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
// 弹出层标题
 | 
			
		||||
const dialogTitle = ref('')
 | 
			
		||||
// 是否显示弹出层
 | 
			
		||||
const showFormDialog = ref(false)
 | 
			
		||||
// 表单参数
 | 
			
		||||
 | 
			
		||||
const replyForm = ref<ReplyForm>({})
 | 
			
		||||
const dialogTitle = ref('') // 弹出层标题
 | 
			
		||||
const showFormDialog = ref(false) // 是否显示弹出层
 | 
			
		||||
const replyForm = ref<ReplyForm>({}) // 表单参数
 | 
			
		||||
// 回复消息
 | 
			
		||||
const objData = ref<ObjData>({
 | 
			
		||||
  type: 'text',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
<!--
 | 
			
		||||
  【微信消息 - 定位】
 | 
			
		||||
  【微信消息 - 定位】TODO @Dhb52 目前未启用
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,7 +60,6 @@ import { MaterialType, useBeforeUpload } from '@/views/mp/hooks/useUpload'
 | 
			
		|||
import type { UploadRawFile } from 'element-plus'
 | 
			
		||||
import { getAccessToken } from '@/utils/auth'
 | 
			
		||||
import { ObjData } from './types'
 | 
			
		||||
 | 
			
		||||
const message = useMessage()
 | 
			
		||||
 | 
			
		||||
const UPLOAD_URL = import.meta.env.VITE_API_BASEPATH + '/admin-api/mp/material/upload-temporary'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -117,5 +117,3 @@ const selectMaterial = (item: any) => {
 | 
			
		|||
  objData.value.thumbMediaUrl = item.url
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped></style>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@
 | 
			
		|||
          <el-col :span="24">
 | 
			
		||||
            <el-button type="success" @click="showDialog = true">
 | 
			
		||||
              {{ newsType === NewsType.Published ? '选择已发布图文' : '选择草稿箱图文' }}
 | 
			
		||||
              <icon icon="ep:circle-check" />
 | 
			
		||||
              <Icon icon="ep:circle-check" />
 | 
			
		||||
            </el-button>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,5 +25,3 @@ const content = computed<string | null>({
 | 
			
		|||
  }
 | 
			
		||||
})
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped></style>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -51,7 +51,6 @@
 | 
			
		|||
    </el-row>
 | 
			
		||||
  </el-tab-pane>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
import WxMaterialSelect from '@/views/mp/components/wx-material-select/main.vue'
 | 
			
		||||
import WxVoicePlayer from '@/views/mp/components/wx-voice-play/main.vue'
 | 
			
		||||
| 
						 | 
				
			
			@ -59,7 +58,6 @@ import { MaterialType, useBeforeUpload } from '@/views/mp/hooks/useUpload'
 | 
			
		|||
import type { UploadRawFile } from 'element-plus'
 | 
			
		||||
import { getAccessToken } from '@/utils/auth'
 | 
			
		||||
import { ObjData } from './types'
 | 
			
		||||
 | 
			
		||||
const message = useMessage()
 | 
			
		||||
 | 
			
		||||
const UPLOAD_URL = import.meta.env.VITE_API_BASEPATH + '/admin-api/mp/material/upload-temporary'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,6 +42,7 @@ const props = withDefaults(defineProps<Props>(), {
 | 
			
		|||
})
 | 
			
		||||
 | 
			
		||||
const objData = reactive(props.objData)
 | 
			
		||||
// TODO @Dhb52:Tab 切换的时候,应该表单还保留着;清除只有两个时机:1)发送成功后;2)关闭窗口后;我捉摸,是不是每个 TabXXX 组件,是个独立的 Form,然后有自己的对象,不粘在 objData 一起。这样最终就是 MusicMessageForm、ImageMessageForm
 | 
			
		||||
// const tempObj = new Map().set(objData.type, Object.assign({}, objData))
 | 
			
		||||
 | 
			
		||||
/** 切换消息类型的 tab */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -65,10 +65,10 @@ import WxMaterialSelect from '@/views/mp/components/wx-material-select/main.vue'
 | 
			
		|||
import { getAccessToken } from '@/utils/auth'
 | 
			
		||||
import type { UploadFiles, UploadProps, UploadRawFile } from 'element-plus'
 | 
			
		||||
import { NewsItem } from './types'
 | 
			
		||||
 | 
			
		||||
const message = useMessage()
 | 
			
		||||
 | 
			
		||||
const UPLOAD_URL = 'http://localhost:8000/upload/' //import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' // 上传永久素材的地址
 | 
			
		||||
// const UPLOAD_URL = 'http://localhost:8000/upload/' // 上传永久素材的地址
 | 
			
		||||
const UPLOAD_URL = import.meta.env.VITE_BASE_URL + '/admin-api/mp/material/upload-permanent' // 上传永久素材的地址
 | 
			
		||||
const HEADERS = { Authorization: 'Bearer ' + getAccessToken() } // 设置上传的请求头部
 | 
			
		||||
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
| 
						 | 
				
			
			@ -109,7 +109,6 @@ const onMaterialSelected = (item: any) => {
 | 
			
		|||
  newsItem.value.thumbUrl = item.url
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ======================== 文件上传 ========================
 | 
			
		||||
const onBeforeUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => {
 | 
			
		||||
  const isType = ['image/jpeg', 'image/png', 'image/gif', 'image/bmp', 'image/jpg'].includes(
 | 
			
		||||
    rawFile.type
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,6 +46,7 @@
 | 
			
		|||
  </ContentWrap>
 | 
			
		||||
 | 
			
		||||
  <!-- 添加或修改草稿对话框 -->
 | 
			
		||||
  <!-- TODO @Dhb52:是不是整个做成一个组件 -->
 | 
			
		||||
  <el-dialog
 | 
			
		||||
    :title="isCreating ? '新建图文' : '修改图文'"
 | 
			
		||||
    width="80%"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -130,6 +130,7 @@ const emit = defineEmits<{
 | 
			
		|||
  (e: 'update:modelValue', v: any)
 | 
			
		||||
}>()
 | 
			
		||||
 | 
			
		||||
// TODO @Dhb52 输入的 table 切换时,表单应该保留
 | 
			
		||||
const menu = computed({
 | 
			
		||||
  get() {
 | 
			
		||||
    return props.modelValue
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -212,7 +212,7 @@ const handleDelete = async (id: number) => {
 | 
			
		|||
    // 删除的二次确认
 | 
			
		||||
    await message.delConfirm()
 | 
			
		||||
    // 发起删除
 | 
			
		||||
    await NotifyTemplateApi.deleteNotifyTemplateApi(id)
 | 
			
		||||
    await NotifyTemplateApi.deleteNotifyTemplate(id)
 | 
			
		||||
    message.success('删除成功')
 | 
			
		||||
    // 刷新列表
 | 
			
		||||
    await getList()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -91,6 +91,7 @@ const open = async (row: RoleApi.RoleVO) => {
 | 
			
		|||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 | 
			
		||||
 | 
			
		||||
/** 提交表单 */
 | 
			
		||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
 | 
			
		||||
const submitForm = async () => {
 | 
			
		||||
  // 校验表单
 | 
			
		||||
  if (!formRef) return
 | 
			
		||||
| 
						 | 
				
			
			@ -109,6 +110,8 @@ const submitForm = async () => {
 | 
			
		|||
    await PermissionApi.assignRoleMenu(data)
 | 
			
		||||
    message.success(t('common.updateSuccess'))
 | 
			
		||||
    dialogVisible.value = false
 | 
			
		||||
    // 发送操作成功的事件
 | 
			
		||||
    emit('success')
 | 
			
		||||
  } finally {
 | 
			
		||||
    formLoading.value = false
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -107,6 +107,7 @@ const open = async (row: RoleApi.RoleVO) => {
 | 
			
		|||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 | 
			
		||||
 | 
			
		||||
/** 提交表单 */
 | 
			
		||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
 | 
			
		||||
const submitForm = async () => {
 | 
			
		||||
  formLoading.value = true
 | 
			
		||||
  try {
 | 
			
		||||
| 
						 | 
				
			
			@ -121,6 +122,8 @@ const submitForm = async () => {
 | 
			
		|||
    await PermissionApi.assignRoleDataScope(data)
 | 
			
		||||
    message.success(t('common.updateSuccess'))
 | 
			
		||||
    dialogVisible.value = false
 | 
			
		||||
    // 发送操作成功的事件
 | 
			
		||||
    emit('success')
 | 
			
		||||
  } finally {
 | 
			
		||||
    formLoading.value = false
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -156,9 +156,9 @@
 | 
			
		|||
  <!-- 表单弹窗:添加/修改 -->
 | 
			
		||||
  <RoleForm ref="formRef" @success="getList" />
 | 
			
		||||
  <!-- 表单弹窗:菜单权限 -->
 | 
			
		||||
  <RoleAssignMenuForm ref="assignMenuFormRef" />
 | 
			
		||||
  <RoleAssignMenuForm ref="assignMenuFormRef" @success="getList" />
 | 
			
		||||
  <!-- 表单弹窗:数据权限 -->
 | 
			
		||||
  <RoleDataPermissionForm ref="dataPermissionFormRef" />
 | 
			
		||||
  <RoleDataPermissionForm ref="dataPermissionFormRef" @success="getList" />
 | 
			
		||||
</template>
 | 
			
		||||
<script lang="ts" name="SystemRole" setup>
 | 
			
		||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -230,7 +230,7 @@ const queryFormRef = ref() // 搜索的表单
 | 
			
		|||
const getList = async () => {
 | 
			
		||||
  loading.value = true
 | 
			
		||||
  try {
 | 
			
		||||
    const data = await UserApi.getUserPage(queryParams.value)
 | 
			
		||||
    const data = await UserApi.getUserPage(queryParams)
 | 
			
		||||
    list.value = data.list
 | 
			
		||||
    total.value = data.total
 | 
			
		||||
  } finally {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue