xrk-components 0.1.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +2 -11
- package/lib/index.css +18560 -0
- package/lib/index.esm.js +2958 -0
- package/lib/index.umd.js +2997 -0
- package/package.json +47 -69
- package/rollup.config.js +59 -0
- package/tsconfig.json +24 -0
- package/typings/shims-vue.d.ts +6 -0
- package/.editorconfig +0 -9
- package/.eslintrc.js +0 -40
- package/.prettierrc.js +0 -16
- package/debug.log +0 -1
- package/dist/bundler.js +0 -7
- package/dist/bundler.js.map +0 -1
- package/index.html +0 -19
- package/src/App.vue +0 -134
- package/src/lib/index.js +0 -27
- package/src/main.js +0 -25
- package/src/packages/dialog/index.js +0 -32
- package/src/packages/dialog/src/main.vue +0 -197
- package/src/packages/slide-verify/index.js +0 -12
- package/src/packages/slide-verify/src/main.vue +0 -479
- package/src/packages/slide-verify/src/static/close.png +0 -0
- package/src/packages/slide-verify/src/static/placeholder.png +0 -0
- package/src/packages/slide-verify/src/static/range_btn.png +0 -0
- package/src/packages/slide-verify/src/static/refresh.png +0 -0
- package/src/packages/task-detail/index.js +0 -12
- package/src/packages/task-detail/src/components/formDetail.vue +0 -79
- package/src/packages/task-detail/src/components/mixin.js +0 -105
- package/src/packages/task-detail/src/components/styles/index.scss +0 -162
- package/src/packages/task-detail/src/components/surveyDetail.vue +0 -337
- package/src/packages/task-detail/src/config/fields.js +0 -655
- package/src/packages/task-detail/src/config/index.js +0 -34
- package/src/packages/task-detail/src/main.vue +0 -108
- package/src/packages/task-detail/src/static/fieldsMap.js +0 -274
- package/src/packages/task-detail/src/test/testData.js +0 -743
- package/src/packages/task-detail/src/tools/index.js +0 -290
- package/webpack.config.js +0 -93
package/index.html
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Description:
|
|
3
|
-
* @LastEditors: wjx
|
|
4
|
-
* @Date: 2021-01-28 23:29:19
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html lang="en">
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="utf-8">
|
|
10
|
-
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
|
11
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
|
12
|
-
<meta name="format-detection" content="telephone=no, email=no" />
|
|
13
|
-
<title>xrk</title>
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div id="app"></div>
|
|
17
|
-
<script src="./dist/bundler.js"></script>
|
|
18
|
-
</body>
|
|
19
|
-
</html>
|
package/src/App.vue
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Description:
|
|
3
|
-
* @LastEditors: jml
|
|
4
|
-
* @Date: 2021-01-28 23:29:19
|
|
5
|
-
-->
|
|
6
|
-
<template>
|
|
7
|
-
<ul class="pervie">
|
|
8
|
-
<li name="任务记录">
|
|
9
|
-
<h1>任务记录</h1>
|
|
10
|
-
<TaskDetail :config="taskDetailOptions"></TaskDetail>
|
|
11
|
-
</li>
|
|
12
|
-
<li name="滑动组件">
|
|
13
|
-
<h1>滑动组件</h1>
|
|
14
|
-
<div style="padding:300px 0 30px 100px;width:350px;" class="block">
|
|
15
|
-
<input type="text" v-model="form.phone" />
|
|
16
|
-
<button @click="showVerify">submit</button>
|
|
17
|
-
<XrkSlideVerify
|
|
18
|
-
ref="verify"
|
|
19
|
-
title="12"
|
|
20
|
-
:options="options"
|
|
21
|
-
></XrkSlideVerify>
|
|
22
|
-
</div>
|
|
23
|
-
</li>
|
|
24
|
-
</ul>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script>
|
|
28
|
-
import Mock from 'mockjs';
|
|
29
|
-
import taskDetailTestData from './packages/task-detail/src/test/testData';
|
|
30
|
-
|
|
31
|
-
const API = {
|
|
32
|
-
// 滑动组件相关接口
|
|
33
|
-
initImages: () => {
|
|
34
|
-
return new Promise(resolve => {
|
|
35
|
-
setTimeout(() => {
|
|
36
|
-
resolve({
|
|
37
|
-
data: {
|
|
38
|
-
data: {
|
|
39
|
-
shadeImage: Mock.Handler.gen('@dataImage("280x171")'),
|
|
40
|
-
cutoutImage: Mock.Handler.gen('@dataImage("55x55","gap")'),
|
|
41
|
-
y: Mock.Handler.gen('@integer(10,100)'),
|
|
42
|
-
shadeImageWeight: 280,
|
|
43
|
-
shadeImageHeight: 171,
|
|
44
|
-
cutoutImageWeight: 65, //小滑块宽
|
|
45
|
-
cutoutImageHeight: 65 //小滑块高
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}, 800);
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
checkVerification: () => {
|
|
53
|
-
console.log('服务器:收到验证请求');
|
|
54
|
-
return new Promise((resolve, reject) => {
|
|
55
|
-
Math.random() > 0.5
|
|
56
|
-
? resolve(() => {
|
|
57
|
-
setTimeout(() => {
|
|
58
|
-
resolve({
|
|
59
|
-
data: {}
|
|
60
|
-
});
|
|
61
|
-
}, 800);
|
|
62
|
-
})
|
|
63
|
-
: reject();
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
// 任务记录组件相关接口
|
|
67
|
-
getTaskDetail: () => {
|
|
68
|
-
return new Promise((resolve, reject) => {
|
|
69
|
-
Math.random() > 0.5
|
|
70
|
-
? resolve(() => {
|
|
71
|
-
setTimeout(() => {
|
|
72
|
-
resolve({
|
|
73
|
-
data: {}
|
|
74
|
-
});
|
|
75
|
-
}, 800);
|
|
76
|
-
})
|
|
77
|
-
: reject();
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const projectType = 5;
|
|
82
|
-
export default {
|
|
83
|
-
name: 'App',
|
|
84
|
-
data() {
|
|
85
|
-
return {
|
|
86
|
-
form: {
|
|
87
|
-
phone: ''
|
|
88
|
-
},
|
|
89
|
-
options: {
|
|
90
|
-
remoteApi: {
|
|
91
|
-
// 获取图片,拼图Y轴
|
|
92
|
-
initImages: API.initImages,
|
|
93
|
-
// 验证接口 {x:'',y:''}
|
|
94
|
-
checkVerification: position => {
|
|
95
|
-
return API.checkVerification({ ...this.form, ...position });
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
errorText: '请控制拼图块对齐缺口',
|
|
99
|
-
successText: '验证成功'
|
|
100
|
-
},
|
|
101
|
-
taskDetailOptions: {
|
|
102
|
-
remoteApi: {
|
|
103
|
-
getTaskDetail: API.getTaskDetail // 获取详情接口
|
|
104
|
-
},
|
|
105
|
-
insertFields: [],
|
|
106
|
-
hideFieldsKeys: [],
|
|
107
|
-
customFieldsMap: {},
|
|
108
|
-
initTaskDetail: taskDetailTestData[projectType], // 默认详情
|
|
109
|
-
projectStructureType: 1, // 税筹结构
|
|
110
|
-
projectId: 1, // 项目ID
|
|
111
|
-
projectType: projectType // 项目类型
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
components: {},
|
|
116
|
-
watch: {},
|
|
117
|
-
computed: {},
|
|
118
|
-
methods: {
|
|
119
|
-
showVerify() {
|
|
120
|
-
this.$refs['verify'].visible = true;
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
created() {},
|
|
124
|
-
beforeDestroy() {}
|
|
125
|
-
};
|
|
126
|
-
</script>
|
|
127
|
-
|
|
128
|
-
<style>
|
|
129
|
-
.block {
|
|
130
|
-
box-sizing: border-box;
|
|
131
|
-
border-radius: 8px;
|
|
132
|
-
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
|
|
133
|
-
}
|
|
134
|
-
</style>
|
package/src/lib/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Description:
|
|
3
|
-
* @LastEditors: jml
|
|
4
|
-
* @Date: 2021-01-28 23:29:19
|
|
5
|
-
*/
|
|
6
|
-
import SlideVerify from '../packages/slide-verify/index.js'; // 滑动验证组件
|
|
7
|
-
import TaskDetail from '../packages/task-detail/index.js'; // 任务记录组件
|
|
8
|
-
import Dialog from '../packages/dialog/index.js'; // 弹窗组件
|
|
9
|
-
|
|
10
|
-
const components = [SlideVerify, TaskDetail, Dialog];
|
|
11
|
-
|
|
12
|
-
const install = function(Vue) {
|
|
13
|
-
components.forEach(component => {
|
|
14
|
-
Vue.component(component.name, component);
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
if (typeof window !== 'undefined' && window.Vue) {
|
|
19
|
-
install(window.Vue);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
install,
|
|
24
|
-
TaskDetail,
|
|
25
|
-
SlideVerify,
|
|
26
|
-
Dialog
|
|
27
|
-
};
|
package/src/main.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Description:
|
|
3
|
-
* @LastEditors: jml
|
|
4
|
-
* @Date: 2021-01-28 23:29:19
|
|
5
|
-
*/
|
|
6
|
-
import Vue from 'vue';
|
|
7
|
-
import App from './App';
|
|
8
|
-
import Xrk from './lib/index.js';
|
|
9
|
-
|
|
10
|
-
Vue.config.productionTip = false;
|
|
11
|
-
Vue.use(Xrk);
|
|
12
|
-
|
|
13
|
-
// 图片预览插件
|
|
14
|
-
import preview from 'vue-photo-preview';
|
|
15
|
-
import 'vue-photo-preview/dist/skin.css';
|
|
16
|
-
Vue.use(preview, {
|
|
17
|
-
fullscreenEl: false,
|
|
18
|
-
bgOpacity: 0.8
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
/* eslint-disable no-new */
|
|
22
|
-
new Vue({
|
|
23
|
-
el: '#app',
|
|
24
|
-
render: h => h(App)
|
|
25
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Description:
|
|
3
|
-
* @Author: jml
|
|
4
|
-
* @Date: 2021-02-26 15:38:03
|
|
5
|
-
* @LastEditors: jml
|
|
6
|
-
* @LastEditTime: 2021-03-02 19:27:29
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import Dialog from './src/main';
|
|
10
|
-
import Vue from 'vue';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 创建弹窗
|
|
14
|
-
* @param {*} props
|
|
15
|
-
*/
|
|
16
|
-
export const createDialog = (props = {}) => {
|
|
17
|
-
const dialogInstance = new Vue({
|
|
18
|
-
el: document.createElement('div'),
|
|
19
|
-
render(h) {
|
|
20
|
-
return h(Dialog, {
|
|
21
|
-
props
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
document.body.appendChild(dialogInstance.$el);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
Dialog.install = function(Vue) {
|
|
29
|
-
Vue.component(Dialog.name, Dialog);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default Dialog;
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Description:
|
|
3
|
-
* @Author: jml
|
|
4
|
-
* @Date: 2021-02-26 15:38:10
|
|
5
|
-
* @LastEditors: jml
|
|
6
|
-
* @LastEditTime: 2021-03-03 11:23:56
|
|
7
|
-
-->
|
|
8
|
-
<template>
|
|
9
|
-
<div class="dialog">
|
|
10
|
-
<div class="content">
|
|
11
|
-
<div class="title">{{ title }}</div>
|
|
12
|
-
<div class="close" @click="close"></div>
|
|
13
|
-
<div class="wrap">
|
|
14
|
-
<CustomRender :vnode="content"></CustomRender>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="btn-group" v-if="!hideCancel || !hideConfirm">
|
|
17
|
-
<div class="btn cancel" @click="btnClick('cancel')" v-if="!hideCancel">{{ cancelText }}</div>
|
|
18
|
-
<div class="btn confirm" @click="btnClick('confirm')" v-if="!hideConfirm">{{ confirmText }}</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
let bodyOldStyle = '';
|
|
26
|
-
import { check } from '../../task-detail/src/tools/index';
|
|
27
|
-
export default {
|
|
28
|
-
name: 'Dialog',
|
|
29
|
-
props: {
|
|
30
|
-
title: String,
|
|
31
|
-
content: {
|
|
32
|
-
/* eslint-disable */
|
|
33
|
-
type: String | Number | Object,
|
|
34
|
-
default: ''
|
|
35
|
-
},
|
|
36
|
-
cancelText: {
|
|
37
|
-
type: String,
|
|
38
|
-
default: '取消'
|
|
39
|
-
},
|
|
40
|
-
hideCancel: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
confirmText: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: '确定'
|
|
47
|
-
},
|
|
48
|
-
hideConfirm: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false
|
|
51
|
-
},
|
|
52
|
-
success: Function,
|
|
53
|
-
closeBefore: Function
|
|
54
|
-
},
|
|
55
|
-
components: {
|
|
56
|
-
CustomRender: {
|
|
57
|
-
props: {
|
|
58
|
-
vnode: {
|
|
59
|
-
type: Object | String
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
render(h) {
|
|
63
|
-
if (check.isObject(this.vnode)) {
|
|
64
|
-
return this.vnode;
|
|
65
|
-
} else {
|
|
66
|
-
return h('span', this.vnode);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
methods: {
|
|
72
|
-
btnClick(type) {
|
|
73
|
-
const { success } = this;
|
|
74
|
-
if (check.isFunction(success)) {
|
|
75
|
-
success({
|
|
76
|
-
confirm: type === 'confirm',
|
|
77
|
-
dialog: this
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
close() {
|
|
82
|
-
const { closeBefore } = this;
|
|
83
|
-
if (check.isFunction(closeBefore)) {
|
|
84
|
-
closeBefore();
|
|
85
|
-
}
|
|
86
|
-
document.body.removeChild(this.$el);
|
|
87
|
-
this.$destroy();
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
created() {
|
|
91
|
-
bodyOldStyle = document.body.style;
|
|
92
|
-
document.body.style = `overflow:hidden;${bodyOldStyle}`;
|
|
93
|
-
},
|
|
94
|
-
destroyed() {
|
|
95
|
-
document.body.style = bodyOldStyle;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
</script>
|
|
99
|
-
|
|
100
|
-
<style lang="scss" scoped>
|
|
101
|
-
.dialog {
|
|
102
|
-
line-height: 1.2;
|
|
103
|
-
padding: 0;
|
|
104
|
-
margin: 0;
|
|
105
|
-
position: fixed;
|
|
106
|
-
left: 0;
|
|
107
|
-
top: 0;
|
|
108
|
-
width: 100vw;
|
|
109
|
-
height: 100vh;
|
|
110
|
-
background-color: rgba($color: #000000, $alpha: 0.7);
|
|
111
|
-
& > .content {
|
|
112
|
-
position: absolute;
|
|
113
|
-
left: 50%;
|
|
114
|
-
top: 50%;
|
|
115
|
-
transform: translate(-50%, -50%);
|
|
116
|
-
background-color: #fff;
|
|
117
|
-
border-radius: 8px;
|
|
118
|
-
padding-bottom: 20px;
|
|
119
|
-
& > .title {
|
|
120
|
-
padding: 20px 20px;
|
|
121
|
-
font-size: 18px;
|
|
122
|
-
text-align: center;
|
|
123
|
-
color: #333;
|
|
124
|
-
position: relative;
|
|
125
|
-
z-index: 1;
|
|
126
|
-
cursor: default;
|
|
127
|
-
}
|
|
128
|
-
& > .close {
|
|
129
|
-
width: 20px;
|
|
130
|
-
height: 20px;
|
|
131
|
-
position: absolute;
|
|
132
|
-
right: 10px;
|
|
133
|
-
top: 10px;
|
|
134
|
-
z-index: 2;
|
|
135
|
-
cursor: pointer;
|
|
136
|
-
&:hover {
|
|
137
|
-
&::after,
|
|
138
|
-
&::before {
|
|
139
|
-
background-color: rgba($color: #666, $alpha: 0.7);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
&::before,
|
|
143
|
-
&::after {
|
|
144
|
-
content: '';
|
|
145
|
-
width: 20px;
|
|
146
|
-
height: 1px;
|
|
147
|
-
background-color: #666;
|
|
148
|
-
position: absolute;
|
|
149
|
-
top: 10px;
|
|
150
|
-
transform: rotate(45deg);
|
|
151
|
-
}
|
|
152
|
-
&::after {
|
|
153
|
-
transform: rotate(135deg);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
& > .wrap {
|
|
157
|
-
line-height: 1.5;
|
|
158
|
-
padding: 0 20px;
|
|
159
|
-
max-height: 65vh;
|
|
160
|
-
overflow-y: auto;
|
|
161
|
-
}
|
|
162
|
-
& > .btn-group {
|
|
163
|
-
padding: 15px 20px 0 20px;
|
|
164
|
-
text-align: center;
|
|
165
|
-
& > .btn {
|
|
166
|
-
display: inline-block;
|
|
167
|
-
width: 85px;
|
|
168
|
-
height: 40px;
|
|
169
|
-
line-height: 40px;
|
|
170
|
-
font-size: 14px;
|
|
171
|
-
border-radius: 4px;
|
|
172
|
-
cursor: pointer;
|
|
173
|
-
transition: all 0.3s;
|
|
174
|
-
& + .btn {
|
|
175
|
-
margin-left: 20px;
|
|
176
|
-
}
|
|
177
|
-
&.cancel {
|
|
178
|
-
border: 1px solid #dcdfe6;
|
|
179
|
-
color: #606266;
|
|
180
|
-
&:hover {
|
|
181
|
-
color: #409eff;
|
|
182
|
-
border-color: #c6e2ff;
|
|
183
|
-
background-color: #ecf5ff;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
&.confirm {
|
|
187
|
-
background-color: #409eff;
|
|
188
|
-
color: #fff;
|
|
189
|
-
&:hover {
|
|
190
|
-
background-color: rgba($color: #409eff, $alpha: 0.7);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
</style>
|