gcs-ui-lib 1.2.15 → 1.2.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gcs-ui-lib",
3
- "version": "1.2.15",
3
+ "version": "1.2.16",
4
4
  "private": false,
5
5
  "main": "./lib/gcs-ui-lib.common.js",
6
6
  "scripts": {
@@ -573,7 +573,7 @@ export default {
573
573
  });
574
574
  },
575
575
  setChange(list) {
576
- const index = list.findIndex((res) => res.isNew && !res.children);
576
+ const index = list.findIndex((res) => !res.children);
577
577
  if (index !== -1) return this.$message.warning(`新增字段必须包含子级!`);
578
578
  let dto = {
579
579
  approvalType: "6",
@@ -736,7 +736,7 @@ export default {
736
736
  ...this.pageObj,
737
737
  // conditions,
738
738
  typeCodes: this.appNo === 'CTMS'
739
- ? (this.searchObj.typeCodes?.length ? this.searchObj.typeCodes : specialCodes)
739
+ ? (this.searchObj.typeCodes.length ? this.searchObj.typeCodes : specialCodes)
740
740
  : this.searchObj.typeCodes,
741
741
  };
742
742
  delete params.states;
@@ -1,69 +1,84 @@
1
- import { axios } from 'n20-common-lib'
1
+ import { axios } from "n20-common-lib";
2
2
 
3
3
  export default {
4
4
  data() {
5
5
  return {
6
- eyeView: false
7
- }
6
+ eyeView: false,
7
+ };
8
8
  },
9
9
  methods: {
10
10
  // 排序
11
- sortMethod({ data, column, property, order }) {
11
+ sortMethod({ data, sortList }) {
12
+ //兼容预算的高版本
13
+ if (!sortList || sortList.length === 0) return;
14
+ let { field, order } = sortList[0];
12
15
  data.sort((a, b) => {
13
16
  // 处理字段为空的情况,确保空值始终排在最后
14
- const aValue = a[property]
15
- const bValue = b[property]
17
+ const aValue = a[field];
18
+ const bValue = b[field];
16
19
 
17
20
  // 统一比较逻辑
18
21
  const compare = (v1, v2) => {
19
- if (typeof v1 === 'string' && typeof v2 === 'string') {
20
- return v1.localeCompare(v2)
22
+ if (typeof v1 === "string" && typeof v2 === "string") {
23
+ return v1.localeCompare(v2);
21
24
  } else {
22
- return v1 - v2
25
+ return v1 - v2;
23
26
  }
24
- }
27
+ };
25
28
  // 处理空值,确保空值始终排在最后
26
- if (aValue === 0 || aValue === null) return order === 'asc' ? 1 : -1
27
- if (bValue === 0 || bValue === null) return order === 'asc' ? -1 : 1
29
+ if (aValue === 0 || aValue === null) return order === "asc" ? 1 : -1;
30
+ if (bValue === 0 || bValue === null) return order === "asc" ? -1 : 1;
28
31
  // 根据排序顺序返回结果
29
- return order === 'desc' ? compare(bValue, aValue) : compare(aValue, bValue)
30
- })
32
+ return order === "desc"
33
+ ? compare(bValue, aValue)
34
+ : compare(aValue, bValue);
35
+ });
31
36
  },
32
37
  getDynamicColumn(typeCode = undefined, approvalType) {
33
- axios.get(`/bems/activiti/actNsSortColumn/querySortColumn/${typeCode}/${approvalType}`).then(({ data }) => {
34
- this.checkColumns =
35
- data && data.sortColumn && data.sortColumn.length > 0 ? JSON.parse(data.sortColumn) : this.originColumn
36
- })
38
+ axios
39
+ .get(
40
+ `/bems/activiti/actNsSortColumn/querySortColumn/${typeCode}/${approvalType}`
41
+ )
42
+ .then(({ data }) => {
43
+ this.checkColumns =
44
+ data && data.sortColumn && data.sortColumn.length > 0
45
+ ? JSON.parse(data.sortColumn)
46
+ : this.originColumn;
47
+ });
37
48
  },
38
49
  saveDynamicColumn(data) {
39
50
  axios.post(`/bems/activiti/actNsSortColumn/saveOrUpDateColumn`, data, {
40
- noMsg: true
41
- })
42
- this.dialogVisible = false
51
+ noMsg: true,
52
+ });
53
+ this.dialogVisible = false;
43
54
  },
44
55
  /**
45
56
  * 查看业务状态
46
57
  */
47
58
  async seeBussStatus() {
48
59
  if (!this.eyeView) {
49
- this.eyeView = true
50
- let dto = (this.tableDate||[]).map((res) => {
60
+ this.eyeView = true;
61
+ let dto = (this.tableDate || []).map((res) => {
51
62
  return {
52
63
  businessId: res.businessId,
53
- typeCode: res.typeCode
54
- }
55
- })
64
+ typeCode: res.typeCode,
65
+ };
66
+ });
56
67
  let dtos = {
57
- dtos: dto
58
- }
59
- const { data, code } = await this.$axios.post(`/api/settlement-order/api/position/order/work/flow`, dtos)
68
+ dtos: dto,
69
+ };
70
+ const { data, code } = await this.$axios.post(
71
+ `/api/settlement-order/api/position/order/work/flow`,
72
+ dtos
73
+ );
60
74
  if (code === 200) {
61
- this.tableDate = (this.tableDate||[]).map((res) => {
62
- res[`${res.businessId}${res.typeCode}`] = data[`${res.businessId}${res.typeCode}`]
63
- return res
64
- })
75
+ this.tableDate = (this.tableDate || []).map((res) => {
76
+ res[`${res.businessId}${res.typeCode}`] =
77
+ data[`${res.businessId}${res.typeCode}`];
78
+ return res;
79
+ });
65
80
  }
66
81
  }
67
- }
68
- }
69
- }
82
+ },
83
+ },
84
+ };
package/src/App.vue CHANGED
@@ -7,7 +7,7 @@
7
7
  <el-container>
8
8
  <el-header>组件演示</el-header>
9
9
  <el-main>
10
- <router-view />
10
+ <router-view style="height: calc(100% - 60px);"/>
11
11
  </el-main>
12
12
  </el-container>
13
13
  </el-container>