开账号限制开关
This commit is contained in:
@@ -5,9 +5,9 @@ VITE_DEV=true
|
|||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
# VITE_BASE_URL='http://172.16.214.222:48080'
|
# VITE_BASE_URL='http://172.16.214.222:48080'
|
||||||
# VITE_BASE_URL='http://192.168.1.144:48080'
|
VITE_BASE_URL='http://192.168.1.144:48080'
|
||||||
# VITE_BASE_URL='http://47.79.98.113:48080'
|
# VITE_BASE_URL='http://47.79.98.113:48080'
|
||||||
VITE_BASE_URL='https://backstageapi.yolozs.com'
|
# VITE_BASE_URL='https://backstageapi.yolozs.com'
|
||||||
|
|
||||||
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
# 文件上传类型:server - 后端上传, client - 前端直连上传,仅支持 S3 服务
|
||||||
VITE_UPLOAD_TYPE=server
|
VITE_UPLOAD_TYPE=server
|
||||||
|
|||||||
@@ -48,31 +48,40 @@
|
|||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- 选择用户 -->
|
||||||
<el-form-item v-if="formType !== 'create'" label="选择用户" prop="userId">
|
<el-form-item v-if="formType !== 'create'" label="选择用户" prop="userId">
|
||||||
<el-select v-model="userData.id" @change="changeUser" clearable placeholder="请选择租户套餐">
|
<el-select v-model="userData.id" @change="changeUser" clearable placeholder="请选择租户">
|
||||||
<el-option v-for="item in userList" :key="item.id" :label="item.username" :value="item.id" />
|
<el-option v-for="item in userList" :key="item.id" :label="item.username" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 爬虫:不受限制,直接选 -->
|
||||||
<el-form-item v-if="userData.id" label="爬虫" prop="status">
|
<el-form-item v-if="userData.id" label="爬虫" prop="status">
|
||||||
<el-radio-group v-model="userData.crawl">
|
<el-radio-group v-model="userData.crawl">
|
||||||
<el-radio :value="1">开启</el-radio>
|
<el-radio :value="1">开启</el-radio>
|
||||||
<el-radio :value="0">关闭</el-radio>
|
<el-radio :value="0">关闭</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 爬大哥:必须先选“爬大哥过期时间” -->
|
||||||
<el-form-item v-if="userData.id" label="爬大哥" prop="status">
|
<el-form-item v-if="userData.id" label="爬大哥" prop="status">
|
||||||
<el-radio-group v-model="userData.bigBrother">
|
<el-radio-group v-model="userData.bigBrother" :disabled="!formData.brotherExpireTime">
|
||||||
<el-radio :value="1">开启</el-radio>
|
<el-radio :value="1">开启</el-radio>
|
||||||
<el-radio :value="0">关闭</el-radio>
|
<el-radio :value="0">关闭</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- ai自动化:必须先选“AI过期时间” -->
|
||||||
<el-form-item v-if="userData.id" label="ai自动化" prop="status">
|
<el-form-item v-if="userData.id" label="ai自动化" prop="status">
|
||||||
<el-radio-group v-model="userData.aiChat">
|
<el-radio-group v-model="userData.aiChat" :disabled="!formData.aiExpireTime">
|
||||||
<el-radio :value="1">开启</el-radio>
|
<el-radio :value="1">开启</el-radio>
|
||||||
<el-radio :value="0">关闭</el-radio>
|
<el-radio :value="0">关闭</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- ai回复:必须先选“AI过期时间” -->
|
||||||
<el-form-item v-if="userData.id" label="ai回复" prop="status">
|
<el-form-item v-if="userData.id" label="ai回复" prop="status">
|
||||||
<el-radio-group v-model="userData.aiReplay">
|
<el-radio-group v-model="userData.aiReplay" :disabled="!formData.aiExpireTime">
|
||||||
<el-radio :value="1">开启</el-radio>
|
<el-radio :value="1">开启</el-radio>
|
||||||
<el-radio :value="0">关闭</el-radio>
|
<el-radio :value="0">关闭</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@@ -91,6 +100,7 @@ import { getUserByTenant, updateRoleUser } from '@/api/system/user'
|
|||||||
import { CommonStatusEnum } from '@/utils/constants'
|
import { CommonStatusEnum } from '@/utils/constants'
|
||||||
import * as TenantPackageApi from '@/api/system/tenantPackage'
|
import * as TenantPackageApi from '@/api/system/tenantPackage'
|
||||||
import * as userApi from '@/api/system/user'
|
import * as userApi from '@/api/system/user'
|
||||||
|
import { watch } from 'vue' // ⭐ 确保引入 watch
|
||||||
|
|
||||||
defineOptions({ name: 'SystemTenantForm' })
|
defineOptions({ name: 'SystemTenantForm' })
|
||||||
|
|
||||||
@@ -212,12 +222,13 @@ const resetForm = () => {
|
|||||||
status: CommonStatusEnum.ENABLE,
|
status: CommonStatusEnum.ENABLE,
|
||||||
username: undefined,
|
username: undefined,
|
||||||
password: undefined,
|
password: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
aiExpireTime: undefined, // ⭐ 加上
|
||||||
|
brotherExpireTime: undefined, // ⭐ 加上
|
||||||
}
|
}
|
||||||
userData.value = {}
|
userData.value = {} as userApi.UserVO
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeUser(val) {
|
function changeUser(val) {
|
||||||
userList.value.forEach(item => {
|
userList.value.forEach(item => {
|
||||||
if (item.id === val) {
|
if (item.id === val) {
|
||||||
@@ -228,4 +239,25 @@ function changeUser(val) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// AI 过期时间变化:没有时间时,禁止并关闭 ai 功能
|
||||||
|
watch(
|
||||||
|
() => formData.value.aiExpireTime,
|
||||||
|
(val) => {
|
||||||
|
if (!val && userData.value) {
|
||||||
|
userData.value.aiChat = 0
|
||||||
|
userData.value.aiReplay = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// 爬大哥 过期时间变化:没有时间时,禁止并关闭 bigBrother
|
||||||
|
watch(
|
||||||
|
() => formData.value.brotherExpireTime,
|
||||||
|
(val) => {
|
||||||
|
if (!val && userData.value) {
|
||||||
|
userData.value.bigBrother = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user