Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2024-06-19 18:06:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0fb276ccd15074ee60bb7ee20e1189661d00f879
0fb276cc
1 parent
c2476459
iframe模式下配合后台编辑页面操作
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
8 deletions
src/views/index.vue
src/views/index.vue
View file @
0fb276c
<!--
* @Date: 2022-07-18 10:22:22
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-06-1
7 14:58:40
* @LastEditTime: 2024-06-1
9 18:05:04
* @FilePath: /data-table/src/views/index.vue
* @Description: 首页
-->
...
...
@@ -28,13 +28,13 @@
:is="item.component" :item="item" @active="onActive" @remove="onRemove" />
</van-cell-group>
<!-- 非流程版表单 -->
<div v-if="formData.length && PCommit.visible" style="margin: 16px">
<div v-if="formData.length && PCommit.visible
&& !formSetting.is_flow
" style="margin: 16px">
<van-button round block type="primary" native-type="submit" :disabled="submitStatus">
{{ PCommit.text ? PCommit.text : '提交' }}
</van-button>
</div>
<!-- 流程表单 -->
<div v-if="formSetting.is_flow" style="margin: 16px;
border-top: 1px dashed #eee;
padding-top: 1rem;">
<div v-if="formSetting.is_flow" style="margin: 16px; padding-top: 1rem;">
<p style="margin-bottom: 1rem; font-size: 0.85rem; font-weight: bold;">审批意见</p>
<div style="margin-bottom: 1rem; border: 1px solid #eee;">
<van-field
...
...
@@ -107,7 +107,7 @@
</van-overlay>
<van-action-sheet
v-model:show="approval_show"
:actions="actions"
:actions="a
pproval_a
ctions"
@select="onApprovalSelect"
cancel-text="取消"
close-on-click-action
...
...
@@ -228,6 +228,7 @@ const onSubmitPwd = async () => {
}
}
// 弹出流程审核操作
const approval_show = ref(false);
const approval_note = ref('');
// 审批组件点击
...
...
@@ -235,11 +236,11 @@ const onClickFloatingBubble = () => {
approval_show.value = true;
}
const myForm = ref(null);
const actions = [
const a
pproval_a
ctions = [
{ name: '提交', id: 'commit', },
{ name: '撤回', id: 'withdraw', disabled: true },
{ name: '驳回', id: 'reject', },
{ name: '结束流程',
key
: 'terminate', },
{ name: '结束流程',
id
: 'terminate', },
];
const onApprovalSelect = (item) => {
switch (item.id) {
...
...
@@ -282,9 +283,13 @@ onMounted(async () => {
// 提交按钮
page_commit = element;
} else {
// TODO:过滤掉自定义流程中的字段-需要新API接口
// console.warn(element);
page_form.push(element);
}
});
// TODO: 判断是否流程表单-需要新API接口
formSetting.value.is_flow = false;
/** 页眉属性
* @param label 表单标题
* @param banner_type 页眉类型:["文字", "单张图", "轮播图"] text=文字,image=单张图,carousel=轮播图
...
...
@@ -563,8 +568,6 @@ onMounted(async () => {
submitStatus.value = true;
}
}
// TODO: 判断是否流程表单
formSetting.value.is_flow = false;
});
// 打开轮询用户是否关注
...
...
@@ -849,6 +852,12 @@ const onSubmit = async (values) => {
showSuccessToast("提交成功");
// 缓存表单返回值
store.changeSuccessInfo(result.data);
//在 iframe 中调用父页面中定义的变量
let getChildVal = parent.parent.getChildVal;
if (getChildVal) {
getChildVal();
return false;
}
// 如果类型为跳转网页
if (result.data.commit_action === 'url') {
window.location.href = result.data.commit_url;
...
...
@@ -878,6 +887,12 @@ const onSubmit = async (values) => {
showSuccessToast("提交成功");
// 缓存表单返回值
store.changeSuccessInfo(result.data);
//在 iframe 中调用父页面中定义的变量
let getChildVal = parent.parent.getChildVal;
if (getChildVal) {
getChildVal();
return false;
}
// 如果类型为跳转网页
if (result.data.commit_action === 'url') {
window.location.href = result.data.commit_url;
...
...
Please
register
or
login
to post a comment