xy 10 months ago
parent 2af617bc67
commit fd922c0721

@ -16,7 +16,6 @@ router.beforeEach(async(to, from, next) => {
// set page title // set page title
document.title = getPageTitle(to.meta.title) document.title = getPageTitle(to.meta.title)
console.log('oa-token', window.decodeURIComponent(to.query.auth_token))
if(to.query.auth_token) { if(to.query.auth_token) {
setToken(window.decodeURIComponent(to.query.auth_token)) setToken(window.decodeURIComponent(to.query.auth_token))
} }

@ -1,12 +1,13 @@
import { CreateElement, VNode } from "vue"; import { CreateElement, VNode } from "vue";
import moment from "moment"; import moment from "moment";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { deepCopy, formatFileSize, formatTime } from "@/utils/index"; import { deepCopy, formatFileSize, formatTime, debounce } from "@/utils/index";
import { uploadSize } from "@/settings"; import { uploadSize } from "@/settings";
import axios from "axios"; import axios from "axios";
import { flowList } from "@/api/flow"; import { flowList } from "@/api/flow";
import MobilePicker from '@/components/MobilePicker/index.vue'; import MobilePicker from '@/components/MobilePicker/index.vue';
import MobileMultipleSelect from "@/components/MobileMultipleSelect/index.vue"; import MobileMultipleSelect from "@/components/MobileMultipleSelect/index.vue";
import { Message } from 'element-ui'
/** /**
* @param {String} device 'desktop' | 'mobile' * @param {String} device 'desktop' | 'mobile'
* @param {Object} info field参数 * @param {Object} info field参数
@ -448,11 +449,17 @@ export default function formBuilder(
.map((i) => Number(i)) .map((i) => Number(i))
: [], : [],
clearable: true, clearable: true,
placeholder: info.help_text, placeholder: info.help_text || '输入标题或编号搜索流程..',
multiple: true, multiple: true,
filterable: true, filterable: true,
"reserve-keyword": true, "reserve-keyword": true,
loading: this.flowSelectLoading, "filter-method": debounce((query) => {
this.tempFlowList = this.flows[info.name].filter(flow => new RegExp(query, 'i').test(flow.title + flow.no))
console.log(query)
if (this.tempFlowList.length === 0) {
Message.warning("未搜索到匹配流程")
}
}, 500).bind(this)
}, },
attrs: { attrs: {
placeholder: info.help_text, placeholder: info.help_text,
@ -463,16 +470,29 @@ export default function formBuilder(
on: { on: {
input: (e) => { input: (e) => {
this.$set(target, info.name, e.toString()); this.$set(target, info.name, e.toString());
this.tempFlowList.length = 0;
}, },
}, },
}, },
this.flows[info.name]?.map((option) => (this.tempFlowList.length > 0 ? this.tempFlowList : this.flows[info.name])?.map((option) =>
h("el-option", { h("el-option", {
props: { props: {
label: option.title, label: option.title,
value: option.id, value: option.id,
}, },
}) }, [
h("div", {
}, [
h("span", {},option.title),
h("span", {
style: {
color: '#999',
float: 'right',
'font-size': '12px'
}
},option.no)
])
])
) )
); );
break; break;

@ -189,7 +189,7 @@ export function debounce(fn, delay = 500) {
return function _debounce() { return function _debounce() {
if (timer) clearTimeout(timer) if (timer) clearTimeout(timer)
timer = setTimeout(() => { timer = setTimeout(() => {
fn() fn.apply(this, arguments)
}, delay) }, delay)
} }
} }

@ -143,6 +143,7 @@ export default {
}, },
], ],
flows: {}, flows: {},
tempFlowList: []
}; };
}, },
methods: { methods: {

Loading…
Cancel
Save