vue2-client 1.7.0 → 1.7.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.
Files changed (128) hide show
  1. package/.env +15 -15
  2. package/CHANGELOG.md +661 -628
  3. package/Components.md +60 -0
  4. package/index.js +31 -30
  5. package/package.json +83 -81
  6. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
  7. package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
  8. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -667
  9. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +735 -733
  10. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +466 -468
  11. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +510 -508
  12. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +144 -146
  13. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
  14. package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
  15. package/src/base-client/components/common/Upload/Upload.vue +168 -168
  16. package/src/base-client/components/common/XAddForm/XAddForm.vue +72 -325
  17. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +369 -279
  18. package/src/base-client/components/common/XAddNativeForm/index.md +107 -17
  19. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  20. package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -0
  21. package/src/base-client/components/common/XDataDrawer/index.js +3 -0
  22. package/src/base-client/components/common/XDataDrawer/index.md +41 -0
  23. package/src/base-client/components/common/XForm/XForm.vue +178 -180
  24. package/src/base-client/components/common/XForm/XFormItem.vue +521 -513
  25. package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
  26. package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
  27. package/src/base-client/components/common/XFormTable/XFormTable.vue +356 -344
  28. package/src/base-client/components/common/XFormTable/index.md +97 -97
  29. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
  30. package/src/base-client/components/common/XTable/XTable.vue +519 -506
  31. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
  32. package/src/base-client/components/index.js +41 -0
  33. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
  34. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  35. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
  36. package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
  37. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
  38. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
  39. package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
  40. package/src/base-client/plugins/AppData.js +76 -76
  41. package/src/base-client/plugins/GetLoginInfoService.js +179 -179
  42. package/src/base-client/plugins/PagedList.js +177 -177
  43. package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
  44. package/src/base-client/plugins/i18n-extend.js +32 -32
  45. package/src/components/Ellipsis/Ellipsis.vue +65 -65
  46. package/src/components/Ellipsis/index.md +38 -38
  47. package/src/components/NumberInfo/index.md +43 -43
  48. package/src/components/STable/README.md +341 -341
  49. package/src/components/STable/index.js +318 -318
  50. package/src/components/Trend/index.md +45 -45
  51. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  52. package/src/components/checkbox/ImgCheckbox.vue +163 -163
  53. package/src/components/exception/ExceptionPage.vue +70 -70
  54. package/src/components/form/FormRow.vue +52 -52
  55. package/src/components/index.js +36 -36
  56. package/src/components/menu/SideMenu.vue +75 -62
  57. package/src/components/menu/menu.js +273 -273
  58. package/src/components/page/header/index.less +40 -40
  59. package/src/components/setting/Setting.vue +235 -235
  60. package/src/components/table/StandardTable.vue +141 -141
  61. package/src/components/table/advance/ActionColumns.vue +158 -158
  62. package/src/components/table/advance/SearchArea.vue +355 -355
  63. package/src/components/tool/AStepItem.vue +60 -60
  64. package/src/components/tool/AvatarList.vue +68 -68
  65. package/src/components/tool/Drawer.vue +142 -142
  66. package/src/components/tool/TagSelect.vue +83 -83
  67. package/src/components/transition/PageToggleTransition.vue +97 -97
  68. package/src/config/CreateQueryConfig.js +307 -307
  69. package/src/config/default/admin.config.js +18 -18
  70. package/src/config/default/setting.config.js +4 -2
  71. package/src/config/replacer/resolve.config.js +67 -67
  72. package/src/layouts/CommonLayout.vue +42 -42
  73. package/src/layouts/ComponentLayoutOne.vue +47 -47
  74. package/src/layouts/PageLayout.vue +151 -151
  75. package/src/layouts/SinglePageView.vue +116 -116
  76. package/src/layouts/footer/PageFooter.vue +49 -49
  77. package/src/layouts/header/AdminHeader.vue +134 -134
  78. package/src/layouts/header/HeaderAvatar.vue +64 -64
  79. package/src/layouts/header/HeaderNotice.vue +176 -176
  80. package/src/layouts/header/HeaderSearch.vue +67 -67
  81. package/src/layouts/header/InstitutionDetail.vue +181 -181
  82. package/src/layouts/header/index.less +92 -92
  83. package/src/layouts/tabs/TabsHead.vue +190 -190
  84. package/src/layouts/tabs/TabsView.vue +379 -379
  85. package/src/lib.js +1 -0
  86. package/src/mock/goods/index.js +108 -108
  87. package/src/pages/CreateQueryPage.vue +84 -84
  88. package/src/pages/login/Login.vue +369 -369
  89. package/src/pages/report/ReportTable.js +124 -124
  90. package/src/pages/report/ReportTableHome.vue +28 -28
  91. package/src/pages/resourceManage/orgListManage.vue +98 -98
  92. package/src/pages/system/dictionary/index.vue +43 -43
  93. package/src/pages/system/file/index.vue +317 -317
  94. package/src/pages/system/monitor/loginInfor/index.vue +36 -36
  95. package/src/pages/system/monitor/operLog/index.vue +36 -36
  96. package/src/pages/system/settings/index.vue +126 -126
  97. package/src/pages/system/settings/modifyPassword.vue +109 -109
  98. package/src/router/async/config.async.js +28 -28
  99. package/src/router/async/router.map.js +66 -66
  100. package/src/router/guards.js +52 -12
  101. package/src/router/index.js +27 -27
  102. package/src/services/api/DictionaryDetailsViewApi.js +6 -6
  103. package/src/services/api/LogDetailsViewApi.js +10 -10
  104. package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
  105. package/src/services/api/TicketDetailsViewApi.js +34 -34
  106. package/src/services/api/cas.js +79 -79
  107. package/src/services/api/common.js +137 -137
  108. package/src/services/api/commonTempTable.js +10 -10
  109. package/src/services/api/index.js +17 -17
  110. package/src/services/api/logininfor/index.js +6 -6
  111. package/src/services/api/manage.js +8 -8
  112. package/src/services/apiService.js +14 -14
  113. package/src/services/user.js +67 -67
  114. package/src/store/modules/index.js +4 -4
  115. package/src/theme/default/nprogress.less +76 -76
  116. package/src/theme/default/style.less +58 -58
  117. package/src/utils/EncryptUtil.js +53 -53
  118. package/src/utils/colors.js +107 -107
  119. package/src/utils/excel/Blob.js +180 -180
  120. package/src/utils/excel/Export2Excel.js +141 -141
  121. package/src/utils/formatter.js +68 -68
  122. package/src/utils/i18n.js +80 -80
  123. package/src/utils/login.js +138 -0
  124. package/src/utils/map-utils.js +37 -37
  125. package/src/utils/theme-color-replacer-extend.js +91 -91
  126. package/src/utils/themeUtil.js +100 -100
  127. package/src/utils/util.js +230 -230
  128. package/vue.config.js +106 -106
@@ -25,31 +25,121 @@ export default {
25
25
  ## 代码演示
26
26
 
27
27
  ```html
28
- <x-add-form
29
- :business-type="businessType"
30
- :json-data="formItems"
31
- :modify-model-data="modifyModelData"
32
- :loading="loading"
33
- @onSubmit="onSubmit">
34
- </x-add-form>
28
+ <x-add-native-form
29
+ ref="nativeForm"
30
+ @onSubmit="submit"/>
35
31
  ```
36
32
 
37
- ## API
33
+ ## 构造参数,通过init方法构造
38
34
 
39
- | 参数 | 说明 | 类型 | 默认值 |
40
- |-----------------|--------------------------|---------|-------|
41
- | businessType | 业务类型 | String | '' |
42
- | jsonData | JSON配置,根据[工具>查询配置生成]功能生成 | Object | {} |
43
- | modifyModelData | 修改操作前查询出的业务数据 | Object | {} |
44
- | loading | 新增或修改业务是否执行中 | Boolean | false |
45
- | fixedAddForm | 固定新增表单,会和新增表单合并 | Object | {} |
46
- | @onSubmit | 表单的提交事件 | event | - |
35
+ | 参数 | 说明 | 类型 | 默认值 |
36
+ |-----------------|----------------------|-------|--------|
37
+ | formItems | 表单项集合 | array | [] |
38
+ | viewMode | 是否为预览模式 | bool | false |
39
+ | isHandleFormKey | 是否对提交表单的key进行处理 | bool | true |
40
+ | serviceName | 所属服务模块名 | string | system |
41
+ | businessType | 业务类型(新增/修改) | string | - |
42
+ | title | 业务标题 | string | - |
43
+ | getDataParams | 调用logic获取下拉框数据源的追加参数 | {} | - |
44
+ | simpleFormJsonData | 动态简易表单集合 | {} | - |
45
+
46
+ ## 事件
47
+ | 事件 | 说明 | 类型 | 默认值 |
48
+ |-----------|----------------------|-------|-----------|
49
+ | @onSubmit | 表单的提交事件 | event | - |
47
50
 
48
51
  ## 例子1
49
52
  ----
50
- 参考XFormTable组件
53
+ ```vue
54
+ <template>
55
+ <x-add-native-form
56
+ ref="nativeForm"
57
+ @onSubmit="submit"/>
58
+ </template>
59
+ <script>
60
+ import { getConfigUrl } from '@vue2-client/services/api/common'
61
+ export default {
62
+ created () {
63
+ this.initComponents()
64
+ },
65
+ methods: {
66
+ initComponents() {
67
+ // 获取请求配置中心的地址
68
+ const url = getConfigUrl('yourConfigModuleName')
69
+ post(url, { configName: 'yourConfigName' }).then(res => {
70
+ if (this.$refs.nativeForm) {
71
+ this.$refs.nativeForm.init({
72
+ formItems: res,
73
+ serviceName: 'system',
74
+ businessType: '新增',
75
+ title: '新增告警记录'
76
+ })
77
+ }
78
+ })
79
+ },
80
+ submit (res) {
81
+ post(api.addData, res.realForm).then(data => {
82
+ this.$message.success(res.businessType + '成功!')
83
+ }).catch(e => {
84
+ this.$message.error(res.businessType + '失败:' + e)
85
+ })
86
+ }
87
+ }
88
+ }
89
+ </script>
90
+ ```
91
+
92
+ ## JSON配置示例
93
+ ----
94
+ `这是一个表单配置示例,通过以下配置,你会得到一个有选项的单选框,一个带校验的输入框,以及一个文本域`
95
+ ```json
96
+ [
97
+ {
98
+ "name": "是否通气",
99
+ "model": "is_ventilate",
100
+ "keys": [
101
+ { "label": "是", "value": "1" },
102
+ { "label": "否", "value": "0" }
103
+ ],
104
+ "type": "radio",
105
+ "addOrEdit": "all",
106
+ },
107
+ {
108
+ "name": "处理人",
109
+ "model": "f_processor",
110
+ "rule": {
111
+ "required": true
112
+ },
113
+ "type": "input",
114
+ "addOrEdit": "all",
115
+ },
116
+ {
117
+ "name": "处理内容",
118
+ "model": "f_handle_content",
119
+ "type": "textarea",
120
+ "addOrEdit": "all",
121
+ }
122
+ ]
51
123
  ```
52
124
 
125
+ ## JSON配置规范
126
+ ----
127
+ | 参数 | 说明 | 类型 | 默认值 |
128
+ |-----------------|----------------------|-------|-----------|
129
+ | name | 表单项名称 | string | '' |
130
+ | model | 表单项key | string | '' |
131
+ | rule | 表单校验 | json | {} |
132
+ | -> required | 是否必填 | bool | false |
133
+ | type | 表单类型 | string | input |
134
+ | keys | 当表单类型是select,radio时的选项值 | Array | [] |
135
+ | -> label | 选项的字面值 | string | '' |
136
+ | -> value | 选项的实际值 | string | '' |
137
+ | addOrEdit | 新增/修改场景 | string | all |
138
+ | -> add | 仅新增 | string | - |
139
+ | -> edit | 仅修改 | string | - |
140
+ | -> all | 全部支持 | string | - |
141
+
142
+
53
143
  注意事项
54
144
  ----
55
145
 
@@ -1,64 +1,64 @@
1
- <template>
2
- <div>
3
- <a-card :body-style="{ margin: 0, padding: 0 }" :bordered="false">
4
- <a-skeleton v-show="loadState === 'loading'" active style="padding: 16px"/>
5
- <a-empty v-show="loadState === 'empty'">
6
- <a-button type="dashed" @click="retry">
7
- 重新加载
8
- </a-button>
9
- </a-empty>
10
- <a-card
11
- v-show="loadState === 'error'"
12
- :body-style="{ margin: '0 auto' }"
13
- :bordered="false"
14
- :hoverable="true"
15
- class="retryCard"
16
- @click="retry" >
17
- <a-icon :style="{ fontSize: '28px' }" type="global"/>
18
- <p class="noSelect" style="margin-top: 20px">网络好像开小差了,点击重新加载...</p>
19
- </a-card>
20
- <div v-show="loadState === 'success'">
21
- <slot></slot>
22
- </div>
23
- </a-card>
24
- </div>
25
- </template>
26
-
27
- <script>
28
-
29
- export default {
30
- name: 'XCard',
31
- props: {
32
- loadState: {
33
- type: String,
34
- default: 'success'
35
- },
36
- retry: {
37
- type: Function,
38
- default: () => {
39
- console.error('未实现重新加载')
40
- }
41
- }
42
- },
43
- data () {
44
- return {
45
-
46
- }
47
- }
48
- }
49
- </script>
50
-
51
- <style lang="less" scoped>
52
- .retryCard {
53
- text-align: center;
54
- }
55
- .noSelect {
56
- -webkit-touch-callout: none; /* iOS Safari */
57
- -webkit-user-select: none; /* Chrome/Safari/Opera */
58
- -khtml-user-select: none; /* Konqueror */
59
- -moz-user-select: none; /* Firefox */
60
- -ms-user-select: none; /* Internet Explorer/Edge */
61
- user-select: none; /* Non-prefixed version, currently
62
- not supported by any browser */
63
- }
64
- </style>
1
+ <template>
2
+ <div>
3
+ <a-card :body-style="{ margin: 0, padding: 0 }" :bordered="false">
4
+ <a-skeleton v-show="loadState === 'loading'" active style="padding: 16px"/>
5
+ <a-empty v-show="loadState === 'empty'">
6
+ <a-button type="dashed" @click="retry">
7
+ 重新加载
8
+ </a-button>
9
+ </a-empty>
10
+ <a-card
11
+ v-show="loadState === 'error'"
12
+ :body-style="{ margin: '0 auto' }"
13
+ :bordered="false"
14
+ :hoverable="true"
15
+ class="retryCard"
16
+ @click="retry" >
17
+ <a-icon :style="{ fontSize: '28px' }" type="global"/>
18
+ <p class="noSelect" style="margin-top: 20px">网络好像开小差了,点击重新加载...</p>
19
+ </a-card>
20
+ <div v-show="loadState === 'success'">
21
+ <slot></slot>
22
+ </div>
23
+ </a-card>
24
+ </div>
25
+ </template>
26
+
27
+ <script>
28
+
29
+ export default {
30
+ name: 'XCard',
31
+ props: {
32
+ loadState: {
33
+ type: String,
34
+ default: 'success'
35
+ },
36
+ retry: {
37
+ type: Function,
38
+ default: () => {
39
+ console.error('未实现重新加载')
40
+ }
41
+ }
42
+ },
43
+ data () {
44
+ return {
45
+
46
+ }
47
+ }
48
+ }
49
+ </script>
50
+
51
+ <style lang="less" scoped>
52
+ .retryCard {
53
+ text-align: center;
54
+ }
55
+ .noSelect {
56
+ -webkit-touch-callout: none; /* iOS Safari */
57
+ -webkit-user-select: none; /* Chrome/Safari/Opera */
58
+ -khtml-user-select: none; /* Konqueror */
59
+ -moz-user-select: none; /* Firefox */
60
+ -ms-user-select: none; /* Internet Explorer/Edge */
61
+ user-select: none; /* Non-prefixed version, currently
62
+ not supported by any browser */
63
+ }
64
+ </style>
@@ -0,0 +1,180 @@
1
+ <template>
2
+ <a-drawer
3
+ :visible="visible"
4
+ :width="isMobile ? screenWidth : screenWidth * 0.85"
5
+ placement="right"
6
+ :title="title"
7
+ @close="onClose"
8
+ >
9
+ <a-spin :spinning="loading">
10
+ <a-page-header :title="getPageHeaderTitle">
11
+ <div class="row">
12
+ <div class="content">
13
+ <slot name="contentDescriptions" :datas="details"></slot>
14
+ </div>
15
+ <div class="extra">
16
+ <a-row class="status-list" v-for="(item,index) in extraStatusList" :key="'extraStatus' + index">
17
+ <a-col :sm="24" :xs="12">
18
+ <div class="text">{{ item.text }}</div>
19
+ <div class="heading">
20
+ <x-badge :is-external-text="true" :value="item.key" :badge-key="item.keyMap ? item.keyMap : 'none'"/>
21
+ </div>
22
+ </a-col>
23
+ </a-row>
24
+ </div>
25
+ </div>
26
+ <!-- actions -->
27
+ <template v-slot:extra>
28
+ <a-button-group style="margin-right: 4px;">
29
+ <a-button :loading="loading" type="dashed" @click="initView('1')">刷新</a-button>
30
+ </a-button-group>
31
+ <a-button-group style="margin-right: 4px;">
32
+ <slot name="extraActions" :datas="details"></slot>
33
+ </a-button-group>
34
+ </template>
35
+ <template v-slot:footer>
36
+ <slot name="footerContent" :datas="details"></slot>
37
+ </template>
38
+ </a-page-header>
39
+ </a-spin>
40
+ </a-drawer>
41
+ </template>
42
+
43
+ <script>
44
+ import { mapState } from 'vuex'
45
+ import XBadge from '@vue2-client/base-client/components/common/XBadge/XBadge'
46
+
47
+ export default {
48
+ name: 'InstructDetailsView',
49
+ components: {
50
+ XBadge
51
+ },
52
+ data () {
53
+ return {
54
+ // 页面宽度
55
+ screenWidth: document.documentElement.clientWidth,
56
+ // Tab页签
57
+ tabActiveKey: '1',
58
+ // 数据详情
59
+ details: {},
60
+ // 加载状态
61
+ loading: true
62
+ }
63
+ },
64
+ mounted () {
65
+ this.initView('1')
66
+ },
67
+ computed: {
68
+ ...mapState('account', { currUser: 'user' }),
69
+ ...mapState('setting', ['isMobile'])
70
+ },
71
+ props: {
72
+ title: {
73
+ type: String,
74
+ required: true
75
+ },
76
+ extraStatusList: {
77
+ type: Array,
78
+ default: () => {
79
+ return []
80
+ }
81
+ },
82
+ visible: {
83
+ type: Boolean,
84
+ default: false
85
+ }
86
+ },
87
+ methods: {
88
+ // 初始化组件
89
+ initView (tabActiveKey) {
90
+ this.tabActiveKey = tabActiveKey || '1'
91
+ this.getDatas()
92
+ },
93
+ // 获取详情信息
94
+ getDatas () {
95
+ this.loading = true
96
+ this.$emit('load').then(res => {
97
+ this.details = res
98
+ }, err => {
99
+ console.error(err)
100
+ }).finally(() => {
101
+ this.loading = false
102
+ })
103
+ },
104
+ // 获取页头标题
105
+ getPageHeaderTitle () {
106
+ this.$emit('getPageHeaderTitle', this.details)
107
+ },
108
+ // 关闭抽屉时回调
109
+ onClose () {
110
+ this.$emit('update:visible', false)
111
+ }
112
+ },
113
+ watch: {
114
+ 'visible' (val) {
115
+ if (val) {
116
+ this.initView('1')
117
+ }
118
+ }
119
+ }
120
+ }
121
+ </script>
122
+
123
+ <style lang="less" scoped>
124
+ .detail-layout {
125
+ margin-left: 44px;
126
+ }
127
+ .text {
128
+ color: rgba(0, 0, 0, .45);
129
+ }
130
+
131
+ .heading {
132
+ color: rgba(0, 0, 0, .85);
133
+ font-size: 20px;
134
+ }
135
+
136
+ .no-data {
137
+ color: rgba(0, 0, 0, .25);
138
+ text-align: center;
139
+ line-height: 64px;
140
+ font-size: 16px;
141
+
142
+ i {
143
+ font-size: 24px;
144
+ margin-right: 16px;
145
+ position: relative;
146
+ top: 3px;
147
+ }
148
+ }
149
+
150
+ .mobile {
151
+ .detail-layout {
152
+ margin-left: unset;
153
+ }
154
+ .text {
155
+
156
+ }
157
+ .status-list {
158
+ text-align: left;
159
+ }
160
+ }
161
+
162
+ .row {
163
+ display: flex;
164
+
165
+ .content {
166
+ -webkit-box-flex: 1;
167
+ flex: auto;
168
+ -ms-flex: auto;
169
+ }
170
+
171
+ .extra {
172
+ flex: 0 1 auto;
173
+ -webkit-box-flex: 0;
174
+ -ms-flex: 0 1 auto;
175
+ min-width: 242px;
176
+ margin-left: 88px;
177
+ text-align: right;
178
+ }
179
+ }
180
+ </style>
@@ -0,0 +1,3 @@
1
+ import XDataDrawer from './XDataDrawer'
2
+
3
+ export default XDataDrawer
@@ -0,0 +1,41 @@
1
+ # XForm
2
+
3
+ 通用数据抽屉控件,快速制作数据详情抽屉
4
+
5
+
6
+ ## 何时使用
7
+
8
+ 当需要一个通用数据抽屉时
9
+
10
+
11
+ 引用方式:
12
+
13
+ ```javascript
14
+ import XDataDrawer from '@vue2-client/base-client/components/XDataDrawer/XDataDrawer'
15
+
16
+ export default {
17
+ components: {
18
+ XDataDrawer
19
+ }
20
+ }
21
+ ```
22
+
23
+
24
+
25
+ ## 代码演示
26
+
27
+ ```html
28
+ <x-data-drawer
29
+ :isExports="true"
30
+ @onSubmit="onSubmit">
31
+ </x-data-drawer>
32
+ ```
33
+
34
+ ## API
35
+
36
+ | 参数 | 说明 | 类型 | 默认值 |
37
+ |-----------|--------------------------|---------|------|
38
+ | jsonData | JSON配置,根据[工具>查询配置生成]功能生成 | Object | {} |
39
+ | isExports | 是否显示导出按钮 | Boolean | true |
40
+ | getDataParams | 调用logic获取数据源的追加参数 | Object | - |
41
+ | @onSubmit | 表单的提交事件 | event | - |