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 class="admin_state_item">
<span>{{ $t('admin.UserName') }}:</span>
<a-select
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>
<SelectUser v-model:value="ids" multiple />
</div>
</div>
<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 allUserPoerationsVue from './addAllUser.vue'
import { useI18n } from 'vue-i18n'
import SelectUser from '@/component/common/SelectUser.vue'
export default defineComponent({
components: { allUserPoerationsVue, MoreOutlined },
components: { allUserPoerationsVue, MoreOutlined, SelectUser },
setup() {
const store: any = useStore()
const currentOrganizationId = computed(
@@ -202,9 +193,6 @@ export default defineComponent({
let filter: any = reactive({
dataList: [],
tableLoading: false,
allUserList: computed(() => {
return store.state.adminPage.allUserList
}),
allCountry: [],
rowSelection: computed(() => {
return {

View File

@@ -46,16 +46,7 @@
</div>
<div class="admin_state_item">
<span>{{ $t("admin.UserName") }}:</span>
<a-select
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>
<SelectUser v-model="ids" multiple />
</div>
<div class="admin_state_item">
<span>Organization Name:</span>
@@ -100,8 +91,9 @@
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import { useI18n } from "vue-i18n";
import SelectUser from "@/component/common/SelectUser.vue";
export default defineComponent({
components: {},
components: { SelectUser },
setup() {
const store: any = useStore();
let rangePickerValue: any = ref([]);
@@ -176,9 +168,6 @@
];
});
let allUserList: any = computed(() => {
return store.state.adminPage.allUserList;
});
let ids = ref([]);
let email = ref("");
let dataList: any = ref([]);
@@ -193,7 +182,6 @@
rangeTimeValue,
columns,
dataList,
allUserList,
ids,
email,
renameData,

View File

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

View File

@@ -42,16 +42,7 @@
</div>
<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>
<SelectUser v-model="ids" multiple />
</div>
<div class="admin_state_item">
<span>Organization Name:</span>
@@ -95,8 +86,11 @@
import { defineComponent, ref, createVNode, computed } from "vue";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import SelectUser from "@/component/common/SelectUser.vue";
export default defineComponent({
components: {},
components: {
SelectUser
},
setup() {
const store: any = useStore();
let rangePickerValue: any = ref([]);
@@ -238,9 +232,6 @@
];
});
let allUserList: any = computed(() => {
return store.state.adminPage.allUserList;
});
let ids = ref([]);
let email = ref("");
let dataList: any = ref([]);
@@ -255,7 +246,6 @@
rangeTimeValue,
columns,
dataList,
allUserList,
ids,
email,
renameData,

View File

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

View File

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

View File

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

View File

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

View File

@@ -47,16 +47,7 @@
</div>
<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>
<SelectUser v-model="ids" multiple />
</div>
</div>
<div class="admin_search">
@@ -96,17 +87,17 @@ import { defineComponent, ref, createVNode, computed, reactive, toRefs, onMounte
import { formatTime } from "@/tool/util";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import SelectUser from '@/component/common/SelectUser.vue'
export default defineComponent({
components: {
SelectUser
},
setup() {
const store:any = useStore()
let filter:any = reactive({
dataList:[],
tableLoading:false,
allUserList: computed(()=>{
return store.state.adminPage.allUserList
}),
allCountry:[]
})
let filterData:any = reactive({

View File

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

View File

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