1.31 财务分析,财务数据模块完善,产业链桑基图展示

This commit is contained in:
尚政杰
2026-01-31 17:19:16 +08:00
parent 1c13386dfc
commit 0a2dab4936
527 changed files with 3390 additions and 604 deletions

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js"),t=require("./utils.js"),s={};class i{constructor(){this.__events={}}on(e,t){if(!e||!t)return;const s=this.__events[e]||[];s.push(t),this.__events[e]=s}emit(e,t){if(e.constructor===Object&&(e=(t=e)&&t.type),!e)return;const s=this.__events[e];s&&s.length&&s.forEach((e=>{e.call(this,t)}))}off(e,t){const s=this.__events,i=s[e];if(i&&i.length)if(t)for(let a=0,r=i.length;a<r;a++)i[a]===t&&(i.splice(a,1),a--);else delete s[e]}}class a{constructor(){this.currentSrc=null,this.naturalHeight=0,this.naturalWidth=0,this.width=0,this.height=0,this.tagName="IMG"}set src(t){this.currentSrc=t,e.index.getImageInfo({src:t,success:e=>{this.naturalWidth=this.width=e.width,this.naturalHeight=this.height=e.height,this.onload()},fail:()=>{this.onerror()}})}get src(){return this.currentSrc}}class r{constructor(e,t,s){this.tagName="canvas",this.com=t,this.canvasId=s,this.ctx=e}set width(e){this.com.offscreenWidth=e}set height(e){this.com.offscreenHeight=e}get width(){return this.com.offscreenWidth||0}get height(){return this.com.offscreenHeight||0}getContext(e){return this.ctx}getImageData(){return new Promise(((t,s)=>{this.com.$nextTick((()=>{e.index.canvasGetImageData({x:0,y:0,width:this.com.offscreenWidth,height:this.com.offscreenHeight,canvasId:this.canvasId,success:e=>{t(e)},fail:e=>{s(e)}},this.com)}))}))}}exports.Canvas=class{constructor(e,t,a,r={}){s[t.canvasId]={ctx:e},this.canvasId=t.canvasId,this.chart=null,this.isNew=a,this.tagName="canvas",this.canvasNode=r,this.com=t,a||this._initStyle(e),this._initEvent(),this._ee=new i}getContext(e){if("2d"===e)return this.ctx}setAttribute(e,t){"aria-label"===e&&(this.com.ariaLabel=t)}setChart(e){this.chart=e}createOffscreenCanvas(t){if(!this.children){this.com.isOffscreenCanvas=!0,this.com.offscreenWidth=t.width||300,this.com.offscreenHeight=t.height||300;const s=this.com,i=this.com.offscreenCanvasId,a=e.index.createCanvasContext(i,this.com);this._initStyle(a),this.children=new r(a,s,i)}return this.children}appendChild(e){console.log("child",e)}dispatchEvent(e,t){return"object"==typeof e?this._ee.emit(e.type,e):this._ee.emit(e,t),!0}attachEvent(){}detachEvent(){}addEventListener(e,t){this._ee.on(e,t)}removeEventListener(e,t){this._ee.off(e,t)}_initCanvas(e,t){}_initStyle(e,s){if(["fillStyle","strokeStyle","fontSize","globalAlpha","opacity","textAlign","textBaseline","shadow","lineWidth","lineCap","lineJoin","lineDash","miterLimit"].forEach((t=>{Object.defineProperty(e,t,{set:s=>{"opacity"!==t?("fillStyle"!==t&&"strokeStyle"!==t||"none"!==s&&null!==s)&&e["set"+t.charAt(0).toUpperCase()+t.slice(1)](s):e.setGlobalAlpha(s)}})})),this.isNew||s||(e.uniDrawImage=e.drawImage,e.drawImage=(...t)=>{t[0]=t[0].src,e.uniDrawImage(...t)}),e.createRadialGradient||(e.createRadialGradient=function(){return e.createCircularGradient(...[...arguments].slice(-3))}),e.strokeText||(e.strokeText=(...t)=>{e.fillText(...t)}),!e.measureText||"harmonyos"==t.getDeviceInfo().osName){e._measureText=e.measureText;const t=e=>{let t=0;for(let s=0;s<e.length;s++)e.charCodeAt(s)>0&&e.charCodeAt(s)<128?t++:t+=2;return t};e.measureText=(s,i)=>{var a;let r=(null==(a=null==e?void 0:e.state)?void 0:a.fontSize)||12;i&&(r=parseInt(i.match(/([\d\.]+)px/)[1])),r/=2;const n=r>=16?1.3:1;return{width:t(s)*r*n}}}}_initEvent(e){this.event={};[{wxName:"touchStart",ecName:"mousedown"},{wxName:"touchMove",ecName:"mousemove"},{wxName:"touchEnd",ecName:"mouseup"},{wxName:"touchEnd",ecName:"click"}].forEach((e=>{this.event[e.wxName]=t=>{const s=t.touches[0];this.chart.getZr().handler.dispatch(e.ecName,{zrX:"tap"===e.wxName?s.clientX:s.x,zrY:"tap"===e.wxName?s.clientY:s.y})}}))}set width(e){this.canvasNode.width=e}set height(e){this.canvasNode.height=e}get width(){return this.canvasNode.width||0}get height(){return this.canvasNode.height||0}get ctx(){return s[this.canvasId].ctx||null}set chart(e){s[this.canvasId].chart=e}get chart(){return s[this.canvasId].chart||null}},exports.dispatch=function(e,{x:t,y:s,wheelDelta:i}){this.dispatch(e,{zrX:t,zrY:s,zrDelta:i,preventDefault:()=>{},stopPropagation:()=>{}})},exports.setCanvasCreator=function(t,{canvas:s,node:i}){if(t&&!t.registerPreprocessor)return console.warn("echarts 版本不对或未传入echartsvue3请使用esm格式");t.registerPreprocessor((e=>{e&&e.series&&(e.series.length>0?e.series.forEach((e=>{e.progressive=0})):"object"==typeof e.series&&(e.series.progressive=0))})),t.setPlatformAPI?t.setPlatformAPI({loadImage:s.setChart?function(e,t,s){let r=null;return i&&i.createImage?(r=i.createImage(),r.onload=t.bind(r),r.onerror=s.bind(r),r.src=e,r):(r=new a,r.onload=t.bind(r),r.onerror=s.bind(r),r.src=e,r)}:null,createCanvas(){const t="createOffscreenCanvas";return e.index.canIUse(t)&&e.index[t]?e.index[t]({type:"2d"}):s}}):t.setCanvasCreator&&t.setCanvasCreator((()=>s))};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view wx:if="{{a}}" class="lime-echart" style="{{C}}" ref="limeEchart" aria-label="{{D}}"><canvas wx:if="{{b}}" class="lime-echart__canvas" type="2d" id="{{c}}" style="{{d}}" disable-scroll="{{e}}" bindtouchstart="{{f}}" bindtouchmove="{{g}}" bindtouchend="{{h}}"/><block wx:else><canvas wx:if="{{r0}}" class="lime-echart__canvas" width="{{i}}" height="{{j}}" style="{{k}}" canvas-id="{{l}}" id="{{m}}" disable-scroll="{{n}}" bindtouchstart="{{o}}" bindtouchmove="{{p}}" bindtouchend="{{q}}"/></block><view wx:if="{{r}}" class="lime-echart__mask" bindmousedown="{{s}}" bindmousemove="{{t}}" bindmouseup="{{v}}" bindtouchstart="{{w}}" bindtouchmove="{{x}}" bindtouchend="{{y}}"></view><canvas wx:if="{{z}}" style="{{A}}" canvas-id="{{B}}"></canvas></view>

View File

@@ -0,0 +1 @@
.lime-echart{position:relative;width:100%;height:100%}.lime-echart__canvas{width:100%;height:100%}.lime-echart__mask{position:absolute;width:100%;height:100%;left:0;top:0;z-index:1}

View File

@@ -0,0 +1 @@
"use strict";const e=require("../../../../common/vendor.js");function n(){return e.index.getDeviceInfo||e.index.canIUse("getDeviceInfo")?e.index.getDeviceInfo():e.index.getSystemInfoSync()}function t(t){const{platform:o}=n();let{SDKVersion:r}=e.index.getAppBaseInfo||e.index.canIUse("getAppBaseInfo")?e.index.getAppBaseInfo():e.index.getSystemInfoSync();return"mac"!==o&&function(e,n){e=e.split("."),n=n.split(".");const t=Math.max(e.length,n.length);for(;e.length<t;)e.push("0");for(;n.length<t;)n.push("0");for(let o=0;o<t;o++){const t=parseInt(e[o],10),r=parseInt(n[o],10);if(t>r)return 1;if(t<r)return-1}return 0}(r,t)>=0}function o(e){return Array.isArray(e)?e:"object"==typeof e&&null!==e?Object.values(e):e}const r=(e.index.getWindowInfo||e.index.canIUse("getWindowInfo")?e.index.getWindowInfo():e.index.getSystemInfoSync()).pixelRatio;exports.canIUseCanvas2d=function(){return t("2.9.0")},exports.convertTouchesToArray=o,exports.devicePixelRatio=r,exports.getDeviceInfo=n,exports.getRect=function(n,t,o){return new Promise(((r,s)=>{const i=e.index.createSelectorQuery().in(t).select(n),c=e=>{e?r(e):s()};o?i.fields({node:!0,size:!0,rect:!0},c).exec():i.boundingClientRect(c).exec()}))},exports.sleep=function(e){return new Promise((n=>{setTimeout((()=>{n(!0)}),e)}))},exports.wrapTouch=function(e){e.touches=o(e.touches);for(let n=0;n<e.touches.length;++n){const t=e.touches[n];t.offsetX=t.x,t.offsetY=t.y}return e};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,129 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style type="text/css">
html,
body,
.canvas {
padding: 0;
margin: 0;
overflow-y: hidden;
background-color: transparent;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="canvas" id="limeChart"></div>
<script type="text/javascript" src="./uni.webview.1.5.3.js"></script>
<script type="text/javascript" src="./echarts.min.js"></script>
<script type="text/javascript" src="./ecStat.min.js"></script>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-liquidfill@latest/dist/echarts-liquidfill.min.js"></script> -->
<script>
let chart = null;
let cache = [];
console.log = function(...agrs) {
postMessage(agrs)
}
function emit(event, data) {
let dataStr = JSON.stringify(data, stringify)
postMessage({
event,
data: dataStr
})
cache = []
}
function postMessage(data) {
uni.postMessage({
data
});
}
function stringify(key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
return;
}
cache.push(value);
}
return value;
}
function parse(name, callback, options) {
const optionNameReg = /[\w]+\.setOption\(([\w]+\.)?([\w]+)\)/
if (optionNameReg.test(callback)) {
const optionNames = callback.match(optionNameReg)
if(optionNames[1]) {
const _this = optionNames[1].split('.')[0]
window[_this] = {}
window[_this][optionNames[2]] = options
return optionNames[2]
} else {
return null
}
}
return null
}
function init(callback, options, opts = {}, theme = null) {
if(!chart) {
chart = echarts.init(document.getElementById('limeChart'), theme, opts)
if(options) {
chart.setOption(options)
}
// const name = parse('a', callback, options)
// console.log('options::', callback)
// if(name) this[name] = options
// eval(`a = ${callback};`)
// if(a) {a(chart)}
}
}
function setChart(callback, options) {
if(!callback) return
if(chart && callback && options) {
var r = null
const name = parse('r', callback, options)
if(name) this[name] = options
eval(`r = ${callback};`)
if(r) {r(chart)}
}
}
function setOption(data) {
if (chart) chart.setOption(data[0], data[1])
}
function showLoading(data) {
if (chart) chart.showLoading(data[0], data[1])
}
function hideLoading() {
if (chart) chart.hideLoading()
}
function clear() {
if (chart) chart.clear()
}
function dispose() {
if (chart) chart.dispose()
}
function resize(size) {
if (chart) chart.resize(size)
}
function canvasToTempFilePath(opt = {}) {
if (chart) {
const src = chart.getDataURL(opt)
postMessage({
file: true,
data: src
})
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,177 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style type="text/css">
html,
body,
.canvas {
padding: 0;
margin: 0;
overflow-y: hidden;
background-color: transparent;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="canvas" id="limeChart"></div>
<script type="text/javascript" src="./uni.webview.1.5.3.js"></script>
<script type="text/javascript" src="./echarts.min.js"></script>
<script type="text/javascript" src="./ecStat.min.js"></script>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-liquidfill@latest/dist/echarts-liquidfill.min.js"></script> -->
<script>
let chart = null;
let cache = [];
console.log = function(...agrs) {
postMessage(agrs)
}
function emit(event, data) {
let dataStr = JSON.stringify(data, stringify)
postMessage({
event,
data: dataStr
})
cache = []
}
function postMessage(data) {
uni.postMessage({
data
});
}
function stringify(key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
return;
}
cache.push(value);
}
return value;
}
function parse(name, callback, options) {
const optionNameReg = /[\w]+\.setOption\(([\w]+\.)?([\w]+)\)/
if (optionNameReg.test(callback)) {
const optionNames = callback.match(optionNameReg)
if (optionNames[1]) {
const _this = optionNames[1].split('.')[0]
window[_this] = {}
window[_this][optionNames[2]] = options
return optionNames[2]
} else {
return null
}
}
return null
}
function init(callback, options, opts = {}, theme = null) {
if (!chart) {
chart = echarts.init(document.getElementById('limeChart'), theme, opts)
if (options) {
chart.setOption(options)
}
// const name = parse('a', callback, options)
// console.log('options::', callback)
// if(name) this[name] = options
// eval(`a = ${callback};`)
// if(a) {a(chart)}
}
}
function setChart(callback, options) {
if (!callback) return
if (chart && callback && options) {
var r = null
const name = parse('r', callback, options)
if (name) this[name] = options
eval(`r = ${callback};`)
if (r) {
r(chart)
}
}
}
function setOption(data) {
if (chart) chart.setOption(data[0], data[1])
}
function showLoading(data) {
if (chart) chart.showLoading(data[0], data[1])
}
function hideLoading() {
if (chart) chart.hideLoading()
}
function clear() {
if (chart) chart.clear()
}
function dispose() {
if (chart) chart.dispose()
}
function resize(size) {
if (chart) chart.resize(size)
}
function canvasToTempFilePath(opt = {}) {
if (chart) {
const src = chart.getDataURL(opt)
postMessage({
file: true,
data: src
})
}
}
function on(data) {
if (chart && data.length > 0) {
const [type, query] = data
const useQuery = query && typeof query != 'function'
const key = `${type}${useQuery ? JSON.stringify(query): '' }`
if (query) {
chart.on(type, query, (options) => {
const obj = {}
Object.keys(options).forEach(key => {
if (key != 'event') {
obj[key] = options[key]
}
})
emit(`@${key}`, {
event: key,
options: obj
})
})
} else {
chart.on(type, (options) => {
const obj = {}
Object.keys(options).forEach(key => {
if (key != 'event') {
obj[key] = options[key]
}
})
emit(`@${key}`, {
event: key,
options: obj
})
})
}
}
}
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,184 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style type="text/css">
html,
body {
overflow: hidden;
/* 隐藏滚动条 */
overscroll-behavior: none;
/* 禁止橡皮筋效果 */
}
html,
body,
.canvas {
padding: 0;
margin: 0;
overflow-y: hidden;
background-color: transparent;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="canvas" id="limeChart"></div>
<script type="text/javascript" src="./uni.webview.1.5.5.js"></script>
<script type="text/javascript" src="./echarts.min.js"></script>
<script type="text/javascript" src="./ecStat.min.js"></script>
<!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts-liquidfill@latest/dist/echarts-liquidfill.min.js"></script> -->
<script>
let chart = null;
let cache = [];
console.log = function() {
emit('log', {
log: arguments,
})
}
function emit(event, data) {
postMessage({
event,
data
})
cache = []
}
function postMessage(data) {
uni.webView.postMessage({
data
})
// window.__uniapp_x_.postMessage(JSON.stringify(data))
};
function stringify(key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.indexOf(value) !== -1) {
return;
}
cache.push(value);
}
return value;
}
function parse(name, callback, options) {
const optionNameReg = /[\w]+\.setOption\(([\w]+\.)?([\w]+)\)/
if (optionNameReg.test(callback)) {
const optionNames = callback.match(optionNameReg)
if (optionNames[1]) {
const _this = optionNames[1].split('.')[0]
window[_this] = {}
window[_this][optionNames[2]] = options
return optionNames[2]
} else {
return null
}
}
return null
}
function init(callback, options, opts, theme) {
if (!chart) {
chart = echarts.init(document.getElementById('limeChart'), theme, opts)
if (options) {
chart.setOption(options)
}
}
}
function on(data) {
if (chart && data.length > 0) {
const [type, query] = data
const key = `${type}${JSON.stringify(query||'')}`
if (query) {
chart.on(type, query, function(options) {
var obj = {};
Object.keys(options).forEach(function(key) {
if (key != 'event') {
obj[key] = options[key];
}
});
emit(key, {
event: key,
options: obj,
});
});
} else {
chart.on(type, function(options) {
var obj = {};
Object.keys(options).forEach(function(key) {
if (key != 'event') {
obj[key] = options[key];
}
});
emit(key, {
event: key,
options: obj,
});
});
}
}
}
function setChart(callback, options) {
if (!callback) return
if (chart && callback && options) {
var r = null
const name = parse('r', callback, options)
if (name) this[name] = options
eval(`r = ${callback};`)
if (r) {
r(chart)
}
}
}
function setOption(data) {
if (chart) chart.setOption(data[0], data[1])
}
function showLoading(data) {
if (chart) chart.showLoading(data[0], data[1])
}
function hideLoading() {
if (chart) chart.hideLoading()
}
function clear() {
if (chart) chart.clear()
}
function dispose() {
if (chart) chart.dispose()
}
function resize(size) {
if (chart) chart.resize(size)
}
function canvasToTempFilePath(opt) {
if (chart) {
delete opt.success
const src = chart.getDataURL(opt)
postMessage({
// event: 'file',
file: src
})
}
}
document.addEventListener('touchmove', () => {
})
</script>
</body>
</html>

View File

@@ -0,0 +1 @@
"use strict";const t=require("../../../../common/vendor.js"),s={name:"uniPopup",components:{},emits:["change","maskClick"],props:{animation:{type:Boolean,default:!0},type:{type:String,default:"center"},isMaskClick:{type:Boolean,default:null},maskClick:{type:Boolean,default:null},backgroundColor:{type:String,default:"none"},safeArea:{type:Boolean,default:!0},maskBackgroundColor:{type:String,default:"rgba(0, 0, 0, 0.4)"},borderRadius:{type:String}},watch:{type:{handler:function(t){this.config[t]&&this[this.config[t]](!0)},immediate:!0},isDesktop:{handler:function(t){this.config[t]&&this[this.config[this.type]](!0)},immediate:!0},maskClick:{handler:function(t){this.mkclick=t},immediate:!0},isMaskClick:{handler:function(t){this.mkclick=t},immediate:!0},showPopup(t){}},data(){return{duration:300,ani:[],showPopup:!1,showTrans:!1,popupWidth:0,popupHeight:0,config:{top:"top",bottom:"bottom",center:"center",left:"left",right:"right",message:"top",dialog:"center",share:"bottom"},maskClass:{position:"fixed",bottom:0,top:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.4)"},transClass:{backgroundColor:"transparent",borderRadius:this.borderRadius||"0",position:"fixed",left:0,right:0},maskShow:!0,mkclick:!0,popupstyle:"top"}},computed:{getStyles(){let t={backgroundColor:this.bg};return this.borderRadius,t=Object.assign(t,{borderRadius:this.borderRadius}),t},isDesktop(){return this.popupWidth>=500&&this.popupHeight>=500},bg(){return""===this.backgroundColor||"none"===this.backgroundColor?"transparent":this.backgroundColor}},mounted(){(()=>{const{windowWidth:s,windowHeight:i,windowTop:o,safeArea:e,screenHeight:a,safeAreaInsets:r}=t.index.getWindowInfo();this.popupWidth=s,this.popupHeight=i+(o||0),e&&this.safeArea?this.safeAreaInsets=a-e.bottom:this.safeAreaInsets=0})()},unmounted(){this.setH5Visible()},activated(){this.setH5Visible(!this.showPopup)},deactivated(){this.setH5Visible(!0)},created(){null===this.isMaskClick&&null===this.maskClick?this.mkclick=!0:this.mkclick=null!==this.isMaskClick?this.isMaskClick:this.maskClick,this.animation?this.duration=300:this.duration=0,this.messageChild=null,this.clearPropagation=!1,this.maskClass.backgroundColor=this.maskBackgroundColor},methods:{setH5Visible(t=!0){},closeMask(){this.maskShow=!1},disableMask(){this.mkclick=!1},clear(t){t.stopPropagation(),this.clearPropagation=!0},open(t){if(this.showPopup)return;t&&-1!==["top","center","bottom","left","right","message","dialog","share"].indexOf(t)||(t=this.type),this.config[t]?(this[this.config[t]](),this.$emit("change",{show:!0,type:t})):console.error("缺少类型:",t)},close(t){this.showTrans=!1,this.$emit("change",{show:!1,type:this.type}),clearTimeout(this.timer),this.timer=setTimeout((()=>{this.showPopup=!1}),300)},touchstart(){this.clearPropagation=!1},onTap(){this.clearPropagation?this.clearPropagation=!1:(this.$emit("maskClick"),this.mkclick&&this.close())},top(t){this.popupstyle=this.isDesktop?"fixforpc-top":"top",this.ani=["slide-top"],this.transClass={position:"fixed",left:0,right:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0"},t||(this.showPopup=!0,this.showTrans=!0,this.$nextTick((()=>{this.showPoptrans(),this.messageChild&&"message"===this.type&&this.messageChild.timerClose()})))},bottom(t){this.popupstyle="bottom",this.ani=["slide-bottom"],this.transClass={position:"fixed",left:0,right:0,bottom:0,paddingBottom:this.safeAreaInsets+"px",backgroundColor:this.bg,borderRadius:this.borderRadius||"0"},t||this.showPoptrans()},center(t){this.popupstyle="center",this.ani=["fade"],this.transClass={position:"fixed",display:"flex",flexDirection:"column",bottom:0,left:0,right:0,top:0,justifyContent:"center",alignItems:"center",borderRadius:this.borderRadius||"0"},t||this.showPoptrans()},left(t){this.popupstyle="left",this.ani=["slide-left"],this.transClass={position:"fixed",left:0,bottom:0,top:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0",display:"flex",flexDirection:"column"},t||this.showPoptrans()},right(t){this.popupstyle="right",this.ani=["slide-right"],this.transClass={position:"fixed",bottom:0,right:0,top:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0",display:"flex",flexDirection:"column"},t||this.showPoptrans()},showPoptrans(){this.$nextTick((()=>{this.showPopup=!0,this.showTrans=!0}))}}};if(!Array){t.resolveComponent("uni-transition")()}Math;const i=t._export_sfc(s,[["render",function(s,i,o,e,a,r){return t.e({a:a.showPopup},a.showPopup?t.e({b:a.maskShow},a.maskShow?{c:t.o(r.onTap),d:t.p({name:"mask","mode-class":"fade",styles:a.maskClass,duration:a.duration,show:a.showTrans})}:{},{e:t.s(r.getStyles),f:t.n(a.popupstyle),g:t.o(((...t)=>r.clear&&r.clear(...t))),h:t.o(r.onTap),i:t.p({"mode-class":a.ani,name:"content",styles:a.transClass,duration:a.duration,show:a.showTrans}),j:t.o(((...t)=>r.touchstart&&r.touchstart(...t))),k:t.n(a.popupstyle),l:t.n(r.isDesktop?"fixforpc-z-index":"")}):{})}]]);wx.createComponent(i);

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uni-transition": "../../../uni-transition/components/uni-transition/uni-transition"
}
}

View File

@@ -0,0 +1 @@
<view wx:if="{{a}}" class="{{['uni-popup', k, l]}}"><view bindtouchstart="{{j}}"><uni-transition wx:if="{{b}}" key="1" bindclick="{{c}}" u-i="10ea031a-0" bind:__l="__l" u-p="{{d}}"/><uni-transition wx:if="{{i}}" u-s="{{['d']}}" key="2" bindclick="{{h}}" u-i="10ea031a-1" bind:__l="__l" u-p="{{i}}"><view style="{{e}}" class="{{['uni-popup__wrapper', f]}}" bindtap="{{g}}"><slot/></view></uni-transition></view></view>

View File

@@ -0,0 +1 @@
.uni-popup{position:fixed;z-index:99999}.uni-popup.top,.uni-popup.left,.uni-popup.right{top:0}.uni-popup .uni-popup__wrapper{display:block;position:relative}.uni-popup .uni-popup__wrapper.left,.uni-popup .uni-popup__wrapper.right{padding-top:0;flex:1}.fixforpc-z-index{z-index:999}.fixforpc-top{top:0}

View File

@@ -0,0 +1 @@
"use strict";const t=require("../../../../common/vendor.js");class e{constructor(e,i){this.options=e,this.animation=t.index.createAnimation({...e}),this.currentStepAnimates={},this.next=0,this.$=i}_nvuePushAnimates(t,e){let n=this.currentStepAnimates[this.next],s={};if(s=n||{styles:{},config:{}},i.includes(t)){s.styles.transform||(s.styles.transform="");let i="";"rotate"===t&&(i="deg"),s.styles.transform+=`${t}(${e+i}) `}else s.styles[t]=`${e}`;this.currentStepAnimates[this.next]=s}_animateRun(t={},e={}){let i=this.$.$refs.ani.ref;if(i)return new Promise(((n,s)=>{nvueAnimation.transition(i,{styles:t,...e},(t=>{n()}))}))}_nvueNextAnimate(t,e=0,i){let n=t[e];if(n){let{styles:s,config:a}=n;this._animateRun(s,a).then((()=>{e+=1,this._nvueNextAnimate(t,e,i)}))}else this.currentStepAnimates={},"function"==typeof i&&i(),this.isEnd=!0}step(t={}){return this.animation.step(t),this}run(t){this.$.animationData=this.animation.export(),this.$.timer=setTimeout((()=>{"function"==typeof t&&t()}),this.$.durationTime)}}const i=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];i.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((t=>{e.prototype[t]=function(...e){return this.animation[t](...e),this}})),exports.createAnimation=function(t,i){if(i)return clearTimeout(i.timer),new e(t,i)};

View File

@@ -0,0 +1 @@
"use strict";const t=require("./createAnimation.js"),i=require("../../../../common/vendor.js"),s={name:"uniTransition",emits:["click","change"],props:{show:{type:Boolean,default:!1},modeClass:{type:[Array,String],default:()=>"fade"},duration:{type:Number,default:300},styles:{type:Object,default:()=>({})},customClass:{type:String,default:""},onceRender:{type:Boolean,default:!1}},data:()=>({isShow:!1,transform:"",opacity:0,animationData:{},durationTime:300,config:{}}),watch:{show:{handler(t){t?this.open():this.isShow&&this.close()},immediate:!0}},computed:{stylesObject(){let t={...this.styles,"transition-duration":this.duration/1e3+"s"},i="";for(let s in t){i+=this.toLine(s)+":"+t[s]+";"}return i},transformStyles(){return"transform:"+this.transform+";opacity:"+this.opacity+";"+this.stylesObject}},created(){this.config={duration:this.duration,timingFunction:"ease",transformOrigin:"50% 50%",delay:0},this.durationTime=this.duration},methods:{init(i={}){i.duration&&(this.durationTime=i.duration),this.animation=t.createAnimation(Object.assign(this.config,i),this)},onClick(){this.$emit("click",{detail:this.isShow})},step(t,i={}){return this.animation?(Object.keys(t).forEach((i=>{const s=t[i];"function"==typeof this.animation[i]&&(Array.isArray(s)?this.animation[i](...s):this.animation[i](s))})),this.animation.step(i),this):this},run(t){this.animation&&this.animation.run(t)},open(){clearTimeout(this.timer),this.isShow=!0,this.transform=this.styleInit(!1).transform||"",this.opacity=this.styleInit(!1).opacity||0,this.$nextTick((()=>{this.timer=setTimeout((()=>{this.animation=t.createAnimation(this.config,this),this.tranfromInit(!1).step(),this.animation.run((()=>{this.transform="",this.opacity=this.styleInit(!1).opacity||1,this.$emit("change",{detail:this.isShow})}))}),80)}))},close(t){this.animation&&this.tranfromInit(!0).step().run((()=>{this.isShow=!1,this.animationData=null,this.animation=null;let{opacity:t,transform:i}=this.styleInit(!1);this.opacity=t||1,this.transform=i,this.$emit("change",{detail:this.isShow})}))},styleInit(t){let i={transform:"",opacity:1};const s=(t,s)=>{const a=this.animationType(t)[s];s.startsWith("fade")?i.opacity=a:i.transform+=a+" "};return"string"==typeof this.modeClass?s(t,this.modeClass):this.modeClass.forEach((i=>s(t,i))),i},tranfromInit(t){let i=(t,i)=>{let s=null;"fade"===i?s=t?0:1:(s=t?"-100%":"0","zoom-in"===i&&(s=t?.8:1),"zoom-out"===i&&(s=t?1.2:1),"slide-right"===i&&(s=t?"100%":"0"),"slide-bottom"===i&&(s=t?"100%":"0")),this.animation[this.animationMode()[i]](s)};return"string"==typeof this.modeClass?i(t,this.modeClass):this.modeClass.forEach((s=>{i(t,s)})),this.animation},animationType:t=>({fade:t?1:0,"slide-top":`translateY(${t?"0":"-100%"})`,"slide-right":`translateX(${t?"0":"100%"})`,"slide-bottom":`translateY(${t?"0":"100%"})`,"slide-left":`translateX(${t?"0":"-100%"})`,"zoom-in":`scaleX(${t?1:.8}) scaleY(${t?1:.8})`,"zoom-out":`scaleX(${t?1:1.2}) scaleY(${t?1:1.2})`}),animationMode:()=>({fade:"opacity","slide-top":"translateY","slide-right":"translateX","slide-bottom":"translateY","slide-left":"translateX","zoom-in":"scale","zoom-out":"scale"}),toLine:t=>t.replace(/([A-Z])/g,"-$1").toLowerCase()}};const a=i._export_sfc(s,[["render",function(t,s,a,n,e,o){return{a:e.isShow,b:e.animationData,c:i.n(a.customClass),d:i.s(o.transformStyles),e:i.o(((...t)=>o.onClick&&o.onClick(...t)))}}]]);wx.createComponent(a);

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view hidden="{{!a}}" ref="ani" animation="{{b}}" class="{{c}}" style="{{d}}" bindtap="{{e}}"><slot></slot></view>

View File

@@ -0,0 +1 @@
"use strict";const t=require("../../../../common/vendor.js"),e="counterclockwise",r="clockwise",i={name:"zui-progress-circle",components:{},props:{size:{type:Number,default:180},position:{type:Number,default:0},range:{type:[Array],default:()=>[0,360]},direction:{type:String,default:r,validator:t=>[e,r].includes(t)},ringWidth:{type:Number,default:8},linecap:{type:String,default:"round"},texture:{type:[String,Array],default:()=>["#1BB507","#E2D8D8"]},pointer:String,pointerOffset:Number,fixOverlay:Boolean,debug:Boolean},data:()=>({}),computed:{preset(){const t={};return t.start=this.range[0],t.end=this.range[0]>this.range[1]?this.range[1]+360:this.range[1],t.ringRadius=(this.size-this.ringWidth)/2,t.ringCenter=this.size/2,t.ringPerimeter=2*Math.PI*t.ringRadius,t.ringLength=(t.end-t.start)*Math.PI*t.ringRadius/180,t.ringStart=t.start*Math.PI*t.ringRadius/180,t.ringEnd=t.end*Math.PI*t.ringRadius/180,/^(ccw|counterclockwise)$/i.test(this.direction)?t.direction=e:t.direction=r,t},textureFG(){const t=this.size;return"string"==typeof this.texture?this.parseTexture(this.texture,t):"[object Array]"===Object.prototype.toString.call(this.texture)?"number"==typeof this.texture[0]?this.parseTexture(this.texture,t):this.parseTexture(this.texture[0],t):this.parseTexture("#1BB507",t)},textureBG(){const t=this.size;return"string"==typeof this.texture?this.parseTexture(void 0,t):"[object Array]"===Object.prototype.toString.call(this.texture)?"number"==typeof this.texture[0]?this.parseTexture(void 0,t):this.parseTexture(this.texture[1],t):this.parseTexture("#E2D8D8",t)},hasBackground(){return!!this.textureBG},svgDataUrl(){let t=this.createSVG();return t=`data:image/svg+xml,${encodeURIComponent(t.replace(/ +/g," "))}`,t},style(){const t={width:`${this.size}px`,height:`${this.size}px`,"--zui-progress-circle-ring-size":`${this.size}px`,"--zui-progress-circle-ring-width":`${this.ringWidth}px`};return Object.keys(t).map((e=>`${e}:${t[e]}`)).join(";")},pointerStyle(){const t={},{start:e,end:r,ringRadius:i}=this.preset;let n=(r-e)*this.position+e;"round"!==this.linecap&&"butt"!==this.linecap||(n+=this.ringWidth/3*180/(Math.PI*i));const s=this.pointerOffset||0;return t["--zui-progress-circle-pointer-rotate"]=`translate(-${s}px, -50%) rotate(${n}deg)`,t["--zui-progress-circle-pointer-center"]=`${s}px 50%`,Object.keys(t).map((e=>`${e}:${t[e]}`)).join(";")}},methods:{parseTexture(t,e){if(!t)return;if(/^#[0-9a-f]+/i.test(t))return{type:"color",value:t};const r=(()=>{const t=999999*Math.random();return Math.round(t)+1e5})();return/Gradient>/i.test(t)?{type:"gradient",value:`url(#def_${r})`,def:t=/id="[^"]+"/.test(t)?t.replace(/id="[^"]+"/,`id="def_${r}"`):t.replace(/<(\w+Gradient) /,`<$1 id="def_${r}" `)}:"[object Array]"===Object.prototype.toString.call(t)?{type:"gradient",value:`url(#def_${r})`,def:t=this.createGradient(r,t.slice(1),t[0])}:{type:"pattern",value:`url(#def_${r})`,def:t=/<pattern /.test(t)?/id="[^"]+"/.test(t)?t.replace(/id="[^"]+"/,`id="def_${r}"`):t.replace(/<pattern /,`<$1 id="def_${r}" `):this.createPattern(`def_${r}`,t,e)}},createGradient(t,e,r){const i=100/(e.length-1);return`<linearGradient id="def_${t}" x1="0%" y1="0%" x2="100%" y2="64.9%" gradientTransform="rotate(${r})">\n ${new Array(e.length).fill(null).map(((t,r)=>`<stop offset="${i*r*100}%" stop-color="${e[r]}" />`)).join("")}\n </linearGradient>`},createPattern:(t,e,r)=>`<pattern id="${t}" patternUnits="userSpaceOnUse" width="100%" height="100%">\n <image xlink:href="${e}" x="0" y="0" width="100%" height="100%"/>\n </pattern>`,createCircle(t,e,r){const{ringCenter:i,ringRadius:n,fixOverlay:s}=this.preset,a={cx:i,cy:i,r:n,"stroke-width":this.ringWidth,stroke:t&&t.value,"stroke-linecap":this.linecap,"stroke-dasharray":e.join(",")};if(s){const t="fg"===r?this.ringWidth:this.ringWidth-1;a["stroke-width"]=t>8?t:8}return`<circle fill="none" stroke-dashoffset="1" ${Object.keys(a).map((t=>a[t]?`${t}="${a[t]}"`:"")).join(" ")}></circle>`},generateDashArray(t){const{direction:r,ringStart:i,ringPerimeter:n,ringLength:s}=this.preset;let a=r===e?i+(1-t)*s:i,o=0,h=0,d=0;h=1+a,d=t*s;const c=a+t*s;return c>n?(o=c-n,h=a-o):o=0,[o,h,d,n]},createSVG(){const t=this.hasBackground?this.createCircle(this.textureBG,this.generateDashArray(1)):"",e=this.createCircle(this.textureFG,this.generateDashArray(this.position),"fg"),r=[this.textureFG.def||"",this.textureBG&&this.textureBG.def||""];return`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="${this.size}" height="${this.size}">\n <defs>\n ${r.join("\n")}\n </defs>\n <g>\n ${t}\n ${e}\n </g>\n</svg>`}}};const n=t._export_sfc(i,[["render",function(e,r,i,n,s,a){return t.e({a:i.pointer},i.pointer?{b:i.pointer,c:t.s(a.pointerStyle)}:{},{d:a.svgDataUrl,e:i.debug},(i.debug,{}),{f:t.n(i.debug?"debug":""),g:t.s(a.style)})}],["__scopeId","data-v-429415b9"]]);wx.createComponent(n);

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view ref="eleMeter" class="{{['data-v-429415b9', 'zui-progress-circle', f]}}" style="{{g}}"><view class="zui-progress-circle-wrapper data-v-429415b9"><image wx:if="{{a}}" class="zui-progress-circle-pointer data-v-429415b9" mode="aspectFit" src="{{b}}" style="{{c}}"/><image class="zui-progress-circle-ring data-v-429415b9" mode="aspectFit" src="{{d}}"/></view><view class="zui-progress-circle-slot data-v-429415b9"><slot/></view><view wx:if="{{e}}" class="debug-frame data-v-429415b9"><view class="cross-v data-v-429415b9"></view><view class="cross-h data-v-429415b9"></view><view class="half-size data-v-429415b9"></view></view></view>

View File

@@ -0,0 +1 @@
.zui-progress-circle.data-v-429415b9{--zui-progress-circle-debug-color: #f00;position:relative}.zui-progress-circle-wrapper.data-v-429415b9{width:100%;height:100%}.zui-progress-circle-ring.data-v-429415b9{width:var(--zui-progress-circle-ring-size);height:var(--zui-progress-circle-ring-size)}.zui-progress-circle-slot.data-v-429415b9{position:absolute;top:0;left:0;width:100%;height:100%;padding:var(--zui-progress-circle-ring-width);box-sizing:border-box}.zui-progress-circle-pointer.data-v-429415b9{position:absolute;z-index:10;top:50%;left:50%;transform:var(--zui-progress-circle-pointer-rotate);transform-origin:var(--zui-progress-circle-pointer-center);width:50%;height:50%;transition:transform .1s linear}.debug-frame.data-v-429415b9,.cross-v.data-v-429415b9,.cross-h.data-v-429415b9,.half-size.data-v-429415b9{position:absolute}.debug-frame.data-v-429415b9{position:absolute;z-index:99;top:0;left:0;width:100%;height:100%;border:1px solid var(--zui-progress-circle-debug-color);border-radius:50%}.cross-h.data-v-429415b9,.cross-v.data-v-429415b9,.half-size.data-v-429415b9{top:50%;left:50%;transform:translate(-50%,-50%);background-color:var(--zui-progress-circle-debug-color);mix-blend-mode:difference}.cross-v.data-v-429415b9{width:1px;height:100%}.cross-h.data-v-429415b9{width:100%;height:1px}.half-size.data-v-429415b9{width:50%;height:50%;border:1px solid var(--zui-progress-circle-debug-color);background-color:transparent;border-radius:50%}