shijiplus-web-plugin 0.1.15 → 0.1.17

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/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # shijiplus-web-tool
1
+ # shijiplus-web-plugin
2
+
2
3
 
3
4
  ## Project setup
4
5
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shijiplus-web-plugin",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "files": [
5
5
  "src"
6
6
  ],
package/src/App.vue CHANGED
@@ -1,8 +1,12 @@
1
1
  <template>
2
2
  <div id="app">
3
3
  <img id="img" alt="Vue logo" src="./assets/logo.png" />
4
+ <Button @click="showMapClick">showMap</Button>
4
5
  <plus-city-cascader></plus-city-cascader>
5
- <TxMap></TxMap>
6
+ <TxMap
7
+ :show="showmap"
8
+ region="北京"
9
+ ></TxMap>
6
10
  </div>
7
11
  </template>
8
12
 
@@ -14,6 +18,14 @@ import TxMap from './components/txmap/tx-map'
14
18
  export default {
15
19
  name: 'App',
16
20
  components: { PlusCityCascader, TxMap },
21
+ data() {
22
+ return { showmap: false }
23
+ },
24
+ methods: {
25
+ showMapClick() {
26
+ this.showmap = true
27
+ }
28
+ },
17
29
  mounted() {
18
30
  console.log(
19
31
  'web-tool mounted!',
@@ -66,7 +66,8 @@ export default {
66
66
  }
67
67
  })
68
68
  }
69
- this.setCenter(this.lat, this.lng, this.posTitle)
69
+ const pos = this.getPosition()
70
+ this.setCenter(pos.lat, pos.lng, this.posTitle)
70
71
  })
71
72
  }
72
73
  console.log('---------txmap-show----------', val)
@@ -123,6 +124,7 @@ export default {
123
124
  },
124
125
  mapTX() {
125
126
  let _this = this
127
+ console.log('--------this.tMap--------', this.tMap)
126
128
  if (this.tMap) {
127
129
  return Promise.resolve()
128
130
  }
package/src/libs/util.js CHANGED
@@ -1,7 +1,78 @@
1
+
2
+ import { forEach, hasOneOf, oneOf, objEqual } from './tools'
3
+
1
4
  import { export_json_to_excel as exportJsonToExcel, exportJsonToExcelBlob } from './excel'
2
5
 
3
- export const hasChild = (item) => {
4
- return item.children && item.children.length !== 0
6
+
7
+ export const createBtn = (h, { props, directives, txt, callback, danger, style, icon }) => {
8
+ return h('Button', {
9
+ directives: directives,
10
+ style: style,
11
+ props: {
12
+ type: danger ? 'error' : 'primary',
13
+ size: 'small',
14
+ icon: icon,
15
+ ghost: true,
16
+ ...props
17
+ },
18
+ on: {
19
+ click: () => {
20
+ if (callback) {
21
+ callback()
22
+ }
23
+ }
24
+ }
25
+ }, txt)
26
+ }
27
+
28
+ export const btn = (h, txt, callback, danger) => {
29
+ return h('Button', {
30
+ props: {
31
+ type: danger ? 'error' : 'primary',
32
+ size: 'small',
33
+ ghost: true
34
+ },
35
+ on: {
36
+ click: () => {
37
+ callback()
38
+ }
39
+ }
40
+ }, txt)
41
+ }
42
+ /**
43
+ * @param {String} url
44
+ * @description 从URL中解析参数
45
+ */
46
+ export const getParams = url => {
47
+ const keyValueArr = url.split('?')[1].split('&')
48
+ let paramObj = {}
49
+ keyValueArr.forEach(item => {
50
+ const keyValue = item.split('=')
51
+ paramObj[keyValue[0]] = keyValue[1]
52
+ })
53
+ return paramObj
54
+ }
55
+
56
+
57
+ /**
58
+ * 按属性名称和value搜索列表内容
59
+ * @param arr
60
+ * @param attrName
61
+ * @param attrVal
62
+ * @returns {null|*}
63
+ */
64
+ export const searchInObjArray = (arr, attrName, attrVal) => {
65
+ if (arr && attrName && attrVal) {
66
+ for (let i = 0; i < arr.length; ++i) {
67
+ if (arr[i] && arr[i][attrName] && arr[i][attrName] === attrVal) {
68
+ return arr[i]
69
+ }
70
+ }
71
+ let rtn = {}
72
+ rtn[attrName] = attrVal
73
+ return rtn
74
+ }
75
+ return null
5
76
  }
6
77
 
7
78
  export const exportTableExcelBlob = (tableData, tableColumn, fileName) => {
package/src/main.js CHANGED
@@ -1,17 +1,10 @@
1
1
  import Vue from 'vue'
2
2
  import App from './App.vue'
3
3
  import iView from 'iview'
4
- import './index.less'
5
- import i18n from '@/locale'
6
- import ExtentionPlugin from './extentionPlugin'
7
- import importDirective from './directive'
8
- import PlusComp from './components/plus-comp'
9
-
10
4
  import Tool from './index'
11
5
 
12
6
 
13
7
 
14
-
15
8
  Vue.config.productionTip = false
16
9
 
17
10
  Tool.install(Vue)