code stringlengths 1 1.05M | repo_name stringlengths 6 83 | path stringlengths 3 242 | language stringclasses 222
values | license stringclasses 20
values | size int64 1 1.05M |
|---|---|---|---|---|---|
pub fn new_count_distinct(input_str: &str) -> usize {
todo!()
}
| 2301_77724773/rust-contest | exercises/solution1/src/count_distinct.rs | Rust | unknown | 68 |
mod count_distinct;
fn main() {
let input_str: &str = "a,b,cd,b,e,e,d,a";
let count = count_distinct::new_count_distinct(input_str);
println!("count: {count}");
}
| 2301_77724773/rust-contest | exercises/solution1/src/main.rs | Rust | unknown | 176 |
// src/tests.rs
mod count_distinct;
#[cfg(test)]
mod tests {
use super::count_distinct::new_count_distinct;
// 定义测试用例和预期结果
const TEST_CASES: &[(&str, usize)] = &[
("a,b,c,a,e,cd", 5),
("a,b,a,a,e,cd", 4),
("j,a,c,d,e,z", 6),
("a,b,c,好,好,爱", 5),
("a,b,c,0,e,cd", 6),
... | 2301_77724773/rust-contest | exercises/solution1/src/tests.rs | Rust | unknown | 783 |
pub fn convert_base(num_str: &str, to_base: u32) -> String {
// TODO: 这里写逻辑
todo!()
}
| 2301_77724773/rust-contest | exercises/solution2/src/converter.rs | Rust | unknown | 104 |
mod converter;
fn main() {
let num_str = "9(10)";
let base_to: u32 = 8;
let result = converter::convert_base(num_str, base_to);
println!("{} -> {}", num_str, result);
}
| 2301_77724773/rust-contest | exercises/solution2/src/main.rs | Rust | unknown | 186 |
// src/tests.rs
mod converter;
#[cfg(test)]
mod tests {
use super::converter::convert_base;
// 定义测试用例和预期结果
const TEST_CASES: &[(&str, u32, &str)] = &[
("10(2)", 10, "2"),
("9(10)", 8, "11"),
("1111(2)", 15, "10"),
("10(7)", 9, "7"),
("12(10)", 16, "c"),
];
... | 2301_77724773/rust-contest | exercises/solution2/src/tests.rs | Rust | unknown | 784 |
pub fn new_birthday_probability(n: u32) -> f64 {
// TODO: 这里写逻辑
todo!()
}
| 2301_77724773/rust-contest | exercises/solution3/src/calc_logic.rs | Rust | unknown | 92 |
mod calc_logic;
fn main() {
// 更改这个值来测试不同的人数
let n: u32 = 78;
let probability = calc_logic::new_birthday_probability(n);
println!(
"在 {} 个人中,有两个人在同一天过生日的概率是 {:.4}",
n,
probability
);
}
| 2301_77724773/rust-contest | exercises/solution3/src/main.rs | Rust | unknown | 296 |
mod calc_logic;
#[cfg(test)]
mod tests {
use super::calc_logic::new_birthday_probability;
// 定义测试用例和预期结果
const TEST_CASES: &[(u32, f64)] = &[
(23, 0.5073),
(30, 0.7063),
(50, 0.9704),
(78, 0.9999),
(100, 1.0000),
];
// 定义一个测试函数来验证每个测试用例
#[test]
fn t... | 2301_77724773/rust-contest | exercises/solution3/src/tests.rs | Rust | unknown | 1,023 |
mod rec_mc;
fn main() {
let amount = 93u32;
let cashe_num = rec_mc::dp_rec_mc(amount);
println!("{cashe_num}");
}
| 2301_77724773/rust-contest | exercises/solution4/src/main.rs | Rust | unknown | 127 |
pub fn dp_rec_mc(amount: u32) -> u32 {
// TODO: 这里写逻辑
todo!()
}
| 2301_77724773/rust-contest | exercises/solution4/src/rec_mc.rs | Rust | unknown | 82 |
// src/tests.rs
mod rec_mc;
#[cfg(test)]
mod tests {
use super::rec_mc::dp_rec_mc;
// 定义测试用例和预期结果
// const CASHES: [u32; 8] = [1, 2, 5, 10, 20, 30, 50, 100];
const TEST_CASES: &[(u32, u32)] = &[
(90, 3),
(93, 5),
(101, 2),
(102, 2),
(0, 0),
];
// 定义一个测试函数来... | 2301_77724773/rust-contest | exercises/solution4/src/tests.rs | Rust | unknown | 746 |
pub fn odd_fibnacci_sum(threshold: u32) -> u32 {
// TODO: 这里写逻辑
todo!()
}
| 2301_77724773/rust-contest | exercises/solution5/src/fibnacci.rs | Rust | unknown | 92 |
mod fibnacci;
fn main() {
let num = 20;
let sum = fibnacci::odd_fibnacci_sum(num);
println!("{sum}");
}
| 2301_77724773/rust-contest | exercises/solution5/src/main.rs | Rust | unknown | 117 |
// src/tests.rs
mod fibnacci;
#[cfg(test)]
mod tests {
use super::fibnacci::odd_fibnacci_sum;
// 定义测试用例和预期结果
const TEST_CASES: &[(u32, u32)] = &[
(20, 23),
(22, 44),
(30, 44),
(40, 44),
(56, 99),
];
// 定义一个测试函数来验证每个测试用例
#[test]
fn test_count() {
... | 2301_77724773/rust-contest | exercises/solution5/src/tests.rs | Rust | unknown | 705 |
use std::sync::Arc;
use std::{process::Command, sync::Mutex};
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use std::fs;
#[tokio::main]
async fn main() {
let solution1 = format!("
// src/tests.rs
mod count_distinct;
#[cfg(test)]
mod tests {{
use super::count_distinct::new_count_distinct;... | 2301_77724773/rust-contest | src/main.rs | Rust | unknown | 7,250 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class Inspect : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/Inspect.cs | C# | apache-2.0 | 5,532 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class Inspect_exdit : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/Inspect_exdit.cs | C# | apache-2.0 | 10,693 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/MR_contrl.cs | C# | apache-2.0 | 7,721 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl_exdit : Form
{
dbOPT dataOpt = new dbOPT()... | 2301_76847048/ebs | prjEMR22-154/MR_contrl_exdit.cs | C# | apache-2.0 | 15,140 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl_exditDE : Form
{
dbOPT dataOpt = new dbOPT... | 2301_76847048/ebs | prjEMR22-154/MR_contrl_exditDE.cs | C# | apache-2.0 | 2,585 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl_exdit_RO : Form
{
dbOPT dataOpt = new dbO... | 2301_76847048/ebs | prjEMR22-154/MR_contrl_exdit_RO.cs | C# | apache-2.0 | 5,847 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl_exdit_in : Form
{
dbOPT dataOpt = new dbO... | 2301_76847048/ebs | prjEMR22-154/MR_contrl_exdit_in.cs | C# | apache-2.0 | 6,769 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl_exdit_inDE : Form
{
dbOPT dataOpt = new d... | 2301_76847048/ebs | prjEMR22-154/MR_contrl_exdit_inDE.cs | C# | apache-2.0 | 1,013 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl_exdit_new : Form
{
dbOPT dataOpt = new db... | 2301_76847048/ebs | prjEMR22-154/MR_contrl_exdit_new.cs | C# | apache-2.0 | 2,902 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl_exdit_out : Form
{
dbOPT dataOpt = new dbO... | 2301_76847048/ebs | prjEMR22-154/MR_contrl_exdit_out.cs | C# | apache-2.0 | 4,657 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class MR_contrl_exdit_search : Form
{
dbOPT dataOpt = new... | 2301_76847048/ebs | prjEMR22-154/MR_contrl_exdit_search.cs | C# | apache-2.0 | 4,432 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class Medicine : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/Medicine.cs | C# | apache-2.0 | 5,439 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class Medicine_exdit : Form
{
dbOPT dataOpt = new dbOPT();... | 2301_76847048/ebs | prjEMR22-154/Medicine_exdit.cs | C# | apache-2.0 | 12,121 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class Pa_Ins : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/Pa_Ins.cs | C# | apache-2.0 | 7,737 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class Pa_Ins_search : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/Pa_Ins_search.cs | C# | apache-2.0 | 7,423 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class Pa_Md : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/Pa_Md.cs | C# | apache-2.0 | 6,789 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class Pa_Md_search : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/Pa_Md_search.cs | C# | apache-2.0 | 6,591 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class PatientInfo_inquire : Form
{
dbOPT dataOpt = new db... | 2301_76847048/ebs | prjEMR22-154/PatientInfo_inquire.cs | C# | apache-2.0 | 7,343 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class PatientInfo_inquire_checked : Form
{
dbOPT dataOpt =... | 2301_76847048/ebs | prjEMR22-154/PatientInfo_inquire_checked.cs | C# | apache-2.0 | 9,192 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class PatientInfo_inquire_checkedDE : Form
{
dbOPT dataOp... | 2301_76847048/ebs | prjEMR22-154/PatientInfo_inquire_checkedDE.cs | C# | apache-2.0 | 1,110 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class PatientInfo_new : Form
{
dbOPT dataOpt = new dbOPT(... | 2301_76847048/ebs | prjEMR22-154/PatientInfo_new.cs | C# | apache-2.0 | 3,584 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace prjEMR22_154
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles... | 2301_76847048/ebs | prjEMR22-154/Program.cs | C# | apache-2.0 | 472 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("prjEMR22-154")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: Assem... | 2301_76847048/ebs | prjEMR22-154/Properties/AssemblyInfo.cs | C# | apache-2.0 | 1,320 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
using System.Diagnostics;
namespace prjEMR22_154
{
public partial class Try : Form... | 2301_76847048/ebs | prjEMR22-154/Try.cs | C# | apache-2.0 | 10,436 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace prjEMR22_154
{
class cPublicData
{
public static string strHSPID;//跨窗体公共变量--住院号
public static string UType;//跨窗体公共变量--用户类型
}
}
| 2301_76847048/ebs | prjEMR22-154/cPublicData.cs | C# | apache-2.0 | 297 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;//引用MySQL命名空间
using System.Windows.Forms; //引用Forms命名空间
using System.Data; //引用数据库命名空间
using System.IO; //引用文件操作命名空间 2018-11-5 08:48:21
namespace public_dbOpt
{
// 这是一个自定义的静态类,用于定义全局事件
pu... | 2301_76847048/ebs | prjEMR22-154/dbOPT.cs | C# | apache-2.0 | 6,530 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class login : Form
{
dbOPT dataOpt = new dbOPT();
... | 2301_76847048/ebs | prjEMR22-154/login.cs | C# | apache-2.0 | 3,995 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using public_dbOpt;
namespace prjEMR22_154
{
public partial class login_NewUser : Form
{
dbOPT dataOpt = new dbOPT();... | 2301_76847048/ebs | prjEMR22-154/login_NewUser.cs | C# | apache-2.0 | 3,248 |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
using System.Diagnostics;
namespace prjEMR22_154
{
public partial class mainFrom :... | 2301_76847048/ebs | prjEMR22-154/mainFrom.cs | C# | apache-2.0 | 8,738 |
print("wqq") | 2301_77966824/learning-python | 2024/2024_01/2024_01_04/pythonProject2/2024_01_04.py | Python | unknown | 12 |
<script>
export default {
onLaunch: function() {
console.warn('当前组件仅支持 uni_modules 目录结构 ,请升级 HBuilderX 到 3.1.0 版本以上!')
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@... | 2301_77169380/miaoyu | App.vue | Vue | unknown | 649 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width... | 2301_77169380/miaoyu | index.html | HTML | unknown | 672 |
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
const app = createSSRApp(App)
... | 2301_77169380/miaoyu | main.js | JavaScript | unknown | 352 |
<template>
<view class="container">
<view class="intro">本项目已包含uni ui组件,无需import和注册,可直接使用。在代码区键入字母u,即可通过代码助手列出所有可用组件。光标置于组件名称处按F1,即可查看组件文档。</view>
<text class="intro">详见:</text>
<uni-link :href="href" :text="href"></uni-link>
</view>
</template>
<script>
export default {
data() {
return {
href: 'ht... | 2301_77169380/miaoyu | pages/index/index.vue | Vue | unknown | 643 |
@font-face {
font-family: "customicons"; /* Project id 2878519 */
src:url('/static/customicons.ttf') format('truetype');
}
.customicons {
font-family: "customicons" !important;
}
.youxi:before {
content: "\e60e";
}
.wenjian:before {
content: "\e60f";
}
.zhuanfa:before {
content: "\e610";
}
| 2301_77169380/miaoyu | static/customicons.css | CSS | unknown | 307 |
@import '@/uni_modules/uni-scss/variables.scss'; | 2301_77169380/miaoyu | uni.scss | SCSS | unknown | 48 |
<template>
<view class="uni-badge--x">
<slot />
<text v-if="text" :class="classNames" :style="[positionStyle, customStyle, dotStyle]"
class="uni-badge" @click="onClick()">{{displayValue}}</text>
</view>
</template>
<script>
/**
* Badge 数字角标
* @description 数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景
* @... | 2301_77169380/miaoyu | uni_modules/uni-badge/components/uni-badge/uni-badge.vue | Vue | unknown | 5,483 |
<template>
<view class="uni-breadcrumb">
<slot />
</view>
</template>
<script>
/**
* Breadcrumb 面包屑导航父组件
* @description 显示当前页面的路径,快速返回之前的任意页面
* @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
* @property {String} separator 分隔符,默认为斜杠'/'
* @property {String} separatorClass 图标分隔符 class
*/
export defaul... | 2301_77169380/miaoyu | uni_modules/uni-breadcrumb/components/uni-breadcrumb/uni-breadcrumb.vue | Vue | unknown | 822 |
<template>
<view class="uni-breadcrumb-item">
<view :class="{
'uni-breadcrumb-item--slot': true,
'uni-breadcrumb-item--slot-link': to && currentPage !== to
}" @click="navTo">
<slot />
</view>
<i v-if="separatorClass" class="uni-breadcrumb-item--separator" :class="separatorClass" />
<text v-else cla... | 2301_77169380/miaoyu | uni_modules/uni-breadcrumb/components/uni-breadcrumb-item/uni-breadcrumb-item.vue | Vue | unknown | 2,305 |
/**
* @1900-2100区间内的公历、农历互转
* @charset UTF-8
* @github https://github.com/jjonline/calendar.js
* @Author Jea杨(JJonline@JJonline.Cn)
* @Time 2014-7-21
* @Time 2016-8-13 Fixed 2033hex、Attribution Annals
* @Time 2016-9-25 Fixed lunar LeapMonth Param Bug
* @Time 2017-7-24 Fixed use getTerm Func Param Error.us... | 2301_77169380/miaoyu | uni_modules/uni-calendar/components/uni-calendar/calendar.js | JavaScript | unknown | 24,849 |
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
| 2301_77169380/miaoyu | uni_modules/uni-calendar/components/uni-calendar/i18n/index.js | JavaScript | unknown | 162 |
<template>
<view class="uni-calendar-item__weeks-box" :class="{
'uni-calendar-item--disable':weeks.disable,
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
'uni-calendar-item--checked':(calendar.fullDate === weeks.fullDate && !weeks.isDay) ,
'uni-calendar-item--before-checked':w... | 2301_77169380/miaoyu | uni_modules/uni-calendar/components/uni-calendar/uni-calendar-item.vue | Vue | unknown | 5,445 |
<template>
<view class="uni-calendar">
<view v-if="!insert&&show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}" @click="clean"></view>
<view v-if="insert || show" class="uni-calendar__content" :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow}">
<view v-if... | 2301_77169380/miaoyu | uni_modules/uni-calendar/components/uni-calendar/uni-calendar.vue | Vue | unknown | 13,205 |
import CALENDAR from './calendar.js'
class Calendar {
constructor({
date,
selected,
startDate,
endDate,
range
} = {}) {
// 当前日期
this.date = this.getDate(new Date()) // 当前初入日期
// 打点信息
this.selected = selected || [];
// 范围开始
this.startDate = startDate
// 范围结束
this.endDate = endDate
this.ran... | 2301_77169380/miaoyu | uni_modules/uni-calendar/components/uni-calendar/util.js | JavaScript | unknown | 8,931 |
<template>
<view class="uni-card" :class="{ 'uni-card--full': isFull, 'uni-card--shadow': isShadow,'uni-card--border':border}"
:style="{'margin':isFull?0:margin,'padding':spacing,'box-shadow':isShadow?shadow:''}">
<!-- 封面 -->
<slot name="cover">
<view v-if="cover" class="uni-card__cover">
<image class="un... | 2301_77169380/miaoyu | uni_modules/uni-card/components/uni-card/uni-card.vue | Vue | unknown | 6,362 |
<template>
<view class="uni-collapse">
<slot />
</view>
</template>
<script>
/**
* Collapse 折叠面板
* @description 展示可以折叠 / 展开的内容区域
* @tutorial https://ext.dcloud.net.cn/plugin?id=23
* @property {String|Array} value 当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)
* @property {Boolean} accordion = [true|false] 是否... | 2301_77169380/miaoyu | uni_modules/uni-collapse/components/uni-collapse/uni-collapse.vue | Vue | unknown | 3,358 |
<template>
<view class="uni-collapse-item">
<!-- onClick(!isOpen) -->
<view @click="onClick(!isOpen)" class="uni-collapse-item__title"
:class="{'is-open':isOpen &&titleBorder === 'auto' ,'uni-collapse-item-border':titleBorder !== 'none'}">
<view class="uni-collapse-item__title-wrap">
<slot name="title">
... | 2301_77169380/miaoyu | uni_modules/uni-collapse/components/uni-collapse-item/uni-collapse-item.vue | Vue | unknown | 9,003 |
<template>
<view class="uni-combox" :class="border ? '' : 'uni-combox__no-border'">
<view v-if="label" class="uni-combox__label" :style="labelStyle">
<text>{{label}}</text>
</view>
<view class="uni-combox__input-box">
<input class="uni-combox__input" type="text" :placeholder="placeholder"
placeholder-c... | 2301_77169380/miaoyu | uni_modules/uni-combox/components/uni-combox/uni-combox.vue | Vue | unknown | 5,806 |
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
| 2301_77169380/miaoyu | uni_modules/uni-countdown/components/uni-countdown/i18n/index.js | JavaScript | unknown | 162 |
<template>
<view class="uni-countdown">
<text v-if="showDay" :style="[timeStyle]" class="uni-countdown__number">{{ d }}</text>
<text v-if="showDay" :style="[splitorStyle]" class="uni-countdown__splitor">{{dayText}}</text>
<text v-if="showHour" :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
<... | 2301_77169380/miaoyu | uni_modules/uni-countdown/components/uni-countdown/uni-countdown.vue | Vue | unknown | 6,506 |
<template>
<view class="uni-data-checklist" :style="{'margin-top':isTop+'px'}">
<template v-if="!isLocal">
<view class="uni-data-loading">
<uni-load-more v-if="!mixinDatacomErrorMessage" status="loading" iconType="snow" :iconSize="18"
:content-text="contentText"></uni-load-more>
<text v-else>{{mixinD... | 2301_77169380/miaoyu | uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue | Vue | unknown | 20,446 |
// #ifdef H5
export default {
name: 'Keypress',
props: {
disable: {
type: Boolean,
default: false
}
},
mounted () {
const keyNames = {
esc: ['Esc', 'Escape'],
tab: 'Tab',
enter: 'Enter',
space: [' ', 'Spacebar'],
up: ['Up', 'ArrowUp'],
left: ['Left', '... | 2301_77169380/miaoyu | uni_modules/uni-data-picker/components/uni-data-picker/keypress.js | JavaScript | unknown | 1,110 |
<template>
<view class="uni-data-tree">
<view class="uni-data-tree-input" @click="handleInput">
<slot :options="options" :data="inputSelected" :error="errorMessage">
<view class="input-value" :class="{'input-value-border': border}">
<text v-if="errorMessage" class="selected-area error-text... | 2301_77169380/miaoyu | uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker.vue | Vue | unknown | 13,919 |
export default {
props: {
localdata: {
type: [Array, Object],
default () {
return []
}
},
spaceInfo: {
type: Object,
default () {
return {}
}
},
collection: {
type: String,
default: ''
},
action: {
type: String,
de... | 2301_77169380/miaoyu | uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-picker.js | JavaScript | unknown | 14,230 |
.uni-data-pickerview {
position: relative;
flex-direction: column;
overflow: hidden;
}
.loading-cover {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
align-items: center;
justify-content: center;
background-color: rgba(150, 150, 150, .1);
}
.error {
background-color: #fff;
paddin... | 2301_77169380/miaoyu | uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.css | CSS | unknown | 1,115 |
<template>
<view class="uni-data-pickerview">
<scroll-view v-if="!isCloudDataList" class="selected-area" scroll-x="true">
<view class="selected-list">
<view
class="selected-item"
v-for="(item,index) in selected"
:key="index"
:class="{
... | 2301_77169380/miaoyu | uni_modules/uni-data-picker/components/uni-data-pickerview/uni-data-pickerview.vue | Vue | unknown | 7,713 |
<template>
<view class="uni-stat__select">
<span v-if="label" class="uni-label-text hide-on-phone">{{label + ':'}}</span>
<view class="uni-stat-box" :class="{'uni-stat__actived': current}">
<view class="uni-select" :class="{'uni-select--disabled':disabled}">
<view class="uni-select__input-box" @click="toggl... | 2301_77169380/miaoyu | uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue | Vue | unknown | 12,377 |
// yyyy-MM-dd hh:mm:ss.SSS 所有支持的类型
function pad(str, length = 2) {
str += ''
while (str.length < length) {
str = '0' + str
}
return str.slice(-length)
}
const parser = {
yyyy: (dateObj) => {
return pad(dateObj.year, 4)
},
yy: (dateObj) => {
return pad(dateObj.year)
},
MM: (dateObj) => {
return pad(dat... | 2301_77169380/miaoyu | uni_modules/uni-dateformat/components/uni-dateformat/date-format.js | JavaScript | unknown | 3,847 |
<template>
<text>{{dateShow}}</text>
</template>
<script>
import {friendlyDate} from './date-format.js'
/**
* Dateformat 日期格式化
* @description 日期格式化组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=3279
* @property {Object|String|Number} date 日期对象/日期字符串/时间戳
* @property {String} locale 格式化使用的语言
* @value... | 2301_77169380/miaoyu | uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat.vue | Vue | unknown | 1,698 |
<template>
<view class="uni-calendar-item__weeks-box" :class="{
'uni-calendar-item--disable':weeks.disable,
'uni-calendar-item--before-checked-x':weeks.beforeMultiple,
'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked-x':weeks.afterMultiple,
}" @click="choiceDate(weeks)" @mouse... | 2301_77169380/miaoyu | uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar-item.vue | Vue | unknown | 4,112 |
<template>
<view class="uni-calendar" @mouseleave="leaveCale">
<view v-if="!insert && show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}"
@click="maskClick"></view>
<view v-if="insert || show" class="uni-calendar__content"
:class="{'uni-calendar--fixed':!insert,'uni-calendar--... | 2301_77169380/miaoyu | uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue | Vue | unknown | 22,102 |
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
| 2301_77169380/miaoyu | uni_modules/uni-datetime-picker/components/uni-datetime-picker/i18n/index.js | JavaScript | unknown | 162 |
<template>
<view class="uni-datetime-picker">
<view @click="initTimePicker">
<slot>
<view class="uni-datetime-picker-timebox-pointer"
:class="{'uni-datetime-picker-disabled': disabled, 'uni-datetime-picker-timebox': border}">
<text class="uni-datetime-picker-text">{{time}}</text>
<view v-if="!t... | 2301_77169380/miaoyu | uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue | Vue | unknown | 22,881 |
<template>
<view class="uni-date">
<view class="uni-date-editor" @click="show">
<slot>
<view class="uni-date-editor--x"
:class="{'uni-date-editor--x__disabled': disabled,'uni-date-x--border': border}">
<view v-if="!isRange" class="uni-date-x uni-date-single">
<uni-icons class="icon-calendar" t... | 2301_77169380/miaoyu | uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue | Vue | unknown | 28,776 |
class Calendar {
constructor({
selected,
startDate,
endDate,
range,
} = {}) {
// 当前日期
this.date = this.getDateObj(new Date()) // 当前初入日期
// 打点信息
this.selected = selected || [];
// 起始时间
this.startDate = startDate
// 终止时间
this.endDate = endDate
// 是否范围选择
this.range = range
// 多选状态
this.cl... | 2301_77169380/miaoyu | uni_modules/uni-datetime-picker/components/uni-datetime-picker/util.js | JavaScript | unknown | 10,060 |
// #ifdef H5
export default {
name: 'Keypress',
props: {
disable: {
type: Boolean,
default: false
}
},
mounted () {
const keyNames = {
esc: ['Esc', 'Escape'],
tab: 'Tab',
enter: 'Enter',
space: [' ', 'Spacebar'],
up: ['Up', 'ArrowUp'],
left: ['Left', '... | 2301_77169380/miaoyu | uni_modules/uni-drawer/components/uni-drawer/keypress.js | JavaScript | unknown | 1,119 |
<template>
<view v-if="visibleSync" :class="{ 'uni-drawer--visible': showDrawer }" class="uni-drawer" @touchmove.stop.prevent="clear">
<view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @tap="close('mask')" />
<view class="uni-drawer__content" :class="{'uni-drawer--right': ... | 2301_77169380/miaoyu | uni_modules/uni-drawer/components/uni-drawer/uni-drawer.vue | Vue | unknown | 3,988 |
/**
* @desc 函数防抖
* @param func 目标函数
* @param wait 延迟执行毫秒数
* @param immediate true - 立即执行, false - 延迟执行
*/
export const debounce = function(func, wait = 1000, immediate = true) {
let timer;
return function() {
let context = this,
args = arguments;
if (timer) clearTimeout(timer);
if (immediate) {
let c... | 2301_77169380/miaoyu | uni_modules/uni-easyinput/components/uni-easyinput/common.js | JavaScript | unknown | 1,251 |
<template>
<view class="uni-easyinput" :class="{ 'uni-easyinput-error': msg }" :style="boxStyle">
<view class="uni-easyinput__content" :class="inputContentClass" :style="inputContentStyle">
<uni-icons v-if="prefixIcon" class="content-clear-icon" :type="prefixIcon" color="#c0c4cc"
@click="onClickIcon('prefix')... | 2301_77169380/miaoyu | uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue | Vue | unknown | 18,079 |
<template>
<view class="uni-cursor-point">
<view v-if="popMenu && (leftBottom||rightBottom||leftTop||rightTop) && content.length > 0" :class="{
'uni-fab--leftBottom': leftBottom,
'uni-fab--rightBottom': rightBottom,
'uni-fab--leftTop': leftTop,
'uni-fab--rightTop': rightTop
}" c... | 2301_77169380/miaoyu | uni_modules/uni-fab/components/uni-fab/uni-fab.vue | Vue | unknown | 11,160 |
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
| 2301_77169380/miaoyu | uni_modules/uni-fav/components/uni-fav/i18n/index.js | JavaScript | unknown | 162 |
<template>
<view :class="[circle === true || circle === 'true' ? 'uni-fav--circle' : '']" :style="[{ backgroundColor: checked ? bgColorChecked : bgColor }]"
@click="onClick" class="uni-fav">
<!-- #ifdef MP-ALIPAY -->
<view class="uni-fav-star" v-if="!checked && (star === true || star === 'true')">
<uni-icons ... | 2301_77169380/miaoyu | uni_modules/uni-fav/components/uni-fav/uni-fav.vue | Vue | unknown | 3,847 |
'use strict';
const ERR_MSG_OK = 'chooseAndUploadFile:ok';
const ERR_MSG_FAIL = 'chooseAndUploadFile:fail';
function chooseImage(opts) {
const {
count,
sizeType = ['original', 'compressed'],
sourceType,
extension
} = opts
return new Promise((resolve, reject) => {
// 微信由于旧接口不再维护,针对微信小程序平台改用chooseMedia接口
... | 2301_77169380/miaoyu | uni_modules/uni-file-picker/components/uni-file-picker/choose-and-upload-file.js | JavaScript | unknown | 6,017 |
<template>
<view class="uni-file-picker">
<view v-if="title" class="uni-file-picker__header">
<text class="file-title">{{ title }}</text>
<text class="file-count">{{ filesList.length }}/{{ limitLength }}</text>
</view>
<upload-image v-if="fileMediatype === 'image' && showType === 'grid'" :readonly="readonl... | 2301_77169380/miaoyu | uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue | Vue | unknown | 16,857 |
<template>
<view class="uni-file-picker__files">
<view v-if="!readonly" class="files-button" @click="choose">
<slot></slot>
</view>
<!-- :class="{'is-text-box':showType === 'list'}" -->
<view v-if="list.length > 0" class="uni-file-picker__lists is-text-box" :style="borderStyle">
<!-- ,'is-list-card':show... | 2301_77169380/miaoyu | uni_modules/uni-file-picker/components/uni-file-picker/upload-file.vue | Vue | unknown | 6,690 |
<template>
<view class="uni-file-picker__container">
<view class="file-picker__box" v-for="(item,index) in filesList" :key="index" :style="boxStyle">
<view class="file-picker__box-content" :style="borderStyle">
<image class="file-image" :src="item.url" mode="aspectFill" @click.stop="prviewImage(item,index)"><... | 2301_77169380/miaoyu | uni_modules/uni-file-picker/components/uni-file-picker/upload-image.vue | Vue | unknown | 6,027 |
/**
* 获取文件名和后缀
* @param {String} name
*/
export const get_file_ext = (name) => {
const last_len = name.lastIndexOf('.')
const len = name.length
return {
name: name.substring(0, last_len),
ext: name.substring(last_len + 1, len)
}
}
/**
* 获取扩展名
* @param {Array} fileExtname
*/
export const get_extname = (fi... | 2301_77169380/miaoyu | uni_modules/uni-file-picker/components/uni-file-picker/utils.js | JavaScript | unknown | 2,326 |
<template>
<view class="uni-forms">
<form>
<slot></slot>
</form>
</view>
</template>
<script>
import Validator from './validate.js';
import {
deepCopy,
getValue,
isRequiredField,
setDataValue,
getDataValue,
realName,
isRealName,
rawData,
isEqual
} from './utils.js'
// #ifndef VUE3
// 后... | 2301_77169380/miaoyu | uni_modules/uni-forms/components/uni-forms/uni-forms.vue | Vue | unknown | 10,691 |
/**
* 简单处理对象拷贝
* @param {Obejct} 被拷贝对象
* @@return {Object} 拷贝对象
*/
export const deepCopy = (val) => {
return JSON.parse(JSON.stringify(val))
}
/**
* 过滤数字类型
* @param {String} format 数字类型
* @@return {Boolean} 返回是否为数字类型
*/
export const typeFilter = (format) => {
return format === 'int' || format === 'double' || ... | 2301_77169380/miaoyu | uni_modules/uni-forms/components/uni-forms/utils.js | JavaScript | unknown | 7,711 |
var pattern = {
email: /^\S+?@\S+?\.\S+?$/,
idcard: /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
url: new RegExp(
"^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:... | 2301_77169380/miaoyu | uni_modules/uni-forms/components/uni-forms/validate.js | JavaScript | unknown | 11,807 |
<template>
<view class="uni-forms-item"
:class="['is-direction-' + localLabelPos ,border?'uni-forms-item--border':'' ,border && isFirstBorder?'is-first-border':'']">
<slot name="label">
<view class="uni-forms-item__label" :class="{'no-label':!label && !required}"
:style="{width:localLabelWidth,justifyConten... | 2301_77169380/miaoyu | uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue | Vue | unknown | 15,246 |
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}
| 2301_77169380/miaoyu | uni_modules/uni-goods-nav/components/uni-goods-nav/i18n/index.js | JavaScript | unknown | 162 |
<template>
<view class="uni-goods-nav">
<!-- 底部占位 -->
<view class="uni-tab__seat" />
<view class="uni-tab__cart-box flex">
<view class="flex uni-tab__cart-sub-left">
<view v-for="(item,index) in options" :key="index" class="flex uni-tab__cart-button-left uni-tab__shop-cart" @click="onClick(index,item)">
... | 2301_77169380/miaoyu | uni_modules/uni-goods-nav/components/uni-goods-nav/uni-goods-nav.vue | Vue | unknown | 5,104 |
<template>
<view class="uni-grid-wrap">
<view :id="elId" ref="uni-grid" class="uni-grid" :class="{ 'uni-grid--border': showBorder }" :style="{ 'border-left-color':borderColor}">
<slot />
</view>
</view>
</template>
<script>
// #ifdef APP-NVUE
const dom = uni.requireNativePlugin('dom');
// #endif
/**
* ... | 2301_77169380/miaoyu | uni_modules/uni-grid/components/uni-grid/uni-grid.vue | Vue | unknown | 2,862 |