zhuliu пре 1 година
родитељ
комит
0681e3b8c1

+ 7 - 0
src/assets/css/main.scss

@@ -6,6 +6,13 @@
   border-bottom:1px solid red ;
 }
 
+@keyframes shake {
+  0% { transform: translateX(0); }
+  25% { transform: translateX(-5px); }
+  50% { transform: translateX(5px); }
+  75% { transform: translateX(-5px); }
+  100% { transform: translateX(5px); }
+}
 
 //弹窗
 .el-dialog__wrapper{

+ 3 - 0
src/utils/direct/index.js

@@ -1,5 +1,7 @@
 // 引入拖拽js
 import { startDrag } from './drag.js'
+//引入抖动
+import shake from './shake.js'
  
 /**
  * 为el-dialog弹框增加拖拽功能
@@ -72,6 +74,7 @@ const directives = {
     SelectLazyLoading,
     disabled,
     DivHeight,
+    shake
 };
 // 这种写法可以批量注册指令
 export default {

+ 55 - 0
src/utils/direct/shake.js

@@ -0,0 +1,55 @@
+
+import Vue from 'vue'
+const toggleShake = (el, binding) => {
+    if (binding.value) {
+        Vue.nextTick(() => {
+            const shakeTimes = binding.value.times || 1; // 震动次数
+            const shakeDistance = binding.value.distance || 2; // 震动距离
+            const shakeDuration = binding.value.duration || '0.5s'; // 震动持续时间
+            el.style.animation = 'shake '+ shakeDuration
+            el.style.animationIterationCount = shakeTimes 
+            // 使用定时器实现震动效果
+            // let counter = 0;
+        
+            // const shake = () => {
+            //     if (counter++ < shakeTimes) {
+            //     const rand = Math.random() * shakeDistance;
+            //     const x = el.offsetLeft + rand - rand;
+            //     const y = el.offsetTop + rand;
+            //     el.style.position = 'absolute';
+            //     el.style.transform = `translate3d(${rand}px, ${rand}px, 0)`;
+            //     setTimeout(() => {
+            //         el.style.transform = '';
+            //         shake();
+            //     }, shakeDuration);
+            //     }
+            // };
+ 
+            // shake();
+        })
+    }
+}
+
+export default{
+    bind:function(el, binding, vnode){
+        if(!binding.value){
+            return
+        }
+        if(!binding.value.shake){
+            return
+        }
+        toggleShake(el, binding)
+    },
+    update: function (el, binding) {
+        if(!binding.value){
+            return
+        }
+        if(!binding.value.shake){
+            return
+        }
+        toggleShake(el, binding)
+    },
+    unbind: function (el, binding) {
+        el.style.position='';
+    }
+}

+ 18 - 16
src/views/report/InvalidResponse/components/reasonsAndEvidence/common.js

@@ -10,6 +10,7 @@ export default {
     data() {
       return {
           tableData:[],
+          claims:[],
         //   column:column,
           loading:false,
           editField:'',
@@ -25,9 +26,12 @@ export default {
     created() {},
     mounted() {
       this.init()
+      this.getClaims()
     },
     methods: {
+      //显示栏位管理
       showField(){},
+      //获取数据
       async init(){
          var params = {
             id:this.projectId,
@@ -48,25 +52,23 @@ export default {
                 this.loading = false
             }
          }).catch(error=>{
-            this.tableData = [
-                {
-                    "id":1,
-                    invalidReason:"无效理由",      
-                    presentOpinions:"陈述意见" ,
-                    "rbDecision":"复审委意见" ,
-                    invalidStatue:{
-                        "id":1,
-                        "statuteId":"4", 
-                        "claimText":"权要内容",
-                        "courtOpinions1":"一审法院意见", 
-                        "court_opinions2":"二审法院意见 ", 
-                        
-                    }
-                }
-            ]
+            this.tableData = []
             this.loading = false
          })
       },
+      getClaims(){
+        var params = {
+            projectId:this.projectId
+        }
+        this.$api.queryClaim(params).then(response=>{
+            if(response.code == 200){
+                this.claims = response.data.data
+            }
+        }).catch(error=>{
+            this.claims = []
+        })
+      },
+      //同步
       synchronization(){
         var params = {
             id:this.projectId

+ 9 - 3
src/views/report/InvalidResponse/components/reasonsAndEvidence/components/addStatute.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-dialog  title="添加无效理由" :visible.sync="dialog.showDialog" width="600px" :close-on-click-modal="false"  :before-close="handleClose" append-to-body>
+    <el-dialog title="添加无效理由" :visible.sync="dialog.showDialog" width="600px" :close-on-click-modal="false"  :before-close="handleClose" append-to-body>
         <el-form :model="form" ref="form" label-width="80px" label-position="left">
             <template >
                 <div>
@@ -45,14 +45,20 @@
 <script>
 export default {
   components: {},
-  props: {},
+  props: {
+    claims:{
+        type:Array,
+        default:()=>{
+            return []
+        }
+    }
+  },
   data() {
     return {
         dialog:{
             showDialog:false,
             btnLoading:false
         },
-        claims:[],
         form:{}
     };
   },

+ 51 - 0
src/views/report/InvalidResponse/components/reasonsAndEvidence/components/editDialog.vue

@@ -0,0 +1,51 @@
+<template>
+    <el-dialog :title="title" v-draggable v-shake="shake" :visible.sync="visible" width="800px" :before-close="close" :modal="false" :close-on-click-modal="false" :modal-append-to-body="false">
+        
+        <div slot="footer" class="dialog-footer">
+            <el-button @click="close">取 消</el-button>
+            <el-button type="primary" :loading="btnLoading" @click="submit">确 定</el-button>
+        </div>
+    </el-dialog>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: {
+    shake:{
+        type:Object,
+        default:()=>{
+            return {
+                shake:false
+            }
+        }
+    }
+  },
+  data() {
+    return {
+        title:'',
+        type:'',//1是选择框,2是输入框,3是数组
+        prop:{
+            label:'label',
+            value:'value'
+        },
+        visible:false,
+        btnLoading:false
+    };
+  },
+  watch: {},
+  computed: {},
+  created() {},
+  mounted() {},
+  methods: {
+    close(){
+        this.visible = false
+    },
+    submit(){
+
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 11 - 2
src/views/report/InvalidResponse/components/reasonsAndEvidence/details_2.vue

@@ -17,7 +17,7 @@
                         <div>
                             <!-- @input="(value)=>getData(scope.row,item.field,value)" -->
                             <div v-if="editField==(item.field+scope.row.id)">
-                                                  <el-select clearable v-if="item.field == 'courtOpinions1' || item.field == 'courtOpinions2'" :value="getColumnData(scope.row,item.field)" @change="(value)=>changeMessage(item.field,scope.row,value)" placeholder="请选择">
+                                <el-select clearable v-if="item.field == 'courtOpinions1' || item.field == 'courtOpinions2'" :value="getColumnData(scope.row,item.field)" @change="(value)=>changeMessage(item.field,scope.row,value)" placeholder="请选择">
                                     <el-option label="基于原权要维持有效"  value="基于原权要维持有效"></el-option>
                                     <el-option label="基于修改后权要维持有效"  value="基于修改后权要维持有效"></el-option>
                                     <el-option label="全部无效"  value="全部无效"></el-option>
@@ -31,6 +31,15 @@
                                     >
                                     </el-option>
                                 </el-select>
+                                <el-select v-else-if="item.field == 'claimText'" v-model="scope.row.claimText" @change="(value)=>changeMessage(item.field,scope.row,value)" placeholder="请选择" style="width:100%">
+                                    <el-option
+                                        v-for="item in claims"
+                                        :key="item.sysOrder"
+                                        :label="`权要${Number(item.sysOrder)+1}`"
+                                        :value="item.content"
+                                    >
+                                    </el-option>
+                                </el-select>
                                 <my-RichText v-else :autoFocus="true" :value="getColumnData(scope.row,item.field)" @blur="(value)=>changeMessage(item.field,scope.row,value)"></my-RichText>
                             </div>
                             <template v-else>
@@ -70,7 +79,7 @@
           </el-main>
       </el-container>
  
-      <addStatute ref="addStatute" @save="save"></addStatute>
+      <addStatute ref="addStatute" :claims="claims" @save="save"></addStatute>
     </div>
 </template>
 <script>