|
@@ -306,7 +306,7 @@ class TreeService extends Service {
|
|
|
data[this.setting.mid] = mid;
|
|
|
data[this.setting.level] = select ? select[this.setting.level] : 1;
|
|
|
data[this.setting.order] = select ? select[this.setting.order] + 1 : 1;
|
|
|
- data[this.setting.fullPath] = data[this.setting.level] > 1 ? select[this.setting.fullPath].replace('.' + select[this.setting.kid], '.' + data[this.setting.kid]) : data[this.setting.kid] + '';
|
|
|
+ data[this.setting.fullPath] = data[this.setting.level] > 1 ? select[this.setting.fullPath].replace('-' + select[this.setting.kid], '-' + data[this.setting.kid]) : data[this.setting.kid] + '';
|
|
|
data[this.setting.isLeaf] = true;
|
|
|
const result = await this.transaction.insert(this.tableName, data);
|
|
|
|
|
@@ -513,7 +513,7 @@ class TreeService extends Service {
|
|
|
selfOperate: '-',
|
|
|
});
|
|
|
this.sqlBuilder.setUpdateData(this.setting.fullPath, {
|
|
|
- value: [this.setting.fullPath, this.db.escape(select[this.setting.pid] + '.'), this.db.escape('')],
|
|
|
+ value: [this.setting.fullPath, this.db.escape(select[this.setting.pid] + '-'), this.db.escape('')],
|
|
|
literal: 'Replace',
|
|
|
});
|
|
|
const [sql, sqlParam] = this.sqlBuilder.build(this.tableName, 'update');
|
|
@@ -565,8 +565,8 @@ class TreeService extends Service {
|
|
|
}
|
|
|
|
|
|
// 修改nextsData及其子节点的full_path
|
|
|
- const oldSubStr = this.db.escape(select[this.setting.pid] + '.');
|
|
|
- const newSubStr = this.db.escape(select[this.setting.kid] + '.');
|
|
|
+ const oldSubStr = this.db.escape(select[this.setting.pid] + '-');
|
|
|
+ const newSubStr = this.db.escape(select[this.setting.kid] + '-');
|
|
|
const sqlArr = [];
|
|
|
sqlArr.push('Update ?? SET `full_path` = Replace(`full_path`,' + oldSubStr + ',' + newSubStr + ') Where');
|
|
|
sqlArr.push('(`' + this.setting.mid + '` = ' + select[this.setting.mid] + ')');
|
|
@@ -600,7 +600,7 @@ class TreeService extends Service {
|
|
|
if (!parent) throw '升级节点数据错误';
|
|
|
|
|
|
this.transaction = await this.db.beginTransaction();
|
|
|
- const newFullPath = select[this.setting.fullPath].replace(select[this.setting.pid] + '.', '');
|
|
|
+ const newFullPath = select[this.setting.fullPath].replace(select[this.setting.pid] + '-', '');
|
|
|
try {
|
|
|
// 选中节点--父节点 选中节点为firstChild时,修改is_leaf
|
|
|
if (select[this.setting.order] === 1) {
|
|
@@ -669,7 +669,7 @@ class TreeService extends Service {
|
|
|
selfOperate: '+',
|
|
|
});
|
|
|
this.sqlBuilder.setUpdateData(this.setting.fullPath, {
|
|
|
- value: [this.setting.fullPath, this.db.escape(select[this.setting.kid] + '.'), this.db.escape(pre[this.setting.kid] + '.' + select[this.setting.kid] + '.')],
|
|
|
+ value: [this.setting.fullPath, this.db.escape(select[this.setting.kid] + '-'), this.db.escape(pre[this.setting.kid] + '-' + select[this.setting.kid] + '-')],
|
|
|
literal: 'Replace',
|
|
|
});
|
|
|
const [sql, sqlParam] = this.sqlBuilder.build(this.tableName, 'update');
|
|
@@ -694,8 +694,8 @@ class TreeService extends Service {
|
|
|
const preLastChild = await this.getLastChildData(mid, pre[this.setting.kid]);
|
|
|
|
|
|
this.transaction = await this.db.beginTransaction();
|
|
|
- const orgLastPath = select[this.setting.level] === 1 ? select[this.setting.kid] : '.' + select[this.setting.kid];
|
|
|
- const newLastPath = select[this.setting.level] === 1 ? pre[this.setting.kid] + '.' + select[this.setting.kid] : '.' + pre[this.setting.kid] + '.' + select[this.setting.kid];
|
|
|
+ const orgLastPath = select[this.setting.level] === 1 ? select[this.setting.kid] : '-' + select[this.setting.kid];
|
|
|
+ const newLastPath = select[this.setting.level] === 1 ? pre[this.setting.kid] + '-' + select[this.setting.kid] : '-' + pre[this.setting.kid] + '-' + select[this.setting.kid];
|
|
|
const newFullPath = select.full_path.replace(orgLastPath, newLastPath);
|
|
|
try {
|
|
|
// 选中节点--全部后节点 order--
|