forked from integrated_whb/integrated_whb_vue
BUG 优化
parent
456855000a
commit
83faf65bb4
|
@ -162,40 +162,13 @@
|
||||||
>编辑
|
>编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="expandedRows[row.INSPECTANNUALLY_ID]"
|
v-if="buttonJurisdiction.del"
|
||||||
type="danger"
|
type="danger"
|
||||||
text
|
text
|
||||||
link
|
link
|
||||||
@click="fnDelete(row.INSPECTANNUALLY_ID)"
|
@click="fnDelete(row.INSPECTANNUALLY_ID)"
|
||||||
>删除
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="
|
|
||||||
expandedRows[row.INSPECTANNUALLY_ID] &&
|
|
||||||
row.REMINDER_STATUS === '0'
|
|
||||||
"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="fnStatusChange(row.INSPECTANNUALLY_ID, '1')"
|
|
||||||
>开启</el-button
|
|
||||||
>
|
>
|
||||||
<el-button
|
删除
|
||||||
v-if="
|
|
||||||
expandedRows[row.INSPECTANNUALLY_ID] &&
|
|
||||||
row.REMINDER_STATUS === '1'
|
|
||||||
"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="fnStatusChange(row.INSPECTANNUALLY_ID, '0')"
|
|
||||||
>关闭
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
@click="toggleExpand(row.INSPECTANNUALLY_ID)"
|
|
||||||
>
|
|
||||||
{{ expandedRows[row.INSPECTANNUALLY_ID] ? "收起" : "更多" }}
|
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -228,7 +201,6 @@ import useListData from "@/assets/js/useListData.js";
|
||||||
import {
|
import {
|
||||||
getInspectAnnuallyList,
|
getInspectAnnuallyList,
|
||||||
setInspectAnnuallyDelete,
|
setInspectAnnuallyDelete,
|
||||||
setInspectAnnuallyEdit2,
|
|
||||||
} from "@/request/mechanical_files.js";
|
} from "@/request/mechanical_files.js";
|
||||||
import { reactive } from "vue";
|
import { reactive } from "vue";
|
||||||
import { debounce } from "throttle-debounce";
|
import { debounce } from "throttle-debounce";
|
||||||
|
@ -272,18 +244,6 @@ const fnResetPaginationTransfer = () => {
|
||||||
REMINDER_STATUS: searchForm.value.REMINDER_STATUS,
|
REMINDER_STATUS: searchForm.value.REMINDER_STATUS,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 使用一个对象来跟踪每一行的展开状态
|
|
||||||
const expandedRows = reactive({}); // 初始化一个空对象
|
|
||||||
|
|
||||||
// 定义一个函数来切换展开状态
|
|
||||||
function toggleExpand(rowId) {
|
|
||||||
if (expandedRows[rowId] === undefined) {
|
|
||||||
expandedRows[rowId] = true; // 如果之前没有状态,默认设置为展开
|
|
||||||
} else {
|
|
||||||
expandedRows[rowId] = !expandedRows[rowId]; // 切换状态
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const fnDelete = debounce(
|
const fnDelete = debounce(
|
||||||
1000,
|
1000,
|
||||||
async (INSPECTANNUALLY_ID) => {
|
async (INSPECTANNUALLY_ID) => {
|
||||||
|
@ -294,19 +254,6 @@ const fnDelete = debounce(
|
||||||
},
|
},
|
||||||
{ atBegin: true }
|
{ atBegin: true }
|
||||||
);
|
);
|
||||||
const fnStatusChange = debounce(
|
|
||||||
1000,
|
|
||||||
async (INSPECTANNUALLY_ID, REMINDER_STATUS) => {
|
|
||||||
const msg = REMINDER_STATUS === "0" ? "关闭" : "开启";
|
|
||||||
await ElMessageBox.confirm("确定要" + msg + "提醒吗?", {
|
|
||||||
type: "warning",
|
|
||||||
});
|
|
||||||
await setInspectAnnuallyEdit2({ INSPECTANNUALLY_ID, REMINDER_STATUS });
|
|
||||||
ElMessage.success(msg + "成功");
|
|
||||||
fnResetPaginationTransfer();
|
|
||||||
},
|
|
||||||
{ atBegin: true }
|
|
||||||
);
|
|
||||||
const buttonJurisdiction = await useButtonJurisdiction("hidden");
|
const buttonJurisdiction = await useButtonJurisdiction("hidden");
|
||||||
|
|
||||||
const fnImportDialogChangeShow = () => {
|
const fnImportDialogChangeShow = () => {
|
||||||
|
@ -328,7 +275,6 @@ const fnSubmitImport = async (formData) => {
|
||||||
|
|
||||||
const fnExport = async () => {
|
const fnExport = async () => {
|
||||||
const selectionData = tableRef.value.getSelectionRows();
|
const selectionData = tableRef.value.getSelectionRows();
|
||||||
console.log("selectionData",selectionData);
|
|
||||||
if (selectionData.length === 0) {
|
if (selectionData.length === 0) {
|
||||||
ElMessage.warning("请选择需要导出至excel报表的记录信息");
|
ElMessage.warning("请选择需要导出至excel报表的记录信息");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue