Merge pull request 'dev' (#18) from dev into master

Reviewed-on: #18
This commit is contained in:
mkm 2023-09-13 22:04:24 +08:00
commit 6736f61076
497 changed files with 16558 additions and 500 deletions

View File

@ -24,7 +24,9 @@ use app\api\controller\JunziqianController;
use app\common\logic\RedisLogic;
use app\common\model\auth\Admin;
use app\common\model\Company;
use app\common\model\ShopMerchant;
use think\cache\driver\Redis;
use think\Exception;
use think\facade\Db;
use app\common\logic\contract\ContractLogic;
use app\common\model\contract\Contract;
@ -39,8 +41,7 @@ use think\facade\Log;
*/
class CompanyController extends BaseAdminController
{
public array $notNeedLogin = ['createShopMerchant'];
/**
* @notes 获取列表
* @return \think\response\Json
@ -210,7 +211,7 @@ class CompanyController extends BaseAdminController
// return $this->fail($faceCreateRe);
// }
//
if ($company->company_type == 30) {
if ($company['company_type'] == 30) {
// 平台公司不用初始化生成合同 合同签约暂不用人脸识别,预留人脸采集状态为已采集
Db::name('company')->where('id', $params['id'])->update([ 'is_contract'=>1,'face_create_status'=>1]);
} else {
@ -357,4 +358,53 @@ class CompanyController extends BaseAdminController
}
return $this->success('success', array_unique($data));
}
public function createShopMerchant()
{
try {
$params = $this->request->param();
if (empty($params['company_name'])) {
throw new Exception('商户名称不能为空');
}
if (empty($params['organization_code'])) {
throw new Exception('社会统一信用代码不能为空');
}
if (empty($params['master_name'])) {
throw new Exception('商户法人名称不能为空');
}
$data = [
'mer_intention_id' => $params['mer_intention_id'], // 商城商户入驻申请id签约完成后回调使用
'company_name' => $params['company_name'],
'organization_code' => $params['organization_code'],
'city' => $params['city'],
'area' => $params['area'],
'street' => $params['street'],
'master_name' => $params['master_name'],
'master_phone' => $params['master_phone'],
'master_email' => substr(md5(uniqid()),rand(0, 22),10)."@lihai.com",
'face_create_status' => 1
];
$shopMerchantModel = ShopMerchant::create($data);
if (!$shopMerchantModel->isEmpty()) {
// 自动发起企业认证
$shopMerchantCertificationData = [
'name' => $shopMerchantModel->company_name,
'organization_code' => $shopMerchantModel->organization_code,
'business_license' => 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/561f8202305171526091317.png',
'master_name' => $shopMerchantModel->master_name,
'master_email' => $shopMerchantModel->master_email,
'master_phone' => $shopMerchantModel->master_phone,
'id' => $shopMerchantModel->id,
];
app(JunziqianController::class)->ShopMerchantCertification($shopMerchantCertificationData);
} else {
throw new Exception('商户创建失败');
}
return $this->success('成功', [], 1, 1);
} catch (Exception $exception) {
return $this->fail($exception->getMessage());
}
}
}

View File

@ -0,0 +1,189 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\controller;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\ShopContractLists;
use app\adminapi\logic\ShopContractLogic;
use app\adminapi\validate\ShopContractValidate;
use app\api\controller\JunziqianController;
use app\api\logic\SmsLogic;
use app\common\logic\contract\ContractLogic;
use app\common\model\Company;
use app\common\model\contract\Contract;
use app\common\model\ShopContract;
use app\common\model\ShopMerchant;
use app\Request;
use think\facade\Db;
/**
* ShopContract控制器
* Class ShopContractController
* @package app\adminapi\controller
*/
class ShopContractController extends BaseAdminController
{
/**
* @notes 获取列表
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function lists()
{
return $this->dataLists(new ShopContractLists());
}
/**
* @notes 添加
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function add()
{
$params = (new ShopContractValidate())->post()->goCheck('add');
$result = ShopContractLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(ShopContractLogic::getError());
}
/**
* @notes 编辑
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function edit()
{
$params = (new ShopContractValidate())->post()->goCheck('edit');
$result = ShopContractLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(ShopContractLogic::getError());
}
/**
* @notes 删除
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function delete()
{
$params = (new ShopContractValidate())->post()->goCheck('delete');
ShopContractLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取详情
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function detail()
{
$params = (new ShopContractValidate())->goCheck('detail');
$result = ShopContractLogic::detail($params);
return $this->data($result);
}
// 上传合同
public function wind_control()
{
$params = $this->request->param();
$file = $params['file'];
$res = ShopContract::where('id', $params['id'])->update(['file' => $file, 'check_status' => 2]);
if ($res) {
$find = ShopContract::where('id', $params['id'])->field('type,party_b,party_a')
->find()->toArray();
$find['party_a_info'] = ShopMerchant::where('id', $find['party_a'])->field('company_name name,master_phone phone')->find()->toArray();
$find['party_b_info'] = ShopMerchant::where('id', $find['party_b'])->field('company_name name,master_phone phone')->find()->toArray();
$a = [
'mobile' => $find['party_a_info']['phone'],
'name' => $find['party_a_info']['name'],
'scene' => 'WQTZ'
];
SmsLogic::contractUrl($a);
$b = [
'mobile' => $find['party_b_info']['phone'],
'name' => $find['party_b_info']['name'],
'scene' => 'WQTZ'
];
SmsLogic::contractUrl($b);
return $this->success('上传成功', [], 1, 1);
} else {
if ($res == 0) {
return $this->success('没有更新', [], 1, 1);
}
return $this->fail('上传失败');
}
}
// 发送合同
public function Draftingcontracts()
{
$params = $this->request->param();
$result = ShopContractLogic::Draftingcontracts($params);
if ($result == true) {
return $this->success('生成合同成功', [], 1, 1);
}
return $this->fail(ContractLogic::getError());
}
//**发送短信 */ 接口可能要做调整
public function postsms()
{
$params = $this->request->param();
$re = ShopContractLogic::postsms($params);
if (!$re) {
return $this->fail(ShopContractLogic::getError());
}
return $this->success('成功');
}
public function evidence()
{
$id = $this->request->param('id');
$detail=ShopContract::where('id',$id)->find();
if(!empty($detail['evidence_url'])){
return $this->success('获取成功', ['url' => env('url.url_prefix').$detail['evidence_url']]);
}
$company=ShopMerchant::where('id',$detail['party_a'])->find();
$request = array(
"applyNo" => $detail['contract_no'],
"fullName" => $company['company_name'],
"identityCard" => $company['organization_code'],
"identityType" => 12,
);
return app(JunziqianController::class)->EvidenceShopDownload($request);
}
}

View File

@ -0,0 +1,108 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\controller;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\ShopMerchantLists;
use app\adminapi\logic\ShopMerchantLogic;
use app\adminapi\validate\ShopMerchantValidate;
/**
* ShopMerchant控制器
* Class ShopMerchantController
* @package app\adminapi\controller
*/
class ShopMerchantController extends BaseAdminController
{
/**
* @notes 获取列表
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function lists()
{
return $this->dataLists(new ShopMerchantLists());
}
/**
* @notes 添加
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function add()
{
$params = (new ShopMerchantValidate())->post()->goCheck('add');
$result = ShopMerchantLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(ShopMerchantLogic::getError());
}
/**
* @notes 编辑
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function edit()
{
$params = (new ShopMerchantValidate())->post()->goCheck('edit');
$result = ShopMerchantLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(ShopMerchantLogic::getError());
}
/**
* @notes 删除
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function delete()
{
$params = (new ShopMerchantValidate())->post()->goCheck('delete');
ShopMerchantLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取详情
* @return \think\response\Json
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function detail()
{
$params = (new ShopMerchantValidate())->goCheck('detail');
$result = ShopMerchantLogic::detail($params);
return $this->data($result);
}
}

View File

@ -55,7 +55,7 @@ class AppUpdateLists extends BaseAdminDataLists implements ListsSearchInterface
public function lists(): array
{
return AppUpdate::where($this->searchWhere)
->field(['id', 'title', 'content', 'type', 'version', 'dow_url', 'force', 'quiet'])
->field(['id', 'title', 'content', 'type', 'version', 'dow_url', 'force', 'quiet', 'create_time', 'update_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()

View File

@ -0,0 +1,78 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\ShopContract;
use app\common\lists\ListsSearchInterface;
/**
* ShopContract列表
* Class ShopContractLists
* @package app\adminapi\lists
*/
class ShopContractLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function setSearch(): array
{
return [
'=' => ['contract_no', 'party_a', 'party_b', 'check_status'],
];
}
/**
* @notes 获取列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function lists(): array
{
return ShopContract::where($this->searchWhere)
->field(['id', 'contract_no', 'party_a', 'party_b', 'area_manager', 'type', 'evidence_url', 'check_status', 'status'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取数量
* @return int
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function count(): int
{
return ShopContract::where($this->searchWhere)->count();
}
}

View File

@ -0,0 +1,83 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\ShopMerchant;
use app\common\lists\ListsSearchInterface;
use think\facade\Db;
/**
* ShopMerchant列表
* Class ShopMerchantLists
* @package app\adminapi\lists
*/
class ShopMerchantLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function setSearch(): array
{
return [
'=' => ['company_name', 'master_name', 'master_phone'],
];
}
/**
* @notes 获取列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function lists(): array
{
return ShopMerchant::where($this->searchWhere)
->field(['id', 'company_name', 'organization_code', 'master_name', 'master_phone'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->append(['notes'], true)
->withAttr('notes',function($value,$data){
return Db::name('company_authentication_fail_log')->where('company_id',$data['id'])->where('log_type', 3)->order(['id'=>'desc'])->limit(1)->value('fail_reason');
})
->select()
->toArray();
}
/**
* @notes 获取数量
* @return int
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function count(): int
{
return ShopMerchant::where($this->searchWhere)->count();
}
}

View File

@ -16,6 +16,7 @@ namespace app\adminapi\lists\finance;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\enum\user\AccountLogEnum;
use app\common\lists\ListsExcelInterface;
use app\common\lists\ListsSearchInterface;
use app\common\model\user\UserAccountLog;
use app\common\model\user\UserRole;
@ -27,9 +28,42 @@ use app\common\service\FileService;
* Class AccountLogLists
* @package app\adminapi\lists\finance
*/
class AccountLogLists extends BaseAdminDataLists implements ListsSearchInterface
class AccountLogLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
{
/**
* @notes 导出字段
* @return string[]
* @author 段誉
* @date 2023/2/24 16:07
*/
public function setExcelFields(): array
{
return [
'user_info_sn' => '用户编号',
'company_info_company_name' => '归属公司',
'user_info_nickname' => '用户昵称',
'user_info_group_name' => '角色名称',
'user_info_mobile' => '手机号码',
'change_amount' => '变动金额',
'left_amount' => '剩余金额',
'change_type_desc' => '变动类型',
'source_sn' => '来源单号',
'create_time' => '记录时间',
];
}
/**
* @notes 导出表名
* @return string
* @author 段誉
* @date 2023/2/24 16:07
*/
public function setFileName(): string
{
return '余额明细';
}
/**
* @notes 搜索条件
* @return array
@ -89,6 +123,12 @@ class AccountLogLists extends BaseAdminDataLists implements ListsSearchInterface
$item['change_type_desc'] = AccountLogEnum::getChangeTypeDesc($item['change_type']);
$symbol = $item['action'] == AccountLogEnum::INC ? '+' : '-';
$item['change_amount'] = $symbol . $item['change_amount'];
// 用于导出
$item['user_info_sn'] = $item['user_info']['sn'];
$item['company_info_company_name'] = $item['company_info']['company_name'];
$item['user_info_nickname'] = $item['user_info']['nickname'];
$item['user_info_group_name'] = $item['user_info']['group_name'];
$item['user_info_mobile'] = $item['user_info']['mobile'];
}
return $lists;

View File

@ -4,6 +4,8 @@ namespace app\adminapi\lists\finance;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface;
use app\common\model\Company;
use app\common\model\user\UserAccountLog;
use app\common\model\user\Withdraw;
class WithdrawLists extends BaseAdminDataLists implements ListsSearchInterface
@ -51,6 +53,25 @@ class WithdrawLists extends BaseAdminDataLists implements ListsSearchInterface
->limit($this->limitOffset, $this->limitLength)
->select()
->toArray();
// 组装审核时直接跳转到余额明细列表的 开始和结束时间
foreach ($lists as &$item) {
$withdrawedCount = Withdraw::where(['user_id'=>$item['user_id'], 'status'=>3])->count();
$company = Company::where(['admin_id'=>$item['admin_id']])->find();
$item['company_name'] = $company['company_name'];
// 开始时间 如果用户第一次提现申请,则以该公司内用户 周期内第一条数据的生成时间为开始时间
if ($withdrawedCount == 0) {
$firstUserLog = UserAccountLog::where(['company_id'=>$company['id']])->order('id', 'asc')->find();
$item['s_date'] = $firstUserLog['create_time'];
} else {
// 如果用户已成功申请过提现,则以上次提现的截止日期为开始时间
$withdrawedCount = Withdraw::where(['user_id'=>$item['user_id'], 'status'=>3])->order('id', 'desc')->find();
$item['s_date'] = $withdrawedCount['transfer_end_cycel'];
}
// 结束时间
$item['e_date'] = date('Y-m-d H:i:s', $item['transfer_end_cycel']);
}
unset($item);
return $lists;
}

View File

@ -78,7 +78,8 @@ class AppUpdateLogic extends BaseLogic
'version' => $params['version'],
'dow_url' => $params['dow_url'],
'force' => $params['force'],
'quiet' => $params['quiet']
'quiet' => $params['quiet'],
'update_time'=>time()
]);
Db::commit();

View File

@ -0,0 +1,258 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\logic;
use app\api\controller\JunziqianController;
use app\api\logic\SmsLogic;
use app\common\logic\CompanyLogic;
use app\common\logic\contract\ContractLogic;
use app\common\logic\UserLogic;
use app\common\model\ShopContract;
use app\common\logic\BaseLogic;
use app\common\model\ShopMerchant;
use think\facade\Db;
/**
* ShopContract逻辑
* Class ShopContractLogic
* @package app\adminapi\logic
*/
class ShopContractLogic extends BaseLogic
{
/**
* @notes 添加
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/09/13 17:01
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
ShopContract::create([
'contract_no' => $params['contract_no'],
'type' => $params['type'],
'contract_url' => $params['contract_url'],
'evidence_url' => $params['evidence_url'],
'url' => $params['url'],
'signing_timer' => $params['signing_timer'],
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/09/13 17:01
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
ShopContract::where('id', $params['id'])->update([
'file' => $params['file'],
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/09/13 17:01
*/
public static function delete(array $params): bool
{
return ShopContract::destroy($params['id']);
}
/**
* @notes 获取详情
* @param $params
* @return array
* @author likeadmin
* @date 2023/09/13 17:01
*/
public static function detail($params): array
{
$data = Db::name('shop_contract')->where('id', $params['id'])
->withAttr('party_b_info', function ($value, $data) {
$field = ['id,company_name,company_type,company_type company_type_name,organization_code,
province,city,area,street,village,brigade,address,province province_name,city city_name,area area_name,street street_name,village village_name,brigade brigade_name,master_phone,master_name,
qualification'];
$shopMerchant = ShopMerchant::where(['id' => $data['party_b']])->field($field)->find()->toArray();
return $shopMerchant;
})
->withAttr('party_a_info', function ($value, $data) {
$field = ['id,company_name,company_type,company_type company_type_name,organization_code,
province,city,area,street,village,brigade,address,province province_name,city city_name,area area_name,street street_name,village village_name,brigade brigade_name,master_phone,master_name,
qualification'];
$shopMerchant = ShopMerchant::where(['id' => $data['party_a']])->field($field)->find()->toArray();
return $shopMerchant;
})
->withAttr('status_name', function ($value, $data) {
return $data['status'] == 1 ? '已签约' : '未签约';
})
->find();
$data['signed_contract_url'] = self::getSignedContract($data);
return $data;
}
public static function getSignedContract($contract)
{
$signedContractUrl = '';
if($contract['status'] == 1){
if ($contract['contract_url'] == '') {
$res = app(JunziqianController::class)->download_shop_file($contract['contract_no'])->getData();
if ($res['code'] == 1) {
$signedContractUrl = $res['data']['url'];
}
}else {
$signedContractUrl = env('url.url_prefix').$contract['contract_url'];
}
}
return $signedContractUrl;
}
// /**发送合同 */
public static function Draftingcontracts($params,$type=1)
{
$result = ShopMerchantLogic::detail($params);
if ($result && isset($result['contract']) && isset($result['contract']['file']) && $result['contract']['file'] != '') {
if ($result['contract']['check_status'] == 3) {
return self::setError('你已经生成过合同,请勿重复生成');
}
$name=$result['company_name'];
$data = [
'name' => $name . '的合同',
'signatories' => [
['fullName' => $name, 'identityType' => 12, 'identityCard' => $result['organization_code'], 'email' => $result['master_email'], 'noNeedVerify' => 1, 'signLevel' => 1], // 'authLevel'=>[11], 签约时验证人脸识别
['fullName' => $result['contract']['party_a_info']['company_name'], 'identityType' => 12, 'identityCard' => $result['contract']['party_a_info']['organization_code'], 'email' => $result['contract']['party_a_info']['master_email'], 'noNeedVerify' => 1, 'signLevel' => 1]
],
'url' => $result['contract']['file'],
];
$res = app(JunziqianController::class)->shopContractSigning($data, $result['contract']['id']);
if ($res->success == true) {
Db::name('shop_contract')->where('id', $result['contract']['id'])->update(['contract_no' => $res->data, 'check_status' => 3]);
self::postsms(['id'=>$result['contract']['id']]);
return true;
} else {
return self::setError($res->msg);
}
} else {
return self::setError('生成合同成功失败,联系管理员');
}
}
//**发送短信 */
public static function postsms($params)
{
$result = self::detail($params);
if ($result && $result['file'] != '') {
//发送短信
$data = [
[
"applyNo" => $result['contract_no'], //TODO *
"fullName" => $result['party_a_info']['company_name'], //TODO *
"identityCard" => $result['party_a_info']['organization_code'], //TODO *
"identityType" => 12, //TODO *
"master_phone" => $result['party_a_info']['master_phone'],
"type"=>"party_a"
],
];
$data[]= [
"applyNo" => $result['contract_no'], //TODO *
"fullName" => $result['party_b_info']['company_name'], //TODO *
"identityCard" => $result['party_b_info']['organization_code'], //TODO *
"identityType" => 12, //TODO *
"master_phone" => $result['party_b_info']['master_phone'],
"type"=>"party_b"
];
$find = Db::name('shop_contract')->where('id', $params['id'])
->withAttr('contract_type_name', function ($value, $data) {
return Db::name('dict_data')->where('id', $data['contract_type'])->value('name');
})->find();
$url = [];
foreach ($data as $k => $v) {
$res = app(JunziqianController::class)->SigningLink($v);
if ($res->success == true) {
if ($v['type'] == 'party_a') {
$url['a'] =$res->data;
} else {
$url['b'] =$res->data;
}
if ($v['type'] == 'party_a') {
$v['type'] = 'a';
}
if ($v['type'] == 'party_b') {
$v['type'] = 'b';
}
//发送短信
$sms = [
'mobile' => $v['master_phone'],
'name' => $v['fullName'],
'type' => '《商户入驻合同》',
'code' => 'api/Hetong/url?id=' . $find['id'].'&type='.$v['type'].'&t=1',
'scene' => 'WQ'
];
$result = SmsLogic::contractUrl($sms);
if ($result != true) {
return self::setError(SmsLogic::getError());
}
} else {
return self::setError($res->msg);
}
}
Db::name('shop_contract')->where('id', $find['id'])->update(['url' => json_encode($url)]);
return true;
}else{
return self::setError('没找到合同,联系管理员');
}
}
}

View File

@ -0,0 +1,120 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\logic;
use app\common\model\auth\Admin;
use app\common\model\Company;
use app\common\model\contract\Contract;
use app\common\model\contract\ShopContract;
use app\common\model\ShopMerchant;
use app\common\logic\BaseLogic;
use think\facade\Db;
/**
* ShopMerchant逻辑
* Class ShopMerchantLogic
* @package app\adminapi\logic
*/
class ShopMerchantLogic extends BaseLogic
{
/**
* @notes 添加
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/09/13 16:45
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
ShopMerchant::create([
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/09/13 16:45
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
ShopMerchant::where('id', $params['id'])->update([
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/09/13 16:45
*/
public static function delete(array $params): bool
{
return ShopMerchant::destroy($params['id']);
}
/**
* @notes 获取详情
* @param $params
* @return array
* @author likeadmin
* @date 2023/09/13 16:45
*/
public static function detail($params): array
{
$data = ShopMerchant::findOrEmpty($params['id'])->toArray();
if ($data) {
$where[]=['party_b','=', $data['id']];
if(isset($params['contract_type'])){
$where[]=['contract_type','=',$params['contract_type']];
}
$data['contract'] = ShopContract::where($where)->with(['party_a_info', 'contractType'])->find();
}
return $data;
// return ShopMerchant::findOrEmpty($params['id'])->toArray();
}
}

View File

@ -0,0 +1,94 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\validate;
use app\common\validate\BaseValidate;
/**
* ShopContract验证器
* Class ShopContractValidate
* @package app\adminapi\validate
*/
class ShopContractValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
];
/**
* @notes 添加场景
* @return ShopContractValidate
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function sceneAdd()
{
return $this->remove('id', true);
}
/**
* @notes 编辑场景
* @return ShopContractValidate
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function sceneEdit()
{
return $this->only(['id']);
}
/**
* @notes 删除场景
* @return ShopContractValidate
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return ShopContractValidate
* @author likeadmin
* @date 2023/09/13 17:01
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -0,0 +1,94 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\validate;
use app\common\validate\BaseValidate;
/**
* ShopMerchant验证器
* Class ShopMerchantValidate
* @package app\adminapi\validate
*/
class ShopMerchantValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
];
/**
* @notes 添加场景
* @return ShopMerchantValidate
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function sceneAdd()
{
return $this->remove('id', true);
}
/**
* @notes 编辑场景
* @return ShopMerchantValidate
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function sceneEdit()
{
return $this->only(['id']);
}
/**
* @notes 删除场景
* @return ShopMerchantValidate
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return ShopMerchantValidate
* @author likeadmin
* @date 2023/09/13 16:45
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -27,10 +27,20 @@ class HetongController extends BaseApiController
{
$id = Request()->get('id');
$type = Request()->get('type');
$params = Request()->param();
$msg='合同不存在';
if(empty($type)){
$msg='参数错误';
}
if (isset($params['t']) && $params['t'] == 1) {
$find = Db::name('shop_contract')->where('id', $id)->find();
if ($find && $find['url']) {
$url = json_decode($find['url'], true);
if(isset($url[$type])){
return redirect($url[$type]);
}
}
}
if ($id && $type) {
$find = Db::name('contract')->where('id', $id)->find();
if ($find && $find['url']) {

View File

@ -17,11 +17,16 @@ use app\api\logic\IndexLogic;
use app\common\logic\RedisLogic;
use app\common\model\Company;
use app\common\model\company\CompanyProperty;
use app\common\model\contract\Contract;
use app\common\model\contract\ShopContract;
use app\common\model\contract\VehicleContract;
use app\common\model\ShopMerchant;
use app\common\model\vehicle\VehicleRent;
use Symfony\Component\HttpClient\HttpClient;
use think\cache\driver\Redis;
use think\facade\Db;
use think\facade\Log;
use think\model\Pivot;
use think\response\Json;
@ -118,6 +123,38 @@ class IndexController extends BaseApiController
}
return json(['success' => true, 'msg' => '成功']);
}
/**商户合同签约回调 */
public function shopContractNotifyUrl()
{
$a = Request()->get();
Log::info(['商户合同签约回调', $a]);
// 获取合同详情
if ($a) {
$find = Db::name('shop_contract')->where('id', $a['id'])->find();
if ($find) {
// 合同一方已签约
if ($find['signing_timer'] == 0) {
Db::name('shop_contract')->where('id', $a['id'])->update(['signing_timer' => 1]);
return true;
} else if ($find['signing_timer'] == 1) {
// 合同另一方已签约,修改合同状态,修改公司状态
Db::name('shop_contract')->where('id', $a['id'])->update(['status' => 1, 'signing_timer' => 2]);
Db::name('shop_merchant')->where('id', $find['party_a'])->update(['status' => 1, 'is_contract' => 1]);
Db::name('shop_merchant')->where('id', $find['party_b'])->update(['status' => 1, 'is_contract' => 1]);
// 通知商城,商户签约完成
$shopMerchant = ShopMerchant::find(['id' => $find['party_b']]);
$requestUtil = HttpClient::create()->request('POST', env('url.shop_prefix') . '/api/merchant/syncStatus/'.$shopMerchant['mer_intention_id'], [
'body' => ['status' => 1]
]);
Log::info(['商户合同签约回调-商城响应', env('url.shop_prefix') . '/api/merchant/syncStatus/'.$shopMerchant['mer_intention_id']]);
Log::info(['商户合同签约回调-商城响应', $requestUtil->getContent()]);
}
}
}
return json(['success' => true, 'msg' => '成功']);
}
//镇街车辆租赁回调
public function townCarRent() {
@ -496,24 +533,31 @@ class IndexController extends BaseApiController
Log::info(['认证回调:',$parmas]);
try {
if ($parmas) {
$data=json_decode($parmas['data'],true);
// 成功回调标记
$redis = RedisLogic::getInstance();
$cache = $redis->get('authentication_company_id_'.$parmas['id']);
if (!empty($cache)) {
$cacheData = json_decode($cache, true);
$cacheData['is_callback'] = 1;
$redis->set('authentication_company_id_'.$parmas['id'], json_encode($cacheData));
// 商城系统商户入驻
if (isset($parmas['type']) && $parmas['type'] == 'shop_merchant') {
$this->shopMerchantCall($parmas);
return json(['success' => true, 'msg' => '成功']);
} else {
$data=json_decode($parmas['data'],true);
// 成功回调标记
$redis = RedisLogic::getInstance();
$cache = $redis->get('authentication_company_id_'.$parmas['id']);
if (!empty($cache)) {
$cacheData = json_decode($cache, true);
$cacheData['is_callback'] = 1;
$redis->set('authentication_company_id_'.$parmas['id'], json_encode($cacheData));
}
if($data['status']==1){
Company::where('id', $parmas['id'])->update(['is_authentication' => 1]);
}
if($data['status']==2){
// 记录认证失败原因
Db::name('company_authentication_fail_log')->insert(['company_id'=>$parmas['id'],'fail_reason'=>$data['msg'],'create_time'=>time()]);
Company::where('id', $parmas['id'])->update([ 'is_contract'=>0]);
}
return json(['success' => true, 'msg' => '成功']);
}
if($data['status']==1){
Company::where('id', $parmas['id'])->update(['is_authentication' => 1]);
}
if($data['status']==2){
// 记录认证失败原因
Db::name('company_authentication_fail_log')->insert(['company_id'=>$parmas['id'],'fail_reason'=>$data['msg'],'create_time'=>time()]);
Company::where('id', $parmas['id'])->update([ 'is_contract'=>0]);
}
return json(['success' => true, 'msg' => '成功']);
}
} catch (\Exception $e) {
Log::error('认证回调错误:'.$e->getMessage());
@ -521,4 +565,33 @@ class IndexController extends BaseApiController
return json(['success' => false, 'msg' => '失败,没有参数']);
}
private function shopMerchantCall($parmas)
{
$shopMerchant = ShopMerchant::find(['id', $parmas['id']]);
$data=json_decode($parmas['data'],true);
if($data['status']==1){
$shopMerchant->save(['is_authentication' => 1]);
// 生成合同
$createContractData = [
'id' => $parmas['id'],
'party_a' => 1,
'party_a_name' => '泸州市海之农科技有限公司',
'party_b' => $parmas['id'],
'party_b_name' => $shopMerchant->company_name,
'contract_type' => 22,
];
$model = new ShopContract();
$model->contract_no = time();
$model->create_time = time();
$model->check_status = 1;
$model->update_time = time();
$model->setAttrs($createContractData);
$res = $model->save($createContractData);
}
if($data['status']==2){
// 记录认证失败原因
Db::name('company_authentication_fail_log')->insert(['company_id'=>$parmas['id'], 'log_type'=>3, 'fail_reason'=>$data['msg'], 'create_time'=>time()]);
}
}
}

View File

@ -92,6 +92,30 @@ class JunziqianController extends BaseApiController
return $response;
}
/**
* @param $data
* @return object
* 商城商户入驻,实名认证
*/
public function ShopMerchantCertification($data)
{
$requestUtils = new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
$request = new OrganizationCreateReq();
$request->name = $data['name'];
$request->identificationType = 1; //证件类型0多证,1多证合一
$request->organizationType = 0; //组织类型 0企业,1事业单位
$request->organizationRegNo = $data['organization_code'];
$request->organizationRegImg = $data['business_license'];
$request->legalName = $data["master_name"]; //法人
if (isset($data['master_email'])) {
$request->emailOrMobile = $data['master_email']; //邮箱
}
$request->notifyUrl = env('url.url_prefix') . '/notifyAuthentication?id=' . $data['id'].'&type=shop_merchant'; // 回调增加type参数用于回调是辨别是商户认证会带
//发起创建企业请求
$response = $requestUtils->doPost("/v2/user/organizationCreate", $request);
return $response;
}
//重新提交企业实名认证
public function organizationReapply($data)
{
@ -160,6 +184,26 @@ class JunziqianController extends BaseApiController
$response = $requestUtils->doPost("/v2/sign/applySign", $request);
return $response;
}
public function shopContractSigning($data, $id, $notify = '')
{
if ($notify == '') {
$notify = env('url.url_prefix') . '/shop_contract_notify_url';
}
$requestUtils = new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
$request = new ApplySignReq();
$request->contractName = $data['name'];
$request->signatories = $data['signatories']; //签约方
// $request->faceThreshold = 79; // 人脸识别阀值:默认等级(1-100之间整数),建议范围(60-79)
$request->serverCa = 1; //是否需要服务端云证书
$request->fileType = 1; //合同上传方式 url
$request->url = $data['url'];
$request->notifyUrl = $notify . '?id=' . $id;
$request->needQifengSign = 1;
//发起PING请求
// halt($request);
$response = $requestUtils->doPost("/v2/sign/applySign", $request);
return $response;
}
// 企业人脸校验上传
public function OrganizationFaceCreate($data)
@ -308,6 +352,26 @@ class JunziqianController extends BaseApiController
return $this->fail('获取失败');
}
}
public function download_shop_file($applyNo)
{
$requestUtils = new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
$find = Db::name('contract')->where('contract_no', $applyNo)->value('contract_url');
if ($find) {
return $this->success('获取成功', ['url' => env('url.url_prefix') . $find]);
}
//初始化请求参数
$request = array(
"applyNo" => $applyNo, //TODO +
);
$response = $requestUtils->doPost("/v2/sign/linkFile", $request);
if ($response->success == true) {
$this->getDownload($response->data, root_path() . 'public/uploads/contract/' . $applyNo . '.pdf');
Db::name('shop_contract')->where('contract_no', $applyNo)->update(['contract_url' => '/uploads/contract/' . $applyNo . '.pdf']);
return $this->success('获取成功', ['url' => env('url.url_prefix') . '/uploads/contract/' . $applyNo . '.pdf']);
} else {
return $this->fail('获取失败');
}
}
/**
* 保全后合同文件及证据包下载
*/
@ -333,6 +397,32 @@ class JunziqianController extends BaseApiController
}
}
/**
* 保全后合同文件及证据包下载
*/
public function EvidenceShopDownload($param)
{
//初始化请求参数
$requestUtils = new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
$request = array(
"applyNo" => $param['applyNo'],
"fullName" => $param['fullName'],
"identityCard" => $param['identityCard'],
"identityType" => 12,
"dealType" => 1,
);
$response = $requestUtils->doPost("/v2/sign/presLinkFile", $request);
if ($response->success == true) {
$this->getDownload($response->data, root_path() . 'public/uploads/evidence_shop_contract/' . $param['applyNo'] . '.zip');
Db::name('shop_contract')->where('contract_no', $param['applyNo'])->update(['evidence_url' => '/uploads/evidence_shop_contract/' . $param['applyNo'] . '.zip']);
return $this->success('获取成功', ['url' => env('url.url_prefix') . '/uploads/evidence_shop_contract/' . $param['applyNo'] . '.zip']);
} else {
return $this->fail('获取失败');
}
}
public function getDownload($url, $publicDir = '', $fileName = '', $type = 0)
{

View File

@ -12,16 +12,15 @@ class RemoteController extends BaseApiController
public array $notNeedLogin = ['index'];
public function shang_date_total_price($company,$arr=[],$template_id=0)
public function shang_date_total_price($company, $arr = [], $template_id = 0)
{
$start_time = date('Y-m-d');
$time=strtotime($start_time)+86399;
$end_time=date('Y-m-d H:i:s',$time);
$time = strtotime($start_time) + 86399;
$end_time = date('Y-m-d H:i:s', $time);
if(isset($arr['start_time']) && $arr['end_time']){
if (isset($arr['start_time']) && $arr['end_time']) {
$start_time = $arr['start_time'];
$end_time = $arr['end_time'];
}
$parmas = [
"start_date" => $start_time,
@ -55,11 +54,11 @@ class RemoteController extends BaseApiController
break;
default:
Log::error('任务结算失败,公司类型错误:' . $company['company_type']);
Log::error('片区交易错误:'.$company);
Log::error('片区交易错误:' . $company);
return false;
}
try {
$res = HttpClient::create()->request('GET', env('url.shop_prefix').'/api/order/statistics', [
$res = HttpClient::create()->request('GET', env('url.shop_prefix') . '/api/order/statistics', [
'query' => $parmas,
]);
$json = json_decode($res->getContent(), true);
@ -71,11 +70,11 @@ class RemoteController extends BaseApiController
$arr['total_price'] = $json['data']['total_price'];
//基础金额*(每日基户数*天数)//且户数小于公司总户数
$user_count = UserInformationg::where('company_id', $company['id'])->count();
$day_count=TaskTemplate::where('id',$template_id)->value('day_count');
$day_count = TaskTemplate::where('id', $template_id)->value('day_count');
//
if($day_count==0){
if ($day_count == 0) {
$user_count_two = 5 * 1;
}else{
} else {
$user_count_two = 5 * $day_count;
}
if ($user_count_two > $user_count) {
@ -98,20 +97,15 @@ class RemoteController extends BaseApiController
}
}
public function shang_date_list($company,$is_day,$querys){
if($is_day==1){
$start_time = date('Y-m-d');
$time=strtotime($start_time)+86399;
$end_time=date('Y-m-d H:i:s',$time);
}else{
$start_time = date('Y-m-d',strtotime('-1 day', time()));
$time=strtotime($start_time)+86399;
$end_time=date('Y-m-d H:i:s',$time);
}
if(isset($querys['start_time']) && isset($querys['end_time'])){
public function shang_date_list($company, $querys)
{
$start_time = date('Y-m-d');
$time = strtotime($start_time) + 86399;
$end_time = date('Y-m-d H:i:s', $time);
if (isset($querys['start_time']) && isset($querys['end_time'])) {
$start_time = $querys['start_time'];
$end_time = $querys['end_time'];
}
$parmas = [
"start_date" => $start_time,
@ -147,54 +141,54 @@ class RemoteController extends BaseApiController
return false;
}
if(isset($querys['page'])){
$parmas['page']=$querys['page'];
if (isset($querys['page'])) {
$parmas['page'] = $querys['page'];
}
try{
$list = HttpClient::create()->request('GET', env('url.shop_prefix').'/api/region/order', [
try {
$list = HttpClient::create()->request('GET', env('url.shop_prefix') . '/api/region/order', [
'query' => $parmas,
]);
$json_list = json_decode($list->getContent(), true);
$data=[];
if($json_list['status'] == 200){
$data=$json_list['data']['list'];
$data = [];
if ($json_list['status'] == 200) {
$data = $json_list['data']['list'];
}
return $data;
}catch(\Exception $e){
} catch (\Exception $e) {
return false;
}
}
/**
*
* 获取坐标的距离
*/
public function coordinate($parmas,$longitude1,$latitude1){
$res = HttpClient::create()->request('GET', env('project.logistic_domain').'/api/getCarHistory', [
public function coordinate($parmas, $longitude1, $latitude1)
{
$res = HttpClient::create()->request('GET', env('project.logistic_domain') . '/api/getCarHistory', [
'query' => $parmas,
]);
$json=json_decode($res->getContent(),true);
$points=$json['data'];
if(empty($points)){
$json = json_decode($res->getContent(), true);
$points = $json['data'];
if (empty($points)) {
return false;
}
$target =[
"lat"=> $latitude1,
"lon"=> $longitude1
$target = [
"lat" => $latitude1,
"lon" => $longitude1
];
$closestPoint = $this->getClosestPoint($points, $target);
return $this->calculateDistance($target['lon'], $target['lat'], $closestPoint[0]['lon'], $closestPoint[0]['lat']);
return $this->calculateDistance($target['lon'], $target['lat'], $closestPoint[0]['lon'], $closestPoint[0]['lat']);
}
/**
*
* 计算两点之间的距离
*/
function getClosestPoint($points, $target) {
function getClosestPoint($points, $target)
{
$minDistance = PHP_INT_MAX;
$closestPoint = null;
foreach ($points as $point) {
@ -203,29 +197,30 @@ class RemoteController extends BaseApiController
if ($distance < $minDistance) {
$minDistance = $distance;
$closestPoint = $point;
}else{
$distance=0;
} else {
$distance = 0;
}
}
return [$closestPoint,$distance];
return [$closestPoint, $distance];
}
/**
*
* 计算两点之间的距离
*/
function calculateDistance( $longitude1,$latitude1, $longitude2,$latitude2 ) {
function calculateDistance($longitude1, $latitude1, $longitude2, $latitude2)
{
$earthRadius = 6371; // 地球半径,单位为公里
$dLat = deg2rad($latitude2 - $latitude1);
$dLon = deg2rad($longitude2 - $longitude1);
$a = sin($dLat/2) * sin($dLat/2) +
$a = sin($dLat / 2) * sin($dLat / 2) +
cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) *
sin($dLon/2) * sin($dLon/2);
sin($dLon / 2) * sin($dLon / 2);
$c = 2 * asin(sqrt($a));
return $earthRadius * $c*100;
return $earthRadius * $c * 100;
}
}

View File

@ -62,12 +62,12 @@ class TaskController extends BaseApiController
if ($find != false) {
if($time<time()){
$transaction_pool=TaskTemplate::where('id',$item['template_id'])->value('transaction_pool');
if($transaction_pool==0){
$find['arr']['transaction_pool']=0;
}else{
$find['arr']['transaction_pool']=$transaction_pool;
}
$res[$k]['extend']['transaction'] = $find;
if($transaction_pool==0){
$res[$k]['extend']['transaction']['arr']['transaction_pool']=$find['arr']['total_price'];
}else{
$res[$k]['extend']['transaction']['arr']['transaction_pool']=bcadd($res[$k]['extend']['transaction']['arr']['total_price'],$transaction_pool,2);
}
}
// Task::where('id',$item['id'])->update(['extend'=>json_encode(['transaction'=>$find],true)]);
} else {
@ -93,13 +93,19 @@ class TaskController extends BaseApiController
// $list = App(RemoteController::class)->shang_date_list($company, 1, $parmas);
$parmas['start_time']=date('Y-m-d',$task['start_time']);
$parmas['end_time']=$task['end_time'].' 23:59:59';
$list = App(RemoteController::class)->shang_date_list($company, 1, $parmas);
$list = App(RemoteController::class)->shang_date_list($company, $parmas);
$shang_date_total_price = App(RemoteController::class)->shang_date_total_price($company,$parmas,$task['template_id']);
if ($task != false) {
$find['list'] = $list;
if($transaction_pool==0){
$task['extend']['transaction']['arr']['transaction_pool']=0;
$task['extend']['transaction']['arr']['transaction_pool']=$shang_date_total_price['arr']['total_price'];
}else{
$task['extend']['transaction']['arr']['transaction_pool']=$transaction_pool;
$task['extend']['transaction']['arr']['transaction_pool']=bcadd($shang_date_total_price['arr']['total_price'],$transaction_pool,2);
}
if($task['start_time']<strtotime(date('Y-m-d'))){
$task['extend']['transaction']['arr']['is_show']=false;
}else{
$task['extend']['transaction']['arr']['is_show']=true;
}
$find['extend']=$task['extend'];
return $this->success('ok', $find);

View File

@ -0,0 +1,121 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\api\controller;
use IFlytek\Xfyun\Speech\ChatClient;
use WebSocket\Client;
/**
* 讯飞
* Class WechatController
*/
class XunFeiController extends BaseApiController
{
public array $notNeedLogin = ['chat'];
private $app_id='2eda6c2e';
private $api_key='12ec1f9d113932575fc4b114a2f60ffd';
private $api_secret='MDEyMzE5YTc5YmQ5NjMwOTU1MWY4N2Y2';
public function chat()
{
header('X-Accel-Buffering: no');
$parmas=$this->request->param('content');
if(empty($parmas)){
return $this->success('success');
}
$chat=new ChatClient($this->app_id,$this->api_key,$this->api_secret);
$client = new Client($chat->assembleAuthUrl('wss://spark-api.xf-yun.com/v2.1/chat'));
// 连接到 WebSocket 服务器
if ($client) {
// 发送数据到 WebSocket 服务器
$data = $this->getBody($this->app_id,$parmas);
$client->send($data);
// 从 WebSocket 服务器接收数据
$answer = "";
while(true){
$response = $client->receive();
$resp = json_decode($response,true);
$code = $resp["header"]["code"];
// echo "从服务器接收到的数据: " . $response;
if(0 == $code){
$status = $resp["header"]["status"];
if($status != 2){
$content = $resp['payload']['choices']['text'][0]['content'];
$answer .= $content;
print($answer);
ob_flush(); // 刷新输出缓冲区
flush(); // 刷新系统输出缓冲区
}else{
$content = $resp['payload']['choices']['text'][0]['content'];
$answer .= $content;
$total_tokens = $resp['payload']['usage']['text']['total_tokens'];
print("\n本次消耗token用量\n");
print($total_tokens);
ob_flush(); // 刷新输出缓冲区
flush(); // 刷新系统输出缓冲区
break;
}
}else{
return $this->fail( "服务返回报错".$response);
break;
}
}
ob_flush(); // 刷新输出缓冲区
flush(); // 刷新系统输出缓冲区
return $this->success('success');
} else {
return $this->fail('无法连接到 WebSocket 服务器');
}
}
//构造参数体
function getBody($appid,$question){
$header = array(
"app_id" => $appid,
"uid" => "1"
);
$parameter = array(
"chat" => array(
"domain" => "generalv2",
"temperature" => 0.5,
"max_tokens" => 1024
)
);
$payload = array(
"message" => array(
"text" => array(
array("role" => "user", "content" => $question)
)
)
);
$json_string = json_encode(array(
"header" => $header,
"parameter" => $parameter,
"payload" => $payload
));
return $json_string;
}
}

View File

@ -81,7 +81,7 @@ class CompanyLogic extends BaseLogic
'master_id_card' => $params['id_card'], // 主联系人证件号 todo DDL 新增字段
'master_position' => $params['master_position'],
'master_phone' => $params['master_phone'],
'master_email' => substr(md5(uniqid(),uniqid()),rand(0, 32),10)."@lihai.com", // 随机邮箱
'master_email' => substr(md5(uniqid()),rand(0, 22),10)."@lihai.com", // 随机邮箱
'other_contacts' => $params['other_contacts'],
'area_manager' => $params['area_manager'] ?? 0,
'qualification' => $params['qualification'],

View File

@ -189,7 +189,7 @@ class ContractLogic extends BaseLogic
$signedContractUrl = '';
if($contract['status'] == 1){
if ($contract['contract_url'] == '') {
$res = app(JunziqianController::class)->download_file($contract['contract_no']);
$res = app(JunziqianController::class)->download_file($contract['contract_no'])->getData();
if ($res['code'] == 1) {
$signedContractUrl = $res['data']['url'];
}

View File

@ -43,7 +43,7 @@ class WithdrawLogic extends BaseLogic
// 拒绝通过审核,记录备注原因
if ($params['status'] == 2) {
Withdraw::where(['id'=>$withDrawInfo['id']])->update(['status'=>2, 'deny_desc'=>$params['notes']]);
Withdraw::where(['id'=>$withDrawInfo['id']])->update(['status'=>2, 'deny_desc'=>$params['deny_desc']]);
return true;
}

View File

@ -82,7 +82,8 @@ class TaskLogic extends BaseLogic
return true;
}
}
$v['day_count']=$v['day_count']+1;
$v_day_count=$v['day_count'];
$v_day_count=$v_day_count+1;
$time = strtotime(date('Y-m-d'));
$TaskSchedulingPlan_data = [
'create_user_id' => 0,
@ -158,10 +159,10 @@ class TaskLogic extends BaseLogic
//基础金额*(每日基户数*天数)//且户数小于公司总户数
$user_count = UserInformationg::where('company_id', $v['company_id'])->count();
//
if ($v['day_count'] == 0) {
if ($v_day_count == 0) {
$user_count_two = 5 * 1;
} else {
$user_count_two = 5 * $v['day_count'];
$user_count_two = 5 * $v_day_count;
}
if ($user_count_two > $user_count) {
$user_count_money = 58 * $user_count;
@ -185,27 +186,29 @@ class TaskLogic extends BaseLogic
//任务金额
private static function task_money($v, $datas)
{
$v_day_count=$v['day_count'];
$v_day_count=$v_day_count+1;
if ($v['types'] == 1 || $v['types'] == 3) {
if ($v['day_count'] <= $v['stage_day_one']) {
if ($v_day_count <= $v['stage_day_one']) {
return $v['money'];
} else {
return $v['money_two'];
}
} elseif ($v['types'] == 2) {
if ($v['day_count'] <= $v['stage_day_one']) {
if ($v_day_count<= $v['stage_day_one']) {
return $v['money'];
} elseif ($v['day_count'] <= $v['stage_day_two']) {
} elseif ($v_day_count <= $v['stage_day_two']) {
return $v['money_two'];
} else {
return $v['money_three'];
}
} else {
if ($v['day_count'] <= $v['stage_day_one']) {
if ($v_day_count <= $v['stage_day_one']) {
$a = $v['money'];
} else {
$a = $v['money_two'];
}
if ($v['day_count'] >= $v['stage_day_two']) {
if ($v_day_count >= $v['stage_day_two']) {
TaskTemplate::where('id', $v['id'])->update(['status' => 0]);
}
return $a;

View File

@ -0,0 +1,34 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model;
use app\common\model\BaseModel;
/**
* ShopContract模型
* Class ShopContract
* @package app\common\model
*/
class ShopContract extends BaseModel
{
protected $name = 'shop_contract';
}

View File

@ -0,0 +1,61 @@
<?php
namespace app\common\model;
use app\common\model\contract\Contract;
use app\common\model\dict\DictData;
use think\facade\Db;
class ShopMerchant extends BaseModel
{
protected $name = 'shop_merchant';
public function getCompanyTypeNameAttr($value)
{
return DictData::where('id', $value)->value('name');
}
public function getProvinceNameAttr($value)
{
return Db::name('geo_province')->where(['province_code' => $this->province])->value('province_name');
}
public function getCityNameAttr($value)
{
return Db::name('geo_city')->where(['city_code' => $this->city])->value('city_name');
}
public function getAreaNameAttr($value)
{
return Db::name('geo_area')->where(['area_code' => $this->area])->value('area_name');
}
public function getStreetNameAttr($value)
{
return Db::name('geo_street')->where(['street_code' => $this->street])->value('street_name');
}
public function getVillageNameAttr($value)
{
return Db::name('geo_village')->where(['village_code' => $this->village])->value('village_name');
}
public function getBrigadeNameAttr($value)
{
return Db::name('geo_brigade')->where(['id' => $this->brigade])->value('brigade_name');
}
public function getAreaManagerNameAttr($value)
{
return Db::name('admin')->where(['id' => $this->area_manager])->value('name');
}
public function getContractAttr()
{
$find=Contract::where('party_a|party_b', $this->id)->field('check_status,status')->find();
if($find){
return $find->toArray();
}else{
return [];
}
}
}

View File

@ -0,0 +1,57 @@
<?php
namespace app\common\model\contract;
use app\common\model\BaseModel;
use app\common\model\Company;
use app\common\model\dict\DictData;
use app\common\model\ShopMerchant;
class ShopContract extends BaseModel
{
protected $name = 'shop_contract';
/**
* @notes 关联company_name
* @return \think\model\relation\HasOne
* @author likeadmin
* @date 2023/07/18 14:28
*/
public function companyName()
{
return $this->hasOne(ShopMerchant::class, 'id', 'company_id')->bind(['company_name']);
}
public function company()
{
return $this->hasOne(ShopMerchant::class, 'id', 'company_id');
}
public function partyAInfo()
{
return $this->hasOne(ShopMerchant::class, 'id', 'party_a')->field('id,company_name,organization_code,master_name,master_phone,master_email,area_manager');
}
public function partyBInfo()
{
// halt($this->type);
// if($this->type==1){
return $this->hasOne(ShopMerchant::class, 'id', 'party_b')->field('id,company_name,organization_code,master_name,master_phone,master_email,area_manager');
// }else{
// return $this->hasOne(User::class, 'id', 'party_b')->field('id,nickname company_name');
// }
}
public function partyA()
{
return $this->hasOne(ShopMerchant::class, 'id', 'party_a')->bind(['party_a_name' => 'company_name']);
}
public function partyB()
{
return $this->hasOne(ShopMerchant::class, 'id', 'party_b')->bind(['party_b_name' => 'company_name']);
}
public function contractType()
{
return $this->hasOne(DictData::class, 'id', 'contract_type')->bind(['contract_type_name' => 'name']);
}
public function getContractTypeNameAttr($value)
{
return DictData::where(['id' => $this->contract_type])->value('name');
}
}

View File

@ -44,19 +44,19 @@ class TaskInformationJob
} elseif
//交易金额
($data['template_info']['type'] == 33) {
$shang_date_total_price = App(RemoteController::class)->shang_date_total_price($company);
$shang_date_total_price = App(RemoteController::class)->shang_date_total_price($company,[],$data['template_id']);
if ($shang_date_total_price == false) {
Log::info('交易金额任务,交易金额未达到要求:' . json_encode($data));
Task::where('id', $data['task_id'])->update(['status' => 5]);
return false;
}
$transaction_pool=$data['template_info']['transaction_pool'];//交易金额剩余池
$count_money=bcadd($shang_date_total_price['arr']['total_price'],$transaction_pool,2);
$count_money=bcadd($shang_date_total_price['arr']['total_price'],$transaction_pool,2);//交易金额加资金池金额
if($count_money>$shang_date_total_price['arr']['day_money']){
$day_money=bcsub($count_money,$shang_date_total_price['arr']['day_money'],2);//当计算剩余池before_transaction_pool
$shang_date_total_price['arr']['before_transaction_pool']=$transaction_pool;//变化前
$shang_date_total_price['arr']['after_count_transaction_pool']=$count_money;//变化后
$shang_date_total_price['arr']['after_transaction_pool']=$day_money;//变化后
Task::where('id', $data['task_id'])->update(['status' => 3,'extend'=>json_encode(['transaction'=>$shang_date_total_price])]);
TaskTemplate::where('id',$data['template_info']['id'])->update(['transaction_pool'=>$day_money]);
$shang_date_total_price['arr']['status']=1;

View File

@ -36,7 +36,9 @@
"w7corp/easywechat": "^6.8",
"yunwuxin/think-cron": "^3.0",
"topthink/think-queue": "^3.0",
"firebase/php-jwt": "^6.8"
"firebase/php-jwt": "^6.8",
"guzzlehttp/guzzle": "^7.8",
"textalk/websocket": "^1.6"
},
"require-dev": {
"symfony/var-dumper": "^4.2",

173
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "fdd9d31f9958a1263e4623ab634b9cc9",
"content-hash": "a4417a460f7b9e7f5f161c5064f27b02",
"packages": [
{
"name": "adbario/php-dot-notation",
@ -542,28 +542,17 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.7.0",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5"
},
"version": "7.8.0",
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5",
"reference": "fb7566caccf22d74d1ab270de3551f72a58399f5",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
"url": "https://mirrors.tencent.com/repository/composer/guzzlehttp/guzzle/7.8.0/guzzlehttp-guzzle-7.8.0.zip",
"reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9",
"shasum": ""
},
"require": {
"ext-json": "*",
"guzzlehttp/promises": "^1.5.3 || ^2.0",
"guzzlehttp/psr7": "^1.9.1 || ^2.4.5",
"guzzlehttp/promises": "^1.5.3 || ^2.0.1",
"guzzlehttp/psr7": "^1.9.1 || ^2.5.1",
"php": "^7.2.5 || ^8.0",
"psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0"
@ -599,7 +588,6 @@
"GuzzleHttp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@ -652,25 +640,7 @@
"rest",
"web service"
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.7.0"
},
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://github.com/Nyholm",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
"type": "tidelift"
}
],
"time": "2023-05-21T14:04:53+00:00"
"time": "2023-08-27T10:20:53+00:00"
},
{
"name": "guzzlehttp/guzzle-services",
@ -1964,6 +1934,92 @@
},
"time": "2023-02-25T12:24:49+00:00"
},
{
"name": "phrity/net-uri",
"version": "1.3.0",
"dist": {
"type": "zip",
"url": "https://mirrors.cloud.tencent.com/repository/composer/phrity/net-uri/1.3.0/phrity-net-uri-1.3.0.zip",
"reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43",
"shasum": ""
},
"require": {
"php": "^7.4 | ^8.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0 | ^2.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpunit/phpunit": "^9.0 | ^10.0",
"squizlabs/php_codesniffer": "^3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Phrity\\Net\\": "src/"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "PSR-7 Uri and PSR-17 UriFactory implementation",
"homepage": "https://phrity.sirn.se/net-uri",
"keywords": [
"psr-17",
"psr-7",
"uri",
"uri factory"
],
"time": "2023-08-21T10:33:06+00:00"
},
{
"name": "phrity/util-errorhandler",
"version": "1.0.1",
"dist": {
"type": "zip",
"url": "https://mirrors.cloud.tencent.com/repository/composer/phrity/util-errorhandler/1.0.1/phrity-util-errorhandler-1.0.1.zip",
"reference": "dc9ac8fb70d733c48a9d9d1eb50f7022172da6bc",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpunit/phpunit": "^8.0|^9.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"autoload": {
"psr-4": {
"": "src/"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Sören Jensen",
"email": "sirn@sirn.se",
"homepage": "https://phrity.sirn.se"
}
],
"description": "Inline error handler; catch and resolve errors for code block.",
"homepage": "https://phrity.sirn.se/util-errorhandler",
"keywords": [
"error",
"warning"
],
"time": "2022-10-27T12:14:42+00:00"
},
{
"name": "psr/cache",
"version": "2.0.0",
@ -4424,6 +4480,47 @@
},
"time": "2023-08-09T00:06:15+00:00"
},
{
"name": "textalk/websocket",
"version": "1.6.3",
"dist": {
"type": "zip",
"url": "https://mirrors.cloud.tencent.com/repository/composer/textalk/websocket/1.6.3/textalk-websocket-1.6.3.zip",
"reference": "67de79745b1a357caf812bfc44e0abf481cee012",
"shasum": ""
},
"require": {
"php": "^7.4 | ^8.0",
"phrity/net-uri": "^1.0",
"phrity/util-errorhandler": "^1.0",
"psr/http-message": "^1.0",
"psr/log": "^1.0 | ^2.0 | ^3.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.0",
"phpunit/phpunit": "^9.0",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
"autoload": {
"psr-4": {
"WebSocket\\": "lib"
}
},
"license": [
"ISC"
],
"authors": [
{
"name": "Fredrik Liljegren"
},
{
"name": "Sören Jensen"
}
],
"description": "WebSocket client and server",
"time": "2022-11-07T18:59:33+00:00"
},
{
"name": "thenorthmemory/xml",
"version": "1.1.1",

View File

@ -0,0 +1,41 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core\Config;
/**
* 配置类接口
*
* @author guizheng@iflytek.com
*/
interface ConfigInterface
{
/**
* 返回配置内容的json形式
*
* @return string
*/
public function toJson();
/**
* 返回配置内容的数组形式
*
* @return array
*/
public function toArray();
}

View File

@ -0,0 +1,53 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core\Handler;
use GuzzleHttp\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
/**
* GuzzleHttp-7处理类
*
* @author guizheng@iflytek.com
*/
class Guzzle7HttpHandler{
/**
* @var ClientInterface
*/
private $client;
/**
* @param ClientInterface $client
*/
public function __construct(ClientInterface $client)
{
$this->client = $client;
}
/**
* 接收Psr-7的request对象和请求参数返回Psr-7的response对象
*
* @param RequestInterface $request
* @param array $options
* @return ResponseInterface
*/
public function __invoke(RequestInterface $request, array $options = [])
{
return $this->client->send($request, $options);
}
}

View File

@ -0,0 +1,45 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core\Handler;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
/**
* HttpHandler工厂类
*
* @author guizheng@iflytek.com
*/
class HttpHandlerFactory
{
/**
* 根据安装的GuzzleHttp版本获取默认的处理类
*
* @param ClientInterface $client
* @return Guzzle6HttpHandler|Guzzle7HttpHandler
* @throws \Exception
*/
public static function build(ClientInterface $client = null)
{
$client = $client ?: new Client();
return new Guzzle7HttpHandler($client);
}
}

View File

@ -0,0 +1,126 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core\Handler;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
use WebSocket\Client;
use WebSocket\Exception;
use GuzzleHttp\Psr7\Response;
use Psr\Log\{LoggerAwareInterface, LoggerInterface, NullLogger};
/**
* WebSocket处理类
*
* @author guizheng@iflytek.com
*/
class WsHandler implements LoggerAwareInterface
{
use JsonTrait;
/**
* @var WebSocket\Client ws client
*/
private $client;
/**
* @var string 发送的字符串
*/
private $input;
/**
* @var LoggerInterface or null 日志处理
*/
private $logger;
public function __construct($uri, $input, $timeout = 300, $logger = null)
{
$this->client = new Client($uri);
$this->client->setTimeout($timeout);
$this->input = $input;
$this->logger = $logger ?: new NullLogger();
}
/**
* 发送并等待获取返回
*
* 这是一个同步阻塞的过程,调用将持续到结果返回或者出现超时
*/
public function sendAndReceive()
{
$result = '';
try {
$this->logger->info("Start to send data, input: {$this->input}");
$this->client->send($this->input);
$printSid = true;
while (true) {
$message = $this->jsonDecode($this->client->receive());
if ($message->code !== 0) {
throw new \Exception(json_encode($message));
}
if ($printSid) {
$this->logger->info("Receiving data, sid-[{$message->sid}]");
$printSid = false;
}
switch ($message->data->status) {
case 1:
$result .= base64_decode($message->data->audio);
break;
case 2:
$result .= base64_decode($message->data->audio);
break 2;
}
}
$this->logger->info("Receive data successfully, total length: " . strlen($result));
return new Response(200, [], $result);
} catch (Exception $ex) {
throw $ex;
}
}
public function send($message = null)
{
try {
if (empty($message)) {
if (!empty($this->input)) {
$message = $this->input;
} else {
throw new Exception();
}
}
return $this->client->send($message);
} catch (Exception $ex) {
throw $ex;
}
}
public function receive()
{
try {
return $this->client->receive();
} catch (Exception $ex) {
throw $ex;
}
}
public function setLogger(LoggerInterface $logger = null)
{
$this->logger = $logger ?: new NullLogger();
}
}

View File

@ -0,0 +1,163 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core;
/**
* Http客户端
*
* @author guizheng@iflytek.com
*/
use Exception;
use GuzzleHttp\Psr7\Response;
use IFlytek\Xfyun\Core\Handler\Guzzle7HttpHandler;
use IFlytek\Xfyun\Core\Traits\SignTrait;
use IFlytek\Xfyun\Core\Traits\DecideRetryTrait;
use IFlytek\Xfyun\Core\Handler\HttpHandlerFactory;
use Psr\Http\Message\RequestInterface;
use GuzzleHttp\Psr7\Utils;
class HttpClient
{
use SignTrait;
use DecideRetryTrait;
const MAX_DELAY_MICROSECONDS = 60000000;
/**
* @var Guzzle7HttpHandler
*/
private $httpHandler;
/**
* @var array 要添加的头部信息
*/
private $httpHeaders;
/**
* @var int 超时时间
*/
private $requestTimeout;
/**
* @var int 重试次数
*/
private $retries;
/**
* @var int 重试次数
*/
private $decideRetryFunction;
/**
* @var int 重试次数
*/
private $delayFunction;
/**
* @var int 重试次数
*/
private $calcDelayFunction;
public function __construct($config)
{
$config += [
'httpHandler' => null,
'httpHeaders' => [],
'requestTimeout' => 3000,
'retries' => 3,
'decideRetryFunction' => null,
'delayFunction' => null,
'calcDelayFunction' => null
];
$this->httpHandler = $config['httpHandler'] ?: HttpHandlerFactory::build();
$this->httpHeaders = $config['httpHeaders'];
$this->retries = $config['retries'];
$this->decideRetryFunction = $config['decideRetryFunction'] ?: $this->getDecideRetryFunction();
$this->calcDelayFunction = $config['calcDelayFunction'] ?: [$this, 'calculateDelay'];
$this->delayFunction = $config['delayFunction'] ?: static function ($delay) {
usleep($delay);
};
}
/**
* 发送请求,并接受返回
*
* @param RequestInterface $request
* @param array $options 请求的配置参数
* @return Response
* @throws Exception
*/
public function sendAndReceive(RequestInterface $request, array $options = [])
{
try {
$delayFunction = $this->delayFunction;
$calcDelayFunction = $this->calcDelayFunction;
$retryAttempt = 0;
while (true) {
try {
return call_user_func_array($this->httpHandler, [$this->applyHeaders($request), $options]);
} catch (Exception $exception) {
if ($this->decideRetryFunction) {
if (!call_user_func($this->decideRetryFunction, $exception)) {
throw $exception;
}
}
if ($retryAttempt >= $this->retries) {
break;
}
$delayFunction($calcDelayFunction($retryAttempt));
$retryAttempt++;
}
}
throw $exception;
} catch (Exception $ex) {
throw $ex;
}
}
/**
* 将头部信息添加到请求对象中
*
* @param $request 请求对象
* @return RequestInterface
*/
private function applyHeaders($request)
{
return Utils::modifyRequest($request, ['set_headers' => $this->httpHeaders]);
}
/**
* 根据重试次数计算下次重试延迟时间
*
* @param int $attempt 重试次数
* @return int
*/
public static function calculateDelay($attempt)
{
return min(
mt_rand(0, 1000000) + (pow(2, $attempt) * 1000000),
self::MAX_DELAY_MICROSECONDS
);
}
}

View File

@ -0,0 +1,45 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core\Traits;
/**
* 数组处理
*
* @author guizheng@iflytek.com
*/
trait ArrayTrait
{
/**
* 递归移除数组中的null项
*
* @param array $array
* @return array
*/
private static function removeNull($array)
{
foreach ($array as $key => $item) {
if (is_array($item)) {
$array[$key] = self::removeNull($item);
} else if (is_null($item)) {
unset($array[$key]);
}
}
return $array;
}
}

View File

@ -0,0 +1,96 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core\Traits;
use GuzzleHttp\Exception\RequestException;
/**
* 提供一个方法,决定是否进行重试
*
* @author guizheng@iflytek.com
*/
trait DecideRetryTrait
{
use JsonTrait;
/**
* @var array
*/
private $httpRetryCodes = [
500,
502,
503
];
/**
* @var array
*/
private $httpRetryMessages = [
'retry later'
];
/**
* 返回一个callable变量作用是决定是否重试
*
* @param bool $shouldRetryMessages 是否要根据message决定重试与否
* @return callable
*/
private function getDecideRetryFunction($shouldRetryMessages = true)
{
$httpRetryCodes = $this->httpRetryCodes;
$httpRetryMessages = $this->httpRetryMessages;
return function (\Exception $ex) use ($httpRetryCodes, $httpRetryMessages, $shouldRetryMessages) {
$statusCode = $ex->getCode();
if (in_array($statusCode, $httpRetryCodes)) {
return true;
}
if (!$shouldRetryMessages) {
return false;
}
$message = ($ex instanceof RequestException && $ex->hasResponse())
? (string) $ex->getResponse()->getBody()
: $ex->getMessage();
try {
$message = $this->jsonDecode(
$message,
true
);
} catch (\InvalidArgumentException $ex) {
return false;
}
if (!isset($message['errors'])) {
return false;
}
foreach ($message['errors'] as $error) {
if (in_array($error['reason'], $httpRetryMessages)) {
return true;
}
}
return false;
};
}
}

View File

@ -0,0 +1,68 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace Iflytek\Xfyun\Core\Traits;
/**
* 提供对原生json_encode和json_decode的封装以便在发生错误时抛出一个异常
*
* @author guizheng@iflytek.com
*/
trait JsonTrait
{
/**
* @param string $json 待解码的字符串
* @param bool $assoc 是否返回数组
* @param int $depth 递归深度
* @param int $options json_decode的配置
* @return mixed
* @throws \InvalidArgumentException
*/
private static function jsonDecode($json, $assoc = false, $options = 0, $depth = 512)
{
$data = json_decode($json, $assoc, $depth, $options);
if (JSON_ERROR_NONE !== json_last_error()) {
throw new \InvalidArgumentException(
'json_decode error: ' . json_last_error_msg()
);
}
return $data;
}
/**
* @param mixed $value 待编码的变量
* @param int $options json_decode的配置
* @param int $depth 递归深度
* @return string
* @throws \InvalidArgumentException
*/
private static function jsonEncode($value, $options = 0, $depth = 512)
{
$json = json_encode($value, $options, $depth);
if (JSON_ERROR_NONE !== json_last_error()) {
throw new \InvalidArgumentException(
'json_encode error: ' . json_last_error_msg()
);
}
return $json;
}
}

View File

@ -0,0 +1,93 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core\Traits;
/**
* 提供平台的签名方法
*
* @author guizheng@iflytek.com
*/
trait SignTrait
{
/**
* 根据secret对uri进行签名返回签名后的uri
*
* @param string $uri 待签名的uri
* @param array $secret 秘钥信息
* @return string
*/
private static function signUriV1($uri, $secret)
{
$apiKey = $secret['apiKey'];
$apiSecret = $secret['apiSecret'];
$host = $secret['host'];
$request_line = $secret['requestLine'];
$date = empty($secret['date']) ? gmdate ('D, d M Y H:i:s \G\M\T', time()) : $secret['date'];
$signature_origin = "host: $host\ndate: $date\n$request_line";
$signature_sha = hash_hmac('sha256', $signature_origin, $apiSecret, true);
$signature = base64_encode($signature_sha);
$authrization = base64_encode("api_key=\"$apiKey\",algorithm=\"hmac-sha256\",headers=\"host date request-line\",signature=\"$signature\"");
$uri = $uri . '?' . http_build_query([
'host' => $host,
'date' => $date,
'authorization' => $authrization
]);
return $uri;
}
/**
* 根据所提供信息返回签名
*
* @param string $appId appid
* @param string $secretKey secretKey
* @param string $timestamp 时间戳,不传的话使用系统时间
* @return string
*/
public static function signV1($appId, $secretKey, $timestamp = null)
{
$timestamp = $timestamp ?: time();
$baseString = $appId . $timestamp;
$signa_origin = hash_hmac('sha1', md5($baseString), $secretKey, true);
return base64_encode($signa_origin);
}
/**
* https调用的鉴权参数构造
*
* @param string $appId appId
* @param string $apiKey apiKey
* @param string $curTime curTime
* @param string $param param
* @return array
*/
public static function signV2($appId, $apiKey, $param, $curTime = null)
{
if (empty($curTime)) {
$curTime = time();
}
return [
'X-Appid' => $appId,
'X-CurTime' => $curTime,
'X-Param' => base64_encode($param),
'X-CheckSum' => md5($apiKey . $curTime . base64_encode($param))
];
}
}

View File

@ -0,0 +1,70 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Core;
/**
* WebSocket客户端
*
* @author guizheng@iflytek.com
*/
class WsClient
{
/** @var WsHandler */
private $handler;
public function __construct($config)
{
$config += [
'handler' => null,
];
$this->handler = $config['handler'];
}
/**
* 发送请求,并接受返回
*
* @return Response
*/
public function sendAndReceive()
{
try {
return call_user_func_array([$this->handler, 'sendAndReceive'], []);
} catch (\Exception $ex) {
throw $ex;
}
}
public function send($message = null)
{
try {
return call_user_func_array([$this->handler, 'send'], [$message]);
} catch (\Exception $ex) {
throw $ex;
}
}
public function receive()
{
try {
return call_user_func_array([$this->handler, 'receive'], []);
} catch (\Exception $ex) {
throw $ex;
}
}
}

View File

@ -0,0 +1,90 @@
<?php
/**
* Copyright 1999-2022 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech;
use IFlytek\Xfyun\Core\Traits\SignTrait;
use IFlytek\Xfyun\Core\HttpClient;
use GuzzleHttp\Psr7\Request;
use IFlytek\Xfyun\Speech\Constants\ChatConstants;
/**
* 文本纠错客户端
*
* @author guizheng@iflytek.com
*/
class ChatClient
{
use SignTrait;
protected $appId;
protected $apiKey;
protected $apiSecret;
protected $uid;
protected $resId;
protected $requestConfig;
protected $client;
public function __construct($appId, $apiKey, $apiSecret, $uid = null, $resId = null, $requestConfig = [])
{
$this->appId = $appId;
$this->apiKey = $apiKey;
$this->apiSecret = $apiSecret;
$this->uid = $uid;
$this->resId = $resId;
$this->client = new HttpClient([]);
}
function assembleAuthUrl($addr,$method='GET') {
$apiKey=$this->apiKey;
$apiSecret=$this->apiSecret;
if ($apiKey == "" && $apiSecret == "") { // 不鉴权
return $addr;
}
$ul = parse_url($addr); // 解析地址
if ($ul === false) { // 地址不对,也不鉴权
return $addr;
}
// // $date = date(DATE_RFC1123); // 获取当前时间并格式化为RFC1123格式的字符串
$timestamp = time();
$rfc1123_format = gmdate("D, d M Y H:i:s \G\M\T", $timestamp);
// $rfc1123_format = "Mon, 31 Jul 2023 08:24:03 GMT";
// 参与签名的字段 host, date, request-line
$signString = array("host: " . $ul["host"], "date: " . $rfc1123_format, $method . " " . $ul["path"] . " HTTP/1.1");
// 对签名字符串进行排序,确保顺序一致
// ksort($signString);
// 将签名字符串拼接成一个字符串
$sgin = implode("\n", $signString);
// 对签名字符串进行HMAC-SHA256加密得到签名结果
$sha = hash_hmac('sha256', $sgin, $apiSecret,true);
$signature_sha_base64 = base64_encode($sha);
// 将API密钥、算法、头部信息和签名结果拼接成一个授权URL
$authUrl = "api_key=\"$apiKey\",algorithm=\"hmac-sha256\",headers=\"host date request-line\",signature=\"$signature_sha_base64\"";
// 对授权URL进行Base64编码并添加到原始地址后面作为查询参数
$authAddr = $addr . '?' . http_build_query(array(
'host' => $ul['host'],
'date' => $rfc1123_format,
'authorization' => base64_encode($authUrl),
));
return $authAddr;
}
}

View File

@ -0,0 +1,110 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Config;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
use IFlytek\Xfyun\Core\Config\ConfigInterface;
/**
* 性别年龄识别配置参数类
*
* @author guizheng@iflytek.com
*/
class IgrConfig implements ConfigInterface
{
use ArrayTrait;
use JsonTrait;
/**
* @var string 引擎类型
* 仅支持igr
*/
private $ent;
/**
* @var string 音频格式
* raw原生音频数据pcm格式
* speexspeex格式rate需设置为8000
* speex-wb宽频speex格式rate需设置为16000
* amramr格式rate需设置为8000
* amr-wb宽频amr格式rate需设置为16000
* 默认raw
*/
private $aue;
/**
* @var int 音频采样率
* 16000/8000
* 默认16000
*/
private $rate;
public function __construct($config)
{
$config += [
'aue' => 'raw',
'rate' => 16000
];
$this->ent = 'igr';
$this->aue = $config['aue'];
$this->rate = $config['rate'];
}
/**
* 去除null项后返回数组形式
*
* @return array
*/
public function toArray()
{
return $this->removeNull([
'ent' => $this->ent,
'aue' => $this->aue,
'rate' => $this->rate
]);
}
/**
* 返回toArray的Json格式
*
* @return string
*/
public function toJson()
{
return $this->jsonEncode($this->toArray());
}
/**
* @return string
*/
public function getAue()
{
return $this->aue;
}
/**
* @return int
*/
public function getRate()
{
return $this->rate;
}
}

View File

@ -0,0 +1,265 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Config;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
use IFlytek\Xfyun\Core\Config\ConfigInterface;
/**
* 语音评测配置参数类
*
* @author guizheng@iflytek.com
*/
class IseConfig implements ConfigInterface
{
use ArrayTrait;
use JsonTrait;
/**
* @var string 服务类型指定
* ise: 开放评测
* 默认'ise'
*/
private $sub;
/**
* @var string 评测语种
* 中文cn_vip英文en_vip
* 默认'cn_vip'
*/
private $ent;
/**
* @var string 评测题型
* 中文题型:
* read_syllable单字朗读汉语专有
* read_word词语朗读
* read_sentence句子朗读
* read_chapter(篇章朗读)
* 英文题型:
* read_word词语朗读
* read_sentence句子朗读
* read_chapter(篇章朗读)
* simple_expression英文情景反应
* read_choice英文选择题
* topic英文自由题
* retell英文复述题
* picture_talk英文看图说话
* oral_translation英文口头翻译
* 默认read_sentence
*/
private $category;
/**
* @var int 上传音频时来区分音频的状态
* 1/2/4
* 默认1
*/
private $aus;
/**
* @var string 用来区分数据上传阶段
* ssb参数上传阶段
* ttp文本上传阶段ttp_skip=true时该阶段可以跳过直接使用text字段中的文本
* auw音频上传阶段
* 必传
*/
private $cmd;
/**
* @var string 待评测文本
* 需要加utf8bom头'\uFEFF' + text
*/
private $text;
/**
* @var string 带评测文本编码
* utf-8/gbk
* 默认utf-8
*/
private $tte;
/**
* @var boolean 跳过ttp直接使用text中的文本进行评测
* true/false
* 默认true
*/
private $ttpSkip;
/**
* @var string 拓展能力生效条件ise_unite="1", rst="entirety"
* 多维度分信息显示准确度分、流畅度分、完整度打分extra_ability值为multi_dimension字词句篇均适用如选多个能力用分号隔开。例如extra_ability=syll_phone_err_msg;pitch;multi_dimension
* 单词基频信息显示基频开始值、结束值extra_ability值为pitch ,仅适用于单词和句子题型
* 音素错误信息显示声韵、调型是否正确extra_ability值为syll_phone_err_msg字词句篇均适用,如选多个能力用分号隔开。例如extra_ability=syll_phone_err_msg;pitch;multi_dimension
*/
private $extraAbility;
/**
* @var string 音频格式
* raw: 未压缩的pcm格式音频或wav如果用wav格式音频建议去掉头部
* lame: mp3格式音频
* speex-wb;7: 讯飞定制speex格式音频
* 默认speex-wb
*/
private $aue;
/**
* @var string 音频采样率
* 默认 audio/L16;rate=16000
*/
private $auf;
/**
* @var string 返回结果格式
* utf8/gbk
* 默认utf8
*/
private $rstcd;
/**
* @var string 评测人群指定
* adult成人群体不设置群体参数时默认为成人
* youth中学群体
* pupil小学群体中文句、篇题型设置此参数值会有accuracy_score得分的返回
* 默认adult
*/
private $group;
/**
* @var string 设置评测的打分及检错松严门限(仅中文引擎支持)
* easy容易
* common普通
* hard困难
*/
private $checkType;
/**
* @var string 设置评测的学段参数 (仅中文题型:中小学的句子、篇章题型支持)
* junior(1,2年级)
* middle(3,4年级)
* senior(5,6年级)
*/
private $grade;
/**
* @var string 评测返回结果与分制控制评测返回结果与分制控制也会受到ise_unite与plev参数的影响
* 完整entirety默认值
* 中文百分制推荐传参rst="entirety"且ise_unite="1"且配合extra_ability参数使用
* 英文百分制推荐传参rst="entirety"且ise_unite="1"且配合extra_ability参数使用
* 精简plain评测返回结果将只有总分
*/
private $rst;
/**
* @var string 返回结果控制
* 0:不控制(默认值)
* 1控制extra_ability参数将影响全维度等信息的返回
*/
private $iseUnite;
/**
* @var string 在rst="entirety"默认值且ise_unite="0"默认值的情况下plev的取值不同对返回结果有影响。
* plev0(给出全部信息汉语包含rec_node_type、perr_msg、fluency_score、phone_score信息的返回英文包含accuracy_score、serr_msg、 syll_accent、fluency_score、standard_score、pitch信息的返回)
*/
private $plev;
public function __construct($config)
{
$config += [
'ent' => 'cn_vip',
'category' => 'read_sentence',
'aus' => 1,
'cmd' => 'ssb',
'text' => '',
'tte' => 'utf-8',
'ttp_skip' => true,
'extra_ability' => null,
'aue' => 'raw',
'rstcd' => 'utf8',
'group' => 'adult',
'check_type' => 'common',
'grade' => 'middle',
'rst' => 'entirety',
'ise_unite' => '0',
'plev' => '0'
];
$this->sub = 'ise';
$this->ent = $config['ent'];
$this->category = $config['category'];
$this->aus = $config['aus'];
$this->cmd = $config['cmd'];
$this->text = chr(239) . chr(187) . chr(191) . $config['text'];
$this->tte = $config['tte'];
$this->ttpSkip = $config['ttp_skip'];
$this->extraAbility = $config['extra_ability'];
$this->aue = $config['aue'];
$this->rstcd = $config['rstcd'];
$this->group = $config['group'];
$this->checkType = $config['check_type'];
$this->grade = $config['grade'];
$this->rst = $config['rst'];
$this->iseUnite = $config['ise_unite'];
$this->plev = $config['plev'];
}
/**
* 去除null项后返回数组形式
*
* @return array
*/
public function toArray()
{
return $this->removeNull([
'sub' => $this->sub,
'ent' => $this->ent,
'category' => $this->category,
'aus' => $this->aus,
'cmd' => $this->cmd,
'text' => $this->text,
'tte' => $this->tte,
'ttp_skip' => $this->ttpSkip,
'extra_ability' => $this->extraAbility,
'aue' => $this->aue,
'rstcd' => $this->rstcd,
'group' => $this->group,
'check_type' => $this->checkType,
'grade' => $this->grade,
'rst' => $this->rst,
'ise_unite' => $this->iseUnite,
'plev' => $this->plev
]);
}
/**
* 返回toArray的Json格式
*
* @return string
*/
public function toJson()
{
return $this->jsonEncode($this->toArray());
}
public function setText($text)
{
$this->text = chr(239) . chr(187) . chr(191) . $text;
}
}

View File

@ -0,0 +1,142 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Config;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
use IFlytek\Xfyun\Core\Config\ConfigInterface;
/**
* 语音转写配置参数类
*
* @author guizheng@iflytek.com
*/
class LfasrConfig implements ConfigInterface
{
use ArrayTrait;
use JsonTrait;
/**
* @var string 转写类型
* 0: (标准版,格式: wav,flac,opus,mp3,m4a)
* 默认: 0
*/
private $lfasrType;
/**
* @var string 转写结果是否包含分词信息
* false或true
* 默认false
*/
private $hasParticiple;
/**
* @var string 转写结果中最大的候选词个数
* 0-5
* 默认0
*/
private $maxAlternatives;
/**
* @var string 发音人个数
* 0-10
* 默认2
*/
private $speakerNumber;
/**
* @var string 是否包含发音人分离信息
* false或true
* 默认false
*/
private $hasSeperate;
/**
* @var string 角色分离类型
* 1: 通用角色分离2: 电话信道角色分离适用于speaker_number为2的说话场景
* 默认1该字段只有在开通了角色分离功能的前提下才会生效正确传入该参数后角色分离效果会有所提升。
*/
private $roleType;
/**
* @var string 语种
* cn: 中英文&中文en: 英文(英文不支持热词)
* 默认cn
*/
private $language;
/**
* @var string 垂直领域个性化参数
* court: 法院; edu: 教育; finance: 金融; medical: 医疗; tech: 科技;
* 默认通用
*/
private $pd;
public function __construct($config)
{
$config += [
'lfasr_type' => '0',
'has_participle' => 'false',
'max_alternatives' => '0',
'speaker_number' => '2',
'has_seperate' => 'false',
'role_type' => '1',
'language' => 'cn',
'pd' => null
];
$this->lfasrType = $config['lfasr_type'];
$this->hasParticiple = $config['has_participle'];
$this->maxAlternatives = $config['max_alternatives'];
$this->speakerNumber = $config['speaker_number'];
$this->hasSeperate = $config['has_seperate'];
$this->roleType = $config['role_type'];
$this->language = $config['language'];
$this->pd = $config['pd'];
}
/**
* 去除null项后返回数组形式
*
* @return array
*/
public function toArray()
{
return $this->removeNull([
'lfasr_type' => $this->lfasrType,
'has_participle' => $this->hasParticiple,
'max_alternatives' => $this->maxAlternatives,
'speaker_number' => $this->speakerNumber,
'has_seperate' => $this->hasSeperate,
'role_type' => $this->roleType,
'language' => $this->language,
'pd' => $this->pd
]);
}
/**
* 返回toArray的Json格式
*
* @return string
*/
public function toJson()
{
return $this->jsonEncode($this->toArray());
}
}

View File

@ -0,0 +1,76 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Config;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Config\ConfigInterface;
/**
* 文本纠错配置参数类
*
* @author guizheng@iflytek.com
*/
class TcConfig implements ConfigInterface
{
use ArrayTrait;
private $resultEncoding;
private $resultCompress;
private $resultFormat;
private $inputEncoding;
private $inputCompress;
private $inputFormat;
public function __construct($config)
{
$config += [
'resultEncoding' => 'utf8',
'resultCompress' => 'raw',
'resultFormat' => 'json',
'inputEncoding' => 'utf8',
'inputCompress' => 'raw',
'inputFormat' => 'json'
];
$this->resultEncoding = $config['resultEncoding'];
$this->resultCompress = $config['resultCompress'];
$this->resultFormat = $config['resultFormat'];
$this->inputEncoding = $config['inputEncoding'];
$this->inputCompress = $config['inputCompress'];
$this->inputFormat = $config['inputFormat'];
}
public function toJson()
{
// TODO: Implement toJson() method.
}
public function toArray()
{
return self::removeNull([
'resultEncoding' => $this->resultEncoding,
'resultCompress' => $this->resultCompress,
'resultFormat' => $this->resultFormat,
'inputEncoding' => $this->inputEncoding,
'inputCompress' => $this->inputCompress,
'inputFormat' => $this->inputFormat
]);
}
}

View File

@ -0,0 +1,191 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Config;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
use IFlytek\Xfyun\Core\Config\ConfigInterface;
/**
* 语音合成配置参数类
*
* @author guizheng@iflytek.com
*/
class TtsConfig implements ConfigInterface
{
use ArrayTrait;
use JsonTrait;
/**
* @var string 音频编码(必填)
* raw:未压缩的pcm
* lame:mp3 (当aue=lame时需传参sfl=1)
* speex-org-wb;7: 标准开源speexfor speex_wideband即16k数字代表指定压缩等级默认等级为8
* speex-org-nb;7: 标准开源speexfor speex_narrowband即8k数字代表指定压缩等级默认等级为8
* speex;7:压缩格式压缩等级1~10默认为78k讯飞定制speex
* speex-wb;7:压缩格式压缩等级1~10默认为716k讯飞定制speex
* 本sdk将默认采用raw格式
*/
private $aue;
/**
* @var int 开启流式返回
* 需要配合aue=lame使用开启流式返回mp3格式音频取值:1
*/
private $sfl;
/**
* @var string 音频采样率
* audio/L16;rate=8000: 合成8K的音频
* audio/L16;rate=16000: 合成16K的音频
* auf不传值: 合成16K的音频
*/
private $auf;
/**
* @var string 发音人(必填)
* 可选值: 请到控制台添加试用或购买
* 默认xiaoyan
*/
private $vcn;
/**
* @var int 语速
* 可选值: 0-100
* 默认为50
*/
private $speed;
/**
* @var int 音量
* 可选值: 0-100
* 默认为50
*/
private $volume;
/**
* @var int 音高
* 可选值: 0-100
* 默认为50
*/
private $pitch;
/**
* @var int 合成音频的背景音
* 0: 无背景音; 1: 有背景音
* 默认0
*/
private $bgs;
/**
* @var string 文本编码格式
* GB2312|GBK|BIG5|UNICODE|GB18030|UTF8
* 默认UTF-8
*/
private $tte;
/**
* @var string 设置英文发音方式
* 0: 自动判断处理,如果不确定将按照英文词语拼写处理
* 1: 所有英文按字母发音
* 2: 自动判断处理,如果不确定将按照字母朗读
* 默认2
*/
private $reg;
/**
* @var string 合成音频数字发音方式
* 0: 自动判断
* 1: 完全数值
* 2: 完全字符串
* 3: 字符串优先
* 默认0
*/
private $rdn;
/**
* @var string 自定义发音人引擎
* 默认传 ptts
*/
private $ent;
public function __construct($config = [])
{
$config += [
'aue' => 'lame',
'sfl' => 1,
'auf' => null,
'vcn' => 'xiaoyan',
'speed' => 50,
'volume' => 50,
'pitch' => 50,
'bgs' => 0,
'tte' => 'UTF8',
'reg' => '2',
'rdn' => '0',
'ent' => ''
];
$this->aue = $config['aue'];
$this->sfl = $config['sfl'];
$this->auf = $config['auf'];
$this->vcn = $config['vcn'];
$this->speed = $config['speed'];
$this->volume = $config['volume'];
$this->pitch = $config['pitch'];
$this->bgs = $config['bgs'];
$this->tte = $config['tte'];
$this->reg = $config['reg'];
$this->rdn = $config['rdn'];
$this->ent = $config['ent'];
}
/**
* 去除null项后返回数组形式
*
* @return array
*/
public function toArray()
{
return $this->removeNull([
'aue' => $this->aue,
'sfl' => $this->sfl,
'auf' => $this->auf,
'vcn' => $this->vcn,
'speed' => $this->speed,
'volume' => $this->volume,
'pitch' => $this->pitch,
'bgs' => $this->bgs,
'tte' => $this->tte,
'reg' => $this->reg,
'rdn' => $this->rdn,
'ent' => $this->ent
]);
}
/**
* 返回toArray的Json格式
*
* @return string
*/
public function toJson()
{
return $this->jsonEncode($this->toArray());
}
}

View File

@ -0,0 +1,30 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Constants;
/**
* 星火
*
* @author
*/
class ChatConstants
{
const URI = 'wss://spark-api.xf-yun.com/v2.1/chat';
const REQUEST_LINE = 'POST wss://spark-api.xf-yun.com/v2.1/chat HTTP/1.1';
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Constants;
/**
* 性别年龄识别常量
*
* @author guizheng@iflytek.com
*/
class IgrConstants
{
const URI = 'wss://ws-api.xfyun.cn/v2/igr';
const HOST = 'ws-api.xfyun.cn';
const REQUEST_LINE = 'GET /v2/igr HTTP/1.1';
const FRAME_SIZE = 1280;
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Constants;
/**
* 语音评测常量
*
* @author guizheng@iflytek.com
*/
class IseConstants
{
const URI = 'wss://ise-api.xfyun.cn/v2/open-ise';
const HOST = 'ise-api.xfyun.cn';
const REQUEST_LINE = 'GET /v2/open-ise HTTP/1.1';
const FRAME_SIZE = 1280;
}

View File

@ -0,0 +1,34 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Constants;
/**
* 语音转写常量
*
* @author guizheng@iflytek.com
*/
class LfasrConstants
{
const URI_PREPARE = 'https://raasr.xfyun.cn/api/prepare';
const URI_UPLOAD = 'https://raasr.xfyun.cn/api/upload';
const URI_MERGE = 'https://raasr.xfyun.cn/api/merge';
const URI_GET_PROGRESS = 'https://raasr.xfyun.cn/api/getProgress';
const URI_GET_RESULT = 'https://raasr.xfyun.cn/api/getResult';
const SLICE_PIECE_SIZE = 1024 * 1024 * 10;
const ORIGIN_SLICE_ID = 'aaaaaaaaaa';
}

View File

@ -0,0 +1,31 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Constants;
/**
* 文本纠错常量
*
* @author guizheng@iflytek.com
*/
class TcConstants
{
const URI = 'https://api.xf-yun.com/v1/private/s9a87e3ec';
const LIST_UPLOAD_URI = 'https://evo-gen.xfyun.cn/individuation/gen/upload';
const HOST = 'api.xf-yun.com';
const REQUEST_LINE = 'POST /v1/private/s9a87e3ec HTTP/1.1';
}

View File

@ -0,0 +1,30 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Constants;
/**
* 语音合成常量
*
* @author guizheng@iflytek.com
*/
class TtsConstants
{
const URI = 'wss://tts-api.xfyun.cn/v2/tts';
const HOST = 'tts-api.xfyun.cn';
const REQUEST_LINE = 'GET /v2/tts HTTP/1.1';
}

View File

@ -0,0 +1,62 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Helper;
use IFlytek\Xfyun\Speech\Constants\LfasrConstants;
/**
* 转写切片ID生成类
*
* @author guizheng@iflytek.com
*/
class SliceIdGenerator
{
/**
* @var string 当前切片ID
*/
private $id;
public function __construct()
{
$this->id = LfasrConstants::ORIGIN_SLICE_ID;
}
/**
* 返回当前切片ID并生成下一个切片ID赋值给对象的当前ID
*
* @return string
*/
public function getId()
{
$currentId = $this->id;
$nextId = $currentId;
$pos = strlen($currentId) - 1;
while ($pos >= 0) {
$charAtPos = $nextId[$pos];
if ($charAtPos != 'z') {
$nextId = substr($nextId, 0, $pos) . chr((ord($charAtPos) + 1)) . substr($nextId, $pos + 1);
break;
} else {
$nextId = substr($nextId, 0, $pos) . 'a';
$pos = $pos - 1;
}
}
$this->id = $nextId;
return $currentId;
}
}

View File

@ -0,0 +1,111 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech;
use Exception;
use IFlytek\Xfyun\Speech\Config\IgrConfig;
use IFlytek\Xfyun\Speech\Constants\IgrConstants;
use IFlytek\Xfyun\Speech\Traits\IgrTrait;
use IFlytek\Xfyun\Core\Handler\WsHandler;
use IFlytek\Xfyun\Core\WsClient;
use IFlytek\Xfyun\Core\Traits\SignTrait;
use GuzzleHttp\Psr7\Stream;
/**
* 性别年龄识别客户端
*
* @author guizheng@iflytek.com
*/
class IgrClient
{
use SignTrait;
use IgrTrait;
/**
* @var string app_id
*/
protected $appId;
/**
* @var string api_key
*/
protected $apiKey;
/**
* @var string api_secret
*/
protected $apiSecret;
/**
* @var IgrConfig
*/
protected $requestConfig;
public function __construct($appId, $apiKey, $apiSecret, $requestConfig = [])
{
$this->appId = $appId;
$this->apiKey = $apiKey;
$this->apiSecret = $apiSecret;
$this->requestConfig = new IgrConfig($requestConfig);
}
/**
* 请求并返回结果
*
* @param string $audioPath 待识别音频路径
* @return string
* @throws Exception
*/
public function request($audioPath)
{
$ttsHandler = new WsHandler(
$this->signUriV1(IgrConstants::URI, [
'appId' => $this->appId,
'apiKey' => $this->apiKey,
'apiSecret' => $this->apiSecret,
'host' => IgrConstants::HOST,
'requestLine' => IgrConstants::REQUEST_LINE,
]),
null
);
$client = new WsClient([
'handler' => $ttsHandler
]);
// 音频上传
$frameNum = ceil(fileSize($audioPath) / IgrConstants::FRAME_SIZE);
$fileStream = new Stream(fopen($audioPath, 'r'));
// 发送第一帧
$client->send($this->generateAudioInput($fileStream->read(IgrConstants::FRAME_SIZE), true, false));
// 发送中间帧
for ($i = 1; $i < $frameNum; $i++) {
$client->send($this->generateAudioInput($fileStream->read(IgrConstants::FRAME_SIZE), false, false));
usleep(4000);
}
// 发送最后一帧
$client->send($this->generateAudioInput('', false, true));
// 接受数据
$message = $this->jsonDecode($client->receive(), true);
if ($message['code'] !== 0) {
throw new Exception(json_encode($message));
}
return $message['data'];
}
}

View File

@ -0,0 +1,126 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech;
use IFlytek\Xfyun\Speech\Config\IseConfig;
use IFlytek\Xfyun\Speech\Constants\IseConstants;
use IFlytek\Xfyun\Speech\Traits\IseTrait;
use IFlytek\Xfyun\Core\Handler\WsHandler;
use IFlytek\Xfyun\Core\WsClient;
use IFlytek\Xfyun\Core\Traits\SignTrait;
use GuzzleHttp\Psr7\Stream;
/**
* 语音评测客户端
*
* @author guizheng@iflytek.com
*/
class IseClient
{
use SignTrait;
use IseTrait;
/**
* @var string app_id
*/
protected $appId;
/**
* @var string api_key
*/
protected $apiKey;
/**
* @var string api_secret
*/
protected $apiSecret;
/**
* @var array 评测参数配置
*/
protected $requestConfig;
public function __construct($appId, $apiKey, $apiSecret, $requestConfig = [])
{
$this->appId = $appId;
$this->apiKey = $apiKey;
$this->apiSecret = $apiSecret;
$this->requestConfig = new IseConfig($requestConfig);
}
/**
* 请求评测并返回结果xml格式
*
* @param string $audioPath 待评测音频路径
* @param string $text 待评测文本
* @return string
*/
public function request($audioPath, $text = null)
{
$ttsHandler = new WsHandler(
$this->signUriV1(IseConstants::URI, [
'appId' => $this->appId,
'apiKey' => $this->apiKey,
'apiSecret' => $this->apiSecret,
'host' => IseConstants::HOST,
'requestLine' => IseConstants::REQUEST_LINE,
]),
null
);
$client = new WsClient([
'handler' => $ttsHandler
]);
// 参数上传
if (!empty($text)) {
$this->requestConfig->setText($text);
}
$client->send($this->generateParamsInput($this->appId, $this->requestConfig->toArray()));
// 音频上传
$frameSize = ceil(fileSize($audioPath) / IseConstants::FRAME_SIZE);
$fileStream = new Stream(fopen($audioPath, 'r'));
// 发送第一帧
$result = $client->send($this->generateAudioInput($fileStream->read(IseConstants::FRAME_SIZE), true, false));
// 发送中间帧
for ($i = 1; $i < $frameSize - 1; $i++) {
$client->send($this->generateAudioInput($fileStream->read(IseConstants::FRAME_SIZE), false, false));
usleep(4000);
}
// 发送最后一帧
$client->send($this->generateAudioInput($fileStream->read(IseConstants::FRAME_SIZE), false, true));
// 接受数据
$result = '';
while (true) {
$message = $this->jsonDecode($client->receive());
if ($message->code !== 0) {
throw new \Exception(json_encode($message));
}
switch ($message->data->status) {
case 1:
$result .= base64_decode($message->data->data);
break;
case 2:
$result .= base64_decode($message->data->data);
break 2;
}
}
return $result;
}
}

View File

@ -0,0 +1,231 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech;
use Exception;
use IFlytek\Xfyun\Speech\Config\LfasrConfig;
use IFlytek\Xfyun\Speech\Constants\LfasrConstants;
use IFlytek\Xfyun\Speech\Traits\LfasrTrait;
use IFlytek\Xfyun\Speech\Helper\SliceIdGenerator;
use IFlytek\Xfyun\Core\Traits\SignTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
use IFlytek\Xfyun\Core\HttpClient;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Query;
use GuzzleHttp\Psr7\Stream;
use GuzzleHttp\Psr7\MultipartStream;
/**
* 语音转写客户端
*
* @author guizheng@iflytek.com
*/
class LfasrClient
{
use SignTrait;
use JsonTrait;
use LfasrTrait;
/**
* @var string app_id
*/
protected $appId;
/**
* @var string secret_key
*/
protected $secretKey;
/**
* @var array 转写参数配置
*/
protected $requestConfig;
/** @var HttpClient */
protected $client;
/** @var array 初始化请求体 */
protected $requestBody;
public function __construct($appId, $secretKey, $requestConfig = [])
{
$this->appId = $appId;
$this->secretKey = $secretKey;
$this->requestConfig = new LfasrConfig($requestConfig);
$this->client = new HttpClient([]);
$timestamp = time();
$this->requestBody = [
'app_id' => $this->appId,
'signa' => $this->signV1($this->appId, $this->secretKey, $timestamp),
'ts' => $timestamp,
];
}
/**
* 打包上传接口封装了准备、分片上传和合并三个接口并返回task_id
*
* @param string $filePath 文件路径
* @return string
* @throws Exception
*/
public function combineUpload($filePath)
{
$prepareResponse = $this->prepare($filePath);
$prepareContent = $this->jsonDecode($prepareResponse->getBody()->getContents(), true);
$taskId = $prepareContent['data'];
$this->upload($taskId, $filePath);
$this->merge($taskId);
return $taskId;
}
/**
* 准备接口
*
* @param $file_path
* @return Response
* @throws Exception
*/
public function prepare($file_path)
{
$this->requestBody += $this->fileInfo($file_path);
$this->requestBody += $this->sliceInfo($file_path);
$this->requestBody += $this->requestConfig->toArray();
return $this->client->sendAndReceive(
new Request(
'POST',
LfasrConstants::URI_PREPARE,
['Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'],
Query::build($this->requestBody)
)
);
}
/**
* 分片上传接口
*
* @param string $taskId task_id
* @param string $filePath 文件路径
* @return Response
* @throws Exception
*/
public function upload($taskId, $filePath)
{
$sliceIdGenerator = new SliceIdGenerator();
$sliceInfo = $this->sliceInfo($filePath);
$fileStream = new Stream(fopen($filePath, 'r'));
$this->requestBody += [
'task_id' => $taskId
];
$request = new Request(
'POST',
LfasrConstants::URI_UPLOAD
);
for ($i = 0; $i < $sliceInfo['slice_num']; $i++) {
$multipartStream = new MultipartStream([
[
'name' => 'app_id',
'contents' => $this->requestBody['app_id']
],
[
'name' => 'signa',
'contents' => $this->requestBody['signa']
],
[
'name' => 'ts',
'contents' => $this->requestBody['ts']
],
[
'name' => 'task_id',
'contents' => $taskId,
],
[
'name' => 'slice_id',
'contents' => $sliceIdGenerator->getId()
],
[
'name' => 'content',
'contents' => $fileStream->read(LfasrConstants::SLICE_PIECE_SIZE),
'filename' => '1.pcm'
]
]);
$this->client->sendAndReceive(
$request->withBody($multipartStream)
);
}
return new Response(200);
}
/**
* 合并接口
*
* @param string $taskId task_id
* @return Response
*/
public function merge($taskId)
{
return $this->process(LfasrConstants::URI_MERGE, $taskId);
}
/**
* 查询进度接口
*
* @param string $taskId task_id
* @return Response
*/
public function getProgress($taskId)
{
return $this->process(LfasrConstants::URI_GET_PROGRESS, $taskId);
}
/**
* 获取结果接口
*
* @param string $taskId task_id
* @return Response
*/
public function getResult($taskId)
{
return $this->process(LfasrConstants::URI_GET_RESULT, $taskId);
}
/**
* 封装操作
*
* @param string $task 操作
* @param string $taskId task_id
* @return Response
*/
private function process($task, $taskId)
{
$this->requestBody += ['task_id' => $taskId];
return $this->client->sendAndReceive(
new Request(
'POST',
$task,
['Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'],
Query::build($this->requestBody)
)
);
}
}

View File

@ -0,0 +1,104 @@
<?php
/**
* Copyright 1999-2022 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech;
use IFlytek\Xfyun\Speech\Config\TcConfig;
use IFlytek\Xfyun\Speech\Constants\TcConstants;
use IFlytek\Xfyun\Speech\Traits\TcTrait;
use IFlytek\Xfyun\Core\Traits\SignTrait;
use IFlytek\Xfyun\Core\HttpClient;
use GuzzleHttp\Psr7\Request;
/**
* 文本纠错客户端
*
* @author guizheng@iflytek.com
*/
class TcClient
{
use SignTrait;
use TcTrait;
protected $appId;
protected $apiKey;
protected $apiSecret;
protected $uid;
protected $resId;
protected $requestConfig;
protected $client;
public function __construct($appId, $apiKey, $apiSecret, $uid = null, $resId = null, $requestConfig = [])
{
$this->appId = $appId;
$this->apiKey = $apiKey;
$this->apiSecret = $apiSecret;
$this->uid = $uid;
$this->resId = $resId;
$this->requestConfig = new TcConfig($requestConfig);
$this->client = new HttpClient([]);
}
public function request($text)
{
$uri = self::signUriV1(TcConstants::URI, [
'apiKey' => $this->apiKey,
'apiSecret' => $this->apiSecret,
'host' => TcConstants::HOST,
'requestLine' => TcConstants::REQUEST_LINE
]);
$body = self::generateInput($text, $this->appId, $this->uid, $this->resId, $this->requestConfig->toArray());
return $this->client->sendAndReceive(
new Request(
'POST',
$uri,
['Content-Type' => 'application/json;charset=UTF-8'],
$body
)
);
}
public function listUpload($whiteList, $blackList)
{
if (empty($this->uid) || empty($this->resId)) {
return false;
}
$response = $this->client->sendAndReceive(
new Request(
'POST',
TcConstants::LIST_UPLOAD_URI,
['Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'],
self::jsonEncode([
'common' => [
'app_id' => $this->appId,
'uid' => $this->uid,
],
'business' => [
'res_id' => $this->resId
],
'data' => base64_encode(self::jsonEncode([
'white_list' => $whiteList,
'black_list' => $blackList
]))
])
)
);
$content = json_decode($response->getBody()->getContents(), true);
return $content['message'] == 'success';
}
}

View File

@ -0,0 +1,59 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Traits;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
/**
* 性别年龄识别方法
*
* @author guizheng@iflytek.com
*/
trait IgrTrait
{
use ArrayTrait;
use JsonTrait;
/**
* 根据音频数据、是否是第一帧、最后一帧,生成音频上传请求体
*
* @param string $frameData 音频数据
* @param boolean $isFirstFrame 是否是第一帧
* @param boolean $isLastFrame 是否是最后一帧
* @return string
*/
public function generateAudioInput($frameData, $isFirstFrame = false, $isLastFrame = false)
{
return self::jsonEncode(
self::removeNull([
"common" => !$isFirstFrame ? null : [
"app_id" => $this->appId
],
'business' => !$isFirstFrame ? null : [
"aue" => $this->requestConfig->getAue(),
"rate" => $this->requestConfig->getRate()
],
'data' => [
'status' => $isFirstFrame ? 0 : ($isLastFrame ? 2 : 1),
'audio' => base64_encode($frameData)
]
])
);
}
}

View File

@ -0,0 +1,78 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Traits;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
/**
* 语音评测方法
*
* @author guizheng@iflytek.com
*/
trait IseTrait
{
use ArrayTrait;
use JsonTrait;
/**
* 根据合成内容、app_id、配置参数生成请求体
*
* @param string $appId app_id
* @param array $iseConfigArray 语音合成参数详见iseConfig
* @return string
*/
public static function generateParamsInput($appId, $iseConfigArray)
{
return self::jsonEncode(
self::removeNull([
'common' => [
'app_id' => $appId
],
'business' => $iseConfigArray,
'data' => [
'status' => 0
]
])
);
}
/**
* 根据音频数据、是否是第一帧、最后一帧,生成音频上传请求体
*
* @param string $frameData 音频数据
* @param boolean $isFirstFrame 是否是第一帧
* @param boolean $isLastFrame 是否是最后一帧
* @return string
*/
public static function generateAudioInput($frameData, $isFirstFrame = false, $isLastFrame = false)
{
return self::jsonEncode(
self::removeNull([
'business' => [
"cmd" => "auw",
"aus" => $isFirstFrame ? 1 : ($isLastFrame ? 4 : 2)
],
'data' => [
'status' => $isLastFrame ? 2 : 1,
'data' => base64_encode($frameData)
]
])
);
}
}

View File

@ -0,0 +1,56 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Traits;
use IFlytek\Xfyun\Speech\Constants\LfasrConstants;
/**
* 转写方法
*
* @author guizheng@iflytek.com
*/
trait LfasrTrait
{
/**
* 获取文件名和文件大小
*
* @param string $filePath 文件路径
* @return array
*/
public static function fileInfo($filePath)
{
return [
'file_name' => basename($filePath),
'file_len' => filesize($filePath)
];
}
/**
* 根据文件大小和SDK默认分片大小获取文件分片数目信息
*
* @param string $filePath 文件路径
* @return array
*/
public static function sliceInfo($filePath)
{
$fileSize = filesize($filePath);
return [
'slice_num' => ceil($fileSize / LfasrConstants::SLICE_PIECE_SIZE)
];
}
}

View File

@ -0,0 +1,64 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Traits;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
/**
* 文本纠错方法
*
* @author guizheng@iflytek.com
*/
trait TcTrait
{
use ArrayTrait;
use JsonTrait;
public static function generateInput($text, $appId, $uid, $resId, $tcConfigArray)
{
return self::jsonEncode(
self::removeNull([
'header' => [
'app_id' => $appId,
'uid' => $uid,
'status' => 3
],
'parameter' => [
's9a87e3ec' => [
'res_id' => $resId,
'result' => [
'encoding' => $tcConfigArray['resultEncoding'],
'compress' => $tcConfigArray['resultCompress'],
'format' => $tcConfigArray['resultFormat'],
]
]
],
'payload' => [
'input' => [
'encoding' => $tcConfigArray['inputEncoding'],
'compress' => $tcConfigArray['inputCompress'],
'format' => $tcConfigArray['inputFormat'],
'status' => 3,
'text' => base64_encode($text)
]
]
])
);
}
}

View File

@ -0,0 +1,56 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech\Traits;
use IFlytek\Xfyun\Core\Traits\ArrayTrait;
use IFlytek\Xfyun\Core\Traits\JsonTrait;
/**
* 语音合成方法
*
* @author guizheng@iflytek.com
*/
trait TtsTrait
{
use ArrayTrait;
use JsonTrait;
/**
* 根据合成内容、app_id、配置参数生成请求体
*
* @param string $text 带合成的文本
* @param string $appId app_id
* @param array $ttsConfigArray 语音合成参数详见TtsConfig
* @return string
*/
public static function generateInput($text, $appId, $ttsConfigArray)
{
return self::jsonEncode(
self::removeNull([
'common' => [
'app_id' => $appId
],
'business' => $ttsConfigArray,
'data' => [
'text' => base64_encode($text),
'status' => 2
]
])
);
}
}

View File

@ -0,0 +1,100 @@
<?php
/**
* Copyright 1999-2021 iFLYTEK Corporation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace IFlytek\Xfyun\Speech;
use Exception;
use IFlytek\Xfyun\Speech\Config\TtsConfig;
use IFlytek\Xfyun\Speech\Constants\TtsConstants;
use IFlytek\Xfyun\Speech\Traits\TtsTrait;
use IFlytek\Xfyun\Core\Handler\WsHandler;
use IFlytek\Xfyun\Core\WsClient;
use IFlytek\Xfyun\Core\Traits\SignTrait;
use Psr\Log\LoggerInterface;
/**
* 语音合成客户端
*
* @author guizheng@iflytek.com
*/
class TtsClient
{
use SignTrait;
use TtsTrait;
/**
* @var string app_id
*/
protected $appId;
/**
* @var string api_key
*/
protected $apiKey;
/**
* @var string api_secret
*/
protected $apiSecret;
/**
* @var array 合成参数配置
*/
protected $requestConfig;
/**
* @var LoggerInterface or null 日志处理
*/
protected $logger;
public function __construct($appId, $apiKey, $apiSecret, $requestConfig = [], $logger = null)
{
$this->appId = $appId;
$this->apiKey = $apiKey;
$this->apiSecret = $apiSecret;
$this->requestConfig = new TtsConfig($requestConfig);
$this->logger = $logger;
}
/**
* 合成文本,并返回结果(字节数组)在Response->getBody()->getContents()
*
* @param string $text 待合成的文本
* @return \GuzzleHttp\Psr7\Response
* @throws Exception
*/
public function request($text)
{
$ttsHandler = new WsHandler(
$this->signUriV1(TtsConstants::URI, [
'appId' => $this->appId,
'apiKey' => $this->apiKey,
'apiSecret' => $this->apiSecret,
'host' => TtsConstants::HOST,
'requestLine' => TtsConstants::REQUEST_LINE,
]),
$this->generateInput($text, $this->appId, $this->requestConfig->toArray())
);
if ($this->logger) {
$ttsHandler->setLogger($this->logger);
}
$client = new WsClient([
'handler' => $ttsHandler
]);
return $client->sendAndReceive();
}
}

View File

@ -1 +1 @@
import o from"./error.64edf5bb.js";import{d as r,o as i,c as p,U as m,L as e,a as t}from"./@vue.51d7f2d8.js";import"./element-plus.b64c0a90.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./vue-router.9f65afb1.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";const s="/admin/assets/no_perms.a56e95a5.png",a={class:"error404"},u=t("div",{class:"flex justify-center"},[t("img",{class:"w-[150px] h-[150px]",src:s,alt:""})],-1),T=r({__name:"403",setup(c){return(n,_)=>(i(),p("div",a,[m(o,{code:"403",title:"\u60A8\u7684\u8D26\u53F7\u6743\u9650\u4E0D\u8DB3\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650\uFF01","show-btn":!1},{content:e(()=>[u]),_:1})]))}});export{T as default};
import o from"./error.06f8098f.js";import{d as r,o as i,c as p,U as m,L as e,a as t}from"./@vue.51d7f2d8.js";import"./element-plus.b64c0a90.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./vue-router.9f65afb1.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";const s="/admin/assets/no_perms.a56e95a5.png",a={class:"error404"},u=t("div",{class:"flex justify-center"},[t("img",{class:"w-[150px] h-[150px]",src:s,alt:""})],-1),T=r({__name:"403",setup(c){return(n,_)=>(i(),p("div",a,[m(o,{code:"403",title:"\u60A8\u7684\u8D26\u53F7\u6743\u9650\u4E0D\u8DB3\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u6DFB\u52A0\u6743\u9650\uFF01","show-btn":!1},{content:e(()=>[u]),_:1})]))}});export{T as default};

View File

@ -1 +1 @@
import o from"./error.64edf5bb.js";import{d as r,o as t,c as m,U as p}from"./@vue.51d7f2d8.js";import"./element-plus.b64c0a90.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./vue-router.9f65afb1.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";const i={class:"error404"},P=r({__name:"404",setup(e){return(u,c)=>(t(),m("div",i,[p(o,{code:"404",title:"\u54CE\u5440\uFF0C\u51FA\u9519\u4E86\uFF01\u60A8\u8BBF\u95EE\u7684\u9875\u9762\u4E0D\u5B58\u5728\u2026"})]))}});export{P as default};
import o from"./error.06f8098f.js";import{d as r,o as t,c as m,U as p}from"./@vue.51d7f2d8.js";import"./element-plus.b64c0a90.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./vue-router.9f65afb1.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";const i={class:"error404"},P=r({__name:"404",setup(e){return(u,c)=>(t(),m("div",i,[p(o,{code:"404",title:"\u54CE\u5440\uFF0C\u51FA\u9519\u4E86\uFF01\u60A8\u8BBF\u95EE\u7684\u9875\u9762\u4E0D\u5B58\u5728\u2026"})]))}});export{P as default};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import"./account-adjust.vue_vue_type_script_setup_true_lang.1e83086b.js";import{_ as N}from"./account-adjust.vue_vue_type_script_setup_true_lang.1e83086b.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";export{N as default};
import"./account-adjust.vue_vue_type_script_setup_true_lang.044fa5d8.js";import{_ as N}from"./account-adjust.vue_vue_type_script_setup_true_lang.044fa5d8.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";export{N as default};

View File

@ -1 +1 @@
import{C as x,G as B,H as R,B as g,D as N}from"./element-plus.b64c0a90.js";import{P as q}from"./index.280ce7d1.js";import{f as C}from"./index.53b22837.js";import{d as A,s as D,$ as I,e as S,w as b,o as U,K as j,L as a,a as G,U as o,u as r,R as n,S as E}from"./@vue.51d7f2d8.js";const P={class:"pr-8"},T=A({__name:"account-adjust",props:{show:{type:Boolean,required:!0},value:{type:[Number,String],required:!0}},emits:["update:show","confirm"],setup(d,{emit:i}){const c=d,s=D(),u=I({action:1,num:"",remark:""}),m=D(),f=S(()=>Number(c.value)+Number(u.num)*(u.action==1?1:-1)),w={num:[{required:!0,message:"\u8BF7\u8F93\u5165\u8C03\u6574\u7684\u91D1\u989D"}]},v=e=>{if(e.includes("-"))return C.msgError("\u8BF7\u8F93\u5165\u6B63\u6574\u6570");u.num=e},y=async()=>{var e;await((e=s.value)==null?void 0:e.validate()),i("confirm",u)},V=()=>{var e;i("update:show",!1),(e=s.value)==null||e.resetFields()};return b(()=>c.show,e=>{var l,t;e?(l=m.value)==null||l.open():(t=m.value)==null||t.close()}),b(f,e=>{e<0&&(C.msgError("\u8C03\u6574\u540E\u4F59\u989D\u9700\u5927\u4E8E0"),u.num="")}),(e,l)=>{const t=x,_=B,h=R,F=g,k=N;return U(),j(q,{ref_key:"popupRef",ref:m,title:"\u4F59\u989D\u8C03\u6574",width:"500px",onConfirm:y,async:!0,onClose:V},{default:a(()=>[G("div",P,[o(k,{ref_key:"formRef",ref:s,model:r(u),"label-width":"120px",rules:w},{default:a(()=>[o(t,{label:"\u5F53\u524D\u4F59\u989D"},{default:a(()=>[n("\xA5 "+E(d.value),1)]),_:1}),o(t,{label:"\u4F59\u989D\u589E\u51CF",required:"",prop:"action"},{default:a(()=>[o(h,{modelValue:r(u).action,"onUpdate:modelValue":l[0]||(l[0]=p=>r(u).action=p)},{default:a(()=>[o(_,{label:1},{default:a(()=>[n("\u589E\u52A0\u4F59\u989D")]),_:1}),o(_,{label:2},{default:a(()=>[n("\u6263\u51CF\u4F59\u989D")]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(t,{label:"\u8C03\u6574\u4F59\u989D",prop:"num"},{default:a(()=>[o(F,{"model-value":r(u).num,placeholder:"\u8BF7\u8F93\u5165\u8C03\u6574\u7684\u91D1\u989D",type:"number",onInput:v},null,8,["model-value"])]),_:1}),o(t,{label:"\u8C03\u6574\u540E\u4F59\u989D"},{default:a(()=>[n(" \xA5 "+E(r(f)),1)]),_:1}),o(t,{label:"\u5907\u6CE8",prop:"remark"},{default:a(()=>[o(F,{modelValue:r(u).remark,"onUpdate:modelValue":l[1]||(l[1]=p=>r(u).remark=p),type:"textarea",rows:4},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])]),_:1},512)}}});export{T as _};
import{C as x,G as B,H as R,B as g,D as N}from"./element-plus.b64c0a90.js";import{P as q}from"./index.a975a0b7.js";import{f as C}from"./index.d710a8b7.js";import{d as A,s as D,$ as I,e as S,w as b,o as U,K as j,L as a,a as G,U as o,u as r,R as n,S as E}from"./@vue.51d7f2d8.js";const P={class:"pr-8"},T=A({__name:"account-adjust",props:{show:{type:Boolean,required:!0},value:{type:[Number,String],required:!0}},emits:["update:show","confirm"],setup(d,{emit:i}){const c=d,s=D(),u=I({action:1,num:"",remark:""}),m=D(),f=S(()=>Number(c.value)+Number(u.num)*(u.action==1?1:-1)),w={num:[{required:!0,message:"\u8BF7\u8F93\u5165\u8C03\u6574\u7684\u91D1\u989D"}]},v=e=>{if(e.includes("-"))return C.msgError("\u8BF7\u8F93\u5165\u6B63\u6574\u6570");u.num=e},y=async()=>{var e;await((e=s.value)==null?void 0:e.validate()),i("confirm",u)},V=()=>{var e;i("update:show",!1),(e=s.value)==null||e.resetFields()};return b(()=>c.show,e=>{var l,t;e?(l=m.value)==null||l.open():(t=m.value)==null||t.close()}),b(f,e=>{e<0&&(C.msgError("\u8C03\u6574\u540E\u4F59\u989D\u9700\u5927\u4E8E0"),u.num="")}),(e,l)=>{const t=x,_=B,h=R,F=g,k=N;return U(),j(q,{ref_key:"popupRef",ref:m,title:"\u4F59\u989D\u8C03\u6574",width:"500px",onConfirm:y,async:!0,onClose:V},{default:a(()=>[G("div",P,[o(k,{ref_key:"formRef",ref:s,model:r(u),"label-width":"120px",rules:w},{default:a(()=>[o(t,{label:"\u5F53\u524D\u4F59\u989D"},{default:a(()=>[n("\xA5 "+E(d.value),1)]),_:1}),o(t,{label:"\u4F59\u989D\u589E\u51CF",required:"",prop:"action"},{default:a(()=>[o(h,{modelValue:r(u).action,"onUpdate:modelValue":l[0]||(l[0]=p=>r(u).action=p)},{default:a(()=>[o(_,{label:1},{default:a(()=>[n("\u589E\u52A0\u4F59\u989D")]),_:1}),o(_,{label:2},{default:a(()=>[n("\u6263\u51CF\u4F59\u989D")]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(t,{label:"\u8C03\u6574\u4F59\u989D",prop:"num"},{default:a(()=>[o(F,{"model-value":r(u).num,placeholder:"\u8BF7\u8F93\u5165\u8C03\u6574\u7684\u91D1\u989D",type:"number",onInput:v},null,8,["model-value"])]),_:1}),o(t,{label:"\u8C03\u6574\u540E\u4F59\u989D"},{default:a(()=>[n(" \xA5 "+E(r(f)),1)]),_:1}),o(t,{label:"\u5907\u6CE8",prop:"remark"},{default:a(()=>[o(F,{modelValue:r(u).remark,"onUpdate:modelValue":l[1]||(l[1]=p=>r(u).remark=p),type:"textarea",rows:4},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])]),_:1},512)}}});export{T as _};

View File

@ -1 +0,0 @@
import"./add-nav.vue_vue_type_script_setup_true_lang.66ca83f2.js";import{_ as Z}from"./add-nav.vue_vue_type_script_setup_true_lang.66ca83f2.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.c8fef2f6.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.6693414f.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.223a7f76.js";import"./index.c5f54a17.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4d04e137.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.a2066cae.js";import"./vue.3348ef2c.js";import"./sortablejs.85a0be55.js";export{Z as default};

View File

@ -0,0 +1 @@
import"./add-nav.vue_vue_type_script_setup_true_lang.87dc1a74.js";import{_ as Z}from"./add-nav.vue_vue_type_script_setup_true_lang.87dc1a74.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.f6ec68b3.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.3151f430.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.03975c4f.js";import"./index.36a4598c.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4638cea9.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.0cb40d3a.js";import"./vue.5de34049.js";import"./sortablejs.ef73fc5c.js";export{Z as default};

View File

@ -1 +1 @@
import{B,w as D}from"./element-plus.b64c0a90.js";import{_ as F}from"./index.c8fef2f6.js";import{_ as A}from"./picker.6693414f.js";import{_ as y}from"./picker.223a7f76.js";import{f as p,b as E}from"./index.53b22837.js";import{D as U}from"./vuedraggable.a2066cae.js";import{d as C,e as w,o as c,c as N,a as e,U as t,L as m,K as $,u as r,k as z,R as L}from"./@vue.51d7f2d8.js";const R={class:"bg-fill-light flex items-center w-full p-4 mb-4 cursor-move"},I={class:"upload-btn w-[60px] h-[60px]"},K={class:"ml-3 flex-1"},P={class:"flex"},T=e("span",{class:"text-tx-regular flex-none mr-3"},"\u540D\u79F0",-1),j={class:"flex mt-[18px]"},q=e("span",{class:"text-tx-regular flex-none mr-3"},"\u94FE\u63A5",-1),W=C({__name:"add-nav",props:{modelValue:{type:Array,default:()=>[]},max:{type:Number,default:10},min:{type:Number,default:1}},emits:["update:modelValue"],setup(_,{emit:i}){const o=_,s=w({get(){return o.modelValue},set(a){i("update:modelValue",a)}}),f=()=>{var a;((a=o.modelValue)==null?void 0:a.length)<o.max?s.value.push({image:"",name:"\u5BFC\u822A\u540D\u79F0",link:{}}):p.msgError(`\u6700\u591A\u6DFB\u52A0${o.max}\u4E2A`)},V=a=>{var u;if(((u=o.modelValue)==null?void 0:u.length)<=o.min)return p.msgError(`\u6700\u5C11\u4FDD\u7559${o.min}\u4E2A`);s.value.splice(a,1)};return(a,u)=>{const x=E,g=y,h=B,v=A,k=F,b=D;return c(),N("div",null,[e("div",null,[t(r(U),{class:"draggable",modelValue:r(s),"onUpdate:modelValue":u[0]||(u[0]=l=>z(s)?s.value=l:null),animation:"300"},{item:m(({element:l,index:d})=>[(c(),$(k,{class:"max-w-[400px]",key:d,onClose:n=>V(d)},{default:m(()=>[e("div",R,[t(g,{modelValue:l.image,"onUpdate:modelValue":n=>l.image=n,"upload-class":"bg-body",size:"60px","exclude-domain":""},{upload:m(()=>[e("div",I,[t(x,{name:"el-icon-Plus",size:20})])]),_:2},1032,["modelValue","onUpdate:modelValue"]),e("div",K,[e("div",P,[T,t(h,{modelValue:l.name,"onUpdate:modelValue":n=>l.name=n,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),e("div",j,[q,t(v,{modelValue:l.link,"onUpdate:modelValue":n=>l.link=n},null,8,["modelValue","onUpdate:modelValue"])])])])]),_:2},1032,["onClose"]))]),_:1},8,["modelValue"])]),e("div",null,[t(b,{type:"primary",onClick:f},{default:m(()=>[L("\u6DFB\u52A0")]),_:1})])])}}});export{W as _};
import{B,w as D}from"./element-plus.b64c0a90.js";import{_ as F}from"./index.f6ec68b3.js";import{_ as A}from"./picker.3151f430.js";import{_ as y}from"./picker.03975c4f.js";import{f as p,b as E}from"./index.d710a8b7.js";import{D as U}from"./vuedraggable.0cb40d3a.js";import{d as C,e as w,o as c,c as N,a as e,U as t,L as m,K as $,u as r,k as z,R as L}from"./@vue.51d7f2d8.js";const R={class:"bg-fill-light flex items-center w-full p-4 mb-4 cursor-move"},I={class:"upload-btn w-[60px] h-[60px]"},K={class:"ml-3 flex-1"},P={class:"flex"},T=e("span",{class:"text-tx-regular flex-none mr-3"},"\u540D\u79F0",-1),j={class:"flex mt-[18px]"},q=e("span",{class:"text-tx-regular flex-none mr-3"},"\u94FE\u63A5",-1),W=C({__name:"add-nav",props:{modelValue:{type:Array,default:()=>[]},max:{type:Number,default:10},min:{type:Number,default:1}},emits:["update:modelValue"],setup(_,{emit:i}){const o=_,s=w({get(){return o.modelValue},set(a){i("update:modelValue",a)}}),f=()=>{var a;((a=o.modelValue)==null?void 0:a.length)<o.max?s.value.push({image:"",name:"\u5BFC\u822A\u540D\u79F0",link:{}}):p.msgError(`\u6700\u591A\u6DFB\u52A0${o.max}\u4E2A`)},V=a=>{var u;if(((u=o.modelValue)==null?void 0:u.length)<=o.min)return p.msgError(`\u6700\u5C11\u4FDD\u7559${o.min}\u4E2A`);s.value.splice(a,1)};return(a,u)=>{const x=E,g=y,h=B,v=A,k=F,b=D;return c(),N("div",null,[e("div",null,[t(r(U),{class:"draggable",modelValue:r(s),"onUpdate:modelValue":u[0]||(u[0]=l=>z(s)?s.value=l:null),animation:"300"},{item:m(({element:l,index:d})=>[(c(),$(k,{class:"max-w-[400px]",key:d,onClose:n=>V(d)},{default:m(()=>[e("div",R,[t(g,{modelValue:l.image,"onUpdate:modelValue":n=>l.image=n,"upload-class":"bg-body",size:"60px","exclude-domain":""},{upload:m(()=>[e("div",I,[t(x,{name:"el-icon-Plus",size:20})])]),_:2},1032,["modelValue","onUpdate:modelValue"]),e("div",K,[e("div",P,[T,t(h,{modelValue:l.name,"onUpdate:modelValue":n=>l.name=n,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),e("div",j,[q,t(v,{modelValue:l.link,"onUpdate:modelValue":n=>l.link=n},null,8,["modelValue","onUpdate:modelValue"])])])])]),_:2},1032,["onClose"]))]),_:1},8,["modelValue"])]),e("div",null,[t(b,{type:"primary",onClick:f},{default:m(()=>[L("\u6DFB\u52A0")]),_:1})])])}}});export{W as _};

View File

@ -1 +1 @@
import{r as n}from"./index.53b22837.js";function e(t){return n.get({url:"/auth.admin/lists",params:t},{ignoreCancelToken:!0})}function r(t){return n.post({url:"/auth.admin/add",params:t})}function u(t){return n.post({url:"/auth.admin/edit",params:t})}function i(t){return n.post({url:"/auth.admin/delete",params:t})}function s(t){return n.get({url:"/auth.admin/detail",params:t})}function d(t){return n.get({url:"/auth.admin/Draftingcontracts",params:t})}function o(t){return n.get({url:"/auth.admin/postsms",params:t})}export{e as a,u as b,r as c,s as d,i as e,d as g,o as s};
import{r as n}from"./index.d710a8b7.js";function e(t){return n.get({url:"/auth.admin/lists",params:t},{ignoreCancelToken:!0})}function r(t){return n.post({url:"/auth.admin/add",params:t})}function u(t){return n.post({url:"/auth.admin/edit",params:t})}function i(t){return n.post({url:"/auth.admin/delete",params:t})}function s(t){return n.get({url:"/auth.admin/detail",params:t})}function d(t){return n.get({url:"/auth.admin/Draftingcontracts",params:t})}function o(t){return n.get({url:"/auth.admin/postsms",params:t})}export{e as a,u as b,r as c,s as d,i as e,d as g,o as s};

View File

@ -1 +1 @@
import{r as e}from"./index.53b22837.js";function a(t){return e.get({url:"/article.articleCate/lists",params:t})}function l(t){return e.get({url:"/article.articleCate/all",params:t})}function i(t){return e.post({url:"/article.articleCate/add",params:t})}function c(t){return e.post({url:"/article.articleCate/edit",params:t})}function u(t){return e.post({url:"/article.articleCate/delete",params:t})}function n(t){return e.get({url:"/article.articleCate/detail",params:t})}function s(t){return e.post({url:"/article.articleCate/updateStatus",params:t})}function o(t){return e.get({url:"/article.article/lists",params:t})}function d(t){return e.post({url:"/article.article/add",params:t})}function f(t){return e.post({url:"/article.article/edit",params:t})}function C(t){return e.post({url:"/article.article/delete",params:t})}function p(t){return e.get({url:"/article.article/detail",params:t})}function g(t){return e.post({url:"/article.article/updateStatus",params:t})}export{c as a,i as b,n as c,u as d,s as e,a as f,p as g,l as h,f as i,d as j,g as k,C as l,o as m};
import{r as e}from"./index.d710a8b7.js";function a(t){return e.get({url:"/article.articleCate/lists",params:t})}function l(t){return e.get({url:"/article.articleCate/all",params:t})}function i(t){return e.post({url:"/article.articleCate/add",params:t})}function c(t){return e.post({url:"/article.articleCate/edit",params:t})}function u(t){return e.post({url:"/article.articleCate/delete",params:t})}function n(t){return e.get({url:"/article.articleCate/detail",params:t})}function s(t){return e.post({url:"/article.articleCate/updateStatus",params:t})}function o(t){return e.get({url:"/article.article/lists",params:t})}function d(t){return e.post({url:"/article.article/add",params:t})}function f(t){return e.post({url:"/article.article/edit",params:t})}function C(t){return e.post({url:"/article.article/delete",params:t})}function p(t){return e.get({url:"/article.article/detail",params:t})}function g(t){return e.post({url:"/article.article/updateStatus",params:t})}export{c as a,i as b,n as c,u as d,s as e,a as f,p as g,l as h,f as i,d as j,g as k,C as l,o as m};

View File

@ -1 +0,0 @@
import"./attr-setting.vue_vue_type_script_setup_true_lang.a390b4e5.js";import{_ as gm}from"./attr-setting.vue_vue_type_script_setup_true_lang.a390b4e5.js";import"./index.34f2bfa0.js";import"./attr.vue_vue_type_script_setup_true_lang.e743e458.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.c8fef2f6.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.6693414f.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.223a7f76.js";import"./index.c5f54a17.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4d04e137.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.a2066cae.js";import"./vue.3348ef2c.js";import"./sortablejs.85a0be55.js";import"./content.vue_vue_type_script_setup_true_lang.64fb1479.js";import"./decoration-img.da75ee7a.js";import"./attr.vue_vue_type_script_setup_true_lang.ccb45541.js";import"./content.2945b561.js";import"./attr.vue_vue_type_script_setup_true_lang.a74053a1.js";import"./add-nav.vue_vue_type_script_setup_true_lang.66ca83f2.js";import"./content.54e70adb.js";import"./attr.vue_vue_type_script_setup_true_lang.17fa2197.js";import"./content.vue_vue_type_script_setup_true_lang.858993d2.js";import"./attr.vue_vue_type_script_setup_true_lang.d01577b5.js";import"./content.ec5f86af.js";import"./decoration.d7c7779b.js";import"./attr.vue_vue_type_script_setup_true_lang.0fc534ba.js";import"./content.0800738a.js";import"./attr.vue_vue_type_script_setup_true_lang.93d16907.js";import"./content.vue_vue_type_script_setup_true_lang.fc27105d.js";import"./attr.vue_vue_type_script_setup_true_lang.00e826d0.js";import"./content.a18e102b.js";export{gm as default};

View File

@ -0,0 +1 @@
import"./attr-setting.vue_vue_type_script_setup_true_lang.8e6dd20c.js";import{_ as gm}from"./attr-setting.vue_vue_type_script_setup_true_lang.8e6dd20c.js";import"./index.aa1f7bf3.js";import"./attr.vue_vue_type_script_setup_true_lang.687bc2bf.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.f6ec68b3.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.3151f430.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.03975c4f.js";import"./index.36a4598c.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4638cea9.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.0cb40d3a.js";import"./vue.5de34049.js";import"./sortablejs.ef73fc5c.js";import"./content.vue_vue_type_script_setup_true_lang.a6d6afc0.js";import"./decoration-img.602090e4.js";import"./attr.vue_vue_type_script_setup_true_lang.c971649d.js";import"./content.03e65212.js";import"./attr.vue_vue_type_script_setup_true_lang.28fa3cf0.js";import"./add-nav.vue_vue_type_script_setup_true_lang.87dc1a74.js";import"./content.bb8352cf.js";import"./attr.vue_vue_type_script_setup_true_lang.66fc1ef0.js";import"./content.vue_vue_type_script_setup_true_lang.5db6e685.js";import"./attr.vue_vue_type_script_setup_true_lang.d01577b5.js";import"./content.3511a0a9.js";import"./decoration.ff2c4515.js";import"./attr.vue_vue_type_script_setup_true_lang.0fc534ba.js";import"./content.dedef8d6.js";import"./attr.vue_vue_type_script_setup_true_lang.5b783121.js";import"./content.vue_vue_type_script_setup_true_lang.9f6c2933.js";import"./attr.vue_vue_type_script_setup_true_lang.00e826d0.js";import"./content.fc58982c.js";export{gm as default};

View File

@ -1 +1 @@
import{w as c}from"./index.34f2bfa0.js";import{d as l,o as t,c as d,a as m,S as p,K as r,P as f,u as g,aK as y}from"./@vue.51d7f2d8.js";const b={class:"pages-setting"},u={class:"title flex items-center before:w-[3px] before:h-[14px] before:block before:bg-primary before:mr-2"},v=l({__name:"attr-setting",props:{widget:{type:Object,default:()=>({})},type:{type:String,default:"mobile"}},setup(e){return(w,x)=>{var s,a,n,o,i;return t(),d("div",b,[m("div",u,p((s=e.widget)==null?void 0:s.title),1),(t(),r(y,null,[(t(),r(f((n=g(c)[(a=e.widget)==null?void 0:a.name])==null?void 0:n.attr),{class:"pt-5 pr-4",content:(o=e.widget)==null?void 0:o.content,styles:(i=e.widget)==null?void 0:i.styles,type:e.type},null,8,["content","styles","type"]))],1024))])}}});export{v as _};
import{w as c}from"./index.aa1f7bf3.js";import{d as l,o as t,c as d,a as m,S as p,K as r,P as f,u as g,aK as y}from"./@vue.51d7f2d8.js";const b={class:"pages-setting"},u={class:"title flex items-center before:w-[3px] before:h-[14px] before:block before:bg-primary before:mr-2"},v=l({__name:"attr-setting",props:{widget:{type:Object,default:()=>({})},type:{type:String,default:"mobile"}},setup(e){return(w,x)=>{var s,a,n,o,i;return t(),d("div",b,[m("div",u,p((s=e.widget)==null?void 0:s.title),1),(t(),r(y,null,[(t(),r(f((n=g(c)[(a=e.widget)==null?void 0:a.name])==null?void 0:n.attr),{class:"pt-5 pr-4",content:(o=e.widget)==null?void 0:o.content,styles:(i=e.widget)==null?void 0:i.styles,type:e.type},null,8,["content","styles","type"]))],1024))])}}});export{v as _};

View File

@ -0,0 +1 @@
import"./attr.vue_vue_type_script_setup_true_lang.c971649d.js";import{_ as Y}from"./attr.vue_vue_type_script_setup_true_lang.c971649d.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./picker.03975c4f.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./index.36a4598c.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.f6ec68b3.js";import"./index.4638cea9.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.0cb40d3a.js";import"./vue.5de34049.js";import"./sortablejs.ef73fc5c.js";export{Y as default};

View File

@ -1 +0,0 @@
import"./attr.vue_vue_type_script_setup_true_lang.93d16907.js";import{_ as Z}from"./attr.vue_vue_type_script_setup_true_lang.93d16907.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.c8fef2f6.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.6693414f.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.223a7f76.js";import"./index.c5f54a17.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4d04e137.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.a2066cae.js";import"./vue.3348ef2c.js";import"./sortablejs.85a0be55.js";export{Z as default};

View File

@ -0,0 +1 @@
import"./attr.vue_vue_type_script_setup_true_lang.66fc1ef0.js";import{_ as $}from"./attr.vue_vue_type_script_setup_true_lang.66fc1ef0.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./add-nav.vue_vue_type_script_setup_true_lang.87dc1a74.js";import"./index.f6ec68b3.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.3151f430.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.03975c4f.js";import"./index.36a4598c.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4638cea9.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.0cb40d3a.js";import"./vue.5de34049.js";import"./sortablejs.ef73fc5c.js";export{$ as default};

View File

@ -0,0 +1 @@
import"./attr.vue_vue_type_script_setup_true_lang.5b783121.js";import{_ as Z}from"./attr.vue_vue_type_script_setup_true_lang.5b783121.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.f6ec68b3.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.3151f430.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.03975c4f.js";import"./index.36a4598c.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4638cea9.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.0cb40d3a.js";import"./vue.5de34049.js";import"./sortablejs.ef73fc5c.js";export{Z as default};

View File

@ -1 +0,0 @@
import"./attr.vue_vue_type_script_setup_true_lang.ccb45541.js";import{_ as Y}from"./attr.vue_vue_type_script_setup_true_lang.ccb45541.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./picker.223a7f76.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./index.c5f54a17.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.c8fef2f6.js";import"./index.4d04e137.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.a2066cae.js";import"./vue.3348ef2c.js";import"./sortablejs.85a0be55.js";export{Y as default};

View File

@ -1 +0,0 @@
import"./attr.vue_vue_type_script_setup_true_lang.a74053a1.js";import{_ as $}from"./attr.vue_vue_type_script_setup_true_lang.a74053a1.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./add-nav.vue_vue_type_script_setup_true_lang.66ca83f2.js";import"./index.c8fef2f6.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.6693414f.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.223a7f76.js";import"./index.c5f54a17.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4d04e137.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.a2066cae.js";import"./vue.3348ef2c.js";import"./sortablejs.85a0be55.js";export{$ as default};

View File

@ -1 +0,0 @@
import"./attr.vue_vue_type_script_setup_true_lang.17fa2197.js";import{_ as $}from"./attr.vue_vue_type_script_setup_true_lang.17fa2197.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./add-nav.vue_vue_type_script_setup_true_lang.66ca83f2.js";import"./index.c8fef2f6.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.6693414f.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.223a7f76.js";import"./index.c5f54a17.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4d04e137.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.a2066cae.js";import"./vue.3348ef2c.js";import"./sortablejs.85a0be55.js";export{$ as default};

View File

@ -1 +0,0 @@
import"./attr.vue_vue_type_script_setup_true_lang.e743e458.js";import{_ as Z}from"./attr.vue_vue_type_script_setup_true_lang.e743e458.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.c8fef2f6.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.6693414f.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.223a7f76.js";import"./index.c5f54a17.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4d04e137.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.a2066cae.js";import"./vue.3348ef2c.js";import"./sortablejs.85a0be55.js";export{Z as default};

View File

@ -0,0 +1 @@
import"./attr.vue_vue_type_script_setup_true_lang.28fa3cf0.js";import{_ as $}from"./attr.vue_vue_type_script_setup_true_lang.28fa3cf0.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./add-nav.vue_vue_type_script_setup_true_lang.87dc1a74.js";import"./index.f6ec68b3.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.3151f430.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.03975c4f.js";import"./index.36a4598c.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4638cea9.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.0cb40d3a.js";import"./vue.5de34049.js";import"./sortablejs.ef73fc5c.js";export{$ as default};

View File

@ -0,0 +1 @@
import"./attr.vue_vue_type_script_setup_true_lang.687bc2bf.js";import{_ as Z}from"./attr.vue_vue_type_script_setup_true_lang.687bc2bf.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.f6ec68b3.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./picker.3151f430.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./picker.03975c4f.js";import"./index.36a4598c.js";import"./index.vue_vue_type_script_setup_true_lang.a080b28e.js";import"./index.4638cea9.js";import"./index.vue_vue_type_script_setup_true_lang.c4fa43c7.js";import"./usePaging.2ad8e1e6.js";import"./vue3-video-play.b911321b.js";import"./vuedraggable.0cb40d3a.js";import"./vue.5de34049.js";import"./sortablejs.ef73fc5c.js";export{Z as default};

View File

@ -1 +1 @@
import{G as r,H as _,C as i,B as f,D as p}from"./element-plus.b64c0a90.js";import{_ as V}from"./add-nav.vue_vue_type_script_setup_true_lang.66ca83f2.js";import{d as b,o as E,c as x,U as e,L as t,R as d,a as B}from"./@vue.51d7f2d8.js";const F={class:"flex-1"},w=b({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(l){return(y,o)=>{const u=r,m=_,n=i,s=f,c=p;return E(),x("div",null,[e(c,{"label-width":"70px"},{default:t(()=>[e(n,{label:"\u6392\u7248\u6837\u5F0F"},{default:t(()=>[e(m,{modelValue:l.content.style,"onUpdate:modelValue":o[0]||(o[0]=a=>l.content.style=a)},{default:t(()=>[e(u,{label:1},{default:t(()=>[d("\u6A2A\u6392")]),_:1}),e(u,{label:2},{default:t(()=>[d("\u7AD6\u6392")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(n,{label:"\u6807\u9898\u540D\u79F0"},{default:t(()=>[e(s,{class:"w-[400px]",modelValue:l.content.title,"onUpdate:modelValue":o[1]||(o[1]=a=>l.content.title=a)},null,8,["modelValue"])]),_:1}),e(n,{label:"\u83DC\u5355\u8BBE\u7F6E"},{default:t(()=>[B("div",F,[e(V,{modelValue:l.content.data,"onUpdate:modelValue":o[2]||(o[2]=a=>l.content.data=a)},null,8,["modelValue"])])]),_:1})]),_:1})])}}});export{w as _};
import{G as r,H as _,C as i,B as f,D as p}from"./element-plus.b64c0a90.js";import{_ as V}from"./add-nav.vue_vue_type_script_setup_true_lang.87dc1a74.js";import{d as b,o as E,c as x,U as e,L as t,R as d,a as B}from"./@vue.51d7f2d8.js";const F={class:"flex-1"},w=b({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(l){return(y,o)=>{const u=r,m=_,n=i,s=f,c=p;return E(),x("div",null,[e(c,{"label-width":"70px"},{default:t(()=>[e(n,{label:"\u6392\u7248\u6837\u5F0F"},{default:t(()=>[e(m,{modelValue:l.content.style,"onUpdate:modelValue":o[0]||(o[0]=a=>l.content.style=a)},{default:t(()=>[e(u,{label:1},{default:t(()=>[d("\u6A2A\u6392")]),_:1}),e(u,{label:2},{default:t(()=>[d("\u7AD6\u6392")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(n,{label:"\u6807\u9898\u540D\u79F0"},{default:t(()=>[e(s,{class:"w-[400px]",modelValue:l.content.title,"onUpdate:modelValue":o[1]||(o[1]=a=>l.content.title=a)},null,8,["modelValue"])]),_:1}),e(n,{label:"\u83DC\u5355\u8BBE\u7F6E"},{default:t(()=>[B("div",F,[e(V,{modelValue:l.content.data,"onUpdate:modelValue":o[2]||(o[2]=a=>l.content.data=a)},null,8,["modelValue"])])]),_:1})]),_:1})])}}});export{w as _};

View File

@ -1 +1 @@
import{G as D,H as U,C as y,B as v,w,D as N}from"./element-plus.b64c0a90.js";import{_ as R}from"./index.c8fef2f6.js";import{_ as $}from"./picker.6693414f.js";import{_ as j}from"./picker.223a7f76.js";import{f as F}from"./index.53b22837.js";import{D as G}from"./vuedraggable.a2066cae.js";import{d as I,o as c,c as O,U as e,L as t,R as _,a as m,u as H,K as E,Q as K}from"./@vue.51d7f2d8.js";const L={class:"flex-1"},Q=m("div",{class:"form-tips"},"\u6700\u591A\u6DFB\u52A05\u5F20\uFF0C\u5EFA\u8BAE\u56FE\u7247\u5C3A\u5BF8\uFF1A750px*200px",-1),T={class:"bg-fill-light flex items-center w-full p-4 mt-4 cursor-move"},q={class:"ml-3 flex-1"},r=5,Y=I({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(a){const s=a,V=()=>{var u;((u=s.content.data)==null?void 0:u.length)<r?s.content.data.push({image:"",name:"",link:{}}):F.msgError(`\u6700\u591A\u6DFB\u52A0${r}\u5F20\u56FE\u7247`)},g=u=>{var o;if(((o=s.content.data)==null?void 0:o.length)<=1)return F.msgError("\u6700\u5C11\u4FDD\u7559\u4E00\u5F20\u56FE\u7247");s.content.data.splice(u,1)};return(u,o)=>{const p=D,b=U,d=y,B=j,k=v,x=$,h=R,A=w,C=N;return c(),O("div",null,[e(C,{"label-width":"70px"},{default:t(()=>{var i;return[e(d,{label:"\u662F\u5426\u542F\u7528"},{default:t(()=>[e(b,{modelValue:a.content.enabled,"onUpdate:modelValue":o[0]||(o[0]=l=>a.content.enabled=l)},{default:t(()=>[e(p,{label:1},{default:t(()=>[_("\u5F00\u542F")]),_:1}),e(p,{label:0},{default:t(()=>[_("\u505C\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(d,{label:"\u56FE\u7247\u8BBE\u7F6E"},{default:t(()=>[m("div",L,[Q,e(H(G),{class:"draggable",modelValue:a.content.data,"onUpdate:modelValue":o[1]||(o[1]=l=>a.content.data=l),animation:"300"},{item:t(({element:l,index:f})=>[(c(),E(h,{key:f,onClose:n=>g(f),class:"max-w-[400px]"},{default:t(()=>[m("div",T,[e(B,{modelValue:l.image,"onUpdate:modelValue":n=>l.image=n,"upload-class":"bg-body","exclude-domain":""},null,8,["modelValue","onUpdate:modelValue"]),m("div",q,[e(d,{label:"\u56FE\u7247\u540D\u79F0"},{default:t(()=>[e(k,{modelValue:l.name,"onUpdate:modelValue":n=>l.name=n,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),e(d,{class:"mt-[18px]",label:"\u56FE\u7247\u94FE\u63A5"},{default:t(()=>[e(x,{modelValue:l.link,"onUpdate:modelValue":n=>l.link=n},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)])])]),_:2},1032,["onClose"]))]),_:1},8,["modelValue"])])]),_:1}),((i=a.content.data)==null?void 0:i.length)<r?(c(),E(d,{key:0},{default:t(()=>[e(A,{type:"primary",onClick:V},{default:t(()=>[_("\u6DFB\u52A0\u56FE\u7247")]),_:1})]),_:1})):K("",!0)]}),_:1})])}}});export{Y as _};
import{G as D,H as U,C as y,B as v,w,D as N}from"./element-plus.b64c0a90.js";import{_ as R}from"./index.f6ec68b3.js";import{_ as $}from"./picker.3151f430.js";import{_ as j}from"./picker.03975c4f.js";import{f as F}from"./index.d710a8b7.js";import{D as G}from"./vuedraggable.0cb40d3a.js";import{d as I,o as c,c as O,U as e,L as t,R as _,a as m,u as H,K as E,Q as K}from"./@vue.51d7f2d8.js";const L={class:"flex-1"},Q=m("div",{class:"form-tips"},"\u6700\u591A\u6DFB\u52A05\u5F20\uFF0C\u5EFA\u8BAE\u56FE\u7247\u5C3A\u5BF8\uFF1A750px*200px",-1),T={class:"bg-fill-light flex items-center w-full p-4 mt-4 cursor-move"},q={class:"ml-3 flex-1"},r=5,Y=I({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(a){const s=a,V=()=>{var u;((u=s.content.data)==null?void 0:u.length)<r?s.content.data.push({image:"",name:"",link:{}}):F.msgError(`\u6700\u591A\u6DFB\u52A0${r}\u5F20\u56FE\u7247`)},g=u=>{var o;if(((o=s.content.data)==null?void 0:o.length)<=1)return F.msgError("\u6700\u5C11\u4FDD\u7559\u4E00\u5F20\u56FE\u7247");s.content.data.splice(u,1)};return(u,o)=>{const p=D,b=U,d=y,B=j,k=v,x=$,h=R,A=w,C=N;return c(),O("div",null,[e(C,{"label-width":"70px"},{default:t(()=>{var i;return[e(d,{label:"\u662F\u5426\u542F\u7528"},{default:t(()=>[e(b,{modelValue:a.content.enabled,"onUpdate:modelValue":o[0]||(o[0]=l=>a.content.enabled=l)},{default:t(()=>[e(p,{label:1},{default:t(()=>[_("\u5F00\u542F")]),_:1}),e(p,{label:0},{default:t(()=>[_("\u505C\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(d,{label:"\u56FE\u7247\u8BBE\u7F6E"},{default:t(()=>[m("div",L,[Q,e(H(G),{class:"draggable",modelValue:a.content.data,"onUpdate:modelValue":o[1]||(o[1]=l=>a.content.data=l),animation:"300"},{item:t(({element:l,index:f})=>[(c(),E(h,{key:f,onClose:n=>g(f),class:"max-w-[400px]"},{default:t(()=>[m("div",T,[e(B,{modelValue:l.image,"onUpdate:modelValue":n=>l.image=n,"upload-class":"bg-body","exclude-domain":""},null,8,["modelValue","onUpdate:modelValue"]),m("div",q,[e(d,{label:"\u56FE\u7247\u540D\u79F0"},{default:t(()=>[e(k,{modelValue:l.name,"onUpdate:modelValue":n=>l.name=n,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),e(d,{class:"mt-[18px]",label:"\u56FE\u7247\u94FE\u63A5"},{default:t(()=>[e(x,{modelValue:l.link,"onUpdate:modelValue":n=>l.link=n},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)])])]),_:2},1032,["onClose"]))]),_:1},8,["modelValue"])])]),_:1}),((i=a.content.data)==null?void 0:i.length)<r?(c(),E(d,{key:0},{default:t(()=>[e(A,{type:"primary",onClick:V},{default:t(()=>[_("\u6DFB\u52A0\u56FE\u7247")]),_:1})]),_:1})):K("",!0)]}),_:1})])}}});export{Y as _};

View File

@ -1 +1 @@
import{G as _,H as r,C as i,D as f}from"./element-plus.b64c0a90.js";import{_ as p}from"./add-nav.vue_vue_type_script_setup_true_lang.66ca83f2.js";import{d as F,o as E,c as b,U as e,L as t,R as d,a as s}from"./@vue.51d7f2d8.js";const V={class:"flex-1"},x=s("div",{class:"form-tips mb-4"},"\u6700\u591A\u53EF\u6DFB\u52A010\u4E2A\uFF0C\u5EFA\u8BAE\u56FE\u7247\u5C3A\u5BF8\uFF1A100px*100px",-1),y=F({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(o){return(B,a)=>{const u=_,m=r,n=i,c=f;return E(),b("div",null,[e(c,{"label-width":"70px"},{default:t(()=>[e(n,{label:"\u662F\u5426\u542F\u7528"},{default:t(()=>[e(m,{modelValue:o.content.enabled,"onUpdate:modelValue":a[0]||(a[0]=l=>o.content.enabled=l)},{default:t(()=>[e(u,{label:1},{default:t(()=>[d("\u5F00\u542F")]),_:1}),e(u,{label:0},{default:t(()=>[d("\u505C\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(n,{label:"\u83DC\u5355\u8BBE\u7F6E"},{default:t(()=>[s("div",V,[x,e(p,{modelValue:o.content.data,"onUpdate:modelValue":a[1]||(a[1]=l=>o.content.data=l)},null,8,["modelValue"])])]),_:1})]),_:1})])}}});export{y as _};
import{G as _,H as r,C as i,D as f}from"./element-plus.b64c0a90.js";import{_ as p}from"./add-nav.vue_vue_type_script_setup_true_lang.87dc1a74.js";import{d as F,o as E,c as b,U as e,L as t,R as d,a as s}from"./@vue.51d7f2d8.js";const V={class:"flex-1"},x=s("div",{class:"form-tips mb-4"},"\u6700\u591A\u53EF\u6DFB\u52A010\u4E2A\uFF0C\u5EFA\u8BAE\u56FE\u7247\u5C3A\u5BF8\uFF1A100px*100px",-1),y=F({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(o){return(B,a)=>{const u=_,m=r,n=i,c=f;return E(),b("div",null,[e(c,{"label-width":"70px"},{default:t(()=>[e(n,{label:"\u662F\u5426\u542F\u7528"},{default:t(()=>[e(m,{modelValue:o.content.enabled,"onUpdate:modelValue":a[0]||(a[0]=l=>o.content.enabled=l)},{default:t(()=>[e(u,{label:1},{default:t(()=>[d("\u5F00\u542F")]),_:1}),e(u,{label:0},{default:t(()=>[d("\u505C\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(n,{label:"\u83DC\u5355\u8BBE\u7F6E"},{default:t(()=>[s("div",V,[x,e(p,{modelValue:o.content.data,"onUpdate:modelValue":a[1]||(a[1]=l=>o.content.data=l)},null,8,["modelValue"])])]),_:1})]),_:1})])}}});export{y as _};

View File

@ -1 +1 @@
import{G as D,H as U,C as v,B as w,w as N,D as R}from"./element-plus.b64c0a90.js";import{_ as $}from"./index.c8fef2f6.js";import{_ as j}from"./picker.6693414f.js";import{_ as G}from"./picker.223a7f76.js";import{f as b}from"./index.53b22837.js";import{D as I}from"./vuedraggable.a2066cae.js";import{d as O,o as n,c as H,U as t,L as l,K as s,R as i,Q as r,a as p,u as K}from"./@vue.51d7f2d8.js";const L={class:"flex-1"},Q=p("div",{class:"form-tips"},"\u6700\u591A\u6DFB\u52A05\u5F20\uFF0C\u5EFA\u8BAE\u56FE\u7247\u5C3A\u5BF8\uFF1A750px*340px",-1),S={class:"bg-fill-light flex items-center w-full p-4 mt-4 cursor-move"},T={class:"ml-3 flex-1"},_=5,Y=O({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})},type:{type:String,default:"mobile"}},setup(o){const c=o,g=()=>{var d;((d=c.content.data)==null?void 0:d.length)<_?c.content.data.push({image:"",name:"",link:{}}):b.msgError(`\u6700\u591A\u6DFB\u52A0${_}\u5F20\u56FE\u7247`)},k=d=>{var u;if(((u=c.content.data)==null?void 0:u.length)<=1)return b.msgError("\u6700\u5C11\u4FDD\u7559\u4E00\u5F20\u56FE\u7247");c.content.data.splice(d,1)};return(d,u)=>{const f=D,y=U,m=v,B=G,F=w,h=j,x=$,A=N,C=R;return n(),H("div",null,[t(C,{"label-width":"70px"},{default:l(()=>{var V;return[o.type=="mobile"?(n(),s(m,{key:0,label:"\u662F\u5426\u542F\u7528"},{default:l(()=>[t(y,{modelValue:o.content.enabled,"onUpdate:modelValue":u[0]||(u[0]=e=>o.content.enabled=e)},{default:l(()=>[t(f,{label:1},{default:l(()=>[i("\u5F00\u542F")]),_:1}),t(f,{label:0},{default:l(()=>[i("\u505C\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1})):r("",!0),t(m,{label:"\u56FE\u7247\u8BBE\u7F6E"},{default:l(()=>[p("div",L,[Q,t(K(I),{class:"draggable",modelValue:o.content.data,"onUpdate:modelValue":u[1]||(u[1]=e=>o.content.data=e),animation:"300"},{item:l(({element:e,index:E})=>[(n(),s(x,{key:E,onClose:a=>k(E),class:"max-w-[400px]"},{default:l(()=>[p("div",S,[t(B,{modelValue:e.image,"onUpdate:modelValue":a=>e.image=a,"upload-class":"bg-body","exclude-domain":""},null,8,["modelValue","onUpdate:modelValue"]),p("div",T,[t(m,{label:"\u56FE\u7247\u540D\u79F0"},{default:l(()=>[t(F,{modelValue:e.name,"onUpdate:modelValue":a=>e.name=a,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),t(m,{class:"mt-[18px]",label:"\u56FE\u7247\u94FE\u63A5"},{default:l(()=>[o.type=="mobile"?(n(),s(h,{key:0,modelValue:e.link,"onUpdate:modelValue":a=>e.link=a},null,8,["modelValue","onUpdate:modelValue"])):r("",!0),o.type=="pc"?(n(),s(F,{key:1,placeholder:"\u8BF7\u8F93\u5165\u94FE\u63A5",modelValue:e.link.path,"onUpdate:modelValue":a=>e.link.path=a},null,8,["modelValue","onUpdate:modelValue"])):r("",!0)]),_:2},1024)])])]),_:2},1032,["onClose"]))]),_:1},8,["modelValue"])])]),_:1}),((V=o.content.data)==null?void 0:V.length)<_?(n(),s(m,{key:1},{default:l(()=>[t(A,{type:"primary",onClick:g},{default:l(()=>[i("\u6DFB\u52A0\u56FE\u7247")]),_:1})]),_:1})):r("",!0)]}),_:1})])}}});export{Y as _};
import{G as D,H as U,C as v,B as w,w as N,D as R}from"./element-plus.b64c0a90.js";import{_ as $}from"./index.f6ec68b3.js";import{_ as j}from"./picker.3151f430.js";import{_ as G}from"./picker.03975c4f.js";import{f as b}from"./index.d710a8b7.js";import{D as I}from"./vuedraggable.0cb40d3a.js";import{d as O,o as n,c as H,U as t,L as l,K as s,R as i,Q as r,a as p,u as K}from"./@vue.51d7f2d8.js";const L={class:"flex-1"},Q=p("div",{class:"form-tips"},"\u6700\u591A\u6DFB\u52A05\u5F20\uFF0C\u5EFA\u8BAE\u56FE\u7247\u5C3A\u5BF8\uFF1A750px*340px",-1),S={class:"bg-fill-light flex items-center w-full p-4 mt-4 cursor-move"},T={class:"ml-3 flex-1"},_=5,Y=O({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})},type:{type:String,default:"mobile"}},setup(o){const c=o,g=()=>{var d;((d=c.content.data)==null?void 0:d.length)<_?c.content.data.push({image:"",name:"",link:{}}):b.msgError(`\u6700\u591A\u6DFB\u52A0${_}\u5F20\u56FE\u7247`)},k=d=>{var u;if(((u=c.content.data)==null?void 0:u.length)<=1)return b.msgError("\u6700\u5C11\u4FDD\u7559\u4E00\u5F20\u56FE\u7247");c.content.data.splice(d,1)};return(d,u)=>{const f=D,y=U,m=v,B=G,F=w,h=j,x=$,A=N,C=R;return n(),H("div",null,[t(C,{"label-width":"70px"},{default:l(()=>{var V;return[o.type=="mobile"?(n(),s(m,{key:0,label:"\u662F\u5426\u542F\u7528"},{default:l(()=>[t(y,{modelValue:o.content.enabled,"onUpdate:modelValue":u[0]||(u[0]=e=>o.content.enabled=e)},{default:l(()=>[t(f,{label:1},{default:l(()=>[i("\u5F00\u542F")]),_:1}),t(f,{label:0},{default:l(()=>[i("\u505C\u7528")]),_:1})]),_:1},8,["modelValue"])]),_:1})):r("",!0),t(m,{label:"\u56FE\u7247\u8BBE\u7F6E"},{default:l(()=>[p("div",L,[Q,t(K(I),{class:"draggable",modelValue:o.content.data,"onUpdate:modelValue":u[1]||(u[1]=e=>o.content.data=e),animation:"300"},{item:l(({element:e,index:E})=>[(n(),s(x,{key:E,onClose:a=>k(E),class:"max-w-[400px]"},{default:l(()=>[p("div",S,[t(B,{modelValue:e.image,"onUpdate:modelValue":a=>e.image=a,"upload-class":"bg-body","exclude-domain":""},null,8,["modelValue","onUpdate:modelValue"]),p("div",T,[t(m,{label:"\u56FE\u7247\u540D\u79F0"},{default:l(()=>[t(F,{modelValue:e.name,"onUpdate:modelValue":a=>e.name=a,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),t(m,{class:"mt-[18px]",label:"\u56FE\u7247\u94FE\u63A5"},{default:l(()=>[o.type=="mobile"?(n(),s(h,{key:0,modelValue:e.link,"onUpdate:modelValue":a=>e.link=a},null,8,["modelValue","onUpdate:modelValue"])):r("",!0),o.type=="pc"?(n(),s(F,{key:1,placeholder:"\u8BF7\u8F93\u5165\u94FE\u63A5",modelValue:e.link.path,"onUpdate:modelValue":a=>e.link.path=a},null,8,["modelValue","onUpdate:modelValue"])):r("",!0)]),_:2},1024)])])]),_:2},1032,["onClose"]))]),_:1},8,["modelValue"])])]),_:1}),((V=o.content.data)==null?void 0:V.length)<_?(n(),s(m,{key:1},{default:l(()=>[t(A,{type:"primary",onClick:g},{default:l(()=>[i("\u6DFB\u52A0\u56FE\u7247")]),_:1})]),_:1})):r("",!0)]}),_:1})])}}});export{Y as _};

View File

@ -1 +1 @@
import{B as c,C as i,D as F}from"./element-plus.b64c0a90.js";import{_ as p}from"./picker.223a7f76.js";import{d as r,o as f,c as V,U as e,L as o,a as m}from"./@vue.51d7f2d8.js";const B=m("div",{class:"form-tips"},"\u5EFA\u8BAE\u56FE\u7247\u5C3A\u5BF8\uFF1A200*200\u50CF\u7D20\uFF1B\u56FE\u7247\u683C\u5F0F\uFF1Ajpg\u3001png\u3001jpeg",-1),A=r({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(t){return(E,l)=>{const a=c,n=i,d=p,s=F;return f(),V("div",null,[e(s,{"label-width":"90px"},{default:o(()=>[e(n,{label:"\u5BA2\u670D\u6807\u9898"},{default:o(()=>[e(a,{class:"w-[400px]",modelValue:t.content.title,"onUpdate:modelValue":l[0]||(l[0]=u=>t.content.title=u)},null,8,["modelValue"])]),_:1}),e(n,{label:"\u670D\u52A1\u65F6\u95F4"},{default:o(()=>[e(a,{class:"w-[400px]",modelValue:t.content.time,"onUpdate:modelValue":l[1]||(l[1]=u=>t.content.time=u)},null,8,["modelValue"])]),_:1}),e(n,{label:"\u8054\u7CFB\u7535\u8BDD"},{default:o(()=>[e(a,{class:"w-[400px]",modelValue:t.content.mobile,"onUpdate:modelValue":l[2]||(l[2]=u=>t.content.mobile=u)},null,8,["modelValue"])]),_:1}),e(n,{label:"\u5BA2\u670D\u4E8C\u7EF4\u7801"},{default:o(()=>[m("div",null,[e(d,{modelValue:t.content.qrcode,"onUpdate:modelValue":l[3]||(l[3]=u=>t.content.qrcode=u),"exclude-domain":""},null,8,["modelValue"]),B])]),_:1})]),_:1})])}}});export{A as _};
import{B as c,C as i,D as F}from"./element-plus.b64c0a90.js";import{_ as p}from"./picker.03975c4f.js";import{d as r,o as f,c as V,U as e,L as o,a as m}from"./@vue.51d7f2d8.js";const B=m("div",{class:"form-tips"},"\u5EFA\u8BAE\u56FE\u7247\u5C3A\u5BF8\uFF1A200*200\u50CF\u7D20\uFF1B\u56FE\u7247\u683C\u5F0F\uFF1Ajpg\u3001png\u3001jpeg",-1),A=r({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(t){return(E,l)=>{const a=c,n=i,d=p,s=F;return f(),V("div",null,[e(s,{"label-width":"90px"},{default:o(()=>[e(n,{label:"\u5BA2\u670D\u6807\u9898"},{default:o(()=>[e(a,{class:"w-[400px]",modelValue:t.content.title,"onUpdate:modelValue":l[0]||(l[0]=u=>t.content.title=u)},null,8,["modelValue"])]),_:1}),e(n,{label:"\u670D\u52A1\u65F6\u95F4"},{default:o(()=>[e(a,{class:"w-[400px]",modelValue:t.content.time,"onUpdate:modelValue":l[1]||(l[1]=u=>t.content.time=u)},null,8,["modelValue"])]),_:1}),e(n,{label:"\u8054\u7CFB\u7535\u8BDD"},{default:o(()=>[e(a,{class:"w-[400px]",modelValue:t.content.mobile,"onUpdate:modelValue":l[2]||(l[2]=u=>t.content.mobile=u)},null,8,["modelValue"])]),_:1}),e(n,{label:"\u5BA2\u670D\u4E8C\u7EF4\u7801"},{default:o(()=>[m("div",null,[e(d,{modelValue:t.content.qrcode,"onUpdate:modelValue":l[3]||(l[3]=u=>t.content.qrcode=u),"exclude-domain":""},null,8,["modelValue"]),B])]),_:1})]),_:1})])}}});export{A as _};

View File

@ -1 +1 @@
import"./audit.vue_vue_type_script_setup_true_name_withdrawEdit_lang.830bf5a1.js";import{_ as O}from"./audit.vue_vue_type_script_setup_true_name_withdrawEdit_lang.830bf5a1.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./withdraw.c1365086.js";export{O as default};
import"./audit.vue_vue_type_script_setup_true_name_withdrawEdit_lang.dd4da680.js";import{_ as O}from"./audit.vue_vue_type_script_setup_true_name_withdrawEdit_lang.dd4da680.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./withdraw.9a58fc0c.js";export{O as default};

View File

@ -1 +0,0 @@
import{J as L,k as E,K as H,B as M,C as O,G as W,H as $,c as z,D as Q}from"./element-plus.b64c0a90.js";import{P as X}from"./index.280ce7d1.js";import{b as Y,w as Z}from"./withdraw.c1365086.js";import"./lodash.675f209e.js";import{a as ee}from"./index.53b22837.js";import{d as h,C as ue,s as B,r as D,e as oe,$ as v,a4 as ae,o as c,c as te,U as a,L as l,u as t,R as b,K as g,a as y}from"./@vue.51d7f2d8.js";const le={class:"edit-popup"},se=y("div",{class:"el-upload__text"},"\u6587\u4EF6\u62D6\u5165\u6216\u70B9\u51FB\u4E0A\u4F20",-1),re=y("div",{class:"el-upload__tip"},"\u8BF7\u4E0A\u4F20JPG/JPEG/PNG/GIF/PDF\u6587\u4EF6",-1),ne=h({name:"withdrawEdit"}),Fe=h({...ne,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(de,{expose:w,emit:m}){const C=ee(),V=ue("base_url"),_=B(),i=B(),p=D("add"),A=oe(()=>p.value=="edit"?"\u5BA1\u6838\u63D0\u73B0\u7533\u8BF7":"\u65B0\u589E\u63D0\u73B0\u7533\u8BF7"),o=v({id:"",order_sn:"",user_id:"",admin_id:"",amount:"",status:"",transfer_voucher:"",notes:""}),k=v({status:[{required:!0,validator:(u,e,s)=>{e==1||e==2?s():s(new Error("\u8BF7\u9009\u62E9\u5BA1\u6838\u662F\u5426\u901A\u8FC7!"))},trigger:["blur"]}],transfer_voucher:[{required:!0,message:"\u8BF7\u5148\u4E0A\u4F20\u51ED\u8BC1",trigger:["blur"]}],notes:[{required:!0,message:"\u8BF7\u586B\u5199\u62D2\u7EDD\u539F\u56E0",trigger:["blur"]}]}),f=async u=>{for(const e in o)u[e]!=null&&u[e]!=null&&(o[e]=u[e])},x=async u=>{const e=await Y({id:u.id});f(e)},G=["application/pdf","image/jpeg","image/gif","image/png"],P=u=>{if(!G.includes(u.type))return E.error("\u8BF7\u4E0A\u4F20JPG/JPEG/PNG/GIF/PDF\u6587\u4EF6"),!1},n=D(null),R=u=>{n.value.clearFiles();const e=u[0];e.uid=H(),n.value.handleStart(e),n.value.submit()},U=u=>{if(u.code==0&&u.show==1)return o.transfer_voucher="",n.value.clearFiles(),E.error(u.msg||"\u4E0A\u4F20\u5931\u8D25");o.transfer_voucher=u.data.uri},I=async()=>{var e,s;await((e=_.value)==null?void 0:e.validate());const u={...o};p.value==await Z(u),(s=i.value)==null||s.close(),m("success")},J=(u="add")=>{var e;p.value=u,(e=i.value)==null||e.open()},N=()=>{m("close")};return w({open:J,setFormData:f,getDetail:x}),(u,e)=>{const s=M,d=O,F=W,S=$,T=ae("upload-filled"),j=z,q=L,K=Q;return c(),te("div",le,[a(X,{ref_key:"popupRef",ref:i,title:t(A),async:!0,width:"550px",onConfirm:I,onClose:N},{default:l(()=>[a(K,{ref_key:"formRef",ref:_,model:t(o),"label-width":"90px",rules:t(k)},{default:l(()=>[a(d,{label:"\u8BA2\u5355\u7F16\u53F7",prop:"order_sn"},{default:l(()=>[a(s,{readonly:"",modelValue:t(o).order_sn,"onUpdate:modelValue":e[0]||(e[0]=r=>t(o).order_sn=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),a(d,{label:"\u63D0\u73B0\u91D1\u989D",prop:"amount"},{default:l(()=>[a(s,{readonly:"",modelValue:t(o).amount,"onUpdate:modelValue":e[1]||(e[1]=r=>t(o).amount=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u63D0\u73B0\u91D1\u989D"},null,8,["modelValue"])]),_:1}),a(d,{label:"\u5BA1\u6838",prop:"status"},{default:l(()=>[a(S,{modelValue:t(o).status,"onUpdate:modelValue":e[2]||(e[2]=r=>t(o).status=r)},{default:l(()=>[a(F,{label:1},{default:l(()=>[b("\u901A\u8FC7")]),_:1}),a(F,{label:2},{default:l(()=>[b("\u62D2\u7EDD")]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(o).status==2?(c(),g(d,{key:0,label:"\u5907\u6CE8",prop:"notes"},{default:l(()=>[a(s,{modelValue:t(o).notes,"onUpdate:modelValue":e[3]||(e[3]=r=>t(o).notes=r),clearable:"",type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})):(c(),g(d,{key:1,label:"\u8F6C\u8D26\u51ED\u8BC1",prop:"transfer_voucher"},{default:l(()=>[a(q,{class:"upload-demo",style:{width:"100%"},drag:"",headers:{Token:t(C).token},action:t(V)+"/upload/file",limit:1,"on-success":U,"on-exceed":R,"before-upload":P,ref_key:"upload",ref:n},{tip:l(()=>[re]),default:l(()=>[a(j,{class:"el-icon--upload"},{default:l(()=>[a(T)]),_:1}),se]),_:1},8,["headers","action"])]),_:1}))]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{Fe as _};

View File

@ -0,0 +1 @@
import{J as W,k as D,K as $,B as z,C as Q,w as X,G as Y,H as Z,c as ee,D as ue}from"./element-plus.b64c0a90.js";import{P as oe}from"./index.a975a0b7.js";import{b as ae,w as te}from"./withdraw.9a58fc0c.js";import"./lodash.08438971.js";import{a as le,k as se}from"./index.d710a8b7.js";import{d as k,C as re,s as b,r as h,e as ne,$ as v,a4 as g,o as i,c as de,U as l,L as t,u as a,R as p,K as _,a as w}from"./@vue.51d7f2d8.js";const ie={class:"edit-popup"},ce=w("div",{class:"el-upload__text"},"\u6587\u4EF6\u62D6\u5165\u6216\u70B9\u51FB\u4E0A\u4F20",-1),pe=w("div",{class:"el-upload__tip"},"\u8BF7\u4E0A\u4F20JPG/JPEG/PNG/GIF/PDF\u6587\u4EF6",-1),_e=k({name:"withdrawEdit"}),be=k({..._e,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(me,{expose:C,emit:f}){const V=le(),A=re("base_url"),F=b(),m=b(),c=h("audit"),x=ne(()=>c.value=="audit"?"\u5BA1\u6838\u63D0\u73B0\u7533\u8BF7":"\u63D0\u73B0\u7533\u8BF7\u8BE6\u60C5"),o=v({id:"",order_sn:"",user_id:"",admin_id:"",amount:"",status:"",transfer_voucher:"",deny_desc:"",company_id:"",company_name:"",s_date:"",e_date:""}),P=v({status:[{required:!0,validator:(u,e,s)=>{e==1||e==2?s():s(new Error("\u8BF7\u9009\u62E9\u5BA1\u6838\u662F\u5426\u901A\u8FC7!"))},trigger:["blur"]}],transfer_voucher:[{required:!0,message:"\u8BF7\u5148\u4E0A\u4F20\u51ED\u8BC1",trigger:["blur"]}],deny_desc:[{required:!0,message:"\u8BF7\u586B\u5199\u62D2\u7EDD\u539F\u56E0",trigger:["blur"]}]}),E=async u=>{for(const e in o)u[e]!=null&&u[e]!=null&&(o[e]=u[e])},G=async u=>{const e=await ae({id:u.id});E(e)},R=["application/pdf","image/jpeg","image/gif","image/png"],U=u=>{if(!R.includes(u.type))return D.error("\u8BF7\u4E0A\u4F20JPG/JPEG/PNG/GIF/PDF\u6587\u4EF6"),!1},d=h(null),I=u=>{d.value.clearFiles();const e=u[0];e.uid=$(),d.value.handleStart(e),d.value.submit()},J=u=>{if(u.code==0&&u.show==1)return o.transfer_voucher="",d.value.clearFiles(),D.error(u.msg||"\u4E0A\u4F20\u5931\u8D25");o.transfer_voucher=u.data.uri},N=()=>{window.open(o.transfer_voucher)},T=async()=>{var e,s;await((e=F.value)==null?void 0:e.validate());const u={...o};c.value==await te(u),(s=m.value)==null||s.close(),f("success")},q=(u="add")=>{var e;c.value=u,(e=m.value)==null||e.open()},S=()=>{f("close")};return C({open:q,setFormData:E,getDetail:G}),(u,e)=>{const s=z,n=Q,j=g("router-link"),B=X,y=Y,K=Z,L=g("upload-filled"),H=ee,M=W,O=ue;return i(),de("div",ie,[l(oe,{ref_key:"popupRef",ref:m,title:a(x),async:!0,width:"550px",onConfirm:T,onClose:S},{default:t(()=>[l(O,{ref_key:"formRef",ref:F,model:a(o),"label-width":"90px",rules:a(P)},{default:t(()=>[l(n,{label:"\u8BA2\u5355\u7F16\u53F7",prop:"order_sn"},{default:t(()=>[l(s,{readonly:"",modelValue:a(o).order_sn,"onUpdate:modelValue":e[0]||(e[0]=r=>a(o).order_sn=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BA2\u5355\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),l(n,{label:"\u63D0\u73B0\u91D1\u989D",prop:"amount"},{default:t(()=>[l(s,{readonly:"",modelValue:a(o).amount,"onUpdate:modelValue":e[1]||(e[1]=r=>a(o).amount=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u63D0\u73B0\u91D1\u989D"},null,8,["modelValue"])]),_:1}),l(n,{label:"",prop:"amount"},{default:t(()=>[l(B,{type:"primary",link:""},{default:t(()=>[l(j,{to:{path:a(se)("finance.account_log/lists"),query:{company_id:a(o).company_id,s_date:a(o).s_date,e_date:a(o).e_date}}},{default:t(()=>[p("\u67E5\u770B\u660E\u7EC6")]),_:1},8,["to"])]),_:1})]),_:1}),l(n,{label:"\u5BA1\u6838",prop:"status"},{default:t(()=>[l(K,{modelValue:a(o).status,"onUpdate:modelValue":e[2]||(e[2]=r=>a(o).status=r)},{default:t(()=>[l(y,{label:1},{default:t(()=>[p("\u901A\u8FC7")]),_:1}),l(y,{label:2},{default:t(()=>[p("\u62D2\u7EDD")]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(o).status==2?(i(),_(n,{key:0,label:"\u5907\u6CE8",prop:"deny_desc"},{default:t(()=>[l(s,{modelValue:a(o).deny_desc,"onUpdate:modelValue":e[3]||(e[3]=r=>a(o).deny_desc=r),clearable:"",type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})):(i(),_(n,{key:1,label:"\u8F6C\u8D26\u51ED\u8BC1",prop:"transfer_voucher"},{default:t(()=>[a(c)=="audit"?(i(),_(M,{key:0,class:"upload-demo",style:{width:"100%"},drag:"",headers:{Token:a(V).token},action:a(A)+"/upload/file",limit:1,"on-success":J,"on-exceed":I,"before-upload":U,ref_key:"upload",ref:d},{tip:t(()=>[pe]),default:t(()=>[l(H,{class:"el-icon--upload"},{default:t(()=>[l(L)]),_:1}),ce]),_:1},8,["headers","action"])):(i(),_(B,{key:1,type:"primary",link:"",onClick:N},{default:t(()=>[p(" \u67E5\u770B\u51ED\u8BC1 ")]),_:1}))]),_:1}))]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{be as _};

View File

@ -1 +1 @@
import"./auth.vue_vue_type_script_setup_true_lang.71d6058a.js";import{_ as P}from"./auth.vue_vue_type_script_setup_true_lang.71d6058a.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./user_menu.958e9cb8.js";import"./user_role.2eefb209.js";export{P as default};
import"./auth.vue_vue_type_script_setup_true_lang.e92b85a6.js";import{_ as P}from"./auth.vue_vue_type_script_setup_true_lang.e92b85a6.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./user_menu.772ed237.js";import"./user_role.797fb0c7.js";export{P as default};

View File

@ -1 +1 @@
import"./auth.vue_vue_type_script_setup_true_lang.de866f5c.js";import{_ as P}from"./auth.vue_vue_type_script_setup_true_lang.de866f5c.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./role.e958c7a6.js";import"./index.53b22837.js";import"./lodash.675f209e.js";import"./axios.54f807ba.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.0a5c0f85.js";import"./color.e5eb3bba.js";import"./clone.546d9b81.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.aee266dc.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./index.280ce7d1.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./menu.4e6af869.js";export{P as default};
import"./auth.vue_vue_type_script_setup_true_lang.f9aa0835.js";import{_ as P}from"./auth.vue_vue_type_script_setup_true_lang.f9aa0835.js";import"./element-plus.b64c0a90.js";import"./@vue.51d7f2d8.js";import"./@vueuse.ec90c285.js";import"./@element-plus.a074d1f6.js";import"./lodash-es.29c53eac.js";import"./dayjs.e873ead7.js";import"./@amap.8a62addd.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./role.7da182a9.js";import"./index.d710a8b7.js";import"./lodash.08438971.js";import"./axios.105476b3.js";import"./vue-router.9f65afb1.js";import"./pinia.56356cb7.js";import"./vue-demi.b3a9cad9.js";import"./css-color-function.7ac6f233.js";import"./color.44a05936.js";import"./clone.0afcbf90.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.86067895.js";import"./ms.a9ae1d6d.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.ac57a99a.js";import"./zrender.d54ce080.js";import"./tslib.60310f1a.js";import"./highlight.js.dba6fa1b.js";import"./@highlightjs.40d5feba.js";import"./index.a975a0b7.js";import"./index.vue_vue_type_style_index_0_scoped_95d1884e_lang.0fc4c9f8.js";import"./menu.4c4b11af.js";export{P as default};

View File

@ -1 +1 @@
import{F as T,V as P,C as q,E as H,D as I,Q as O}from"./element-plus.b64c0a90.js";import"./index.53b22837.js";import{P as Q}from"./index.280ce7d1.js";import"./lodash.675f209e.js";import{e as $}from"./user_menu.958e9cb8.js";import{a as j}from"./user_role.2eefb209.js";import{d as z,s as f,r as c,$ as G,o as v,c as J,U as a,L as i,M as W,K as X,u as r,a as k,k as Y,n as y}from"./@vue.51d7f2d8.js";const Z={class:"edit-popup"},ce=z({__name:"auth",emits:["success","close"],setup(ee,{expose:C,emit:_}){const o=f(),h=f(),d=f(),x=c(!1),u=c(!0),m=c(!1),b=c([]),p=c([]),l=G({id:"",name:"",desc:"",sort:0,menu_arr:[]}),g={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:["blur"]}]},E=()=>{m.value=!0,$().then(s=>{for(let e of s.lists)if(e.notes?e.nameAndNotes=e.name+" ("+e.notes+")":e.nameAndNotes=e.name,e.children)for(let t of e.children)t.notes?t.nameAndNotes=t.name+" ("+t.notes+")":t.nameAndNotes=t.name;p.value=s.lists,y(()=>{D()}),m.value=!1})},A=()=>{var t,n;const s=(t=o.value)==null?void 0:t.getCheckedKeys(),e=(n=o.value)==null?void 0:n.getHalfCheckedKeys();return s==null||s.unshift.apply(s,e),s},D=()=>{l.menu_arr.forEach(s=>{y(()=>{var e;(e=o.value)==null||e.setChecked(s,!0,!1)})})},R=s=>{const e=p.value;for(let t=0;t<e.length;t++)o.value.store.nodesMap[e[t].id].expanded=s},w=s=>{var e,t;s?(e=o.value)==null||e.setCheckedKeys(b.value.map(n=>n.id)):(t=o.value)==null||t.setCheckedKeys([])},F=async()=>{var s,e;await((s=h.value)==null?void 0:s.validate()),l.menu_arr=A(),await j(l),(e=d.value)==null||e.close(),_("success")},K=()=>{_("close")},N=()=>{var s;(s=d.value)==null||s.open()},B=async s=>{for(const e in l)s[e]!=null&&s[e]!=null&&(l[e]=s[e])};return E(),C({open:N,setFormData:B}),(s,e)=>{const t=T,n=P,V=q,L=H,S=I,U=O;return v(),J("div",Z,[a(Q,{ref_key:"popupRef",ref:d,title:"\u5206\u914D\u6743\u9650",async:!0,width:"550px",onConfirm:F,onClose:K},{default:i(()=>[W((v(),X(S,{class:"ls-form",ref_key:"formRef",ref:h,rules:g,model:r(l),"label-width":"60px"},{default:i(()=>[a(L,{class:"h-[400px] sm:h-[600px]"},{default:i(()=>[a(V,{label:"\u6743\u9650",prop:"menu_arr"},{default:i(()=>[k("div",null,[a(t,{label:"\u5C55\u5F00/\u6298\u53E0",onChange:R}),a(t,{label:"\u5168\u9009/\u4E0D\u5168\u9009",onChange:w}),a(t,{modelValue:r(u),"onUpdate:modelValue":e[0]||(e[0]=M=>Y(u)?u.value=M:null),label:"\u7236\u5B50\u8054\u52A8"},null,8,["modelValue"]),k("div",null,[a(n,{ref_key:"treeRef",ref:o,data:r(p),props:{label:"nameAndNotes",children:"children"},"check-strictly":!r(u),"node-key":"id","default-expand-all":r(x),"show-checkbox":""},null,8,["data","check-strictly","default-expand-all"])])])]),_:1})]),_:1})]),_:1},8,["model"])),[[U,r(m)]])]),_:1},512)])}}});export{ce as _};
import{F as T,V as P,C as q,E as H,D as I,Q as O}from"./element-plus.b64c0a90.js";import"./index.d710a8b7.js";import{P as Q}from"./index.a975a0b7.js";import"./lodash.08438971.js";import{e as $}from"./user_menu.772ed237.js";import{a as j}from"./user_role.797fb0c7.js";import{d as z,s as f,r as c,$ as G,o as v,c as J,U as a,L as i,M as W,K as X,u as r,a as k,k as Y,n as y}from"./@vue.51d7f2d8.js";const Z={class:"edit-popup"},ce=z({__name:"auth",emits:["success","close"],setup(ee,{expose:C,emit:_}){const o=f(),h=f(),d=f(),x=c(!1),u=c(!0),m=c(!1),b=c([]),p=c([]),l=G({id:"",name:"",desc:"",sort:0,menu_arr:[]}),g={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:["blur"]}]},E=()=>{m.value=!0,$().then(s=>{for(let e of s.lists)if(e.notes?e.nameAndNotes=e.name+" ("+e.notes+")":e.nameAndNotes=e.name,e.children)for(let t of e.children)t.notes?t.nameAndNotes=t.name+" ("+t.notes+")":t.nameAndNotes=t.name;p.value=s.lists,y(()=>{D()}),m.value=!1})},A=()=>{var t,n;const s=(t=o.value)==null?void 0:t.getCheckedKeys(),e=(n=o.value)==null?void 0:n.getHalfCheckedKeys();return s==null||s.unshift.apply(s,e),s},D=()=>{l.menu_arr.forEach(s=>{y(()=>{var e;(e=o.value)==null||e.setChecked(s,!0,!1)})})},R=s=>{const e=p.value;for(let t=0;t<e.length;t++)o.value.store.nodesMap[e[t].id].expanded=s},w=s=>{var e,t;s?(e=o.value)==null||e.setCheckedKeys(b.value.map(n=>n.id)):(t=o.value)==null||t.setCheckedKeys([])},F=async()=>{var s,e;await((s=h.value)==null?void 0:s.validate()),l.menu_arr=A(),await j(l),(e=d.value)==null||e.close(),_("success")},K=()=>{_("close")},N=()=>{var s;(s=d.value)==null||s.open()},B=async s=>{for(const e in l)s[e]!=null&&s[e]!=null&&(l[e]=s[e])};return E(),C({open:N,setFormData:B}),(s,e)=>{const t=T,n=P,V=q,L=H,S=I,U=O;return v(),J("div",Z,[a(Q,{ref_key:"popupRef",ref:d,title:"\u5206\u914D\u6743\u9650",async:!0,width:"550px",onConfirm:F,onClose:K},{default:i(()=>[W((v(),X(S,{class:"ls-form",ref_key:"formRef",ref:h,rules:g,model:r(l),"label-width":"60px"},{default:i(()=>[a(L,{class:"h-[400px] sm:h-[600px]"},{default:i(()=>[a(V,{label:"\u6743\u9650",prop:"menu_arr"},{default:i(()=>[k("div",null,[a(t,{label:"\u5C55\u5F00/\u6298\u53E0",onChange:R}),a(t,{label:"\u5168\u9009/\u4E0D\u5168\u9009",onChange:w}),a(t,{modelValue:r(u),"onUpdate:modelValue":e[0]||(e[0]=M=>Y(u)?u.value=M:null),label:"\u7236\u5B50\u8054\u52A8"},null,8,["modelValue"]),k("div",null,[a(n,{ref_key:"treeRef",ref:o,data:r(p),props:{label:"nameAndNotes",children:"children"},"check-strictly":!r(u),"node-key":"id","default-expand-all":r(x),"show-checkbox":""},null,8,["data","check-strictly","default-expand-all"])])])]),_:1})]),_:1})]),_:1},8,["model"])),[[U,r(m)]])]),_:1},512)])}}});export{ce as _};

View File

@ -1 +1 @@
import{F as P,V as U,C as q,E as H,D as I,Q as O}from"./element-plus.b64c0a90.js";import{a as Q}from"./role.e958c7a6.js";import{P as $}from"./index.280ce7d1.js";import{t as j}from"./index.53b22837.js";import{m as z}from"./menu.4e6af869.js";import{d as G,s as f,r as u,$ as J,o as k,c as W,U as s,L as d,M as X,K as Y,u as c,a as y,k as Z,n as C}from"./@vue.51d7f2d8.js";const ee={class:"edit-popup"},ue=G({__name:"auth",emits:["success","close"],setup(le,{expose:x,emit:_}){const o=f(),h=f(),i=f(),b=u(!1),r=u(!0),m=u(!1),v=u([]),p=u([]),a=J({id:"",name:"",desc:"",sort:0,menu_id:[]}),g={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:["blur"]}]},E=()=>{m.value=!0,z().then(e=>{p.value=e,v.value=j(e),C(()=>{w()}),m.value=!1})},D=()=>{var t,n;const e=(t=o.value)==null?void 0:t.getCheckedKeys(),l=(n=o.value)==null?void 0:n.getHalfCheckedKeys();return e==null||e.unshift.apply(e,l),e},w=()=>{a.menu_id.forEach(e=>{C(()=>{var l;(l=o.value)==null||l.setChecked(e,!0,!1)})})},F=e=>{const l=p.value;for(let t=0;t<l.length;t++)o.value.store.nodesMap[l[t].id].expanded=e},R=e=>{var l,t;e?(l=o.value)==null||l.setCheckedKeys(v.value.map(n=>n.id)):(t=o.value)==null||t.setCheckedKeys([])},A=async()=>{var e,l;await((e=h.value)==null?void 0:e.validate()),a.menu_id=D(),await Q(a),(l=i.value)==null||l.close(),_("success")},K=()=>{_("close")},B=()=>{var e;(e=i.value)==null||e.open()},V=async e=>{for(const l in a)e[l]!=null&&e[l]!=null&&(a[l]=e[l])};return E(),x({open:B,setFormData:V}),(e,l)=>{const t=P,n=U,S=q,T=H,L=I,M=O;return k(),W("div",ee,[s($,{ref_key:"popupRef",ref:i,title:"\u5206\u914D\u6743\u9650",async:!0,width:"550px",onConfirm:A,onClose:K},{default:d(()=>[X((k(),Y(L,{class:"ls-form",ref_key:"formRef",ref:h,rules:g,model:c(a),"label-width":"60px"},{default:d(()=>[s(T,{class:"h-[400px] sm:h-[600px]"},{default:d(()=>[s(S,{label:"\u6743\u9650",prop:"menu_id"},{default:d(()=>[y("div",null,[s(t,{label:"\u5C55\u5F00/\u6298\u53E0",onChange:F}),s(t,{label:"\u5168\u9009/\u4E0D\u5168\u9009",onChange:R}),s(t,{modelValue:c(r),"onUpdate:modelValue":l[0]||(l[0]=N=>Z(r)?r.value=N:null),label:"\u7236\u5B50\u8054\u52A8"},null,8,["modelValue"]),y("div",null,[s(n,{ref_key:"treeRef",ref:o,data:c(p),props:{label:"name",children:"children"},"check-strictly":!c(r),"node-key":"id","default-expand-all":c(b),"show-checkbox":""},null,8,["data","check-strictly","default-expand-all"])])])]),_:1})]),_:1})]),_:1},8,["model"])),[[M,c(m)]])]),_:1},512)])}}});export{ue as _};
import{F as P,V as U,C as q,E as H,D as I,Q as O}from"./element-plus.b64c0a90.js";import{a as Q}from"./role.7da182a9.js";import{P as $}from"./index.a975a0b7.js";import{t as j}from"./index.d710a8b7.js";import{m as z}from"./menu.4c4b11af.js";import{d as G,s as f,r as u,$ as J,o as k,c as W,U as s,L as d,M as X,K as Y,u as c,a as y,k as Z,n as C}from"./@vue.51d7f2d8.js";const ee={class:"edit-popup"},ue=G({__name:"auth",emits:["success","close"],setup(le,{expose:x,emit:_}){const o=f(),h=f(),i=f(),b=u(!1),r=u(!0),m=u(!1),v=u([]),p=u([]),a=J({id:"",name:"",desc:"",sort:0,menu_id:[]}),g={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:["blur"]}]},E=()=>{m.value=!0,z().then(e=>{p.value=e,v.value=j(e),C(()=>{w()}),m.value=!1})},D=()=>{var t,n;const e=(t=o.value)==null?void 0:t.getCheckedKeys(),l=(n=o.value)==null?void 0:n.getHalfCheckedKeys();return e==null||e.unshift.apply(e,l),e},w=()=>{a.menu_id.forEach(e=>{C(()=>{var l;(l=o.value)==null||l.setChecked(e,!0,!1)})})},F=e=>{const l=p.value;for(let t=0;t<l.length;t++)o.value.store.nodesMap[l[t].id].expanded=e},R=e=>{var l,t;e?(l=o.value)==null||l.setCheckedKeys(v.value.map(n=>n.id)):(t=o.value)==null||t.setCheckedKeys([])},A=async()=>{var e,l;await((e=h.value)==null?void 0:e.validate()),a.menu_id=D(),await Q(a),(l=i.value)==null||l.close(),_("success")},K=()=>{_("close")},B=()=>{var e;(e=i.value)==null||e.open()},V=async e=>{for(const l in a)e[l]!=null&&e[l]!=null&&(a[l]=e[l])};return E(),x({open:B,setFormData:V}),(e,l)=>{const t=P,n=U,S=q,T=H,L=I,M=O;return k(),W("div",ee,[s($,{ref_key:"popupRef",ref:i,title:"\u5206\u914D\u6743\u9650",async:!0,width:"550px",onConfirm:A,onClose:K},{default:d(()=>[X((k(),Y(L,{class:"ls-form",ref_key:"formRef",ref:h,rules:g,model:c(a),"label-width":"60px"},{default:d(()=>[s(T,{class:"h-[400px] sm:h-[600px]"},{default:d(()=>[s(S,{label:"\u6743\u9650",prop:"menu_id"},{default:d(()=>[y("div",null,[s(t,{label:"\u5C55\u5F00/\u6298\u53E0",onChange:F}),s(t,{label:"\u5168\u9009/\u4E0D\u5168\u9009",onChange:R}),s(t,{modelValue:c(r),"onUpdate:modelValue":l[0]||(l[0]=N=>Z(r)?r.value=N:null),label:"\u7236\u5B50\u8054\u52A8"},null,8,["modelValue"]),y("div",null,[s(n,{ref_key:"treeRef",ref:o,data:c(p),props:{label:"name",children:"children"},"check-strictly":!c(r),"node-key":"id","default-expand-all":c(b),"show-checkbox":""},null,8,["data","check-strictly","default-expand-all"])])])]),_:1})]),_:1})]),_:1},8,["model"])),[[M,c(m)]])]),_:1},512)])}}});export{ue as _};

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More