|
@@ -9,7 +9,7 @@
|
|
|
<hc-new-card title="当前目录信息编辑">
|
|
|
<template #extra>
|
|
|
<HcTooltip keys="archives_bookmark_btn_add">
|
|
|
- <el-button hc-btn type="primary" @click="addModalClick(false)">保存设置</el-button>
|
|
|
+ <el-button hc-btn type="primary" :loading="saveLoading" @click="addModalClick(false)">保存设置</el-button>
|
|
|
</HcTooltip>
|
|
|
</template>
|
|
|
<template #search>
|
|
@@ -107,7 +107,7 @@
|
|
|
<script setup>
|
|
|
import { onMounted, reactive, ref, watch } from 'vue'
|
|
|
import { useAppStore } from '~src/store'
|
|
|
-import { archiveTreeUpdate } from '~api/other'
|
|
|
+import { archiveTreeDetail, archiveTreeUpdate } from '~api/other'
|
|
|
import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
import HcTree from '~src/components/tree/hc-tree.vue'
|
|
|
import tasksApi from '~api/tasks/data'
|
|
@@ -189,17 +189,21 @@ const ruleTypeList = ref([
|
|
|
const onSubmit = () => {
|
|
|
console.log('submit!')
|
|
|
}//新增
|
|
|
+const saveLoading = ref(false)
|
|
|
|
|
|
const addModalClick = async (type) => {
|
|
|
if (!formInline.value.id) {
|
|
|
window.$message?.warning('请先点选左侧要修改信息的树节点')
|
|
|
return
|
|
|
}
|
|
|
+ saveLoading.value = true
|
|
|
+ formInline.value.nodeName = formInline.value.title
|
|
|
const { code } = await archiveTreeUpdate(formInline.value)
|
|
|
//console.log(res);
|
|
|
+ saveLoading.value = false
|
|
|
if (code == 200) {
|
|
|
window.$message?.success('修改成功')
|
|
|
- window?.location?.reload() //刷新页面
|
|
|
+ // window?.location?.reload() //刷新页面
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -233,11 +237,27 @@ const treeAutoExpandKeys = ref(getStoreValue('bookExpandKeys') || [])
|
|
|
const nodeElTreeClick = ({ node, data, keys, key }) => {
|
|
|
console.log('点击', data)
|
|
|
// treeNodeInfo.value = node
|
|
|
- formInline.value = data
|
|
|
-
|
|
|
+ // formInline.value = data
|
|
|
+ getDetail(data.id)
|
|
|
setStoreValue('bookExpandKeys', keys)
|
|
|
treeAutoExpandKeys.value = keys || []
|
|
|
}
|
|
|
+
|
|
|
+const getDetail = async (id)=>{
|
|
|
+ const { code, data } = await archiveTreeDetail({
|
|
|
+ id:id,
|
|
|
+ })
|
|
|
+ if (code === 200) {
|
|
|
+
|
|
|
+ formInline.value = data
|
|
|
+ formInline.value.title = data.nodeName
|
|
|
+
|
|
|
+ } else {
|
|
|
+ formInline.value = {}
|
|
|
+ }
|
|
|
+ //addform.value = node.data;
|
|
|
+
|
|
|
+}
|
|
|
//设置树菜单数据
|
|
|
const ElTreeMenu = ref([])
|
|
|
const TreeMark = ref(false)
|