Vue & Python将pywebview执行的操作改为同步 2025-02-26
constbatchOperate=async(type)=>{for(letrowofmultipleSelection.value){varpath=awaitpywebview.api.uploadOrder(row['create_date']+"/"+row['file']);}}
Element 根据JSON数据自动合并单元格 2025-02-26
使用一级JSON,而不是多级嵌套JSON-数据需要排序letstr=""conststroageValue:Record<string,string|number>=reactive({})constgoodsSpanMethod=({row,column,rowIndex,columnIndex}:SpanMethodProps)=>{if(columnIndex==0||columnIndex==1){letspanCount=1//从当前行往下找for(leti=rowIndex+1;i<productData.value.length;i++
Mysql将查询记录内容拼接为JSON 2025-02-26
SELECTo.field1,o.field,c.fieldfield,o.field,DATE(o.field)field,`field`,`field`,`field`,IF(cp.fieldISNULL,'[]',JSON_ARRAYAGG(JSON_OBJECT('product_id',cp.field,'product_name',cp.field)))ASfieldFROMtableoleftJOINtablecONo.field=c.fieldleftJOINtablecpONo.field=cp.fieldWHERE(field
后端技术
PHPObject转Array 2025-02-26
publicfunctionobject_to_array($obj){$_arr=is_object($obj)?get_object_vars($obj):$obj;$arr=null;foreach($_arras$key=>$val){$val=(is_array($val))||is_object($val)?$this->object_to_array($val):$val;$arr[$key]=$val;}return$arr;}$task_data=$this->object_to_array(json_decode(htmlspecialchars_deco
Mysql
将一条记录的多个字段合并为一个 2025-02-26
SELECTid,name,role1ASroleFROMemployeesUNIONALLSELECTid,name,role2ASroleFROMemployeesUNIONALLSELECTid,name,role3ASroleFROMemployeesWHERErole2ISNOTNULLUNIONALLSELECTid,name,role3ASroleFROMemployeesWHERErole3ISNOTNULL;
后端技术
PHP万能读取请求参数 2025-02-26
前端使用POST方式传递数据(跨域)axios.post('http://xxx.xxx.xxx.xxx:8888/xxx/xxx/xxx',{xxxForm}).then(res=>{})ThinkPHP后端使用I(“post.”)接收不到数据,get,request,put都试了一遍原来使用的是put使用put读取出来数据…,有点小乱,json_decode也用不了。array(1){["{"ruleForm":{"rules":"]=>array(1){["{"field"
Jquery滚轮事件 2023-09-19
下载插件GitHub:https://github.com/jquery/jquery-mousewheel使用$('body').on('mousewheel',function(event){//防抖代码if(time!==null){clearTimeout(time);}time=setTimeout(()=>{if(event.deltaY==1){//yourcode}else{//yourcode}},1000)});
Python使用pywebview 2023-09-19
使用方法python代码:classApi:defsayhello(self,name)->str:print("hello"+name)return"已get"defexpose(window):window.toggle_fullscreen()window.evaluate_js('alert("helloworld")')api=Api()win=webview.create_window(title='windows',url='http://your_web',js_a
Python多线程 2023-09-19
开启方法importthreadingdeffunction_name(arg1,arg2):#yourcodethread=threading.Thread(target=function_name,args=(arg1,arg2))#function-线程函数。#args-传递给线程函数的参数,必须是个tuple类型。#kwargs-可选参数。
Python使用ffmpeg编辑多媒体 2023-09-18
1.下载ffmpeg百度云下载(版本旧)链接:https://pan.baidu.com/s/11uWXloIqpSv6fo_osulYvA?pwd=wvm2提取码:wvm2git下载:https://github.com/GyanD/codexffmpeg/releases?page=1官网下载:https://www.ffmpeg.org/2.安装解压下载的内容,赋值解压后的ffmpeg\bin目录地址,在系统环境变量中path新增一条并粘贴3.python使用ffmpeg将ffmpeg\bin目录下的ffmpeg.exe复制到,python项目目录下方法一:fromffmpyimport
热门文章
专栏