This commit is contained in:
众产-王坤 2025-08-10 10:40:14 +08:00
commit ea3d56e9da
7 changed files with 24 additions and 72 deletions

View File

@ -906,6 +906,7 @@ data;
data;
}
$codex .= <<<data
</script>
</body>

View File

@ -77,7 +77,7 @@ function code_pc_php($post) {
$codex .= "\n";
$codex .= "\nclass {$classname} {";
$codex .= "\n static function setwhere(\$db, \$post, \$rsuser) {";
$codex .= "\n \$query = \$post->get('query');";
$codex .= "\n \$query = \$post->get('query', array());";
$codex .= "\n \$csql = new \ciy\sql('{$tabname}');";
if (!empty($liiddict)) {
$codex .= "\n \$liid = objint(\$query, 'liid');";

View File

@ -248,6 +248,8 @@ _ciydomclas.prototype.attr = function (name, value) {
if (!this[0] || !iselement(this[0]))
return null;
if (value === undefined) {
if (name in this[0])
return this[0][name];
var val = this[0].getAttribute(name);
if (val === null)
return null;
@ -262,7 +264,9 @@ _ciydomclas.prototype.attr = function (name, value) {
this.each(function (dom) {
if (value === null)
return dom.removeAttribute(name);
if (typeof (value) == 'string' || typeof (value) == 'number')
if (name in dom)
return dom[name] = value;
if (typeof (value) == 'string' || typeof (value) == 'number' || typeof (value) == 'boolean')
return dom.setAttribute(name, value);
dom.setAttribute(name, ciyfn.jsontostr({ v: value }));
});
@ -1316,7 +1320,8 @@ ciyfn.makeuploadpath = function (mpath, saas) {
}
ciyfn.ccode = function (arr, value, field, nonestr) {
field = field || 'name';
nonestr = nonestr || '--';
if (typeof (nonestr) === 'undefined')
nonestr = '--';
arr = ciyfn.getdictdata(arr);
if (typeof (arr) != 'object')
return '!';
@ -1333,7 +1338,7 @@ ciyfn.ccode = function (arr, value, field, nonestr) {
}
if (field == '_obj')
return null;
if (value < 1)
if (!value)
return nonestr;
return '';
}

View File

@ -994,8 +994,8 @@ ciycmpfunc.ciyselect = function (opn) {
this.range.unshift({ id: '', name: opn.all + '', _nofilter: true });
}
if (ciyfn.topinyin) {
for (var i in thos.range)
thos.range[i]._py = ciyfn.topinyin(thos.range[i].name);
for (var i in this.range)
this.range[i]._py = ciyfn.topinyin(this.range[i].name);
}
if (this.value !== undefined)
this.setvalue();

View File

@ -833,7 +833,7 @@ ciyfn.fillsearch = function (opn) {
html += '<input type="text" sechr="' + name + '_1" name="' + name + '_1"' + prop + '/> - <input type="text" sechr="' + name + '_2" name="' + name + '_2"' + prop + '/>';
else if (sp.type == 'select' || sp.type == 'radio') {
if (sp.type == 'select')
html += '<ciy-select sechr="' + name + '" com="' + name + '" value="' + val + '"' + prop + '></ciy-switch>';
html += '<ciy-select sechr="' + name + '" com="' + name + '" value="' + val + '"' + prop + '></ciy-select>';
if (sp.type == 'radio')
html += '<ciy-radio sechr="' + name + '" com="' + name + '" value="' + val + '"' + prop + '></ciy-radio>';
sp.def = sp.def || '';

View File

@ -1510,6 +1510,7 @@ textarea[disabled], select[disabled], input[disabled], input[disabled]+i, .btn.d
display: inline-block;
flex: 1;
vertical-align: top;
min-width: 0;
}
.ciy-form>label {
@ -2338,6 +2339,10 @@ fieldset.tips>div>ul>li {
font-size: 1.5em;
}
.txt-lgggg.txt-lgggg.txt-lgggg {
font-size: 2em;
}
.txt-wb.txt-wb.txt-wb {
font-weight: bold;
}
@ -2547,10 +2552,12 @@ fieldset.tips>div>ul>li {
.flex1.flex1.flex1 {
flex: 1;
min-width: 0;
}
.flexnone.flexnone.flexnone {
flex: none;
min-width: 0;
}
.flex-center.flex-center.flex-center {

View File

@ -333,7 +333,7 @@ class http {
$this->response = curl_exec($ch);
if ($this->response === false) {
$this->response_info['http_code'] = 204;
$this->response_data = 'URL: ' . $url . ' error: ' . curl_error($ch) . ' (' . curl_errno($ch) . ')';
$this->response_data = 'error: ' . curl_error($ch) . ' (' . curl_errno($ch) . ')URL: ' . $url;
return false;
}
$this->response_info = curl_getinfo($ch);
@ -466,25 +466,14 @@ class http {
curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookiefile);
}
if (!empty($this->request_referer))
curl_setopt($ch, CURLOPT_REFERER, $this->request_referer);
$headers = array_merge($this->request_headeronce, $this->request_headerfixed);
if ($headers)
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$this->request_headeronce = array();
if ($this->request_proxy) {
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
$host = $this->request_proxy['host'];
$host .= ($this->request_proxy['port']) ? ':' . $this->request_proxy['port'] : '';
curl_setopt($ch, CURLOPT_PROXY, $host);
if (isset($this->request_proxy['user']) && isset($this->request_proxy['pass'])) {
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->request_proxy['user'] . ':' . $this->request_proxy['pass']);
}
}
$this->response = curl_exec($ch);
if ($this->response === false) {
$this->response_info['http_code'] = 204;
$this->response_data = 'URL: ' . $url . ' error: ' . curl_error($ch) . ' (' . curl_errno($ch) . ')';
$this->response_data = 'error: ' . curl_error($ch) . ' (' . curl_errno($ch) . ')URL: ' . $url;
return false;
}
$this->response_info = curl_getinfo($ch);
@ -502,64 +491,14 @@ class http {
$this->response_header = array_pop($this->response_header);
$this->response_header = explode("\r\n", $this->response_header);
array_shift($this->response_header); //去掉第一行
$purl = null;
$header_assoc = array();
foreach ($this->response_header as $header) {
$kv = explode(': ', $header, 2);
if (strtolower($kv[0]) == 'set-cookie') {
$header_assoc['Set-Cookie'][] = $kv[1];
if (empty($this->cookiefile)) {
$cookieinfo = explode(';', $kv[1]);
//list($name, $value) = explode('=', array_shift($cookieinfo), 2);
$cookname = array_shift($cookieinfo);
$ind = strpos($cookname, '=');
if ($ind === false)
continue;
$cook = array();
$cook['value'] = substr($cookname, $ind + 1);
$cook['name'] = trim(substr($cookname, 0, $ind));
foreach ($cookieinfo as $key) {
$ind = strpos($key, '=');
if ($ind !== false) {
$val = substr($key, $ind + 1);
$key = strtolower(trim(substr($key, 0, $ind)));
}
if ($key == 'expires') {
$cook['expires'] = time($val);
if ($cook['expires'] < time())
$cook['value'] = 'deleted';
} else if ($key == 'path')
$cook['path'] = $val;
else if ($key == 'domain')
$cook['domain'] = $val;
}
if ($purl === null) {
$purl = parse_url($this->response_info['url']);
$doamin = $purl['host'];
if (isset($purl['path']))
$path = $purl['path'];
else
$path = '/';
}
if (!isset($cook['expires']))
$cook['expires'] = 2114352000;
if (!isset($cook['domain']))
$cook['domain'] = $doamin;
if (!isset($cook['path']))
$cook['path'] = '/';
$this->set_cookie($cook);
}
continue;
}
$header_assoc[$kv[0]] = $kv[1];
}
$this->response_header = $header_assoc;
curl_close($ch);
$httpcode = toint($this->response_info['http_code']);
if ($httpcode >= 300 && $httpcode < 400) {
if ($this->response_info['redirect_url']) {
$url = $this->response_info['redirect_url'];
$postdata = '';
continue;
}
}
@ -594,7 +533,7 @@ class http {
if ($response === false) {
clog(curl_error($ch) . ' (' . curl_errno($ch) . ')');
$this->response_info['http_code'] = 204;
$this->response_data = 'URL: ' . $url . ' error: ' . curl_error($ch) . ' (' . curl_errno($ch) . ')';
$this->response_data = 'error: ' . curl_error($ch) . ' (' . curl_errno($ch) . ')URL: ' . $url;
curl_close($ch);
return false;
}