|
@@ -1,118 +1,145 @@
|
|
|
<template>
|
|
|
<div class="hc-layout-box">
|
|
|
- <div v-if="dataType === 1" :style="'width:' + leftWidth + 'px;'" class="hc-layout-left-box">
|
|
|
+ <div v-if="dataType === 1" :style="`width:${leftWidth}px;`" class="hc-layout-left-box">
|
|
|
<div class="hc-project-box">
|
|
|
<div class="hc-project-icon-box">
|
|
|
- <HcIcon name="stack"/>
|
|
|
+ <HcIcon name="stack" />
|
|
|
</div>
|
|
|
<div class="ml-2 project-name-box">
|
|
|
- <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
|
|
|
- <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
|
|
|
+ <span class="text-xl text-cut project-alias">{{ projectInfo.projectAlias }}</span>
|
|
|
+ <div class="text-xs text-cut project-name">{{ projectInfo.name }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="hc-tree-box">
|
|
|
<el-scrollbar>
|
|
|
- <WbsTree :autoExpandKeys="TreeAutoExpandKeys" :contractId="contractId" :projectId="projectId"
|
|
|
- @nodeTap="nodeWbsElTreeClick"/>
|
|
|
+ <WbsTree
|
|
|
+ :auto-expand-keys="TreeAutoExpandKeys" :contract-id="contractId" :project-id="projectId" :class-id="dataId"
|
|
|
+ @nodeTap="nodeWbsElTreeClick"
|
|
|
+ />
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
|
- <!--左右拖动-->
|
|
|
- <div class="horizontal-drag-line" @mousedown="onmousedown"/>
|
|
|
+ <!-- 左右拖动 -->
|
|
|
+ <div class="horizontal-drag-line" @mousedown="onmousedown" />
|
|
|
</div>
|
|
|
<div v-loading="queryByLoading" class="hc-layout-content-box" element-loading-text="获取数据中...">
|
|
|
<HcCard
|
|
|
:scrollbar="false"
|
|
|
:title="`${treeItemInfo?.title ?? ''} 上传${fileType === 1 ? '视频' : fileType === 2 ? '图片' : ''}`"
|
|
|
- actionSize="lg">
|
|
|
- <el-alert v-if="dataType === 1 && !wbsId" :closable="false" effect="dark" style="margin-bottom: 14px"
|
|
|
- title="请先在左边项目树,选择一个节点" type="warning"/>
|
|
|
+ action-size="lg"
|
|
|
+ >
|
|
|
+ <el-alert
|
|
|
+ v-if="dataType === 1 && !wbsId" :closable="false" effect="dark" style="margin-bottom: 14px"
|
|
|
+ title="请先在左边项目树,选择一个节点" type="warning"
|
|
|
+ />
|
|
|
|
|
|
<el-row :gutter="20" class="hc-form-row-box">
|
|
|
<el-col :span="10">
|
|
|
<el-scrollbar>
|
|
|
<el-form ref="formRef" :model="formValue" :rules="rules" label-width="auto" size="large">
|
|
|
<el-form-item label="上传日期" prop="uploadTime">
|
|
|
- <el-date-picker v-model="formValue.uploadTime" format="YYYY-MM-DD" type="date"
|
|
|
- value-format="YYYY-MM-DD"/>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formValue.uploadTime" format="YYYY-MM-DD" type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="上传文件" prop="imageUrl">
|
|
|
<div class="w-full">
|
|
|
<HcUploads
|
|
|
:accept="fileType === 1 ? videoAccept : fileType === 2 ? imageAccept : null"
|
|
|
- :fileList="uploadFileList"
|
|
|
+ :file-list="uploadFileList"
|
|
|
:limit="fileType === 2 ? 10 : 1"
|
|
|
:size="fileType === 2 ? 30 : 500" :viewer="false"
|
|
|
action="upload-file" @change="uploadsChange" @del="uploadsDel"
|
|
|
- @preview="uploadsPreview" @progress="uploadsProgress"/>
|
|
|
+ @preview="uploadsPreview" @progress="uploadsProgress"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <el-image-viewer v-if="previewModal && fileType === 2" :initial-index="initialIndex"
|
|
|
- :url-list="previewFileList" @close="previewModalClose"/>
|
|
|
- <el-dialog v-model="previewVideoModal" :before-close="previewModalClose"
|
|
|
- destroy-on-close
|
|
|
- width="62rem">
|
|
|
- <video :src="previewVideoUrl" autoplay="autoplay" class="preview-video"
|
|
|
- controls="controls">
|
|
|
+ <el-image-viewer
|
|
|
+ v-if="previewModal && fileType === 2" :initial-index="initialIndex"
|
|
|
+ :url-list="previewFileList" @close="previewModalClose"
|
|
|
+ />
|
|
|
+ <el-dialog
|
|
|
+ v-model="previewVideoModal" :before-close="previewModalClose"
|
|
|
+ destroy-on-close
|
|
|
+ width="62rem"
|
|
|
+ >
|
|
|
+ <video
|
|
|
+ :src="previewVideoUrl" autoplay="autoplay" class="preview-video"
|
|
|
+ controls="controls"
|
|
|
+ >
|
|
|
您的浏览器不支持 video
|
|
|
</video>
|
|
|
</el-dialog>
|
|
|
- <el-alert v-if="fileType === 1"
|
|
|
- :closable="false"
|
|
|
- title="请上传MP4、MOV格式的视频文件,文件大小不超过500M,只能上传1个视频文件"
|
|
|
- type="error"/>
|
|
|
+ <el-alert
|
|
|
+ v-if="fileType === 1"
|
|
|
+ :closable="false"
|
|
|
+ title="请上传MP4、MOV格式的视频文件,文件大小不超过500M,只能上传1个视频文件"
|
|
|
+ type="error"
|
|
|
+ />
|
|
|
<el-alert
|
|
|
v-if="fileType === 2"
|
|
|
:closable="false"
|
|
|
title="请上传JPG/JPEG、PNG格式的图片文件,文件大小不超过30M,最多10张图片文件"
|
|
|
- type="error"/>
|
|
|
+ type="error"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="题名" prop="title">
|
|
|
- <el-input v-model="formValue.title" placeholder="请输入题名"/>
|
|
|
+ <el-input v-model="formValue.title" placeholder="请输入题名" />
|
|
|
</el-form-item>
|
|
|
<div class="flex">
|
|
|
- <el-form-item :class="fileType === 2?'mr-4':''" class="flex-1" label="拍摄者"
|
|
|
- prop="shootingUser">
|
|
|
- <el-input v-model="formValue.shootingUser" placeholder="请输入拍摄者"/>
|
|
|
+ <el-form-item
|
|
|
+ :class="fileType === 2 ? 'mr-4' : ''" class="flex-1" label="拍摄者"
|
|
|
+ prop="shootingUser"
|
|
|
+ >
|
|
|
+ <el-input v-model="formValue.shootingUser" placeholder="请输入拍摄者" />
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="fileType === 2" class="flex-1 ml-4" label="照片号">
|
|
|
- <el-input v-model="formValue.photoCode" placeholder="请输入照片号"/>
|
|
|
+ <el-input v-model="formValue.photoCode" placeholder="请输入照片号" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<el-form-item label="拍摄时间" prop="shootingTimeStr">
|
|
|
- <el-date-picker v-model="formValue.shootingTimeStr" format="YYYY-MM-DD" type="date"
|
|
|
- value-format="YYYY-MM-DD"/>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formValue.shootingTimeStr" format="YYYY-MM-DD" type="date"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<div v-if="fileType === 2" class="flex">
|
|
|
<el-form-item class="flex-1 mr-4" label="底片号" prop="filmCode">
|
|
|
- <el-input v-model="formValue.filmCode" placeholder="请输入底片号"/>
|
|
|
+ <el-input v-model="formValue.filmCode" placeholder="请输入底片号" />
|
|
|
</el-form-item>
|
|
|
<el-form-item class="flex-1 ml-4" label="参见号" prop="seeAlsoCode">
|
|
|
- <el-input v-model="formValue.seeAlsoCode" placeholder="请输入参见号"/>
|
|
|
+ <el-input v-model="formValue.seeAlsoCode" placeholder="请输入参见号" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
<el-form-item label="文字说明" prop="textContent">
|
|
|
- <el-input v-model="formValue.textContent" :autosize="{ minRows: 3, maxRows: 5 }"
|
|
|
- placeholder="请输入文字说明" type="textarea"/>
|
|
|
+ <el-input
|
|
|
+ v-model="formValue.textContent" :autosize="{ minRows: 3, maxRows: 5 }"
|
|
|
+ placeholder="请输入文字说明" type="textarea"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-scrollbar>
|
|
|
</el-col>
|
|
|
<el-col :span="14">
|
|
|
- <HcTable v-if="dataType === 2" :column="tableColumn" :datas="tableData"/>
|
|
|
+ <HcTable v-if="dataType === 2" :column="tableColumn" :datas="tableData" />
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<template #action>
|
|
|
- <el-button :disabled="uploadsLoading || (dataType === 1 && !wbsId)" :loading="saveLoading" hc-btn
|
|
|
- type="primary" @click="saveClick">
|
|
|
- <HcIcon name="save"/>
|
|
|
+ <el-button
|
|
|
+ :disabled="uploadsLoading || (dataType === 1 && !wbsId)" :loading="saveLoading" hc-btn
|
|
|
+ type="primary" @click="saveClick"
|
|
|
+ >
|
|
|
+ <HcIcon name="save" />
|
|
|
<span>保存</span>
|
|
|
</el-button>
|
|
|
- <el-button v-if="dataType === 2" :disabled="uploadsLoading" :loading="saveLoading" hc-btn
|
|
|
- @click="saveLogClick">
|
|
|
- <HcIcon name="save"/>
|
|
|
+ <el-button
|
|
|
+ v-if="dataType === 2" :disabled="uploadsLoading" :loading="saveLoading" hc-btn
|
|
|
+ @click="saveLogClick"
|
|
|
+ >
|
|
|
+ <HcIcon name="save" />
|
|
|
<span>保存并再次添加</span>
|
|
|
</el-button>
|
|
|
<el-button hc-btn @click="toBackClick">
|
|
|
- <HcIcon name="arrow-go-back"/>
|
|
|
+ <HcIcon name="arrow-go-back" />
|
|
|
<span>返回</span>
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -122,15 +149,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {onMounted, ref, watch} from 'vue'
|
|
|
-import {useAppStore} from "~src/store";
|
|
|
-import {useRouter, useRoute} from 'vue-router'
|
|
|
-import WbsTree from "./components/WbsTree.vue"
|
|
|
-import imageApi from '~api/other-file/imageData';
|
|
|
-import {getStoreValue, setStoreValue} from '~src/utils/storage'
|
|
|
-import {formValidate, getObjValue, getRandom, deepClone, arrToKey} from "js-fast-way"
|
|
|
-import {dateFormat} from '~src/utils/tools'
|
|
|
-import ossApi from "~api/oss";
|
|
|
+import { onMounted, ref, watch } from 'vue'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
+import WbsTree from './components/WbsTree.vue'
|
|
|
+import imageApi from '~api/other-file/imageData'
|
|
|
+import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
+import { arrToKey, deepClone, formValidate, getObjValue, getRandom } from 'js-fast-way'
|
|
|
+import { dateFormat } from '~src/utils/tools'
|
|
|
+import ossApi from '~api/oss'
|
|
|
|
|
|
//变量
|
|
|
const router = useRouter()
|
|
@@ -143,13 +170,13 @@ const isCollapse = ref(useAppState.getCollapse)
|
|
|
const userInfo = ref(useAppState.getUserInfo)
|
|
|
|
|
|
//路由参数
|
|
|
-const routerQuery = useRoutes?.query;
|
|
|
+const routerQuery = useRoutes?.query
|
|
|
//存储目录格式 1按部位存储,2按日期存储
|
|
|
-const dataId = routerQuery?.id || '';
|
|
|
-const wbsNodeIds = routerQuery?.wbsId || '';
|
|
|
-const classifyId = routerQuery?.classifyId || '';
|
|
|
-const dataType = parseInt(routerQuery?.dataType + '') || 1;
|
|
|
-const fileType = parseInt(routerQuery?.fileType + '') || 2;
|
|
|
+const dataId = routerQuery?.id || ''
|
|
|
+const wbsNodeIds = routerQuery?.wbsId || ''
|
|
|
+const classifyId = routerQuery?.classifyId || ''
|
|
|
+const dataType = parseInt(routerQuery?.dataType + '') || 1
|
|
|
+const fileType = parseInt(routerQuery?.fileType + '') || 2
|
|
|
const toDayDate = dateFormat(new Date(), 'yyyy-MM-dd')
|
|
|
|
|
|
const userRealName = ref('')
|
|
@@ -157,7 +184,7 @@ const userRealName = ref('')
|
|
|
watch(() => [
|
|
|
useAppState.getCollapse,
|
|
|
useAppState.getUserInfo,
|
|
|
- useAppState.getContractId
|
|
|
+ useAppState.getContractId,
|
|
|
], ([Collapse, UserInfo, ContractId]) => {
|
|
|
isCollapse.value = Collapse
|
|
|
userRealName.value = UserInfo['real_name']
|
|
@@ -195,7 +222,7 @@ const queryByLoading = ref(false)
|
|
|
const queryById = async () => {
|
|
|
if (dataId) {
|
|
|
queryByLoading.value = true
|
|
|
- const {error, code, data} = await imageApi.queryById({id: dataId})
|
|
|
+ const { error, code, data } = await imageApi.queryById({ id: dataId })
|
|
|
//判断状态
|
|
|
queryByLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
@@ -206,10 +233,10 @@ const queryById = async () => {
|
|
|
//获取题名
|
|
|
const getFileTitleNamedata = async (wbsNodeIds) => {
|
|
|
|
|
|
- const {error, code, data} = await imageApi.getFileTitleName({pKeyId: wbsNodeIds})
|
|
|
+ const { error, code, data } = await imageApi.getFileTitleName({ pKeyId: wbsNodeIds })
|
|
|
//判断状态
|
|
|
if (!error && code === 200) {
|
|
|
- let arr = Object.keys(data);
|
|
|
+ let arr = Object.keys(data)
|
|
|
if (arr.length > 0) {
|
|
|
formValue.value.title = data
|
|
|
} else {
|
|
@@ -222,7 +249,7 @@ const getFileTitleNamedata = async (wbsNodeIds) => {
|
|
|
//项目树被点击
|
|
|
const wbsId = ref('')
|
|
|
const treeItemInfo = ref({})
|
|
|
-const nodeWbsElTreeClick = ({data, keys}) => {
|
|
|
+const nodeWbsElTreeClick = ({ data, keys }) => {
|
|
|
if (data.leaf === true) {
|
|
|
treeItemInfo.value = data
|
|
|
wbsId.value = data['primaryKeyId']
|
|
@@ -250,27 +277,27 @@ const formValue = ref({
|
|
|
const rules = {
|
|
|
uploadTime: {
|
|
|
required: true,
|
|
|
- trigger: "blur",
|
|
|
- message: "请选择上传日期"
|
|
|
+ trigger: 'blur',
|
|
|
+ message: '请选择上传日期',
|
|
|
},
|
|
|
imageUrl: {
|
|
|
required: true,
|
|
|
- message: "请先上传文件"
|
|
|
+ message: '请先上传文件',
|
|
|
},
|
|
|
title: {
|
|
|
required: true,
|
|
|
- trigger: "blur",
|
|
|
- message: "请输入题名"
|
|
|
+ trigger: 'blur',
|
|
|
+ message: '请输入题名',
|
|
|
},
|
|
|
shootingUser: {
|
|
|
required: true,
|
|
|
- trigger: "blur",
|
|
|
- message: "请输入拍摄者"
|
|
|
+ trigger: 'blur',
|
|
|
+ message: '请输入拍摄者',
|
|
|
},
|
|
|
shootingTimeStr: {
|
|
|
required: true,
|
|
|
- trigger: "blur",
|
|
|
- message: "请选择拍摄时间"
|
|
|
+ trigger: 'blur',
|
|
|
+ message: '请选择拍摄时间',
|
|
|
},
|
|
|
}
|
|
|
|
|
@@ -288,23 +315,23 @@ const formDataFormat = (info) => {
|
|
|
contractId: info?.contractId || contractId.value,
|
|
|
}
|
|
|
//原始文件地址
|
|
|
- let imageUrl = info['imageUrl'] || '';
|
|
|
+ let imageUrl = info['imageUrl'] || ''
|
|
|
let imageUrlArr = imageUrl ? imageUrl.split(',') : []
|
|
|
//PDF地址
|
|
|
- let pdfUrl = info['pdfUrl'] || '';
|
|
|
+ let pdfUrl = info['pdfUrl'] || ''
|
|
|
let pdfUrlArr = pdfUrl ? pdfUrl.split(',') : []
|
|
|
//处理数据
|
|
|
if (imageUrlArr.length > 0) {
|
|
|
//状态处理
|
|
|
- let InfoPdfUrl = pdfUrlArr.length === imageUrlArr.length;
|
|
|
+ let InfoPdfUrl = pdfUrlArr.length === imageUrlArr.length
|
|
|
//遍历数据
|
|
|
for (let i = 0; i < imageUrlArr.length; i++) {
|
|
|
- let item = imageUrlArr[i];
|
|
|
+ let item = imageUrlArr[i]
|
|
|
uploadFileList.value.push({
|
|
|
name: getRandom(),
|
|
|
url: item,
|
|
|
page: '',
|
|
|
- pdfUrl: InfoPdfUrl ? pdfUrlArr[i] : ''
|
|
|
+ pdfUrl: InfoPdfUrl ? pdfUrlArr[i] : '',
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
@@ -313,15 +340,15 @@ const formDataFormat = (info) => {
|
|
|
}
|
|
|
|
|
|
//上传组件参数
|
|
|
-const imageAccept = 'image/png,image/jpg,image/jpeg';
|
|
|
-const videoAccept = 'video/*';
|
|
|
+const imageAccept = 'image/png,image/jpg,image/jpeg'
|
|
|
+const videoAccept = 'video/*'
|
|
|
|
|
|
//上传文件的相关数据
|
|
|
const previewFileList = ref([])
|
|
|
const uploadFileList = ref([])
|
|
|
|
|
|
//上传的文件结果
|
|
|
-const uploadsChange = ({fileList}) => {
|
|
|
+const uploadsChange = ({ fileList }) => {
|
|
|
uploadFileList.value = fileList
|
|
|
}
|
|
|
|
|
@@ -336,7 +363,7 @@ const previewModal = ref(false)
|
|
|
const previewVideoModal = ref(false)
|
|
|
const initialIndex = ref(-1)
|
|
|
const previewVideoUrl = ref('')
|
|
|
-const uploadsPreview = ({index, fileArr}) => {
|
|
|
+const uploadsPreview = ({ index, fileArr }) => {
|
|
|
if (fileType === 2) {
|
|
|
previewFileList.value = fileArr
|
|
|
initialIndex.value = index
|
|
@@ -355,19 +382,19 @@ const previewModalClose = () => {
|
|
|
}
|
|
|
|
|
|
//删除上传的文件
|
|
|
-const uploadsDel = async ({link}) => {
|
|
|
- const arrUrl = link.split(".com//");
|
|
|
+const uploadsDel = async ({ link }) => {
|
|
|
+ const arrUrl = link.split('.com//')
|
|
|
if (arrUrl.length > 0) {
|
|
|
- await ossApi.removeFile({fileName: arrUrl[1]}, false)
|
|
|
+ await ossApi.removeFile({ fileName: arrUrl[1] }, false)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//上传记录表格
|
|
|
const tableColumn = ref([
|
|
|
- {name: '上传日期', key: 'uploadTime'},
|
|
|
- {name: '题名', key: 'title'},
|
|
|
- {name: '拍摄者', key: 'shootingUser'},
|
|
|
- {name: '拍摄时间', key: 'shootingTimeStr'}
|
|
|
+ { name: '上传日期', key: 'uploadTime' },
|
|
|
+ { name: '题名', key: 'title' },
|
|
|
+ { name: '拍摄者', key: 'shootingUser' },
|
|
|
+ { name: '拍摄时间', key: 'shootingTimeStr' },
|
|
|
])
|
|
|
const tableData = ref([])
|
|
|
|
|
@@ -385,10 +412,10 @@ const saveLogClick = () => {
|
|
|
//表单效验
|
|
|
const shootingTimeStr = ref('')
|
|
|
const verifyFormData = async (log) => {
|
|
|
- const formData = formValue.value;
|
|
|
- const fileList = uploadFileList.value;
|
|
|
+ const formData = formValue.value
|
|
|
+ const fileList = uploadFileList.value
|
|
|
//处理文件
|
|
|
- let imageUrl = '', pdfUrl = '';
|
|
|
+ let imageUrl = '', pdfUrl = ''
|
|
|
if (fileList.length > 0) {
|
|
|
imageUrl = arrToKey(fileList, 'url', ',')
|
|
|
pdfUrl = arrToKey(fileList, 'pdfUrl', ',')
|
|
@@ -417,7 +444,7 @@ const verifyFormData = async (log) => {
|
|
|
//新增资料
|
|
|
const addImageclassifyFile = async (formData, log) => {
|
|
|
saveLoading.value = true
|
|
|
- const {error, code} = await imageApi.addImageclassifyFile(formData)
|
|
|
+ const { error, code } = await imageApi.addImageclassifyFile(formData)
|
|
|
//判断状态
|
|
|
saveLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
@@ -434,7 +461,7 @@ const addImageclassifyFile = async (formData, log) => {
|
|
|
//修改资料
|
|
|
const updateImageclassifyFile = async (formData, log) => {
|
|
|
saveLoading.value = true
|
|
|
- const {error, code} = await imageApi.updateImageclassifyFile(formData)
|
|
|
+ const { error, code } = await imageApi.updateImageclassifyFile(formData)
|
|
|
//判断状态
|
|
|
saveLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
@@ -453,7 +480,7 @@ const dataNodeExpandKeys = () => {
|
|
|
let TimeStr = shootingTimeStr.value || ''
|
|
|
let TimeArr = TimeStr.split('-')
|
|
|
if (TimeStr && TimeArr.length > 0) {
|
|
|
- let timeKey = TimeArr[0] + '-' + TimeArr[1];
|
|
|
+ let timeKey = TimeArr[0] + '-' + TimeArr[1]
|
|
|
setStoreValue('TreeExpandedKeys', [timeKey])
|
|
|
}
|
|
|
}
|
|
@@ -472,26 +499,26 @@ const toBackClick = () => {
|
|
|
fileType: fileType,
|
|
|
type: dataType,
|
|
|
id: classifyId,
|
|
|
- }
|
|
|
+ },
|
|
|
})
|
|
|
setTimeout(() => {
|
|
|
- window?.location?.reload() //刷新页面
|
|
|
+ window?.location?.reload() //刷新页面
|
|
|
}, 1000)
|
|
|
}
|
|
|
|
|
|
//左右拖动,改变树形结构宽度
|
|
|
-const leftWidth = ref(382);
|
|
|
+const leftWidth = ref(382)
|
|
|
const onmousedown = () => {
|
|
|
const leftNum = isCollapse.value ? 142 : 272
|
|
|
document.onmousemove = (ve) => {
|
|
|
- let diffVal = ve.clientX - leftNum;
|
|
|
+ let diffVal = ve.clientX - leftNum
|
|
|
if (diffVal >= 310 && diffVal <= 900) {
|
|
|
- leftWidth.value = diffVal;
|
|
|
+ leftWidth.value = diffVal
|
|
|
}
|
|
|
}
|
|
|
document.onmouseup = () => {
|
|
|
- document.onmousemove = null;
|
|
|
- document.onmouseup = null;
|
|
|
+ document.onmousemove = null
|
|
|
+ document.onmouseup = null
|
|
|
}
|
|
|
}
|
|
|
</script>
|