mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
fix: 修复复制流水线保存后丢失分组和排序号的问题
This commit is contained in:
@@ -35,7 +35,7 @@ defineOptions({
|
||||
|
||||
const projectStore = useProjectStore();
|
||||
onMounted(async () => {
|
||||
await projectStore.reload();
|
||||
await projectStore.init();
|
||||
console.log(projectStore.myProjects);
|
||||
});
|
||||
|
||||
|
||||
@@ -82,7 +82,6 @@ export function useCrudPermission({ permission }: UseCrudPermissionProps) {
|
||||
if (isProjectPermission) {
|
||||
removePermission = per.projectPermission || "write";
|
||||
}
|
||||
debugger;
|
||||
return LodashMerge(
|
||||
{
|
||||
actionbar: {
|
||||
|
||||
@@ -26,6 +26,7 @@ export const certdResources = [
|
||||
isMenu: false,
|
||||
icon: "ion:apps",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -40,6 +41,7 @@ export const certdResources = [
|
||||
},
|
||||
isMenu: true,
|
||||
icon: "ion:apps",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -51,6 +53,7 @@ export const certdResources = [
|
||||
isMenu: false,
|
||||
show: true,
|
||||
icon: "ion:apps",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -61,6 +64,7 @@ export const certdResources = [
|
||||
meta: {
|
||||
icon: "ion:analytics-sharp",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -70,6 +74,7 @@ export const certdResources = [
|
||||
component: "/certd/pipeline/detail.vue",
|
||||
meta: {
|
||||
isMenu: false,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -80,6 +85,7 @@ export const certdResources = [
|
||||
meta: {
|
||||
icon: "ion:timer-outline",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -90,6 +96,7 @@ export const certdResources = [
|
||||
meta: {
|
||||
isMenu: true,
|
||||
icon: "ion:duplicate-outline",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -99,6 +106,7 @@ export const certdResources = [
|
||||
component: "/certd/pipeline/template/edit.vue",
|
||||
meta: {
|
||||
isMenu: false,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -108,6 +116,7 @@ export const certdResources = [
|
||||
component: "/certd/pipeline/template/import/index.vue",
|
||||
meta: {
|
||||
isMenu: false,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import LayoutPass from "/@/layout/layout-pass.vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import aboutResource from "/@/router/source/modules/about";
|
||||
import i18n from "/@/locales/i18n";
|
||||
|
||||
export const sysResources = [
|
||||
{
|
||||
@@ -13,6 +10,7 @@ export const sysResources = [
|
||||
icon: "ion:settings-outline",
|
||||
permission: "sys:settings:view",
|
||||
order: 10,
|
||||
auth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -27,6 +25,7 @@ export const sysResources = [
|
||||
},
|
||||
icon: "ion:speedometer-outline",
|
||||
permission: "sys:auth:user:view",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -38,6 +37,7 @@ export const sysResources = [
|
||||
meta: {
|
||||
icon: "ion:settings-outline",
|
||||
permission: "sys:settings:view",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -47,6 +47,7 @@ export const sysResources = [
|
||||
component: "/sys/enterprise/project/index.vue",
|
||||
meta: {
|
||||
show: true,
|
||||
auth: true,
|
||||
icon: "ion:apps",
|
||||
permission: "sys:settings:edit",
|
||||
keepAlive: true,
|
||||
@@ -60,6 +61,7 @@ export const sysResources = [
|
||||
meta: {
|
||||
isMenu: false,
|
||||
show: true,
|
||||
auth: true,
|
||||
icon: "ion:apps",
|
||||
permission: "sys:settings:edit",
|
||||
},
|
||||
@@ -73,6 +75,7 @@ export const sysResources = [
|
||||
icon: "ion:earth-outline",
|
||||
permission: "sys:settings:view",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -96,6 +99,7 @@ export const sysResources = [
|
||||
const settingStore = useSettingStore();
|
||||
return settingStore.isComm;
|
||||
},
|
||||
auth: true,
|
||||
icon: "ion:document-text-outline",
|
||||
permission: "sys:settings:view",
|
||||
},
|
||||
@@ -110,6 +114,7 @@ export const sysResources = [
|
||||
const settingStore = useSettingStore();
|
||||
return settingStore.isComm;
|
||||
},
|
||||
auth: true,
|
||||
icon: "ion:menu",
|
||||
permission: "sys:settings:view",
|
||||
keepAlive: true,
|
||||
@@ -125,6 +130,7 @@ export const sysResources = [
|
||||
const settingStore = useSettingStore();
|
||||
return settingStore.isComm;
|
||||
},
|
||||
auth: true,
|
||||
icon: "ion:disc-outline",
|
||||
permission: "sys:settings:view",
|
||||
keepAlive: true,
|
||||
@@ -139,6 +145,7 @@ export const sysResources = [
|
||||
icon: "ion:extension-puzzle-outline",
|
||||
permission: "sys:settings:view",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -151,6 +158,7 @@ export const sysResources = [
|
||||
icon: "ion:extension-puzzle",
|
||||
permission: "sys:settings:view",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -165,6 +173,7 @@ export const sysResources = [
|
||||
},
|
||||
icon: "ion:extension-puzzle",
|
||||
permission: "sys:settings:view",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -176,6 +185,7 @@ export const sysResources = [
|
||||
icon: "ion:golf-outline",
|
||||
permission: "sys:settings:view",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -187,6 +197,7 @@ export const sysResources = [
|
||||
icon: "ion:list-outline",
|
||||
permission: "sys:auth:per:view",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -198,6 +209,7 @@ export const sysResources = [
|
||||
icon: "ion:people-outline",
|
||||
permission: "sys:auth:role:view",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -209,6 +221,7 @@ export const sysResources = [
|
||||
icon: "ion:person-outline",
|
||||
permission: "sys:auth:user:view",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -224,6 +237,7 @@ export const sysResources = [
|
||||
return settingStore.isComm;
|
||||
},
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
@@ -238,6 +252,7 @@ export const sysResources = [
|
||||
},
|
||||
icon: "ion:cart",
|
||||
permission: "sys:settings:edit",
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -253,6 +268,7 @@ export const sysResources = [
|
||||
icon: "ion:bag-check",
|
||||
permission: "sys:settings:edit",
|
||||
keepAlive: true,
|
||||
auth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -17,7 +17,8 @@ export const useProjectStore = defineStore("app.project", () => {
|
||||
const inited = ref(false);
|
||||
const userStore = useUserStore();
|
||||
const userId = userStore.getUserInfo?.id;
|
||||
const lastProjectId = LocalStorage.get("currentProjectId:" + userId);
|
||||
const lastProjectIdCacheKey = "currentProjectId:" + userId;
|
||||
const lastProjectId = LocalStorage.get(lastProjectIdCacheKey);
|
||||
const currentProjectId = ref(lastProjectId); // 直接调用
|
||||
|
||||
const projects = computed(() => {
|
||||
@@ -63,7 +64,7 @@ export const useProjectStore = defineStore("app.project", () => {
|
||||
|
||||
function changeCurrentProject(id: string, silent?: boolean) {
|
||||
currentProjectId.value = id;
|
||||
LocalStorage.set("currentProjectId", id);
|
||||
LocalStorage.set(lastProjectIdCacheKey, id);
|
||||
if (!silent) {
|
||||
message.success("切换项目成功");
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
|
||||
delete form.lastVars;
|
||||
delete form.createTime;
|
||||
delete form.id;
|
||||
delete form.webhook;
|
||||
let pipeline = form.content;
|
||||
if (typeof pipeline === "string" && pipeline.startsWith("{")) {
|
||||
pipeline = JSON.parse(form.content);
|
||||
@@ -75,8 +76,8 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
|
||||
function onDialogOpen(opt: any) {
|
||||
const searchForm = crudExpose.getSearchValidatedFormData();
|
||||
opt.initialForm = {
|
||||
...opt.initialForm,
|
||||
groupId: searchForm.groupId,
|
||||
...opt.initialForm,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -219,7 +220,7 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
|
||||
row = info.pipeline;
|
||||
row.content = JSON.parse(row.content);
|
||||
row.title = row.title + "_copy";
|
||||
await crudExpose.openCopy({
|
||||
await crudExpose.openAdd({
|
||||
row: row,
|
||||
index: context.index,
|
||||
});
|
||||
|
||||
@@ -251,6 +251,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
if (bean.id > 0) {
|
||||
//修改
|
||||
old = await this.info(bean.id);
|
||||
bean.order = old.order;
|
||||
}
|
||||
if (!old || !old.webhookKey) {
|
||||
bean.webhookKey = await this.genWebhookKey();
|
||||
|
||||
Reference in New Issue
Block a user