feat:商户权限
This commit is contained in:
1 parent
6fefe9d69c
commit
5f757796c8
5 files changed
+113
-96
No files matched your search
@@ -1,58 +1,58 @@
|
||||
import request from '/@/utils/request';
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export function pageJoinSelect(query?: Object) {
|
||||
export function select(query?: Object) {
|
||||
return request({
|
||||
url: '/wallet/mch-manage/page-join-select',
|
||||
method: 'get',
|
||||
url: "/wallet/mch-manage/select",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: '/wallet/mch-manage/page-join',
|
||||
method: 'get',
|
||||
url: "/wallet/mch-manage/page-join",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: '/wallet/mch-manage/page',
|
||||
method: 'get',
|
||||
url: "/wallet/mch-manage/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/wallet/mch-manage',
|
||||
method: 'post',
|
||||
url: "/wallet/mch-manage",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: '/wallet/mch-manage/' + id,
|
||||
method: 'get',
|
||||
});
|
||||
url: "/wallet/mch-manage/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: '/wallet/mch-manage',
|
||||
method: 'delete',
|
||||
url: "/wallet/mch-manage",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/wallet/mch-manage',
|
||||
method: 'put',
|
||||
url: "/wallet/mch-manage",
|
||||
method: "put",
|
||||
data: obj,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,10 +61,10 @@ export function putObj(obj?: Object) {
|
||||
*/
|
||||
export function selectMerchantList(type?: string) {
|
||||
return request({
|
||||
url: '/wallet/mch-manage/selectMerchantList',
|
||||
method: 'get',
|
||||
url: "/wallet/mch-manage/selectMerchantList",
|
||||
method: "get",
|
||||
params: {
|
||||
type: type,
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
@@ -1,7 +1,16 @@
|
||||
<template>
|
||||
<el-select style="width: 100%" v-model="state.selectId" :placeholder="props.placeholder" clearable
|
||||
remote-show-suffix filterable remote :remote-method="remoteSearch" :loading="state.loading"
|
||||
@visible-change="(e: boolean) => e && getOptions()">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="state.selectId"
|
||||
:placeholder="props.placeholder"
|
||||
clearable
|
||||
remote-show-suffix
|
||||
filterable
|
||||
remote
|
||||
:remote-method="remoteSearch"
|
||||
:loading="state.loading"
|
||||
@visible-change="(e: boolean) => e && getOptions()"
|
||||
>
|
||||
<el-option v-for="v in state.options" :key="v.id" :label="`${v.name}`" :value="v.id">
|
||||
<div class="flex items-center">
|
||||
<div class="color-primary">{{ v.name }}</div>
|
||||
@@ -16,62 +25,62 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="select-merchant">
|
||||
import { reactive, computed, defineModel, withDefaults, defineProps } from 'vue';
|
||||
import * as mchApi from '/@/api/wallet/mch-manage';
|
||||
import { reactive, defineModel, withDefaults, defineProps } from "vue"
|
||||
import * as mchApi from "/@/api/wallet/mch-manage"
|
||||
|
||||
const selectId = defineModel();
|
||||
const selectId = defineModel()
|
||||
|
||||
export type Props = {
|
||||
placeholder?: string;
|
||||
};
|
||||
placeholder?: string
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
placeholder: '请选择',
|
||||
});
|
||||
placeholder: "请选择",
|
||||
})
|
||||
|
||||
const queryForm = reactive<any>({
|
||||
name: '',
|
||||
name: null,
|
||||
current: 1,
|
||||
size: 10,
|
||||
});
|
||||
})
|
||||
|
||||
const state = reactive<any>({
|
||||
loading: true,
|
||||
selectId: selectId,
|
||||
options: [],
|
||||
});
|
||||
})
|
||||
|
||||
watch(
|
||||
selectId,
|
||||
(newVal, oldValue) => {
|
||||
if (newVal == oldValue) return;
|
||||
state.selectId = newVal;
|
||||
getOptions();
|
||||
if (newVal == oldValue) return
|
||||
state.selectId = newVal
|
||||
getOptions()
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
async function getOptions() {
|
||||
try {
|
||||
state.loading = true;
|
||||
state.loading = true
|
||||
const _pa = {
|
||||
...queryForm,
|
||||
};
|
||||
const { data } = await mchApi.pageJoinSelect(_pa);
|
||||
state.options = data.records ?? [];
|
||||
}
|
||||
const { data } = await mchApi.select(_pa)
|
||||
state.options = data.records ?? []
|
||||
} finally {
|
||||
setTimeout(() => (state.loading = false), 500);
|
||||
setTimeout(() => (state.loading = false), 500)
|
||||
}
|
||||
}
|
||||
|
||||
function remoteSearch(params: string) {
|
||||
if (params != queryForm.name) {
|
||||
queryForm.name = params;
|
||||
getOptions();
|
||||
queryForm.name = params
|
||||
getOptions()
|
||||
}
|
||||
}
|
||||
|
||||
function clear() {
|
||||
state.selectId = null;
|
||||
getOptions();
|
||||
state.selectId = null
|
||||
getOptions()
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user