vue2-client 1.7.0 → 1.7.1
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/.env +15 -15
- package/CHANGELOG.md +31 -1
- package/Components.md +60 -0
- package/index.js +39 -30
- package/package.json +4 -2
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
- package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -667
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +735 -733
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +466 -468
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +510 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +144 -146
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/Upload/Upload.vue +168 -168
- package/src/base-client/components/common/XAddForm/XAddForm.vue +72 -325
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +365 -279
- package/src/base-client/components/common/XAddNativeForm/index.md +96 -56
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -0
- package/src/base-client/components/common/XDataDrawer/index.js +3 -0
- package/src/base-client/components/common/XDataDrawer/index.md +41 -0
- package/src/base-client/components/common/XForm/XForm.vue +178 -180
- package/src/base-client/components/common/XForm/XFormItem.vue +521 -513
- package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
- package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
- package/src/base-client/components/common/XFormTable/XFormTable.vue +356 -344
- package/src/base-client/components/common/XFormTable/index.md +97 -97
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
- package/src/base-client/components/common/XTable/XTable.vue +519 -506
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +76 -76
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +62 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/CreateQueryConfig.js +307 -307
- package/src/config/default/admin.config.js +18 -18
- package/src/config/default/setting.config.js +3 -1
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +116 -116
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +134 -134
- package/src/layouts/header/HeaderAvatar.vue +64 -64
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/mock/goods/index.js +108 -108
- package/src/pages/CreateQueryPage.vue +84 -84
- package/src/pages/login/Login.vue +369 -369
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +43 -43
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/monitor/loginInfor/index.vue +36 -36
- package/src/pages/system/monitor/operLog/index.vue +36 -36
- package/src/pages/system/settings/index.vue +126 -126
- package/src/pages/system/settings/modifyPassword.vue +109 -109
- package/src/router/async/config.async.js +28 -28
- package/src/router/async/router.map.js +66 -66
- package/src/router/guards.js +52 -12
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +137 -137
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +67 -67
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +58 -58
- package/src/utils/EncryptUtil.js +53 -53
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/login.js +138 -0
- package/src/utils/map-utils.js +37 -37
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# TicketDetailsView 工单详情页
|
|
2
|
-
|
|
3
|
-
提供一个可以对单个工单进行一系列通用业务操作的抽屉实现
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## 何时使用
|
|
8
|
-
|
|
9
|
-
允许用户对单个工单进行一系列通用业务操作
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## 代码演示
|
|
14
|
-
|
|
15
|
-
```html
|
|
16
|
-
<ticket-details-view
|
|
17
|
-
:visible.sync="detailVisible"
|
|
18
|
-
:ticketId="ticketId"
|
|
19
|
-
v-if="ticketId"
|
|
20
|
-
/>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## API
|
|
24
|
-
|
|
25
|
-
| 参数 | 说明 | 类型 | 默认值 |
|
|
26
|
-
|---------------|-------|---------|-------|
|
|
27
|
-
| detailVisible | 是否显示 | Boolean | false |
|
|
28
|
-
| ticketId | 工单编号 | String | null |
|
|
29
|
-
| id | 负责人id | String | null |
|
|
1
|
+
# TicketDetailsView 工单详情页
|
|
2
|
+
|
|
3
|
+
提供一个可以对单个工单进行一系列通用业务操作的抽屉实现
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
## 何时使用
|
|
8
|
+
|
|
9
|
+
允许用户对单个工单进行一系列通用业务操作
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## 代码演示
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<ticket-details-view
|
|
17
|
+
:visible.sync="detailVisible"
|
|
18
|
+
:ticketId="ticketId"
|
|
19
|
+
v-if="ticketId"
|
|
20
|
+
/>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## API
|
|
24
|
+
|
|
25
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
26
|
+
|---------------|-------|---------|-------|
|
|
27
|
+
| detailVisible | 是否显示 | Boolean | false |
|
|
28
|
+
| ticketId | 工单编号 | String | null |
|
|
29
|
+
| id | 负责人id | String | null |
|
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
import { manageApi, post } from '@vue2-client/services/api'
|
|
2
|
-
import { handleTree } from '@vue2-client/utils/util'
|
|
3
|
-
|
|
4
|
-
const GetAppDataService = {
|
|
5
|
-
install (Vue) {
|
|
6
|
-
// 给vue增添对话框显示方法
|
|
7
|
-
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
|
|
8
|
-
},
|
|
9
|
-
async load () {
|
|
10
|
-
localStorage.removeItem(undefined)
|
|
11
|
-
const params = {}
|
|
12
|
-
await post(manageApi.getDictionaryValue, {}).then((res) => {
|
|
13
|
-
Object.assign(params, res)
|
|
14
|
-
const badgeItemArray = {}
|
|
15
|
-
for (const key of Object.keys(params)) {
|
|
16
|
-
badgeItemArray[key] = {}
|
|
17
|
-
for (const item of params[key]) {
|
|
18
|
-
let status
|
|
19
|
-
if (!item.status) {
|
|
20
|
-
status = 'none'
|
|
21
|
-
} else {
|
|
22
|
-
status = item.status
|
|
23
|
-
}
|
|
24
|
-
badgeItemArray[key][item.value] = {
|
|
25
|
-
status: status,
|
|
26
|
-
text: item.text
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
// 追加参数
|
|
31
|
-
localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
|
|
32
|
-
localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
// 返回树形省市区
|
|
36
|
-
async getDivisionsOhChinaForTree () {
|
|
37
|
-
let list = this.getDivisionsOhChinaForList()
|
|
38
|
-
// 获取省市区数据
|
|
39
|
-
if (!list) {
|
|
40
|
-
await post(manageApi.getDivisionsOhChina, {}).then((res) => {
|
|
41
|
-
list = res
|
|
42
|
-
// localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
return handleTree(list, 'code', 'parentcode')
|
|
46
|
-
},
|
|
47
|
-
// 返回列表省市区
|
|
48
|
-
getDivisionsOhChinaForList () {
|
|
49
|
-
const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
|
|
50
|
-
return JSON.parse(str)
|
|
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
|
-
getParam (key, value) {
|
|
58
|
-
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
59
|
-
const object = JSON.parse(str)
|
|
60
|
-
const result = object[key]
|
|
61
|
-
if (result && result.hasOwnProperty(value)) {
|
|
62
|
-
return result[value]
|
|
63
|
-
} else {
|
|
64
|
-
return null
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
getParams () {
|
|
68
|
-
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
69
|
-
return JSON.parse(str)
|
|
70
|
-
},
|
|
71
|
-
getSingleValues () {
|
|
72
|
-
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
73
|
-
return JSON.parse(str)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
export default GetAppDataService
|
|
1
|
+
import { manageApi, post } from '@vue2-client/services/api'
|
|
2
|
+
import { handleTree } from '@vue2-client/utils/util'
|
|
3
|
+
|
|
4
|
+
const GetAppDataService = {
|
|
5
|
+
install (Vue) {
|
|
6
|
+
// 给vue增添对话框显示方法
|
|
7
|
+
Vue.$appdata = Vue.prototype.$appdata = GetAppDataService
|
|
8
|
+
},
|
|
9
|
+
async load () {
|
|
10
|
+
localStorage.removeItem(undefined)
|
|
11
|
+
const params = {}
|
|
12
|
+
await post(manageApi.getDictionaryValue, {}).then((res) => {
|
|
13
|
+
Object.assign(params, res)
|
|
14
|
+
const badgeItemArray = {}
|
|
15
|
+
for (const key of Object.keys(params)) {
|
|
16
|
+
badgeItemArray[key] = {}
|
|
17
|
+
for (const item of params[key]) {
|
|
18
|
+
let status
|
|
19
|
+
if (!item.status) {
|
|
20
|
+
status = 'none'
|
|
21
|
+
} else {
|
|
22
|
+
status = item.status
|
|
23
|
+
}
|
|
24
|
+
badgeItemArray[key][item.value] = {
|
|
25
|
+
status: status,
|
|
26
|
+
text: item.text
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// 追加参数
|
|
31
|
+
localStorage.setItem(process.env.VUE_APP_DICTIONARY_KEY, JSON.stringify(params))
|
|
32
|
+
localStorage.setItem(process.env.VUE_APP_BADGE_KEY, JSON.stringify(badgeItemArray))
|
|
33
|
+
})
|
|
34
|
+
},
|
|
35
|
+
// 返回树形省市区
|
|
36
|
+
async getDivisionsOhChinaForTree () {
|
|
37
|
+
let list = this.getDivisionsOhChinaForList()
|
|
38
|
+
// 获取省市区数据
|
|
39
|
+
if (!list) {
|
|
40
|
+
await post(manageApi.getDivisionsOhChina, {}).then((res) => {
|
|
41
|
+
list = res
|
|
42
|
+
// localStorage.setItem(process.env.VUE_APP_DIVISIONSOHCHINA, JSON.stringify(res))
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
return handleTree(list, 'code', 'parentcode')
|
|
46
|
+
},
|
|
47
|
+
// 返回列表省市区
|
|
48
|
+
getDivisionsOhChinaForList () {
|
|
49
|
+
const str = localStorage.getItem(process.env.VUE_APP_DIVISIONSOHCHINA)
|
|
50
|
+
return JSON.parse(str)
|
|
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
|
+
getParam (key, value) {
|
|
58
|
+
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
59
|
+
const object = JSON.parse(str)
|
|
60
|
+
const result = object[key]
|
|
61
|
+
if (result && result.hasOwnProperty(value)) {
|
|
62
|
+
return result[value]
|
|
63
|
+
} else {
|
|
64
|
+
return null
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
getParams () {
|
|
68
|
+
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
69
|
+
return JSON.parse(str)
|
|
70
|
+
},
|
|
71
|
+
getSingleValues () {
|
|
72
|
+
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
73
|
+
return JSON.parse(str)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export default GetAppDataService
|
|
@@ -1,179 +1,179 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import { SEARCH } from '@vue2-client/services/apiService'
|
|
3
|
-
import { post } from '@vue2-client/services/api'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 获取片区
|
|
7
|
-
* @returns {Promise<void>}
|
|
8
|
-
*/
|
|
9
|
-
// eslint-disable-next-line
|
|
10
|
-
async function getAllArea () {
|
|
11
|
-
try {
|
|
12
|
-
const getAllArea = await post(SEARCH, {
|
|
13
|
-
source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
|
|
14
|
-
userid: Vue.$login.f.id
|
|
15
|
-
})
|
|
16
|
-
const areaTemp = []
|
|
17
|
-
for (let i = 0; i < getAllArea.length; i++) {
|
|
18
|
-
areaTemp.push({ label: getAllArea[i].name, value: getAllArea[i] })
|
|
19
|
-
}
|
|
20
|
-
Vue.$login.f.f_allArea = areaTemp
|
|
21
|
-
} catch (error) {
|
|
22
|
-
Vue.$login.f.f_allArea = []
|
|
23
|
-
console.log('获取片区异常', error)
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* 获取抄表员
|
|
28
|
-
* @returns {Promise<void>}
|
|
29
|
-
*/
|
|
30
|
-
// eslint-disable-next-line
|
|
31
|
-
async function getGasman () {
|
|
32
|
-
try {
|
|
33
|
-
const getGasman = await post(SEARCH, {
|
|
34
|
-
source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
|
|
35
|
-
userid: Vue.$login.f.id
|
|
36
|
-
})
|
|
37
|
-
const gasman = []
|
|
38
|
-
for (let i = 0; i < getGasman.length; i++) {
|
|
39
|
-
gasman.push(getGasman[i])
|
|
40
|
-
}
|
|
41
|
-
Vue.$login.f.f_gasman = gasman
|
|
42
|
-
} catch (error) {
|
|
43
|
-
Vue.$login.f.f_gasman = []
|
|
44
|
-
console.log('获取抄表员异常', error)
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* 获取资源服务权限
|
|
49
|
-
* @returns {Promise<void>}
|
|
50
|
-
*/
|
|
51
|
-
// eslint-disable-next-line
|
|
52
|
-
async function getLic () {
|
|
53
|
-
try {
|
|
54
|
-
const getLic = await post(SEARCH, { data: {
|
|
55
|
-
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
|
|
56
|
-
userid: Vue.$login.f.id
|
|
57
|
-
} }, { resolveMsg: null, rejectMsg: null })
|
|
58
|
-
const arry = []
|
|
59
|
-
getLic.forEach((item) => {
|
|
60
|
-
arry.push(item.name)
|
|
61
|
-
})
|
|
62
|
-
Vue.$login.f.lics = arry
|
|
63
|
-
} catch (error) {
|
|
64
|
-
Vue.$login.f.f_gasman = []
|
|
65
|
-
console.log('获取资源服务权限异常', error)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* 获取界面细节 (界面权限)
|
|
71
|
-
* @returns {Promise<void>}
|
|
72
|
-
*/
|
|
73
|
-
// eslint-disable-next-line
|
|
74
|
-
async function getViewDetails () {
|
|
75
|
-
try {
|
|
76
|
-
const viewDetails = await post(SEARCH, {
|
|
77
|
-
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
|
|
78
|
-
userid: Vue.$login.f.id
|
|
79
|
-
}, { resolveMsg: null, rejectMsg: null })
|
|
80
|
-
const r = viewDetails
|
|
81
|
-
Vue.$login.r = []
|
|
82
|
-
r.forEach(x => Vue.$login.r.push(x.name))
|
|
83
|
-
} catch (error) {
|
|
84
|
-
Vue.$login.r = []
|
|
85
|
-
console.log('获取界面细节异常', error)
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* 获取资源功能
|
|
90
|
-
* @returns {Promise<void>}
|
|
91
|
-
*/
|
|
92
|
-
async function getResourceFunction () {
|
|
93
|
-
try {
|
|
94
|
-
const resourceFunction = await post(SEARCH, {
|
|
95
|
-
source: 'tool.getFullTree(this.getRights().where(row.getName() == $组织管理$||row.getName() == $功能管理$||row.getName() == $部门管理$ || row.getName() == $角色管理$ || row.getName() == $人员管理$|| row.getName() == $资源调配$ ))',
|
|
96
|
-
userid: Vue.$login.f.id
|
|
97
|
-
}, { resolveMsg: null, rejectMsg: null })
|
|
98
|
-
return resourceFunction
|
|
99
|
-
} catch (error) {
|
|
100
|
-
console.log('获取资源功能异常', error)
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* 获取组织管理数据
|
|
105
|
-
* @returns {Promise<void>}
|
|
106
|
-
*/
|
|
107
|
-
async function getOrganization () {
|
|
108
|
-
try {
|
|
109
|
-
const resourceFunction = await post(SEARCH, {
|
|
110
|
-
source: 'tool.getFullTree(this.getRights().where(row.getType() == $organization$||row.getType() == $zone$))',
|
|
111
|
-
userid: Vue.$login.f.id
|
|
112
|
-
}, { resolveMsg: null, rejectMsg: null })
|
|
113
|
-
return resourceFunction
|
|
114
|
-
} catch (error) {
|
|
115
|
-
console.log('获取组织管理数据异常', error)
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* 完整资源树筛选指定名称的资源
|
|
120
|
-
* @param fun 要筛选的资源树
|
|
121
|
-
* @param name 筛选的资源名称
|
|
122
|
-
* @returns {*}
|
|
123
|
-
*/
|
|
124
|
-
function searchFun (fun, name) {
|
|
125
|
-
if (fun.length > 0) {
|
|
126
|
-
if (fun[0].name === name) {
|
|
127
|
-
return fun[0].children
|
|
128
|
-
} else {
|
|
129
|
-
return searchFun(fun[0].children, name)
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const loginGen = async function (response) {
|
|
135
|
-
Vue.$login.f = response
|
|
136
|
-
await Promise.all([Vue.$appdata.load()])
|
|
137
|
-
const login = {
|
|
138
|
-
f: Vue.$login.f,
|
|
139
|
-
jwt: Vue.$login.f.id,
|
|
140
|
-
r: Vue.$login.r
|
|
141
|
-
}
|
|
142
|
-
Vue.$store.commit('account/setLogin', login)
|
|
143
|
-
}
|
|
144
|
-
const GetLoginInfoService = {
|
|
145
|
-
install (Vue) {
|
|
146
|
-
// 给vue增添对话框显示方法
|
|
147
|
-
Vue.$login = Vue.prototype.$login = GetLoginInfoService
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
f: {
|
|
151
|
-
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
login (response) {
|
|
155
|
-
return loginGen(response)
|
|
156
|
-
},
|
|
157
|
-
required (param) {
|
|
158
|
-
if (typeof param === 'number' && param === 0) {
|
|
159
|
-
return false
|
|
160
|
-
}
|
|
161
|
-
if (!param) {
|
|
162
|
-
return true
|
|
163
|
-
}
|
|
164
|
-
param = param + ''
|
|
165
|
-
param = param.trim()
|
|
166
|
-
return !param
|
|
167
|
-
},
|
|
168
|
-
// 不能选择器中截取掉多余的字符
|
|
169
|
-
orgName (name) {
|
|
170
|
-
return name.substring(10)
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export default GetLoginInfoService
|
|
175
|
-
export {
|
|
176
|
-
getResourceFunction,
|
|
177
|
-
getOrganization,
|
|
178
|
-
searchFun
|
|
179
|
-
}
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { SEARCH } from '@vue2-client/services/apiService'
|
|
3
|
+
import { post } from '@vue2-client/services/api'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 获取片区
|
|
7
|
+
* @returns {Promise<void>}
|
|
8
|
+
*/
|
|
9
|
+
// eslint-disable-next-line
|
|
10
|
+
async function getAllArea () {
|
|
11
|
+
try {
|
|
12
|
+
const getAllArea = await post(SEARCH, {
|
|
13
|
+
source: 'this.getParentByType($organization$).getChildByName($片区$).getChildren()',
|
|
14
|
+
userid: Vue.$login.f.id
|
|
15
|
+
})
|
|
16
|
+
const areaTemp = []
|
|
17
|
+
for (let i = 0; i < getAllArea.length; i++) {
|
|
18
|
+
areaTemp.push({ label: getAllArea[i].name, value: getAllArea[i] })
|
|
19
|
+
}
|
|
20
|
+
Vue.$login.f.f_allArea = areaTemp
|
|
21
|
+
} catch (error) {
|
|
22
|
+
Vue.$login.f.f_allArea = []
|
|
23
|
+
console.log('获取片区异常', error)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 获取抄表员
|
|
28
|
+
* @returns {Promise<void>}
|
|
29
|
+
*/
|
|
30
|
+
// eslint-disable-next-line
|
|
31
|
+
async function getGasman () {
|
|
32
|
+
try {
|
|
33
|
+
const getGasman = await post(SEARCH, {
|
|
34
|
+
source: 'this.getParentByType($organization$).getChildByName($抄表员$).getUsers()',
|
|
35
|
+
userid: Vue.$login.f.id
|
|
36
|
+
})
|
|
37
|
+
const gasman = []
|
|
38
|
+
for (let i = 0; i < getGasman.length; i++) {
|
|
39
|
+
gasman.push(getGasman[i])
|
|
40
|
+
}
|
|
41
|
+
Vue.$login.f.f_gasman = gasman
|
|
42
|
+
} catch (error) {
|
|
43
|
+
Vue.$login.f.f_gasman = []
|
|
44
|
+
console.log('获取抄表员异常', error)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 获取资源服务权限
|
|
49
|
+
* @returns {Promise<void>}
|
|
50
|
+
*/
|
|
51
|
+
// eslint-disable-next-line
|
|
52
|
+
async function getLic () {
|
|
53
|
+
try {
|
|
54
|
+
const getLic = await post(SEARCH, { data: {
|
|
55
|
+
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($资源操作$) != -1)',
|
|
56
|
+
userid: Vue.$login.f.id
|
|
57
|
+
} }, { resolveMsg: null, rejectMsg: null })
|
|
58
|
+
const arry = []
|
|
59
|
+
getLic.forEach((item) => {
|
|
60
|
+
arry.push(item.name)
|
|
61
|
+
})
|
|
62
|
+
Vue.$login.f.lics = arry
|
|
63
|
+
} catch (error) {
|
|
64
|
+
Vue.$login.f.f_gasman = []
|
|
65
|
+
console.log('获取资源服务权限异常', error)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* 获取界面细节 (界面权限)
|
|
71
|
+
* @returns {Promise<void>}
|
|
72
|
+
*/
|
|
73
|
+
// eslint-disable-next-line
|
|
74
|
+
async function getViewDetails () {
|
|
75
|
+
try {
|
|
76
|
+
const viewDetails = await post(SEARCH, {
|
|
77
|
+
source: 'this.getRights().where(row.getType()==$function$ && row.getPath($name$).indexOf($功能权限$) != -1)',
|
|
78
|
+
userid: Vue.$login.f.id
|
|
79
|
+
}, { resolveMsg: null, rejectMsg: null })
|
|
80
|
+
const r = viewDetails
|
|
81
|
+
Vue.$login.r = []
|
|
82
|
+
r.forEach(x => Vue.$login.r.push(x.name))
|
|
83
|
+
} catch (error) {
|
|
84
|
+
Vue.$login.r = []
|
|
85
|
+
console.log('获取界面细节异常', error)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* 获取资源功能
|
|
90
|
+
* @returns {Promise<void>}
|
|
91
|
+
*/
|
|
92
|
+
async function getResourceFunction () {
|
|
93
|
+
try {
|
|
94
|
+
const resourceFunction = await post(SEARCH, {
|
|
95
|
+
source: 'tool.getFullTree(this.getRights().where(row.getName() == $组织管理$||row.getName() == $功能管理$||row.getName() == $部门管理$ || row.getName() == $角色管理$ || row.getName() == $人员管理$|| row.getName() == $资源调配$ ))',
|
|
96
|
+
userid: Vue.$login.f.id
|
|
97
|
+
}, { resolveMsg: null, rejectMsg: null })
|
|
98
|
+
return resourceFunction
|
|
99
|
+
} catch (error) {
|
|
100
|
+
console.log('获取资源功能异常', error)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* 获取组织管理数据
|
|
105
|
+
* @returns {Promise<void>}
|
|
106
|
+
*/
|
|
107
|
+
async function getOrganization () {
|
|
108
|
+
try {
|
|
109
|
+
const resourceFunction = await post(SEARCH, {
|
|
110
|
+
source: 'tool.getFullTree(this.getRights().where(row.getType() == $organization$||row.getType() == $zone$))',
|
|
111
|
+
userid: Vue.$login.f.id
|
|
112
|
+
}, { resolveMsg: null, rejectMsg: null })
|
|
113
|
+
return resourceFunction
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.log('获取组织管理数据异常', error)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 完整资源树筛选指定名称的资源
|
|
120
|
+
* @param fun 要筛选的资源树
|
|
121
|
+
* @param name 筛选的资源名称
|
|
122
|
+
* @returns {*}
|
|
123
|
+
*/
|
|
124
|
+
function searchFun (fun, name) {
|
|
125
|
+
if (fun.length > 0) {
|
|
126
|
+
if (fun[0].name === name) {
|
|
127
|
+
return fun[0].children
|
|
128
|
+
} else {
|
|
129
|
+
return searchFun(fun[0].children, name)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const loginGen = async function (response) {
|
|
135
|
+
Vue.$login.f = response
|
|
136
|
+
await Promise.all([Vue.$appdata.load()])
|
|
137
|
+
const login = {
|
|
138
|
+
f: Vue.$login.f,
|
|
139
|
+
jwt: Vue.$login.f.id,
|
|
140
|
+
r: Vue.$login.r
|
|
141
|
+
}
|
|
142
|
+
Vue.$store.commit('account/setLogin', login)
|
|
143
|
+
}
|
|
144
|
+
const GetLoginInfoService = {
|
|
145
|
+
install (Vue) {
|
|
146
|
+
// 给vue增添对话框显示方法
|
|
147
|
+
Vue.$login = Vue.prototype.$login = GetLoginInfoService
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
f: {
|
|
151
|
+
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
login (response) {
|
|
155
|
+
return loginGen(response)
|
|
156
|
+
},
|
|
157
|
+
required (param) {
|
|
158
|
+
if (typeof param === 'number' && param === 0) {
|
|
159
|
+
return false
|
|
160
|
+
}
|
|
161
|
+
if (!param) {
|
|
162
|
+
return true
|
|
163
|
+
}
|
|
164
|
+
param = param + ''
|
|
165
|
+
param = param.trim()
|
|
166
|
+
return !param
|
|
167
|
+
},
|
|
168
|
+
// 不能选择器中截取掉多余的字符
|
|
169
|
+
orgName (name) {
|
|
170
|
+
return name.substring(10)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export default GetLoginInfoService
|
|
175
|
+
export {
|
|
176
|
+
getResourceFunction,
|
|
177
|
+
getOrganization,
|
|
178
|
+
searchFun
|
|
179
|
+
}
|