vue2-client 1.2.33 → 1.2.36

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 (27) hide show
  1. package/.eslintrc.js +82 -81
  2. package/CHANGELOG.md +21 -0
  3. package/package.json +1 -1
  4. package/src/base-client/all.js +59 -57
  5. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1342 -1308
  6. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +752 -752
  7. package/src/base-client/components/common/Upload/Upload.vue +124 -0
  8. package/src/base-client/components/common/Upload/index.js +3 -0
  9. package/src/base-client/components/common/XAddForm/XAddForm.vue +338 -337
  10. package/src/base-client/components/common/XAddNativeForm/index.js +3 -3
  11. package/src/base-client/components/common/XAddNativeForm/index.md +56 -56
  12. package/src/base-client/components/common/XForm/XFormItem.vue +280 -307
  13. package/src/base-client/components/common/XFormTable/XFormTable.vue +4 -4
  14. package/src/base-client/components/common/XFormTable/index.md +94 -94
  15. package/src/base-client/components/common/XTable/index.md +255 -255
  16. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +5 -1
  17. package/src/config/config.js +2 -0
  18. package/src/layouts/AdminLayout.vue +2 -2
  19. package/src/layouts/tabs/TabsView.vue +6 -0
  20. package/src/pages/resourceManage/resourceManageMain.vue +0 -1
  21. package/src/pages/system/ticket/index.vue +29 -26
  22. package/src/router/index.js +1 -1
  23. package/src/services/api/EmployeeDetailsViewApi.js +16 -16
  24. package/src/services/api/applyInstallApi.js +14 -14
  25. package/src/services/api/restTools.js +24 -23
  26. package/src/utils/request.js +1 -0
  27. package/vue.config.js +143 -143
@@ -118,17 +118,17 @@
118
118
  <br/>
119
119
  </div>
120
120
  </a-modal>
121
- <a-card>
121
+ <a-card v-if="visible">
122
122
  <div style="text-align: right">
123
- <p>欢迎您:{{ currUser.name }},<a @click="logout">退出登录</a></p>
123
+ <p>欢迎您:{{ currUser.ename }}</p>
124
124
  </div>
125
125
  <div class="submitTicketTitle">
126
126
  <span>奥枫问题反馈平台</span>
127
127
  </div>
128
- <a-tabs>
129
- <a-tab-pane :key="1" tab="工单提交">
128
+ <a-tabs :activeKey="tabActiveKey" @change="changeTab">
129
+ <a-tab-pane key="workSubmit" tab="工单提交">
130
130
  <!-- 表格主体 -->
131
- <a-row>
131
+ <a-row v-if="tabActiveKey === 'workSubmit'">
132
132
  <a-col :span="18">
133
133
  <a-form :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
134
134
  <!-- 问题类型单选框 -->
@@ -210,9 +210,10 @@
210
210
  </a-col>
211
211
  </a-row>
212
212
  </a-tab-pane>
213
- <a-tab-pane :key="2" tab="历史工单">
213
+ <a-tab-pane key="workHistory" tab="历史工单">
214
214
  <!-- 查询表单 -->
215
215
  <x-form-table
216
+ v-if="tabActiveKey === 'workHistory'"
216
217
  title="已提交工单"
217
218
  :queryParamsName="queryParamsName"
218
219
  :fixed-query-form="fixedQueryForm"
@@ -227,8 +228,8 @@
227
228
  <script>
228
229
  import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
229
230
  import { logout } from '@/services/user'
230
- import { mapState } from 'vuex'
231
231
  import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
232
+ import Vue from 'vue'
232
233
 
233
234
  export default {
234
235
  name: 'submitTicket',
@@ -272,16 +273,25 @@
272
273
  // 工单类型在字典中显示的文字值
273
274
  categoryStr: '',
274
275
  // 当前登陆用户手机号
275
- phoneNumber: ''
276
+ phoneNumber: '',
277
+ // 用户信息
278
+ currUser: {
279
+ ename: '',
280
+ phoneNumber: ''
281
+ },
282
+ visible: false,
283
+ tabActiveKey: 'workSubmit'
276
284
  }
277
285
  },
286
+ created () {
287
+ Vue.$appdata.load().then(res => {
288
+ this.currUser.phoneNumber = this.$route.query.personPhone ? this.$route.query.personPhone : '未定义'
289
+ this.currUser.ename = this.$route.query.orgName
290
+ this.fixedQueryForm['t_uploader'] = this.currUser.ename
291
+ this.visible = true
292
+ })
293
+ },
278
294
  mounted () {
279
- if (!this.currUser) {
280
- this.$router.replace('/login')
281
- return
282
- }
283
- this.getCurrentUserPhone()
284
- this.fixedQueryForm['t_uploader'] = this.currUser.ename
285
295
  },
286
296
  methods: {
287
297
  toDetail (record, id) {
@@ -296,14 +306,6 @@
296
306
  reader.onerror = error => reject(error)
297
307
  })
298
308
  },
299
- // 获取当前用户手机号
300
- getCurrentUserPhone () {
301
- if (this.currUser.f_user_telephone === undefined) {
302
- this.phoneNumber = '未定义'
303
- } else {
304
- this.phoneNumber = this.currUser.f_user_telephone
305
- }
306
- },
307
309
  // 图像修改检测
308
310
  handleChange ({ fileList }) {
309
311
  this.fileList = fileList.filter((item) => {
@@ -374,7 +376,7 @@
374
376
  serial_number: serialNumber,
375
377
  images: this.fileList,
376
378
  categoryStr: this.categoryStr,
377
- phoneNumber: this.phoneNumber
379
+ phoneNumber: this.currUser.phoneNumber
378
380
  })
379
381
  .then(res => {
380
382
  this.serialNumber = serialNumber
@@ -409,11 +411,12 @@
409
411
  logout () {
410
412
  logout()
411
413
  this.$router.push('/login')
414
+ },
415
+ // 切换标签页
416
+ changeTab (id) {
417
+ this.tabActiveKey = id
412
418
  }
413
419
  },
414
- computed: {
415
- ...mapState('account', { currUser: 'user' })
416
- },
417
420
  watch: {
418
421
  // 监控类别的改变,当类别改变,校验通过
419
422
  'form.category' (newVal) {
@@ -3,7 +3,7 @@ import { formatRoutes } from '@vue2-client/utils/routerUtil'
3
3
  // 不需要登录拦截的路由配置
4
4
  const loginIgnore = {
5
5
  names: ['404', '403'], // 根据路由名称匹配
6
- paths: ['/login'], // 根据路由fullPath匹配
6
+ paths: ['/login', '/submitTicket'], // 根据路由fullPath匹配
7
7
  /**
8
8
  * 判断路由是否包含在该配置中
9
9
  * @param route vue-router 的 route 对象
@@ -1,16 +1,16 @@
1
- const EmployeeDetailsViewApi = {
2
- // 查询:获取员工详细信息
3
- getEmployeeDetails: '/webmeterapi/getEmployeeDetails',
4
- // 查询:获取员工上一周应答工单数量
5
- getConfirmTicketsCountWeekly: '/webmeterapi/getConfirmTicketsCountWeekly',
6
- // 查询:获取员工上一周完成工单数量
7
- getFinishedTicketsCountWeekly: '/webmeterapi/getFinishedTicketsCountWeekly',
8
- // 查询:是否存在此员工
9
- findEmpName: '/webmeterapi/findEmpName',
10
- // 查询:获取所有员工名,供前端展示备选项
11
- getAllEmployeeName: '/webmeterapi/getAllEmployeeName',
12
- // 查询:根据员工名,获取员工id
13
- getEmployeeId: '/webmeterapi/getEmployeeId'
14
- }
15
-
16
- export { EmployeeDetailsViewApi }
1
+ const EmployeeDetailsViewApi = {
2
+ // 查询:获取员工详细信息
3
+ getEmployeeDetails: '/webmeterapi/getEmployeeDetails',
4
+ // 查询:获取员工上一周应答工单数量
5
+ getConfirmTicketsCountWeekly: '/webmeterapi/getConfirmTicketsCountWeekly',
6
+ // 查询:获取员工上一周完成工单数量
7
+ getFinishedTicketsCountWeekly: '/webmeterapi/getFinishedTicketsCountWeekly',
8
+ // 查询:是否存在此员工
9
+ findEmpName: '/webmeterapi/findEmpName',
10
+ // 查询:获取所有员工名,供前端展示备选项
11
+ getAllEmployeeName: '/webmeterapi/getAllEmployeeName',
12
+ // 查询:根据员工名,获取员工id
13
+ getEmployeeId: '/webmeterapi/getEmployeeId'
14
+ }
15
+
16
+ export { EmployeeDetailsViewApi }
@@ -1,14 +1,14 @@
1
- const ApplyInstallApi = {
2
- // 查询:获取报装临时表所需数据
3
- getApplySubTableData: '/webmeterapi/getApplySubTableData',
4
- // 初始化子表
5
- initApplySubTable: '/webmeterapi/initApplySubTable',
6
- // 删除临时子表
7
- deleteApplySubTempTable: '/webmeterapi/deleteApplySubTempTable',
8
- // 创建报建子表的临时表,根据配置文件动态生成
9
- createTempTable: '/webmeterapi/createTempTable',
10
- // 向临时表中插入数据
11
- insertDataToTempTable: '/webmeterapi/insertDataToTempTable'
12
- }
13
-
14
- export { ApplyInstallApi }
1
+ const ApplyInstallApi = {
2
+ // 查询:获取报装临时表所需数据
3
+ getApplySubTableData: '/webmeterapi/getApplySubTableData',
4
+ // 初始化子表
5
+ initApplySubTable: '/webmeterapi/initApplySubTable',
6
+ // 删除临时子表
7
+ deleteApplySubTempTable: '/webmeterapi/deleteApplySubTempTable',
8
+ // 创建报建子表的临时表,根据配置文件动态生成
9
+ createTempTable: '/webmeterapi/createTempTable',
10
+ // 向临时表中插入数据
11
+ insertDataToTempTable: '/webmeterapi/insertDataToTempTable'
12
+ }
13
+
14
+ export { ApplyInstallApi }
@@ -1,23 +1,24 @@
1
- import { METHOD, request } from '@vue2-client/utils/request'
2
-
3
- /**
4
- * GET请求
5
- * @param url 请求地址
6
- * @param parameter 路径参数
7
- * @returns {Promise<AxiosResponse<T>>}
8
- */
9
- function get (url, parameter) {
10
- return request(url, METHOD.GET, parameter)
11
- }
12
-
13
- /**
14
- * POST请求
15
- * @param url 请求地址
16
- * @param parameter 请求参数
17
- * @returns {Promise<AxiosResponse<T>>}
18
- */
19
- function post (url, parameter) {
20
- return request(url, METHOD.POST, parameter)
21
- }
22
-
23
- export { get, post }
1
+ import { METHOD, request } from '@vue2-client/utils/request'
2
+
3
+ /**
4
+ * GET请求
5
+ * @param url 请求地址
6
+ * @param parameter 路径参数
7
+ * @returns {Promise<AxiosResponse<T>>}
8
+ */
9
+ function get (url, parameter) {
10
+ return request(url, METHOD.GET, parameter)
11
+ }
12
+
13
+ /**
14
+ * POST请求
15
+ * @param url 请求地址
16
+ * @param parameter 请求参数
17
+ * @param config
18
+ * @returns {Promise<AxiosResponse<T>>}
19
+ */
20
+ function post (url, parameter, config = {}) {
21
+ return request(url, METHOD.POST, parameter, config)
22
+ }
23
+
24
+ export { get, post }
@@ -31,6 +31,7 @@ const METHOD = {
31
31
  * @param url 请求地址
32
32
  * @param method {METHOD} http method
33
33
  * @param params 请求参数
34
+ * @param config
34
35
  * @returns {Promise<AxiosResponse<T>>}
35
36
  */
36
37
  async function request (url, method, params, config) {
package/vue.config.js CHANGED
@@ -1,143 +1,143 @@
1
- const path = require('path')
2
- const webpack = require('webpack')
3
- const ThemeColorReplacer = require('webpack-theme-color-replacer')
4
- const { getThemeColors, modifyVars } = require('./src/utils/themeUtil')
5
- const { resolveCss } = require('./src/utils/theme-color-replacer-extend')
6
- const CompressionWebpackPlugin = require('compression-webpack-plugin')
7
-
8
- const productionGzipExtensions = ['js', 'css']
9
- const isProd = process.env.NODE_ENV === 'production'
10
-
11
- const assetsCDN = {
12
- // webpack build externals
13
- externals: {
14
- vue: 'Vue',
15
- 'vue-router': 'VueRouter',
16
- vuex: 'Vuex',
17
- axios: 'axios',
18
- nprogress: 'NProgress',
19
- clipboard: 'ClipboardJS',
20
- '@antv/data-set': 'DataSet',
21
- 'js-cookie': 'Cookies'
22
- },
23
- css: [
24
- ],
25
- js: [
26
- '//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
27
- '//cdn.jsdelivr.net/npm/vue-router@3.3.4/dist/vue-router.min.js',
28
- '//cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.min.js',
29
- '//cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js',
30
- '//cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js',
31
- '//cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js',
32
- '//cdn.jsdelivr.net/npm/@antv/data-set@0.11.4/build/data-set.min.js',
33
- '//cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js'
34
- ]
35
- }
36
-
37
- const server = 'http://121.36.106.17:8400'
38
- // const local = 'http://localhost:8445/webmeter'
39
- const local = 'http://123.60.214.109:8405/webmeter'
40
-
41
- module.exports = {
42
- devServer: {
43
- // development server port 8000
44
- port: 8001,
45
- // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
46
- proxy: {
47
- '/rs': {
48
- target: server,
49
- ws: false,
50
- changeOrigin: true
51
- },
52
- '/image': {
53
- target: server,
54
- ws: false,
55
- changeOrigin: true
56
- },
57
- '/webapps': {
58
- target: server,
59
- ws: false,
60
- changeOrigin: true
61
- },
62
- '/webmeterapi': {
63
- pathRewrite: { '^/webmeterapi': '/rs/logic' },
64
- target: local,
65
- changeOrigin: true
66
- },
67
- '/webmeteruploadapi': {
68
- pathRewrite: { '^/webmeteruploadapi': '/rs/file' },
69
- target: local,
70
- changeOrigin: true
71
- }
72
- }
73
- },
74
- pluginOptions: {
75
- 'style-resources-loader': {
76
- preProcessor: 'less',
77
- patterns: [path.resolve(__dirname, './src/theme/theme.less')]
78
- }
79
- },
80
- configureWebpack: config => {
81
- config.entry.app = ['babel-polyfill', 'whatwg-fetch', './src/main.js']
82
- config.performance = {
83
- hints: false
84
- }
85
- config.plugins.push(
86
- new ThemeColorReplacer({
87
- fileName: 'css/theme-colors-[contenthash:8].css',
88
- matchColors: getThemeColors(),
89
- injectCss: true,
90
- resolveCss
91
- })
92
- )
93
- // Ignore all locale files of moment.js
94
- config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
95
- // 生产环境下将资源压缩成gzip格式
96
- if (isProd) {
97
- // add `CompressionWebpack` plugin to webpack plugins
98
- config.plugins.push(new CompressionWebpackPlugin({
99
- algorithm: 'gzip',
100
- test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
101
- threshold: 10240,
102
- minRatio: 0.8
103
- }))
104
- }
105
- // if prod, add externals
106
- if (isProd) {
107
- config.externals = assetsCDN.externals
108
- }
109
- },
110
- chainWebpack: config => {
111
- // 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
112
- if (isProd) {
113
- config.plugin('optimize-css')
114
- .tap(args => {
115
- args[0].cssnanoOptions.preset[1].colormin = false
116
- return args
117
- })
118
- }
119
- // 生产环境下使用CDN
120
- if (isProd) {
121
- config.plugin('html')
122
- .tap(args => {
123
- args[0].cdn = assetsCDN
124
- return args
125
- })
126
- }
127
- config.resolve.alias.set('@vue2-client', path.resolve(__dirname, 'src'))
128
- },
129
- css: {
130
- loaderOptions: {
131
- less: {
132
- lessOptions: {
133
- modifyVars: modifyVars(),
134
- javascriptEnabled: true
135
- }
136
- }
137
- }
138
- },
139
- publicPath: process.env.VUE_APP_PUBLIC_PATH,
140
- outputDir: 'dist',
141
- assetsDir: 'static',
142
- productionSourceMap: false
143
- }
1
+ const path = require('path')
2
+ const webpack = require('webpack')
3
+ const ThemeColorReplacer = require('webpack-theme-color-replacer')
4
+ const { getThemeColors, modifyVars } = require('./src/utils/themeUtil')
5
+ const { resolveCss } = require('./src/utils/theme-color-replacer-extend')
6
+ const CompressionWebpackPlugin = require('compression-webpack-plugin')
7
+
8
+ const productionGzipExtensions = ['js', 'css']
9
+ const isProd = process.env.NODE_ENV === 'production'
10
+
11
+ // const assetsCDN = {
12
+ // // webpack build externals
13
+ // externals: {
14
+ // vue: 'Vue',
15
+ // 'vue-router': 'VueRouter',
16
+ // vuex: 'Vuex',
17
+ // axios: 'axios',
18
+ // nprogress: 'NProgress',
19
+ // clipboard: 'ClipboardJS',
20
+ // '@antv/data-set': 'DataSet',
21
+ // 'js-cookie': 'Cookies'
22
+ // },
23
+ // css: [
24
+ // ],
25
+ // js: [
26
+ // '//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
27
+ // '//cdn.jsdelivr.net/npm/vue-router@3.3.4/dist/vue-router.min.js',
28
+ // '//cdn.jsdelivr.net/npm/vuex@3.4.0/dist/vuex.min.js',
29
+ // '//cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js',
30
+ // '//cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js',
31
+ // '//cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js',
32
+ // '//cdn.jsdelivr.net/npm/@antv/data-set@0.11.4/build/data-set.min.js',
33
+ // '//cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js'
34
+ // ]
35
+ // }
36
+
37
+ const server = 'http://121.36.106.17:8400'
38
+ // const local = 'http://localhost:8445/webmeter'
39
+ const local = 'http://123.60.214.109:8405/webmeter'
40
+
41
+ module.exports = {
42
+ devServer: {
43
+ // development server port 8000
44
+ port: 8001,
45
+ // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
46
+ proxy: {
47
+ '/rs': {
48
+ target: server,
49
+ ws: false,
50
+ changeOrigin: true
51
+ },
52
+ '/image': {
53
+ target: server,
54
+ ws: false,
55
+ changeOrigin: true
56
+ },
57
+ '/webapps': {
58
+ target: server,
59
+ ws: false,
60
+ changeOrigin: true
61
+ },
62
+ '/webmeterapi': {
63
+ pathRewrite: { '^/webmeterapi': '/rs/logic' },
64
+ target: local,
65
+ changeOrigin: true
66
+ },
67
+ '/webmeteruploadapi': {
68
+ pathRewrite: { '^/webmeteruploadapi': '/rs/file' },
69
+ target: local,
70
+ changeOrigin: true
71
+ }
72
+ }
73
+ },
74
+ pluginOptions: {
75
+ 'style-resources-loader': {
76
+ preProcessor: 'less',
77
+ patterns: [path.resolve(__dirname, './src/theme/theme.less')]
78
+ }
79
+ },
80
+ configureWebpack: config => {
81
+ config.entry.app = ['babel-polyfill', 'whatwg-fetch', './src/main.js']
82
+ config.performance = {
83
+ hints: false
84
+ }
85
+ config.plugins.push(
86
+ new ThemeColorReplacer({
87
+ fileName: 'css/theme-colors-[contenthash:8].css',
88
+ matchColors: getThemeColors(),
89
+ injectCss: true,
90
+ resolveCss
91
+ })
92
+ )
93
+ // Ignore all locale files of moment.js
94
+ config.plugins.push(new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/))
95
+ // 生产环境下将资源压缩成gzip格式
96
+ if (isProd) {
97
+ // add `CompressionWebpack` plugin to webpack plugins
98
+ config.plugins.push(new CompressionWebpackPlugin({
99
+ algorithm: 'gzip',
100
+ test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
101
+ threshold: 10240,
102
+ minRatio: 0.8
103
+ }))
104
+ }
105
+ // if prod, add externals
106
+ // if (isProd) {
107
+ // config.externals = assetsCDN.externals
108
+ // }
109
+ },
110
+ chainWebpack: config => {
111
+ // 生产环境下关闭css压缩的 colormin 项,因为此项优化与主题色替换功能冲突
112
+ if (isProd) {
113
+ config.plugin('optimize-css')
114
+ .tap(args => {
115
+ args[0].cssnanoOptions.preset[1].colormin = false
116
+ return args
117
+ })
118
+ }
119
+ // 生产环境下使用CDN
120
+ // if (isProd) {
121
+ // config.plugin('html')
122
+ // .tap(args => {
123
+ // args[0].cdn = assetsCDN
124
+ // return args
125
+ // })
126
+ // }
127
+ config.resolve.alias.set('@vue2-client', path.resolve(__dirname, 'src'))
128
+ },
129
+ css: {
130
+ loaderOptions: {
131
+ less: {
132
+ lessOptions: {
133
+ modifyVars: modifyVars(),
134
+ javascriptEnabled: true
135
+ }
136
+ }
137
+ }
138
+ },
139
+ publicPath: process.env.VUE_APP_PUBLIC_PATH,
140
+ outputDir: 'dist',
141
+ assetsDir: 'static',
142
+ productionSourceMap: false
143
+ }