File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
api/SimpleAdmin/SimpleAdmin.Web.Entry/wwwroot/CodeGen/Frontend/views Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -155,10 +155,8 @@ var showColumns= tableFieIds.Where(it => it.WhetherTable == "Y").ToList();//获
155155 <template #operator>
156156 <a-space>
157157 <a-button type="primary" @@click="formRef.onOpen()" v-if="hasPerm('@(@Model.ClassNameFirstLower)Add')">
158- <template #icon><plus-outlined /></template>新增</a-button>
159- <a-popconfirm title="确定要删除选中@(@Model.FunctionName)吗?" :disabled="selectedRowKeys.length === 0" @@confirm="deleteBatch@(@Model.ClassName)()">
160- <a-button danger type="primary" :disabled="selectedRowKeys.length === 0" v-if="hasPerm('@(@Model.ClassNameFirstLower)BatchDelete')"><template #icon><delete-outlined /></template>删除</a-button>
161- </a-popconfirm>
158+ <template #icon><plus-outlined /></template>新增@(@Model.FunctionName)</a-button>
159+ <batch-delete v-if="hasPerm('@(@Model.ClassNameFirstLower)BatchDelete')"> title="确定要删除选中@(@Model.FunctionName)吗?" buttonName="删除@(@Model.FunctionName)" :selectedRowKeys="selectedRowKeys" @@batchDelete="deleteBatch@(@Model.ClassName)"/>
162160 </a-space>
163161 </template>
164162 <template #bodyCell="{ column, record }">
@@ -318,19 +316,7 @@ var isSelect=searchColumns.Any(it => it.EffectType=="select"||it.EffectType=="ra
318316 }
319317
320318 // 批量删除
321- const deleteBatch@(@Model.ClassName) = () => {
322- if (selectedRowKeys.value.length < 1) {
323- message.warning('请选择一条或多条数据')
324- return false
325- }
326- const params = selectedRowKeys.value.map((m) => {
327- return {
328- @foreach (var column in tableFieIds){//遍历字段
329- @if(column.IsPrimarykey=="Y"){//如果是主键
330- @:@column.FieldNameFirstLower: m
331- }}
332- }
333- })
319+ const deleteBatch@(@Model.ClassName) = (params) => {
334320 @(@Model.ClassNameFirstLower)Api.@(@Model.ClassNameFirstLower)Delete(params).then(() => {
335321 table.value.clearRefreshSelected()
336322 })
You can’t perform that action at this time.
0 commit comments