fix: some warn

This commit is contained in:
xingyuv 2023-02-09 15:29:29 +08:00
parent 5df6addb78
commit 6e12fa4d78
24 changed files with 81 additions and 117 deletions

View File

@ -22,6 +22,7 @@ export type ModelVO = {
status: number status: number
remark: string remark: string
createTime: string createTime: string
bpmnXml: string
} }
export const getModelPageApi = async (params) => { export const getModelPageApi = async (params) => {

View File

@ -5,7 +5,7 @@
</template> </template>
</VxeGrid> </VxeGrid>
</template> </template>
<script lang="ts" setup name="XTable"> <script setup lang="ts" name="XTable">
import { PropType } from 'vue' import { PropType } from 'vue'
import { SizeType, VxeGridInstance } from 'vxe-table' import { SizeType, VxeGridInstance } from 'vxe-table'
import { useAppStore } from '@/store/modules/app' import { useAppStore } from '@/store/modules/app'

View File

@ -287,7 +287,7 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script lang="ts" setup name="UserTaskListeners"> <script setup lang="ts" name="UserTaskListeners">
import { ElMessageBox } from 'element-plus' import { ElMessageBox } from 'element-plus'
import { createListenerObject, updateElementExtensions } from '../../utils' import { createListenerObject, updateElementExtensions } from '../../utils'
import { initListenerForm, initListenerType, eventType, listenerType, fieldType } from './utilSelf' import { initListenerForm, initListenerType, eventType, listenerType, fieldType } from './utilSelf'

View File

@ -1,10 +1,6 @@
<template> <template>
<Error type="403" @error-click="errorClick()" /> <Error type="403" @error-click="push('/')" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const { push } = useRouter() const { push } = useRouter()
const errorClick = () => {
push('/')
}
</script> </script>

View File

@ -1,10 +1,6 @@
<template> <template>
<Error @error-click="errorClick()" /> <Error @error-click="push('/')" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const { push } = useRouter() const { push } = useRouter()
const errorClick = () => {
push('/')
}
</script> </script>

View File

@ -1,10 +1,6 @@
<template> <template>
<Error type="500" @error-click="errorClick()" /> <Error type="500" @error-click="push('/')" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const { push } = useRouter() const { push } = useRouter()
const errorClick = () => {
push('/')
}
</script> </script>

View File

@ -1,7 +1,4 @@
import { reactive } from 'vue' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
import { DICT_TYPE } from '@/utils/dict'
// CrudSchema // CrudSchema
const crudSchemas = reactive<VxeCrudSchema>({ const crudSchemas = reactive<VxeCrudSchema>({

View File

@ -46,20 +46,16 @@
</ContentWrap> </ContentWrap>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
// import
import { ref } from 'vue'
// import // import
import * as DefinitionApi from '@/api/bpm/definition' import * as DefinitionApi from '@/api/bpm/definition'
// import * as ModelApi from '@/api/bpm/model' // import * as ModelApi from '@/api/bpm/model'
import { allSchemas } from './definition.data' import { allSchemas } from './definition.data'
import { setConfAndFields2 } from '@/utils/formCreate'
const message = useMessage() // const message = useMessage() //
const router = useRouter() // const router = useRouter() //
const { query } = useRoute() // const { query } = useRoute() //
import { setConfAndFields2 } from '@/utils/formCreate'
// ========== ========== // ========== ==========
const queryParams = reactive({ const queryParams = reactive({
key: query.key key: query.key

View File

@ -1,4 +1,4 @@
import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化

View File

@ -1,52 +1,49 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 列表 --> <!-- 列表 -->
<div> <XTable @register="registerTable">
<XTable @register="registerTable"> <!-- 操作新增 -->
<!-- 操作新增 --> <template #toolbar_buttons>
<template #toolbar_buttons> <XButton
<XButton type="primary"
type="primary" preIcon="ep:zoom-in"
preIcon="ep:zoom-in" :title="t('action.add')"
:title="t('action.add')" v-hasPermi="['system:post:create']"
v-hasPermi="['system:post:create']" @click="handleCreate()"
@click="handleCreate()" />
/> </template>
</template> <template #actionbtns_default="{ row }">
<template #actionbtns_default="{ row }"> <!-- 操作修改 -->
<!-- 操作修改 --> <XTextButton
<XTextButton preIcon="ep:edit"
preIcon="ep:edit" :title="t('action.edit')"
:title="t('action.edit')" v-hasPermi="['bpm:form:update']"
v-hasPermi="['bpm:form:update']" @click="handleUpdate(row.id)"
@click="handleUpdate(row.id)" />
/> <!-- 操作详情 -->
<!-- 操作详情 --> <XTextButton
<XTextButton preIcon="ep:view"
preIcon="ep:view" :title="t('action.detail')"
:title="t('action.detail')" v-hasPermi="['bpm:form:query']"
v-hasPermi="['bpm:form:query']" @click="handleDetail(row.id)"
@click="handleDetail(row.id)" />
/> <!-- 操作删除 -->
<!-- 操作删除 --> <XTextButton
<XTextButton preIcon="ep:delete"
preIcon="ep:delete" :title="t('action.del')"
:title="t('action.del')" v-hasPermi="['bpm:form:delete']"
v-hasPermi="['bpm:form:delete']" @click="deleteData(row.id)"
@click="deleteData(row.id)" />
/> </template>
</template> </XTable>
</XTable> <!-- 表单详情的弹窗 -->
<!-- 表单详情的弹窗 --> <XModal v-model="detailOpen" width="800" title="表单详情">
<XModal v-model="detailOpen" width="800" title="表单详情"> <form-create :rule="detailPreview.rule" :option="detailPreview.option" v-if="detailOpen" />
<form-create :rule="detailPreview.rule" :option="detailPreview.option" v-if="detailOpen" /> </XModal>
</XModal>
</div>
</ContentWrap> </ContentWrap>
</template> </template>
<script setup lang="ts" name="BpmForm"> <script setup lang="ts" name="BpmForm">
// import
// import // import
import * as FormApi from '@/api/bpm/form' import * as FormApi from '@/api/bpm/form'
import { allSchemas } from './form.data' import { allSchemas } from './form.data'
@ -54,7 +51,7 @@ import { allSchemas } from './form.data'
import { setConfAndFields2 } from '@/utils/formCreate' import { setConfAndFields2 } from '@/utils/formCreate'
const { t } = useI18n() // const { t } = useI18n() //
const router = useRouter() // const { push } = useRouter() //
// //
const [registerTable, { deleteData }] = useXTable({ const [registerTable, { deleteData }] = useXTable({
@ -65,14 +62,14 @@ const [registerTable, { deleteData }] = useXTable({
// //
const handleCreate = () => { const handleCreate = () => {
router.push({ push({
name: 'bpmFormEditor' name: 'bpmFormEditor'
}) })
} }
// //
const handleUpdate = async (rowId: number) => { const handleUpdate = async (rowId: number) => {
await router.push({ await push({
name: 'bpmFormEditor', name: 'bpmFormEditor',
query: { query: {
id: rowId id: rowId

View File

@ -1,4 +1,4 @@
import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化

View File

@ -1,9 +1,5 @@
import { reactive } from 'vue' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
import { useI18n } from '@/hooks/web/useI18n'
import { required } from '@/utils/formRules'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
import { DICT_TYPE } from '@/utils/dict'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// 表单校验 // 表单校验

View File

@ -27,7 +27,6 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted } from 'vue'
// import { translations } from '@/components/bpmnProcessDesigner/src/translations' // import { translations } from '@/components/bpmnProcessDesigner/src/translations'
// //
import CustomContentPadProvider from '@/components/bpmnProcessDesigner/package/designer/plugins/content-pad' import CustomContentPadProvider from '@/components/bpmnProcessDesigner/package/designer/plugins/content-pad'
@ -36,11 +35,10 @@ import CustomPaletteProvider from '@/components/bpmnProcessDesigner/package/desi
// import xmlObj2json from "./utils/xml2json"; // import xmlObj2json from "./utils/xml2json";
// import myProcessDesigner from '@/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue' // import myProcessDesigner from '@/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue'
// import MyProcessPalette from '@/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue' // import MyProcessPalette from '@/components/bpmnProcessDesigner/package/palette/ProcessPalette.vue'
import { createModelApi, getModelApi, updateModelApi } from '@/api/bpm/model' import { createModelApi, getModelApi, updateModelApi, ModelVO } from '@/api/bpm/model'
import { useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
const router = useRouter() const router = useRouter()
const message = useMessage()
// //
// import MyProcessPanel from "../package/process-panel/ProcessPanel"; // import MyProcessPanel from "../package/process-panel/ProcessPanel";
@ -63,14 +61,14 @@ const controlForm = ref({
// CustomPaletteProvider // CustomPaletteProvider
// }) // })
// //
const model = ref({}) const model = ref<ModelVO>()
onMounted(() => { onMounted(() => {
// modelId // modelId
const modelId = router.currentRoute.value.query && router.currentRoute.value.query.modelId const modelId = router.currentRoute.value.query && router.currentRoute.value.query.modelId
console.log(modelId, 'modelId') console.log(modelId, 'modelId')
if (modelId) { if (modelId) {
// let data = '4b4909d8-97e7-11ec-8e20-862bc1a4a054' // let data = '4b4909d8-97e7-11ec-8e20-862bc1a4a054'
getModelApi(modelId).then((data) => { getModelApi(modelId as unknown as number).then((data) => {
console.log(data, 'response') console.log(data, 'response')
xmlString.value = data.bpmnXml xmlString.value = data.bpmnXml
model.value = { model.value = {
@ -109,9 +107,9 @@ const initModeler = (item) => {
} }
const save = (bpmnXml) => { const save = (bpmnXml) => {
const data = { const data: ModelVO = {
...model.value, ...model.value,
bpmnXml: bpmnXml // this.bpmnXml bpmnXml: bpmnXml // bpmnXml
} }
console.log(data, 'data') console.log(data, 'data')
@ -119,9 +117,7 @@ const save = (bpmnXml) => {
if (data.id) { if (data.id) {
updateModelApi(data).then((response) => { updateModelApi(data).then((response) => {
console.log(response, 'response') console.log(response, 'response')
// this.$modal.msgSuccess("") message.success('修改成功')
ElMessage.success('修改成功')
// //
close() close()
}) })
@ -130,15 +126,13 @@ const save = (bpmnXml) => {
// //
createModelApi(data).then((response) => { createModelApi(data).then((response) => {
console.log(response, 'response1') console.log(response, 'response1')
// this.$modal.msgSuccess("") message.success('保存成功')
ElMessage.success('保存成功')
// //
close() close()
}) })
} }
/** 关闭按钮 */ /** 关闭按钮 */
const close = () => { const close = () => {
// this.$tab.closeOpenPage({ path: "/bpm/manager/model" })
router.push({ path: '/bpm/manager/model' }) router.push({ path: '/bpm/manager/model' })
} }
</script> </script>

View File

@ -21,7 +21,7 @@ import { rules, allSchemas } from './leave.data'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const router = useRouter() // const { push } = useRouter() //
// //
const actionLoading = ref(false) // Loading const actionLoading = ref(false) // Loading
@ -41,15 +41,13 @@ const submitForm = async () => {
const data = unref(formRef)?.formModel as LeaveApi.LeaveVO const data = unref(formRef)?.formModel as LeaveApi.LeaveVO
// data.startTime = XEUtils.toDateString(data.startTime, 'yyyy-MM-dd HH:mm:ss') // data.startTime = XEUtils.toDateString(data.startTime, 'yyyy-MM-dd HH:mm:ss')
// data.endTime = XEUtils.toDateString(data.endTime, 'yyyy-MM-dd HH:mm:ss') // data.endTime = XEUtils.toDateString(data.endTime, 'yyyy-MM-dd HH:mm:ss')
data.startTime = Date.parse(new Date(data.startTime).toString()) data.startTime = Date.parse(new Date(data.startTime).toString()).toString()
data.endTime = Date.parse(new Date(data.endTime).toString()) data.endTime = Date.parse(new Date(data.endTime).toString()).toString()
// //
await LeaveApi.createLeaveApi(data) await LeaveApi.createLeaveApi(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
// //
router.push({ push('/bpm/oa/leave')
path: '/bpm/oa/leave'
})
} finally { } finally {
actionLoading.value = false actionLoading.value = false
} }

View File

@ -5,7 +5,7 @@
</ContentWrap> </ContentWrap>
</template> </template>
<script lang="ts" setup> <script setup lang="ts">
// import // import
import * as LeaveApi from '@/api/bpm/leave' import * as LeaveApi from '@/api/bpm/leave'
import { allSchemas } from '@/views/bpm/oa/leave/leave.data' import { allSchemas } from '@/views/bpm/oa/leave/leave.data'

View File

@ -33,7 +33,7 @@ import * as ProcessInstanceApi from '@/api/bpm/processInstance'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const router = useRouter() // const { push } = useRouter() //
const [registerTable, { reload }] = useXTable({ const [registerTable, { reload }] = useXTable({
allSchemas: allSchemas, allSchemas: allSchemas,
@ -42,7 +42,7 @@ const [registerTable, { reload }] = useXTable({
// //
const handleCreate = () => { const handleCreate = () => {
router.push({ push({
name: 'OALeaveCreate' name: 'OALeaveCreate'
}) })
} }
@ -63,7 +63,7 @@ const cancelLeave = (row) => {
// //
const handleDetail = (row) => { const handleDetail = (row) => {
router.push({ push({
name: 'OALeaveDetail', name: 'OALeaveDetail',
query: { query: {
id: row.id id: row.id
@ -73,7 +73,7 @@ const handleDetail = (row) => {
// //
const handleProcessDetail = (row) => { const handleProcessDetail = (row) => {
router.push({ push({
name: 'BpmProcessInstanceDetail', name: 'BpmProcessInstanceDetail',
query: { query: {
id: row.processInstanceId id: row.processInstanceId

View File

@ -1,4 +1,4 @@
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化

View File

@ -1,4 +1,4 @@
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
// crudSchemas // crudSchemas
const crudSchemas = reactive<VxeCrudSchema>({ const crudSchemas = reactive<VxeCrudSchema>({

View File

@ -1,7 +1,5 @@
import { reactive } from 'vue' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
import { useI18n } from '@/hooks/web/useI18n'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
import { DICT_TYPE } from '@/utils/dict'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
// CrudSchema // CrudSchema

View File

@ -1,4 +1,4 @@
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化

View File

@ -12,13 +12,12 @@
</XTable> </XTable>
</ContentWrap> </ContentWrap>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
// import // import
import { allSchemas } from './done.data' import { allSchemas } from './done.data'
import * as TaskApi from '@/api/bpm/task' import * as TaskApi from '@/api/bpm/task'
const router = useRouter() // const { push } = useRouter() //
const [registerTable] = useXTable({ const [registerTable] = useXTable({
allSchemas: allSchemas, allSchemas: allSchemas,
@ -27,7 +26,7 @@ const [registerTable] = useXTable({
// //
const handleAudit = (row) => { const handleAudit = (row) => {
router.push({ push({
name: 'BpmProcessInstanceDetail', name: 'BpmProcessInstanceDetail',
query: { query: {
id: row.processInstance.id id: row.processInstance.id

View File

@ -18,7 +18,7 @@
import { allSchemas } from './todo.data' import { allSchemas } from './todo.data'
import * as TaskApi from '@/api/bpm/task' import * as TaskApi from '@/api/bpm/task'
const router = useRouter() // const { push } = useRouter() //
const [registerTable] = useXTable({ const [registerTable] = useXTable({
allSchemas: allSchemas, allSchemas: allSchemas,
@ -27,7 +27,7 @@ const [registerTable] = useXTable({
// //
const handleAudit = (row) => { const handleAudit = (row) => {
router.push({ push({
name: 'BpmProcessInstanceDetail', name: 'BpmProcessInstanceDetail',
query: { query: {
id: row.processInstance.id id: row.processInstance.id

View File

@ -1,4 +1,4 @@
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化

View File

@ -1,4 +1,4 @@
import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
// 表单校验 // 表单校验
export const rules = reactive({ export const rules = reactive({