schangxiang@126.com
2025-09-10 3d43ffa3152110b7823f9fa6320c08a6ae02358a
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
<template>
  <div class="form-config-container">
    <el-form label-position="top">
      <el-row :gutter="3">
        <el-col :span="12">
          <el-form-item label="Model路径" required>
            <el-input v-model="dataOptions.folder"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="tableView" required>
            <el-input v-model="dataOptions.tableView"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :span="12">
          <el-form-item label="tableName">
            <el-input v-model="dataOptions.tableName"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="编辑开启tab分组">
            <el-switch v-model="dataOptions.openTabGroup" :active-value="true" :inactive-value="false" active-text="是" inactive-text="否">
            </el-switch>
          </el-form-item>
        </el-col>
      </el-row>
      <el-form-item label="固定条件">
        <el-input v-model="currentFixedWhere" :rows="3" type="textarea"></el-input>
      </el-form-item>
 
      <el-row :gutter="3">
        <el-col :span="12">
          <el-form-item label="idField" required>
            <el-input v-model="dataOptions.idField"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="自动编码字段">
            <el-input v-model="dataOptions.codeRegular"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-row :gutter="3">
        <el-col :span="12">
          <el-form-item label="连接字段" required>
            <el-input v-model="dataOptions.linkColumn"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="menu_Id" required>
            <el-input v-model.number="dataOptions.menu_Id"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-row :gutter="3">
        <el-col :span="24">
          <el-form-item label="路由" required>
            <el-input v-model="dataOptions.router"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-row :gutter="3">
        <el-col :span="6">
          <el-form-item label="分页大小">
            <el-input v-model.number="dataOptions.pageSize"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="18">
          <el-form-item label="列表排序方式">
            <el-input v-model="orderBy"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-row :gutter="3">
        <el-col :span="12">
          <el-form-item label="列表显示操作列">
            <el-switch v-model="dataOptions.showActionField" :active-value="true" :inactive-value="false" active-text="是" inactive-text="否">
            </el-switch>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="列表显示求和行">
            <el-switch v-model="dataOptions.showSumField" :active-value="true" :inactive-value="false" active-text="是" inactive-text="否">
            </el-switch>
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-row :gutter="3">
        <el-col :span="12">
          <el-form-item label="行内表单">
            <el-switch v-model="dataOptions.formInline" :active-value="false" :inactive-value="true" active-text="单独行" inactive-text="行内">
            </el-switch>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="查询独立行">
            <el-switch v-model="dataOptions.searchOnlyLine" :active-value="true" :inactive-value="false">
            </el-switch>
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-form-item label="标签对齐方式">
        <el-radio-group v-model="editorConfig.labelPosition">
          <el-radio-button label="left">左对齐</el-radio-button>
          <el-radio-button label="right">右对齐</el-radio-button>
          <el-radio-button label="top">顶部对齐</el-radio-button>
        </el-radio-group>
      </el-form-item>
 
      <el-row :gutter="3">
        <el-col :span="12">
          <el-form-item label="表单字段宽度">
            <el-input-number v-model="labelWidth" :min="0" :max="200" :step="10" controls-position="right" style="width:110px;"></el-input-number> px
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="表单宽度">
            <el-input-number v-model="formWidth" :min="0" :max="1000" :step="10" controls-position="right" style="width:110px;"></el-input-number> px
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-row :gutter="3">
        <el-col :span="12">
          <el-form-item label="对话框宽度">
            <el-input v-model="editorConfig.width"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="对话框顶部距离">
            <el-input v-model="editorConfig.top"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
 
      <el-row :gutter="3">
        <el-col :span="12">
          <el-form-item label="对话框标题">
            <el-input v-model="editorConfig.title"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="提交按钮名称">
            <el-input v-model="editorConfig.saveButtonText"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
 
    </el-form>
  </div>
</template>
 
<script>
export default {
  props: {
    editorConfig: {
      type: Object,
      default: () => {
        return {};
      }
    },
    dataOptions: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  computed: {
    labelWidth: {
      get: function() {
        return parseInt(this.editorConfig.labelWidth);
      },
      set: function(val) {
        this.editorConfig.labelWidth = val + "px";
      }
    },
    formWidth: {
      get: function() {
        return parseInt(this.editorConfig.formWidth);
      },
      set: function(val) {
        if (val) {
          this.editorConfig.formWidth = val + "px";
        } else {
          this.editorConfig.formWidth = null;
        }
      }
    },
    // 排序方式
    orderBy: {
      get: function() {
        return JSON.stringify(this.dataOptions.orderBy || this.dataOptions.sortName);
      },
      set: function(val) {
        try {
          if (!val) {
            this.$set(this.dataOptions, "orderBy", null);
            return;
          }
          const orderBy = JSON.parse(val);
          this.$set(this.dataOptions, "orderBy", orderBy);
          this.$message.success("列表排序方式格式正确");
        } catch (error) {
          this.$message.error("列表排序方式不是有效的JSON格式");
        }
      }
    },
    // fixedWhere JSON加载属性
    currentFixedWhere: {
      get: function() {
        debugger;
        var params = this.dataOptions.fixedWhere;
        if (params) {
          return JSON.stringify(params, 0, 2);
        } else {
          return "";
        }
      },
      set: function(val) {
        try {
          this.dataOptions.fixedWhere = JSON.parse(val);
          this.$message.success("json格式正确");
        } catch (error) {
          this.$message.error("数据结构不正确,不是有效的json格式," + error.message);
        }
      }
    }
  }
};
</script>