mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-22 07:04:24 +00:00
style:代码中的else if改为elseif
This commit is contained in:
parent
80dcba5344
commit
81138cdb79
@ -723,9 +723,9 @@ class Crud extends Command
|
|||||||
$formFieldList[$field][':data'] = [
|
$formFieldList[$field][':data'] = [
|
||||||
'content' => $columnData,
|
'content' => $columnData,
|
||||||
];
|
];
|
||||||
} else if ($inputType == 'textarea') {
|
} elseif ($inputType == 'textarea') {
|
||||||
$formFieldList[$field][':input-attr']['rows'] = 3;
|
$formFieldList[$field][':input-attr']['rows'] = 3;
|
||||||
} else if ($inputType == 'remoteSelect' || $inputType == 'remoteSelects') {
|
} elseif ($inputType == 'remoteSelect' || $inputType == 'remoteSelects') {
|
||||||
$formFieldList[$field][':input-attr']['field'] = $this->getRemoteSelectField($field);
|
$formFieldList[$field][':input-attr']['field'] = $this->getRemoteSelectField($field);
|
||||||
$remoteUrl = $this->getRemoteSelectUrl($field, $relations, $webControllerUrls);
|
$remoteUrl = $this->getRemoteSelectUrl($field, $relations, $webControllerUrls);
|
||||||
$formFieldList[$field][':input-attr']['remote-url'] = $remoteUrl['url'];
|
$formFieldList[$field][':input-attr']['remote-url'] = $remoteUrl['url'];
|
||||||
@ -738,17 +738,17 @@ class Crud extends Command
|
|||||||
$formFieldList[$field]['type'] = 'remoteSelect';
|
$formFieldList[$field]['type'] = 'remoteSelect';
|
||||||
$formFieldList[$field][':input-attr']['multiple'] = 'true';
|
$formFieldList[$field][':input-attr']['multiple'] = 'true';
|
||||||
}
|
}
|
||||||
} else if ($inputType == 'number') {
|
} elseif ($inputType == 'number') {
|
||||||
$formFieldList[$field]['v-model.number'] = $formFieldList[$field]['v-model'];
|
$formFieldList[$field]['v-model.number'] = $formFieldList[$field]['v-model'];
|
||||||
unset($formFieldList[$field]['v-model']);
|
unset($formFieldList[$field]['v-model']);
|
||||||
$formFieldList[$field][':input-attr']['step'] = $column['NUMERIC_SCALE'] > 0 ? '0.' . str_repeat(0, $column['NUMERIC_SCALE'] - 1) . '1' : 1;
|
$formFieldList[$field][':input-attr']['step'] = $column['NUMERIC_SCALE'] > 0 ? '0.' . str_repeat(0, $column['NUMERIC_SCALE'] - 1) . '1' : 1;
|
||||||
} else if ($inputType == 'icon') {
|
} elseif ($inputType == 'icon') {
|
||||||
$formFieldList[$field][':input-attr']['placement'] = 'top';
|
$formFieldList[$field][':input-attr']['placement'] = 'top';
|
||||||
} else if ($inputType == 'array') {
|
} elseif ($inputType == 'array') {
|
||||||
$modelFieldType[$field] = 'json';
|
$modelFieldType[$field] = 'json';
|
||||||
} else if ($inputType == 'datetime' && $column['DATA_TYPE'] == 'int') {
|
} elseif ($inputType == 'datetime' && $column['DATA_TYPE'] == 'int') {
|
||||||
$modelFieldType[$field] = 'timestamp:Y-m-d H:i:s';
|
$modelFieldType[$field] = 'timestamp:Y-m-d H:i:s';
|
||||||
} else if ($inputType == 'editor') {
|
} elseif ($inputType == 'editor') {
|
||||||
$formDialogBig = true; // form 使用较宽的 Dialog
|
$formDialogBig = true; // form 使用较宽的 Dialog
|
||||||
|
|
||||||
// 重写edit方法
|
// 重写edit方法
|
||||||
@ -1035,7 +1035,7 @@ class Crud extends Command
|
|||||||
foreach ($value as $item) {
|
foreach ($value as $item) {
|
||||||
if (stripos($item, ',') !== false) {
|
if (stripos($item, ',') !== false) {
|
||||||
$valueTmp = array_merge($valueTmp, explode(',', $item));
|
$valueTmp = array_merge($valueTmp, explode(',', $item));
|
||||||
} else if (stripos($item, ',') !== false) {
|
} elseif (stripos($item, ',') !== false) {
|
||||||
$valueTmp = array_merge($valueTmp, explode(',', $item));
|
$valueTmp = array_merge($valueTmp, explode(',', $item));
|
||||||
} else {
|
} else {
|
||||||
$valueTmp[] = $item;
|
$valueTmp[] = $item;
|
||||||
|
@ -124,7 +124,7 @@ class Stub
|
|||||||
} else {
|
} else {
|
||||||
if ($item === 'false') {
|
if ($item === 'false') {
|
||||||
$itemJson = ' ' . $key . ': false,';
|
$itemJson = ' ' . $key . ': false,';
|
||||||
} else if (in_array($key, ['label', 'width', 'buttons']) || strpos($item, "t('") === 0 || strpos($item, "t(\"") === 0) {
|
} elseif (in_array($key, ['label', 'width', 'buttons']) || strpos($item, "t('") === 0 || strpos($item, "t(\"") === 0) {
|
||||||
$itemJson = ' ' . $key . ': ' . $item . ',';
|
$itemJson = ' ' . $key . ': ' . $item . ',';
|
||||||
} else {
|
} else {
|
||||||
$itemJson = ' ' . $key . ': \'' . $item . '\',';
|
$itemJson = ' ' . $key . ': \'' . $item . '\',';
|
||||||
@ -188,11 +188,11 @@ class Stub
|
|||||||
$keyStr = strpos($key, "-") === false ? ' ' . $key . ': ' : ' \'' . $key . '\': ';
|
$keyStr = strpos($key, "-") === false ? ' ' . $key . ': ' : ' \'' . $key . '\': ';
|
||||||
if (is_array($item)) {
|
if (is_array($item)) {
|
||||||
$jsonStr .= $keyStr . self::getJsonFromArray($item) . ',';
|
$jsonStr .= $keyStr . self::getJsonFromArray($item) . ',';
|
||||||
} else if ($item === 'false' || $item === 'true') {
|
} elseif ($item === 'false' || $item === 'true') {
|
||||||
$jsonStr .= $keyStr . ($item === 'false' ? 'false' : 'true') . ',';
|
$jsonStr .= $keyStr . ($item === 'false' ? 'false' : 'true') . ',';
|
||||||
} else if (strpos($item, "t('") === 0 || strpos($item, "t(\"") === 0) {
|
} elseif (strpos($item, "t('") === 0 || strpos($item, "t(\"") === 0) {
|
||||||
$jsonStr .= $keyStr . $item . ',';
|
$jsonStr .= $keyStr . $item . ',';
|
||||||
} else if (($key == 'remote-url' && strpos($item, "+") !== false) || $key == 'rows') {
|
} elseif (($key == 'remote-url' && strpos($item, "+") !== false) || $key == 'rows') {
|
||||||
$jsonStr .= $keyStr . $item . ',';
|
$jsonStr .= $keyStr . $item . ',';
|
||||||
} else {
|
} else {
|
||||||
$jsonStr .= $keyStr . '\'' . $item . '\',';
|
$jsonStr .= $keyStr . '\'' . $item . '\',';
|
||||||
|
@ -49,7 +49,7 @@ class Config extends Model
|
|||||||
if (in_array($row['type'], $this->jsonDecodeType)) {
|
if (in_array($row['type'], $this->jsonDecodeType)) {
|
||||||
$arr = json_decode($value, true);
|
$arr = json_decode($value, true);
|
||||||
return $arr ? $arr : [];
|
return $arr ? $arr : [];
|
||||||
} else if ($row['type'] == 'switch') {
|
} elseif ($row['type'] == 'switch') {
|
||||||
return (bool)$value;
|
return (bool)$value;
|
||||||
} else {
|
} else {
|
||||||
return $value ? $value : '';
|
return $value ? $value : '';
|
||||||
@ -60,7 +60,7 @@ class Config extends Model
|
|||||||
{
|
{
|
||||||
if (in_array($row['type'], $this->jsonDecodeType)) {
|
if (in_array($row['type'], $this->jsonDecodeType)) {
|
||||||
return $value ? json_encode($value) : '';
|
return $value ? json_encode($value) : '';
|
||||||
} else if ($row['type'] == 'switch') {
|
} elseif ($row['type'] == 'switch') {
|
||||||
return $value ? '1' : '0';
|
return $value ? '1' : '0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class Mysql extends Driver
|
|||||||
//返回剩余有效时间
|
//返回剩余有效时间
|
||||||
$data['expires_in'] = $this->getExpiredIn($data['expiretime']);
|
$data['expires_in'] = $this->getExpiredIn($data['expiretime']);
|
||||||
return $data;
|
return $data;
|
||||||
} else if ($data['type'] == 'admin-refresh' || $data['type'] == 'user-refresh') {
|
} elseif ($data['type'] == 'admin-refresh' || $data['type'] == 'user-refresh') {
|
||||||
return $data;
|
return $data;
|
||||||
} else {
|
} else {
|
||||||
// token过期-触发前端刷新token
|
// token过期-触发前端刷新token
|
||||||
|
@ -145,7 +145,7 @@ class CommandExec
|
|||||||
if (strpos(strtolower($output), 'all packages installed') !== false) {
|
if (strpos(strtolower($output), 'all packages installed') !== false) {
|
||||||
$this->output($this->CurrentCommandKey . '-success', false);
|
$this->output($this->CurrentCommandKey . '-success', false);
|
||||||
}
|
}
|
||||||
} else if ($this->CurrentCommandKey == 'install-cnpm') {
|
} elseif ($this->CurrentCommandKey == 'install-cnpm') {
|
||||||
$preg = "/added ([0-9]*) packages in/i";
|
$preg = "/added ([0-9]*) packages in/i";
|
||||||
$preg2 = "/added ([0-9]*) packages, removed/i";
|
$preg2 = "/added ([0-9]*) packages, removed/i";
|
||||||
if (preg_match($preg, $output)) {
|
if (preg_match($preg, $output)) {
|
||||||
@ -154,7 +154,7 @@ class CommandExec
|
|||||||
if (preg_match($preg2, $output)) {
|
if (preg_match($preg2, $output)) {
|
||||||
$this->output('install-cnpm-success', false);
|
$this->output('install-cnpm-success', false);
|
||||||
}
|
}
|
||||||
} else if ($this->CurrentCommandKey == 'web-build') {
|
} elseif ($this->CurrentCommandKey == 'web-build') {
|
||||||
if (strpos(strtolower($output), 'build successfully!') !== false) {
|
if (strpos(strtolower($output), 'build successfully!') !== false) {
|
||||||
$this->output($this->CurrentCommandKey . '-success', false);
|
$this->output($this->CurrentCommandKey . '-success', false);
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ class Tree
|
|||||||
$prefix = ($number == $total) ? self::$icon[2] : self::$icon[1];
|
$prefix = ($number == $total) ? self::$icon[2] : self::$icon[1];
|
||||||
if ($level == 2) {
|
if ($level == 2) {
|
||||||
$arr[$key][$field] = str_pad('', 4, ' ') . $prefix . $item[$field];
|
$arr[$key][$field] = str_pad('', 4, ' ') . $prefix . $item[$field];
|
||||||
} else if ($level >= 3) {
|
} elseif ($level >= 3) {
|
||||||
$arr[$key][$field] = str_pad('', 4, ' ') . ($superiorEnd ? '' : self::$icon[0]) . str_pad('', ($level - 2) * 4, ' ') . $prefix . $item[$field];
|
$arr[$key][$field] = str_pad('', 4, ' ') . ($superiorEnd ? '' : self::$icon[0]) . str_pad('', ($level - 2) * 4, ' ') . $prefix . $item[$field];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user