king
2025-02-14 32431a7ce3f9a642ec988cf21bcda8935070ddd2
2025-02-14
5个文件已修改
151 ■■■■ 已修改文件
src/menu/debug/index.jsx 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/actionList/normalbutton/index.jsx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mkai/index.jsx 112 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mkai/index.scss 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/debug/index.jsx
@@ -1762,6 +1762,7 @@
    _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
  }
@@ -2028,6 +2029,8 @@
        aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
    }
    sql = sql.replace(/\$check@|@check\$/ig, '')
    return sql
  }
src/tabviews/zshare/actionList/normalbutton/index.jsx
@@ -1123,20 +1123,22 @@
        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(
src/templates/zshare/verifycard/index.jsx
@@ -1740,6 +1740,7 @@
    _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
  }
src/views/mkai/index.jsx
@@ -1,8 +1,9 @@
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'
@@ -78,6 +79,7 @@
    LoginUID: '',
    textInput: '',
    type: 'deepseek-chat', // deepseek-chat deepseek-reasoner
    currentChat: {uuid: Utils.getuuid(), list: [], title: ''}
  }
  UNSAFE_componentWillMount() {
@@ -135,13 +137,15 @@
          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()
  }
@@ -157,35 +161,101 @@
  }
  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)
@@ -201,7 +271,7 @@
          <div className="mk-right">
            <div className="mk-faad">
              <div className="title">
                <span>标题</span>
                <span>{currentChat.title}</span>
              </div>
            </div>
            <div className="mk-ksje">
src/views/mkai/index.scss
@@ -356,7 +356,7 @@
                    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;
@@ -365,6 +365,9 @@
                    justify-content: center;
                    display: flex;
                  }
                  .ds-icon:not(.disabled):hover {
                    background: var(--mk-sys-color);
                  }
                  .ds-icon.disabled {
                    background: var(--mk-sys-color4);