|
@@ -383,6 +383,7 @@ import website from '~src/config'
|
|
import { getDictionaryData } from '~uti/tools'
|
|
import { getDictionaryData } from '~uti/tools'
|
|
import { getDictionary, userConfigSave } from '~api/other'
|
|
import { getDictionary, userConfigSave } from '~api/other'
|
|
import { useClick } from 'hc-vue3-ui'
|
|
import { useClick } from 'hc-vue3-ui'
|
|
|
|
+import { nodeModuleNameResolver } from 'typescript'
|
|
|
|
|
|
//变量
|
|
//变量
|
|
const useAppState = useAppStore()
|
|
const useAppState = useAppStore()
|
|
@@ -1262,19 +1263,37 @@ const batchSetRule = async ()=>{
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-const ruleChange = async (ele)=>{
|
|
|
|
- let str = ''
|
|
|
|
- if (ele.rule.length > 0) {
|
|
|
|
- str = ele.rule.join('-')
|
|
|
|
- }
|
|
|
|
- let arr = [{
|
|
|
|
- wbsId:ele.wbsId,
|
|
|
|
-
|
|
|
|
- nameRule:str,
|
|
|
|
- }]
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+const ruleChange = async (ele) => {
|
|
|
|
+ let str = ''
|
|
|
|
+ let matchedItems = [] // 存储匹配的项
|
|
|
|
+
|
|
|
|
+ if (ele.rule.length > 0) {
|
|
|
|
+ // 1. 找出所有匹配的项
|
|
|
|
+ matchedItems = nodeTypeData.value.filter(dataItem =>
|
|
|
|
+ ele.rule.includes(dataItem.value),
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ // 2. 按原始 sort 排序
|
|
|
|
+ matchedItems.sort((a, b) => a.sort - b.sort)
|
|
|
|
+
|
|
|
|
+ // 3. 更新 ele.rule 为排序后的 value 数组
|
|
|
|
+ ele.rule = matchedItems.map(item => item.value)
|
|
|
|
+
|
|
|
|
+ // 4. 生成连接字符串
|
|
|
|
+ str = ele.rule.join('-')
|
|
|
|
+ }
|
|
|
|
+ console.log(ele.rule, 'ele.rule')
|
|
|
|
+
|
|
|
|
+ // 5. 调用API
|
|
|
|
+ let arr = [{
|
|
|
|
+ wbsId: ele.wbsId,
|
|
|
|
+ nameRule: str,
|
|
|
|
+ }]
|
|
|
|
+
|
|
let afterArr = await getRuleValue(arr)
|
|
let afterArr = await getRuleValue(arr)
|
|
ele.newNodeName = afterArr[0].newNodeName
|
|
ele.newNodeName = afterArr[0].newNodeName
|
|
-
|
|
|
|
}
|
|
}
|
|
const getRuleLoad = ref(false)
|
|
const getRuleLoad = ref(false)
|
|
const ruleTableLoading = ref(false)
|
|
const ruleTableLoading = ref(false)
|