index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. <template>
  2. <div>
  3. <basic-container v-if="!basic">
  4. <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn"
  5. @saveColumn="saveColumn">
  6. <template slot="menuLeft">
  7. <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled"
  8. v-if="display">上传
  9. </el-button>
  10. <el-button type="success" size="small" @click="submit" :disabled="disabled"
  11. v-if="saveBtn">一键保存
  12. </el-button>
  13. <slot name="c_button"></slot>
  14. </template>
  15. <template slot="url" slot-scope="{ row }">
  16. <span style="display: flex;">
  17. <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url">
  18. <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
  19. </el-input>
  20. <span v-else>{{ row.url }}</span>
  21. </span>
  22. </template>
  23. <template slot-scope="scope" slot="menu">
  24. <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看
  25. </el-button>
  26. <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
  27. @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
  28. {{ scope.row.$cellEdit ? "保存" : "修改" }}
  29. </el-button>
  30. <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
  31. @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled">删除
  32. </el-button>
  33. </template>
  34. </avue-crud>
  35. <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  36. v-dialog-drag>
  37. <el-upload class="upload-demo" drag style="text-align: center" ref="upload"
  38. :action="incomingAction ? incomingAction : action" :headers="headers" :on-success="onSuccess" multiple
  39. :before-upload="beforeUpload">
  40. <i class="el-icon-upload"></i>
  41. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  42. <div class="el-upload__tip" slot="tip">
  43. 如上传文件过大,请耐心等待上传成功
  44. </div>
  45. </el-upload>
  46. </el-dialog>
  47. <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false"
  48. v-dialog-drag>
  49. <el-upload class="upload-demo" drag style="text-align: center"
  50. :action="incomingAction ? incomingAction : action" :headers="headers" :show-file-list="false"
  51. :on-success="onSuccessTwo" :before-upload="beforeUpload">
  52. <i class="el-icon-upload"></i>
  53. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  54. <div class="el-upload__tip" slot="tip">
  55. 如上传文件过大,请耐心等待上传成功
  56. </div>
  57. </el-upload>
  58. </el-dialog>
  59. <!--之前的查看图片弹窗-->
  60. <!--<el-dialog-->
  61. <!-- width="80%"-->
  62. <!-- title="附件"-->
  63. <!-- :visible.sync="innerVisible"-->
  64. <!-- :close-on-click-modal="false"-->
  65. <!-- append-to-body-->
  66. <!--&gt;-->
  67. <!-- <div style="width: 50%;height: 50%;margin: 0 auto">-->
  68. <!-- <img :src="imgUrl" alt="" style="width: 100%;height: 100%;" />-->
  69. <!-- </div>-->
  70. <!--</el-dialog>-->
  71. <!-- 新的查看图片弹窗-->
  72. <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
  73. </basic-container>
  74. <span v-else-if="true">
  75. <avue-crud :data="data" ref="crud" :option="option" :key="key" @resetColumn="resetColumn"
  76. @saveColumn="saveColumn">
  77. <template slot="menuLeft">
  78. <el-button type="primary" size="small" icon="el-icon-edit" @click="addDetail" :disabled="disabled">上传
  79. </el-button>
  80. </template>
  81. <template slot="url" slot-scope="{ row }">
  82. <el-input placeholder="请输入内容" size="small" v-if="row.$cellEdit" v-model="row.url">
  83. <el-button slot="append" @click="singleLineUpload(row)">附件</el-button>
  84. </el-input>
  85. <span v-else>{{ row.url }}</span>
  86. </template>
  87. <template slot-scope="scope" slot="menu">
  88. <el-button icon="el-icon-download" :size="scope.size" :type="scope.type" @click="download(scope)">查看
  89. </el-button>
  90. <el-button :type="scope.type" :size="scope.size" icon="el-icon-edit"
  91. @click.stop="rowCell(scope.row, scope.index)" :disabled="disabled">
  92. {{ scope.row.$cellEdit ? "保存" : "修改" }}
  93. </el-button>
  94. <el-button :type="scope.type" :size="scope.size" icon="el-icon-delete"
  95. @click.stop="rowDel(scope.row, scope.index)" :disabled="disabled">删除
  96. </el-button>
  97. </template>
  98. </avue-crud>
  99. <el-dialog title="上传附件" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  100. v-dialog-drag>
  101. <el-upload class="upload-demo" drag style="text-align: center" ref="upload" :action="action" :headers="headers"
  102. :on-success="onSuccess" multiple :before-upload="beforeUpload">
  103. <i class="el-icon-upload"></i>
  104. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  105. <div class="el-upload__tip" slot="tip">
  106. 如上传文件过大,请耐心等待上传成功
  107. </div>
  108. </el-upload>
  109. </el-dialog>
  110. <el-dialog title="修改附件" append-to-body :visible.sync="excelTwo" width="555px" :close-on-click-modal="false"
  111. v-dialog-drag>
  112. <el-upload class="upload-demo" drag style="text-align: center"
  113. :action="incomingAction ? incomingAction : action" :headers="headers" :show-file-list="false"
  114. :on-success="onSuccessTwo" :before-upload="beforeUpload">
  115. <i class="el-icon-upload"></i>
  116. <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
  117. <div class="el-upload__tip" slot="tip">
  118. 如上传文件过大,请耐心等待上传成功
  119. </div>
  120. </el-upload>
  121. </el-dialog>
  122. <!--之前的查看图片弹窗-->
  123. <!--<el-dialog-->
  124. <!-- width="80%"-->
  125. <!-- title="附件"-->
  126. <!-- :visible.sync="innerVisible"-->
  127. <!-- :close-on-click-modal="false"-->
  128. <!-- append-to-body-->
  129. <!--&gt;-->
  130. <!-- <div style="width: 50%;height: 50%;margin: 0 auto">-->
  131. <!-- <img :src="imgUrl" alt="" style="width: 100%;height: 100%;" />-->
  132. <!-- </div>-->
  133. <!--</el-dialog>-->
  134. <!-- 新的查看图片弹窗-->
  135. <PreviewImage :visible.sync="innerVisible" :currentIndex="0" :previewImgList="[imgUrl]" />
  136. </span>
  137. </div>
  138. </template>
  139. <script>
  140. import { getToken } from "@/util/auth";
  141. import { LTfujianDelete, sharedDeletion } from "@/api/user";
  142. import option from "@/views/exportTrade/customerInquiry/config/mainList.json";
  143. import { gainUser } from "@/api/basicData/customerInquiry";
  144. import { updateListRemove, submitList } from "@/api/uploadFile/upload-file";
  145. import { deleteImg } from "../../api/basicData/EquipmentArchives";
  146. import PreviewImage from '@/components/PreviewImage/index.vue'
  147. export default {
  148. name: "index",
  149. components: { PreviewImage },
  150. props: {
  151. data: {
  152. type: Object
  153. },
  154. incomingAction: {
  155. type: String
  156. },
  157. deleteUrl: {
  158. type: String
  159. },
  160. enumerationValue: {
  161. type: Number
  162. },
  163. typeUpload: {
  164. type: String
  165. },
  166. disabled: {
  167. type: Boolean
  168. },
  169. display: {
  170. type: Boolean
  171. },
  172. basic: {
  173. type: Boolean
  174. },
  175. actionUrl: {
  176. type: String
  177. },
  178. maxNum: {
  179. type: Number
  180. },
  181. linkKey: {
  182. type: String,
  183. default: 'link'
  184. },
  185. saveBtn: {
  186. type: Boolean,
  187. default: false
  188. },
  189. pId: {
  190. type: String,
  191. default: null
  192. },
  193. },
  194. data() {
  195. return {
  196. excelBox: false,
  197. excelTwo: false,
  198. innerVisible: false,
  199. form: {},
  200. imgUrl: "",
  201. action: this.actionUrl ? this.actionUrl : "/api/blade-resource/oss/endpoint/put-file",
  202. headers: { "Blade-Auth": "Bearer " + getToken() },
  203. option: {},
  204. key: 0,
  205. originalOptions: {
  206. dialogDrag: true,
  207. index: true,
  208. refreshBtn: false,
  209. cellBtn: false,
  210. cancelBtn: false,
  211. delBtn: false,
  212. editBtn: false,
  213. addBtn: false,
  214. align: "center",
  215. column: [
  216. {
  217. label: "文件名称",
  218. prop: "fileName",
  219. index: 1,
  220. width: 140,
  221. cell: true,
  222. overHidden: true
  223. },
  224. {
  225. label: "文件地址",
  226. prop: "url",
  227. index: 2,
  228. overHidden: true
  229. },
  230. // {
  231. // type: "select",
  232. // dicUrl: "/api/blade-system/dict-biz/dictionary?code=file_type",
  233. // props: {
  234. // label: "dictValue",
  235. // value: "dictValue"
  236. // },
  237. // label: "文件属性",
  238. // prop: "paymentType",
  239. // search: false,
  240. // index: 3,
  241. // width: 140,
  242. // overHidden: true,
  243. // cell: true
  244. // },
  245. {
  246. label: "备注",
  247. prop: "remarks",
  248. index: 4,
  249. cell: true,
  250. overHidden: true
  251. }
  252. ]
  253. },
  254. originalOptionsTwo: {
  255. dialogDrag: true,
  256. index: true,
  257. refreshBtn: false,
  258. cellBtn: false,
  259. cancelBtn: false,
  260. delBtn: false,
  261. editBtn: false,
  262. addBtn: false,
  263. align: "center",
  264. column: [
  265. {
  266. label: "文件名称",
  267. prop: "fileName",
  268. index: 1,
  269. width: 140,
  270. cell: true,
  271. overHidden: true
  272. },
  273. {
  274. label: "文件地址",
  275. prop: "url",
  276. index: 2,
  277. overHidden: true
  278. }, {
  279. type: "select",
  280. dicUrl: "/api/blade-system/dict-biz/dictionary?code=picture_type",
  281. props: {
  282. label: "dictValue",
  283. value: "dictKey"
  284. },
  285. label: "文件属性",
  286. prop: "version",
  287. search: false,
  288. index: 3,
  289. width: 140,
  290. overHidden: true,
  291. cell: true,
  292. },
  293. {
  294. label: "备注",
  295. prop: "remarks",
  296. index: 4,
  297. cell: true,
  298. overHidden: true
  299. }
  300. ]
  301. },
  302. // 基础信息轮胎附件
  303. originalOptionsTwo_LT: {
  304. dialogDrag: true,
  305. index: true,
  306. refreshBtn: false,
  307. cellBtn: false,
  308. cancelBtn: false,
  309. delBtn: false,
  310. editBtn: false,
  311. addBtn: false,
  312. align: "center",
  313. column: [
  314. {
  315. label: "文件名称",
  316. prop: "fileName",
  317. index: 1,
  318. width: 140,
  319. cell: true,
  320. overHidden: true
  321. },
  322. {
  323. label: "文件地址",
  324. prop: "url",
  325. index: 2,
  326. overHidden: true
  327. }, {
  328. type: "select",
  329. dicUrl: "/api/blade-system/dict-biz/dictionary?code=picture_type",
  330. props: {
  331. label: "dictValue",
  332. value: "dictKey"
  333. },
  334. label: "文件属性",
  335. prop: "mainImage",
  336. search: false,
  337. index: 3,
  338. width: 140,
  339. overHidden: true,
  340. cell: true,
  341. },
  342. {
  343. label: "备注",
  344. prop: "remarks",
  345. index: 4,
  346. cell: true,
  347. overHidden: true
  348. }
  349. ]
  350. },
  351. originalOptionsThree: {
  352. dialogDrag: true,
  353. index: true,
  354. refreshBtn: false,
  355. cellBtn: false,
  356. cancelBtn: false,
  357. delBtn: false,
  358. editBtn: false,
  359. addBtn: false,
  360. align: "center",
  361. column: [
  362. {
  363. label: "文件名称",
  364. prop: "fileName",
  365. index: 1,
  366. width: 140,
  367. cell: true,
  368. overHidden: true
  369. },
  370. {
  371. label: "文件地址",
  372. prop: "url",
  373. index: 2,
  374. overHidden: true
  375. },
  376. {
  377. label: "备注",
  378. prop: "remarks",
  379. index: 4,
  380. cell: true,
  381. overHidden: true
  382. }
  383. ]
  384. },
  385. originalOptionsThree_HW: {
  386. dialogDrag: true,
  387. index: true,
  388. refreshBtn: false,
  389. cellBtn: false,
  390. cancelBtn: false,
  391. delBtn: false,
  392. editBtn: false,
  393. addBtn: false,
  394. align: "center",
  395. column: [
  396. {
  397. label: "名称",
  398. prop: "figure",
  399. index: 1,
  400. cell: true,
  401. overHidden: true
  402. },
  403. {
  404. label: "文件名称",
  405. prop: "fileName",
  406. index: 1,
  407. width: 140,
  408. cell: true,
  409. overHidden: true
  410. },
  411. {
  412. label: "文件地址",
  413. prop: "url",
  414. index: 2,
  415. overHidden: true
  416. },
  417. {
  418. label: "备注",
  419. prop: "remarks",
  420. index: 4,
  421. cell: true,
  422. overHidden: true
  423. }
  424. ]
  425. },
  426. uploadCount: 0
  427. };
  428. },
  429. async created() {
  430. /**
  431. * 已定义全局方法,直接使用,getColumnData获取列数据,参数传值(表格名称,引入的本地JSON的数据定义的名称)
  432. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  433. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  434. */
  435. console.log(this.enumerationValue)
  436. if (this.enumerationValue === 160) {
  437. this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo);
  438. } else if (this.enumerationValue === 107.1) {
  439. this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo);
  440. } else if (this.enumerationValue > 230 && this.enumerationValue != 338) {
  441. this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo);
  442. } else if (this.enumerationValue === 35.1) {
  443. this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree);
  444. } else if (this.enumerationValue === 160.1) {
  445. this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo_LT);
  446. } else if (this.enumerationValue === 338) {
  447. this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree_HW);
  448. } else {
  449. this.option = await this.getColumnData(this.getColumnName(this.enumerationValue), this.originalOptions);
  450. this.getWorkDicts("picture_type").then(res => {
  451. if (this.findObject(this.option.column, "version").dicData) {
  452. this.findObject(this.option.column, "version").dicData = res.data.data;
  453. }
  454. });
  455. }
  456. this.key++
  457. },
  458. methods: {
  459. //自定义列保存
  460. async saveColumn() {
  461. /**
  462. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  463. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  464. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  465. */
  466. const inSave = await this.saveColumnData(this.getColumnName(this.enumerationValue), this.option);
  467. if (inSave) {
  468. this.$message.success("保存成功");
  469. //关闭窗口
  470. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  471. }
  472. },
  473. //自定义列重置
  474. async resetColumn() {
  475. if (this.enumerationValue === 160) {
  476. this.option = this.originalOptionsTwo;
  477. const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo);
  478. if (inSave) {
  479. this.$message.success("重置成功");
  480. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  481. }
  482. } else if (this.enumerationValue === 107.1) {
  483. this.option = this.originalOptionsTwo;
  484. const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo);
  485. if (inSave) {
  486. this.$message.success("重置成功");
  487. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  488. }
  489. } else if (this.enumerationValue > 230 && this.enumerationValue != 338) {
  490. this.option = this.originalOptionsTwo;
  491. const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo);
  492. if (inSave) {
  493. this.$message.success("重置成功");
  494. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  495. }
  496. } else if (this.enumerationValue === 35.1) {
  497. this.option = this.originalOptionsThree;
  498. const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree);
  499. if (inSave) {
  500. this.$message.success("重置成功");
  501. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  502. }
  503. } else if (this.enumerationValue === 160.1) {
  504. this.option = this.originalOptionsTwo_LT;
  505. const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsTwo_LT);
  506. if (inSave) {
  507. this.$message.success("重置成功");
  508. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  509. }
  510. } else if (this.enumerationValue === 338) {
  511. this.option = this.originalOptionsThree_HW;
  512. const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptionsThree_HW);
  513. if (inSave) {
  514. this.$message.success("重置成功");
  515. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  516. }
  517. } else {
  518. this.option = this.originalOptions;
  519. const inSave = await this.delColumnData(this.getColumnName(this.enumerationValue), this.originalOptions);
  520. if (inSave) {
  521. this.$message.success("重置成功");
  522. this.getWorkDicts("picture_type").then(res => {
  523. this.findObject(this.option.column, "version").dicData = res.data.data;
  524. });
  525. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  526. }
  527. }
  528. },
  529. submit() {
  530. if (this.data.length == 0) {
  531. return this.$message.error("请添加数据");
  532. }
  533. const loading = this.$loading({
  534. lock: true,
  535. text: '加载中',
  536. spinner: 'el-icon-loading',
  537. background: 'rgba(255,255,255,0.7)'
  538. });
  539. submitList(this.data).then(res => {
  540. this.$emit('upDate', res.data.data)
  541. }).finally(() => {
  542. loading.close();
  543. })
  544. },
  545. beforeUpload(file) {
  546. if (file.type == "image/jpeg" || file.type == "image/png" || file.type == "image/bmp") {
  547. const fileSize = file.size / 1024 / 1024
  548. if (fileSize > 5) {
  549. this.$message.error("请上传不能超过5M的图片");
  550. return false;
  551. }
  552. } else {
  553. const fileSize = file.size / 1024 / 1024
  554. if (fileSize > 10) {
  555. this.$message.error("请上传不能超过10M的文件");
  556. return false;
  557. }
  558. }
  559. },
  560. //新增上传成功
  561. onSuccess(response, file, fileList) {
  562. this.$refs.crud.rowCellAdd({
  563. pid: this.pId ? this.pId : null,
  564. fileName: response.data.originalName,
  565. url: response.data[this.linkKey]
  566. });
  567. this.uploadCount++;
  568. if (this.uploadCount === fileList.length) {
  569. this.$refs.upload.clearFiles();
  570. this.excelBox = false;
  571. this.uploadCount = 0;
  572. }
  573. },
  574. //修改上传成功
  575. onSuccessTwo(response) {
  576. this.form.fileName = response.data.originalName;
  577. this.form.url = response.data[this.linkKey];
  578. this.data[this.form.$index] = this.form;
  579. this.excelTwo = false;
  580. },
  581. //单行上传
  582. singleLineUpload(row) {
  583. this.form = row;
  584. this.excelTwo = true;
  585. },
  586. //开启批量上传
  587. addDetail() {
  588. if (this.saveBtn) {
  589. if (!this.pId) {
  590. return this.$message.error("请保存主表数据");
  591. }
  592. }
  593. if (this.maxNum > 0 && this.data.length == this.maxNum) {
  594. return this.$message.error("最多上传" + this.maxNum + "个文件");
  595. }
  596. this.excelBox = true;
  597. },
  598. //下载附件
  599. download(scope) {
  600. if (scope.row.url) {
  601. if (
  602. scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
  603. ".jpg" ||
  604. scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
  605. ".png" ||
  606. scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
  607. ".jpeg" ||
  608. scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
  609. ".JPG" ||
  610. scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
  611. ".PNG" ||
  612. scope.row.url.substring(scope.row.url.lastIndexOf(".")) ===
  613. ".JPEG"
  614. ) {
  615. this.imgUrl = scope.row.url;
  616. this.innerVisible = true;
  617. } else {
  618. window.open(scope.row.url);
  619. }
  620. } else {
  621. this.$message.error("请上传附件");
  622. }
  623. },
  624. //修改触发
  625. rowCell(row, index) {
  626. if (row.$cellEdit == true) {
  627. this.$set(row, "$cellEdit", false);
  628. } else {
  629. this.$set(row, "$cellEdit", true);
  630. }
  631. // this.$refs.crud.rowCell(row, index)
  632. },
  633. rowDel(row, index) {
  634. this.$confirm("确定将选择数据删除?", {
  635. confirmButtonText: "确定",
  636. cancelButtonText: "取消",
  637. type: "warning"
  638. }).then(() => {
  639. console.log(row, 657)
  640. if (row.id) {
  641. if (this.typeUpload == "CK") {
  642. updateListRemove(row.id, this.deleteUrl).then(res => {
  643. if (res.data.success) {
  644. this.$message.success("操作成功!");
  645. this.data.splice(index, 1);
  646. }
  647. });
  648. } else if (this.typeUpload == "LT") {
  649. LTfujianDelete({ ids: row.id }).then(res => {
  650. if (res.data.success) {
  651. this.$message.success("操作成功!");
  652. this.data.splice(index, 1);
  653. }
  654. })
  655. } else if (this.typeUpload == "SBDAFJ") {
  656. deleteImg({ ids: row.id }).then(res => {
  657. if (res.data.success) {
  658. this.$message.success("操作成功!");
  659. this.data.splice(index, 1);
  660. }
  661. })
  662. } else {
  663. sharedDeletion(this.deleteUrl, row.id).then(res => {
  664. if (res.data.success) {
  665. this.$message.success("操作成功!");
  666. this.data.splice(index, 1);
  667. }
  668. });
  669. }
  670. } else {
  671. this.data.splice(index, 1);
  672. }
  673. });
  674. }
  675. }
  676. };
  677. </script>
  678. <style lang="scss" scoped>
  679. ::v-deep .el-table .cell {
  680. height: 33px;
  681. }
  682. </style>