fix(admin): 渠道列表脚本因 \$input 无法执行
Blade 原样输出反斜杠,整段 layui 脚本语法错误,表格不会请求数据。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -261,16 +261,16 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
var isAppNow = data.value === 'app';
|
||||
$('.LAY-ch-app-only').toggle(isAppNow);
|
||||
$('.LAY-ch-new-only').toggle(!isAppNow);
|
||||
var \$input = $('#LAY-ch-id-input');
|
||||
var idInput = $('#LAY-ch-id-input');
|
||||
if (isAppNow) {
|
||||
\$input.attr('readonly', true).attr('maxlength', '').attr('placeholder', '自动生成 UUID');
|
||||
if (!\$input.val()) {
|
||||
idInput.attr('readonly', true).attr('maxlength', '').attr('placeholder', '自动生成 UUID');
|
||||
if (!idInput.val()) {
|
||||
$.getJSON(@json(route('admin.channels.randomId')) + '?builder_type=app', function (res) {
|
||||
if (res.code === 0) \$input.val(res.data.channel_id);
|
||||
if (res.code === 0) idInput.val(res.data.channel_id);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
\$input.removeAttr('readonly').attr('maxlength', '6').attr('placeholder', '例如 A.B.C1 或 3.1.07').val('');
|
||||
idInput.removeAttr('readonly').attr('maxlength', '6').attr('placeholder', '例如 A.B.C1 或 3.1.07').val('');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user