wenhongquan 1 рік тому
батько
коміт
0d449d094d

+ 2 - 1
src/components/pdfview/index.vue

@@ -1,8 +1,9 @@
 <template>
-  <div style="width: 100%;height:100%;position:absolute">
+  <div style="width: 100%;height:100%;position:absolute;text-align: center">
     <el-watermark :font="font" :content="watertext" style="width: 100%;height:100%;position:absolute">
       <PicShow :src="props.src" v-if="props.ispic" />
 
+
       <iframe v-loading style="width:100%;height:100%;border:none" v-if="!props.ispic" :src="`${currentPdf}`" />
       <!--      <div style="height: 100%;overflow-y: auto" v-if="!usepdf">-->
       <!--        &lt;!&ndash; <div v-for="page in pages" :key="page" style="width: 100%;">-->

+ 30 - 6
src/components/pdfview/picShow.vue

@@ -9,6 +9,16 @@ const props = defineProps({
 });
 
 const zoom = ref(0.05)
+const current = ref(0);
+const width = ref(220);
+
+const rateimg = () => {
+  current.value = (current.value+90)%360;
+  document.getElementById("scream").style.transform =  `rotate(${current.value}deg)`;
+  var c=document.getElementById("myCanvas");
+  var ctx=c.getContext("2d");
+  c.style.transform =  `rotate(${current.value}deg)`;
+}
 
 onMounted(()=>{
   var c=document.getElementById("myCanvas");
@@ -17,15 +27,20 @@ onMounted(()=>{
   var img1=document.getElementById("scream2");
   img1.onload = () => {
     img.style.width=220;
-    img.style.height=img1.height*(img.style.width/img1.style.width);
+    img.style.height=img1.height*(220/img1.width);
+    width.value= 220> img1.height*(220/img1.width)?220:img1.height*(220/img1.width);
+    console.log(width.value)
   };
   img.addEventListener("mousemove", (e)=>{
     // let zoom = 0.05;//相对原图的放大倍数
     //计算放大后的位置 %
+
     let x= e.offsetX/img.width;
     let y= e.offsetY/img.height;
+
     ctx.clearRect(0, 0, c.width, c.height);
     ctx.drawImage(img,img1.width*x-img1.width*zoom.value/2,img1.height*y-img1.width*zoom.value/2,img1.width*zoom.value,img1.width*zoom.value,0,0,c.width, c.height);
+
   })
 })
 
@@ -34,19 +49,28 @@ onMounted(()=>{
 </script>
 <template>
   <div class="product-image">
-    <div style="display:flex;flex-direction: column;width: 220px">
-      <img id="scream" :src="props.src" width="220" />
+    <div :style="`display:flex;flex-direction: column;width: ${width}px;`">
+
       <div>
         <div>
-          <el-descriptions title="设置">
-            <el-descriptions-item label="放大倍数"> <el-input v-model="zoom" placeholder="请输入放大倍数" type="number" /></el-descriptions-item>
+          <el-descriptions title="设置" direction="vertical" :column="1">
+            <el-descriptions-item>
+              <el-button type="primary" @click="rateimg">旋转</el-button>
+            </el-descriptions-item>
+            <el-descriptions-item label="放大倍数">
+              <el-select v-model="zoom" placeholder="请选择放大倍数">
+                <el-option v-for="item in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,30]" :value="1/item" :label="item" ></el-option>
+              </el-select>
+            </el-descriptions-item>
+
           </el-descriptions>
         </div>
       </div>
+      <img id="scream" :src="props.src" width="220" />
     </div>
 
     <img id="scream2" :src="props.src" style="display: none;"/>
-    <canvas  id="myCanvas" width="600" height="600" style="border:1px solid #d3d3d3;margin-left: 10px">
+    <canvas  id="myCanvas" width="600" height="600" style="border:1px solid #d3d3d3;margin-left: 15px">
       您的浏览器不支持 HTML5 canvas 标签。</canvas>
   </div>
 </template>

+ 15 - 12
src/views/project/list/index.vue

@@ -292,8 +292,8 @@
           <el-input v-model="currentitem.ecode" placeholder="请输入电子档案编号" />
         </el-form-item>
 
-        <el-form-item label="状态:" v-if="currenttype != 1" v-hasPermi="['filemanager.project.status']">
-          <el-select v-model="currentitem.status" clearable placeholder="请选择状态">
+        <el-form-item label="状态:" v-if="currenttype != 1" v-hasPermi="['filemanager.project.status']" required>
+          <el-select v-model="currentitem.status" placeholder="请选择状态">
             <el-option
               v-for="item in sys_project_status"
               :key="item.value"
@@ -352,7 +352,7 @@
     :before-close="handleClose" size="60%"
   >
     <div style="position: absolute;right: 20px;bottom: 20px;">
-    <el-button type="primary" icon="UploadFilled" v-hasPermi="['filemanager.project.file.upload']" v-if="status != '0'"  @click="uploadfile">上传文件</el-button>
+    <el-button type="primary" icon="UploadFilled" v-hasPermi="['filemanager.project.file.upload']" v-if="status != '0'||currentitem.createBy==userId"  @click="uploadfile">上传文件</el-button>
     </div>
     <div style="position: absolute;left: 20px;top: 60px;">
       <el-button type="primary" icon="Download" size="small" :disabled="selectfiles.length<1" v-hasPermi="['filemanager.project.file.downloadb']" v-if="status != '0'"  @click="downloadfilebanch">下载</el-button>
@@ -449,7 +449,7 @@ const hsp = (v:string)=>{
   return auth.hasPermi(v)
 }
 
-
+const userId = useUserStore().userId;
 const userroles = useUserStore().roles;
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { sys_area, sys_project_status } = toRefs<any>(
@@ -629,11 +629,13 @@ const updatecurrent = (id, status: number) => {
     ElMessage.warning("请输入不同意原因");
     return;
   }
+
   updateArchives({
     id: id,
     status: status + "",
+    ext2: "{}",
     ...(status == 4
-      ? { ext1: JSON.stringify({ projectreson: projectreson.value }),ext2: "{}" }
+      ? { ext1: JSON.stringify({ projectreson: projectreson.value }) }
       : {}),
   }).then((res) => {
     ElMessage.success("保存成功");
@@ -771,13 +773,14 @@ const handleCloseupload = (done) => {
 };
 
 const handleClose = (done) => {
-    ElMessageBox.confirm('确定关闭文件查看?')
-    .then(() => {
-      done()
-    })
-    .catch(() => {
-      // catch error
-    })
+  done();
+    // ElMessageBox.confirm('确定关闭文件查看?')
+    // .then(() => {
+    //   done()
+    // })
+    // .catch(() => {
+    //   // catch error
+    // })
 };
 
 const currentfile = ref();

+ 2 - 2
vite.config.ts

@@ -26,8 +26,8 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
       open: true,
       proxy: {
         [env.VITE_APP_BASE_API]: {
-          // target: 'http://localhost:8080',
-          target: 'https://filesystem.njdnyjs.com/api',
+          target: 'http://localhost:8080',
+          // target: 'https://filesystem.njdnyjs.com/api',
           changeOrigin: true,
           ws: true,
           rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')