Commit 0e2c2555 by 胡悦

Merge branch 'SAAS+V4.53.0-0528' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.53.0-0528
2 parents 85f9af8d f900cd3f
import request from "./request"
import RequestMethods from "./request.methods"
// AI助理-账号管理-账号列表
export function getAccountList(data) {
data.method = `dj.api.script.aiagent.account.list`
return request(data, RequestMethods.POST)
}
// AI助理-账号管理-新建账号
export function createAccount(data) {
data.method = `dj.api.script.aiagent.account.create`
return request(data, RequestMethods.POST)
}
// AI助理-账号管理-启用/禁用账号
export function switchAccount(data) {
data.method = `dj.api.script.aiagent.account.switch`
return request(data, RequestMethods.POST)
}
// AI助理-账号管理-编辑账号
export function updateAccount(data) {
data.method = `dj.api.script.aiagent.account.update`
return request(data, RequestMethods.POST)
}
// // AI助理-账号管理-删除账号
export function deleteAccount(data) {
data.method = `dj.api.script.aiagent.account.delete`
return request(data, RequestMethods.POST)
}
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-04-24 15:36:37
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-04-24 16:31:47
* @FilePath: \dj-car-life-system\src\router\modules\916_largeModel.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
916: {
path: "/largeModel",
name: "largeModel",
meta: {
title: "AI大模型",
authId: "916",
parentId: "1",
cache: false
}
},
91601: {
path: "/accountManagement",
name: "accountManagement",
meta: {
title: "账号管理",
authId: "91601",
parentId: "916",
cache: false
},
auth: [
{
authId: "9160102",
parentId: "91601",
label: "编辑",
handle: "handleEdit"
},
{
authId: "9160103",
parentId: "91601",
label: "禁用",
handle: "handleDisabled"
},
{
authId: "9160104",
parentId: "91601",
label: "删除",
handle: "handleDelete"
}
],
component: _import("largeModel/accountManagement/index")
}
}
<!-- 驳回 -->
<template>
<d2-dialog
:title="detailInfo && detailInfo.id ? '编辑总部账号' : '新建总部账号'"
:is-visible="visible"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm"
>
<div class="reject-dialog">
<glsx-combi-form
class="edit-form-container"
ref="formRef"
label-width="112px"
default-width="390px"
:form-ref="rejectRef"
:form-obj="accountForm"
:form-data="formData"
:form-rules="formRules"
></glsx-combi-form>
</div>
</d2-dialog>
</template>
<script>
import { createAccount, updateAccount } from "@api/large"
import { Validator } from "@/common/validator"
export default {
name: "addAccountDialog",
data() {
var checkPhoneObj = {
required: true,
validator: (rule, value, callback) => {
Validator.checkPhoneNumber(value)
? callback()
: callback(new Error("你输入的手机号码不正确,请重新输入"))
},
trigger: "blur"
}
return {
accountForm: {
accountName: "",
accountPhone: "",
accountPhone: "",
ownerShipType: "",
ownerDept: ""
},
dialogConfig: {
title: "提示",
width: "576px",
height: "315px"
},
rejectRef: "rejectRef",
formRules: {
accountName: [
{ required: true, message: "请输入员工姓名", trigger: "blur" }
],
accountPhone: [
{ required: true, message: "请输入手机号码", trigger: "blur" },
checkPhoneObj
],
ownerPost: [{ required: true, message: "请输入岗位", trigger: "blur" }]
},
formData: [
{
label: "员工姓名",
name: "accountName",
type: "input",
width: "300px",
labelWidth: "10px"
},
{
label: "手机号码",
name: "accountPhone",
type: "input",
width: "300px",
maxlength: "11",
labelWidth: "10px"
},
// {
// label: "归属中心",
// name: "ownerShipType",
// type: "select",
// width: "300px",
// optionList: [
// {
// confValue: "总部",
// confId: 0
// },
// {
// confValue: "驻店",
// confId: 1
// }
// ],
// optionId: "confId",
// optionLabel: "confValue",
// isDisabled: true
// },
// {
// label: "归属部门",
// name: "deliveryType",
// type: "select",
// optionList: [],
// optionId: "confId",
// optionLabel: "confName",
// optionsName: "deliveryTypeList"
// },
// {
// label: "归属中心",
// name: "ownerShipType",
// type: "input",
// width: "300px",
// labelWidth: "10px",
// isDisabled: true
// },
// {
// label: "归属部门",
// name: "ownerDept",
// type: "input",
// width: "300px",
// labelWidth: "10px",
// isDisabled: true
// },
{
label: "岗位",
name: "ownerPost",
type: "input",
width: "300px",
labelWidth: "10px"
}
],
baseData: {}
}
},
props: {
visible: {
type: Boolean,
default: false
},
detailInfo: {
type: Object,
default: () => {}
}
},
computed: {
isVisible: {
get() {
return this.visible
},
set(newVal) {}
}
},
watch: {
detailInfo(val) {
if (val) {
this.accountForm = val
}
}
},
mounted() {},
methods: {
handleAddConfirm() {
this.$refs.formRef.$refs[this.rejectRef].validate(async (valid) => {
if (valid) {
let api =
this.detailInfo && this.detailInfo.id
? updateAccount
: createAccount
let params = {
accountName: this.accountForm.accountName,
accountPhone: this.accountForm.accountPhone,
ownerPost: this.accountForm.ownerPost,
ownerShipType: 0,
ownerDept: this.accountForm.ownerDept,
ownerCenter: this.accountForm.ownerCenter,
useStatus: 1
}
if (this.detailInfo && this.detailInfo.id) {
params.id = this.detailInfo.id
params.useStatus = this.detailInfo.useStatus
params.ownerShipType = this.accountForm.ownerShipType
}
api(params).then((res) => {
if (res) {
this.handleClose()
this.notice.okTips("操作成功")
}
})
}
})
},
handleClose() {
this.$emit("dialogClose", false)
}
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin: 21px 0 83px;
::v-deep .el-textarea__inner {
height: 70px;
}
::v-deep .el-input__count {
right: 15px !important;
bottom: 3px !important;
font-size: 12px;
color: #999999;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!