vue2-client 1.8.108 → 1.8.110

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.108",
3
+ "version": "1.8.110",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -250,16 +250,21 @@ export default {
250
250
  type: 'ai-question',
251
251
  content: ''
252
252
  }).then(res => {
253
+ const _questionsLib = []
253
254
  res.forEach(item => {
254
255
  const _item = JSON.parse(item.f_json)
255
256
  if (_item.data && _item.data.length) {
256
257
  if (!this.questionsLib.some(_ => _.uuid === _item.uuid)) {
257
258
  _item.date = formatDate('now')
258
- this.questionsLib.push(_item)
259
+ _questionsLib.push(_item)
259
260
  indexedDB.add('question-lib-' + _item.uuid, _item)
260
261
  }
261
262
  }
262
263
  })
264
+ // _questionsLib 根据问题question文字排序
265
+ _questionsLib.sort((a, b) => a.question.localeCompare(b.question))
266
+ // 把_questionsLib 放到 questionsLib 上面
267
+ this.questionsLib = _questionsLib.concat(this.questionsLib)
263
268
  this.pullQuestionLoading = false
264
269
  }).catch(e => {
265
270
  this.pullQuestionLoading = false
@@ -311,6 +316,10 @@ export default {
311
316
  // 处理sql的单引号
312
317
  content.sql = content.sql.replaceAll(/'/g, "''")
313
318
  }
319
+ if (content.oldSql) {
320
+ // 处理sql的单引号
321
+ content.oldSql = content.oldSql.replaceAll(/'/g, "''")
322
+ }
314
323
  console.log(content)
315
324
  // 保存到数据库中
316
325
  post('/api/af-system/logic/openapi/updateCommonData', {
@@ -50,7 +50,7 @@ import DataTabs from './DataTabs.vue'
50
50
  import { formatDate } from '@vue2-client/utils/util'
51
51
  import QuestionHistoryAndFavorites from './QuestionHistoryAndFavorites.vue'
52
52
  import { post } from '@vue2-client/services/api'
53
- import { indexedDB } from '@vue2-client/utils/indexedDB'
53
+ // import { indexedDB } from '@vue2-client/utils/indexedDB'
54
54
 
55
55
  export default {
56
56
  name: 'DynamicStatistics',
@@ -75,27 +75,30 @@ export default {
75
75
  callback()
76
76
  return
77
77
  }
78
- const that = this
79
- indexedDB.getAll((data) => {
80
- let evaluation = true
81
- for (const datum of data) {
82
- if (datum.key.includes('question') && !datum.key.includes('question-lib')) {
83
- const item = datum.data
84
- console.warn(item)
85
- if (item.evaluation === undefined && item.sql) {
86
- evaluation = false
87
- break
88
- }
89
- }
90
- }
91
- if (evaluation) {
92
- that.handleSearchMain(value, queryType, callback, uuid)
93
- } else {
94
- that.$message.warn('请先对已发起的对话进行评价!')
95
- callback()
96
- return false
97
- }
98
- })
78
+ // 何总说我们自己用 不需要判断有没有评论了
79
+ this.handleSearchMain(value, queryType, callback, uuid)
80
+
81
+ // const that = this
82
+ // indexedDB.getAll((data) => {
83
+ // let evaluation = true
84
+ // for (const datum of data) {
85
+ // if (datum.key.includes('question') && !datum.key.includes('question-lib')) {
86
+ // const item = datum.data
87
+ // console.warn(item)
88
+ // if (item.evaluation === undefined && item.sql) {
89
+ // evaluation = false
90
+ // break
91
+ // }
92
+ // }
93
+ // }
94
+ // // if (evaluation) {
95
+ // that.handleSearchMain(value, queryType, callback, uuid)
96
+ // } else {
97
+ // that.$message.warn('请先对已发起的对话进行评价!')
98
+ // callback()
99
+ // return false
100
+ // }
101
+ // })
99
102
  },
100
103
  handleSearchMain (value, queryType, callback, uuid) {
101
104
  this.loading = true
@@ -110,9 +113,9 @@ export default {
110
113
  isFavorite: false,
111
114
  date: formatDate('now')
112
115
  })
113
- let url = '/ai/question/'
116
+ let url = '/ai/question'
114
117
  if (queryType !== 'all') {
115
- url = url + queryType + '/'
118
+ url = '/' + url + queryType + '/'
116
119
  }
117
120
  post(url, {
118
121
  messages: [{