From e9641ae29c711eed06912f7a6037ab2b6f619e02 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Wed, 28 May 2025 11:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=89=80=E6=9C=89=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/formBuilder.js | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/utils/formBuilder.js b/src/utils/formBuilder.js index f4324f1..82774db 100644 --- a/src/utils/formBuilder.js +++ b/src/utils/formBuilder.js @@ -18,6 +18,7 @@ function isJSON(str) { return false; } } + /** * @param {String} device 'desktop' | 'mobile' * @param {Object} info field参数 @@ -454,6 +455,7 @@ export default function formBuilder( this.$set(this.flows, info.name, res.data.data); }); } + let loading = false formItem = h("div", { style: { // display: "flex", @@ -461,6 +463,39 @@ export default function formBuilder( // alignItems: "flex-start" } }, [ + h('el-button',{ + style: { + 'margin-bottom':'10px' + }, + props: { + type: 'primary', + size: 'mini', + loading:loading + }, + on: { + click: (e) => { + e.stopPropagation() + loading = true + console.log("123",this.flows[info.name],loading) + let extraParam = {} + if (isJSON(info.stub)) { + extraParam = JSON.parse(info.stub) + } + flowList("all", { + page: 1, + page_size: 9999, + is_simple: 1, + custom_model_id: isJSON(info.stub) ? '' : info.stub, + // is_auth: 1, + ...extraParam + }).then((res) => { + this.$set(this.flows, info.name, res.data.data); + loading = false + console.log("123",loading) + }); + } + } + }, '加载所有相关流程'), // 原有的 el-select h("el-select", { ref: `relation-flow-${info.name}`, @@ -472,7 +507,8 @@ export default function formBuilder( filterable: true, "reserve-keyword": true, "filter-method": debounce((query) => { - this.tempFlowList = this.handleFlowFilter(query, this.flows[info.name]); + // this.tempFlowList = this.handleFlowFilter(query, this.flows[info.name]); + this.tempFlowList = this.flows[info.name].filter(item=>item.title.includes(query)) }, 500) }, style: {