Browse Source

标段排序更改

laiguoran 4 years ago
parent
commit
a9de5bfa3b

File diff suppressed because it is too large
+ 335 - 0
app/public/js/PinYinOrder.bundle.js


+ 15 - 13
app/public/js/shares/tender_list_order.js

@@ -11,20 +11,22 @@
 const tenderListOrder = (function () {
     let orderSetting = getLocalCache('zh-calc-tender-list-order');
     if (!orderSetting) orderSetting = 'name|up';
+    const pinyin = new PinYinOrder();
     function CompareStr (x, y) {
         // 根据mysql的GBK
-        const regASC = /^[\x00-\x7F]/;
-        if (regASC.test(x) || regASC.test(y)) {
-            if (x > y) {
-                return 1
-            } else if (x < y) {
-                return -1
-            } else {
-                return 0;
-            }
-        } else {
-            return x.localeCompare(y, 'zh-CN');
-        }
+        // const regASC = /^[\x00-\x7F]/;
+        // if (regASC.test(x) || regASC.test(y)) {
+        //     if (x > y) {
+        //         return 1
+        //     } else if (x < y) {
+        //         return -1
+        //     } else {
+        //         return 0;
+        //     }
+        // } else {
+        //     return x.localeCompare(y, 'zh', { sensitivity: 'base' });
+        // }
+        return pinyin.compareWord(x, y);
     }
     function reOrderTenders (orderStr) {
         if (orderStr) {
@@ -62,4 +64,4 @@ const tenderListOrder = (function () {
         return '<a href="javascript:void(0)" class="btn btn-sm ml-1">' + button + '</a>';
     }
     return { reOrderTenders, getOrderButton }
-})();
+})();

+ 3 - 3
app/public/js/tender_list.js

@@ -319,9 +319,9 @@ function getTenderTreeHtml () {
         const html = [];
         html.push('<table class="table table-hover table-bordered">');
         html.push('<thead style="position: fixed;left:56px;top: 34px;">', '<tr>');
-        html.push('<th class="text-center" style="width: 45%">', '标段名称', '</th>');
+        html.push('<th class="text-center" style="width: 45%">', '标段名称', tenderListOrder.getOrderButton('name'), '</th>');
         html.push('<th class="text-center" style="width: 10%">', '创建人', '</th>');
-        html.push('<th class="text-center" style="width: 15%">', '创建时间', '</th>');
+        html.push('<th class="text-center" style="width: 15%">', '创建时间', tenderListOrder.getOrderButton('create_time'), '</th>');
         html.push('<th class="text-center" style="width: 10%">', '计量期数', '</th>');
         html.push('<th class="text-center" style="width: 20%">', '审批状态', '</th>');
         html.push('</tr>', '</thead>');
@@ -361,7 +361,7 @@ $(document).ready(() => {
     initCategoryLevelNode();
     $('.modal-body', '#add-bd').append(getCategoryHtml());
     // 初始化标段树结构
-    //tenderListOrder.reOrderTenders();
+    // tenderListOrder.reOrderTenders();
     initTenderTree();
     $('.c-body').html(getTenderTreeHtml());
     bindTenderUrl();

+ 2 - 2
app/public/js/tender_list_manage.js

@@ -303,9 +303,9 @@ function getTenderTreeHeaderHtml() {
     const html = [];
     html.push('<table class="table table-hover table-bordered">');
     html.push('<thead style="position: fixed;left:56px;top: 34px;">', '<tr>');
-    html.push('<th class="text-center" style="width: 45%">', '标段名称', '</th>');
+    html.push('<th class="text-center" style="width: 45%">', '标段名称', tenderListOrder.getOrderButton('name'), '</th>');
     html.push('<th class="text-center" style="width: 10%">', '创建人', '</th>');
-    html.push('<th class="text-center" style="width: 15%">', '创建时间', '</th>');
+    html.push('<th class="text-center" style="width: 15%">', '创建时间', tenderListOrder.getOrderButton('create_time'), '</th>');
     html.push('<th class="text-center" style="width: 10%">', '完成期数', '</th>');
     html.push('<th class="text-center" style="width: 20%">', '管理', '</th>');
     html.push('</tr>', '</thead>');

+ 1 - 1
app/view/dashboard/index.ejs

@@ -275,7 +275,7 @@
                 <div class="col-2">
                     <div class="card">
                         <div class="card-body">
-                            <h5 class="card-title">纵横技术支持</h5>
+                            <h5 class="card-title">技术支持</h5>
                             <!--<h6 class="card-subtitle mb-2 text-muted"><%= salesmanData.username %></h6>-->
                         </div>
                         <ul class="list-group list-group-flush">

+ 4 - 0
config/web.js

@@ -62,6 +62,7 @@ const JsFiles = {
                 ],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
+                    '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',
                     '/public/js/tender_showhide.js',
                     '/public/js/tender_list.js',
@@ -76,6 +77,7 @@ const JsFiles = {
                 ],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
+                    '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',
                     '/public/js/tender_showhide.js',
                     '/public/js/tender_list_info.js',
@@ -90,6 +92,7 @@ const JsFiles = {
                 ],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
+                    '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',
                     '/public/js/tender_showhide.js',
                     '/public/js/tender_list_progress.js',
@@ -105,6 +108,7 @@ const JsFiles = {
                 ],
                 mergeFiles: [
                     '/public/js/zh_calc.js',
+                    '/public/js/PinYinOrder.bundle.js',
                     '/public/js/shares/tender_list_order.js',
                     '/public/js/tender_showhide.js',
                     '/public/js/tender_list_manage.js',