更新小功能

master
飘泊客 6 months ago
parent 4f8b6729cc
commit e967d65d64

@ -74,7 +74,6 @@
"watch": true, "watch": true,
"watchEffect": true, "watchEffect": true,
"watchPostEffect": true, "watchPostEffect": true,
"watchSyncEffect": true, "watchSyncEffect": true
"toValue": true
} }
} }

@ -389,7 +389,7 @@ const ProTable = defineComponent({
// eslint-disable-next-line no-underscore-dangle // eslint-disable-next-line no-underscore-dangle
delete (actionParams as any)._timestamp delete (actionParams as any)._timestamp
const response = await props.request?.(actionParams, proSort.value!, proFilter.value!) const response = await props.request?.(actionParams, proSort.value!, proFilter.value!)
console.log('请求数据:', response) // console.log('请求数据:', response)
return response as RequestData<unknown> return response as RequestData<unknown>
} }
} }

@ -193,7 +193,7 @@ const useFetchData = <T extends RequestData<any>>(
watch( watch(
() => pageInfo.value, () => pageInfo.value,
(currentPageInfo, prePageInfo) => { (currentPageInfo, prePageInfo) => {
console.log('页码改变了') // console.log('页码改变了')
const { current, pageSize } = pageInfo.value || {} const { current, pageSize } = pageInfo.value || {}
const { current: prePage, pageSize: prePageSize } = prePageInfo || {} const { current: prePage, pageSize: prePageSize } = prePageInfo || {}
// 如果上次的页码为空或者两次页码等于是没必要查询的 // 如果上次的页码为空或者两次页码等于是没必要查询的

@ -44,10 +44,7 @@ export function updateI18nData(data: I18nData) {
export function exportI18nDataExcel(params: I18nDataQO) { export function exportI18nDataExcel(params: I18nDataQO) {
return httpClient.get('/i18n/i18n-data/export', { params, responseType: 'blob' }) return httpClient.get('/i18n/i18n-data/export', { params, responseType: 'blob' })
} }
/**
*
* @param data
*/
export function checkHeaderInformation(data: I18nImportData) { export function checkHeaderInformation(data: I18nImportData) {
const { file } = data const { file } = data
const formData = new FormData() const formData = new FormData()

@ -1,5 +1,4 @@
import type { ApiResult } from '@/api/types' import type { ApiResult } from '@/api/types'
export const isSuccess = (result: ApiResult) => { export const isSuccess = (result: ApiResult) => {
return result.code === 200 return result.code === 200
} }

@ -0,0 +1,52 @@
import httpClient from '@/utils/axios'
import type { ApiResult } from '@/api/types'
import type { AddConfig, settingPageParam, comparisonPageParam, fileUpload } from './types'
// 新增对外链接
export function createStore(data: AddConfig) {
return httpClient.post<ApiResult<void>>('/push/clue/config/add', data)
}
// 修改对外链接
export function updateStore(data: AddConfig) {
return httpClient.post<ApiResult<void>>('/push/clue/config/update', data)
}
// 对外链接查询
export function getConfig() {
return httpClient.get<ApiResult>('/push/clue/config/query')
}
//
export function pageQueryPage(pageParams: settingPageParam) {
return httpClient.get<ApiResult>('/push/clue/page', {
params: pageParams
})
}
// 资源对比-人员列表
export function getFindAll(roleId: number) {
return httpClient.get('/system/user/findAll/' + roleId)
}
// 资源比对-列表
export function pageQueryPageFile(pageParams: comparisonPageParam) {
return httpClient.get<ApiResult>('/api/file/contrast/page', {
params: pageParams
})
}
// 资源比对-文件列表
export function pageRecordPage() {
return httpClient.get<ApiResult>('/api/file/contrast/record/page')
}
// 资源对比-创建任务
export function createTask(data: any) {
return httpClient.post('/api/file/contrast/create', data)
}
// 资源对比-追加资源
export function fileContrastAddition(data: any) {
return httpClient.post('/api/file/contrast/addition', data)
}
// 资源比对-资源比对
export function fileContrastBuild(data: any) {
return httpClient.post('/api/file/contrast/build', data)
}

@ -0,0 +1,39 @@
import type { PageParam } from '@/api/types'
import type { UploadFile } from 'ant-design-vue/lib/upload/interface'
export interface AddConfig {
userId: number | undefined
status?: number
pushUrl?: string
}
export type settingParam = {
requestId?: string | undefined
startTime?: string | undefined
endTime?: string | undefined
reservationDate?: string
}
export type settingData = {
id?: number
userId: number | undefined
clueId?: number
requestId?: string
pushInfo?: string
pushStatus?: number
status: number
pushUrl?: string
sendNum?: number
}
export type fileUpload = {
files: UploadFile
userIds: number[]
taskName: string
}
export type comparisonParam = {
taskName?: string
startTime?: string | undefined
endTime?: string | undefined
}
export type comparisonPageParam = comparisonParam & PageParam
export type settingPageParam = settingParam & PageParam

@ -5,7 +5,7 @@
.ballcat-multi-tabs { .ballcat-multi-tabs {
background: @component-background; background: @component-background;
box-shadow: 0 3px 4px -2px rgba(0, 21, 41, 0.08); box-shadow: 0 3px 4px -2px rgba(0, 21, 41, 0.08);
z-index: 20; // 比 global header 大就行 z-index: 18!important; // 比 global header 大就行
transition: all 0.2s; transition: all 0.2s;
.ant-tabs { .ant-tabs {

@ -9,9 +9,14 @@
@mousedown="handleDocumentClick" @mousedown="handleDocumentClick"
> >
<a-dropdown :visible="visible" @click="dropdownClick"> <a-dropdown :visible="visible" @click="dropdownClick">
<a-tooltip placement="bottom">
<template #title>
<span>消息</span>
</template>
<a class="ant-dropdown-link" @click.prevent> <a class="ant-dropdown-link" @click.prevent>
<i class="iconfont icon-xiaoxi1" style="font-size: 20px" /> <i class="iconfont icon-xiaoxi1" style="font-size: 20px" />
</a> </a>
</a-tooltip>
<template #overlay> <template #overlay>
<a-menu> <a-menu>
<a-menu-item> <a-menu-item>
@ -25,6 +30,14 @@
</a-menu> </a-menu>
</template> </template>
</a-dropdown> </a-dropdown>
<!-- <a-tooltip placement="bottom">
<template #title>
<span>设置</span>
</template>
<a class="ant-dropdown-link ml-10" @click.prevent="openSettings">
<setting-outlined style="font-size: 20px" />
</a>
</a-tooltip> -->
</div> </div>
<header-dropdown overlay-class-name="avatar-dropdown"> <header-dropdown overlay-class-name="avatar-dropdown">
@ -74,16 +87,18 @@ import HeaderDropdown from '@/layouts/components/HeaderDropdown'
import type { MenuInfo } from 'ant-design-vue/es/menu/src/interface' import type { MenuInfo } from 'ant-design-vue/es/menu/src/interface'
import { Modal } from 'ant-design-vue' import { Modal } from 'ant-design-vue'
import { logout } from '@/api/auth' import { logout } from '@/api/auth'
// import { useUserStore } from '@/stores/user-store'
import { loginPath } from '@/config' import { loginPath } from '@/config'
// import { fileAbsoluteUrl } from '@/utils/file-utils' // import { fileAbsoluteUrl } from '@/utils/file-utils'
import { useMultiTabStore } from '@/stores/multitab-store' import { useMultiTabStore } from '@/stores/multitab-store'
import Avatar from '@/assets/images/avatar.png' import Avatar from '@/assets/images/avatar.png'
import Message from '@/components/Message/index.vue' import Message from '@/components/Message/index.vue'
import { ref, watch, onMounted, onUnmounted } from 'vue' import { message } from 'ant-design-vue'
import { ref, onMounted, onUnmounted } from 'vue'
import { doRequest } from '@/utils/axios/request' import { doRequest } from '@/utils/axios/request'
import { messageAccessLogs } from '@/api/customermanagement/customerList' import { messageAccessLogs } from '@/api/customermanagement/customerList'
import useAdminWebSocket from '@/hooks/websocket' import useAdminWebSocket from '@/hooks/websocket'
import { SettingOutlined } from '@ant-design/icons-vue'
// //
import { useUserStore } from '@/stores/user-store' import { useUserStore } from '@/stores/user-store'
const { userInfo } = useUserStore() const { userInfo } = useUserStore()
@ -109,6 +124,7 @@ onMounted(() => {
const visible = ref(false) const visible = ref(false)
const container = ref(null) const container = ref(null)
// 线 // 线
interface DataItem { interface DataItem {
id: number | undefined id: number | undefined
@ -120,7 +136,6 @@ interface DataItem {
title: string title: string
show: boolean show: boolean
} }
const newclueList = ref<DataItem[]>([]) const newclueList = ref<DataItem[]>([])
const multiTabStore = useMultiTabStore() const multiTabStore = useMultiTabStore()
@ -198,6 +213,7 @@ const getMessageList = () => {
} }
) )
} }
const dropdownClick = async () => { const dropdownClick = async () => {
if (!visible.value) { if (!visible.value) {
await getMessageList() await getMessageList()
@ -238,3 +254,14 @@ export default {
<style lang="less" module> <style lang="less" module>
@import './index.less'; @import './index.less';
</style> </style>
<style lang="less" scoped>
// .modal {
// ::v-deep .ant-modal-body {
// padding: 0px 24px 8px !important;
// }
// .bottom-group ::v-deep .ant-form-item-control-input-content {
// display: flex;
// justify-content: flex-end;
// }
// }
</style>

@ -4,6 +4,9 @@
.ml-5 { .ml-5 {
margin-left: 5px; margin-left: 5px;
} }
.ml-10 {
margin-left: 10px
}
.u-flex { .u-flex {
display: flex; display: flex;
align-items: center; align-items: center;

@ -4,7 +4,7 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="订单编号"> <a-form-item label="订单编号">
<a-input v-model:value="formModel.batchNo" placeholder="请输入" /> <a-input v-model:value="formModel.batchNo" allow-clear placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">

@ -267,29 +267,7 @@ const column = [
} }
} }
] ]
const dataSource: Ref<DataItem[]> = ref([ const dataSource: Ref<DataItem[]> = ref([])
// {
// key: '0',
// name: 'A',
// totalNum: 35000,
// address: 35,
// operation: '-10%'
// },
// {
// key: '1',
// name: 'B',
// age: 25000,
// address: 25,
// operation: '-10%'
// },
// {
// key: '1',
// name: 'C',
// age: 20000,
// address: 20,
// operation: '+10%'
// }
])
// //
// //

@ -107,7 +107,7 @@ const emits = defineEmits<{
const { title, visible, openModal, closeModal } = useModal('推送配置') const { title, visible, openModal, closeModal } = useModal('推送配置')
const { formAction, isCreateForm, isUpdateForm } = useFormAction() const { formAction } = useFormAction()
const formRef = ref() const formRef = ref()

@ -4,7 +4,7 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="渠道名"> <a-form-item label="渠道名">
<a-input v-model:value="formModel.oldFileName" placeholder="请输入" /> <a-input v-model:value="formModel.oldFileName" allow-clear placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">

@ -4,7 +4,7 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="渠道名称"> <a-form-item label="渠道名称">
<a-input v-model:value="formModel.name" placeholder="请输入" /> <a-input v-model:value="formModel.name" allow-clear placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<dict-select <dict-select

@ -4,7 +4,7 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="客户名称"> <a-form-item label="客户名称">
<a-input v-model:value="formModel.username" placeholder="请输入" /> <a-input v-model:value="formModel.username" allow-clear placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">

@ -5,7 +5,7 @@
<!-- v-if="userInfoCurrent === 'ROLE_ADMIN'" --> <!-- v-if="userInfoCurrent === 'ROLE_ADMIN'" -->
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="任务名称"> <a-form-item label="任务名称">
<a-input v-model:value="formModel.taskName" placeholder="请输入" /> <a-input v-model:value="formModel.taskName" allow-clear placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<!-- <a-col v-if="userInfoCurrent === 'ROLE_STORE_EXECUTIVE'" :xl="8" :md="12" :sm="24"> <!-- <a-col v-if="userInfoCurrent === 'ROLE_STORE_EXECUTIVE'" :xl="8" :md="12" :sm="24">

@ -8,7 +8,7 @@
<!-- 批量操作更多操作 --> <!-- 批量操作更多操作 -->
<a-card :bordered="false" :body-style="{ paddingBottom: 0 }"> <a-card :bordered="false" :body-style="{ paddingBottom: 0 }">
<div class="download"> <div class="download">
<a-button @click.stop="exportModel = true">导出</a-button> <a-button @click.stop="downloadTemplate">导出</a-button>
</div> </div>
</a-card> </a-card>
<!-- 底部表格 --> <!-- 底部表格 -->
@ -71,18 +71,18 @@
</template> --> </template> -->
</template> </template>
</pro-table> </pro-table>
<a-modal v-model:visible="exportModel" title="导出" @cancel="cancelModel"> <!-- <a-modal v-model:visible="exportModel" title="导出" @cancel="cancelModel">
<!-- <a-input <a-input
v-model:value="searchData.nid" v-model:value="searchData.nid"
placeholder="请输入号码" placeholder="请输入号码"
allow-clear allow-clear
style="width: 220px; margin-bottom: 10px" style="width: 220px; margin-bottom: 10px"
/> --> />
<a-range-picker v-model:value="searchData.exportDate" format="YYYY-MM-DD HH:mm:ss" show-time /> <a-range-picker v-model:value="searchData.exportDate" format="YYYY-MM-DD HH:mm:ss" show-time />
<template #footer> <template #footer>
<a-button key="submit" type="primary" @click="downloadTemplate"></a-button> <a-button key="submit" type="primary" @click="downloadTemplate"></a-button>
</template> </template>
</a-modal> </a-modal> -->
<!-- 详情弹窗 --> <!-- 详情弹窗 -->
<customer-list-view-modal ref="customerListViewModalRef" @submit-success="reloadTable" /> <customer-list-view-modal ref="customerListViewModalRef" @submit-success="reloadTable" />
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
@ -115,6 +115,7 @@ import { doRequest } from '@/utils/axios/request'
import type { Dayjs } from 'dayjs' import type { Dayjs } from 'dayjs'
// //
import { useDebounceFn } from '@vueuse/core' import { useDebounceFn } from '@vueuse/core'
// import { useRoute } from 'vue-router' // import { useRoute } from 'vue-router'
// //
// import { doRequest } from '@/utils/axios/request' // import { doRequest } from '@/utils/axios/request'
@ -355,13 +356,14 @@ const switchChange = (record: any) => {
// //
const downloadTemplate = useDebounceFn( const downloadTemplate = useDebounceFn(
() => { () => {
const data: any = searchData const data: any = searchParams
data.salesmanType = salesmanType.value data.salesmanType = salesmanType.value
if (data.exportDate && data.exportDate.length == 2) { // console.log('searchParams=', searchParams)
data.startTime = data.exportDate[0].format('YYYY-MM-DD HH:mm:ss') // if (data.exportDate && data.exportDate.length == 2) {
data.endTime = data.exportDate[1].format('YYYY-MM-DD HH:mm:ss') // data.startTime = data.exportDate[0].format('YYYY-MM-DD HH:mm:ss')
delete data.exportDate // data.endTime = data.exportDate[1].format('YYYY-MM-DD HH:mm:ss')
} // delete data.exportDate
// }
exportClueData(data) exportClueData(data)
.then(res => { .then(res => {
exportModel.value = false exportModel.value = false

@ -4,7 +4,7 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="标签"> <a-form-item label="标签">
<a-input v-model:value="formModel.clueLabelName" placeholder="请输入" /> <a-input v-model:value="formModel.clueLabelName" allow-clear placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<!-- <a-col :xl="8" :md="12" :sm="24" > --> <!-- <a-col :xl="8" :md="12" :sm="24" > -->
@ -25,7 +25,7 @@
</a-col> --> </a-col> -->
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="号码"> <a-form-item label="号码">
<a-input v-model:value="formModel.nid" placeholder="请输入" /> <a-input v-model:value="formModel.nid" allow-clear placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-if="salesmanType === 0" :xl="8" :md="12" :sm="24"> <a-col v-if="salesmanType === 0" :xl="8" :md="12" :sm="24">

@ -133,7 +133,9 @@
<a-select <a-select
v-model:value="formModel.salesmanUserId" v-model:value="formModel.salesmanUserId"
allow-clear allow-clear
show-search
mode="multiple" mode="multiple"
:filter-option="filterOption"
:max-tag-count="1" :max-tag-count="1"
:options="userList" :options="userList"
:field-names="{ label: 'userName', value: 'userId' }" :field-names="{ label: 'userName', value: 'userId' }"
@ -1513,7 +1515,9 @@ const handleMapInit = async () => {
await initMap() await initMap()
}) })
} }
const filterOption = (input: string, option: any) => {
return option.userName.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
defineExpose({ defineExpose({
open(opendata: openObj) { open(opendata: openObj) {
isSubmit.value = false isSubmit.value = false

@ -120,7 +120,9 @@
<a-select <a-select
v-model:value="formModel.salesmanUserId" v-model:value="formModel.salesmanUserId"
allow-clear allow-clear
show-search
mode="multiple" mode="multiple"
:filter-option="filterOption"
:max-tag-count="1" :max-tag-count="1"
:options="userList" :options="userList"
:field-names="{ label: 'userName', value: 'userId' }" :field-names="{ label: 'userName', value: 'userId' }"
@ -742,6 +744,9 @@ const searchData = (city: string, keywords: string, callback: any) => {
console.log(err) console.log(err)
}) })
} }
const filterOption = (input: string, option: any) => {
return option.userName.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
// //
const searchDataList = ref<any[]>([]) const searchDataList = ref<any[]>([])

@ -5,7 +5,7 @@
<!-- v-if="userInfoCurrent === 'ROLE_ADMIN'" --> <!-- v-if="userInfoCurrent === 'ROLE_ADMIN'" -->
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="客户名称"> <a-form-item label="客户名称">
<a-input v-model:value="formModel.customName" placeholder="请输入" /> <a-input v-model:value="formModel.customName" allow-clear placeholder="请输入" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
@ -13,6 +13,7 @@
<a-range-picker <a-range-picker
v-model:value="searchTimeValue" v-model:value="searchTimeValue"
show-time show-time
allow-clear
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
:ranges="{ :ranges="{
@ -25,6 +26,7 @@
<a-form-item label="业务员" name="salesmanUserId"> <a-form-item label="业务员" name="salesmanUserId">
<a-select <a-select
v-model:value="formModel.salesmanUserId" v-model:value="formModel.salesmanUserId"
allow-clear
:field-names="{ label: 'userName', value: 'userId' }" :field-names="{ label: 'userName', value: 'userId' }"
:options="businessUserList" :options="businessUserList"
placeholder="请选择业务员" placeholder="请选择业务员"
@ -35,6 +37,7 @@
<a-form-item label="分发状态" name="enrollStatus"> <a-form-item label="分发状态" name="enrollStatus">
<a-select <a-select
v-model:value="formModel.enrollStatus" v-model:value="formModel.enrollStatus"
allow-clear
:field-names="{ label: 'name', value: 'value' }" :field-names="{ label: 'name', value: 'value' }"
:options="enrollStatusList" :options="enrollStatusList"
placeholder="请选择分发状态" placeholder="请选择分发状态"
@ -110,6 +113,10 @@ const formModel = reactive<GeopoliticalCustomersSearch>({
const { resetFields } = useForm(formModel) const { resetFields } = useForm(formModel)
const enrollStatusList = [ const enrollStatusList = [
{
name: '暂存中',
value: 0
},
{ {
name: '待分发', name: '待分发',
value: 1 value: 1

@ -171,11 +171,8 @@ interface tagsItem {
const inputRef = ref() const inputRef = ref()
const taghandleClose = (removedTag: tagsItem, type: string) => { const taghandleClose = (removedTag: tagsItem, type: string) => {
console.log(removedTag, 'removedTag')
console.log(type, 'type')
const tags = tagFormModel.desc?.tags.filter(tag => tag.labelName !== removedTag.labelName) const tags = tagFormModel.desc?.tags.filter(tag => tag.labelName !== removedTag.labelName)
tagFormModel.desc.tags = tags tagFormModel.desc.tags = tags
console.log(tags, 'tags')
const newList: any = reactive([]) const newList: any = reactive([])
if (formModel.length > 0) { if (formModel.length > 0) {
tags.forEach((item: any) => { tags.forEach((item: any) => {
@ -185,11 +182,9 @@ const taghandleClose = (removedTag: tagsItem, type: string) => {
})[0] })[0]
) )
}) })
console.log(newList, 'newList')
formModel.length = 0 formModel.length = 0
formModel.push(...newList) formModel.push(...newList)
} }
console.log(formModel, 'formModel2')
// formModel.delLabelId?.push(removedTag.labelOrganizeId) // formModel.delLabelId?.push(removedTag.labelOrganizeId)
} }
@ -201,7 +196,6 @@ const showInput = (type: string) => {
} }
const handleInputConfirm = (type: string, index: number | undefined) => { const handleInputConfirm = (type: string, index: number | undefined) => {
console.log(index, 'index')
const inputValue = tagFormModel.desc.inputValue const inputValue = tagFormModel.desc.inputValue
const labelNameList = tagFormModel.desc.tags.map((item: tagsItem) => { const labelNameList = tagFormModel.desc.tags.map((item: tagsItem) => {
return item.labelName return item.labelName
@ -215,14 +209,9 @@ const handleInputConfirm = (type: string, index: number | undefined) => {
// if (index && clueStageListLength.value) { // if (index && clueStageListLength.value) {
// length.value = index + clueStageListLength.value - 1 // length.value = index + clueStageListLength.value - 1
length.value = Number(clueStageListLength.value) + Number(index) length.value = Number(clueStageListLength.value) + Number(index)
console.log(length.value, 'length.value')
console.log(clueStageListLength.value, 'clueStageListLength.value2')
console.log(index, 'index')
// } // }
formModel.push({ name: inputValue, sort: length.value }) formModel.push({ name: inputValue, sort: length.value })
// formModel.push({ name: inputValue, sort: index }) // formModel.push({ name: inputValue, sort: index })
console.log(formModel, 'formModel1')
} }
Object.assign(tagFormModel.desc, { Object.assign(tagFormModel.desc, {
@ -255,9 +244,7 @@ interface openObj {
defineExpose({ defineExpose({
open(opendata: openObj) { open(opendata: openObj) {
console.log(opendata, 'opendata')
clueStageListLength.value = opendata.clueStageListLength clueStageListLength.value = opendata.clueStageListLength
console.log(clueStageListLength.value, 'clueStageListLength.value1')
openModal() openModal()
if (isCreateForm.value) { if (isCreateForm.value) {
tagresetFields() tagresetFields()
@ -273,7 +260,6 @@ defineExpose({
clueStageEditModel.clueStageId = opendata.tag?.clueStageId clueStageEditModel.clueStageId = opendata.tag?.clueStageId
title.value = '编辑线索阶段' title.value = '编辑线索阶段'
// overrideProperties(formModel, opendata.record) // overrideProperties(formModel, opendata.record)
} }
formAction.value = opendata.newFormAction formAction.value = opendata.newFormAction

@ -210,21 +210,15 @@ const inputRef = ref()
const taghandleClose = (removedTag: tagsItem, type: string) => { const taghandleClose = (removedTag: tagsItem, type: string) => {
const tags = tagFormModel.desc?.tags.filter(tag => tag.labelName !== removedTag.labelName) const tags = tagFormModel.desc?.tags.filter(tag => tag.labelName !== removedTag.labelName)
tagFormModel.desc.tags = tags tagFormModel.desc.tags = tags
console.log(tagFormModel.desc.tags, 'tagFormModel.desc.tags')
if (title.value === '编辑标签组') { if (title.value === '编辑标签组') {
if (removedTag.labelOrganizeId) { if (removedTag.labelOrganizeId) {
formModel.delLabelId?.push(removedTag.labelOrganizeId) formModel.delLabelId?.push(removedTag.labelOrganizeId)
console.log(removedTag, 'removedTag')
console.log(formModel, 'formModel')
} else { } else {
formModel.labelList = formModel.labelList?.filter((item: string) => { formModel.labelList = formModel.labelList?.filter((item: string) => {
return item !== removedTag.labelName return item !== removedTag.labelName
}) })
} }
} }
console.log(tagFormModel.desc.tags, 'tagFormModel.desc.tags1111')
console.log(formModel, 'formModel')
} }
const showInput = (type: string) => { const showInput = (type: string) => {
@ -247,9 +241,7 @@ const handleInputConfirm = (type: string, id: number | undefined) => {
{ labelName: inputValue, labelOrganizeId: undefined } { labelName: inputValue, labelOrganizeId: undefined }
] ]
formModel.labelList?.push(inputValue) formModel.labelList?.push(inputValue)
console.log(formModel.labelList, 'formModel.labelList')
} }
// console.log(tagFormModel.desc.tags, 'tagFormModel.desc.tags2')
Object.assign(tagFormModel.desc, { Object.assign(tagFormModel.desc, {
tags: tagFormModel.desc.tags, tags: tagFormModel.desc.tags,
inputVisible: false, inputVisible: false,
@ -283,7 +275,6 @@ defineExpose({
labelOrganizeId: item.id labelOrganizeId: item.id
}) })
}) })
console.log(tagFormModel.desc.tags, 'tagFormModel.desc.tags1')
title.value = '编辑标签组' title.value = '编辑标签组'
formModel.delLabelId = [] formModel.delLabelId = []

@ -143,7 +143,6 @@ const handleClose = () => {
defineExpose({ defineExpose({
open(newFormAction: FormAction, record?: SysUserPageVO) { open(newFormAction: FormAction, record?: SysUserPageVO) {
console.log(record, 'record')
openModal() openModal()
resetFields() resetFields()
if (newFormAction === FormAction.CREATE) { if (newFormAction === FormAction.CREATE) {

@ -0,0 +1,150 @@
<template>
<!-- 头部 -->
<a-card :bordered="false" :body-style="{ paddingBottom: 0 }">
<div class="resourceList-title">资源比对</div>
</a-card>
<!-- 工具栏 -->
<clueComparisonSearch :loading="tableRef?.loading" @search="searchTable" />
<!-- 批量操作更多操作 -->
<a-card :bordered="false" :body-style="{ paddingBottom: 0 }">
<div class="operationButtonArea">
<a-button type="primary" @click="batchImport"></a-button>
</div>
</a-card>
<!-- 底部表格 -->
<pro-table
ref="tableRef"
row-key="customId"
:request="tableRequest"
:columns="columns"
:scroll="{ x: 1100 }"
:tool-bar-render="false"
class="protable"
:pagination="{ showQuickJumper: true }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'contrastUsername'">
<div v-for="(item, index) in record.contrastUsername" :key="index">
{{ item }}
</div>
</template>
<template v-if="column.key === 'operate'">
<operation-group>
<a @click="batchImport(record.id)"></a>
</operation-group>
</template>
</template>
</pro-table>
<!-- 批量导入新建弹窗 -->
<clue-comparison-modal
ref="clueComparisonModalRef"
@submit-success="reloadTable"
></clue-comparison-modal>
</template>
<script setup lang="ts">
import { ref } from 'vue'
//
import ProTable from '#/table'
import type { ProTableInstanceExpose, TableRequest, ProColumns } from '#/table'
import { mergePageParam } from '@/utils/page-utils'
import { FormAction } from '@/hooks/form'
import clueComparisonSearch from './clueComparisonSearch.vue'
import { pageQueryPageFile } from '@/api/system/setup/index'
import clueComparisonModal from './clueComparisonModal.vue'
import type { comparisonParam, comparisonPageParam } from '@/api/system/setup/types'
defineOptions({ name: 'ClueComparison' })
//
import { useUserStore } from '@/stores/user-store'
const { userInfo } = useUserStore()
const salesmanType = ref<number | undefined>()
onMounted(() => {
salesmanType.value = userInfo?.salesmanType
})
//
const clueComparisonModalRef = ref<InstanceType<typeof clueComparisonModal>>()
//
const tableRef = ref<ProTableInstanceExpose>()
//
let searchParams: comparisonParam = {}
//
const tableRequest: TableRequest = (params, sorter, filter) => {
const pageParam = mergePageParam(params, sorter, filter, salesmanType.value)
return pageQueryPageFile({ ...pageParam, ...searchParams })
}
//
const reloadTable = (resetPageIndex?: boolean) => {
tableRef.value?.actionRef?.reload(resetPageIndex)
}
//
const searchTable = (params: comparisonPageParam) => {
searchParams = params
reloadTable(true) // tableRequest
}
//
const batchImport = (id?: number) => {
clueComparisonModalRef.value?.open({
newFormAction: FormAction.CREATE,
id
})
}
const columns: ProColumns[] = [
{
title: 'ID',
width: 160,
dataIndex: 'id'
},
{
title: '任务名称',
dataIndex: 'taskName'
},
{
title: '任务数量',
width: 80,
dataIndex: 'contrastNum'
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 150,
align: 'center',
customRender: function ({ record }: any) {
if (record.createTime) {
return record.createTime
} else if (record.createTime === null) {
return '--'
}
}
},
{
key: 'operate',
title: '操作',
align: 'center',
width: 70,
fixed: 'right'
}
]
</script>
<style lang="less" scoped>
.resourceList-title {
font-size: 17px;
font-weight: 600;
color: #000;
}
//
.operationButtonArea {
padding-bottom: 20px;
::v-deep .ant-btn-primary {
margin-right: 10px;
}
}
.editable-row-operations a {
margin-right: 8px;
}
</style>

@ -0,0 +1,338 @@
<template>
<div ref="modal" class="modal">
<a-modal
:visible="visible"
:mask-closable="false"
:centered="true"
:body-style="{ padding: '20px 40px 24px 40px' }"
:get-container="() => $refs.modal"
:width="600"
:wrap-style="{ overflow: 'hidden' }"
@cancel="handleClose"
>
<template #title>
<div style="width: 100%; cursor: move">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane v-if="formModel.taskId == undefined" :key="1" tab="新建任务" />
<a-tab-pane v-if="formModel.taskId != undefined" :key="2" tab="资源处理" />
<a-tab-pane v-if="formModel.taskId != undefined" :key="3" tab="比对记录" />
</a-tabs>
</div>
</template>
<a-form
v-if="activeKey != 3"
ref="formRef"
:model="formModel"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 15 }"
>
<a-form-item
v-if="activeKey == 1"
label="任务名称"
name="taskName"
:rules="[{ required: true, message: '请输入任务名称', trigger: ['blur', 'change'] }]"
>
<a-input v-model:value="formModel.taskName" placeholder="请输入" />
</a-form-item>
<a-form-item v-if="activeKey == 2" label="操作类型" name="operateType">
<a-radio-group v-model:value="formModel.operateType">
<a-radio-button value="append">追加资源</a-radio-button>
<a-radio-button value="comparison">资源比对</a-radio-button>
</a-radio-group>
</a-form-item>
<div class="importModeOne" style="margin-left: 108px">
<div style="width: 100%">
<a-upload
v-model:file-list="formModel.fileList"
accept=".xls,.xlsx"
:show-upload-list="{ showDownloadIcon: true, showRemoveIcon: true }"
:before-upload="beforeUpload"
@remove="handleRemove"
>
<a-button> <UploadOutlined />上传文件 </a-button>
</a-upload>
</div>
</div>
<!-- <a-form-item
ref="distributorsUserIdListRef"
label="人员选择"
name="distributorsUserIdList"
:rules="[
{ type: 'array', required: true, message: '请选择人员', trigger: ['blur', 'change'] }
]"
>
<a-select
v-model:value="formModel.distributorsUserIdList"
mode="multiple"
style="width: 100%"
:max-tag-count="2"
placeholder="请选择人员"
:options="selectedPersonOptions"
></a-select>
</a-form-item> -->
</a-form>
<a-table
v-if="activeKey == 3"
:loading="fileLoading"
:columns="columns"
:data-source="exportList"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'operate'">
<a-button type="link" :disabled="!record.downPath" @click="downloadTemplate(record)"
>下载</a-button
>
</template>
</template>
</a-table>
<template #footer>
<a-button @click="handleClose()"></a-button>
<a-button v-if="activeKey != 3" type="primary" :loading="uploading" @click="onSubmit()">{{
uploading ? '正在提交' : '确认'
}}</a-button>
</template>
</a-modal>
</div>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { useModal } from '@/hooks/modal'
import { useFormAction, FormAction } from '@/hooks/form'
import type { CustomerListRecord } from '@/api/customermanagement/customerList/types'
import { doRequest } from '@/utils/axios/request'
import { message } from 'ant-design-vue'
import {
fileContrastAddition,
createTask,
fileContrastBuild,
pageRecordPage
} from '@/api/system/setup/index'
// import type { SelectProps } from 'ant-design-vue'
import { useDebounceFn } from '@vueuse/core'
import type { UploadFile } from 'ant-design-vue/lib/upload/interface'
//
// const selectedPersonOptions = ref<SelectProps['options']>([])
//
// const formModelFile = ref<UploadFile>()
export interface importData {
//
fileList: UploadFile[]
distributorsUserIdList: number[]
taskName: string
operateType?: string
taskId: number | undefined
}
const formModel = reactive<importData>({
fileList: [],
distributorsUserIdList: [],
taskName: '',
taskId: undefined,
operateType: ''
})
const columns = [
{
title: '对比状态',
dataIndex: 'status',
width: 90,
customRender: function ({ record }: any) {
if (record.status === 0) {
return h('div', '对比中')
} else if (record.status === 1) {
return h('div', '对比完成')
} else {
return h('div', '-')
}
}
},
{
title: '创建时间',
dataIndex: 'createTime',
align: 'center',
customRender: function ({ record }: any) {
if (record.createTime) {
return record.createTime
} else if (record.createTime === null) {
return '--'
}
}
},
{
key: 'operate',
title: '操作',
align: 'center',
width: 70,
fixed: 'right'
}
]
// type
const formRef = ref()
//
const uploading = ref<boolean>(false)
const emits = defineEmits<{
(e: 'submit-success', resetPageIndex?: boolean): void
}>()
const { title, visible, openModal, closeModal } = useModal()
const { formAction } = useFormAction()
const activeKey = ref<number>(1)
const exportList = ref([])
//
const resetForm = () => {
if (formRef.value) {
formRef.value.resetFields()
}
}
const fileLoading = ref<boolean>(false)
watch(activeKey, newValue => {
if (newValue == 2) {
formModel.operateType = 'append'
}
if (newValue == 3) {
getList()
}
})
function beforeUpload(file: UploadFile) {
formModel.fileList = [...formModel.fileList, file]
return false
}
const handleRemove = (file: UploadFile) => {
const index = formModel.fileList.indexOf(file)
const newFileList = formModel.fileList.slice()
newFileList.splice(index, 1)
formModel.fileList = newFileList
}
const getList = () => {
fileLoading.value = true
doRequest(pageRecordPage(), {
onSuccess: (res: any) => {
exportList.value = res.data.records
fileLoading.value = false
}
})
}
const onSubmit = useDebounceFn(() => {
formRef.value
.validate()
.then(() => {
if (formModel.fileList.length === 0) {
message.error('请选择上传文件')
return
}
const formData = new FormData()
formModel.fileList.forEach((file: UploadFile) => {
formData.append('files', file.originFileObj as any)
})
if (activeKey.value == 2 || activeKey.value == 3) {
console.log("🚀 ~ .then ~ formModel.taskId:", formModel.taskId)
formData.append('taskId', formModel.taskId as any)
}
uploading.value = true
if (activeKey.value == 1) {
formData.append('taskName', formModel.taskName)
doRequest(createTask(formData), {
onSuccess: () => {
message.success('上传成功', 1)
uploading.value = false
formModel.fileList.length = 0
handleClose()
emits('submit-success')
},
onError: () => {
message.error('上传异常', 1)
uploading.value = false
}
})
} else if (activeKey.value == 2) {
if (formModel.operateType == 'append') {
doRequest(fileContrastAddition(formData), {
onSuccess: () => {
message.success('上传成功', 1)
uploading.value = false
formModel.fileList.length = 0
handleClose()
emits('submit-success')
},
onError: () => {
message.error('上传异常', 1)
uploading.value = false
}
})
} else if (formModel.operateType == 'comparison') {
doRequest(fileContrastBuild(formData), {
onSuccess: () => {
message.success('上传成功', 1)
uploading.value = false
formModel.fileList.length = 0
handleClose()
emits('submit-success')
},
onError: () => {
message.error('上传异常', 1)
uploading.value = false
}
})
}
}
})
.catch((error: any) => {
return false
})
}, 300) // 300
//
const handleClose = () => {
formModel.fileList.length = 0
formModel.taskId = undefined
resetForm()
closeModal()
}
interface openObj {
newFormAction: FormAction
type?: string | undefined
id?: number | undefined
record?: CustomerListRecord
}
function downloadTemplate(data: any) {
if (data) {
window.open(data.downPath, '_blank')
}
}
defineExpose({
open(opendata: openObj) {
// selectedPersonOptions.value = []
// doRequest(getFindAll(23), {
// onSuccess: (res: any) => {
// const a = res.data.map((item: any) => {
// return { label: item.userName, value: item.userId }
// })
// a.forEach((item: any) => {
// selectedPersonOptions.value?.push({
// label: item.label,
// value: item.value
// })
// })
// }
// })
openModal()
if (typeof opendata.id == 'string') {
formModel.taskId = opendata.id
activeKey.value = 2
} else {
activeKey.value = 1
}
formAction.value = opendata.newFormAction
}
})
</script>
<style lang="less" scoped>
.modal {
::v-deep .ant-modal-header {
border-bottom: 0;
padding: 16px 24px 0;
}
}
</style>

@ -0,0 +1,79 @@
<template>
<a-card :bordered="false" style="margin-bottom: 16px" :body-style="{ paddingBottom: 0 }">
<a-form :model="formModel" :label-col="labelCol">
<a-row :gutter="16">
<a-col :xl="8" :md="12" :sm="24">
<a-form-item label="任务名">
<a-input v-model:value="formModel.taskName" allow-clear placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :xl="8" :md="12" :sm="24">
<a-form-item label="创建时间">
<a-range-picker
v-model:value="searchTimeValue"
show-time
format="YYYY-MM-DD HH:mm:ss"
style="width: 100%"
:ranges="{
Today: [dayjs().startOf('date'), dayjs()]
}"
/>
</a-form-item>
</a-col>
<a-col :xl="24" :md="24" :sm="24">
<search-actions :loading="props.loading" @search="search" @reset="reset" />
</a-col>
</a-row>
</a-form>
</a-card>
</template>
<script setup lang="ts">
import { Form } from 'ant-design-vue'
import type { comparisonParam } from '@/api/system/setup/types'
import dayjs from 'dayjs'
import type { Dayjs } from 'dayjs'
const useForm = Form.useForm
// label
const labelCol = { md: { span: 6 } }
const props = withDefaults(
defineProps<{
loading?: boolean
}>(),
{ loading: false }
)
const emits = defineEmits<{
(e: 'search', params: Record<string, any>): void
}>()
const searchTimeValue = ref<[Dayjs, Dayjs]>()
const formModel = reactive<comparisonParam>({
taskName: ''
})
const { resetFields } = useForm(formModel)
const search = () => {
const param = toRaw(formModel)
if (searchTimeValue.value && searchTimeValue.value.length == 2) {
param.startTime = searchTimeValue.value[0].format('YYYY-MM-DD HH:mm:ss')
param.endTime = searchTimeValue.value[1].format('YYYY-MM-DD HH:mm:ss')
} else {
param.startTime = ''
param.endTime = ''
}
emits('search', param)
}
const reset = () => {
//
resetFields()
//
searchTimeValue.value = undefined
search()
}
</script>

@ -0,0 +1,143 @@
<template>
<!-- 头部 -->
<a-card :bordered="false" :body-style="{ paddingBottom: 0 }">
<div class="geopoliticalCustomers-title">对外开放</div>
</a-card>
<!-- 搜索 -->
<setting-search :loading="tableRef?.loading" @search="searchTable" />
<!-- 工具栏 -->
<a-card :bordered="false" :body-style="{ paddingBottom: 0 }">
<div class="operationButtonArea">
<a-button type="primary" @click="editSetting"></a-button>
<!-- 更多操作 -->
</div>
</a-card>
<!-- 底部表格 -->
<pro-table
ref="tableRef"
row-key="customId"
:request="tableRequest"
:columns="columns"
:scroll="{ x: 1100 }"
:tool-bar-render="false"
class="protable"
:pagination="{ showQuickJumper: true }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key == 'pushStatus'">
<a-tag :color="record.pushStatus == 1 ? 'success' : 'error'">{{
record.pushStatus == 1 ? '推送成功' : '推送失败'
}}</a-tag>
</template>
</template>
</pro-table>
<!-- 新建/编辑弹窗 -->
<setting-modal ref="settingModalRef" @submit-success="reloadTable" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import settingSearch from './settingSearch.vue'
import settingModal from './settingModal.vue'
import ProTable from '#/table'
import type { ProTableInstanceExpose, TableRequest, ProColumns } from '#/table'
import { mergePageParam } from '@/utils/page-utils'
import { FormAction } from '@/hooks/form'
import type { settingParam } from '@/api/system/setup/types'
import { pageQueryPage } from '@/api/system/setup/index'
defineOptions({ name: 'SettingIndex' })
//
//
const tableRef = ref<ProTableInstanceExpose>()
// add ref
const settingModalRef = ref<InstanceType<typeof settingModal>>()
//
let searchParams: settingParam = {}
//
const reloadTable = (resetPageIndex?: boolean) => {
tableRef.value?.actionRef?.reload(resetPageIndex)
}
//
const searchTable = (params: settingParam) => {
searchParams = params
reloadTable(true) // tableRequest
}
//
const tableRequest: TableRequest = (params, sorter, filter) => {
const pageParam = mergePageParam(params, sorter, filter)
return pageQueryPage({ ...pageParam, ...searchParams })
}
const editSetting = () => {
settingModalRef.value?.open(FormAction.UPDATE)
}
const columns: ProColumns[] = [
{
title: '线索ID',
dataIndex: 'clueId'
},
{
title: '请求ID',
dataIndex: 'requestId'
},
{
title: '推送内容',
dataIndex: 'pushInfo'
},
{
title: '推送状态',
dataIndex: 'pushStatus'
// customRender: function ({ record }: any) {
// if (record.pushStatus === 0) {
// return h('div', '')
// } else if (record.pushStatus === 1) {
// return h('div', '')
// }
// }
},
{
title: '第几次推送',
dataIndex: 'sendNum'
},
{
title: '创建日期',
dataIndex: 'createTime',
width: 150,
align: 'center',
customRender: function ({ record }: any) {
if (record.createTime) {
return record.createTime
} else if (record.createTime == null) {
return '--'
}
}
}
// {
// key: 'operate',
// title: '',
// align: 'center',
// width: 150,
// fixed: 'right'
// }
]
</script>
<style lang="less" scoped>
.geopoliticalCustomers-title {
font-size: 17px;
font-weight: 600;
color: #000;
}
//
.operationButtonArea {
padding-bottom: 20px;
}
.editable-row-operations a {
margin-right: 8px;
}
</style>

@ -0,0 +1,163 @@
<template>
<div ref="modal" class="modal">
<!-- get-container="() => $refs.modal" 原因被挂载在最大的元素div外面不然无法修改样式需要将挂载在某个html元素上在modal外面主动套一个div -->
<a-modal
v-model:visible="visible"
title="设置"
:get-container="() => $refs.modal"
:footer="null"
:confirm-loading="submitLoading"
:width="650"
@cancel="handleClose"
>
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="对外开放">
<a-form
:model="formModel"
name="basic"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 19 }"
autocomplete="off"
@finish="handleSubmit"
>
<a-form-item
label="对接链接"
name="pushUrl"
:rules="[{ required: true, message: '请填入对接链接' }]"
>
<a-input
v-model:value="formModel.pushUrl"
allow-clear
placeholder="如https://boardgamegeek.com"
/>
</a-form-item>
<a-form-item label="是否启用" name="status">
<a-switch
v-model:checked="formModel.status"
:checked-value="1"
:un-checked-value="0"
/>
</a-form-item>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }" class="bottom-group">
<a-button type="primary" html-type="submit">提交</a-button>
</a-form-item>
</a-form>
</a-tab-pane>
</a-tabs>
</a-modal>
</div>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
import { useModal } from '@/hooks/modal'
import { message } from 'ant-design-vue'
import { doRequest } from '@/utils/axios/request'
import { useFormAction, FormAction, useAdminForm } from '@/hooks/form'
// import { remoteFileDownload } from '@/utils/file-utils'
import type { FormRequestMapping } from '@/hooks/form'
import { createStore, getConfig, updateStore } from '@/api/system/setup'
import type { settingData } from '@/api/system/setup/types'
//
import { useUserStore } from '@/stores/user-store'
//
import { useDebounceFn } from '@vueuse/core'
const emits = defineEmits<{
(e: 'submit-success'): void
}>()
const { userInfo } = useUserStore()
//
const { title, visible, openModal, closeModal } = useModal()
const { formAction } = useFormAction()
const formModel = reactive<SetmodalTy>({
id: undefined,
pushUrl: '',
status: 1,
userId: undefined
})
//
const formRequestMapping: FormRequestMapping<settingData> = {
[FormAction.CREATE]: createStore,
[FormAction.UPDATE]: updateStore
}
const { submitLoading, validateAndSubmit, resetFields } = useAdminForm(
formAction,
formRequestMapping,
formModel
)
// onMounted(() => {})
const activeKey = ref('1')
type SetmodalTy = {
id: number | undefined
pushUrl: string
status: number
userId: number | undefined
}
const handleSubmit = useDebounceFn(() => {
const reg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\\.-]+)+[\w\-\\._~:/?#[\]@!\\$&'\\*\\+,;=.]+$/
const isThrough = reg.test(formModel.pushUrl.trim())
if (!isThrough) {
message.error('域名地址不合法')
return false
}
formModel.userId = userInfo?.userId
submitLoading.value = true
validateAndSubmit(
{
...formModel
},
{
onSuccess: () => {
closeModal()
emits('submit-success')
}
}
)
}, 300)
const handleClose = () => {
closeModal()
}
defineExpose({
async open(newFormAction: FormAction) {
title.value = '设置'
openModal()
resetFields()
submitLoading.value = true
await doRequest(getConfig(), {
onSuccess: (data: any) => {
if (data.data.id != null) {
newFormAction = FormAction.UPDATE
formModel.id = data.data.id
formModel.pushUrl = data.data.pushUrl
formModel.status = data.data.status
formModel.userId = data.data.userId
} else {
newFormAction = FormAction.CREATE
}
},
onFinally: () => {
submitLoading.value = false
formAction.value = newFormAction
}
})
// formAction.value = newFormAction
}
})
</script>
<style lang="less" scoped>
//
.modal {
::v-deep .ant-modal-body {
padding: 0px 24px 8px !important;
}
.bottom-group ::v-deep .ant-form-item-control-input-content {
display: flex;
justify-content: flex-end;
}
}
</style>

@ -0,0 +1,87 @@
<template>
<a-card :bordered="false" style="margin-bottom: 16px" :body-style="{ paddingBottom: 0 }">
<a-form :model="formModel" :label-col="labelCol">
<a-row :gutter="16">
<!-- v-if="userInfoCurrent === 'ROLE_ADMIN'" -->
<a-col :xl="8" :md="12" :sm="24">
<a-form-item label="请求ID">
<a-input v-model:value="formModel.requestId" allow-clear placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :xl="8" :md="12" :sm="24">
<a-form-item label="创建日期">
<a-range-picker
v-model:value="formModel.reservationDate"
format="YYYY-MM-DD"
style="width: 100%"
/>
</a-form-item>
</a-col>
<a-col :xl="24" :md="24" :sm="24">
<search-actions :loading="props.loading" @search="search" @reset="reset" />
</a-col>
</a-row>
</a-form>
</a-card>
</template>
<script setup lang="ts">
import { Form } from 'ant-design-vue'
import type { settingParam } from '@/api/system/setup/types'
import dayjs from 'dayjs'
//
import { useUserStore } from '@/stores/user-store'
const { userInfo } = useUserStore()
const userInfoCurrent = ref<string | undefined>('')
onMounted(() => {
userInfoCurrent.value = userInfo?.roleCodes?.toLocaleString()
})
const useForm = Form.useForm
// label
const labelCol = { md: { span: 6 } }
const props = withDefaults(
defineProps<{
loading?: boolean
}>(),
{ loading: false }
)
const emits = defineEmits<{
(e: 'search', params: Record<string, any>): void
}>()
const formModel = reactive<settingParam>({
requestId: '',
reservationDate: undefined
})
watch(
() => formModel.reservationDate,
nval => {
if (nval && nval.length == 2) {
formModel.startTime = dayjs(nval[0]).format('YYYY-MM-DD')
formModel.endTime = dayjs(nval[1]).format('YYYY-MM-DD')
} else {
formModel.reservationDate = undefined
formModel.startTime = undefined
formModel.endTime = undefined
}
}
)
const { resetFields } = useForm(formModel)
const search = () => {
const param = toRaw(formModel)
if (param.reservationDate && param.reservationDate.length == 2) {
delete param.reservationDate
}
emits('search', param)
}
const reset = () => {
//
resetFields()
search()
}
</script>
Loading…
Cancel
Save