askbot-dragon 0.7.91 → 0.7.94

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.
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <div class="container">
3
+ <div class="top-container">
4
+ <div class="close">取消</div>
5
+ <div class="sure">确定</div>
6
+ </div>
7
+ <van-list v-model="loading" :finished="finished" finished-text="没有更多了" :offset="1" @load="onload" class="list-container">
8
+ <van-cell v-for="item in list" :key="item.id" :title="item.name" />
9
+ <!-- <van-cell title="123" />
10
+ <van-cell title="asdasd" />
11
+ <van-cell title="adszx" />
12
+ <van-cell title="zxc zc" />
13
+ <van-cell title="asdasd" />
14
+ <van-cell title="wqeqweqwe" />
15
+ <van-cell title="icvbncvbn" /> -->
16
+ </van-list>
17
+ </div>
18
+ </template>
19
+ <script>
20
+ export default {
21
+ props: {
22
+ finished:{
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ list:{
27
+ type:Array,
28
+ default:() =>{
29
+ return []
30
+ }
31
+ }
32
+ },
33
+ data() {
34
+ return {
35
+ show: false,
36
+ loading: false
37
+ }
38
+ },
39
+ methods: {
40
+ onload() {
41
+ this.$emit('onload')
42
+ }
43
+ }
44
+ }
45
+ </script>
46
+
47
+ <style lang="less" scoped>
48
+ .container {
49
+ width: 100%;
50
+ height: 100%;
51
+ .top-container {
52
+ width: 100%;
53
+ height: 50px;
54
+ display: flex;
55
+ align-items: center;
56
+ justify-content: space-between;
57
+ padding: 0 20px;
58
+ box-sizing: border-box;
59
+ .sure {
60
+ color: #366aff;
61
+ }
62
+ .close {
63
+ color: #cccccc;
64
+ }
65
+ }
66
+ .list-container {
67
+ width: 100%;
68
+ height: calc(100% - 50px);
69
+ }
70
+ }
71
+ </style>
@@ -0,0 +1,225 @@
1
+ <template>
2
+ <div class="popUp">
3
+ <div class="topBtn">
4
+ <span class="cancel" @click="closeBtn">取消</span>
5
+ <span class="sure" @click="sure">确定</span>
6
+ </div>
7
+ <slot name="popup-header" class="popup-header"></slot>
8
+ <div class="popup-content">
9
+ <div
10
+ class="filter-item"
11
+ v-for="(item,index) in options"
12
+ :key="index"
13
+ @click="checked(item,index)"
14
+ >
15
+ <div :class="[checkIdList.includes(item[props.value]) && 'setColor', 'label']">{{item[props.label]}}</div>
16
+ </div>
17
+ </div>
18
+ <div class="popup-footer">
19
+ <slot name="popup-footer"></slot>
20
+ </div>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ export default {
26
+ data() {
27
+ return {
28
+ checkOptions: [],
29
+ checkIdList:[],
30
+ visable:false
31
+ }
32
+ },
33
+ props: {
34
+ options: {
35
+ type: Array,
36
+ default:function() {
37
+ return []
38
+ }
39
+ },
40
+ defaultValue: {
41
+ type: Array,
42
+ default:function() {
43
+ return []
44
+ }
45
+ },
46
+ props: {
47
+ type: Object,
48
+ default(){
49
+ return{
50
+ label: 'label',
51
+ value: 'value'
52
+ }
53
+ }
54
+ },
55
+ multiple: {
56
+ type: Boolean,
57
+ default: false
58
+ }
59
+ },
60
+ methods: {
61
+ checked(item) {
62
+ if(this.multiple) {
63
+ let count = this.checkIdList.findIndex(element => { return element == item[this.props.value] } )
64
+ if(count !== -1) {
65
+ this.checkIdList.splice(count,1)
66
+ this.checkOptions.splice(count,1)
67
+ } else {
68
+ this.checkIdList.push(item[this.props.value])
69
+ this.checkOptions.push(item)
70
+ }
71
+ } else {
72
+ this.checkIdList = []
73
+ this.checkOptions = []
74
+ this.checkIdList.push(item[this.props.value])
75
+ this.checkOptions.push(item)
76
+ }
77
+ },
78
+ sure() {
79
+ if(this.checkOptions.length == 0 && this.checkIdList == 0){
80
+ this.$emit('onConfim',false,false)
81
+ return
82
+ }
83
+ let option = JSON.parse(JSON.stringify(this.checkOptions))
84
+ let list = JSON.parse(JSON.stringify(this.checkIdList))
85
+ if(this.multiple) {
86
+ this.$emit('onConfim',option, list)
87
+ } else {
88
+ this.$emit('onConfim',option[0], list[0])
89
+ }
90
+ },
91
+ closeBtn(){
92
+ this.$emit('onclose')
93
+ }
94
+ },
95
+ watch: {
96
+ defaultValue: {
97
+ handler(value) {
98
+ console.log(value,'=====');
99
+ this.checkOptions = []
100
+ if(Array.isArray(this.defaultValue)) {
101
+ if (this.multiple){
102
+ let val = []
103
+ this.defaultValue.forEach(item=>{
104
+ item.forEach(items=>{
105
+ val.push(items)
106
+ })
107
+ })
108
+ this.checkIdList = [...val]
109
+ }
110
+ else {
111
+ this.checkIdList = [...this.defaultValue]
112
+ }
113
+
114
+ this.checkIdList.forEach(item =>{
115
+ if (Array.isArray(item)){
116
+ item.forEach(items=>{
117
+
118
+ this.options.forEach(res =>{
119
+ console.debug('items',items,res[this.props.value])
120
+ if(items == res[this.props.value]) {
121
+ this.checkOptions.push(res)
122
+ }
123
+ })
124
+ })
125
+ }
126
+ else {
127
+ this.options.forEach(res =>{
128
+ if(item == res[this.props.value]) {
129
+ this.checkOptions.push(res)
130
+ }
131
+ })
132
+ }
133
+
134
+ })
135
+ }
136
+ console.debug('checkOptions',this.checkOptions)
137
+ },
138
+ deep: true,
139
+ immediate: true
140
+ },
141
+ visable(value) {
142
+ if(value) {
143
+ console.log(this.defaultValue,'=====');
144
+ this.checkOptions = []
145
+ if(Array.isArray(this.defaultValue)) {
146
+ this.checkIdList = [...this.defaultValue]
147
+ this.checkIdList.forEach(item =>{
148
+ this.options.forEach(res =>{
149
+ if(item == res[this.props.value]) {
150
+ this.checkOptions.push(res)
151
+ }
152
+ })
153
+ })
154
+ }
155
+ // else {
156
+ // this.checkIdList = this.defaultValue
157
+ // let obj = this.options.find(item =>{ return item[this.props.value] == this.defaultValue[0] })
158
+ // obj && this.checkOptions.push(obj)
159
+ // }
160
+ } else {
161
+ this.checkOptions = []
162
+ this.checkIdList = []
163
+ }
164
+ },
165
+ },
166
+ mounted() {
167
+ console.debug('options',this.options)
168
+
169
+ }
170
+ }
171
+ </script>
172
+
173
+ <style lang="less" scoped>
174
+ .popup-content {
175
+ /*padding-top: 8px;*/
176
+ height: 240px;
177
+ overflow-y: scroll;
178
+ overflow-x: hidden;
179
+ .filter-item {
180
+ width: 100%;
181
+ display: flex;
182
+ align-items: center;
183
+ justify-content: center;
184
+ height: 48px;
185
+ .setColor {
186
+ color: #366aff;
187
+ }
188
+ .label {
189
+ display: block;
190
+ width: 80%;
191
+ overflow: hidden;
192
+ text-overflow: ellipsis;
193
+ white-space:nowrap;
194
+ text-align: center;
195
+ }
196
+ }
197
+ }
198
+ .topBtn {
199
+ width: 100%;
200
+ height: 40px;
201
+ display: flex;
202
+ align-items: center;
203
+ justify-content: space-between;
204
+ box-sizing: border-box;
205
+ padding: 0 20px;
206
+ .cancel {
207
+ color: #606266;
208
+ }
209
+ .sure {
210
+ color: #366aff;
211
+ }
212
+ }
213
+ .popup-footer {
214
+ position: absolute;
215
+ max-height: 50px;
216
+ bottom: 0;
217
+ display: flex;
218
+ justify-content: center;
219
+ align-items: center;
220
+ width: 100%;
221
+ color: #366aff;
222
+ background: #eff2f5;
223
+ /*border-radius: 28px;*/
224
+ }
225
+ </style>
@@ -0,0 +1,163 @@
1
+ <template>
2
+ <div id="tree">
3
+ <div class="tree-header">
4
+ <span class="cacel" @click="cancelBtn">取消</span>
5
+ <span class="primary" @click="saveData">确认</span>
6
+ </div>
7
+ <div class="tree-container">
8
+ <el-tree :data="dataTree"
9
+ :props="defaultProps"
10
+ ref="dataTree"
11
+ node-key="value"
12
+ >
13
+ <span class="custom-tree-node" slot-scope="{ node,data}">
14
+ <span class="tree-label">{{ node.label }}</span>
15
+ <span>
16
+ <el-checkbox v-model="data.checked" v-if="dataOptions.extInfo.selectType ==='多选'"></el-checkbox>
17
+ <el-radio v-model="checked" v-else :label="data.value"></el-radio>
18
+ </span>
19
+ </span>
20
+ </el-tree>
21
+ </div>
22
+ <!-- <div class="footer">
23
+ <el-button>取 消</el-button>
24
+ <el-button type="primary" @click="saveData">确 认</el-button>
25
+ </div>-->
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ export default {
31
+ name: "tree",
32
+ data(){
33
+ return{
34
+ defaultProps:{},
35
+ checked:'',
36
+ dataTree:[],
37
+ checkList:[],
38
+ checkDatas:[]
39
+ }
40
+ },
41
+ props:["dataOptions"],
42
+ methods:{
43
+ saveData(){
44
+ this.checkList = []
45
+ this.checkDatas = []
46
+ this.ergodicData(this.dataTree,this.checkList)
47
+ this.$emit('saveData',this.checkList,this.checkDatas)
48
+ },
49
+ cancelBtn(){
50
+ this.$emit('cancelBtn')
51
+ },
52
+ ergodicData(list){
53
+ list.forEach(item=>{
54
+ if (this.dataOptions.extInfo.selectType === '多选'){
55
+ if (item.checked){
56
+ let data = this.$refs.dataTree.getNode(item)
57
+ let checkList = []
58
+ let arr = this.serchParent(data,checkList)
59
+ this.checkList.push(arr)
60
+ this.checkDatas.push(item)
61
+ }
62
+ }
63
+ else {
64
+ if (item.value === this.checked){
65
+ let data = this.$refs.dataTree.getNode(item)
66
+ let checkList = []
67
+ let arr = this.serchParent(data,checkList)
68
+ this.checkList = arr
69
+ this.checkDatas = [item]
70
+ }
71
+ }
72
+ if (item.children){
73
+ this.ergodicData(item.children)
74
+ }
75
+ })
76
+ },
77
+ serchParent(node,list) {
78
+ if(node) {
79
+ if(Object.prototype.toString.call(node.data) == '[object Object]') {
80
+ list.unshift(node.data.value)
81
+ }
82
+ if(node.parent) {
83
+ list = this.serchParent(node.parent,list)
84
+ }
85
+ }
86
+ return list
87
+ },
88
+ },
89
+ mounted() {
90
+ if (this.dataOptions.extInfo.cascadeDown.options){
91
+ this.dataTree = this.dataOptions.extInfo.cascadeDown.options
92
+ }
93
+ else if (this.dataOptions.extInfo.cascade){
94
+ this.dataTree = this.dataOptions.extInfo.cascade
95
+ }
96
+ else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]){
97
+ this.dataTree = this.dataOptions.extInfo.cascadeDown[0].options
98
+ }
99
+ }
100
+ };
101
+ </script>
102
+
103
+ <style scoped lang="less">
104
+ #tree{
105
+ height: 100%;
106
+ overflow: hidden;
107
+ /deep/.el-tree-node__content{
108
+ height: 38px;
109
+ line-height: 38px;
110
+ }
111
+ .tree-header{
112
+ height: 30px;
113
+ display: flex;
114
+ align-items: center;
115
+ justify-content: space-between;
116
+ margin: 0 20px;
117
+ width: calc(100% - 40px);
118
+ /*font-size: 14px;*/
119
+ padding-bottom: 30px;
120
+ .primary{
121
+ color: #366aff;
122
+ }
123
+ .cacel{
124
+ color: #969799;
125
+ }
126
+ }
127
+ .tree-container{
128
+ height:260px;
129
+ overflow-y: scroll;
130
+ overflow-x: hidden;
131
+ }
132
+ .custom-tree-node{
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: space-between;
136
+ width: calc(100% - 40px);
137
+ font-size: 14px;
138
+ .tree-label{
139
+ max-width: 160px;
140
+ overflow: hidden;
141
+ text-overflow: ellipsis;
142
+ white-space: nowrap;
143
+ }
144
+ /deep/.el-radio__label{
145
+ display: none;
146
+ }
147
+ }
148
+ .footer{
149
+ position: absolute;
150
+ bottom: 0;
151
+ height: 60px;
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: space-between;
155
+ width: calc(100% - 40px);
156
+ margin: 0 20px;
157
+ .el-button{
158
+ flex: 1;
159
+ border-radius: 9px;
160
+ }
161
+ }
162
+ }
163
+ </style>
@@ -13,7 +13,14 @@ const formatDate = (fmt) => { //author: meizz
13
13
  if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
14
14
  return fmt;
15
15
  }
16
-
17
- export { formatDate };
16
+ function forMatTime(value){
17
+ let startTime = ''
18
+ let currentTime = new Date(), year = currentTime.getFullYear(),
19
+ month = currentTime.getMonth() + 1 < 10 ? '0' + (currentTime.getMonth() + 1) : currentTime.getMonth() + 1,
20
+ day = currentTime.getDate() < 10 ? '0' + currentTime.getDate() : currentTime.getDate();
21
+ startTime = year + "-" + month + "-" + day +' ' + value;
22
+ return new Date(startTime)
23
+ }
24
+ export { formatDate,forMatTime };
18
25
 
19
26
  // new Date("2019-12-14T00:09:16.000+0000").Format("yyyy-MM-dd hh:mm:ss")
package/vue.config.js CHANGED
@@ -23,6 +23,15 @@ module.exports = {
23
23
  '^/open': '/'
24
24
  }
25
25
  },
26
+ '/order-api': {
27
+ target: 'http://master.test.askbot.cn:32022',
28
+ /*target:'http://new-test.guoranbot.com:30672',*/
29
+ changeOrigin: true,
30
+ ws: true,
31
+ pathRewrite: {
32
+ '^/order-api': '/'
33
+ }
34
+ },
26
35
  },
27
36
  },
28
37
  configureWebpack: {