vue2-client 1.12.101 → 1.12.103

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.
@@ -43,6 +43,12 @@ export default {
43
43
  queryParamsName: {
44
44
  type: String,
45
45
  default: 'DescriptionsExampleConfig'
46
+ },
47
+ parameter: {
48
+ type: Object,
49
+ default: () => {
50
+ return {}
51
+ }
46
52
  }
47
53
  },
48
54
  created () {
@@ -54,7 +60,8 @@ export default {
54
60
  getConfigByName(data, 'af-his', res => {
55
61
  this.configurationParameters = res
56
62
  console.log(this.configurationParameters)
57
- runLogic(res.logicName, res.parameter, 'af-his').then(result => {
63
+ const parameter = { ...res.parameter, ...this.parameter }
64
+ runLogic(res.logicName, parameter, 'af-his').then(result => {
58
65
  this.data = result
59
66
  })
60
67
  })
@@ -1,131 +1,131 @@
1
- <template>
2
- <div class="list-wrapper">
3
- <a-list size="large" :data-source="data" itemLayout="horizontal" class="list-container" ref="listRef">
4
- <a-list-item slot="renderItem" slot-scope="item, index" class="list-item" @click="handleClick(index)">
5
- <i
6
- v-if="icon"
7
- class="icon-menu"
8
- :style="getIconStyle(item)"
9
- ></i>
10
- <span
11
- class="item-text">
12
- {{ item.number }} {{ item.name }}
13
- </span>
14
- <a-button v-if="button" type="link" class="confirm-btn" @click.stop="click(index)">{{ buttonName }}</a-button>
15
- </a-list-item>
16
- </a-list>
17
- </div>
18
- </template>
19
-
20
- <script>
21
-
22
- import { runLogic } from '@vue2-client/services/api/common'
23
-
24
- export default {
25
- name: 'XList',
26
- props: {
27
- queryParamsName: {
28
- type: Object,
29
- default: null
30
- }
31
- },
32
- inject: ['getComponentByName'],
33
- data () {
34
- return {
35
- data: [],
36
- button: false,
37
- icon: false,
38
- buttonName: ''
39
- }
40
- },
41
- created () {
42
- this.getData(this.queryParamsName)
43
- },
44
- methods: {
45
- async getData (config) {
46
- runLogic(config, {}, 'af-his').then(res => {
47
- this.button = res.button
48
- this.icon = res.icon
49
- this.buttonName = res.buttonName
50
- this.data = res.data
51
- })
52
- },
53
- handleClick (index) {
54
- this.$emit('listClick', this.data[index])
55
- },
56
- refreshList () {
57
- this.getData(this.queryParamsName)
58
- },
59
- click (index) {
60
- this.$emit('click', this.data[index])
61
- },
62
- getIconStyle (item) {
63
- return item.picture
64
- ? { backgroundImage: `url(${item.picture})` }
65
- : {}
66
- },
67
- filterData (par) {
68
- runLogic(this.queryParamsName, par, 'af-his').then(res => {
69
- this.data = res.data
70
- })
71
- }
72
- }
73
- }
74
- </script>
75
-
76
- <style scoped>
77
- .list-wrapper {
78
- max-height: 240px;
79
- overflow-y: auto;
80
- padding-right: 2px;
81
- }
82
-
83
- .list-container {
84
- width: 100%;
85
- }
86
-
87
- .list-item {
88
- height: 35px;
89
- border-radius: 6px;
90
- background-color: #F4F4F4;
91
- padding: 8px 15px;
92
- font-size: 16px;
93
- display: flex;
94
- align-items: center;
95
- width: 100%;
96
- border: 1px solid #D9D9D9;
97
- box-sizing: border-box;
98
- margin-bottom: 8px !important;
99
- }
100
-
101
- .icon-menu {
102
- display: inline-block;
103
- width: 20px;
104
- height: 20px;
105
- background-color: #ccc;
106
- margin-right: 8px;
107
- }
108
-
109
- .item-text {
110
- flex: 1;
111
- }
112
-
113
- .confirm-btn {
114
- margin-left: auto;
115
- padding: 0 8px;
116
- }
117
-
118
- /* 自定义滚动条样式 */
119
- .list-wrapper::-webkit-scrollbar {
120
- width: 6px;
121
- }
122
-
123
- .list-wrapper::-webkit-scrollbar-thumb {
124
- background-color: #d9d9d9;
125
- border-radius: 3px;
126
- }
127
-
128
- .list-wrapper::-webkit-scrollbar-track {
129
- background-color: #f0f0f0;
130
- }
131
- </style>
1
+ <template>
2
+ <div class="list-wrapper">
3
+ <a-list size="large" :data-source="data" itemLayout="horizontal" class="list-container" ref="listRef">
4
+ <a-list-item slot="renderItem" slot-scope="item, index" class="list-item" @click="handleClick(index)">
5
+ <i
6
+ v-if="icon"
7
+ class="icon-menu"
8
+ :style="getIconStyle(item)"
9
+ ></i>
10
+ <span
11
+ class="item-text">
12
+ {{ item.number }} {{ item.name }}
13
+ </span>
14
+ <a-button v-if="button" type="link" class="confirm-btn" @click.stop="click(index)">{{ buttonName }}</a-button>
15
+ </a-list-item>
16
+ </a-list>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+
22
+ import { runLogic } from '@vue2-client/services/api/common'
23
+
24
+ export default {
25
+ name: 'XList',
26
+ props: {
27
+ queryParamsName: {
28
+ type: Object,
29
+ default: null
30
+ }
31
+ },
32
+ inject: ['getComponentByName'],
33
+ data () {
34
+ return {
35
+ data: [],
36
+ button: false,
37
+ icon: false,
38
+ buttonName: ''
39
+ }
40
+ },
41
+ created () {
42
+ this.getData(this.queryParamsName)
43
+ },
44
+ methods: {
45
+ async getData (config) {
46
+ runLogic(config, {}, 'af-his').then(res => {
47
+ this.button = res.button
48
+ this.icon = res.icon
49
+ this.buttonName = res.buttonName
50
+ this.data = res.data
51
+ })
52
+ },
53
+ handleClick (index) {
54
+ this.$emit('listClick', this.data[index])
55
+ },
56
+ refreshList () {
57
+ this.getData(this.queryParamsName)
58
+ },
59
+ click (index) {
60
+ this.$emit('click', this.data[index])
61
+ },
62
+ getIconStyle (item) {
63
+ return item.picture
64
+ ? { backgroundImage: `url(${item.picture})` }
65
+ : {}
66
+ },
67
+ filterData (par) {
68
+ runLogic(this.queryParamsName, par, 'af-his').then(res => {
69
+ this.data = res.data
70
+ })
71
+ }
72
+ }
73
+ }
74
+ </script>
75
+
76
+ <style scoped>
77
+ .list-wrapper {
78
+ max-height: 240px;
79
+ overflow-y: auto;
80
+ padding-right: 2px;
81
+ }
82
+
83
+ .list-container {
84
+ width: 100%;
85
+ }
86
+
87
+ .list-item {
88
+ height: 35px;
89
+ border-radius: 6px;
90
+ background-color: #F4F4F4;
91
+ padding: 8px 15px;
92
+ font-size: 16px;
93
+ display: flex;
94
+ align-items: center;
95
+ width: 100%;
96
+ border: 1px solid #D9D9D9;
97
+ box-sizing: border-box;
98
+ margin-bottom: 8px !important;
99
+ }
100
+
101
+ .icon-menu {
102
+ display: inline-block;
103
+ width: 20px;
104
+ height: 20px;
105
+ background-color: #ccc;
106
+ margin-right: 8px;
107
+ }
108
+
109
+ .item-text {
110
+ flex: 1;
111
+ }
112
+
113
+ .confirm-btn {
114
+ margin-left: auto;
115
+ padding: 0 8px;
116
+ }
117
+
118
+ /* 自定义滚动条样式 */
119
+ .list-wrapper::-webkit-scrollbar {
120
+ width: 6px;
121
+ }
122
+
123
+ .list-wrapper::-webkit-scrollbar-thumb {
124
+ background-color: #d9d9d9;
125
+ border-radius: 3px;
126
+ }
127
+
128
+ .list-wrapper::-webkit-scrollbar-track {
129
+ background-color: #f0f0f0;
130
+ }
131
+ </style>
@@ -127,14 +127,14 @@ export default {
127
127
  currentCol = currentCol.parentNode
128
128
  }
129
129
  if (currentCol) {
130
- // 更新当前列的宽度
130
+ // 更新当前列的宽度
131
131
  const drawerWidth = isOpen ? 33.3 : 2
132
132
  // 强制更新样式
133
133
  currentCol.style.cssText = `
134
134
  flex: 0 0 ${drawerWidth}% !important;
135
135
  max-width: ${drawerWidth}% !important;
136
136
  transition: all 0.3s;`
137
- // 触发XTab组件重新计算宽度
137
+ // 触发XTab组件重新计算宽度
138
138
  this.$nextTick(() => {
139
139
  const tabComponent = this.$el.querySelector('.ant-tabs')
140
140
  if (tabComponent) {
@@ -142,7 +142,7 @@ export default {
142
142
  window.dispatchEvent(new Event('resize'))
143
143
  }
144
144
  })
145
- // 更新其他列宽度
145
+ // 更新其他列宽度
146
146
  otherCols.forEach((col, index) => {
147
147
  if (index < this.mainWithData.length) {
148
148
  const widthValue = isOpen ? this.mainWithData[index].min : this.mainWithData[index].max
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div class="x-title">{{ title }}</div>
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: 'XTitle',
8
+ props: {
9
+ queryParamsName: {
10
+ type: String,
11
+ default: null
12
+ }
13
+ },
14
+ data () {
15
+ return {
16
+ title: ''
17
+ }
18
+ },
19
+ created () {
20
+ this.getData(this.queryParamsName)
21
+ },
22
+ methods: {
23
+ getData (data) {
24
+ this.title = data
25
+ }
26
+ }
27
+ }
28
+ </script>
29
+ <style scoped>
30
+ .x-title {
31
+ font-size: 18px;
32
+ font-weight: bold;
33
+ height: 26px;
34
+ width: 100%;
35
+ text-align: left;
36
+ font-family: "Source Han Sans", sans-serif;
37
+ color: #5D5C5C;
38
+ }
39
+ </style>
@@ -1,126 +1,126 @@
1
- import { manageApi, post } from '@vue2-client/services/api'
2
- import { handleTree } from '@vue2-client/utils/util'
3
- import { indexedDB } from '@vue2-client/utils/indexedDB'
4
- import { getConfigByName } from '@vue2-client/services/api/common'
5
-
6
- const GetAppDataService = {
7
- install (Vue) {
8
- // 给vue增添对话框显示方法
9
- Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
10
- },
11
- async load () {
12
- const params = {}
13
- await post(manageApi.getDictionaryValue, {}).then((res) => {
14
- Object.assign(params, res)
15
- const badgeItemArray = {}
16
- for (const key of Object.keys(params)) {
17
- badgeItemArray[key] = {}
18
- for (const item of params[key]) {
19
- let status
20
- if (!item.status) {
21
- status = 'none'
22
- } else {
23
- status = item.status
24
- }
25
- badgeItemArray[key][item.value] = {
26
- status: status,
27
- text: item.text
28
- }
29
- }
30
- }
31
- // 追加参数
32
- localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
33
- localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
34
- })
35
- },
36
- // 返回树形省市区
37
- async getDivisionsOhChinaForTree () {
38
- // 获取省市区数据
39
- return new Promise((resolve, reject) => {
40
- try {
41
- indexedDB.getByWeb('divisionsOhChina', manageApi.getDivisionsOhChina, {}, res => {
42
- resolve(res)
43
- }, processRes => {
44
- return handleTree(processRes, 'code', 'parentcode')
45
- })
46
- } catch (e) {
47
- reject(e)
48
- }
49
- })
50
- },
51
- // 旧版获取配置中心字典
52
- getDictionaryList (key) {
53
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
54
- const object = JSON.parse(str)
55
- return object[key]
56
- },
57
- async getDictValue (dictKey, value, func, isDev = false, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
58
- const processResult = (result) => {
59
- if (!result.value) {
60
- return {
61
- status: 'none',
62
- text: value
63
- }
64
- }
65
- const item = result.value.find(item => item.value == value)
66
- if (item) {
67
- return {
68
- status: item.status || 'none',
69
- text: item.label
70
- }
71
- }
72
- return {
73
- status: 'none',
74
- text: value
75
- }
76
- }
77
- if (func) {
78
- getConfigByName(dictKey, serviceName, result => {
79
- func(processResult(result))
80
- }, isDev)
81
- } else {
82
- const result = await new Promise((resolve) => {
83
- getConfigByName(dictKey, serviceName, resolve, isDev)
84
- })
85
- return processResult(result)
86
- }
87
- },
88
- // 新版获取配置中心字典推荐使用 服务名默认为当前服务
89
- getDictByKey (dictKey, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
90
- getConfigByName(dictKey, undefined, result => {
91
- callback(result.value)
92
- }, isDev)
93
- },
94
- getParam (key, value, callback) {
95
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
96
- const object = JSON.parse(str)
97
- if (object && object[key]) {
98
- const result = object[key]
99
- if (Object.prototype.hasOwnProperty.call(result, value)) {
100
- return result[value]
101
- } else {
102
- return { status: 'none', text: value }
103
- }
104
- }
105
- return null
106
- },
107
- getParams () {
108
- const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
109
- return JSON.parse(str)
110
- },
111
- getSingleValues () {
112
- const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
113
- return JSON.parse(str)
114
- },
115
- getWebConfigByKey (key) {
116
- const str = localStorage.getItem(process.env.VUE_APP_WEB_CONFIG_KEY)
117
- const object = JSON.parse(str)
118
- return object[key]
119
- },
120
- getStylesByKey (key) {
121
- const str = localStorage.getItem(process.env.VUE_APP_WEB_STYLES_KEY)
122
- const object = JSON.parse(str)
123
- return object[key]
124
- },
125
- }
126
- export default GetAppDataService
1
+ import { manageApi, post } from '@vue2-client/services/api'
2
+ import { handleTree } from '@vue2-client/utils/util'
3
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
4
+ import { getConfigByName } from '@vue2-client/services/api/common'
5
+
6
+ const GetAppDataService = {
7
+ install (Vue) {
8
+ // 给vue增添对话框显示方法
9
+ Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
10
+ },
11
+ async load () {
12
+ const params = {}
13
+ await post(manageApi.getDictionaryValue, {}).then((res) => {
14
+ Object.assign(params, res)
15
+ const badgeItemArray = {}
16
+ for (const key of Object.keys(params)) {
17
+ badgeItemArray[key] = {}
18
+ for (const item of params[key]) {
19
+ let status
20
+ if (!item.status) {
21
+ status = 'none'
22
+ } else {
23
+ status = item.status
24
+ }
25
+ badgeItemArray[key][item.value] = {
26
+ status: status,
27
+ text: item.text
28
+ }
29
+ }
30
+ }
31
+ // 追加参数
32
+ localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
33
+ localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
34
+ })
35
+ },
36
+ // 返回树形省市区
37
+ async getDivisionsOhChinaForTree () {
38
+ // 获取省市区数据
39
+ return new Promise((resolve, reject) => {
40
+ try {
41
+ indexedDB.getByWeb('divisionsOhChina', manageApi.getDivisionsOhChina, {}, res => {
42
+ resolve(res)
43
+ }, processRes => {
44
+ return handleTree(processRes, 'code', 'parentcode')
45
+ })
46
+ } catch (e) {
47
+ reject(e)
48
+ }
49
+ })
50
+ },
51
+ // 旧版获取配置中心字典
52
+ getDictionaryList (key) {
53
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
54
+ const object = JSON.parse(str)
55
+ return object[key]
56
+ },
57
+ async getDictValue (dictKey, value, func, isDev = false, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
58
+ const processResult = (result) => {
59
+ if (!result.value) {
60
+ return {
61
+ status: 'none',
62
+ text: value
63
+ }
64
+ }
65
+ const item = result.value.find(item => item.value == value)
66
+ if (item) {
67
+ return {
68
+ status: item.status || 'none',
69
+ text: item.label
70
+ }
71
+ }
72
+ return {
73
+ status: 'none',
74
+ text: value
75
+ }
76
+ }
77
+ if (func) {
78
+ getConfigByName(dictKey, serviceName, result => {
79
+ func(processResult(result))
80
+ }, isDev)
81
+ } else {
82
+ const result = await new Promise((resolve) => {
83
+ getConfigByName(dictKey, serviceName, resolve, isDev)
84
+ })
85
+ return processResult(result)
86
+ }
87
+ },
88
+ // 新版获取配置中心字典推荐使用 服务名默认为当前服务
89
+ getDictByKey (dictKey, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
90
+ getConfigByName(dictKey, undefined, result => {
91
+ callback(result.value)
92
+ }, isDev)
93
+ },
94
+ getParam (key, value, callback) {
95
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
96
+ const object = JSON.parse(str)
97
+ if (object && object[key]) {
98
+ const result = object[key]
99
+ if (Object.prototype.hasOwnProperty.call(result, value)) {
100
+ return result[value]
101
+ } else {
102
+ return { status: 'none', text: value }
103
+ }
104
+ }
105
+ return null
106
+ },
107
+ getParams () {
108
+ const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
109
+ return JSON.parse(str)
110
+ },
111
+ getSingleValues () {
112
+ const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
113
+ return JSON.parse(str)
114
+ },
115
+ getWebConfigByKey (key) {
116
+ const str = localStorage.getItem(process.env.VUE_APP_WEB_CONFIG_KEY)
117
+ const object = JSON.parse(str)
118
+ return object[key]
119
+ },
120
+ getStylesByKey (key) {
121
+ const str = localStorage.getItem(process.env.VUE_APP_WEB_STYLES_KEY)
122
+ const object = JSON.parse(str)
123
+ return object[key]
124
+ },
125
+ }
126
+ export default GetAppDataService