Wgn.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  1. <template>
  2. <el-affix :offset="0">
  3. <div style="height: 44px; width: 100vw; background: #00002a"></div>
  4. </el-affix>
  5. <el-affix :offset="44">
  6. <div class="application-overview">
  7. <div class="wgn-body">
  8. <aside class="wgn-side-nav" aria-label="微功能锚点导航">
  9. <button
  10. v-for="block in groupedWgnSections"
  11. :key="block.cat.value"
  12. type="button"
  13. class="wgn-anchor"
  14. :class="{ active: activeAnchorId === block.cat.value }"
  15. @click="scrollToAnchor(block.cat.value)"
  16. >
  17. {{ block.cat.label }}
  18. </button>
  19. </aside>
  20. <!-- 右侧主内容区 -->
  21. <div class="main-content">
  22. <div style="display: flex; justify-content: space-between; padding-right: 30px">
  23. <!-- 搜索栏 -->
  24. <div class="search-bar">
  25. <el-input
  26. placeholder="输入搜索关键词"
  27. v-model="searchStr"
  28. class="search-input"
  29. clearable
  30. @clear="searchServerList"
  31. @keyup.enter="searchServerList"
  32. >
  33. </el-input>
  34. <el-button type="primary" class="search-btn" @click="searchServerList"
  35. >搜索</el-button
  36. >
  37. <!-- <span>搜索到{{total}}条微功能服务</span> -->
  38. </div>
  39. <div>
  40. <el-button
  41. v-if="$getUserType() != 1"
  42. type="primary"
  43. class="search-btn"
  44. @click="createTask"
  45. >大批量数据处理任务</el-button
  46. >
  47. </div>
  48. </div>
  49. <!-- 应用卡片:按一级场景分组,锚点滚动 -->
  50. <div class="wgn-content" ref="wgnScrollRoot">
  51. <template v-if="groupedWgnSections.length">
  52. <section
  53. v-for="block in groupedWgnSections"
  54. :key="block.cat.value"
  55. :id="sectionDomId(block.cat.value)"
  56. class="wgn-anchor-section"
  57. >
  58. <h2 class="wgn-anchor-section-title">{{ block.cat.label }}</h2>
  59. <div class="applications-grid">
  60. <div
  61. class="application-card"
  62. v-for="(item, index) in block.items"
  63. :key="(item.c_scene_name || '') + '-' + index"
  64. >
  65. <div class="card-image">
  66. <img :src="curUrl + item.c_picture" :alt="item.title" />
  67. </div>
  68. <div class="card-content">
  69. <div class="wgn-header">
  70. <h3 class="wgn-name">{{ item.title }}</h3>
  71. </div>
  72. <el-tooltip placement="top" effect="dark">
  73. <template #content>
  74. <div style="max-width: 500px">{{ item.content }}</div>
  75. </template>
  76. <p class="wgn-description">{{ item.content }}</p>
  77. </el-tooltip>
  78. <div class="wgn-footer">
  79. <el-button
  80. type="primary"
  81. size="small"
  82. class="visit-button"
  83. @click="handleOnlineDemo(item)"
  84. >在线体验</el-button
  85. >
  86. <el-button
  87. type="primary"
  88. size="small"
  89. class="visit-button"
  90. @click="handleApply(item)"
  91. >申请使用</el-button
  92. >
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </section>
  98. </template>
  99. <el-empty v-else description="暂无数据" />
  100. </div>
  101. <!-- 申请使用微功能服务的表单弹窗 -->
  102. <el-dialog
  103. title="申请使用微功能服务"
  104. v-model="showFrom"
  105. width="60%"
  106. :close-on-click-modal="false"
  107. :close-on-press-escape="false"
  108. :show-close="true"
  109. >
  110. <el-form :model="column.from" :rules="rules" ref="formRef" label-width="120px">
  111. <el-form-item label="应用名称" prop="c_application_name">
  112. <el-input v-model="column.from.c_application_name" placeholder="请输入应用名称" />
  113. </el-form-item>
  114. <el-form-item label="接口路径" prop="c_interface_path">
  115. <el-input
  116. v-model="column.from.c_interface_path"
  117. disabled
  118. placeholder="请输入接口路径"
  119. />
  120. </el-form-item>
  121. <el-form-item label="联系电话" prop="c_phone">
  122. <el-input v-model="column.from.c_phone" placeholder="请输入联系电话" />
  123. </el-form-item>
  124. <el-form-item label="单位名称" prop="c_unit_name">
  125. <el-input v-model="column.from.c_unit_name" placeholder="请输入单位名称" />
  126. </el-form-item>
  127. <el-form-item label="部门名称" prop="c_department">
  128. <el-input v-model="column.from.c_department" placeholder="请输入部门名称" />
  129. </el-form-item>
  130. <!-- 项目负责人 -->
  131. <el-form-item label="项目负责人" prop="c_business_leader">
  132. <el-input v-model="column.from.c_business_leader" placeholder="请输入项目负责人" />
  133. </el-form-item>
  134. <!-- 申请使用微功能服务的详细信息 -->
  135. <el-form-item label="申请使用微功能服务的详细信息" prop="content">
  136. <el-input
  137. type="textarea"
  138. v-model="column.from.content"
  139. placeholder="请输入申请使用微功能服务的详细信息"
  140. />
  141. </el-form-item>
  142. </el-form>
  143. <template #footer>
  144. <div class="dialog-footer">
  145. <el-button @click="showFrom = false">取消</el-button>
  146. <el-button type="primary" @click="handleApplySubmit">确定</el-button>
  147. </div>
  148. </template>
  149. </el-dialog>
  150. <!-- 创建任务的表单弹窗 -->
  151. <el-dialog
  152. title="创建任务"
  153. v-model="showTaskFrom"
  154. width="60%"
  155. :close-on-click-modal="false"
  156. :close-on-press-escape="false"
  157. :show-close="true"
  158. >
  159. <el-form
  160. :model="taskColumn.from"
  161. :rules="taskColumn.rules"
  162. ref="taskFormRef"
  163. label-width="120px"
  164. >
  165. <el-form-item label="任务名称" prop="c_name">
  166. <el-input v-model="taskColumn.from.c_name" placeholder="请输入任务名称" clearable>
  167. <template #prepend>{{
  168. $moment(new Date()).format("YYMMDD_HHmm") +
  169. "_" +
  170. (taskColumn.from.c_type
  171. ? $getDmsTypes("yzt_task_type", taskColumn.from.c_type) + "_"
  172. : "")
  173. }}</template>
  174. </el-input>
  175. </el-form-item>
  176. <el-form-item label="任务备注" prop="c_comment">
  177. <el-input
  178. type="textarea"
  179. clearable
  180. v-model="taskColumn.from.c_comment"
  181. placeholder="请输入任务备注"
  182. />
  183. </el-form-item>
  184. <!-- 下拉框选择任务类型 -->
  185. <el-form-item label="任务类型" prop="c_type">
  186. <el-select
  187. v-model="taskColumn.from.c_type"
  188. @change="changeTaskType"
  189. placeholder="请选择任务类型"
  190. >
  191. <el-option
  192. v-for="(name, index) in $store.state.DmsTypesMap['yzt_task_type']"
  193. :key="index"
  194. :label="name"
  195. :value="index"
  196. />
  197. </el-select>
  198. </el-form-item>
  199. <!-- 渲染任务描述:仅查看 -->
  200. <el-form-item
  201. label="任务描述"
  202. prop="apiDescription"
  203. v-if="taskColumn.apiFrom.apiDescription"
  204. >
  205. <el-input type="textarea" disabled v-model="taskColumn.apiFrom.apiDescription" />
  206. </el-form-item>
  207. <!-- 任务文件是必须的 -->
  208. <el-form-item label="任务文件" prop="c_source_file">
  209. <el-input disabled v-model="taskColumn.from.c_source_file" v-show="false" />
  210. <el-upload class="avatar-uploader" :http-request="handleTCUpload" :limit="1">
  211. <el-button size="small" type="primary">点击上传</el-button>
  212. </el-upload>
  213. </el-form-item>
  214. <el-divider />
  215. <!-- 其他参数数据 -->
  216. <el-form-item label="其他参数数据" prop="c_source_data" v-show="false">
  217. <el-input
  218. type="textarea"
  219. clearable
  220. v-model="taskColumn.from.c_source_data"
  221. placeholder="请输入其他参数数据"
  222. />
  223. </el-form-item>
  224. <div
  225. v-if="
  226. taskColumn.apiFrom.apiParameterRules &&
  227. includesKey([
  228. 'lonKey',
  229. 'latKey',
  230. 'outFileType',
  231. 'inPrj',
  232. 'outPrj',
  233. 'compressionRatio',
  234. 'keyType',
  235. 'geocodeColumnKeyword',
  236. ])
  237. "
  238. >
  239. <template
  240. v-for="(rulesItem, index) in taskColumn.apiFrom.apiParameterRules"
  241. :key="index"
  242. >
  243. <el-form-item
  244. v-if="
  245. [
  246. 'lonKey',
  247. 'latKey',
  248. 'outFileType',
  249. 'inPrj',
  250. 'outPrj',
  251. 'compressionRatio',
  252. 'keyType',
  253. 'geocodeColumnKeyword',
  254. ].includes(rulesItem)
  255. "
  256. :label="
  257. rulesItem === 'keyType'
  258. ? '类型字段'
  259. : rulesItem === 'geocodeColumnKeyword'
  260. ? '数据列名'
  261. : rulesItem
  262. "
  263. >
  264. <el-input
  265. v-if="['lonKey', 'latKey'].includes(rulesItem)"
  266. v-model="taskColumn.from.c_source_data[rulesItem]"
  267. placeholder="当文件为xlsx时必填"
  268. />
  269. <el-select
  270. v-if="
  271. ['outFileType', 'inPrj', 'outPrj', 'compressionRatio'].includes(rulesItem)
  272. "
  273. v-model="taskColumn.from.c_source_data[rulesItem]"
  274. :placeholder="'请选择' + rulesItem"
  275. >
  276. <el-option
  277. v-for="item in taskColumn.selectOptions[rulesItem]"
  278. :key="'wgn-task-selectOptions-form-' + item.label"
  279. :label="item.label"
  280. :value="item.value"
  281. />
  282. </el-select>
  283. <el-select
  284. v-if="rulesItem === 'keyType'"
  285. v-model="taskColumn.from.c_source_data.keyType"
  286. placeholder="非空转空时选择地物类型"
  287. :clearable="!isGeocodingTaskKeyTypeReadonly()"
  288. filterable
  289. :disabled="isGeocodingTaskKeyTypeReadonly()"
  290. >
  291. <el-option
  292. v-for="item in taskColumn.selectOptions.keyType"
  293. :key="'wgn-task-keyType-' + item.value"
  294. :label="item.label"
  295. :value="item.value"
  296. />
  297. </el-select>
  298. <el-input
  299. v-if="rulesItem === 'geocodeColumnKeyword' && isTaskGeocodeZipForColumnInput"
  300. v-model="taskColumn.from.c_source_data.geocodeColumnKeyword"
  301. placeholder="zip 内含多个表格时请手动输入列名(与各表表头一致)"
  302. clearable
  303. />
  304. <el-select
  305. v-if="rulesItem === 'geocodeColumnKeyword' && !isTaskGeocodeZipForColumnInput"
  306. v-model="taskColumn.from.c_source_data.geocodeColumnKeyword"
  307. placeholder="请先上传 CSV / XLSX,将自动读取表头"
  308. clearable
  309. filterable
  310. :disabled="
  311. !taskColumn.selectOptions.geocodeColumnKeyword ||
  312. !taskColumn.selectOptions.geocodeColumnKeyword.length
  313. "
  314. >
  315. <el-option
  316. v-for="item in taskColumn.selectOptions.geocodeColumnKeyword"
  317. :key="'wgn-task-geocol-' + item.value"
  318. :label="item.label"
  319. :value="item.value"
  320. />
  321. </el-select>
  322. </el-form-item>
  323. </template>
  324. </div>
  325. <!-- 任务状态默认为初始化 -->
  326. <el-form-item label="任务状态" prop="c_state" v-show="false">
  327. <el-select disabled v-model="taskColumn.from.c_state" placeholder="请选择任务状态">
  328. <el-option
  329. v-for="(name, index) in $store.state.DmsTypesMap['task_status']"
  330. :key="'wgn-task-form-' + index"
  331. :label="name"
  332. :value="index"
  333. />
  334. </el-select>
  335. </el-form-item>
  336. <!-- 任务负责人默认为当前登录用户 -->
  337. <el-form-item label="用户id" prop="c_user_id" v-show="false">
  338. <el-input disabled v-model="taskColumn.from.c_user_id" />
  339. </el-form-item>
  340. <!-- 任务负责人默认为当前登录用户 -->
  341. <el-form-item label="用户名" prop="c_user_name" v-show="false">
  342. <el-input disabled v-model="taskColumn.from.c_user_name" />
  343. </el-form-item>
  344. </el-form>
  345. <template #footer>
  346. <div class="dialog-footer">
  347. <el-button @click="showTaskFrom = false">取消</el-button>
  348. <el-button type="primary" @click="handleTaskSubmit">确定</el-button>
  349. </div>
  350. </template>
  351. </el-dialog>
  352. </div>
  353. </div>
  354. </div>
  355. </el-affix>
  356. </template>
  357. <script>
  358. import { ElNotification } from "element-plus";
  359. import moment from "moment";
  360. import * as XLSX from "xlsx";
  361. import api from "@/api/content";
  362. import { executeTask } from "@/api/rwgl";
  363. import { WGN_SCENE_LIST } from "@/data/wgnSceneList";
  364. export default {
  365. name: "ApplicationOverview",
  366. data() {
  367. return {
  368. total: 0,
  369. curUrl: systemConfig.dmsDataProxy,
  370. // 搜索关键词
  371. searchStr: "",
  372. // 微功能服务列表
  373. dmsServerList: [],
  374. sceneMenuTree: WGN_SCENE_LIST,
  375. activeAnchorId: null,
  376. anchorScrollLock: false,
  377. // 是否显示申请使用微功能服务的表单弹窗
  378. showFrom: false,
  379. // 是否显示创建任务的表单弹窗
  380. showTaskFrom: false,
  381. // 申请使用微功能服务的表单验证规则
  382. rules: {
  383. c_application_name: [{ required: true, message: "请输入应用名称", trigger: "blur" }],
  384. c_interface_path: [{ required: true, message: "请输入接口路径", trigger: "blur" }],
  385. c_business_leader: [{ required: true, message: "请输入项目负责人", trigger: "blur" }],
  386. // 添加手机号正则验证
  387. c_phone: [
  388. { required: true, message: "请输入联系电话", trigger: "blur" },
  389. {
  390. validator: (rule, value, callback) => {
  391. // 手机号正则验证
  392. let phoneRegex = /^1[3456789]\d{9}$/;
  393. if (!phoneRegex.test(value)) {
  394. callback(new Error("请输入正确的手机号"));
  395. } else {
  396. callback();
  397. }
  398. },
  399. trigger: "blur",
  400. },
  401. ],
  402. c_unit_name: [{ required: true, message: "请输入单位名称", trigger: "blur" }],
  403. c_department: [{ required: true, message: "请输入部门名称", trigger: "blur" }],
  404. },
  405. // 申请使用微功能服务的表单数据
  406. column: {
  407. columnId: systemConfig.columnIds[4],
  408. modelId: systemConfig.modelIds[2],
  409. from: {
  410. // 备注:申请使用微功能服务的详细信息,非必填
  411. content: "",
  412. // 项目负责人,必填
  413. c_business_leader: "",
  414. // 应用名称,必填
  415. c_application_name: "",
  416. // 接口路径,必填
  417. c_interface_path: "",
  418. // 联系电话,必填
  419. c_phone: "",
  420. // 单位名称,必填
  421. c_unit_name: "",
  422. // 部门名称,必填
  423. c_department: "",
  424. },
  425. },
  426. // 创建任务的表单数据
  427. taskColumn: {
  428. columnId: systemConfig.columnIds[6],
  429. modelId: systemConfig.modelIds[3],
  430. rules: {
  431. c_name: [{ required: true, message: "请输入任务名称", trigger: "blur" }],
  432. c_comment: [{ required: true, message: "请输入任务备注", trigger: "blur" }],
  433. c_type: [{ required: true, message: "请选择任务类型", trigger: "change" }],
  434. c_source_file: [{ required: true, message: "请上传任务文件", trigger: "change" }],
  435. },
  436. from: {
  437. title: "",
  438. content: "",
  439. // 任务名称,必填(默认应该是:日期-任务类型-用户自定义名称),这里保存的就是用户自定义名称,提交的时候会自动补充日期-任务类型-
  440. c_name: "",
  441. // 备注:任务的详细信息,必填
  442. c_comment: "",
  443. // 任务类型,必填
  444. c_type: "",
  445. // 任务创建人用户名,必填
  446. c_user_name: "",
  447. // 任务创建人,必填
  448. c_user_id: "",
  449. // 任务文件,必填
  450. c_source_file: "",
  451. // 任务文件名,上传文件时自动带入
  452. c_source_file_name: "",
  453. // 其他参数数据
  454. c_source_data: {},
  455. // 申请状态,默认初始化【0:初始化;1:运行中;2:成功完成;3:异常中断】
  456. c_state: "0",
  457. },
  458. // 切换任务类型时,渲染的接口详情
  459. apiFrom: {
  460. // 任务描述,仅查看
  461. apiDescription: "",
  462. // 接口参数,仅查看
  463. apiParameterRules: [],
  464. // 接口路径
  465. apiUrl: "",
  466. },
  467. // 其他参数
  468. selectOptions: {
  469. keyType: [
  470. { value: "地址", label: "地址" },
  471. { value: "村居", label: "村居" },
  472. { value: "街镇", label: "街镇" },
  473. { value: "区县", label: "区县" },
  474. // { value: "要素ID", label: "要素ID" },
  475. ],
  476. geocodeColumnKeyword: [],
  477. // 单位
  478. unit: [
  479. {
  480. value: "METER",
  481. label: "米",
  482. },
  483. {
  484. value: "KILOMETER",
  485. label: "千米",
  486. },
  487. ],
  488. inPrj: [
  489. {
  490. value: "WGS84",
  491. label: "WGS84",
  492. },
  493. {
  494. value: "SH2000",
  495. label: "SH2000",
  496. },
  497. {
  498. value: "UTM",
  499. label: "UTM",
  500. },
  501. {
  502. value: "WEB_Mercator",
  503. label: "WEB_Mercator",
  504. },
  505. ],
  506. compressionRatio: [
  507. {
  508. value: "100%",
  509. label: "100%",
  510. },
  511. {
  512. value: "80%",
  513. label: "80%",
  514. },
  515. {
  516. value: "50%",
  517. label: "50%",
  518. },
  519. {
  520. value: "25%",
  521. label: "25%",
  522. },
  523. ],
  524. outPrj: [
  525. {
  526. value: "WGS84",
  527. label: "WGS84",
  528. },
  529. {
  530. value: "SH2000",
  531. label: "SH2000",
  532. },
  533. {
  534. value: "UTM",
  535. label: "UTM",
  536. },
  537. {
  538. value: "WEB_Mercator",
  539. label: "WEB_Mercator",
  540. },
  541. ],
  542. outFileType: [
  543. {
  544. value: "geoJson",
  545. label: "geoJson",
  546. },
  547. {
  548. value: "shp",
  549. label: "shp",
  550. },
  551. {
  552. value: "csv",
  553. label: "csv",
  554. },
  555. {
  556. value: "xlsx",
  557. label: "xlsx",
  558. },
  559. ],
  560. },
  561. },
  562. // 搜索微功能服务的防抖定时器
  563. searchTimeout: null,
  564. taskUploadRawFile: null,
  565. };
  566. },
  567. computed: {
  568. /** 按一级场景分组,仅保留当前搜索结果下仍有卡片的分类 */
  569. groupedWgnSections() {
  570. const list = this.dmsServerList || [];
  571. return this.sceneMenuTree
  572. .map((cat) => {
  573. const codes = new Set((cat.children || []).map((ch) => ch.value));
  574. const items = list.filter((i) => codes.has(i.c_scene_name));
  575. return { cat, items };
  576. })
  577. .filter((g) => g.items.length > 0);
  578. },
  579. isTaskGeocodeZipForColumnInput() {
  580. const n =
  581. (this.taskUploadRawFile && this.taskUploadRawFile.name) ||
  582. this.taskColumn.from.c_source_file_name ||
  583. "";
  584. return String(n).toLowerCase().endsWith(".zip");
  585. },
  586. },
  587. watch: {
  588. groupedWgnSections: {
  589. handler(blocks) {
  590. this.$nextTick(() => {
  591. if (blocks.length) {
  592. if (!blocks.some((b) => b.cat.value === this.activeAnchorId)) {
  593. this.activeAnchorId = blocks[0].cat.value;
  594. }
  595. } else {
  596. this.activeAnchorId = null;
  597. }
  598. this.bindAnchorSpy();
  599. });
  600. },
  601. },
  602. },
  603. mounted() {
  604. // 任务负责人默认为当前登录用户
  605. this.taskColumn.from.c_user_id = this.$store.state.userInfo.id;
  606. // 任务创建人用户名默认为当前登录用户用户名
  607. this.taskColumn.from.c_user_name = this.$store.state.userInfo.username;
  608. this.searchServerList();
  609. },
  610. beforeUnmount() {
  611. this.unbindAnchorSpy();
  612. },
  613. methods: {
  614. sectionDomId(catValue) {
  615. return "wgn-section-" + String(catValue).replace(/\./g, "-");
  616. },
  617. scrollToAnchor(catValue) {
  618. const root = this.$refs.wgnScrollRoot;
  619. const el = document.getElementById(this.sectionDomId(catValue));
  620. if (!root || !el) return;
  621. this.anchorScrollLock = true;
  622. this.activeAnchorId = catValue;
  623. const rootRect = root.getBoundingClientRect();
  624. const elRect = el.getBoundingClientRect();
  625. const nextTop = elRect.top - rootRect.top + root.scrollTop - 8;
  626. root.scrollTo({ top: Math.max(0, nextTop), behavior: "smooth" });
  627. window.setTimeout(() => {
  628. this.anchorScrollLock = false;
  629. this.updateActiveAnchorFromScroll();
  630. }, 480);
  631. },
  632. unbindAnchorSpy() {
  633. const root = this.$refs.wgnScrollRoot;
  634. if (root && this._wgnOnScroll) {
  635. root.removeEventListener("scroll", this._wgnOnScroll);
  636. }
  637. this._wgnOnScroll = null;
  638. },
  639. bindAnchorSpy() {
  640. this.unbindAnchorSpy();
  641. const root = this.$refs.wgnScrollRoot;
  642. if (!root) return;
  643. this._wgnOnScroll = () => this.updateActiveAnchorFromScroll();
  644. root.addEventListener("scroll", this._wgnOnScroll, { passive: true });
  645. this.updateActiveAnchorFromScroll();
  646. },
  647. updateActiveAnchorFromScroll() {
  648. if (this.anchorScrollLock) return;
  649. const root = this.$refs.wgnScrollRoot;
  650. const blocks = this.groupedWgnSections;
  651. if (!root || !blocks.length) return;
  652. const rootRect = root.getBoundingClientRect();
  653. const threshold = 28;
  654. let current = blocks[0].cat.value;
  655. for (const { cat } of blocks) {
  656. const el = document.getElementById(this.sectionDomId(cat.value));
  657. if (!el) continue;
  658. const top = el.getBoundingClientRect().top - rootRect.top;
  659. if (top <= threshold) {
  660. current = cat.value;
  661. }
  662. }
  663. this.activeAnchorId = current;
  664. },
  665. isGeocodingTaskKeyTypeReadonly() {
  666. const label = this.$getDmsTypes("yzt_task_type", this.taskColumn.from.c_type);
  667. return label === "文件地名地址查询";
  668. },
  669. syncKeyTypeForGeocodingTask() {
  670. if (!this.isGeocodingTaskKeyTypeReadonly()) {
  671. return;
  672. }
  673. const pr = this.taskColumn.apiFrom.apiParameterRules;
  674. if (!Array.isArray(pr) || !pr.includes("keyType")) {
  675. return;
  676. }
  677. if (!this.taskColumn.from.c_source_data) {
  678. this.taskColumn.from.c_source_data = {};
  679. }
  680. this.taskColumn.from.c_source_data.keyType = "地址";
  681. },
  682. includesKey(keys) {
  683. let hasKey = false;
  684. keys.forEach((key) => {
  685. if (this.taskColumn.apiFrom.apiParameterRules.includes(key)) {
  686. hasKey = true;
  687. }
  688. });
  689. return hasKey;
  690. },
  691. handleTCUpload(emit) {
  692. this.taskUploadRawFile = emit.file;
  693. // 上传任务文件
  694. let formData = new FormData();
  695. formData.append("file", emit.file);
  696. formData.append("columnId", this.taskColumn.columnId);
  697. formData.append("type", 0);
  698. formData.append("paraName", emit.file.name);
  699. api
  700. .uploadFile(formData)
  701. .then((res) => {
  702. if (res.code === 200) {
  703. this.taskColumn.from.c_source_file_name = emit.file.name;
  704. this.taskColumn.from.c_source_file = res.content;
  705. this.refreshTaskGeocodeColumns(emit.file);
  706. this.syncKeyTypeForGeocodingTask();
  707. ElNotification.success({
  708. title: "成功",
  709. message: "上传任务文件成功",
  710. offset: 80,
  711. });
  712. } else {
  713. this.taskUploadRawFile = null;
  714. ElNotification.error({
  715. title: "失败",
  716. message: "上传任务文件失败" + res.msg,
  717. offset: 80,
  718. });
  719. }
  720. })
  721. .catch((e) => {
  722. this.taskUploadRawFile = null;
  723. ElNotification.error({
  724. title: "失败",
  725. message: "上传任务文件失败" + e,
  726. offset: 80,
  727. });
  728. });
  729. },
  730. changeTaskType() {
  731. if (this.taskColumn.from.c_type) {
  732. // 先把任务类型每个字符中间都添加一个句号
  733. let serviceId = this.taskColumn.from.c_type.split("").join(".");
  734. // 根据任务类型获取任务参数
  735. api
  736. .getSimpleContentList({
  737. columnId: systemConfig.columnIds[5],
  738. states: 0,
  739. pageSize: 1,
  740. page: 0,
  741. search: JSON.stringify([
  742. {
  743. field: "c_scene_name",
  744. searchType: 1,
  745. content: { value: serviceId },
  746. },
  747. ]),
  748. })
  749. .then((res) => {
  750. if (res.code === 200) {
  751. let apiInfo = res.content.data[0];
  752. // 接口描述
  753. this.taskColumn.apiFrom.apiDescription = apiInfo.content;
  754. // 接口参数规则
  755. this.taskColumn.apiFrom.apiParameterRules = JSON.parse(
  756. apiInfo.c_input_parameter_rules
  757. );
  758. // 接口路径
  759. this.taskColumn.apiFrom.apiUrl = apiInfo.c_url;
  760. const pr = this.taskColumn.apiFrom.apiParameterRules;
  761. if (pr && pr.includes("geocodeColumnKeyword") && this.taskUploadRawFile) {
  762. this.refreshTaskGeocodeColumns(this.taskUploadRawFile);
  763. }
  764. this.syncKeyTypeForGeocodingTask();
  765. } else {
  766. this.taskColumn.apiFrom.apiDescription = "";
  767. this.taskColumn.apiFrom.apiParameterRules = [];
  768. this.taskColumn.apiFrom.apiUrl = "";
  769. ElNotification.error({
  770. title: "失败",
  771. message: "获取任务参数失败" + res.msg,
  772. offset: 80,
  773. });
  774. }
  775. })
  776. .catch((e) => {
  777. this.taskColumn.apiFrom.apiDescription = "";
  778. this.taskColumn.apiFrom.apiParameterRules = [];
  779. ElNotification.error({
  780. title: "失败",
  781. message: "获取任务参数失败" + e,
  782. offset: 80,
  783. });
  784. });
  785. this.taskColumn.from.c_source_data = {};
  786. this.taskColumn.selectOptions.geocodeColumnKeyword = [];
  787. }
  788. },
  789. parseCsvHeaderLine(line) {
  790. const out = [];
  791. let cur = "";
  792. let inq = false;
  793. for (let i = 0; i < line.length; i++) {
  794. const c = line[i];
  795. if (c === '"') {
  796. inq = !inq;
  797. continue;
  798. }
  799. if (!inq && c === ",") {
  800. out.push(cur.trim());
  801. cur = "";
  802. continue;
  803. }
  804. cur += c;
  805. }
  806. out.push(cur.trim());
  807. return out.filter((h) => h.length > 0);
  808. },
  809. async refreshTaskGeocodeColumns(file) {
  810. const rules = this.taskColumn.apiFrom.apiParameterRules;
  811. if (!rules || !rules.includes("geocodeColumnKeyword")) {
  812. return;
  813. }
  814. if (!this.taskColumn.from.c_source_data) {
  815. this.taskColumn.from.c_source_data = {};
  816. }
  817. this.taskColumn.from.c_source_data.geocodeColumnKeyword = "";
  818. this.taskColumn.selectOptions.geocodeColumnKeyword = [];
  819. const raw = file && (file.raw || file);
  820. if (!raw || !raw.name) {
  821. return;
  822. }
  823. const name = String(raw.name).toLowerCase();
  824. if (name.endsWith(".zip")) {
  825. ElNotification.info({
  826. title: "数据列名",
  827. message: "zip 包请在「数据列名」中手动填写与各 xlsx 表头一致的列名",
  828. offset: 80,
  829. });
  830. return;
  831. }
  832. try {
  833. if (name.endsWith(".csv")) {
  834. const text = await raw.text();
  835. const firstLine = (text.split(/\r?\n/).find((l) => l.trim().length > 0) || "").trim();
  836. if (!firstLine) {
  837. return;
  838. }
  839. const headers = this.parseCsvHeaderLine(firstLine);
  840. this.taskColumn.selectOptions.geocodeColumnKeyword = headers.map((h) => ({
  841. value: h,
  842. label: h,
  843. }));
  844. ElNotification.success({
  845. title: "表头",
  846. message: "已解析 CSV 表头,共 " + headers.length + " 列",
  847. offset: 80,
  848. });
  849. } else if (name.endsWith(".xlsx") || name.endsWith(".xls")) {
  850. const buf = await raw.arrayBuffer();
  851. const wb = XLSX.read(buf, { type: "array" });
  852. const sheetName = wb.SheetNames[0];
  853. const sheet = wb.Sheets[sheetName];
  854. const rows = XLSX.utils.sheet_to_json(sheet, { header: 1, defval: "" });
  855. const headers = (rows[0] || []).map((c) => String(c).trim()).filter((c) => c.length > 0);
  856. this.taskColumn.selectOptions.geocodeColumnKeyword = headers.map((h) => ({
  857. value: h,
  858. label: h,
  859. }));
  860. ElNotification.success({
  861. title: "表头",
  862. message: "已解析 Excel 首行表头,共 " + headers.length + " 列",
  863. offset: 80,
  864. });
  865. }
  866. } catch (e) {
  867. console.error(e);
  868. ElNotification.warning({
  869. title: "表头解析",
  870. message: "解析表头失败,请确认上传为 CSV 或 XLSX",
  871. offset: 80,
  872. });
  873. }
  874. },
  875. // 申请使用微功能服务
  876. handleApply(item) {
  877. // 申请使用微功能服务时,先从localStorage中获取数据,填充到表单中
  878. let applyInfo = localStorage.getItem("wgnApplyInfo");
  879. if (applyInfo) {
  880. this.column.from = JSON.parse(applyInfo);
  881. }
  882. // 先打开弹窗,显示from表单,用户输入表单数据并提交
  883. this.column.from.c_interface_path = item.c_url;
  884. this.showFrom = true;
  885. },
  886. // 在线演示微功能服务
  887. handleOnlineDemo(item) {
  888. let routerPath = {};
  889. // console.log("000000000"+item);
  890. // 1. 解析目标路由(支持传参、命名路由等)
  891. if (item.c_scene_name == "view") {
  892. routerPath = {
  893. // path: item.c_url,
  894. path: "sksj",
  895. };
  896. // this.$router.push(routerPath);
  897. window.open(routerPath.path, "_blank");
  898. } else {
  899. routerPath = {
  900. path: "/wgnSingle", // 微功能
  901. query: { sceneId: item.c_scene_name },
  902. };
  903. const routeData = this.$router.resolve(routerPath);
  904. // 2. 打开新窗口(_blank 表示新窗口)
  905. window.open(routeData.href, "_blank");
  906. }
  907. },
  908. // 搜索微功能服务
  909. searchServerList() {
  910. // 添加防抖功能,避免频繁搜索导致性能问题
  911. if (this.searchTimeout != null) {
  912. clearTimeout(this.searchTimeout);
  913. }
  914. this.searchTimeout = setTimeout(() => {
  915. let requestParams = {
  916. columnId: systemConfig.columnIds[5],
  917. states: 0,
  918. pageSize: 999,
  919. page: 0,
  920. };
  921. if (this.searchStr) {
  922. requestParams.search = JSON.stringify([
  923. {
  924. field: "title",
  925. searchType: 2,
  926. content: { value: "%" + this.searchStr + "%" },
  927. },
  928. ]);
  929. }
  930. // 获取微功能服务列表
  931. api
  932. .getSimpleContentList(requestParams)
  933. .then((res) => {
  934. if (res.code === 200) {
  935. // 过滤掉自定义工具微功能服务1.5.8.1
  936. // this.dmsServerList = res.content.data.filter(
  937. // (item) => item.c_scene_name != "1.5.8.1"
  938. // );
  939. // 转换时间格式
  940. this.dmsServerList = res.content.data.map((item) => ({
  941. ...item,
  942. createTime: moment(item.create_time).format("YYYY-MM-DD HH:mm:ss"),
  943. }));
  944. this.total = this.dmsServerList.length;
  945. if (this.total === 0) {
  946. this.$message({
  947. message: "暂无数据",
  948. type: "info",
  949. });
  950. }
  951. // ElNotification.success({
  952. // title: "成功",
  953. // message: "搜索到" + this.dmsServerList.length + "条微功能服务",
  954. // offset: 80,
  955. // });
  956. } else {
  957. this.dmsServerList = [];
  958. this.total = 0;
  959. this.$message({
  960. message: "暂无数据",
  961. type: "info",
  962. });
  963. // ElNotification.error({
  964. // title: "失败",
  965. // message: "搜索到0条微功能服务",
  966. // offset: 80,
  967. // });
  968. }
  969. })
  970. .catch((e) => {
  971. this.total = 0;
  972. // ElNotification.error({
  973. // title: "失败",
  974. // message: "搜索微功能服务失败" + e,
  975. // offset: 80,
  976. // });
  977. });
  978. }, 0);
  979. },
  980. // 提交申请使用微功能服务表单
  981. handleApplySubmit() {
  982. let that = this;
  983. this.$refs.formRef.validate((valid) => {
  984. if (valid) {
  985. // 提交时把信息添加到localStorage中,下次打开弹窗时,从localStorage中获取数据,填充到表单中
  986. localStorage.setItem("wgnApplyInfo", JSON.stringify(that.column.from));
  987. // 标题:电话+时间
  988. that.column.from.title =
  989. that.column.from.c_unit_name +
  990. "_" +
  991. that.column.from.c_business_leader +
  992. "_" +
  993. that.column.from.c_phone;
  994. // 备注:申请使用微功能服务的详细信息
  995. let params = {
  996. content: JSON.stringify(that.column.from),
  997. columnId: that.column.columnId,
  998. modelId: that.column.modelId,
  999. };
  1000. api.addContent(params).then((res) => {
  1001. if (res.code === 200) {
  1002. // 确认申请使用
  1003. that.$message({
  1004. message: "申请成功,请等待审核通过后工作人员专人联系,请保持电话通畅!",
  1005. type: "success",
  1006. });
  1007. that.showFrom = false;
  1008. } else {
  1009. that.$message({
  1010. message: "申请使用" + item.title + "失败" + res.msg,
  1011. type: "error",
  1012. });
  1013. }
  1014. });
  1015. } else {
  1016. // 表单验证失败,提示用户填写完整信息
  1017. that.$message({
  1018. message: "请填写完整信息",
  1019. type: "warning",
  1020. });
  1021. }
  1022. });
  1023. },
  1024. // 创建任务
  1025. createTask() {
  1026. // 打开弹窗,显示任务创建表单
  1027. this.showTaskFrom = true;
  1028. },
  1029. // 提交任务创建表单
  1030. handleTaskSubmit() {
  1031. let that = this;
  1032. // 表单验证
  1033. this.$refs.taskFormRef.validate((valid) => {
  1034. if (valid) {
  1035. this.syncKeyTypeForGeocodingTask();
  1036. let content = this.taskColumn.from;
  1037. content.title =
  1038. this.$moment(new Date()).format("YYMMDD_HHmm") +
  1039. "_" +
  1040. (this.taskColumn.from.c_type
  1041. ? this.$getDmsTypes("yzt_task_type", this.taskColumn.from.c_type) + "_"
  1042. : "") +
  1043. content.c_name;
  1044. content.content = this.taskColumn.apiFrom.apiDescription
  1045. ? this.taskColumn.apiFrom.apiDescription
  1046. : "";
  1047. content.c_name = content.title;
  1048. // 提交任务创建表单
  1049. let params = {
  1050. content: JSON.stringify(content),
  1051. columnId: this.taskColumn.columnId,
  1052. modelId: this.taskColumn.modelId,
  1053. };
  1054. api.addContent(params).then(async (res) => {
  1055. if (res.code === 200) {
  1056. that.showTaskFrom = false;
  1057. const taskId = res.content;
  1058. try {
  1059. const runRes = await executeTask(taskId);
  1060. if (runRes && runRes.code === 200) {
  1061. that.$message({
  1062. message: "任务已创建并已提交后台执行,可在任务管理中查看进度与结果",
  1063. type: "success",
  1064. });
  1065. } else {
  1066. const errText =
  1067. (runRes && (runRes.message || runRes.content || runRes.msg)) || "未知错误";
  1068. that.$message({
  1069. message:
  1070. "任务已创建,但自动执行提交失败:" +
  1071. errText +
  1072. "。请到任务管理中找到该任务后手动点击「运行」",
  1073. type: "warning",
  1074. });
  1075. }
  1076. } catch (e) {
  1077. console.error(e);
  1078. that.$message({
  1079. message:
  1080. "任务已创建,但自动执行请求失败,请到任务管理中找到该任务后手动点击「运行」",
  1081. type: "warning",
  1082. });
  1083. }
  1084. } else {
  1085. that.$message({
  1086. message: "任务创建失败" + res.msg,
  1087. type: "error",
  1088. });
  1089. }
  1090. });
  1091. } else {
  1092. // 表单验证失败,提示用户填写完整信息
  1093. that.$message({
  1094. message: "请填写完整信息",
  1095. type: "warning",
  1096. });
  1097. }
  1098. });
  1099. },
  1100. },
  1101. };
  1102. </script>
  1103. <style lang="less" scoped>
  1104. .application-overview {
  1105. display: fixed !important;
  1106. width: 100%;
  1107. height: 100vh;
  1108. // background-color: #08224a;
  1109. background-color: #00002a;
  1110. color: #ffffff;
  1111. }
  1112. .wgn-body {
  1113. display: flex;
  1114. align-items: flex-start;
  1115. width: 100%;
  1116. box-sizing: border-box;
  1117. min-height: calc(100vh - 44px);
  1118. }
  1119. .wgn-side-nav {
  1120. flex: 0 0 200px;
  1121. padding: 12px 12px 24px 24px;
  1122. background: transparent;
  1123. border: none;
  1124. position: sticky;
  1125. top: 52px;
  1126. align-self: flex-start;
  1127. max-height: calc(100vh - 56px);
  1128. overflow-y: auto;
  1129. }
  1130. .wgn-anchor {
  1131. display: block;
  1132. width: 100%;
  1133. padding: 10px 4px 10px 0;
  1134. margin: 0 0 2px;
  1135. border: none;
  1136. background: transparent;
  1137. color: rgba(255, 255, 255, 0.85);
  1138. font-size: 16px;
  1139. text-align: left;
  1140. cursor: pointer;
  1141. border-radius: 4px;
  1142. }
  1143. .wgn-anchor:hover {
  1144. color: #ffffff;
  1145. }
  1146. .wgn-anchor.active {
  1147. color: #69b1ff;
  1148. font-weight: 600;
  1149. }
  1150. .wgn-anchor-section {
  1151. scroll-margin-top: 12px;
  1152. }
  1153. .wgn-anchor-section + .wgn-anchor-section {
  1154. margin-top: 36px;
  1155. }
  1156. .wgn-anchor-section-title {
  1157. margin: 0 0 18px;
  1158. font-size: 20px;
  1159. font-weight: 600;
  1160. color: #ffffff;
  1161. letter-spacing: 0.02em;
  1162. }
  1163. /* 右侧主内容区 */
  1164. .main-content {
  1165. flex: 1;
  1166. min-width: 0;
  1167. padding: 20px 40px 20px 8px;
  1168. overflow-y: auto;
  1169. }
  1170. /* 搜索栏样式 */
  1171. .search-bar {
  1172. margin-bottom: 20px;
  1173. .search-input {
  1174. width: 400px;
  1175. // ::v-deep .el-input__inner {
  1176. // background-color: rgba(255, 255, 255, 0.1);
  1177. // border: 1px solid rgba(255, 255, 255, 0.2);
  1178. // color: #ffffff;
  1179. // &::placeholder {
  1180. // color: rgba(255, 255, 255, 0.6);
  1181. // }
  1182. // }
  1183. // ::v-deep .el-input__prepend {
  1184. // background-color: rgba(255, 255, 255, 0.1);
  1185. // border-color: rgba(255, 255, 255, 0.2);
  1186. // color: rgba(255, 255, 255, 0.8);
  1187. // }
  1188. }
  1189. .search-btn {
  1190. margin-left: 10px;
  1191. }
  1192. }
  1193. /* 过滤标签样式 */
  1194. .filter-tabs {
  1195. margin-bottom: 30px;
  1196. :deep(.el-radio-group) {
  1197. .el-radio-button {
  1198. background-color: rgba(255, 255, 255, 0.1);
  1199. border-color: rgba(255, 255, 255, 0.2);
  1200. color: rgba(255, 255, 255, 0.8);
  1201. &:first-child .el-radio-button__inner {
  1202. border-left-color: rgba(255, 255, 255, 0.2);
  1203. }
  1204. .el-radio-button__inner {
  1205. background-color: transparent;
  1206. border-color: rgba(255, 255, 255, 0.2);
  1207. color: rgba(255, 255, 255, 0.8);
  1208. }
  1209. &.is-active {
  1210. background-color: #1890ff;
  1211. .el-radio-button__inner {
  1212. background-color: #1890ff;
  1213. border-color: #1890ff;
  1214. color: #ffffff;
  1215. }
  1216. }
  1217. }
  1218. }
  1219. }
  1220. .wgn-content {
  1221. // height: 640px;
  1222. height: calc(100vh - 160px);
  1223. overflow: auto;
  1224. padding-right: 20px;
  1225. }
  1226. /* 应用卡片网格样式 */
  1227. .applications-grid {
  1228. display: grid;
  1229. grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  1230. gap: 25px;
  1231. }
  1232. /* 应用卡片样式 */
  1233. .application-card {
  1234. background-color: rgba(255, 255, 255, 0.05);
  1235. border: 1px solid rgba(255, 255, 255, 0.1);
  1236. border-radius: 8px;
  1237. overflow: hidden;
  1238. transition: all 0.3s ease;
  1239. &:hover {
  1240. transform: translateY(-5px);
  1241. box-shadow: 0 10px 30px rgba(24, 144, 255, 0.2);
  1242. border-color: rgba(24, 144, 255, 0.4);
  1243. }
  1244. .card-image {
  1245. width: 100%;
  1246. height: 160px;
  1247. overflow: hidden;
  1248. position: relative;
  1249. img {
  1250. width: 100%;
  1251. height: 100%;
  1252. object-fit: cover;
  1253. transition: transform 0.3s ease;
  1254. }
  1255. // &:hover img {
  1256. // transform: scale(1.05);
  1257. // }
  1258. }
  1259. .card-content {
  1260. padding: 15px;
  1261. }
  1262. .wgn-header {
  1263. display: flex;
  1264. justify-content: space-between;
  1265. align-items: center;
  1266. margin-bottom: 10px;
  1267. .wgn-name {
  1268. font-size: 16px;
  1269. font-weight: bold;
  1270. margin: 0;
  1271. color: #ffffff;
  1272. }
  1273. .wgn-level {
  1274. font-size: 12px;
  1275. color: rgba(255, 255, 255, 0.6);
  1276. background-color: rgba(27, 117, 236, 0.8);
  1277. padding: 2px 6px;
  1278. border-radius: 4px;
  1279. }
  1280. .wgn-version {
  1281. font-size: 12px;
  1282. color: rgba(255, 255, 255, 0.6);
  1283. background-color: rgba(255, 255, 255, 0.1);
  1284. padding: 2px 6px;
  1285. border-radius: 4px;
  1286. }
  1287. }
  1288. .wgn-tags {
  1289. margin-bottom: 10px;
  1290. .el-tag {
  1291. margin-right: 5px;
  1292. margin-bottom: 5px;
  1293. }
  1294. }
  1295. .wgn-description {
  1296. font-size: 13px;
  1297. line-height: 1.6;
  1298. height: 40px;
  1299. color: rgba(255, 255, 255, 0.7);
  1300. margin-bottom: 15px;
  1301. overflow: hidden;
  1302. text-overflow: ellipsis;
  1303. display: -webkit-box;
  1304. -webkit-line-clamp: 2;
  1305. -webkit-box-orient: vertical;
  1306. }
  1307. .wgn-footer {
  1308. display: flex;
  1309. justify-content: space-between;
  1310. align-items: center;
  1311. .wgn-date {
  1312. font-size: 12px;
  1313. color: rgba(255, 255, 255, 0.5);
  1314. }
  1315. .visit-button {
  1316. padding: 4px 12px;
  1317. font-size: 12px;
  1318. border-radius: 4px;
  1319. }
  1320. }
  1321. }
  1322. /* 加载更多按钮 */
  1323. .load-more {
  1324. text-align: center;
  1325. margin-bottom: 30px;
  1326. .el-button {
  1327. padding: 10px 30px;
  1328. background-color: rgba(24, 144, 255, 0.2);
  1329. border-color: rgba(24, 144, 255, 0.4);
  1330. color: #1890ff;
  1331. &:hover {
  1332. background-color: rgba(24, 144, 255, 0.3);
  1333. border-color: rgba(24, 144, 255, 0.6);
  1334. }
  1335. }
  1336. }
  1337. /* 响应式设计 */
  1338. @media (max-width: 1200px) {
  1339. .applications-grid {
  1340. grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  1341. gap: 20px;
  1342. }
  1343. }
  1344. @media (max-width: 992px) {
  1345. .sidebar {
  1346. width: 180px;
  1347. .sidebar-menu .menu-item {
  1348. padding: 12px 15px;
  1349. i {
  1350. font-size: 16px;
  1351. }
  1352. }
  1353. }
  1354. .main-content {
  1355. padding: 15px 20px;
  1356. }
  1357. .search-input {
  1358. width: 300px !important;
  1359. }
  1360. .applications-grid {
  1361. grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  1362. gap: 15px;
  1363. }
  1364. }
  1365. </style>