zouyu
2023-11-10 131bc7a32291a13e5e9d379c4978e02795e6b3dc
参数
已修改3个文件
85 ■■■■ 文件已修改
src/views/common/param-mergeTemplate.vue 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/technology/routing/routing-form.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/common/param-mergeTemplate.vue
@@ -1,15 +1,7 @@
<template>
  <div>
        <avue-crud
        ref="crud"
        class="l-mes"
        rowKey="oneId"
        :data="tableData"
        :option="option"
        :span-method="spanMethod"
        :page="page"
        :table-loading="loading"
        >
        <avue-crud ref="crud" class="l-mes" rowKey="oneId" :data="tableData" :option="option" :span-method="spanMethod"
            :page="page" :table-loading="loading">
        <template slot="code" slot-scope="scope">
            <avue-text-ellipsis use-tooltip :text="scope.row.code" :height="40" :width="100">
                <small slot="more">...</small>
@@ -19,11 +11,39 @@
                <el-input @blur="checkType(scope.row)" :disabled="routingTemplateId!=null" :placeholder="'请输入'+scope.row.paramType" v-model="scope.row.paramValue"/>
            </template>
        </avue-crud>
        <!-- <el-table :data="tableData" ref="commonTree" :span-method="objectSpanMethod" border row-key="id" style="width: 100%">
            <el-table-column prop="code" label="编码"></el-table-column>
            <el-table-column prop="paramItem" label="一级"></el-table-column>
            <el-table-column prop="paramItemTwo" label="二级"></el-table-column>
            <el-table-column prop="paramItemThree" label="三级"></el-table-column>
            <el-table-column prop="paramType" label="类型"></el-table-column>
            <el-table-column prop="paramValue" label="值"></el-table-column>
            <el-table-column prop="unit" label="单位"></el-table-column>
        </el-table> -->
  </div>
</template>
<script>
export default {
    // props: ["tableTreeData"],
    data() {
        return {
            checkType(row) {
                if (row.paramType == '数值格式') {
                    let val = row.paramValue
                    const reg = /^[0-9]*$/
                    if (!reg.test(val)) {
                        row.paramValue = ''
                        this.$message.warning("请输入数值格式的数据!")
                    }
                }
            },
            mergeObj: {},
            mergeArr: ['code','paramItem', 'paramItemTwo',],
            tableData: [],
            // routingTemplateId: null
        }
    },
    props:{
       option:{
         type: Object,
@@ -89,7 +109,7 @@
         }
         }
       },
       tableData:{
        tableTreeData: {
         type: Array,
         default: () => {
            return []
@@ -132,7 +152,23 @@
         }
       }
    },
    watch:{
        tableTreeData:{
            handler(old,newval){
            console.log(this.tableTreeData);
            this.tableData=JSON.parse(JSON.stringify(this.tableTreeData))
            // this.getSpanArr(this.tableData);
            this.rowSort()
            this.rowCalc()
            },
            deep: true
        }
    },
    created(){
        // this.$nextTick(() => {
        //     this.$refs.crud.doLayout()
        // })
        this.tableData=JSON.parse(JSON.stringify(this.tableTreeData))
        this.rowSort()
        this.rowCalc()
    },
@@ -158,7 +194,7 @@
        //动态合并方法
        rowCalc() {
            this.spanArr.forEach((ele, index) => {
                let parent
                let parent = null
                if (index !== 0) parent = this.spanArr[ele.parent || index - 1].span
                ele.span = this.rowSpan(ele.prop, parent)
            })
src/views/technology/routing/routing-form.vue
@@ -564,16 +564,26 @@
                    </el-button>
                  </div>
                </div>
                <div>
                    <!-- <paramMergeTemplate :key="isShowTree" :tableTreeData="paramData" :routingTemplateId="routingTemplateId"/> -->
                <component
                :is="paramMergeTemplate"
                :key="isShowTree"
                :tableTreeData="paramData"
                :routingTemplateId="routingTemplateId"
                ></component>
                </div>
                <!-- <paramMergeTemplate 
                :tableData="paramData"
                :page="{}"
                >
                </paramMergeTemplate> -->
                <component
                <!-- <component
                :is="paramMergeTemplate" 
                :key="isShowTree"
                :tableData="paramData"
                :routingTemplateId="routingTemplateId"
                ></component>
                ></component> -->
                <!-- <el-table :data="paramData" class="l-mes" height="600">
                  <el-table-column
                    label="参数项"
@@ -700,6 +710,7 @@
    return {
      paramMergeTemplate: '',
      itemKey: '',
      isShowTree: false,
      typeOptions: [],
      paramTemplateSelArr: [],
      paramTemplateSelCol: 'operationTemplateNo',
@@ -1073,6 +1084,13 @@
    },
    // 参数集模板点击事件
    templateRowClick(row) {
      if(this.isShowTree){
        this.isShowTree=false
      }else{
        this.isShowTree=true
      }
      console.log(this.isShowTree);
      this.paramData=[]
      this.getRoutingTemplateParam(row.id)
    },
    // 根据工艺、工序id、模板id去获取模板下的参数
@@ -1085,6 +1103,7 @@
        })
      ).then((response) => {
        if (response.data.data.length > 0) {
          this.paramData = []
          this.paramData = response.data.data
          this.paramMergeTemplate = 'paramMergeTemplate'
        } else {
vue.config.js
@@ -3,7 +3,7 @@
 * https://cli.vuejs.org/zh/config/
 */
//const url = 'http://ztt-gateway:9999'
const url = 'http://192.168.0.15:9999'
const url = 'http://ztt-gateway:9999'
const localUrl = 'http://localhost:8089'
//const localUrl = 'http://10.88.15.95:8089'
const CompressionWebpackPlugin = require('compression-webpack-plugin')