style: 统一字符串引号为双引号并优化代码格式

将单引号字符串统一改为双引号
调整部分组件代码格式和样式
移除空行和冗余代码
This commit is contained in:
zhangtao
2025-12-03 01:07:45 +08:00
parent 871b5c37e4
commit 0766c8aa7d
17 changed files with 57 additions and 43 deletions
+1 -1
View File
@@ -312,7 +312,7 @@ const listNotice = async () => {
const response = await NoticeAPI.listNotice({
page_no: 1,
page_size: 10,
status: '0', // 只获取启用的公告
status: "0", // 只获取启用的公告
});
if (response.data.code === 0) {
noticeList.value = response.data.data.items;
@@ -141,7 +141,7 @@
<el-table-column label="执行状态" prop="status" min-width="100" show-overflow-tooltip>
<template #default="scope">
<el-tag :type="scope.row.status === '0' ? 'primary' : 'success'">
{{ scope.row.status === '0' ? "运行中" : "完成" }}
{{ scope.row.status === "0" ? "运行中" : "完成" }}
</el-tag>
</template>
</el-table-column>
@@ -231,7 +231,7 @@
</el-descriptions-item>
<el-descriptions-item label="执行状态" :span="2">
<el-tag :type="detailFormData.status === '0' ? 'primary' : 'success'">
{{ detailFormData.status === '0' ? "运行中" : "完成" }}
{{ detailFormData.status === "0" ? "运行中" : "完成" }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="执行信息" :span="2">
@@ -26,11 +26,17 @@
</el-form-item>
<!-- 时间范围,收起状态下隐藏 -->
<el-form-item v-if="isExpand" prop="created_time" label="创建时间">
<DatePicker v-model="createdDateRange" @update:model-value="handleCreatedDateRangeChange" />
<DatePicker
v-model="createdDateRange"
@update:model-value="handleCreatedDateRangeChange"
/>
</el-form-item>
<!-- 更新时间范围,收起状态下隐藏 -->
<el-form-item v-if="isExpand" prop="updated_time" label="更新时间">
<DatePicker v-model="updatedDateRange" @update:model-value="handleUpdatedDateRangeChange" />
<DatePicker
v-model="updatedDateRange"
@update:model-value="handleUpdatedDateRangeChange"
/>
</el-form-item>
<el-form-item v-if="isExpand" prop="created_id" label="创建人">
<UserTableSelect
@@ -218,7 +224,6 @@
<el-table-column label="描述" prop="description" min-width="100" />
<el-table-column label="创建时间" prop="created_time" min-width="200" sortable />
<el-table-column label="更新时间" prop="updated_time" min-width="200" sortable />
<OperationColumn :list-data-length="pageTableData.length">
<template #default="scope">
@@ -281,7 +281,8 @@ const queryFormData = reactive<ApplicationPageQuery>({
page_no: 1,
page_size: 12,
name: undefined,
status: undefined, created_id: undefined,
status: undefined,
created_id: undefined,
});
// 应用列表数据
@@ -292,7 +293,7 @@ const formData = reactive<ApplicationForm>({
name: "",
access_url: "",
icon_url: "",
status: '0',
status: "0",
description: "",
});
@@ -465,7 +466,7 @@ function resetForm() {
name: "",
access_url: "",
icon_url: "",
status: '0',
status: "0",
description: "",
});
formRef.value?.resetFields();
@@ -532,8 +533,8 @@ onMounted(() => {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 16px;
padding: 0 2px;
justify-items: stretch;
padding: 0 2px;
@media (max-width: 768px) {
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
@@ -12,5 +12,4 @@ defineOptions({
});
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
@@ -40,10 +40,16 @@
</el-form-item>
<!-- 时间范围,收起状态下隐藏 -->
<el-form-item v-if="isExpand" prop="created_time" label="创建时间">
<DatePicker v-model="createdDateRange" @update:model-value="handleCreatedDateRangeChange" />
<DatePicker
v-model="createdDateRange"
@update:model-value="handleCreatedDateRangeChange"
/>
</el-form-item>
<el-form-item v-if="isExpand" prop="updated_time" label="更新时间">
<DatePicker v-model="updatedDateRange" @update:model-value="handleUpdatedDateRangeChange" />
<DatePicker
v-model="updatedDateRange"
@update:model-value="handleUpdatedDateRangeChange"
/>
</el-form-item>
<!-- 查询、重置、展开/收起按钮 -->
<el-form-item>
@@ -545,7 +551,7 @@ const queryFormData = reactive<DemoPageQuery>({
const formData = reactive<DemoForm>({
id: undefined,
name: "",
status: '0',
status: "0",
description: undefined,
});
@@ -624,7 +630,7 @@ async function handleResetQuery() {
const initialFormData: DemoForm = {
id: undefined,
name: "",
status: '0',
status: "0",
description: "",
};
@@ -156,7 +156,11 @@
>
<template #default="scope">
<el-text>{{ scope.row.ipaddr }}</el-text>
<CopyButton v-if="scope.row.ipaddr" :text="scope.row.ipaddr" :style="{ marginLeft: '2px' }" />
<CopyButton
v-if="scope.row.ipaddr"
:text="scope.row.ipaddr"
:style="{ marginLeft: '2px' }"
/>
</template>
</el-table-column>
<el-table-column
@@ -446,7 +446,7 @@ const formData = reactive<DeptForm>({
code: undefined,
order: 1,
parent_id: undefined,
status: '0',
status: "0",
description: undefined,
});
@@ -512,7 +512,7 @@ const initialFormData: DeptForm = {
name: undefined,
order: 1,
parent_id: undefined,
status: '0',
status: "0",
description: undefined,
};
@@ -158,7 +158,7 @@
<el-table-column label="状态" prop="status" min-width="100" show-overflow-tooltip>
<template #default="scope">
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'">
{{ scope.row.status === '0' ? "启用" : "停用" }}
{{ scope.row.status === "0" ? "启用" : "停用" }}
</el-tag>
</template>
</el-table-column>
@@ -456,7 +456,7 @@ const formData = reactive<DictDataForm>({
css_class: "",
list_class: undefined,
is_default: false,
status: '0',
status: "0",
description: "",
dict_type_id: undefined,
});
@@ -539,7 +539,7 @@ const initialFormData: DictDataForm = {
css_class: "",
list_class: undefined,
is_default: false,
status: '0',
status: "0",
description: "",
dict_type_id: props.dictTypeId,
};
@@ -583,7 +583,7 @@ async function handleOpenDialog(type: "create" | "update" | "detail", id?: numbe
// 重置为初始值并确保状态默认开启
Object.assign(formData, initialFormData);
formData.dict_type = props.dictType;
formData.status = '0';
formData.status = "0";
formData.id = undefined;
}
dialogVisible.visible = true;
@@ -468,7 +468,7 @@ const formData = reactive<DictForm>({
id: undefined,
dict_name: "",
dict_type: "",
status: '0',
status: "0",
description: undefined,
});
@@ -516,7 +516,6 @@ const currentDictLabel = ref("");
// 添加字典类型ID变量
const currentDictTypeId = ref(1);
// 加载表格数据
async function loadingData() {
loading.value = true;
@@ -552,7 +551,7 @@ const initialFormData: DictForm = {
id: undefined,
dict_name: "",
dict_type: "",
status: '0',
status: "0",
description: undefined,
};
@@ -721,7 +721,7 @@ const formData = reactive<MenuForm>({
title: "",
params: undefined,
affix: false,
status: '0',
status: "0",
description: undefined,
});
@@ -859,7 +859,7 @@ const initialFormData: MenuForm = {
title: "",
params: [] as { key: string; value: string }[],
affix: false,
status: '0',
status: "0",
description: undefined,
};
@@ -228,7 +228,7 @@
>
<template #default="scope">
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'">
{{ scope.row.status === '0' ? "启用" : "停用" }}
{{ scope.row.status === "0" ? "启用" : "停用" }}
</el-tag>
</template>
</el-table-column>
@@ -530,7 +530,7 @@ const formData = reactive<NoticeForm>({
notice_title: "",
notice_type: "",
notice_content: "",
status: '0',
status: "0",
description: undefined,
});
@@ -608,7 +608,7 @@ const initialFormData: NoticeForm = {
notice_title: "",
notice_type: "",
notice_content: "",
status: '0',
status: "0",
description: undefined,
};
@@ -215,7 +215,7 @@
>
<template #default="scope">
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'">
{{ scope.row.status === '0' ? "启用" : "停用" }}
{{ scope.row.status === "0" ? "启用" : "停用" }}
</el-tag>
</template>
</el-table-column>
@@ -480,7 +480,7 @@ const formData = reactive<PositionForm>({
id: undefined,
name: undefined,
order: 1,
status: '0',
status: "0",
description: undefined,
});
@@ -556,7 +556,7 @@ const initialFormData: PositionForm = {
id: undefined,
name: undefined,
order: 1,
status: '0',
status: "0",
description: undefined,
};
@@ -246,7 +246,7 @@
>
<template #default="scope">
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'">
{{ scope.row.status === '0' ? "启用" : "停用" }}
{{ scope.row.status === "0" ? "启用" : "停用" }}
</el-tag>
</template>
</el-table-column>
@@ -563,7 +563,7 @@ const formData = reactive<RoleForm>({
name: undefined,
order: 1,
code: undefined,
status: '0',
status: "0",
description: undefined,
});
@@ -633,7 +633,7 @@ const initialFormData: RoleForm = {
name: undefined,
order: 1,
code: undefined,
status: '0',
status: "0",
description: undefined,
};
@@ -8,7 +8,7 @@
>
<template #status="scope">
<el-tag :type="scope.row[scope.prop] === '0' ? 'success' : 'danger'">
{{ scope.row[scope.prop] === '0' ? "启用" : "停用" }}
{{ scope.row[scope.prop] === "0" ? "启用" : "停用" }}
</el-tag>
</template>
</table-select>
@@ -39,7 +39,7 @@ const selectConfig: ISelectConfig = {
type: "select",
label: "状态",
prop: "status",
initialValue: '0',
initialValue: "0",
attrs: {
placeholder: "全部",
clearable: true,
@@ -218,7 +218,7 @@
<el-table-column label="状态" prop="status" min-width="100">
<template #default="scope">
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'">
{{ scope.row.status === '0' ? "启用" : "停用" }}
{{ scope.row.status === "0" ? "启用" : "停用" }}
</el-tag>
</template>
</el-table-column>
@@ -641,7 +641,7 @@ const formData = reactive<UserForm>({
email: undefined,
mobile: undefined,
is_superuser: false, //默认不是超管
status: '0',
status: "0",
description: undefined,
});
@@ -790,7 +790,7 @@ const initialFormData: UserForm = {
email: undefined,
mobile: undefined,
is_superuser: false, //默认不是超管
status: '0',
status: "0",
description: undefined,
};