zhangh 3 lat temu
rodzic
commit
93a174686c

+ 9 - 4
src/views/manager/projectinfo/editElement/editElement.vue

@@ -278,7 +278,6 @@ export default {
       });
     },
     async cop () {
-      // console.log(localStorage.getItem('editElement'));
       let _that = this
       var MyComponent = await Vue.extend({
         template: localStorage.getItem('editElement'),
@@ -292,8 +291,14 @@ export default {
       document.getElementById('parent').appendChild(component.$el);
     },
     async copss () {
+      let _that = this
       var MyComponent = await Vue.extend({
-        template: localStorage.getItem('editElement')
+        template: localStorage.getItem('editElement'),
+        methods: {
+          RightClick (tr, td, x1, x2, y1, y2) {//鼠标右键事件
+            _that.RightClick2(tr, td, x1, x2, y1, y2)
+          },
+        }
       })
       var component = new MyComponent().$mount()
       let na = document.getElementById('parent')
@@ -318,11 +323,11 @@ export default {
       if (this.value) {
         this.tag = true
         this.submit({
-          id: this.value,
           tabId: this.$route.query.pkeyId,
           tdIndex: this.table.td,
           trIndex: this.table.tr,
-          colName:"",
+          colName: "",
+          htmlType: this.value
         })
       } else {
         this.$message({

+ 26 - 2
src/views/manager/projectinfo/treeTemplate/dynamicExcel.vue

@@ -44,6 +44,7 @@
           v-if="setUptype===0"
           :pkeyId='pkeyId'
           @cop='domss'
+          :htmlData="htmlData"
         />
         <electronicSignature v-if="setUptype===1" />
         <setFormula v-if="setUptype===2" />
@@ -65,6 +66,11 @@ export default {
   data () {
     return {
       setUptype: 0,//右侧显示的类型1
+      htmlData: {
+        name: '',
+        tr: '',
+        td: ''
+      }
     }
   },
   mounted () {
@@ -75,16 +81,26 @@ export default {
       this.$emit('remove')
     },
     async cop () {
+      let _that = this
       var MyComponent = await Vue.extend({
-        template: localStorage.getItem('excelHtml')
+        template: localStorage.getItem('excelHtml'),
+        methods: {
+          getInformation (name, tr, td) {//鼠标右键事件
+            _that.getInformation(name, tr, td)
+          },
+        }
       })
       var component = new MyComponent().$mount()
       let na = document.getElementById('parent')
       document.getElementById('parent').appendChild(component.$el);
     },
     async copss () {
+      let _that = this
       var MyComponent = await Vue.extend({
-        template: localStorage.getItem('excelHtml')
+        template: localStorage.getItem('excelHtml'),
+        getInformation (name, tr, td) {//鼠标右键事件
+          _that.getInformation(name, tr, td)
+        },
       })
       var component = new MyComponent().$mount()
       let na = document.getElementById('parent')
@@ -97,6 +113,14 @@ export default {
     domss () {
       this.copss()
     },
+    getInformation (name, tr, td) {//鼠标点击事件
+      console.log(name, tr, td);
+      this.htmlData = {
+        name,
+        tr,
+        td
+      }
+    },
   },
   components: {
     setInputTPT,

+ 21 - 17
src/views/manager/projectinfo/treeTemplate/template/setInputTPT.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="setInput">
     <div class="flexBetween">
-      <el-select
+      <!-- <el-select
         style="width:45%;"
         v-model="from.value"
         clearable
@@ -14,7 +14,12 @@
           :value="item.tabId"
         >
         </el-option>
-      </el-select>
+      </el-select> -->
+      <el-input
+        :disabled='true'
+        v-model="htmlData.name"
+        placeholder="请输入内容"
+      ></el-input>
       <el-select
         style="width:45%;"
         v-model="from.type"
@@ -83,8 +88,7 @@
     </div>
 
     <el-button
-      class="martop15"
-      style="float:right;"
+      style="float:right;margin-top:15px;"
       type="info"
       size="mini"
       @click="saveType()"
@@ -96,7 +100,7 @@
 import { dictionary, saveInput, getColByTabId } from "@/api/manager/AdjustForm";
 import { getExcelHtml } from '@/api/exctab/excelmodel'
 export default {
-  props: ['pkeyId'],
+  props: ['pkeyId', 'htmlData'],
   data () {
     return {
       elementName: [],
@@ -119,7 +123,7 @@ export default {
     saveType () {//保存设置按钮
       this.disabled = true
 
-      if (this.from.type && this.from.value) {
+      if (this.from.type && this.htmlData.name) {
         let ks = false
         if (this.from.type == 'select' | this.from.type == 'radio' | this.from.type == 'checkbox') {
           if (this.setInputTable) {
@@ -137,7 +141,7 @@ export default {
             this.disabled = false
           } else {
             this.saveInput({
-              colId: this.from.value,
+              colId: this.htmlData.name,
               nodeId: this.pkeyId,
               textId: this.from.type,
               textInfo: this.setInputTable
@@ -145,7 +149,7 @@ export default {
           }
         } else {
           this.saveInput({
-            colId: this.from.value,
+            colId: this.htmlData.name,
             nodeId: this.pkeyId,
             textId: this.from.type,
             textInfo: []
@@ -170,18 +174,18 @@ export default {
         this.getExcelHtml()
       }
     },
-    async getColByTabId () {//获取字段信息
-      const { data: res } = await getColByTabId({ tabId: this.pkeyId })
-      console.log(res);
-      if (res.code === 200) {
-        this.elementName = res.data
-      }
-    },
+    // async getColByTabId () {//获取字段信息
+    //   const { data: res } = await getColByTabId({ tabId: this.pkeyId })
+    //   console.log(res);
+    //   if (res.code === 200) {
+    //     this.elementName = res.data
+    //   }
+    // },
     async getExcelHtml () {
       const { data: res } = await getExcelHtml({ excelId: this.excelId })
       console.log(res);
       if (res.code === 200) {
-        this.from.value = ''
+        this.htmlData.name = ''
         this.from.type = ''
         this.setInputTable = []
         localStorage.setItem('excelHtml', res.data)
@@ -191,7 +195,7 @@ export default {
   },
   created () {
     this.dictionary()  //获取文本类型接口
-    this.getColByTabId()
+    // this.getColByTabId()
   },
 }
 </script>