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; data;
} }
$codex .= <<<data $codex .= <<<data
</script> </script>
</body> </body>

View File

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

View File

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

View File

@ -994,8 +994,8 @@ ciycmpfunc.ciyselect = function (opn) {
this.range.unshift({ id: '', name: opn.all + '', _nofilter: true }); this.range.unshift({ id: '', name: opn.all + '', _nofilter: true });
} }
if (ciyfn.topinyin) { if (ciyfn.topinyin) {
for (var i in thos.range) for (var i in this.range)
thos.range[i]._py = ciyfn.topinyin(thos.range[i].name); this.range[i]._py = ciyfn.topinyin(this.range[i].name);
} }
if (this.value !== undefined) if (this.value !== undefined)
this.setvalue(); 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 + '/>'; 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') { else if (sp.type == 'select' || sp.type == 'radio') {
if (sp.type == 'select') 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') if (sp.type == 'radio')
html += '<ciy-radio sechr="' + name + '" com="' + name + '" value="' + val + '"' + prop + '></ciy-radio>'; html += '<ciy-radio sechr="' + name + '" com="' + name + '" value="' + val + '"' + prop + '></ciy-radio>';
sp.def = sp.def || ''; sp.def = sp.def || '';

View File

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

View File

@ -333,7 +333,7 @@ class http {
$this->response = curl_exec($ch); $this->response = curl_exec($ch);
if ($this->response === false) { if ($this->response === false) {
$this->response_info['http_code'] = 204; $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; return false;
} }
$this->response_info = curl_getinfo($ch); $this->response_info = curl_getinfo($ch);
@ -466,25 +466,14 @@ class http {
curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookiefile); 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); $headers = array_merge($this->request_headeronce, $this->request_headerfixed);
if ($headers) if ($headers)
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$this->request_headeronce = array(); $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); $this->response = curl_exec($ch);
if ($this->response === false) { if ($this->response === false) {
$this->response_info['http_code'] = 204; $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; return false;
} }
$this->response_info = curl_getinfo($ch); $this->response_info = curl_getinfo($ch);
@ -502,64 +491,14 @@ class http {
$this->response_header = array_pop($this->response_header); $this->response_header = array_pop($this->response_header);
$this->response_header = explode("\r\n", $this->response_header); $this->response_header = explode("\r\n", $this->response_header);
array_shift($this->response_header); //去掉第一行 array_shift($this->response_header); //去掉第一行
$purl = null;
$header_assoc = array(); $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; $this->response_header = $header_assoc;
curl_close($ch); curl_close($ch);
$httpcode = toint($this->response_info['http_code']); $httpcode = toint($this->response_info['http_code']);
if ($httpcode >= 300 && $httpcode < 400) { if ($httpcode >= 300 && $httpcode < 400) {
if ($this->response_info['redirect_url']) { if ($this->response_info['redirect_url']) {
$url = $this->response_info['redirect_url']; $url = $this->response_info['redirect_url'];
$postdata = '';
continue; continue;
} }
} }
@ -594,7 +533,7 @@ class http {
if ($response === false) { if ($response === false) {
clog(curl_error($ch) . ' (' . curl_errno($ch) . ')'); clog(curl_error($ch) . ' (' . curl_errno($ch) . ')');
$this->response_info['http_code'] = 204; $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); curl_close($ch);
return false; return false;
} }