|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<hc-sys id="app-sys" class="h-full hc-uni-app-table-form" :isNavBar="false">
|
|
<hc-sys id="app-sys" class="h-full hc-uni-app-table-form" :isNavBar="false">
|
|
- <view id="title-bar" class="title-bar">
|
|
|
|
|
|
+ <view id="title-bar" class="title-bar z-24">
|
|
<button type="primary" class="title-bar-btn" @click="editTypeClick">切换</button>
|
|
<button type="primary" class="title-bar-btn" @click="editTypeClick">切换</button>
|
|
<button type="primary" class="title-bar-btn" @click="toCopyClick">复制</button>
|
|
<button type="primary" class="title-bar-btn" @click="toCopyClick">复制</button>
|
|
<button type="primary" class="title-bar-btn" @click="toHideClick">隐藏</button>
|
|
<button type="primary" class="title-bar-btn" @click="toHideClick">隐藏</button>
|
|
@@ -24,7 +24,6 @@ import {getStorage} from "@/utils/storage";
|
|
import {useAppStore} from "@/store";
|
|
import {useAppStore} from "@/store";
|
|
import wbsApi from '~api/data-fill/wbs';
|
|
import wbsApi from '~api/data-fill/wbs';
|
|
import {getFormApiUrl} from '@/config/envApi';
|
|
import {getFormApiUrl} from '@/config/envApi';
|
|
-import {date} from "@/uni_modules/uv-ui-tools/libs/function/test";
|
|
|
|
|
|
|
|
const store = useAppStore()
|
|
const store = useAppStore()
|
|
const instance = getCurrentInstance().proxy
|
|
const instance = getCurrentInstance().proxy
|
|
@@ -104,6 +103,7 @@ const initWebview = async () => {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const isFormRender = ref(false)
|
|
const handleMessage = (event) => {
|
|
const handleMessage = (event) => {
|
|
let msg = {};
|
|
let msg = {};
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
@@ -115,6 +115,9 @@ const handleMessage = (event) => {
|
|
msg = event.detail.data[0]
|
|
msg = event.detail.data[0]
|
|
// #endif
|
|
// #endif
|
|
if (msg.source === 'web') {
|
|
if (msg.source === 'web') {
|
|
|
|
+ if (msg.type === 'formRender') {
|
|
|
|
+ isFormRender.value = true
|
|
|
|
+ }
|
|
if (msg.type === 'back') {
|
|
if (msg.type === 'back') {
|
|
toBack() //收到通知,刷新列表去
|
|
toBack() //收到通知,刷新列表去
|
|
}
|
|
}
|
|
@@ -140,6 +143,10 @@ onUnload(()=>{
|
|
//切换显示模式
|
|
//切换显示模式
|
|
const editType = ref('form')
|
|
const editType = ref('form')
|
|
const editTypeClick = () => {
|
|
const editTypeClick = () => {
|
|
|
|
+ if (isFormRender.value === false) {
|
|
|
|
+ errorToast('表单未渲染完成,请稍后再试');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const type = editType.value === 'form' ? 'table' : 'form'
|
|
const type = editType.value === 'form' ? 'table' : 'form'
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
window.frames["exceliframe"].postMessage({
|
|
window.frames["exceliframe"].postMessage({
|
|
@@ -156,6 +163,10 @@ const editTypeClick = () => {
|
|
|
|
|
|
//复制本表
|
|
//复制本表
|
|
const toCopyClick = async () => {
|
|
const toCopyClick = async () => {
|
|
|
|
+ if (isFormRender.value === false) {
|
|
|
|
+ errorToast('表单未渲染完成,请稍后再试');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const { pkeyId, status } = pageNode.value
|
|
const { pkeyId, status } = pageNode.value
|
|
if (!pkeyId) {
|
|
if (!pkeyId) {
|
|
errorToast('pkeyId为空');
|
|
errorToast('pkeyId为空');
|
|
@@ -181,6 +192,10 @@ const toCopyClick = async () => {
|
|
|
|
|
|
//隐藏表单
|
|
//隐藏表单
|
|
const toHideClick = async () => {
|
|
const toHideClick = async () => {
|
|
|
|
+ if (isFormRender.value === false) {
|
|
|
|
+ errorToast('表单未渲染完成,请稍后再试');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const { pkeyId, status } = pageNode.value
|
|
const { pkeyId, status } = pageNode.value
|
|
if (!pkeyId) {
|
|
if (!pkeyId) {
|
|
errorToast('pkeyId为空');
|
|
errorToast('pkeyId为空');
|
|
@@ -207,6 +222,10 @@ const toHideClick = async () => {
|
|
|
|
|
|
//预览表单
|
|
//预览表单
|
|
const previewClick = async () => {
|
|
const previewClick = async () => {
|
|
|
|
+ if (isFormRender.value === false) {
|
|
|
|
+ errorToast('表单未渲染完成,请稍后再试');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const { pkeyId, isBussShow, isTabPdf, pdfUrl } = pageNode.value
|
|
const { pkeyId, isBussShow, isTabPdf, pdfUrl } = pageNode.value
|
|
if (!pkeyId) {
|
|
if (!pkeyId) {
|
|
errorToast('pkeyId为空');
|
|
errorToast('pkeyId为空');
|
|
@@ -229,6 +248,10 @@ const previewClick = async () => {
|
|
|
|
|
|
//保存
|
|
//保存
|
|
const formSaveClick = () => {
|
|
const formSaveClick = () => {
|
|
|
|
+ if (isFormRender.value === false) {
|
|
|
|
+ errorToast('表单未渲染完成,请稍后再试');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
uni.showLoading({title: '保存中...', mask: true})
|
|
uni.showLoading({title: '保存中...', mask: true})
|
|
// #ifdef H5
|
|
// #ifdef H5
|
|
window.frames["exceliframe"].postMessage({
|
|
window.frames["exceliframe"].postMessage({
|
|
@@ -244,6 +267,10 @@ const formSaveClick = () => {
|
|
|
|
|
|
//上传
|
|
//上传
|
|
const toFileUp = () => {
|
|
const toFileUp = () => {
|
|
|
|
+ if (isFormRender.value === false) {
|
|
|
|
+ errorToast('表单未渲染完成,请稍后再试');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
const { pkeyId, status } = pageNode.value
|
|
const { pkeyId, status } = pageNode.value
|
|
if (!pkeyId) {
|
|
if (!pkeyId) {
|
|
errorToast('pkeyId为空');
|
|
errorToast('pkeyId为空');
|