addChoiceness.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762
  1. <template>
  2. <!-- 报告精选添加/编辑 -->
  3. <div class="add-choiceness">
  4. <el-card>
  5. <!-- 更新方式继承第几期 -->
  6. <el-row :gutter="24">
  7. <el-col :span="12">
  8. <el-select v-model="updateMode" placeholder="请选择更新方式" clearable @change="updateModeChange">
  9. <el-option label="重新编辑" value="重新编辑"></el-option>
  10. <el-option label="继承往期" value="继承往期"></el-option>
  11. </el-select>
  12. </el-col>
  13. <el-col :span="12">
  14. <el-select v-if="updateMode == '继承往期'" v-model="inheritNum" placeholder="选择继承第几期" clearable @clear="inheritNumClear" @change="getDetail">
  15. <el-option v-for="item in updateModeList" :key="item.Periods" :label="item.InheritPeriodsName" :value="item.Periods"></el-option>
  16. </el-select>
  17. </el-col>
  18. </el-row>
  19. <div v-show="updateMode">
  20. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
  21. <!-- 标题 / 作者 /发布时间 -->
  22. <el-row :gutter="24" style="margin-top: 30px">
  23. <el-col :span="12">
  24. <el-form-item prop="title">
  25. <el-input v-model="ruleForm.title" placeholder="请输入标题"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :span="6">
  29. <el-form-item prop="author">
  30. <el-input v-model="ruleForm.author" placeholder="请输入作者"></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="6">
  34. <el-form-item prop="time">
  35. <el-date-picker type="date" placeholder="选择发布时间" value-format="yyyy-MM-dd" v-model="ruleForm.time"></el-date-picker>
  36. </el-form-item>
  37. </el-col>
  38. </el-row>
  39. <!-- 产品说明 -->
  40. <el-form-item prop="explain" style="margin-top: 10px">
  41. <el-input v-model="ruleForm.explain" placeholder="请输入产品说明"></el-input>
  42. </el-form-item>
  43. <!-- 变更说明 -->
  44. <!-- 富文本 -->
  45. <rich-text ref="oneRich" :spareId="contentValue" :isText="contentText" />
  46. <el-form-item prop="reportLink">
  47. <div style="display: flex; align-items: center; margin-top: 10px">
  48. <span style="flex-shrink: 0">详细报告链接:</span>
  49. <el-input style="margin: 10px 0" v-model="ruleForm.reportLink" placeholder="请输入报告链接(弘则研报管理栏目下)"></el-input>
  50. </div>
  51. </el-form-item>
  52. </el-form>
  53. <!-- 产业/标的 模块 -->
  54. <div class="content-module">
  55. <draggable
  56. v-model="industryList"
  57. animation="300"
  58. @update="sortChange">
  59. <div class="content-industry" v-for="(item, index) in industryList" :key="item.ChartPermissionId">
  60. <div class="content-name" :class="industryIndex == index ? 'active' : ''" @click="industryBtn(item, index)">{{ item.ChartPermissionName }}</div>
  61. </div>
  62. </draggable>
  63. <div v-for="(item, index) in industryList" :key="item.ChartPermissionId">
  64. <RichText v-show="industryIndex == index" :ref="'logic' + index" :spareId="'logictest' + index" :isText="contentTextLogic" />
  65. </div>
  66. <draggable
  67. :list="industryListItem"
  68. animation="300"
  69. class="classification"
  70. filter=".addIndustrial"
  71. :move="onMove"
  72. @update="ificationSortChange">
  73. <div v-for="(val, num) in industryListItem" :key="val.IndustrialSubjectId" class="industrial"
  74. @click="ificationIndustrialBtn(val, num)" :class="num == ificationIndustrial ? 'pitch' : ''">
  75. <span style="margin-right: 19px">{{ val.IndustrialSubjectName }}</span>
  76. <span v-if="num == ificationIndustrial">
  77. <img src="~@/assets/img/icons/edit1.png" style="width: 12px; height: 12px; marginright: 10px" @click="editText(val, num)" />
  78. <i class="el-icon-close" @click="deleteClassify(val, num)"></i>
  79. </span>
  80. </div>
  81. <div class="addIndustrial" @click="addMulti">
  82. <i class="el-icon-plus"></i>
  83. <span>添加标的</span>
  84. </div>
  85. </draggable>
  86. <template v-for="(val, num) in industryListItem">
  87. <div class="industrial-is-new" :key="val.IndustrialSubjectId" v-if="num == ificationIndustrial">
  88. <el-checkbox v-model="val.IsNew" :true-label="1" :false-label="0">显示new标签</el-checkbox>
  89. </div>
  90. </template>
  91. <div v-if="industryListItem.length" style="margin-bottom: 20px; display: flex; align-items: center">
  92. <div style="display: flex; align-items: center" v-for="(val, num) in industryListItem[ificationIndustrial].CompanyLabel" :key="num">
  93. <el-input style="width: 260px; margin-right: 15px" v-model="val.name" placeholder="请输入公司标签"></el-input>
  94. <img class="delete-item-icon" v-if="num > 0" @click="deleteLabelItem(val, num)" src="~@/assets/img/icons/delete-Item.png" alt="" />
  95. </div>
  96. <el-tooltip class="item" effect="dark" content="添加标签" placement="top-start">
  97. <img @click="addLabelClick" class="editsty" src="~@/assets/img/set_m/add_ico.png" />
  98. </el-tooltip>
  99. </div>
  100. </div>
  101. <rich-text ref="twoRich" :spareId="contentValueTwo" :isText="contentTextTwo" />
  102. <div class="content-resource">
  103. <span class="resource">产业资源包:</span>
  104. <span class="show">{{ industrialSubjectName }}</span>
  105. </div>
  106. <div class="content-resource">
  107. <span class="resource">综述报告:</span>
  108. <span class="show">{{ overviewList.Title }}</span>
  109. </div>
  110. <div class="content-bottom">
  111. <el-button type="primary" @click="confirm('预览')">预览</el-button>
  112. <el-button type="primary" @click="confirm('保存')">保存</el-button>
  113. <el-button v-if="isShowStatus" type="primary" @click="confirm('发布')">发布</el-button>
  114. <el-button type="" @click="cancel">取消</el-button>
  115. </div>
  116. </div>
  117. </el-card>
  118. <!-- 弹框部分 -->
  119. <el-dialog v-dialogDrag :close-on-click-modal="false" :modal-append-to-body="false" center :visible.sync="addDialogVisible" width="560px" :before-close="handleClose">
  120. <div slot="title" style="display: flex; align-items: center">
  121. <img :src="dialogText == '编辑' ? $icons.editicon : $icons.add" style="color: #fff; width: 16px; height: 16px; margin-right: 5px" />
  122. <span style="font-size: 16px">{{ dialogText }}</span>
  123. </div>
  124. <div class="dlg-content">
  125. <el-autocomplete class="inline-input" v-model="stateValue" :trigger-on-focus="false" :fetch-suggestions="handleSearchResult" placeholder="请输入标的名称" clearable></el-autocomplete>
  126. </div>
  127. <span slot="footer" class="dialog-footer">
  128. <el-button v-if="dialogText == '编辑'" type="primary" @click="editconfirmPerson">确定</el-button>
  129. <el-button v-else type="primary" @click="confirmPerson">确定</el-button>
  130. <el-button @click="handleClose">取消</el-button>
  131. </span>
  132. </el-dialog>
  133. </div>
  134. </template>
  135. <script>
  136. import RichText from "./richText.vue";
  137. import { raiInterface } from "@/api/api.js";
  138. import draggable from 'vuedraggable';
  139. export default {
  140. name: "",
  141. components: { RichText , draggable},
  142. props: {},
  143. data() {
  144. return {
  145. contentValue: "one",
  146. contentText: "市场策略核心逻辑汇总",
  147. contentValueTwo: "two",
  148. contentTextTwo: "公司核心逻辑汇总",
  149. contentTextLogic: "行业核心逻辑汇总",
  150. updateMode: "", //更新方式
  151. inheritNum: "", //继承第几
  152. ruleForm: {
  153. title: "", //标题
  154. author: "", //作者
  155. time: "", //时间
  156. explain: "", //说明
  157. reportLink: "", //变更
  158. },
  159. rules: {
  160. title: [{ required: true, message: "请输入标题", trigger: "blur" }],
  161. author: [{ required: true, message: "请输入作者", trigger: "blur" }],
  162. time: [{ required: true, message: "请输入时间", trigger: "change" }],
  163. explain: [{ required: true, message: "请输入产品说明", trigger: "blur" }],
  164. reportLink: [{ required: true, message: "请输入报告链接", trigger: "blur" }],
  165. },
  166. industryList: [], //行业
  167. industryIndex: 0, //
  168. ificationIndustrial: 0,
  169. addDialogVisible: false,
  170. dialogText: "",
  171. stateValue: "",
  172. companyList: [],
  173. timeout: null,
  174. isShowStatus: true,
  175. industryListItem: [],
  176. industrialSubjectName: "",
  177. chartPermissionId: "", //分类id
  178. subjectList: [],
  179. updateModeList: [], //期数的数组
  180. editNum: "",
  181. overviewList: {},
  182. };
  183. },
  184. computed: {},
  185. watch: {
  186. industryListItem: {
  187. handler(nval) {
  188. if (nval.length > 0) {
  189. this.industrialSubjectName = this.industryListItem[this.ificationIndustrial].IndustrialManagementName || "";
  190. this.overviewList = {
  191. ArticleId: this.industryListItem[this.ificationIndustrial].OverviewArticleId,
  192. Title: this.industryListItem[this.ificationIndustrial].OverviewArticleTitle,
  193. };
  194. } else {
  195. this.industrialSubjectName = "";
  196. this.overviewList = { ArticleId: 0, Title: "" };
  197. }
  198. },
  199. deep: true,
  200. },
  201. },
  202. created() {},
  203. mounted() {
  204. if (this.$route.query.id) {
  205. this.isShowStatus = this.$route.query.status == 0;
  206. this.getDetail();
  207. } else {
  208. this.getNoTacticsfirst();
  209. }
  210. this.getListPeriods();
  211. },
  212. methods: {
  213. updateModeChange() {
  214. if (this.updateMode == "重新编辑") {
  215. this.init();
  216. this.industryList = [];
  217. this.industryListItem = [];
  218. this.getNoTacticsfirst();
  219. }
  220. },
  221. inheritNumClear() {
  222. if (this.inheritNum == "") {
  223. // this.init();
  224. // this.industryList=[]
  225. // this.industryListItem=[]
  226. // this.getNoTacticsfirst();
  227. }
  228. },
  229. //获取编辑详情
  230. async getDetail() {
  231. const res = await raiInterface.reportSelectionDetail({ ArticleId: this.$route.query.id || "", Periods: this.inheritNum || "" });
  232. if (res.Ret === 200) {
  233. res.Data.List.forEach((item) => {
  234. if (!item.List || !item.List.length > 0) {
  235. item.List = [];
  236. }
  237. });
  238. this.updateMode = this.inheritNum ? this.updateMode : res.Data.AddType == "1" ? "重新编辑" : "继承往期";
  239. this.ruleForm = {
  240. title: res.Data.Title, //标题
  241. author: res.Data.Department, //作者
  242. time: res.Data.PublishDate, //时间
  243. explain: res.Data.ProductDescription, //说明
  244. reportLink: res.Data.ReportLink, //变更
  245. };
  246. this.$refs["oneRich"].value = res.Data.MarketStrategy;
  247. this.inheritNum = this.inheritNum ? this.inheritNum : res.Data.InheritPeriods;
  248. this.industryList = res.Data.List;
  249. setTimeout(() => {
  250. res.Data.List.forEach((item, index) => {
  251. this.$refs["logic" + index][0].value = item.BodyChartSummary && item.BodyChartSummary;
  252. item.List.forEach((key) => {
  253. key.CompanyLabel = key.CompanyLabel
  254. ? key.CompanyLabel.map((val, i) => {
  255. let obj = {
  256. name: val,
  257. value: i + 1,
  258. };
  259. return obj;
  260. })
  261. : [
  262. {
  263. name: "",
  264. value: 1,
  265. },
  266. ];
  267. });
  268. });
  269. }, 300);
  270. this.chartPermissionId = res.Data.List[0].ChartPermissionId;
  271. this.industryListItem = res.Data.List[0].List || [];
  272. this.$refs.twoRich.value = res.Data.List[0].List ? res.Data.List[0].List[0].Body : "";
  273. this.industrialSubjectName = res.Data.List[0].List ? res.Data.List[0].List[0].IndustrialManagementName : "";
  274. this.overviewList = {
  275. ArticleId: res.Data.List[0].List && res.Data.List[0].List[0].OverviewArticleId,
  276. Title: res.Data.List[0].List && res.Data.List[0].List[0].OverviewArticleTitle,
  277. };
  278. }
  279. },
  280. //获取模版
  281. async getNoTacticsfirst() {
  282. const res = await raiInterface.reportSereportSelectiondDetailTemplate();
  283. if (res.Ret === 200) {
  284. this.industryList = res.Data.List;
  285. this.chartPermissionId = res.Data.List[0].ChartPermissionId;
  286. this.industryListItem = res.Data.List[0].List || [];
  287. }
  288. },
  289. //点击产业的事件
  290. industryBtn(item, index) {
  291. if (this.industryListItem.length > 0) {
  292. this.industryListItem[this.ificationIndustrial].Body = this.$refs["twoRich"].value;
  293. }
  294. this.industryList[this.industryIndex].BodyChartSummary = this.$refs["logic" + this.industryIndex][0].value;
  295. if (index !== this.industryIndex) {
  296. this.industryIndex = index;
  297. this.industryListItem = item.List || [];
  298. this.industryListItem.forEach((item) => {
  299. if (item.CompanyLabel && typeof item.CompanyLabel[0] === "string") {
  300. item.CompanyLabel = item.CompanyLabel
  301. ? item.CompanyLabel.map((key, index) => {
  302. let obj = {
  303. name: key,
  304. value: index + 1,
  305. };
  306. return obj;
  307. })
  308. : [
  309. {
  310. name: "",
  311. value: 1,
  312. },
  313. ];
  314. }
  315. });
  316. this.$refs.twoRich.value = item.List[0] ? item.List[0].Body : "";
  317. this.chartPermissionId = item.ChartPermissionId;
  318. this.ificationIndustrial = 0;
  319. }
  320. },
  321. //标的的点击事件 处理
  322. ificationIndustrialBtn(item, index) {
  323. if (this.industryListItem.length > 0) {
  324. this.industryListItem[this.ificationIndustrial].Body = this.$refs["twoRich"].value;
  325. }
  326. if (index !== this.ificationIndustrial) {
  327. this.ificationIndustrial = index;
  328. this.$refs.twoRich.value = item.Body || "";
  329. this.industrialSubjectName = item.IndustrialManagementName || "";
  330. this.overviewList = {
  331. ArticleId: item.OverviewArticleId,
  332. Title: item.OverviewArticleTitle,
  333. };
  334. }
  335. },
  336. //编辑标的
  337. editText(item, index) {
  338. this.dialogText = "编辑";
  339. this.chartPermissionId = item.ChartPermissionId;
  340. this.stateValue = item.IndustrialSubjectName;
  341. this.addDialogVisible = true;
  342. this.editNum = index;
  343. },
  344. //删除标的
  345. deleteClassify(item, index) {
  346. this.$confirm("确定要删除该标的吗?", "提示", {
  347. confirmButtonText: "确定",
  348. cancelButtonText: "取消",
  349. type: "warning",
  350. })
  351. .then(() => {
  352. this.industryList[this.industryIndex].List.splice(index, 1);
  353. this.ificationIndustrial = 0;
  354. this.$refs["twoRich"].value = this.industryList[this.industryIndex].List.length > 0 ? this.industryList[this.industryIndex].List[0].Body : "";
  355. this.$message({
  356. type: "success",
  357. message: "删除成功!",
  358. });
  359. })
  360. .catch(() => {
  361. this.$message({
  362. type: "info",
  363. message: "已取消删除",
  364. });
  365. });
  366. },
  367. //添加产业
  368. addMulti() {
  369. this.dialogText = "添加标的";
  370. this.addDialogVisible = true;
  371. },
  372. //弹框的取消事件
  373. handleClose() {
  374. this.stateValue = "";
  375. this.addDialogVisible = false;
  376. },
  377. //弹框的确认事件
  378. async confirmPerson() {
  379. if (this.stateValue) {
  380. const arr = this.subjectList.find((item) => item.SubjectName === this.stateValue);
  381. if (!arr) {
  382. this.$message.error("输入正确的标的");
  383. return;
  384. }
  385. let overviewList = {};
  386. const res = await raiInterface.getReportSelectionArticle({
  387. IndustrialSubjectId: arr.IndustrialSubjectId,
  388. });
  389. if (res.Ret === 200) {
  390. overviewList = res.Data;
  391. }
  392. this.industryList.forEach((item) => {
  393. if (item.ChartPermissionId == this.chartPermissionId) {
  394. if (item.List.length > 0) {
  395. var isNext = item.List.some((item) => item.IndustrialSubjectName == arr.SubjectName);
  396. }
  397. if (isNext) return this.$message.error("标的重复!");
  398. item.List.push({
  399. Body: "",
  400. ChartPermissionId: this.chartPermissionId,
  401. IndustrialManagementId: arr.IndustrialManagementId + "",
  402. IndustrialManagementName: arr.IndustryName,
  403. IndustrialSubjectId: arr.IndustrialSubjectId + "",
  404. IndustrialSubjectName: arr.SubjectName,
  405. CompanyLabel: [{ name: "", value: item.List.length + 1 }],
  406. OverviewArticleId: overviewList.ArticleId,
  407. OverviewArticleTitle: overviewList.Title,
  408. });
  409. }
  410. });
  411. }
  412. this.stateValue = "";
  413. this.addDialogVisible = false;
  414. },
  415. async editconfirmPerson() {
  416. if (this.stateValue) {
  417. const arr = this.subjectList.find((item) => item.SubjectName === this.stateValue);
  418. if (!arr) {
  419. this.$message.error("输入正确的标的");
  420. return;
  421. }
  422. let overviewList = {};
  423. const res = await raiInterface.getReportSelectionArticle({
  424. IndustrialSubjectId: arr.IndustrialSubjectId,
  425. });
  426. if (res.Ret === 200) {
  427. overviewList = res.Data;
  428. }
  429. this.industryList.forEach((item) => {
  430. if (item.ChartPermissionId == this.chartPermissionId) {
  431. if (item.List.length > 0) {
  432. var isNext = item.List.some((item) => item.IndustrialSubjectName == arr.SubjectName);
  433. }
  434. if (isNext) return this.$message.error("标的重复!");
  435. const obj = {
  436. Body: this.$refs.twoRich.value || "",
  437. ChartPermissionId: this.chartPermissionId,
  438. IndustrialManagementId: arr.IndustrialManagementId + "",
  439. IndustrialManagementName: arr.IndustryName,
  440. IndustrialSubjectId: arr.IndustrialSubjectId + "",
  441. IndustrialSubjectName: arr.SubjectName,
  442. OverviewArticleId: overviewList.ArticleId,
  443. OverviewArticleTitle: overviewList.Title,
  444. };
  445. item.List.splice(this.editNum, 1, obj);
  446. }
  447. });
  448. }
  449. this.stateValue = "";
  450. this.addDialogVisible = false;
  451. },
  452. // 申请内容搜索
  453. async handleSearchResult(data, cb) {
  454. if (data) {
  455. cb([]);
  456. let res = await raiInterface.industrialSubjectSearch({ KeyWord: data, ChartPermissionId: this.chartPermissionId });
  457. if (res.Ret === 200) {
  458. if (res.Data.List && res.Data.List.length > 0) {
  459. let arr = res.Data.List.map((item) => {
  460. return { value: item.SubjectName, ...item };
  461. });
  462. this.subjectList = arr;
  463. cb(arr);
  464. }
  465. }
  466. }
  467. },
  468. //保存 发布
  469. confirm(type) {
  470. this.$refs.ruleForm.validate(async (val) => {
  471. if (val) {
  472. if (this.industryListItem.length > 0) {
  473. this.industryListItem[this.ificationIndustrial].Body = this.$refs["twoRich"].value;
  474. } else if (this.$refs["twoRich"].value) {
  475. this.$message.error("文本内容无对应标的,请选择标的!");
  476. return;
  477. }
  478. let isText = [];
  479. this.industryList.forEach((item) => {
  480. item.List.forEach((key) => {
  481. key.CompanyLabel && key.CompanyLabel.length > 0 && isText.push(key.CompanyLabel.some((val) => val.name));
  482. });
  483. });
  484. if (isText && isText.includes(false)) {
  485. return this.$message.error("请输入公司标签");
  486. }
  487. let params = this.dataHandle(type);
  488. if (type == "预览") {
  489. console.log(params);
  490. sessionStorage.setItem("choicenessPre", JSON.stringify(params));
  491. let { href } = this.$router.resolve({ name: "预览报告精选" });
  492. window.open(href, "_blank");
  493. } else {
  494. const res = await raiInterface.industrialSubjectPreserveAndPublish(params);
  495. if (res.Ret === 200) {
  496. this.$message.success("操作成功!");
  497. this.init();
  498. this.$router.back();
  499. }
  500. }
  501. }
  502. });
  503. },
  504. //取消
  505. cancel() {
  506. this.$router.back();
  507. this.$refs["ruleForm"].resetFields();
  508. },
  509. async getListPeriods() {
  510. const res = await raiInterface.industrialSubjectListPeriods();
  511. if (res.Ret === 200) {
  512. this.updateModeList = res.Data.List || [];
  513. }
  514. },
  515. init() {
  516. this.ruleForm = {
  517. title: "", //标题
  518. author: "", //作者
  519. time: "", //时间
  520. explain: "", //说明
  521. reportLink: "", //变更
  522. };
  523. this.$refs["ruleForm"].resetFields();
  524. this.$refs["oneRich"].value = "";
  525. this.$refs["twoRich"].value = "";
  526. },
  527. // 标的下添加公司标签
  528. addLabelClick() {
  529. this.industryListItem[this.ificationIndustrial].CompanyLabel.push({ name: "", value: this.industryListItem.length + 1 });
  530. },
  531. // 处理保存的数据
  532. dataHandle(type) {
  533. let industryList = _.cloneDeep(this.industryList);
  534. const arr = [];
  535. let ListChartSummary = [];
  536. industryList.forEach((item) => {
  537. item.List.forEach((key) => {
  538. key.CompanyLabel && (key.CompanyLabel = key.CompanyLabel.map((val) => val.name));
  539. arr.push(key);
  540. });
  541. ListChartSummary.push({
  542. ChartPermissionId: item.ChartPermissionId,
  543. BodyChartSummary: item.BodyChartSummary,
  544. ChartPermissionName: item.ChartPermissionName,
  545. ListSubject: [...item.List],
  546. });
  547. });
  548. if (this.$refs["oneRich"].value == "") {
  549. this.$message.error("市场策略核心逻辑汇总不能为空");
  550. }
  551. let params = {
  552. AddType: this.updateMode == "重新编辑" ? "1" : "2",
  553. ArticleId: this.$route.query.id ? Number(this.$route.query.id) : 0,
  554. Department: this.ruleForm.author,
  555. Title: this.ruleForm.title,
  556. DoType: type == "发布" ? 1 : 0,
  557. MarketStrategy: this.$refs["oneRich"].value,
  558. InheritPeriods: this.inheritNum,
  559. List: arr,
  560. ProductDescription: this.ruleForm.explain,
  561. PublishDate: this.ruleForm.time,
  562. ReportLink: this.ruleForm.reportLink,
  563. ListChartSummary,
  564. };
  565. return params;
  566. },
  567. deleteLabelItem(item, index) {
  568. this.industryListItem[this.ificationIndustrial].CompanyLabel.splice(index, 1);
  569. },
  570. },
  571. // 拖拽排序更新
  572. sortChange({oldIndex,newIndex}){
  573. this.industryIndex=this.sortChangeFun(this.industryIndex,oldIndex,newIndex)
  574. },
  575. //标的拖拽排序更新
  576. ificationSortChange({oldIndex,newIndex}){
  577. this.ificationIndustrial=this.sortChangeFun(this.ificationIndustrial,oldIndex,newIndex)
  578. },
  579. // 排序更新后的逻辑
  580. sortChangeFun(currentIndex,oldIndex,newIndex){
  581. console.log({currentIndex,oldIndex,newIndex});
  582. let bigger,smaller
  583. if(oldIndex>newIndex){
  584. bigger=oldIndex
  585. smaller=newIndex
  586. }else{
  587. bigger=newIndex
  588. smaller=oldIndex
  589. }
  590. // 当前算中tab的排序 小于较小的 大于较大的 则不用做变动
  591. if(currentIndex < smaller || currentIndex > bigger) return currentIndex
  592. // 移动的是当前选中的
  593. if(currentIndex == oldIndex) return newIndex
  594. if(oldIndex>newIndex){
  595. // 向左移 加加
  596. currentIndex++
  597. }else if(oldIndex<newIndex){
  598. // 向右移 减减
  599. currentIndex--
  600. }
  601. return currentIndex
  602. },
  603. onMove(e){
  604. // 返回false表示不允许停靠
  605. return !!e.relatedContext.element
  606. },
  607. };
  608. </script>
  609. <style lang="scss">
  610. .add-choiceness {
  611. .el-date-editor.el-input,
  612. .el-select {
  613. width: 100%;
  614. }
  615. .content-resource {
  616. margin: 30px 0 60px;
  617. display: flex;
  618. line-height: 40px;
  619. .resource {
  620. width: 105px;
  621. }
  622. .show {
  623. flex: 1;
  624. height: 40px;
  625. border: 1px solid #aab4cc;
  626. border-radius: 4px;
  627. padding-left: 20px;
  628. }
  629. }
  630. .content-bottom {
  631. width: 100%;
  632. display: flex;
  633. justify-content: center;
  634. .el-button {
  635. padding: 0 30px;
  636. height: 40px;
  637. margin-left: 30px;
  638. }
  639. }
  640. .dlg-content {
  641. width: 100%;
  642. margin: 40px 0 70px;
  643. .inline-input {
  644. width: 100% !important;
  645. }
  646. .el-input {
  647. width: 100% !important;
  648. }
  649. }
  650. .content-module {
  651. margin-top: 30px;
  652. .content-industry {
  653. display: inline-block;
  654. margin: 30px 0;
  655. .content-name {
  656. display: inline-block;
  657. box-sizing: border-box;
  658. padding: 0 24px;
  659. line-height: 38px;
  660. height: 40px;
  661. background: #ecf5ff;
  662. border: 1px solid #b3d8ff;
  663. opacity: 1;
  664. font-weight: 500;
  665. font-size: 16px;
  666. color: #409eff;
  667. border-radius: 4px;
  668. margin-right: 30px;
  669. }
  670. .active {
  671. background-color: #409eff;
  672. color: #fff;
  673. }
  674. }
  675. .addIndustrial {
  676. box-sizing: border-box;
  677. width: 96px;
  678. height: 60px;
  679. padding-top: 10px;
  680. text-align: center;
  681. background: #ecf5ff;
  682. border: 1px solid #b3d8ff;
  683. opacity: 1;
  684. border-radius: 4px;
  685. color: #409eff;
  686. i {
  687. color: #409eff;
  688. font-weight: 700;
  689. padding-bottom: 5px;
  690. }
  691. span {
  692. display: inline-block;
  693. width: 100%;
  694. }
  695. }
  696. }
  697. .classification {
  698. display: flex;
  699. flex-wrap: wrap;
  700. margin-top: 20px;
  701. .industrial {
  702. position: relative;
  703. box-sizing: border-box;
  704. margin-bottom: 15px;
  705. width: 290px;
  706. height: 60px;
  707. line-height: 60px;
  708. text-align: center;
  709. background: #ecf5ff;
  710. font-size: 14px;
  711. margin-right: 30px;
  712. color: #409eff;
  713. border-radius: 4px;
  714. border: 1px solid #b3d8ff;
  715. }
  716. .pitch {
  717. display: flex;
  718. padding: 0 20px;
  719. justify-content: space-between;
  720. background-color: #409eff;
  721. border: none;
  722. color: #fff !important;
  723. }
  724. .addIndustrial {
  725. box-sizing: border-box;
  726. width: 96px;
  727. height: 60px;
  728. padding-top: 10px;
  729. text-align: center;
  730. background: #ecf5ff;
  731. border: 1px solid #b3d8ff;
  732. opacity: 1;
  733. border-radius: 4px;
  734. color: #409eff;
  735. margin-bottom: 15px;
  736. i {
  737. color: #409eff;
  738. font-weight: 700;
  739. padding-bottom: 5px;
  740. }
  741. span {
  742. display: inline-block;
  743. width: 100%;
  744. }
  745. }
  746. }
  747. .industrial-is-new {
  748. margin-bottom: 20px;
  749. }
  750. .delete-item-icon {
  751. width: 20px;
  752. height: 20px;
  753. margin-right: 20px;
  754. }
  755. }
  756. </style>