| | |
| | | _sql = _sql.replace(/@BID@/ig, `'${BID}'`) |
| | | _sql = _sql.replace(/@typename@/ig, `'typename'`) |
| | | _sql = _sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) |
| | | _sql = _sql.replace(/\$check@|@check\$/ig, '') |
| | | |
| | | return _sql |
| | | } |
| | |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | } |
| | | |
| | | sql = sql.replace(/\$check@|@check\$/ig, '') |
| | | |
| | | return sql |
| | | } |
| | | |
| | |
| | | let works_flow_sign_field = 'statuscharone' |
| | | let works_flow_sign_label = '' |
| | | let works_begin_branch = '' |
| | | if (line.approvalMethod === 'countersign' && node.checkIds.length > 1) { |
| | | works_flow_countersign = 'Y' |
| | | let mark = line.mark || '已审核' |
| | | let fields = ['statuscharone', 'statuschartwo', 'statuscharthree', 'statuscharfour', 'statuscharfive'] |
| | | node.checkUsers.forEach((user, index) => { |
| | | if (user.worker_id === userid) { |
| | | works_flow_sign_field = fields[index] |
| | | works_flow_sign_label = `${user.parentNames[2] || ''}${user.workername || ''}${mark}` |
| | | } else { |
| | | works_flow_sign_values += `${user.parentNames[2] || ''}${user.workername || ''}${mark}` |
| | | } |
| | | }) |
| | | } else { |
| | | works_begin_branch = line.mknode === 'startEdge' ? 'Y' : '' |
| | | if (line) { |
| | | if (line.approvalMethod === 'countersign' && node.checkIds.length > 1) { |
| | | works_flow_countersign = 'Y' |
| | | let mark = line.mark || '已审核' |
| | | let fields = ['statuscharone', 'statuschartwo', 'statuscharthree', 'statuscharfour', 'statuscharfive'] |
| | | node.checkUsers.forEach((user, index) => { |
| | | if (user.worker_id === userid) { |
| | | works_flow_sign_field = fields[index] |
| | | works_flow_sign_label = `${user.parentNames[2] || ''}${user.workername || ''}${mark}` |
| | | } else { |
| | | works_flow_sign_values += `${user.parentNames[2] || ''}${user.workername || ''}${mark}` |
| | | } |
| | | }) |
| | | } else { |
| | | works_begin_branch = line.mknode === 'startEdge' ? 'Y' : '' |
| | | } |
| | | } |
| | | |
| | | exps.push( |
| | |
| | | _sql = _sql.replace(/@BID@/ig, `'${BID}'`) |
| | | _sql = _sql.replace(/@typename@/ig, `'typename'`) |
| | | _sql = _sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) |
| | | _sql = _sql.replace(/\$check@|@check\$/ig, '') |
| | | |
| | | return _sql |
| | | } |
| | |
| | | import React, { Component, useState } from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { Spin, notification, Tooltip, Input } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | // import Utils from '@/utils/utils.js' |
| | | import Utils from '@/utils/utils.js' |
| | | |
| | | import avatar from '@/assets/img/avatar.jpg' |
| | | import './index.scss' |
| | |
| | | LoginUID: '', |
| | | textInput: '', |
| | | type: 'deepseek-chat', // deepseek-chat deepseek-reasoner |
| | | currentChat: {uuid: Utils.getuuid(), list: [], title: ''} |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | |
| | | this.setState({ |
| | | chats: result.data || [] |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | newContent = () => { |
| | | this.setState({textInput: ''}) |
| | | this.setState({textInput: '', currentChat: {uuid: Utils.getuuid(), list: [], title: ''}}) |
| | | let node = document.getElementById('mk-input') |
| | | node && node.focus() |
| | | } |
| | |
| | | } |
| | | |
| | | submit = () => { |
| | | const { textInput } = this.state |
| | | const { textInput, currentChat, UserID, LoginUID } = this.state |
| | | |
| | | let val = textInput.replace(/\t+|\v+/g, '').replace(/^\s+|\s+$/g, '') |
| | | |
| | | if (!val) return |
| | | if (!val || currentChat.loading) return |
| | | |
| | | let node = document.getElementById('mk-input') |
| | | node && node.blur() |
| | | |
| | | this.setState({textInput: ''}) |
| | | let chat = fromJS(currentChat).toJS() |
| | | chat.list.push({ role: 'user', content: val }) |
| | | chat.list.push({ role: 'assistant', content: '', loading: true }) |
| | | |
| | | // Api.directRequest({ |
| | | // url: burl + '/chat/completions', |
| | | // method: 'post', |
| | | // headers: { 'Content-Type': 'application/json' }, |
| | | // data: { |
| | | // model: this.state.type, |
| | | // messages: [ |
| | | // { role: 'user', content: val } |
| | | // ], |
| | | // stream: false |
| | | // } |
| | | // }).then(result => { |
| | | if (!chat.title) { |
| | | chat.title = val.substr(0, 32) |
| | | } |
| | | chat.loading = true |
| | | |
| | | // }) |
| | | this.setState({textInput: '', currentChat: chat}) |
| | | |
| | | Api.directRequest({ |
| | | url: burl + '/chat/completions', |
| | | method: 'post', |
| | | headers: { 'Content-Type': 'application/json' }, |
| | | data: { |
| | | model: this.state.type, |
| | | messages: chat.list, |
| | | stream: false |
| | | } |
| | | }).then(res => { |
| | | let _chat = fromJS(chat).toJS() |
| | | |
| | | delete _chat.loading |
| | | _chat.list.shift() |
| | | |
| | | let _val = '服务器繁忙,请稍后再试。' |
| | | if (res.success && res.choices && res.choices[0]) { |
| | | _val = res.choices[0].message.content |
| | | } |
| | | |
| | | _chat.list = _chat.list.map(item => { |
| | | delete item.step |
| | | return item |
| | | }) |
| | | |
| | | _chat.list.push({ role: 'assistant', content: _val, step: true }) |
| | | |
| | | this.setState({currentChat: _chat}) |
| | | |
| | | Api.genericInterface({ |
| | | func: 's_deepseek_ai', |
| | | rduri: burl + '/webapi/dostars', |
| | | file_url: '', |
| | | userid: UserID, |
| | | LoginUID: LoginUID, |
| | | u_id: sessionStorage.getItem('UserID'), |
| | | content: window.btoa(window.encodeURIComponent(_val)), |
| | | title: window.btoa(window.encodeURIComponent(chat.title)), |
| | | data_type: 'reply', |
| | | ID: chat.uuid |
| | | }).then(r => { |
| | | if (!r.status) { |
| | | notification.error({ |
| | | top: 92, |
| | | message: r.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | Api.genericInterface({ |
| | | func: 's_deepseek_ai', |
| | | rduri: burl + '/webapi/dostars', |
| | | file_url: '', |
| | | userid: UserID, |
| | | LoginUID: LoginUID, |
| | | u_id: sessionStorage.getItem('UserID'), |
| | | content: window.btoa(window.encodeURIComponent(val)), |
| | | title: window.btoa(window.encodeURIComponent(chat.title)), |
| | | data_type: 'request', |
| | | ID: chat.uuid |
| | | }).then(result => { |
| | | if (!result.status) { |
| | | notification.error({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { loading, textInput, type } = this.state |
| | | const { loading, textInput, type, currentChat } = this.state |
| | | |
| | | let able = textInput && !/^\s+$/.test(textInput) |
| | | |
| | |
| | | <div className="mk-right"> |
| | | <div className="mk-faad"> |
| | | <div className="title"> |
| | | <span>标题</span> |
| | | <span>{currentChat.title}</span> |
| | | </div> |
| | | </div> |
| | | <div className="mk-ksje"> |
| | |
| | | white-space: nowrap; |
| | | cursor: pointer; |
| | | color: #fff; |
| | | background: var(--mk-sys-color); |
| | | background: var(--mk-sys-color5); |
| | | border: none; |
| | | border-radius: 16px; |
| | | min-width: 32px; |
| | |
| | | justify-content: center; |
| | | display: flex; |
| | | } |
| | | .ds-icon:not(.disabled):hover { |
| | | background: var(--mk-sys-color); |
| | | } |
| | | |
| | | .ds-icon.disabled { |
| | | background: var(--mk-sys-color4); |