|
@@ -59,6 +59,7 @@
|
|
|
:on-show="handleShow"
|
|
:on-show="handleShow"
|
|
|
:on-delete="handleDelete"
|
|
:on-delete="handleDelete"
|
|
|
@update:selection="handlePop"
|
|
@update:selection="handlePop"
|
|
|
|
|
+ @update:time-sort="handleChangeTimeSort"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="pagination-box">
|
|
<div class="pagination-box">
|
|
@@ -72,10 +73,16 @@
|
|
|
</div>
|
|
</div>
|
|
|
<DetailDialog
|
|
<DetailDialog
|
|
|
v-if="isDetailDialogShow"
|
|
v-if="isDetailDialogShow"
|
|
|
|
|
+ :has-been-chosen="detailRowChosen"
|
|
|
:description="detailDescription"
|
|
:description="detailDescription"
|
|
|
:image-paths="detailPictures"
|
|
:image-paths="detailPictures"
|
|
|
:video-paths="detailVideos"
|
|
:video-paths="detailVideos"
|
|
|
|
|
+ :has-previous="hasPreviousRow"
|
|
|
|
|
+ :has-next="hasNextRow"
|
|
|
@close="closeDetailDialog"
|
|
@close="closeDetailDialog"
|
|
|
|
|
+ @update:previous="handleChangePrevious"
|
|
|
|
|
+ @update:next="handleChangeNext"
|
|
|
|
|
+ @update:choose="handleChangeChoose"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -85,13 +92,13 @@
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import axios, { AxiosRequestConfig } from 'axios';
|
|
import axios, { AxiosRequestConfig } from 'axios';
|
|
|
import QueryForm from '../common/QueryForm.vue';
|
|
import QueryForm from '../common/QueryForm.vue';
|
|
|
- import AlertTable from '../common/AlertTable.vue';
|
|
|
|
|
|
|
+ import AlertTable, { DataSourceItem } from '../common/AlertTable.vue';
|
|
|
import DetailDialog from '../common/DetailDialog.vue';
|
|
import DetailDialog from '../common/DetailDialog.vue';
|
|
|
import Pagination from '../common/Pagination.vue';
|
|
import Pagination from '../common/Pagination.vue';
|
|
|
- // import { useIssueType } from '../../hooks/useIssueType';
|
|
|
|
|
import { useWorkLocation } from '../../hooks/useWorkLocation';
|
|
import { useWorkLocation } from '../../hooks/useWorkLocation';
|
|
|
import { useIssueMainType } from '../../hooks/useIssueMainType';
|
|
import { useIssueMainType } from '../../hooks/useIssueMainType';
|
|
|
import {
|
|
import {
|
|
|
|
|
+ TableQueryForm,
|
|
|
getDefaultTableData,
|
|
getDefaultTableData,
|
|
|
deleteDefaultTableData,
|
|
deleteDefaultTableData,
|
|
|
copyToShowTableData,
|
|
copyToShowTableData,
|
|
@@ -108,7 +115,6 @@
|
|
|
import { getHeaders } from '@/utils/http/axios';
|
|
import { getHeaders } from '@/utils/http/axios';
|
|
|
|
|
|
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
|
- // const { aiOptions, manualOptions, getAIOptions, getManualOptions } = useIssueType();
|
|
|
|
|
const { locationOptions, getLocationOptions } = useWorkLocation();
|
|
const { locationOptions, getLocationOptions } = useWorkLocation();
|
|
|
const { aiMainOptions, manualMainOptions, getAIMainOptions, getManualMainOptions } =
|
|
const { aiMainOptions, manualMainOptions, getAIMainOptions, getManualMainOptions } =
|
|
|
useIssueMainType();
|
|
useIssueMainType();
|
|
@@ -116,11 +122,11 @@
|
|
|
const { urlPrefix } = useGlobSetting();
|
|
const { urlPrefix } = useGlobSetting();
|
|
|
|
|
|
|
|
const alertTableRef = ref<typeof AlertTable>();
|
|
const alertTableRef = ref<typeof AlertTable>();
|
|
|
- const tableData = ref([]);
|
|
|
|
|
|
|
+ const tableData = ref<DataSourceItem[]>([]);
|
|
|
const showActionBar = ref(false);
|
|
const showActionBar = ref(false);
|
|
|
const chooseNum = ref(0);
|
|
const chooseNum = ref(0);
|
|
|
|
|
+ const chooseRow = ref<DataSourceItem[]>([]); // 被选中的数据行
|
|
|
const chooseId = ref<number[]>([]);
|
|
const chooseId = ref<number[]>([]);
|
|
|
- // const cancelHideFlag = ref(true); // true取消隐藏 / false全部隐藏
|
|
|
|
|
const cancelUrgentFlag = ref(true); // true取消加急 / false全部加急
|
|
const cancelUrgentFlag = ref(true); // true取消加急 / false全部加急
|
|
|
const isActiveHide = ref(false);
|
|
const isActiveHide = ref(false);
|
|
|
const isActiveCancelHide = ref(false);
|
|
const isActiveCancelHide = ref(false);
|
|
@@ -130,13 +136,20 @@
|
|
|
const isActiveCopy = ref(false);
|
|
const isActiveCopy = ref(false);
|
|
|
// 详情
|
|
// 详情
|
|
|
const isDetailDialogShow = ref(false);
|
|
const isDetailDialogShow = ref(false);
|
|
|
|
|
+ const detailRowChosen = ref(false); // 当前行是否被选中
|
|
|
|
|
+ const detailRow = ref(); // 当前行
|
|
|
|
|
+ const detailCurRowIndex = ref(0); // 当前行index
|
|
|
|
|
+ const detailPreviousRow = ref(); // 上一行
|
|
|
|
|
+ const detailNextRow = ref(); // 下一行
|
|
|
|
|
+ const hasPreviousRow = ref(false); // 是否有上一行
|
|
|
|
|
+ const hasNextRow = ref(false); // 是否有下一行
|
|
|
const detailDescription = ref('');
|
|
const detailDescription = ref('');
|
|
|
const detailPictures = ref<string[]>([]);
|
|
const detailPictures = ref<string[]>([]);
|
|
|
const detailVideos = ref<string[]>([]);
|
|
const detailVideos = ref<string[]>([]);
|
|
|
// 分页
|
|
// 分页
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
|
|
|
|
|
|
- const query = ref({
|
|
|
|
|
|
|
+ const query = ref<TableQueryForm>({
|
|
|
pageNumber: 1,
|
|
pageNumber: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
|
});
|
|
});
|
|
@@ -200,16 +213,19 @@
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // 表格排序切换
|
|
|
|
|
+ const handleChangeTimeSort = (curTimeSort) => {
|
|
|
|
|
+ query.value.order = curTimeSort;
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 多选
|
|
// 多选
|
|
|
const handlePop = (selection) => {
|
|
const handlePop = (selection) => {
|
|
|
|
|
+ chooseRow.value = selection;
|
|
|
chooseId.value = [];
|
|
chooseId.value = [];
|
|
|
- // cancelHideFlag.value = true;
|
|
|
|
|
cancelUrgentFlag.value = true;
|
|
cancelUrgentFlag.value = true;
|
|
|
selection.forEach((item) => {
|
|
selection.forEach((item) => {
|
|
|
if (chooseId.value.indexOf(item.id) === -1) chooseId.value.push(item.id);
|
|
if (chooseId.value.indexOf(item.id) === -1) chooseId.value.push(item.id);
|
|
|
- // 只要有一个item.isHide === false 说明多选的这些选项不是全都隐藏/失效,不用变成“取消隐藏”/全部生效
|
|
|
|
|
- // if (item.isHide === false) cancelHideFlag.value = false;
|
|
|
|
|
- // 只要有一个item.priority === 0 说明不是全都加急状态,不用变成“取消加急”
|
|
|
|
|
if (item.priority === 0) cancelUrgentFlag.value = false;
|
|
if (item.priority === 0) cancelUrgentFlag.value = false;
|
|
|
});
|
|
});
|
|
|
chooseNum.value = selection.length;
|
|
chooseNum.value = selection.length;
|
|
@@ -222,6 +238,11 @@
|
|
|
alertTableRef.value?.clearAll();
|
|
alertTableRef.value?.clearAll();
|
|
|
showActionBar.value = false;
|
|
showActionBar.value = false;
|
|
|
};
|
|
};
|
|
|
|
|
+ // 改变该行的选中状态
|
|
|
|
|
+ const handleChangeChoose = (status) => {
|
|
|
|
|
+ alertTableRef.value?.updateCurRowChosen(detailRow.value, !status);
|
|
|
|
|
+ updateDetailDialog(detailRow.value);
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
// 全部隐藏
|
|
// 全部隐藏
|
|
|
const handleHideAll = () => {
|
|
const handleHideAll = () => {
|
|
@@ -352,11 +373,36 @@
|
|
|
const closeDetailDialog = () => {
|
|
const closeDetailDialog = () => {
|
|
|
isDetailDialogShow.value = false;
|
|
isDetailDialogShow.value = false;
|
|
|
};
|
|
};
|
|
|
|
|
+ // 更新detailCurRowIndex、detailPreviousRow、detailNextRow、hasPreviousRow、hasNextRow
|
|
|
|
|
+ const updateDetailDialog = (curRow) => {
|
|
|
|
|
+ detailDescription.value = curRow.description;
|
|
|
|
|
+ detailPictures.value = curRow.pictures;
|
|
|
|
|
+ detailVideos.value = curRow.videos;
|
|
|
|
|
+ detailCurRowIndex.value = tableData.value.findIndex((item) => item.id === curRow.id);
|
|
|
|
|
+ detailPreviousRow.value = tableData.value[detailCurRowIndex.value - 1];
|
|
|
|
|
+ detailNextRow.value = tableData.value[detailCurRowIndex.value + 1];
|
|
|
|
|
+ if (detailPreviousRow.value) hasPreviousRow.value = true;
|
|
|
|
|
+ else hasPreviousRow.value = false;
|
|
|
|
|
+ if (detailNextRow.value) hasNextRow.value = true;
|
|
|
|
|
+ else hasNextRow.value = false;
|
|
|
|
|
+ if (chooseRow.value.findIndex((item) => item.id === curRow.id) !== -1)
|
|
|
|
|
+ detailRowChosen.value = true;
|
|
|
|
|
+ else detailRowChosen.value = false;
|
|
|
|
|
+ };
|
|
|
const handleDetail = (row) => {
|
|
const handleDetail = (row) => {
|
|
|
isDetailDialogShow.value = true;
|
|
isDetailDialogShow.value = true;
|
|
|
- detailDescription.value = row.description;
|
|
|
|
|
- detailPictures.value = row.pictures;
|
|
|
|
|
- detailVideos.value = row.videos;
|
|
|
|
|
|
|
+ detailRow.value = row;
|
|
|
|
|
+ updateDetailDialog(detailRow.value);
|
|
|
|
|
+ };
|
|
|
|
|
+ // 上一个
|
|
|
|
|
+ const handleChangePrevious = () => {
|
|
|
|
|
+ detailRow.value = detailPreviousRow.value;
|
|
|
|
|
+ updateDetailDialog(detailRow.value);
|
|
|
|
|
+ };
|
|
|
|
|
+ // 下一个
|
|
|
|
|
+ const handleChangeNext = () => {
|
|
|
|
|
+ detailRow.value = detailNextRow.value;
|
|
|
|
|
+ updateDetailDialog(detailRow.value);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 单个加急priority=1/取消加急priority=0
|
|
// 单个加急priority=1/取消加急priority=0
|
|
@@ -431,34 +477,31 @@
|
|
|
return userStore.checkPermission('question_mock_edit_admin');
|
|
return userStore.checkPermission('question_mock_edit_admin');
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- onMounted(() => {
|
|
|
|
|
- getTableData();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const hasDevModePermisson = () => {
|
|
|
|
|
+ return userStore.checkPermission('control_activation');
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
const devMode = ref(true);
|
|
const devMode = ref(true);
|
|
|
getDevMode().then((res) => {
|
|
getDevMode().then((res) => {
|
|
|
devMode.value = res;
|
|
devMode.value = res;
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
const switchDevMode = () => {
|
|
const switchDevMode = () => {
|
|
|
SDM();
|
|
SDM();
|
|
|
devMode.value = !devMode.value;
|
|
devMode.value = !devMode.value;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const hasDevModePermisson = () => {
|
|
|
|
|
- return userStore.checkPermission('control_activation');
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
onBeforeMount(() => {
|
|
onBeforeMount(() => {
|
|
|
- // getAIOptions();
|
|
|
|
|
- // getManualOptions();
|
|
|
|
|
getLocationOptions();
|
|
getLocationOptions();
|
|
|
getAIMainOptions();
|
|
getAIMainOptions();
|
|
|
getManualMainOptions();
|
|
getManualMainOptions();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-<style scoped lang="scss">
|
|
|
|
|
|
|
+<style scoped lang="less">
|
|
|
.box {
|
|
.box {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
@@ -466,8 +509,6 @@
|
|
|
|
|
|
|
|
.table-list {
|
|
.table-list {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
- // height: calc(100vh - 350px);
|
|
|
|
|
- // overflow-y: scroll;
|
|
|
|
|
|
|
|
|
|
.action-bar {
|
|
.action-bar {
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -519,7 +560,7 @@
|
|
|
margin-top: 10px;
|
|
margin-top: 10px;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
-<style lang="scss">
|
|
|
|
|
|
|
+<style lang="less">
|
|
|
.deleteMessage {
|
|
.deleteMessage {
|
|
|
padding: 20px 24px;
|
|
padding: 20px 24px;
|
|
|
box-shadow: 0px 12px 48px 16px rgba(0, 0, 0, 0.03), 0px 9px 28px 0px rgba(0, 0, 0, 0.05),
|
|
box-shadow: 0px 12px 48px 16px rgba(0, 0, 0, 0.03), 0px 9px 28px 0px rgba(0, 0, 0, 0.05),
|