|
@@ -110,19 +110,21 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import {useAppStore} from "~src/store";
|
|
import {ref, watch, onMounted,nextTick,toRefs,computed } from "vue";
|
|
import {ref, watch, onMounted,nextTick,toRefs,computed } from "vue";
|
|
import {roletree,getDictionary,archiveTreeSave,archiveTreeDetail,archiveTreeUpdate} from "~api/other";
|
|
import {roletree,getDictionary,archiveTreeSave,archiveTreeDetail,archiveTreeUpdate} from "~api/other";
|
|
|
|
+import archiveFileApi from "~api/archiveFile/archiveFile";
|
|
|
|
+import {getArrValue} from "js-fast-way"
|
|
|
|
+const useAppState = useAppStore()
|
|
|
|
|
|
|
|
+const contractId = ref(useAppState.getContractId);
|
|
//参数
|
|
//参数
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
projectId: {
|
|
projectId: {
|
|
type: [String,Number],
|
|
type: [String,Number],
|
|
default: ''
|
|
default: ''
|
|
},
|
|
},
|
|
- contractId: {
|
|
|
|
- type: [String,Number],
|
|
|
|
- default: ''
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
node: {
|
|
node: {
|
|
type: Object,
|
|
type: Object,
|
|
default: () => ({})
|
|
default: () => ({})
|
|
@@ -138,17 +140,19 @@ const props = defineProps({
|
|
})
|
|
})
|
|
|
|
|
|
const projectId = ref(props.projectId);
|
|
const projectId = ref(props.projectId);
|
|
-const contractId = ref(props.contractId);
|
|
|
|
|
|
+
|
|
// 使用toRefs结构,使其具有响应式
|
|
// 使用toRefs结构,使其具有响应式
|
|
const {node} = toRefs(props);
|
|
const {node} = toRefs(props);
|
|
|
|
|
|
//监听
|
|
//监听
|
|
watch(() => [
|
|
watch(() => [
|
|
props.projectId,
|
|
props.projectId,
|
|
- props.contractId,
|
|
|
|
-], ([UserProjectId, UserContractId]) => {
|
|
|
|
|
|
+
|
|
|
|
+], ([UserProjectId]) => {
|
|
|
|
+
|
|
projectId.value = UserProjectId
|
|
projectId.value = UserProjectId
|
|
- contractId.value = UserContractId
|
|
|
|
|
|
+
|
|
|
|
+
|
|
})
|
|
})
|
|
|
|
|
|
watch(() => [props.show,props.type],([newShow,newType])=>{
|
|
watch(() => [props.show,props.type],([newShow,newType])=>{
|
|
@@ -321,7 +325,15 @@ const saveTreeNode = async (form)=>{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (addform.value.id) {
|
|
if (addform.value.id) {
|
|
- await archiveTreeUpdateHandle(form)
|
|
|
|
|
|
+ console.log(isEditsto.value,'isEditsto.value');
|
|
|
|
+ console.log(ishabvFile.value,ishabvFile.value);
|
|
|
|
+ // await archiveTreeUpdateHandle(form)
|
|
|
|
+ if(isEditsto.value===1&&addform.value.isStorageNode===2&&ishabvFile.value===true){
|
|
|
|
+ //是否存储类型由是改为否,要判断该节点下是否有存储文件
|
|
|
|
+ window.$message.warning('当前节点下有存储文件,请迁移或删除后再变更')
|
|
|
|
+ }else{
|
|
|
|
+ await archiveTreeUpdateHandle(form)
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
await archiveTreeSaveHandle(form)
|
|
await archiveTreeSaveHandle(form)
|
|
}
|
|
}
|
|
@@ -348,15 +360,37 @@ const archiveTreeUpdateHandle = async (form)=>{//编辑
|
|
node.value.data.storageType = form.storageType;
|
|
node.value.data.storageType = form.storageType;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+const ishabvFile=ref(false)
|
|
|
|
+//查询该节点下有没有文件
|
|
|
|
+const getTableData = async (nodeid) => {
|
|
|
|
+ console.log(contractId.value,'contractId.value');
|
|
|
|
+ const { error, code, data } = await archiveFileApi.getarchiveFilePage({
|
|
|
|
+ nodeIds: nodeid,
|
|
|
|
+ current: 1,
|
|
|
|
+ size: 20,
|
|
|
|
+ total: 0,
|
|
|
|
+ projectId: projectId.value,
|
|
|
|
+ contractId:contractId.value
|
|
|
|
+ })
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ let dataarr=getArrValue(data['records'])
|
|
|
|
+ if(dataarr.length>0){
|
|
|
|
+ ishabvFile.value=true
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ ishabvFile.value=false
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+const isEditsto=ref('')//原始为存储节点
|
|
//编辑节点
|
|
//编辑节点
|
|
const editNodeModal = async ()=>{
|
|
const editNodeModal = async ()=>{
|
|
const {code,data } = await archiveTreeDetail({
|
|
const {code,data } = await archiveTreeDetail({
|
|
id:node.value.data.id
|
|
id:node.value.data.id
|
|
})
|
|
})
|
|
if (code == 200) {
|
|
if (code == 200) {
|
|
- console.log(data,'dtat');
|
|
|
|
addform.value = data;
|
|
addform.value = data;
|
|
|
|
+ isEditsto.value=data.isStorageNode
|
|
|
|
+ getTableData(node.value.data.id)
|
|
addNodeModal.value = true
|
|
addNodeModal.value = true
|
|
}
|
|
}
|
|
//addform.value = node.data;
|
|
//addform.value = node.data;
|