index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. /*我的项目*/
  2. <template>
  3. <div class="myproject">
  4. <div class="title">
  5. <span>我的项目</span>
  6. </div>
  7. <div class="btn">
  8. <el-row>
  9. <el-button class="btn_color1" @click="dialogVisible = true">新建项目</el-button>
  10. <el-button class="btn_color1">新建文件夹</el-button>
  11. <el-button type="warning">导入</el-button>
  12. </el-row>
  13. </div>
  14. <div class="scher">
  15. <span></span>
  16. <span class="xuanzhogn">1个已选中</span><span style="padding: 0 5px;">|</span>
  17. <div class="input">
  18. <el-select v-model="value" placeholder="请选择">
  19. <el-option
  20. v-for="item in options"
  21. :key="item.value"
  22. :label="item.label"
  23. :value="item.value">
  24. </el-option>
  25. </el-select>
  26. <el-input v-model="input" class="text" ></el-input>
  27. </div>
  28. </div>
  29. <!-- 表格 -->
  30. <template>
  31. <el-table
  32. v-loading="loading"
  33. element-loading-text="拼命加载中"
  34. :data="tableData"
  35. class="lbg_color2"
  36. @row-click="rowclinck"
  37. style="width: 100%">
  38. <el-table-column
  39. label="名称"
  40. prop="name"
  41. >
  42. </el-table-column>
  43. <el-table-column
  44. prop="updateTime"
  45. label="最近编辑时间"
  46. >
  47. </el-table-column>
  48. <el-table-column
  49. prop="remark"
  50. label="描述">
  51. </el-table-column>
  52. <el-table-column
  53. prop="isshare"
  54. label="是否公开">
  55. <template slot-scope="scope">
  56. <span slot="content">{{
  57. scope.row.isshare == '0'?"公有":"私有"
  58. }}</span>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <div class="pagination">
  63. <Pagination
  64. :pagination-config="paginationConfig"
  65. @putPagination="getPagination"
  66. ></Pagination>
  67. </div>
  68. </template>
  69. <!-- 、新建文件 -->
  70. <el-dialog
  71. title="创建新项目"
  72. :visible.sync="dialogVisible"
  73. width="30%"
  74. >
  75. <el-form class="newfile">
  76. <el-form-item label="项目名称:" :label-width="formLabelWidth5">
  77. <!-- <span class="sblock">项目类型</span> -->
  78. <el-radio v-model="newobj.isshare" :label="0"
  79. >公开</el-radio
  80. >
  81. <el-radio v-model="newobj.isshare" :label="1">私有</el-radio>
  82. </el-form-item>
  83. <el-form-item label="项目名称:" :label-width="formLabelWidth5">
  84. <el-input v-model="newobj.name" autocomplete="off"></el-input>
  85. </el-form-item>
  86. <el-form-item label="项目描述:" :label-width="formLabelWidth5">
  87. <el-input v-model="newobj.remark" autocomplete="off"></el-input>
  88. </el-form-item>
  89. <!-- <div class="disflex">
  90. <span class="sblock">项目名称:</span>
  91. <el-input class="inpwidth" v-model="project.name"></el-input>
  92. </div>
  93. <div class="disflex">
  94. <span class="sblock">项目名称:</span>
  95. <el-input class="inpwidth" v-model="project.name"></el-input>
  96. </div> -->
  97. </el-form>
  98. <span slot="footer" class="dialog-footer">
  99. <el-button @click="dialogVisible = false">取 消</el-button>
  100. <el-button type="primary" @click="dialogVisible = false;newsave()">确 定</el-button>
  101. </span>
  102. </el-dialog>
  103. </div>
  104. </template>
  105. <script>
  106. import Pagination from '@/components/Pagination'
  107. import { request, getImage } from '@/utils/request'
  108. export default {
  109. name: 'Project',
  110. components: {
  111. Pagination
  112. },
  113. data() {
  114. return {
  115. loading: false, // 是显示加载
  116. paginationConfig: {
  117. hideSinglePage: false,
  118. page: 1,
  119. size: 15,
  120. sizeList: [10, 15, 30, 50],
  121. layout: 'total, sizes, prev, pager, next, jumper',
  122. total: 0,
  123. },
  124. options:[{
  125. value: '0',
  126. label: '搜索项目'
  127. }, {
  128. value: '1',
  129. label: '搜索标签'
  130. }
  131. ],
  132. newobj:{
  133. name:'',
  134. remark:'',
  135. image:'',
  136. isshare:0,
  137. }, // 新建项目参数
  138. formLabelWidth: '60px',
  139. formLabelWidth2:'73px',
  140. formLabelWidth4:'37px',
  141. formLabelWidth5:'100px',
  142. formLabelWidth6:'120px',
  143. value:'0',
  144. input:'',
  145. tableData: [
  146. // {
  147. // date: '2022-05-02',
  148. // name: '封顶圆柱壳',
  149. // address: '案例1'
  150. // }, {
  151. // date: '2016-05-04',
  152. // name: '气缸盖二次接触接头热/结构分析综述 ',
  153. // address: '案例2'
  154. // }, {
  155. // date: '2019-11-01',
  156. // name: 'RBE3(通用刚体连杆)',
  157. // address: '案例3'
  158. // }
  159. ],
  160. dialogVisible: false,
  161. project:{
  162. fileType:"公开",
  163. name:''
  164. }
  165. }
  166. },
  167. created() {
  168. },
  169. mounted(){
  170. this.init();
  171. },
  172. methods: {
  173. init(){
  174. this.projectlist();
  175. },
  176. // 分页查询
  177. getPagination(data) {
  178. this.paginationConfig = data;
  179. this.projectlist();
  180. },
  181. projectlist(){//列表加载
  182. const loading = this.$loading({
  183. lock: true,
  184. text: 'Loading',
  185. spinner: 'el-icon-loading',
  186. background: 'rgba(0, 0, 0, 0.7)',
  187. })
  188. setTimeout(() => {
  189. const params = {
  190. transCode: 'C00001',
  191. page: this.paginationConfig.page,
  192. count: this.paginationConfig.size,
  193. }
  194. request(params)
  195. .then((res) => {
  196. loading.close()
  197. this.paginationConfig.total = res.total
  198. this.tableData=res.rows;
  199. })
  200. .catch((err) => {
  201. loading.close()
  202. })
  203. }, 1500)
  204. },
  205. rowclinck(row, column, event){
  206. console.log(row)
  207. this.$router.push({path:'/index',query:{pid:row.id}});
  208. //this.$router.push({path:'/index',query:{pid:'fa26eb863f664446a20f7d461dfafd71'}});
  209. },
  210. newsave(){ //新建项目
  211. const params = {
  212. transCode: 'C00002',
  213. name: this.newobj.name,
  214. remark: this.newobj.remark,
  215. isshare: this.newobj.isshare,
  216. }
  217. request(params)
  218. .then((res) => {
  219. this.projectlist();
  220. })
  221. .catch((err) => {
  222. })
  223. },
  224. }
  225. }
  226. </script>
  227. <style lang="scss" scoped>
  228. @import '@/styles/variables.scss';
  229. @import '@/styles/mixin.scss';
  230. .myproject{
  231. padding: 15px;
  232. }
  233. .myproject .title span{
  234. font-size: 26px;
  235. display: inline-block;
  236. color: #b6b6b6;
  237. }
  238. /deep/.el-dialog__title{
  239. color: #fff;
  240. }
  241. /deep/ .el-pagination__editor {
  242. width: 50px;
  243. border: none;
  244. }
  245. .btn{
  246. padding: 10px;
  247. display: flex;
  248. justify-content: flex-end;
  249. }
  250. .scher{
  251. display: flex;
  252. padding-bottom: 15px;
  253. }
  254. .scher span{
  255. font-size: 16px;
  256. height: 40px;
  257. line-height: 40px;
  258. display: inline-block;
  259. }
  260. /deep/.newfile .el-form-item__label{
  261. line-height: 40px;
  262. }
  263. .newfile .el-form-item__label {
  264. text-align: right;
  265. vertical-align: middle;
  266. float: left;
  267. font-size: 14px;
  268. color: #606266;
  269. line-height: 1px;
  270. padding: 12px 12px 0 0;
  271. -webkit-box-sizing: border-box;
  272. box-sizing: border-box;
  273. }
  274. .xuanzhogn{
  275. font-size: 16px;
  276. color: #b6b6b6;
  277. }
  278. .scher .input{
  279. width: 30%;
  280. box-sizing: border-box;
  281. border:1px solid transparent;
  282. &:hover{
  283. border: 1px solid #666;
  284. transition: 0.5s linear;
  285. position:relative;
  286. -moz-box-sizing: border-box;
  287. box-sizing: border-box;
  288. }
  289. }
  290. .scher .el-select{
  291. width: 110px;
  292. }
  293. .input{
  294. display: flex;
  295. }
  296. .input .text{
  297. flex:1;
  298. }
  299. // .el-table, .el-table__expanded-cell{
  300. // background-color:#333;
  301. // }
  302. </style>
  303. <style >
  304. .scher .el-input__inner{
  305. border-radius: 0;
  306. border: none;
  307. }
  308. .pagination{
  309. margin-top: 50px;
  310. }
  311. </style>