jinlin
2024-09-26 089b302259e03ce52fc102bcf168d1fa048fffe9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<template>
  <div class="fa-card-a" shadow="never">
    <div class="mod-sync-config}">
        <zt-table-wraper ref="tableObj" v-slot="{ table }" :lazy="true"
                         delete-url="/maintain/SyncConfig" query-url="/maintain/SyncConfig/page">
              <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
                <zt-form-item >
                  <el-input v-model="dataForm.tabledesc" clearable placeholder="请输入数据表说明"></el-input>
                </zt-form-item>
                <zt-form-item prop="src">
                  <zt-select v-model="dataForm.src" :datas="cmplist" placeholder="请输入源"
                             @input="table.query()"></zt-select>
                </zt-form-item>
                <zt-form-item>
                  <zt-select v-model="dataForm.dst" :datas="cmplist" placeholder="请输入目的"
                             @input="table.query()"></zt-select>
                </zt-form-item>
                <zt-form-item class="message-btn">
                  <zt-button type="query" @click="table.query()"/>
                </zt-form-item>
                <zt-form-item >
                  <zt-button v-show="true" type="add" @click="table.editHandle()"/>
                </zt-form-item>
              </el-form>
              <el-table v-adaptive="{bottomOffset:70}"
                        v-loading="table.dataLoading"
                        :data="table.dataList"
                        style="margin-top:10px"
                        border height="100px" highlight-current-row>
                <!-- <el-table-column type="selection" width="40"/> -->
                <el-table-column align="center" label="规则说明" prop="tabledesc" width="150"/>
                <el-table-column :formatter="formatBoolean" align="center" label="是否启用" prop="relatedDataFlow"
                                 width="200"/>
                <!-- <el-table-column fixed prop="databasename" label="数据库名称" width="100"/>
                <el-table-column fixed prop="tablename" label="数据表名称" width="100"/>
                <el-table-column fixed prop="pkField" label="厂家字段名称" width="100"/> -->
                <!-- <el-table-column prop="id" label="唯一标识" width="100"/> -->
                <el-table-column :formatter="formatSrc" align="center" label="源" prop="src"/>
                <el-table-column :formatter="formatDst" align="center" label="目的" prop="dst"/>
                <!-- <el-table-column prop="datalevel" label="数据等级" width="100"/> -->
            <!-- <el-table-column prop="direct" label="数据传递方向" width="120"/> -->
            <!-- <el-table-column prop="ismarkfield" label="主键是自增长字段" width="140"/> -->
            <el-table-column align="center" label="不传递列" prop="fieldlist" width="200"/>
            <el-table-column :formatter="formatBoolean" align="center" label="时间过滤" prop="timecond" width="120"/>
            <!--            <el-table-column prop="productCond" label="按产品节点过滤" width="120" :formatter="formatBoolean"/>
                        <el-table-column prop="productfield" label="产品节点ID字段" width="180"/>
                        <el-table-column prop="productdatafield" label="产品数据ID字段" width="160"/>
                        <el-table-column prop="companyCond" label="按厂家过滤" width="120" :formatter="formatBoolean"/>
                        <el-table-column prop="fkField" label="厂家字段名称" width="200"/>-->
                <!-- <el-table-column prop="otherCond" label="按其他条件过滤"/> -->
                <el-table-column align="center" label="按其他条件过滤" prop="otherCondDesc" width="200"/>
                <el-table-column align="center" label="附件条件sql" prop="addcond" width="200"/>
                <el-table-column align="center" label="其他条件外键" prop="otherTermKey" width="150"/>
                <!--            <el-table-column prop="relatedStateHandle" label="相关状态处理" width="150"/>-->
                <zt-table-column-handle :table="table" delete-perm="sync:config:delete" edit-perm="sync:config:update"
                                        width="120">
                </zt-table-column-handle>
              </el-table>
          <!-- 弹窗, 新增 / 修改 -->
          <add-or-update :id="dataForm.id" @refreshDataList="table.query"/>
        </zt-table-wraper>
    </div>
  </div>
</template>
 
<script>
import AddOrUpdate from './sync-config-add-or-update'
 
export default {
  data() {
    return {
      dataForm: {
        orderField: 'src,dst,sortno',
        order: 'asc'
      },
      cmplist: [{id: 'cj', name: '厂家'}, {id: 'jd', name: '基地'}, {id: 'yjs', name: '研究所'}],
      selectedProject: null
    }
  },
  components: {
    AddOrUpdate
  },
  mounted() {
    this.getsyncConfigList()
    //this.gettarget()
  },
  methods: {
    async getsyncConfigList() {
      this.$refs.tableObj.query()
    },
    /* 布尔值格式化:cellValue为后台返回的值 */
    formatBoolean: function (row, column, cellValue) {
      var ret = '' // 你想在页面展示的值
      if (cellValue) {
        ret = '是' // 根据自己的需求设定
      } else {
        ret = '否'
      }
      return ret
    },
    formatSrc: function (row, column) {
      return row.src === 'yjs' ? '研究所' : row.src === 'cj' ? '厂家' : row.src === 'jd' ? '基地' : '未知'
    },
    formatDst: function (row, column) {
      return row.dst === 'yjs' ? '研究所' : row.dst === 'cj' ? '厂家' : row.dst === 'jd' ? '基地' : '未知'
    },
    async gettarget() {
      let res = await this.$http.get('/sys/data/export/record/dict/company')
      if (res.success) {
        this.cmplist = res.data
      }
    }
  }
}
</script>