centaline-data-driven 1.1.55 → 1.1.59

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 (202) hide show
  1. package/.babelrc +12 -12
  2. package/.editorconfig +9 -9
  3. package/.gitattributes +63 -63
  4. package/.postcssrc.js +10 -10
  5. package/.vs/Centaline.Front_End.DataDriven/DesignTimeBuild/.dtbcache +0 -0
  6. package/.vs/Centaline.Front_End.DataDriven/v16/Server/sqlite3/db.lock +0 -0
  7. package/.vs/Centaline.Front_End.DataDriven/v16/Server/sqlite3/storage.ide +0 -0
  8. package/Centaline.Front_End.DataDriven.csproj +37 -37
  9. package/Centaline.Front_End.DataDriven.sln +25 -25
  10. package/Properties/launchSettings.json +26 -26
  11. package/README.md +140 -140
  12. package/build/build.js +41 -41
  13. package/build/centaline/centaline.path.js +59 -59
  14. package/build/centaline/webpack.centaline.conf.js +106 -106
  15. package/build/check-versions.js +54 -54
  16. package/build/utils.js +102 -102
  17. package/build/vue-loader.conf.js +22 -22
  18. package/build/webpack.base.conf.js +82 -82
  19. package/build/webpack.dev.conf.js +111 -111
  20. package/build/webpack.prod.conf.js +145 -145
  21. package/config/dev.env.js +12 -12
  22. package/config/index.js +73 -73
  23. package/config/prod.env.js +4 -4
  24. package/index.html +14 -14
  25. package/obj/Centaline.Front_End.DataDriven.csproj.nuget.dgspec.json +73 -0
  26. package/obj/Centaline.Front_End.DataDriven.csproj.nuget.g.props +29 -0
  27. package/obj/Centaline.Front_End.DataDriven.csproj.nuget.g.targets +15 -0
  28. package/obj/Debug/netcoreapp2.1/Centaline.Front_End.DataDriven.AssemblyInfo.cs +23 -0
  29. package/obj/Debug/netcoreapp2.1/Centaline.Front_End.DataDriven.RazorAssemblyInfo.cs +20 -0
  30. package/obj/project.assets.json +11907 -0
  31. package/package.json +75 -75
  32. package/src/App.vue +10 -10
  33. package/src/Detail.vue +29 -26
  34. package/src/Edit.vue +32 -32
  35. package/src/Form.vue +45 -29
  36. package/src/SearchList.vue +41 -40
  37. package/src/SearchTree.vue +51 -51
  38. package/src/Tabs.vue +19 -19
  39. package/src/centaline/api/index.js +249 -249
  40. package/src/centaline/comfirm/index.js +11 -11
  41. package/src/centaline/comfirm/src/comfirm.vue +44 -44
  42. package/src/centaline/common/index.js +738 -738
  43. package/src/centaline/css/common.css +752 -748
  44. package/src/centaline/css/max.css +208 -208
  45. package/src/centaline/dialogList/index.js +11 -11
  46. package/src/centaline/dialogList/src/dialog.vue +210 -210
  47. package/src/centaline/dialogList/src/dialogList.vue +65 -65
  48. package/src/centaline/dialogList/src/dialogNew.vue +78 -78
  49. package/src/centaline/dialogList/src/drag.js +77 -77
  50. package/src/centaline/directives/index.js +23 -23
  51. package/src/centaline/dynamicBtn/index.js +11 -11
  52. package/src/centaline/dynamicBtn/src/dynamicBtn.vue +100 -100
  53. package/src/centaline/dynamicCb/index.js +11 -11
  54. package/src/centaline/dynamicCb/src/dynamicCb.vue +72 -72
  55. package/src/centaline/dynamicCheckbox/index.js +11 -11
  56. package/src/centaline/dynamicCheckbox/src/dynamicCheckbox.vue +128 -128
  57. package/src/centaline/dynamicComboBoxWithTextBox/index.js +11 -11
  58. package/src/centaline/dynamicComboBoxWithTextBox/src/dynamicComboBoxWithTextBox.vue +240 -240
  59. package/src/centaline/dynamicD/index.js +11 -11
  60. package/src/centaline/dynamicD/src/dynamicD.vue +92 -92
  61. package/src/centaline/dynamicDetail/index.js +10 -10
  62. package/src/centaline/dynamicDetail/src/dynamicDetail.vue +40 -40
  63. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailOFI.vue +1280 -1280
  64. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +1346 -1293
  65. package/src/centaline/dynamicDrop/index.js +11 -11
  66. package/src/centaline/dynamicDrop/src/dynamicDrop.vue +54 -54
  67. package/src/centaline/dynamicDtd/index.js +11 -11
  68. package/src/centaline/dynamicDtd/src/dynamicDtd.vue +125 -125
  69. package/src/centaline/dynamicDtd/src/dynamicDtdOld.vue +93 -93
  70. package/src/centaline/dynamicFile/index.js +11 -11
  71. package/src/centaline/dynamicFile/src/dynamicFile.vue +289 -288
  72. package/src/centaline/dynamicForm/index.js +24 -24
  73. package/src/centaline/dynamicForm/src/dynamicForm.vue +564 -564
  74. package/src/centaline/dynamicForm/src/dynamicFormList.vue +209 -209
  75. package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +376 -376
  76. package/src/centaline/dynamicGp/index.js +11 -11
  77. package/src/centaline/dynamicGp/src/dynamicGp.vue +27 -27
  78. package/src/centaline/dynamicHyperLink/index.js +10 -10
  79. package/src/centaline/dynamicHyperLink/src/dynamicHyperLink.vue +54 -54
  80. package/src/centaline/dynamicInput/index.js +35 -35
  81. package/src/centaline/dynamicInput/src/dynamicInput.vue +35 -35
  82. package/src/centaline/dynamicInputNumber/index.js +11 -11
  83. package/src/centaline/dynamicInputNumber/src/dynamicInputNumber.vue +157 -157
  84. package/src/centaline/dynamicIti/index.js +11 -11
  85. package/src/centaline/dynamicIti/src/dynamicIti.vue +148 -148
  86. package/src/centaline/dynamicL/index.js +11 -11
  87. package/src/centaline/dynamicL/src/dynamicL.vue +37 -37
  88. package/src/centaline/dynamicLabel/index.js +11 -11
  89. package/src/centaline/dynamicLabel/src/dynamicLabel.vue +73 -73
  90. package/src/centaline/dynamicLs/index.js +22 -22
  91. package/src/centaline/dynamicLs/src/dynamicLs.vue +233 -233
  92. package/src/centaline/dynamicMo/index.js +13 -13
  93. package/src/centaline/dynamicMo/src/dynamicMo.vue +421 -421
  94. package/src/centaline/dynamicMt/index.js +11 -11
  95. package/src/centaline/dynamicMt/src/dynamicMt.vue +44 -44
  96. package/src/centaline/dynamicPlaceHolder/index.js +10 -10
  97. package/src/centaline/dynamicPlaceHolder/src/dynamicPlaceHolder.vue +29 -29
  98. package/src/centaline/dynamicPopupSearchList/index.js +11 -11
  99. package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchList.vue +157 -157
  100. package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchListTable.vue +239 -239
  101. package/src/centaline/dynamicRichText/index.js +11 -11
  102. package/src/centaline/dynamicRichText/src/dynamicRichText.vue +33 -33
  103. package/src/centaline/dynamicSearchList/index.js +11 -11
  104. package/src/centaline/dynamicSearchList/src/dynamicSearchCategory.vue +121 -121
  105. package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +135 -135
  106. package/src/centaline/dynamicSearchList/src/dynamicSearchScreen.vue +206 -206
  107. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +1082 -1069
  108. package/src/centaline/dynamicSearchList/src/dynamicTableStatistics.vue +30 -30
  109. package/src/centaline/dynamicSearchList/src/dynamicTableTip.vue +46 -46
  110. package/src/centaline/dynamicSearchList/src/dynamicTableToolbar.vue +61 -61
  111. package/src/centaline/dynamicSeg/index.js +11 -11
  112. package/src/centaline/dynamicSeg/src/dynamicSeg.vue +100 -100
  113. package/src/centaline/dynamicSensitiveEye/index.js +11 -11
  114. package/src/centaline/dynamicSensitiveEye/src/dynamicSensitiveEye.vue +74 -74
  115. package/src/centaline/dynamicSo/index.js +14 -14
  116. package/src/centaline/dynamicSo/src/dynamicSo.vue +329 -328
  117. package/src/centaline/dynamicSo/src/dynamicSo/345/211/257/346/234/254.vue +69 -69
  118. package/src/centaline/dynamicSos/index.js +14 -14
  119. package/src/centaline/dynamicSos/src/dynamicSos - /345/244/215/345/210/266.vue" +223 -223
  120. package/src/centaline/dynamicSos/src/dynamicSos.vue +261 -260
  121. package/src/centaline/dynamicSw/index.js +11 -11
  122. package/src/centaline/dynamicSw/src/dynamicSw.vue +74 -74
  123. package/src/centaline/dynamicT/index.js +11 -11
  124. package/src/centaline/dynamicT/src/dynamicT.vue +79 -79
  125. package/src/centaline/dynamicTab/index.js +11 -11
  126. package/src/centaline/dynamicTab/src/dynamicTab.vue +49 -49
  127. package/src/centaline/dynamicTabs/index.js +11 -11
  128. package/src/centaline/dynamicTabs/src/dynamicTabs.vue +69 -69
  129. package/src/centaline/dynamicTags/index.js +13 -13
  130. package/src/centaline/dynamicTags/src/dynamicTags - /345/244/215/345/210/266.vue" +391 -391
  131. package/src/centaline/dynamicTags/src/dynamicTags.vue +427 -427
  132. package/src/centaline/dynamicTimeSelect/index.js +11 -11
  133. package/src/centaline/dynamicTimeSelect/src/dynamicTimeSelect.vue +141 -141
  134. package/src/centaline/dynamicTree/index.js +11 -11
  135. package/src/centaline/dynamicTree/src/dynamicSearchTree.vue +66 -66
  136. package/src/centaline/dynamicTree/src/dynamicTree.vue +233 -233
  137. package/src/centaline/dynamicTree/src/dynamicTreeList.vue +74 -74
  138. package/src/centaline/formData/index.js +290 -290
  139. package/src/centaline/imgPreview/index.js +42 -42
  140. package/src/centaline/imgPreview/src/imgPreview.vue +26 -26
  141. package/src/centaline/index.js +51 -51
  142. package/src/centaline/loader/index.js +157 -157
  143. package/src/centaline/loader/src/ctl/Base.js +270 -261
  144. package/src/centaline/loader/src/ctl/Button.js +44 -44
  145. package/src/centaline/loader/src/ctl/Cb.js +27 -27
  146. package/src/centaline/loader/src/ctl/Checkbox.js +107 -107
  147. package/src/centaline/loader/src/ctl/ComboBoxWithTextBox.js +162 -162
  148. package/src/centaline/loader/src/ctl/D.js +31 -31
  149. package/src/centaline/loader/src/ctl/Detail.js +228 -175
  150. package/src/centaline/loader/src/ctl/Dtd.js +115 -115
  151. package/src/centaline/loader/src/ctl/DtdOld.js +129 -129
  152. package/src/centaline/loader/src/ctl/File.js +292 -292
  153. package/src/centaline/loader/src/ctl/Form.js +380 -380
  154. package/src/centaline/loader/src/ctl/FormList.js +428 -428
  155. package/src/centaline/loader/src/ctl/GM.js +20 -20
  156. package/src/centaline/loader/src/ctl/Gp.js +9 -9
  157. package/src/centaline/loader/src/ctl/Hd.js +13 -13
  158. package/src/centaline/loader/src/ctl/HyperLink.js +24 -24
  159. package/src/centaline/loader/src/ctl/InputNumber.js +51 -51
  160. package/src/centaline/loader/src/ctl/Iti.js +108 -108
  161. package/src/centaline/loader/src/ctl/L.js +18 -18
  162. package/src/centaline/loader/src/ctl/Mo.js +183 -183
  163. package/src/centaline/loader/src/ctl/Mt.js +20 -20
  164. package/src/centaline/loader/src/ctl/PlaceHolder.js +15 -15
  165. package/src/centaline/loader/src/ctl/Router.js +273 -273
  166. package/src/centaline/loader/src/ctl/SearchCategory.js +54 -54
  167. package/src/centaline/loader/src/ctl/SearchScreen.js +236 -236
  168. package/src/centaline/loader/src/ctl/SearchTable.js +787 -772
  169. package/src/centaline/loader/src/ctl/Seg.js +37 -37
  170. package/src/centaline/loader/src/ctl/SensitiveEye.js +65 -65
  171. package/src/centaline/loader/src/ctl/So.js +117 -117
  172. package/src/centaline/loader/src/ctl/Sos.js +128 -128
  173. package/src/centaline/loader/src/ctl/Sw.js +27 -27
  174. package/src/centaline/loader/src/ctl/T.js +65 -65
  175. package/src/centaline/loader/src/ctl/Tabs.js +57 -57
  176. package/src/centaline/loader/src/ctl/Tags.js +191 -191
  177. package/src/centaline/loader/src/ctl/TimeSelect.js +87 -87
  178. package/src/centaline/loader/src/ctl/Tree.js +151 -151
  179. package/src/centaline/loader/src/ctl/Ttts.js +78 -78
  180. package/src/centaline/loader/src/ctl/lib/Enum.js +580 -563
  181. package/src/centaline/loader/src/ctl/lib/LibFunction.js +364 -364
  182. package/src/centaline/loader/src/ctl.js +36 -36
  183. package/src/centaline/mixins/dynamicElement.js +151 -151
  184. package/src/centaline/mixins/dynamicSelect.js +84 -84
  185. package/src/centaline/mixins/emitter.js +33 -33
  186. package/src/centaline/progress/index.js +11 -11
  187. package/src/centaline/progress/src/progress.vue +70 -70
  188. package/src/centaline/quickInput/src/quickInput.vue +64 -64
  189. package/src/centaline/selectOption/src/selectOption.vue +61 -61
  190. package/src/centaline/selectOption/src/selectOptionVertical.vue +80 -80
  191. package/src/centaline/templateControls/index.js +17 -17
  192. package/src/centaline/templateControls/src/dynamicTableA.vue +20 -20
  193. package/src/centaline/templateControls/src/dynamicTableCurrency.vue +62 -62
  194. package/src/centaline/templateControls/src/dynamicTableImg.vue +25 -25
  195. package/src/centaline/templates/index.js +34 -34
  196. package/src/centaline/templates/src/ContractSearch.js +67 -67
  197. package/src/centaline/templates/src/test.js +44 -44
  198. package/src/centaline/validate/index.js +332 -332
  199. package/src/main.js +55 -46
  200. package/src/router/index.js +44 -44
  201. package/wwwroot/static/centaline/centaline-data-driven.js +1 -1
  202. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
@@ -1,249 +1,249 @@
1
- import Axios from 'axios';
2
- import Vue from 'vue';
3
- import Enum from '../loader/src/ctl/lib/Enum';
4
- import common from '../common';
5
-
6
- //Axios.defaults.baseURL = 'https://localhost:44381/api'
7
- Axios.defaults.headers.post['Content-Type'] = 'application/json';
8
- Axios.defaults.maxContentLength = 400000;
9
- Axios.defaults.withCredentials = true;//允许带上跨域cookies
10
-
11
- // Axios.defaults = {
12
- // // `url` 是用于请求的服务器 URL
13
- // // url: '/user',
14
-
15
- // // `method` 是创建请求时使用的方法
16
- // // method: 'get', // 默认是 get
17
-
18
- // // `baseURL` 将自动加在 `url` 前面,除非 `url` 是一个绝对 URL。
19
- // // 它可以通过设置一个 `baseURL` 便于为 axios 实例的方法传递相对 URL
20
- // baseURL: 'https://localhost:44367/api/',
21
-
22
- // // `transformRequest` 允许在向服务器发送前,修改请求数据
23
- // // 只能用在 'PUT', 'POST' 和 'PATCH' 这几个请求方法
24
- // // 后面数组中的函数必须返回一个字符串,或 ArrayBuffer,或 Stream
25
- // transformRequest: [function (data) {
26
- // // 对 data 进行任意转换处理
27
-
28
- // return data
29
- // }],
30
-
31
- // // `transformResponse` 在传递给 then/catch 前,允许修改响应数据
32
- // transformResponse: [function (data) {
33
- // // 对 data 进行任意转换处理
34
-
35
- // return data
36
- // }],
37
- // // `headers` 是即将被发送的自定义请求头
38
- // // headers: { 'X-Requested-With': 'XMLHttpRequest' },
39
-
40
- // // `params` 是即将与请求一起发送的 URL 参数
41
- // // 必须是一个无格式对象(plain object)或 URLSearchParams 对象
42
- // /* params: {
43
- // ID: 12345
44
- // }, */
45
-
46
- // // `paramsSerializer` 是一个负责 `params` 序列化的函数
47
- // // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/)
48
- // /* paramsSerializer: function (params) {
49
- // return Qs.stringify(params, { arrayFormat: 'brackets' })
50
- // },
51
- // */
52
-
53
- // // `data` 是作为请求主体被发送的数据
54
- // // 只适用于这些请求方法 'PUT', 'POST', 和 'PATCH'
55
- // // 在没有设置 `transformRequest` 时,必须是以下类型之一:
56
- // // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams
57
- // // - 浏览器专属:FormData, File, Blob
58
- // // - Node 专属: Stream
59
- // /* data: {
60
- // firstName: 'Fred'
61
- // }, */
62
-
63
- // // `timeout` 指定请求超时的毫秒数(0 表示无超时时间)
64
- // // 如果请求话费了超过 `timeout` 的时间,请求将被中断
65
- // timeout: 3000,
66
-
67
- // // `withCredentials` 表示跨域请求时是否需要使用凭证
68
- // withCredentials: false, // 默认的
69
-
70
- // // `auth` 表示应该使用 HTTP 基础验证,并提供凭据
71
- // // 这将设置一个 `Authorization` 头,覆写掉现有的任意使用 `headers` 设置的自定义 `Authorization`头
72
- // /* auth: {
73
- // username: 'janedoe',
74
- // password: 's00pers3cret'
75
- // }, */
76
-
77
- // // `responseType` 表示服务器响应的数据类型,可以是 'arraybuffer', 'blob', 'document', 'json', 'text', 'stream'
78
- // responseType: 'json', // 默认的
79
-
80
- // // `xsrfCookieName` 是用作 xsrf token 的值的cookie的名称
81
- // xsrfCookieName: 'XSRF-TOKEN', // default
82
-
83
- // // `onUploadProgress` 允许为上传处理进度事件
84
- // onUploadProgress: function (progressEvent) {
85
- // // 对原生进度事件的处理
86
- // },
87
-
88
- // // `onDownloadProgress` 允许为下载处理进度事件
89
- // onDownloadProgress: function (progressEvent) {
90
- // // 对原生进度事件的处理
91
- // },
92
-
93
- // // `maxContentLength` 定义允许的响应内容的最大尺寸
94
- // maxContentLength: 200000,
95
-
96
- // // `validateStatus` 定义对于给定的HTTP 响应状态码是 resolve 或 reject promise 。如果 `validateStatus` 返回 `true` (或者设置为 `null` 或 `undefined`),promise 将被 resolve; 否则,promise 将被 rejecte
97
- // validateStatus: function (status) {
98
- // return status >= 200 && status < 300 // 默认的
99
- // },
100
-
101
- // // `maxRedirects` 定义在 node.js 中 follow 的最大重定向数目
102
- // // 如果设置为0,将不会 follow 任何重定向
103
- // maxRedirects: 5 // 默认的
104
-
105
- // // `httpAgent` 和 `httpsAgent` 分别在 node.js 中用于定义在执行 http 和 https 时使用的自定义代理。允许像这样配置选项:
106
- // // `keepAlive` 默认没有启用
107
- // // httpAgent: new http.Agent({ keepAlive: true }),
108
- // // httpsAgent: new https.Agent({ keepAlive: true }),
109
-
110
- // // 'proxy' 定义代理服务器的主机名称和端口
111
- // // `auth` 表示 HTTP 基础验证应当用于连接代理,并提供凭据
112
- // // 这将会设置一个 `Proxy-Authorization` 头,覆写掉已有的通过使用 `header` 设置的自定义 `Proxy-Authorization` 头。
113
- // // proxy: {
114
- // // host: '127.0.0.1',
115
- // // port: 9000,
116
- // // auth: : {
117
- // // username: 'mikeymike',
118
- // // password: 'rapunz3l'
119
- // // }
120
- // // },
121
-
122
- // // `cancelToken` 指定用于取消请求的 cancel token
123
- // // (查看后面的 Cancellation 这节了解更多)
124
- // // cancelToken: new CancelToken(function (cancel) {
125
- // // })
126
- // }
127
-
128
- const api = {
129
- get(url, params, callback) {
130
- return Axios.get(url, params, {
131
- headers: {
132
- headers: common.getDataDrivenOpts().handler.getRequestHeaders()
133
- }
134
- }).then(
135
- function (response) {
136
- callback(response.data);
137
- }
138
- );
139
- },
140
- post(url, params, callback) {
141
- return Axios.post(url, params, {
142
- headers: {
143
- headers: common.getDataDrivenOpts().handler.getRequestHeaders()
144
- }
145
- }).then(
146
- function (response) {
147
- callback(response.data);
148
- }
149
- );
150
- },
151
- postThenHandler: function (response) {
152
- var data = response.data;
153
-
154
- if (typeof common.getDataDrivenOpts().handler.requestComplete === 'function') {
155
- common.getDataDrivenOpts().handler.requestComplete(response);
156
- }
157
-
158
- // 执行js
159
- if (data.clientActionType === Enum.ClientActionType.ExcuteScript && data.content) {
160
- eval(data.content);
161
- }
162
-
163
- //关闭tab页
164
- if (data.notification === Enum.ActionType.CloseTab
165
- || data.notification === Enum.ActionType.CloseTabThenDelete
166
- || data.notification === Enum.ActionType.CloseTabThenNew
167
- || data.notification === Enum.ActionType.CloseTabThenUpdate) {
168
- if (typeof common.getDataDrivenOpts().handler.closeTab === 'function') {
169
- common.getDataDrivenOpts().handler.closeTab();
170
- }
171
- }
172
-
173
- if (data.rtnCode === Enum.ReturnCode.Successful) {
174
- if (data.rtnMsg) {
175
- if (data.MsgAlertStyle && data.MsgAlertStyle == Enum.MessageAlertStyle.Dialog) {
176
- common.confirm(data.rtnMsg, '信息', { confirmButtonText: '确定', flagShowcCancelButton: '0' });
177
- }
178
- else {
179
- Vue.prototype.$message({
180
- message: response.data.rtnMsg,
181
- type: 'success'
182
- });
183
- }
184
- }
185
-
186
- if (data.notification === Enum.ActionType.Export && data.content) {//导出
187
- //var fileName = data.content.fieldName1;
188
- //var fileContent = window.atob(data.content.code1);
189
- //Vue.prototype.$common.saveFile(fileName, fileContent);
190
- var dialogOption = {
191
- title: "导出",
192
- content: [{
193
- component: 'ct-progress',
194
- attrs: {
195
- progressAction: data.content.action,
196
- progressKey: data.content.key,
197
- width: '300px',
198
- height: '60px'
199
- },
200
- on: {
201
- finished() {
202
- Vue.prototype.$common.closeDialog(dialogOption.dialog);
203
- }
204
- }
205
- }]
206
- };
207
- self.$common.openDialog(dialogOption);
208
- }
209
- }
210
- else {
211
- if (response.data.rtnMsg && common.getDataDrivenOpts().showRequestErrorMessage) {
212
- if (data.MsgAlertStyle && data.MsgAlertStyle == Enum.MessageAlertStyle.Dialog) {
213
- common.confirm(data.rtnMsg, '信息', { confirmButtonText: '确定', flagShowcCancelButton: '0' });
214
- }
215
- else {
216
- Vue.prototype.$message.error(response.data.rtnMsg);
217
- }
218
- }
219
- return Promise.reject(response);
220
- }
221
- //返回给下一个链式调用
222
- return Promise.resolve(response.data);
223
- },
224
- postHandler(url, params, formData) {
225
- return Axios.post(url, params, {
226
- headers: common.getDataDrivenOpts().handler.getRequestHeaders()
227
- }).then(this.postThenHandler).catch((ex) => {
228
- console.log(ex);
229
- if (ex.message) {
230
- Vue.prototype.$message.error(ex.message);
231
- }
232
- else if (typeof ex.data === "string") {
233
- Vue.prototype.$message.error(ex.data);
234
- }
235
- //return Promise.reject(ex.data ? ex.data : ex);
236
- return Promise.resolve(ex.data ? ex.data : ex);//错误处理了,直接返回成功,要判断response.rtnCode=200再处理
237
- });
238
- }
239
- };
240
- api.install = function (Vue) {
241
- Vue.prototype.$axios = Axios;
242
- Vue.prototype.$api = api;
243
- };
244
-
245
- if (typeof window !== 'undefined' && window.Vue) {
246
- window.Vue.use(api);
247
- }
248
-
249
- export default api;
1
+ import Axios from 'axios';
2
+ import Vue from 'vue';
3
+ import Enum from '../loader/src/ctl/lib/Enum';
4
+ import common from '../common';
5
+
6
+ //Axios.defaults.baseURL = 'https://localhost:44381/api'
7
+ Axios.defaults.headers.post['Content-Type'] = 'application/json';
8
+ Axios.defaults.maxContentLength = 400000;
9
+ Axios.defaults.withCredentials = true;//允许带上跨域cookies
10
+
11
+ // Axios.defaults = {
12
+ // // `url` 是用于请求的服务器 URL
13
+ // // url: '/user',
14
+
15
+ // // `method` 是创建请求时使用的方法
16
+ // // method: 'get', // 默认是 get
17
+
18
+ // // `baseURL` 将自动加在 `url` 前面,除非 `url` 是一个绝对 URL。
19
+ // // 它可以通过设置一个 `baseURL` 便于为 axios 实例的方法传递相对 URL
20
+ // baseURL: 'https://localhost:44367/api/',
21
+
22
+ // // `transformRequest` 允许在向服务器发送前,修改请求数据
23
+ // // 只能用在 'PUT', 'POST' 和 'PATCH' 这几个请求方法
24
+ // // 后面数组中的函数必须返回一个字符串,或 ArrayBuffer,或 Stream
25
+ // transformRequest: [function (data) {
26
+ // // 对 data 进行任意转换处理
27
+
28
+ // return data
29
+ // }],
30
+
31
+ // // `transformResponse` 在传递给 then/catch 前,允许修改响应数据
32
+ // transformResponse: [function (data) {
33
+ // // 对 data 进行任意转换处理
34
+
35
+ // return data
36
+ // }],
37
+ // // `headers` 是即将被发送的自定义请求头
38
+ // // headers: { 'X-Requested-With': 'XMLHttpRequest' },
39
+
40
+ // // `params` 是即将与请求一起发送的 URL 参数
41
+ // // 必须是一个无格式对象(plain object)或 URLSearchParams 对象
42
+ // /* params: {
43
+ // ID: 12345
44
+ // }, */
45
+
46
+ // // `paramsSerializer` 是一个负责 `params` 序列化的函数
47
+ // // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/)
48
+ // /* paramsSerializer: function (params) {
49
+ // return Qs.stringify(params, { arrayFormat: 'brackets' })
50
+ // },
51
+ // */
52
+
53
+ // // `data` 是作为请求主体被发送的数据
54
+ // // 只适用于这些请求方法 'PUT', 'POST', 和 'PATCH'
55
+ // // 在没有设置 `transformRequest` 时,必须是以下类型之一:
56
+ // // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams
57
+ // // - 浏览器专属:FormData, File, Blob
58
+ // // - Node 专属: Stream
59
+ // /* data: {
60
+ // firstName: 'Fred'
61
+ // }, */
62
+
63
+ // // `timeout` 指定请求超时的毫秒数(0 表示无超时时间)
64
+ // // 如果请求话费了超过 `timeout` 的时间,请求将被中断
65
+ // timeout: 3000,
66
+
67
+ // // `withCredentials` 表示跨域请求时是否需要使用凭证
68
+ // withCredentials: false, // 默认的
69
+
70
+ // // `auth` 表示应该使用 HTTP 基础验证,并提供凭据
71
+ // // 这将设置一个 `Authorization` 头,覆写掉现有的任意使用 `headers` 设置的自定义 `Authorization`头
72
+ // /* auth: {
73
+ // username: 'janedoe',
74
+ // password: 's00pers3cret'
75
+ // }, */
76
+
77
+ // // `responseType` 表示服务器响应的数据类型,可以是 'arraybuffer', 'blob', 'document', 'json', 'text', 'stream'
78
+ // responseType: 'json', // 默认的
79
+
80
+ // // `xsrfCookieName` 是用作 xsrf token 的值的cookie的名称
81
+ // xsrfCookieName: 'XSRF-TOKEN', // default
82
+
83
+ // // `onUploadProgress` 允许为上传处理进度事件
84
+ // onUploadProgress: function (progressEvent) {
85
+ // // 对原生进度事件的处理
86
+ // },
87
+
88
+ // // `onDownloadProgress` 允许为下载处理进度事件
89
+ // onDownloadProgress: function (progressEvent) {
90
+ // // 对原生进度事件的处理
91
+ // },
92
+
93
+ // // `maxContentLength` 定义允许的响应内容的最大尺寸
94
+ // maxContentLength: 200000,
95
+
96
+ // // `validateStatus` 定义对于给定的HTTP 响应状态码是 resolve 或 reject promise 。如果 `validateStatus` 返回 `true` (或者设置为 `null` 或 `undefined`),promise 将被 resolve; 否则,promise 将被 rejecte
97
+ // validateStatus: function (status) {
98
+ // return status >= 200 && status < 300 // 默认的
99
+ // },
100
+
101
+ // // `maxRedirects` 定义在 node.js 中 follow 的最大重定向数目
102
+ // // 如果设置为0,将不会 follow 任何重定向
103
+ // maxRedirects: 5 // 默认的
104
+
105
+ // // `httpAgent` 和 `httpsAgent` 分别在 node.js 中用于定义在执行 http 和 https 时使用的自定义代理。允许像这样配置选项:
106
+ // // `keepAlive` 默认没有启用
107
+ // // httpAgent: new http.Agent({ keepAlive: true }),
108
+ // // httpsAgent: new https.Agent({ keepAlive: true }),
109
+
110
+ // // 'proxy' 定义代理服务器的主机名称和端口
111
+ // // `auth` 表示 HTTP 基础验证应当用于连接代理,并提供凭据
112
+ // // 这将会设置一个 `Proxy-Authorization` 头,覆写掉已有的通过使用 `header` 设置的自定义 `Proxy-Authorization` 头。
113
+ // // proxy: {
114
+ // // host: '127.0.0.1',
115
+ // // port: 9000,
116
+ // // auth: : {
117
+ // // username: 'mikeymike',
118
+ // // password: 'rapunz3l'
119
+ // // }
120
+ // // },
121
+
122
+ // // `cancelToken` 指定用于取消请求的 cancel token
123
+ // // (查看后面的 Cancellation 这节了解更多)
124
+ // // cancelToken: new CancelToken(function (cancel) {
125
+ // // })
126
+ // }
127
+
128
+ const api = {
129
+ get(url, params, callback) {
130
+ return Axios.get(url, params, {
131
+ headers: {
132
+ headers: common.getDataDrivenOpts().handler.getRequestHeaders()
133
+ }
134
+ }).then(
135
+ function (response) {
136
+ callback(response.data);
137
+ }
138
+ );
139
+ },
140
+ post(url, params, callback) {
141
+ return Axios.post(url, params, {
142
+ headers: {
143
+ headers: common.getDataDrivenOpts().handler.getRequestHeaders()
144
+ }
145
+ }).then(
146
+ function (response) {
147
+ callback(response.data);
148
+ }
149
+ );
150
+ },
151
+ postThenHandler: function (response) {
152
+ var data = response.data;
153
+
154
+ if (typeof common.getDataDrivenOpts().handler.requestComplete === 'function') {
155
+ common.getDataDrivenOpts().handler.requestComplete(response);
156
+ }
157
+
158
+ // 执行js
159
+ if (data.clientActionType === Enum.ClientActionType.ExcuteScript && data.content) {
160
+ eval(data.content);
161
+ }
162
+
163
+ //关闭tab页
164
+ if (data.notification === Enum.ActionType.CloseTab
165
+ || data.notification === Enum.ActionType.CloseTabThenDelete
166
+ || data.notification === Enum.ActionType.CloseTabThenNew
167
+ || data.notification === Enum.ActionType.CloseTabThenUpdate) {
168
+ if (typeof common.getDataDrivenOpts().handler.closeTab === 'function') {
169
+ common.getDataDrivenOpts().handler.closeTab();
170
+ }
171
+ }
172
+
173
+ if (data.rtnCode === Enum.ReturnCode.Successful) {
174
+ if (data.rtnMsg) {
175
+ if (data.MsgAlertStyle && data.MsgAlertStyle == Enum.MessageAlertStyle.Dialog) {
176
+ common.confirm(data.rtnMsg, '信息', { confirmButtonText: '确定', flagShowcCancelButton: '0' });
177
+ }
178
+ else {
179
+ Vue.prototype.$message({
180
+ message: response.data.rtnMsg,
181
+ type: 'success'
182
+ });
183
+ }
184
+ }
185
+
186
+ if (data.notification === Enum.ActionType.Export && data.content) {//导出
187
+ //var fileName = data.content.fieldName1;
188
+ //var fileContent = window.atob(data.content.code1);
189
+ //Vue.prototype.$common.saveFile(fileName, fileContent);
190
+ var dialogOption = {
191
+ title: "导出",
192
+ content: [{
193
+ component: 'ct-progress',
194
+ attrs: {
195
+ progressAction: data.content.action,
196
+ progressKey: data.content.key,
197
+ width: '300px',
198
+ height: '60px'
199
+ },
200
+ on: {
201
+ finished() {
202
+ Vue.prototype.$common.closeDialog(dialogOption.dialog);
203
+ }
204
+ }
205
+ }]
206
+ };
207
+ self.$common.openDialog(dialogOption);
208
+ }
209
+ }
210
+ else {
211
+ if (response.data.rtnMsg && common.getDataDrivenOpts().showRequestErrorMessage) {
212
+ if (data.MsgAlertStyle && data.MsgAlertStyle == Enum.MessageAlertStyle.Dialog) {
213
+ common.confirm(data.rtnMsg, '信息', { confirmButtonText: '确定', flagShowcCancelButton: '0' });
214
+ }
215
+ else {
216
+ Vue.prototype.$message.error(response.data.rtnMsg);
217
+ }
218
+ }
219
+ return Promise.reject(response);
220
+ }
221
+ //返回给下一个链式调用
222
+ return Promise.resolve(response.data);
223
+ },
224
+ postHandler(url, params, formData) {
225
+ return Axios.post(url, params, {
226
+ headers: common.getDataDrivenOpts().handler.getRequestHeaders()
227
+ }).then(this.postThenHandler).catch((ex) => {
228
+ console.log(ex);
229
+ if (ex.message) {
230
+ Vue.prototype.$message.error(ex.message);
231
+ }
232
+ else if (typeof ex.data === "string") {
233
+ Vue.prototype.$message.error(ex.data);
234
+ }
235
+ //return Promise.reject(ex.data ? ex.data : ex);
236
+ return Promise.resolve(ex.data ? ex.data : ex);//错误处理了,直接返回成功,要判断response.rtnCode=200再处理
237
+ });
238
+ }
239
+ };
240
+ api.install = function (Vue) {
241
+ Vue.prototype.$axios = Axios;
242
+ Vue.prototype.$api = api;
243
+ };
244
+
245
+ if (typeof window !== 'undefined' && window.Vue) {
246
+ window.Vue.use(api);
247
+ }
248
+
249
+ export default api;
@@ -1,11 +1,11 @@
1
- import comfirm from './src/comfirm'
2
-
3
- comfirm.install = function (Vue) {
4
- Vue.component(comfirm.name, comfirm);
5
- }
6
-
7
- if (typeof window !== 'undefined' && window.Vue) {
8
- window.Vue.use(comfirm);
9
- }
10
-
11
- export default comfirm;
1
+ import comfirm from './src/comfirm'
2
+
3
+ comfirm.install = function (Vue) {
4
+ Vue.component(comfirm.name, comfirm);
5
+ }
6
+
7
+ if (typeof window !== 'undefined' && window.Vue) {
8
+ window.Vue.use(comfirm);
9
+ }
10
+
11
+ export default comfirm;
@@ -1,44 +1,44 @@
1
- <template>
2
- <div class="ct-comfirm-content max-comfirm-content">
3
- <div style="margin-top: 15px;margin-bottom: 15px;min-width: 150px;text-align: center;">
4
- <span>{{text}}</span>
5
- </div>
6
- <div style="text-align:center;width:100%">
7
- <el-button @click="clickHandler($event,true)" type="primary" size="mini">{{options.confirmButtonText||'确定'}}</el-button>
8
- <el-button v-if="options.flagShowcCancelButton===undefined || options.flagShowcCancelButton==='1'" @click="clickHandler($event,false)" size="mini">{{options.cancelButtonText||'取消'}}</el-button>
9
- </div>
10
- </div>
11
- </template>
12
- <script>
13
- export default {
14
- name: 'ct-comfirm',
15
- props: {
16
- text: String,
17
- options:{
18
- type: Object,
19
- default: () => {
20
- return {};
21
- },
22
- },
23
-
24
- },
25
- data() {
26
- return {
27
-
28
- };
29
- },
30
- methods: {
31
- clickHandler(ev, v) {
32
- if (v) {
33
- this.$emit('access');
34
- }
35
- else if (!v){
36
- this.$emit('cancel');
37
- }
38
- }
39
- }
40
- }
41
- </script>
42
- <style scoped>
43
-
44
- </style>
1
+ <template>
2
+ <div class="ct-comfirm-content max-comfirm-content">
3
+ <div style="margin-top: 15px;margin-bottom: 15px;min-width: 150px;text-align: center;">
4
+ <span>{{text}}</span>
5
+ </div>
6
+ <div style="text-align:center;width:100%">
7
+ <el-button @click="clickHandler($event,true)" type="primary" size="mini">{{options.confirmButtonText||'确定'}}</el-button>
8
+ <el-button v-if="options.flagShowcCancelButton===undefined || options.flagShowcCancelButton==='1'" @click="clickHandler($event,false)" size="mini">{{options.cancelButtonText||'取消'}}</el-button>
9
+ </div>
10
+ </div>
11
+ </template>
12
+ <script>
13
+ export default {
14
+ name: 'ct-comfirm',
15
+ props: {
16
+ text: String,
17
+ options:{
18
+ type: Object,
19
+ default: () => {
20
+ return {};
21
+ },
22
+ },
23
+
24
+ },
25
+ data() {
26
+ return {
27
+
28
+ };
29
+ },
30
+ methods: {
31
+ clickHandler(ev, v) {
32
+ if (v) {
33
+ this.$emit('access');
34
+ }
35
+ else if (!v){
36
+ this.$emit('cancel');
37
+ }
38
+ }
39
+ }
40
+ }
41
+ </script>
42
+ <style scoped>
43
+
44
+ </style>