mirror of
https://github.com/certd/certd.git
synced 2026-05-16 21:27:34 +08:00
chore: 手机端适配
This commit is contained in:
@@ -265,7 +265,7 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru
|
||||
type: "number",
|
||||
search: {
|
||||
show: true,
|
||||
col: { span: 3 },
|
||||
col: { span: 2 },
|
||||
},
|
||||
column: {
|
||||
width: 100,
|
||||
@@ -281,7 +281,7 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru
|
||||
show: computed(() => {
|
||||
return userStore.isAdmin && settingStore.sysPublic.managerOtherUserPipeline;
|
||||
}),
|
||||
col: { span: 3 },
|
||||
col: { span: 2 },
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
@@ -317,40 +317,41 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru
|
||||
},
|
||||
},
|
||||
},
|
||||
content: {
|
||||
title: t("certd.fields.pipelineContent"),
|
||||
form: { show: false },
|
||||
column: {
|
||||
show: false,
|
||||
},
|
||||
valueBuilder({ row }) {
|
||||
if (row.content) {
|
||||
row.content = JSON.parse(row.content);
|
||||
const pipeline = row.content;
|
||||
let stepCount = 0;
|
||||
eachStages(pipeline.stages, (item, runnableType) => {
|
||||
if (runnableType === "step") {
|
||||
stepCount++;
|
||||
}
|
||||
});
|
||||
row._stepCount = stepCount;
|
||||
if (pipeline.triggers) {
|
||||
row._triggerCount = pipeline.triggers?.length > 0 ? pipeline.triggers.length : "-";
|
||||
}
|
||||
}
|
||||
},
|
||||
valueResolve({ row }) {
|
||||
if (row.content) {
|
||||
row.content = JSON.stringify(row.content);
|
||||
}
|
||||
},
|
||||
},
|
||||
// content: {
|
||||
// title: t("certd.fields.pipelineContent"),
|
||||
// form: { show: false },
|
||||
// column: {
|
||||
// show: false,
|
||||
// },
|
||||
// valueBuilder({ row }) {
|
||||
// if (row.content) {
|
||||
// row.content = JSON.parse(row.content);
|
||||
// const pipeline = row.content;
|
||||
// let stepCount = 0;
|
||||
// eachStages(pipeline.stages, (item, runnableType) => {
|
||||
// if (runnableType === "step") {
|
||||
// stepCount++;
|
||||
// }
|
||||
// });
|
||||
// row._stepCount = stepCount;
|
||||
// if (pipeline.triggers) {
|
||||
// row._triggerCount = pipeline.triggers?.length > 0 ? pipeline.triggers.length : "-";
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// valueResolve({ row }) {
|
||||
// if (row.content) {
|
||||
// row.content = JSON.stringify(row.content);
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
triggerCount: {
|
||||
title: t("certd.fields.scheduledTaskCount"),
|
||||
type: "number",
|
||||
column: {
|
||||
align: "center",
|
||||
width: 100,
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
form: {
|
||||
show: false,
|
||||
@@ -465,6 +466,12 @@ export default function ({ crudExpose, context: { selectedRowKeys } }: CreateCru
|
||||
disabled: {
|
||||
title: t("certd.fields.enabled"),
|
||||
type: "dict-switch",
|
||||
search: {
|
||||
show: true,
|
||||
col: {
|
||||
span: 2,
|
||||
},
|
||||
},
|
||||
dict: dict({
|
||||
data: [
|
||||
{ value: false, label: t("certd.fields.enabledLabel") },
|
||||
|
||||
@@ -61,22 +61,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="warning">
|
||||
<a-carousel arrows dots-class="slick-dots slick-thumb" autoplay dot-position="right">
|
||||
<a-alert v-if="!settingStore.isComm" type="warning" show-icon>
|
||||
<template #message>
|
||||
<div>
|
||||
{{ t("certd.dashboard.alertMessage") }}
|
||||
<a class="ml-5 flex-inline" href="https://gitee.com/certd/certd" target="_blank">gitee</a>、 <a class="ml-5 flex-inline" href="https://github.com/certd/certd" target="_blank">github</a>、
|
||||
<a class="ml-5 flex-inline" href="https://certd.docmirror.cn" target="_blank">{{ t("certd.dashboard.helpDoc") }}</a>
|
||||
</div>
|
||||
</template>
|
||||
</a-alert>
|
||||
<a-alert v-if="settingStore.sysPublic.notice" type="warning" show-icon>
|
||||
<template #message>
|
||||
{{ settingStore.sysPublic.notice }}
|
||||
</template>
|
||||
</a-alert>
|
||||
</a-carousel>
|
||||
<notice-bar :list="noticeList"></notice-bar>
|
||||
</div>
|
||||
|
||||
<div class="statistic-data m-20">
|
||||
@@ -166,7 +151,7 @@ import { useI18n } from "/src/locales";
|
||||
const { t } = useI18n();
|
||||
import { usePluginStore } from "/@/store/plugin";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
|
||||
import NoticeBar from "./notice-bar.vue";
|
||||
defineOptions({
|
||||
name: "DashboardUser",
|
||||
});
|
||||
@@ -289,6 +274,32 @@ function openUpgradeUrl() {
|
||||
function openChangeLogUrl() {
|
||||
window.open("https://certd.docmirror.cn/guide/changelogs/CHANGELOG.html");
|
||||
}
|
||||
|
||||
const noticeList = computed(() => {
|
||||
const list = [];
|
||||
if (!settingStore.isComm) {
|
||||
list.push(`
|
||||
${t("certd.dashboard.alertMessage")}
|
||||
<a class="ml-5 flex-inline" href="https://gitee.com/certd/certd" target="_blank">
|
||||
gitee
|
||||
</a>
|
||||
、
|
||||
<a class="ml-5 flex-inline" href="https://github.com/certd/certd" target="_blank">
|
||||
github
|
||||
</a>
|
||||
、
|
||||
<a class="ml-5 flex-inline" href="https://certd.docmirror.cn" target="_blank">
|
||||
${t("certd.dashboard.helpDoc")}
|
||||
</a>
|
||||
`);
|
||||
}
|
||||
|
||||
if (settingStore.sysPublic.notice) {
|
||||
list.push(`${settingStore.sysPublic.notice}`);
|
||||
}
|
||||
|
||||
return list;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<a-carousel v-if="list?.length" class="notice-bar pointer" arrows dots-class="slick-dots slick-thumb" autoplay dot-position="right">
|
||||
<a-alert v-for="(item, index) in list" :key="index" type="warning" show-icon>
|
||||
<template #message>
|
||||
<div @click="handleClick(item)" v-html="item"></div>
|
||||
</template>
|
||||
</a-alert>
|
||||
</a-carousel>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Modal } from "ant-design-vue";
|
||||
import { h } from "vue";
|
||||
const props = defineProps<{
|
||||
list: string[];
|
||||
}>();
|
||||
|
||||
const handleClick = (item: string) => {
|
||||
Modal.info({
|
||||
title: "公告",
|
||||
width: 700,
|
||||
maskClosable: true,
|
||||
content: () => {
|
||||
return h("div", {
|
||||
innerHTML: item,
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.notice-bar {
|
||||
.ant-alert-content {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user