修正版本:还缺少数据同步
This commit is contained in:
@@ -8,6 +8,8 @@ use app\admin\model\split\Link as LinkModel;
|
||||
use app\admin\model\split\Ticket as TicketModel;
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
use think\Lang;
|
||||
use think\Loader;
|
||||
use think\Exception;
|
||||
use think\exception\DbException;
|
||||
use think\exception\PDOException;
|
||||
@@ -45,15 +47,6 @@ class Ticket extends Backend
|
||||
|
||||
$lang = $this->request->langset();
|
||||
$lang = preg_match('/^([a-zA-Z\-_]{2,10})$/i', $lang) ? $lang : 'zh-cn';
|
||||
$langFile = ROOT_PATH . 'patches/application/admin/lang/' . $lang . '/split/ticket.php';
|
||||
if (is_file($langFile)) {
|
||||
\think\Lang::load($langFile);
|
||||
}
|
||||
$linkLangFile = ROOT_PATH . 'patches/application/admin/lang/' . $lang . '/split/link.php';
|
||||
if (is_file($linkLangFile)) {
|
||||
\think\Lang::load($linkLangFile);
|
||||
}
|
||||
|
||||
$this->model = new \app\admin\model\split\Ticket();
|
||||
$this->view->assign('ticketTypeList', $this->model->getTicketTypeList());
|
||||
$this->view->assign('numberTypeList', $this->model->getNumberTypeList());
|
||||
@@ -66,6 +59,32 @@ class Ticket extends Backend
|
||||
$this->setupPatchFrontend();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载工单语言包(优先 patches)
|
||||
*/
|
||||
protected function loadlang($name): void
|
||||
{
|
||||
$lang = $this->request->langset();
|
||||
$lang = preg_match('/^([a-zA-Z\-_]{2,10})$/i', $lang) ? $lang : 'zh-cn';
|
||||
$name = Loader::parseName($name);
|
||||
$name = preg_match('/^([a-zA-Z0-9_\.\/]+)$/i', $name) ? $name : 'index';
|
||||
|
||||
$files = [
|
||||
APP_PATH . 'admin/lang/' . $lang . '/' . str_replace('.', '/', $name) . '.php',
|
||||
ROOT_PATH . 'patches/application/admin/lang/' . $lang . '/split/ticket.php',
|
||||
];
|
||||
$loaded = false;
|
||||
foreach ($files as $file) {
|
||||
if (is_file($file)) {
|
||||
Lang::load($file);
|
||||
$loaded = true;
|
||||
}
|
||||
}
|
||||
if (!$loaded) {
|
||||
parent::loadlang($name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 未部署 JS 时指向 script 接口
|
||||
*/
|
||||
|
||||
@@ -39,4 +39,6 @@ return [
|
||||
'Reply statements tip'=> '一行填写一条回复语句,保存后与当前分流链接关联',
|
||||
'Auto reply saved' => '自动回复已保存',
|
||||
'Reply statements column' => '回复语',
|
||||
'NS' => 'NS',
|
||||
'DNS' => 'DNS',
|
||||
];
|
||||
|
||||
@@ -6,8 +6,6 @@ return [
|
||||
'Ticket_url' => '工单链接',
|
||||
'Ticket_total' => '工单总量',
|
||||
'Split_link_id' => '分流链接',
|
||||
'View split link tip' => '点击查看分流链接与复制完整 URL',
|
||||
'Copy link code tip' => '复制链接码',
|
||||
'Number_type' => '号码类型',
|
||||
'Number_type_custom' => '自定义号码类型',
|
||||
'Start_time' => '开始时间',
|
||||
|
||||
@@ -466,8 +466,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
var statusHtml = '';
|
||||
if (options.showStatus) {
|
||||
statusHtml = '<span class="split-domain-status">'
|
||||
+ '<span class="label ' + Controller.api.statusLabelClass(options.nsStatus) + '">NS:' + Fast.api.escape(options.nsText || '-') + '</span>'
|
||||
+ '<span class="label ' + Controller.api.statusLabelClass(options.dnsStatus, true) + '">DNS:' + Fast.api.escape(options.dnsText || '-') + '</span>'
|
||||
+ '<span class="label ' + Controller.api.statusLabelClass(options.nsStatus) + '">' + __('NS') + ':' + Fast.api.escape(options.nsText || '-') + '</span>'
|
||||
+ '<span class="label ' + Controller.api.statusLabelClass(options.dnsStatus, true) + '">' + __('DNS') + ':' + Fast.api.escape(options.dnsText || '-') + '</span>'
|
||||
+ '</span>';
|
||||
}
|
||||
return '<div class="split-domain-item' + checkedClass + '">'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/split/link'], function ($, undefined, Backend, Table, Form, SplitLink) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -116,25 +116,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/split/link']
|
||||
]
|
||||
});
|
||||
|
||||
table.on('click', '.btn-ticket-split-link', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var linkCode = $.trim($(this).data('link-code') || '');
|
||||
if (!linkCode || !SplitLink || !SplitLink.api || !SplitLink.api.openCopyModal) {
|
||||
return false;
|
||||
}
|
||||
SplitLink.api.openCopyModal(linkCode);
|
||||
});
|
||||
|
||||
table.on('click', '.btn-ticket-copy-link-code', function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var linkCode = $.trim($(this).data('link-code') || '');
|
||||
if (linkCode && SplitLink && SplitLink.api && SplitLink.api.copyText) {
|
||||
SplitLink.api.copyText(linkCode);
|
||||
}
|
||||
});
|
||||
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
@@ -158,7 +139,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/split/link']
|
||||
return '<span class="split-ticket-type-plain">' + Fast.api.escape(text) + '</span>';
|
||||
},
|
||||
/**
|
||||
* 分流链接:链接样式 + 操作图标(点击文字打开复制弹窗)
|
||||
* 分流链接:纯文本 + 边框背景标记,不可点击
|
||||
*/
|
||||
splitLinkCode: function (value) {
|
||||
value = value == null ? '' : String(value);
|
||||
@@ -166,15 +147,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/split/link']
|
||||
return '<span class="text-muted">-</span>';
|
||||
}
|
||||
var safe = Fast.api.escape(value);
|
||||
var viewTip = __('View split link tip');
|
||||
var copyTip = __('Copy link code tip');
|
||||
return '<span class="split-ticket-link-cell">'
|
||||
+ '<a href="javascript:;" class="btn-ticket-split-link split-ticket-link-text" data-link-code="' + safe + '"'
|
||||
+ ' data-toggle="tooltip" title="' + Fast.api.escape(viewTip) + '"'
|
||||
+ ' style="font-weight:600;color:#337ab7;text-decoration:underline;cursor:pointer;">' + safe + '</a>'
|
||||
+ ' <a href="javascript:;" class="btn-ticket-copy-link-code text-primary" data-link-code="' + safe + '"'
|
||||
+ ' data-toggle="tooltip" title="' + Fast.api.escape(copyTip) + '"><i class="fa fa-copy"></i></a>'
|
||||
+ '</span>';
|
||||
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>';
|
||||
},
|
||||
speedPerHour: function (value) {
|
||||
var num = parseFloat(value);
|
||||
|
||||
Reference in New Issue
Block a user