diff --git a/src/utils/formBuilder.js b/src/utils/formBuilder.js
index 468bfd7..f5db7c0 100644
--- a/src/utils/formBuilder.js
+++ b/src/utils/formBuilder.js
@@ -8,6 +8,16 @@ import { flowList } from "@/api/flow";
import MobilePicker from '@/components/MobilePicker/index.vue';
import MobileMultipleSelect from "@/components/MobileMultipleSelect/index.vue";
import { Message } from 'element-ui'
+function isJSON(str) {
+ if (typeof str !== 'string') return false;
+ try {
+ const result = JSON.parse(str);
+ const type = Object.prototype.toString.call(result);
+ return type === '[object Object]' || type === '[object Array]';
+ } catch (e) {
+ return false;
+ }
+}
/**
* @param {String} device 'desktop' | 'mobile'
* @param {Object} info field参数
@@ -428,12 +438,17 @@ export default function formBuilder(
break;
case "relation-flow":
if (!this.flows[info.name]) {
+ let extraParam = {}
+ if (isJSON(info.stub)) {
+ extraParam = JSON.parse(info.stub)
+ }
flowList("all", {
page: 1,
page_size: 9999,
is_simple: 1,
- custom_model_id: info.stub,
+ custom_model_id: isJSON(info.stub) ? '' : info.stub,
is_auth: 1,
+ ...extraParam
}).then((res) => {
this.$set(this.flows, info.name, res.data.data);
});
@@ -441,6 +456,7 @@ export default function formBuilder(
formItem = h(
"el-select",
{
+ ref: `relation-flow-${info.name}`,
props: {
value: target[info.name]
? target[info.name]
@@ -484,13 +500,42 @@ export default function formBuilder(
h("div", {
}, [
h("span", {},option.title),
- h("span", {
+ h("el-button", {
style: {
- color: '#999',
- float: 'right',
- 'font-size': '12px'
+ float: 'right'
+ },
+ props: {
+ type: 'primary',
+ size: 'mini',
+ icon: 'el-icon-search'
+ },
+ on: {
+ click: e => {
+ e.stopPropagation()
+ let target = this.$router.resolve({
+ path: "/flow/detail",
+ query: {
+ module_id: option.custom_model_id,
+ flow_id: option.id,
+ isSinglePage: 1,
+ },
+ });
+ this.modalRender = (h) =>
+ h("iframe", {
+ attrs: {
+ src: target.href,
+ },
+ style: {
+ border: "none",
+ width: "100%",
+ height: "100%",
+ },
+ });
+ this.isShowModal = true;
+ this.$refs[`relation-flow-${info.name}`]?.blur()
+ }
}
- },option.no)
+ }, '查看')
])
])
)
@@ -728,12 +773,17 @@ export default function formBuilder(
break;
case "relation-flow":
if (!this.flows[info.name]) {
+ let extraParam = {}
+ if (isJSON(info.stub)) {
+ extraParam = JSON.parse(info.stub)
+ }
flowList("all", {
page: 1,
page_size: 9999,
is_simple: 1,
- custom_model_id: info.stub,
+ custom_model_id: isJSON(info.stub) ? '' : info.stub,
is_auth: 1,
+ ...extraParam
}).then((res) => {
this.$set(this.flows, info.name, res.data.data);
});
@@ -1356,12 +1406,17 @@ export default function formBuilder(
break;
case "relation-flow":
if (!this.flows[info.name]) {
+ let extraParam = {}
+ if (isJSON(info.stub)) {
+ extraParam = JSON.parse(info.stub)
+ }
flowList("all", {
page: 1,
page_size: 9999,
is_simple: 1,
- custom_model_id: info.stub,
+ custom_model_id: isJSON(info.stub) ? '' : info.stub,
is_auth: 1,
+ ...extraParam
}).then((res) => {
this.$set(this.flows, info.name, res.data.data);
});
@@ -1670,12 +1725,17 @@ export default function formBuilder(
break;
case "relation-flow":
if (!this.flows[info.name]) {
+ let extraParam = {}
+ if (isJSON(info.stub)) {
+ extraParam = JSON.parse(info.stub)
+ }
flowList("all", {
page: 1,
page_size: 9999,
is_simple: 1,
- custom_model_id: info.stub,
+ custom_model_id: isJSON(info.stub) ? '' : info.stub,
is_auth: 1,
+ ...extraParam
}).then((res) => {
this.$set(this.flows, info.name, res.data.data);
});
diff --git a/src/views/attendance/SignHandle.vue b/src/views/attendance/SignHandle.vue
index a03dc3c..eb179cc 100644
--- a/src/views/attendance/SignHandle.vue
+++ b/src/views/attendance/SignHandle.vue
@@ -15,6 +15,30 @@