law-ssdwstatistics-form.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <div :class="$style.searchdiv">
  3. <a-card :class="$style.searchWrap">
  4. <a-form-model
  5. ref="advancedSearchForm"
  6. layout="horizontal"
  7. :model="form"
  8. v-bind="formItemLayout"
  9. :rules="rules"
  10. >
  11. <a-row>
  12. <a-col :span="12">
  13. <a-form-model-item label="统计日期" prop="timeRange">
  14. <a-range-picker v-model="form.timeRange" :time-range.sync="form.timeRange" />
  15. </a-form-model-item>
  16. </a-col>
  17. <a-col :span="12">
  18. <a-form-model-item label="统计单位" prop="Org">
  19. <sd-group-picker v-model="form.Org" :read-only="false" :single="true" />
  20. </a-form-model-item>
  21. </a-col>
  22. <a-col :span="24" :pull="3">
  23. <a-form-model-item label="案件类型" prop="caseType">
  24. <a-checkbox-group v-model="form.caseType">
  25. <a-checkbox
  26. v-for="item in caseTypeOptions"
  27. :key="item.value"
  28. :value="item.value"
  29. :disabled="item.disabled"
  30. @change="typeChange"
  31. >
  32. {{ item.label }}
  33. </a-checkbox>
  34. </a-checkbox-group>
  35. </a-form-model-item>
  36. </a-col>
  37. <a-col :span="24">
  38. <div class="reportbuttonContent">
  39. <a-button @click="resetForm">重置</a-button>
  40. <a-button
  41. style="margin: 0 5px 10px"
  42. type="primary"
  43. html-type="submit"
  44. @click="submitForm"
  45. >查询</a-button
  46. >
  47. <a-button type="primary" @click="exportForm">导出</a-button>
  48. </div>
  49. </a-col>
  50. </a-row>
  51. </a-form-model>
  52. </a-card>
  53. <a-card class="reporttablecardxm">
  54. <span class="header_sd-header_common"
  55. ><span :class="['toptitle', $style.toptitle]">诉讼地位统计</span></span
  56. >
  57. <template v-if="JSON.stringify(this.onepie.series[0].data) !== '[]'">
  58. <div>
  59. <sd-echart :options="onepie" autoresize :class="$style.onepieClass" />
  60. </div>
  61. </template>
  62. <template v-else-if="JSON.stringify(this.onepie.series[0].data) === '[]' && !flag">
  63. <div :class="$style.emptyecharts"> </div>
  64. </template>
  65. </a-card>
  66. </div>
  67. </template>
  68. <script>
  69. import 'echarts/lib/chart/pie'
  70. import 'echarts/lib/component/polar'
  71. import 'echarts/lib/component/legend'
  72. import 'echarts/lib/component/tooltip'
  73. import 'echarts/lib/component/title'
  74. import 'echarts/lib/component/toolbox'
  75. // import SdSelect from '@/common/components/sd-select.vue'
  76. import moment from 'moment'
  77. import LawService from '../law-service'
  78. import components from './_import-components/law-casestatistics-form-import'
  79. export default {
  80. name: 'LawSsdwtatisticsForm',
  81. metaInfo: {
  82. title: '诉讼地位统计',
  83. },
  84. components: {
  85. ...components,
  86. // SdSelect,
  87. },
  88. data() {
  89. return {
  90. rules: {
  91. // timeRange: [{ required: true, message: '请选择年度', trigger: 'change' }],
  92. // Org: [{ required: true, message: '请选择审计机构', trigger: 'change' }],
  93. // caseType: [{ required: true, message: '请选择案件类型', trigger: 'change' }],
  94. },
  95. tableKey: 0,
  96. ipagination: {
  97. current: 1,
  98. pageSize: 10,
  99. },
  100. formItemLayout: {
  101. labelCol: { span: 6 },
  102. wrapperCol: { span: 14 },
  103. },
  104. startYear: null,
  105. endYear: null,
  106. form: {
  107. timeRange: [],
  108. Org: [],
  109. caseType: [],
  110. },
  111. onepie: {
  112. color: ['#194f97', '#555555'],
  113. textStyle: {
  114. color: '#939393',
  115. fontSize: 13,
  116. },
  117. tooltip: {
  118. trigger: 'item',
  119. },
  120. legend: {
  121. orient: 'vertical',
  122. x: 'right',
  123. y: 'center',
  124. // right: '0px',
  125. icon: 'circle',
  126. align: 'left',
  127. // itemWidth: '800px',
  128. // top: 50,
  129. textStyle: {
  130. color: '#939393',
  131. lineHeight: 18,
  132. },
  133. },
  134. series: [
  135. {
  136. type: 'pie',
  137. left: '100px',
  138. top: 15,
  139. radius: [60, 90],
  140. data: [],
  141. avoidLabelOverlap: true,
  142. emphasis: {
  143. itemStyle: {
  144. shadowBlur: 10,
  145. shadowOffsetX: 0,
  146. shadowColor: 'rgba(0, 0, 0, 0.5)',
  147. },
  148. },
  149. label: {
  150. minMargin: 5,
  151. edgeDistance: 10,
  152. lineHeight: 15,
  153. padding: [0, 0],
  154. formatter: '{b}\n',
  155. },
  156. labelLine: {
  157. length2: '70px',
  158. },
  159. },
  160. ],
  161. toolbox: {
  162. feature: {
  163. // magicType: { show: true, type: ['line', 'bar'] },
  164. restore: { title: '刷新', show: true },
  165. saveAsImage: { show: true, name: '诉讼地位统计图' },
  166. },
  167. },
  168. },
  169. params: {
  170. startYear: '',
  171. endYear: '',
  172. Org: [],
  173. caseType: [],
  174. }, // 查询条件
  175. flag: true,
  176. rootNode: {},
  177. caseTypeOptions: [],
  178. }
  179. },
  180. created() {
  181. // const params = {
  182. // buttonExpressions: [],
  183. // columns: 'id,name,code,sortNum,status,valueDesc',
  184. // expressions: [
  185. // {
  186. // dataType: 'str',
  187. // name: 'keyId',
  188. // op: 'eq',
  189. // stringValue: '272818597314232320',
  190. // },
  191. // ],
  192. // formId: 'weAppDictValue',
  193. // maxResults: 10,
  194. // startPosition: 0,
  195. // }
  196. LawService.getdict('272818597314232320').then((res) => {
  197. const dict = [
  198. {
  199. label: '全部',
  200. value: 'all',
  201. onChange: this.typeChange,
  202. },
  203. ]
  204. res.data.forEach((d) => {
  205. dict.push({
  206. label: d.label,
  207. value: d.value,
  208. disabled: false,
  209. })
  210. })
  211. this.caseTypeOptions = [...dict]
  212. })
  213. },
  214. methods: {
  215. // 复选框变化时
  216. typeChange(e) {
  217. if (e.target.value === 'all') {
  218. this.caseTypeOptions.forEach((item) => {
  219. if (item.value !== 'all') {
  220. item.disabled = e.target.checked
  221. }
  222. })
  223. if (e.target.checked) {
  224. this.caseTypeOptions.forEach((item) => {
  225. if (item.value !== 'all' && !this.form.caseType.includes(item.value)) {
  226. this.form.caseType.push(item.value)
  227. }
  228. })
  229. } else {
  230. this.$nextTick().then(() => {
  231. this.form.caseType = []
  232. })
  233. }
  234. } else {
  235. }
  236. },
  237. submitForm() {
  238. this.flag = false
  239. this.$refs.advancedSearchForm.validate((valid, values) => {
  240. if (valid) {
  241. const type = []
  242. this.form.caseType.forEach((t) => {
  243. if (t !== 'all') {
  244. type.push(t)
  245. }
  246. })
  247. const unitIds = []
  248. this.form.Org.forEach((o) => {
  249. unitIds.push(o.code)
  250. })
  251. const params = {
  252. type: 'ownerPosition', // 定值
  253. startTime: new Date(this.form.timeRange[0]).getTime(),
  254. endTime: new Date(this.form.timeRange[1]).getTime(),
  255. orgIds: unitIds,
  256. caseTypes: type,
  257. }
  258. this.onepie.series[0].data = []
  259. LawService.getSsdwStatistics(params).then((res) => {
  260. res.data.forEach((d) => {
  261. if (d.ownerPosition !== '') {
  262. this.onepie.series[0].data.push({
  263. value: d.count,
  264. name: d.ownerPositionName,
  265. tooltip: {},
  266. })
  267. }
  268. })
  269. })
  270. }
  271. })
  272. },
  273. resetForm() {
  274. this.startYear = null
  275. this.endYear = null
  276. this.form = {
  277. timeRange: [],
  278. Org: [],
  279. caseType: [],
  280. }
  281. },
  282. exportForm() {
  283. // 获取画布信息
  284. const canvas = document.getElementsByTagName('canvas')
  285. if (canvas && canvas.length > 0) {
  286. // 创建标签
  287. const tempA = document.createElement('a')
  288. // 设置下载名称
  289. tempA.download = '诉讼地位统计图' + '.png'
  290. // 设置地址以及文件类型
  291. tempA.href = canvas[0].toDataURL('image/png')
  292. document.body.appendChild(tempA)
  293. // 触发下载事件
  294. tempA.click()
  295. // 移除标签
  296. tempA.remove()
  297. }
  298. },
  299. chartClick(evtArgs) {
  300. const seriesId = JSON.parse(evtArgs.seriesId)
  301. const param = {
  302. planYear: evtArgs.name,
  303. unitNames: "'" + seriesId.NAME + "'",
  304. auditType: seriesId.TYPE,
  305. amount: '1',
  306. }
  307. const url =
  308. '#/audit-annualplancompletion-project-list?params=' +
  309. encodeURIComponent(JSON.stringify(param)) +
  310. '&type=projecttrends'
  311. window.open(url)
  312. },
  313. },
  314. }
  315. </script>
  316. <style module lang="scss">
  317. @use '@/common/design' as *;
  318. .emptyecharts {
  319. width: 600px;
  320. height: 400px;
  321. margin: auto auto;
  322. text-align: center;
  323. &::after {
  324. content: '无数据';
  325. padding-top: 150px;
  326. display: block;
  327. }
  328. }
  329. .echarts {
  330. width: 100%;
  331. height: 400px;
  332. margin: auto auto;
  333. text-align: center;
  334. }
  335. .onepieClass {
  336. width: 90%;
  337. height: 400px;
  338. // margin: auto auto;
  339. text-align: center;
  340. padding-right: 100px;
  341. }
  342. .toptitle {
  343. color: #404040;
  344. font-weight: bold;
  345. font-size: 22px;
  346. margin-left: calc(50% - 150px);
  347. }
  348. .search-wrap {
  349. margin-bottom: $padding-lg;
  350. :global(.ant-advanced-search-form) {
  351. padding: 0;
  352. background: transparent;
  353. border: none;
  354. }
  355. :global .ant-divider-horizontal {
  356. margin: 10px 0;
  357. }
  358. }
  359. .searchdiv {
  360. height: 100%;
  361. :global(.sd-has-table.ant-card) {
  362. min-height: calc(100vh - 270px);
  363. }
  364. :global(.reporttablecardxm) {
  365. :global(.ant-table-body) {
  366. height: auto !important;
  367. overflow: auto;
  368. min-height: auto !important;
  369. }
  370. }
  371. :global(.ant-table-placeholder) {
  372. height: auto !important;
  373. }
  374. }
  375. </style>