IndexTask.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <template>
  2. <div class="index-container-ty">
  3. <a-row type="flex" justify="start" :gutter="3">
  4. <a-col :sm="24" :lg="12">
  5. <a-card>
  6. <template #title>
  7. <div class="index-md-title">
  8. <img src="../../../../assets/images/daiban.png" />
  9. 我的待办【{{ dataSource1.length }}】
  10. </div>
  11. </template>
  12. <template v-if="dataSource1 && dataSource1.length > 0" #extra>
  13. <a @click="goPage"
  14. >更多
  15. <Icon icon="ant-design:double-right-outlined" />
  16. </a>
  17. </template>
  18. <a-table
  19. :class="'my-index-table tytable1'"
  20. ref="table1"
  21. size="small"
  22. rowKey="id"
  23. :columns="columns"
  24. :dataSource="dataSource1"
  25. :pagination="false"
  26. >
  27. <template #ellipsisText="{ text }">
  28. <JEllipsis :value="text" :length="textMaxLength"></JEllipsis>
  29. </template>
  30. <template #dayWarnning="{ text, record }">
  31. <BellTwoTone style="font-size: 22px" :twoToneColor="getTipColor(record)" />
  32. </template>
  33. <template #action="{ text, record }">
  34. <a @click="handleData">办理</a>
  35. </template>
  36. </a-table>
  37. </a-card>
  38. </a-col>
  39. <a-col :sm="24" :lg="12">
  40. <a-card>
  41. <template #title>
  42. <div class="index-md-title">
  43. <img src="../../../../assets/images/zaiban.png" />
  44. 我的在办【{{ dataSource2.length }}】
  45. </div>
  46. </template>
  47. <template v-if="dataSource2 && dataSource2.length > 0" #extra>
  48. <a @click="goPage"
  49. >更多
  50. <Icon icon="ant-design:double-right-outlined" />
  51. </a>
  52. </template>
  53. <a-table
  54. :class="'my-index-table tytable2'"
  55. ref="table1"
  56. size="small"
  57. rowKey="id"
  58. :columns="columns"
  59. :dataSource="dataSource2"
  60. :pagination="false"
  61. >
  62. <template #ellipsisText="{ text }">
  63. <JEllipsis :value="text" :length="textMaxLength"></JEllipsis>
  64. </template>
  65. <template #dayWarnning="{ text, record }">
  66. <BellTwoTone style="font-size: 22px" :twoToneColor="getTipColor(record)" />
  67. </template>
  68. <template #action="{ text, record }">
  69. <a @click="handleData">办理</a>
  70. </template>
  71. </a-table>
  72. </a-card>
  73. </a-col>
  74. <a-col :span="24">
  75. <div style="height: 5px"></div>
  76. </a-col>
  77. <a-col :sm="24" :lg="12">
  78. <a-card>
  79. <template #title>
  80. <div class="index-md-title">
  81. <img src="../../../../assets/images/guaz.png" />
  82. 我的挂账【{{ dataSource4.length }}】
  83. </div>
  84. </template>
  85. <a-table
  86. :class="'my-index-table tytable4'"
  87. ref="table1"
  88. size="small"
  89. rowKey="id"
  90. :columns="columns"
  91. :dataSource="dataSource4"
  92. :pagination="false"
  93. >
  94. <template #ellipsisText="{ text }">
  95. <JEllipsis :value="text" :length="textMaxLength"></JEllipsis>
  96. </template>
  97. <template #dayWarnning="{ text, record }">
  98. <BellTwoTone style="font-size: 22px" :twoToneColor="getTipColor(record)" />
  99. </template>
  100. <template #action="{ text, record }">
  101. <a @click="handleData">办理</a>
  102. </template>
  103. </a-table>
  104. </a-card>
  105. </a-col>
  106. <a-col :sm="24" :lg="12">
  107. <a-card>
  108. <template #title>
  109. <div class="index-md-title">
  110. <img src="../../../../assets/images/duban.png" />
  111. 我的督办【{{ dataSource3.length }}】
  112. </div>
  113. </template>
  114. <a-table
  115. :class="'my-index-table tytable3'"
  116. ref="table1"
  117. size="small"
  118. rowKey="id"
  119. :columns="columns"
  120. :dataSource="dataSource3"
  121. :pagination="false"
  122. >
  123. <template #ellipsisText="{ text }">
  124. <JEllipsis :value="text" :length="textMaxLength"></JEllipsis>
  125. </template>
  126. <template #dayWarnning="{ text, record }">
  127. <BellTwoTone style="font-size: 22px" :twoToneColor="getTipColor(record)" />
  128. </template>
  129. <template #action="{ text, record }">
  130. <a @click="handleData">办理</a>
  131. </template>
  132. </a-table>
  133. </a-card>
  134. </a-col>
  135. </a-row>
  136. </div>
  137. </template>
  138. <script lang="ts" setup>
  139. import { ref } from 'vue';
  140. import noDataPng from '/@/assets/images/nodata.png';
  141. import { useMessage } from '/@/hooks/web/useMessage';
  142. import JEllipsis from '/@/components/Form/src/jeecg/components/JEllipsis.vue';
  143. import { BulbTwoTone, BellTwoTone } from '@ant-design/icons-vue';
  144. const tempSs1 = [
  145. {
  146. id: '001',
  147. orderNo: '电[1]1267102',
  148. orderTitle: '药品出问题了',
  149. restDay: 1,
  150. },
  151. {
  152. id: '002',
  153. orderNo: '电[4]5967102',
  154. orderTitle: '吃了xxx医院的药,病情越来越严重',
  155. restDay: 0,
  156. },
  157. {
  158. id: '003',
  159. orderNo: '电[3]5988987',
  160. orderTitle: '今天去超市买鸡蛋,鸡蛋都是坏的',
  161. restDay: 7,
  162. },
  163. {
  164. id: '004',
  165. orderNo: '电[2]5213491',
  166. orderTitle: 'xx宝实体店高价售卖xx',
  167. restDay: 5,
  168. },
  169. {
  170. id: '005',
  171. orderNo: '电[1]1603491',
  172. orderTitle: '以红利相诱,答应退保后扣一年费用',
  173. restDay: 0,
  174. },
  175. ];
  176. const tempSs2 = [
  177. {
  178. id: '001',
  179. orderTitle: '我要投诉这个大超市',
  180. orderNo: '电[1]10299456',
  181. restDay: 6,
  182. },
  183. {
  184. id: '002',
  185. orderTitle: 'xxx医院乱开药方,售卖假药',
  186. orderNo: '电[2]20235691',
  187. restDay: 0,
  188. },
  189. {
  190. id: '003',
  191. orderTitle: '我想问问这家店是干啥的',
  192. orderNo: '电[3]495867322',
  193. restDay: 7,
  194. },
  195. {
  196. id: '004',
  197. orderTitle: '我要举报朝阳区奥森公园酒店',
  198. orderNo: '电[2]1193849',
  199. restDay: 3,
  200. },
  201. {
  202. id: '005',
  203. orderTitle: '我今天吃饭吃到一个石头子',
  204. orderNo: '电[4]56782344',
  205. restDay: 9,
  206. },
  207. ];
  208. //4-7天
  209. const tip_green = 'rgba(0, 255, 0, 1)';
  210. //1-3天
  211. const tip_yellow = 'rgba(255, 255, 0, 1)';
  212. //超期
  213. const tip_red = 'rgba(255, 0, 0, 1)';
  214. const textMaxLength = 8;
  215. const $message = useMessage();
  216. const dataSource1 = ref([]);
  217. const dataSource2 = ref([]);
  218. const dataSource3 = ref([]);
  219. const dataSource4 = ref([]);
  220. const columns = [
  221. {
  222. title: '',
  223. dataIndex: '',
  224. key: 'rowIndex',
  225. width: 50,
  226. fixed: 'left',
  227. align: 'center',
  228. slots: { customRender: 'dayWarnning' },
  229. },
  230. {
  231. title: '剩余天数',
  232. align: 'center',
  233. dataIndex: 'restDay',
  234. width: 80,
  235. },
  236. {
  237. title: '工单标题',
  238. align: 'center',
  239. dataIndex: 'orderTitle',
  240. slots: { customRender: 'ellipsisText' },
  241. },
  242. {
  243. title: '工单编号',
  244. align: 'center',
  245. dataIndex: 'orderNo',
  246. },
  247. {
  248. title: '操作',
  249. dataIndex: 'action',
  250. align: 'center',
  251. slots: { customRender: 'action' },
  252. },
  253. ];
  254. function getTipColor(rd) {
  255. let num = rd.restDay;
  256. if (num <= 0) {
  257. return tip_red;
  258. } else if (num >= 1 && num < 4) {
  259. return tip_yellow;
  260. } else if (num >= 4) {
  261. return tip_green;
  262. }
  263. }
  264. function mock() {
  265. dataSource1.value = tempSs1;
  266. dataSource2.value = tempSs2;
  267. dataSource3.value = tempSs1;
  268. dataSource4.value = tempSs2;
  269. ifNullDataSource(dataSource4, '.tytable4');
  270. }
  271. function ifNullDataSource(ds, tb) {
  272. if (!ds || ds.length == 0) {
  273. var tmp = document.createElement('img');
  274. tmp.src = noDataPng;
  275. tmp.width = 300;
  276. let tbclass = `${tb} .ant-table-placeholder`;
  277. document.querySelector(tbclass).innerHTML = '';
  278. document.querySelector(tbclass).appendChild(tmp);
  279. }
  280. }
  281. function handleData() {
  282. $message.createMessage.success('办理完成');
  283. }
  284. function goPage() {
  285. $message.createMessage.success('请根据具体业务跳转页面');
  286. }
  287. mock();
  288. </script>
  289. <style scoped lang="less">
  290. .my-index-table {
  291. height: 270px;
  292. table {
  293. font-size: 14px !important;
  294. }
  295. }
  296. .index-container-ty {
  297. margin: 12px 12px 0;
  298. :deep(.ant-card-body) {
  299. padding: 10px 12px 0 12px;
  300. }
  301. :deep(.ant-card-head) {
  302. line-height: 24px;
  303. min-height: 24px;
  304. background: #7196fb !important;
  305. .ant-card-head-title {
  306. padding-top: 6px;
  307. padding-bottom: 6px;
  308. }
  309. .ant-card-extra {
  310. padding: 0;
  311. a {
  312. color: #fff;
  313. }
  314. a:hover {
  315. color: #152ede;
  316. }
  317. }
  318. }
  319. :deep(.ant-table-footer) {
  320. text-align: right;
  321. padding: 6px 12px 6px 6px;
  322. background: #fff;
  323. border-top: 2px solid #f7f1f1;
  324. }
  325. .index-md-title {
  326. position: relative;
  327. width: 100%;
  328. color: #fff;
  329. font-size: 21px;
  330. font-family: cursive;
  331. padding-left: 25px;
  332. img {
  333. position: absolute;
  334. height: 25px;
  335. left: 0;
  336. }
  337. }
  338. :deep(.ant-table-thead > tr > th),
  339. :deep(.ant-table-tbody > tr > td) {
  340. border-bottom: 1px solid #90aeff;
  341. }
  342. :deep(
  343. .ant-table-small
  344. > .ant-table-content
  345. > .ant-table-fixed-left
  346. > .ant-table-body-outer
  347. > .ant-table-body-inner
  348. > table
  349. > .ant-table-thead
  350. > tr
  351. > th),
  352. :deep(
  353. .ant-table-small
  354. > .ant-table-content
  355. > .ant-table-fixed-right
  356. > .ant-table-body-outer
  357. > .ant-table-body-inner
  358. > table
  359. > .ant-table-thead
  360. > tr
  361. > th) {
  362. border-bottom: 1px solid #90aeff;
  363. }
  364. :deep(.ant-table-small > .ant-table-content > .ant-table-scroll > .ant-table-body > table > .ant-table-thead > tr > th) {
  365. border-bottom: 1px solid #90aeff;
  366. }
  367. :deep(.ant-table-small) {
  368. border: 1px solid #90aeff;
  369. }
  370. :deep(.ant-table-placeholder) {
  371. padding: 0;
  372. height: 215px;
  373. }
  374. }
  375. </style>