|
@@ -1,3 +1,475 @@
|
|
|
+<script setup>
|
|
|
+import { ref, onMounted } from "vue";
|
|
|
+import RichText from "./richText.vue";
|
|
|
+import { raiInterface } from "@/api/api.js";
|
|
|
+import draggable from "vuedraggable";
|
|
|
+import TemplateMessage from "./apply/templateMessage.vue";
|
|
|
+import _ from "lodash";
|
|
|
+import { onBeforeRouteLeave, useRouter, useRoute } from "vue-router";
|
|
|
+import { ElMessageBox, ElMessage } from "element-plus";
|
|
|
+
|
|
|
+const route = useRoute();
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+const contentValue = ref("one");
|
|
|
+const contentText = ref("市场策略核心逻辑汇总");
|
|
|
+const contentValueTwo = ref("two");
|
|
|
+const contentTextTwo = ref("公司核心逻辑汇总");
|
|
|
+const contentTextLogic = ref("行业核心逻辑汇总");
|
|
|
+const updateMode = ref(""); //更新方式
|
|
|
+const inheritNum = ref(""); //继承第几
|
|
|
+
|
|
|
+const ruleForm = ref({
|
|
|
+ title: "", //标题
|
|
|
+ author: "", //作者
|
|
|
+ time: "", //时间
|
|
|
+ explain: "", //说明
|
|
|
+ reportLink: "", //变更
|
|
|
+});
|
|
|
+const rules = ref({
|
|
|
+ title: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
|
|
+});
|
|
|
+const ruleFormRef = ref(null);
|
|
|
+const twoRich = ref(null);
|
|
|
+const industryList = ref([]); //行业
|
|
|
+const industryIndex = ref(0); //
|
|
|
+const ificationIndustrial = ref(0);
|
|
|
+const addDialogVisible = ref(false);
|
|
|
+const dialogText = ref("");
|
|
|
+const stateValue = ref("");
|
|
|
+const companyList = ref([]);
|
|
|
+const timeout = ref(null);
|
|
|
+const isShowStatus = ref(true);
|
|
|
+const industrialSubjectName = ref("");
|
|
|
+const chartPermissionId = ref(""); //分类id
|
|
|
+const subjectList = ref([]);
|
|
|
+const updateModeList = ref([]); //期数的数组
|
|
|
+const editNum = ref("");
|
|
|
+const overviewList = ref({});
|
|
|
+const marketStrategy = ref("");
|
|
|
+const timeInterval = ref(null); // 定时器
|
|
|
+
|
|
|
+// 报告的缓存处理数据
|
|
|
+function dataInit() {
|
|
|
+ if (sessionStorage.getItem("addChoicenessQY")) {
|
|
|
+ console.log('????');
|
|
|
+ let data = JSON.parse(sessionStorage.getItem("addChoicenessQY"));
|
|
|
+ setTimeout(() => {
|
|
|
+ industryList.value = data.industryList;
|
|
|
+ industryIndex.value = data.industryIndex;
|
|
|
+ ificationIndustrial.value = data.ificationIndustrial;
|
|
|
+ updateMode.value = data.updateMode;
|
|
|
+ inheritNum.value = data.inheritNum;
|
|
|
+ companyList.value = data.companyList;
|
|
|
+ industrialSubjectName.value = data.industrialSubjectName;
|
|
|
+ chartPermissionId.value = data.chartPermissionId;
|
|
|
+ subjectList.value = data.subjectList;
|
|
|
+ updateModeList.value = data.updateModeList;
|
|
|
+ editNum.value = data.editNum;
|
|
|
+ overviewList.value = data.overviewList;
|
|
|
+ ruleForm.value = data.ruleForm;
|
|
|
+ marketStrategy.value = data.MarketStrategy;
|
|
|
+ }, 200);
|
|
|
+ }
|
|
|
+ timeInterval.value = setInterval(() => {
|
|
|
+ let params = {
|
|
|
+ industryList: industryList.value,
|
|
|
+ industryIndex: industryIndex.value,
|
|
|
+ ificationIndustrial: ificationIndustrial.value,
|
|
|
+ updateMode: updateMode.value,
|
|
|
+ inheritNum: inheritNum.value,
|
|
|
+ companyList: companyList.value,
|
|
|
+ industrialSubjectName: industrialSubjectName.value,
|
|
|
+ chartPermissionId: chartPermissionId.value,
|
|
|
+ subjectList: subjectList.value,
|
|
|
+ updateModeList: updateModeList.value,
|
|
|
+ editNum: editNum.value,
|
|
|
+ overviewList: overviewList.value,
|
|
|
+ ruleForm: ruleForm.value,
|
|
|
+ MarketStrategy: marketStrategy.value,
|
|
|
+ };
|
|
|
+ sessionStorage.setItem("addChoicenessQY", JSON.stringify(params));
|
|
|
+ }, 120000);
|
|
|
+}
|
|
|
+function updateModeChange() {
|
|
|
+ if (updateMode.value == "重新编辑") {
|
|
|
+ init();
|
|
|
+ industryList.value = [];
|
|
|
+ getNoTacticsfirst();
|
|
|
+ }
|
|
|
+}
|
|
|
+//获取编辑详情
|
|
|
+async function getDetail() {
|
|
|
+ const res = await raiInterface.reportSelectionDetail({ ArticleId: route.query.id || "", Periods: inheritNum.value || "" });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ res.Data.List.forEach((item) => {
|
|
|
+ if (!item.List || !item.List.length > 0) {
|
|
|
+ item.List = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ updateMode.value = inheritNum.value ? updateMode.value : res.Data.AddType == "1" ? "重新编辑" : "继承往期";
|
|
|
+ ruleForm.value = {
|
|
|
+ title: res.Data.Title, //标题
|
|
|
+ author: res.Data.Department, //作者
|
|
|
+ time: res.Data.PublishDate, //时间
|
|
|
+ explain: res.Data.ProductDescription, //说明
|
|
|
+ reportLink: res.Data.ReportLink, //变更
|
|
|
+ };
|
|
|
+ marketStrategy.value = res.Data.MarketStrategy;
|
|
|
+ inheritNum.value = inheritNum.value ? inheritNum.value : res.Data.InheritPeriods;
|
|
|
+ industryList.value = res.Data.List;
|
|
|
+ setTimeout(() => {
|
|
|
+ res.Data.List.forEach((item, index) => {
|
|
|
+ item.List.forEach((key, i) => {
|
|
|
+ key.CompanyLabel = key.CompanyLabel
|
|
|
+ ? key.CompanyLabel.map((val, i) => {
|
|
|
+ let obj = {
|
|
|
+ name: val,
|
|
|
+ value: i + 1,
|
|
|
+ };
|
|
|
+ return obj;
|
|
|
+ })
|
|
|
+ : [
|
|
|
+ {
|
|
|
+ name: "",
|
|
|
+ value: 1,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }, 300);
|
|
|
+ chartPermissionId.value = res.Data.List[0].ChartPermissionId;
|
|
|
+ industrialSubjectName.value = res.Data.List[0].List ? res.Data.List[0].List[0].IndustrialManagementName : "";
|
|
|
+ overviewList.value = {
|
|
|
+ ArticleId: res.Data.List[0].List && res.Data.List[0].List[0].OverviewArticleId,
|
|
|
+ Title: res.Data.List[0].List && res.Data.List[0].List[0].OverviewArticleTitle,
|
|
|
+ IsShowOverviewArticle: res.Data.List[0].List && res.Data.List[0].List[0].IsShowOverviewArticle,
|
|
|
+ };
|
|
|
+ }
|
|
|
+}
|
|
|
+//获取模版
|
|
|
+async function getNoTacticsfirst() {
|
|
|
+ const res = await raiInterface.reportSereportSelectiondDetailTemplate();
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ industryList.value = res.Data.List;
|
|
|
+ chartPermissionId.value = res.Data.List[0].ChartPermissionId;
|
|
|
+ }
|
|
|
+}
|
|
|
+//点击产业的事件
|
|
|
+function industryBtn(item, index) {
|
|
|
+ if (index !== industryIndex.value) {
|
|
|
+ industryIndex.value = index;
|
|
|
+ chartPermissionId.value = item.ChartPermissionId;
|
|
|
+ ificationIndustrial.value = 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+//标的的点击事件 处理
|
|
|
+function ificationIndustrialBtn(item, index) {
|
|
|
+ if (index !== ificationIndustrial.value) {
|
|
|
+ ificationIndustrial.value = index;
|
|
|
+ industrialSubjectName.value = item.IndustrialManagementName || "";
|
|
|
+ overviewList.value = {
|
|
|
+ ArticleId: item.OverviewArticleId,
|
|
|
+ Title: item.OverviewArticleTitle,
|
|
|
+ IsShowOverviewArticle: item.IsShowOverviewArticle,
|
|
|
+ };
|
|
|
+ }
|
|
|
+}
|
|
|
+//编辑标的
|
|
|
+function editText(item, index) {
|
|
|
+ dialogText.value = "编辑";
|
|
|
+ chartPermissionId.value = item.ChartPermissionId;
|
|
|
+ stateValue.value = item.IndustrialSubjectName;
|
|
|
+ addDialogVisible.value = true;
|
|
|
+ editNum.value = index;
|
|
|
+}
|
|
|
+//删除标的
|
|
|
+function deleteClassify(item, index) {
|
|
|
+ ElMessageBox.confirm("确定要删除该标的吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ industryList[industryIndex.value].value.List.splice(index, 1);
|
|
|
+ ificationIndustrial.value = 0;
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!",
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除",
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+//添加产业
|
|
|
+function addMulti() {
|
|
|
+ dialogText.value = "添加标的";
|
|
|
+ addDialogVisible.value = true;
|
|
|
+}
|
|
|
+//弹框的取消事件
|
|
|
+function handleClose() {
|
|
|
+ stateValue.value = "";
|
|
|
+ addDialogVisible.value = false;
|
|
|
+}
|
|
|
+//弹框的确认事件
|
|
|
+async function confirmPerson() {
|
|
|
+ if (stateValue.value) {
|
|
|
+ const arr = subjectList.value.find((item) => item.SubjectName === stateValue.value);
|
|
|
+ if (!arr) {
|
|
|
+ ElMessage.error("输入正确的标的");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let overviewList = {};
|
|
|
+ const res = await raiInterface.getReportSelectionArticle({
|
|
|
+ IndustrialSubjectId: arr.IndustrialSubjectId,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ overviewList = res.Data;
|
|
|
+ }
|
|
|
+ industryList.value.forEach((item) => {
|
|
|
+ if (item.ChartPermissionId == chartPermissionId.value) {
|
|
|
+ if (item.List.length > 0) {
|
|
|
+ var isNext = item.List.some((item) => item.IndustrialSubjectName == arr.SubjectName);
|
|
|
+ }
|
|
|
+ if (isNext) return ElMessage.error("标的重复!");
|
|
|
+ item.List.push({
|
|
|
+ Body: "",
|
|
|
+ ChartPermissionId: chartPermissionId.value,
|
|
|
+ IndustrialManagementId: arr.IndustrialManagementId + "",
|
|
|
+ IndustrialManagementName: arr.IndustryName,
|
|
|
+ IndustrialSubjectId: arr.IndustrialSubjectId + "",
|
|
|
+ IndustrialSubjectName: arr.SubjectName,
|
|
|
+ CompanyLabel: [{ name: "", value: item.List.length + 1 }],
|
|
|
+ OverviewArticleId: overviewList.ArticleId,
|
|
|
+ OverviewArticleTitle: overviewList.Title,
|
|
|
+ IsShowOverviewArticle: overviewList.IsShowOverviewArticle,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ stateValue.value = "";
|
|
|
+ addDialogVisible.value = false;
|
|
|
+}
|
|
|
+async function editconfirmPerson() {
|
|
|
+ if (stateValue.value) {
|
|
|
+ const arr = subjectList.value.find((item) => item.SubjectName === stateValue.value);
|
|
|
+ if (!arr) {
|
|
|
+ ElMessage.error("输入正确的标的");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let overviewList = {};
|
|
|
+ const res = await raiInterface.getReportSelectionArticle({
|
|
|
+ IndustrialSubjectId: arr.IndustrialSubjectId,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ overviewList = res.Data;
|
|
|
+ }
|
|
|
+ industryList.value.forEach((item) => {
|
|
|
+ if (item.ChartPermissionId == chartPermissionId.value) {
|
|
|
+ if (item.List.length > 0) {
|
|
|
+ var isNext = item.List.some((item) => item.IndustrialSubjectName == arr.SubjectName);
|
|
|
+ }
|
|
|
+ if (isNext) return ElMessage.error("标的重复!");
|
|
|
+ const obj = {
|
|
|
+ Body: twoRich.value || "",
|
|
|
+ ChartPermissionId: chartPermissionId.value,
|
|
|
+ IndustrialManagementId: arr.IndustrialManagementId + "",
|
|
|
+ IndustrialManagementName: arr.IndustryName,
|
|
|
+ IndustrialSubjectId: arr.IndustrialSubjectId + "",
|
|
|
+ IndustrialSubjectName: arr.SubjectName,
|
|
|
+ CompanyLabel: item.List[editNum.value].CompanyLabel && item.List[editNum.value].CompanyLabel.length > 0 ? item.List[editNum.value].CompanyLabel : [{ name: "", value: item.List.length + 1 }],
|
|
|
+ OverviewArticleId: overviewList.ArticleId,
|
|
|
+ OverviewArticleTitle: overviewList.Title,
|
|
|
+ IsShowOverviewArticle: overviewList.IsShowOverviewArticle,
|
|
|
+ };
|
|
|
+ item.List.splice(editNum.value, 1, obj);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ stateValue.value = "";
|
|
|
+ addDialogVisible.value = false;
|
|
|
+}
|
|
|
+// 申请内容搜索
|
|
|
+async function handleSearchResult(data, cb) {
|
|
|
+ if (data) {
|
|
|
+ cb([]);
|
|
|
+ let res = await raiInterface.industrialSubjectSearch({ KeyWord: data, ChartPermissionId: chartPermissionId.value });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ if (res.Data.List && res.Data.List.length > 0) {
|
|
|
+ let arr = res.Data.List.map((item) => {
|
|
|
+ return { value: item.SubjectName, ...item };
|
|
|
+ });
|
|
|
+ subjectList.value = arr;
|
|
|
+ cb(arr);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+//保存 发布
|
|
|
+const confirm = _.debounce(function (type) {
|
|
|
+ ruleFormRef.value.validate(async (val) => {
|
|
|
+ if (val) {
|
|
|
+ let isText = [];
|
|
|
+ industryList.value.forEach((item) => {
|
|
|
+ item.List.forEach((key) => {
|
|
|
+ key.CompanyLabel && key.CompanyLabel.length > 0 && isText.push(key.CompanyLabel.some((val) => val.name));
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (isText && isText.includes(false)) {
|
|
|
+ return ElMessage.error("请输入公司标签");
|
|
|
+ }
|
|
|
+ let params = dataHandle(type);
|
|
|
+ if (type == "预览") {
|
|
|
+ sessionStorage.setItem("choicenessPre", JSON.stringify(params));
|
|
|
+ let { href } = router.resolve({ name: "预览报告精选" });
|
|
|
+ window.open(href, "_blank");
|
|
|
+ } else {
|
|
|
+ const res = await raiInterface.industrialSubjectPreserveAndPublish(params);
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ clearInterval(timeInterval.value);
|
|
|
+ sessionStorage.removeItem("addChoicenessQY");
|
|
|
+ thElMessage.success("操作成功!");
|
|
|
+ init();
|
|
|
+ router.back();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}, 500);
|
|
|
+//取消
|
|
|
+function cancel() {
|
|
|
+ clearInterval(timeInterval.value);
|
|
|
+ sessionStorage.removeItem("addChoicenessQY");
|
|
|
+ ruleFormRef.value.resetFields();
|
|
|
+ router.back();
|
|
|
+}
|
|
|
+async function getListPeriods() {
|
|
|
+ const res = await raiInterface.industrialSubjectListPeriods();
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ updateModeList.value = res.Data.List || [];
|
|
|
+ }
|
|
|
+}
|
|
|
+function init() {
|
|
|
+ ruleForm.value = {
|
|
|
+ title: "", //标题
|
|
|
+ author: "", //作者
|
|
|
+ time: "", //时间
|
|
|
+ explain: "", //说明
|
|
|
+ reportLink: "", //变更
|
|
|
+ };
|
|
|
+ ruleFormRef.value.resetFields();
|
|
|
+ marketStrategy.value = "";
|
|
|
+}
|
|
|
+// 标的下添加公司标签
|
|
|
+function addLabelClick(item) {
|
|
|
+ item.CompanyLabel.push({ name: "", value: item.CompanyLabel.length + 1 });
|
|
|
+}
|
|
|
+// 处理保存的数据
|
|
|
+function dataHandle(type) {
|
|
|
+ let industryList = _.cloneDeep(industryList.value);
|
|
|
+ const arr = [];
|
|
|
+ let ListChartSummary = [];
|
|
|
+ industryList.forEach((item) => {
|
|
|
+ item.List.forEach((key) => {
|
|
|
+ key.CompanyLabel && (key.CompanyLabel = key.CompanyLabel.map((val) => val.name));
|
|
|
+ arr.push(key);
|
|
|
+ });
|
|
|
+ ListChartSummary.push({
|
|
|
+ ChartPermissionId: item.ChartPermissionId,
|
|
|
+ BodyChartSummary: item.BodyChartSummary,
|
|
|
+ ChartPermissionName: item.ChartPermissionName,
|
|
|
+ ListSubject: [...item.List],
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (marketStrategy.value == "") {
|
|
|
+ ElMessage.error("市场策略核心逻辑汇总不能为空");
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ AddType: updateMode.value == "重新编辑" ? "1" : "2",
|
|
|
+ ArticleId: route.query.id ? Number(route.query.id) : 0,
|
|
|
+ Department: ruleForm.value.author,
|
|
|
+ Title: ruleForm.value.title,
|
|
|
+ DoType: type == "发布" ? 1 : 0,
|
|
|
+ MarketStrategy: marketStrategy.value,
|
|
|
+ InheritPeriods: inheritNum.value,
|
|
|
+ List: arr,
|
|
|
+ ProductDescription: ruleForm.value.explain,
|
|
|
+ PublishDate: ruleForm.value.time,
|
|
|
+ ReportLink: ruleForm.value.reportLink,
|
|
|
+ ListChartSummary,
|
|
|
+ };
|
|
|
+ return params;
|
|
|
+}
|
|
|
+function deleteLabelItem(item, index) {
|
|
|
+ item.CompanyLabel.splice(index, 1);
|
|
|
+}
|
|
|
+function switchChangeHandler(e) {
|
|
|
+ industryList.value.forEach((_) => {
|
|
|
+ _.List.forEach((item) => {
|
|
|
+ if (item.OverviewArticleId === overviewList.value.ArticleId) {
|
|
|
+ item.IsShowOverviewArticle = e;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+// 拖拽排序更新
|
|
|
+function sortChange({ oldIndex, newIndex }) {
|
|
|
+ industryIndex.value = sortChangeFun(industryIndex.value, oldIndex, newIndex);
|
|
|
+}
|
|
|
+//标的拖拽排序更新
|
|
|
+function ificationSortChange({ oldIndex, newIndex }) {
|
|
|
+ ificationIndustrial.value = sortChangeFun(ificationIndustrial.value, oldIndex, newIndex);
|
|
|
+}
|
|
|
+// 排序更新后的逻辑
|
|
|
+function sortChangeFun(currentIndex, oldIndex, newIndex) {
|
|
|
+ let bigger, smaller;
|
|
|
+ if (oldIndex > newIndex) {
|
|
|
+ bigger = oldIndex;
|
|
|
+ smaller = newIndex;
|
|
|
+ } else {
|
|
|
+ bigger = newIndex;
|
|
|
+ smaller = oldIndex;
|
|
|
+ }
|
|
|
+ // 当前算中tab的排序 小于较小的 大于较大的 则不用做变动
|
|
|
+ if (currentIndex < smaller || currentIndex > bigger) return currentIndex;
|
|
|
+ // 移动的是当前选中的
|
|
|
+ if (currentIndex == oldIndex) return newIndex;
|
|
|
+ if (oldIndex > newIndex) {
|
|
|
+ // 向左移 加加
|
|
|
+ currentIndex++;
|
|
|
+ } else if (oldIndex < newIndex) {
|
|
|
+ // 向右移 减减
|
|
|
+ currentIndex--;
|
|
|
+ }
|
|
|
+ return currentIndex;
|
|
|
+}
|
|
|
+function onMove(e) {
|
|
|
+ // 返回false表示不允许停靠
|
|
|
+ return !!e.relatedContext.element;
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ console.log(route);
|
|
|
+ if (route.query.id) {
|
|
|
+ isShowStatus.value = route.query.status == 0;
|
|
|
+ getDetail();
|
|
|
+ } else {
|
|
|
+ getNoTacticsfirst();
|
|
|
+ dataInit();
|
|
|
+ }
|
|
|
+ getListPeriods();
|
|
|
+});
|
|
|
+// 离开时清理定时器
|
|
|
+onBeforeRouteLeave((to, from, next) => {
|
|
|
+ clearInterval(timeInterval.value);
|
|
|
+ next();
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
<template>
|
|
|
<!-- 报告精选添加/编辑 -->
|
|
|
<div class="add-choiceness">
|
|
@@ -17,7 +489,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<div v-show="updateMode">
|
|
|
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
|
|
|
+ <el-form :model="ruleForm" :rules="rules" ref="ruleFormRef" class="demo-ruleForm">
|
|
|
<!-- 标题 / 作者 /发布时间 -->
|
|
|
<el-row :gutter="24" style="margin-top: 30px">
|
|
|
<el-col :span="12">
|
|
@@ -51,7 +523,7 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<!-- 产业/标的 模块 -->
|
|
|
- <div class="content-module">
|
|
|
+ <div class="content-module" v-if="industryList.length">
|
|
|
<draggable v-model="industryList" animation="300" @update="sortChange">
|
|
|
<div class="content-industry" v-for="(item, index) in industryList" :key="item.ChartPermissionId">
|
|
|
<div class="content-name" :class="industryIndex == index ? 'active' : ''" @click="industryBtn(item, index)">{{ item.ChartPermissionName }}</div>
|
|
@@ -60,7 +532,7 @@
|
|
|
<div v-for="(item, index) in industryList" :key="item.ChartPermissionId">
|
|
|
<div v-show="industryIndex == index">
|
|
|
<RichText v-model="item.BodyChartSummary" :ref="'logic' + index" :spareId="'logictest' + index" :isText="contentTextLogic" />
|
|
|
- <draggable :list="item.List" animation="300" class="classification" filter=".addIndustrial" :move="onMove" @update="ificationSortChange">
|
|
|
+ <!-- <draggable :list="item.List" animation="300" class="classification" filter=".addIndustrial" :move="onMove" @update="ificationSortChange"> -->
|
|
|
<div v-for="(val, num) in item.List" :key="val.IndustrialSubjectId" class="industrial" @click="ificationIndustrialBtn(val, num)" :class="num == ificationIndustrial ? 'pitch' : ''">
|
|
|
<span style="margin-right: 19px">{{ val.IndustrialSubjectName }}</span>
|
|
|
<span v-if="num == ificationIndustrial">
|
|
@@ -72,9 +544,9 @@
|
|
|
<i class="el-icon-plus"></i>
|
|
|
<span>添加标的</span>
|
|
|
</div>
|
|
|
- </draggable>
|
|
|
- <template v-for="(val, num) in item.List">
|
|
|
- <div :key="val.IndustrialSubjectId" v-show="industryIndex == index">
|
|
|
+ <!-- </draggable> -->
|
|
|
+ <template v-for="(val, num) in item.List" :key="val.IndustrialSubjectId">
|
|
|
+ <div v-show="industryIndex == index">
|
|
|
<div class="industrial-is-new" v-show="num == ificationIndustrial">
|
|
|
<el-checkbox v-model="val.IsNew" :true-label="1" :false-label="0">显示new标签</el-checkbox>
|
|
|
</div>
|
|
@@ -117,493 +589,27 @@
|
|
|
</div>
|
|
|
</el-card>
|
|
|
<!-- 弹框部分 -->
|
|
|
- <el-dialog v-dialogDrag :close-on-click-modal="false" :modal-append-to-body="false" center :visible.sync="addDialogVisible" width="560px" :before-close="handleClose">
|
|
|
- <div slot="title" style="display: flex; align-items: center">
|
|
|
- <img :src="dialogText == '编辑' ? $icons.editicon : $icons.add" style="color: #fff; width: 16px; height: 16px; margin-right: 5px" />
|
|
|
- <span style="font-size: 16px">{{ dialogText }}</span>
|
|
|
- </div>
|
|
|
+ <el-dialog v-dialogDrag :close-on-click-modal="false" :modal-append-to-body="false" center v-model="addDialogVisible" width="560px" :before-close="handleClose">
|
|
|
+ <template #header>
|
|
|
+ <div style="display: flex; align-items: center">
|
|
|
+ <img :src="dialogText == '编辑' ? $icons.editicon : $icons.add" style="color: #fff; width: 16px; height: 16px; margin-right: 5px" />
|
|
|
+ <span style="font-size: 16px">{{ dialogText }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<div class="dlg-content">
|
|
|
<el-autocomplete class="inline-input" v-model="stateValue" :trigger-on-focus="false" :fetch-suggestions="handleSearchResult" placeholder="请输入标的名称" clearable></el-autocomplete>
|
|
|
</div>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button v-if="dialogText == '编辑'" type="primary" @click="editconfirmPerson">确定</el-button>
|
|
|
- <el-button v-else type="primary" @click="confirmPerson">确定</el-button>
|
|
|
- <el-button @click="handleClose">取消</el-button>
|
|
|
- </span>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button v-if="dialogText == '编辑'" type="primary" @click="editconfirmPerson">确定</el-button>
|
|
|
+ <el-button v-else type="primary" @click="confirmPerson">确定</el-button>
|
|
|
+ <el-button @click="handleClose">取消</el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
-import RichText from "./richText.vue";
|
|
|
-import { raiInterface } from "@/api/api.js";
|
|
|
-import draggable from "vuedraggable";
|
|
|
-import TemplateMessage from "./apply/templateMessage.vue";
|
|
|
-
|
|
|
-export default {
|
|
|
- name: "",
|
|
|
- components: { RichText, draggable, TemplateMessage },
|
|
|
- props: {},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- contentValue: "one",
|
|
|
- contentText: "市场策略核心逻辑汇总",
|
|
|
- contentValueTwo: "two",
|
|
|
- contentTextTwo: "公司核心逻辑汇总",
|
|
|
- contentTextLogic: "行业核心逻辑汇总",
|
|
|
- updateMode: "", //更新方式
|
|
|
- inheritNum: "", //继承第几
|
|
|
- ruleForm: {
|
|
|
- title: "", //标题
|
|
|
- author: "", //作者
|
|
|
- time: "", //时间
|
|
|
- explain: "", //说明
|
|
|
- reportLink: "", //变更
|
|
|
- },
|
|
|
- rules: {
|
|
|
- title: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
|
|
- },
|
|
|
- industryList: [], //行业
|
|
|
- industryIndex: 0, //
|
|
|
- ificationIndustrial: 0,
|
|
|
- addDialogVisible: false,
|
|
|
- dialogText: "",
|
|
|
- stateValue: "",
|
|
|
- companyList: [],
|
|
|
- timeout: null,
|
|
|
- isShowStatus: true,
|
|
|
- industrialSubjectName: "",
|
|
|
- chartPermissionId: "", //分类id
|
|
|
- subjectList: [],
|
|
|
- updateModeList: [], //期数的数组
|
|
|
- editNum: "",
|
|
|
- overviewList: {},
|
|
|
- marketStrategy: "",
|
|
|
- timeInterval: null, // 定时器
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {},
|
|
|
- mounted() {
|
|
|
- if (this.$route.query.id) {
|
|
|
- this.isShowStatus = this.$route.query.status == 0;
|
|
|
- this.getDetail();
|
|
|
- } else {
|
|
|
- this.getNoTacticsfirst();
|
|
|
- this.dataInit();
|
|
|
- }
|
|
|
- this.getListPeriods();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 报告的缓存处理数据
|
|
|
- dataInit() {
|
|
|
- if (sessionStorage.getItem("addChoicenessQY")) {
|
|
|
- let data = JSON.parse(sessionStorage.getItem("addChoicenessQY"));
|
|
|
- setTimeout(async () => {
|
|
|
- this.industryList = data.industryList;
|
|
|
- this.industryIndex = data.industryIndex;
|
|
|
- this.ificationIndustrial = data.ificationIndustrial;
|
|
|
- this.updateMode = data.updateMode;
|
|
|
- this.inheritNum = data.inheritNum;
|
|
|
- this.companyList = data.companyList;
|
|
|
- this.industrialSubjectName = data.industrialSubjectName;
|
|
|
- this.chartPermissionId = data.chartPermissionId;
|
|
|
- this.subjectList = data.subjectList;
|
|
|
- this.updateModeList = data.updateModeList;
|
|
|
- this.editNum = data.editNum;
|
|
|
- this.overviewList = data.overviewList;
|
|
|
- this.ruleForm = data.ruleForm;
|
|
|
- this.marketStrategy = data.MarketStrategy;
|
|
|
- }, 200);
|
|
|
- }
|
|
|
- this.timeInterval = setInterval(() => {
|
|
|
- let params = {
|
|
|
- industryList: this.industryList,
|
|
|
- industryIndex: this.industryIndex,
|
|
|
- ificationIndustrial: this.ificationIndustrial,
|
|
|
- updateMode: this.updateMode,
|
|
|
- inheritNum: this.inheritNum,
|
|
|
- companyList: this.companyList,
|
|
|
- industrialSubjectName: this.industrialSubjectName,
|
|
|
- chartPermissionId: this.chartPermissionId,
|
|
|
- subjectList: this.subjectList,
|
|
|
- updateModeList: this.updateModeList,
|
|
|
- editNum: this.editNum,
|
|
|
- overviewList: this.overviewList,
|
|
|
- ruleForm: this.ruleForm,
|
|
|
- MarketStrategy: this.marketStrategy,
|
|
|
- };
|
|
|
- sessionStorage.setItem("addChoicenessQY", JSON.stringify(params));
|
|
|
- }, 120000);
|
|
|
- },
|
|
|
- updateModeChange() {
|
|
|
- if (this.updateMode == "重新编辑") {
|
|
|
- this.init();
|
|
|
- this.industryList = [];
|
|
|
- this.getNoTacticsfirst();
|
|
|
- }
|
|
|
- },
|
|
|
- //获取编辑详情
|
|
|
- async getDetail() {
|
|
|
- const res = await raiInterface.reportSelectionDetail({ ArticleId: this.$route.query.id || "", Periods: this.inheritNum || "" });
|
|
|
- if (res.Ret === 200) {
|
|
|
- res.Data.List.forEach((item) => {
|
|
|
- if (!item.List || !item.List.length > 0) {
|
|
|
- item.List = [];
|
|
|
- }
|
|
|
- });
|
|
|
- this.updateMode = this.inheritNum ? this.updateMode : res.Data.AddType == "1" ? "重新编辑" : "继承往期";
|
|
|
- this.ruleForm = {
|
|
|
- title: res.Data.Title, //标题
|
|
|
- author: res.Data.Department, //作者
|
|
|
- time: res.Data.PublishDate, //时间
|
|
|
- explain: res.Data.ProductDescription, //说明
|
|
|
- reportLink: res.Data.ReportLink, //变更
|
|
|
- };
|
|
|
- this.marketStrategy = res.Data.MarketStrategy;
|
|
|
- this.inheritNum = this.inheritNum ? this.inheritNum : res.Data.InheritPeriods;
|
|
|
- this.industryList = res.Data.List;
|
|
|
- setTimeout(() => {
|
|
|
- res.Data.List.forEach((item, index) => {
|
|
|
- item.List.forEach((key, i) => {
|
|
|
- key.CompanyLabel = key.CompanyLabel
|
|
|
- ? key.CompanyLabel.map((val, i) => {
|
|
|
- let obj = {
|
|
|
- name: val,
|
|
|
- value: i + 1,
|
|
|
- };
|
|
|
- return obj;
|
|
|
- })
|
|
|
- : [
|
|
|
- {
|
|
|
- name: "",
|
|
|
- value: 1,
|
|
|
- },
|
|
|
- ];
|
|
|
- });
|
|
|
- });
|
|
|
- }, 300);
|
|
|
- this.chartPermissionId = res.Data.List[0].ChartPermissionId;
|
|
|
- this.industrialSubjectName = res.Data.List[0].List ? res.Data.List[0].List[0].IndustrialManagementName : "";
|
|
|
- this.overviewList = {
|
|
|
- ArticleId: res.Data.List[0].List && res.Data.List[0].List[0].OverviewArticleId,
|
|
|
- Title: res.Data.List[0].List && res.Data.List[0].List[0].OverviewArticleTitle,
|
|
|
- IsShowOverviewArticle: res.Data.List[0].List && res.Data.List[0].List[0].IsShowOverviewArticle,
|
|
|
- };
|
|
|
- }
|
|
|
- },
|
|
|
- //获取模版
|
|
|
- async getNoTacticsfirst() {
|
|
|
- const res = await raiInterface.reportSereportSelectiondDetailTemplate();
|
|
|
- if (res.Ret === 200) {
|
|
|
- this.industryList = res.Data.List;
|
|
|
- this.chartPermissionId = res.Data.List[0].ChartPermissionId;
|
|
|
- }
|
|
|
- },
|
|
|
- //点击产业的事件
|
|
|
- industryBtn(item, index) {
|
|
|
- if (index !== this.industryIndex) {
|
|
|
- this.industryIndex = index;
|
|
|
- this.chartPermissionId = item.ChartPermissionId;
|
|
|
- this.ificationIndustrial = 0;
|
|
|
- }
|
|
|
- },
|
|
|
- //标的的点击事件 处理
|
|
|
- ificationIndustrialBtn(item, index) {
|
|
|
- if (index !== this.ificationIndustrial) {
|
|
|
- this.ificationIndustrial = index;
|
|
|
- this.industrialSubjectName = item.IndustrialManagementName || "";
|
|
|
- this.overviewList = {
|
|
|
- ArticleId: item.OverviewArticleId,
|
|
|
- Title: item.OverviewArticleTitle,
|
|
|
- IsShowOverviewArticle: item.IsShowOverviewArticle,
|
|
|
- };
|
|
|
- }
|
|
|
- },
|
|
|
- //编辑标的
|
|
|
- editText(item, index) {
|
|
|
- this.dialogText = "编辑";
|
|
|
- this.chartPermissionId = item.ChartPermissionId;
|
|
|
- this.stateValue = item.IndustrialSubjectName;
|
|
|
- this.addDialogVisible = true;
|
|
|
- this.editNum = index;
|
|
|
- },
|
|
|
- //删除标的
|
|
|
- deleteClassify(item, index) {
|
|
|
- this.$confirm("确定要删除该标的吗?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.industryList[this.industryIndex].List.splice(index, 1);
|
|
|
- this.ificationIndustrial = 0;
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!",
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消删除",
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- //添加产业
|
|
|
- addMulti() {
|
|
|
- this.dialogText = "添加标的";
|
|
|
- this.addDialogVisible = true;
|
|
|
- },
|
|
|
- //弹框的取消事件
|
|
|
- handleClose() {
|
|
|
- this.stateValue = "";
|
|
|
- this.addDialogVisible = false;
|
|
|
- },
|
|
|
- //弹框的确认事件
|
|
|
- async confirmPerson() {
|
|
|
- if (this.stateValue) {
|
|
|
- const arr = this.subjectList.find((item) => item.SubjectName === this.stateValue);
|
|
|
- if (!arr) {
|
|
|
- this.$message.error("输入正确的标的");
|
|
|
- return;
|
|
|
- }
|
|
|
- let overviewList = {};
|
|
|
- const res = await raiInterface.getReportSelectionArticle({
|
|
|
- IndustrialSubjectId: arr.IndustrialSubjectId,
|
|
|
- });
|
|
|
- if (res.Ret === 200) {
|
|
|
- overviewList = res.Data;
|
|
|
- }
|
|
|
- this.industryList.forEach((item) => {
|
|
|
- if (item.ChartPermissionId == this.chartPermissionId) {
|
|
|
- if (item.List.length > 0) {
|
|
|
- var isNext = item.List.some((item) => item.IndustrialSubjectName == arr.SubjectName);
|
|
|
- }
|
|
|
- if (isNext) return this.$message.error("标的重复!");
|
|
|
- item.List.push({
|
|
|
- Body: "",
|
|
|
- ChartPermissionId: this.chartPermissionId,
|
|
|
- IndustrialManagementId: arr.IndustrialManagementId + "",
|
|
|
- IndustrialManagementName: arr.IndustryName,
|
|
|
- IndustrialSubjectId: arr.IndustrialSubjectId + "",
|
|
|
- IndustrialSubjectName: arr.SubjectName,
|
|
|
- CompanyLabel: [{ name: "", value: item.List.length + 1 }],
|
|
|
- OverviewArticleId: overviewList.ArticleId,
|
|
|
- OverviewArticleTitle: overviewList.Title,
|
|
|
- IsShowOverviewArticle: overviewList.IsShowOverviewArticle,
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- this.stateValue = "";
|
|
|
- this.addDialogVisible = false;
|
|
|
- },
|
|
|
- async editconfirmPerson() {
|
|
|
- if (this.stateValue) {
|
|
|
- const arr = this.subjectList.find((item) => item.SubjectName === this.stateValue);
|
|
|
- if (!arr) {
|
|
|
- this.$message.error("输入正确的标的");
|
|
|
- return;
|
|
|
- }
|
|
|
- let overviewList = {};
|
|
|
- const res = await raiInterface.getReportSelectionArticle({
|
|
|
- IndustrialSubjectId: arr.IndustrialSubjectId,
|
|
|
- });
|
|
|
- if (res.Ret === 200) {
|
|
|
- overviewList = res.Data;
|
|
|
- }
|
|
|
- this.industryList.forEach((item) => {
|
|
|
- if (item.ChartPermissionId == this.chartPermissionId) {
|
|
|
- if (item.List.length > 0) {
|
|
|
- var isNext = item.List.some((item) => item.IndustrialSubjectName == arr.SubjectName);
|
|
|
- }
|
|
|
- if (isNext) return this.$message.error("标的重复!");
|
|
|
- const obj = {
|
|
|
- Body: this.$refs.twoRich.value || "",
|
|
|
- ChartPermissionId: this.chartPermissionId,
|
|
|
- IndustrialManagementId: arr.IndustrialManagementId + "",
|
|
|
- IndustrialManagementName: arr.IndustryName,
|
|
|
- IndustrialSubjectId: arr.IndustrialSubjectId + "",
|
|
|
- IndustrialSubjectName: arr.SubjectName,
|
|
|
- CompanyLabel:
|
|
|
- item.List[this.editNum].CompanyLabel && item.List[this.editNum].CompanyLabel.length > 0 ? item.List[this.editNum].CompanyLabel : [{ name: "", value: item.List.length + 1 }],
|
|
|
- OverviewArticleId: overviewList.ArticleId,
|
|
|
- OverviewArticleTitle: overviewList.Title,
|
|
|
- IsShowOverviewArticle: overviewList.IsShowOverviewArticle,
|
|
|
- };
|
|
|
- item.List.splice(this.editNum, 1, obj);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- this.stateValue = "";
|
|
|
- this.addDialogVisible = false;
|
|
|
- },
|
|
|
- // 申请内容搜索
|
|
|
- async handleSearchResult(data, cb) {
|
|
|
- if (data) {
|
|
|
- cb([]);
|
|
|
- let res = await raiInterface.industrialSubjectSearch({ KeyWord: data, ChartPermissionId: this.chartPermissionId });
|
|
|
- if (res.Ret === 200) {
|
|
|
- if (res.Data.List && res.Data.List.length > 0) {
|
|
|
- let arr = res.Data.List.map((item) => {
|
|
|
- return { value: item.SubjectName, ...item };
|
|
|
- });
|
|
|
- this.subjectList = arr;
|
|
|
- cb(arr);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- //保存 发布
|
|
|
- confirm: _.debounce(function (type) {
|
|
|
- this.$refs.ruleForm.validate(async (val) => {
|
|
|
- if (val) {
|
|
|
- let isText = [];
|
|
|
- this.industryList.forEach((item) => {
|
|
|
- item.List.forEach((key) => {
|
|
|
- key.CompanyLabel && key.CompanyLabel.length > 0 && isText.push(key.CompanyLabel.some((val) => val.name));
|
|
|
- });
|
|
|
- });
|
|
|
- if (isText && isText.includes(false)) {
|
|
|
- return this.$message.error("请输入公司标签");
|
|
|
- }
|
|
|
- let params = this.dataHandle(type);
|
|
|
- if (type == "预览") {
|
|
|
- sessionStorage.setItem("choicenessPre", JSON.stringify(params));
|
|
|
- let { href } = this.$router.resolve({ name: "预览报告精选" });
|
|
|
- window.open(href, "_blank");
|
|
|
- } else {
|
|
|
- const res = await raiInterface.industrialSubjectPreserveAndPublish(params);
|
|
|
- if (res.Ret === 200) {
|
|
|
- clearInterval(this.timeInterval);
|
|
|
- sessionStorage.removeItem("addChoicenessQY");
|
|
|
- this.$message.success("操作成功!");
|
|
|
- this.init();
|
|
|
- this.$router.back();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }, 500),
|
|
|
- //取消
|
|
|
- cancel() {
|
|
|
- clearInterval(this.timeInterval);
|
|
|
- sessionStorage.removeItem("addChoicenessQY");
|
|
|
- this.$refs["ruleForm"].resetFields();
|
|
|
- this.$router.back();
|
|
|
- },
|
|
|
- async getListPeriods() {
|
|
|
- const res = await raiInterface.industrialSubjectListPeriods();
|
|
|
- if (res.Ret === 200) {
|
|
|
- this.updateModeList = res.Data.List || [];
|
|
|
- }
|
|
|
- },
|
|
|
- init() {
|
|
|
- this.ruleForm = {
|
|
|
- title: "", //标题
|
|
|
- author: "", //作者
|
|
|
- time: "", //时间
|
|
|
- explain: "", //说明
|
|
|
- reportLink: "", //变更
|
|
|
- };
|
|
|
- this.$refs["ruleForm"].resetFields();
|
|
|
- this.marketStrategy = "";
|
|
|
- },
|
|
|
- // 标的下添加公司标签
|
|
|
- addLabelClick(item) {
|
|
|
- item.CompanyLabel.push({ name: "", value: item.CompanyLabel.length + 1 });
|
|
|
- },
|
|
|
- // 处理保存的数据
|
|
|
- dataHandle(type) {
|
|
|
- let industryList = _.cloneDeep(this.industryList);
|
|
|
- const arr = [];
|
|
|
- let ListChartSummary = [];
|
|
|
- industryList.forEach((item) => {
|
|
|
- item.List.forEach((key) => {
|
|
|
- key.CompanyLabel && (key.CompanyLabel = key.CompanyLabel.map((val) => val.name));
|
|
|
- arr.push(key);
|
|
|
- });
|
|
|
- ListChartSummary.push({
|
|
|
- ChartPermissionId: item.ChartPermissionId,
|
|
|
- BodyChartSummary: item.BodyChartSummary,
|
|
|
- ChartPermissionName: item.ChartPermissionName,
|
|
|
- ListSubject: [...item.List],
|
|
|
- });
|
|
|
- });
|
|
|
- if (this.marketStrategy == "") {
|
|
|
- this.$message.error("市场策略核心逻辑汇总不能为空");
|
|
|
- }
|
|
|
- let params = {
|
|
|
- AddType: this.updateMode == "重新编辑" ? "1" : "2",
|
|
|
- ArticleId: this.$route.query.id ? Number(this.$route.query.id) : 0,
|
|
|
- Department: this.ruleForm.author,
|
|
|
- Title: this.ruleForm.title,
|
|
|
- DoType: type == "发布" ? 1 : 0,
|
|
|
- MarketStrategy: this.marketStrategy,
|
|
|
- InheritPeriods: this.inheritNum,
|
|
|
- List: arr,
|
|
|
- ProductDescription: this.ruleForm.explain,
|
|
|
- PublishDate: this.ruleForm.time,
|
|
|
- ReportLink: this.ruleForm.reportLink,
|
|
|
- ListChartSummary,
|
|
|
- };
|
|
|
- return params;
|
|
|
- },
|
|
|
- deleteLabelItem(item, index) {
|
|
|
- item.CompanyLabel.splice(index, 1);
|
|
|
- },
|
|
|
- switchChangeHandler(e) {
|
|
|
- this.industryList.forEach((_) => {
|
|
|
- _.List.forEach((item) => {
|
|
|
- if (item.OverviewArticleId === this.overviewList.ArticleId) {
|
|
|
- item.IsShowOverviewArticle = e;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- // 拖拽排序更新
|
|
|
- sortChange({ oldIndex, newIndex }) {
|
|
|
- this.industryIndex = this.sortChangeFun(this.industryIndex, oldIndex, newIndex);
|
|
|
- },
|
|
|
- //标的拖拽排序更新
|
|
|
- ificationSortChange({ oldIndex, newIndex }) {
|
|
|
- this.ificationIndustrial = this.sortChangeFun(this.ificationIndustrial, oldIndex, newIndex);
|
|
|
- },
|
|
|
- // 排序更新后的逻辑
|
|
|
- sortChangeFun(currentIndex, oldIndex, newIndex) {
|
|
|
- let bigger, smaller;
|
|
|
- if (oldIndex > newIndex) {
|
|
|
- bigger = oldIndex;
|
|
|
- smaller = newIndex;
|
|
|
- } else {
|
|
|
- bigger = newIndex;
|
|
|
- smaller = oldIndex;
|
|
|
- }
|
|
|
- // 当前算中tab的排序 小于较小的 大于较大的 则不用做变动
|
|
|
- if (currentIndex < smaller || currentIndex > bigger) return currentIndex;
|
|
|
- // 移动的是当前选中的
|
|
|
- if (currentIndex == oldIndex) return newIndex;
|
|
|
- if (oldIndex > newIndex) {
|
|
|
- // 向左移 加加
|
|
|
- currentIndex++;
|
|
|
- } else if (oldIndex < newIndex) {
|
|
|
- // 向右移 减减
|
|
|
- currentIndex--;
|
|
|
- }
|
|
|
- return currentIndex;
|
|
|
- },
|
|
|
- onMove(e) {
|
|
|
- // 返回false表示不允许停靠
|
|
|
- return !!e.relatedContext.element;
|
|
|
- },
|
|
|
- },
|
|
|
- // 路由离开了 清除定时器
|
|
|
- beforeRouteLeave(to, from, next) {
|
|
|
- clearInterval(this.timeInterval);
|
|
|
- next();
|
|
|
- },
|
|
|
-};
|
|
|
-</script>
|
|
|
<style lang="scss">
|
|
|
.add-choiceness {
|
|
|
.el-date-editor.el-input,
|