ВЬЮ.js

This commit is contained in:
2020-12-08 11:20:16 +06:00
parent 27d49bf102
commit c19e513a5e
5 changed files with 3113 additions and 40 deletions

3
metadata/axios.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -85,8 +85,8 @@ class EdtRec
//Задать CDATA значение для узла "type->properties->prop" по "n"
setPropCdata(name,value)
{
var nodeProperties=findNodeOnPath(this.nodeMetadata, 'type/properties');
var nodeProp=nodeProperties.firstChild;
let nodeProperties=findNodeOnPath(this.nodeMetadata, 'type/properties');
let nodeProp=nodeProperties.firstChild;
while(nodeProp!=null)
{
if(nodeProp.nodeName=="prop")
@ -889,15 +889,14 @@ class EdtRec
//The result can fill the filter field with complete information or display a window with a further selection of the value.
selObj(typeName,propname)
{
var win=new TWin();
let win=new TWin();
win.BuildGUI(pageX-10,pageY-10);
var str='';
str+='<table id="thetable'+win+'" bgcolor="SlateGrey" style="border: 1px solid rgb(99, 99, 99);" width="100%">';
str+=' <caption></caption>';
str+=' <thead><tr><th></th></tr></thead>';
str+=' <tbody><tr><td></td></tr></tbody>';
str+='</table>';
let str=`
<table id="thetable`+win+`" bgcolor="SlateGrey" style="border: 1px solid rgb(99, 99, 99);" width="100%">
<caption></caption>
<thead><tr><th></th></tr></thead>
<tbody><tr><td></td></tr></tbody>
</table>`;
win.setContent(str);
};
@ -924,9 +923,9 @@ class EdtRec
//Call the ShowRecord.html window with the parameters for the filter (not just the object name).
callWindow(nodeProp)
{
var xmlString="";
var TypeName="";
var nT=findNode(nodeProp, "type");
let xmlString="";
let TypeName="";
let nT=findNode(nodeProp, "type");
if(nT!=null)
{
xmlString=getXMLNodeSerialisation(nT);
@ -938,11 +937,11 @@ class EdtRec
//Write to XML string from GUI
while(true)
{
var sub1=BeforeFirst(xmlString,"${");
let sub1=BeforeFirst(xmlString,"${");
if(sub1==null) break;
var sub2=AfterFirst(xmlString,"}");
let sub2=AfterFirst(xmlString,"}");
if(sub2==null) break;
var val=BeforeFirst(AfterFirst(xmlString,"${"),"}");
let val=BeforeFirst(AfterFirst(xmlString,"${"),"}");
let obj=document.getElementById("prop_"+this.uid+"_"+val);
if(obj!=null){
@ -952,7 +951,7 @@ class EdtRec
}
}
var rec=new SRec();
let rec=new SRec();
rec.create();
rec.f_Settings=xmlString;
rec.f_TypeName=TypeName;
@ -1031,14 +1030,14 @@ class EdtRec
//Function to populate the drop-down lists
setDataSelect(node)
{
var prop_name,prop,option,nodeProp,id,value,cdataNode;
var nodeType=findFirstNode(node, 'type');
let prop_name,prop,option,nodeProp,id,value,cdataNode;
let nodeType=findFirstNode(node, 'type');
prop_name=nodeType.getAttribute("pn"); //field name
prop=document.getElementById("prop_"+this.uid+"_"+prop_name);
var selector=null; //find what kind of object object
var nodeFilter=findFirstNode(this.nodeMetadata, 'properties');
var nodeCur=nodeFilter.firstChild;
let selector=null; //find what kind of object object
let nodeFilter=findFirstNode(this.nodeMetadata, 'properties');
let nodeCur=nodeFilter.firstChild;
while(nodeCur!=null)
{
if((nodeCur.nodeName=="prop")&&(nodeCur.getAttribute("n")==prop_name))
@ -1055,7 +1054,7 @@ class EdtRec
//in the full can be that the list has arrived after the arrival of all data and therefore the drop-down list must be set to the desired value here
//select the value for this list
let val=null;
var nodeProperties=findFirstNode(this.nodeMetadata, 'properties');
let nodeProperties=findFirstNode(this.nodeMetadata, 'properties');
nodeProp=nodeProperties.firstChild;
while(nodeProp!=null)
{
@ -1544,15 +1543,15 @@ class TCheckboxListField
};
// Set checked values divide ";"
setValue(val) {
var splits;
let splits;
if(val.indexOf(';')==-1)
splits = val.split('');
else
splits = val.split(';');
for(var j=0;j<splits.length;j++)
for(let j=0;j<splits.length;j++)
{
for(var i=0;i<this.array.length;i++)
for(let i=0;i<this.array.length;i++)
{
if(this.array[i].value==splits[j])
{

View File

@ -238,9 +238,11 @@
{
$doc = new DOMDocument();
try
{ $doc->loadXML(file_get_contents("php://input"));
{
$doc->loadXML($HTTP_INPUT);
} catch (Exception $e)
{ sendError($e->getMessage());
{
sendError($e->getMessage());
}
$reqNode = $doc->documentElement;
@ -250,8 +252,6 @@
}
}
//error_log($HTTP_INPUT);
//описание
//(fn==0) - отправить метаданные клиенту по запрошенному узлу
//(fn==1) - вставить одну запись в базу данных (результат id записи)
@ -607,13 +607,8 @@
$f2=findNodeOnPath($nTypeR,'objects-list/filter');
setFilter($f1,$f2);//заменить все значения первого фильтра значениями из второго
//+++++++
//$objXMLDocument->saveXML($currNode)
$sql_query=getCdataValue(findNodeOnPath($currNode, "objects-list/sql-query"));
//sendError($sql_query);
if($f1!=null)
{
$nextnode=$f1->firstChild;
@ -705,7 +700,10 @@
if(!array_key_exists("_u",$row)) { $access.="u"; } else { $access.=$row["_u"]; }
if(!array_key_exists("_d",$row)) { $access.="d"; } else { $access.=$row["_d"]; }
$xmlstring.=' <record id="'.$row[$currNode->getAttribute("ObjectID")].'" a="'.$access.'">';
if(array_key_exists($currNode->getAttribute("ObjectID"),$row))
$xmlstring.=' <record id="'.$row[$currNode->getAttribute("ObjectID")].'" a="'.$access.'">';
else
$xmlstring.=' <record id="" a="'.$access.'">';
$nextnode=findNode($currNode,'objects-list')->firstChild;
while ($nextnode)
{

View File

@ -42,4 +42,3 @@
{
echo 'error';
}
?>

3074
metadata/vue-router.js Normal file

File diff suppressed because it is too large Load Diff