123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774 |
- <template>
- <!-- 报告精选添加/编辑 -->
- <div class="add-choiceness">
- <el-card>
- <!-- 更新方式继承第几期 -->
- <el-row :gutter="24">
- <el-col :span="12">
- <el-select v-model="updateMode" placeholder="请选择更新方式" clearable @change="updateModeChange">
- <el-option label="重新编辑" value="重新编辑"></el-option>
- <el-option label="继承往期" value="继承往期"></el-option>
- </el-select>
- </el-col>
- <el-col :span="12">
- <el-select v-if="updateMode == '继承往期'" v-model="inheritNum" placeholder="选择继承第几期" clearable @change="getDetail">
- <el-option v-for="item in updateModeList" :key="item.Periods" :label="item.InheritPeriodsName" :value="item.Periods"></el-option>
- </el-select>
- </el-col>
- </el-row>
- <div v-show="updateMode">
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
- <!-- 标题 / 作者 /发布时间 -->
- <el-row :gutter="24" style="margin-top: 30px">
- <el-col :span="12">
- <el-form-item prop="title">
- <el-input v-model="ruleForm.title" placeholder="请输入标题"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item prop="author">
- <el-input v-model="ruleForm.author" placeholder="请输入作者"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="6">
- <el-form-item prop="time">
- <el-date-picker type="date" placeholder="选择发布时间" value-format="yyyy-MM-dd" v-model="ruleForm.time"></el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- <!-- 产品说明 -->
- <el-form-item prop="explain" style="margin-top: 10px">
- <el-input v-model="ruleForm.explain" placeholder="请输入产品说明"></el-input>
- </el-form-item>
- <!-- 变更说明 -->
- <!-- 富文本 -->
- <rich-text ref="oneRich" v-model="marketStrategy" :spareId="contentValue" :isText="contentText" />
- <el-form-item prop="reportLink">
- <div style="display: flex; align-items: center; margin-top: 10px">
- <span style="flex-shrink: 0">详细报告链接:</span>
- <el-input style="margin: 10px 0" v-model="ruleForm.reportLink" placeholder="请输入报告链接(弘则研报管理栏目下)"></el-input>
- </div>
- </el-form-item>
- </el-form>
- <!-- 产业/标的 模块 -->
- <div class="content-module">
- <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>
- </div>
- </draggable>
- <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">
- <div v-for="(val, num) in item.List" :key="val.ShowName" class="industrial" @click="ificationIndustrialBtn(val, num)" :class="num == ificationIndustrial ? 'pitch' : ''">
- <span style="margin-right: 19px">{{ val.ShowName }}</span>
- <span v-if="num == ificationIndustrial">
- <img src="~@/assets/img/icons/edit1.png" style="width: 12px; height: 12px; marginright: 10px" @click="editText(val, num)" />
- <i class="el-icon-close" @click="deleteClassify(val, num)"></i>
- </span>
- </div>
- <div class="addIndustrial" @click="addMulti" v-if="industryIndex == index">
- <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">
- <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>
- <div style="margin-bottom: 20px; display: flex; align-items: center" v-show="num == ificationIndustrial">
- <div style="display: flex; align-items: center" v-for="(son, num) in val.CompanyLabel" :key="num">
- <el-input style="width: 260px; margin-right: 15px" v-model="son.name" placeholder="请输入公司标签"></el-input>
- <img class="delete-item-icon" v-if="num > 0" @click="deleteLabelItem(val, num)" src="~@/assets/img/icons/delete-Item.png" alt="" />
- </div>
- <el-tooltip class="item" effect="dark" content="添加标签" placement="top-start">
- <img @click="addLabelClick(val)" class="editsty" src="~@/assets/img/set_m/add_ico.png" />
- </el-tooltip>
- </div>
- <rich-text :ref="'twoRich' + num" v-model="val.Body" :spareId="contentValueTwo" :isText="contentTextTwo" v-show="num == ificationIndustrial" />
- </div>
- </template>
- </div>
- </div>
- </div>
- <div>
- <div class="content-resource">
- <span class="resource">产业资源包:</span>
- <span class="show">{{ industrialSubjectName }}</span>
- </div>
- <div class="content-resource">
- <span class="resource">综述报告:</span>
- <span class="show">{{ overviewList.Title }}</span>
- <div style="margin-left: 20px">
- <el-switch @change="switchChangeHandler" v-model="overviewList.IsShowOverviewArticle" :active-value="1" :inactive-value="0" active-text="显示链接" inactive-text="不显示链接">
- </el-switch>
- </div>
- </div>
- </div>
- <div class="content-bottom">
- <el-button type="primary" @click="confirm('预览')">预览</el-button>
- <el-button type="primary" @click="confirm('保存')">保存</el-button>
- <el-button v-if="isShowStatus" type="primary" @click="confirm('发布')">发布</el-button>
- <el-button type="" @click="cancel">取消</el-button>
- </div>
- </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>
- <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>
- </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 || item.ShowName;
- 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;
- let itemList = this.industryList[0].List[0];
- this.industrialSubjectName = itemList.IndustrialManagementName || "";
- this.overviewList = {
- ArticleId: itemList.OverviewArticleId,
- Title: itemList.OverviewArticleTitle,
- IsShowOverviewArticle: itemList.IsShowOverviewArticle,
- };
- 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.ShowName === this.stateValue);
- let overviewList = {};
- const res = !arr
- ? await raiInterface.getReportSelectionThird_name({
- ThirdName: this.stateValue,
- ChartPermissionId: this.chartPermissionId,
- })
- : 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.ShowName == (arr ? arr.ShowName : res.Data.ThirdName));
- }
- if (isNext) return this.$message.error("标的重复!");
- item.List.push({
- Body: "",
- ChartPermissionId: this.chartPermissionId,
- IndustrialManagementId: arr ? arr.IndustrialManagementId + "" : "",
- IndustrialManagementName: arr ? arr.IndustryName : "",
- IndustrialSubjectId: arr ? arr.IndustrialSubjectId + "" : "",
- IndustrialSubjectName: arr ? arr.SubjectName : "",
- ShowName: arr ? arr.ShowName || arr.IndustryName : res.Data.ThirdName,
- ThirdId: res.Data.ThirdId || "",
- ThirdName: res.Data.ThirdName || "",
- CompanyLabel: [{ name: "", value: item.List.length + 1 }],
- OverviewArticleId: overviewList.ArticleId || 0,
- OverviewArticleTitle: overviewList.Title || "",
- IsShowOverviewArticle: overviewList.IsShowOverviewArticle || 0,
- });
- }
- });
- }
- }
- this.stateValue = "";
- this.addDialogVisible = false;
- },
- async editconfirmPerson() {
- if (this.stateValue) {
- const arr = this.subjectList.find((item) => item.ShowName === this.stateValue);
- let overviewList = {};
- const res = !arr
- ? await raiInterface.getReportSelectionThird_name({
- ThirdName: this.stateValue,
- ChartPermissionId: this.chartPermissionId,
- })
- : await raiInterface.getReportSelectionArticle({
- IndustrialSubjectId: arr.IndustrialSubjectId,
- });
- if (res.Ret === 200) {
- overviewList = res.Data;
- this.overviewList = overviewList;
- this.industryList.forEach((item) => {
- if (item.ChartPermissionId == this.chartPermissionId) {
- if (item.List.length > 0) {
- var isNext = item.List.some((item) => item.ShowName == (arr ? arr.ShowName : res.Data.ThirdName));
- }
- if (isNext) return this.$message.error("标的重复!");
- const obj = {
- Body: (this.$refs.twoRich && this.$refs.twoRich.value) || "",
- ChartPermissionId: this.chartPermissionId,
- IndustrialManagementId: arr ? arr.IndustrialManagementId + "" : "",
- IndustrialManagementName: arr ? arr.IndustryName : "",
- IndustrialSubjectId: arr ? arr.IndustrialSubjectId + "" : "",
- IndustrialSubjectName: arr ? arr.SubjectName : "",
- ShowName: arr ? arr.ShowName || arr.IndustryName : res.Data.ThirdName,
- ThirdId: res.Data.ThirdId || "",
- ThirdName: res.Data.ThirdName || "",
- 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 || 0,
- OverviewArticleTitle: overviewList.Title || "",
- IsShowOverviewArticle: overviewList.IsShowOverviewArticle || 0,
- };
- item.List.splice(this.editNum, 1, obj);
- this.industrialSubjectName = arr ? arr.IndustryName : res.Data.ThirdName || "";
- }
- });
- }
- }
- this.stateValue = "";
- this.addDialogVisible = false;
- },
- // 申请内容搜索
- async handleSearchResult(data, cb) {
- if (data) {
- cb([]);
- let res = await raiInterface.industrialAndSubjectSearch({ 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.ShowName, ...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("操作成功!");
- type != "保存" && 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,
- .el-select {
- width: 100%;
- }
- .content-resource {
- margin: 30px 0 60px;
- display: flex;
- line-height: 40px;
- .resource {
- width: 105px;
- }
- .show {
- flex: 1;
- height: 40px;
- border: 1px solid #aab4cc;
- border-radius: 4px;
- padding-left: 20px;
- }
- }
- .content-bottom {
- width: 100%;
- display: flex;
- justify-content: center;
- .el-button {
- padding: 0 30px;
- height: 40px;
- margin-left: 30px;
- }
- }
- .dlg-content {
- width: 100%;
- margin: 40px 0 70px;
- .inline-input {
- width: 100% !important;
- }
- .el-input {
- width: 100% !important;
- }
- }
- .content-module {
- margin-top: 30px;
- .content-industry {
- display: inline-block;
- margin: 30px 0;
- .content-name {
- display: inline-block;
- box-sizing: border-box;
- padding: 0 24px;
- line-height: 38px;
- height: 40px;
- background: #ecf5ff;
- border: 1px solid #b3d8ff;
- opacity: 1;
- font-weight: 500;
- font-size: 16px;
- color: #409eff;
- border-radius: 4px;
- margin-right: 30px;
- }
- .active {
- background-color: #409eff;
- color: #fff;
- }
- }
- .addIndustrial {
- box-sizing: border-box;
- width: 96px;
- height: 60px;
- padding-top: 10px;
- text-align: center;
- background: #ecf5ff;
- border: 1px solid #b3d8ff;
- opacity: 1;
- border-radius: 4px;
- color: #409eff;
- i {
- color: #409eff;
- font-weight: 700;
- padding-bottom: 5px;
- }
- span {
- display: inline-block;
- width: 100%;
- }
- }
- }
- .classification {
- display: flex;
- flex-wrap: wrap;
- margin-top: 20px;
- .industrial {
- position: relative;
- box-sizing: border-box;
- margin-bottom: 15px;
- width: 290px;
- height: 60px;
- line-height: 60px;
- text-align: center;
- background: #ecf5ff;
- font-size: 14px;
- margin-right: 30px;
- color: #409eff;
- border-radius: 4px;
- border: 1px solid #b3d8ff;
- }
- .pitch {
- display: flex;
- padding: 0 20px;
- justify-content: space-between;
- background-color: #409eff;
- border: none;
- color: #fff !important;
- }
- .addIndustrial {
- box-sizing: border-box;
- width: 96px;
- height: 60px;
- padding-top: 10px;
- text-align: center;
- background: #ecf5ff;
- border: 1px solid #b3d8ff;
- opacity: 1;
- border-radius: 4px;
- color: #409eff;
- margin-bottom: 15px;
- i {
- color: #409eff;
- font-weight: 700;
- padding-bottom: 5px;
- }
- span {
- display: inline-block;
- width: 100%;
- }
- }
- }
- .industrial-is-new {
- margin-bottom: 20px;
- }
- .delete-item-icon {
- width: 20px;
- height: 20px;
- margin-right: 20px;
- }
- }
- </style>
|