ソースを参照

书签编辑问题

MaiXinRong 1 ヶ月 前
コミット
5e73107b8e
2 ファイル変更6 行追加2 行削除
  1. 1 0
      app/public/js/cost_stage_ledger.js
  2. 5 2
      app/public/js/shares/cs_tools.js

+ 1 - 0
app/public/js/cost_stage_ledger.js

@@ -873,6 +873,7 @@ $(document).ready(function() {
         relaSpread: billsObj.spread,
         relaPosSpread: detailObj.spread,
         key: 'id',
+        keyType: 'uuid',
         treeId: 'tree_id',
         user_id: 'create_user_id',
         user_name: 'user_name',

+ 5 - 2
app/public/js/shares/cs_tools.js

@@ -1167,6 +1167,9 @@ const showSelectTab = function(select, spread, afterShow) {
             if (viewTags && viewTags.length > 0) viewTags.remove();
             billsTags.forEach(x => {x.display = false});
         };
+        const getTagId = function(obj) {
+            return setting.keyType == 'uuid' ? obj.attr('tag-id') : parseInt(obj.attr('tag-id'));
+        };
 
         const getTagEditHtml = function(tag) {
             const tagClass = classIndexes.find(x => {return x.color === tag.color}) || {};
@@ -1459,7 +1462,7 @@ const showSelectTab = function(select, spread, afterShow) {
         });
         $('body').on('click', '#tag-del', function () {
             const obj = $('[name=tag-edit]').parent();
-            postData(setting.updateUrl, {del: parseInt(obj.attr('tag-id'))}, function (result) {
+            postData(setting.updateUrl, {del: getTagId(obj)}, function (result) {
                 if (!result.del) return;
 
                 const bills = updateDatasAndShow(result);
@@ -1469,7 +1472,7 @@ const showSelectTab = function(select, spread, afterShow) {
         $('body').on('click', '#tag-edit-ok', function () {
             const obj = $('[name=tag-edit]').parent();
             const data = {
-                id: parseInt(obj.attr('tag-id')),
+                id: getTagId(obj),
                 share: $('#tag-share')[0].checked,
                 comment: $('#tag-comment').val(),
                 color: $('#tag-change-color').attr('tag-color'),