diff --git a/src/api/wallet/wallet-manage.ts b/src/api/wallet/wallet-manage.ts index b5ba012..04a8324 100644 --- a/src/api/wallet/wallet-manage.ts +++ b/src/api/wallet/wallet-manage.ts @@ -47,6 +47,13 @@ export function getObj(id?: string) { }) } +export function getObjDetails(id?: string) { + return request({ + url: "/wallet/wallet-manage/join/" + id, + method: "get", + }) +} + export function delObjs(ids?: Object) { return request({ url: "/wallet/wallet-manage", diff --git a/src/api/wallet/wallet-rule-join.ts b/src/api/wallet/wallet-rule-join.ts index 0be6acf..84c28bf 100644 --- a/src/api/wallet/wallet-rule-join.ts +++ b/src/api/wallet/wallet-rule-join.ts @@ -31,6 +31,14 @@ export function getObj(id?: string) { }) } +export function userConfig(query?: Object) { + return request({ + url: "/wallet/wallet-rule-join/user-config", + method: "get", + params: query, + }) +} + export function getJoinDetail(id?: string) { return request({ url: "/wallet/wallet-rule-join/join-detail/" + id, diff --git a/src/components/Select/SelectMch.vue b/src/components/Select/SelectMch.vue index bed8d9a..ef5f724 100644 --- a/src/components/Select/SelectMch.vue +++ b/src/components/Select/SelectMch.vue @@ -35,11 +35,13 @@ const props = withDefaults( defineProps<{ placeholder?: string apiParams?: any + autoFirst?: boolean disabled?: boolean }>(), { placeholder: "请选择", apiParams: {}, + autoFirst: false, disabled: false, }, ) @@ -75,6 +77,9 @@ async function getOptions() { } const { data } = await mchApi.select(_pa) state.options = data.records ?? [] + if (props.autoFirst && state.options.length != 0) { + state.selectId = state.options[0].id + } } finally { setTimeout(() => (state.loading = false), 500) } @@ -91,4 +96,8 @@ function clear() { state.selectId = null getOptions() } + +onMounted(() => { + props.autoFirst && getOptions() +}) diff --git a/src/components/Select/SelectWalletType.vue b/src/components/Select/SelectWalletType.vue index 7aefdba..5aaa64f 100644 --- a/src/components/Select/SelectWalletType.vue +++ b/src/components/Select/SelectWalletType.vue @@ -3,7 +3,7 @@ style="width: 100%" v-model="state.selectId" :placeholder="props.placeholder" - clearable + :clearable="props.clearable" remote-show-suffix filterable remote @@ -11,6 +11,7 @@ :remote-method="remoteSearch" :loading="state.loading" @visible-change="(e: boolean) => e && getOptions()" + @change="change" >
@@ -30,16 +31,24 @@ import { reactive } from "vue" import { useDict } from "/@/hooks/dict" import { getWalletTypeSimple } from "/@/api/wallet/wallet-type" +const emit = defineEmits(["change"]) + const selectId = defineModel() const props = withDefaults( defineProps<{ placeholder?: string disabled?: boolean + clearable?: boolean + autoFirst?: boolean + apiParams?: any }>(), { placeholder: "请选择", disabled: false, + clearable: true, + autoFirst: false, + apiParams: {}, }, ) @@ -59,6 +68,8 @@ const state = reactive({ watch( selectId, (newVal, oldValue) => { + console.log(newVal, "newVal") + if (newVal == oldValue) return state.selectId = newVal getOptions() @@ -71,10 +82,14 @@ async function getOptions() { state.loading = true const _pa = { ...queryForm, + ...props.apiParams, } const { data } = await getWalletTypeSimple(_pa) state.options = data.records ?? [] - + if (props.autoFirst && state.options.length != 0) { + state.selectId = state.options[0].id + emit("change", state.selectId) + } const { wallet_type } = useDict("wallet_type") state.walletType = wallet_type } finally { @@ -93,4 +108,12 @@ function clear() { state.selectId = null getOptions() } + +function change() { + emit("change", selectId) +} + +onMounted(() => { + props.autoFirst && getOptions() +}) diff --git a/src/components/TreeMultipleSelect/index.vue b/src/components/TreeMultipleSelect/index.vue new file mode 100644 index 0000000..c55fe7c --- /dev/null +++ b/src/components/TreeMultipleSelect/index.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/src/components/TreeSelect/index.vue b/src/components/TreeSelect/index.vue index f48c1e5..263b337 100644 --- a/src/components/TreeSelect/index.vue +++ b/src/components/TreeSelect/index.vue @@ -1,181 +1,181 @@ - - - - - + + + + + diff --git a/src/components/index.ts b/src/components/index.ts index bc6a59f..07d5514 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -25,6 +25,7 @@ import SelectHardGroup from "/@/components/Select/selectHardGroup.vue" import SelectHandlerUser from "/@/components/Select/SelectHandlerUser.vue" import SelectSupplier from "/@/components/Select/SelectSupplier.vue" import SelectMchRule from "/@/components/Select/SelectMchRule.vue" +import TreeMultipleSelect from "/@/components/TreeMultipleSelect/index.vue" // 第三方组件 import ElementPlus from "element-plus" @@ -61,6 +62,7 @@ export default { app.component("SvgIcon", SvgIcon) app.component("PreviewImage", PreviewImage) app.component("DraggableDepTree", DraggableDepTree) + app.component("TreeMultipleSelect", TreeMultipleSelect) app.component("SelectUser", SelectUser) app.component("SelectWalletType", SelectWalletType) diff --git a/src/views/mch/mch-manage/mch-rule-config-form.vue b/src/views/mch/mch-manage/mch-rule-config-form.vue index 46b80ad..576094d 100644 --- a/src/views/mch/mch-manage/mch-rule-config-form.vue +++ b/src/views/mch/mch-manage/mch-rule-config-form.vue @@ -14,7 +14,7 @@ - + diff --git a/src/views/mch/mch-manage/setting.vue b/src/views/mch/mch-manage/setting.vue index ec1b856..a17b223 100644 --- a/src/views/mch/mch-manage/setting.vue +++ b/src/views/mch/mch-manage/setting.vue @@ -1,5 +1,5 @@ + + diff --git a/src/views/wallet/wallet-type/components/wallet-rule-form-dialog.vue b/src/views/wallet/wallet-type/components/wallet-rule-form-dialog.vue index f2617f3..73ef879 100644 --- a/src/views/wallet/wallet-type/components/wallet-rule-form-dialog.vue +++ b/src/views/wallet/wallet-type/components/wallet-rule-form-dialog.vue @@ -9,7 +9,16 @@ - + + + + + + @@ -17,11 +26,6 @@ - - - - -