Explorar el Código

文件题名修改

duy hace 5 meses
padre
commit
1c6d4a2803
Se han modificado 2 ficheros con 40 adiciones y 14 borrados
  1. 1 1
      src/styles/data-fill/division.scss
  2. 39 13
      src/views/data-fill/division.vue

+ 1 - 1
src/styles/data-fill/division.scss

@@ -7,7 +7,7 @@
     .project-info {
         position: relative;
         margin-bottom: 24px;
-        height: calc(100% - 238px);
+        height: calc(100% - 298px);
     }
     .footer-box {
         position: relative;

+ 39 - 13
src/views/data-fill/division.vue

@@ -98,7 +98,7 @@
                             <HcIcon name="add" />
                             <span>引用元素表</span>
                         </el-button>
-                        <!-- <el-button
+                        <el-button
                             hc-btn
                             color="#3EB1A5"
                             class="text-white"
@@ -106,7 +106,7 @@
                         >
                             <HcIcon name="edit-2" />
                             <span>节点命名配置</span>
-                        </el-button> -->
+                        </el-button>
                     </template>
                     <HcTable
                         :column="tableProjectColumn"
@@ -1043,16 +1043,16 @@
             >
                 <el-option
                     v-for="item in titleOptions"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                    :key="item.id"
+                    :label="item.dictValue"
+                    :value="item.dictKey"
                 />
             </el-select>
 
             <div class="align-items-center flex items-center justify-center">
                 <el-input v-model="inputVal" class="mt-4 w-full" />
                 <el-link class="ml-1 mt-5">
-                    <HcIcon name="refresh" class="text-2xl" />
+                    <HcIcon name="refresh" class="text-2xl" @click="refreshName" />
                 </el-link>
             </div>
         </hc-dialog>
@@ -1062,14 +1062,14 @@
 <script setup>
 import { nextTick, onActivated, onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
-import { useRoute, useRouter } from 'vue-router'
+import { useRouter } from 'vue-router'
 import HcUpload from './components/division/HcUpload.vue'
 import HcTreeData from './components/division/HcTreeData.vue'
 import HcTreeData1 from './components/division/HcTreeData1.vue'
 import DivisionTree from './components/division/DivisionTree.vue'
 import HcTreeNode from './components/HcTreeNode.vue'
 import divisionDialog from './components/divisionDialog.vue'
-import samplingApi from '~api/tentative/material/sampling'
+
 import {
     arrIndex,
     arrToId,
@@ -1090,10 +1090,10 @@ import { HcDelMsg, getHeader } from 'hc-vue3-ui'
 
 import { getChildList } from '~api/other'
 import { getDictionaryData } from '~uti/tools'
-import { p } from 'hc-vue3-ui/dist/js/_element-plus.js'
+
 //初始变量
 const router = useRouter()
-const useRoutes = useRoute()
+
 const useAppState = useAppStore()
 
 //全局变量
@@ -1244,7 +1244,7 @@ const treeLoadNode = async ({ node, item, level }, resolve) => {
     })
     resolve(getArrValue(data))
     // 获取最顶层节点的 pKeyId 和第一个节点数据
-    if (level === 0 && data.length > 0) {
+    if (level === 0 && getArrValue(data).length > 0) {
         pKeyIdData.value = data[0]?.pKeyId
         firstTree.value = data[0] // 存储第一个节点数据
     }
@@ -2604,7 +2604,9 @@ const onmousedown = () => {
 }
 //节点划分
 const divisionDialogShow = ref(false)
-const divisionClick = ()=>{
+const divisionClick = async ()=>{
+   
+    await nextTick()
     divisionDialogShow.value = true
 }
 const divisionSaveClick = ()=>{
@@ -2665,15 +2667,39 @@ const confirmTap = ()=>{
 }
 //节点命名配置
 const nodeNameDialogShow = ref(false) 
-const editNamingConfigClick = ()=>{
+const editNamingConfigClick = async ()=>{
+    getTitleOptionsData().then()
+    await nextTick()
     nodeNameDialogShow.value = true
 }
 const titleSetValue = ref('')
 const titleOptions = ref([])
 const inputVal = ref('')
 
+const getTitleOptionsData = async () => {
+  const { data } = await getDictionary({ code:'name_rule' })
+  titleOptions.value = getArrValue(data)
+    
+}
 // 添加 firstTree ref
 const firstTree = ref(null)
+const refreshName = async ()=>{
+ if (titleSetValue.value.length <= 0) {
+    window.$message.warning('请先选择命名规则')
+    return
+ }
+
+    const { code, error, msg } = await divisionApi.getNameRuleByRule({
+        nameRule:titleSetValue.value.join('-'),
+        pkeyId:  treeItemInfo.value?.primaryKeyId,
+      
+      
+
+    })
+    if (code === 200 && !error) {
+     window.$message.success(msg)
+    }
+}
 </script>
 
 <style lang="scss" scoped>