style(components): 将按钮组件替换为链接样式

- 统一将页面中的 Button 组件替换为 a 标签,保持样式一致
- 添加统一的链接样式类 ops-link 和分隔符样式类 ops-sep
- 更新操作列中按钮的样式,使用颜色、光标和文本装饰属性替代原有 props 配置
- 在多个文件中调整了操作项之间的分隔符显示逻辑
- 优化表格操作列渲染函数,去除冗余的 Button 属性配置
- 保持功能不变的前提下提升界面视觉一致性
This commit is contained in:
pikachu1995@126.com
2025-11-24 11:33:54 +08:00
parent 756cb28daa
commit 799184fd21
82 changed files with 1454 additions and 1394 deletions

View File

@@ -213,18 +213,17 @@ export default {
title: "操作",
key: "action",
align: "center",
fixed: "right",
width: 230,
render: (h, params) => {
return h("div", [
h(
"Button",
"a",
{
props: {
type: "info",
size: "small",
},
style: {
marginRight: "5px",
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
},
on: {
click: () => {
@@ -235,16 +234,17 @@ export default {
"查看"
),
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "info",
size: "small",
ghost: true,
},
style: {
marginRight: "5px",
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
},
on: {
click: () => {
@@ -255,14 +255,17 @@ export default {
"修改"
),
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "error",
size: "small",
},
style: {
marginRight: "5px",
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
},
on: {
click: () => {

View File

@@ -411,14 +411,8 @@
let enableOrDisable = "";
if (params.row.noticeStatus == "OPEN") {
enableOrDisable = h(
"Button",
"a",
{
props: {
size: "small"
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.disable(params.row);
@@ -429,15 +423,8 @@
);
} else {
enableOrDisable = h(
"Button",
"a",
{
props: {
type: "success",
size: "small"
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.enable(params.row);
@@ -447,18 +434,16 @@
"开启"
);
}
return h("div", [
return h("div", { class: "ops" }, [
enableOrDisable,
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "primary",
size: "small"
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.edit(params.row);
@@ -491,22 +476,19 @@
minWidth: 50,
align: "center",
render: (h, params) => {
return h(
"Button",
{
props: {
size: "small",
type: "error",
ghost: true,
},
on: {
click: () => {
this.delUser(params.index);
return h("div", { class: "ops" }, [
h(
"a",
{
on: {
click: () => {
this.delUser(params.index);
},
},
},
},
"删除"
);
"删除"
)
]);
},
},
],
@@ -574,17 +556,10 @@
fixed: "right",
width: 140,
render: (h, params) => {
return h("div", [
return h("div", { class: "ops" }, [
h(
"Button",
"a",
{
props: {
type: "info",
size: "small"
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.detail(params.row);
@@ -594,15 +569,13 @@
"详细"
),
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "error",
size: "small"
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.delete(params.row.id);
@@ -1025,3 +998,15 @@
<style lang="scss">
@import "sms.scss";
</style>
<style lang="scss" scoped>
.ops a {
color: #2d8cf0;
cursor: pointer;
text-decoration: none;
}
.ops span {
display: inline-block;
margin: 0 8px;
color: #dcdee2;
}
</style>

View File

@@ -279,18 +279,17 @@ export default {
title: "操作",
key: "action",
align: "center",
fixed: "right",
width: 150,
render: (h, params) => {
return h("div", [
h(
"Button",
"a",
{
props: {
type: "primary",
size: "small",
},
style: {
marginRight: "5px",
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
},
on: {
click: () => {
@@ -343,20 +342,16 @@ export default {
render: (h, params) => {
return h("div", [
h(
"Button",
"a",
{
props: {
type: "info",
size: "small"
},
style: {
marginRight: "5px",
},
attrs: {
disabled: params.row.templateStatus == 2 ? false : true,
color: params.row.templateStatus == 2 ? "#2d8cf0" : "#c5c8ce",
cursor: params.row.templateStatus == 2 ? "pointer" : "not-allowed",
textDecoration: "none",
},
on: {
click: () => {
if (params.row.templateStatus != 2) return;
this.editTemplate(params.row);
},
},
@@ -364,20 +359,21 @@ export default {
"编辑"
),
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "error",
size: "small",
},
style: {
marginRight: "5px",
},
attrs: {
disabled: params.row.templateStatus == 0 ? true : false,
color: params.row.templateStatus == 0 ? "#c5c8ce" : "#2d8cf0",
cursor: params.row.templateStatus == 0 ? "not-allowed" : "pointer",
textDecoration: "none",
},
on: {
click: () => {
if (params.row.templateStatus == 0) return;
this.deleteSmsTemplate(params.row);
},
},
@@ -415,21 +411,16 @@ export default {
render: (h, params) => {
return h("div", [
h(
"Button",
"a",
{
props: {
type: "info",
size: "small",
icon: "ios-create-outline",
},
attrs: {
disabled: params.row.signStatus == 2 ? false : true,
},
style: {
marginRight: "5px",
color: params.row.signStatus == 2 ? "#2d8cf0" : "#c5c8ce",
cursor: params.row.signStatus == 2 ? "pointer" : "not-allowed",
textDecoration: "none",
},
on: {
click: () => {
if (params.row.signStatus != 2) return;
this.editSign(params.row);
},
},
@@ -437,21 +428,21 @@ export default {
"编辑"
),
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "error",
size: "small",
icon: "ios-create-outline",
},
attrs: {
disabled: params.row.signStatus == 0 ? true : false,
},
style: {
marginRight: "5px",
color: params.row.signStatus == 0 ? "#c5c8ce" : "#2d8cf0",
cursor: params.row.signStatus == 0 ? "not-allowed" : "pointer",
textDecoration: "none",
},
on: {
click: () => {
if (params.row.signStatus == 0) return;
this.deleteSmsSign(params.row);
},
},

View File

@@ -635,16 +635,14 @@ export default {
render: (h, params) => {
return h("div", [
h(
"Button",
"a",
{
props: {
type: "default",
size: "small",
},
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
marginRight: "5px",
display:
this.selectImage === true ? "inline-block" : "none",
display: this.selectImage === true ? "inline-block" : "none",
},
on: {
click: () => {
@@ -655,13 +653,23 @@ export default {
"选择"
),
h(
"Button",
"span",
{
props: {
type: "info",
size: "small",
},
style: {
margin: "0 8px",
color: "#dcdee2",
display: this.selectImage === true ? "inline-block" : "none",
},
},
"|"
),
h(
"a",
{
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
marginRight: "5px",
display: this.selectImage == true ? "none" : "inline-block",
},
@@ -674,13 +682,23 @@ export default {
"下载"
),
h(
"Button",
"span",
{
props: {
type: "error",
size: "small",
},
style: {
margin: "0 8px",
color: "#dcdee2",
display: this.selectImage == true ? "none" : "inline-block",
},
},
"|"
),
h(
"a",
{
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
display: this.selectImage == true ? "none" : "inline-block",
},
on: {

View File

@@ -165,13 +165,12 @@ export default {
render: (h, params) => {
return h("div", [
h(
"Button",
"a",
{
props: {
type: "warning",
size: "small",
},
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
marginRight: "5px",
},
on: {
@@ -183,13 +182,17 @@ export default {
"菜单权限"
),
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
size: "small",
type: "info",
},
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
marginRight: "5px",
},
on: {
@@ -201,11 +204,17 @@ export default {
"编辑"
),
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "error",
size: "small",
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
},
on: {
click: () => {

View File

@@ -196,13 +196,12 @@ export default {
render: (h, params) => {
return h("div", [
h(
"Button",
"a",
{
props: {
type: "info",
size: "small",
},
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
marginRight: "5px",
},
on: {
@@ -214,11 +213,17 @@ export default {
"编辑"
),
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "error",
size: "small",
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
},
on: {
click: () => {

View File

@@ -266,13 +266,12 @@ export default {
let enableOrDisable = "";
if (params.row.status == true) {
enableOrDisable = h(
"Button",
"a",
{
props: {
type: 'default',
size: "small"
},
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
marginRight: "5px"
},
on: {
@@ -285,13 +284,12 @@ export default {
);
} else {
enableOrDisable = h(
"Button",
"a",
{
props: {
type: "success",
size: "small"
},
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
marginRight: "5px"
},
on: {
@@ -305,13 +303,12 @@ export default {
}
return h("div", [
h(
"Button",
"a",
{
props: {
type: "info",
size: "small"
},
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none",
marginRight: "5px"
},
on: {
@@ -322,13 +319,24 @@ export default {
},
"编辑"
),
h(
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
enableOrDisable,
h(
"Button",
"span",
{ style: { margin: "0 8px", color: "#dcdee2" } },
"|"
),
h(
"a",
{
props: {
type: "error",
size: "small"
style: {
color: "#2d8cf0",
cursor: "pointer",
textDecoration: "none"
},
on: {
click: () => {