1
This commit is contained in:
@@ -26,11 +26,11 @@ const baseConfig = {
|
||||
// 开发环境配置
|
||||
const developmentConfig = {
|
||||
...baseConfig,
|
||||
// apiUrl: 'http://localhost:9097/admin_api/',
|
||||
// uploadUrl: 'http://localhost:9097/admin_api/upload',
|
||||
apiUrl: 'http://localhost:9097/admin_api/',
|
||||
uploadUrl: 'http://localhost:9097/admin_api/upload',
|
||||
|
||||
apiUrl: 'https://work.light120.com/admin_api/',
|
||||
uploadUrl: 'https://work.light120.com/admin_api/upload',
|
||||
// apiUrl: 'https://work.light120.com/admin_api/',
|
||||
// uploadUrl: 'https://work.light120.com/admin_api/upload',
|
||||
// 开发环境显示更多调试信息
|
||||
debug: true
|
||||
}
|
||||
|
||||
@@ -163,6 +163,29 @@ class PlaAccountServer {
|
||||
batchParseLocation(ids) {
|
||||
return window.framework.http.post('/pla_account/batchParseLocation', { ids })
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查账号授权状态
|
||||
* @param {Object} param - 参数对象
|
||||
* @param {Number|String} param.id - 账号ID(可选)
|
||||
* @param {String} param.sn_code - 设备SN码(可选)
|
||||
* @returns {Promise}
|
||||
*/
|
||||
checkAuthorization(param) {
|
||||
return window.framework.http.post('/account/check-authorization', param)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新账号授权信息
|
||||
* @param {Object} param - 参数对象
|
||||
* @param {Number|String} param.id - 账号ID
|
||||
* @param {String} param.authorization_date - 授权日期(可选,不提供则使用当前时间)
|
||||
* @param {Number} param.authorization_days - 授权天数
|
||||
* @returns {Promise}
|
||||
*/
|
||||
updateAuthorization(param) {
|
||||
return window.framework.http.post('/account/update-authorization', param)
|
||||
}
|
||||
}
|
||||
|
||||
export default new PlaAccountServer()
|
||||
|
||||
@@ -49,6 +49,56 @@
|
||||
<!-- 编辑组件(使用 FloatPanel,包含所有字段) -->
|
||||
<PlaAccountEdit ref="accountEdit" @on-save="handleSaveSuccess" />
|
||||
|
||||
<!-- 授权设置弹窗 -->
|
||||
<Modal
|
||||
v-model="authorizationModal.visible"
|
||||
title="设置授权"
|
||||
:mask-closable="false"
|
||||
width="600"
|
||||
@on-ok="handleSaveAuthorization"
|
||||
@on-cancel="handleCancelAuthorization"
|
||||
>
|
||||
<Form ref="authorizationForm" :model="authorizationModal.formData" :label-width="120">
|
||||
<FormItem label="账号名称">
|
||||
<Input v-model="authorizationModal.formData.accountName" disabled />
|
||||
</FormItem>
|
||||
<FormItem label="设备SN码">
|
||||
<Input v-model="authorizationModal.formData.sn_code" disabled />
|
||||
</FormItem>
|
||||
<FormItem label="授权日期">
|
||||
<DatePicker
|
||||
v-model="authorizationModal.formData.authorization_date"
|
||||
type="date"
|
||||
placeholder="请选择授权日期(不选择则使用当前时间)"
|
||||
style="width: 100%;"
|
||||
format="yyyy-MM-dd"
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem label="授权天数">
|
||||
<div style="display: flex; align-items: center; gap: 8px; flex-wrap: wrap;">
|
||||
<InputNumber
|
||||
v-model="authorizationModal.formData.authorization_days"
|
||||
:min="0"
|
||||
placeholder="请输入授权天数"
|
||||
style="width: 200px;"
|
||||
/>
|
||||
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
||||
<Button size="small" @click="setQuickAuthorizationDays(7)">7天</Button>
|
||||
<Button size="small" @click="setQuickAuthorizationDays(30)">30天</Button>
|
||||
<Button size="small" @click="setQuickAuthorizationDays(90)">90天</Button>
|
||||
<Button size="small" @click="setQuickAuthorizationDays(180)">180天</Button>
|
||||
<Button size="small" @click="setQuickAuthorizationDays(365)">365天</Button>
|
||||
</div>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem label="过期时间" v-if="authorizationModal.formData.authorization_date && authorizationModal.formData.authorization_days">
|
||||
<span :style="{ color: getExpireDateColor(authorizationModal.formData) }">
|
||||
{{ getExpireDate(authorizationModal.formData) }}
|
||||
</span>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
<!-- 简历详情弹窗 -->
|
||||
<Modal v-model="resumeModal.visible" :title="resumeModal.title" width="900" :footer-hide="true">
|
||||
<div v-if="resumeModal.loading" style="text-align: center; padding: 40px;">
|
||||
@@ -253,6 +303,16 @@ export default {
|
||||
title: '在线简历详情',
|
||||
data: null
|
||||
},
|
||||
authorizationModal: {
|
||||
visible: false,
|
||||
formData: {
|
||||
id: null,
|
||||
accountName: '',
|
||||
sn_code: '',
|
||||
authorization_date: null,
|
||||
authorization_days: 0
|
||||
}
|
||||
},
|
||||
gridOption: {
|
||||
param: {
|
||||
seachOption: {
|
||||
@@ -356,6 +416,51 @@ export default {
|
||||
}, params.row.auto_chat ? '开启' : '关闭')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '剩余天数',
|
||||
key: 'remaining_days',
|
||||
minWidth: 100,
|
||||
render: (h, params) => {
|
||||
const remainingDays = params.row.remaining_days || 0
|
||||
let color = 'success'
|
||||
if (remainingDays <= 0) {
|
||||
color = 'error'
|
||||
} else if (remainingDays <= 7) {
|
||||
color = 'warning'
|
||||
}
|
||||
return h('Tag', {
|
||||
props: { color: color }
|
||||
}, remainingDays > 0 ? `${remainingDays} 天` : '已过期')
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '授权日期',
|
||||
key: 'authorization_date',
|
||||
minWidth: 150,
|
||||
render: (h, params) => {
|
||||
if (!params.row.authorization_date) {
|
||||
return h('span', { style: { color: '#999' } }, '未授权')
|
||||
}
|
||||
const date = new Date(params.row.authorization_date)
|
||||
return h('span', this.formatDate(date))
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '过期时间',
|
||||
key: 'expire_date',
|
||||
minWidth: 150,
|
||||
render: (h, params) => {
|
||||
if (!params.row.authorization_date || !params.row.authorization_days) {
|
||||
return h('span', { style: { color: '#999' } }, '未授权')
|
||||
}
|
||||
const authDate = new Date(params.row.authorization_date)
|
||||
const expireDate = new Date(authDate.getTime() + params.row.authorization_days * 24 * 60 * 60 * 1000)
|
||||
const remainingDays = params.row.remaining_days || 0
|
||||
return h('span', {
|
||||
style: { color: remainingDays <= 0 ? '#ed4014' : remainingDays <= 7 ? '#ff9900' : '#515a6e' }
|
||||
}, this.formatDate(expireDate))
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '自动活跃',
|
||||
key: 'auto_active',
|
||||
@@ -418,6 +523,13 @@ export default {
|
||||
this.showEditWarp(params.row)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '设置授权',
|
||||
type: 'warning',
|
||||
click: () => {
|
||||
this.showAuthorizationModal(params.row)
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '解析位置',
|
||||
type: 'success',
|
||||
@@ -597,6 +709,108 @@ export default {
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 格式化日期
|
||||
formatDate(date) {
|
||||
if (!date) return '-'
|
||||
const d = new Date(date)
|
||||
const year = d.getFullYear()
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
// 显示授权设置弹窗
|
||||
showAuthorizationModal(row) {
|
||||
this.authorizationModal.formData = {
|
||||
id: row.id,
|
||||
accountName: row.name,
|
||||
sn_code: row.sn_code,
|
||||
// 如果有授权日期则使用,否则默认使用当天
|
||||
authorization_date: row.authorization_date ? new Date(row.authorization_date) : new Date(),
|
||||
authorization_days: row.authorization_days || 0
|
||||
}
|
||||
this.authorizationModal.visible = true
|
||||
},
|
||||
// 设置快捷授权天数
|
||||
setQuickAuthorizationDays(days) {
|
||||
this.authorizationModal.formData.authorization_days = days
|
||||
// 如果没有设置授权日期,自动设置为当前日期
|
||||
if (!this.authorizationModal.formData.authorization_date) {
|
||||
this.authorizationModal.formData.authorization_date = new Date()
|
||||
}
|
||||
},
|
||||
// 保存授权信息
|
||||
async handleSaveAuthorization() {
|
||||
if (!this.authorizationModal.formData.id) {
|
||||
this.$Message.error('账号ID不能为空')
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.authorizationModal.formData.authorization_days || this.authorizationModal.formData.authorization_days <= 0) {
|
||||
this.$Message.error('请输入授权天数')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const param = {
|
||||
id: this.authorizationModal.formData.id,
|
||||
authorization_days: this.authorizationModal.formData.authorization_days
|
||||
}
|
||||
|
||||
// 如果设置了授权日期,添加到参数中
|
||||
if (this.authorizationModal.formData.authorization_date) {
|
||||
param.authorization_date = this.authorizationModal.formData.authorization_date
|
||||
}
|
||||
|
||||
await plaAccountServer.updateAuthorization(param)
|
||||
this.$Message.success('授权设置成功!')
|
||||
this.authorizationModal.visible = false
|
||||
// 刷新列表
|
||||
this.query(this.gridOption.param.pageOption.page || 1)
|
||||
} catch (error) {
|
||||
console.error('设置授权失败:', error)
|
||||
this.$Message.error('设置授权失败:' + (error.message || '请稍后重试'))
|
||||
}
|
||||
},
|
||||
// 取消授权设置
|
||||
handleCancelAuthorization() {
|
||||
this.authorizationModal.visible = false
|
||||
this.authorizationModal.formData = {
|
||||
id: null,
|
||||
accountName: '',
|
||||
sn_code: '',
|
||||
authorization_date: null,
|
||||
authorization_days: 0
|
||||
}
|
||||
},
|
||||
// 获取过期时间
|
||||
getExpireDate(formData) {
|
||||
if (!formData.authorization_date || !formData.authorization_days) {
|
||||
return '未授权'
|
||||
}
|
||||
const authDate = new Date(formData.authorization_date)
|
||||
const expireDate = new Date(authDate.getTime() + formData.authorization_days * 24 * 60 * 60 * 1000)
|
||||
const year = expireDate.getFullYear()
|
||||
const month = String(expireDate.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(expireDate.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
// 获取过期时间颜色
|
||||
getExpireDateColor(formData) {
|
||||
if (!formData.authorization_date || !formData.authorization_days) {
|
||||
return '#999'
|
||||
}
|
||||
const authDate = new Date(formData.authorization_date)
|
||||
const expireDate = new Date(authDate.getTime() + formData.authorization_days * 24 * 60 * 60 * 1000)
|
||||
const now = new Date()
|
||||
const remaining = Math.ceil((expireDate.getTime() - now.getTime()) / (24 * 60 * 60 * 1000))
|
||||
if (remaining <= 0) {
|
||||
return '#ed4014'
|
||||
} else if (remaining <= 7) {
|
||||
return '#ff9900'
|
||||
} else {
|
||||
return '#515a6e'
|
||||
}
|
||||
},
|
||||
// 解析工作经历
|
||||
parseWorkExp(workExp) {
|
||||
if (!workExp) return []
|
||||
|
||||
@@ -92,6 +92,54 @@
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
<!-- 授权信息卡片 -->
|
||||
<Card class="config-card" title="授权信息" :bordered="false" style="margin-bottom: 16px;">
|
||||
<Row :gutter="16">
|
||||
<Col span="8">
|
||||
<div class="detail-item">
|
||||
<span class="label">授权日期:</span>
|
||||
<span class="value">{{ formatDateTime(accountInfo.authorization_date) || '未授权' }}</span>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<div class="detail-item">
|
||||
<span class="label">授权天数:</span>
|
||||
<span class="value">{{ accountInfo.authorization_days || 0 }} 天</span>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<div class="detail-item">
|
||||
<span class="label">剩余天数:</span>
|
||||
<span class="value">
|
||||
<Tag :color="getRemainingDaysColor(accountInfo.remaining_days)">
|
||||
{{ accountInfo.remaining_days || 0 }} 天
|
||||
</Tag>
|
||||
</span>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row :gutter="16" style="margin-top: 12px;">
|
||||
<Col span="8">
|
||||
<div class="detail-item">
|
||||
<span class="label">过期时间:</span>
|
||||
<span class="value" :class="{'text-danger': isExpired(accountInfo)}">
|
||||
{{ getExpireDate(accountInfo) }}
|
||||
</span>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<div class="detail-item">
|
||||
<span class="label">授权状态:</span>
|
||||
<span class="value">
|
||||
<Tag :color="getAuthorizationStatusColor(accountInfo)">
|
||||
{{ getAuthorizationStatus(accountInfo) }}
|
||||
</Tag>
|
||||
</span>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<!-- 配置信息卡片 -->
|
||||
<Card class="config-card" title="基础配置" :bordered="false" style="margin-bottom: 16px;">
|
||||
<Row :gutter="16">
|
||||
@@ -177,13 +225,13 @@
|
||||
<span class="value">{{ deliverConfig.max_deliver || '-' }}</span>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span="12">
|
||||
<Col span="8">
|
||||
<div class="detail-item">
|
||||
<span class="label">过滤关键词:</span>
|
||||
<span class="value">{{ deliverConfig.filter_keywords || '-' }}</span>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span="12">
|
||||
<Col span="8">
|
||||
<div class="detail-item">
|
||||
<span class="label">排除关键词:</span>
|
||||
<span class="value">{{ deliverConfig.exclude_keywords || '-' }}</span>
|
||||
@@ -1371,6 +1419,63 @@ export default {
|
||||
this.$Message.warning('二维码图片加载失败,请刷新重试')
|
||||
},
|
||||
|
||||
// 获取剩余天数颜色
|
||||
getRemainingDaysColor(remainingDays) {
|
||||
if (!remainingDays || remainingDays <= 0) {
|
||||
return 'error'
|
||||
} else if (remainingDays <= 7) {
|
||||
return 'warning'
|
||||
} else {
|
||||
return 'success'
|
||||
}
|
||||
},
|
||||
|
||||
// 获取过期时间
|
||||
getExpireDate(accountInfo) {
|
||||
if (!accountInfo.authorization_date || !accountInfo.authorization_days) {
|
||||
return '未授权'
|
||||
}
|
||||
const authDate = new Date(accountInfo.authorization_date)
|
||||
const expireDate = new Date(authDate.getTime() + accountInfo.authorization_days * 24 * 60 * 60 * 1000)
|
||||
return this.formatDateTime(expireDate)
|
||||
},
|
||||
|
||||
// 判断是否过期
|
||||
isExpired(accountInfo) {
|
||||
const remainingDays = accountInfo.remaining_days || 0
|
||||
return remainingDays <= 0
|
||||
},
|
||||
|
||||
// 获取授权状态
|
||||
getAuthorizationStatus(accountInfo) {
|
||||
if (!accountInfo.authorization_date || !accountInfo.authorization_days) {
|
||||
return '未授权'
|
||||
}
|
||||
const remainingDays = accountInfo.remaining_days || 0
|
||||
if (remainingDays <= 0) {
|
||||
return '已过期'
|
||||
} else if (remainingDays <= 7) {
|
||||
return '即将过期'
|
||||
} else {
|
||||
return '正常'
|
||||
}
|
||||
},
|
||||
|
||||
// 获取授权状态颜色
|
||||
getAuthorizationStatusColor(accountInfo) {
|
||||
if (!accountInfo.authorization_date || !accountInfo.authorization_days) {
|
||||
return 'default'
|
||||
}
|
||||
const remainingDays = accountInfo.remaining_days || 0
|
||||
if (remainingDays <= 0) {
|
||||
return 'error'
|
||||
} else if (remainingDays <= 7) {
|
||||
return 'warning'
|
||||
} else {
|
||||
return 'success'
|
||||
}
|
||||
},
|
||||
|
||||
// 格式化日期时间
|
||||
formatDateTime(datetime) {
|
||||
if (!datetime) return '-'
|
||||
|
||||
@@ -56,6 +56,45 @@
|
||||
</FormItem>
|
||||
</Card>
|
||||
|
||||
<Card title="授权信息" style="margin-bottom: 16px;">
|
||||
<FormItem label="授权日期">
|
||||
<DatePicker
|
||||
v-model="formData.authorization_date"
|
||||
type="date"
|
||||
placeholder="请选择授权日期(不选择则使用当前时间)"
|
||||
style="width: 100%;"
|
||||
format="yyyy-MM-dd"
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem label="授权天数">
|
||||
<div style="display: flex; align-items: center; gap: 8px; flex-wrap: wrap;">
|
||||
<InputNumber
|
||||
v-model="formData.authorization_days"
|
||||
:min="0"
|
||||
placeholder="请输入授权天数"
|
||||
style="width: 200px;"
|
||||
/>
|
||||
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
||||
<Button size="small" @click="setAuthorizationDays(7)">7天</Button>
|
||||
<Button size="small" @click="setAuthorizationDays(30)">30天</Button>
|
||||
<Button size="small" @click="setAuthorizationDays(90)">90天</Button>
|
||||
<Button size="small" @click="setAuthorizationDays(180)">180天</Button>
|
||||
<Button size="small" @click="setAuthorizationDays(365)">365天</Button>
|
||||
</div>
|
||||
</div>
|
||||
</FormItem>
|
||||
<FormItem label="剩余天数" v-if="formData.remaining_days !== undefined">
|
||||
<span :style="{ color: getRemainingDaysColor(formData.remaining_days) }">
|
||||
{{ formData.remaining_days || 0 }} 天
|
||||
</span>
|
||||
</FormItem>
|
||||
<FormItem label="过期时间" v-if="formData.authorization_date && formData.authorization_days">
|
||||
<span :style="{ color: getExpireDateColor(formData) }">
|
||||
{{ getExpireDate(formData) }}
|
||||
</span>
|
||||
</FormItem>
|
||||
</Card>
|
||||
|
||||
<Card title="排序优先级配置" style="margin-bottom: 16px;">
|
||||
<FormItem label="排序优先级">
|
||||
<div class="priority-config">
|
||||
@@ -230,7 +269,11 @@ export default {
|
||||
chat_workdays_only: 1,
|
||||
auto_active: 0,
|
||||
active_interval: 60,
|
||||
active_actions_json: ''
|
||||
active_actions_json: '',
|
||||
// 授权相关字段
|
||||
authorization_date: null,
|
||||
authorization_days: 0,
|
||||
remaining_days: 0
|
||||
},
|
||||
// 排序优先级列表
|
||||
priorityList: [
|
||||
@@ -284,6 +327,16 @@ export default {
|
||||
},
|
||||
// 处理 JSON 配置字段
|
||||
processJsonFields(row) {
|
||||
// 处理授权信息
|
||||
if (row.authorization_date) {
|
||||
this.formData.authorization_date = new Date(row.authorization_date)
|
||||
} else {
|
||||
// 如果没有授权日期,默认使用当天
|
||||
this.formData.authorization_date = new Date()
|
||||
}
|
||||
this.formData.authorization_days = row.authorization_days || 0
|
||||
this.formData.remaining_days = row.remaining_days || 0
|
||||
|
||||
// is_salary_priority 配置
|
||||
if (row.is_salary_priority) {
|
||||
const priorityConfig = typeof row.is_salary_priority === 'string'
|
||||
@@ -400,6 +453,56 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取过期时间
|
||||
getExpireDate(formData) {
|
||||
if (!formData.authorization_date || !formData.authorization_days) {
|
||||
return '未授权'
|
||||
}
|
||||
const authDate = new Date(formData.authorization_date)
|
||||
const expireDate = new Date(authDate.getTime() + formData.authorization_days * 24 * 60 * 60 * 1000)
|
||||
const year = expireDate.getFullYear()
|
||||
const month = String(expireDate.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(expireDate.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
},
|
||||
// 获取过期时间颜色
|
||||
getExpireDateColor(formData) {
|
||||
const remainingDays = formData.remaining_days || 0
|
||||
if (remainingDays <= 0) {
|
||||
return '#ed4014'
|
||||
} else if (remainingDays <= 7) {
|
||||
return '#ff9900'
|
||||
} else {
|
||||
return '#515a6e'
|
||||
}
|
||||
},
|
||||
// 获取剩余天数颜色
|
||||
getRemainingDaysColor(remainingDays) {
|
||||
if (!remainingDays || remainingDays <= 0) {
|
||||
return '#ed4014'
|
||||
} else if (remainingDays <= 7) {
|
||||
return '#ff9900'
|
||||
} else {
|
||||
return '#19be6b'
|
||||
}
|
||||
},
|
||||
// 设置授权天数(快捷按钮)
|
||||
setAuthorizationDays(days) {
|
||||
this.formData.authorization_days = days
|
||||
// 如果没有设置授权日期,自动设置为当前日期
|
||||
if (!this.formData.authorization_date) {
|
||||
this.formData.authorization_date = new Date()
|
||||
}
|
||||
// 计算剩余天数(如果已有授权日期)
|
||||
if (this.formData.authorization_date && days > 0) {
|
||||
const authDate = new Date(this.formData.authorization_date)
|
||||
const expireDate = new Date(authDate.getTime() + days * 24 * 60 * 60 * 1000)
|
||||
const now = new Date()
|
||||
const remaining = Math.ceil((expireDate.getTime() - now.getTime()) / (24 * 60 * 60 * 1000))
|
||||
this.formData.remaining_days = Math.max(0, remaining)
|
||||
}
|
||||
this.$Message.success(`已设置授权天数为 ${days} 天`)
|
||||
},
|
||||
// 返回
|
||||
handleBack() {
|
||||
this.$refs.floatPanel.hide()
|
||||
|
||||
Reference in New Issue
Block a user