workSpace.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. <template>
  2. <div class="workSpace">
  3. <div class="ac_left">
  4. <saveCard
  5. title="最近使用"
  6. :data="recentUse"
  7. :type="0"
  8. @saveClick="openApp"
  9. />
  10. <saveCard title="收藏" :data="collect" :type="1" @saveClick="openApp" />
  11. </div>
  12. <div class="ac_right">
  13. <div class="ac_header">
  14. <div class="ac_h_top">
  15. <span @click="changeShowPage(0)">
  16. <svg
  17. width="20"
  18. height="20"
  19. viewBox="0 0 20 20"
  20. xmlns="http://www.w3.org/2000/svg"
  21. >
  22. <path
  23. d="M14.0625 2.1875C11.9914 2.1875 10.3125 3.86643 10.3125 5.9375C10.3125 8.00857 11.9914 9.6875 14.0625 9.6875C16.1336 9.6875 17.8125 8.00857 17.8125 5.9375C17.8125 3.86643 16.1336 2.1875 14.0625 2.1875ZM11.5625 5.9375C11.5625 4.55679 12.6818 3.4375 14.0625 3.4375C15.4432 3.4375 16.5625 4.55679 16.5625 5.9375C16.5625 7.31821 15.4432 8.4375 14.0625 8.4375C12.6818 8.4375 11.5625 7.31821 11.5625 5.9375Z"
  24. />
  25. <path
  26. d="M2.5 3.75C2.5 3.05964 3.05964 2.5 3.75 2.5H8.125C8.81536 2.5 9.375 3.05964 9.375 3.75V8.125C9.375 8.81536 8.81536 9.375 8.125 9.375H3.75C3.05964 9.375 2.5 8.81536 2.5 8.125V3.75ZM3.75 3.75V8.125H8.125V3.75H3.75Z"
  27. />
  28. <path
  29. d="M2.5 11.875C2.5 11.1846 3.05964 10.625 3.75 10.625H8.125C8.81536 10.625 9.375 11.1846 9.375 11.875V16.25C9.375 16.9404 8.81536 17.5 8.125 17.5H3.75C3.05964 17.5 2.5 16.9404 2.5 16.25V11.875ZM3.75 11.875V16.25H8.125V11.875H3.75Z"
  30. />
  31. <path
  32. d="M10.625 11.875C10.625 11.1846 11.1846 10.625 11.875 10.625H16.25C16.9404 10.625 17.5 11.1846 17.5 11.875V16.25C17.5 16.9404 16.9404 17.5 16.25 17.5H11.875C11.1846 17.5 10.625 16.9404 10.625 16.25V11.875ZM11.875 16.25H16.25V11.875H11.875V16.25Z"
  33. />
  34. </svg>
  35. 应用管理</span
  36. >
  37. <span class="ac_h_t_active">
  38. <svg
  39. width="20"
  40. height="20"
  41. viewBox="0 0 20 20"
  42. xmlns="http://www.w3.org/2000/svg"
  43. >
  44. <rect width="20" height="20" fill="white" />
  45. <path
  46. fill-rule="evenodd"
  47. clip-rule="evenodd"
  48. d="M9.70072 1.32632C9.88727 1.22456 10.1127 1.22456 10.2993 1.32632L17.1743 5.07632C17.3751 5.18584 17.5 5.39628 17.5 5.625V14.375C17.5 14.6037 17.3751 14.8142 17.1743 14.9237L10.2993 18.6737C10.1127 18.7754 9.88727 18.7754 9.70072 18.6737L2.82572 14.9237C2.62493 14.8142 2.5 14.6037 2.5 14.375V5.625C2.5 5.39628 2.62493 5.18584 2.82572 5.07632L9.70072 1.32632ZM3.75 6.79282V14.004L9.375 17.0722V14.1039L6.55344 12.4109C6.36519 12.298 6.25 12.0945 6.25 11.875V8.45949L3.75 6.79282ZM7.5 8.47887V10.7711L9.375 9.64613V7.35387L7.5 8.47887ZM10.625 7.35387V9.64613L12.5 10.7711V8.47887L10.625 7.35387ZM13.75 8.45949V11.875C13.75 12.0945 13.6348 12.298 13.4466 12.4109L10.625 14.1039V17.0722L16.25 14.004V6.79282L13.75 8.45949ZM15.668 5.67854L10 2.58693L4.33205 5.67854L6.8926 7.38557L9.67844 5.71407C9.87637 5.59531 10.1236 5.59531 10.3216 5.71407L13.1074 7.38557L15.668 5.67854ZM10 13.0211L11.9102 11.875L10 10.7289L8.08978 11.875L10 13.0211Z"
  49. />
  50. </svg>
  51. 工作空间</span
  52. >
  53. </div>
  54. <div class="ac_h_banner" v-if="bannerObj">
  55. <img
  56. :src="bannerObj.poster"
  57. alt="banner图"
  58. />
  59. </div>
  60. <div class="ac_h_bottom">
  61. <div class="ac_h_b_typeList">
  62. <span
  63. :class="{ ac_h_b_typeList_active: showType === '' }"
  64. @click="changeShowType('')"
  65. >
  66. 全部
  67. </span>
  68. <span
  69. :class="{ ac_h_b_typeList_active: showType === '1' }"
  70. @click="changeShowType('1')"
  71. >
  72. 智能体
  73. </span>
  74. <span
  75. :class="{ ac_h_b_typeList_active: showType === '2' }"
  76. @click="changeShowType('2')"
  77. >
  78. 工作流
  79. </span>
  80. </div>
  81. <div class="ac_h_b_selectList">
  82. <el-select
  83. v-model="statusSelect"
  84. placeholder="请选择"
  85. @change="changeSelectType"
  86. style="width: 150px;margin-right: 10px;"
  87. >
  88. <el-option
  89. v-for="item in statusSelectList"
  90. :key="item.index"
  91. :label="item.label"
  92. :value="item.index"
  93. ></el-option>
  94. </el-select>
  95. <el-select
  96. v-model="tagSelect"
  97. placeholder="请选择"
  98. @change="changeSelectType"
  99. style="width: 150px;margin-right: 10px;"
  100. >
  101. <el-option
  102. v-for="item in tagSelectList"
  103. :key="item.index"
  104. :label="item.label"
  105. :value="item.index"
  106. ></el-option>
  107. </el-select>
  108. <el-input
  109. v-model="searchText"
  110. style="width: 200px;"
  111. placeholder="请输入名称"
  112. @keyup.enter.native="getData"
  113. clearable
  114. />
  115. <el-button
  116. type="primary"
  117. style="margin-left: 10px;"
  118. icon="el-icon-search"
  119. @click="getData"
  120. ></el-button>
  121. <el-button type="primary" @click="resetData">重置</el-button>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="ac_content">
  126. <div class="ac_c_item" v-for="item in 10">
  127. <div class="ac_c_i_top">
  128. <img
  129. src="https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/default%2F%E6%B5%8B%E8%AF%951733981587859.jpg"
  130. alt="封面"
  131. />
  132. <div>
  133. <div>名称名称名称名称名称名称名称名称</div>
  134. <span class="ac_c_i_t_brief">简介简介简介简介简介</span>
  135. <span class="ac_c_i_t_time">2024-12-12 10:22:04 编辑</span>
  136. </div>
  137. </div>
  138. <div class="ac_c_i_t_popover">
  139. <div
  140. class="ac_c_i_t_p_box"
  141. v-if="editAppCard"
  142. v-click-outside="handleBlur"
  143. >
  144. <div>编辑</div>
  145. <div>收藏</div>
  146. <div>复制</div>
  147. <div>删除</div>
  148. </div>
  149. <svg
  150. t="1732786015570"
  151. @click.stop="updateCard(!editAppCard)"
  152. class="icon"
  153. viewBox="0 0 1024 1024"
  154. version="1.1"
  155. xmlns="http://www.w3.org/2000/svg"
  156. p-id="9199"
  157. width="200"
  158. height="200"
  159. >
  160. <path
  161. d="M192 443.733333c-38.4 0-68.266667 29.866667-68.266667 68.266667 0 38.4 29.866667 68.266667 68.266667 68.266667s68.266667-29.866667 68.266667-68.266667c0-38.4-29.866667-68.266667-68.266667-68.266667zM512 443.733333c-38.4 0-68.266667 29.866667-68.266667 68.266667 0 38.4 29.866667 68.266667 68.266667 68.266667s68.266667-29.866667 68.266667-68.266667c0-38.4-29.866667-68.266667-68.266667-68.266667zM832 443.733333c-38.4 0-68.266667 29.866667-68.266667 68.266667 0 38.4 29.866667 68.266667 68.266667 68.266667s68.266667-29.866667 68.266667-68.266667c0-38.4-34.133333-68.266667-68.266667-68.266667z"
  162. fill="#111111"
  163. p-id="9200"
  164. ></path>
  165. </svg>
  166. </div>
  167. <div class="ac_c_i_bottom">
  168. <div>标签</div>
  169. <span>工作流</span>
  170. </div>
  171. </div>
  172. <div class="ac_c_empty" v-if="dataList.length === 0">
  173. <span>暂无数据...</span>
  174. </div>
  175. </div>
  176. </div>
  177. <!-- <addAppDialog
  178. ref="addAppDialogRef"
  179. :typeList="typeList"
  180. @success="addAppSuccess"
  181. />-->
  182. </div>
  183. </template>
  184. <script>
  185. const clickOutside = {
  186. bind(el, binding) {
  187. // 在元素上绑定一个点击事件监听器
  188. el.clickOutsideEvent = function(event) {
  189. // 检查点击事件是否发生在元素的内部
  190. if (!(el === event.target || el.contains(event.target))) {
  191. // 如果点击事件发生在元素的外部,则触发指令绑定的方法,将点击的event数据传过去
  192. binding.value(event);
  193. }
  194. };
  195. // 在文档上添加点击事件监听器
  196. document.addEventListener("click", el.clickOutsideEvent);
  197. },
  198. unbind(el) {
  199. // 在元素上解除点击事件监听器
  200. document.removeEventListener("click", el.clickOutsideEvent);
  201. }
  202. };
  203. import saveCard from "../dialog/saveCard.vue";
  204. export default {
  205. components: {
  206. saveCard
  207. },
  208. directives: {
  209. "click-outside": clickOutside // 注册自定义指令
  210. },
  211. data() {
  212. return {
  213. showType: "",
  214. searchText: "",
  215. statusSelect: "",
  216. statusSelectList: [
  217. { index: "", label: "全部状态" },
  218. { index: 1, label: "未发布" },
  219. { index: 2, label: "已发布" }
  220. ],
  221. tagSelect: "",
  222. tagSelectList: [
  223. { index: "", label: "全部标签" },
  224. { index: 1, label: "标签1" },
  225. { index: 2, label: "标签2" },
  226. { index: 3, label: "标签3" },
  227. { index: 4, label: "标签4" },
  228. { index: 5, label: "标签5" }
  229. ],
  230. userId: this.$route.query["userid"],
  231. org: this.$route.query["org"],
  232. oid: this.$route.query["oid"],
  233. getDataLoading: false,
  234. dataList: [1],
  235. recentUse: [],
  236. collect: [],
  237. editAppCard: null,
  238. bannerObj:null
  239. };
  240. },
  241. computed: {},
  242. methods: {
  243. changeType(newIndex) {
  244. let flag = this.showType === newIndex;
  245. this.showType = newIndex;
  246. if (!flag) {
  247. this.getData();
  248. }
  249. },
  250. changeShowType(newType) {
  251. if (this.showType === newType) return;
  252. this.showType = newType;
  253. this.getData();
  254. },
  255. changeSelectType() {
  256. this.getData();
  257. },
  258. getData() {
  259. this.$message.info("获取数据暂未开发...");
  260. },
  261. updateCard(newValue) {
  262. // if (this.editAppCard === id) return (this.editAppCard = null);
  263. this.editAppCard = newValue;
  264. },
  265. handleBlur() {
  266. this.updateCard(null);
  267. },
  268. openApp(item, type = 0) {
  269. console.log("👉", item);
  270. },
  271. resetData() {
  272. this.searchText = "";
  273. this.statusSelect = "";
  274. this.tagSelectList = "";
  275. this.showType = "";
  276. this.getData();
  277. },
  278. changeShowPage(newPage) {
  279. this.$emit("changeShowCard", newPage);
  280. },
  281. getBanner(){
  282. let params = {
  283. uid:this.userId,
  284. oid:this.oid,
  285. org:this.org,
  286. type:4
  287. }
  288. this.ajax.get(this.$store.state.api+"select_bannerByoidORorg",params).then(res=>{
  289. let _data = res.data[0];
  290. if(_data[0]){
  291. this.bannerObj = _data[0];
  292. }else{
  293. this.bannerObj = null
  294. }
  295. }).catch(e=>{
  296. console.log("获取banner图失败")
  297. console.log(e)
  298. })
  299. }
  300. },
  301. mounted() {
  302. this.getBanner()
  303. }
  304. };
  305. </script>
  306. <style scoped>
  307. .workSpace {
  308. width: 100vw;
  309. height: 100vh;
  310. background-color: #f2f4f7;
  311. margin: 0;
  312. overflow: auto;
  313. box-sizing: border-box;
  314. padding: 20px;
  315. display: flex;
  316. justify-content: space-between;
  317. }
  318. .ac_left {
  319. width: 280px;
  320. min-width: 280px;
  321. margin-right: 20px;
  322. height: 100%;
  323. border-radius: 5px;
  324. background-color: #fff;
  325. box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  326. box-sizing: border-box;
  327. padding: 10px;
  328. overflow: auto;
  329. }
  330. .ac_right {
  331. width: calc(100% - 280px);
  332. min-width: 800px;
  333. height: 100%;
  334. overflow-y: hidden;
  335. display: flex;
  336. flex-direction: column;
  337. }
  338. .ac_header {
  339. width: 100%;
  340. height: auto;
  341. border-radius: 5px;
  342. box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  343. background-color: #fff;
  344. }
  345. .ac_h_top {
  346. width: 100%;
  347. height: 50px;
  348. display: flex;
  349. align-items: center;
  350. box-sizing: border-box;
  351. padding: 0 15px;
  352. border-bottom: 1px solid #eeeeee;
  353. position: relative;
  354. justify-content: center;
  355. }
  356. .ac_h_top > span {
  357. font-size: 22px;
  358. position: relative;
  359. margin-right: 25px;
  360. cursor: pointer;
  361. display: flex;
  362. align-items: center;
  363. }
  364. .ac_h_top > span > svg {
  365. width: 22px;
  366. height: 22px;
  367. fill: #1a1a1a;
  368. margin-right: 10px;
  369. }
  370. .ac_h_t_active {
  371. color: #0354d7;
  372. }
  373. .ac_h_t_active > svg {
  374. fill: #0354d7 !important;
  375. }
  376. .ac_h_banner {
  377. width: 100%;
  378. height: 300px;
  379. border-radius: 5px;
  380. overflow: hidden;
  381. box-sizing: border-box;
  382. padding: 10px;
  383. }
  384. .ac_h_banner > img {
  385. width: 100%;
  386. height: 100%;
  387. object-fit: cover;
  388. border-radius: 5px;
  389. }
  390. .ac_h_bottom {
  391. width: 100%;
  392. height: auto;
  393. padding: 10px 15px 10px 15px;
  394. box-sizing: border-box;
  395. display: flex;
  396. justify-content: space-between;
  397. align-items: center;
  398. }
  399. .ac_h_b_typeList {
  400. width: calc(100% - 666px);
  401. height: auto;
  402. display: flex;
  403. flex-wrap: wrap;
  404. box-sizing: border-box;
  405. align-items: center;
  406. }
  407. .ac_h_b_typeList > span {
  408. font-size: 18px;
  409. margin-right: 20px;
  410. margin-top: 10px;
  411. margin-bottom: 5px;
  412. cursor: pointer;
  413. }
  414. .ac_h_b_typeList_active {
  415. color: #007aff;
  416. }
  417. .ac_h_b_selectList {
  418. margin-left: 15px;
  419. margin-bottom: 10px;
  420. display: flex;
  421. align-items: center;
  422. }
  423. .ac_content {
  424. width: 100%;
  425. flex: 1;
  426. height: auto;
  427. margin-top: 10px;
  428. overflow: auto;
  429. min-height: 200px;
  430. }
  431. .ac_c_item {
  432. width: calc(100% / 5 - (15px * 4) / 5);
  433. height: auto;
  434. background-color: #fff;
  435. border-radius: 10px;
  436. box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  437. box-sizing: border-box;
  438. padding: 15px;
  439. margin-right: 15px;
  440. margin-bottom: 15px;
  441. float: left;
  442. position: relative;
  443. /* cursor: pointer; */
  444. }
  445. @media screen and (min-width: 1400px) {
  446. .ac_c_item {
  447. width: calc(100% / 5 - (15px * 4) / 5) !important;
  448. }
  449. .ac_c_item:nth-child(5n) {
  450. margin-right: 0px !important;
  451. /* background-color: red; */
  452. }
  453. }
  454. @media screen and (max-width: 1380px) {
  455. .ac_c_item {
  456. width: calc(100% / 4 - (15px * 3) / 4) !important;
  457. }
  458. .ac_c_item:nth-child(4n) {
  459. margin-right: 0px !important;
  460. }
  461. /* .ac_c_item:nth-child(5n) {
  462. margin-right: 0 !important;
  463. } */
  464. }
  465. @media screen and (max-width: 1080px) {
  466. .ac_c_item {
  467. width: calc(100% / 3 - (15px * 2) / 3) !important;
  468. }
  469. .ac_c_item:nth-child(5n) {
  470. margin-right: 15px !important;
  471. }
  472. .ac_c_item:nth-of-type(4n) {
  473. margin-right: 15px !important;
  474. }
  475. .ac_c_item:nth-child(3n) {
  476. margin-right: 0 !important;
  477. }
  478. }
  479. .ac_c_i_top {
  480. width: 100%;
  481. height: 180px;
  482. display: flex;
  483. justify-content: space-between;
  484. position: relative;
  485. }
  486. .ac_c_i_top > img {
  487. width: 130px;
  488. height: 130px;
  489. object-fit: cover;
  490. border-radius: 10px;
  491. margin: 10px 15px 10px 10px;
  492. }
  493. .ac_c_i_top > div {
  494. box-sizing: border-box;
  495. padding: 20px 0px 10px 0px;
  496. flex: 1;
  497. height: 100%;
  498. width: calc(100% - 130px - 10px - 15px);
  499. }
  500. .ac_c_i_top > div > div {
  501. font-size: 18px;
  502. width: calc(100%);
  503. overflow: hidden;
  504. text-overflow: ellipsis;
  505. white-space: nowrap;
  506. }
  507. .ac_c_i_t_brief {
  508. margin: 5px 0;
  509. font-size: 1em;
  510. color: #8991a1;
  511. width: calc(100%);
  512. height: 74px;
  513. /* 第四行溢出显示... */
  514. display: -webkit-box;
  515. display: block;
  516. overflow: hidden;
  517. text-overflow: ellipsis;
  518. -webkit-line-clamp: 4;
  519. -webkit-box-orient: vertical;
  520. }
  521. .ac_c_i_t_time {
  522. margin: 5px 0;
  523. font-size: .9em !important;
  524. color: #8991a1;
  525. width: 100%;
  526. height: auto;
  527. white-space: nowrap;
  528. overflow: hidden;
  529. text-overflow: ellipsis;
  530. }
  531. .ac_c_i_bottom {
  532. width: 100%;
  533. height: 30px;
  534. display: flex;
  535. align-items: center;
  536. justify-content: space-between;
  537. box-sizing: border-box;
  538. padding: 0 10px;
  539. }
  540. .ac_c_empty {
  541. width: 100%;
  542. height: 40%;
  543. display: flex;
  544. box-sizing: border-box;
  545. padding-top: 2%;
  546. justify-content: center;
  547. /* align-items: center; */
  548. }
  549. .ac_c_i_t_popover {
  550. width: 30px;
  551. height: 30px;
  552. position: absolute;
  553. right: 10px;
  554. top: 10px;
  555. }
  556. .ac_c_i_t_popover svg {
  557. width: 30px;
  558. height: 25px;
  559. cursor: pointer;
  560. background-color: #f2f2f2;
  561. border-radius: 4px;
  562. }
  563. .ac_c_i_t_p_box {
  564. position: absolute;
  565. height: auto;
  566. top: 100%;
  567. right: 0;
  568. padding: 8px;
  569. border-radius: 8px 0 8px 8px;
  570. background-color: #fff;
  571. box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  572. width: auto;
  573. }
  574. .ac_c_i_t_p_box > div {
  575. width: 80px;
  576. height: 30px;
  577. cursor: pointer;
  578. transition: 0.3s;
  579. font-weight: bold;
  580. font-size: 0.9em;
  581. border-radius: 5px;
  582. display: flex;
  583. justify-content: center;
  584. align-items: center;
  585. position: relative;
  586. box-sizing: border-box;
  587. }
  588. .ac_c_i_t_p_box > div:hover {
  589. background-color: #f2f4f7;
  590. }
  591. </style>