screenShot.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203
  1. <template>
  2. <div class="content-box">
  3. <div class="left">
  4. <!-- <el-icon :size="23" class="camera"><VideoCameraFilled /></el-icon> -->
  5. <span class="cameratxt">截屏风险</span>
  6. </div>
  7. <div class="middle">
  8. <div class="filter">
  9. <el-tabs
  10. v-model="activeName"
  11. class="demo-tabs"
  12. @tab-change="handleClick"
  13. >
  14. <el-tab-pane label="规则" name="1">
  15. <div class="footer">
  16. <el-table
  17. :row-class-name="tableRowClassName"
  18. :data="ruleData.list"
  19. @selection-change="handleSelectionChange"
  20. style="width: 100%"
  21. :header-cell-style="{
  22. background: 'rgba(240, 243, 247, 1)',
  23. height: '50px',
  24. border: 0,
  25. }"
  26. >
  27. <el-table-column
  28. width="250"
  29. align="center "
  30. prop="screenshotNum"
  31. label="近一年截屏次数"
  32. />
  33. <el-table-column
  34. align="center"
  35. prop="triggers"
  36. label="触发惩罚"
  37. >
  38. <template #default="scope">
  39. <div class="triggers" v-if="scope.row.triggers == 0">
  40. 身份码提醒
  41. </div>
  42. <div class="triggers" v-if="scope.row.triggers == 1">
  43. 冻结1小时
  44. </div>
  45. <div class="triggers" v-if="scope.row.triggers == 2">
  46. 冻结2小时
  47. </div>
  48. <div class="triggers" v-if="scope.row.triggers == 3">
  49. 冻结4小时
  50. </div>
  51. <div class="triggers" v-if="scope.row.triggers == 4">
  52. 冻结8小时
  53. </div>
  54. <div class="triggers" v-if="scope.row.triggers == 5">
  55. 冻结1天
  56. </div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column align="center" label="操作" width="200">
  60. <template #default="scope">
  61. <div class="del" @click="editClick(scope.row)">编辑</div>
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. </div>
  66. <div class="pageSize">
  67. <span></span>
  68. <el-pagination
  69. background
  70. :current-page="currentPageRule"
  71. :page-size="pageSizeRule"
  72. layout="total, prev, pager, next, jumper, slot"
  73. :total="totalRule"
  74. @update:current-page="handleCurrentChangeRule"
  75. />
  76. </div>
  77. </el-tab-pane>
  78. <el-tab-pane label="截屏记录" name="2">
  79. <div class="footer">
  80. <el-table
  81. :row-class-name="tableRowClassName"
  82. :data="recordData.list"
  83. style="width: 100%"
  84. :header-cell-style="{
  85. background: 'rgba(240, 243, 247, 1)',
  86. height: '50px',
  87. border: 0,
  88. }"
  89. >
  90. <el-table-column
  91. width="150"
  92. align="center "
  93. type="index"
  94. label="序号"
  95. />
  96. <el-table-column
  97. width="250"
  98. align="center "
  99. prop="cardNo"
  100. label="用户编号"
  101. />
  102. <el-table-column
  103. align="center"
  104. prop="userName"
  105. label="用户姓名"
  106. />
  107. <el-table-column
  108. align="center"
  109. prop="createTime"
  110. label="创建时间"
  111. />
  112. <el-table-column align="center" label="操作" width="200">
  113. <template #default="scope">
  114. <div
  115. v-if="scope.row.isShow == 1"
  116. class="del"
  117. @click="freezeClick(scope.row)"
  118. >
  119. 冻结
  120. </div>
  121. </template>
  122. </el-table-column>
  123. </el-table>
  124. </div>
  125. <div class="pageSize">
  126. <span></span>
  127. <el-pagination
  128. background
  129. :current-page="currentPageRecord"
  130. :page-size="pageSizeRecord"
  131. layout="total, prev, pager, next, jumper, slot"
  132. :total="totalRecord"
  133. @update:current-page="handleCurrentChangeRecord"
  134. />
  135. </div>
  136. </el-tab-pane>
  137. <el-tab-pane class="freezeList" label="已冻结名单" name="3">
  138. <div class="searchInp">
  139. <div class="sel">
  140. <el-input
  141. :clearable="true"
  142. @clear="searchBtn"
  143. v-model="freezeListSel"
  144. placeholder="请输入关键字"
  145. >
  146. <template #prefix>
  147. <el-icon class="el-input__icon"><search /></el-icon>
  148. </template>
  149. </el-input>
  150. <el-button
  151. color="rgba(0, 97, 255, 1)"
  152. type="primary"
  153. class="search"
  154. @click="searchBtn"
  155. >
  156. 查询</el-button
  157. >
  158. </div>
  159. <el-button
  160. type="primary"
  161. color="rgba(0, 97, 255, 1)"
  162. plain
  163. @click="importExcel"
  164. ><span>导出</span></el-button
  165. >
  166. </div>
  167. <div class="footers">
  168. <el-table
  169. :row-class-name="tableRowClassName"
  170. :data="freezeListData.list"
  171. style="width: 100%"
  172. :header-cell-style="{
  173. background: 'rgba(240, 243, 247, 1)',
  174. height: '50px',
  175. border: 0,
  176. }"
  177. >
  178. <el-table-column
  179. width="150"
  180. align="center "
  181. type="index"
  182. label="序号"
  183. />
  184. <el-table-column
  185. width="250"
  186. align="center "
  187. prop="cardNo"
  188. label="编号"
  189. />
  190. <el-table-column
  191. align="center"
  192. prop="userName"
  193. label="用户姓名"
  194. />
  195. <el-table-column align="center" prop="typeStr" label="冻结方式">
  196. <template #default="scope">
  197. <span v-if="scope.row.typeStr == 0">永久冻结</span>
  198. <span v-if="scope.row.typeStr == 1">指定时间</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column align="center" label="操作" width="200">
  202. <template #default="scope">
  203. <div class="defrost">
  204. <el-popconfirm
  205. width="220"
  206. confirm-button-text="确认"
  207. cancel-button-text="取消"
  208. :icon="InfoFilled"
  209. icon-color="#f89626"
  210. title="是否解冻此用户?"
  211. @confirm="defrost(scope.row)"
  212. >
  213. <template #reference>
  214. <div class="del">解冻</div>
  215. </template>
  216. </el-popconfirm>
  217. </div>
  218. </template>
  219. </el-table-column>
  220. </el-table>
  221. </div>
  222. <div class="pageSize">
  223. <span></span>
  224. <el-pagination
  225. background
  226. :current-page="currentPageFreezeList"
  227. :page-size="pageSizeFreezeList"
  228. layout="total, prev, pager, next, jumper, slot"
  229. :total="totalFreezeList"
  230. @update:current-page="handleCurrentChangeFreezeList"
  231. />
  232. </div>
  233. </el-tab-pane>
  234. </el-tabs>
  235. </div>
  236. </div>
  237. <!--规则 编辑按钮 -->
  238. <el-dialog
  239. class="editDialog"
  240. v-model="editVisible"
  241. :close-on-click-modal="false"
  242. :close-on-press-escape="false"
  243. title="编辑"
  244. align-center
  245. width="500"
  246. :before-close="cancelEdit"
  247. >
  248. <el-form
  249. ref="editRuleRef"
  250. :model="editRuleForm"
  251. :rules="editRules"
  252. label-width="90px"
  253. class="demo-ruleForm"
  254. :size="formSize"
  255. label-position="left"
  256. status-icon
  257. >
  258. <el-form-item label="截屏次数 :" prop="screenshotNum">
  259. <span
  260. >近一年截屏次数到达
  261. <el-input
  262. v-model="editRuleForm.screenshotNum"
  263. placeholder="请输入截屏次数"
  264. clearable
  265. style="width: 150px"
  266. />
  267. 次</span
  268. >
  269. </el-form-item>
  270. <el-form-item label="触发惩罚 :" prop="trigger">
  271. <el-select
  272. v-model="editRuleForm.trigger"
  273. class="m-2"
  274. placeholder="请选择触发惩罚"
  275. style="width: 300px"
  276. >
  277. <el-option v-for="i in ruleList" :label="i.name" :value="i.id" />
  278. </el-select>
  279. </el-form-item>
  280. </el-form>
  281. <div class="options">
  282. <el-button
  283. color="rgba(41, 109, 227, 1)"
  284. class="queding"
  285. type="primary"
  286. @click="confirmEdit(editRuleRef)"
  287. >
  288. 确认
  289. </el-button>
  290. <el-button @click="cancelEdit(editRuleRef)">取消</el-button>
  291. </div>
  292. </el-dialog>
  293. <!--截屏记录 冻结按钮 -->
  294. <el-dialog
  295. class="freezeDialog"
  296. v-model="freezeVisible"
  297. :close-on-click-modal="false"
  298. :close-on-press-escape="false"
  299. title="编辑"
  300. align-center
  301. width="500"
  302. :before-close="cancelFreeze"
  303. >
  304. <el-form
  305. ref="freezeRef"
  306. :model="freezeRuleForm"
  307. :rules="freezeRules"
  308. label-width="90px"
  309. class="demo-ruleForm"
  310. :size="formSize"
  311. label-position="left"
  312. status-icon
  313. >
  314. <el-form-item label="冻结方式 :" prop="type">
  315. <el-radio-group v-model="freezeRuleForm.type">
  316. <el-radio :label="0">永久冻结</el-radio>
  317. <el-radio :label="1">指定时间</el-radio>
  318. </el-radio-group>
  319. </el-form-item>
  320. <el-form-item
  321. label="截止时间 :"
  322. :prop="freezeRuleForm.type == 0 ? '' : 'time'"
  323. >
  324. <el-date-picker
  325. v-model="freezeRuleForm.time"
  326. type="date"
  327. format="YYYY-MM-DD"
  328. value-format="YYYY-MM-DD"
  329. :prefix-icon="Calendar"
  330. placeholder="请选择日期"
  331. @change="changeTime"
  332. />
  333. </el-form-item>
  334. <el-form-item label="冻结原因 :" prop="reason">
  335. <el-input
  336. v-model="freezeRuleForm.reason"
  337. :rows="4"
  338. show-word-limit
  339. maxlength="100"
  340. type="textarea"
  341. placeholder="请输入冻结原因"
  342. />
  343. </el-form-item>
  344. <el-form-item class="options">
  345. <el-button
  346. color="rgba(41, 109, 227, 1)"
  347. class="queding"
  348. type="primary"
  349. @click="confirmFreeze(freezeRef)"
  350. >
  351. 确认
  352. </el-button>
  353. <el-button @click="cancelFreeze(freezeRef)">取消</el-button>
  354. </el-form-item>
  355. </el-form>
  356. </el-dialog>
  357. </div>
  358. </template>
  359. <script setup>
  360. import {
  361. ref,
  362. reactive,
  363. watch,
  364. nextTick,
  365. onBeforeMount,
  366. onUnmounted,
  367. } from "vue";
  368. import { useRouter } from "vue-router";
  369. import { ElMessage, ElMessageBox } from "element-plus";
  370. import { Calendar } from "@element-plus/icons-vue";
  371. import vidiconsApi from "@/api/vidicons.js";
  372. import { dayjs } from "element-plus";
  373. import lodash from "lodash";
  374. import axios from "axios";
  375. import { useStore } from "vuex";
  376. const store = useStore();
  377. const api = ref("");
  378. const router = useRouter();
  379. // 头部切换按钮
  380. const activeName = ref("1");
  381. // 规则表格数据 (-------------------------------------------------------------)
  382. const loading = ref(false);
  383. const ruleData = reactive({
  384. list: [],
  385. });
  386. const currentPageRule = ref(1); // 当前页
  387. const pageSizeRule = ref(10);
  388. const totalRule = ref(15); // 当前总数
  389. const ruleList = ref(); // 规则列表
  390. // 编辑规则功能
  391. const editVisible = ref(false);
  392. const editRuleRef = ref();
  393. const editRuleForm = reactive({
  394. trigger: "", // 选择触发惩罚
  395. screenshotNum: "", // 次数
  396. id: "",
  397. });
  398. const editRules = reactive({
  399. trigger: [{ required: true, message: "触发惩罚不能为空", trigger: "blur" }],
  400. screenshotNum: [
  401. {
  402. required: true,
  403. message: "截屏次数不能为空",
  404. trigger: "blur",
  405. },
  406. ],
  407. });
  408. // 截屏记录表格数据 (-------------------------------------------------------------)
  409. const recordData = reactive({
  410. list: [],
  411. });
  412. const currentPageRecord = ref(1); // 当前页
  413. const pageSizeRecord = ref(10);
  414. const totalRecord = ref(15); // 当前总数
  415. // 冻结功能
  416. const freezeVisible = ref(false);
  417. const freezeRef = ref();
  418. const freezeRuleForm = reactive({
  419. type: 1,
  420. time: "",
  421. reason: "",
  422. userId: "",
  423. });
  424. // 表单验证
  425. const freezeRules = reactive({
  426. type: [{ required: true, message: "冻结方式不能为空", trigger: "blur" }],
  427. time: [
  428. {
  429. required: true,
  430. message: "截止时间不能为空",
  431. trigger: "blur",
  432. },
  433. ],
  434. // reason: [
  435. // {
  436. // required: true,
  437. // message: "冻结原因不能为空",
  438. // trigger: "blur",
  439. // },
  440. // ],
  441. });
  442. // 已冻结名单 (----------------------------------------------------------)
  443. const freezeListSel = ref();
  444. const freezeListData = reactive({
  445. list: [],
  446. });
  447. const currentPageFreezeList = ref(1); // 当前页
  448. const pageSizeFreezeList = ref(9);
  449. const totalFreezeList = ref(5); // 当前总数
  450. // 查看列表
  451. const getList = async () => {
  452. if (activeName.value == 1) {
  453. let data = {
  454. currentPage: currentPageRule.value,
  455. pageCount: pageSizeRule.value,
  456. };
  457. let res = await axios({
  458. method: "get",
  459. url: api.value + "/wanzai/api/smartScreenshot/queryPageSmartScreenshot",
  460. headers: {
  461. // token: sessionStorage.getItem("token"),
  462. // user_head: sessionStorage.getItem("userhead"),
  463. },
  464. params: data,
  465. });
  466. console.log(res, "规则");
  467. if (res.data.code == 200) {
  468. loading.value = false;
  469. ruleData.list = res.data.data.list;
  470. totalRule.value = res.data.data.totalCount;
  471. // ElMessage({
  472. // type: "success",
  473. // showClose: true,
  474. // message: res.data.message,
  475. // center: true,
  476. // });
  477. } else {
  478. loading.value = false;
  479. ElMessage({
  480. type: "error",
  481. showClose: true,
  482. message: res.data.message,
  483. center: true,
  484. });
  485. }
  486. } else if (activeName.value == 2) {
  487. let data = {
  488. currentPage: currentPageRecord.value,
  489. pageCount: pageSizeRecord.value,
  490. };
  491. let res = await axios({
  492. method: "get",
  493. url:
  494. api.value +
  495. "/wanzai/api/smartScreenshotRecord/queryScreenshotRecordPage",
  496. headers: {
  497. // token: sessionStorage.getItem("token"),
  498. // user_head: sessionStorage.getItem("userhead"),
  499. },
  500. params: data,
  501. });
  502. console.log(res, "截屏记录分页");
  503. if (res.data.code == 200) {
  504. recordData.list = res.data.data.list;
  505. totalRecord.value = res.data.data.totalCount;
  506. // ElMessage({
  507. // type: "success",
  508. // showClose: true,
  509. // message: res.data.message,
  510. // center: true,
  511. // });
  512. } else {
  513. loading.value = false;
  514. ElMessage({
  515. type: "error",
  516. showClose: true,
  517. message: res.data.message,
  518. center: true,
  519. });
  520. }
  521. } else if (activeName.value == 3) {
  522. let data = {
  523. currentPage: currentPageFreezeList.value,
  524. pageCount: pageSizeFreezeList.value,
  525. };
  526. let res = await axios({
  527. method: "get",
  528. url: api.value + "/wanzai/api/smartFreezeRecord/queryPageFreezeRecord",
  529. headers: {
  530. // token: sessionStorage.getItem("token"),
  531. // user_head: sessionStorage.getItem("userhead"),
  532. },
  533. params: data,
  534. });
  535. console.log(res, "已冻结名单分页");
  536. if (res.data.code == 200) {
  537. freezeListData.list = res.data.data.list;
  538. totalFreezeList.value = res.data.data.totalCount;
  539. // ElMessage({
  540. // type: "success",
  541. // showClose: true,
  542. // message: res.data.message,
  543. // center: true,
  544. // });
  545. } else {
  546. loading.value = false;
  547. ElMessage({
  548. type: "error",
  549. showClose: true,
  550. message: res.data.message,
  551. center: true,
  552. });
  553. }
  554. }
  555. };
  556. // 头部切换功能
  557. const handleClick = (name) => {
  558. console.log(name);
  559. getList();
  560. };
  561. // 规则页面 (----------------------------------------------------)
  562. const handleCurrentChangeRule = (value) => {
  563. currentPageRule.value = value;
  564. };
  565. //编辑按钮
  566. const editClick = async (row) => {
  567. editVisible.value = true;
  568. editRuleForm.screenshotNum = row.screenshotNum;
  569. editRuleForm.trigger = row.triggers;
  570. editRuleForm.id = row.id;
  571. };
  572. // 确定编辑
  573. const confirmEdit = (formEl) => {
  574. if (!formEl) return;
  575. formEl.validate(async (valid, fields) => {
  576. if (valid) {
  577. let data = {
  578. screenshotNum: editRuleForm.screenshotNum,
  579. trigger: editRuleForm.trigger,
  580. id: editRuleForm.id,
  581. };
  582. let res = await axios({
  583. method: "post",
  584. url:
  585. api.value + "/wanzai/api/smartScreenshot/updateSmartScreenshotById",
  586. headers: {
  587. // token: sessionStorage.getItem("token"),
  588. // user_head: sessionStorage.getItem("userhead"),
  589. },
  590. data: data,
  591. });
  592. console.log(res, "规则");
  593. if (res.data.code == 200) {
  594. editVisible.value = false;
  595. getList();
  596. ElMessage({
  597. type: "success",
  598. showClose: true,
  599. message: res.data.message,
  600. center: true,
  601. });
  602. } else {
  603. ElMessage({
  604. type: "error",
  605. showClose: true,
  606. message: res.data.message,
  607. center: true,
  608. });
  609. }
  610. }
  611. });
  612. };
  613. const cancelEdit = () => {
  614. editVisible.value = false;
  615. editRuleRef.value.resetFields();
  616. editRuleForm.trigger = "";
  617. editRuleForm.screenshotNum = "";
  618. editRuleForm.id = "";
  619. };
  620. const getRules = async () => {
  621. let res = await axios({
  622. method: "get",
  623. url: api.value + "/wanzai/api/smartScreenshot/queryPunishs",
  624. headers: {
  625. // token: sessionStorage.getItem("token"),
  626. // user_head: sessionStorage.getItem("userhead"),
  627. },
  628. });
  629. console.log(res, "规则列表");
  630. if (res.data.code == 200) {
  631. ruleList.value = res.data.data;
  632. } else {
  633. loading.value = false;
  634. ElMessage({
  635. type: "error",
  636. showClose: true,
  637. message: res.data.message,
  638. center: true,
  639. });
  640. }
  641. };
  642. // 截屏记录页面 (----------------------------------------------------)
  643. const handleCurrentChangeRecord = (value) => {
  644. currentPageRecord.value = value;
  645. };
  646. // 改变时间
  647. const changeTime = (value) => {
  648. console.log(value);
  649. let nowTime = dayjs().format("YYYY-MM-DD");
  650. if (dayjs(value).isAfter(nowTime)) {
  651. } else {
  652. freezeRuleForm.time = "";
  653. ElMessage({
  654. type: "warning",
  655. showClose: true,
  656. message: "截止时间应大于当前时间",
  657. center: true,
  658. });
  659. }
  660. };
  661. //冻结按钮
  662. const freezeClick = async (row) => {
  663. freezeVisible.value = true;
  664. freezeRuleForm.userId = row.userId;
  665. freezeRuleForm.type = "";
  666. freezeRuleForm.time = "";
  667. freezeRuleForm.reason = "";
  668. };
  669. // 确定冻结
  670. const confirmFreeze = (formEl) => {
  671. if (!formEl) return;
  672. formEl.validate(async (valid, fields) => {
  673. if (valid) {
  674. let data = {
  675. userId: freezeRuleForm.userId,
  676. type: freezeRuleForm.type,
  677. deadline: freezeRuleForm.time,
  678. reason: freezeRuleForm.reason,
  679. };
  680. let res = await axios({
  681. method: "post",
  682. url: api.value + "/wanzai/api/smartFreezeRecord/manualFreezing",
  683. headers: {
  684. // token: sessionStorage.getItem("token"),
  685. // user_head: sessionStorage.getItem("userhead"),
  686. },
  687. data: data,
  688. });
  689. console.log(res, "冻结");
  690. if (res.data.code == 200) {
  691. editVisible.value = false;
  692. getList();
  693. ElMessage({
  694. type: "success",
  695. showClose: true,
  696. message: res.data.message,
  697. center: true,
  698. });
  699. } else {
  700. ElMessage({
  701. type: "error",
  702. showClose: true,
  703. message: res.data.message,
  704. center: true,
  705. });
  706. }
  707. }
  708. });
  709. };
  710. const cancelFreeze = () => {
  711. freezeVisible.value = false;
  712. freezeRef.value.resetFields();
  713. freezeRuleForm.userId = "";
  714. freezeRuleForm.type = "";
  715. freezeRuleForm.time = "";
  716. freezeRuleForm.reason = "";
  717. };
  718. //已冻结名单(-------------------------------------------------------------------)
  719. // 分页
  720. const handleCurrentChangeFreezeList = (value) => {
  721. currentPageFreezeList.value = value;
  722. };
  723. // 搜索功能
  724. const searchBtn = lodash.debounce(async () => {}, 300);
  725. //导出功能
  726. const importExcel = async () => {
  727. // if (searchInput.createTime == null) {
  728. // searchInput.createTime = "";
  729. // }
  730. // let data = new FormData();
  731. // data.set("car_number", searchInput.carnumber);
  732. // data.set("create_time", searchInput.createTime);
  733. // let res = await axios({
  734. // method: "post",
  735. // url: api.value + "/carBook/cinfotoExcel.action",
  736. // headers: {
  737. // token: sessionStorage.getItem("token"),
  738. // },
  739. // data: data,
  740. // });
  741. // // console.log(res, "导出账号");
  742. // if (res.data.code == 200) {
  743. // // const elt = document.createElement("a");
  744. // // elt.setAttribute(
  745. // // "href",
  746. // // "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl
  747. // // );
  748. // // elt.setAttribute("download", "file.png");
  749. // // elt.style.display = "none";
  750. // // document.body.appendChild(elt);
  751. // // elt.click();
  752. // var downloadPath = "https://chtech.ncjti.edu.cn/carstop" + res.data.downurl;
  753. // console.log("获得地址数据:", downloadPath);
  754. // var downloadLink = document.createElement("a");
  755. // downloadLink.style.display = "none"; // 使其隐藏
  756. // downloadLink.href = downloadPath;
  757. // downloadLink.download = "";
  758. // downloadLink.click();
  759. // document.body.appendChild(downloadLink);
  760. // document.body.removeChild(downloadLink);
  761. // ElMessage({
  762. // type: "success",
  763. // showClose: true,
  764. // message: res.data.message,
  765. // center: true,
  766. // });
  767. // } else {
  768. // ElMessage({
  769. // type: "error",
  770. // showClose: true,
  771. // message: res.data.message,
  772. // center: true,
  773. // });
  774. // }
  775. };
  776. // 解冻
  777. const defrost = async (row) => {
  778. let data = {
  779. id: row.id,
  780. };
  781. let res = await axios({
  782. method: "get",
  783. url: api.value + "/wanzai/api/smartFreezeRecord/thawFreezing",
  784. headers: {
  785. // token: sessionStorage.getItem("token"),
  786. // user_head: sessionStorage.getItem("userhead"),
  787. },
  788. params: data,
  789. });
  790. console.log(res, "解冻");
  791. if (res.data.code == 200) {
  792. editVisible.value = false;
  793. getList();
  794. ElMessage({
  795. type: "success",
  796. showClose: true,
  797. message: res.data.message,
  798. center: true,
  799. });
  800. } else {
  801. ElMessage({
  802. type: "error",
  803. showClose: true,
  804. message: res.data.message,
  805. center: true,
  806. });
  807. }
  808. };
  809. // 表格斑马纹颜色修改
  810. const tableRowClassName = ({ row, rowIndex }) => {
  811. if (rowIndex % 2 === 0) {
  812. return "even";
  813. } else if (rowIndex % 2 !== 0) {
  814. return "odd";
  815. }
  816. return "";
  817. };
  818. // 分页
  819. const handleCurrentChange = (value) => {
  820. // console.log(value);
  821. currentPage.value = value;
  822. getList();
  823. };
  824. onBeforeMount(async () => {
  825. api.value = store.state.user.api;
  826. getList();
  827. getRules();
  828. });
  829. onUnmounted(() => {
  830. // document.removeEventListener("keyup", Enters);
  831. });
  832. </script>
  833. <style scoped lang="scss">
  834. .content-box {
  835. min-width: 1000px;
  836. width: calc(100vw - 260px);
  837. height: calc(100vh - 105px);
  838. margin: 20px auto;
  839. background-color: #fff;
  840. color: #fff;
  841. display: flex;
  842. flex-direction: column;
  843. box-shadow: 0px 3px 10px rgba(0, 97, 255, 0.2);
  844. .left {
  845. width: 96%;
  846. display: flex;
  847. align-items: center;
  848. height: 60px;
  849. margin: 0 30px;
  850. border-bottom: 1px solid #ccc;
  851. color: rgb(0, 0, 0);
  852. font-size: 18px;
  853. font-weight: 600;
  854. }
  855. .middle {
  856. width: 96%;
  857. height: calc(100% - 61px);
  858. margin: 0 auto;
  859. overflow: auto;
  860. color: #000;
  861. // border-bottom: 1px solid rgb(231, 231, 231);
  862. .filter {
  863. width: 100%;
  864. height: 100%;
  865. display: flex;
  866. flex-wrap: wrap;
  867. align-items: center;
  868. .el-tabs {
  869. width: 100%;
  870. height: 100%;
  871. :deep(.el-tabs__header) {
  872. margin: 15px 0;
  873. .el-tabs__item {
  874. color: #000;
  875. font-size: 16px;
  876. font-family: "微软雅黑";
  877. }
  878. }
  879. :deep(.el-tabs__content) {
  880. height: calc(100% - 70px);
  881. .el-tab-pane {
  882. height: 100%;
  883. }
  884. }
  885. .footer {
  886. width: 100%;
  887. height: calc(100% - 64px);
  888. margin: 0 auto;
  889. .el-table--fit {
  890. height: 100%;
  891. :deep(.el-table__header-wrapper) {
  892. background-color: #000;
  893. font-size: 14px;
  894. tr {
  895. // color: #000;
  896. }
  897. }
  898. :deep(.el-table__row) {
  899. height: 50px;
  900. font-size: 14px;
  901. // color: #000;
  902. &:hover {
  903. td {
  904. background-color: rgba(223, 236, 254, 1);
  905. }
  906. }
  907. }
  908. :deep(.el-table__row):nth-child(2n) {
  909. .el-table-fixed-column--right {
  910. background-color: rgba(240, 243, 247, 1);
  911. }
  912. }
  913. :deep(.el-table__row td) {
  914. padding: 0;
  915. // border: 0;
  916. }
  917. .el-button--primary {
  918. margin-left: 5px;
  919. }
  920. :deep(.el-table__body .even) {
  921. background-color: #fff;
  922. }
  923. :deep(.el-table__body .odd) {
  924. background-color: rgba(240, 243, 247, 1);
  925. }
  926. .defrost,
  927. .del {
  928. padding: 0 10px;
  929. color: rgba(30, 125, 251, 1);
  930. cursor: pointer;
  931. }
  932. .triggers {
  933. color: red;
  934. }
  935. // :deep(.look):hover {
  936. // color: red;
  937. // }
  938. // :deep(.del):hover {
  939. // color: red;
  940. // }
  941. }
  942. }
  943. .freezeList {
  944. .searchInp {
  945. display: flex;
  946. justify-content: space-between;
  947. margin-bottom: 10px;
  948. .search {
  949. margin-left: 15px;
  950. }
  951. }
  952. .footers {
  953. width: 100%;
  954. height: calc(100% - 106px);
  955. margin: 0 auto;
  956. .el-table--fit {
  957. height: 100%;
  958. :deep(.el-table__header-wrapper) {
  959. background-color: #000;
  960. font-size: 14px;
  961. tr {
  962. // color: #000;
  963. }
  964. }
  965. :deep(.el-table__row) {
  966. height: 50px;
  967. font-size: 14px;
  968. // color: #000;
  969. &:hover {
  970. td {
  971. background-color: rgba(223, 236, 254, 1);
  972. }
  973. }
  974. }
  975. :deep(.el-table__row):nth-child(2n) {
  976. .el-table-fixed-column--right {
  977. background-color: rgba(240, 243, 247, 1);
  978. }
  979. }
  980. :deep(.el-table__row td) {
  981. padding: 0;
  982. // border: 0;
  983. }
  984. .el-button--primary {
  985. margin-left: 5px;
  986. }
  987. :deep(.el-table__body .even) {
  988. background-color: #fff;
  989. }
  990. :deep(.el-table__body .odd) {
  991. background-color: rgba(240, 243, 247, 1);
  992. }
  993. .defrost,
  994. .del {
  995. padding: 0 10px;
  996. color: rgba(30, 125, 251, 1);
  997. cursor: pointer;
  998. }
  999. .triggers {
  1000. color: red;
  1001. }
  1002. // :deep(.look):hover {
  1003. // color: red;
  1004. // }
  1005. // :deep(.del):hover {
  1006. // color: red;
  1007. // }
  1008. }
  1009. }
  1010. }
  1011. }
  1012. }
  1013. }
  1014. // 编辑按钮
  1015. :deep(.editDialog) {
  1016. // height: 420px;
  1017. border-radius: 11px;
  1018. .el-dialog__header {
  1019. border-radius: 11px 11px 0 0;
  1020. background: rgba(237, 241, 245, 1);
  1021. font-weight: 600;
  1022. margin: 0;
  1023. .el-dialog__headerbtn {
  1024. outline: none;
  1025. }
  1026. }
  1027. .el-dialog__body {
  1028. padding: 20px 30px 10px 30px;
  1029. .condition {
  1030. display: flex;
  1031. align-items: center;
  1032. margin: 10px 30px 20px 0;
  1033. color: #000;
  1034. .item {
  1035. margin-right: 15px;
  1036. width: 80px;
  1037. text-align: right;
  1038. font-weight: 600;
  1039. }
  1040. }
  1041. .options {
  1042. margin: 80px 20px 20px 0;
  1043. width: 100%;
  1044. display: flex;
  1045. flex-direction: row-reverse;
  1046. .queding {
  1047. color: #fff;
  1048. margin-left: 15px;
  1049. }
  1050. }
  1051. }
  1052. }
  1053. //冻结按钮
  1054. :deep(.freezeDialog) {
  1055. // height: 420px;
  1056. border-radius: 11px;
  1057. .el-dialog__header {
  1058. border-radius: 11px 11px 0 0;
  1059. background: rgba(237, 241, 245, 1);
  1060. font-weight: 600;
  1061. margin: 0;
  1062. .el-dialog__headerbtn {
  1063. outline: none;
  1064. }
  1065. }
  1066. .el-dialog__body {
  1067. padding: 20px 30px 10px 30px;
  1068. .condition {
  1069. display: flex;
  1070. align-items: center;
  1071. margin: 10px 30px 20px 0;
  1072. color: #000;
  1073. .item {
  1074. margin-right: 15px;
  1075. width: 80px;
  1076. text-align: right;
  1077. font-weight: 600;
  1078. }
  1079. }
  1080. .options {
  1081. margin: 50px 20px 20px 0;
  1082. width: 100%;
  1083. .el-form-item__content {
  1084. display: flex;
  1085. flex-direction: row-reverse;
  1086. }
  1087. .queding {
  1088. color: #fff;
  1089. margin-left: 15px;
  1090. }
  1091. }
  1092. }
  1093. }
  1094. .pageSize {
  1095. display: flex;
  1096. align-items: center;
  1097. justify-content: space-between;
  1098. margin: 15px 30px;
  1099. span {
  1100. color: #000;
  1101. }
  1102. .el-pagination {
  1103. // width: 1600px;
  1104. :deep(.el-pagination__total) {
  1105. color: #000;
  1106. }
  1107. :deep(.el-pagination__goto) {
  1108. color: #000;
  1109. }
  1110. :deep(.el-pagination__classifier) {
  1111. color: #000;
  1112. }
  1113. :deep(.el-input__wrapper) {
  1114. border: 1px solid rgba(0, 0, 0, 1);
  1115. border-radius: 5px;
  1116. box-shadow: none;
  1117. }
  1118. :deep(.el-pager li) {
  1119. margin: 0 5px;
  1120. border: 1px solid rgba(0, 0, 0, 1);
  1121. border-radius: 5px;
  1122. background-color: transparent;
  1123. }
  1124. :deep(.el-pager li.is-active) {
  1125. // background-color: rgba(0, 97, 255, 0.8);
  1126. border: 1px solid rgba(0, 97, 255, 1);
  1127. color: rgba(0, 97, 255, 1);
  1128. }
  1129. :deep(.btn-prev) {
  1130. margin-right: 5px;
  1131. border: 1px solid rgba(0, 0, 0, 1);
  1132. border-radius: 5px;
  1133. background-color: transparent;
  1134. }
  1135. :deep(.btn-next) {
  1136. margin-left: 5px;
  1137. border: 1px solid rgba(0, 0, 0, 1);
  1138. border-radius: 5px;
  1139. background-color: transparent;
  1140. }
  1141. }
  1142. }
  1143. }
  1144. .el-input {
  1145. width: 192px;
  1146. }
  1147. </style>