|
@@ -296,14 +296,13 @@
|
|
<el-form-item label="划分编号">
|
|
<el-form-item label="划分编号">
|
|
<el-input v-model="formEditNodeModel.partitionCode" placeholder="请输入划分编号"/>
|
|
<el-input v-model="formEditNodeModel.partitionCode" placeholder="请输入划分编号"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <!-- <el-form-item label="模板位置">
|
|
|
|
- <el-input v-model="formEditNodeModel.position" id="copyText">
|
|
|
|
- <template #append>
|
|
|
|
- <el-button :icon="DocumentCopy" @click="copyText"/>
|
|
|
|
- </template>
|
|
|
|
-
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item> -->
|
|
|
|
|
|
+ <el-form-item class="hc-position-input-icon" label="模板位置">
|
|
|
|
+ <el-input v-model="formEditNodeModel.position" :autosize="{ minRows: 3, maxRows: 6 }"
|
|
|
|
+ type="textarea"/>
|
|
|
|
+ <el-tooltip content="一键复制模板位置">
|
|
|
|
+ <HcIcon name="file-copy-2" @click="copyPositionText(formEditNodeModel.position)"/>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</HcDialog>
|
|
</HcDialog>
|
|
|
|
|
|
@@ -667,7 +666,7 @@ import HcTreeData from "./components/HcTreeData.vue"
|
|
import WbsTree from "./components/WbsTree.vue"
|
|
import WbsTree from "./components/WbsTree.vue"
|
|
import {getTokenHeader} from '~src/api/request/header';
|
|
import {getTokenHeader} from '~src/api/request/header';
|
|
import {getStoreData, setStoreData} from '~src/utils/storage'
|
|
import {getStoreData, setStoreData} from '~src/utils/storage'
|
|
-import {isType, deepClone, formValidate} from "vue-utils-plus"
|
|
|
|
|
|
+import {isType, deepClone, formValidate, setCopyText} from "vue-utils-plus"
|
|
import {getDictionary, eVisaTaskCheckApi} from "~api/other"
|
|
import {getDictionary, eVisaTaskCheckApi} from "~api/other"
|
|
import wbsApi from "~api/data-fill/wbs"
|
|
import wbsApi from "~api/data-fill/wbs"
|
|
import queryApi from '~api/data-fill/query';
|
|
import queryApi from '~api/data-fill/query';
|
|
@@ -993,14 +992,21 @@ const setTreeMenuDataClick = ({key, node, data}) => {
|
|
if (key === 'mark' || key === 'cancel_mark') {
|
|
if (key === 'mark' || key === 'cancel_mark') {
|
|
firstItemBox()
|
|
firstItemBox()
|
|
} else if (key === 'edit') {
|
|
} else if (key === 'edit') {
|
|
|
|
+ let form = {}
|
|
if (tabKey === 'tree') {
|
|
if (tabKey === 'tree') {
|
|
const parent = deepClone(node?.parent?.data || {})
|
|
const parent = deepClone(node?.parent?.data || {})
|
|
- formEditNodeModel.value = {...deepClone(data), parent: parent}
|
|
|
|
|
|
+ form = {...deepClone(data), parent: parent}
|
|
} else if (tabKey === 'map') {
|
|
} else if (tabKey === 'map') {
|
|
const parent = deepClone(node?.parentNodes?.data || {})
|
|
const parent = deepClone(node?.parentNodes?.data || {})
|
|
- formEditNodeModel.value = {...deepClone(data), parent: parent}
|
|
|
|
|
|
+ form = {...deepClone(data), parent: parent}
|
|
}
|
|
}
|
|
|
|
+ formEditNodeModel.value = form
|
|
editNodeModal.value = true
|
|
editNodeModal.value = true
|
|
|
|
+ //处理路径
|
|
|
|
+ let pathArr = [];
|
|
|
|
+ getPathName(node, pathArr);
|
|
|
|
+ form.position = pathArr.join("\\")
|
|
|
|
+ formEditNodeModel.value = form
|
|
} else if (key === 'copy') {
|
|
} else if (key === 'copy') {
|
|
if (tabKey === 'tree') {
|
|
if (tabKey === 'tree') {
|
|
const parent = deepClone(node?.parent?.data || {})
|
|
const parent = deepClone(node?.parent?.data || {})
|
|
@@ -1013,7 +1019,6 @@ const setTreeMenuDataClick = ({key, node, data}) => {
|
|
copyNodeTabKey.value = '1'
|
|
copyNodeTabKey.value = '1'
|
|
copyNodeTable.value = []
|
|
copyNodeTable.value = []
|
|
copyNodeLoading.value = false
|
|
copyNodeLoading.value = false
|
|
-
|
|
|
|
copyNodeModal.value = true
|
|
copyNodeModal.value = true
|
|
} else if (key === 'add') {
|
|
} else if (key === 'add') {
|
|
addTreeNodeId.value = data?.id
|
|
addTreeNodeId.value = data?.id
|
|
@@ -1023,13 +1028,11 @@ const setTreeMenuDataClick = ({key, node, data}) => {
|
|
} else if (key === 'upload') {
|
|
} else if (key === 'upload') {
|
|
document.getElementById('upload-drawing').click()
|
|
document.getElementById('upload-drawing').click()
|
|
} else if (key === 'del') {
|
|
} else if (key === 'del') {
|
|
-
|
|
|
|
if (data['colorStatus'] === 1 || data['colorStatus'] === 2) {
|
|
if (data['colorStatus'] === 1 || data['colorStatus'] === 2) {
|
|
delModalClick()
|
|
delModalClick()
|
|
} else {
|
|
} else {
|
|
window?.$message?.warning('该节点已存在上报数据,不允许删除')
|
|
window?.$message?.warning('该节点已存在上报数据,不允许删除')
|
|
}
|
|
}
|
|
-
|
|
|
|
} else if (key === 'sort') {
|
|
} else if (key === 'sort') {
|
|
let nodes = [], childNodes = []
|
|
let nodes = [], childNodes = []
|
|
if (tabKey === 'tree') {
|
|
if (tabKey === 'tree') {
|
|
@@ -1051,14 +1054,18 @@ const setTreeMenuDataClick = ({key, node, data}) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-//复制节点位置
|
|
|
|
-const copyText = () => {
|
|
|
|
- let copyCon = document.getElementById("copyText");
|
|
|
|
- copyCon.select(); // 选中文本
|
|
|
|
- document.execCommand("copy"); // 执行浏览器复制命令
|
|
|
|
- window.$message?.success("复制成功!");
|
|
|
|
|
|
+//获取节点的路径名字
|
|
|
|
+const getPathName = (node, pathArr) => {
|
|
|
|
+ if (node.parent?.parent) {
|
|
|
|
+ pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, "")); //去掉头尾空格
|
|
|
|
+ getPathName(node.parent, pathArr);
|
|
|
|
+ } else {
|
|
|
|
+ //根节点结束
|
|
|
|
+ pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, "")); //去掉头尾空格
|
|
|
|
+ return pathArr;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
//上传前
|
|
//上传前
|
|
const loadingReactive = ref(null)
|
|
const loadingReactive = ref(null)
|
|
const beforeUpload = () => {
|
|
const beforeUpload = () => {
|
|
@@ -1804,6 +1811,19 @@ const setWbsTreeShow = () => {
|
|
isWbsTreeShow.value = !isWbsTreeShow.value
|
|
isWbsTreeShow.value = !isWbsTreeShow.value
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//拷贝内容
|
|
|
|
+const copyPositionText = (val) => {
|
|
|
|
+ if (val) {
|
|
|
|
+ setCopyText(val).then(() => {
|
|
|
|
+ window.$message?.success('复制成功')
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ window.$message?.error('复制失败,请手动复制')
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ window.$message?.warning('没有可复制的数据')
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
//左右拖动,改变树形结构宽度
|
|
//左右拖动,改变树形结构宽度
|
|
const leftWidth = ref(382);
|
|
const leftWidth = ref(382);
|
|
const isMouseTree = ref(false);
|
|
const isMouseTree = ref(false);
|
|
@@ -1960,4 +1980,27 @@ html.theme-dark {
|
|
padding-top: 24px;
|
|
padding-top: 24px;
|
|
border-top: 1px solid #efeff5;
|
|
border-top: 1px solid #efeff5;
|
|
}
|
|
}
|
|
|
|
+.hc-position-input-icon {
|
|
|
|
+ position: relative;
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
+ .el-form-item__content {
|
|
|
|
+ position: relative;
|
|
|
|
+ .el-textarea .el-textarea__inner {
|
|
|
|
+ padding-right: 30px;
|
|
|
|
+ }
|
|
|
|
+ .hc-icon-i {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 10px;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ color: #0081ff;
|
|
|
|
+ opacity: 1;
|
|
|
|
+ transition: opacity 0.2s;
|
|
|
|
+ &:hover {
|
|
|
|
+ opacity: .5;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|