Merge branch release/21.7.8 of zentao/zentaopms (#13019)
This commit is contained in:
@@ -216,7 +216,7 @@ class zai extends control
|
||||
|
||||
if(empty($userPrompt) || empty($filters)) return $this->send(array('result' => 'failed', 'message' => $this->lang->fail));
|
||||
|
||||
$knowledges = $this->zai->searchKnowledgesInCollections($userPrompt, $filters, $type, $limit, 0.7);
|
||||
$knowledges = $this->zai->searchKnowledgesInCollections($userPrompt, $filters, $type, $limit, 0.5);
|
||||
$results = [];
|
||||
foreach($knowledges as $knowledge)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@ class VectorizedPanel extends zui.Component
|
||||
this.syncingTimer = 0;
|
||||
this.progressBarWidth = 700;
|
||||
this.waitTime = 0;
|
||||
this.syncCouter = 0;
|
||||
|
||||
let store = null;
|
||||
if(window !== window.parent)
|
||||
@@ -162,8 +163,12 @@ class VectorizedPanel extends zui.Component
|
||||
|
||||
async syncNext(data)
|
||||
{
|
||||
this.syncCouter++;
|
||||
const result = await this.post(['zai', 'ajaxSyncVectorization'], data);
|
||||
await zui.delay(result.data.lastSync ? (result.data.lastSync.time * 2) : 100);
|
||||
let waitTime = result.data.lastSync ? (result.data.lastSync.time * 3) : 100;
|
||||
if(this.syncCouter % 200 === 0) waitTime += 2000;
|
||||
if(this.syncCouter % 1000 === 0) waitTime += 2000;
|
||||
await zui.delay(waitTime);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -49,7 +49,8 @@ function getPromptFormConfig(fields, extraConfig)
|
||||
if(!Array.isArray(fields) || !fields.length) return;
|
||||
const typeMap = {radio: 'picker', checkbox: 'multiPicker', text: 'input'};
|
||||
const required = [];
|
||||
const properties = fields.reduce((properties, field, index) => {
|
||||
const properties = fields.reduce((properties, field, index) =>
|
||||
{
|
||||
field.code = `field-${field.id}`;
|
||||
properties[field.code] = {
|
||||
type : 'string',
|
||||
@@ -139,6 +140,7 @@ window.executeZentaoPrompt = async function(info, testingMode)
|
||||
if(isChange && originObject)
|
||||
{
|
||||
const renderProp = (prop, value) => {
|
||||
if(propNames[prop] === undefined) return null;
|
||||
let oldValue = originObject[prop];
|
||||
if(oldValue === undefined || oldValue === null) oldValue = '';
|
||||
if(value === undefined || value === null) value = '';
|
||||
@@ -146,8 +148,8 @@ window.executeZentaoPrompt = async function(info, testingMode)
|
||||
value = typeof value === 'string' ? value : JSON.stringify(value);
|
||||
oldValue = typeof oldValue === 'string' ? oldValue : JSON.stringify(oldValue);
|
||||
const isSame = oldValue === value;
|
||||
return h`<tr class="whitespace-pre-wrap">
|
||||
<td class='font-bold'>${propNames[prop] || prop}</td>
|
||||
return h`<tr class="whitespace-pre-wrap" key=${prop}>
|
||||
<td class='font-bold'>${propNames[prop]}</td>
|
||||
<td>${isSame ? renderValue(value) : (oldValue.length ? h`<div class="htmldiff article whitespace-prewrap" dangerouslySetInnerHTML=${{__html: htmlDiff(oldValue, value)}}></div>` : h`<div class="htmldiff article whitespace-prewrap"><ins data-operation-index="0">${value}</ins></div>`)}</td>
|
||||
</tr>`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user