Merge branch 'dev_vite' of http://18.167.251.121:10003/aidlab/aida_front into dev_vite

This commit is contained in:
李志鹏
2026-01-07 13:02:19 +08:00
11 changed files with 84 additions and 151 deletions

View File

@@ -18,17 +18,7 @@
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>{{ $t('admin.UserName') }}:</span> <span>{{ $t('admin.UserName') }}:</span>
<a-select <SelectUser v-model:value="ids" multiple />
v-model:value="ids"
mode="multiple"
style="width: 230px"
:field-names="{ label: 'label', value: 'label' }"
:filter-option="filterOption"
:placeholder="$t('admin.selectUserName')"
max-tag-count="responsive"
:options="allUserList"
@keydown.enter="gettrialList"
></a-select>
</div> </div>
</div> </div>
<div class="admin_search"> <div class="admin_search">
@@ -188,8 +178,9 @@ import { Modal, message, Input } from 'ant-design-vue'
import { ExclamationCircleOutlined, MoreOutlined } from '@ant-design/icons-vue' import { ExclamationCircleOutlined, MoreOutlined } from '@ant-design/icons-vue'
import allUserPoerationsVue from './addAllUser.vue' import allUserPoerationsVue from './addAllUser.vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import SelectUser from '@/component/common/SelectUser.vue'
export default defineComponent({ export default defineComponent({
components: { allUserPoerationsVue, MoreOutlined }, components: { allUserPoerationsVue, MoreOutlined, SelectUser },
setup() { setup() {
const store: any = useStore() const store: any = useStore()
const currentOrganizationId = computed( const currentOrganizationId = computed(
@@ -202,9 +193,6 @@ export default defineComponent({
let filter: any = reactive({ let filter: any = reactive({
dataList: [], dataList: [],
tableLoading: false, tableLoading: false,
allUserList: computed(() => {
return store.state.adminPage.allUserList
}),
allCountry: [], allCountry: [],
rowSelection: computed(() => { rowSelection: computed(() => {
return { return {

View File

@@ -46,16 +46,7 @@
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>{{ $t("admin.UserName") }}:</span> <span>{{ $t("admin.UserName") }}:</span>
<a-select <SelectUser v-model="ids" multiple />
v-model:value="ids"
mode="multiple"
style="width: 250px"
:filter-option="filterOption"
:placeholder="$t('admin.selectUserName')"
max-tag-count="responsive"
:options="allUserList"
@keydown.enter="gettrialList"
></a-select>
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>Organization Name:</span> <span>Organization Name:</span>
@@ -100,8 +91,9 @@
import { useStore } from "vuex"; import { useStore } from "vuex";
import { Https } from "@/tool/https"; import { Https } from "@/tool/https";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import SelectUser from "@/component/common/SelectUser.vue";
export default defineComponent({ export default defineComponent({
components: {}, components: { SelectUser },
setup() { setup() {
const store: any = useStore(); const store: any = useStore();
let rangePickerValue: any = ref([]); let rangePickerValue: any = ref([]);
@@ -176,9 +168,6 @@
]; ];
}); });
let allUserList: any = computed(() => {
return store.state.adminPage.allUserList;
});
let ids = ref([]); let ids = ref([]);
let email = ref(""); let email = ref("");
let dataList: any = ref([]); let dataList: any = ref([]);
@@ -193,7 +182,6 @@
rangeTimeValue, rangeTimeValue,
columns, columns,
dataList, dataList,
allUserList,
ids, ids,
email, email,
renameData, renameData,

View File

@@ -85,9 +85,6 @@ export default defineComponent({
const {t} = useI18n() const {t} = useI18n()
const store:any = useStore() const store:any = useStore()
let filter:any = reactive({ let filter:any = reactive({
dataList:computed(()=>{
return store.state.adminPage.allUserList
}),
}) })
let filterData:any = reactive({ let filterData:any = reactive({

View File

@@ -42,16 +42,7 @@
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>User Name:</span> <span>User Name:</span>
<a-select <SelectUser v-model="ids" multiple />
v-model:value="ids"
mode="multiple"
style="width: 250px"
:filter-option="filterOption"
placeholder="Select Item..."
max-tag-count="responsive"
:options="allUserList"
@keydown.enter="gettrialList"
></a-select>
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>Organization Name:</span> <span>Organization Name:</span>
@@ -95,8 +86,11 @@
import { defineComponent, ref, createVNode, computed } from "vue"; import { defineComponent, ref, createVNode, computed } from "vue";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { Https } from "@/tool/https"; import { Https } from "@/tool/https";
import SelectUser from "@/component/common/SelectUser.vue";
export default defineComponent({ export default defineComponent({
components: {}, components: {
SelectUser
},
setup() { setup() {
const store: any = useStore(); const store: any = useStore();
let rangePickerValue: any = ref([]); let rangePickerValue: any = ref([]);
@@ -238,9 +232,6 @@
]; ];
}); });
let allUserList: any = computed(() => {
return store.state.adminPage.allUserList;
});
let ids = ref([]); let ids = ref([]);
let email = ref(""); let email = ref("");
let dataList: any = ref([]); let dataList: any = ref([]);
@@ -255,7 +246,6 @@
rangeTimeValue, rangeTimeValue,
columns, columns,
dataList, dataList,
allUserList,
ids, ids,
email, email,
renameData, renameData,

View File

@@ -139,9 +139,6 @@ export default defineComponent({
let filter: any = reactive({ let filter: any = reactive({
dataList: [], dataList: [],
tableLoading: false, tableLoading: false,
allUserList: computed(()=>{
return store.state.adminPage.allUserList
}),
rowSelection:computed(() => { rowSelection:computed(() => {
return { return {
selectedRowKeys: unref(selectedRowKeys), selectedRowKeys: unref(selectedRowKeys),

View File

@@ -40,27 +40,16 @@
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>Email:</span> <span>Email:</span>
<input <!-- <input
v-model="email" v-model="email"
placeholder="Please enter email" placeholder="Please enter email"
@keydown.enter="gettrialList" @keydown.enter="gettrialList"
type="text" type="text"
style="width: 250px" style="width: 250px"
/> /> -->
</div> <SelectUser v-model="email" labelKey="email" valueKey="email" />
<div class="admin_state_item">
<span>User Name:</span>
<a-select
v-model:value="ids"
mode="multiple"
style="width: 250px"
:filter-option="filterOption"
placeholder="Select Item..."
max-tag-count="responsive"
:options="allUserList"
@keydown.enter="gettrialList"
></a-select>
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>User Type:</span> <span>User Type:</span>
<a-select <a-select
@@ -160,16 +149,14 @@ import { formatTime } from "@/tool/util";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { Https } from "@/tool/https"; import { Https } from "@/tool/https";
import allUserPoerationsVue from "./allUserPoerations.vue"; import allUserPoerationsVue from "./allUserPoerations.vue";
import SelectUser from '@/component/common/SelectUser.vue'
export default defineComponent({ export default defineComponent({
components: {allUserPoerationsVue,}, components: {allUserPoerationsVue,SelectUser},
setup() { setup() {
const store:any = useStore() const store:any = useStore()
let filter: any = reactive({ let filter: any = reactive({
dataList: [], dataList: [],
tableLoading: false, tableLoading: false,
allUserList: computed(()=>{
return store.state.adminPage.allUserList
}),
allCountry:[], allCountry:[],
isAwayOrUnfold:false isAwayOrUnfold:false
}); });

View File

@@ -25,7 +25,7 @@
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>User:</span> <span>User:</span>
<a-select <!-- <a-select
v-model:value="userIdList" v-model:value="userIdList"
mode="multiple" mode="multiple"
style="width: 280px" style="width: 280px"
@@ -33,7 +33,8 @@
placeholder="Select Item..." placeholder="Select Item..."
max-tag-count="responsive" max-tag-count="responsive"
:options="dataList" :options="dataList"
></a-select> ></a-select> -->
<SelectUser v-model="userIdList" multiple />
</div> </div>
</div> </div>
@@ -62,15 +63,14 @@ import { PieChart } from 'echarts/charts';
import { LabelLayout } from 'echarts/features'; import { LabelLayout } from 'echarts/features';
import { useStore } from "vuex"; import { useStore } from "vuex";
import { CanvasRenderer } from 'echarts/renderers'; import { CanvasRenderer } from 'echarts/renderers';
import SelectUser from '@/component/common/SelectUser.vue';
export default defineComponent({ export default defineComponent({
components: { components: {
SelectUser
}, },
setup() { setup() {
const store:any = useStore() const store:any = useStore()
let filter:any = reactive({ let filter:any = reactive({
dataList:computed(()=>{
return store.state.adminPage.allUserList
}),
}) })
let filterData:any = reactive({ let filterData:any = reactive({

View File

@@ -48,16 +48,7 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="Admin Account"> <a-form-item label="Admin Account">
<!-- <a-select <SelectUser v-model="searchForm.adminAccId" labelKey="email" />
v-model:value="searchForm.adminAccId"
allow-clear
show-search
:filter-option="filterOption"
placeholder="Select Account"
style="width: 180px"
:options="allUserList"
></a-select> -->
<SelectUser v-model="testuser" />
</a-form-item> </a-form-item>
<a-form-item label="Status"> <a-form-item label="Status">
<a-select <a-select
@@ -71,12 +62,12 @@
</a-form-item> </a-form-item>
<a-form-item label="Country or Region"> <a-form-item label="Country or Region">
<a-select <a-select
v-model:value="searchForm.country" v-model:value="searchForm.countryOrRegion"
:allowClear="true" :allowClear="true"
show-search show-search
style="width: 250px" style="width: 250px"
:filter-option="filterOption" :filter-option="filterOption"
placeholder="Select Item..." placeholder="Select the country or region"
max-tag-count="responsive" max-tag-count="responsive"
:options="countryList" :options="countryList"
/> />
@@ -127,9 +118,6 @@
{{ record.status }} {{ record.status }}
</a-tag> </a-tag>
</template> </template>
<template v-if="column.key === 'adminAccId'">
{{ allUserList.find(item => item.value === record.adminAccId)?.label }}
</template>
<template v-else-if="column.key === 'actions'"> <template v-else-if="column.key === 'actions'">
<a-space> <a-space>
@@ -239,19 +227,26 @@
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span> <span>
Admin Account: Country Or Region:
<span>*</span> <span>*</span>
</span> </span>
<a-select <a-select
v-model:value="formState.adminAccId" v-model:value="formState.countryOrRegion"
placeholder="Select the admin account" placeholder="Select the country or region"
allow-clear allow-clear
show-search show-search
:filter-option="filterOption" :filter-option="filterOption"
style="width: 250px" style="width: 250px"
:options="allUserList" :options="countryList"
></a-select> ></a-select>
</div> </div>
<div class="admin_state_item">
<span>
Admin Account:
<span>*</span>
</span>
<SelectUser v-model="formState.adminAccId" labelKey="email" />
</div>
<div class="admin_state_item"> <div class="admin_state_item">
<span> <span>
Start Time: Start Time:
@@ -439,6 +434,7 @@ const searchForm = reactive({
adminAccId: undefined as string | undefined, adminAccId: undefined as string | undefined,
status: [] as PlanStatus[] | [], status: [] as PlanStatus[] | [],
id: '', id: '',
countryOrRegion: null,
page: 1, page: 1,
size: 10, size: 10,
total: 0 total: 0
@@ -461,7 +457,8 @@ const formState = reactive({
adminAccId: undefined as string | undefined, adminAccId: undefined as string | undefined,
creditLimit: null as number | null, creditLimit: null as number | null,
accountNum: null as number | null, accountNum: null as number | null,
status: undefined as PlanStatus | undefined status: undefined as PlanStatus | undefined,
countryOrRegion: null as string | null
}) })
const organizationModalVisible = ref(false) const organizationModalVisible = ref(false)
@@ -607,6 +604,7 @@ const resetFormState = () => {
formState.creditLimit = null formState.creditLimit = null
formState.accountNum = null formState.accountNum = null
formState.status = undefined formState.status = undefined
formState.countryOrRegion = null
} }
const changePage = (pagination: any) => { const changePage = (pagination: any) => {
@@ -628,12 +626,10 @@ const handleReset = () => {
searchForm.adminAccId = undefined searchForm.adminAccId = undefined
searchForm.status = [] searchForm.status = []
searchForm.id = '' searchForm.id = ''
searchForm.countryOrRegion = ''
handleSearch() handleSearch()
} }
const allUserList = computed(() => {
return store.state.adminPage.allUserList
})
const openCreate = () => { const openCreate = () => {
modalTitle.value = 'New Subscription Plan' modalTitle.value = 'New Subscription Plan'
isEditMode.value = false isEditMode.value = false
@@ -971,7 +967,7 @@ const filterOption = (input: string, option: any) => {
} }
.subscriptionPlan_modal { .subscriptionPlan_modal {
.form_content{ .form_content {
width: 100%; width: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;

View File

@@ -47,16 +47,7 @@
</div> </div>
<div class="admin_state_item"> <div class="admin_state_item">
<span>User Name:</span> <span>User Name:</span>
<a-select <SelectUser v-model="ids" multiple />
v-model:value="ids"
mode="multiple"
style="width: 250px"
:filter-option="filterOption"
placeholder="Select Item..."
max-tag-count="responsive"
:options="allUserList"
@keydown.enter="gettrialList"
></a-select>
</div> </div>
</div> </div>
<div class="admin_search"> <div class="admin_search">
@@ -96,17 +87,17 @@ import { defineComponent, ref, createVNode, computed, reactive, toRefs, onMounte
import { formatTime } from "@/tool/util"; import { formatTime } from "@/tool/util";
import { useStore } from "vuex"; import { useStore } from "vuex";
import { Https } from "@/tool/https"; import { Https } from "@/tool/https";
import SelectUser from '@/component/common/SelectUser.vue'
export default defineComponent({ export default defineComponent({
components: { components: {
SelectUser
}, },
setup() { setup() {
const store:any = useStore() const store:any = useStore()
let filter:any = reactive({ let filter:any = reactive({
dataList:[], dataList:[],
tableLoading:false, tableLoading:false,
allUserList: computed(()=>{
return store.state.adminPage.allUserList
}),
allCountry:[] allCountry:[]
}) })
let filterData:any = reactive({ let filterData:any = reactive({

View File

@@ -3,9 +3,10 @@
v-model:value="value" v-model:value="value"
:allowClear="true" :allowClear="true"
show-search show-search
:mode="multiple ? 'multiple' : undefined"
style="width: 250px" style="width: 250px"
:filter-option="false" :filter-option="false"
placeholder="Select Item..." placeholder="Select Item"
max-tag-count="responsive" max-tag-count="responsive"
:options="options" :options="options"
:loading="fetching" :loading="fetching"
@@ -19,43 +20,42 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed, ref, reactive } from 'vue' import { computed, ref, reactive } from 'vue'
import { debounce } from 'lodash-es' import { debounce } from 'lodash-es'
import { Https } from '@/tool/https'
import { useStore } from '@/store'
type OptionItem = { [k: string]: any } type OptionItem = { [k: string]: any }
const props = defineProps<{ const props = defineProps<{
modelValue?: any modelValue: any
labelKey?: string
valueKey?: string
multiple?: boolean
}>() }>()
const emit = defineEmits(['update:modelValue', 'change', 'search']) const emit = defineEmits(['update:modelValue', 'change', 'search'])
const pager = reactive<{ page: number; size: number; total: number | null }>({ const pager = reactive<{ page: number; size: number; hasMore: boolean }>({
page: 1, page: 1,
size: 20, size: 30,
total: null hasMore: true
}) })
const fetching = ref(false) const fetching = ref(false)
const keyword = ref('') const keyword = ref('')
const internalList = ref<OptionItem[]>([]) const internalList = ref<OptionItem[]>([])
// page size is stored in pager.size
const value = computed({ const value = computed({
get: () => props.modelValue, get: () => {
const mv = props.modelValue
if (mv === '' || mv === null) return undefined
return mv
},
set: v => emit('update:modelValue', v) set: v => emit('update:modelValue', v)
}) })
const getLabel = (it: OptionItem) => {
return String(it['label'] ?? '')
}
const getValue = (it: OptionItem, idx: number) => {
return it['value'] ?? String(idx)
}
const options = computed(() => { const options = computed(() => {
return internalList.value.map((it, idx) => ({ return internalList.value.map((it, idx) => ({
label: getLabel(it), label: it[props.labelKey] || it.label,
value: getValue(it, idx), value: it[props.valueKey] || it.value,
raw: it raw: it
})) }))
}) })
@@ -69,22 +69,22 @@ const defaultFetch = async ({
pageSize: number pageSize: number
keyword: string keyword: string
}) => { }) => {
const raw = sessionStorage.getItem('allCountry') || '[]' const res =
let list: OptionItem[] = [] (await Https.axiosGet(Https.httpUrls.getAllUserId, {
try { params: { page: p, size: ps, email: kw }
list = JSON.parse(raw) })) || []
if (!Array.isArray(list)) list = [] // store.commit('setAllUserList', rv)
} catch (e) {
list = []
}
// Return the raw list from sessionStorage exactly as-is (no slicing/filtering/delay) // Return the raw list from sessionStorage exactly as-is (no slicing/filtering/delay)
return { data: list, total: list.length } return { data: res.records, hasMore: res.current <= res.pages }
} }
const doFetch = async (reset = false) => { const doFetch = async (reset = false) => {
if (reset) pager.page = 1 if (reset) {
if (pager.total !== null && (pager.page - 1) * pager.size >= (pager.total ?? 0)) return pager.page = 1
pager.hasMore = true
}
if (!pager.hasMore) return
fetching.value = true fetching.value = true
try { try {
const res = await defaultFetch({ const res = await defaultFetch({
@@ -92,8 +92,8 @@ const doFetch = async (reset = false) => {
pageSize: pager.size, pageSize: pager.size,
keyword: keyword.value keyword: keyword.value
}) })
const data = res?.data ?? [] const data = res?.data
pager.total = res?.total ?? null pager.hasMore = res?.hasMore
if (pager.page === 1) internalList.value = data if (pager.page === 1) internalList.value = data
else internalList.value = internalList.value.concat(data) else internalList.value = internalList.value.concat(data)
pager.page += 1 pager.page += 1
@@ -115,8 +115,8 @@ const onSearch = (val: string) => {
const handleScrollUserList = (e: Event) => { const handleScrollUserList = (e: Event) => {
const target = e?.target as HTMLElement | null const target = e?.target as HTMLElement | null
if (!target) return if (!target) return
const nearBottom = target.scrollTop + target.clientHeight >= target.scrollHeight - 40 const nearBottom = target.scrollTop + target.clientHeight >= target.scrollHeight - 30
if (nearBottom && !fetching.value) { if (nearBottom) {
doFetch(false) doFetch(false)
} }
} }
@@ -128,7 +128,6 @@ const handleFocus = () => {
const onChange = (val: any) => { const onChange = (val: any) => {
emit('change', val) emit('change', val)
console.log('change---------', val)
} }
</script> </script>

View File

@@ -184,11 +184,11 @@ export default defineComponent({
} }
syncMenuStatus(router.currentRoute.value.path) syncMenuStatus(router.currentRoute.value.path)
//储存所有用户id和name //储存所有用户id和name
Https.axiosGet(Https.httpUrls.getAllUserId,).then((rv: any) => { // Https.axiosGet(Https.httpUrls.getAllUserId,).then((rv: any) => {
if (rv) { // if (rv) {
store.commit('setAllUserList',rv); // store.commit('setAllUserList',rv);
} // }
}) // })
if(vuex_systemUser == 3){ if(vuex_systemUser == 3){
Https.axiosGet(Https.httpUrls.getCities,).then((rv: any) => { Https.axiosGet(Https.httpUrls.getCities,).then((rv: any) => {
if (rv) { if (rv) {