通讯录导入前端

This commit is contained in:
wong
2025-09-11 10:08:26 +08:00
parent 0f1edf3f9c
commit 51312a3a2a
13 changed files with 2232 additions and 11 deletions

View File

@@ -556,12 +556,12 @@ class WorkbenchController extends Controller
}
break;
case self::TYPE_IMPORT_CONTACT:
if (!empty($item->importContact)) {
$item->config = $item->importContact;
$item->config->devices = json_decode($item->config->devices, true);
$item->config->pools = json_decode($item->config->pools, true);
if (!empty($workbench->importContact)) {
$workbench->config = $workbench->importContact;
$workbench->config->devices = json_decode($workbench->config->devices, true);
$workbench->config->pools = json_decode($workbench->config->pools, true);
}
unset($item->importContact, $item->import_contact);
unset($workbench->importContact, $workbench->import_contact);
break;
}
unset(
@@ -991,11 +991,12 @@ class WorkbenchController extends Controller
}
break;
case self::TYPE_IMPORT_CONTACT: //联系人导入
$config = WorkbenchImportContact::where('workbenchId',$id)->find();;
$config = WorkbenchImportContact::where('workbenchId',$id)->find();
if ($config) {
$newConfig = new WorkbenchImportContact;
$newConfig->devices = json_encode($config->deveiceGroups);
$newConfig->pools = json_encode($config->pools);
$newConfig->workbenchId = $newWorkbench->id;
$newConfig->devices = $config->devices;
$newConfig->pools = $config->pools;
$newConfig->num = $config->num;
$newConfig->clearContact = $config->clearContact;
$newConfig->remark = $config->remark;

View File

@@ -64,7 +64,7 @@ class Workbench extends Model
public function importContact()
{
return $this->hasOne('WorkbenchTrafficConfig', 'workbenchId', 'id');
return $this->hasOne('WorkbenchImportContact', 'workbenchId', 'id');
}