7baee977 by lxs

确认变更提示保存

1 parent b6a2f994
......@@ -249,6 +249,7 @@ const sheetTableInfo = ref({
},
});
const selectRowData = ref([]);
const fieldTableRef = ref();
const fieldTableInfo = ref({
id: "metadata-table",
fields: [
......@@ -681,7 +682,28 @@ const btnClick = async (btn, bType = null) => {
name: "taskConfig",
});
} else if (type == 'confirm') {
const row = fieldTableInfo.value.data.find(item => item.STATE == 'Running');
const rIndex = fieldTableInfo.value.data.findIndex(item => item.STATE == 'Running');
if (rIndex > -1) {
ElMessageBox.confirm(
'存在未保存的数据,提交后会丢失,是否确定提交',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
saveTask();
}).catch(() => {
// 设置高亮
fieldTableRef.value.setCurrentRow(row)
// 设置表格滚动的位置
fieldTableRef.value.scrollTo({ top: 36 * rIndex, behavior: 'smooth' });
})
} else {
saveTask();
}
} else if (type == 'status') {
if (selectRowData.value.length == 0) {
ElMessage.warning('请选择需要操作的数据');
......@@ -1022,9 +1044,9 @@ onMounted(() => {
</div>
<div class="table_panel_wrap panel" :style="{ height: 'calc(100% - ' + toolH + 'px)' }">
<div class="table_panel" v-loading="fieldTableInfo.loading">
<el-table ref="costTableRef" :data="fieldTableInfo.data" border :height="'100%'"
<el-table ref="fieldTableRef" :data="fieldTableInfo.data" border :height="'100%'"
style="width: 100%; display: inline-block" :style="{ 'max-height': 'calc(100% - 44px)' }"
:cell-class-name="tableCellClassName" @selection-change="tableSelectionChange">
:cell-class-name="tableCellClassName" @selection-change="tableSelectionChange" highlight-current-row>
<el-table-column type="selection" align="center" :width="32" :selectable="rowSelectable"
fixed="left" />
<el-table-column v-for="(item, i) in fieldTableInfo.fields" :label="item.label" :width="item.width"
......
......@@ -48,8 +48,7 @@ const treeInfo = ref({
expandOnNodeClick: false,
data: [],
});
// const toolH = ref(82)
const toolRef = ref();
const expand1 = ref(true)
const expand2 = ref(true)
......@@ -389,9 +388,6 @@ const getPermissionList = (val = {}, init = true) => {
tempInfo = data.filter(item => item.guid == taskDetail.value.classifyGuid)[0]
}
listClick(tempInfo);
// nextTick(() => {
// toolH.value = toolRef.value.offsetHeight
// })
}
} else {
permissionList.value.push(...JSON.parse(JSON.stringify(data)))
......@@ -439,9 +435,6 @@ onBeforeMount(() => {
})
onMounted(() => {
// window.addEventListener('resize', function () {
// toolH.value = toolRef.value.offsetHeight
// })
})
</script>
......@@ -461,7 +454,7 @@ onMounted(() => {
</div>
<div class="main_wrap" :class="{ full: step == 1 }">
<div class="content_main" v-show="step == 0">
<div class="template_panel" ref="toolRef">
<div class="template_panel">
<div class="title_item">
<span class="title_label">分类标准:</span>
<span class="title_text">{{ templateInfo.name || '--' }}</span>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!