添加前后端筛选导出excel按钮权限
This commit is contained in:
@@ -1856,7 +1856,7 @@ test('六个基础资料页面逐页满足 API、权限、分页和安全删除
|
||||
assert.doesNotMatch(source, /\bhandle(?:Import|Export)\b|proxy\.download\(/)
|
||||
assert.match(
|
||||
masterToolbar,
|
||||
new RegExp(`<master-excel-actions resource="${resource}" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList"\\s*/>`),
|
||||
new RegExp(`<master-excel-actions resource="${resource}" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList"\\s*/>`),
|
||||
`${resource} 必须复用基础资料导入导出组件`
|
||||
)
|
||||
assert.match(
|
||||
@@ -1979,7 +1979,7 @@ test('隧道资料页复用基础资料导入导出组件', async () => {
|
||||
const masterToolbar = source.match(/<el-row\b[^>]*class="[^"]*\bmaster-toolbar\b[^"]*"[^>]*>[\s\S]*?<\/el-row>/)?.[0] || ''
|
||||
assert.match(
|
||||
masterToolbar,
|
||||
/<master-excel-actions resource="tunnel" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList"\s*\/>/
|
||||
/<master-excel-actions resource="tunnel" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList"\s*\/>/
|
||||
)
|
||||
assert.match(masterToolbar, /<\/template>\s*<master-excel-actions\b[\s\S]*?\/>\s*<right-toolbar\b/)
|
||||
assert.doesNotMatch(source, />\s*(?:导入|导出)\s*<\/el-button>/)
|
||||
|
||||
@@ -95,6 +95,10 @@ const props = defineProps({
|
||||
queryParams: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
selectedIds: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
});
|
||||
const emit = defineEmits(["imported"]);
|
||||
@@ -136,9 +140,13 @@ function downloadTemplate() {
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
const exportParams = { ...props.queryParams };
|
||||
if (Array.isArray(props.selectedIds) && props.selectedIds.length > 0) {
|
||||
exportParams.ids = props.selectedIds.join(",");
|
||||
}
|
||||
proxy.download(
|
||||
`master/${props.resource}/export`,
|
||||
{ ...props.queryParams },
|
||||
exportParams,
|
||||
`${props.resource}_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<el-button type="warning" plain icon="FolderAdd" :disabled="!selectedIds.length" @click="openAdoptionDialog" v-hasPermi="['system:testbatch:adopt']">纳入测试批次</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
<master-excel-actions resource="customer" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList" />
|
||||
<master-excel-actions resource="customer" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList" />
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<el-button type="warning" plain icon="FolderAdd" :disabled="!selectedIds.length" @click="openAdoptionDialog" v-hasPermi="['system:testbatch:adopt']">纳入测试批次</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
<master-excel-actions resource="line" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList" />
|
||||
<master-excel-actions resource="line" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList" />
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<el-button type="warning" plain icon="FolderAdd" :disabled="!selectedIds.length" @click="openAdoptionDialog" v-hasPermi="['system:testbatch:adopt']">纳入测试批次</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
<master-excel-actions resource="pallet" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList" />
|
||||
<master-excel-actions resource="pallet" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList" />
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<el-button type="warning" plain icon="FolderAdd" :disabled="!selectedIds.length" @click="openAdoptionDialog" v-hasPermi="['system:testbatch:adopt']">纳入测试批次</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
<master-excel-actions resource="site" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList" />
|
||||
<master-excel-actions resource="site" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList" />
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<el-button type="warning" plain icon="FolderAdd" :disabled="!selectedIds.length" @click="openAdoptionDialog" v-hasPermi="['system:testbatch:adopt']">纳入测试批次</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
<master-excel-actions resource="strain" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList" />
|
||||
<master-excel-actions resource="strain" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList" />
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<el-button type="warning" plain icon="FolderAdd" :disabled="!selectedIds.length" @click="openAdoptionDialog" v-hasPermi="['system:testbatch:adopt']">纳入测试批次</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
<master-excel-actions resource="tunnel" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList" />
|
||||
<master-excel-actions resource="tunnel" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList" />
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<el-button type="warning" plain icon="FolderAdd" :disabled="!selectedIds.length" @click="openAdoptionDialog" v-hasPermi="['system:testbatch:adopt']">纳入测试批次</el-button>
|
||||
</el-col>
|
||||
</template>
|
||||
<master-excel-actions resource="warehouse" :allow-import="isMasterWriteAllowed" :query-params="queryParams" @imported="getList" />
|
||||
<master-excel-actions resource="warehouse" :allow-import="isMasterWriteAllowed" :query-params="queryParams" :selected-ids="selectedIds" @imported="getList" />
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user