田源
2023-05-05 ae5ee96f6a7d6722526cb00f8b7a8fb7778596ea
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<template>
  <basic-container>
    <avue-tabs :option="Taboption" @change="handleChange"></avue-tabs>
    <span v-if="type.prop==='tab1'">
      <attrCrud></attrCrud>
    </span>
    <span v-else-if="type.prop==='tab2'">模板流程</span>
    <span v-else-if="type.prop==='tab3'">模板阶段</span>
    <span v-else-if="type.prop==='tab4'">模板按钮流程</span>
  </basic-container>
 
</template>
 
<script>
export default {
  name: "TemplatePro.vue",
  data: function () {
    return {
      type: {},
      Taboption: {
        column: [{
          icon: 'el-icon-info',
          label: '模板属性',
          prop: 'tab1',
        }, {
          icon: 'el-icon-warning',
          label: '模板流程',
          prop: 'tab2',
        }, {
          icon: 'el-icon-question',
          label: '模板阶段',
          prop: 'tab3',
        }, {
          icon: 'el-icon-question',
          label: '模板按钮流程',
          prop: 'tab4',
        }]
      },
 
    }
  },
  created() {
    // 进入页面默认是模板属性
    this.type = this.Taboption.column[0];
    this.type.prop = "tab1"
  },
  methods: {
    // Tab栏切换
    handleChange(column) {
      this.type = column
      this.$message.success(JSON.stringify(column))
    },
  }
}
</script>
 
 
<!--<template>-->
<!--  &lt;!&ndash; 使用 Element UI 的表格组件展示数据 &ndash;&gt;-->
<!--  &lt;!&ndash; 对每行数据渲染一个表格行组件 &ndash;&gt;-->
<!--  <el-table :data="data">-->
<!--    <el-table-column v-for="column in columns" :key="column.prop" :label="column.label">-->
<!--      <template slot-scope="scope">-->
<!--        <template v-if="isEditing(scope.$index, column.prop)">-->
<!--          &lt;!&ndash; 使用自定义输入框,绑定数据并监听 blur 事件 &ndash;&gt;-->
<!--          <el-input v-model="editorModel[scope.$index][column.prop]" ref="editor"-->
<!--                    @blur="onEditorBlur(scope.$index, column.prop)">-->
<!--          </el-input>-->
<!--        </template>-->
<!--        <template v-else>-->
<!--          &lt;!&ndash; 将数据渲染为表格单元格,绑定 click 事件 &ndash;&gt;-->
<!--          <div @click="onCellClick(scope.$index, column.prop)"-->
<!--               :style="{cursor: 'pointer', backgroundColor: isEditing(scope.$index, column.prop) ? '#F0F0F0' : 'transparent'}">-->
<!--            {{ scope.row[column.prop] === "" ? '' : scope.row[column.prop] }}-->
<!--          </div>-->
<!--        </template>-->
<!--      </template>-->
<!--    </el-table-column>-->
<!--  </el-table>-->
<!--</template>-->
 
<!--<script>-->
<!--export default {-->
<!--  data() {-->
<!--    // 组件的数据,包括表格的数据、列定义和当前正在编辑的行和列-->
<!--    return {-->
<!--      data: [-->
<!--        { id: 1, name: '张三', age: 18, attributegroup: '男', attributeDataTypeText: '广东省深圳市' },-->
<!--        { id: 2, name: '李四', age: 20, attributegroup: '女', attributeDataTypeText: '北京市海淀区' },-->
<!--        { id: 3, name: '王五', age: 22, attributegroup: '男', attributeDataTypeText: '上海市浦东新区' },-->
<!--        { id: 4, name: '赵六', age: 24, attributegroup: '女', attributeDataTypeText: '广东省广州市' }-->
<!--      ],-->
<!--      columns: [  // 定义表格的列-->
<!--        {-->
<!--          label: "属性英文编号",-->
<!--          prop: "id",-->
<!--          fixed: true,-->
<!--          cell: false,-->
<!--          labelWidth: 110,-->
<!--          width: 125,-->
<!--          sortable: true,-->
<!--        },-->
<!--        {-->
<!--          label: "属性中文名称",-->
<!--          prop: "name",-->
<!--          fixed: true,-->
<!--          cell: false,-->
<!--          width: 125,-->
<!--          sortable: true-->
<!--        },-->
<!--        {-->
<!--          label: "属性分组",-->
<!--          prop: "attributegroup",-->
<!--          cell: false,-->
<!--          sortable: true,-->
<!--          width: 125,-->
<!--        },-->
<!--        {-->
<!--          label: "类型",-->
<!--          prop: "attributeDataTypeText",-->
<!--          cell: false,-->
<!--          sortable: true,-->
<!--        },-->
<!--        {-->
<!--          label: "列表宽度",-->
<!--          prop: "attrTableWidth",-->
<!--          cell: false,-->
<!--          sortable: true,-->
<!--          width: 105,-->
<!--        },-->
<!--        {-->
<!--          label: "关键属性",-->
<!--          prop: "keyattrflag",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "查询属性",-->
<!--          prop: "queryattrflag",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "高级查询属性",-->
<!--          prop: "seniorqueryattrflag",-->
<!--          width: 95,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "相似查询属性",-->
<!--          prop: "samerepeatattrflag",-->
<!--          width: 95,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "必输",-->
<!--          prop: "requireflag",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "表单显示",-->
<!--          prop: "formdisplayflag",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "列表显示",-->
<!--          prop: "tabledisplayflag",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "只读",-->
<!--          prop: "readonlyflag",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "列表排序",-->
<!--          prop: "sortattrflag",-->
<!--          cell: false,-->
<!--        },-->
 
<!--        {-->
<!--          label: "多行文本",-->
<!--          prop: "textareaflag",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "默认值",-->
<!--          prop: "defaultvalue",-->
<!--          sortable: true,-->
<!--          cell: false,-->
<!--          width: 95,-->
<!--        },-->
<!--        {-->
<!--          label: "前缀",-->
<!--          prop: "prefixvalue",-->
<!--          sortable: true,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "后缀",-->
<!--          prop: "suffixvalue",-->
<!--          sortable: true,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "组合规则",-->
<!--          prop: "componentrule",-->
<!--          sortable: true,-->
<!--          cell: false,-->
<!--          width: 105,-->
<!--        },-->
<!--        {-->
<!--          label: "验证规则",-->
<!--          prop: "verifyrule",-->
<!--          sortable: true,-->
<!--          cell: false,-->
<!--          width: 105,-->
<!--        },-->
<!--        {-->
<!--          label: "时间格式",-->
<!--          prop: "codedateformat",-->
<!--          sortable: true,-->
<!--          width: 105,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "分类注入",-->
<!--          prop: "classifyinvokelevel",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "枚举注入",-->
<!--          prop: "enumString",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "级联属性",-->
<!--          prop: "parentCode",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "参照配置",-->
<!--          prop: "referConfig",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "级联查询属性",-->
<!--          prop: "parentQueryAttr",-->
<!--          width: 105,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "选择库标识",-->
<!--          prop: "libraryIdentification",-->
<!--          width: 105,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "填写提示",-->
<!--          prop: "explain",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "表单显示样式",-->
<!--          prop: "formdisplaystyle",-->
<!--          width: 105,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "表格显示样式",-->
<!--          prop: "tabledisplaystyle",-->
<!--          width: 105,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "表单超链接",-->
<!--          prop: "formhref",-->
<!--          width: 95,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "表格超链接",-->
<!--          prop: "tablehref",-->
<!--          width: 95,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "表格显示js",-->
<!--          prop: "tabledisplayjs",-->
<!--          width: 95,-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "长度",-->
<!--          prop: "controllength",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "小数精度",-->
<!--          prop: "precisionlength",-->
<!--          cell: false,-->
<!--        },-->
<!--        {-->
<!--          label: "取值范围",-->
<!--          prop: "valuearea",-->
<!--          sortable: true,-->
<!--          cell: false,-->
<!--          width: 105,-->
<!--        },-->
 
<!--      ],-->
<!--      editingIndex: -1,  // 当前正在编辑的行的索引-->
<!--      editingColumn: '',  // 当前正在编辑的列的属性名-->
<!--      editorModel: []  // 编辑框的数据,使用数组保存每个单元格的数据-->
<!--    };-->
<!--  },-->
<!--  created() {-->
<!--    // 在组件创建时,初始化编辑框的数据-->
<!--    this.editorModel = this.data.map(row => {-->
<!--      const editorRow = {};-->
<!--      this.columns.forEach(column => {-->
<!--        editorRow[column.prop] = row[column.prop];-->
<!--      });-->
<!--      return editorRow;-->
<!--    });-->
<!--  },-->
<!--  methods: {-->
<!--    // 单元格点击事件处理函数-->
<!--    onCellClick(rowIndex, columnProp) {-->
<!--      if (this.editingIndex >= 0 && this.editingColumn) {-->
<!--        this.onEditorBlur(this.editingIndex, this.editingColumn);-->
<!--        return;-->
<!--      }-->
 
<!--      const cellValue = this.data[rowIndex][columnProp];-->
<!--      if (cellValue === undefined || cellValue === null) {-->
<!--        this.data[rowIndex][columnProp] = '';-->
<!--      }-->
 
<!--      this.editingIndex = rowIndex;-->
<!--      this.editingColumn = columnProp;-->
 
<!--      this.$nextTick(() => {-->
<!--        this.$refs.editor.focus();-->
<!--      });-->
<!--    },-->
 
<!--    // 编辑框失焦事件处理函数-->
<!--    onEditorBlur(rowIndex, columnProp) {-->
<!--      // 将当前编辑框的数据保存到表格数据中-->
<!--      const editorValue = this.editorModel[rowIndex][columnProp];-->
<!--      if (editorValue === '') {-->
<!--        this.data[rowIndex][columnProp] = undefined;-->
<!--      } else {-->
<!--        this.data[rowIndex][columnProp] = editorValue;-->
<!--      }-->
 
<!--      this.editingIndex = -1;-->
<!--      this.editingColumn = '';-->
<!--    },-->
<!--    // 判断指定单元格是否在编辑状态-->
<!--    isEditing(rowIndex, columnProp) {-->
<!--      return rowIndex === this.editingIndex && columnProp === this.editingColumn;-->
<!--    }-->
<!--  }-->
<!--};-->
<!--</script>-->
 
 
<style lang="scss">
//修改分类注入对话框公共样式
.mydialog .el-dialog__body {
  padding: 10px 20px 30px;
}
 
</style>