220 lines
9.1 KiB
Plaintext
220 lines
9.1 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Пример POST-запроса</title>
|
|
<script src="./vue.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="../metadata/dbms/dbms.css"/>
|
|
</head>
|
|
<body>
|
|
|
|
<table class="SEdit" id="app0" border="0px" cellspacing="1" cellpadding="1" style="width: 100%; height: 100%;">
|
|
<caption><b id="caption'+this.uid+'"></b></caption>
|
|
<thead>
|
|
<tr style="background-color:#dadada;">
|
|
<th style="width:20%">trt('Name')</th>
|
|
<th style="width:80%">trt('Value')</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr style="background-color:#dadada;">
|
|
<td style="width:20%">trt('Name')</td>
|
|
<td style="width:80%">trt('Value')</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
<div id="app" style="border: 2px solid;">
|
|
<h1>{{ type.d }}</h1>
|
|
<div v-for="(column,index) in type.edit_object.columns">
|
|
<div v-if="column.vt=='i4'" :style="{ backgroundColor: index % 2 === 0 ? 'var(--row-color-1)' : 'var(--row-color-2)' }">
|
|
<div style="width:150px;display:inline-block;">{{column.d}}</div>
|
|
<input type="text" v-model="column.value">
|
|
<input type="button" class="button-secondary" style="width:22px;margin:0px;padding:0px;" v-on:click="column.value += 1" value="+" title="trt('Increase_by_1')">
|
|
<input type="button" class="button-secondary" style="width:22px;margin:0px;padding:0px;" v-on:click="column.value -= 1" value="-" title="trt('Decrease_by_1')">
|
|
</div>
|
|
<div v-if="column.vt=='object'" :style="{ backgroundColor: index % 2 === 0 ? 'var(--row-color-1)' : 'var(--row-color-2)' }">
|
|
<div style="width:150px;display:inline-block;">{{column.d}}</div>
|
|
<input type="text">
|
|
</div>
|
|
<div v-if="column.vt=='string'" :style="{ backgroundColor: index % 2 === 0 ? 'var(--row-color-1)' : 'var(--row-color-2)' }">
|
|
<div style="width:150px;display:inline-block;">{{column.d}}</div>
|
|
<input type="text">
|
|
</div>
|
|
</div>
|
|
<div style="display: flex; justify-content: space-between;">
|
|
<div>
|
|
<label><input type="checkbox">trt('Repeat_the_addition_of_the_entry')</label>
|
|
</div>
|
|
<div>
|
|
<div style="display: inline-block;">
|
|
<input type="button" class="button-secondary" value="trt('Apply')">
|
|
<input type="button" class="button-secondary" value="trt('Cancel')">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
if (rpos%2==0) bgColor='var(--row-color-1)'; else bgColor='var(--row-color-2)';
|
|
|
|
<script>
|
|
/*
|
|
<type n="Terminals" d="trt('Terminal')" ObjectID="id">
|
|
<properties>
|
|
<prop d="id" n="id" vt="i4" visible="0"/>
|
|
<prop d="trt('Company')" n="company_id" vt="object" maybenull="0" ot="Companies" FieldCaption="name" selector="combo"/>
|
|
<prop d="trt('Phone')" n="phone" vt="string" size="20"/>
|
|
<prop d="trt('Serial_number')" n="serial" vt="string" size="50"/>
|
|
<prop d="IMEI" n="imei" vt="string" size="50" maybenull="0"/>
|
|
<prop d="trt('Terminal model')" n="terminal_model_id" vt="object" maybenull="0" ot="TerminalsModels" FieldCaption="name" selector="combo"/>
|
|
<prop d="trt('Description')" n="description" vt="text" size="500"/>
|
|
<sql-query t="i">
|
|
<![CDATA[select * from main.p_Terminals_i(${_user_id},${company_id},${phone},${serial},${imei},${terminal_model_id},${description});]]>
|
|
</sql-query>
|
|
<sql-query t="u">
|
|
<![CDATA[select * from main.p_Terminals_u(${_user_id},${id},${company_id},${phone},${serial},${imei},${terminal_model_id},${description});]]>
|
|
</sql-query>
|
|
<sql-query t="d">
|
|
<![CDATA[select * from main.p_Terminals_d(${_user_id},${id});]]>
|
|
</sql-query>
|
|
<sql-query t="s">
|
|
<![CDATA[select * from main.p_Terminals_s(${_user_id},${id},0,NULL);]]>
|
|
</sql-query>
|
|
</properties>
|
|
<objects-list d="trt('Terminals')" width="1000">
|
|
<sql-query>
|
|
<![CDATA[
|
|
select * from main.p_terminals_ss(${_user_id},${id},${company_id},${terminal_id},${install},${imei},${serial});
|
|
]]>
|
|
</sql-query>
|
|
<filter height="1">
|
|
<column d="id" n="id" vt="string" visible="0"/>
|
|
<column d="trt('Company')" n="company_id" vt="object" object="Companies" FieldCaption="name" selector="combo"/>
|
|
<column d="terminal_id" n="terminal_id" vt="i4" visible="0"/>
|
|
<column d="trt('Installed')" n="install" vt="b"/>
|
|
<column d="trt('IMEI')" n="imei" vt="string"/>
|
|
<column d="trt('Serial_number')" n="serial" vt="string"/>
|
|
</filter>
|
|
<column d="trt('Terminal_model')" n="terminal_model_name" width="150"/>
|
|
<column d="trt('Company')" n="campany_name" width="150"/>
|
|
<column d="trt('Installed_on')" n="object_name" width="150"/>
|
|
<column d="trt('Phone')" n="phone" width="150"/>
|
|
<column d="trt('Serial_number')" n="serial" width="120"/>
|
|
<column d="IMEI" n="imei" width="300"/>
|
|
<column d="trt('Description')" n="description" width="300"/>
|
|
<column d="trt('Count_sensors')" n="tscnt" width="120">
|
|
<type n="TerminalsSensors">
|
|
<objects-list d="trt('Sensors_types')">
|
|
<filter height="1">
|
|
<column n="terminal_id"><![CDATA[${id}]]>
|
|
</column>
|
|
</filter>
|
|
</objects-list>
|
|
</type>
|
|
</column>
|
|
<column d="Настройки" n="tstcnt" width="120">
|
|
<type n="TerminalsSettings">
|
|
<objects-list>
|
|
<filter>
|
|
<column n="terminal_id"><![CDATA[${id}]]>
|
|
</column>
|
|
</filter>
|
|
</objects-list>
|
|
</type>
|
|
</column>
|
|
</objects-list>
|
|
</type>
|
|
*/
|
|
let str= `
|
|
{
|
|
"type":{
|
|
"n":"Terminals",
|
|
"d":"trt('Terminal')",
|
|
"ObjectID":"id",
|
|
"edit_object":{
|
|
"columns":[
|
|
{"d":"id", "n":"id", "vt":"i4", "visible":"0", "value":6},
|
|
{"d":"trt('Company')", "n":"company_id", "vt":"object", "maybenull":"0", "ot":"Companies", "FieldCaption":"name", "selector":"combo"},
|
|
{"d":"trt('Phone')", "n":"phone", "vt":"string", "size":"20"},
|
|
{"d":"trt('Serial_number')", "n":"serial", "vt":"string", "size":"50"},
|
|
{"d":"IMEI", "n":"imei", "vt":"string", "size":"50", "maybenull":"0"},
|
|
{"d":"trt('Terminal model')", "n":"terminal_model_id", "vt":"object", "maybenull":"0", "ot":"TerminalsModels", "FieldCaption":"name", "selector":"combo"},
|
|
{"d":"trt('Description')", "n":"description", "vt":"text", "size":"500"}
|
|
],
|
|
"insert_query":"",
|
|
"update_query":"",
|
|
"delete_query":"",
|
|
"select_query":""
|
|
},
|
|
"show-object":{
|
|
"d":"trt('Terminals')",
|
|
"width":"1000",
|
|
"sql-query":"",
|
|
"filter":{
|
|
"columns":[
|
|
{"d":"id","n":"id","vt":"string","visible":"0"},
|
|
{"d":"trt('Company')","n":"company_id","vt":"object","object":"Companies","FieldCaption":"name","selector":"combo"},
|
|
{"d":"terminal_id","n":"terminal_id","vt":"i4","visible":"0"},
|
|
{"d":"trt('Installed')","n":"install","vt":"b"},
|
|
{"d":"trt('IMEI')","n":"imei","vt":"string"},
|
|
{"d":"trt('Serial_number')","n":"serial","vt":"string"}
|
|
]
|
|
},
|
|
"columns":[
|
|
{"d":"trt('Terminal_model')", "n":"terminal_model_name", "width":"150"},
|
|
{"d":"trt('Company')", "n":"campany_name", "width":"150"},
|
|
{"d":"trt('Installed_on')", "n":"object_name", "width":"150"},
|
|
{"d":"trt('Phone')", "n":"phone", "width":"150"},
|
|
{"d":"trt('Serial_number')", "n":"serial", "width":"120"},
|
|
{"d":"IMEI", "n":"imei", "width":"300"},
|
|
{"d":"trt('Description')", "n":"description", "width":"300"},
|
|
{"d":"trt('Count_sensors')", "n":"tscnt", "width":"120",
|
|
"type":{
|
|
"n":"TerminalsSensors",
|
|
"show-object":{
|
|
"d":"trt('Sensors_types')",
|
|
"filter":{
|
|
"height":"1",
|
|
"columns":[
|
|
{
|
|
"n":"terminal_id",
|
|
"data":""
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{"d":"Настройки", "n":"tstcnt", "width":"120",
|
|
"type":{
|
|
"n":"TerminalsSettings",
|
|
"show-object":{
|
|
"filter":{
|
|
"columns":[
|
|
{
|
|
"n":"terminal_id",
|
|
"data":""
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
var myObject = new Vue({
|
|
el: '#app',
|
|
data: JSON.parse(str)
|
|
});
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html>
|