xs-common-plugins 1.4.8 → 1.4.10

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/.idea/vcs.xml CHANGED
@@ -1,6 +1,6 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
6
  </project>
@@ -0,0 +1,98 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AutoImportSettings">
4
+ <option name="autoReloadType" value="SELECTIVE" />
5
+ </component>
6
+ <component name="ChangeListManager">
7
+ <list default="true" id="18da8823-8844-430e-8765-342a5b83382e" name="更改" comment="fix(table): 更新单元格分析逻辑以正确处理括号- 替换正则表达式检测为 includes 方法检测括号和 null&#10;- 确保只在包含成对括号且不含 null 时才匹配&#10;&#10;chore: 升级版本号至 1.4.9">
8
+ <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
9
+ <change beforePath="$PROJECT_DIR$/src/common/common.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/common/common.js" afterDir="false" />
10
+ </list>
11
+ <option name="SHOW_DIALOG" value="false" />
12
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
13
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
14
+ <option name="LAST_RESOLUTION" value="IGNORE" />
15
+ </component>
16
+ <component name="Git.Settings">
17
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
18
+ </component>
19
+ <component name="ProjectColorInfo">{
20
+ &quot;associatedIndex&quot;: 3
21
+ }</component>
22
+ <component name="ProjectId" id="34JyttMh1dkF7QtKVN47OnvRO5X" />
23
+ <component name="ProjectViewState">
24
+ <option name="autoscrollFromSource" value="true" />
25
+ <option name="hideEmptyMiddlePackages" value="true" />
26
+ <option name="showLibraryContents" value="true" />
27
+ </component>
28
+ <component name="PropertiesComponent"><![CDATA[{
29
+ "keyToString": {
30
+ "ModuleVcsDetector.initialDetectionPerformed": "true",
31
+ "RunOnceActivity.ShowReadmeOnStart": "true",
32
+ "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
33
+ "RunOnceActivity.git.unshallow": "true",
34
+ "com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultAutoModeForALLUsers.v1": "true",
35
+ "com.intellij.ml.llm.matterhorn.ej.ui.settings.DefaultModelSelectionForGA.v1": "true",
36
+ "git-widget-placeholder": "master",
37
+ "junie.onboarding.icon.badge.shown": "true",
38
+ "node.js.detected.package.eslint": "true",
39
+ "node.js.detected.package.tslint": "true",
40
+ "node.js.selected.package.eslint": "(autodetect)",
41
+ "node.js.selected.package.tslint": "(autodetect)",
42
+ "nodejs_interpreter_path": "/Users/chengjiawei/Library/Application Support/JetBrains/WebStorm2025.2/node/versions/16.20.2/bin/node",
43
+ "nodejs_package_manager_path": "npm",
44
+ "settings.editor.selected.configurable": "settings.nodejs",
45
+ "to.speed.mode.migration.done": "true",
46
+ "vue.rearranger.settings.migration": "true"
47
+ }
48
+ }]]></component>
49
+ <component name="SharedIndexes">
50
+ <attachedChunks>
51
+ <set>
52
+ <option value="bundled-js-predefined-d6986cc7102b-3aa1da707db6-JavaScript-WS-252.27397.92" />
53
+ </set>
54
+ </attachedChunks>
55
+ </component>
56
+ <component name="TaskManager">
57
+ <task active="true" id="Default" summary="默认任务">
58
+ <changelist id="18da8823-8844-430e-8765-342a5b83382e" name="更改" comment="" />
59
+ <created>1760946186247</created>
60
+ <option name="number" value="Default" />
61
+ <option name="presentableId" value="Default" />
62
+ <updated>1760946186247</updated>
63
+ <workItem from="1760946187282" duration="11000" />
64
+ <workItem from="1760946201677" duration="480000" />
65
+ <workItem from="1760946687182" duration="513000" />
66
+ <workItem from="1761553442925" duration="558000" />
67
+ </task>
68
+ <task id="LOCAL-00001" summary="fix(table): 更新单元格分析逻辑以正确处理括号- 替换正则表达式检测为 includes 方法检测括号和 null&#10;- 确保只在包含成对括号且不含 null 时才匹配&#10;&#10;chore: 升级版本号至 1.4.9">
69
+ <option name="closed" value="true" />
70
+ <created>1760946269455</created>
71
+ <option name="number" value="00001" />
72
+ <option name="presentableId" value="LOCAL-00001" />
73
+ <option name="project" value="LOCAL" />
74
+ <updated>1760946269455</updated>
75
+ </task>
76
+ <option name="localTasksCounter" value="2" />
77
+ <servers />
78
+ </component>
79
+ <component name="TypeScriptGeneratedFilesManager">
80
+ <option name="version" value="3" />
81
+ </component>
82
+ <component name="Vcs.Log.Tabs.Properties">
83
+ <option name="TAB_STATES">
84
+ <map>
85
+ <entry key="MAIN">
86
+ <value>
87
+ <State />
88
+ </value>
89
+ </entry>
90
+ </map>
91
+ </option>
92
+ </component>
93
+ <component name="VcsManagerConfiguration">
94
+ <MESSAGE value="fix(table): 更新单元格分析逻辑以正确处理括号- 替换正则表达式检测为 includes 方法检测括号和 null" />
95
+ <MESSAGE value="fix(table): 更新单元格分析逻辑以正确处理括号- 替换正则表达式检测为 includes 方法检测括号和 null&#10;- 确保只在包含成对括号且不含 null 时才匹配&#10;&#10;chore: 升级版本号至 1.4.9" />
96
+ <option name="LAST_COMMIT_MESSAGE" value="fix(table): 更新单元格分析逻辑以正确处理括号- 替换正则表达式检测为 includes 方法检测括号和 null&#10;- 确保只在包含成对括号且不含 null 时才匹配&#10;&#10;chore: 升级版本号至 1.4.9" />
97
+ </component>
98
+ </project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xs-common-plugins",
3
- "version": "1.4.8",
3
+ "version": "1.4.10",
4
4
  "description": "向上公共代码部分",
5
5
  "author": "祝玲云 <1902733517@qq.com>",
6
6
  "main": "index.js",
@@ -590,4 +590,41 @@ common.getLabelList = (that, prop, url, query) => {
590
590
  that[prop] = res.data
591
591
  })
592
592
  }
593
+
594
+ common.checkRows2 = async (that, row, title, prop = "id", check = true) => {
595
+ if(row.length == 0) {
596
+ common.message(that, `请选择数据`, 'error');
597
+ return false;
598
+ }
599
+ if(check) {
600
+ try {
601
+ return prop ? row.map(item => item[prop]) : row
602
+ } catch (error) {
603
+ return false
604
+ }
605
+ } else {
606
+ return true
607
+ }
608
+ }
609
+
610
+ common.checkStatus = async (that, row, title, prop = "status", check = true) => {
611
+ if(row.length == 0) {
612
+ //common.message(that, `请选择数据`, 'error');
613
+ return false;
614
+ }
615
+ if(check) {
616
+ try {
617
+ //await common.confirm(that, `您确定进行${title}操作`, '操作提醒')
618
+ return prop ? row.map(item => item[prop]) : row
619
+ } catch (error) {
620
+ return false
621
+ }
622
+ } else {
623
+ return true
624
+ }
625
+ }
626
+
627
+
628
+
629
+
593
630
  export default common
@@ -1,59 +1,59 @@
1
- <template>
2
- <div class="checkbox-wrap">
3
- <el-checkbox-group v-model="checkList" @change="handleChecked">
4
- <el-checkbox v-for="(item, index) in checkSourceList" :key="index" :label="item.Id">{{ item.Text }}</el-checkbox>
5
- </el-checkbox-group>
6
- </div>
7
- </template>
8
- <script>
9
- export default {
10
- props: {
11
- value: [String, Number],
12
- sourceData: {
13
- type: Array,
14
- default: () => []
15
- }
16
- },
17
- data() {
18
- return {
19
- checkSourceList: this.sourceData,
20
- checkList: [],
21
- selfValue: this.value
22
- }
23
- },
24
- watch: {
25
- value: {
26
- immediate: true,
27
- handler(val) {
28
- this.selfValue = val
29
- this.checkList = []
30
- this.backFill()
31
- }
32
- }
33
- },
34
- methods: {
35
- handleChecked(val) {
36
- let count = 0
37
- val.forEach(item => {
38
- this.checkSourceList.forEach(_item => {
39
- if (item == _item.Id) {
40
- count += item
41
- }
42
- })
43
- })
44
- this.$emit('input', count)
45
- },
46
- backFill() {
47
- const _this = this
48
- const arr = this.checkSourceList.map(item => {
49
- return item.Id
50
- })
51
- arr.forEach((item, index) => {
52
- if ((_this.selfValue & item) > 0) {
53
- this.checkList.push(this.checkSourceList[index].Id)
54
- }
55
- })
56
- }
57
- }
58
- }
59
- </script>
1
+ <template>
2
+ <div class="checkbox-wrap">
3
+ <el-checkbox-group v-model="checkList" @change="handleChecked">
4
+ <el-checkbox v-for="(item, index) in checkSourceList" :key="index" :label="item.Id">{{ item.Text }}</el-checkbox>
5
+ </el-checkbox-group>
6
+ </div>
7
+ </template>
8
+ <script>
9
+ export default {
10
+ props: {
11
+ value: [String, Number],
12
+ sourceData: {
13
+ type: Array,
14
+ default: () => []
15
+ }
16
+ },
17
+ data() {
18
+ return {
19
+ checkSourceList: this.sourceData,
20
+ checkList: [],
21
+ selfValue: this.value
22
+ }
23
+ },
24
+ watch: {
25
+ value: {
26
+ immediate: true,
27
+ handler(val) {
28
+ this.selfValue = val
29
+ this.checkList = []
30
+ this.backFill()
31
+ }
32
+ }
33
+ },
34
+ methods: {
35
+ handleChecked(val) {
36
+ let count = 0
37
+ val.forEach(item => {
38
+ this.checkSourceList.forEach(_item => {
39
+ if (item == _item.Id) {
40
+ count += item
41
+ }
42
+ })
43
+ })
44
+ this.$emit('input', count)
45
+ },
46
+ backFill() {
47
+ const _this = this
48
+ const arr = this.checkSourceList.map(item => {
49
+ return item.Id
50
+ })
51
+ arr.forEach((item, index) => {
52
+ if ((_this.selfValue & item) > 0) {
53
+ this.checkList.push(this.checkSourceList[index].Id)
54
+ }
55
+ })
56
+ }
57
+ }
58
+ }
59
+ </script>
@@ -42,9 +42,9 @@ export const MIX_ColCellAnalysis = {
42
42
 
43
43
  let _value = "";
44
44
 
45
- var reg = /(^\()?\D*\)$/;
46
45
  //test()返回值bool类型,判断参数是否符合正则表达式
47
- var result = reg.test(group[0]);
46
+ var result = group[0].includes('(') && group[0].includes(')') && !group[0].includes('null');
47
+
48
48
  if (result) {
49
49
  _value = group[0];
50
50
  } else {
@@ -1,69 +1,69 @@
1
- import OSS from 'ali-oss'
2
- import { requestApi as axios } from 'xs-request'
3
- import store from '../store/index'
4
- import { getLocalStorage } from '@/utils/localStorage'
5
- import { getConfig } from '@/utils/global-config'
6
-
7
- let ossCfg = {}
8
-
9
- // 去哪个服务下 获取 token 信息
10
- function getOssToken() {
11
- return axios
12
- .get('@commng/UserCur/Oss/Config/' + getConfig('CLIENT_ID'))
13
- .then(({ data }) => {
14
- let timestamp = new Date().getTime()
15
- ossCfg.region = data.ossEndpoint
16
- ossCfg.bucket = data.bucketName
17
- ossCfg.accessKeyId = data.stsAccessKeyId
18
- ossCfg.accessKeySecret = data.stsAccessKeySecret
19
- ossCfg.stsToken = data.stsSecurityToken
20
- ossCfg.baseDir = data.baseDir
21
- ossCfg.timeout = timestamp + data.durationSeconds * 1000
22
- store.commit('oss/SET_OSS', ossCfg)
23
- return ossCfg
24
- })
25
- .catch(err => {
26
- console.log('获取Token错误', err)
27
- })
28
- }
29
-
30
- //自动刷新token
31
- const initOssToken = function (time) {
32
- setTimeout(() => {
33
- getOssToken()
34
- }, time)
35
- }
36
-
37
- // 从 vuex 中 获取初始化值
38
- const initToken = async function () {
39
- ossCfg = store.getters.ossCfg
40
- let timestamp = new Date().getTime()
41
- // 有效期内不发送获取token 请求
42
- let endTime = ossCfg.timeout - timestamp - 1000 * 60 // 提前1分钟刷新
43
- initOssToken(endTime)
44
- if (ossCfg.region && ossCfg.timeout > timestamp) {
45
- return Promise.resolve(ossCfg)
46
- }
47
- return getOssToken()
48
- }
49
-
50
- const newFileName = function (id = getConfig('CLIENT_ID'), userid = getLocalStorage('userProfile').id) {
51
- let dt = new Date()
52
- let y = dt.getFullYear()
53
- let m = dt.getMonth() + 1 < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth() + 1
54
- let d = dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate()
55
- return `${ossCfg.baseDir}/${userid}/${y}${m}${d}/${id}_${dt.getTime()}` // 定义唯一的文件名
56
- }
57
-
58
- const ossService = {
59
- token: ossCfg,
60
- initToken,
61
- newFileName,
62
- _ossClient: null,
63
- getOssClient() {
64
- this._ossClient = new OSS(ossCfg)
65
- return this._ossClient
66
- }
67
- }
68
-
69
- export default ossService
1
+ import OSS from 'ali-oss'
2
+ import { requestApi as axios } from 'xs-request'
3
+ import store from '../store/index'
4
+ import { getLocalStorage } from '@/utils/localStorage'
5
+ import { getConfig } from '@/utils/global-config'
6
+
7
+ let ossCfg = {}
8
+
9
+ // 去哪个服务下 获取 token 信息
10
+ function getOssToken() {
11
+ return axios
12
+ .get('@commng/UserCur/Oss/Config/' + getConfig('CLIENT_ID'))
13
+ .then(({ data }) => {
14
+ let timestamp = new Date().getTime()
15
+ ossCfg.region = data.ossEndpoint
16
+ ossCfg.bucket = data.bucketName
17
+ ossCfg.accessKeyId = data.stsAccessKeyId
18
+ ossCfg.accessKeySecret = data.stsAccessKeySecret
19
+ ossCfg.stsToken = data.stsSecurityToken
20
+ ossCfg.baseDir = data.baseDir
21
+ ossCfg.timeout = timestamp + data.durationSeconds * 1000
22
+ store.commit('oss/SET_OSS', ossCfg)
23
+ return ossCfg
24
+ })
25
+ .catch(err => {
26
+ console.log('获取Token错误', err)
27
+ })
28
+ }
29
+
30
+ //自动刷新token
31
+ const initOssToken = function (time) {
32
+ setTimeout(() => {
33
+ getOssToken()
34
+ }, time)
35
+ }
36
+
37
+ // 从 vuex 中 获取初始化值
38
+ const initToken = async function () {
39
+ ossCfg = store.getters.ossCfg
40
+ let timestamp = new Date().getTime()
41
+ // 有效期内不发送获取token 请求
42
+ let endTime = ossCfg.timeout - timestamp - 1000 * 60 // 提前1分钟刷新
43
+ initOssToken(endTime)
44
+ if (ossCfg.region && ossCfg.timeout > timestamp) {
45
+ return Promise.resolve(ossCfg)
46
+ }
47
+ return getOssToken()
48
+ }
49
+
50
+ const newFileName = function (id = getConfig('CLIENT_ID'), userid = getLocalStorage('userProfile').id) {
51
+ let dt = new Date()
52
+ let y = dt.getFullYear()
53
+ let m = dt.getMonth() + 1 < 10 ? '0' + (dt.getMonth() + 1) : dt.getMonth() + 1
54
+ let d = dt.getDate() < 10 ? '0' + dt.getDate() : dt.getDate()
55
+ return `${ossCfg.baseDir}/${userid}/${y}${m}${d}/${id}_${dt.getTime()}` // 定义唯一的文件名
56
+ }
57
+
58
+ const ossService = {
59
+ token: ossCfg,
60
+ initToken,
61
+ newFileName,
62
+ _ossClient: null,
63
+ getOssClient() {
64
+ this._ossClient = new OSS(ossCfg)
65
+ return this._ossClient
66
+ }
67
+ }
68
+
69
+ export default ossService
@@ -1,42 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="CssInvalidPropertyValue" enabled="false" level="ERROR" enabled_by_default="false" />
5
- <inspection_tool class="HtmlRequiredAltAttribute" enabled="false" level="WARNING" enabled_by_default="false" />
6
- <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
7
- <option name="myValues">
8
- <value>
9
- <list size="3">
10
- <item index="0" class="java.lang.String" itemvalue="src" />
11
- <item index="1" class="java.lang.String" itemvalue="open-type" />
12
- <item index="2" class="java.lang.String" itemvalue="class" />
13
- </list>
14
- </value>
15
- </option>
16
- <option name="myCustomValuesEnabled" value="true" />
17
- </inspection_tool>
18
- <inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
19
- <option name="myValues">
20
- <value>
21
- <list size="13">
22
- <item index="0" class="java.lang.String" itemvalue="nobr" />
23
- <item index="1" class="java.lang.String" itemvalue="noembed" />
24
- <item index="2" class="java.lang.String" itemvalue="comment" />
25
- <item index="3" class="java.lang.String" itemvalue="noscript" />
26
- <item index="4" class="java.lang.String" itemvalue="embed" />
27
- <item index="5" class="java.lang.String" itemvalue="script" />
28
- <item index="6" class="java.lang.String" itemvalue="page" />
29
- <item index="7" class="java.lang.String" itemvalue="contact-button" />
30
- <item index="8" class="java.lang.String" itemvalue="web-view" />
31
- <item index="9" class="java.lang.String" itemvalue="block" />
32
- <item index="10" class="java.lang.String" itemvalue="scroll-view" />
33
- <item index="11" class="java.lang.String" itemvalue="swiper" />
34
- <item index="12" class="java.lang.String" itemvalue="swiper-item" />
35
- </list>
36
- </value>
37
- </option>
38
- <option name="myCustomValuesEnabled" value="true" />
39
- </inspection_tool>
40
- <inspection_tool class="JSEqualityComparisonWithCoercion" enabled="false" level="WARNING" enabled_by_default="false" />
41
- </profile>
42
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/xs-common-plugins.iml" filepath="$PROJECT_DIR$/.idea/xs-common-plugins.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>