Compare commits
No commits in common. 'ab8c49d7945b0e2bad771715831fb4c124410c21' and '53b7561d19ade050326b8a7818923f15e87785f8' have entirely different histories.
ab8c49d794
...
53b7561d19
699 changed files with 67930 additions and 8763 deletions
@ -1,3 +1,3 @@ |
|||||||
/node_modules |
/node_modules |
||||||
/unpackage/dist |
/unpackage/dist |
||||||
/uni_modules |
/uni_modules |
@ -1,47 +1,47 @@ |
|||||||
<script> |
<script> |
||||||
export default { |
export default { |
||||||
onLaunch: function(options) { |
onLaunch: function(options) { |
||||||
|
|
||||||
this.$auth.getLocalUserInfo() |
this.$auth.getLocalUserInfo() |
||||||
this.$store.commit('savePath', options.path); //打开时访问的链接 |
this.$store.commit('savePath', options.path); //打开时访问的链接 |
||||||
}, |
}, |
||||||
onShow: function() { |
onShow: function() { |
||||||
console.log('-------------- 小程序显示 --------------') |
console.log('-------------- 小程序显示 --------------') |
||||||
}, |
}, |
||||||
onHide: function() { |
onHide: function() { |
||||||
console.log('-------------- bye bye --------------') |
console.log('-------------- bye bye --------------') |
||||||
}, |
}, |
||||||
|
|
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style> |
<style> |
||||||
/*每个页面公共css */ |
/*每个页面公共css */ |
||||||
.page { |
.page { |
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
width: 100vw; |
width: 100vw; |
||||||
height: 100vh; |
height: 100vh; |
||||||
background: #efefef; |
background: #efefef; |
||||||
overflow: auto; |
overflow: auto; |
||||||
color: #100F19; |
color: #100F19; |
||||||
} |
} |
||||||
checkbox{ |
checkbox{ |
||||||
border: #4963F4; |
border: #4963F4; |
||||||
} |
} |
||||||
button[type='primary'] { |
button[type='primary'] { |
||||||
background-color: #327AFE; |
background-color: #327AFE; |
||||||
color: #fff; |
color: #fff; |
||||||
} |
} |
||||||
button[type='default'] { |
button[type='default'] { |
||||||
background-color: #FFFFFF; |
background-color: #FFFFFF; |
||||||
border: 1px solid rgba(0,0,0,0.15); |
border: 1px solid rgba(0,0,0,0.15); |
||||||
color: rgba(0,0,0,0.65); |
color: rgba(0,0,0,0.65); |
||||||
} |
} |
||||||
.buttons{ |
.buttons{ |
||||||
display: flex; |
display: flex; |
||||||
|
|
||||||
} |
} |
||||||
.button button{ |
.button button{ |
||||||
margin: 0 6rpx; |
margin: 0 6rpx; |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,79 +1,79 @@ |
|||||||
<template> |
<template> |
||||||
<view class="content"> |
<view class="content"> |
||||||
<view class="input"> |
<view class="input"> |
||||||
<input type="text" placeholder="搜索单位" @input="getCompanies($event)"> |
<input type="text" placeholder="搜索单位" @input="getCompanies($event)"> |
||||||
</view> |
</view> |
||||||
<view class="content_item_box"> |
<view class="content_item_box"> |
||||||
<view class="content_item" v-for="(item,index) in list" :key="index"> |
<view class="content_item" v-for="(item,index) in list" :key="index"> |
||||||
<text @tap="aaa(index)">{{item.companyName}}</text> |
<text @tap="aaa(index)">{{item.companyName}}</text> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
export default { |
export default { |
||||||
props: ['cid'], |
props: ['cid'], |
||||||
data() { |
data() { |
||||||
|
|
||||||
return { |
return { |
||||||
list: [] |
list: [] |
||||||
} |
} |
||||||
}, |
}, |
||||||
created() { |
created() { |
||||||
|
|
||||||
this.getCompanies() |
this.getCompanies() |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
getCompanies(e) { |
getCompanies(e) { |
||||||
let a = "" |
let a = "" |
||||||
if (e) { |
if (e) { |
||||||
a = e.detail.value |
a = e.detail.value |
||||||
} |
} |
||||||
let OrganizationId = uni.getStorageSync("user").organizationId |
let OrganizationId = uni.getStorageSync("user").organizationId |
||||||
let params = { |
let params = { |
||||||
companyName: a, |
companyName: a, |
||||||
OrganizationId: OrganizationId, |
OrganizationId: OrganizationId, |
||||||
PageNumber: 1, |
PageNumber: 1, |
||||||
PageSize: 50 |
PageSize: 50 |
||||||
} |
} |
||||||
this.$request.get('/api/Companies', params, (data, res) => { |
this.$request.get('/api/Companies', params, (data, res) => { |
||||||
console.log(res,4444); |
console.log(res,4444); |
||||||
this.list = res.items |
this.list = res.items |
||||||
}) |
}) |
||||||
}, |
}, |
||||||
aaa(i) { |
aaa(i) { |
||||||
console.log(i); |
console.log(i); |
||||||
|
|
||||||
this.$parent.Company(this.list[i]); |
this.$parent.Company(this.list[i]); |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
.content { |
.content { |
||||||
height: 100%; |
height: 100%; |
||||||
display: flex; |
display: flex; |
||||||
flex-direction: column; |
flex-direction: column; |
||||||
padding: 20rpx; |
padding: 20rpx; |
||||||
.input{ |
.input{ |
||||||
border: 2rpx solid #E4E7EC; |
border: 2rpx solid #E4E7EC; |
||||||
height: 60rpx; |
height: 60rpx; |
||||||
padding: 0 20rpx; |
padding: 0 20rpx; |
||||||
input{ |
input{ |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
} |
} |
||||||
.content_item_box { |
.content_item_box { |
||||||
flex: 1; |
flex: 1; |
||||||
overflow: auto; |
overflow: auto; |
||||||
.content_item{ |
.content_item{ |
||||||
height: 80rpx; |
height: 80rpx; |
||||||
line-height: 80rpx; |
line-height: 80rpx; |
||||||
padding-left: 20rpx; |
padding-left: 20rpx; |
||||||
border-bottom: 2rpx solid #eceff3; |
border-bottom: 2rpx solid #eceff3; |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,106 +1,106 @@ |
|||||||
<template> |
<template> |
||||||
<view class="content"> |
<view class="content"> |
||||||
<view class="content_item_box"> |
<view class="content_item_box"> |
||||||
<view class="content_item"> |
<view class="content_item"> |
||||||
<view class=""> |
<view class=""> |
||||||
任务名称: |
任务名称: |
||||||
</view> |
</view> |
||||||
<view class=""> |
<view class=""> |
||||||
{{list.taskType}} |
{{list.taskType}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="content_item"> |
<view class="content_item"> |
||||||
<view class=""> |
<view class=""> |
||||||
单位名称: |
单位名称: |
||||||
</view> |
</view> |
||||||
|
|
||||||
<view class=""> |
<view class=""> |
||||||
{{list.company.companyName}} |
{{list.company.companyName}} |
||||||
</view> |
</view> |
||||||
|
|
||||||
</view> |
</view> |
||||||
<view class="content_item"> |
<view class="content_item"> |
||||||
<view class=""> |
<view class=""> |
||||||
协助机构: |
协助机构: |
||||||
</view> |
</view> |
||||||
|
|
||||||
<view class=""> |
<view class=""> |
||||||
<view class="" v-for="(item,k) in list.supervisors" :key="k"> |
<view class="" v-for="(item,k) in list.supervisors" :key="k"> |
||||||
{{item.name}} |
{{item.name}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
export default { |
export default { |
||||||
props: ['cid'], |
props: ['cid'], |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
list:{} |
list:{} |
||||||
} |
} |
||||||
}, |
}, |
||||||
created() { |
created() { |
||||||
console.log(this.cid); |
console.log(this.cid); |
||||||
this.list=this.cid |
this.list=this.cid |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
|
|
||||||
} |
} |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
.content { |
.content { |
||||||
height: 100%; |
height: 100%; |
||||||
display: flex; |
display: flex; |
||||||
flex-direction: column; |
flex-direction: column; |
||||||
padding: 0 20rpx; |
padding: 0 20rpx; |
||||||
|
|
||||||
.content_item_box { |
.content_item_box { |
||||||
flex: 1; |
flex: 1; |
||||||
overflow: auto; |
overflow: auto; |
||||||
} |
} |
||||||
|
|
||||||
.content_item { |
.content_item { |
||||||
display: flex; |
display: flex; |
||||||
align-items: center; |
align-items: center; |
||||||
padding: 20rpx 0; |
padding: 20rpx 0; |
||||||
|
|
||||||
view { |
view { |
||||||
margin: 0 20rpx; |
margin: 0 20rpx; |
||||||
} |
} |
||||||
|
|
||||||
.input { |
.input { |
||||||
flex: 1; |
flex: 1; |
||||||
height: 60rpx; |
height: 60rpx; |
||||||
border: 2rpx solid #E4E7EC; |
border: 2rpx solid #E4E7EC; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
.button { |
.button { |
||||||
display: flex; |
display: flex; |
||||||
height: 150rpx; |
height: 150rpx; |
||||||
} |
} |
||||||
|
|
||||||
.checkbox-group, |
.checkbox-group, |
||||||
.radio-group { |
.radio-group { |
||||||
flex: 1; |
flex: 1; |
||||||
|
|
||||||
overflow: auto; |
overflow: auto; |
||||||
|
|
||||||
.checkbox, |
.checkbox, |
||||||
.radio { |
.radio { |
||||||
margin-bottom: 10rpx; |
margin-bottom: 10rpx; |
||||||
margin-right: 10rpx; |
margin-right: 10rpx; |
||||||
|
|
||||||
radio { |
radio { |
||||||
transform: scale(0.7); |
transform: scale(0.7); |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,25 +1,25 @@ |
|||||||
<template> |
<template> |
||||||
<button @tap="aaa()">123</button> |
<button @tap="aaa()">123</button> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
export default { |
export default { |
||||||
|
|
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
list:{} |
list:{} |
||||||
} |
} |
||||||
}, |
}, |
||||||
created() { |
created() { |
||||||
console.log(this.cid); |
console.log(this.cid); |
||||||
this.list=this.cid |
this.list=this.cid |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
|
|
||||||
} |
} |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style> |
<style> |
||||||
|
|
||||||
</style> |
</style> |
@ -1,54 +1,54 @@ |
|||||||
const alert = { |
const alert = { |
||||||
// 显示等待对话框
|
// 显示等待对话框
|
||||||
showLoading: function(msg) { |
showLoading: function(msg) { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: msg, |
title: msg, |
||||||
icon: "loading", |
icon: "loading", |
||||||
duration: 100000 |
duration: 100000 |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
// 隐藏等待对话框
|
// 隐藏等待对话框
|
||||||
hideLoading: function(msg) { |
hideLoading: function(msg) { |
||||||
uni.hideToast(); |
uni.hideToast(); |
||||||
}, |
}, |
||||||
// 成功
|
// 成功
|
||||||
showSuccess: function(msg) { |
showSuccess: function(msg) { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: msg, |
title: msg, |
||||||
icon: "success", |
icon: "success", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
//显示警告
|
//显示警告
|
||||||
showWarning: function(msg) { |
showWarning: function(msg) { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: msg, |
title: msg, |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
|
|
||||||
showError: function(msg) { |
showError: function(msg) { |
||||||
uni.showToast({ |
uni.showToast({ |
||||||
title: msg, |
title: msg, |
||||||
icon: "none", |
icon: "none", |
||||||
duration: 2000 |
duration: 2000 |
||||||
}); |
}); |
||||||
}, |
}, |
||||||
askLogin: function () { |
askLogin: function () { |
||||||
uni.showModal({ |
uni.showModal({ |
||||||
title: '尚未登录', |
title: '尚未登录', |
||||||
content: '前往授权登录页面吗?', |
content: '前往授权登录页面吗?', |
||||||
success(res) { |
success(res) { |
||||||
console.log(res) |
console.log(res) |
||||||
if (res.confirm) { |
if (res.confirm) { |
||||||
uni.redirectTo({ |
uni.redirectTo({ |
||||||
url: '/pages/login/login' |
url: '/pages/login/login' |
||||||
}) |
}) |
||||||
} |
} |
||||||
} |
} |
||||||
}) |
}) |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
export default alert |
export default alert |
@ -0,0 +1,12 @@ |
|||||||
|
{ |
||||||
|
"name": "Jinan_app", |
||||||
|
"lockfileVersion": 2, |
||||||
|
"requires": true, |
||||||
|
"packages": { |
||||||
|
"node_modules/@escook/request-miniprogram": { |
||||||
|
"version": "0.2.1", |
||||||
|
"resolved": "https://registry.npmmirror.com/@escook/request-miniprogram/-/request-miniprogram-0.2.1.tgz", |
||||||
|
"integrity": "sha512-ueWV5YsaEm/ycQZuEjMiA88GFMhfBQSjy9GrP9omy4xAQajkGTbYIlnhzsDfWzRPmRC1fKmAiKMrCVcgS+SHcQ==" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,99 @@ |
|||||||
|
## 安装 |
||||||
|
|
||||||
|
```bash |
||||||
|
npm install @escook/request-miniprogram |
||||||
|
``` |
||||||
|
|
||||||
|
## 导入 |
||||||
|
|
||||||
|
```js |
||||||
|
// 按需导入 $http 对象 |
||||||
|
import { $http } from '@escook/request-miniprogram' |
||||||
|
|
||||||
|
// 将按需导入的 $http 挂载到 wx 顶级对象之上,方便全局调用 |
||||||
|
wx.$http = $http |
||||||
|
|
||||||
|
// 在 uni-app 项目中,可以把 $http 挂载到 uni 顶级对象之上,方便全局调用 |
||||||
|
uni.$http = $http |
||||||
|
``` |
||||||
|
|
||||||
|
## 使用 |
||||||
|
|
||||||
|
### 支持的请求方法 |
||||||
|
|
||||||
|
```js |
||||||
|
// 发起 GET 请求,data 是可选的参数对象 |
||||||
|
$http.get(url, data?) |
||||||
|
|
||||||
|
// 发起 POST 请求,data 是可选的参数对象 |
||||||
|
$http.post(url, data?) |
||||||
|
|
||||||
|
// 发起 PUT 请求,data 是可选的参数对象 |
||||||
|
$http.put(url, data?) |
||||||
|
|
||||||
|
// 发起 DELETE 请求,data 是可选的参数对象 |
||||||
|
$http.delete(url, data?) |
||||||
|
``` |
||||||
|
|
||||||
|
### 配置请求根路径 |
||||||
|
|
||||||
|
```js |
||||||
|
$http.baseUrl = 'https://www.example.com' |
||||||
|
``` |
||||||
|
|
||||||
|
### 请求拦截器 |
||||||
|
|
||||||
|
```js |
||||||
|
// 请求开始之前做一些事情 |
||||||
|
$http.beforeRequest = function (options) { |
||||||
|
// do somethimg... |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
例 1,展示 loading 效果: |
||||||
|
|
||||||
|
```js |
||||||
|
// 请求开始之前做一些事情 |
||||||
|
$http.beforeRequest = function (options) { |
||||||
|
wx.showLoading({ |
||||||
|
title: '数据加载中...', |
||||||
|
}) |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
例 2,自定义 header 请求头: |
||||||
|
|
||||||
|
```js |
||||||
|
// 请求开始之前做一些事情 |
||||||
|
$http.beforeRequest = function (options) { |
||||||
|
if (options.url.indexOf('/home/catitems') !== -1) { |
||||||
|
options.header = { |
||||||
|
'X-Test': 'AAA', |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
### 响应拦截器 |
||||||
|
|
||||||
|
```js |
||||||
|
// 请求完成之后做一些事情 |
||||||
|
$http.afterRequest = function () { |
||||||
|
// do something... |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
例如,隐藏 loading 效果: |
||||||
|
|
||||||
|
```js |
||||||
|
// 请求完成之后做一些事情 |
||||||
|
$http.afterRequest = function () { |
||||||
|
wx.hideLoading() |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
## 开源协议 |
||||||
|
|
||||||
|
 |
||||||
|
|
||||||
|
**enjoy!** |
@ -0,0 +1,73 @@ |
|||||||
|
class Request { |
||||||
|
constructor(options = {}) { |
||||||
|
// 请求的根路径
|
||||||
|
this.baseUrl = options.baseUrl || '' |
||||||
|
// 请求的 url 地址
|
||||||
|
this.url = options.url || '' |
||||||
|
// 请求方式
|
||||||
|
this.method = 'GET' |
||||||
|
// 请求的参数对象
|
||||||
|
this.data = null |
||||||
|
// header 请求头
|
||||||
|
this.header = options.header || {} |
||||||
|
this.beforeRequest = null |
||||||
|
this.afterRequest = null |
||||||
|
} |
||||||
|
|
||||||
|
get(url, data = {}) { |
||||||
|
this.method = 'GET' |
||||||
|
this.url = this.baseUrl + url |
||||||
|
this.data = data |
||||||
|
return this._() |
||||||
|
} |
||||||
|
|
||||||
|
post(url, data = {}) { |
||||||
|
this.method = 'POST' |
||||||
|
this.url = this.baseUrl + url |
||||||
|
this.data = data |
||||||
|
return this._() |
||||||
|
} |
||||||
|
|
||||||
|
put(url, data = {}) { |
||||||
|
this.method = 'PUT' |
||||||
|
this.url = this.baseUrl + url |
||||||
|
this.data = data |
||||||
|
return this._() |
||||||
|
} |
||||||
|
|
||||||
|
delete(url, data = {}) { |
||||||
|
this.method = 'DELETE' |
||||||
|
this.url = this.baseUrl + url |
||||||
|
this.data = data |
||||||
|
return this._() |
||||||
|
} |
||||||
|
|
||||||
|
_() { |
||||||
|
// 清空 header 对象
|
||||||
|
this.header = {} |
||||||
|
// 请求之前做一些事
|
||||||
|
this.beforeRequest && typeof this.beforeRequest === 'function' && this.beforeRequest(this) |
||||||
|
// 发起请求
|
||||||
|
return new Promise((resolve, reject) => { |
||||||
|
let weixin = wx |
||||||
|
// 适配 uniapp
|
||||||
|
if ('undefined' !== typeof uni) { |
||||||
|
weixin = uni |
||||||
|
} |
||||||
|
weixin.request({ |
||||||
|
url: this.url, |
||||||
|
method: this.method, |
||||||
|
data: this.data, |
||||||
|
header: this.header, |
||||||
|
success: (res) => { resolve(res) }, |
||||||
|
fail: (err) => { reject(err) }, |
||||||
|
complete: (res) => { |
||||||
|
// 请求完成以后做一些事情
|
||||||
|
this.afterRequest && typeof this.afterRequest === 'function' && this.afterRequest(res) |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
export const $http = new Request() |
@ -0,0 +1,23 @@ |
|||||||
|
{ |
||||||
|
"name": "@escook/request-miniprogram", |
||||||
|
"version": "0.2.1", |
||||||
|
"description": "基于 Promise 的小程序网路请求库", |
||||||
|
"main": "miniprogram_dist/index.js", |
||||||
|
"miniprogram": "miniprogram_dist", |
||||||
|
"scripts": {}, |
||||||
|
"keywords": [ |
||||||
|
"request", |
||||||
|
"miniprogram", |
||||||
|
"wx", |
||||||
|
"weixin" |
||||||
|
], |
||||||
|
"repository": { |
||||||
|
"type": "git", |
||||||
|
"url": "git@github.com:liulongbin1314/request-miniprogram.git" |
||||||
|
}, |
||||||
|
"bugs": { |
||||||
|
"url": "https://github.com/liulongbin1314/request-miniprogram/issues" |
||||||
|
}, |
||||||
|
"author": "LiuLongBin", |
||||||
|
"license": "MIT" |
||||||
|
} |
@ -1,148 +1,148 @@ |
|||||||
<template> |
<template> |
||||||
<view class="page"> |
<view class="page"> |
||||||
|
|
||||||
<view class="items"> |
<view class="items"> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="text" @tap="changePassword()"> |
<view class="text" @tap="changePassword()"> |
||||||
旧密码 |
旧密码 |
||||||
</view> |
</view> |
||||||
<view class="input"> |
<view class="input"> |
||||||
<input type="password" placeholder="请输入旧密码" v-model="list.oldpassword"> |
<input type="password" placeholder="请输入旧密码" v-model="list.oldpassword"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="text" @tap="changePassword()"> |
<view class="text" @tap="changePassword()"> |
||||||
新密码 |
新密码 |
||||||
</view> |
</view> |
||||||
<view class="input"> |
<view class="input"> |
||||||
<input type="password" placeholder="请输入新密码" v-model="list.newpassword"> |
<input type="password" placeholder="请输入新密码" v-model="list.newpassword"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="text" @tap="changePassword()"> |
<view class="text" @tap="changePassword()"> |
||||||
确认密码 |
确认密码 |
||||||
</view> |
</view> |
||||||
<view class="input"> |
<view class="input"> |
||||||
<input type="password" placeholder="请确认密码" v-model="list.truepassword"> |
<input type="password" placeholder="请确认密码" v-model="list.truepassword"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="button"> |
<view class="button"> |
||||||
<button @tap="xiugai()">确定</button> |
<button @tap="xiugai()">确定</button> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
export default { |
export default { |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
list:{ |
list:{ |
||||||
newpassword:"", |
newpassword:"", |
||||||
oldpassword:"", |
oldpassword:"", |
||||||
truepassword:"" |
truepassword:"" |
||||||
} |
} |
||||||
} |
} |
||||||
}, |
}, |
||||||
onLoad() { |
onLoad() { |
||||||
|
|
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
|
|
||||||
xiugai(){ |
xiugai(){ |
||||||
if(this.list.truepassword!=this.list.newpassword){ |
if(this.list.truepassword!=this.list.newpassword){ |
||||||
return this.$alert.showError("两次输入不一致") |
return this.$alert.showError("两次输入不一致") |
||||||
} |
} |
||||||
let bady={ |
let bady={ |
||||||
oldPassword: this.list.oldpassword, |
oldPassword: this.list.oldpassword, |
||||||
newPassword: this.list.newpassword |
newPassword: this.list.newpassword |
||||||
} |
} |
||||||
this.$request.patch('/api/Accounts/ChangePassword',bady,(data,res)=>{ |
this.$request.patch('/api/Accounts/ChangePassword',bady,(data,res)=>{ |
||||||
console.log(res); |
console.log(res); |
||||||
if(res){ |
if(res){ |
||||||
return this.$alert.showError(res) |
return this.$alert.showError(res) |
||||||
}else{ |
}else{ |
||||||
this.$auth.logout() |
this.$auth.logout() |
||||||
} |
} |
||||||
}) |
}) |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
.page { |
.page { |
||||||
|
|
||||||
|
|
||||||
.top{ |
.top{ |
||||||
background: linear-gradient(180deg, #317AFF 0%, #ACD1FF 100%); |
background: linear-gradient(180deg, #317AFF 0%, #ACD1FF 100%); |
||||||
height: 300rpx; |
height: 300rpx; |
||||||
padding: 20rpx 40rpx; |
padding: 20rpx 40rpx; |
||||||
.box{ |
.box{ |
||||||
display: flex; |
display: flex; |
||||||
.portrait{ |
.portrait{ |
||||||
width: 150rpx; |
width: 150rpx; |
||||||
height: 150rpx; |
height: 150rpx; |
||||||
border-radius: 150rpx; |
border-radius: 150rpx; |
||||||
border: 6rpx solid #fff; |
border: 6rpx solid #fff; |
||||||
img{ |
img{ |
||||||
width: 100%; |
width: 100%; |
||||||
height: 100%; |
height: 100%; |
||||||
border-radius: 150rpx; |
border-radius: 150rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
.information{ |
.information{ |
||||||
color: #fff; |
color: #fff; |
||||||
margin: 30rpx 20rpx; |
margin: 30rpx 20rpx; |
||||||
font-size: 36rpx; |
font-size: 36rpx; |
||||||
.name{ |
.name{ |
||||||
margin-bottom: 20rpx; |
margin-bottom: 20rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
.items{ |
.items{ |
||||||
width: 100%; |
width: 100%; |
||||||
// margin-top: -40rpx; |
// margin-top: -40rpx; |
||||||
|
|
||||||
.item{ |
.item{ |
||||||
margin-top: 20rpx; |
margin-top: 20rpx; |
||||||
display: flex; |
display: flex; |
||||||
background-color: #fff; |
background-color: #fff; |
||||||
// width: 90%; |
// width: 90%; |
||||||
margin: 0 auto; |
margin: 0 auto; |
||||||
height: 80rpx; |
height: 80rpx; |
||||||
line-height: 80rpx; |
line-height: 80rpx; |
||||||
// border-radius: 10rpx; |
// border-radius: 10rpx; |
||||||
padding-left: 20rpx; |
padding-left: 20rpx; |
||||||
border-bottom: 2rpx solid #E4E7EC; |
border-bottom: 2rpx solid #E4E7EC; |
||||||
.text{ |
.text{ |
||||||
width: 180rpx; |
width: 180rpx; |
||||||
} |
} |
||||||
.input{ |
.input{ |
||||||
margin-left: 20rpx; |
margin-left: 20rpx; |
||||||
flex: 1; |
flex: 1; |
||||||
height: 100%; |
height: 100%; |
||||||
input{ |
input{ |
||||||
margin-top: 20rpx; |
margin-top: 20rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
.button{ |
.button{ |
||||||
margin-top: 80rpx; |
margin-top: 80rpx; |
||||||
button { |
button { |
||||||
width: 100%; |
width: 100%; |
||||||
// height: 140rpx; |
// height: 140rpx; |
||||||
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%); |
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%); |
||||||
color: #fff; |
color: #fff; |
||||||
border-radius: 120rpx; |
border-radius: 120rpx; |
||||||
background: #4963F4; |
background: #4963F4; |
||||||
box-shadow: 2px 6px 8px 1px rgba(73, 99, 244, 0.8); |
box-shadow: 2px 6px 8px 1px rgba(73, 99, 244, 0.8); |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
</style> |
</style> |
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,215 +1,215 @@ |
|||||||
<template> |
<template> |
||||||
<view class="page"> |
<view class="page"> |
||||||
<view class="top"> |
<view class="top"> |
||||||
<img src="@/static/login/banner.jpg" alt=""> |
<img src="@/static/login/banner.jpg" alt=""> |
||||||
<view class="tops"> |
<view class="tops"> |
||||||
|
|
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
<view class="items"> |
<view class="items"> |
||||||
<view class="title"> |
<view class="title"> |
||||||
<img mode="widthFix" src="@/static/login/title.png" alt=""> |
<img mode="widthFix" src="@/static/login/title.png" alt=""> |
||||||
<view class="text"> |
<view class="text"> |
||||||
欢迎登录防消一体化综合治理平台 |
欢迎登录防消一体化综合治理平台 |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
<view class="item username"> |
<view class="item username"> |
||||||
<view class="label"> |
<view class="label"> |
||||||
账号 |
账号 |
||||||
</view> |
</view> |
||||||
<view class="input"> |
<view class="input"> |
||||||
<input v-model="form.name" type="text" placeholder="请输入账号"> |
<input v-model="form.name" type="text" placeholder="请输入账号"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
<view class="item password"> |
<view class="item password"> |
||||||
<view class="label"> |
<view class="label"> |
||||||
密码 |
密码 |
||||||
</view> |
</view> |
||||||
<view class="input"> |
<view class="input"> |
||||||
<input v-model="form.password" type="password" placeholder="请输入密码"> |
<input v-model="form.password" type="password" placeholder="请输入密码"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<!-- <view class="item"> |
<!-- <view class="item"> |
||||||
<label> |
<label> |
||||||
<checkbox :value="form.auto" /><text>自动登录</text> |
<checkbox :value="form.auto" /><text>自动登录</text> |
||||||
</label> |
</label> |
||||||
</view> --> |
</view> --> |
||||||
<view class="button"> |
<view class="button"> |
||||||
<button type="default" @tap="getUserInfo()">登录</button> |
<button type="default" @tap="getUserInfo()">登录</button> |
||||||
<!-- <button @tap="getToken()">登录</button> --> |
<!-- <button @tap="getToken()">登录</button> --> |
||||||
</view> |
</view> |
||||||
|
|
||||||
|
|
||||||
</view> |
</view> |
||||||
<view class="bottom"> |
<view class="bottom"> |
||||||
<image src="../../static/login/bottom.png" mode=""></image> |
<image src="../../static/login/bottom.png" mode=""></image> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import store from '@/store.js' |
import store from '@/store.js' |
||||||
export default { |
export default { |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
title: 'Hello', |
title: 'Hello', |
||||||
|
|
||||||
form: { |
form: { |
||||||
name: "", |
name: "", |
||||||
password: "", |
password: "", |
||||||
auto: false, |
auto: false, |
||||||
} |
} |
||||||
} |
} |
||||||
}, |
}, |
||||||
onLoad() { |
onLoad() { |
||||||
if (store.state.token) { |
if (store.state.token) { |
||||||
console.log(store.state.token); |
console.log(store.state.token); |
||||||
uni.reLaunch({ |
uni.reLaunch({ |
||||||
url: "/pages/tabbar/index", |
url: "/pages/tabbar/index", |
||||||
success: res => {}, |
success: res => {}, |
||||||
fail: () => {}, |
fail: () => {}, |
||||||
complete: () => {}, |
complete: () => {}, |
||||||
}) |
}) |
||||||
} |
} |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
getUserInfo() { |
getUserInfo() { |
||||||
let body = {} |
let body = {} |
||||||
if (!this.form.name) { |
if (!this.form.name) { |
||||||
return this.$alert.showError("请输入用户账号") |
return this.$alert.showError("请输入用户账号") |
||||||
} |
} |
||||||
if (!this.form.password) { |
if (!this.form.password) { |
||||||
return this.$alert.showError("请输入密码") |
return this.$alert.showError("请输入密码") |
||||||
} |
} |
||||||
this.$auth.login(this.form) |
this.$auth.login(this.form) |
||||||
return |
return |
||||||
}, |
}, |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
.page { |
.page { |
||||||
overflow: hidden; |
overflow: hidden; |
||||||
background-color: #FAFBFF; |
background-color: #FAFBFF; |
||||||
color: #808080; |
color: #808080; |
||||||
display: flex; |
display: flex; |
||||||
flex-direction: column; |
flex-direction: column; |
||||||
position: relative; |
position: relative; |
||||||
} |
} |
||||||
|
|
||||||
.top { |
.top { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 200rpx; |
height: 200rpx; |
||||||
position: relative; |
position: relative; |
||||||
|
|
||||||
img { |
img { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 200rpx; |
height: 200rpx; |
||||||
} |
} |
||||||
|
|
||||||
.tops { |
.tops { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 40rpx; |
height: 40rpx; |
||||||
border-radius: 20rpx 20rpx 0 0; |
border-radius: 20rpx 20rpx 0 0; |
||||||
position: absolute; |
position: absolute; |
||||||
z-index: 10; |
z-index: 10; |
||||||
background-color: #FAFBFF; |
background-color: #FAFBFF; |
||||||
bottom: 0rpx; |
bottom: 0rpx; |
||||||
left: 0; |
left: 0; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.items { |
.items { |
||||||
flex: 1; |
flex: 1; |
||||||
display: flex; |
display: flex; |
||||||
flex-direction: column; |
flex-direction: column; |
||||||
align-items: center; |
align-items: center; |
||||||
z-index: 999; |
z-index: 999; |
||||||
|
|
||||||
.title { |
.title { |
||||||
display: flex; |
display: flex; |
||||||
flex-direction: column; |
flex-direction: column; |
||||||
align-items: center; |
align-items: center; |
||||||
justify-content: center; |
justify-content: center; |
||||||
margin-top: 58rpx; |
margin-top: 58rpx; |
||||||
|
|
||||||
.text { |
.text { |
||||||
margin-top: 20rpx; |
margin-top: 20rpx; |
||||||
font-size: 26rpx; |
font-size: 26rpx; |
||||||
text-align: center; |
text-align: center; |
||||||
color: #939393; |
color: #939393; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.item { |
.item { |
||||||
width: 80%; |
width: 80%; |
||||||
|
|
||||||
.label { |
.label { |
||||||
font-size: 32rpx; |
font-size: 32rpx; |
||||||
margin: 26rpx 0; |
margin: 26rpx 0; |
||||||
} |
} |
||||||
|
|
||||||
label { |
label { |
||||||
color: #4963F4; |
color: #4963F4; |
||||||
|
|
||||||
checkbox { |
checkbox { |
||||||
border: #4963F4; |
border: #4963F4; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
input { |
input { |
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
padding: 0 16rpx; |
padding: 0 16rpx; |
||||||
height: 80rpx; |
height: 80rpx; |
||||||
background: #ECF2FF; |
background: #ECF2FF; |
||||||
border-radius: 3px; |
border-radius: 3px; |
||||||
font-size: 26rpx; |
font-size: 26rpx; |
||||||
|
|
||||||
input { |
input { |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
.username { |
.username { |
||||||
margin-top: 58rpx; |
margin-top: 58rpx; |
||||||
} |
} |
||||||
|
|
||||||
.password { |
.password { |
||||||
margin-bottom: 76rpx; |
margin-bottom: 76rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
.button { |
.button { |
||||||
width: 100%; |
width: 100%; |
||||||
button[type="default"] { |
button[type="default"] { |
||||||
margin: 0 auto; |
margin: 0 auto; |
||||||
width: 80%; |
width: 80%; |
||||||
color: #fff; |
color: #fff; |
||||||
border-radius: 100rpx; |
border-radius: 100rpx; |
||||||
background: #4963F4; |
background: #4963F4; |
||||||
box-shadow: 2px rgba(73, 99, 244, 0.8); |
box-shadow: 2px rgba(73, 99, 244, 0.8); |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
.bottom { |
.bottom { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 200rpx; |
height: 200rpx; |
||||||
|
|
||||||
image { |
image { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,160 +1,160 @@ |
|||||||
<template> |
<template> |
||||||
<view class="page"> |
<view class="page"> |
||||||
<view class="top"> |
<view class="top"> |
||||||
<img src="@/static/login/banner.jpg" alt=""> |
<img src="@/static/login/banner.jpg" alt=""> |
||||||
<view class="tops"> |
<view class="tops"> |
||||||
|
|
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
<view class="items"> |
<view class="items"> |
||||||
<view class="title"> |
<view class="title"> |
||||||
<img mode="widthFix" src="@/static/login/title.png" alt=""> |
<img mode="widthFix" src="@/static/login/title.png" alt=""> |
||||||
<view class="text"> |
<view class="text"> |
||||||
欢迎登录防消一体化综合治理平台 |
欢迎登录防消一体化综合治理平台 |
||||||
</view> |
</view> |
||||||
|
|
||||||
</view> |
</view> |
||||||
<view class=""> |
<view class=""> |
||||||
请选择登陆方式 |
请选择登陆方式 |
||||||
</view> |
</view> |
||||||
<view class="button"> |
<view class="button"> |
||||||
<button @tap="getUserInfo()">账号密码登录</button> |
<button @tap="getUserInfo()">账号密码登录</button> |
||||||
<button @tap="getToken()">微信登录</button> |
<button @tap="getToken()">微信登录</button> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import store from '@/store.js' |
import store from '@/store.js' |
||||||
export default { |
export default { |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
title: 'Hello', |
title: 'Hello', |
||||||
|
|
||||||
form: { |
form: { |
||||||
name: "", |
name: "", |
||||||
password: "", |
password: "", |
||||||
auto: false, |
auto: false, |
||||||
} |
} |
||||||
} |
} |
||||||
}, |
}, |
||||||
onLoad() { |
onLoad() { |
||||||
if (store.state.token) { |
if (store.state.token) { |
||||||
console.log(store.state.token); |
console.log(store.state.token); |
||||||
uni.reLaunch({ |
uni.reLaunch({ |
||||||
url: "/pages/index/index", |
url: "/pages/index/index", |
||||||
success: res => {}, |
success: res => {}, |
||||||
fail: () => {}, |
fail: () => {}, |
||||||
complete: () => {}, |
complete: () => {}, |
||||||
}) |
}) |
||||||
} |
} |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
getUserInfo() { |
getUserInfo() { |
||||||
|
|
||||||
|
|
||||||
}, |
}, |
||||||
getToken() { |
getToken() { |
||||||
this.$auth.getUserProfile() |
this.$auth.getUserProfile() |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
.page { |
.page { |
||||||
background-color: #FAFBFF; |
background-color: #FAFBFF; |
||||||
color: #808080; |
color: #808080; |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
.top { |
.top { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 200rpx; |
height: 200rpx; |
||||||
position: absolute; |
position: absolute; |
||||||
|
|
||||||
img { |
img { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 200rpx; |
height: 200rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
.tops { |
.tops { |
||||||
height: 40rpx; |
height: 40rpx; |
||||||
border-radius: 20rpx 20rpx 0 0; |
border-radius: 20rpx 20rpx 0 0; |
||||||
position: relative; |
position: relative; |
||||||
z-index: 10; |
z-index: 10; |
||||||
background-color: #FAFBFF; |
background-color: #FAFBFF; |
||||||
bottom: 30rpx; |
bottom: 30rpx; |
||||||
left: 0; |
left: 0; |
||||||
} |
} |
||||||
|
|
||||||
.items { |
.items { |
||||||
// width: 100%; |
// width: 100%; |
||||||
margin: 0 60rpx; |
margin: 0 60rpx; |
||||||
|
|
||||||
.title { |
.title { |
||||||
/* width: 748rpx; */ |
/* width: 748rpx; */ |
||||||
// height: 68rpx; |
// height: 68rpx; |
||||||
// line-height: 68rpx; |
// line-height: 68rpx; |
||||||
// font-size: 50rpx; |
// font-size: 50rpx; |
||||||
// font-weight: 500; |
// font-weight: 500; |
||||||
// color: #317AFF; |
// color: #317AFF; |
||||||
margin: 240rpx 0 60rpx 0; |
margin: 240rpx 0 60rpx 0; |
||||||
|
|
||||||
.text { |
.text { |
||||||
margin-top: 20rpx; |
margin-top: 20rpx; |
||||||
font-size: 30rpx; |
font-size: 30rpx; |
||||||
text-align: center; |
text-align: center; |
||||||
color: #939393; |
color: #939393; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
button { |
button { |
||||||
width: 100%; |
width: 100%; |
||||||
// height: 140rpx; |
// height: 140rpx; |
||||||
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%); |
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%); |
||||||
color: #fff; |
color: #fff; |
||||||
margin: 20rpx 0; |
margin: 20rpx 0; |
||||||
border-radius: 120rpx; |
border-radius: 120rpx; |
||||||
background: #4963F4; |
background: #4963F4; |
||||||
box-shadow: 2px 6px 8px 1px rgba(73, 99, 244, 0.8); |
box-shadow: 2px 6px 8px 1px rgba(73, 99, 244, 0.8); |
||||||
} |
} |
||||||
|
|
||||||
.item { |
.item { |
||||||
margin: 60rpx 0; |
margin: 60rpx 0; |
||||||
|
|
||||||
.label { |
.label { |
||||||
font-size: 32rpx; |
font-size: 32rpx; |
||||||
// color: rgba(16, 15, 25, 0.48); |
// color: rgba(16, 15, 25, 0.48); |
||||||
margin-bottom: 30rpx; |
margin-bottom: 30rpx; |
||||||
} |
} |
||||||
|
|
||||||
label { |
label { |
||||||
color: #4963F4; |
color: #4963F4; |
||||||
|
|
||||||
checkbox { |
checkbox { |
||||||
border: #4963F4; |
border: #4963F4; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
.input { |
.input { |
||||||
// border-bottom: 2rpx solid rgba(16, 15, 25, 0.16); |
// border-bottom: 2rpx solid rgba(16, 15, 25, 0.16); |
||||||
height: 80rpx; |
height: 80rpx; |
||||||
background: #ECF2FF; |
background: #ECF2FF; |
||||||
|
|
||||||
input { |
input { |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,297 +1,297 @@ |
|||||||
<template> |
<template> |
||||||
<view class="page"> |
<view class="page"> |
||||||
<view class="form"> |
<view class="form"> |
||||||
<view class="itembox"> |
<view class="itembox"> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
单位名称 |
单位名称 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
{{list.companyName||""}} |
{{list.companyName||""}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
单位管理人 |
单位管理人 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
{{list.directorName||""}} |
{{list.directorName||""}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
联系方式 |
联系方式 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
{{list.directorPhone||""}} |
{{list.directorPhone||""}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
单位地址 |
单位地址 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
{{list.address||""}} |
{{list.address||""}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
建筑结构 |
建筑结构 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
{{datas.basicInfo.structure}} |
{{datas.basicInfo.structure}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
建筑高度 |
建筑高度 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
{{datas.basicInfo.height}} |
{{datas.basicInfo.height}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
建筑层数 |
建筑层数 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
{{datas.basicInfo.layer}} |
{{datas.basicInfo.layer}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="itembox"> |
<view class="itembox"> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
控制室位置 |
控制室位置 |
||||||
</view> |
</view> |
||||||
<view class="right_inp"> |
<view class="right_inp"> |
||||||
<input type="text" placeholder="输入多个请用“,”隔开" v-model="datas.facilities.controlPosition"> |
<input type="text" placeholder="输入多个请用“,”隔开" v-model="datas.facilities.controlPosition"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
安全重点部位 |
安全重点部位 |
||||||
</view> |
</view> |
||||||
<view class="right_inp"> |
<view class="right_inp"> |
||||||
<input type="text" placeholder="输入安全重点部位" v-model="datas.KeyParts[0].useNature"> |
<input type="text" placeholder="输入安全重点部位" v-model="datas.KeyParts[0].useNature"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
单位性质 |
单位性质 |
||||||
</view> |
</view> |
||||||
<view class="right_inp"> |
<view class="right_inp"> |
||||||
<picker :range="danwei" @change="danweif($event)"> |
<picker :range="danwei" @change="danweif($event)"> |
||||||
<view>{{datas.basicInfo.nature||"请选择"}}</view> |
<view>{{datas.basicInfo.nature||"请选择"}}</view> |
||||||
</picker> |
</picker> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
消防设施及器材 |
消防设施及器材 |
||||||
</view> |
</view> |
||||||
<view class="right_inp"> |
<view class="right_inp"> |
||||||
<input type="text" placeholder="(个)" v-model="datas.facilities.fireFightingFacilities"> |
<input type="text" placeholder="(个)" v-model="datas.facilities.fireFightingFacilities"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<!-- <view class="item"> |
<!-- <view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
单位主要消防设施 |
单位主要消防设施 |
||||||
</view> |
</view> |
||||||
<view class="right_inp"> |
<view class="right_inp"> |
||||||
<input type="text" placeholder="输入多个请用“,”隔开"> |
<input type="text" placeholder="输入多个请用“,”隔开"> |
||||||
</view> |
</view> |
||||||
</view> --> |
</view> --> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="button"> |
<view class="button"> |
||||||
<button @tap="bbb()">确定</button> |
<button @tap="bbb()">确定</button> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
export default { |
export default { |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
id:"", |
id:"", |
||||||
list:{}, |
list:{}, |
||||||
danwei:["一般单位",'重点单位'], |
danwei:["一般单位",'重点单位'], |
||||||
datas: { |
datas: { |
||||||
basicInfo: { |
basicInfo: { |
||||||
name: "", |
name: "", |
||||||
addr: "", |
addr: "", |
||||||
phone: "", |
phone: "", |
||||||
total: "", |
total: "", |
||||||
height: "", |
height: "", |
||||||
layer: "", |
layer: "", |
||||||
structure: "", |
structure: "", |
||||||
coveredArea: "", |
coveredArea: "", |
||||||
builtUpArea: "", |
builtUpArea: "", |
||||||
nature: "", |
nature: "", |
||||||
east: "", |
east: "", |
||||||
south: "", |
south: "", |
||||||
west: "", |
west: "", |
||||||
north: "", |
north: "", |
||||||
routeAndTime: "", |
routeAndTime: "", |
||||||
positionCoordinates: { x: 0, y: 0 } |
positionCoordinates: { x: 0, y: 0 } |
||||||
}, |
}, |
||||||
facilities: { |
facilities: { |
||||||
controlPosition: "", |
controlPosition: "", |
||||||
poolNumbe: "", |
poolNumbe: "", |
||||||
poolPosition: "", |
poolPosition: "", |
||||||
poolCapacity: "", |
poolCapacity: "", |
||||||
supplyMode: "", |
supplyMode: "", |
||||||
waterSources: "", |
waterSources: "", |
||||||
waterSourcesPosition: "", |
waterSourcesPosition: "", |
||||||
system: { |
system: { |
||||||
alarm: false, |
alarm: false, |
||||||
spray: false, |
spray: false, |
||||||
broadcast: false, |
broadcast: false, |
||||||
smoke: false, |
smoke: false, |
||||||
}, |
}, |
||||||
hydrantsNumber: "", |
hydrantsNumber: "", |
||||||
hydrantsPosition: "", |
hydrantsPosition: "", |
||||||
pumpNumber: "", |
pumpNumber: "", |
||||||
pumpRange: "", |
pumpRange: "", |
||||||
pumpFlow: "", |
pumpFlow: "", |
||||||
pumpAdapter: "", |
pumpAdapter: "", |
||||||
SprayPumpNumber: "", |
SprayPumpNumber: "", |
||||||
SprayPumpRange: "", |
SprayPumpRange: "", |
||||||
SprayPumpFlow: "", |
SprayPumpFlow: "", |
||||||
SprayPumpAdapter: "", |
SprayPumpAdapter: "", |
||||||
elevator: "", |
elevator: "", |
||||||
stairs: "", |
stairs: "", |
||||||
Export: "", |
Export: "", |
||||||
indoorHydrant: "", |
indoorHydrant: "", |
||||||
standardIndoorHydrant: "", |
standardIndoorHydrant: "", |
||||||
fireFightingFacilities:"" |
fireFightingFacilities:"" |
||||||
}, |
}, |
||||||
KeyParts: [ |
KeyParts: [ |
||||||
{ |
{ |
||||||
keyparts: "", |
keyparts: "", |
||||||
keypartsposition: "", |
keypartsposition: "", |
||||||
buildingstructure: "", |
buildingstructure: "", |
||||||
useNature: "", |
useNature: "", |
||||||
danger: "" |
danger: "" |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
keyparts: "", |
keyparts: "", |
||||||
keypartsposition: "", |
keypartsposition: "", |
||||||
buildingstructure: "", |
buildingstructure: "", |
||||||
useNature: "", |
useNature: "", |
||||||
danger: "" |
danger: "" |
||||||
} |
} |
||||||
], |
], |
||||||
datasIndex:0, |
datasIndex:0, |
||||||
tips: "", |
tips: "", |
||||||
uid:"" |
uid:"" |
||||||
} |
} |
||||||
} |
} |
||||||
}, |
}, |
||||||
onLoad(e) { |
onLoad(e) { |
||||||
console.log(e); |
console.log(e); |
||||||
this.id=e.id |
this.id=e.id |
||||||
this.uid=e.user |
this.uid=e.user |
||||||
|
|
||||||
this.getCompanies() |
this.getCompanies() |
||||||
}, |
}, |
||||||
onReady() { |
onReady() { |
||||||
|
|
||||||
|
|
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
getCompanies(){ |
getCompanies(){ |
||||||
this.$request.get("/api/Companies/"+this.id,{},(data,res)=>{ |
this.$request.get("/api/Companies/"+this.id,{},(data,res)=>{ |
||||||
console.log(res); |
console.log(res); |
||||||
this.list=res |
this.list=res |
||||||
if(this.list.data){ |
if(this.list.data){ |
||||||
this.datas=JSON.parse(this.list.data) |
this.datas=JSON.parse(this.list.data) |
||||||
if(this.datas.basicInfo.nature=="重点单位"){ |
if(this.datas.basicInfo.nature=="重点单位"){ |
||||||
this.datasIndex=1 |
this.datasIndex=1 |
||||||
} |
} |
||||||
} |
} |
||||||
}) |
}) |
||||||
}, |
}, |
||||||
|
|
||||||
bbb(){ |
bbb(){ |
||||||
// let params={ |
// let params={ |
||||||
// approvalStatus:'已检查', |
// approvalStatus:'已检查', |
||||||
// inspectionResult:'未发现违法违规情况' |
// inspectionResult:'未发现违法违规情况' |
||||||
// } |
// } |
||||||
// this.$request.patch('/api/PlanTasks/' + this.uid, params, (data, res) => { |
// this.$request.patch('/api/PlanTasks/' + this.uid, params, (data, res) => { |
||||||
// console.log(res); |
// console.log(res); |
||||||
// }) |
// }) |
||||||
// uni.redirectTo({ |
// uni.redirectTo({ |
||||||
// url:"/pages/rescue/task_implement/implement?id="+ |
// url:"/pages/rescue/task_implement/implement?id="+ |
||||||
// }) |
// }) |
||||||
}, |
}, |
||||||
danweif(e){ |
danweif(e){ |
||||||
console.log(e); |
console.log(e); |
||||||
this.datas.basicInfo.nature=this.danwei[e.detail.value] |
this.datas.basicInfo.nature=this.danwei[e.detail.value] |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
|
|
||||||
.button{ |
.button{ |
||||||
margin: 0 auto; |
margin: 0 auto; |
||||||
margin-top: 40rpx; |
margin-top: 40rpx; |
||||||
width: 100%; |
width: 100%; |
||||||
|
|
||||||
button { |
button { |
||||||
width: 200rpx; |
width: 200rpx; |
||||||
// height: 140rpx; |
// height: 140rpx; |
||||||
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%); |
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%); |
||||||
color: #fff; |
color: #fff; |
||||||
background: #317AFF; |
background: #317AFF; |
||||||
border-radius: 20rpx; |
border-radius: 20rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
.form{ |
.form{ |
||||||
|
|
||||||
.itembox{ |
.itembox{ |
||||||
margin-top: 20rpx; |
margin-top: 20rpx; |
||||||
background: #fff; |
background: #fff; |
||||||
.item{ |
.item{ |
||||||
display: flex; |
display: flex; |
||||||
height: 100rpx; |
height: 100rpx; |
||||||
border-top: 2rpx solid #E4E7EC; |
border-top: 2rpx solid #E4E7EC; |
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
margin: 0 20rpx; |
margin: 0 20rpx; |
||||||
font-size: 32rpx; |
font-size: 32rpx; |
||||||
.left{ |
.left{ |
||||||
color: #8D8C8F; |
color: #8D8C8F; |
||||||
line-height: 100rpx; |
line-height: 100rpx; |
||||||
} |
} |
||||||
.right{ |
.right{ |
||||||
flex: 1; |
flex: 1; |
||||||
color: #100F19; |
color: #100F19; |
||||||
text-align: right; |
text-align: right; |
||||||
line-height: 100rpx; |
line-height: 100rpx; |
||||||
|
|
||||||
} |
} |
||||||
.right_inp{ |
.right_inp{ |
||||||
flex: 1; |
flex: 1; |
||||||
color: #100F19; |
color: #100F19; |
||||||
text-align: right; |
text-align: right; |
||||||
margin-top: 26rpx; |
margin-top: 26rpx; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
.item:nth-child(1){ |
.item:nth-child(1){ |
||||||
display: flex; |
display: flex; |
||||||
height: 100rpx; |
height: 100rpx; |
||||||
|
|
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
margin: 0 20rpx; |
margin: 0 20rpx; |
||||||
font-size: 32rpx; |
font-size: 32rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,352 +1,352 @@ |
|||||||
<template> |
<template> |
||||||
<view class="page"> |
<view class="page"> |
||||||
<view class="top"> |
<view class="top"> |
||||||
<view class="img" v-if="!age.imgShow"> |
<view class="img" v-if="!age.imgShow"> |
||||||
<img src="@/static/091212.jpg" @click="chooseImage" alt="" > |
<img src="@/static/091212.jpg" @click="chooseImage" alt="" > |
||||||
</view> |
</view> |
||||||
<img v-else :src="age.imgShow" alt="" @click="chooseImage"> |
<img v-else :src="age.imgShow" alt="" @click="chooseImage"> |
||||||
</view> |
</view> |
||||||
<view class="form"> |
<view class="form"> |
||||||
<view class="itembox"> |
<view class="itembox"> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
位置 |
位置 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
<input type="text" v-model="form.position" placeholder="请输入位置"> |
<input type="text" v-model="form.position" placeholder="请输入位置"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="itembox"> |
<view class="itembox"> |
||||||
|
|
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
姓名 |
姓名 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
<input type="text" v-model="form.name" placeholder="请输入姓名"> |
<input type="text" v-model="form.name" placeholder="请输入姓名"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
职务 |
职务 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
<input type="text" v-model="form.post" placeholder="请输入职务"> |
<input type="text" v-model="form.post" placeholder="请输入职务"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
备注 |
备注 |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
<input type="text" v-model="form.remarks" placeholder="若非指导员请说明原因"> |
<input type="text" v-model="form.remarks" placeholder="若非指导员请说明原因"> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
</view> |
</view> |
||||||
<view class="itembox"> |
<view class="itembox"> |
||||||
|
|
||||||
<view class="item" v-for="(item,k) in form.form" :key="k"> |
<view class="item" v-for="(item,k) in form.form" :key="k"> |
||||||
<view class="left"> |
<view class="left"> |
||||||
{{item.name}} |
{{item.name}} |
||||||
</view> |
</view> |
||||||
<view class="right"> |
<view class="right"> |
||||||
<view v-if="item.index" class=""> |
<view v-if="item.index" class=""> |
||||||
已完成 |
已完成 |
||||||
</view> |
</view> |
||||||
<view v-else class=""> |
<view v-else class=""> |
||||||
未完成 |
未完成 |
||||||
</view> |
</view> |
||||||
<img src="@/static/arrow.png" alt=""> |
<img src="@/static/arrow.png" alt=""> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
|
|
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="button"> |
<view class="button"> |
||||||
<button @tap="bbb()">确定</button> |
<button @tap="bbb()">确定</button> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
export default { |
export default { |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
id:"", |
id:"", |
||||||
form:{ |
form:{ |
||||||
position:"", |
position:"", |
||||||
name:"", |
name:"", |
||||||
post:"", |
post:"", |
||||||
remarks:"", |
remarks:"", |
||||||
form:[ |
form:[ |
||||||
{ |
{ |
||||||
name:"消防控制室", |
name:"消防控制室", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"消防电梯", |
name:"消防电梯", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"实战演练", |
name:"实战演练", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"安全出口", |
name:"安全出口", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"应急照明", |
name:"应急照明", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"消防疏散指示标志", |
name:"消防疏散指示标志", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"火灾自动报警系统", |
name:"火灾自动报警系统", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"消防水池", |
name:"消防水池", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"消防水箱", |
name:"消防水箱", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"消防水泵房", |
name:"消防水泵房", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"室内消火栓", |
name:"室内消火栓", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"室外消火栓", |
name:"室外消火栓", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"末端试水装置", |
name:"末端试水装置", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"防火门", |
name:"防火门", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"防火卷帘", |
name:"防火卷帘", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"防排烟设施", |
name:"防排烟设施", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"灭火器", |
name:"灭火器", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"通信测试情况", |
name:"通信测试情况", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"消防车辆作业面", |
name:"消防车辆作业面", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"微型消防站", |
name:"微型消防站", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"水泵接合器", |
name:"水泵接合器", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"高层建筑管道井", |
name:"高层建筑管道井", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"数字化预案", |
name:"数字化预案", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"消防安全管理", |
name:"消防安全管理", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
{ |
{ |
||||||
name:"其他项", |
name:"其他项", |
||||||
index:false, |
index:false, |
||||||
data:{} |
data:{} |
||||||
}, |
}, |
||||||
] |
] |
||||||
}, |
}, |
||||||
age: { |
age: { |
||||||
imgShow: '', |
imgShow: '', |
||||||
text: '', |
text: '', |
||||||
}, |
}, |
||||||
|
|
||||||
} |
} |
||||||
}, |
}, |
||||||
onLoad(e) { |
onLoad(e) { |
||||||
console.log(e); |
console.log(e); |
||||||
this.id=e.id |
this.id=e.id |
||||||
this.uid=e.uid |
this.uid=e.uid |
||||||
console.log(uni.getStorageSync("user")); |
console.log(uni.getStorageSync("user")); |
||||||
// this.getCompanies() |
// this.getCompanies() |
||||||
}, |
}, |
||||||
onReady() { |
onReady() { |
||||||
|
|
||||||
|
|
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
getCompanies(){ |
getCompanies(){ |
||||||
this.$request.get("/api/Companies/"+this.id,{},(data,res)=>{ |
this.$request.get("/api/Companies/"+this.id,{},(data,res)=>{ |
||||||
console.log(res); |
console.log(res); |
||||||
this.list=res |
this.list=res |
||||||
if(this.list.data){ |
if(this.list.data){ |
||||||
this.datas=JSON.parse(this.list.data) |
this.datas=JSON.parse(this.list.data) |
||||||
if(this.datas.basicInfo.nature=="重点单位"){ |
if(this.datas.basicInfo.nature=="重点单位"){ |
||||||
this.datasIndex=1 |
this.datasIndex=1 |
||||||
} |
} |
||||||
} |
} |
||||||
}) |
}) |
||||||
}, |
}, |
||||||
chooseImage() { |
chooseImage() { |
||||||
var _this = this |
var _this = this |
||||||
uni.chooseImage({ |
uni.chooseImage({ |
||||||
count: 1, //默认9 |
count: 1, //默认9 |
||||||
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
||||||
sourceType: ['album', 'camera'], //从相册选择、摄像头 |
sourceType: ['album', 'camera'], //从相册选择、摄像头 |
||||||
success: function(res) { |
success: function(res) { |
||||||
_this.age.imgShow = res.tempFilePaths[0] |
_this.age.imgShow = res.tempFilePaths[0] |
||||||
} |
} |
||||||
}); |
}); |
||||||
// ass() |
// ass() |
||||||
}, |
}, |
||||||
bbb(){ |
bbb(){ |
||||||
uni.navigateTo({ |
uni.navigateTo({ |
||||||
url:"/pages/demo/demo" |
url:"/pages/demo/demo" |
||||||
}) |
}) |
||||||
// let params={ |
// let params={ |
||||||
// approvalStatus:'已检查', |
// approvalStatus:'已检查', |
||||||
// inspectionResult:'未发现违法违规情况' |
// inspectionResult:'未发现违法违规情况' |
||||||
// } |
// } |
||||||
// this.$request.patch('/api/PlanTasks/' + this.uid, params, (data, res) => { |
// this.$request.patch('/api/PlanTasks/' + this.uid, params, (data, res) => { |
||||||
// console.log(res); |
// console.log(res); |
||||||
// }) |
// }) |
||||||
}, |
}, |
||||||
danweif(e){ |
danweif(e){ |
||||||
console.log(e); |
console.log(e); |
||||||
this.datas.basicInfo.nature=this.danwei[e.detail.value] |
this.datas.basicInfo.nature=this.danwei[e.detail.value] |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
|
|
||||||
.button{ |
.button{ |
||||||
margin-top: 40rpx; |
margin-top: 40rpx; |
||||||
button { |
button { |
||||||
width: 200rpx; |
width: 200rpx; |
||||||
// height: 140rpx; |
// height: 140rpx; |
||||||
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%); |
// background: linear-gradient(180deg, #317AFF 0%, #0052E6 100%); |
||||||
color: #fff; |
color: #fff; |
||||||
background: #317AFF; |
background: #317AFF; |
||||||
border-radius: 20rpx; |
border-radius: 20rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
.top{ |
.top{ |
||||||
display: flex; |
display: flex; |
||||||
justify-content: center; |
justify-content: center; |
||||||
align-items: center; |
align-items: center; |
||||||
.img{ |
.img{ |
||||||
margin-top: 20rpx; |
margin-top: 20rpx; |
||||||
width: 320rpx; |
width: 320rpx; |
||||||
height: 320rpx; |
height: 320rpx; |
||||||
|
|
||||||
img{ |
img{ |
||||||
width: 100%; |
width: 100%; |
||||||
height: 100%; |
height: 100%; |
||||||
border-radius: 40rpx; |
border-radius: 40rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
.form{ |
.form{ |
||||||
|
|
||||||
.itembox{ |
.itembox{ |
||||||
margin-top: 20rpx; |
margin-top: 20rpx; |
||||||
background: #fff; |
background: #fff; |
||||||
.item{ |
.item{ |
||||||
display: flex; |
display: flex; |
||||||
height: 100rpx; |
height: 100rpx; |
||||||
border-top: 2rpx solid #E4E7EC; |
border-top: 2rpx solid #E4E7EC; |
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
margin: 0 20rpx; |
margin: 0 20rpx; |
||||||
font-size: 32rpx; |
font-size: 32rpx; |
||||||
.left{ |
.left{ |
||||||
color: #8D8C8F; |
color: #8D8C8F; |
||||||
line-height: 100rpx; |
line-height: 100rpx; |
||||||
} |
} |
||||||
.right{ |
.right{ |
||||||
flex: 1; |
flex: 1; |
||||||
color: #100F19; |
color: #100F19; |
||||||
text-align: right; |
text-align: right; |
||||||
line-height: 100rpx; |
line-height: 100rpx; |
||||||
display: flex; |
display: flex; |
||||||
img{ |
img{ |
||||||
width: 20rpx; |
width: 20rpx; |
||||||
height: 20rpx; |
height: 20rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
.right_inp{ |
.right_inp{ |
||||||
flex: 1; |
flex: 1; |
||||||
color: #100F19; |
color: #100F19; |
||||||
text-align: right; |
text-align: right; |
||||||
margin-top: 26rpx; |
margin-top: 26rpx; |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
.item:nth-child(1){ |
.item:nth-child(1){ |
||||||
display: flex; |
display: flex; |
||||||
height: 100rpx; |
height: 100rpx; |
||||||
|
|
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
margin: 0 20rpx; |
margin: 0 20rpx; |
||||||
font-size: 32rpx; |
font-size: 32rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,59 +1,59 @@ |
|||||||
<template> |
<template> |
||||||
<view class=""> |
<view class=""> |
||||||
<view class=""> |
<view class=""> |
||||||
<Dindex v-if="shenfen=='battalion'&&!isSupervisor"></Dindex> |
<Dindex v-if="shenfen=='battalion'&&!isSupervisor"></Dindex> |
||||||
</view> |
</view> |
||||||
<view class=""> |
<view class=""> |
||||||
<Zindex v-if="shenfen=='brigade'"></Zindex> |
<Zindex v-if="shenfen=='brigade'"></Zindex> |
||||||
</view> |
</view> |
||||||
<view class=""> |
<view class=""> |
||||||
<Jindex v-if="shenfen=='squadron'||isSupervisor"></Jindex> |
<Jindex v-if="shenfen=='squadron'||isSupervisor"></Jindex> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import Dindex from "@/pages/dadui/index/index.vue" |
import Dindex from "@/pages/dadui/index/index.vue" |
||||||
import Jindex from "@/pages/rescue/index.vue" |
import Jindex from "@/pages/rescue/index.vue" |
||||||
import Zindex from "@/pages/zhidui/index.vue" |
import Zindex from "@/pages/zhidui/index.vue" |
||||||
|
|
||||||
export default { |
export default { |
||||||
components: { |
components: { |
||||||
Dindex, |
Dindex, |
||||||
Jindex, |
Jindex, |
||||||
Zindex |
Zindex |
||||||
}, |
}, |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
shenfen: "", |
shenfen: "", |
||||||
isSupervisor: false |
isSupervisor: false |
||||||
} |
} |
||||||
}, |
}, |
||||||
onShow() { |
onShow() { |
||||||
this.shenfen= "" |
this.shenfen= "" |
||||||
this.$nextTick(()=>{ |
this.$nextTick(()=>{ |
||||||
let roles = uni.getStorageSync("user").roles |
let roles = uni.getStorageSync("user").roles |
||||||
let isSupervisor = roles.find(item => { |
let isSupervisor = roles.find(item => { |
||||||
return item.name.indexOf('检查') != -1 |
return item.name.indexOf('检查') != -1 |
||||||
}) |
}) |
||||||
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false |
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false |
||||||
this.shenfen = uni.getStorageSync("user").organizationLevel |
this.shenfen = uni.getStorageSync("user").organizationLevel |
||||||
console.log(1111111); |
console.log(1111111); |
||||||
}) |
}) |
||||||
|
|
||||||
}, |
}, |
||||||
onReady() { |
onReady() { |
||||||
|
|
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
|
|
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
|
|
||||||
</style> |
</style> |
||||||
|
@ -1,52 +1,52 @@ |
|||||||
<template> |
<template> |
||||||
<view class=""> |
<view class=""> |
||||||
<view class=""> |
<view class=""> |
||||||
<Dtask v-if="shenfen=='battalion'&&!isSupervisor"></Dtask> |
<Dtask v-if="shenfen=='battalion'&&!isSupervisor"></Dtask> |
||||||
</view> |
</view> |
||||||
<view class=""> |
<view class=""> |
||||||
<Ztask v-if="shenfen=='brigade'"></Ztask> |
<Ztask v-if="shenfen=='brigade'"></Ztask> |
||||||
</view> |
</view> |
||||||
<view class=""> |
<view class=""> |
||||||
<Jtask v-if="shenfen=='squadron'||isSupervisor"></Jtask> |
<Jtask v-if="shenfen=='squadron'||isSupervisor"></Jtask> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
|
|
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import Dtask from "@/pages/dadui/jiuyuan/jiuyuan.vue" |
import Dtask from "@/pages/dadui/jiuyuan/jiuyuan.vue" |
||||||
import Jtask from "@/pages/rescue/taskreceive.vue" |
import Jtask from "@/pages/rescue/taskreceive.vue" |
||||||
import Ztask from '@/pages/zhidui/ranks/ranks.vue' |
import Ztask from '@/pages/zhidui/ranks/ranks.vue' |
||||||
export default { |
export default { |
||||||
components: { |
components: { |
||||||
Dtask, |
Dtask, |
||||||
Jtask, |
Jtask, |
||||||
Ztask |
Ztask |
||||||
}, |
}, |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
shenfen: "", |
shenfen: "", |
||||||
isSupervisor: false |
isSupervisor: false |
||||||
} |
} |
||||||
}, |
}, |
||||||
onShow() { |
onShow() { |
||||||
console.log(555555); |
console.log(555555); |
||||||
let roles = uni.getStorageSync("user").roles |
let roles = uni.getStorageSync("user").roles |
||||||
let isSupervisor = roles.find(item => { |
let isSupervisor = roles.find(item => { |
||||||
return item.name.indexOf('检查') != -1 |
return item.name.indexOf('检查') != -1 |
||||||
}) |
}) |
||||||
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false |
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false |
||||||
this.shenfen = uni.getStorageSync("user").organizationLevel |
this.shenfen = uni.getStorageSync("user").organizationLevel |
||||||
|
|
||||||
}, |
}, |
||||||
onReady() { |
onReady() { |
||||||
|
|
||||||
}, |
}, |
||||||
methods: {} |
methods: {} |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
|
|
||||||
</style> |
</style> |
||||||
|
@ -1,50 +1,50 @@ |
|||||||
<template> |
<template> |
||||||
<view class=""> |
<view class=""> |
||||||
<view class=""> |
<view class=""> |
||||||
<Dtask v-if="shenfen=='battalion'&&!isSupervisor"></Dtask> |
<Dtask v-if="shenfen=='battalion'&&!isSupervisor"></Dtask> |
||||||
</view> |
</view> |
||||||
<view class=""> |
<view class=""> |
||||||
<Ztask v-if="shenfen=='brigade'"></Ztask> |
<Ztask v-if="shenfen=='brigade'"></Ztask> |
||||||
</view> |
</view> |
||||||
<view class=""> |
<view class=""> |
||||||
<Jtask v-if="shenfen=='squadron'||isSupervisor"></Jtask> |
<Jtask v-if="shenfen=='squadron'||isSupervisor"></Jtask> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
|
|
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import Dtask from "@/pages/dadui/jiancha/jiancha.vue" |
import Dtask from "@/pages/dadui/jiancha/jiancha.vue" |
||||||
import Jtask from "@/pages/rescue/taskapply.vue" |
import Jtask from "@/pages/rescue/taskapply.vue" |
||||||
import Ztask from '@/pages/zhidui/assign/assign.vue' |
import Ztask from '@/pages/zhidui/assign/assign.vue' |
||||||
export default { |
export default { |
||||||
components: { |
components: { |
||||||
Dtask, |
Dtask, |
||||||
Jtask, |
Jtask, |
||||||
Ztask |
Ztask |
||||||
}, |
}, |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
shenfen: "", |
shenfen: "", |
||||||
isSupervisor: false |
isSupervisor: false |
||||||
} |
} |
||||||
}, |
}, |
||||||
onShow() { |
onShow() { |
||||||
let roles = uni.getStorageSync("user").roles |
let roles = uni.getStorageSync("user").roles |
||||||
let isSupervisor = roles.find(item => { |
let isSupervisor = roles.find(item => { |
||||||
return item.name.indexOf('检查') != -1 |
return item.name.indexOf('检查') != -1 |
||||||
}) |
}) |
||||||
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false |
isSupervisor ? this.isSupervisor = true : this.isSupervisor = false |
||||||
this.shenfen = uni.getStorageSync("user").organizationLevel |
this.shenfen = uni.getStorageSync("user").organizationLevel |
||||||
|
|
||||||
}, |
}, |
||||||
onReady() { |
onReady() { |
||||||
|
|
||||||
}, |
}, |
||||||
methods: {} |
methods: {} |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
|
|
||||||
</style> |
</style> |
||||||
|
@ -1,131 +1,131 @@ |
|||||||
<template> |
<template> |
||||||
<view class="page"> |
<view class="page"> |
||||||
<view class="top"> |
<view class="top"> |
||||||
<view class="box"> |
<view class="box"> |
||||||
<view class="portrait"> |
<view class="portrait"> |
||||||
<img src="../../static/logo.png" alt=""> |
<img src="../../static/logo.png" alt=""> |
||||||
</view> |
</view> |
||||||
<view class="information"> |
<view class="information"> |
||||||
<view class="name"> |
<view class="name"> |
||||||
{{list.name}} |
{{list.name}} |
||||||
</view> |
</view> |
||||||
<view class="organization"> |
<view class="organization"> |
||||||
{{list.organizationName}} |
{{list.organizationName}} |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view class="items"> |
<view class="items"> |
||||||
<view class="item"> |
<view class="item"> |
||||||
<view style="flex: 1;" class="text" @tap="changePassword()"> |
<view style="flex: 1;" class="text" @tap="changePassword()"> |
||||||
修改密码 |
修改密码 |
||||||
</view> |
</view> |
||||||
<img src="../../static/arrow.png" alt=""> |
<img src="../../static/arrow.png" alt=""> |
||||||
</view> |
</view> |
||||||
</view> |
</view> |
||||||
<view @tap="tuichu()" class="tuichudenglu"> |
<view @tap="tuichu()" class="tuichudenglu"> |
||||||
退出登录 |
退出登录 |
||||||
</view> |
</view> |
||||||
<tabbar :selected="3"></tabbar> |
<tabbar :selected="3"></tabbar> |
||||||
</view> |
</view> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<script> |
<script> |
||||||
import tabbar from '../../components/tabbar.vue' |
import tabbar from '../../components/tabbar.vue' |
||||||
export default { |
export default { |
||||||
components: { |
components: { |
||||||
tabbar |
tabbar |
||||||
}, |
}, |
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
list: {} |
list: {} |
||||||
} |
} |
||||||
}, |
}, |
||||||
onShow() { |
onShow() { |
||||||
this.list = uni.getStorageSync("user") |
this.list = uni.getStorageSync("user") |
||||||
console.log(this.list); |
console.log(this.list); |
||||||
}, |
}, |
||||||
methods: { |
methods: { |
||||||
changePassword() { |
changePassword() { |
||||||
uni.navigateTo({ |
uni.navigateTo({ |
||||||
url: "/pages/changePassword/changePassword" |
url: "/pages/changePassword/changePassword" |
||||||
}) |
}) |
||||||
}, |
}, |
||||||
tuichu() { |
tuichu() { |
||||||
this.$auth.logout() |
this.$auth.logout() |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
</script> |
</script> |
||||||
|
|
||||||
<style lang="scss"> |
<style lang="scss"> |
||||||
.page { |
.page { |
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
padding-bottom: 100rpx; |
padding-bottom: 100rpx; |
||||||
|
|
||||||
.top { |
.top { |
||||||
background: linear-gradient(180deg, #317AFF 0%, #ACD1FF 100%); |
background: linear-gradient(180deg, #317AFF 0%, #ACD1FF 100%); |
||||||
height: 250rpx; |
height: 250rpx; |
||||||
padding: 10rpx 66rpx; |
padding: 10rpx 66rpx; |
||||||
|
|
||||||
.box { |
.box { |
||||||
display: flex; |
display: flex; |
||||||
|
|
||||||
.portrait { |
.portrait { |
||||||
width: 130rpx; |
width: 130rpx; |
||||||
height: 130rpx; |
height: 130rpx; |
||||||
border-radius: 130rpx; |
border-radius: 130rpx; |
||||||
border: 3rpx solid #fff; |
border: 3rpx solid #fff; |
||||||
overflow: hidden; |
overflow: hidden; |
||||||
img { |
img { |
||||||
width: 100%; |
width: 100%; |
||||||
height: 100%; |
height: 100%; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
.information { |
.information { |
||||||
color: #fff; |
color: #fff; |
||||||
margin: 18rpx 25rpx; |
margin: 18rpx 25rpx; |
||||||
.name { |
.name { |
||||||
font-size: 35rpx; |
font-size: 35rpx; |
||||||
margin-bottom: 12rpx; |
margin-bottom: 12rpx; |
||||||
} |
} |
||||||
.organization{ |
.organization{ |
||||||
font-size: 30rpx; |
font-size: 30rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
.items { |
.items { |
||||||
width: 100%; |
width: 100%; |
||||||
margin-top: -50rpx; |
margin-top: -50rpx; |
||||||
|
|
||||||
.item { |
.item { |
||||||
display: flex; |
display: flex; |
||||||
background-color: #fff; |
background-color: #fff; |
||||||
width: 90%; |
width: 90%; |
||||||
margin: 0 auto; |
margin: 0 auto; |
||||||
height: 110rpx; |
height: 110rpx; |
||||||
line-height: 110rpx; |
line-height: 110rpx; |
||||||
border-radius: 8rpx; |
border-radius: 8rpx; |
||||||
box-sizing: border-box; |
box-sizing: border-box; |
||||||
padding: 0 20rpx; |
padding: 0 20rpx; |
||||||
font-size: 30rpx; |
font-size: 30rpx; |
||||||
img { |
img { |
||||||
height: 40rpx; |
height: 40rpx; |
||||||
margin-top: 38rpx; |
margin-top: 38rpx; |
||||||
width: 40rpx; |
width: 40rpx; |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
} |
} |
||||||
|
|
||||||
.tuichudenglu { |
.tuichudenglu { |
||||||
width: 100%; |
width: 100%; |
||||||
color: gray; |
color: gray; |
||||||
margin-top: 40rpx; |
margin-top: 40rpx; |
||||||
text-align: center; |
text-align: center; |
||||||
} |
} |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
@ -1,32 +1,32 @@ |
|||||||
import Vue from 'vue' |
import Vue from 'vue' |
||||||
import Vuex from 'vuex' |
import Vuex from 'vuex' |
||||||
Vue.use(Vuex) |
Vue.use(Vuex) |
||||||
|
|
||||||
const store = new Vuex.Store({ |
const store = new Vuex.Store({ |
||||||
state: { |
state: { |
||||||
token: null, |
token: null, |
||||||
path: '/pages/index/index', |
path: '/pages/index/index', |
||||||
people: { |
people: { |
||||||
id: null, |
id: null, |
||||||
name: null, |
name: null, |
||||||
tag: null |
tag: null |
||||||
}, |
}, |
||||||
taskType:'', |
taskType:'', |
||||||
}, |
}, |
||||||
mutations: { |
mutations: { |
||||||
savePath (state, path) { |
savePath (state, path) { |
||||||
state.path = path; |
state.path = path; |
||||||
}, |
}, |
||||||
saveToken (state, token) { |
saveToken (state, token) { |
||||||
state.token = token |
state.token = token |
||||||
}, |
}, |
||||||
savePeople (state, people){ |
savePeople (state, people){ |
||||||
state.people = people |
state.people = people |
||||||
}, |
}, |
||||||
saveTaskType (state, taskType){ |
saveTaskType (state, taskType){ |
||||||
state.taskType = taskType |
state.taskType = taskType |
||||||
}, |
}, |
||||||
}, |
}, |
||||||
actions: {}, |
actions: {}, |
||||||
}) |
}) |
||||||
export default store |
export default store |
||||||
|
@ -0,0 +1,246 @@ |
|||||||
|
## 2.4.3-20220505(2022-05-05) |
||||||
|
- 秋云图表组件 修复开启canvas2d后将series赋值为空数组显示加载图标时,再次赋值后画布闪动的bug |
||||||
|
- 秋云图表组件 修复升级hbx最新版后ECharts的highlight方法报错的bug |
||||||
|
- uCharts.js 雷达图新增参数opts.extra.radar.gridEval,数据点位网格抽希,默认1 |
||||||
|
- uCharts.js 雷达图新增参数opts.extra.radar.axisLabel, 是否显示刻度点值,默认false |
||||||
|
- uCharts.js 雷达图新增参数opts.extra.radar.axisLabelTofix,刻度点值小数位数,默认0 |
||||||
|
- uCharts.js 雷达图新增参数opts.extra.radar.labelPointShow,是否显示末端刻度圆点,默认false |
||||||
|
- uCharts.js 雷达图新增参数opts.extra.radar.labelPointRadius,刻度圆点的半径,默认3 |
||||||
|
- uCharts.js 雷达图新增参数opts.extra.radar.labelPointColor,刻度圆点的颜色,默认#cccccc |
||||||
|
- uCharts.js 雷达图新增参数opts.extra.radar.linearType,渐变色类型,可选值"none"关闭渐变,"custom"开启渐变 |
||||||
|
- uCharts.js 雷达图新增参数opts.extra.radar.customColor,自定义渐变颜色,数组类型对应series的数组长度以匹配不同series颜色的不同配色方案,例如["#FA7D8D", "#EB88E2"] |
||||||
|
- uCharts.js 雷达图优化支持series.textColor、series.textSize属性 |
||||||
|
- uCharts.js 柱状图中温度计式图标,优化支持全圆角类型,修复边框有缝隙的bug,详见官网【演示】中的温度计图表 |
||||||
|
- uCharts.js 柱状图新增参数opts.extra.column.activeWidth,当前点击柱状图的背景宽度,默认一个单元格单位 |
||||||
|
- uCharts.js 混合图增加opts.extra.mix.area.gradient 区域图是否开启渐变色 |
||||||
|
- uCharts.js 混合图增加opts.extra.mix.area.opacity 区域图透明度,默认0.2 |
||||||
|
- uCharts.js 饼图、圆环图、玫瑰图、漏斗图,增加opts.series[0].data[i].labelText,自定义标签文字,避免formatter格式化的繁琐,详见官网【演示】中的饼图 |
||||||
|
- uCharts.js 饼图、圆环图、玫瑰图、漏斗图,增加opts.series[0].data[i].labelShow,自定义是否显示某一个指示标签,避免因饼图类别太多导致标签重复或者居多导致图形变形的问题,详见官网【演示】中的饼图 |
||||||
|
- uCharts.js 增加opts.series[i].legendText/opts.series[0].data[i].legendText(与series.name同级)自定义图例显示文字的方法 |
||||||
|
- uCharts.js 优化X轴、Y轴formatter格式化方法增加形参,统一为fromatter:function(value,index,opts){} |
||||||
|
- uCharts.js 修复横屏模式下无法使用双指缩放方法的bug |
||||||
|
- uCharts.js 修复当只有一条数据或者多条数据值相等的时候Y轴自动计算的最大值错误的bug |
||||||
|
- 【官网模板】增加外部自定义图例与图表交互的例子,[点击跳转](https://www.ucharts.cn/v2/#/layout/info?id=2) |
||||||
|
|
||||||
|
## 注意:非unimodules 版本如因更新 hbx 至 3.4.7 导致报错如下,请到码云更新非 unimodules 版本组件,[点击跳转](https://gitee.com/uCharts/uCharts/tree/master/uni-app/uCharts-%E7%BB%84%E4%BB%B6) |
||||||
|
> Error in callback for immediate watcher "uchartsOpts": "SyntaxError: Unexpected token u in JSON at position 0" |
||||||
|
## 2.4.2-20220421(2022-04-21) |
||||||
|
- 秋云图表组件 修复HBX升级3.4.6.20220420版本后echarts报错的问题 |
||||||
|
## 2.4.2-20220420(2022-04-20) |
||||||
|
## 重要!此版本uCharts新增了很多功能,修复了诸多已知问题 |
||||||
|
- 秋云图表组件 新增onzoom开启双指缩放功能(仅uCharts),前提需要直角坐标系类图表类型,并且ontouch为true、opts.enableScroll为true,详见实例项目K线图 |
||||||
|
- 秋云图表组件 新增optsWatch是否监听opts变化,关闭optsWatch后,动态修改opts不会触发图表重绘 |
||||||
|
- 秋云图表组件 修复开启canvas2d功能后,动态更新数据后画布闪动的bug |
||||||
|
- 秋云图表组件 去除directory属性,改为自动获取echarts.min.js路径(升级不受影响) |
||||||
|
- 秋云图表组件 增加getImage()方法及@getImage事件,通过ref调用getImage()方法获,触发@getImage事件获取当前画布的base64图片文件流。 |
||||||
|
- 秋云图表组件 支付宝、字节跳动、飞书、快手小程序支持开启canvas2d同层渲染设置。 |
||||||
|
- 秋云图表组件 新增加【非uniCloud】版本组件,避免有些不需要uniCloud的使用组件发布至小程序需要提交隐私声明问题,请到码云[【非uniCloud版本】](https://gitee.com/uCharts/uCharts/tree/master/uni-app/uCharts-%E7%BB%84%E4%BB%B6),或npm[【非uniCloud版本】](https://www.npmjs.com/package/@qiun/uni-ucharts)下载使用。 |
||||||
|
- uCharts.js 新增dobuleZoom双指缩放功能 |
||||||
|
- uCharts.js 新增山峰图type="mount",数据格式为饼图类格式,不需要传入categories,具体详见新版官网在线演示 |
||||||
|
- uCharts.js 修复折线图当数据中存在null时tooltip报错的bug |
||||||
|
- uCharts.js 修复饼图类当画布比较小时自动计算的半径是负数报错的bug |
||||||
|
- uCharts.js 统一各图表类型的series.formatter格式化方法的形参为(val, index, series, opts),方便格式化时有更多参数可用 |
||||||
|
- uCharts.js 标记线功能增加labelText自定义显示文字,增加labelAlign标签显示位置(左侧或右侧),增加标签显示位置微调labelOffsetX、labelOffsetY |
||||||
|
- uCharts.js 修复条状图当数值很小时开启圆角后样式错误的bug |
||||||
|
- uCharts.js 修复X轴开启disabled后,X轴仍占用空间的bug |
||||||
|
- uCharts.js 修复X轴开启滚动条并且开启rotateLabel后,X轴文字与滚动条重叠的bug |
||||||
|
- uCharts.js 增加X轴rotateAngle文字旋转自定义角度,取值范围(-90至90) |
||||||
|
- uCharts.js 修复地图文字标签层级显示不正确的bug |
||||||
|
- uCharts.js 修复饼图、圆环图、玫瑰图当数据全部为0的时候不显示数据标签的bug |
||||||
|
- uCharts.js 修复当opts.padding上边距为0时,Y轴顶部刻度标签位置不正确的bug |
||||||
|
|
||||||
|
## 另外我们还开发了各大原生小程序组件,已发布至码云和npm |
||||||
|
[https://gitee.com/uCharts/uCharts](https://gitee.com/uCharts/uCharts) |
||||||
|
[https://www.npmjs.com/~qiun](https://www.npmjs.com/~qiun) |
||||||
|
|
||||||
|
## 对于原生uCharts文档我们已上线新版官方网站,详情点击下面链接进入官网 |
||||||
|
[https://www.uCharts.cn/v2/](https://www.ucharts.cn/v2/) |
||||||
|
## 2.3.7-20220122(2022-01-22) |
||||||
|
## 重要!使用vue3编译,请使用cli模式并升级至最新依赖,HbuilderX编译需要使用3.3.8以上版本 |
||||||
|
- uCharts.js 修复uni-app平台组件模式使用vue3编译到小程序报错的bug。 |
||||||
|
## 2.3.7-20220118(2022-01-18) |
||||||
|
## 注意,使用vue3的前提是需要3.3.8.20220114-alpha版本的HBuilder! |
||||||
|
## 2.3.67-20220118(2022-01-18) |
||||||
|
- 秋云图表组件 组件初步支持vue3,全端编译会有些问题,具体详见下面修改: |
||||||
|
1. 小程序端运行时,在uni_modules文件夹的qiun-data-charts.js中搜索 new uni_modules_qiunDataCharts_js_sdk_uCharts_uCharts.uCharts,将.uCharts去掉。 |
||||||
|
2. 小程序端发行时,在uni_modules文件夹的qiun-data-charts.js中搜索 new e.uCharts,将.uCharts去掉,变为 new e。 |
||||||
|
3. 如果觉得上述步骤比较麻烦,如果您的项目只编译到小程序端,可以修改u-charts.js最后一行导出方式,将 export default uCharts;变更为 export default { uCharts: uCharts }; 这样变更后,H5和App端的renderjs会有问题,请开发者自行选择。(此问题非组件问题,请等待DC官方修复Vue3的小程序端) |
||||||
|
## 2.3.6-20220111(2022-01-11) |
||||||
|
- 秋云图表组件 修改组件 props 属性中的 background 默认值为 rgba(0,0,0,0) |
||||||
|
## 2.3.6-20211201(2021-12-01) |
||||||
|
- uCharts.js 修复bar条状图开启圆角模式时,值很小时圆角渲染错误的bug |
||||||
|
## 2.3.5-20211014(2021-10-15) |
||||||
|
- uCharts.js 增加vue3的编译支持(仅原生uCharts,qiun-data-charts组件后续会支持,请关注更新) |
||||||
|
## 2.3.4-20211012(2021-10-12) |
||||||
|
- 秋云图表组件 修复 mac os x 系统 mouseover 事件丢失的 bug |
||||||
|
## 2.3.3-20210706(2021-07-06) |
||||||
|
- uCharts.js 增加雷达图开启数据点值(opts.dataLabel)的显示 |
||||||
|
## 2.3.2-20210627(2021-06-27) |
||||||
|
- 秋云图表组件 修复tooltipCustom个别情况下传值不正确报错TypeError: Cannot read property 'name' of undefined的bug |
||||||
|
## 2.3.1-20210616(2021-06-16) |
||||||
|
- uCharts.js 修复圆角柱状图使用4角圆角时,当数值过大时不正确的bug |
||||||
|
## 2.3.0-20210612(2021-06-12) |
||||||
|
- uCharts.js 【重要】uCharts增加nvue兼容,可在nvue项目中使用gcanvas组件渲染uCharts,[详见码云uCharts-demo-nvue](https://gitee.com/uCharts/uCharts) |
||||||
|
- 秋云图表组件 增加tapLegend属性,是否开启图例点击交互事件 |
||||||
|
- 秋云图表组件 getIndex事件中增加返回uCharts实例中的opts参数,以便在页面中调用参数 |
||||||
|
- 示例项目 pages/other/other.vue增加app端自定义tooltip的方法,详见showOptsTooltip方法 |
||||||
|
## 2.2.1-20210603(2021-06-03) |
||||||
|
- uCharts.js 修复饼图、圆环图、玫瑰图,当起始角度不为0时,tooltip位置不准确的bug |
||||||
|
- uCharts.js 增加温度计式柱状图开启顶部半圆形的配置 |
||||||
|
## 2.2.0-20210529(2021-05-29) |
||||||
|
- uCharts.js 增加条状图type="bar" |
||||||
|
- 示例项目 pages/ucharts/ucharts.vue增加条状图的demo |
||||||
|
## 2.1.7-20210524(2021-05-24) |
||||||
|
- uCharts.js 修复大数据量模式下曲线图不平滑的bug |
||||||
|
## 2.1.6-20210523(2021-05-23) |
||||||
|
- 秋云图表组件 修复小程序端开启滚动条更新数据后滚动条位置不符合预期的bug |
||||||
|
## 2.1.5-2021051702(2021-05-17) |
||||||
|
- uCharts.js 修复自定义Y轴min和max值为0时不能正确显示的bug |
||||||
|
## 2.1.5-20210517(2021-05-17) |
||||||
|
- uCharts.js 修复Y轴自定义min和max时,未按指定的最大值最小值显示坐标轴刻度的bug |
||||||
|
## 2.1.4-20210516(2021-05-16) |
||||||
|
- 秋云图表组件 优化onWindowResize防抖方法 |
||||||
|
- 秋云图表组件 修复APP端uCharts更新数据时,清空series显示loading图标后再显示图表,图表抖动的bug |
||||||
|
- uCharts.js 修复开启canvas2d后,x轴、y轴、series自定义字体大小未按比例缩放的bug |
||||||
|
- 示例项目 修复format-e.vue拼写错误导致app端使用uCharts渲染图表 |
||||||
|
## 2.1.3-20210513(2021-05-13) |
||||||
|
- 秋云图表组件 修改uCharts变更chartData数据为updateData方法,支持带滚动条的数据动态打点 |
||||||
|
- 秋云图表组件 增加onWindowResize防抖方法 fix by ど誓言,如尘般染指流年づ |
||||||
|
- 秋云图表组件 H5或者APP变更chartData数据显示loading图表时,原数据闪现的bug |
||||||
|
- 秋云图表组件 props增加errorReload禁用错误点击重新加载的方法 |
||||||
|
- uCharts.js 增加tooltip显示category(x轴对应点位)标题的功能,opts.extra.tooltip.showCategory,默认为false |
||||||
|
- uCharts.js 修复mix混合图只有柱状图时,tooltip的分割线显示位置不正确的bug |
||||||
|
- uCharts.js 修复开启滚动条,图表在拖动中动态打点,滚动条位置不正确的bug |
||||||
|
- uCharts.js 修复饼图类数据格式为echarts数据格式,series为空数组报错的bug |
||||||
|
- 示例项目 修改uCharts.js更新到v2.1.2版本后,@getIndex方法获取索引值变更为e.currentIndex.index |
||||||
|
- 示例项目 pages/updata/updata.vue增加滚动条拖动更新(数据动态打点)的demo |
||||||
|
- 示例项目 pages/other/other.vue增加errorReload禁用错误点击重新加载的demo |
||||||
|
## 2.1.2-20210509(2021-05-09) |
||||||
|
秋云图表组件 修复APP端初始化时就传入chartData或lacaldata不显示图表的bug |
||||||
|
## 2.1.1-20210509(2021-05-09) |
||||||
|
- 秋云图表组件 变更ECharts的eopts配置在renderjs内执行,支持在config-echarts.js配置文件内写function配置。 |
||||||
|
- 秋云图表组件 修复APP端报错Prop being mutated: "onmouse"错误的bug。 |
||||||
|
- 秋云图表组件 修复APP端报错Error: Not Found:Page[6][-1,27] at view.umd.min.js:1的bug。 |
||||||
|
## 2.1.0-20210507(2021-05-07) |
||||||
|
- 秋云图表组件 修复初始化时就有数据或者数据更新的时候loading加载动画闪动的bug |
||||||
|
- uCharts.js 修复x轴format方法categories为字符串类型时返回NaN的bug |
||||||
|
- uCharts.js 修复series.textColor、legend.fontColor未执行全局默认颜色的bug |
||||||
|
## 2.1.0-20210506(2021-05-06) |
||||||
|
- 秋云图表组件 修复极个别情况下报错item.properties undefined的bug |
||||||
|
- 秋云图表组件 修复极个别情况下关闭加载动画reshow不起作用,无法显示图表的bug |
||||||
|
- 示例项目 pages/ucharts/ucharts.vue 增加时间轴折线图(type="tline")、时间轴区域图(type="tarea")、散点图(type="scatter")、气泡图demo(type="bubble")、倒三角形漏斗图(opts.extra.funnel.type="triangle")、金字塔形漏斗图(opts.extra.funnel.type="pyramid") |
||||||
|
- 示例项目 pages/format-u/format-u.vue 增加X轴format格式化示例 |
||||||
|
- uCharts.js 升级至v2.1.0版本 |
||||||
|
- uCharts.js 修复 玫瑰图面积模式点击tooltip位置不正确的bug |
||||||
|
- uCharts.js 修复 玫瑰图点击图例,只剩一个类别显示空白的bug |
||||||
|
- uCharts.js 修复 饼图类图点击图例,其他图表tooltip位置某些情况下不准的bug |
||||||
|
- uCharts.js 修复 x轴为矢量轴(时间轴)情况下,点击tooltip位置不正确的bug |
||||||
|
- uCharts.js 修复 词云图获取点击索引偶尔不准的bug |
||||||
|
- uCharts.js 增加 直角坐标系图表X轴format格式化方法(原生uCharts.js用法请使用formatter) |
||||||
|
- uCharts.js 增加 漏斗图扩展配置,倒三角形(opts.extra.funnel.type="triangle"),金字塔形(opts.extra.funnel.type="pyramid") |
||||||
|
- uCharts.js 增加 散点图(opts.type="scatter")、气泡图(opts.type="bubble") |
||||||
|
- 后期计划 完善散点图、气泡图,增加markPoints标记点,增加横向条状图。 |
||||||
|
## 2.0.0-20210502(2021-05-02) |
||||||
|
- uCharts.js 修复词云图获取点击索引不正确的bug |
||||||
|
## 2.0.0-20210501(2021-05-01) |
||||||
|
- 秋云图表组件 修复QQ小程序、百度小程序在关闭动画效果情况下,v-for循环使用图表,显示不正确的bug |
||||||
|
## 2.0.0-20210426(2021-04-26) |
||||||
|
- 秋云图表组件 修复QQ小程序不支持canvas2d的bug |
||||||
|
- 秋云图表组件 修复钉钉小程序某些情况点击坐标计算错误的bug |
||||||
|
- uCharts.js 增加 extra.column.categoryGap 参数,柱状图类每个category点位(X轴点)柱子组之间的间距 |
||||||
|
- uCharts.js 增加 yAxis.data[i].titleOffsetY 参数,标题纵向偏移距离,负数为向上偏移,正数向下偏移 |
||||||
|
- uCharts.js 增加 yAxis.data[i].titleOffsetX 参数,标题横向偏移距离,负数为向左偏移,正数向右偏移 |
||||||
|
- uCharts.js 增加 extra.gauge.labelOffset 参数,仪表盘标签文字径向便宜距离,默认13px |
||||||
|
## 2.0.0-20210422-2(2021-04-22) |
||||||
|
秋云图表组件 修复 formatterAssign 未判断 args[key] == null 的情况导致栈溢出的 bug |
||||||
|
## 2.0.0-20210422(2021-04-22) |
||||||
|
- 秋云图表组件 修复H5、APP、支付宝小程序、微信小程序canvas2d模式下横屏模式的bug |
||||||
|
## 2.0.0-20210421(2021-04-21) |
||||||
|
- uCharts.js 修复多行图例的情况下,图例在上方或者下方时,图例float为左侧或者右侧时,第二行及以后的图例对齐方式不正确的bug |
||||||
|
## 2.0.0-20210420(2021-04-20) |
||||||
|
- 秋云图表组件 修复微信小程序开启canvas2d模式后,windows版微信小程序不支持canvas2d模式的bug |
||||||
|
- 秋云图表组件 修改非uni_modules版本为v2.0版本qiun-data-charts组件 |
||||||
|
## 2.0.0-20210419(2021-04-19) |
||||||
|
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 |
||||||
|
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑; |
||||||
|
## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。 |
||||||
|
## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。 |
||||||
|
## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn) |
||||||
|
## <font color=#FF0000> 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! </font> |
||||||
|
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) |
||||||
|
## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) |
||||||
|
- uCharts.js 修复混合图中柱状图单独设置颜色不生效的bug |
||||||
|
- uCharts.js 修复多Y轴单独设置fontSize时,开启canvas2d后,未对应放大字体的bug |
||||||
|
## 2.0.0-20210418(2021-04-18) |
||||||
|
- 秋云图表组件 增加directory配置,修复H5端history模式下如果发布到二级目录无法正确加载echarts.min.js的bug |
||||||
|
## 2.0.0-20210416(2021-04-16) |
||||||
|
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 |
||||||
|
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑; |
||||||
|
## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。 |
||||||
|
## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。 |
||||||
|
## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn) |
||||||
|
## <font color=#FF0000> 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! </font> |
||||||
|
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) |
||||||
|
## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) |
||||||
|
- 秋云图表组件 修复APP端某些情况下报错`Not Found Page`的bug,fix by 高级bug开发技术员 |
||||||
|
- 示例项目 修复APP端v-for循环某些情况下报错`Not Found Page`的bug,fix by 高级bug开发技术员 |
||||||
|
- uCharts.js 修复非直角坐标系tooltip提示窗右侧超出未变换方向显示的bug |
||||||
|
## 2.0.0-20210415(2021-04-15) |
||||||
|
- 秋云图表组件 修复H5端发布到二级目录下echarts无法加载的bug |
||||||
|
- 秋云图表组件 修复某些情况下echarts.off('finished')移除监听事件报错的bug |
||||||
|
## 2.0.0-20210414(2021-04-14) |
||||||
|
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 |
||||||
|
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,如仍不好用,请重启电脑; |
||||||
|
## 如果是cli项目,请尝试清理node_modules,重新install,还不行就删除项目,再重新install。 |
||||||
|
## 此问题已于DCloud官方确认,HBuilderX下个版本会修复。 |
||||||
|
## 其他图表不显示问题详见[常见问题选项卡](https://demo.ucharts.cn) |
||||||
|
## <font color=#FF0000> 新手请先完整阅读帮助文档及常见问题3遍,右侧蓝色按钮示例项目请看2遍! </font> |
||||||
|
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) |
||||||
|
## [图表组件在项目中的应用参见 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) |
||||||
|
- 秋云图表组件 修复H5端在cli项目下ECharts引用地址错误的bug |
||||||
|
- 示例项目 增加ECharts的formatter用法的示例(详见示例项目format-e.vue) |
||||||
|
- uCharts.js 增加圆环图中心背景色的配置extra.ring.centerColor |
||||||
|
- uCharts.js 修复微信小程序安卓端柱状图开启透明色后显示不正确的bug |
||||||
|
## 2.0.0-20210413(2021-04-13) |
||||||
|
- 秋云图表组件 修复百度小程序多个图表真机未能正确获取根元素dom尺寸的bug |
||||||
|
- 秋云图表组件 修复百度小程序横屏模式方向不正确的bug |
||||||
|
- 秋云图表组件 修改ontouch时,@getTouchStart@getTouchMove@getTouchEnd的触发条件 |
||||||
|
- uCharts.js 修复饼图类数据格式series属性不生效的bug |
||||||
|
- uCharts.js 增加时序区域图 详见示例项目中ucharts.vue |
||||||
|
## 2.0.0-20210412-2(2021-04-12) |
||||||
|
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 |
||||||
|
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX。如仍不好用,请重启电脑,此问题已于DCloud官方确认,HBuilderX下个版本会修复。 |
||||||
|
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) |
||||||
|
## [图表组件在uniCloudAdmin中的应用 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) |
||||||
|
- 秋云图表组件 修复uCharts在APP端横屏模式下不能正确渲染的bug |
||||||
|
- 示例项目 增加ECharts柱状图渐变色、圆角柱状图、横向柱状图(条状图)的示例 |
||||||
|
## 2.0.0-20210412(2021-04-12) |
||||||
|
- 秋云图表组件 修复created中判断echarts导致APP端无法识别,改回mounted中判断echarts初始化 |
||||||
|
- uCharts.js 修复2d模式下series.textOffset未乘像素比的bug |
||||||
|
## 2.0.0-20210411(2021-04-11) |
||||||
|
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧绿色【使用HBuilderX导入插件】即可使用,示例项目请点击右侧蓝色按钮【使用HBuilderX导入示例项目】。 |
||||||
|
## 初次使用如果提示未注册<qiun-data-charts>组件,请重启HBuilderX,并清空小程序开发者工具缓存。 |
||||||
|
## [DEMO演示及在线生成工具(v2.0文档)https://demo.ucharts.cn](https://demo.ucharts.cn) |
||||||
|
## [图表组件在uniCloudAdmin中的应用 UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) |
||||||
|
- uCharts.js 折线图区域图增加connectNulls断点续连的功能,详见示例项目中ucharts.vue |
||||||
|
- 秋云图表组件 变更初始化方法为created,变更type2d默认值为true,优化2d模式下组件初始化后dom获取不到的bug |
||||||
|
- 秋云图表组件 修复左右布局时,右侧图表点击坐标错误的bug,修复tooltip柱状图自定义颜色显示object的bug |
||||||
|
## 2.0.0-20210410(2021-04-10) |
||||||
|
- 修复左右布局时,右侧图表点击坐标错误的bug,修复柱状图自定义颜色tooltip显示object的bug |
||||||
|
- 增加标记线及柱状图自定义颜色的demo |
||||||
|
## 2.0.0-20210409(2021-04-08) |
||||||
|
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧【使用HBuilderX导入插件】即可体验,DEMO演示及在线生成工具(v2.0文档)[https://demo.ucharts.cn](https://demo.ucharts.cn) |
||||||
|
## 图表组件在uniCloudAdmin中的应用 [UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) |
||||||
|
- uCharts.js 修复钉钉小程序百度小程序measureText不准确的bug,修复2d模式下饼图类activeRadius为按比例放大的bug |
||||||
|
- 修复组件在支付宝小程序端点击位置不准确的bug |
||||||
|
## 2.0.0-20210408(2021-04-07) |
||||||
|
- 修复组件在支付宝小程序端不能显示的bug(目前支付宝小程不能点击交互,后续修复) |
||||||
|
- uCharts.js 修复高分屏下柱状图类,圆弧进度条 自定义宽度不能按比例放大的bug |
||||||
|
## 2.0.0-20210407(2021-04-06) |
||||||
|
## v1.0版本已停更,建议转uni_modules版本组件方式调用,点击右侧【使用HBuilderX导入插件】即可体验,DEMO演示及在线生成工具(v2.0文档)[https://demo.ucharts.cn](https://demo.ucharts.cn) |
||||||
|
## 增加 通过tofix和unit快速格式化y轴的demo add by `howcode` |
||||||
|
## 增加 图表组件在uniCloudAdmin中的应用 [UReport数据报表](https://ext.dcloud.net.cn/plugin?id=4651) |
||||||
|
## 2.0.0-20210406(2021-04-05) |
||||||
|
# 秋云图表组件+uCharts v2.0版本同步上线,使用方法详见https://demo.ucharts.cn帮助页 |
||||||
|
## 2.0.0(2021-04-05) |
||||||
|
# 秋云图表组件+uCharts v2.0版本同步上线,使用方法详见https://demo.ucharts.cn帮助页 |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,162 @@ |
|||||||
|
<template> |
||||||
|
<view class="container loading1"> |
||||||
|
<view class="shape shape1"></view> |
||||||
|
<view class="shape shape2"></view> |
||||||
|
<view class="shape shape3"></view> |
||||||
|
<view class="shape shape4"></view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
name: 'loading1', |
||||||
|
data() { |
||||||
|
return { |
||||||
|
|
||||||
|
}; |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped="true"> |
||||||
|
.container { |
||||||
|
width: 30px; |
||||||
|
height: 30px; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
.container.loading1 { |
||||||
|
-webkit-transform: rotate(45deg); |
||||||
|
transform: rotate(45deg); |
||||||
|
} |
||||||
|
|
||||||
|
.container .shape { |
||||||
|
position: absolute; |
||||||
|
width: 10px; |
||||||
|
height: 10px; |
||||||
|
border-radius: 1px; |
||||||
|
} |
||||||
|
.container .shape.shape1 { |
||||||
|
left: 0; |
||||||
|
background-color: #1890FF; |
||||||
|
} |
||||||
|
.container .shape.shape2 { |
||||||
|
right: 0; |
||||||
|
background-color: #91CB74; |
||||||
|
} |
||||||
|
.container .shape.shape3 { |
||||||
|
bottom: 0; |
||||||
|
background-color: #FAC858; |
||||||
|
} |
||||||
|
.container .shape.shape4 { |
||||||
|
bottom: 0; |
||||||
|
right: 0; |
||||||
|
background-color: #EE6666; |
||||||
|
} |
||||||
|
|
||||||
|
.loading1 .shape1 { |
||||||
|
-webkit-animation: animation1shape1 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation1shape1 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation1shape1 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(16px, 16px); |
||||||
|
transform: translate(16px, 16px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation1shape1 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(16px, 16px); |
||||||
|
transform: translate(16px, 16px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading1 .shape2 { |
||||||
|
-webkit-animation: animation1shape2 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation1shape2 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation1shape2 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-16px, 16px); |
||||||
|
transform: translate(-16px, 16px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation1shape2 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-16px, 16px); |
||||||
|
transform: translate(-16px, 16px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading1 .shape3 { |
||||||
|
-webkit-animation: animation1shape3 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation1shape3 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation1shape3 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(16px, -16px); |
||||||
|
transform: translate(16px, -16px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation1shape3 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(16px, -16px); |
||||||
|
transform: translate(16px, -16px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading1 .shape4 { |
||||||
|
-webkit-animation: animation1shape4 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation1shape4 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation1shape4 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-16px, -16px); |
||||||
|
transform: translate(-16px, -16px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation1shape4 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-16px, -16px); |
||||||
|
transform: translate(-16px, -16px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
</style> |
@ -0,0 +1,170 @@ |
|||||||
|
<template> |
||||||
|
<view class="container loading2"> |
||||||
|
<view class="shape shape1"></view> |
||||||
|
<view class="shape shape2"></view> |
||||||
|
<view class="shape shape3"></view> |
||||||
|
<view class="shape shape4"></view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
name: 'loading2', |
||||||
|
data() { |
||||||
|
return { |
||||||
|
|
||||||
|
}; |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped="true"> |
||||||
|
.container { |
||||||
|
width: 30px; |
||||||
|
height: 30px; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.container.loading2 { |
||||||
|
-webkit-transform: rotate(10deg); |
||||||
|
transform: rotate(10deg); |
||||||
|
} |
||||||
|
.container.loading2 .shape { |
||||||
|
border-radius: 5px; |
||||||
|
} |
||||||
|
.container.loading2{ |
||||||
|
-webkit-animation: rotation 1s infinite; |
||||||
|
animation: rotation 1s infinite; |
||||||
|
} |
||||||
|
|
||||||
|
.container .shape { |
||||||
|
position: absolute; |
||||||
|
width: 10px; |
||||||
|
height: 10px; |
||||||
|
border-radius: 1px; |
||||||
|
} |
||||||
|
.container .shape.shape1 { |
||||||
|
left: 0; |
||||||
|
background-color: #1890FF; |
||||||
|
} |
||||||
|
.container .shape.shape2 { |
||||||
|
right: 0; |
||||||
|
background-color: #91CB74; |
||||||
|
} |
||||||
|
.container .shape.shape3 { |
||||||
|
bottom: 0; |
||||||
|
background-color: #FAC858; |
||||||
|
} |
||||||
|
.container .shape.shape4 { |
||||||
|
bottom: 0; |
||||||
|
right: 0; |
||||||
|
background-color: #EE6666; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
.loading2 .shape1 { |
||||||
|
-webkit-animation: animation2shape1 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation2shape1 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation2shape1 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(20px, 20px); |
||||||
|
transform: translate(20px, 20px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation2shape1 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(20px, 20px); |
||||||
|
transform: translate(20px, 20px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading2 .shape2 { |
||||||
|
-webkit-animation: animation2shape2 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation2shape2 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation2shape2 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-20px, 20px); |
||||||
|
transform: translate(-20px, 20px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation2shape2 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-20px, 20px); |
||||||
|
transform: translate(-20px, 20px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading2 .shape3 { |
||||||
|
-webkit-animation: animation2shape3 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation2shape3 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation2shape3 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(20px, -20px); |
||||||
|
transform: translate(20px, -20px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation2shape3 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(20px, -20px); |
||||||
|
transform: translate(20px, -20px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading2 .shape4 { |
||||||
|
-webkit-animation: animation2shape4 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation2shape4 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation2shape4 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-20px, -20px); |
||||||
|
transform: translate(-20px, -20px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation2shape4 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-20px, -20px); |
||||||
|
transform: translate(-20px, -20px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
</style> |
@ -0,0 +1,173 @@ |
|||||||
|
<template> |
||||||
|
<view class="container loading3"> |
||||||
|
<view class="shape shape1"></view> |
||||||
|
<view class="shape shape2"></view> |
||||||
|
<view class="shape shape3"></view> |
||||||
|
<view class="shape shape4"></view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
name: 'loading3', |
||||||
|
data() { |
||||||
|
return { |
||||||
|
|
||||||
|
}; |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped="true"> |
||||||
|
.container { |
||||||
|
width: 30px; |
||||||
|
height: 30px; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.container.loading3 { |
||||||
|
-webkit-animation: rotation 1s infinite; |
||||||
|
animation: rotation 1s infinite; |
||||||
|
} |
||||||
|
.container.loading3 .shape1 { |
||||||
|
border-top-left-radius: 10px; |
||||||
|
} |
||||||
|
.container.loading3 .shape2 { |
||||||
|
border-top-right-radius: 10px; |
||||||
|
} |
||||||
|
.container.loading3 .shape3 { |
||||||
|
border-bottom-left-radius: 10px; |
||||||
|
} |
||||||
|
.container.loading3 .shape4 { |
||||||
|
border-bottom-right-radius: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.container .shape { |
||||||
|
position: absolute; |
||||||
|
width: 10px; |
||||||
|
height: 10px; |
||||||
|
border-radius: 1px; |
||||||
|
} |
||||||
|
.container .shape.shape1 { |
||||||
|
left: 0; |
||||||
|
background-color: #1890FF; |
||||||
|
} |
||||||
|
.container .shape.shape2 { |
||||||
|
right: 0; |
||||||
|
background-color: #91CB74; |
||||||
|
} |
||||||
|
.container .shape.shape3 { |
||||||
|
bottom: 0; |
||||||
|
background-color: #FAC858; |
||||||
|
} |
||||||
|
.container .shape.shape4 { |
||||||
|
bottom: 0; |
||||||
|
right: 0; |
||||||
|
background-color: #EE6666; |
||||||
|
} |
||||||
|
|
||||||
|
.loading3 .shape1 { |
||||||
|
-webkit-animation: animation3shape1 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation3shape1 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation3shape1 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(5px, 5px); |
||||||
|
transform: translate(5px, 5px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation3shape1 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(5px, 5px); |
||||||
|
transform: translate(5px, 5px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading3 .shape2 { |
||||||
|
-webkit-animation: animation3shape2 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation3shape2 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation3shape2 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-5px, 5px); |
||||||
|
transform: translate(-5px, 5px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation3shape2 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-5px, 5px); |
||||||
|
transform: translate(-5px, 5px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading3 .shape3 { |
||||||
|
-webkit-animation: animation3shape3 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation3shape3 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation3shape3 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(5px, -5px); |
||||||
|
transform: translate(5px, -5px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation3shape3 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(5px, -5px); |
||||||
|
transform: translate(5px, -5px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading3 .shape4 { |
||||||
|
-webkit-animation: animation3shape4 0.5s ease 0s infinite alternate; |
||||||
|
animation: animation3shape4 0.5s ease 0s infinite alternate; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation3shape4 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-5px, -5px); |
||||||
|
transform: translate(-5px, -5px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation3shape4 { |
||||||
|
from { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
to { |
||||||
|
-webkit-transform: translate(-5px, -5px); |
||||||
|
transform: translate(-5px, -5px); |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,222 @@ |
|||||||
|
<template> |
||||||
|
<view class="container loading5"> |
||||||
|
<view class="shape shape1"></view> |
||||||
|
<view class="shape shape2"></view> |
||||||
|
<view class="shape shape3"></view> |
||||||
|
<view class="shape shape4"></view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
name: 'loading5', |
||||||
|
data() { |
||||||
|
return { |
||||||
|
|
||||||
|
}; |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped="true"> |
||||||
|
.container { |
||||||
|
width: 30px; |
||||||
|
height: 30px; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.container.loading5 .shape { |
||||||
|
width: 15px; |
||||||
|
height: 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.container .shape { |
||||||
|
position: absolute; |
||||||
|
width: 10px; |
||||||
|
height: 10px; |
||||||
|
border-radius: 1px; |
||||||
|
} |
||||||
|
.container .shape.shape1 { |
||||||
|
left: 0; |
||||||
|
background-color: #1890FF; |
||||||
|
} |
||||||
|
.container .shape.shape2 { |
||||||
|
right: 0; |
||||||
|
background-color: #91CB74; |
||||||
|
} |
||||||
|
.container .shape.shape3 { |
||||||
|
bottom: 0; |
||||||
|
background-color: #FAC858; |
||||||
|
} |
||||||
|
.container .shape.shape4 { |
||||||
|
bottom: 0; |
||||||
|
right: 0; |
||||||
|
background-color: #EE6666; |
||||||
|
} |
||||||
|
|
||||||
|
.loading5 .shape1 { |
||||||
|
animation: animation5shape1 2s ease 0s infinite reverse; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation5shape1 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(0, 15px); |
||||||
|
transform: translate(0, 15px); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(15px, 15px); |
||||||
|
transform: translate(15px, 15px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(15px, 0); |
||||||
|
transform: translate(15px, 0); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation5shape1 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(0, 15px); |
||||||
|
transform: translate(0, 15px); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(15px, 15px); |
||||||
|
transform: translate(15px, 15px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(15px, 0); |
||||||
|
transform: translate(15px, 0); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading5 .shape2 { |
||||||
|
animation: animation5shape2 2s ease 0s infinite reverse; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation5shape2 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(-15px, 0); |
||||||
|
transform: translate(-15px, 0); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(-15px, 15px); |
||||||
|
transform: translate(-15px, 15px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(0, 15px); |
||||||
|
transform: translate(0, 15px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation5shape2 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(-15px, 0); |
||||||
|
transform: translate(-15px, 0); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(-15px, 15px); |
||||||
|
transform: translate(-15px, 15px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(0, 15px); |
||||||
|
transform: translate(0, 15px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading5 .shape3 { |
||||||
|
animation: animation5shape3 2s ease 0s infinite reverse; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation5shape3 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(15px, 0); |
||||||
|
transform: translate(15px, 0); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(15px, -15px); |
||||||
|
transform: translate(15px, -15px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(0, -15px); |
||||||
|
transform: translate(0, -15px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation5shape3 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(15px, 0); |
||||||
|
transform: translate(15px, 0); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(15px, -15px); |
||||||
|
transform: translate(15px, -15px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(0, -15px); |
||||||
|
transform: translate(0, -15px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading5 .shape4 { |
||||||
|
animation: animation5shape4 2s ease 0s infinite reverse; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation5shape4 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(0, -15px); |
||||||
|
transform: translate(0, -15px); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(-15px, -15px); |
||||||
|
transform: translate(-15px, -15px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(-15px, 0); |
||||||
|
transform: translate(-15px, 0); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation5shape4 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(0, -15px); |
||||||
|
transform: translate(0, -15px); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(-15px, -15px); |
||||||
|
transform: translate(-15px, -15px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(-15px, 0); |
||||||
|
transform: translate(-15px, 0); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
</style> |
@ -0,0 +1,229 @@ |
|||||||
|
<template> |
||||||
|
<view class="container loading6"> |
||||||
|
<view class="shape shape1"></view> |
||||||
|
<view class="shape shape2"></view> |
||||||
|
<view class="shape shape3"></view> |
||||||
|
<view class="shape shape4"></view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
name: 'loading6', |
||||||
|
data() { |
||||||
|
return { |
||||||
|
|
||||||
|
}; |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
<style scoped="true"> |
||||||
|
.container { |
||||||
|
width: 30px; |
||||||
|
height: 30px; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.container.loading6 { |
||||||
|
-webkit-animation: rotation 1s infinite; |
||||||
|
animation: rotation 1s infinite; |
||||||
|
} |
||||||
|
.container.loading6 .shape { |
||||||
|
width: 12px; |
||||||
|
height: 12px; |
||||||
|
border-radius: 2px; |
||||||
|
} |
||||||
|
.container .shape { |
||||||
|
position: absolute; |
||||||
|
width: 10px; |
||||||
|
height: 10px; |
||||||
|
border-radius: 1px; |
||||||
|
} |
||||||
|
.container .shape.shape1 { |
||||||
|
left: 0; |
||||||
|
background-color: #1890FF; |
||||||
|
} |
||||||
|
.container .shape.shape2 { |
||||||
|
right: 0; |
||||||
|
background-color: #91CB74; |
||||||
|
} |
||||||
|
.container .shape.shape3 { |
||||||
|
bottom: 0; |
||||||
|
background-color: #FAC858; |
||||||
|
} |
||||||
|
.container .shape.shape4 { |
||||||
|
bottom: 0; |
||||||
|
right: 0; |
||||||
|
background-color: #EE6666; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
.loading6 .shape1 { |
||||||
|
-webkit-animation: animation6shape1 2s linear 0s infinite normal; |
||||||
|
animation: animation6shape1 2s linear 0s infinite normal; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation6shape1 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(0, 18px); |
||||||
|
transform: translate(0, 18px); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(18px, 18px); |
||||||
|
transform: translate(18px, 18px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(18px, 0); |
||||||
|
transform: translate(18px, 0); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation6shape1 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(0, 18px); |
||||||
|
transform: translate(0, 18px); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(18px, 18px); |
||||||
|
transform: translate(18px, 18px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(18px, 0); |
||||||
|
transform: translate(18px, 0); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading6 .shape2 { |
||||||
|
-webkit-animation: animation6shape2 2s linear 0s infinite normal; |
||||||
|
animation: animation6shape2 2s linear 0s infinite normal; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation6shape2 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(-18px, 0); |
||||||
|
transform: translate(-18px, 0); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(-18px, 18px); |
||||||
|
transform: translate(-18px, 18px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(0, 18px); |
||||||
|
transform: translate(0, 18px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation6shape2 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(-18px, 0); |
||||||
|
transform: translate(-18px, 0); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(-18px, 18px); |
||||||
|
transform: translate(-18px, 18px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(0, 18px); |
||||||
|
transform: translate(0, 18px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading6 .shape3 { |
||||||
|
-webkit-animation: animation6shape3 2s linear 0s infinite normal; |
||||||
|
animation: animation6shape3 2s linear 0s infinite normal; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation6shape3 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(18px, 0); |
||||||
|
transform: translate(18px, 0); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(18px, -18px); |
||||||
|
transform: translate(18px, -18px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(0, -18px); |
||||||
|
transform: translate(0, -18px); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation6shape3 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(18px, 0); |
||||||
|
transform: translate(18px, 0); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(18px, -18px); |
||||||
|
transform: translate(18px, -18px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(0, -18px); |
||||||
|
transform: translate(0, -18px); |
||||||
|
} |
||||||
|
} |
||||||
|
.loading6 .shape4 { |
||||||
|
-webkit-animation: animation6shape4 2s linear 0s infinite normal; |
||||||
|
animation: animation6shape4 2s linear 0s infinite normal; |
||||||
|
} |
||||||
|
|
||||||
|
@-webkit-keyframes animation6shape4 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(0, -18px); |
||||||
|
transform: translate(0, -18px); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(-18px, -18px); |
||||||
|
transform: translate(-18px, -18px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(-18px, 0); |
||||||
|
transform: translate(-18px, 0); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@keyframes animation6shape4 { |
||||||
|
0% { |
||||||
|
-webkit-transform: translate(0, 0); |
||||||
|
transform: translate(0, 0); |
||||||
|
} |
||||||
|
25% { |
||||||
|
-webkit-transform: translate(0, -18px); |
||||||
|
transform: translate(0, -18px); |
||||||
|
} |
||||||
|
50% { |
||||||
|
-webkit-transform: translate(-18px, -18px); |
||||||
|
transform: translate(-18px, -18px); |
||||||
|
} |
||||||
|
75% { |
||||||
|
-webkit-transform: translate(-18px, 0); |
||||||
|
transform: translate(-18px, 0); |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,36 @@ |
|||||||
|
<template> |
||||||
|
<view> |
||||||
|
<Loading1 v-if="loadingType==1"/> |
||||||
|
<Loading2 v-if="loadingType==2"/> |
||||||
|
<Loading3 v-if="loadingType==3"/> |
||||||
|
<Loading4 v-if="loadingType==4"/> |
||||||
|
<Loading5 v-if="loadingType==5"/> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Loading1 from "./loading1.vue"; |
||||||
|
import Loading2 from "./loading2.vue"; |
||||||
|
import Loading3 from "./loading3.vue"; |
||||||
|
import Loading4 from "./loading4.vue"; |
||||||
|
import Loading5 from "./loading5.vue"; |
||||||
|
export default { |
||||||
|
components:{Loading1,Loading2,Loading3,Loading4,Loading5}, |
||||||
|
name: 'qiun-loading', |
||||||
|
props: { |
||||||
|
loadingType: { |
||||||
|
type: Number, |
||||||
|
default: 2 |
||||||
|
}, |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
|
||||||
|
}; |
||||||
|
}, |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style> |
||||||
|
|
||||||
|
</style> |
@ -0,0 +1,422 @@ |
|||||||
|
/* |
||||||
|
* uCharts® |
||||||
|
* 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台 |
||||||
|
* Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
|
||||||
|
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||||
|
* 复制使用请保留本段注释,感谢支持开源! |
||||||
|
*
|
||||||
|
* uCharts®官方网站 |
||||||
|
* https://www.uCharts.cn
|
||||||
|
*
|
||||||
|
* 开源地址: |
||||||
|
* https://gitee.com/uCharts/uCharts
|
||||||
|
*
|
||||||
|
* uni-app插件市场地址: |
||||||
|
* http://ext.dcloud.net.cn/plugin?id=271
|
||||||
|
*
|
||||||
|
*/ |
||||||
|
|
||||||
|
// 通用配置项
|
||||||
|
|
||||||
|
// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性
|
||||||
|
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc']; |
||||||
|
|
||||||
|
const cfe = { |
||||||
|
//demotype为自定义图表类型
|
||||||
|
"type": ["pie", "ring", "rose", "funnel", "line", "column", "area", "radar", "gauge","candle","demotype"], |
||||||
|
//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型例如最后的"demotype"
|
||||||
|
"categories": ["line", "column", "area", "radar", "gauge", "candle","demotype"], |
||||||
|
//instance为实例变量承载属性,option为eopts承载属性,不要删除
|
||||||
|
"instance": {}, |
||||||
|
"option": {}, |
||||||
|
//下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
|
||||||
|
"formatter":{ |
||||||
|
"tooltipDemo1":function(res){ |
||||||
|
let result = '' |
||||||
|
for (let i in res) { |
||||||
|
if (i == 0) { |
||||||
|
result += res[i].axisValueLabel + '年销售额' |
||||||
|
} |
||||||
|
let value = '--' |
||||||
|
if (res[i].data !== null) { |
||||||
|
value = res[i].data |
||||||
|
} |
||||||
|
// #ifdef H5
|
||||||
|
result += '\n' + res[i].seriesName + ':' + value + ' 万元' |
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
result += '<br/>' + res[i].marker + res[i].seriesName + ':' + value + ' 万元' |
||||||
|
// #endif
|
||||||
|
} |
||||||
|
return result; |
||||||
|
}, |
||||||
|
legendFormat:function(name){ |
||||||
|
return "自定义图例+"+name; |
||||||
|
}, |
||||||
|
yAxisFormatDemo:function (value, index) { |
||||||
|
return value + '元'; |
||||||
|
}, |
||||||
|
seriesFormatDemo:function(res){ |
||||||
|
return res.name + '年' + res.value + '元'; |
||||||
|
} |
||||||
|
}, |
||||||
|
//这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在eopts参数,会将demotype与eopts中option合并后渲染图表。
|
||||||
|
"demotype":{ |
||||||
|
"color": color, |
||||||
|
//在这里填写echarts的option即可
|
||||||
|
|
||||||
|
}, |
||||||
|
//下面是自定义配置,请添加项目所需的通用配置
|
||||||
|
"column": { |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"text": '' |
||||||
|
}, |
||||||
|
"tooltip": { |
||||||
|
"trigger": 'axis' |
||||||
|
}, |
||||||
|
"grid": { |
||||||
|
"top": 30, |
||||||
|
"bottom": 50, |
||||||
|
"right": 15, |
||||||
|
"left": 40 |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
"bottom": 'left', |
||||||
|
}, |
||||||
|
"toolbox": { |
||||||
|
"show": false, |
||||||
|
}, |
||||||
|
"xAxis": { |
||||||
|
"type": 'category', |
||||||
|
"axisLabel": { |
||||||
|
"color": '#666666' |
||||||
|
}, |
||||||
|
"axisLine": { |
||||||
|
"lineStyle": { |
||||||
|
"color": '#CCCCCC' |
||||||
|
} |
||||||
|
}, |
||||||
|
"boundaryGap": true, |
||||||
|
"data": [] |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"type": 'value', |
||||||
|
"axisTick": { |
||||||
|
"show": false, |
||||||
|
}, |
||||||
|
"axisLabel": { |
||||||
|
"color": '#666666' |
||||||
|
}, |
||||||
|
"axisLine": { |
||||||
|
"lineStyle": { |
||||||
|
"color": '#CCCCCC' |
||||||
|
} |
||||||
|
}, |
||||||
|
}, |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '', |
||||||
|
"type": 'bar', |
||||||
|
"data": [], |
||||||
|
"barwidth": 20, |
||||||
|
"label": { |
||||||
|
"show": true, |
||||||
|
"color": "#666666", |
||||||
|
"position": 'top', |
||||||
|
}, |
||||||
|
}, |
||||||
|
}, |
||||||
|
"line": { |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"text": '' |
||||||
|
}, |
||||||
|
"tooltip": { |
||||||
|
"trigger": 'axis' |
||||||
|
}, |
||||||
|
"grid": { |
||||||
|
"top": 30, |
||||||
|
"bottom": 50, |
||||||
|
"right": 15, |
||||||
|
"left": 40 |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
"bottom": 'left', |
||||||
|
}, |
||||||
|
"toolbox": { |
||||||
|
"show": false, |
||||||
|
}, |
||||||
|
"xAxis": { |
||||||
|
"type": 'category', |
||||||
|
"axisLabel": { |
||||||
|
"color": '#666666' |
||||||
|
}, |
||||||
|
"axisLine": { |
||||||
|
"lineStyle": { |
||||||
|
"color": '#CCCCCC' |
||||||
|
} |
||||||
|
}, |
||||||
|
"boundaryGap": true, |
||||||
|
"data": [] |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"type": 'value', |
||||||
|
"axisTick": { |
||||||
|
"show": false, |
||||||
|
}, |
||||||
|
"axisLabel": { |
||||||
|
"color": '#666666' |
||||||
|
}, |
||||||
|
"axisLine": { |
||||||
|
"lineStyle": { |
||||||
|
"color": '#CCCCCC' |
||||||
|
} |
||||||
|
}, |
||||||
|
}, |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '', |
||||||
|
"type": 'line', |
||||||
|
"data": [], |
||||||
|
"barwidth": 20, |
||||||
|
"label": { |
||||||
|
"show": true, |
||||||
|
"color": "#666666", |
||||||
|
"position": 'top', |
||||||
|
}, |
||||||
|
}, |
||||||
|
}, |
||||||
|
"area": { |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"text": '' |
||||||
|
}, |
||||||
|
"tooltip": { |
||||||
|
"trigger": 'axis' |
||||||
|
}, |
||||||
|
"grid": { |
||||||
|
"top": 30, |
||||||
|
"bottom": 50, |
||||||
|
"right": 15, |
||||||
|
"left": 40 |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
"bottom": 'left', |
||||||
|
}, |
||||||
|
"toolbox": { |
||||||
|
"show": false, |
||||||
|
}, |
||||||
|
"xAxis": { |
||||||
|
"type": 'category', |
||||||
|
"axisLabel": { |
||||||
|
"color": '#666666' |
||||||
|
}, |
||||||
|
"axisLine": { |
||||||
|
"lineStyle": { |
||||||
|
"color": '#CCCCCC' |
||||||
|
} |
||||||
|
}, |
||||||
|
"boundaryGap": true, |
||||||
|
"data": [] |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"type": 'value', |
||||||
|
"axisTick": { |
||||||
|
"show": false, |
||||||
|
}, |
||||||
|
"axisLabel": { |
||||||
|
"color": '#666666' |
||||||
|
}, |
||||||
|
"axisLine": { |
||||||
|
"lineStyle": { |
||||||
|
"color": '#CCCCCC' |
||||||
|
} |
||||||
|
}, |
||||||
|
}, |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '', |
||||||
|
"type": 'line', |
||||||
|
"data": [], |
||||||
|
"areaStyle": {}, |
||||||
|
"label": { |
||||||
|
"show": true, |
||||||
|
"color": "#666666", |
||||||
|
"position": 'top', |
||||||
|
}, |
||||||
|
}, |
||||||
|
}, |
||||||
|
"pie": { |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"text": '' |
||||||
|
}, |
||||||
|
"tooltip": { |
||||||
|
"trigger": 'item' |
||||||
|
}, |
||||||
|
"grid": { |
||||||
|
"top": 40, |
||||||
|
"bottom": 30, |
||||||
|
"right": 15, |
||||||
|
"left": 15 |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
"bottom": 'left', |
||||||
|
}, |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '', |
||||||
|
"type": 'pie', |
||||||
|
"data": [], |
||||||
|
"radius": '50%', |
||||||
|
"label": { |
||||||
|
"show": true, |
||||||
|
"color": "#666666", |
||||||
|
"position": 'top', |
||||||
|
}, |
||||||
|
}, |
||||||
|
}, |
||||||
|
"ring": { |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"text": '' |
||||||
|
}, |
||||||
|
"tooltip": { |
||||||
|
"trigger": 'item' |
||||||
|
}, |
||||||
|
"grid": { |
||||||
|
"top": 40, |
||||||
|
"bottom": 30, |
||||||
|
"right": 15, |
||||||
|
"left": 15 |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
"bottom": 'left', |
||||||
|
}, |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '', |
||||||
|
"type": 'pie', |
||||||
|
"data": [], |
||||||
|
"radius": ['40%', '70%'], |
||||||
|
"avoidLabelOverlap": false, |
||||||
|
"label": { |
||||||
|
"show": true, |
||||||
|
"color": "#666666", |
||||||
|
"position": 'top', |
||||||
|
}, |
||||||
|
"labelLine": { |
||||||
|
"show": true |
||||||
|
}, |
||||||
|
}, |
||||||
|
}, |
||||||
|
"rose": { |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"text": '' |
||||||
|
}, |
||||||
|
"tooltip": { |
||||||
|
"trigger": 'item' |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
"top": 'bottom' |
||||||
|
}, |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '', |
||||||
|
"type": 'pie', |
||||||
|
"data": [], |
||||||
|
"radius": "55%", |
||||||
|
"center": ['50%', '50%'], |
||||||
|
"roseType": 'area', |
||||||
|
}, |
||||||
|
}, |
||||||
|
"funnel": { |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"text": '' |
||||||
|
}, |
||||||
|
"tooltip": { |
||||||
|
"trigger": 'item', |
||||||
|
"formatter": "{b} : {c}%" |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
"top": 'bottom' |
||||||
|
}, |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '', |
||||||
|
"type": 'funnel', |
||||||
|
"left": '10%', |
||||||
|
"top": 60, |
||||||
|
"bottom": 60, |
||||||
|
"width": '80%', |
||||||
|
"min": 0, |
||||||
|
"max": 100, |
||||||
|
"minSize": '0%', |
||||||
|
"maxSize": '100%', |
||||||
|
"sort": 'descending', |
||||||
|
"gap": 2, |
||||||
|
"label": { |
||||||
|
"show": true, |
||||||
|
"position": 'inside' |
||||||
|
}, |
||||||
|
"labelLine": { |
||||||
|
"length": 10, |
||||||
|
"lineStyle": { |
||||||
|
"width": 1, |
||||||
|
"type": 'solid' |
||||||
|
} |
||||||
|
}, |
||||||
|
"itemStyle": { |
||||||
|
"bordercolor": '#fff', |
||||||
|
"borderwidth": 1 |
||||||
|
}, |
||||||
|
"emphasis": { |
||||||
|
"label": { |
||||||
|
"fontSize": 20 |
||||||
|
} |
||||||
|
}, |
||||||
|
"data": [], |
||||||
|
}, |
||||||
|
}, |
||||||
|
"gauge": { |
||||||
|
"color": color, |
||||||
|
"tooltip": { |
||||||
|
"formatter": '{a} <br/>{b} : {c}%' |
||||||
|
}, |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '业务指标', |
||||||
|
"type": 'gauge', |
||||||
|
"detail": {"formatter": '{value}%'}, |
||||||
|
"data": [{"value": 50, "name": '完成率'}] |
||||||
|
}, |
||||||
|
}, |
||||||
|
"candle": { |
||||||
|
"xAxis": { |
||||||
|
"data": [] |
||||||
|
}, |
||||||
|
"yAxis": {}, |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"text": '' |
||||||
|
}, |
||||||
|
"dataZoom": [{ |
||||||
|
"type": 'inside', |
||||||
|
"xAxisIndex": [0, 1], |
||||||
|
"start": 10, |
||||||
|
"end": 100 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"show": true, |
||||||
|
"xAxisIndex": [0, 1], |
||||||
|
"type": 'slider', |
||||||
|
"bottom": 10, |
||||||
|
"start": 10, |
||||||
|
"end": 100 |
||||||
|
} |
||||||
|
], |
||||||
|
"seriesTemplate": { |
||||||
|
"name": '', |
||||||
|
"type": 'k', |
||||||
|
"data": [], |
||||||
|
}, |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
export default cfe; |
@ -0,0 +1,601 @@ |
|||||||
|
/* |
||||||
|
* uCharts® |
||||||
|
* 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)、Vue、Taro等支持canvas的框架平台 |
||||||
|
* Copyright (c) 2021 QIUN®秋云 https://www.ucharts.cn All rights reserved.
|
||||||
|
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||||
|
* 复制使用请保留本段注释,感谢支持开源! |
||||||
|
*
|
||||||
|
* uCharts®官方网站 |
||||||
|
* https://www.uCharts.cn
|
||||||
|
*
|
||||||
|
* 开源地址: |
||||||
|
* https://gitee.com/uCharts/uCharts
|
||||||
|
*
|
||||||
|
* uni-app插件市场地址: |
||||||
|
* http://ext.dcloud.net.cn/plugin?id=271
|
||||||
|
*
|
||||||
|
*/ |
||||||
|
|
||||||
|
// 主题颜色配置:如每个图表类型需要不同主题,请在对应图表类型上更改color属性
|
||||||
|
const color = ['#1890FF', '#91CB74', '#FAC858', '#EE6666', '#73C0DE', '#3CA272', '#FC8452', '#9A60B4', '#ea7ccc']; |
||||||
|
|
||||||
|
//事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改
|
||||||
|
const formatDateTime = (timeStamp, returnType)=>{ |
||||||
|
var date = new Date(); |
||||||
|
date.setTime(timeStamp * 1000); |
||||||
|
var y = date.getFullYear(); |
||||||
|
var m = date.getMonth() + 1; |
||||||
|
m = m < 10 ? ('0' + m) : m; |
||||||
|
var d = date.getDate(); |
||||||
|
d = d < 10 ? ('0' + d) : d; |
||||||
|
var h = date.getHours(); |
||||||
|
h = h < 10 ? ('0' + h) : h; |
||||||
|
var minute = date.getMinutes(); |
||||||
|
var second = date.getSeconds(); |
||||||
|
minute = minute < 10 ? ('0' + minute) : minute; |
||||||
|
second = second < 10 ? ('0' + second) : second; |
||||||
|
if(returnType == 'full'){return y + '-' + m + '-' + d + ' '+ h +':' + minute + ':' + second;} |
||||||
|
if(returnType == 'y-m-d'){return y + '-' + m + '-' + d;} |
||||||
|
if(returnType == 'h:m'){return h +':' + minute;} |
||||||
|
if(returnType == 'h:m:s'){return h +':' + minute +':' + second;} |
||||||
|
return [y, m, d, h, minute, second]; |
||||||
|
} |
||||||
|
|
||||||
|
const cfu = { |
||||||
|
//demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可
|
||||||
|
"type":["pie","ring","rose","word","funnel","map","arcbar","line","column","mount","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"], |
||||||
|
"range":["饼状图","圆环图","玫瑰图","词云图","漏斗图","地图","圆弧进度条","折线图","柱状图","山峰图","条状图","区域图","雷达图","仪表盘","K线图","混合图","时间轴折线","时间轴区域","散点图","气泡图","自定义类型"], |
||||||
|
//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
|
||||||
|
//自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
|
||||||
|
"categories":["line","column","mount","bar","area","radar","gauge","candle","mix","demotype"], |
||||||
|
//instance为实例变量承载属性,不要删除
|
||||||
|
"instance":{}, |
||||||
|
//option为opts及eopts承载属性,不要删除
|
||||||
|
"option":{}, |
||||||
|
//下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换
|
||||||
|
"formatter":{ |
||||||
|
"yAxisDemo1":function(val, index, opts){return val+'元'}, |
||||||
|
"yAxisDemo2":function(val, index, opts){return val.toFixed(2)}, |
||||||
|
"xAxisDemo1":function(val, index, opts){return val+'年';}, |
||||||
|
"xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')}, |
||||||
|
"seriesDemo1":function(val, index, series, opts){return val+'元'}, |
||||||
|
"tooltipDemo1":function(item, category, index, opts){ |
||||||
|
if(index==0){ |
||||||
|
return '随便用'+item.data+'年' |
||||||
|
}else{ |
||||||
|
return '其他我没改'+item.data+'天' |
||||||
|
} |
||||||
|
}, |
||||||
|
"pieDemo":function(val, index, series, opts){ |
||||||
|
if(index !== undefined){ |
||||||
|
return series[index].name+':'+series[index].data+'元' |
||||||
|
} |
||||||
|
}, |
||||||
|
}, |
||||||
|
//这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。
|
||||||
|
"demotype":{ |
||||||
|
//我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置
|
||||||
|
"type": "line", |
||||||
|
"color": color, |
||||||
|
"padding": [15,10,0,15], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": true, |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"gridType": "dash", |
||||||
|
"dashLength": 2, |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"line": { |
||||||
|
"type": "curve", |
||||||
|
"width": 2 |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
//下面是自定义配置,请添加项目所需的通用配置
|
||||||
|
"pie":{ |
||||||
|
"type": "pie", |
||||||
|
"color": color, |
||||||
|
"padding": [5,5,5,5], |
||||||
|
"extra": { |
||||||
|
"pie": { |
||||||
|
"activeOpacity": 0.5, |
||||||
|
"activeRadius": 10, |
||||||
|
"offsetAngle": 0, |
||||||
|
"labelWidth": 15, |
||||||
|
"border": true, |
||||||
|
"borderWidth": 3, |
||||||
|
"borderColor": "#FFFFFF" |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"ring":{ |
||||||
|
"type": "ring", |
||||||
|
"color": color, |
||||||
|
"padding": [5,5,5,5], |
||||||
|
"rotate": false, |
||||||
|
"dataLabel": true, |
||||||
|
"legend": { |
||||||
|
"show": true, |
||||||
|
"position": "right", |
||||||
|
"lineHeight": 25, |
||||||
|
}, |
||||||
|
"title": { |
||||||
|
"name": "收益率", |
||||||
|
"fontSize": 15, |
||||||
|
"color": "#666666" |
||||||
|
}, |
||||||
|
"subtitle": { |
||||||
|
"name": "70%", |
||||||
|
"fontSize": 25, |
||||||
|
"color": "#7cb5ec" |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"ring": { |
||||||
|
"ringWidth":30, |
||||||
|
"activeOpacity": 0.5, |
||||||
|
"activeRadius": 10, |
||||||
|
"offsetAngle": 0, |
||||||
|
"labelWidth": 15, |
||||||
|
"border": true, |
||||||
|
"borderWidth": 3, |
||||||
|
"borderColor": "#FFFFFF" |
||||||
|
}, |
||||||
|
}, |
||||||
|
}, |
||||||
|
"rose":{ |
||||||
|
"type": "rose", |
||||||
|
"color": color, |
||||||
|
"padding": [5,5,5,5], |
||||||
|
"legend": { |
||||||
|
"show": true, |
||||||
|
"position": "left", |
||||||
|
"lineHeight": 25, |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"rose": { |
||||||
|
"type": "area", |
||||||
|
"minRadius": 50, |
||||||
|
"activeOpacity": 0.5, |
||||||
|
"activeRadius": 10, |
||||||
|
"offsetAngle": 0, |
||||||
|
"labelWidth": 15, |
||||||
|
"border": false, |
||||||
|
"borderWidth": 2, |
||||||
|
"borderColor": "#FFFFFF" |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"word":{ |
||||||
|
"type": "word", |
||||||
|
"color": color, |
||||||
|
"extra": { |
||||||
|
"word": { |
||||||
|
"type": "normal", |
||||||
|
"autoColors": false |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
"funnel":{ |
||||||
|
"type": "funnel", |
||||||
|
"color": color, |
||||||
|
"padding": [15,15,0,15], |
||||||
|
"extra": { |
||||||
|
"funnel": { |
||||||
|
"activeOpacity": 0.3, |
||||||
|
"activeWidth": 10, |
||||||
|
"border": true, |
||||||
|
"borderWidth": 2, |
||||||
|
"borderColor": "#FFFFFF", |
||||||
|
"fillOpacity": 1, |
||||||
|
"labelAlign": "right" |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"map":{ |
||||||
|
"type": "map", |
||||||
|
"color": color, |
||||||
|
"padding": [0,0,0,0], |
||||||
|
"dataLabel": true, |
||||||
|
"extra": { |
||||||
|
"map": { |
||||||
|
"border": true, |
||||||
|
"borderWidth": 1, |
||||||
|
"borderColor": "#666666", |
||||||
|
"fillOpacity": 0.6, |
||||||
|
"activeBorderColor": "#F04864", |
||||||
|
"activeFillColor": "#FACC14", |
||||||
|
"activeFillOpacity": 1 |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"arcbar":{ |
||||||
|
"type": "arcbar", |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"name": "百分比", |
||||||
|
"fontSize": 25, |
||||||
|
"color": "#00FF00" |
||||||
|
}, |
||||||
|
"subtitle": { |
||||||
|
"name": "默认标题", |
||||||
|
"fontSize": 15, |
||||||
|
"color": "#666666" |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"arcbar": { |
||||||
|
"type": "default", |
||||||
|
"width": 12, |
||||||
|
"backgroundColor": "#E9E9E9", |
||||||
|
"startAngle": 0.75, |
||||||
|
"endAngle": 0.25, |
||||||
|
"gap": 2 |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
"line":{ |
||||||
|
"type": "line", |
||||||
|
"color": color, |
||||||
|
"padding": [15,10,0,15], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": true, |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"gridType": "dash", |
||||||
|
"dashLength": 2, |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"line": { |
||||||
|
"type": "straight", |
||||||
|
"width": 2 |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"tline":{ |
||||||
|
"type": "line", |
||||||
|
"color": color, |
||||||
|
"padding": [15,10,0,15], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": false, |
||||||
|
"boundaryGap":"justify", |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"gridType": "dash", |
||||||
|
"dashLength": 2, |
||||||
|
"data":[ |
||||||
|
{ |
||||||
|
"min":0, |
||||||
|
"max":80 |
||||||
|
} |
||||||
|
] |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"line": { |
||||||
|
"type": "curve", |
||||||
|
"width": 2 |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"tarea":{ |
||||||
|
"type": "area", |
||||||
|
"color": color, |
||||||
|
"padding": [15,10,0,15], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": true, |
||||||
|
"boundaryGap":"justify", |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"gridType": "dash", |
||||||
|
"dashLength": 2, |
||||||
|
"data":[ |
||||||
|
{ |
||||||
|
"min":0, |
||||||
|
"max":80 |
||||||
|
} |
||||||
|
] |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"area": { |
||||||
|
"type": "curve", |
||||||
|
"opacity": 0.2, |
||||||
|
"addLine": true, |
||||||
|
"width": 2, |
||||||
|
"gradient": true |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"column":{ |
||||||
|
"type": "column", |
||||||
|
"color": color, |
||||||
|
"padding": [15,15,0,5], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": true, |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"data":[{"min":0}] |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"column": { |
||||||
|
"type": "group", |
||||||
|
"width": 30, |
||||||
|
"activeBgColor": "#000000", |
||||||
|
"activeBgOpacity": 0.08 |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"mount":{ |
||||||
|
"type": "mount", |
||||||
|
"color": color, |
||||||
|
"padding": [15,15,0,5], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": true, |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"data":[{"min":0}] |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"mount": { |
||||||
|
"type": "mount", |
||||||
|
"widthRatio": 1.5, |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"bar":{ |
||||||
|
"type": "bar", |
||||||
|
"color": color, |
||||||
|
"padding": [15,30,0,5], |
||||||
|
"xAxis": { |
||||||
|
"boundaryGap":"justify", |
||||||
|
"disableGrid":false, |
||||||
|
"min":0, |
||||||
|
"axisLine":false |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"bar": { |
||||||
|
"type": "group", |
||||||
|
"width": 30, |
||||||
|
"meterBorde": 1, |
||||||
|
"meterFillColor": "#FFFFFF", |
||||||
|
"activeBgColor": "#000000", |
||||||
|
"activeBgOpacity": 0.08 |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"area":{ |
||||||
|
"type": "area", |
||||||
|
"color": color, |
||||||
|
"padding": [15,15,0,15], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": true, |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"gridType": "dash", |
||||||
|
"dashLength": 2, |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"area": { |
||||||
|
"type": "straight", |
||||||
|
"opacity": 0.2, |
||||||
|
"addLine": true, |
||||||
|
"width": 2, |
||||||
|
"gradient": false |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"radar":{ |
||||||
|
"type": "radar", |
||||||
|
"color": color, |
||||||
|
"padding": [5,5,5,5], |
||||||
|
"dataLabel": false, |
||||||
|
"legend": { |
||||||
|
"show": true, |
||||||
|
"position": "right", |
||||||
|
"lineHeight": 25, |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"radar": { |
||||||
|
"gridType": "radar", |
||||||
|
"gridColor": "#CCCCCC", |
||||||
|
"gridCount": 3, |
||||||
|
"opacity": 0.2, |
||||||
|
"max": 200 |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"gauge":{ |
||||||
|
"type": "gauge", |
||||||
|
"color": color, |
||||||
|
"title": { |
||||||
|
"name": "66Km/H", |
||||||
|
"fontSize": 25, |
||||||
|
"color": "#2fc25b", |
||||||
|
"offsetY": 50 |
||||||
|
}, |
||||||
|
"subtitle": { |
||||||
|
"name": "实时速度", |
||||||
|
"fontSize": 15, |
||||||
|
"color": "#1890ff", |
||||||
|
"offsetY": -50 |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"gauge": { |
||||||
|
"type": "default", |
||||||
|
"width": 30, |
||||||
|
"labelColor": "#666666", |
||||||
|
"startAngle": 0.75, |
||||||
|
"endAngle": 0.25, |
||||||
|
"startNumber": 0, |
||||||
|
"endNumber": 100, |
||||||
|
"labelFormat": "", |
||||||
|
"splitLine": { |
||||||
|
"fixRadius": 0, |
||||||
|
"splitNumber": 10, |
||||||
|
"width": 30, |
||||||
|
"color": "#FFFFFF", |
||||||
|
"childNumber": 5, |
||||||
|
"childWidth": 12 |
||||||
|
}, |
||||||
|
"pointer": { |
||||||
|
"width": 24, |
||||||
|
"color": "auto" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
"candle":{ |
||||||
|
"type": "candle", |
||||||
|
"color": color, |
||||||
|
"padding": [15,15,0,15], |
||||||
|
"enableScroll": true, |
||||||
|
"enableMarkLine": true, |
||||||
|
"dataLabel": false, |
||||||
|
"xAxis": { |
||||||
|
"labelCount": 4, |
||||||
|
"itemCount": 40, |
||||||
|
"disableGrid": true, |
||||||
|
"gridColor": "#CCCCCC", |
||||||
|
"gridType": "solid", |
||||||
|
"dashLength": 4, |
||||||
|
"scrollShow": true, |
||||||
|
"scrollAlign": "left", |
||||||
|
"scrollColor": "#A6A6A6", |
||||||
|
"scrollBackgroundColor": "#EFEBEF" |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"candle": { |
||||||
|
"color": { |
||||||
|
"upLine": "#f04864", |
||||||
|
"upFill": "#f04864", |
||||||
|
"downLine": "#2fc25b", |
||||||
|
"downFill": "#2fc25b" |
||||||
|
}, |
||||||
|
"average": { |
||||||
|
"show": true, |
||||||
|
"name": ["MA5","MA10","MA30"], |
||||||
|
"day": [5,10,20], |
||||||
|
"color": ["#1890ff","#2fc25b","#facc14"] |
||||||
|
} |
||||||
|
}, |
||||||
|
"markLine": { |
||||||
|
"type": "dash", |
||||||
|
"dashLength": 5, |
||||||
|
"data": [ |
||||||
|
{ |
||||||
|
"value": 2150, |
||||||
|
"lineColor": "#f04864", |
||||||
|
"showLabel": true |
||||||
|
}, |
||||||
|
{ |
||||||
|
"value": 2350, |
||||||
|
"lineColor": "#f04864", |
||||||
|
"showLabel": true |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
"mix":{ |
||||||
|
"type": "mix", |
||||||
|
"color": color, |
||||||
|
"padding": [15,15,0,15], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": true, |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"disabled": false, |
||||||
|
"disableGrid": false, |
||||||
|
"splitNumber": 5, |
||||||
|
"gridType": "dash", |
||||||
|
"dashLength": 4, |
||||||
|
"gridColor": "#CCCCCC", |
||||||
|
"padding": 10, |
||||||
|
"showTitle": true, |
||||||
|
"data": [] |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"mix": { |
||||||
|
"column": { |
||||||
|
"width": 20 |
||||||
|
} |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"scatter":{ |
||||||
|
"type": "scatter", |
||||||
|
"color":color, |
||||||
|
"padding":[15,15,0,15], |
||||||
|
"dataLabel":false, |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": false, |
||||||
|
"gridType":"dash", |
||||||
|
"splitNumber":5, |
||||||
|
"boundaryGap":"justify", |
||||||
|
"min":0 |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"disableGrid": false, |
||||||
|
"gridType":"dash", |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"scatter": { |
||||||
|
}, |
||||||
|
} |
||||||
|
}, |
||||||
|
"bubble":{ |
||||||
|
"type": "bubble", |
||||||
|
"color":color, |
||||||
|
"padding":[15,15,0,15], |
||||||
|
"xAxis": { |
||||||
|
"disableGrid": false, |
||||||
|
"gridType":"dash", |
||||||
|
"splitNumber":5, |
||||||
|
"boundaryGap":"justify", |
||||||
|
"min":0, |
||||||
|
"max":250 |
||||||
|
}, |
||||||
|
"yAxis": { |
||||||
|
"disableGrid": false, |
||||||
|
"gridType":"dash", |
||||||
|
"data":[{ |
||||||
|
"min":0, |
||||||
|
"max":150 |
||||||
|
}] |
||||||
|
}, |
||||||
|
"legend": { |
||||||
|
}, |
||||||
|
"extra": { |
||||||
|
"bubble": { |
||||||
|
"border":2, |
||||||
|
"opacity": 0.5, |
||||||
|
}, |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
export default cfu; |
@ -0,0 +1,5 @@ |
|||||||
|
# uCharts JSSDK说明 |
||||||
|
1、如不使用uCharts组件,可直接引用u-charts.js,打包编译后会`自动压缩`,压缩后体积约为`120kb`。 |
||||||
|
2、如果120kb的体积仍需压缩,请手到uCharts官网通过在线定制选择您需要的图表。 |
||||||
|
3、config-ucharts.js为uCharts组件的用户配置文件,升级前请`自行备份config-ucharts.js`文件,以免被强制覆盖。 |
||||||
|
4、config-echarts.js为ECharts组件的用户配置文件,升级前请`自行备份config-echarts.js`文件,以免被强制覆盖。 |
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -0,0 +1,201 @@ |
|||||||
|
Apache License |
||||||
|
Version 2.0, January 2004 |
||||||
|
http://www.apache.org/licenses/ |
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION |
||||||
|
|
||||||
|
1. Definitions. |
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction, |
||||||
|
and distribution as defined by Sections 1 through 9 of this document. |
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by |
||||||
|
the copyright owner that is granting the License. |
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all |
||||||
|
other entities that control, are controlled by, or are under common |
||||||
|
control with that entity. For the purposes of this definition, |
||||||
|
"control" means (i) the power, direct or indirect, to cause the |
||||||
|
direction or management of such entity, whether by contract or |
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the |
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity. |
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity |
||||||
|
exercising permissions granted by this License. |
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications, |
||||||
|
including but not limited to software source code, documentation |
||||||
|
source, and configuration files. |
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical |
||||||
|
transformation or translation of a Source form, including but |
||||||
|
not limited to compiled object code, generated documentation, |
||||||
|
and conversions to other media types. |
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or |
||||||
|
Object form, made available under the License, as indicated by a |
||||||
|
copyright notice that is included in or attached to the work |
||||||
|
(an example is provided in the Appendix below). |
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object |
||||||
|
form, that is based on (or derived from) the Work and for which the |
||||||
|
editorial revisions, annotations, elaborations, or other modifications |
||||||
|
represent, as a whole, an original work of authorship. For the purposes |
||||||
|
of this License, Derivative Works shall not include works that remain |
||||||
|
separable from, or merely link (or bind by name) to the interfaces of, |
||||||
|
the Work and Derivative Works thereof. |
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including |
||||||
|
the original version of the Work and any modifications or additions |
||||||
|
to that Work or Derivative Works thereof, that is intentionally |
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner |
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of |
||||||
|
the copyright owner. For the purposes of this definition, "submitted" |
||||||
|
means any form of electronic, verbal, or written communication sent |
||||||
|
to the Licensor or its representatives, including but not limited to |
||||||
|
communication on electronic mailing lists, source code control systems, |
||||||
|
and issue tracking systems that are managed by, or on behalf of, the |
||||||
|
Licensor for the purpose of discussing and improving the Work, but |
||||||
|
excluding communication that is conspicuously marked or otherwise |
||||||
|
designated in writing by the copyright owner as "Not a Contribution." |
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity |
||||||
|
on behalf of whom a Contribution has been received by Licensor and |
||||||
|
subsequently incorporated within the Work. |
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of |
||||||
|
this License, each Contributor hereby grants to You a perpetual, |
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
||||||
|
copyright license to reproduce, prepare Derivative Works of, |
||||||
|
publicly display, publicly perform, sublicense, and distribute the |
||||||
|
Work and such Derivative Works in Source or Object form. |
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of |
||||||
|
this License, each Contributor hereby grants to You a perpetual, |
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable |
||||||
|
(except as stated in this section) patent license to make, have made, |
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work, |
||||||
|
where such license applies only to those patent claims licensable |
||||||
|
by such Contributor that are necessarily infringed by their |
||||||
|
Contribution(s) alone or by combination of their Contribution(s) |
||||||
|
with the Work to which such Contribution(s) was submitted. If You |
||||||
|
institute patent litigation against any entity (including a |
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work |
||||||
|
or a Contribution incorporated within the Work constitutes direct |
||||||
|
or contributory patent infringement, then any patent licenses |
||||||
|
granted to You under this License for that Work shall terminate |
||||||
|
as of the date such litigation is filed. |
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the |
||||||
|
Work or Derivative Works thereof in any medium, with or without |
||||||
|
modifications, and in Source or Object form, provided that You |
||||||
|
meet the following conditions: |
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or |
||||||
|
Derivative Works a copy of this License; and |
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices |
||||||
|
stating that You changed the files; and |
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works |
||||||
|
that You distribute, all copyright, patent, trademark, and |
||||||
|
attribution notices from the Source form of the Work, |
||||||
|
excluding those notices that do not pertain to any part of |
||||||
|
the Derivative Works; and |
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its |
||||||
|
distribution, then any Derivative Works that You distribute must |
||||||
|
include a readable copy of the attribution notices contained |
||||||
|
within such NOTICE file, excluding those notices that do not |
||||||
|
pertain to any part of the Derivative Works, in at least one |
||||||
|
of the following places: within a NOTICE text file distributed |
||||||
|
as part of the Derivative Works; within the Source form or |
||||||
|
documentation, if provided along with the Derivative Works; or, |
||||||
|
within a display generated by the Derivative Works, if and |
||||||
|
wherever such third-party notices normally appear. The contents |
||||||
|
of the NOTICE file are for informational purposes only and |
||||||
|
do not modify the License. You may add Your own attribution |
||||||
|
notices within Derivative Works that You distribute, alongside |
||||||
|
or as an addendum to the NOTICE text from the Work, provided |
||||||
|
that such additional attribution notices cannot be construed |
||||||
|
as modifying the License. |
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and |
||||||
|
may provide additional or different license terms and conditions |
||||||
|
for use, reproduction, or distribution of Your modifications, or |
||||||
|
for any such Derivative Works as a whole, provided Your use, |
||||||
|
reproduction, and distribution of the Work otherwise complies with |
||||||
|
the conditions stated in this License. |
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise, |
||||||
|
any Contribution intentionally submitted for inclusion in the Work |
||||||
|
by You to the Licensor shall be under the terms and conditions of |
||||||
|
this License, without any additional terms or conditions. |
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify |
||||||
|
the terms of any separate license agreement you may have executed |
||||||
|
with Licensor regarding such Contributions. |
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade |
||||||
|
names, trademarks, service marks, or product names of the Licensor, |
||||||
|
except as required for reasonable and customary use in describing the |
||||||
|
origin of the Work and reproducing the content of the NOTICE file. |
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or |
||||||
|
agreed to in writing, Licensor provides the Work (and each |
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS, |
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
||||||
|
implied, including, without limitation, any warranties or conditions |
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A |
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the |
||||||
|
appropriateness of using or redistributing the Work and assume any |
||||||
|
risks associated with Your exercise of permissions under this License. |
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory, |
||||||
|
whether in tort (including negligence), contract, or otherwise, |
||||||
|
unless required by applicable law (such as deliberate and grossly |
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be |
||||||
|
liable to You for damages, including any direct, indirect, special, |
||||||
|
incidental, or consequential damages of any character arising as a |
||||||
|
result of this License or out of the use or inability to use the |
||||||
|
Work (including but not limited to damages for loss of goodwill, |
||||||
|
work stoppage, computer failure or malfunction, or any and all |
||||||
|
other commercial damages or losses), even if such Contributor |
||||||
|
has been advised of the possibility of such damages. |
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing |
||||||
|
the Work or Derivative Works thereof, You may choose to offer, |
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity, |
||||||
|
or other liability obligations and/or rights consistent with this |
||||||
|
License. However, in accepting such obligations, You may act only |
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf |
||||||
|
of any other Contributor, and only if You agree to indemnify, |
||||||
|
defend, and hold each Contributor harmless for any liability |
||||||
|
incurred by, or claims asserted against, such Contributor by reason |
||||||
|
of your accepting any such warranty or additional liability. |
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS |
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work. |
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following |
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]" |
||||||
|
replaced with your own identifying information. (Don't include |
||||||
|
the brackets!) The text should be enclosed in the appropriate |
||||||
|
comment syntax for the file format. We also recommend that a |
||||||
|
file or class name and description of purpose be included on the |
||||||
|
same "printed page" as the copyright notice for easier |
||||||
|
identification within third-party archives. |
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner] |
||||||
|
|
||||||
|
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. |
@ -0,0 +1,84 @@ |
|||||||
|
{ |
||||||
|
"id": "qiun-data-charts", |
||||||
|
"displayName": "秋云 ucharts echarts 高性能跨全端图表组件", |
||||||
|
"version": "2.4.3-20220505", |
||||||
|
"description": "uCharts 新增双指缩放、新增山峰图!支持H5及APP用 ucharts echarts 渲染图表,uniapp可视化首选组件", |
||||||
|
"keywords": [ |
||||||
|
"ucharts", |
||||||
|
"echarts", |
||||||
|
"f2", |
||||||
|
"图表", |
||||||
|
"可视化" |
||||||
|
], |
||||||
|
"repository": "https://gitee.com/uCharts/uCharts", |
||||||
|
"engines": { |
||||||
|
"HBuilderX": "^3.3.8" |
||||||
|
}, |
||||||
|
"dcloudext": { |
||||||
|
"category": [ |
||||||
|
"前端组件", |
||||||
|
"通用组件" |
||||||
|
], |
||||||
|
"sale": { |
||||||
|
"regular": { |
||||||
|
"price": "0.00" |
||||||
|
}, |
||||||
|
"sourcecode": { |
||||||
|
"price": "0.00" |
||||||
|
} |
||||||
|
}, |
||||||
|
"contact": { |
||||||
|
"qq": "474119" |
||||||
|
}, |
||||||
|
"declaration": { |
||||||
|
"ads": "无", |
||||||
|
"data": "插件不采集任何数据", |
||||||
|
"permissions": "无" |
||||||
|
}, |
||||||
|
"npmurl": "https://www.npmjs.com/~qiun" |
||||||
|
}, |
||||||
|
"uni_modules": { |
||||||
|
"dependencies": [], |
||||||
|
"encrypt": [], |
||||||
|
"platforms": { |
||||||
|
"cloud": { |
||||||
|
"tcb": "y", |
||||||
|
"aliyun": "y" |
||||||
|
}, |
||||||
|
"client": { |
||||||
|
"App": { |
||||||
|
"app-vue": "y", |
||||||
|
"app-nvue": "y" |
||||||
|
}, |
||||||
|
"H5-mobile": { |
||||||
|
"Safari": "y", |
||||||
|
"Android Browser": "y", |
||||||
|
"微信浏览器(Android)": "y", |
||||||
|
"QQ浏览器(Android)": "y" |
||||||
|
}, |
||||||
|
"H5-pc": { |
||||||
|
"Chrome": "y", |
||||||
|
"IE": "y", |
||||||
|
"Edge": "y", |
||||||
|
"Firefox": "y", |
||||||
|
"Safari": "y" |
||||||
|
}, |
||||||
|
"小程序": { |
||||||
|
"微信": "y", |
||||||
|
"阿里": "y", |
||||||
|
"百度": "y", |
||||||
|
"字节跳动": "y", |
||||||
|
"QQ": "y" |
||||||
|
}, |
||||||
|
"快应用": { |
||||||
|
"华为": "y", |
||||||
|
"联盟": "y" |
||||||
|
}, |
||||||
|
"Vue": { |
||||||
|
"vue2": "y", |
||||||
|
"vue3": "y" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,102 @@ |
|||||||
|
|
||||||
|
|
||||||
|
## <font color='red'>写给uCharts使用者的一封信</font> |
||||||
|
<font color='red'> |
||||||
|
亲爱的用户: |
||||||
|
|
||||||
|
- 由于最近上线的官网中实行了部分收费体验,收到了许多用户的使用反馈,大致反馈的问题都指向同一矛头:为何新官网的在线工具也要收费?对于这件事,我们深表歉意。由于新官网本身未提供技术文档,使得用户误以为我们对文档实行了收费。经我们连夜整改,新官网目前已经将技术文档开放出来供大家阅读使用,并免费对外开放了【演示】中的查看全端全平台的代码的功能,为此再次向所受影响的用户们致以诚恳的歉意。 |
||||||
|
|
||||||
|
- 其次,我们须澄清几点,如下: |
||||||
|
1. uCharts的插件本身遵循开源原则,并不收费,用户可自行到DCloud市场与Gitee码云上获取源码 |
||||||
|
2. uCharts的技术文档永久对用户开放 |
||||||
|
3. 收费内容仅针对原生工具、组件工具、定制功能以及模板市场的部分收费模板 |
||||||
|
|
||||||
|
- uCharts为什么实行收费原则? |
||||||
|
1. 服务器的费用支撑 |
||||||
|
2. 团队的运营支出;正如你所见,我们的群里有大量的用户在请教图表配置与反馈问题,群里的每一位管理员都在花费不少精力在积极解决用户的问题,然而遇到巨大的咨询量时,我们无法及时、精准解答回复,因此,我们推出了会员优先服务 |
||||||
|
3. 与其说模板市场是收费,倒不如说给野生用户提供了创造价值的机会,用户既可以在上面发布模板赚取费用,遇到心动的模板也能免费/付费使用 |
||||||
|
|
||||||
|
- 收费不是目的,正如你们所见,用户可以申请成为[【开发者】](https://www.ucharts.cn/v2/#/agreement/developer),开发者不限制任何官网功能,并享有官方指导、开发、改造uCharts的权力,并且活动期间【返还超级会员费用】!我们想说的是,我们新版官网上线旨在希望更多的用户加入到开发者的队伍,我们共同去维护uCharts! |
||||||
|
|
||||||
|
我们相信:星星之火可以燎原! |
||||||
|
|
||||||
|
uCharts技术团队 |
||||||
|
|
||||||
|
2022.4.23 |
||||||
|
|
||||||
|
</font> |
||||||
|
|
||||||
|
|
||||||
|
 |
||||||
|
|
||||||
|
|
||||||
|
[](https://gitee.com/uCharts/uCharts/stargazers) |
||||||
|
[](https://gitee.com/uCharts/uCharts/members) |
||||||
|
[](https://www.apache.org/licenses/LICENSE-2.0.html) |
||||||
|
[](https://www.npmjs.com/~qiun) |
||||||
|
|
||||||
|
|
||||||
|
## uCharts简介 |
||||||
|
|
||||||
|
`uCharts`是一款基于`canvas API`开发的适用于所有前端应用的图表库,开发者编写一套代码,可运行到 Web、iOS、Android(基于 uni-app / taro )、以及各种小程序(微信/支付宝/百度/头条/飞书/QQ/快手/钉钉/淘宝)、快应用等更多支持 canvas API 的平台。 |
||||||
|
|
||||||
|
## 官方网站 |
||||||
|
|
||||||
|
## [https://www.ucharts.cn](https://www.ucharts.cn) |
||||||
|
|
||||||
|
## 快速体验 |
||||||
|
|
||||||
|
一套代码编到多个平台,依次扫描二维码,亲自体验uCharts图表跨平台效果!其他平台请自行编译。 |
||||||
|
|
||||||
|
 |
||||||
|
|
||||||
|
## 致开发者 |
||||||
|
|
||||||
|
感谢各位开发者`四年`来对秋云及uCharts的支持,uCharts的进步离不开各位开发者的鼓励与贡献。为更好的帮助各位开发者使用图表工具,我们推出了新版官网,增加了在线定制、问答社区、在线配置等一些增值服务,为确保您能更好的应用图表组件,建议您先`仔细阅读本页指南`以及`常见问题`,而不是下载下来`直接使用`。如仍然不能解决,请到`官网社区`或开通会员后加入`专属VIP会员群`提问将会很快得到回答。 |
||||||
|
|
||||||
|
## 社群支持 |
||||||
|
|
||||||
|
uCharts官方拥有4个2000人的QQ群及专属VIP会员群支持,庞大的用户量证明我们一直在努力,请各位放心使用!uCharts的开源图表组件的开发,团队付出了大量的时间与精力,经过四来的考验,不会有比较明显的bug,请各位放心使用。如果您有更好的想法,可以在`码云提交Pull Requests`以帮助更多开发者完成需求,再次感谢各位对uCharts的鼓励与支持! |
||||||
|
|
||||||
|
#### 官方交流群 |
||||||
|
- 交流群1:371774600(已满) |
||||||
|
- 交流群2:619841586(已满) |
||||||
|
- 交流群3:955340127(已满) |
||||||
|
- 交流群4:641669795 |
||||||
|
- 口令`uniapp` |
||||||
|
|
||||||
|
#### 专属VIP会员群 |
||||||
|
- 开通会员后详见【账号详情】页面中顶部的滚动通知 |
||||||
|
- 口令`您的用户ID` |
||||||
|
|
||||||
|
## 版权信息 |
||||||
|
|
||||||
|
uCharts始终坚持开源,遵循 [Apache Licence 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) 开源协议,意味着您无需支付任何费用,即可将uCharts应用到您的产品中。 |
||||||
|
|
||||||
|
注意:这并不意味着您可以将uCharts应用到非法的领域,比如涉及赌博,暴力等方面。如因此产生纠纷或法律问题,uCharts相关方及秋云科技不承担任何责任。 |
||||||
|
|
||||||
|
## 合作伙伴 |
||||||
|
|
||||||
|
[](https://www.diygw.com/) |
||||||
|
[](https://gitee.com/howcode/has-chat) |
||||||
|
[](https://www.uviewui.com/) |
||||||
|
[](https://ext.dcloud.net.cn/plugin?id=7088) |
||||||
|
[](https://ext.dcloud.net.cn/publisher?id=202) |
||||||
|
[](https://www.firstui.cn/) |
||||||
|
[](https://ext.dcloud.net.cn/plugin?id=5169) |
||||||
|
[](https://www.graceui.com/) |
||||||
|
|
||||||
|
|
||||||
|
## 更新记录 |
||||||
|
|
||||||
|
详见官网指南中说明,[点击此处查看](https://www.ucharts.cn/v2/#/guide/index?id=100) |
||||||
|
|
||||||
|
|
||||||
|
## 相关链接 |
||||||
|
- [uCharts官网](https://www.ucharts.cn) |
||||||
|
- [DCloud插件市场地址](https://ext.dcloud.net.cn/plugin?id=271) |
||||||
|
- [uCharts码云开源托管地址](https://gitee.com/uCharts/uCharts) [](https://gitee.com/uCharts/uCharts/stargazers) |
||||||
|
- [uCharts npm开源地址](https://www.ucharts.cn) |
||||||
|
- [ECharts官网](https://echarts.apache.org/zh/index.html) |
||||||
|
- [ECharts配置手册](https://echarts.apache.org/zh/option.html) |
||||||
|
- [图表组件在项目中的应用 ReportPlus数据报表](https://www.ucharts.cn/v2/#/layout/info?id=1) |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,20 @@ |
|||||||
|
## 1.0.9(2022-07-28) |
||||||
|
- 完善是否创建新条目功能,并将默认值改为允许 |
||||||
|
## 1.0.8(2022-07-26) |
||||||
|
- 新增禁用选项和是否创建新条目功能,新增disabledColor和isAllowCreate属性 |
||||||
|
## 1.0.7(2022-05-05) |
||||||
|
- 解决传入JSON数组后,在模糊匹配项中进行选择,@select事件返回值为undefined且报错的问题 |
||||||
|
## 1.0.6(2022-03-24) |
||||||
|
- 新增@select事件 |
||||||
|
## 1.0.5(2022-03-22) |
||||||
|
- 修改文档 |
||||||
|
## 1.0.4(2022-03-18) |
||||||
|
- 新增isJSON和keyName属性,candidates支持JSON数组格式 |
||||||
|
## 1.0.3(2022-03-01) |
||||||
|
- 调整为uni_modules目录规范 |
||||||
|
## 1.0.2(2022-03-01) |
||||||
|
- 基于官方uni-combox组件,解决选择后再次选择不展示全部选项的问题,同时新增选中项默认的文字和背景颜色,也可自定义进行样式覆盖 |
||||||
|
## 1.0.1(2022-03-01) |
||||||
|
- 无 |
||||||
|
## 1.0.0(2022-03-01) |
||||||
|
- 无 |
@ -0,0 +1,402 @@ |
|||||||
|
<template> |
||||||
|
<view class="superwei-combox" :class="border ? '' : 'superwei-combox__no-border'"> |
||||||
|
<view v-if="label" class="superwei-combox__label" :style="labelStyle"> |
||||||
|
<text>{{label}}</text> |
||||||
|
</view> |
||||||
|
<view class="superwei-combox__input-box"> |
||||||
|
<input class="superwei-combox__input" type="text" :placeholder="placeholder" |
||||||
|
placeholder-class="superwei-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus" |
||||||
|
@blur="onBlur" /> |
||||||
|
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector"> |
||||||
|
</uni-icons> |
||||||
|
</view> |
||||||
|
<view class="superwei-combox__selector" v-if="showSelector"> |
||||||
|
<view class="uni-popper__arrow"></view> |
||||||
|
<scroll-view scroll-y="true" class="superwei-combox__selector-scroll"> |
||||||
|
<view class="superwei-combox__selector-empty" v-if="filterCandidatesLength === 0"> |
||||||
|
<text>{{emptyTips}}</text> |
||||||
|
</view> |
||||||
|
<view class="superwei-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index"> |
||||||
|
<template v-if="(isJSON?(item.disabled?true:false):false)"> |
||||||
|
<text |
||||||
|
:style="'color:'+disabledColor+';cursor: not-allowed;'">{{isJSON?item[keyName]?item[keyName]:'字段'+keyName+'不存在':item}}</text> |
||||||
|
</template> |
||||||
|
<template v-else> |
||||||
|
<text @click="onSelectorClick(index)" |
||||||
|
:style="(isJSON?item[keyName]?item[keyName]==inputVal:false:item==inputVal)?'font-weight: bold;background-color: '+selectedBackground+';color: '+selectedColor:''">{{isJSON?item[keyName]?item[keyName]:'字段'+keyName+'不存在':item}}</text> |
||||||
|
</template> |
||||||
|
</view> |
||||||
|
</scroll-view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
/** |
||||||
|
* Combox 组合输入框 |
||||||
|
* @description 组合输入框一般用于既可以输入也可以选择的场景 |
||||||
|
* @property {String} label 左侧文字 |
||||||
|
* @property {String} labelWidth 左侧内容宽度 |
||||||
|
* @property {String} placeholder 输入框占位符 |
||||||
|
* @property {Array} candidates 候选项列表 |
||||||
|
* @property {String} emptyTips 筛选结果为空时显示的文字 |
||||||
|
* @property {String} value 组合框的值 |
||||||
|
* @property {String} selectedBackground 选中项背景颜色 |
||||||
|
* @property {String} selectedColor 选中项文字颜色 |
||||||
|
* @property {Boolean} isJSON 是否是json数组 |
||||||
|
* @property {String} keyName json数组显示的字段值 |
||||||
|
* @property {String} disabledColor 禁用项文字颜色 |
||||||
|
* @property {Boolean} isAllowCreate 是否允许用户创建新条目 |
||||||
|
*/ |
||||||
|
export default { |
||||||
|
name: 'superweiCombox', |
||||||
|
emits: ['input', 'update:modelValue', 'select'], |
||||||
|
props: { |
||||||
|
isAllowCreate: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
}, |
||||||
|
disabledColor: { |
||||||
|
type: String, |
||||||
|
default: '#ababac' |
||||||
|
}, |
||||||
|
isJSON: { |
||||||
|
type: Boolean, |
||||||
|
default: false |
||||||
|
}, |
||||||
|
keyName: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
selectedBackground: { |
||||||
|
type: String, |
||||||
|
default: '#f5f7fa' |
||||||
|
}, |
||||||
|
selectedColor: { |
||||||
|
type: String, |
||||||
|
default: '#409eff' |
||||||
|
}, |
||||||
|
border: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
}, |
||||||
|
label: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
labelWidth: { |
||||||
|
type: String, |
||||||
|
default: 'auto' |
||||||
|
}, |
||||||
|
placeholder: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
candidates: { |
||||||
|
type: Array, |
||||||
|
default () { |
||||||
|
return [] |
||||||
|
} |
||||||
|
}, |
||||||
|
emptyTips: { |
||||||
|
type: String, |
||||||
|
default: '无匹配项' |
||||||
|
}, |
||||||
|
// #ifndef VUE3 |
||||||
|
value: { |
||||||
|
type: [String, Number], |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
// #ifdef VUE3 |
||||||
|
modelValue: { |
||||||
|
type: [String, Number], |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
isInput: false, |
||||||
|
showSelector: false, |
||||||
|
isSelector: false, |
||||||
|
inputVal: '' |
||||||
|
} |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
labelStyle() { |
||||||
|
if (this.labelWidth === 'auto') { |
||||||
|
return "" |
||||||
|
} |
||||||
|
return `width: ${this.labelWidth}` |
||||||
|
}, |
||||||
|
filterCandidates() { |
||||||
|
if (this.isInput) { |
||||||
|
if (this.isJSON) { |
||||||
|
return this.candidates.filter((item) => { |
||||||
|
return item[this.keyName].toString().indexOf(this.inputVal) > -1 |
||||||
|
}) |
||||||
|
} else { |
||||||
|
return this.candidates.filter((item) => { |
||||||
|
return item.toString().indexOf(this.inputVal) > -1 |
||||||
|
}) |
||||||
|
} |
||||||
|
} else { |
||||||
|
return this.candidates |
||||||
|
} |
||||||
|
}, |
||||||
|
filterCandidatesLength() { |
||||||
|
return this.filterCandidates.length |
||||||
|
} |
||||||
|
}, |
||||||
|
watch: { |
||||||
|
// #ifndef VUE3 |
||||||
|
value: { |
||||||
|
handler(newVal) { |
||||||
|
this.inputVal = newVal |
||||||
|
this.isInput = true |
||||||
|
}, |
||||||
|
immediate: true |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
// #ifdef VUE3 |
||||||
|
modelValue: { |
||||||
|
handler(newVal) { |
||||||
|
this.inputVal = newVal |
||||||
|
this.isInput = true |
||||||
|
}, |
||||||
|
immediate: true |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
toggleSelector() { |
||||||
|
this.showSelector = !this.showSelector |
||||||
|
this.isInput = false |
||||||
|
}, |
||||||
|
onFocus() { |
||||||
|
this.showSelector = true |
||||||
|
this.isInput = false |
||||||
|
}, |
||||||
|
onChange() { |
||||||
|
setTimeout(() => { |
||||||
|
// this.showSelector = false |
||||||
|
this.isInput = false |
||||||
|
}, 200) |
||||||
|
}, |
||||||
|
onBlur() { |
||||||
|
if (!this.isInput) { |
||||||
|
this.onChange() |
||||||
|
} else { |
||||||
|
if (this.inputVal && !this.isAllowCreate) { |
||||||
|
let index = this.candidates.findIndex((item) => { |
||||||
|
if (this.isJSON) { |
||||||
|
return item[this.keyName].toString() == this.inputVal && !item.disabled |
||||||
|
} else { |
||||||
|
return item.toString() == this.inputVal |
||||||
|
} |
||||||
|
}) |
||||||
|
if (index == -1) { |
||||||
|
if (this.filterCandidatesLength > 0) { |
||||||
|
setTimeout(() => { |
||||||
|
this.showSelector = false |
||||||
|
this.isInput = false |
||||||
|
if (!this.isSelector) { |
||||||
|
this.inputVal = '' |
||||||
|
this.$emit('input', this.inputVal) |
||||||
|
this.$emit('update:modelValue', this.inputVal) |
||||||
|
} |
||||||
|
}, 200) |
||||||
|
this.isSelector = false |
||||||
|
} else { |
||||||
|
this.showSelector = false |
||||||
|
this.isInput = false |
||||||
|
this.inputVal = '' |
||||||
|
this.$emit('input', this.inputVal) |
||||||
|
this.$emit('update:modelValue', this.inputVal) |
||||||
|
} |
||||||
|
} else { |
||||||
|
this.onChange() |
||||||
|
} |
||||||
|
} else { |
||||||
|
this.onChange() |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
onSelectorClick(index) { |
||||||
|
let item = this.filterCandidates[index] |
||||||
|
if (this.isJSON) { |
||||||
|
this.inputVal = item[this.keyName] |
||||||
|
} else { |
||||||
|
this.inputVal = item |
||||||
|
} |
||||||
|
this.showSelector = false |
||||||
|
this.isSelector = true |
||||||
|
this.$emit('input', this.inputVal) |
||||||
|
this.$emit('update:modelValue', this.inputVal) |
||||||
|
this.$emit('select', item) |
||||||
|
}, |
||||||
|
onInput() { |
||||||
|
setTimeout(() => { |
||||||
|
this.$emit('input', this.inputVal) |
||||||
|
this.$emit('update:modelValue', this.inputVal) |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang="scss" scoped> |
||||||
|
@media only screen and (max-width: 999px) { |
||||||
|
|
||||||
|
/* 针对手机: */ |
||||||
|
.superwei-combox { |
||||||
|
font-size: 14px; |
||||||
|
border: 0px solid #12b7f5; |
||||||
|
border-radius: 4px; |
||||||
|
padding: 6px 10px; |
||||||
|
position: relative; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
// height: 40px; |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
// border-bottom: solid 1px #DDDDDD; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@media only screen and (min-width: 1000px) { |
||||||
|
|
||||||
|
/* 针对手机: */ |
||||||
|
.superwei-combox { |
||||||
|
font-size: 14px; |
||||||
|
border: 2px solid #12b7f5; |
||||||
|
border-radius: 4px; |
||||||
|
padding: 6px 10px; |
||||||
|
position: relative; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
// height: 40px; |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
// border-bottom: solid 1px #DDDDDD; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__label { |
||||||
|
font-size: 16px; |
||||||
|
line-height: 22px; |
||||||
|
padding-right: 10px; |
||||||
|
color: #999999; |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__input-box { |
||||||
|
position: relative; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex: 1; |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__input { |
||||||
|
flex: 1; |
||||||
|
font-size: 14px; |
||||||
|
height: 22px; |
||||||
|
line-height: 22px; |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__input-plac { |
||||||
|
font-size: 14px; |
||||||
|
color: #ccc; //placeholder-style="color:#FFFFFF" |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__selector { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
box-sizing: border-box; |
||||||
|
/* #endif */ |
||||||
|
position: absolute; |
||||||
|
top: calc(100% + 12px); |
||||||
|
left: 0; |
||||||
|
width: 100%; |
||||||
|
background-color: #FFFFFF; |
||||||
|
border: 1px solid #EBEEF5; |
||||||
|
border-radius: 6px; |
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
||||||
|
z-index: 2; |
||||||
|
padding: 4px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__selector-scroll { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
max-height: 200px; |
||||||
|
box-sizing: border-box; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__selector-empty, |
||||||
|
.superwei-combox__selector-item { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
cursor: pointer; |
||||||
|
/* #endif */ |
||||||
|
line-height: 36px; |
||||||
|
font-size: 14px; |
||||||
|
text-align: center; |
||||||
|
// border-bottom: solid 1px #DDDDDD; |
||||||
|
padding: 0px 0px; |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__selector-empty text, |
||||||
|
.superwei-combox__selector-item text { |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__selector-item:hover { |
||||||
|
background-color: #f9f9f9; |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__selector-empty:last-child, |
||||||
|
.superwei-combox__selector-item:last-child { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
border-bottom: none; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
// picker 弹出层通用的指示小三角 |
||||||
|
.uni-popper__arrow, |
||||||
|
.uni-popper__arrow::after { |
||||||
|
position: absolute; |
||||||
|
display: block; |
||||||
|
width: 0; |
||||||
|
height: 0; |
||||||
|
border-color: transparent; |
||||||
|
border-style: solid; |
||||||
|
border-width: 6px; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-popper__arrow { |
||||||
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); |
||||||
|
top: -6px; |
||||||
|
left: 10%; |
||||||
|
margin-right: 3px; |
||||||
|
border-top-width: 0; |
||||||
|
border-bottom-color: #EBEEF5; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-popper__arrow::after { |
||||||
|
content: " "; |
||||||
|
top: 1px; |
||||||
|
margin-left: -6px; |
||||||
|
border-top-width: 0; |
||||||
|
border-bottom-color: #fff; |
||||||
|
} |
||||||
|
|
||||||
|
.superwei-combox__no-border { |
||||||
|
border: none; |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,89 @@ |
|||||||
|
{ |
||||||
|
"id": "superwei-combox", |
||||||
|
"displayName": "superwei-combox 组合框", |
||||||
|
"version": "1.0.9", |
||||||
|
"description": "下拉搜索选择组合框,基于官方uni-combox组件,解决选择后再次选择不展示全部选项的问题,支持模糊搜索和JSON数组格式,可设置选中项文字和背景颜色(若使用请一定下载uni_modules版本)", |
||||||
|
"keywords": [ |
||||||
|
"combox", |
||||||
|
"组合框", |
||||||
|
"select", |
||||||
|
"下拉选择", |
||||||
|
"搜索选择" |
||||||
|
], |
||||||
|
"repository": "", |
||||||
|
"engines": { |
||||||
|
}, |
||||||
|
"directories": { |
||||||
|
"example": "../../temps/example_temps" |
||||||
|
}, |
||||||
|
"dcloudext": { |
||||||
|
"category": [ |
||||||
|
"前端组件", |
||||||
|
"通用组件" |
||||||
|
], |
||||||
|
"sale": { |
||||||
|
"regular": { |
||||||
|
"price": "0.00" |
||||||
|
}, |
||||||
|
"sourcecode": { |
||||||
|
"price": "0.00" |
||||||
|
} |
||||||
|
}, |
||||||
|
"contact": { |
||||||
|
"qq": "" |
||||||
|
}, |
||||||
|
"declaration": { |
||||||
|
"ads": "无", |
||||||
|
"data": "无", |
||||||
|
"permissions": "无" |
||||||
|
}, |
||||||
|
"npmurl": "" |
||||||
|
}, |
||||||
|
"uni_modules": { |
||||||
|
"dependencies": [ |
||||||
|
"uni-scss", |
||||||
|
"uni-icons" |
||||||
|
], |
||||||
|
"encrypt": [], |
||||||
|
"platforms": { |
||||||
|
"cloud": { |
||||||
|
"tcb": "y", |
||||||
|
"aliyun": "y" |
||||||
|
}, |
||||||
|
"client": { |
||||||
|
"App": { |
||||||
|
"app-vue": "y", |
||||||
|
"app-nvue": "n" |
||||||
|
}, |
||||||
|
"H5-mobile": { |
||||||
|
"Safari": "y", |
||||||
|
"Android Browser": "y", |
||||||
|
"微信浏览器(Android)": "y", |
||||||
|
"QQ浏览器(Android)": "y" |
||||||
|
}, |
||||||
|
"H5-pc": { |
||||||
|
"Chrome": "y", |
||||||
|
"IE": "y", |
||||||
|
"Edge": "y", |
||||||
|
"Firefox": "y", |
||||||
|
"Safari": "y" |
||||||
|
}, |
||||||
|
"小程序": { |
||||||
|
"微信": "y", |
||||||
|
"阿里": "y", |
||||||
|
"百度": "y", |
||||||
|
"字节跳动": "y", |
||||||
|
"QQ": "y" |
||||||
|
}, |
||||||
|
"快应用": { |
||||||
|
"华为": "u", |
||||||
|
"联盟": "u" |
||||||
|
}, |
||||||
|
"Vue": { |
||||||
|
"vue2": "y", |
||||||
|
"vue3": "y" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,77 @@ |
|||||||
|
## 基本用法 |
||||||
|
在 ``template`` 中使用组件 |
||||||
|
```html |
||||||
|
<superwei-combox :candidates="candidates" placeholder="请选择或输入" v-model="inputValue" @input="input" @select="select"></superwei-combox> |
||||||
|
<script> |
||||||
|
export default { |
||||||
|
data() { |
||||||
|
return { |
||||||
|
candidates: ['选项一','选项二','选项三','选项四','...'] |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
input(e){ |
||||||
|
console.log(e) // 选项一 |
||||||
|
}, |
||||||
|
select(e){ |
||||||
|
console.log(e) // 选项一 |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<superwei-combox :candidates="candidates" :isJSON="true" keyName="name" placeholder="请选择或输入" v-model="inputValue" @input="input" @select="select"></superwei-combox> |
||||||
|
<script> |
||||||
|
export default { |
||||||
|
data() { |
||||||
|
return { |
||||||
|
candidates: [{ |
||||||
|
id: '1', |
||||||
|
name: '选项一' |
||||||
|
}, { |
||||||
|
id: '2', |
||||||
|
name: '选项二', |
||||||
|
disabled: true // 单独设置disabled后即可禁用该选项 |
||||||
|
}, { |
||||||
|
id: '3', |
||||||
|
name: '...' |
||||||
|
}] |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
input(e){ |
||||||
|
console.log(e) // 选项一 |
||||||
|
}, |
||||||
|
select(e){ |
||||||
|
console.log(e) // {id: '1',name: '选项一'} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
``` |
||||||
|
|
||||||
|
## API |
||||||
|
|
||||||
|
### Combox Props |
||||||
|
|
||||||
|
|属性名 |类型 |默认值 |说明 | |
||||||
|
|:-: |:-: |:-: |:-: | |
||||||
|
|label |String |- |标签文字 | |
||||||
|
|value |String |- |combox的值 | |
||||||
|
|labelWidth |String |auto |标签宽度,有单位字符串,如:'100px' | |
||||||
|
|placeholder|String |- |输入框占位符 | |
||||||
|
|candidates |Array/String |[] |候选字段 | |
||||||
|
|emptyTips |String |无匹配项 |无匹配项时的提示语 | |
||||||
|
|selectedBackground |String |#f5f7fa |选中项背景颜色 | |
||||||
|
|selectedColor |String |#409eff |选中项文字颜色 | |
||||||
|
|isJSON |Boolean |false |候选字段是否是json数组 | |
||||||
|
|keyName |String |- |json数组显示的字段值 | |
||||||
|
|disabledColor |String |#ababac |禁用项文字颜色 | |
||||||
|
|isAllowCreate |Boolean |true |是否允许用户创建新条目 | |
||||||
|
|
||||||
|
### Combox Events |
||||||
|
|
||||||
|
|事件称名 |说明 |返回值 | |
||||||
|
|:-: |:-: |:-: | |
||||||
|
|@input |combox输入事件 |返回combox输入值| |
||||||
|
|@select|combox选择事件 |返回combox选项值| |
@ -0,0 +1,15 @@ |
|||||||
|
## 1.0.1(2021-11-23) |
||||||
|
- 优化 label、label-width 属性 |
||||||
|
## 1.0.0(2021-11-19) |
||||||
|
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) |
||||||
|
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-combox](https://uniapp.dcloud.io/component/uniui/uni-combox) |
||||||
|
## 0.1.0(2021-07-30) |
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) |
||||||
|
## 0.0.6(2021-05-12) |
||||||
|
- 新增 组件示例地址 |
||||||
|
## 0.0.5(2021-04-21) |
||||||
|
- 优化 添加依赖 uni-icons, 导入后自动下载依赖 |
||||||
|
## 0.0.4(2021-02-05) |
||||||
|
- 优化 组件引用关系,通过uni_modules引用组件 |
||||||
|
## 0.0.3(2021-02-04) |
||||||
|
- 调整为uni_modules目录规范 |
@ -0,0 +1,335 @@ |
|||||||
|
<template> |
||||||
|
<view class="uni-combox" :class="border ? '' : 'uni-combox__no-border'"> |
||||||
|
<view class="uni-combox__selector" v-if="showSelector"> |
||||||
|
<view class="uni-popper__arrow"></view> |
||||||
|
<scroll-view scroll-y="true" class="uni-combox__selector-scroll"> |
||||||
|
<view class="uni-combox__selector-empty" v-if="filterCandidatesLength === 0"> |
||||||
|
<text>{{emptyTips}}</text> |
||||||
|
</view> |
||||||
|
<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index" |
||||||
|
@click="onSelectorClick(index)"> |
||||||
|
<text>{{item[`${labelKey}`]}}</text> |
||||||
|
</view> |
||||||
|
</scroll-view> |
||||||
|
</view> |
||||||
|
<view v-if="false" 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-class="uni-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus" |
||||||
|
@blur="onBlur" /> |
||||||
|
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector"> |
||||||
|
</uni-icons> |
||||||
|
</view> |
||||||
|
|
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
/** |
||||||
|
* Combox 组合输入框 |
||||||
|
* @description 组合输入框一般用于既可以输入也可以选择的场景 |
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=1261 |
||||||
|
* @property {String} label 左侧文字 |
||||||
|
* @property {String} labelWidth 左侧内容宽度 |
||||||
|
* @property {String} placeholder 输入框占位符 |
||||||
|
* @property {Array} candidates 候选项列表 |
||||||
|
* @property {String} emptyTips 筛选结果为空时显示的文字 |
||||||
|
* @property {String} value 组合框的值 |
||||||
|
*/ |
||||||
|
export default { |
||||||
|
name: 'uniCombox', |
||||||
|
emits: ['input', 'update:modelValue'], |
||||||
|
props: { |
||||||
|
border: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
}, |
||||||
|
label: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
labelWidth: { |
||||||
|
type: String, |
||||||
|
default: 'auto' |
||||||
|
}, |
||||||
|
placeholder: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
candidates: { |
||||||
|
type: Array, |
||||||
|
default () { |
||||||
|
return [] |
||||||
|
} |
||||||
|
}, |
||||||
|
emptyTips: { |
||||||
|
type: String, |
||||||
|
default: '无匹配项' |
||||||
|
}, |
||||||
|
labelKey: { |
||||||
|
type: String, |
||||||
|
default: 'dictName' |
||||||
|
}, |
||||||
|
valueKey:{ |
||||||
|
type: String, |
||||||
|
default: 'dictId' |
||||||
|
}, |
||||||
|
// #ifndef VUE3 |
||||||
|
value: { |
||||||
|
type: [String, Number], |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
// #ifdef VUE3 |
||||||
|
modelValue: { |
||||||
|
type: [String, Number], |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
showSelector: false, |
||||||
|
inputVal: '', |
||||||
|
dictVal:"", |
||||||
|
filterCandidates:[] |
||||||
|
} |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
labelStyle() { |
||||||
|
if (this.labelWidth === 'auto') { |
||||||
|
return "" |
||||||
|
} |
||||||
|
return `width: ${this.labelWidth}` |
||||||
|
}, |
||||||
|
// 为了点击选择能够显示所有选项,把这个filterCandidates放在data中 |
||||||
|
// filterCandidates() { |
||||||
|
// return this.candidates.filter((item) => { |
||||||
|
// console.log(item,this.labelKey) |
||||||
|
// return item[`${this.labelKey}`].toString().indexOf(this.inputVal) > -1 |
||||||
|
// }) |
||||||
|
// }, |
||||||
|
filterCandidatesLength() { |
||||||
|
return this.filterCandidates.length |
||||||
|
} |
||||||
|
}, |
||||||
|
watch: { |
||||||
|
// #ifndef VUE3 |
||||||
|
value: { |
||||||
|
handler(newVal) { |
||||||
|
this.dictVal = newVal |
||||||
|
}, |
||||||
|
immediate: true |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
// #ifndef VUE3 |
||||||
|
// 因为获取列表是个异步的过程,需要对列表进行监听 |
||||||
|
candidates: function(arr){ |
||||||
|
if(arr.length>0 && this.dictVal){ |
||||||
|
let obj = arr.find((item,index) => { |
||||||
|
return this.dictVal == item[`${this.valueKey}`] |
||||||
|
}) |
||||||
|
this.inputVal = obj[`${this.labelKey}`] |
||||||
|
|
||||||
|
} |
||||||
|
this.filterCandidates = arr.filter((item) => { |
||||||
|
return item[`${this.labelKey}`].toString().indexOf(this.inputVal) > -1 |
||||||
|
}) |
||||||
|
console.log("#####",this.filterCandidates) |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
// #ifdef VUE3 |
||||||
|
modelValue: { |
||||||
|
handler(newVal) { |
||||||
|
// this.inputVal = newVal |
||||||
|
if( this.candidates.length>0){ |
||||||
|
let obj = this.candidates.find((item,index) => { |
||||||
|
return newVal == item[`${this.valueKey}`] |
||||||
|
}) |
||||||
|
this.inputVal = obj[`${this.labelKey}`] |
||||||
|
} |
||||||
|
}, |
||||||
|
immediate: true |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
// #ifdef VUE3 |
||||||
|
modelValue: { |
||||||
|
handler(newVal) { |
||||||
|
// this.inputVal = newVal |
||||||
|
if( this.candidates.length>0){ |
||||||
|
let obj = this.candidates.find((item,index) => { |
||||||
|
return newVal == item[`${this.valueKey}`] |
||||||
|
}) |
||||||
|
this.inputVal = obj[`${this.labelKey}`] |
||||||
|
} |
||||||
|
}, |
||||||
|
immediate: true |
||||||
|
}, |
||||||
|
// #endif |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
toggleSelector() { |
||||||
|
this.showSelector = !this.showSelector |
||||||
|
}, |
||||||
|
onFocus() { |
||||||
|
this.filterCandidates = this.candidates |
||||||
|
this.showSelector = true |
||||||
|
|
||||||
|
}, |
||||||
|
onBlur() { |
||||||
|
setTimeout(() => { |
||||||
|
this.showSelector = false |
||||||
|
|
||||||
|
}, 153) |
||||||
|
}, |
||||||
|
onSelectorClick(index) { |
||||||
|
this.dictVal = this.filterCandidates[index][`${this.valueKey}`] |
||||||
|
//this.dictVal 的赋值一定要在this.inputVal前执行, |
||||||
|
//因为this.filterCandidates会监听this.inputVal的变化被重新赋值 |
||||||
|
//这样在选择列表中非第一个选项会报错 |
||||||
|
this.inputVal = this.filterCandidates[index][`${this.labelKey}`] |
||||||
|
this.showSelector = false |
||||||
|
this.$emit('input',this.dictVal) |
||||||
|
this.$emit('update:modelValue', this.dictVal) |
||||||
|
}, |
||||||
|
onInput() { |
||||||
|
this.filterCandidates = this.candidates.filter((item) => { |
||||||
|
// console.log(item,this.labelKey) |
||||||
|
return item[`${this.labelKey}`].toString().indexOf(this.inputVal) > -1 |
||||||
|
}) |
||||||
|
setTimeout(() => { |
||||||
|
this.$emit('input', this.dictVal) |
||||||
|
this.$emit('update:modelValue', this.dictVal) |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang="scss" > |
||||||
|
.uni-combox { |
||||||
|
font-size: 14px; |
||||||
|
border: 1px solid #DCDFE6; |
||||||
|
border-radius: 4px; |
||||||
|
padding: 6px 10px; |
||||||
|
position: relative; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
// height: 40px; |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
// border-bottom: solid 1px #DDDDDD; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__label { |
||||||
|
font-size: 16px; |
||||||
|
line-height: 22px; |
||||||
|
padding-right: 10px; |
||||||
|
color: #999999; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__input-box { |
||||||
|
position: relative; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex: 1; |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__input { |
||||||
|
flex: 1; |
||||||
|
font-size: 14px; |
||||||
|
height: 22px; |
||||||
|
line-height: 22px; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__input-plac { |
||||||
|
font-size: 14px; |
||||||
|
color: #999; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__selector { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
box-sizing: border-box; |
||||||
|
/* #endif */ |
||||||
|
position: absolute; |
||||||
|
top: calc(100% + 12px); |
||||||
|
left: 0; |
||||||
|
width: 100%; |
||||||
|
background-color: #FFFFFF; |
||||||
|
border: 1px solid #EBEEF5; |
||||||
|
border-radius: 6px; |
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
||||||
|
z-index: 99; |
||||||
|
padding: 4px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__selector-scroll { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
max-height: 200px; |
||||||
|
box-sizing: border-box; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__selector-empty, |
||||||
|
.uni-combox__selector-item { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
cursor: pointer; |
||||||
|
/* #endif */ |
||||||
|
line-height: 36px; |
||||||
|
font-size: 14px; |
||||||
|
text-align: center; |
||||||
|
// border-bottom: solid 1px #DDDDDD; |
||||||
|
padding: 0px 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__selector-item:hover { |
||||||
|
background-color: #f9f9f9; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__selector-empty:last-child, |
||||||
|
.uni-combox__selector-item:last-child { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
border-bottom: none; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
// picker 弹出层通用的指示小三角 |
||||||
|
.uni-popper__arrow, |
||||||
|
.uni-popper__arrow::after { |
||||||
|
position: absolute; |
||||||
|
display: block; |
||||||
|
width: 0; |
||||||
|
height: 0; |
||||||
|
border-color: transparent; |
||||||
|
border-style: solid; |
||||||
|
border-width: 6px; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-popper__arrow { |
||||||
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); |
||||||
|
top: -6px; |
||||||
|
left: 10%; |
||||||
|
margin-right: 3px; |
||||||
|
border-top-width: 0; |
||||||
|
border-bottom-color: #EBEEF5; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-popper__arrow::after { |
||||||
|
content: " "; |
||||||
|
top: 1px; |
||||||
|
margin-left: -6px; |
||||||
|
border-top-width: 0; |
||||||
|
border-bottom-color: #fff; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-combox__no-border { |
||||||
|
border: none; |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,90 @@ |
|||||||
|
{ |
||||||
|
"id": "uni-combox", |
||||||
|
"displayName": "uni-combox 组合框", |
||||||
|
"version": "1.0.1", |
||||||
|
"description": "可以选择也可以输入的表单项 ", |
||||||
|
"keywords": [ |
||||||
|
"uni-ui", |
||||||
|
"uniui", |
||||||
|
"combox", |
||||||
|
"组合框", |
||||||
|
"select" |
||||||
|
], |
||||||
|
"repository": "https://github.com/dcloudio/uni-ui", |
||||||
|
"engines": { |
||||||
|
"HBuilderX": "" |
||||||
|
}, |
||||||
|
"directories": { |
||||||
|
"example": "../../temps/example_temps" |
||||||
|
}, |
||||||
|
"dcloudext": { |
||||||
|
"category": [ |
||||||
|
"前端组件", |
||||||
|
"通用组件" |
||||||
|
], |
||||||
|
"sale": { |
||||||
|
"regular": { |
||||||
|
"price": "0.00" |
||||||
|
}, |
||||||
|
"sourcecode": { |
||||||
|
"price": "0.00" |
||||||
|
} |
||||||
|
}, |
||||||
|
"contact": { |
||||||
|
"qq": "" |
||||||
|
}, |
||||||
|
"declaration": { |
||||||
|
"ads": "无", |
||||||
|
"data": "无", |
||||||
|
"permissions": "无" |
||||||
|
}, |
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" |
||||||
|
}, |
||||||
|
"uni_modules": { |
||||||
|
"dependencies": [ |
||||||
|
"uni-scss", |
||||||
|
"uni-icons" |
||||||
|
], |
||||||
|
"encrypt": [], |
||||||
|
"platforms": { |
||||||
|
"cloud": { |
||||||
|
"tcb": "y", |
||||||
|
"aliyun": "y" |
||||||
|
}, |
||||||
|
"client": { |
||||||
|
"App": { |
||||||
|
"app-vue": "y", |
||||||
|
"app-nvue": "n" |
||||||
|
}, |
||||||
|
"H5-mobile": { |
||||||
|
"Safari": "y", |
||||||
|
"Android Browser": "y", |
||||||
|
"微信浏览器(Android)": "y", |
||||||
|
"QQ浏览器(Android)": "y" |
||||||
|
}, |
||||||
|
"H5-pc": { |
||||||
|
"Chrome": "y", |
||||||
|
"IE": "y", |
||||||
|
"Edge": "y", |
||||||
|
"Firefox": "y", |
||||||
|
"Safari": "y" |
||||||
|
}, |
||||||
|
"小程序": { |
||||||
|
"微信": "y", |
||||||
|
"阿里": "y", |
||||||
|
"百度": "y", |
||||||
|
"字节跳动": "y", |
||||||
|
"QQ": "y" |
||||||
|
}, |
||||||
|
"快应用": { |
||||||
|
"华为": "u", |
||||||
|
"联盟": "u" |
||||||
|
}, |
||||||
|
"Vue": { |
||||||
|
"vue2": "y", |
||||||
|
"vue3": "y" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
|
||||||
|
|
||||||
|
## Combox 组合框 |
||||||
|
> **组件名:uni-combox** |
||||||
|
> 代码块: `uCombox` |
||||||
|
|
||||||
|
|
||||||
|
组合框组件。 |
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-combox) |
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 |
@ -0,0 +1,64 @@ |
|||||||
|
## 1.0.7(2022-07-06) |
||||||
|
- 优化 pc端图标位置不正确的问题 |
||||||
|
## 1.0.6(2022-07-05) |
||||||
|
- 优化 显示样式 |
||||||
|
## 1.0.5(2022-07-04) |
||||||
|
- 修复 uni-data-picker 在 uni-forms-item 中宽度不正确的bug |
||||||
|
## 1.0.4(2022-04-19) |
||||||
|
- 修复 字节小程序 本地数据无法选择下一级的Bug |
||||||
|
## 1.0.3(2022-02-25) |
||||||
|
- 修复 nvue 不支持的 v-show 的 bug |
||||||
|
## 1.0.2(2022-02-25) |
||||||
|
- 修复 条件编译 nvue 不支持的 css 样式 |
||||||
|
## 1.0.1(2021-11-23) |
||||||
|
- 修复 由上个版本引发的map、v-model等属性不生效的bug |
||||||
|
## 1.0.0(2021-11-19) |
||||||
|
- 优化 组件 UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) |
||||||
|
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-data-picker](https://uniapp.dcloud.io/component/uniui/uni-data-picker) |
||||||
|
## 0.4.9(2021-10-28) |
||||||
|
- 修复 VUE2 v-model 概率无效的 bug |
||||||
|
## 0.4.8(2021-10-27) |
||||||
|
- 修复 v-model 概率无效的 bug |
||||||
|
## 0.4.7(2021-10-25) |
||||||
|
- 新增 属性 spaceInfo 服务空间配置 HBuilderX 3.2.11+ |
||||||
|
- 修复 树型 uniCloud 数据类型为 int 时报错的 bug |
||||||
|
## 0.4.6(2021-10-19) |
||||||
|
- 修复 非 VUE3 v-model 为 0 时无法选中的 bug |
||||||
|
## 0.4.5(2021-09-26) |
||||||
|
- 新增 清除已选项的功能(通过 clearIcon 属性配置是否显示按钮),同时提供 clear 方法以供调用,二者等效 |
||||||
|
- 修复 readonly 为 true 时报错的 bug |
||||||
|
## 0.4.4(2021-09-26) |
||||||
|
- 修复 上一版本造成的 map 属性失效的 bug |
||||||
|
- 新增 ellipsis 属性,支持配置 tab 选项长度过长时是否自动省略 |
||||||
|
## 0.4.3(2021-09-24) |
||||||
|
- 修复 某些情况下级联未触发的 bug |
||||||
|
## 0.4.2(2021-09-23) |
||||||
|
- 新增 提供 show 和 hide 方法,开发者可以通过 ref 调用 |
||||||
|
- 新增 选项内容过长自动添加省略号 |
||||||
|
## 0.4.1(2021-09-15) |
||||||
|
- 新增 map 属性 字段映射,将 text/value 映射到数据中的其他字段 |
||||||
|
## 0.4.0(2021-07-13) |
||||||
|
- 组件兼容 vue3,如何创建 vue3 项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) |
||||||
|
## 0.3.5(2021-06-04) |
||||||
|
- 修复 无法加载云端数据的问题 |
||||||
|
## 0.3.4(2021-05-28) |
||||||
|
- 修复 v-model 无效问题 |
||||||
|
- 修复 loaddata 为空数据组时加载时间过长问题 |
||||||
|
- 修复 上个版本引出的本地数据无法选择带有 children 的 2 级节点 |
||||||
|
## 0.3.3(2021-05-12) |
||||||
|
- 新增 组件示例地址 |
||||||
|
## 0.3.2(2021-04-22) |
||||||
|
- 修复 非树形数据有 where 属性查询报错的问题 |
||||||
|
## 0.3.1(2021-04-15) |
||||||
|
- 修复 本地数据概率无法回显时问题 |
||||||
|
## 0.3.0(2021-04-07) |
||||||
|
- 新增 支持云端非树形表结构数据 |
||||||
|
- 修复 根节点 parent_field 字段等于 null 时选择界面错乱问题 |
||||||
|
## 0.2.0(2021-03-15) |
||||||
|
- 修复 nodeclick、popupopened、popupclosed 事件无法触发的问题 |
||||||
|
## 0.1.9(2021-03-09) |
||||||
|
- 修复 微信小程序某些情况下无法选择的问题 |
||||||
|
## 0.1.8(2021-02-05) |
||||||
|
- 优化 部分样式在 nvue 上的兼容表现 |
||||||
|
## 0.1.7(2021-02-05) |
||||||
|
- 调整为 uni_modules 目录规范 |
@ -0,0 +1,45 @@ |
|||||||
|
// #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', 'ArrowLeft'], |
||||||
|
right: ['Right', 'ArrowRight'], |
||||||
|
down: ['Down', 'ArrowDown'], |
||||||
|
delete: ['Backspace', 'Delete', 'Del'] |
||||||
|
} |
||||||
|
const listener = ($event) => { |
||||||
|
if (this.disable) { |
||||||
|
return |
||||||
|
} |
||||||
|
const keyName = Object.keys(keyNames).find(key => { |
||||||
|
const keyName = $event.key |
||||||
|
const value = keyNames[key] |
||||||
|
return value === keyName || (Array.isArray(value) && value.includes(keyName)) |
||||||
|
}) |
||||||
|
if (keyName) { |
||||||
|
// 避免和其他按键事件冲突
|
||||||
|
setTimeout(() => { |
||||||
|
this.$emit(keyName, {}) |
||||||
|
}, 0) |
||||||
|
} |
||||||
|
} |
||||||
|
document.addEventListener('keyup', listener) |
||||||
|
this.$once('hook:beforeDestroy', () => { |
||||||
|
document.removeEventListener('keyup', listener) |
||||||
|
}) |
||||||
|
}, |
||||||
|
render: () => {} |
||||||
|
} |
||||||
|
// #endif
|
@ -0,0 +1,557 @@ |
|||||||
|
<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">{{errorMessage}}</text> |
||||||
|
<view v-else-if="loading && !isOpened" class="selected-area"> |
||||||
|
<uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more> |
||||||
|
</view> |
||||||
|
<scroll-view v-else-if="inputSelected.length" class="selected-area" scroll-x="true"> |
||||||
|
<view class="selected-list"> |
||||||
|
<view class="selected-item" v-for="(item,index) in inputSelected" :key="index"> |
||||||
|
<text class="text-color">{{item.text}}</text><text v-if="index<inputSelected.length-1" |
||||||
|
class="input-split-line">{{split}}</text> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</scroll-view> |
||||||
|
<text v-else class="selected-area placeholder">{{placeholder}}</text> |
||||||
|
<view v-if="clearIcon && !readonly && inputSelected.length" class="icon-clear" |
||||||
|
@click.stop="clear"> |
||||||
|
<uni-icons type="clear" color="#c0c4cc" size="24"></uni-icons> |
||||||
|
</view> |
||||||
|
<view class="arrow-area" v-if="(!clearIcon || !inputSelected.length) && !readonly "> |
||||||
|
<img src="@/static/task/list.png" alt="" class="input-arrow"> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</slot> |
||||||
|
</view> |
||||||
|
<view class="uni-data-tree-cover" v-if="isOpened" @click="handleClose"></view> |
||||||
|
<view class="uni-data-tree-dialog" v-if="isOpened"> |
||||||
|
<view class="uni-popper__arrow"></view> |
||||||
|
<view class="dialog-caption"> |
||||||
|
<view class="title-area"> |
||||||
|
<text class="dialog-title">{{popupTitle}}</text> |
||||||
|
</view> |
||||||
|
<view class="dialog-close" @click="handleClose"> |
||||||
|
<view class="dialog-close-plus" data-id="close"></view> |
||||||
|
<view class="dialog-close-plus dialog-close-rotate" data-id="close"></view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
<data-picker-view class="picker-view" ref="pickerView" v-model="dataValue" :localdata="localdata" |
||||||
|
:preload="preload" :collection="collection" :field="field" :orderby="orderby" :where="where" |
||||||
|
:step-searh="stepSearh" :self-field="selfField" :parent-field="parentField" :managed-mode="true" |
||||||
|
:map="map" :ellipsis="ellipsis" @change="onchange" @datachange="ondatachange" @nodeclick="onnodeclick"> |
||||||
|
</data-picker-view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import dataPicker from "../uni-data-pickerview/uni-data-picker.js" |
||||||
|
import DataPickerView from "../uni-data-pickerview/uni-data-pickerview.vue" |
||||||
|
|
||||||
|
/** |
||||||
|
* DataPicker 级联选择 |
||||||
|
* @description 支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。 |
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=3796 |
||||||
|
* @property {String} popup-title 弹出窗口标题 |
||||||
|
* @property {Array} localdata 本地数据,参考 |
||||||
|
* @property {Boolean} border = [true|false] 是否有边框 |
||||||
|
* @property {Boolean} readonly = [true|false] 是否仅读 |
||||||
|
* @property {Boolean} preload = [true|false] 是否预加载数据 |
||||||
|
* @value true 开启预加载数据,点击弹出窗口后显示已加载数据 |
||||||
|
* @value false 关闭预加载数据,点击弹出窗口后开始加载数据 |
||||||
|
* @property {Boolean} step-searh = [true|false] 是否分布查询 |
||||||
|
* @value true 启用分布查询,仅查询当前选中节点 |
||||||
|
* @value false 关闭分布查询,一次查询出所有数据 |
||||||
|
* @property {String|DBFieldString} self-field 分布查询当前字段名称 |
||||||
|
* @property {String|DBFieldString} parent-field 分布查询父字段名称 |
||||||
|
* @property {String|DBCollectionString} collection 表名 |
||||||
|
* @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割 |
||||||
|
* @property {String} orderby 排序字段及正序倒叙设置 |
||||||
|
* @property {String|JQLString} where 查询条件 |
||||||
|
* @event {Function} popupshow 弹出的选择窗口打开时触发此事件 |
||||||
|
* @event {Function} popuphide 弹出的选择窗口关闭时触发此事件 |
||||||
|
*/ |
||||||
|
export default { |
||||||
|
name: 'UniDataPicker', |
||||||
|
emits: ['popupopened', 'popupclosed', 'nodeclick', 'input', 'change', 'update:modelValue'], |
||||||
|
mixins: [dataPicker], |
||||||
|
components: { |
||||||
|
DataPickerView |
||||||
|
}, |
||||||
|
props: { |
||||||
|
options: { |
||||||
|
type: [Object, Array], |
||||||
|
default () { |
||||||
|
return {} |
||||||
|
} |
||||||
|
}, |
||||||
|
popupTitle: { |
||||||
|
type: String, |
||||||
|
default: '请选择' |
||||||
|
}, |
||||||
|
placeholder: { |
||||||
|
type: String, |
||||||
|
default: '请选择' |
||||||
|
}, |
||||||
|
heightMobile: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
readonly: { |
||||||
|
type: Boolean, |
||||||
|
default: false |
||||||
|
}, |
||||||
|
clearIcon: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
}, |
||||||
|
border: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
}, |
||||||
|
split: { |
||||||
|
type: String, |
||||||
|
default: '/' |
||||||
|
}, |
||||||
|
ellipsis: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
isOpened: false, |
||||||
|
inputSelected: [] |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.form = this.getForm('uniForms') |
||||||
|
this.formItem = this.getForm('uniFormsItem') |
||||||
|
if (this.formItem) { |
||||||
|
if (this.formItem.name) { |
||||||
|
this.rename = this.formItem.name |
||||||
|
this.form.inputChildrens.push(this) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
this.$nextTick(() => { |
||||||
|
this.load() |
||||||
|
}) |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
clear() { |
||||||
|
this.inputSelected.splice(0) |
||||||
|
this._dispatchEvent([]) |
||||||
|
}, |
||||||
|
onPropsChange() { |
||||||
|
this._treeData = [] |
||||||
|
this.selectedIndex = 0 |
||||||
|
this.load() |
||||||
|
}, |
||||||
|
load() { |
||||||
|
if (this.readonly) { |
||||||
|
this._processReadonly(this.localdata, this.dataValue) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
if (this.isLocaldata) { |
||||||
|
this.loadData() |
||||||
|
this.inputSelected = this.selected.slice(0) |
||||||
|
} else if (!this.parentField && !this.selfField && this.hasValue) { |
||||||
|
this.getNodeData(() => { |
||||||
|
this.inputSelected = this.selected.slice(0) |
||||||
|
}) |
||||||
|
} else if (this.hasValue) { |
||||||
|
this.getTreePath(() => { |
||||||
|
this.inputSelected = this.selected.slice(0) |
||||||
|
}) |
||||||
|
} |
||||||
|
}, |
||||||
|
getForm(name = 'uniForms') { |
||||||
|
let parent = this.$parent; |
||||||
|
let parentName = parent.$options.name; |
||||||
|
while (parentName !== name) { |
||||||
|
parent = parent.$parent; |
||||||
|
if (!parent) return false; |
||||||
|
parentName = parent.$options.name; |
||||||
|
} |
||||||
|
return parent; |
||||||
|
}, |
||||||
|
show() { |
||||||
|
this.isOpened = true |
||||||
|
setTimeout(() => { |
||||||
|
this.$refs.pickerView.updateData({ |
||||||
|
treeData: this._treeData, |
||||||
|
selected: this.selected, |
||||||
|
selectedIndex: this.selectedIndex |
||||||
|
}) |
||||||
|
}, 200) |
||||||
|
this.$emit('popupopened') |
||||||
|
}, |
||||||
|
hide() { |
||||||
|
this.isOpened = false |
||||||
|
this.$emit('popupclosed') |
||||||
|
}, |
||||||
|
handleInput() { |
||||||
|
if (this.readonly) { |
||||||
|
return |
||||||
|
} |
||||||
|
this.show() |
||||||
|
}, |
||||||
|
handleClose(e) { |
||||||
|
this.hide() |
||||||
|
}, |
||||||
|
onnodeclick(e) { |
||||||
|
this.$emit('nodeclick', e) |
||||||
|
}, |
||||||
|
ondatachange(e) { |
||||||
|
this._treeData = this.$refs.pickerView._treeData |
||||||
|
}, |
||||||
|
onchange(e) { |
||||||
|
this.hide() |
||||||
|
this.$nextTick(() => { |
||||||
|
this.inputSelected = e; |
||||||
|
}) |
||||||
|
this._dispatchEvent(e) |
||||||
|
}, |
||||||
|
_processReadonly(dataList, value) { |
||||||
|
var isTree = dataList.findIndex((item) => { |
||||||
|
return item.children |
||||||
|
}) |
||||||
|
if (isTree > -1) { |
||||||
|
let inputValue |
||||||
|
if (Array.isArray(value)) { |
||||||
|
inputValue = value[value.length - 1] |
||||||
|
if (typeof inputValue === 'object' && inputValue.value) { |
||||||
|
inputValue = inputValue.value |
||||||
|
} |
||||||
|
} else { |
||||||
|
inputValue = value |
||||||
|
} |
||||||
|
this.inputSelected = this._findNodePath(inputValue, this.localdata) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
if (!this.hasValue) { |
||||||
|
this.inputSelected = [] |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
let result = [] |
||||||
|
for (let i = 0; i < value.length; i++) { |
||||||
|
var val = value[i] |
||||||
|
var item = dataList.find((v) => { |
||||||
|
return v.value == val |
||||||
|
}) |
||||||
|
if (item) { |
||||||
|
result.push(item) |
||||||
|
} |
||||||
|
} |
||||||
|
if (result.length) { |
||||||
|
this.inputSelected = result |
||||||
|
} |
||||||
|
}, |
||||||
|
_filterForArray(data, valueArray) { |
||||||
|
var result = [] |
||||||
|
for (let i = 0; i < valueArray.length; i++) { |
||||||
|
var value = valueArray[i] |
||||||
|
var found = data.find((item) => { |
||||||
|
return item.value == value |
||||||
|
}) |
||||||
|
if (found) { |
||||||
|
result.push(found) |
||||||
|
} |
||||||
|
} |
||||||
|
return result |
||||||
|
}, |
||||||
|
_dispatchEvent(selected) { |
||||||
|
let item = {} |
||||||
|
if (selected.length) { |
||||||
|
var value = new Array(selected.length) |
||||||
|
for (var i = 0; i < selected.length; i++) { |
||||||
|
value[i] = selected[i].value |
||||||
|
} |
||||||
|
item = selected[selected.length - 1] |
||||||
|
} else { |
||||||
|
item.value = '' |
||||||
|
} |
||||||
|
if (this.formItem) { |
||||||
|
this.formItem.setValue(item.value) |
||||||
|
} |
||||||
|
|
||||||
|
this.$emit('input', item.value) |
||||||
|
this.$emit('update:modelValue', item.value) |
||||||
|
this.$emit('change', { |
||||||
|
detail: { |
||||||
|
value: selected |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style > |
||||||
|
.uni-data-tree { |
||||||
|
flex: 1; |
||||||
|
position: relative; |
||||||
|
font-size: 14px; |
||||||
|
} |
||||||
|
|
||||||
|
.error-text { |
||||||
|
color: #DD524D; |
||||||
|
} |
||||||
|
|
||||||
|
.input-value { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
flex-wrap: nowrap; |
||||||
|
font-size: 14px; |
||||||
|
width: 400rpx; |
||||||
|
/* line-height: 35px; */ |
||||||
|
padding: 0 10px; |
||||||
|
padding-right: 5px; |
||||||
|
overflow: hidden; |
||||||
|
height: 35px; |
||||||
|
/* #ifdef APP-NVUE */ |
||||||
|
/* #endif */ |
||||||
|
box-sizing: border-box; |
||||||
|
} |
||||||
|
|
||||||
|
.input-value-border { |
||||||
|
border: 1px solid #e5e5e5; |
||||||
|
/* border-radius: 5px; */ |
||||||
|
} |
||||||
|
|
||||||
|
.selected-area { |
||||||
|
flex: 1; |
||||||
|
overflow: hidden; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: row; |
||||||
|
} |
||||||
|
|
||||||
|
.load-more { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
margin-right: auto; |
||||||
|
/* #endif */ |
||||||
|
/* #ifdef APP-NVUE */ |
||||||
|
width: 40px; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.selected-list { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: row; |
||||||
|
flex-wrap: nowrap; |
||||||
|
/* padding: 0 5px; */ |
||||||
|
} |
||||||
|
|
||||||
|
.selected-item { |
||||||
|
flex-direction: row; |
||||||
|
/* padding: 0 1px; */ |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
white-space: nowrap; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.text-color { |
||||||
|
color: #333; |
||||||
|
} |
||||||
|
|
||||||
|
.placeholder { |
||||||
|
color: grey; |
||||||
|
font-size: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
.input-split-line { |
||||||
|
opacity: .5; |
||||||
|
} |
||||||
|
|
||||||
|
.arrow-area { |
||||||
|
position: relative; |
||||||
|
width: 20px; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
margin-bottom: 5px; |
||||||
|
margin-left: auto; |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
justify-content: center; |
||||||
|
/* transform: rotate(-45deg); */ |
||||||
|
transform-origin: center; |
||||||
|
} |
||||||
|
|
||||||
|
.input-arrow { |
||||||
|
width: 40rpx; |
||||||
|
height: 40rpx; |
||||||
|
/* border-left: 1px solid #999; |
||||||
|
border-bottom: 1px solid #999; */ |
||||||
|
} |
||||||
|
|
||||||
|
.uni-data-tree-cover { |
||||||
|
position: fixed; |
||||||
|
width: 100vw; |
||||||
|
height: 100vh; |
||||||
|
left: 0; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
bottom: 0; |
||||||
|
background-color: rgba(0, 0, 0, .4); |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: column; |
||||||
|
z-index: 100; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-data-tree-dialog { |
||||||
|
position: fixed; |
||||||
|
left: 0; |
||||||
|
top: 40%; |
||||||
|
right: 0; |
||||||
|
bottom: 0; |
||||||
|
background-color: #FFFFFF; |
||||||
|
border-top-left-radius: 10px; |
||||||
|
border-top-right-radius: 10px; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: column; |
||||||
|
z-index: 102; |
||||||
|
overflow: hidden; |
||||||
|
/* #ifdef APP-NVUE */ |
||||||
|
width: 100%; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.dialog-caption { |
||||||
|
position: relative; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: row; |
||||||
|
/* border-bottom: 1px solid #f0f0f0; */ |
||||||
|
} |
||||||
|
|
||||||
|
.title-area { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
align-items: center; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
margin: auto; |
||||||
|
/* #endif */ |
||||||
|
padding: 0 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.dialog-title { |
||||||
|
/* font-weight: bold; */ |
||||||
|
line-height: 44px; |
||||||
|
} |
||||||
|
|
||||||
|
.dialog-close { |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
bottom: 0; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: row; |
||||||
|
align-items: center; |
||||||
|
padding: 0 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.dialog-close-plus { |
||||||
|
width: 16px; |
||||||
|
height: 2px; |
||||||
|
background-color: #666; |
||||||
|
border-radius: 2px; |
||||||
|
transform: rotate(45deg); |
||||||
|
} |
||||||
|
|
||||||
|
.dialog-close-rotate { |
||||||
|
position: absolute; |
||||||
|
transform: rotate(-45deg); |
||||||
|
} |
||||||
|
|
||||||
|
.picker-view { |
||||||
|
flex: 1; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.icon-clear { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
|
||||||
|
/* #ifdef H5 */ |
||||||
|
@media all and (min-width: 768px) { |
||||||
|
.uni-data-tree-cover { |
||||||
|
background-color: transparent; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-data-tree-dialog { |
||||||
|
position: absolute; |
||||||
|
top: 55px; |
||||||
|
height: auto; |
||||||
|
min-height: 400px; |
||||||
|
max-height: 50vh; |
||||||
|
background-color: #fff; |
||||||
|
border: 1px solid #EBEEF5; |
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
||||||
|
border-radius: 4px; |
||||||
|
overflow: unset; |
||||||
|
} |
||||||
|
|
||||||
|
.dialog-caption { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
|
||||||
|
.icon-clear { |
||||||
|
/* margin-right: 5px; */ |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/* #endif */ |
||||||
|
|
||||||
|
/* picker 弹出层通用的指示小三角, todo:扩展至上下左右方向定位 */ |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
.uni-popper__arrow, |
||||||
|
.uni-popper__arrow::after { |
||||||
|
position: absolute; |
||||||
|
display: block; |
||||||
|
width: 0; |
||||||
|
height: 0; |
||||||
|
border-color: transparent; |
||||||
|
border-style: solid; |
||||||
|
border-width: 6px; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-popper__arrow { |
||||||
|
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); |
||||||
|
top: -6px; |
||||||
|
left: 10%; |
||||||
|
margin-right: 3px; |
||||||
|
border-top-width: 0; |
||||||
|
border-bottom-color: #EBEEF5; |
||||||
|
} |
||||||
|
|
||||||
|
.uni-popper__arrow::after { |
||||||
|
content: " "; |
||||||
|
top: 1px; |
||||||
|
margin-left: -6px; |
||||||
|
border-top-width: 0; |
||||||
|
border-bottom-color: #fff; |
||||||
|
} |
||||||
|
/* #endif */ |
||||||
|
</style> |
@ -0,0 +1,563 @@ |
|||||||
|
export default { |
||||||
|
props: { |
||||||
|
localdata: { |
||||||
|
type: [Array, Object], |
||||||
|
default () { |
||||||
|
return [] |
||||||
|
} |
||||||
|
}, |
||||||
|
spaceInfo: { |
||||||
|
type: Object, |
||||||
|
default () { |
||||||
|
return {} |
||||||
|
} |
||||||
|
}, |
||||||
|
collection: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
action: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
field: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
orderby: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
where: { |
||||||
|
type: [String, Object], |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
pageData: { |
||||||
|
type: String, |
||||||
|
default: 'add' |
||||||
|
}, |
||||||
|
pageCurrent: { |
||||||
|
type: Number, |
||||||
|
default: 1 |
||||||
|
}, |
||||||
|
pageSize: { |
||||||
|
type: Number, |
||||||
|
default: 20 |
||||||
|
}, |
||||||
|
getcount: { |
||||||
|
type: [Boolean, String], |
||||||
|
default: false |
||||||
|
}, |
||||||
|
getone: { |
||||||
|
type: [Boolean, String], |
||||||
|
default: false |
||||||
|
}, |
||||||
|
gettree: { |
||||||
|
type: [Boolean, String], |
||||||
|
default: false |
||||||
|
}, |
||||||
|
manual: { |
||||||
|
type: Boolean, |
||||||
|
default: false |
||||||
|
}, |
||||||
|
value: { |
||||||
|
type: [Array, String, Number], |
||||||
|
default () { |
||||||
|
return [] |
||||||
|
} |
||||||
|
}, |
||||||
|
modelValue: { |
||||||
|
type: [Array, String, Number], |
||||||
|
default () { |
||||||
|
return [] |
||||||
|
} |
||||||
|
}, |
||||||
|
preload: { |
||||||
|
type: Boolean, |
||||||
|
default: false |
||||||
|
}, |
||||||
|
stepSearh: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
}, |
||||||
|
selfField: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
parentField: { |
||||||
|
type: String, |
||||||
|
default: '' |
||||||
|
}, |
||||||
|
multiple: { |
||||||
|
type: Boolean, |
||||||
|
default: false |
||||||
|
}, |
||||||
|
map: { |
||||||
|
type: Object, |
||||||
|
default() { |
||||||
|
return { |
||||||
|
text: "text", |
||||||
|
value: "value" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
loading: false, |
||||||
|
errorMessage: '', |
||||||
|
loadMore: { |
||||||
|
contentdown: '', |
||||||
|
contentrefresh: '', |
||||||
|
contentnomore: '' |
||||||
|
}, |
||||||
|
dataList: [], |
||||||
|
selected: [], |
||||||
|
selectedIndex: 0, |
||||||
|
page: { |
||||||
|
current: this.pageCurrent, |
||||||
|
size: this.pageSize, |
||||||
|
count: 0 |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
isLocaldata() { |
||||||
|
return !this.collection.length |
||||||
|
}, |
||||||
|
postField() { |
||||||
|
let fields = [this.field]; |
||||||
|
if (this.parentField) { |
||||||
|
fields.push(`${this.parentField} as parent_value`); |
||||||
|
} |
||||||
|
return fields.join(','); |
||||||
|
}, |
||||||
|
dataValue() { |
||||||
|
let isModelValue = Array.isArray(this.modelValue) ? (this.modelValue.length > 0) : (this.modelValue !== null || this.modelValue !== undefined) |
||||||
|
return isModelValue ? this.modelValue : this.value |
||||||
|
}, |
||||||
|
hasValue() { |
||||||
|
if (typeof this.dataValue === 'number') { |
||||||
|
return true |
||||||
|
} |
||||||
|
return (this.dataValue != null) && (this.dataValue.length > 0) |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.$watch(() => { |
||||||
|
var al = []; |
||||||
|
['pageCurrent', |
||||||
|
'pageSize', |
||||||
|
'spaceInfo', |
||||||
|
'value', |
||||||
|
'modelValue', |
||||||
|
'localdata', |
||||||
|
'collection', |
||||||
|
'action', |
||||||
|
'field', |
||||||
|
'orderby', |
||||||
|
'where', |
||||||
|
'getont', |
||||||
|
'getcount', |
||||||
|
'gettree' |
||||||
|
].forEach(key => { |
||||||
|
al.push(this[key]) |
||||||
|
}); |
||||||
|
return al |
||||||
|
}, (newValue, oldValue) => { |
||||||
|
let needReset = false |
||||||
|
for (let i = 2; i < newValue.length; i++) { |
||||||
|
if (newValue[i] != oldValue[i]) { |
||||||
|
needReset = true |
||||||
|
break |
||||||
|
} |
||||||
|
} |
||||||
|
if (newValue[0] != oldValue[0]) { |
||||||
|
this.page.current = this.pageCurrent |
||||||
|
} |
||||||
|
this.page.size = this.pageSize |
||||||
|
|
||||||
|
this.onPropsChange() |
||||||
|
}) |
||||||
|
this._treeData = [] |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
onPropsChange() { |
||||||
|
this._treeData = [] |
||||||
|
}, |
||||||
|
getCommand(options = {}) { |
||||||
|
/* eslint-disable no-undef */ |
||||||
|
let db = uniCloud.database(this.spaceInfo) |
||||||
|
|
||||||
|
const action = options.action || this.action |
||||||
|
if (action) { |
||||||
|
db = db.action(action) |
||||||
|
} |
||||||
|
|
||||||
|
const collection = options.collection || this.collection |
||||||
|
db = db.collection(collection) |
||||||
|
|
||||||
|
const where = options.where || this.where |
||||||
|
if (!(!where || !Object.keys(where).length)) { |
||||||
|
db = db.where(where) |
||||||
|
} |
||||||
|
|
||||||
|
const field = options.field || this.field |
||||||
|
if (field) { |
||||||
|
db = db.field(field) |
||||||
|
} |
||||||
|
|
||||||
|
const orderby = options.orderby || this.orderby |
||||||
|
if (orderby) { |
||||||
|
db = db.orderBy(orderby) |
||||||
|
} |
||||||
|
|
||||||
|
const current = options.pageCurrent !== undefined ? options.pageCurrent : this.page.current |
||||||
|
const size = options.pageSize !== undefined ? options.pageSize : this.page.size |
||||||
|
const getCount = options.getcount !== undefined ? options.getcount : this.getcount |
||||||
|
const getTree = options.gettree !== undefined ? options.gettree : this.gettree |
||||||
|
|
||||||
|
const getOptions = { |
||||||
|
getCount, |
||||||
|
getTree |
||||||
|
} |
||||||
|
if (options.getTreePath) { |
||||||
|
getOptions.getTreePath = options.getTreePath |
||||||
|
} |
||||||
|
|
||||||
|
db = db.skip(size * (current - 1)).limit(size).get(getOptions) |
||||||
|
|
||||||
|
return db |
||||||
|
}, |
||||||
|
getNodeData(callback) { |
||||||
|
if (this.loading) { |
||||||
|
return |
||||||
|
} |
||||||
|
this.loading = true |
||||||
|
this.getCommand({ |
||||||
|
field: this.postField, |
||||||
|
where: this._pathWhere() |
||||||
|
}).then((res) => { |
||||||
|
this.loading = false |
||||||
|
this.selected = res.result.data |
||||||
|
callback && callback() |
||||||
|
}).catch((err) => { |
||||||
|
this.loading = false |
||||||
|
this.errorMessage = err |
||||||
|
}) |
||||||
|
}, |
||||||
|
getTreePath(callback) { |
||||||
|
if (this.loading) { |
||||||
|
return |
||||||
|
} |
||||||
|
this.loading = true |
||||||
|
|
||||||
|
this.getCommand({ |
||||||
|
field: this.postField, |
||||||
|
getTreePath: { |
||||||
|
startWith: `${this.selfField}=='${this.dataValue}'` |
||||||
|
} |
||||||
|
}).then((res) => { |
||||||
|
this.loading = false |
||||||
|
let treePath = [] |
||||||
|
this._extractTreePath(res.result.data, treePath) |
||||||
|
this.selected = treePath |
||||||
|
callback && callback() |
||||||
|
}).catch((err) => { |
||||||
|
this.loading = false |
||||||
|
this.errorMessage = err |
||||||
|
}) |
||||||
|
}, |
||||||
|
loadData() { |
||||||
|
if (this.isLocaldata) { |
||||||
|
this._processLocalData() |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
if (this.dataValue != null) { |
||||||
|
this._loadNodeData((data) => { |
||||||
|
this._treeData = data |
||||||
|
this._updateBindData() |
||||||
|
this._updateSelected() |
||||||
|
}) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
if (this.stepSearh) { |
||||||
|
this._loadNodeData((data) => { |
||||||
|
this._treeData = data |
||||||
|
this._updateBindData() |
||||||
|
}) |
||||||
|
} else { |
||||||
|
this._loadAllData((data) => { |
||||||
|
this._treeData = [] |
||||||
|
this._extractTree(data, this._treeData, null) |
||||||
|
this._updateBindData() |
||||||
|
}) |
||||||
|
} |
||||||
|
}, |
||||||
|
_loadAllData(callback) { |
||||||
|
if (this.loading) { |
||||||
|
return |
||||||
|
} |
||||||
|
this.loading = true |
||||||
|
|
||||||
|
this.getCommand({ |
||||||
|
field: this.postField, |
||||||
|
gettree: true, |
||||||
|
startwith: `${this.selfField}=='${this.dataValue}'` |
||||||
|
}).then((res) => { |
||||||
|
this.loading = false |
||||||
|
callback(res.result.data) |
||||||
|
this.onDataChange() |
||||||
|
}).catch((err) => { |
||||||
|
this.loading = false |
||||||
|
this.errorMessage = err |
||||||
|
}) |
||||||
|
}, |
||||||
|
_loadNodeData(callback, pw) { |
||||||
|
if (this.loading) { |
||||||
|
return |
||||||
|
} |
||||||
|
this.loading = true |
||||||
|
|
||||||
|
this.getCommand({ |
||||||
|
field: this.postField, |
||||||
|
where: pw || this._postWhere(), |
||||||
|
pageSize: 500 |
||||||
|
}).then((res) => { |
||||||
|
this.loading = false |
||||||
|
callback(res.result.data) |
||||||
|
this.onDataChange() |
||||||
|
}).catch((err) => { |
||||||
|
this.loading = false |
||||||
|
this.errorMessage = err |
||||||
|
}) |
||||||
|
}, |
||||||
|
_pathWhere() { |
||||||
|
let result = [] |
||||||
|
let where_field = this._getParentNameByField(); |
||||||
|
if (where_field) { |
||||||
|
result.push(`${where_field} == '${this.dataValue}'`) |
||||||
|
} |
||||||
|
|
||||||
|
if (this.where) { |
||||||
|
return `(${this.where}) && (${result.join(' || ')})` |
||||||
|
} |
||||||
|
|
||||||
|
return result.join(' || ') |
||||||
|
}, |
||||||
|
_postWhere() { |
||||||
|
let result = [] |
||||||
|
let selected = this.selected |
||||||
|
let parentField = this.parentField |
||||||
|
if (parentField) { |
||||||
|
result.push(`${parentField} == null || ${parentField} == ""`) |
||||||
|
} |
||||||
|
if (selected.length) { |
||||||
|
for (var i = 0; i < selected.length - 1; i++) { |
||||||
|
result.push(`${parentField} == '${selected[i].value}'`) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
let where = [] |
||||||
|
if (this.where) { |
||||||
|
where.push(`(${this.where})`) |
||||||
|
} |
||||||
|
if (result.length) { |
||||||
|
where.push(`(${result.join(' || ')})`) |
||||||
|
} |
||||||
|
|
||||||
|
return where.join(' && ') |
||||||
|
}, |
||||||
|
_nodeWhere() { |
||||||
|
let result = [] |
||||||
|
let selected = this.selected |
||||||
|
if (selected.length) { |
||||||
|
result.push(`${this.parentField} == '${selected[selected.length - 1].value}'`) |
||||||
|
} |
||||||
|
|
||||||
|
if (this.where) { |
||||||
|
return `(${this.where}) && (${result.join(' || ')})` |
||||||
|
} |
||||||
|
|
||||||
|
return result.join(' || ') |
||||||
|
}, |
||||||
|
_getParentNameByField() { |
||||||
|
const fields = this.field.split(','); |
||||||
|
let where_field = null; |
||||||
|
for (let i = 0; i < fields.length; i++) { |
||||||
|
const items = fields[i].split('as'); |
||||||
|
if (items.length < 2) { |
||||||
|
continue; |
||||||
|
} |
||||||
|
if (items[1].trim() === 'value') { |
||||||
|
where_field = items[0].trim(); |
||||||
|
break; |
||||||
|
} |
||||||
|
} |
||||||
|
return where_field |
||||||
|
}, |
||||||
|
_isTreeView() { |
||||||
|
return (this.parentField && this.selfField) |
||||||
|
}, |
||||||
|
_updateSelected() { |
||||||
|
var dl = this.dataList |
||||||
|
var sl = this.selected |
||||||
|
let textField = this.map.text |
||||||
|
let valueField = this.map.value |
||||||
|
for (var i = 0; i < sl.length; i++) { |
||||||
|
var value = sl[i].value |
||||||
|
var dl2 = dl[i] |
||||||
|
for (var j = 0; j < dl2.length; j++) { |
||||||
|
var item2 = dl2[j] |
||||||
|
if (item2[valueField] === value) { |
||||||
|
sl[i].text = item2[textField] |
||||||
|
break |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
_updateBindData(node) { |
||||||
|
const { |
||||||
|
dataList, |
||||||
|
hasNodes |
||||||
|
} = this._filterData(this._treeData, this.selected) |
||||||
|
|
||||||
|
let isleaf = this._stepSearh === false && !hasNodes |
||||||
|
|
||||||
|
if (node) { |
||||||
|
node.isleaf = isleaf |
||||||
|
} |
||||||
|
|
||||||
|
this.dataList = dataList |
||||||
|
this.selectedIndex = dataList.length - 1 |
||||||
|
|
||||||
|
if (!isleaf && this.selected.length < dataList.length) { |
||||||
|
this.selected.push({ |
||||||
|
value: null, |
||||||
|
text: "请选择" |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
return { |
||||||
|
isleaf, |
||||||
|
hasNodes |
||||||
|
} |
||||||
|
}, |
||||||
|
_filterData(data, paths) { |
||||||
|
let dataList = [] |
||||||
|
let hasNodes = true |
||||||
|
|
||||||
|
dataList.push(data.filter((item) => { |
||||||
|
return (item.parent_value === null || item.parent_value === undefined || item.parent_value === '') |
||||||
|
})) |
||||||
|
for (let i = 0; i < paths.length; i++) { |
||||||
|
var value = paths[i].value |
||||||
|
var nodes = data.filter((item) => { |
||||||
|
return item.parent_value === value |
||||||
|
}) |
||||||
|
|
||||||
|
if (nodes.length) { |
||||||
|
dataList.push(nodes) |
||||||
|
} else { |
||||||
|
hasNodes = false |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return { |
||||||
|
dataList, |
||||||
|
hasNodes |
||||||
|
} |
||||||
|
}, |
||||||
|
_extractTree(nodes, result, parent_value) { |
||||||
|
let list = result || [] |
||||||
|
let valueField = this.map.value |
||||||
|
for (let i = 0; i < nodes.length; i++) { |
||||||
|
let node = nodes[i] |
||||||
|
|
||||||
|
let child = {} |
||||||
|
for (let key in node) { |
||||||
|
if (key !== 'children') { |
||||||
|
child[key] = node[key] |
||||||
|
} |
||||||
|
} |
||||||
|
if (parent_value !== null && parent_value !== undefined && parent_value !== '') { |
||||||
|
child.parent_value = parent_value |
||||||
|
} |
||||||
|
result.push(child) |
||||||
|
|
||||||
|
let children = node.children |
||||||
|
if (children) { |
||||||
|
this._extractTree(children, result, node[valueField]) |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
_extractTreePath(nodes, result) { |
||||||
|
let list = result || [] |
||||||
|
for (let i = 0; i < nodes.length; i++) { |
||||||
|
let node = nodes[i] |
||||||
|
|
||||||
|
let child = {} |
||||||
|
for (let key in node) { |
||||||
|
if (key !== 'children') { |
||||||
|
child[key] = node[key] |
||||||
|
} |
||||||
|
} |
||||||
|
result.push(child) |
||||||
|
|
||||||
|
let children = node.children |
||||||
|
if (children) { |
||||||
|
this._extractTreePath(children, result) |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
_findNodePath(key, nodes, path = []) { |
||||||
|
let textField = this.map.text |
||||||
|
let valueField = this.map.value |
||||||
|
for (let i = 0; i < nodes.length; i++) { |
||||||
|
let node = nodes[i] |
||||||
|
let children = node.children |
||||||
|
let text = node[textField] |
||||||
|
let value = node[valueField] |
||||||
|
|
||||||
|
path.push({ |
||||||
|
value, |
||||||
|
text |
||||||
|
}) |
||||||
|
|
||||||
|
if (value === key) { |
||||||
|
return path |
||||||
|
} |
||||||
|
|
||||||
|
if (children) { |
||||||
|
const p = this._findNodePath(key, children, path) |
||||||
|
if (p.length) { |
||||||
|
return p |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
path.pop() |
||||||
|
} |
||||||
|
return [] |
||||||
|
}, |
||||||
|
_processLocalData() { |
||||||
|
this._treeData = [] |
||||||
|
this._extractTree(this.localdata, this._treeData) |
||||||
|
|
||||||
|
var inputValue = this.dataValue |
||||||
|
if (inputValue === undefined) { |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
if (Array.isArray(inputValue)) { |
||||||
|
inputValue = inputValue[inputValue.length - 1] |
||||||
|
if (typeof inputValue === 'object' && inputValue[this.map.value]) { |
||||||
|
inputValue = inputValue[this.map.value] |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
this.selected = this._findNodePath(inputValue, this.localdata) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,333 @@ |
|||||||
|
<template> |
||||||
|
<view class="uni-data-pickerview"> |
||||||
|
<scroll-view class="selected-area" scroll-x="true" scroll-y="false" :show-scrollbar="false"> |
||||||
|
<view class="selected-list"> |
||||||
|
<template v-for="(item,index) in selected"> |
||||||
|
<view class="selected-item" |
||||||
|
:class="{'selected-item-active':index==selectedIndex, 'selected-item-text-overflow': ellipsis}" |
||||||
|
v-if="item.text" @click="handleSelect(index)"> |
||||||
|
<text class="">{{item.text}}</text> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
</view> |
||||||
|
</scroll-view> |
||||||
|
<view class="tab-c"> |
||||||
|
<template v-for="(child, i) in dataList" > |
||||||
|
<scroll-view class="list" :key="i" v-if="i==selectedIndex" :scroll-y="true"> |
||||||
|
<view class="item" :class="{'is-disabled': !!item.disable}" v-for="(item, j) in child" |
||||||
|
@click="handleNodeClick(item, i, j)"> |
||||||
|
<text class="item-text item-text-overflow">{{item[map.text]}}</text> |
||||||
|
<view class="check" v-if="selected.length > i && item[map.value] == selected[i].value"></view> |
||||||
|
</view> |
||||||
|
</scroll-view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<view class="loading-cover" v-if="loading"> |
||||||
|
<uni-load-more class="load-more" :contentText="loadMore" status="loading"></uni-load-more> |
||||||
|
</view> |
||||||
|
<view class="error-message" v-if="errorMessage"> |
||||||
|
<text class="error-text">{{errorMessage}}</text> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</view> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import dataPicker from "./uni-data-picker.js" |
||||||
|
|
||||||
|
/** |
||||||
|
* DataPickerview |
||||||
|
* @description uni-data-pickerview |
||||||
|
* @tutorial https://ext.dcloud.net.cn/plugin?id=3796 |
||||||
|
* @property {Array} localdata 本地数据,参考 |
||||||
|
* @property {Boolean} step-searh = [true|false] 是否分布查询 |
||||||
|
* @value true 启用分布查询,仅查询当前选中节点 |
||||||
|
* @value false 关闭分布查询,一次查询出所有数据 |
||||||
|
* @property {String|DBFieldString} self-field 分布查询当前字段名称 |
||||||
|
* @property {String|DBFieldString} parent-field 分布查询父字段名称 |
||||||
|
* @property {String|DBCollectionString} collection 表名 |
||||||
|
* @property {String|DBFieldString} field 查询字段,多个字段用 `,` 分割 |
||||||
|
* @property {String} orderby 排序字段及正序倒叙设置 |
||||||
|
* @property {String|JQLString} where 查询条件 |
||||||
|
*/ |
||||||
|
export default { |
||||||
|
name: 'UniDataPickerView', |
||||||
|
emits: ['nodeclick', 'change', 'datachange', 'update:modelValue'], |
||||||
|
mixins: [dataPicker], |
||||||
|
props: { |
||||||
|
managedMode: { |
||||||
|
type: Boolean, |
||||||
|
default: false |
||||||
|
}, |
||||||
|
ellipsis: { |
||||||
|
type: Boolean, |
||||||
|
default: true |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return {} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
if (this.managedMode) { |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
this.$nextTick(() => { |
||||||
|
this.load() |
||||||
|
}) |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
onPropsChange() { |
||||||
|
this._treeData = [] |
||||||
|
this.selectedIndex = 0 |
||||||
|
this.load() |
||||||
|
}, |
||||||
|
load() { |
||||||
|
if (this.isLocaldata) { |
||||||
|
this.loadData() |
||||||
|
} else if (this.dataValue.length) { |
||||||
|
this.getTreePath((res) => { |
||||||
|
this.loadData() |
||||||
|
}) |
||||||
|
} |
||||||
|
}, |
||||||
|
handleSelect(index) { |
||||||
|
this.selectedIndex = index |
||||||
|
}, |
||||||
|
handleNodeClick(item, i, j) { |
||||||
|
if (item.disable) { |
||||||
|
return |
||||||
|
} |
||||||
|
const node = this.dataList[i][j] |
||||||
|
const text = node[this.map.text] |
||||||
|
const value = node[this.map.value] |
||||||
|
if (i < this.selected.length - 1) { |
||||||
|
this.selected.splice(i, this.selected.length - i) |
||||||
|
this.selected.push({ |
||||||
|
text, |
||||||
|
value |
||||||
|
}) |
||||||
|
} else if (i === this.selected.length - 1) { |
||||||
|
this.selected.splice(i, 1, { |
||||||
|
text, |
||||||
|
value |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
if (node.isleaf) { |
||||||
|
this.onSelectedChange(node, node.isleaf) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
const { |
||||||
|
isleaf, |
||||||
|
hasNodes |
||||||
|
} = this._updateBindData() |
||||||
|
|
||||||
|
if (!this._isTreeView() && !hasNodes) { |
||||||
|
this.onSelectedChange(node, true) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
if (this.isLocaldata && (!hasNodes || isleaf)) { |
||||||
|
this.onSelectedChange(node, true) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
if (!isleaf && !hasNodes) { |
||||||
|
this._loadNodeData((data) => { |
||||||
|
if (!data.length) { |
||||||
|
node.isleaf = true |
||||||
|
} else { |
||||||
|
this._treeData.push(...data) |
||||||
|
this._updateBindData(node) |
||||||
|
} |
||||||
|
this.onSelectedChange(node, node.isleaf) |
||||||
|
}, this._nodeWhere()) |
||||||
|
return |
||||||
|
} |
||||||
|
|
||||||
|
this.onSelectedChange(node, false) |
||||||
|
}, |
||||||
|
updateData(data) { |
||||||
|
this._treeData = data.treeData |
||||||
|
this.selected = data.selected |
||||||
|
if (!this._treeData.length) { |
||||||
|
this.loadData() |
||||||
|
} else { |
||||||
|
//this.selected = data.selected |
||||||
|
this._updateBindData() |
||||||
|
} |
||||||
|
}, |
||||||
|
onDataChange() { |
||||||
|
this.$emit('datachange') |
||||||
|
}, |
||||||
|
onSelectedChange(node, isleaf) { |
||||||
|
if (isleaf) { |
||||||
|
this._dispatchEvent() |
||||||
|
} |
||||||
|
|
||||||
|
if (node) { |
||||||
|
this.$emit('nodeclick', node) |
||||||
|
} |
||||||
|
}, |
||||||
|
_dispatchEvent() { |
||||||
|
this.$emit('change', this.selected.slice(0)) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
<style > |
||||||
|
.uni-data-pickerview { |
||||||
|
flex: 1; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: column; |
||||||
|
overflow: hidden; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.error-text { |
||||||
|
color: #DD524D; |
||||||
|
} |
||||||
|
|
||||||
|
.loading-cover { |
||||||
|
position: absolute; |
||||||
|
left: 0; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
bottom: 0; |
||||||
|
background-color: rgba(255, 255, 255, .5); |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: column; |
||||||
|
align-items: center; |
||||||
|
z-index: 1001; |
||||||
|
} |
||||||
|
|
||||||
|
.load-more { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
margin: auto; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.error-message { |
||||||
|
background-color: #fff; |
||||||
|
position: absolute; |
||||||
|
left: 0; |
||||||
|
top: 0; |
||||||
|
right: 0; |
||||||
|
bottom: 0; |
||||||
|
padding: 15px; |
||||||
|
opacity: .9; |
||||||
|
z-index: 102; |
||||||
|
} |
||||||
|
|
||||||
|
/* #ifdef APP-NVUE */ |
||||||
|
.selected-area { |
||||||
|
width: 750rpx; |
||||||
|
} |
||||||
|
|
||||||
|
/* #endif */ |
||||||
|
|
||||||
|
.selected-list { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: row; |
||||||
|
flex-wrap: nowrap; |
||||||
|
padding: 0 5px; |
||||||
|
border-bottom: 1px solid #f8f8f8; |
||||||
|
} |
||||||
|
|
||||||
|
.selected-item { |
||||||
|
margin-left: 10px; |
||||||
|
margin-right: 10px; |
||||||
|
padding: 12px 0; |
||||||
|
text-align: center; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
white-space: nowrap; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.selected-item-text-overflow { |
||||||
|
width: 168px; |
||||||
|
/* fix nvue */ |
||||||
|
overflow: hidden; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
width: 6em; |
||||||
|
white-space: nowrap; |
||||||
|
text-overflow: ellipsis; |
||||||
|
-o-text-overflow: ellipsis; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.selected-item-active { |
||||||
|
border-bottom: 2px solid #007aff; |
||||||
|
} |
||||||
|
|
||||||
|
.selected-item-text { |
||||||
|
color: #007aff; |
||||||
|
} |
||||||
|
|
||||||
|
.tab-c { |
||||||
|
position: relative; |
||||||
|
flex: 1; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: row; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.list { |
||||||
|
flex: 1; |
||||||
|
} |
||||||
|
|
||||||
|
.item { |
||||||
|
padding: 12px 15px; |
||||||
|
/* border-bottom: 1px solid #f0f0f0; */ |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
display: flex; |
||||||
|
/* #endif */ |
||||||
|
flex-direction: row; |
||||||
|
justify-content: space-between; |
||||||
|
} |
||||||
|
|
||||||
|
.is-disabled { |
||||||
|
opacity: .5; |
||||||
|
} |
||||||
|
|
||||||
|
.item-text { |
||||||
|
/* flex: 1; */ |
||||||
|
color: #333333; |
||||||
|
} |
||||||
|
|
||||||
|
.item-text-overflow { |
||||||
|
width: 280px; |
||||||
|
/* fix nvue */ |
||||||
|
overflow: hidden; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
width: 20em; |
||||||
|
white-space: nowrap; |
||||||
|
text-overflow: ellipsis; |
||||||
|
-o-text-overflow: ellipsis; |
||||||
|
/* #endif */ |
||||||
|
} |
||||||
|
|
||||||
|
.check { |
||||||
|
margin-right: 5px; |
||||||
|
border: 2px solid #007aff; |
||||||
|
border-left: 0; |
||||||
|
border-top: 0; |
||||||
|
height: 12px; |
||||||
|
width: 6px; |
||||||
|
transform-origin: center; |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
transition: all 0.3s; |
||||||
|
/* #endif */ |
||||||
|
transform: rotate(45deg); |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,93 @@ |
|||||||
|
{ |
||||||
|
"id": "uni-data-picker", |
||||||
|
"displayName": "uni-data-picker 数据驱动的picker选择器", |
||||||
|
"version": "1.0.7", |
||||||
|
"description": "单列、多列级联选择器,常用于省市区城市选择、公司部门选择、多级分类等场景", |
||||||
|
"keywords": [ |
||||||
|
"uni-ui", |
||||||
|
"uniui", |
||||||
|
"picker", |
||||||
|
"级联", |
||||||
|
"省市区", |
||||||
|
"" |
||||||
|
], |
||||||
|
"repository": "https://github.com/dcloudio/uni-ui", |
||||||
|
"engines": { |
||||||
|
"HBuilderX": "" |
||||||
|
}, |
||||||
|
"directories": { |
||||||
|
"example": "../../temps/example_temps" |
||||||
|
}, |
||||||
|
"dcloudext": { |
||||||
|
"category": [ |
||||||
|
"前端组件", |
||||||
|
"通用组件" |
||||||
|
], |
||||||
|
"sale": { |
||||||
|
"regular": { |
||||||
|
"price": "0.00" |
||||||
|
}, |
||||||
|
"sourcecode": { |
||||||
|
"price": "0.00" |
||||||
|
} |
||||||
|
}, |
||||||
|
"contact": { |
||||||
|
"qq": "" |
||||||
|
}, |
||||||
|
"declaration": { |
||||||
|
"ads": "无", |
||||||
|
"data": "无", |
||||||
|
"permissions": "无" |
||||||
|
}, |
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" |
||||||
|
}, |
||||||
|
"uni_modules": { |
||||||
|
"dependencies": [ |
||||||
|
"uni-load-more", |
||||||
|
"uni-icons", |
||||||
|
"uni-scss" |
||||||
|
], |
||||||
|
"encrypt": [], |
||||||
|
"platforms": { |
||||||
|
"cloud": { |
||||||
|
"tcb": "y", |
||||||
|
"aliyun": "y" |
||||||
|
}, |
||||||
|
"client": { |
||||||
|
"App": { |
||||||
|
"app-vue": "y", |
||||||
|
"app-nvue": "y" |
||||||
|
}, |
||||||
|
"H5-mobile": { |
||||||
|
"Safari": "y", |
||||||
|
"Android Browser": "y", |
||||||
|
"微信浏览器(Android)": "y", |
||||||
|
"QQ浏览器(Android)": "y" |
||||||
|
}, |
||||||
|
"H5-pc": { |
||||||
|
"Chrome": "y", |
||||||
|
"IE": "y", |
||||||
|
"Edge": "y", |
||||||
|
"Firefox": "y", |
||||||
|
"Safari": "y" |
||||||
|
}, |
||||||
|
"小程序": { |
||||||
|
"微信": "y", |
||||||
|
"阿里": "y", |
||||||
|
"百度": "y", |
||||||
|
"字节跳动": "y", |
||||||
|
"QQ": "y", |
||||||
|
"京东": "u" |
||||||
|
}, |
||||||
|
"快应用": { |
||||||
|
"华为": "u", |
||||||
|
"联盟": "u" |
||||||
|
}, |
||||||
|
"Vue": { |
||||||
|
"vue2": "y", |
||||||
|
"vue3": "y" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
## DataPicker 级联选择 |
||||||
|
> **组件名:uni-data-picker** |
||||||
|
> 代码块: `uDataPicker` |
||||||
|
> 关联组件:`uni-data-pickerview`、`uni-load-more`。 |
||||||
|
|
||||||
|
|
||||||
|
`<uni-data-picker>` 是一个选择类[datacom组件](https://uniapp.dcloud.net.cn/component/datacom)。 |
||||||
|
|
||||||
|
支持单列、和多列级联选择。列数没有限制,如果屏幕显示不全,顶部tab区域会左右滚动。 |
||||||
|
|
||||||
|
候选数据支持一次性加载完毕,也支持懒加载,比如示例图中,选择了“北京”后,动态加载北京的区县数据。 |
||||||
|
|
||||||
|
`<uni-data-picker>` 组件尤其适用于地址选择、分类选择等选择类。 |
||||||
|
|
||||||
|
`<uni-data-picker>` 支持本地数据、云端静态数据(json),uniCloud云数据库数据。 |
||||||
|
|
||||||
|
`<uni-data-picker>` 可以通过JQL直连uniCloud云数据库,配套[DB Schema](https://uniapp.dcloud.net.cn/uniCloud/schema),可在schema2code中自动生成前端页面,还支持服务器端校验。 |
||||||
|
|
||||||
|
在uniCloud数据表中新建表“uni-id-address”和“opendb-city-china”,这2个表的schema自带foreignKey关联。在“uni-id-address”表的表结构页面使用schema2code生成前端页面,会自动生成地址管理的维护页面,自动从“opendb-city-china”表包含的中国所有省市区信息里选择地址。 |
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-picker) |
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 |
@ -0,0 +1,22 @@ |
|||||||
|
## 1.3.5(2022-01-24) |
||||||
|
- 优化 size 属性可以传入不带单位的字符串数值 |
||||||
|
## 1.3.4(2022-01-24) |
||||||
|
- 优化 size 支持其他单位 |
||||||
|
## 1.3.3(2022-01-17) |
||||||
|
- 修复 nvue 有些图标不显示的bug,兼容老版本图标 |
||||||
|
## 1.3.2(2021-12-01) |
||||||
|
- 优化 示例可复制图标名称 |
||||||
|
## 1.3.1(2021-11-23) |
||||||
|
- 优化 兼容旧组件 type 值 |
||||||
|
## 1.3.0(2021-11-19) |
||||||
|
- 新增 更多图标 |
||||||
|
- 优化 自定义图标使用方式 |
||||||
|
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) |
||||||
|
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-icons](https://uniapp.dcloud.io/component/uniui/uni-icons) |
||||||
|
## 1.1.7(2021-11-08) |
||||||
|
## 1.2.0(2021-07-30) |
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) |
||||||
|
## 1.1.5(2021-05-12) |
||||||
|
- 新增 组件示例地址 |
||||||
|
## 1.1.4(2021-02-05) |
||||||
|
- 调整为uni_modules目录规范 |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,663 @@ |
|||||||
|
.uniui-color:before { |
||||||
|
content: "\e6cf"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-wallet:before { |
||||||
|
content: "\e6b1"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-settings-filled:before { |
||||||
|
content: "\e6ce"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-auth-filled:before { |
||||||
|
content: "\e6cc"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-shop-filled:before { |
||||||
|
content: "\e6cd"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-staff-filled:before { |
||||||
|
content: "\e6cb"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-vip-filled:before { |
||||||
|
content: "\e6c6"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-plus-filled:before { |
||||||
|
content: "\e6c7"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-folder-add-filled:before { |
||||||
|
content: "\e6c8"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-color-filled:before { |
||||||
|
content: "\e6c9"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-tune-filled:before { |
||||||
|
content: "\e6ca"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-calendar-filled:before { |
||||||
|
content: "\e6c0"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-notification-filled:before { |
||||||
|
content: "\e6c1"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-wallet-filled:before { |
||||||
|
content: "\e6c2"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-medal-filled:before { |
||||||
|
content: "\e6c3"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-gift-filled:before { |
||||||
|
content: "\e6c4"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-fire-filled:before { |
||||||
|
content: "\e6c5"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-refreshempty:before { |
||||||
|
content: "\e6bf"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-location-filled:before { |
||||||
|
content: "\e6af"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-person-filled:before { |
||||||
|
content: "\e69d"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-personadd-filled:before { |
||||||
|
content: "\e698"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-back:before { |
||||||
|
content: "\e6b9"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-forward:before { |
||||||
|
content: "\e6ba"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrow-right:before { |
||||||
|
content: "\e6bb"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrowthinright:before { |
||||||
|
content: "\e6bb"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrow-left:before { |
||||||
|
content: "\e6bc"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrowthinleft:before { |
||||||
|
content: "\e6bc"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrow-up:before { |
||||||
|
content: "\e6bd"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrowthinup:before { |
||||||
|
content: "\e6bd"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrow-down:before { |
||||||
|
content: "\e6be"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrowthindown:before { |
||||||
|
content: "\e6be"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-bottom:before { |
||||||
|
content: "\e6b8"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrowdown:before { |
||||||
|
content: "\e6b8"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-right:before { |
||||||
|
content: "\e6b5"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrowright:before { |
||||||
|
content: "\e6b5"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-top:before { |
||||||
|
content: "\e6b6"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrowup:before { |
||||||
|
content: "\e6b6"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-left:before { |
||||||
|
content: "\e6b7"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-arrowleft:before { |
||||||
|
content: "\e6b7"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-eye:before { |
||||||
|
content: "\e651"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-eye-filled:before { |
||||||
|
content: "\e66a"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-eye-slash:before { |
||||||
|
content: "\e6b3"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-eye-slash-filled:before { |
||||||
|
content: "\e6b4"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-info-filled:before { |
||||||
|
content: "\e649"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-reload:before { |
||||||
|
content: "\e6b2"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-micoff-filled:before { |
||||||
|
content: "\e6b0"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-map-pin-ellipse:before { |
||||||
|
content: "\e6ac"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-map-pin:before { |
||||||
|
content: "\e6ad"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-location:before { |
||||||
|
content: "\e6ae"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-starhalf:before { |
||||||
|
content: "\e683"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-star:before { |
||||||
|
content: "\e688"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-star-filled:before { |
||||||
|
content: "\e68f"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-calendar:before { |
||||||
|
content: "\e6a0"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-fire:before { |
||||||
|
content: "\e6a1"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-medal:before { |
||||||
|
content: "\e6a2"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-font:before { |
||||||
|
content: "\e6a3"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-gift:before { |
||||||
|
content: "\e6a4"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-link:before { |
||||||
|
content: "\e6a5"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-notification:before { |
||||||
|
content: "\e6a6"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-staff:before { |
||||||
|
content: "\e6a7"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-vip:before { |
||||||
|
content: "\e6a8"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-folder-add:before { |
||||||
|
content: "\e6a9"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-tune:before { |
||||||
|
content: "\e6aa"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-auth:before { |
||||||
|
content: "\e6ab"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-person:before { |
||||||
|
content: "\e699"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-email-filled:before { |
||||||
|
content: "\e69a"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-phone-filled:before { |
||||||
|
content: "\e69b"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-phone:before { |
||||||
|
content: "\e69c"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-email:before { |
||||||
|
content: "\e69e"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-personadd:before { |
||||||
|
content: "\e69f"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-chatboxes-filled:before { |
||||||
|
content: "\e692"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-contact:before { |
||||||
|
content: "\e693"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-chatbubble-filled:before { |
||||||
|
content: "\e694"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-contact-filled:before { |
||||||
|
content: "\e695"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-chatboxes:before { |
||||||
|
content: "\e696"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-chatbubble:before { |
||||||
|
content: "\e697"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-upload-filled:before { |
||||||
|
content: "\e68e"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-upload:before { |
||||||
|
content: "\e690"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-weixin:before { |
||||||
|
content: "\e691"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-compose:before { |
||||||
|
content: "\e67f"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-qq:before { |
||||||
|
content: "\e680"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-download-filled:before { |
||||||
|
content: "\e681"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-pyq:before { |
||||||
|
content: "\e682"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-sound:before { |
||||||
|
content: "\e684"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-trash-filled:before { |
||||||
|
content: "\e685"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-sound-filled:before { |
||||||
|
content: "\e686"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-trash:before { |
||||||
|
content: "\e687"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-videocam-filled:before { |
||||||
|
content: "\e689"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-spinner-cycle:before { |
||||||
|
content: "\e68a"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-weibo:before { |
||||||
|
content: "\e68b"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-videocam:before { |
||||||
|
content: "\e68c"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-download:before { |
||||||
|
content: "\e68d"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-help:before { |
||||||
|
content: "\e679"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-navigate-filled:before { |
||||||
|
content: "\e67a"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-plusempty:before { |
||||||
|
content: "\e67b"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-smallcircle:before { |
||||||
|
content: "\e67c"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-minus-filled:before { |
||||||
|
content: "\e67d"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-micoff:before { |
||||||
|
content: "\e67e"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-closeempty:before { |
||||||
|
content: "\e66c"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-clear:before { |
||||||
|
content: "\e66d"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-navigate:before { |
||||||
|
content: "\e66e"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-minus:before { |
||||||
|
content: "\e66f"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-image:before { |
||||||
|
content: "\e670"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-mic:before { |
||||||
|
content: "\e671"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-paperplane:before { |
||||||
|
content: "\e672"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-close:before { |
||||||
|
content: "\e673"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-help-filled:before { |
||||||
|
content: "\e674"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-paperplane-filled:before { |
||||||
|
content: "\e675"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-plus:before { |
||||||
|
content: "\e676"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-mic-filled:before { |
||||||
|
content: "\e677"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-image-filled:before { |
||||||
|
content: "\e678"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-locked-filled:before { |
||||||
|
content: "\e668"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-info:before { |
||||||
|
content: "\e669"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-locked:before { |
||||||
|
content: "\e66b"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-camera-filled:before { |
||||||
|
content: "\e658"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-chat-filled:before { |
||||||
|
content: "\e659"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-camera:before { |
||||||
|
content: "\e65a"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-circle:before { |
||||||
|
content: "\e65b"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-checkmarkempty:before { |
||||||
|
content: "\e65c"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-chat:before { |
||||||
|
content: "\e65d"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-circle-filled:before { |
||||||
|
content: "\e65e"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-flag:before { |
||||||
|
content: "\e65f"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-flag-filled:before { |
||||||
|
content: "\e660"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-gear-filled:before { |
||||||
|
content: "\e661"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-home:before { |
||||||
|
content: "\e662"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-home-filled:before { |
||||||
|
content: "\e663"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-gear:before { |
||||||
|
content: "\e664"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-smallcircle-filled:before { |
||||||
|
content: "\e665"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-map-filled:before { |
||||||
|
content: "\e666"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-map:before { |
||||||
|
content: "\e667"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-refresh-filled:before { |
||||||
|
content: "\e656"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-refresh:before { |
||||||
|
content: "\e657"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-cloud-upload:before { |
||||||
|
content: "\e645"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-cloud-download-filled:before { |
||||||
|
content: "\e646"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-cloud-download:before { |
||||||
|
content: "\e647"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-cloud-upload-filled:before { |
||||||
|
content: "\e648"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-redo:before { |
||||||
|
content: "\e64a"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-images-filled:before { |
||||||
|
content: "\e64b"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-undo-filled:before { |
||||||
|
content: "\e64c"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-more:before { |
||||||
|
content: "\e64d"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-more-filled:before { |
||||||
|
content: "\e64e"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-undo:before { |
||||||
|
content: "\e64f"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-images:before { |
||||||
|
content: "\e650"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-paperclip:before { |
||||||
|
content: "\e652"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-settings:before { |
||||||
|
content: "\e653"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-search:before { |
||||||
|
content: "\e654"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-redo-filled:before { |
||||||
|
content: "\e655"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-list:before { |
||||||
|
content: "\e644"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-mail-open-filled:before { |
||||||
|
content: "\e63a"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-hand-down-filled:before { |
||||||
|
content: "\e63c"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-hand-down:before { |
||||||
|
content: "\e63d"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-hand-up-filled:before { |
||||||
|
content: "\e63e"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-hand-up:before { |
||||||
|
content: "\e63f"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-heart-filled:before { |
||||||
|
content: "\e641"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-mail-open:before { |
||||||
|
content: "\e643"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-heart:before { |
||||||
|
content: "\e639"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-loop:before { |
||||||
|
content: "\e633"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-pulldown:before { |
||||||
|
content: "\e632"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-scan:before { |
||||||
|
content: "\e62a"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-bars:before { |
||||||
|
content: "\e627"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-cart-filled:before { |
||||||
|
content: "\e629"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-checkbox:before { |
||||||
|
content: "\e62b"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-checkbox-filled:before { |
||||||
|
content: "\e62c"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-shop:before { |
||||||
|
content: "\e62f"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-headphones:before { |
||||||
|
content: "\e630"; |
||||||
|
} |
||||||
|
|
||||||
|
.uniui-cart:before { |
||||||
|
content: "\e631"; |
||||||
|
} |
Binary file not shown.
@ -0,0 +1,86 @@ |
|||||||
|
{ |
||||||
|
"id": "uni-icons", |
||||||
|
"displayName": "uni-icons 图标", |
||||||
|
"version": "1.3.5", |
||||||
|
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。", |
||||||
|
"keywords": [ |
||||||
|
"uni-ui", |
||||||
|
"uniui", |
||||||
|
"icon", |
||||||
|
"图标" |
||||||
|
], |
||||||
|
"repository": "https://github.com/dcloudio/uni-ui", |
||||||
|
"engines": { |
||||||
|
"HBuilderX": "^3.2.14" |
||||||
|
}, |
||||||
|
"directories": { |
||||||
|
"example": "../../temps/example_temps" |
||||||
|
}, |
||||||
|
"dcloudext": { |
||||||
|
"category": [ |
||||||
|
"前端组件", |
||||||
|
"通用组件" |
||||||
|
], |
||||||
|
"sale": { |
||||||
|
"regular": { |
||||||
|
"price": "0.00" |
||||||
|
}, |
||||||
|
"sourcecode": { |
||||||
|
"price": "0.00" |
||||||
|
} |
||||||
|
}, |
||||||
|
"contact": { |
||||||
|
"qq": "" |
||||||
|
}, |
||||||
|
"declaration": { |
||||||
|
"ads": "无", |
||||||
|
"data": "无", |
||||||
|
"permissions": "无" |
||||||
|
}, |
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" |
||||||
|
}, |
||||||
|
"uni_modules": { |
||||||
|
"dependencies": ["uni-scss"], |
||||||
|
"encrypt": [], |
||||||
|
"platforms": { |
||||||
|
"cloud": { |
||||||
|
"tcb": "y", |
||||||
|
"aliyun": "y" |
||||||
|
}, |
||||||
|
"client": { |
||||||
|
"App": { |
||||||
|
"app-vue": "y", |
||||||
|
"app-nvue": "y" |
||||||
|
}, |
||||||
|
"H5-mobile": { |
||||||
|
"Safari": "y", |
||||||
|
"Android Browser": "y", |
||||||
|
"微信浏览器(Android)": "y", |
||||||
|
"QQ浏览器(Android)": "y" |
||||||
|
}, |
||||||
|
"H5-pc": { |
||||||
|
"Chrome": "y", |
||||||
|
"IE": "y", |
||||||
|
"Edge": "y", |
||||||
|
"Firefox": "y", |
||||||
|
"Safari": "y" |
||||||
|
}, |
||||||
|
"小程序": { |
||||||
|
"微信": "y", |
||||||
|
"阿里": "y", |
||||||
|
"百度": "y", |
||||||
|
"字节跳动": "y", |
||||||
|
"QQ": "y" |
||||||
|
}, |
||||||
|
"快应用": { |
||||||
|
"华为": "u", |
||||||
|
"联盟": "u" |
||||||
|
}, |
||||||
|
"Vue": { |
||||||
|
"vue2": "y", |
||||||
|
"vue3": "y" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
## Icons 图标 |
||||||
|
> **组件名:uni-icons** |
||||||
|
> 代码块: `uIcons` |
||||||
|
|
||||||
|
用于展示 icons 图标 。 |
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-icons) |
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 |
@ -0,0 +1,19 @@ |
|||||||
|
## 1.3.3(2022-01-20) |
||||||
|
- 新增 showText属性 ,是否显示文本 |
||||||
|
## 1.3.2(2022-01-19) |
||||||
|
- 修复 nvue 平台下不显示文本的bug |
||||||
|
## 1.3.1(2022-01-19) |
||||||
|
- 修复 微信小程序平台样式选择器报警告的问题 |
||||||
|
## 1.3.0(2021-11-19) |
||||||
|
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource) |
||||||
|
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-load-more](https://uniapp.dcloud.io/component/uniui/uni-load-more) |
||||||
|
## 1.2.1(2021-08-24) |
||||||
|
- 新增 支持国际化 |
||||||
|
## 1.2.0(2021-07-30) |
||||||
|
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834) |
||||||
|
## 1.1.8(2021-05-12) |
||||||
|
- 新增 组件示例地址 |
||||||
|
## 1.1.7(2021-03-30) |
||||||
|
- 修复 uni-load-more 在首页使用时,h5 平台报 'uni is not defined' 的 bug |
||||||
|
## 1.1.6(2021-02-05) |
||||||
|
- 调整为uni_modules目录规范 |
@ -0,0 +1,5 @@ |
|||||||
|
{ |
||||||
|
"uni-load-more.contentdown": "Pull up to show more", |
||||||
|
"uni-load-more.contentrefresh": "loading...", |
||||||
|
"uni-load-more.contentnomore": "No more data" |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
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 |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
{ |
||||||
|
"uni-load-more.contentdown": "上拉显示更多", |
||||||
|
"uni-load-more.contentrefresh": "正在加载...", |
||||||
|
"uni-load-more.contentnomore": "没有更多数据了" |
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
{ |
||||||
|
"uni-load-more.contentdown": "上拉顯示更多", |
||||||
|
"uni-load-more.contentrefresh": "正在加載...", |
||||||
|
"uni-load-more.contentnomore": "沒有更多數據了" |
||||||
|
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,86 @@ |
|||||||
|
{ |
||||||
|
"id": "uni-load-more", |
||||||
|
"displayName": "uni-load-more 加载更多", |
||||||
|
"version": "1.3.3", |
||||||
|
"description": "LoadMore 组件,常用在列表里面,做滚动加载使用。", |
||||||
|
"keywords": [ |
||||||
|
"uni-ui", |
||||||
|
"uniui", |
||||||
|
"加载更多", |
||||||
|
"load-more" |
||||||
|
], |
||||||
|
"repository": "https://github.com/dcloudio/uni-ui", |
||||||
|
"engines": { |
||||||
|
"HBuilderX": "" |
||||||
|
}, |
||||||
|
"directories": { |
||||||
|
"example": "../../temps/example_temps" |
||||||
|
}, |
||||||
|
"dcloudext": { |
||||||
|
"category": [ |
||||||
|
"前端组件", |
||||||
|
"通用组件" |
||||||
|
], |
||||||
|
"sale": { |
||||||
|
"regular": { |
||||||
|
"price": "0.00" |
||||||
|
}, |
||||||
|
"sourcecode": { |
||||||
|
"price": "0.00" |
||||||
|
} |
||||||
|
}, |
||||||
|
"contact": { |
||||||
|
"qq": "" |
||||||
|
}, |
||||||
|
"declaration": { |
||||||
|
"ads": "无", |
||||||
|
"data": "无", |
||||||
|
"permissions": "无" |
||||||
|
}, |
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" |
||||||
|
}, |
||||||
|
"uni_modules": { |
||||||
|
"dependencies": ["uni-scss"], |
||||||
|
"encrypt": [], |
||||||
|
"platforms": { |
||||||
|
"cloud": { |
||||||
|
"tcb": "y", |
||||||
|
"aliyun": "y" |
||||||
|
}, |
||||||
|
"client": { |
||||||
|
"App": { |
||||||
|
"app-vue": "y", |
||||||
|
"app-nvue": "y" |
||||||
|
}, |
||||||
|
"H5-mobile": { |
||||||
|
"Safari": "y", |
||||||
|
"Android Browser": "y", |
||||||
|
"微信浏览器(Android)": "y", |
||||||
|
"QQ浏览器(Android)": "y" |
||||||
|
}, |
||||||
|
"H5-pc": { |
||||||
|
"Chrome": "y", |
||||||
|
"IE": "y", |
||||||
|
"Edge": "y", |
||||||
|
"Firefox": "y", |
||||||
|
"Safari": "y" |
||||||
|
}, |
||||||
|
"小程序": { |
||||||
|
"微信": "y", |
||||||
|
"阿里": "y", |
||||||
|
"百度": "y", |
||||||
|
"字节跳动": "y", |
||||||
|
"QQ": "y" |
||||||
|
}, |
||||||
|
"快应用": { |
||||||
|
"华为": "u", |
||||||
|
"联盟": "u" |
||||||
|
}, |
||||||
|
"Vue": { |
||||||
|
"vue2": "y", |
||||||
|
"vue3": "y" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,14 @@ |
|||||||
|
|
||||||
|
|
||||||
|
### LoadMore 加载更多 |
||||||
|
> **组件名:uni-load-more** |
||||||
|
> 代码块: `uLoadMore` |
||||||
|
|
||||||
|
|
||||||
|
用于列表中,做滚动加载使用,展示 loading 的各种状态。 |
||||||
|
|
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-load-more) |
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 |
||||||
|
|
||||||
|
|
@ -0,0 +1,8 @@ |
|||||||
|
## 1.0.3(2022-01-21) |
||||||
|
- 优化 组件示例 |
||||||
|
## 1.0.2(2021-11-22) |
||||||
|
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题 |
||||||
|
## 1.0.1(2021-11-22) |
||||||
|
- 修复 vue3中scss语法兼容问题 |
||||||
|
## 1.0.0(2021-11-18) |
||||||
|
- init |
@ -0,0 +1,82 @@ |
|||||||
|
{ |
||||||
|
"id": "uni-scss", |
||||||
|
"displayName": "uni-scss 辅助样式", |
||||||
|
"version": "1.0.3", |
||||||
|
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。", |
||||||
|
"keywords": [ |
||||||
|
"uni-scss", |
||||||
|
"uni-ui", |
||||||
|
"辅助样式" |
||||||
|
], |
||||||
|
"repository": "https://github.com/dcloudio/uni-ui", |
||||||
|
"engines": { |
||||||
|
"HBuilderX": "^3.1.0" |
||||||
|
}, |
||||||
|
"dcloudext": { |
||||||
|
"category": [ |
||||||
|
"JS SDK", |
||||||
|
"通用 SDK" |
||||||
|
], |
||||||
|
"sale": { |
||||||
|
"regular": { |
||||||
|
"price": "0.00" |
||||||
|
}, |
||||||
|
"sourcecode": { |
||||||
|
"price": "0.00" |
||||||
|
} |
||||||
|
}, |
||||||
|
"contact": { |
||||||
|
"qq": "" |
||||||
|
}, |
||||||
|
"declaration": { |
||||||
|
"ads": "无", |
||||||
|
"data": "无", |
||||||
|
"permissions": "无" |
||||||
|
}, |
||||||
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui" |
||||||
|
}, |
||||||
|
"uni_modules": { |
||||||
|
"dependencies": [], |
||||||
|
"encrypt": [], |
||||||
|
"platforms": { |
||||||
|
"cloud": { |
||||||
|
"tcb": "y", |
||||||
|
"aliyun": "y" |
||||||
|
}, |
||||||
|
"client": { |
||||||
|
"App": { |
||||||
|
"app-vue": "y", |
||||||
|
"app-nvue": "u" |
||||||
|
}, |
||||||
|
"H5-mobile": { |
||||||
|
"Safari": "y", |
||||||
|
"Android Browser": "y", |
||||||
|
"微信浏览器(Android)": "y", |
||||||
|
"QQ浏览器(Android)": "y" |
||||||
|
}, |
||||||
|
"H5-pc": { |
||||||
|
"Chrome": "y", |
||||||
|
"IE": "y", |
||||||
|
"Edge": "y", |
||||||
|
"Firefox": "y", |
||||||
|
"Safari": "y" |
||||||
|
}, |
||||||
|
"小程序": { |
||||||
|
"微信": "y", |
||||||
|
"阿里": "y", |
||||||
|
"百度": "y", |
||||||
|
"字节跳动": "y", |
||||||
|
"QQ": "y" |
||||||
|
}, |
||||||
|
"快应用": { |
||||||
|
"华为": "n", |
||||||
|
"联盟": "n" |
||||||
|
}, |
||||||
|
"Vue": { |
||||||
|
"vue2": "y", |
||||||
|
"vue3": "y" |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,4 @@ |
|||||||
|
`uni-sass` 是 `uni-ui`提供的一套全局样式 ,通过一些简单的类名和`sass`变量,实现简单的页面布局操作,比如颜色、边距、圆角等。 |
||||||
|
|
||||||
|
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-sass) |
||||||
|
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 |
@ -0,0 +1,7 @@ |
|||||||
|
@import './setting/_variables.scss'; |
||||||
|
@import './setting/_border.scss'; |
||||||
|
@import './setting/_color.scss'; |
||||||
|
@import './setting/_space.scss'; |
||||||
|
@import './setting/_radius.scss'; |
||||||
|
@import './setting/_text.scss'; |
||||||
|
@import './setting/_styles.scss'; |
@ -0,0 +1,3 @@ |
|||||||
|
.uni-border { |
||||||
|
border: 1px $uni-border-1 solid; |
||||||
|
} |
@ -0,0 +1,66 @@ |
|||||||
|
|
||||||
|
// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐 |
||||||
|
// @mixin get-styles($k,$c) { |
||||||
|
// @if $k == size or $k == weight{ |
||||||
|
// font-#{$k}:#{$c} |
||||||
|
// }@else{ |
||||||
|
// #{$k}:#{$c} |
||||||
|
// } |
||||||
|
// } |
||||||
|
$uni-ui-color:( |
||||||
|
// 主色 |
||||||
|
primary: $uni-primary, |
||||||
|
primary-disable: $uni-primary-disable, |
||||||
|
primary-light: $uni-primary-light, |
||||||
|
// 辅助色 |
||||||
|
success: $uni-success, |
||||||
|
success-disable: $uni-success-disable, |
||||||
|
success-light: $uni-success-light, |
||||||
|
warning: $uni-warning, |
||||||
|
warning-disable: $uni-warning-disable, |
||||||
|
warning-light: $uni-warning-light, |
||||||
|
error: $uni-error, |
||||||
|
error-disable: $uni-error-disable, |
||||||
|
error-light: $uni-error-light, |
||||||
|
info: $uni-info, |
||||||
|
info-disable: $uni-info-disable, |
||||||
|
info-light: $uni-info-light, |
||||||
|
// 中性色 |
||||||
|
main-color: $uni-main-color, |
||||||
|
base-color: $uni-base-color, |
||||||
|
secondary-color: $uni-secondary-color, |
||||||
|
extra-color: $uni-extra-color, |
||||||
|
// 背景色 |
||||||
|
bg-color: $uni-bg-color, |
||||||
|
// 边框颜色 |
||||||
|
border-1: $uni-border-1, |
||||||
|
border-2: $uni-border-2, |
||||||
|
border-3: $uni-border-3, |
||||||
|
border-4: $uni-border-4, |
||||||
|
// 黑色 |
||||||
|
black:$uni-black, |
||||||
|
// 白色 |
||||||
|
white:$uni-white, |
||||||
|
// 透明 |
||||||
|
transparent:$uni-transparent |
||||||
|
) !default; |
||||||
|
@each $key, $child in $uni-ui-color { |
||||||
|
.uni-#{"" + $key} { |
||||||
|
color: $child; |
||||||
|
} |
||||||
|
.uni-#{"" + $key}-bg { |
||||||
|
background-color: $child; |
||||||
|
} |
||||||
|
} |
||||||
|
.uni-shadow-sm { |
||||||
|
box-shadow: $uni-shadow-sm; |
||||||
|
} |
||||||
|
.uni-shadow-base { |
||||||
|
box-shadow: $uni-shadow-base; |
||||||
|
} |
||||||
|
.uni-shadow-lg { |
||||||
|
box-shadow: $uni-shadow-lg; |
||||||
|
} |
||||||
|
.uni-mask { |
||||||
|
background-color:$uni-mask; |
||||||
|
} |
@ -0,0 +1,55 @@ |
|||||||
|
@mixin radius($r,$d:null ,$important: false){ |
||||||
|
$radius-value:map-get($uni-radius, $r) if($important, !important, null); |
||||||
|
// Key exists within the $uni-radius variable |
||||||
|
@if (map-has-key($uni-radius, $r) and $d){ |
||||||
|
@if $d == t { |
||||||
|
border-top-left-radius:$radius-value; |
||||||
|
border-top-right-radius:$radius-value; |
||||||
|
}@else if $d == r { |
||||||
|
border-top-right-radius:$radius-value; |
||||||
|
border-bottom-right-radius:$radius-value; |
||||||
|
}@else if $d == b { |
||||||
|
border-bottom-left-radius:$radius-value; |
||||||
|
border-bottom-right-radius:$radius-value; |
||||||
|
}@else if $d == l { |
||||||
|
border-top-left-radius:$radius-value; |
||||||
|
border-bottom-left-radius:$radius-value; |
||||||
|
}@else if $d == tl { |
||||||
|
border-top-left-radius:$radius-value; |
||||||
|
}@else if $d == tr { |
||||||
|
border-top-right-radius:$radius-value; |
||||||
|
}@else if $d == br { |
||||||
|
border-bottom-right-radius:$radius-value; |
||||||
|
}@else if $d == bl { |
||||||
|
border-bottom-left-radius:$radius-value; |
||||||
|
} |
||||||
|
}@else{ |
||||||
|
border-radius:$radius-value; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@each $key, $child in $uni-radius { |
||||||
|
@if($key){ |
||||||
|
.uni-radius-#{"" + $key} { |
||||||
|
@include radius($key) |
||||||
|
} |
||||||
|
}@else{ |
||||||
|
.uni-radius { |
||||||
|
@include radius($key) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@each $direction in t, r, b, l,tl, tr, br, bl { |
||||||
|
@each $key, $child in $uni-radius { |
||||||
|
@if($key){ |
||||||
|
.uni-radius-#{"" + $direction}-#{"" + $key} { |
||||||
|
@include radius($key,$direction,false) |
||||||
|
} |
||||||
|
}@else{ |
||||||
|
.uni-radius-#{$direction} { |
||||||
|
@include radius($key,$direction,false) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,56 @@ |
|||||||
|
|
||||||
|
@mixin fn($space,$direction,$size,$n) { |
||||||
|
@if $n { |
||||||
|
#{$space}-#{$direction}: #{$size*$uni-space-root}px |
||||||
|
} @else { |
||||||
|
#{$space}-#{$direction}: #{-$size*$uni-space-root}px |
||||||
|
} |
||||||
|
} |
||||||
|
@mixin get-styles($direction,$i,$space,$n){ |
||||||
|
@if $direction == t { |
||||||
|
@include fn($space, top,$i,$n); |
||||||
|
} |
||||||
|
@if $direction == r { |
||||||
|
@include fn($space, right,$i,$n); |
||||||
|
} |
||||||
|
@if $direction == b { |
||||||
|
@include fn($space, bottom,$i,$n); |
||||||
|
} |
||||||
|
@if $direction == l { |
||||||
|
@include fn($space, left,$i,$n); |
||||||
|
} |
||||||
|
@if $direction == x { |
||||||
|
@include fn($space, left,$i,$n); |
||||||
|
@include fn($space, right,$i,$n); |
||||||
|
} |
||||||
|
@if $direction == y { |
||||||
|
@include fn($space, top,$i,$n); |
||||||
|
@include fn($space, bottom,$i,$n); |
||||||
|
} |
||||||
|
@if $direction == a { |
||||||
|
@if $n { |
||||||
|
#{$space}:#{$i*$uni-space-root}px; |
||||||
|
} @else { |
||||||
|
#{$space}:#{-$i*$uni-space-root}px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@each $orientation in m,p { |
||||||
|
$space: margin; |
||||||
|
@if $orientation == m { |
||||||
|
$space: margin; |
||||||
|
} @else { |
||||||
|
$space: padding; |
||||||
|
} |
||||||
|
@for $i from 0 through 16 { |
||||||
|
@each $direction in t, r, b, l, x, y, a { |
||||||
|
.uni-#{$orientation}#{$direction}-#{$i} { |
||||||
|
@include get-styles($direction,$i,$space,true); |
||||||
|
} |
||||||
|
.uni-#{$orientation}#{$direction}-n#{$i} { |
||||||
|
@include get-styles($direction,$i,$space,false); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,167 @@ |
|||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
|
||||||
|
$-color-white:#fff; |
||||||
|
$-color-black:#000; |
||||||
|
@mixin base-style($color) { |
||||||
|
color: #fff; |
||||||
|
background-color: $color; |
||||||
|
border-color: mix($-color-black, $color, 8%); |
||||||
|
&:not([hover-class]):active { |
||||||
|
background: mix($-color-black, $color, 10%); |
||||||
|
border-color: mix($-color-black, $color, 20%); |
||||||
|
color: $-color-white; |
||||||
|
outline: none; |
||||||
|
} |
||||||
|
} |
||||||
|
@mixin is-color($color) { |
||||||
|
@include base-style($color); |
||||||
|
&[loading] { |
||||||
|
@include base-style($color); |
||||||
|
&::before { |
||||||
|
margin-right:5px; |
||||||
|
} |
||||||
|
} |
||||||
|
&[disabled] { |
||||||
|
&, |
||||||
|
&[loading], |
||||||
|
&:not([hover-class]):active { |
||||||
|
color: $-color-white; |
||||||
|
border-color: mix(darken($color,10%), $-color-white); |
||||||
|
background-color: mix($color, $-color-white); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
@mixin base-plain-style($color) { |
||||||
|
color:$color; |
||||||
|
background-color: mix($-color-white, $color, 90%); |
||||||
|
border-color: mix($-color-white, $color, 70%); |
||||||
|
&:not([hover-class]):active { |
||||||
|
background: mix($-color-white, $color, 80%); |
||||||
|
color: $color; |
||||||
|
outline: none; |
||||||
|
border-color: mix($-color-white, $color, 50%); |
||||||
|
} |
||||||
|
} |
||||||
|
@mixin is-plain($color){ |
||||||
|
&[plain] { |
||||||
|
@include base-plain-style($color); |
||||||
|
&[loading] { |
||||||
|
@include base-plain-style($color); |
||||||
|
&::before { |
||||||
|
margin-right:5px; |
||||||
|
} |
||||||
|
} |
||||||
|
&[disabled] { |
||||||
|
&, |
||||||
|
&:active { |
||||||
|
color: mix($-color-white, $color, 40%); |
||||||
|
background-color: mix($-color-white, $color, 90%); |
||||||
|
border-color: mix($-color-white, $color, 80%); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
.uni-btn { |
||||||
|
margin: 5px; |
||||||
|
color: #393939; |
||||||
|
border:1px solid #ccc; |
||||||
|
font-size: 16px; |
||||||
|
font-weight: 200; |
||||||
|
background-color: #F9F9F9; |
||||||
|
// TODO 暂时处理边框隐藏一边的问题 |
||||||
|
overflow: visible; |
||||||
|
&::after{ |
||||||
|
border: none; |
||||||
|
} |
||||||
|
|
||||||
|
&:not([type]),&[type=default] { |
||||||
|
color: #999; |
||||||
|
&[loading] { |
||||||
|
background: none; |
||||||
|
&::before { |
||||||
|
margin-right:5px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
&[disabled]{ |
||||||
|
color: mix($-color-white, #999, 60%); |
||||||
|
&, |
||||||
|
&[loading], |
||||||
|
&:active { |
||||||
|
color: mix($-color-white, #999, 60%); |
||||||
|
background-color: mix($-color-white,$-color-black , 98%); |
||||||
|
border-color: mix($-color-white, #999, 85%); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
&[plain] { |
||||||
|
color: #999; |
||||||
|
background: none; |
||||||
|
border-color: $uni-border-1; |
||||||
|
&:not([hover-class]):active { |
||||||
|
background: none; |
||||||
|
color: mix($-color-white, $-color-black, 80%); |
||||||
|
border-color: mix($-color-white, $-color-black, 90%); |
||||||
|
outline: none; |
||||||
|
} |
||||||
|
&[disabled]{ |
||||||
|
&, |
||||||
|
&[loading], |
||||||
|
&:active { |
||||||
|
background: none; |
||||||
|
color: mix($-color-white, #999, 60%); |
||||||
|
border-color: mix($-color-white, #999, 85%); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
&:not([hover-class]):active { |
||||||
|
color: mix($-color-white, $-color-black, 50%); |
||||||
|
} |
||||||
|
|
||||||
|
&[size=mini] { |
||||||
|
font-size: 16px; |
||||||
|
font-weight: 200; |
||||||
|
border-radius: 8px; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
&.uni-btn-small { |
||||||
|
font-size: 14px; |
||||||
|
} |
||||||
|
&.uni-btn-mini { |
||||||
|
font-size: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
&.uni-btn-radius { |
||||||
|
border-radius: 999px; |
||||||
|
} |
||||||
|
&[type=primary] { |
||||||
|
@include is-color($uni-primary); |
||||||
|
@include is-plain($uni-primary) |
||||||
|
} |
||||||
|
&[type=success] { |
||||||
|
@include is-color($uni-success); |
||||||
|
@include is-plain($uni-success) |
||||||
|
} |
||||||
|
&[type=error] { |
||||||
|
@include is-color($uni-error); |
||||||
|
@include is-plain($uni-error) |
||||||
|
} |
||||||
|
&[type=warning] { |
||||||
|
@include is-color($uni-warning); |
||||||
|
@include is-plain($uni-warning) |
||||||
|
} |
||||||
|
&[type=info] { |
||||||
|
@include is-color($uni-info); |
||||||
|
@include is-plain($uni-info) |
||||||
|
} |
||||||
|
} |
||||||
|
/* #endif */ |
@ -0,0 +1,24 @@ |
|||||||
|
@mixin get-styles($k,$c) { |
||||||
|
@if $k == size or $k == weight{ |
||||||
|
font-#{$k}:#{$c} |
||||||
|
}@else{ |
||||||
|
#{$k}:#{$c} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@each $key, $child in $uni-headings { |
||||||
|
/* #ifndef APP-NVUE */ |
||||||
|
.uni-#{$key} { |
||||||
|
@each $k, $c in $child { |
||||||
|
@include get-styles($k,$c) |
||||||
|
} |
||||||
|
} |
||||||
|
/* #endif */ |
||||||
|
/* #ifdef APP-NVUE */ |
||||||
|
.container .uni-#{$key} { |
||||||
|
@each $k, $c in $child { |
||||||
|
@include get-styles($k,$c) |
||||||
|
} |
||||||
|
} |
||||||
|
/* #endif */ |
||||||
|
} |
@ -0,0 +1,146 @@ |
|||||||
|
// @use "sass:math"; |
||||||
|
@import '../tools/functions.scss'; |
||||||
|
// 间距基础倍数 |
||||||
|
$uni-space-root: 2 !default; |
||||||
|
// 边框半径默认值 |
||||||
|
$uni-radius-root:5px !default; |
||||||
|
$uni-radius: () !default; |
||||||
|
// 边框半径断点 |
||||||
|
$uni-radius: map-deep-merge( |
||||||
|
( |
||||||
|
0: 0, |
||||||
|
// TODO 当前版本暂时不支持 sm 属性 |
||||||
|
// 'sm': math.div($uni-radius-root, 2), |
||||||
|
null: $uni-radius-root, |
||||||
|
'lg': $uni-radius-root * 2, |
||||||
|
'xl': $uni-radius-root * 6, |
||||||
|
'pill': 9999px, |
||||||
|
'circle': 50% |
||||||
|
), |
||||||
|
$uni-radius |
||||||
|
); |
||||||
|
// 字体家族 |
||||||
|
$body-font-family: 'Roboto', sans-serif !default; |
||||||
|
// 文本 |
||||||
|
$heading-font-family: $body-font-family !default; |
||||||
|
$uni-headings: () !default; |
||||||
|
$letterSpacing: -0.01562em; |
||||||
|
$uni-headings: map-deep-merge( |
||||||
|
( |
||||||
|
'h1': ( |
||||||
|
size: 32px, |
||||||
|
weight: 300, |
||||||
|
line-height: 50px, |
||||||
|
// letter-spacing:-0.01562em |
||||||
|
), |
||||||
|
'h2': ( |
||||||
|
size: 28px, |
||||||
|
weight: 300, |
||||||
|
line-height: 40px, |
||||||
|
// letter-spacing: -0.00833em |
||||||
|
), |
||||||
|
'h3': ( |
||||||
|
size: 24px, |
||||||
|
weight: 400, |
||||||
|
line-height: 32px, |
||||||
|
// letter-spacing: normal |
||||||
|
), |
||||||
|
'h4': ( |
||||||
|
size: 20px, |
||||||
|
weight: 400, |
||||||
|
line-height: 30px, |
||||||
|
// letter-spacing: 0.00735em |
||||||
|
), |
||||||
|
'h5': ( |
||||||
|
size: 16px, |
||||||
|
weight: 400, |
||||||
|
line-height: 24px, |
||||||
|
// letter-spacing: normal |
||||||
|
), |
||||||
|
'h6': ( |
||||||
|
size: 14px, |
||||||
|
weight: 500, |
||||||
|
line-height: 18px, |
||||||
|
// letter-spacing: 0.0125em |
||||||
|
), |
||||||
|
'subtitle': ( |
||||||
|
size: 12px, |
||||||
|
weight: 400, |
||||||
|
line-height: 20px, |
||||||
|
// letter-spacing: 0.00937em |
||||||
|
), |
||||||
|
'body': ( |
||||||
|
font-size: 14px, |
||||||
|
font-weight: 400, |
||||||
|
line-height: 22px, |
||||||
|
// letter-spacing: 0.03125em |
||||||
|
), |
||||||
|
'caption': ( |
||||||
|
'size': 12px, |
||||||
|
'weight': 400, |
||||||
|
'line-height': 20px, |
||||||
|
// 'letter-spacing': 0.03333em, |
||||||
|
// 'text-transform': false |
||||||
|
) |
||||||
|
), |
||||||
|
$uni-headings |
||||||
|
); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 主色 |
||||||
|
$uni-primary: #2979ff !default; |
||||||
|
$uni-primary-disable:lighten($uni-primary,20%) !default; |
||||||
|
$uni-primary-light: lighten($uni-primary,25%) !default; |
||||||
|
|
||||||
|
// 辅助色 |
||||||
|
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。 |
||||||
|
$uni-success: #18bc37 !default; |
||||||
|
$uni-success-disable:lighten($uni-success,20%) !default; |
||||||
|
$uni-success-light: lighten($uni-success,25%) !default; |
||||||
|
|
||||||
|
$uni-warning: #f3a73f !default; |
||||||
|
$uni-warning-disable:lighten($uni-warning,20%) !default; |
||||||
|
$uni-warning-light: lighten($uni-warning,25%) !default; |
||||||
|
|
||||||
|
$uni-error: #e43d33 !default; |
||||||
|
$uni-error-disable:lighten($uni-error,20%) !default; |
||||||
|
$uni-error-light: lighten($uni-error,25%) !default; |
||||||
|
|
||||||
|
$uni-info: #8f939c !default; |
||||||
|
$uni-info-disable:lighten($uni-info,20%) !default; |
||||||
|
$uni-info-light: lighten($uni-info,25%) !default; |
||||||
|
|
||||||
|
// 中性色 |
||||||
|
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。 |
||||||
|
$uni-main-color: #3a3a3a !default; // 主要文字 |
||||||
|
$uni-base-color: #6a6a6a !default; // 常规文字 |
||||||
|
$uni-secondary-color: #909399 !default; // 次要文字 |
||||||
|
$uni-extra-color: #c7c7c7 !default; // 辅助说明 |
||||||
|
|
||||||
|
// 边框颜色 |
||||||
|
$uni-border-1: #F0F0F0 !default; |
||||||
|
$uni-border-2: #EDEDED !default; |
||||||
|
$uni-border-3: #DCDCDC !default; |
||||||
|
$uni-border-4: #B9B9B9 !default; |
||||||
|
|
||||||
|
// 常规色 |
||||||
|
$uni-black: #000000 !default; |
||||||
|
$uni-white: #ffffff !default; |
||||||
|
$uni-transparent: rgba($color: #000000, $alpha: 0) !default; |
||||||
|
|
||||||
|
// 背景色 |
||||||
|
$uni-bg-color: #f7f7f7 !default; |
||||||
|
|
||||||
|
/* 水平间距 */ |
||||||
|
$uni-spacing-sm: 8px !default; |
||||||
|
$uni-spacing-base: 15px !default; |
||||||
|
$uni-spacing-lg: 30px !default; |
||||||
|
|
||||||
|
// 阴影 |
||||||
|
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default; |
||||||
|
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default; |
||||||
|
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default; |
||||||
|
|
||||||
|
// 蒙版 |
||||||
|
$uni-mask: rgba($color: #000000, $alpha: 0.4) !default; |
@ -0,0 +1,19 @@ |
|||||||
|
// 合并 map |
||||||
|
@function map-deep-merge($parent-map, $child-map){ |
||||||
|
$result: $parent-map; |
||||||
|
@each $key, $child in $child-map { |
||||||
|
$parent-has-key: map-has-key($result, $key); |
||||||
|
$parent-value: map-get($result, $key); |
||||||
|
$parent-type: type-of($parent-value); |
||||||
|
$child-type: type-of($child); |
||||||
|
$parent-is-map: $parent-type == map; |
||||||
|
$child-is-map: $child-type == map; |
||||||
|
|
||||||
|
@if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){ |
||||||
|
$result: map-merge($result, ( $key: $child )); |
||||||
|
}@else { |
||||||
|
$result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) )); |
||||||
|
} |
||||||
|
} |
||||||
|
@return $result; |
||||||
|
}; |
@ -0,0 +1,31 @@ |
|||||||
|
// 间距基础倍数 |
||||||
|
$uni-space-root: 2; |
||||||
|
// 边框半径默认值 |
||||||
|
$uni-radius-root:5px; |
||||||
|
// 主色 |
||||||
|
$uni-primary: #2979ff; |
||||||
|
// 辅助色 |
||||||
|
$uni-success: #4cd964; |
||||||
|
// 警告色 |
||||||
|
$uni-warning: #f0ad4e; |
||||||
|
// 错误色 |
||||||
|
$uni-error: #dd524d; |
||||||
|
// 描述色 |
||||||
|
$uni-info: #909399; |
||||||
|
// 中性色 |
||||||
|
$uni-main-color: #303133; |
||||||
|
$uni-base-color: #606266; |
||||||
|
$uni-secondary-color: #909399; |
||||||
|
$uni-extra-color: #C0C4CC; |
||||||
|
// 背景色 |
||||||
|
$uni-bg-color: #f5f5f5; |
||||||
|
// 边框颜色 |
||||||
|
$uni-border-1: #DCDFE6; |
||||||
|
$uni-border-2: #E4E7ED; |
||||||
|
$uni-border-3: #EBEEF5; |
||||||
|
$uni-border-4: #F2F6FC; |
||||||
|
|
||||||
|
// 常规色 |
||||||
|
$uni-black: #000000; |
||||||
|
$uni-white: #ffffff; |
||||||
|
$uni-transparent: rgba($color: #000000, $alpha: 0); |
@ -0,0 +1,62 @@ |
|||||||
|
@import './styles/setting/_variables.scss'; |
||||||
|
// 间距基础倍数 |
||||||
|
$uni-space-root: 2; |
||||||
|
// 边框半径默认值 |
||||||
|
$uni-radius-root:5px; |
||||||
|
|
||||||
|
// 主色 |
||||||
|
$uni-primary: #2979ff; |
||||||
|
$uni-primary-disable:mix(#fff,$uni-primary,50%); |
||||||
|
$uni-primary-light: mix(#fff,$uni-primary,80%); |
||||||
|
|
||||||
|
// 辅助色 |
||||||
|
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。 |
||||||
|
$uni-success: #18bc37; |
||||||
|
$uni-success-disable:mix(#fff,$uni-success,50%); |
||||||
|
$uni-success-light: mix(#fff,$uni-success,80%); |
||||||
|
|
||||||
|
$uni-warning: #f3a73f; |
||||||
|
$uni-warning-disable:mix(#fff,$uni-warning,50%); |
||||||
|
$uni-warning-light: mix(#fff,$uni-warning,80%); |
||||||
|
|
||||||
|
$uni-error: #e43d33; |
||||||
|
$uni-error-disable:mix(#fff,$uni-error,50%); |
||||||
|
$uni-error-light: mix(#fff,$uni-error,80%); |
||||||
|
|
||||||
|
$uni-info: #8f939c; |
||||||
|
$uni-info-disable:mix(#fff,$uni-info,50%); |
||||||
|
$uni-info-light: mix(#fff,$uni-info,80%); |
||||||
|
|
||||||
|
// 中性色 |
||||||
|
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。 |
||||||
|
$uni-main-color: #3a3a3a; // 主要文字 |
||||||
|
$uni-base-color: #6a6a6a; // 常规文字 |
||||||
|
$uni-secondary-color: #909399; // 次要文字 |
||||||
|
$uni-extra-color: #c7c7c7; // 辅助说明 |
||||||
|
|
||||||
|
// 边框颜色 |
||||||
|
$uni-border-1: #F0F0F0; |
||||||
|
$uni-border-2: #EDEDED; |
||||||
|
$uni-border-3: #DCDCDC; |
||||||
|
$uni-border-4: #B9B9B9; |
||||||
|
|
||||||
|
// 常规色 |
||||||
|
$uni-black: #000000; |
||||||
|
$uni-white: #ffffff; |
||||||
|
$uni-transparent: rgba($color: #000000, $alpha: 0); |
||||||
|
|
||||||
|
// 背景色 |
||||||
|
$uni-bg-color: #f7f7f7; |
||||||
|
|
||||||
|
/* 水平间距 */ |
||||||
|
$uni-spacing-sm: 8px; |
||||||
|
$uni-spacing-base: 15px; |
||||||
|
$uni-spacing-lg: 30px; |
||||||
|
|
||||||
|
// 阴影 |
||||||
|
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5); |
||||||
|
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2); |
||||||
|
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5); |
||||||
|
|
||||||
|
// 蒙版 |
||||||
|
$uni-mask: rgba($color: #000000, $alpha: 0.4); |
@ -0,0 +1,21 @@ |
|||||||
|
MIT License |
||||||
|
|
||||||
|
Copyright (c) 2020 www.uviewui.com |
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||||
|
of this software and associated documentation files (the "Software"), to deal |
||||||
|
in the Software without restriction, including without limitation the rights |
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||||
|
copies of the Software, and to permit persons to whom the Software is |
||||||
|
furnished to do so, subject to the following conditions: |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all |
||||||
|
copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||||
|
SOFTWARE. |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue