AddDevKnow.vue 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608
  1. <template>
  2. <el-scrollbar style="height: 100%" ref="elscrollbar" id="message-container">
  3. <div class="NoiseTemplateWrapper TemplateWrapper knowledgeWrapper">
  4. <crumbs
  5. <<<<<<< HEAD
  6. :title="'医学术语静态知识维护-'+title"
  7. =======
  8. :title="'医学术语静态知识维护-' + title"
  9. >>>>>>> parent of e19d1f7 (no message)
  10. class="topBack"
  11. :param="$route.params"
  12. linkTo="StaticInfo"
  13. ></crumbs>
  14. <<<<<<< HEAD
  15. <div class="info-container">
  16. <el-form :rules="rules" :model="form" label-width="160px" ref="groups">
  17. <el-form-item v-if="!isEdit" label="选择标准术语:" prop="selectedTerm">
  18. <el-select
  19. v-model="form.selectedTerm"
  20. filterable
  21. remote
  22. clearable
  23. :loading="showDrop"
  24. loading-text="加载中..."
  25. @change="changeWord"
  26. @visible-change="handleVisible"
  27. value-key="id"
  28. @clear="handleClear"
  29. ref="termName"
  30. placeholder="搜索"
  31. :remote-method="searchTerms"
  32. >
  33. <el-option
  34. v-for="(term,idx) in terms"
  35. :key="idx"
  36. :label="term.name+(term.typeName?'('+term.typeName+')':'')"
  37. :value="term"
  38. :title="term.name+(term.typeName?'('+term.typeName+')':'')"
  39. ></el-option>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="已选择标准术语:" label-width="160px">{{form.selectedTermName}}</el-form-item>
  43. <el-form-item
  44. v-if="form.selectedTerm&&(form.typeId==1||form.typeId==3||form.typeId==4||form.typeId==5||form.typeId==6)"
  45. :label="titleChange"
  46. prop="titleChange"
  47. label-width="160px"
  48. >
  49. <el-input v-model="form.titleChange"></el-input>
  50. </el-form-item>
  51. <p class="line"></p>
  52. <DevInfo
  53. v-for="(f,i) in form.prags"
  54. v-if="!upload"
  55. :key="(i+1)*10000 + showType"
  56. :data="f"
  57. :index="i"
  58. :total="form.prags.length"
  59. :isEdit="isEdit"
  60. :isCopy="isCopy"
  61. ref="subForm"
  62. @add="addParagraph(i)"
  63. @del="delParagraph"
  64. @reOrder="reOrder"
  65. :showType="showType"
  66. ></DevInfo>
  67. <el-form-item v-if="upload" label="标题名称搜索:" prop="fileTitle" label-width="160px">
  68. <el-input v-model="form.fileTitle"></el-input>
  69. </el-form-item>
  70. <el-form-item
  71. v-if="upload"
  72. label="上传文件:"
  73. ref="upload"
  74. prop="fileList"
  75. label-width="160px"
  76. >
  77. <el-upload
  78. @mouseenter.native="handleMouseenter"
  79. @mouseleave.native="handleMouseleave"
  80. class="upload-demo"
  81. :action="config.urls.promptServer"
  82. name="upfile"
  83. :multiple="false"
  84. :limit="1"
  85. :on-preview="handlePreview"
  86. :on-remove="handleRemove"
  87. :before-upload="handleBeforeUpLoad"
  88. :before-remove="beforeRemove"
  89. :on-change="handleChange"
  90. :on-success="handleSuccess"
  91. :show-file-list="showFileList"
  92. :file-list="form.fileList"
  93. >
  94. <el-button size="small" type="primary" v-if="showUpLoad">点击上传</el-button>
  95. <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
  96. </el-upload>
  97. <span class="tipInfo" v-show="isShowTip">{{form.fileList[0]&&form.fileList[0].name}}</span>
  98. <!-- <el-button size="small" type="primary" >点击上传</el-button> -->
  99. </el-form-item>
  100. <el-form-item label-width="160px">
  101. <div class="uploadInfo" v-if="isSuccessUpload===1">文件上传中,请稍等...</div>
  102. </el-form-item>
  103. </el-form>
  104. <div class="btn">
  105. <el-button type="primary" :disabled="saveDisable" @click="submitForm">确 定</el-button>
  106. </div>
  107. </div>
  108. =======
  109. <div class="info-container">
  110. <el-form :rules="rules1" :model="form" label-width="160px" ref="groups1" size="mini">
  111. <div class="container_top">
  112. <div v-if="!isEdit" style="margin-right: 40px">
  113. <el-form-item label="选择标准术语:" prop="selectedTerm">
  114. <el-select
  115. v-model="form.selectedTerm"
  116. filterable
  117. remote
  118. clearable
  119. :loading="showDrop"
  120. loading-text="加载中..."
  121. @change="changeWord"
  122. @visible-change="handleVisible"
  123. value-key="id"
  124. @clear="handleClear"
  125. ref="termName"
  126. placeholder="搜索"
  127. :remote-method="searchTerms"
  128. >
  129. <el-option
  130. v-for="(term, idx) in terms"
  131. :key="idx"
  132. :label="
  133. term.name +
  134. (term.typeName ? '(' + term.typeName + ')' : '')
  135. "
  136. :value="term"
  137. :title="
  138. term.name +
  139. (term.typeName ? '(' + term.typeName + ')' : '')
  140. "
  141. ></el-option>
  142. </el-select>
  143. </el-form-item>
  144. </div>
  145. <el-form-item label="已选择标准术语:" label-width="160px">
  146. {{
  147. form.selectedTermName
  148. }}
  149. </el-form-item>
  150. </div>
  151. </el-form>
  152. <div class="tabs_box">
  153. <div class="tabs">
  154. <div
  155. class="tabs_pane"
  156. :style="
  157. tabActive == 'one'
  158. ? { color: '#fff', background: '#00c7da' }
  159. : ''
  160. "
  161. @click="tabActiveChange('one')"
  162. v-if="staticTabShow"
  163. >
  164. 静态信息
  165. <img
  166. @click.stop="handleStaticTab"
  167. src="@/images/tab_add.png"
  168. alt
  169. v-if="AssesComSHow && !AssesTabSHow"
  170. />
  171. <img
  172. v-if="AssesTabSHow && AssesComSHow"
  173. @click.stop="closeStaticTab"
  174. src="@/images/tab_close.png"
  175. alt
  176. />
  177. </div>
  178. <div
  179. class="tabs_pane"
  180. :style="
  181. tabActive == 'two'
  182. ? { color: '#fff', background: '#00c7da' }
  183. : ''
  184. "
  185. @click="tabActiveChange('two')"
  186. v-if="AssesTabSHow && AssesComSHow"
  187. >
  188. 评估内容
  189. <img
  190. v-if="!staticTabShow"
  191. @click.stop="handleAssesTab"
  192. src="@/images/tab_add.png"
  193. alt
  194. />
  195. <img
  196. v-if="staticTabShow"
  197. @click.stop="closeAssesTab"
  198. src="@/images/tab_close.png"
  199. alt
  200. />
  201. </div>
  202. </div>
  203. </div>
  204. <p class="line"></p>
  205. <div class="tab_box_left" v-show="tabActive == 'one'" v-if="staticTabShow">
  206. <el-form :rules="rules" :model="form" label-width="160px" ref="groups" size="mini">
  207. <div
  208. v-if="
  209. form.selectedTerm &&
  210. (form.typeId == 1 ||
  211. form.typeId == 3 ||
  212. form.typeId == 4 ||
  213. form.typeId == 5 ||
  214. form.typeId == 6)
  215. "
  216. >
  217. <el-form-item
  218. :label="titleChange"
  219. prop="titleChange"
  220. label-width="160px"
  221. style="margin-bottom: 20px"
  222. >
  223. <el-input v-model="form.titleChange"></el-input>
  224. </el-form-item>
  225. </div>
  226. <div v-if="!upload">
  227. <DevInfo
  228. v-for="(f, i) in form.prags"
  229. :key="(i + 1) * 10000 + showType"
  230. :data="f"
  231. :index="i"
  232. :total="form.prags.length"
  233. :isEdit="isEdit"
  234. :isCopy="isCopy"
  235. ref="subForm"
  236. @add="addParagraph(i)"
  237. @del="delParagraph"
  238. @reOrder="reOrder"
  239. :showType="showType"
  240. ></DevInfo>
  241. </div>
  242. <div v-if="upload">
  243. <el-form-item label="标题名称搜索:" prop="fileTitle" label-width="160px">
  244. <el-input v-model="form.fileTitle"></el-input>
  245. </el-form-item>
  246. </div>
  247. <div>
  248. <el-form-item
  249. v-if="upload"
  250. label="上传文件:"
  251. ref="upload"
  252. prop="fileList"
  253. label-width="160px"
  254. >
  255. <el-upload
  256. @mouseenter.native="handleMouseenter"
  257. @mouseleave.native="handleMouseleave"
  258. class="upload-demo"
  259. :action="config.urls.promptServer"
  260. name="upfile"
  261. :multiple="false"
  262. :limit="1"
  263. :on-preview="handlePreview"
  264. :on-remove="handleRemove"
  265. :before-upload="handleBeforeUpLoad"
  266. :before-remove="beforeRemove"
  267. :on-change="handleChange"
  268. :on-success="handleSuccess"
  269. :show-file-list="showFileList"
  270. :file-list="form.fileList"
  271. >
  272. <el-button size="small" type="primary" v-if="showUpLoad">点击上传</el-button>
  273. <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
  274. </el-upload>
  275. <span class="tipInfo" v-show="isShowTip">
  276. {{
  277. form.fileList[0] && form.fileList[0].name
  278. }}
  279. </span>
  280. <!-- <el-button size="small" type="primary" >点击上传</el-button> -->
  281. </el-form-item>
  282. </div>
  283. <el-form-item label-width="160px">
  284. <div class="uploadInfo" v-if="isSuccessUpload === 1">文件上传中,请稍等...</div>
  285. </el-form-item>
  286. </el-form>
  287. </div>
  288. <div v-if="AssesComSHow && AssesTabSHow" v-show="tabActive == 'two'">
  289. <AddAssess @scrollTo="scrollTo" :childScaleData="scaleData" ref="assessRef" />
  290. </div>
  291. </div>
  292. <div class="btn">
  293. <el-button type="primary" :disabled="saveDisable" @click="submitForm">确 定</el-button>
  294. </div>
  295. >>>>>>> parent of e19d1f7 (no message)
  296. </div>
  297. </el-scrollbar>
  298. </template>
  299. <script>
  300. /**
  301. *
  302. */
  303. import api from '@api/knowledgeTree.js';
  304. import DevInfo from './DevInfo';
  305. import config from '@api/config';
  306. import $ from 'jquery';
  307. <<<<<<< HEAD
  308. =======
  309. import AddAssess from './AddAssess';
  310. >>>>>>> parent of e19d1f7 (no message)
  311. export default {
  312. name: 'AddDevKnow',
  313. components: {
  314. <<<<<<< HEAD
  315. DevInfo
  316. },
  317. data() {
  318. return {
  319. =======
  320. DevInfo,
  321. AddAssess
  322. },
  323. data() {
  324. return {
  325. staticTabShow: true,
  326. AssesTabSHow: true,
  327. staticComShow: true,
  328. AssesComSHow: false,
  329. toAssesTermId: null,
  330. scaleData: null,
  331. >>>>>>> parent of e19d1f7 (no message)
  332. isFixedTop: true,
  333. isEdit: false,
  334. isCopy: false,
  335. title: '添加',
  336. termTypes: [],
  337. terms: [], //术语列表
  338. form: {
  339. conceptId: '', //术语id
  340. isTip: 0, //是否要覆盖,0不覆盖,1覆盖
  341. selectedTerm: '', //术语标签
  342. termType: '',
  343. typeId: '',
  344. selectedTermName: '',
  345. selectedTermType: '',
  346. // titleChange: '',
  347. fileList: [],
  348. name: '',
  349. prags: [
  350. {
  351. //单个段落相关
  352. title: '',
  353. content: '',
  354. isReason: 0,
  355. orderNo: 0,
  356. position: [],
  357. text: ''
  358. }
  359. ],
  360. fileTitle: '',
  361. titleChange: ''
  362. },
  363. <<<<<<< HEAD
  364. rules: {
  365. selectedTerm: [
  366. { required: true, message: '请选择标准术语', trigger: 'change' }
  367. ],
  368. =======
  369. rules1: {
  370. selectedTerm: [
  371. { required: true, message: '请选择标准术语', trigger: 'change' }
  372. ]
  373. },
  374. rules: {
  375. >>>>>>> parent of e19d1f7 (no message)
  376. fileTitle: [
  377. { required: true, message: '请输入标题名称', trigger: 'change' },
  378. {
  379. validator: (rule, value, callback) => {
  380. if (value.trim().length > 30) {
  381. callback(new Error('标题名称不能超过30字'));
  382. } else {
  383. callback();
  384. }
  385. },
  386. trigger: 'change'
  387. }
  388. ],
  389. fileList: [
  390. { required: true, message: '请上传文件', trigger: 'change' }
  391. ],
  392. titleChange: [
  393. // {
  394. // validator: (rule, value, callback) => {
  395. // if (!value.trim()) {
  396. // callback(
  397. // new Error('请输入' + this.titleChange.replace(':', ''))
  398. // );
  399. // } else {
  400. // callback();
  401. // }
  402. // },
  403. // trigger: 'change'
  404. // },
  405. { max: 30, message: '标题最多30字', trigger: 'change' }
  406. ]
  407. },
  408. saveDisable: false, //保存按钮禁止点击
  409. showDrop: false, //下拉框显示文字bug1774
  410. config: config,
  411. showUpLoad: true,
  412. showFileList: false,
  413. upload: false,
  414. showConfirm: true,
  415. isSuccessUpload: 0, //是否上传成功 0: 不在上传 1: 上传过程中 2: 上传成功
  416. isShowTip: false,
  417. showType: -1, // 1 诊断 2 药品 3检验套餐 4检验细项 5检查 6检查子 7手术和操作 8量表
  418. editCount: -1, // 页面会否被编辑 >0被编辑 =0 未编辑
  419. startCount: -1,
  420. <<<<<<< HEAD
  421. isSaveSuccess: false // 是否保存成功
  422. =======
  423. isSaveSuccess: false, // 是否保存成功
  424. tabActive: 'one'
  425. >>>>>>> parent of e19d1f7 (no message)
  426. };
  427. },
  428. watch: {
  429. showType: {
  430. handler(newVal, oldVal) {
  431. if (newVal !== oldVal) {
  432. this.form.prags = this.form.prags.map(item => {
  433. return { ...item, position: [] };
  434. });
  435. }
  436. }
  437. },
  438. form: {
  439. handler(newName, oldName) {
  440. this.editCount++;
  441. },
  442. deep: true,
  443. immediate: true
  444. }
  445. },
  446. created: function() {
  447. const { isEdit, data, isCopy } = this.$route.params;
  448. if (isEdit || isCopy) {
  449. <<<<<<< HEAD
  450. =======
  451. const loading = this.$loading({
  452. lock: true,
  453. text: 'Loading',
  454. spinner: 'el-icon-loading',
  455. background: 'rgba(0, 0, 0, 0.7)'
  456. });
  457. >>>>>>> parent of e19d1f7 (no message)
  458. this.showType = data.type; // 编辑页确认显示类型
  459. this.isEdit = isEdit;
  460. this.isCopy = isCopy;
  461. this.title = isEdit ? '修改' : isCopy ? '复制' : '添加';
  462. (isEdit || isCopy) && this.changeWord(data);
  463. <<<<<<< HEAD
  464. if (isCopy) {
  465. const _this = this;
  466. setTimeout(() => {
  467. _this.handleClear();
  468. }, 300);
  469. }
  470. api.getBaseRecordById({ id: data.id })
  471. .then(res => {
  472. if (res.data.code == '0') {
  473. const data = res.data.data;
  474. =======
  475. api
  476. .getBaseRecordById({ id: data.id })
  477. .then(res => {
  478. if (res.data.code == '0') {
  479. const data = res.data.data;
  480. console.log('dwadfesvgeosboau13131213h', data.scale);
  481. if (data.type === 8) {
  482. this.AssesComSHow = true;
  483. if (data.scale) {
  484. this.scaleData = data.scale;
  485. this.AssesTabSHow = true;
  486. } else {
  487. this.AssesTabSHow = false;
  488. }
  489. }
  490. >>>>>>> parent of e19d1f7 (no message)
  491. if (this.form.typeId === 82 || this.form.typeId === 83) {
  492. // console.log('data',data)
  493. this.form.fileList =
  494. data &&
  495. data.map(it => {
  496. return JSON.parse(it.content);
  497. });
  498. this.showFileList = true;
  499. this.showUpLoad = false;
  500. } else {
  501. this.conceptId = data.id;
  502. this.form.typeId = data.type;
  503. this.form.name = data.name;
  504. this.form.titleChange =
  505. data.type == 1
  506. ? data.clinicalPathwayName
  507. : data.type == 3 ||
  508. data.type == 4 ||
  509. data.type == 5 ||
  510. data.type == 6
  511. ? data.noticeName
  512. : '';
  513. this.form.selectedTermName =
  514. data.name + (data.typeName ? '(' + data.typeName + ')' : '');
  515. this.form.selectedTerm =
  516. data.name + (data.typeName ? '(' + data.typeName + ')' : '');
  517. <<<<<<< HEAD
  518. this.form.prags =
  519. data &&
  520. data.details.map(it => {
  521. return {
  522. title: it.title,
  523. position: this.mapStringToNum(it.contentType),
  524. content: it.content.replace(
  525. /{imageUrlPrefix}/g,
  526. config.imgHost
  527. ),
  528. // isReason:it.isReason,
  529. text: it.text,
  530. disabled: true
  531. };
  532. });
  533. }
  534. }
  535. })
  536. .catch(error => {
  537. =======
  538. if (isCopy) {
  539. this.handleClear();
  540. }
  541. if (data.details.length) {
  542. this.form.prags =
  543. data &&
  544. data.details.map(it => {
  545. return {
  546. title: it.title,
  547. position: (it.contentType||'').split(","),
  548. content: it.content.replace(
  549. /{imageUrlPrefix}/g,
  550. config.imgHost
  551. ),
  552. // isReason:it.isReason,
  553. text: it.text,
  554. disabled: true
  555. };
  556. });
  557. } else {
  558. this.staticTabShow = false;
  559. this.tabActiveChange('two');
  560. }
  561. }
  562. }
  563. setTimeout(() => {
  564. loading.close();
  565. }, 200);
  566. })
  567. .catch(error => {
  568. loading.close();
  569. >>>>>>> parent of e19d1f7 (no message)
  570. if (error.code === '900010001') {
  571. return false;
  572. }
  573. console.log(error);
  574. });
  575. }
  576. setTimeout(() => {
  577. this.startCount = this.editCount;
  578. }, 500);
  579. },
  580. mounted() {},
  581. beforeRouteLeave(to, from, next) {
  582. // if (this.isSuccessUpload === 1) {
  583. // this.$confirm('文件正在上传,是否确定返回?', '提示', {
  584. // confirmButtonText: '确定',
  585. // cancelButtonText: '取消',
  586. // cancelButtonClass: 'cancel',
  587. // type: 'warning'
  588. // })
  589. // .then(() => {
  590. // next();
  591. // })
  592. // .catch(() => {});
  593. // // this.warning('还有未保存的文件,是否确定返回?');
  594. // } else if (this.isSuccessUpload === 2) {
  595. // this.$confirm('还有未保存的文件,是否确定返回?', '提示', {
  596. // confirmButtonText: '确定',
  597. // cancelButtonText: '取消',
  598. // cancelButtonClass: 'cancel',
  599. // type: 'warning'
  600. // })
  601. // .then(() => {
  602. // next();
  603. // })
  604. // .catch(() => {});
  605. // } else {
  606. // next();
  607. // }
  608. if (this.startCount !== this.editCount && !this.isSaveSuccess) {
  609. this.$alert('还有未保存的内容,确定要退出当前页面吗?', '提示', {
  610. confirmButtonText: '确定',
  611. // cancelButtonText: '取消',
  612. // cancelButtonClass: 'leaveBtn',
  613. // customClass: 'leaveBox',
  614. type: 'warning'
  615. })
  616. .then(() => {
  617. next();
  618. })
  619. .catch(() => {});
  620. } else {
  621. next();
  622. }
  623. },
  624. methods: {
  625. <<<<<<< HEAD
  626. =======
  627. scrollTo(dom) {
  628. var div = this.$refs['elscrollbar'].$refs['wrap'];
  629. if (dom >= 0) {
  630. div.scrollTop += dom - 120;
  631. } else {
  632. div.scrollTop -= Math.abs(dom) + 120;
  633. }
  634. },
  635. handleStaticTab() {
  636. this.AssesTabSHow = true;
  637. this.AssesComSHow = true;
  638. this.tabActiveChange('two');
  639. },
  640. handleAssesTab() {
  641. this.staticTabShow = true;
  642. this.form.prags = [
  643. {
  644. //单个段落相关
  645. title: '',
  646. content: '',
  647. isReason: 0,
  648. orderNo: 0,
  649. position: [],
  650. text: ''
  651. }
  652. ];
  653. this.tabActiveChange('one');
  654. },
  655. closeStaticTab() {
  656. this.$alert('确定要删除该标签?删除后该标签内容将会被清空!', '提示', {
  657. confirmButtonText: '确定',
  658. cancelButtonText: '取消',
  659. // cancelButtonClass: 'leaveBtn',
  660. // customClass: 'leaveBox',
  661. type: 'warning'
  662. })
  663. .then(() => {
  664. this.staticTabShow = false;
  665. this.tabActiveChange('two');
  666. })
  667. .catch(() => {});
  668. },
  669. closeAssesTab() {
  670. this.$alert('确定要删除该标签?删除后该标签内容将会被清空!', '提示', {
  671. confirmButtonText: '确定',
  672. cancelButtonText: '取消',
  673. // cancelButtonClass: 'leaveBtn',
  674. // customClass: 'leaveBox',
  675. type: 'warning'
  676. })
  677. .then(() => {
  678. this.AssesTabSHow = false;
  679. // this.AssesComSHow = false;
  680. this.tabActiveChange('one');
  681. })
  682. .catch(() => {});
  683. },
  684. tabActiveChange(type) {
  685. this.tabActive = type;
  686. if (type == 'two') {
  687. setTimeout(() => {
  688. this.$refs.assessRef.resizeTable();
  689. }, 200);
  690. }
  691. },
  692. >>>>>>> parent of e19d1f7 (no message)
  693. handleClear() {
  694. this.form.selectedTermName = '';
  695. this.form.selectedTerm = '';
  696. this.form.titleChange = '';
  697. <<<<<<< HEAD
  698. // console.log('处理清空的操作');
  699. =======
  700. >>>>>>> parent of e19d1f7 (no message)
  701. },
  702. handleMouseenter() {
  703. if (this.form.fileList.length !== 0) {
  704. this.isShowTip = true;
  705. }
  706. },
  707. handleMouseleave() {
  708. this.isShowTip = false;
  709. },
  710. changeWord(newVal) {
  711. <<<<<<< HEAD
  712. // console.log(newVal, '选中');
  713. =======
  714. if (newVal.typeName == '量表') {
  715. this.AssesComSHow = true;
  716. } else {
  717. this.staticTabShow = true;
  718. this.AssesComSHow = false;
  719. this.tabActive = 'one';
  720. }
  721. this.toAssesTermId = newVal.id;
  722. >>>>>>> parent of e19d1f7 (no message)
  723. this.showType = newVal.type || -1;
  724. const name = newVal.name;
  725. const typeName = newVal.typeName;
  726. const type = newVal.type;
  727. <<<<<<< HEAD
  728. this.form.selectedTermName = name + (typeName ? '(' + typeName + ')' : '');
  729. =======
  730. this.form.selectedTermName =
  731. name + (typeName ? '(' + typeName + ')' : '');
  732. >>>>>>> parent of e19d1f7 (no message)
  733. // this.form.selectedTerm = name + (typeName ? '(' + typeName + ')' : '');
  734. this.form.name = name;
  735. this.form.fileList = [];
  736. this.showFileList = false;
  737. this.form.typeId = type || '';
  738. this.showUpLoad = true;
  739. this.titleChange =
  740. type == 1
  741. ? '临床路径标题:'
  742. : type == 3 || type == 4 || type == 5 || type == 6
  743. ? '注意事项标题:'
  744. : '';
  745. this.form.fileTitle = '';
  746. if (newVal.typeId === 82 || newVal.typeId === 83) {
  747. this.upload = true;
  748. this.form.fileTitle = newVal.title;
  749. } else {
  750. this.upload = false;
  751. }
  752. },
  753. handleVisible(flag) {
  754. if (!flag) {
  755. this.terms = [];
  756. }
  757. },
  758. reOrder(isUp, i) {
  759. // isUp: 1 上升 0 下降
  760. let div = this.$refs['elscrollbar'].$refs['wrap'];
  761. let temp = {},
  762. it = {};
  763. if (isUp === 1) {
  764. if (i === 0) {
  765. this.warning('已经是第一个,不能再升啦!');
  766. return;
  767. }
  768. temp = Object.assign(this.form.prags[i - 1]);
  769. it = Object.assign(this.form.prags[i]);
  770. this.form.prags.splice(i - 1, 2, it, temp);
  771. this.$nextTick(() => {
  772. div.scrollTop = this.$refs.subForm[i - 1].$el.offsetTop - 48;
  773. });
  774. } else {
  775. if (i === this.form.prags.length - 1) {
  776. this.warning('已经是最后一个,不能再降啦!');
  777. return;
  778. }
  779. temp = Object.assign(this.form.prags[i + 1]);
  780. it = Object.assign(this.form.prags[i]);
  781. this.form.prags.splice(i, 2, temp, it);
  782. }
  783. },
  784. addParagraph(i) {
  785. this.form.prags.splice(i + 1, 0, {
  786. title: '',
  787. content: '',
  788. isReason: 0,
  789. position: [],
  790. text: ''
  791. });
  792. //添加段落光标自动落到新增的段落中
  793. setTimeout(() => {
  794. this.$refs.subForm[i + 1].$el
  795. .getElementsByClassName('el-input__inner')[0]
  796. .focus();
  797. });
  798. },
  799. delParagraph(i) {
  800. if (this.form.prags.length == 1) {
  801. this.warning('只剩一个段落,不能再删啦!');
  802. return;
  803. }
  804. this.showConfirmDialog('确定要删除该段落?', () => {
  805. this.form.prags.splice(i, 1);
  806. });
  807. },
  808. back() {
  809. this.$router.go(-1);
  810. },
  811. searchTerms(query) {
  812. if (!query.trim()) {
  813. this.form.terms = [];
  814. return;
  815. }
  816. //搜索术语列表
  817. this.showDrop = true;
  818. <<<<<<< HEAD
  819. api.staticKnowledgeBaseInfo({ inputStr: query.trim(), types: [0] }).then(res => {
  820. this.showDrop = false;
  821. if (res.data.code === '0') {
  822. this.terms = res.data.data;
  823. } else {
  824. this.warning('数据获取失败');
  825. }
  826. });
  827. =======
  828. api
  829. .staticKnowledgeBaseInfo({ inputStr: query.trim(), types: [0] })
  830. .then(res => {
  831. this.showDrop = false;
  832. if (res.data.code === '0') {
  833. this.terms = res.data.data;
  834. } else {
  835. this.warning('数据获取失败');
  836. }
  837. });
  838. >>>>>>> parent of e19d1f7 (no message)
  839. },
  840. mapStringToNum(str) {
  841. return str.split(',').map(it => {
  842. return +it;
  843. });
  844. },
  845. <<<<<<< HEAD
  846. =======
  847. >>>>>>> parent of e19d1f7 (no message)
  848. // 额外的表单检验
  849. formVal() {
  850. let positiontemp = this.form.prags.map(item => {
  851. return [...item.position];
  852. });
  853. let positionArr = positiontemp.reduce(function(a, b) {
  854. return a.concat(b);
  855. }); // 所有被选中的值集合
  856. <<<<<<< HEAD
  857. console.log(positionArr, 'positionArr');
  858. console.log(this.showType, '当前页的显示类型');
  859. let isVisFlag = positionArr.some(item => item === 2);
  860. let isDiagFlag = positionArr.some(item => item === 3);
  861. console.log(isVisFlag, 'isVisFlag是否显示');
  862. =======
  863. // console.log(positionArr, "positionArr");
  864. // console.log(this.showType, "当前页的显示类型");
  865. let isVisFlag = positionArr.some(item => item === 2);
  866. let isDiagFlag = positionArr.some(item => item === 3);
  867. // console.log(isVisFlag, "isVisFlag是否显示");
  868. >>>>>>> parent of e19d1f7 (no message)
  869. if (
  870. (this.showType == 3 ||
  871. this.showType == 4 ||
  872. this.showType == 5 ||
  873. this.showType == 6) &&
  874. isVisFlag
  875. ) {
  876. <<<<<<< HEAD
  877. console.log('进入校验');
  878. //若医学术语为检验/检查,且内容类型选择了注意事项,此时“注意事项标题”是必填项
  879. this.$refs.groups.clearValidate();
  880. =======
  881. // console.log("进入校验");
  882. //若医学术语为检验/检查,且内容类型选择了注意事项,此时“注意事项标题”是必填项
  883. this.$refs.groups && this.$refs.groups.clearValidate();
  884. >>>>>>> parent of e19d1f7 (no message)
  885. this.rules.titleChange.push({
  886. required: true,
  887. message: '请输入注意事项标题',
  888. trigger: 'change'
  889. });
  890. <<<<<<< HEAD
  891. this.$refs.groups.validateField('titleChange');
  892. this.$refs.groups.validateField('selectedTerm');
  893. =======
  894. this.$refs.groups && this.$refs.groups.validateField('titleChange');
  895. this.$refs.groups && this.$refs.groups.validateField('selectedTerm');
  896. >>>>>>> parent of e19d1f7 (no message)
  897. this.rules.titleChange = this.rules.titleChange.slice(0, 1);
  898. if (this.form.titleChange.trim() !== '') {
  899. // console.log('内容不为空');
  900. return true;
  901. } else {
  902. var div = this.$refs['elscrollbar'].$refs['wrap'];
  903. this.$nextTick(() => {
  904. div.scrollTop = 0;
  905. });
  906. return false;
  907. }
  908. // return;
  909. } else if (isDiagFlag && this.showType == 1) {
  910. // 若医学术语为诊断,且内容类型选择了临床路径,此时“临床路径标题”是必填项
  911. <<<<<<< HEAD
  912. this.$refs.groups.clearValidate();
  913. =======
  914. this.$refs.groups && this.$refs.groups.clearValidate();
  915. >>>>>>> parent of e19d1f7 (no message)
  916. this.rules.titleChange.push({
  917. required: true,
  918. message: '请输入临床路径标题',
  919. trigger: 'change'
  920. });
  921. <<<<<<< HEAD
  922. this.$refs.groups.validateField('titleChange');
  923. this.$refs.groups.validateField('selectedTerm');
  924. =======
  925. this.$refs.groups && this.$refs.groups.validateField('titleChange');
  926. this.$refs.groups && this.$refs.groups.validateField('selectedTerm');
  927. >>>>>>> parent of e19d1f7 (no message)
  928. this.rules.titleChange = this.rules.titleChange.slice(0, 1);
  929. if (this.form.titleChange.trim() !== '') {
  930. // console.log('内容不为空');
  931. return true;
  932. } else {
  933. var div = this.$refs['elscrollbar'].$refs['wrap'];
  934. this.$nextTick(() => {
  935. div.scrollTop = 0;
  936. });
  937. return false;
  938. }
  939. }
  940. },
  941. <<<<<<< HEAD
  942. submitForm() {
  943. if (this.isSuccessUpload === 1) {
  944. this.warning('文件上传中,请稍等');
  945. return;
  946. }
  947. let flagVal = this.formVal(); // 额外的表单校验
  948. if (flagVal === false) return;
  949. //验证外层表单
  950. let goOn = true,
  951. it = null;
  952. let outIsVia = true; // 外层验证是否通过
  953. this.$refs.groups.validate(valid => {
  954. if (!valid) {
  955. goOn = false;
  956. outIsVia = false;
  957. return false;
  958. }
  959. });
  960. //验证段落表单
  961. let viewHeight = 0; // 定位到表单校验的高度
  962. let viewHeightArr = []; // 表单校验出错高度的所有数组
  963. if (this.form.typeId !== 82 && this.form.typeId !== 83) {
  964. for (let i = 0; i < this.$refs.subForm.length; i++) {
  965. it = this.$refs.subForm[i];
  966. viewHeight += it.$el.offsetHeight;
  967. it.$refs.form.validate(valid => {
  968. if (!valid) {
  969. goOn = false;
  970. viewHeightArr.push(viewHeight);
  971. }
  972. });
  973. }
  974. }
  975. // console.log(viewHeightArr,'viewHeightArr');
  976. if (!goOn) {
  977. var div = this.$refs['elscrollbar'].$refs['wrap'];
  978. if (outIsVia) {
  979. // 外层校验通过,跳转至下层校验具体位置
  980. this.$nextTick(() => {
  981. div.scrollTop = +viewHeightArr[0] - 150;
  982. });
  983. } else {
  984. // 外层校验没通过,页面滚动到顶部
  985. this.$nextTick(() => {
  986. div.scrollTop = 0;
  987. });
  988. }
  989. return;
  990. }
  991. //通过必填验证,提交保存
  992. const item = this.form.prags;
  993. let param = [];
  994. =======
  995. async submitForm() {
  996. let all = [];
  997. let goOn = true,
  998. it = null;
  999. let assessRule = false;
  1000. let viewHeight = 0; // 定位到表单校验的高度
  1001. let viewHeightArr = []; // 表单校验出错高度的所有数组
  1002. let outIsVia = true; // 外层验证是否通过
  1003. let fvalidate1 = new Promise((resolve, reject) => {
  1004. //wanglei 添加promise
  1005. this.$refs.groups1.validate((valid, object) => {
  1006. if (valid) {
  1007. resolve(true);
  1008. } else {
  1009. reject('top', object);
  1010. return false;
  1011. }
  1012. });
  1013. });
  1014. all.push(fvalidate1);
  1015. if (this.staticTabShow) {
  1016. if (this.isSuccessUpload === 1) {
  1017. this.warning('文件上传中,请稍等');
  1018. return;
  1019. }
  1020. let flagVal = this.formVal(); // 额外的表单校验
  1021. if (flagVal === false) return;
  1022. //验证外层表单
  1023. let fvalidate = new Promise((resolve, reject) => {
  1024. //wanglei 添加promise
  1025. this.$refs.groups &&
  1026. this.$refs.groups.validate((valid, object) => {
  1027. if (valid) {
  1028. resolve(true);
  1029. } else {
  1030. reject('f', object);
  1031. return false;
  1032. }
  1033. });
  1034. });
  1035. // end....
  1036. //验证段落表单
  1037. // return;
  1038. all.push(fvalidate);
  1039. if (this.form.typeId !== 82 && this.form.typeId !== 83) {
  1040. for (let i = 0; i < this.$refs.subForm.length; i++) {
  1041. all.push(
  1042. new Promise((resolve, reject) => {
  1043. it = this.$refs.subForm[i];
  1044. // viewHeight += it.$el.getBoundingClientRect().top;
  1045. it.$refs.form.validate((valid, object) => {
  1046. if (!valid) {
  1047. reject('f', object);
  1048. goOn = false;
  1049. viewHeightArr.push(it.$el);
  1050. } else {
  1051. resolve(true);
  1052. }
  1053. });
  1054. })
  1055. );
  1056. }
  1057. }
  1058. }
  1059. // 表单验证
  1060. if (this.$refs.assessRef) {
  1061. all.push(...this.$refs.assessRef.assessCommit());
  1062. }
  1063. // 批量处理Promise返回
  1064. let transferedPromises = promises => {
  1065. // 返回一个处理之后的promise数组
  1066. return promises.map(promise => {
  1067. return promise.then(res => res).catch(err => err);
  1068. });
  1069. };
  1070. let promiseArr = transferedPromises(all);
  1071. await Promise.all(promiseArr).then(resArr => {
  1072. let cErrIndex = resArr.findIndex(item => item.type == 'c');
  1073. let fErrIndex = resArr.findIndex(item => item == 'f');
  1074. let topErrIndex = resArr.findIndex(item => item == 'top');
  1075. if (topErrIndex != -1) {
  1076. outIsVia = false;
  1077. var div = this.$refs['elscrollbar'].$refs['wrap'];
  1078. this.$nextTick(() => {
  1079. div.scrollTop = 0;
  1080. });
  1081. } else if (cErrIndex != -1 && fErrIndex != -1) {
  1082. if (this.staticTabShow) {
  1083. goOn = false;
  1084. }
  1085. this.tabActive = 'one';
  1086. this.$message({
  1087. showClose: true,
  1088. message: `"静态信息"和"评估内容"标签内有未填写项目,请填写完整或者删除该标签!`,
  1089. type: 'warning'
  1090. });
  1091. } else if (cErrIndex != -1 && fErrIndex == -1) {
  1092. this.tabActive = 'two';
  1093. this.$message({
  1094. showClose: true,
  1095. message: `"评估内容"标签内有未填写项目,请填写完整或者删除该标签!`,
  1096. type: 'warning'
  1097. });
  1098. let cErrArr = resArr.filter(item => item.type == 'c');
  1099. if (cErrArr) {
  1100. cErrArr = Object.keys(cErrArr[0].object);
  1101. }
  1102. this.$nextTick(() => {
  1103. setTimeout(() => {
  1104. let domTop = this.$refs.assessRef.getDom(cErrArr[0]);
  1105. var div = this.$refs['elscrollbar'].$refs['wrap'];
  1106. if (domTop >= 0) {
  1107. div.scrollTop += domTop - 120;
  1108. } else {
  1109. div.scrollTop -= Math.abs(domTop) + 120;
  1110. }
  1111. }, 100);
  1112. });
  1113. } else if (cErrIndex == -1 && fErrIndex != -1) {
  1114. this.tabActive = 'one';
  1115. this.$message({
  1116. showClose: true,
  1117. message: `"静态信息"标签内有未填写项目,请填写完整或者删除该标签!`,
  1118. type: 'warning'
  1119. });
  1120. } else {
  1121. assessRule = true;
  1122. }
  1123. });
  1124. if (this.staticTabShow && !goOn) {
  1125. setTimeout(() => {
  1126. var div = this.$refs['elscrollbar'].$refs['wrap'];
  1127. if (outIsVia) {
  1128. // 外层校验通过,跳转至下层校验具体位置
  1129. let sTop = viewHeightArr[0].getBoundingClientRect().top;
  1130. this.$nextTick(() => {
  1131. if (sTop >= 0) {
  1132. div.scrollTop += sTop - 120;
  1133. } else {
  1134. div.scrollTop -= Math.abs(sTop) + 120;
  1135. }
  1136. });
  1137. } else {
  1138. // 外层校验没通过,页面滚动到顶部
  1139. this.$nextTick(() => {
  1140. div.scrollTop = 0;
  1141. });
  1142. }
  1143. }, 200);
  1144. return;
  1145. }
  1146. if (!assessRule) return;
  1147. //通过必填验证,提交保存
  1148. let param = [];
  1149. // const item = this.form.prags;
  1150. >>>>>>> parent of e19d1f7 (no message)
  1151. if (this.form.typeId === 82 || this.form.typeId === 83) {
  1152. if (this.form.fileList.length === 0) {
  1153. this.warning('文件未上传,不存储数据');
  1154. return;
  1155. }
  1156. param.push(
  1157. Object.assign(
  1158. {},
  1159. {
  1160. position: this.form.typeId === 82 ? '8' : '9',
  1161. conceptId: this.form.conceptId,
  1162. title: this.form.fileTitle,
  1163. orderNo: 0,
  1164. content: JSON.stringify(this.form.fileList[0])
  1165. }
  1166. )
  1167. );
  1168. } else {
  1169. <<<<<<< HEAD
  1170. =======
  1171. // if (this.staticTabShow) {
  1172. // }
  1173. >>>>>>> parent of e19d1f7 (no message)
  1174. let data = this.form.prags,
  1175. tempArr = [],
  1176. paramsAll = {},
  1177. types = this.form.typeId;
  1178. for (let i = 0; i < data.length; i++) {
  1179. let obj = {};
  1180. obj.content = data[i].content;
  1181. obj.text = data[i].text;
  1182. obj.conceptId = data[i].conceptId;
  1183. obj.orderNo = i;
  1184. obj.title = data[i].title;
  1185. obj.contentType = data[i].position.join(',');
  1186. tempArr.push(obj);
  1187. }
  1188. paramsAll.clinicalPathwayName = types == 1 ? this.form.titleChange : '';
  1189. paramsAll.id = this.conceptId;
  1190. paramsAll.name = this.form.name;
  1191. paramsAll.noticeName =
  1192. types == 3 || types == 4 || types == 5 || types == 6
  1193. ? this.form.titleChange
  1194. : '';
  1195. paramsAll.type = this.form.typeId;
  1196. <<<<<<< HEAD
  1197. paramsAll.details = tempArr;
  1198. param = paramsAll;
  1199. }
  1200. // this.showSaveDialog(param,'是否'+(this.isEdit?'修改':'保存')+'该静态知识?');
  1201. =======
  1202. if (this.staticTabShow) {
  1203. paramsAll.details = tempArr;
  1204. } else {
  1205. paramsAll.details = null;
  1206. }
  1207. param = paramsAll;
  1208. if (!param.details) param.details = [];
  1209. param.details.forEach(item => {
  1210. let regExp = new RegExp(config.imgHost, 'g');
  1211. item.content = item.content.replace(regExp, '{imageUrlPrefix}');
  1212. });
  1213. // 评估内容的数据
  1214. param.scale = {};
  1215. console.log(
  1216. 'this.AssesComSHow',
  1217. this.AssesComSHow,
  1218. 'AssesTabSHow',
  1219. this.AssesTabSHow
  1220. );
  1221. if (this.AssesComSHow && this.AssesTabSHow) {
  1222. const assessParam = this.$refs.assessRef.formtParams();
  1223. param.scale = assessParam;
  1224. param.scale.conceptId = this.toAssesTermId;
  1225. const userInfo = localStorage.getItem('userLoginDTO');
  1226. param.scale.modifier = userInfo.linkman;
  1227. }
  1228. }
  1229. // return;
  1230. // this.showSaveDialog(param,'是否'+(this.isEdit?'修改':'保存')+'该静态知识?');
  1231. console.log('param-------');
  1232. console.dir(param);
  1233. // return;
  1234. >>>>>>> parent of e19d1f7 (no message)
  1235. if (!this.isEdit) {
  1236. // 新增页面
  1237. this.saveDisable = true;
  1238. this.sendSaveOrEdit(param);
  1239. return;
  1240. }
  1241. this.showSaveDialog(
  1242. param,
  1243. '<div><p style="color: #333333">确定保存修改内容?</p><p style="color: #D70A25">保存后将覆盖原有数据,且原有数据无法恢复。</p></div>'
  1244. );
  1245. },
  1246. showSaveDialog(param, msg) {
  1247. this.showConfirmDialog(msg, () => {
  1248. this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
  1249. this.sendSaveOrEdit(param);
  1250. });
  1251. },
  1252. //保存编辑 接口
  1253. sendSaveOrEdit(param) {
  1254. this.isCopy && (param.id = undefined);
  1255. <<<<<<< HEAD
  1256. api.saveBaseOrUpdateRecord(param)
  1257. =======
  1258. param.source = 1; //0:医院端 1:云平台
  1259. api
  1260. .saveBaseOrUpdateRecord(param)
  1261. >>>>>>> parent of e19d1f7 (no message)
  1262. .then(res => {
  1263. if (res.data.code === '0') {
  1264. this.isSuccessUpload = 0; // 修改文件上传状态为0
  1265. this.warning(res.data.msg || '保存成功', 'success');
  1266. this.isSaveSuccess = true; // 保存成功,可正常退出
  1267. //返回带搜索条件的首页
  1268. this.$router.push({
  1269. name: 'StaticInfo',
  1270. params: Object.assign({}, this.$route.params, {
  1271. currentPage: 1
  1272. })
  1273. });
  1274. } else {
  1275. this.warning(res.data.msg);
  1276. }
  1277. this.saveDisable = false;
  1278. })
  1279. .catch(err => {
  1280. if (err.code === '900010001') {
  1281. return false;
  1282. }
  1283. this.saveDisable = false;
  1284. this.warning(err);
  1285. });
  1286. },
  1287. // 弹出窗
  1288. showConfirmDialog(msg, resolve) {
  1289. this.$alert(msg, '提示', {
  1290. confirmButtonText: '确定',
  1291. // cancelButtonText: '取消',
  1292. // cancelButtonClass: 'cancel',
  1293. // confirmButtonClass: 'confirmBtn',
  1294. dangerouslyUseHTMLString: true,
  1295. type: 'warning'
  1296. })
  1297. .then(() => {
  1298. resolve();
  1299. })
  1300. .catch(() => {});
  1301. },
  1302. warning(msg, type) {
  1303. this.$message({
  1304. showClose: true,
  1305. message: msg,
  1306. <<<<<<< HEAD
  1307. type: type || 'warning'
  1308. =======
  1309. type: type || 'warning',
  1310. duration:1000
  1311. >>>>>>> parent of e19d1f7 (no message)
  1312. });
  1313. },
  1314. handleChange(file, fileList) {
  1315. // if(fileList&&fileList[0]&&fileList[0].response&&fileList[0].response.code==='0'){
  1316. // this.showUpLoad = false
  1317. // this.showFileList = true
  1318. // }else{
  1319. // this.showUpLoad = true
  1320. // this.showFileList = false
  1321. // }
  1322. // console.log(fileList,this.form.fileList,'aa')
  1323. },
  1324. handleSuccess(response, file, fileList) {
  1325. if (response.code == '0') {
  1326. this.showFileList = true;
  1327. this.form.fileList = [];
  1328. this.form.fileList.push({
  1329. name: response.data.title,
  1330. url: response.data.url,
  1331. size: response.data.size
  1332. });
  1333. this.showUpLoad = false;
  1334. if (!this.form.fileTitle) {
  1335. this.form.fileTitle = response.data.title;
  1336. }
  1337. this.isSuccessUpload = 2; // 上传成功状态
  1338. this.$refs.upload && this.$refs.upload.clearValidate(); // 清除校验
  1339. } else {
  1340. this.warning(response.msg || '上传失败');
  1341. // this.form.fileList = []
  1342. this.showUpLoad = true;
  1343. this.showFileList = false;
  1344. this.form.fileList = [];
  1345. }
  1346. },
  1347. handleRemove(file, fileList) {
  1348. this.showUpLoad = true;
  1349. this.form.fileList = [];
  1350. this.isSuccessUpload = 0;
  1351. },
  1352. handleBeforeUpLoad(file) {
  1353. // 上传过程中 上传按钮 隐藏
  1354. this.isSuccessUpload = 1; // 上传过程中
  1355. this.showFileList = true; // 新增 进度条 显示
  1356. this.$refs.upload && this.$refs.upload.clearValidate(); // 清除校验
  1357. this.showUpLoad = false;
  1358. if (file.size / 1024 / 1024 >= 500) {
  1359. this.warning('文件上传失败,超出大小限制500MB');
  1360. this.form.fileList = [];
  1361. this.showConfirm = false;
  1362. return false;
  1363. } else {
  1364. this.showConfirm = true;
  1365. }
  1366. },
  1367. handlePreview(file) {},
  1368. beforeRemove(file, fileList) {
  1369. if (this.showConfirm) {
  1370. return this.$alert(`确定移除 ${file.name}?`, '', {
  1371. cancelButtonClass: 'cacelBtn'
  1372. });
  1373. }
  1374. }
  1375. }
  1376. };
  1377. </script>
  1378. <style lang="less" scoped>
  1379. @import '../../less/common.less';
  1380. .cell .el-button.delete:focus {
  1381. color: red !important;
  1382. }
  1383. .topBack {
  1384. top: 0;
  1385. }
  1386. .info-container {
  1387. <<<<<<< HEAD
  1388. background: #fff;
  1389. padding: 20px;
  1390. margin: 70px 20px -20px 20px;
  1391. =======
  1392. // background: #fff;
  1393. // padding: 20px 0;
  1394. margin: 60px 20px -20px 20px;
  1395. min-width: 960px;
  1396. >>>>>>> parent of e19d1f7 (no message)
  1397. .el-input__inner {
  1398. width: 200px;
  1399. }
  1400. .el-form-item__label {
  1401. text-align: left;
  1402. }
  1403. .add-prg .el-form-item {
  1404. margin-bottom: 20px;
  1405. }
  1406. <<<<<<< HEAD
  1407. .el-form-item {
  1408. margin-bottom: 8px !important;
  1409. }
  1410. =======
  1411. // .el-form-item {
  1412. // margin-bottom: 8px !important;
  1413. // }
  1414. >>>>>>> parent of e19d1f7 (no message)
  1415. }
  1416. // .cancel span {
  1417. // color: #22ccc8;
  1418. // }
  1419. .line {
  1420. <<<<<<< HEAD
  1421. border-top: 1px #dcdfe6 solid;
  1422. margin-bottom: 25px;
  1423. margin-top: 25px;
  1424. =======
  1425. // border-top: 1px #dcdfe6 solid;
  1426. background: #dcdfe6;
  1427. height: 12px;
  1428. >>>>>>> parent of e19d1f7 (no message)
  1429. }
  1430. .NoiseTemplateWrapper .info-container .el-input__inner {
  1431. width: 250px;
  1432. }
  1433. // .NoiseTemplateWrapper .el-select .el-input .el-icon-circle-close{
  1434. // display: inherit!important;
  1435. // }
  1436. .cacelBtn {
  1437. color: #22ccc8 !important;
  1438. }
  1439. .upload-demo {
  1440. width: 300px;
  1441. /deep/.el-upload-list__item .el-icon-close-tip {
  1442. display: none !important;
  1443. }
  1444. /deep/.el-upload-list__item .el-upload-list__item-name {
  1445. max-width: 250px;
  1446. white-space: nowrap;
  1447. overflow: hidden;
  1448. text-overflow: ellipsis;
  1449. }
  1450. /deep/ .focusing {
  1451. // border: 1px solid transparent !important;
  1452. outline: transparent !important;
  1453. }
  1454. }
  1455. .uploadInfo {
  1456. margin-top: -20px;
  1457. color: #606266;
  1458. }
  1459. .tipInfo {
  1460. position: absolute;
  1461. // position: relative;
  1462. line-height: 24px;
  1463. top: -56px;
  1464. left: 20px;
  1465. // background-color: transparent;
  1466. // color: #606266;
  1467. padding: 3px 10px;
  1468. border-radius: 4px;
  1469. margin: 100px auto;
  1470. background-color: #4d4d4d;
  1471. text-align: center;
  1472. color: #fff;
  1473. font-size: 14px;
  1474. }
  1475. .tipInfo:before {
  1476. content: '';
  1477. display: block;
  1478. position: absolute;
  1479. // bottom: 9px;
  1480. top: -10px;
  1481. left: 18px;
  1482. border-bottom: 6px solid #4d4d4d;
  1483. border-top: 6px solid transparent;
  1484. border-left: 6px solid transparent;
  1485. border-right: 6px solid transparent;
  1486. // border-right: 6px solid #4D4D4D;
  1487. }
  1488. .btn {
  1489. text-align: right;
  1490. <<<<<<< HEAD
  1491. padding-right: 20px;
  1492. =======
  1493. margin: 10px 20px;
  1494. padding: 30px;
  1495. background: #fff;
  1496. >>>>>>> parent of e19d1f7 (no message)
  1497. }
  1498. .el-message-box {
  1499. /deep/ .el-icon-warning {
  1500. background-color: transparent !important;
  1501. // display: none;
  1502. }
  1503. /deep/ .el-message-box__message {
  1504. margin: 24px 0px;
  1505. }
  1506. // /deep/ .confirmBtn {
  1507. // // position: relative;
  1508. // // right: 240px !important;
  1509. // // top: 0px;
  1510. // background-color: #fff !important;
  1511. // span {
  1512. // color: #48c5d7 !important;
  1513. // }
  1514. // }
  1515. /deep/ .cancel {
  1516. background-color: #d7d7d7;
  1517. border-color: transparent !important;
  1518. span {
  1519. color: #fff;
  1520. }
  1521. }
  1522. }
  1523. <<<<<<< HEAD
  1524. =======
  1525. /deep/ .el-tabs__header {
  1526. padding: 0 10px !important;
  1527. }
  1528. .container_top {
  1529. display: flex;
  1530. padding: 20px 30px;
  1531. }
  1532. .tabs_box {
  1533. display: flex;
  1534. align-items: center;
  1535. }
  1536. .tabs {
  1537. display: flex;
  1538. margin: 0px 30px;
  1539. font-size: 14px;
  1540. height: 31px;
  1541. .tabs_pane {
  1542. position: relative;
  1543. width: 92px;
  1544. height: 32px;
  1545. border-radius: 6px 6px 0px 0px;
  1546. border: 1px solid #00c7da;
  1547. text-align: center;
  1548. line-height: 32px;
  1549. margin-right: 32px;
  1550. box-sizing: border-box;
  1551. color: #00c7da;
  1552. cursor: pointer;
  1553. img {
  1554. position: absolute;
  1555. right: -18px;
  1556. bottom: 0;
  1557. width: 18px;
  1558. height: 18px;
  1559. }
  1560. }
  1561. }
  1562. .tab_box_left {
  1563. padding: 30px;
  1564. }
  1565. /deep/ .el-form-item.is-success .el-input__inner,
  1566. .el-form-item.is-success .el-textarea__inner {
  1567. border-color: #c9c9c9 !important;
  1568. }
  1569. /deep/ .el-form-item.is-success .el-textarea__inner {
  1570. border-color: #c9c9c9 !important;
  1571. }
  1572. /deep/ .el-form-item.is-success .el-textarea__inner {
  1573. border-color: #c9c9c9 !important;
  1574. }
  1575. >>>>>>> parent of e19d1f7 (no message)
  1576. </style>