添加whatshub工单
This commit is contained in:
Regular → Executable
+55
-4
@@ -14,6 +14,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
var searchSelect = Controller.api.searchSelectColumn;
|
||||
var searchSelectMeta = Controller.api.searchSelectMeta;
|
||||
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
@@ -22,14 +24,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
sortOrder: 'desc',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
searchFormVisible: true,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
searchSelect('id', __('Link_code'), Config.linkFilterList || {}, true),
|
||||
{field: 'countries_text', title: __('Countries'), operate: false, formatter: Table.api.formatter.content},
|
||||
{
|
||||
field: 'link_code',
|
||||
title: __('Link_code'),
|
||||
operate: 'LIKE',
|
||||
operate: false,
|
||||
formatter: Controller.api.formatter.linkCode
|
||||
},
|
||||
{field: 'description', title: __('Description'), operate: 'LIKE', class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
@@ -39,9 +43,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
operate: false,
|
||||
formatter: Controller.api.formatter.autoReplyText
|
||||
},
|
||||
{field: 'ip_protect', title: __('Ip_protect'), searchList: Config.ipProtectList, formatter: Table.api.formatter.status},
|
||||
{field: 'random_shuffle', title: __('Random_shuffle'), searchList: Config.randomShuffleList, formatter: Table.api.formatter.status},
|
||||
{field: 'status', title: __('Status'), searchList: Config.statusList, formatter: Table.api.formatter.status},
|
||||
$.extend(
|
||||
{field: 'ip_protect', title: __('Ip_protect'), searchList: Config.ipProtectList, formatter: Table.api.formatter.status},
|
||||
searchSelectMeta(false)
|
||||
),
|
||||
$.extend(
|
||||
{field: 'random_shuffle', title: __('Random_shuffle'), searchList: Config.randomShuffleList, formatter: Table.api.formatter.status},
|
||||
searchSelectMeta(false)
|
||||
),
|
||||
$.extend(
|
||||
{field: 'status', title: __('Status'), searchList: Config.statusList, formatter: Table.api.formatter.status},
|
||||
searchSelectMeta(false)
|
||||
),
|
||||
{field: 'createtime', title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime, sortable: true},
|
||||
{
|
||||
field: 'operate',
|
||||
@@ -117,6 +130,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
|
||||
Controller.api.bindAutoReplyPreviewTips(table);
|
||||
|
||||
table.on('post-common-search.bs.table', function (e, tbl) {
|
||||
Controller.api.initCommonSearchSelectpicker(tbl);
|
||||
});
|
||||
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
@@ -127,6 +144,40 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
searchSelectColumn: function (field, title, searchList, liveSearch) {
|
||||
return {
|
||||
field: field,
|
||||
title: title,
|
||||
visible: false,
|
||||
searchList: searchList || {},
|
||||
operate: '=',
|
||||
addclass: 'selectpicker',
|
||||
extend: Controller.api.searchSelectExtend(liveSearch !== false)
|
||||
};
|
||||
},
|
||||
searchSelectMeta: function (liveSearch) {
|
||||
return {
|
||||
addclass: 'selectpicker',
|
||||
extend: Controller.api.searchSelectExtend(liveSearch !== false)
|
||||
};
|
||||
},
|
||||
searchSelectExtend: function (liveSearch) {
|
||||
var text = __('Please select');
|
||||
if (!text || text === 'Please select' || text === 'Please Select') {
|
||||
text = '请选择';
|
||||
}
|
||||
var ext = 'data-none-selected-text="' + text + '" title="' + text + '"';
|
||||
if (liveSearch) {
|
||||
ext += ' data-live-search="true"';
|
||||
}
|
||||
return ext;
|
||||
},
|
||||
initCommonSearchSelectpicker: function (tbl) {
|
||||
var $form = $('form.form-commonsearch', tbl.$container);
|
||||
if ($form.length) {
|
||||
Form.events.selectpicker($form);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 规范化后台跨模块跳转 URL,避免在 split.link 页面内相对解析成 split.link/domain
|
||||
*
|
||||
|
||||
Regular → Executable
+156
-20
@@ -14,6 +14,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
var searchSelect = Controller.api.searchSelectColumn;
|
||||
var searchSelectMeta = Controller.api.searchSelectMeta;
|
||||
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
@@ -22,9 +24,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
sortOrder: 'desc',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
searchFormVisible: true,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
searchSelect('split_link_id', __('Link_url'), Config.splitLinkFilterList || {}, true),
|
||||
{field: 'id', title: __('Id'), sortable: true},
|
||||
{
|
||||
field: 'link_url_text',
|
||||
@@ -34,28 +38,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
},
|
||||
{field: 'ticket_name', title: __('Ticket_name'), operate: 'LIKE'},
|
||||
{field: 'number', title: __('Number'), operate: 'LIKE'},
|
||||
{
|
||||
field: 'number_type',
|
||||
title: __('Number_type'),
|
||||
searchList: Config.numberTypeList,
|
||||
formatter: Table.api.formatter.normal
|
||||
},
|
||||
$.extend(
|
||||
{field: 'number_type', title: __('Number_type'), searchList: Config.numberTypeList, formatter: Table.api.formatter.normal},
|
||||
searchSelectMeta(false)
|
||||
),
|
||||
{field: 'visit_count', title: __('Visit_count'), operate: false, sortable: true},
|
||||
{field: 'inbound_count', title: __('Inbound_count'), operate: false, sortable: true},
|
||||
{
|
||||
field: 'platform_status',
|
||||
title: __('Platform_status'),
|
||||
searchList: Config.platformStatusList,
|
||||
formatter: Controller.api.formatter.platformStatus
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: __('Status'),
|
||||
searchList: Config.statusList,
|
||||
formatter: Table.api.formatter.toggle,
|
||||
yes: 'normal',
|
||||
no: 'hidden'
|
||||
},
|
||||
$.extend(
|
||||
{field: 'platform_status', title: __('Platform_status'), searchList: Config.platformStatusList, formatter: Controller.api.formatter.platformStatus},
|
||||
searchSelectMeta(false)
|
||||
),
|
||||
$.extend(
|
||||
{field: 'status', title: __('Status'), searchList: Config.statusList, formatter: Table.api.formatter.toggle, yes: 'normal', no: 'hidden'},
|
||||
searchSelectMeta(false)
|
||||
),
|
||||
{
|
||||
field: 'createtime',
|
||||
title: __('Createtime'),
|
||||
@@ -95,6 +91,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
Controller.api.openBatchUpdateModal(ids, table);
|
||||
});
|
||||
|
||||
$('.btn-batch-operate').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
Controller.api.openBatchOperateModal(table);
|
||||
});
|
||||
|
||||
table.on('post-common-search.bs.table', function (e, tbl) {
|
||||
Controller.api.initCommonSearchSelectpicker(tbl);
|
||||
});
|
||||
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
@@ -104,6 +110,41 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
searchSelectColumn: function (field, title, searchList, liveSearch) {
|
||||
return {
|
||||
field: field,
|
||||
title: title,
|
||||
visible: false,
|
||||
searchList: searchList || {},
|
||||
operate: '=',
|
||||
addclass: 'selectpicker',
|
||||
extend: Controller.api.searchSelectExtend(liveSearch !== false)
|
||||
};
|
||||
},
|
||||
searchSelectMeta: function (liveSearch) {
|
||||
return {
|
||||
addclass: 'selectpicker',
|
||||
extend: Controller.api.searchSelectExtend(liveSearch !== false)
|
||||
};
|
||||
},
|
||||
searchSelectExtend: function (liveSearch) {
|
||||
var text = __('Please select');
|
||||
if (!text || text === 'Please select' || text === 'Please Select') {
|
||||
text = '请选择';
|
||||
}
|
||||
var ext = 'data-none-selected-text="' + text + '" title="' + text + '"';
|
||||
if (liveSearch) {
|
||||
ext += ' data-live-search="true"';
|
||||
}
|
||||
return ext;
|
||||
},
|
||||
initCommonSearchSelectpicker: function (tbl) {
|
||||
var $form = $('form.form-commonsearch', tbl.$container);
|
||||
if ($form.length) {
|
||||
Form.events.selectpicker($form);
|
||||
}
|
||||
},
|
||||
|
||||
formatter: {
|
||||
platformStatus: function (value, row) {
|
||||
var text = row.platform_status_text != null && row.platform_status_text !== ''
|
||||
@@ -214,6 +255,101 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
openBatchOperateModal: function (table) {
|
||||
var pleaseSelect = __('Please select');
|
||||
if (!pleaseSelect || pleaseSelect === 'Please select' || pleaseSelect === 'Please Select') {
|
||||
pleaseSelect = '请选择';
|
||||
}
|
||||
var linkOptions = ['<option value="">' + Fast.api.escape(pleaseSelect) + '</option>'];
|
||||
$.each(Config.splitLinkSelectList || {}, function (id, label) {
|
||||
linkOptions.push('<option value="' + Fast.api.escape(String(id)) + '">' + Fast.api.escape(String(label)) + '</option>');
|
||||
});
|
||||
var html = [
|
||||
'<div class="split-batch-operate-modal" style="padding:26px 22px;">',
|
||||
' <div class="form-group">',
|
||||
' <label class="control-label">' + __('Link_url') + '<span class="text-danger">*</span></label>',
|
||||
' <select id="batch-operate-split-link" class="form-control selectpicker" data-live-search="true" data-none-selected-text="' + pleaseSelect + '" title="' + pleaseSelect + '">',
|
||||
linkOptions.join(''),
|
||||
' </select>',
|
||||
' </div>',
|
||||
' <div class="form-group">',
|
||||
' <label class="control-label">' + __('Number') + '<span class="text-danger">*</span></label>',
|
||||
' <textarea id="batch-operate-numbers" class="form-control" rows="8" placeholder="' + Fast.api.escape(__('Numbers one per line')) + '"></textarea>',
|
||||
' </div>',
|
||||
' <div class="form-group">',
|
||||
' <label class="control-label">' + __('Batch operate action') + '<span class="text-danger">*</span></label>',
|
||||
' <select id="batch-operate-action" class="form-control selectpicker" data-none-selected-text="' + pleaseSelect + '" title="' + pleaseSelect + '">',
|
||||
' <option value="enable">' + Fast.api.escape(__('Batch operate enable')) + '</option>',
|
||||
' <option value="disable">' + Fast.api.escape(__('Batch operate disable')) + '</option>',
|
||||
' <option value="delete">' + Fast.api.escape(__('Batch operate delete')) + '</option>',
|
||||
' </select>',
|
||||
' </div>',
|
||||
' <div class="form-group" style="margin-top:10px;margin-bottom:0;text-align:right;">',
|
||||
' <button type="button" class="btn btn-primary btn-batch-operate-confirm">' + __('OK') + '</button> ',
|
||||
' <button type="button" class="btn btn-default btn-batch-operate-cancel">' + __('Cancel') + '</button>',
|
||||
' </div>',
|
||||
'</div>'
|
||||
].join('');
|
||||
|
||||
var layerIndex = Layer.open({
|
||||
type: 1,
|
||||
title: __('Batch operate title'),
|
||||
area: ['520px', 'auto'],
|
||||
shadeClose: false,
|
||||
content: html,
|
||||
success: function (layero, index) {
|
||||
Form.events.selectpicker(layero);
|
||||
layero.find('.btn-batch-operate-cancel').on('click', function () {
|
||||
Layer.close(index);
|
||||
});
|
||||
layero.find('.btn-batch-operate-confirm').on('click', function () {
|
||||
var splitLinkId = $.trim(layero.find('#batch-operate-split-link').val());
|
||||
var numbers = $.trim(layero.find('#batch-operate-numbers').val());
|
||||
var action = $.trim(layero.find('#batch-operate-action').val());
|
||||
|
||||
if (!splitLinkId) {
|
||||
Toastr.warning(__('Please select split link'));
|
||||
return false;
|
||||
}
|
||||
if (!numbers) {
|
||||
Toastr.warning(__('Please fill at least one number'));
|
||||
return false;
|
||||
}
|
||||
if (!action) {
|
||||
Toastr.error(__('Invalid batch operate action'));
|
||||
return false;
|
||||
}
|
||||
|
||||
var submit = function () {
|
||||
Fast.api.ajax({
|
||||
url: 'split.number/batchoperate',
|
||||
type: 'post',
|
||||
data: {
|
||||
split_link_id: splitLinkId,
|
||||
numbers: numbers,
|
||||
action: action
|
||||
}
|
||||
}, function (data, ret) {
|
||||
Layer.close(index);
|
||||
table.bootstrapTable('refresh');
|
||||
Toastr.success(ret.msg || __('Batch operate success'));
|
||||
});
|
||||
};
|
||||
|
||||
if (action === 'delete') {
|
||||
Layer.confirm(__('Batch operate delete confirm'), {icon: 3, title: __('Warning')}, function (confirmIndex) {
|
||||
Layer.close(confirmIndex);
|
||||
submit();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
submit();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Regular → Executable
+145
-11
@@ -14,6 +14,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
var searchSelect = Controller.api.searchSelectColumn;
|
||||
var searchSelectMeta = Controller.api.searchSelectMeta;
|
||||
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
@@ -22,9 +24,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
sortOrder: 'desc',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
searchFormVisible: true,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
searchSelect('split_link_id', __('Split_link_id'), Config.splitLinkFilterList || {}, true),
|
||||
{
|
||||
field: 'ticket_type',
|
||||
title: __('Ticket_type'),
|
||||
@@ -39,6 +43,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
operate: false,
|
||||
formatter: Controller.api.formatter.splitLinkCode
|
||||
},
|
||||
{
|
||||
field: 'ticket_url',
|
||||
title: __('Ticket_url'),
|
||||
operate: 'LIKE',
|
||||
formatter: Controller.api.formatter.ticketUrlLink
|
||||
},
|
||||
{
|
||||
field: 'start_time_text',
|
||||
title: __('Start_time'),
|
||||
@@ -89,14 +99,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
operate: false,
|
||||
formatter: Controller.api.formatter.syncDisplay
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: __('Status'),
|
||||
searchList: Config.statusList,
|
||||
formatter: Table.api.formatter.toggle,
|
||||
yes: 'normal',
|
||||
no: 'hidden'
|
||||
},
|
||||
$.extend(
|
||||
{field: 'status', title: __('Status'), searchList: Config.statusList, formatter: Table.api.formatter.toggle, yes: 'normal', no: 'hidden'},
|
||||
searchSelectMeta(false)
|
||||
),
|
||||
{
|
||||
field: 'createtime',
|
||||
title: __('Createtime'),
|
||||
@@ -110,18 +116,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
field: 'operate',
|
||||
title: __('Operate'),
|
||||
table: table,
|
||||
events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate
|
||||
events: Controller.api.events.operate,
|
||||
formatter: Controller.api.formatter.operate
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
table.on('post-common-search.bs.table', function (e, tbl) {
|
||||
Controller.api.initCommonSearchSelectpicker(tbl);
|
||||
});
|
||||
|
||||
Table.api.bindevent(table);
|
||||
Controller.api.syncingTicketIds = [];
|
||||
window.__splitTicketPendingPostAddSyncIds = window.__splitTicketPendingPostAddSyncIds || [];
|
||||
|
||||
table.on('load-success.bs.table', function () {
|
||||
table.on('click', '.split-ticket-url-group input, .split-ticket-url-group a', function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
table.on('load-success.bs.table', function (e, res) {
|
||||
Controller.api.renderSummaryRow(res);
|
||||
var pendingIds = window.__splitTicketPendingPostAddSyncIds;
|
||||
if (!pendingIds || !pendingIds.length) {
|
||||
return;
|
||||
@@ -185,9 +200,67 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
searchSelectColumn: function (field, title, searchList, liveSearch) {
|
||||
return {
|
||||
field: field,
|
||||
title: title,
|
||||
visible: false,
|
||||
searchList: searchList || {},
|
||||
operate: '=',
|
||||
addclass: 'selectpicker',
|
||||
extend: Controller.api.searchSelectExtend(liveSearch !== false)
|
||||
};
|
||||
},
|
||||
searchSelectMeta: function (liveSearch) {
|
||||
return {
|
||||
addclass: 'selectpicker',
|
||||
extend: Controller.api.searchSelectExtend(liveSearch !== false)
|
||||
};
|
||||
},
|
||||
searchSelectExtend: function (liveSearch) {
|
||||
var text = __('Please select');
|
||||
if (!text || text === 'Please select' || text === 'Please Select') {
|
||||
text = '请选择';
|
||||
}
|
||||
var ext = 'data-none-selected-text="' + text + '" title="' + text + '"';
|
||||
if (liveSearch) {
|
||||
ext += ' data-live-search="true"';
|
||||
}
|
||||
return ext;
|
||||
},
|
||||
initCommonSearchSelectpicker: function (tbl) {
|
||||
var $form = $('form.form-commonsearch', tbl.$container);
|
||||
if ($form.length) {
|
||||
Form.events.selectpicker($form);
|
||||
}
|
||||
},
|
||||
|
||||
/** @type {number[]} 正在手动同步的工单 ID */
|
||||
syncingTicketIds: [],
|
||||
|
||||
/**
|
||||
* 渲染筛选结果汇总行(全量筛选数据,非当前页)
|
||||
*
|
||||
* @param {object} res 列表接口响应
|
||||
*/
|
||||
renderSummaryRow: function (res) {
|
||||
var $bar = $('#split-ticket-summary');
|
||||
if (!$bar.length) {
|
||||
return;
|
||||
}
|
||||
var total = res && res.total ? parseInt(res.total, 10) : 0;
|
||||
var summary = res && res.summary ? res.summary : null;
|
||||
if (!summary || total <= 0) {
|
||||
$bar.addClass('hide');
|
||||
return;
|
||||
}
|
||||
$bar.removeClass('hide');
|
||||
$bar.find('[data-sum="ticket_total"]').text(summary.ticket_total != null ? summary.ticket_total : 0);
|
||||
$bar.find('[data-sum="complete_count"]').text(summary.complete_count != null ? summary.complete_count : 0);
|
||||
$bar.find('[data-sum="ticket_progress_text"]').text(summary.ticket_progress_text || '0.00%');
|
||||
$bar.find('[data-sum="speed_per_hour"]').text(summary.speed_per_hour != null ? summary.speed_per_hour : '0.00');
|
||||
},
|
||||
|
||||
/**
|
||||
* 后台同步:标记「同步中」并请求 sync 接口
|
||||
*
|
||||
@@ -243,6 +316,30 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
},
|
||||
|
||||
formatter: {
|
||||
/**
|
||||
* 操作列:编辑 → 拷贝 → 删除
|
||||
*/
|
||||
operate: function (value, row, index) {
|
||||
var column = this;
|
||||
var table = this.table;
|
||||
var options = table.bootstrapTable('getOptions');
|
||||
var buttons = [];
|
||||
if (options.extend.edit_url) {
|
||||
buttons.push($.extend({}, Table.button.edit, {url: options.extend.edit_url}));
|
||||
}
|
||||
buttons.push({
|
||||
name: 'copy',
|
||||
icon: 'fa fa-copy',
|
||||
title: __('Copy'),
|
||||
classname: 'btn btn-xs btn-info btn-copyone',
|
||||
url: 'javascript:;',
|
||||
extend: 'data-toggle="tooltip" data-container="body"',
|
||||
});
|
||||
if (options.extend.del_url) {
|
||||
buttons.push($.extend({}, Table.button.del));
|
||||
}
|
||||
return Table.api.buttonlink(column, buttons, value, row, index, 'operate');
|
||||
},
|
||||
/**
|
||||
* 工单类型:纯文本展示,无链接/标签样式
|
||||
*/
|
||||
@@ -267,6 +364,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
return '<span class="split-ticket-link-badge" style="display:inline-block;max-width:100%;padding:2px 8px;font-size:12px;line-height:1.5;color:#555;background:#f5f5f5;border:1px solid #ddd;border-radius:3px;word-break:break-all;">'
|
||||
+ safe + '</span>';
|
||||
},
|
||||
/**
|
||||
* 工单链接:只读 input + 外链图标按钮
|
||||
*/
|
||||
ticketUrlLink: function (value) {
|
||||
value = value == null ? '' : String(value).trim();
|
||||
if (value === '') {
|
||||
return '<span class="text-muted">-</span>';
|
||||
}
|
||||
var href = value;
|
||||
if (!/^https?:\/\//i.test(href)) {
|
||||
href = 'https://' + href;
|
||||
}
|
||||
var safeValue = Fast.api.escape(value);
|
||||
var safeHref = Fast.api.escape(href);
|
||||
return '<div class="input-group input-group-sm split-ticket-url-group">'
|
||||
+ '<input type="text" class="form-control input-sm" readonly value="' + safeValue + '" title="' + safeValue + '">'
|
||||
+ '<span class="input-group-btn">'
|
||||
+ '<a href="' + safeHref + '" target="_blank" rel="noopener noreferrer" class="btn btn-default btn-sm" title="' + safeValue + '">'
|
||||
+ '<i class="fa fa-link"></i></a>'
|
||||
+ '</span></div>';
|
||||
},
|
||||
speedPerHour: function (value) {
|
||||
var num = parseFloat(value);
|
||||
if (isNaN(num)) {
|
||||
@@ -308,6 +426,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
+ '</span>';
|
||||
}
|
||||
},
|
||||
events: {
|
||||
operate: $.extend({}, Table.api.events.operate, {
|
||||
'click .btn-copyone': function (e, value, row, index) {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
var table = $(this).closest('table');
|
||||
var options = table.bootstrapTable('getOptions');
|
||||
var id = row[options.pk];
|
||||
Fast.api.open(
|
||||
Fast.api.fixurl('split.ticket/add?copy_id=' + id),
|
||||
__('Copy'),
|
||||
$(this).data() || {}
|
||||
);
|
||||
}
|
||||
})
|
||||
},
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($('form[role=form]'));
|
||||
Controller.api.fixSelectPlaceholder();
|
||||
|
||||
@@ -10,7 +10,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
|
||||
search: true, //是否启用快速搜索
|
||||
cache: false,
|
||||
commonSearch: true, //是否启用通用搜索
|
||||
searchFormVisible: false, //是否始终显示搜索表单
|
||||
searchFormVisible: true, //是否始终显示搜索表单
|
||||
titleForm: '', //为空则不显示标题,不定义默认显示:普通搜索
|
||||
idTable: 'commonTable',
|
||||
showExport: true,
|
||||
|
||||
Reference in New Issue
Block a user