|
|
@@ -108,12 +108,13 @@
|
|
|
v-loading="loading"
|
|
|
tooltip-effect="light"
|
|
|
row-key="@(@pkFieldName)"
|
|
|
+ @@sort-change="sortChange"
|
|
|
border="">
|
|
|
<el-table-column type="index" label="序号" width="55" align="center"/>
|
|
|
@foreach (var column in Model.TableField){
|
|
|
if(@column.WhetherTable == "Y"){
|
|
|
if(@column.EffectType == "Upload"||@column.EffectType == "fk"||@column.EffectType == "ApiTreeSelect"||@column.EffectType == "Switch"||@column.EffectType == "ConstSelector"){
|
|
|
- @:<el-table-column prop="@column.LowerPropertyName" label="@column.ColumnComment" width="@(column.ColumnComment!=null && column.ColumnComment.Length > 5 ? column.ColumnComment.Length * 15 : 120)" show-overflow-tooltip="">
|
|
|
+ @:<el-table-column prop="@column.LowerPropertyName" label="@column.ColumnComment" width="@(column.ColumnComment!=null && column.ColumnComment.Length > 5 ? column.ColumnComment.Length * 15 : 120)" @(column.WhetherSortable == "Y" ? "sortable='custom'" : "") show-overflow-tooltip="">
|
|
|
@:<template #default="scope">
|
|
|
if(@column.EffectType == "Upload"){
|
|
|
@:<el-image
|
|
|
@@ -142,21 +143,21 @@
|
|
|
</el-table-column>
|
|
|
}
|
|
|
else if(@column.EffectType == "Select"){
|
|
|
- @:<el-table-column prop="@column.LowerPropertyName" label="@column.ColumnComment" width="@(column.ColumnComment!=null && column.ColumnComment.Length > 5 ? column.ColumnComment.Length * 15 : 140)" show-overflow-tooltip="" >
|
|
|
+ @:<el-table-column prop="@column.LowerPropertyName" label="@column.ColumnComment" width="@(column.ColumnComment!=null && column.ColumnComment.Length > 5 ? column.ColumnComment.Length * 15 : 140)" @(column.WhetherSortable == "Y" ? "sortable='custom'" : "") show-overflow-tooltip="" >
|
|
|
@:<template #default="scope">
|
|
|
@:<el-tag :type="di('@(@column.DictTypeCode)', scope.row.@(@column.LowerPropertyName))?.tagType"> {{di("@(@column.DictTypeCode)", scope.row.@(@column.LowerPropertyName))?.value}} </el-tag>
|
|
|
@:</template>
|
|
|
@:</el-table-column>
|
|
|
}
|
|
|
else if(@column.EffectType == "EnumSelector"){
|
|
|
- @:<el-table-column prop="@column.LowerPropertyName" label="@column.ColumnComment" width="@(column.ColumnComment!=null && column.ColumnComment.Length > 5 ? column.ColumnComment.Length * 15 : 140)" show-overflow-tooltip="" >
|
|
|
+ @:<el-table-column prop="@column.LowerPropertyName" label="@column.ColumnComment" width="@(column.ColumnComment!=null && column.ColumnComment.Length > 5 ? column.ColumnComment.Length * 15 : 140)" @(column.WhetherSortable == "Y" ? "sortable='custom'" : "") show-overflow-tooltip="" >
|
|
|
@:<template #default="scope">
|
|
|
@:<el-tag>{{ getEnumDesc(scope.row.@column.LowerPropertyName, getEnum@(@column.PropertyName)Data_Index)}}</el-tag>
|
|
|
@:</template>
|
|
|
@:</el-table-column>
|
|
|
}
|
|
|
else {
|
|
|
- @:<el-table-column prop="@column.LowerPropertyName" label="@column.ColumnComment" width="@(column.ColumnComment!=null && column.ColumnComment.Length > 5 ? column.ColumnComment.Length * 15 : 140)" show-overflow-tooltip="" />
|
|
|
+ @:<el-table-column prop="@column.LowerPropertyName" label="@column.ColumnComment" width="@(column.ColumnComment!=null && column.ColumnComment.Length > 5 ? column.ColumnComment.Length * 15 : 140)" @(column.WhetherSortable == "Y" ? "sortable='custom'" : "") show-overflow-tooltip="" />
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -276,6 +277,13 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 列排序
|
|
|
+ const sortChange = async (column: any) => {
|
|
|
+ queryParams.value.field = column.prop;
|
|
|
+ queryParams.value.order = column.order;
|
|
|
+ await handleQuery();
|
|
|
+ };
|
|
|
+
|
|
|
// 打开新增页面
|
|
|
const openAdd@(@Model.ClassName) = () => {
|
|
|
edit@(@Model.ClassName)Title.value = '添加@(@Model.BusName)';
|