clusteringDetail.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <!--新增、编辑、查看集群信息-->
  2. <template>
  3. <div>
  4. <el-form
  5. ref="form"
  6. :model="form"
  7. :rules="rules"
  8. label-width="200px"
  9. class="flexBox"
  10. >
  11. <div class="formItemBox">
  12. <el-form-item label="账户名称:" prop="userName">
  13. <el-input
  14. placeholder="请输入"
  15. disabled
  16. v-model="form.userName"
  17. >
  18. </el-input>
  19. </el-form-item>
  20. <el-form-item label="独占类型:" prop="userType">
  21. <!--<el-select v-model="form.userType" disabled>
  22. <el-option
  23. v-for="item in userTypeList"
  24. :label="item.caption"
  25. :value="item.code"
  26. :key="item.code"
  27. ></el-option>
  28. </el-select>-->
  29. <el-input
  30. placeholder="请输入"
  31. disabled
  32. v-model="form.userType"
  33. >
  34. </el-input>
  35. </el-form-item>
  36. <el-form-item label="仿真软件license数量:" prop="numSimulationLicense">
  37. <el-input
  38. placeholder="请输入"
  39. maxlength="20"
  40. v-autoTrim="{ obj: form, key: 'numSimulationLicense' }"
  41. v-model="form.numSimulationLicense"
  42. >
  43. </el-input>
  44. </el-form-item>
  45. <el-form-item label="到期时间:" prop="dateSimulationLicense">
  46. <el-date-picker
  47. v-model="form.dateSimulationLicense"
  48. type="date"
  49. placeholder="选择日期"
  50. value-format="yyyy-MM-dd"
  51. ></el-date-picker>
  52. </el-form-item>
  53. <el-form-item label="动力学软件license数量:" prop="numDynamicLicense">
  54. <el-input
  55. placeholder="请输入"
  56. maxlength="20"
  57. v-autoTrim="{ obj: form, key: 'numDynamicLicense' }"
  58. v-model="form.numDynamicLicense"
  59. >
  60. </el-input>
  61. </el-form-item>
  62. <el-form-item label="到期时间:" prop="dateDynamicLicense">
  63. <el-date-picker
  64. v-model="form.dateDynamicLicense"
  65. type="date"
  66. placeholder="选择日期"
  67. value-format="yyyy-MM-dd"
  68. ></el-date-picker>
  69. </el-form-item>
  70. </div>
  71. </el-form>
  72. <div class="title">历史记录</div>
  73. <tableList
  74. ref="table"
  75. style="width:60%;min-width: 900px;margin: auto;"
  76. :columns="columns"
  77. :getDataWay="getDataWay"
  78. index
  79. >
  80. </tableList>
  81. <div class="btns">
  82. <el-button type="primary" @click="save">保存</el-button>
  83. <el-button type="primary" plain @click="cancel">取消</el-button>
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. import tableList from "@/components/grid/TableList";
  89. export default {
  90. name: "clusteringDetail",
  91. components: {tableList},
  92. data() {
  93. return {
  94. userTypeList: [],
  95. getDataWay:{
  96. dataType: "url",
  97. type: "post",
  98. firstRequest: false,
  99. data: this.$api.systemManagement.getClusterHistory,
  100. param: {
  101. //userId: this.$route.query.userId
  102. },
  103. },
  104. columns: [
  105. //表格列
  106. {
  107. label: "仿真软件license",
  108. prop: "numSimulationLicense",
  109. },
  110. {
  111. label: "到期时间",
  112. prop: "dateSimulationLicense",
  113. formatter:(data)=>{
  114. return data.dateSimulationLicense.slice(0,10)
  115. }
  116. },
  117. {
  118. label: "动力学软件license",
  119. prop: "numDynamicLicense",
  120. },
  121. {
  122. label: "到期时间",
  123. prop: "dateDynamicLicense",
  124. formatter:(data)=>{
  125. return data.dateDynamicLicense.slice(0,10)
  126. }
  127. },
  128. {
  129. label: "操作时间",
  130. prop: "modifyTime",
  131. formatter:(data)=>{
  132. return this.$timeFormatter(data.modifyTime)
  133. }
  134. }
  135. ],
  136. form: {
  137. userName:"",
  138. id: "",
  139. userId: "",
  140. numSimulationLicense: "",
  141. dateSimulationLicense: "",
  142. numDynamicLicense: "",
  143. dateDynamicLicense: ""
  144. },
  145. rules: {
  146. numSimulationLicense: [{ required: true, message: "请输入", trigger: "blur" }],
  147. dateSimulationLicense: [{ required: true, message: "请选择", trigger: "blur" }],
  148. numDynamicLicense: [{ required: true, message: "请输入", trigger: "blur" }],
  149. dateDynamicLicense: [{ required: true, message: "请选择", trigger: "blur" }]
  150. }
  151. };
  152. },
  153. created(){
  154. if(this.$route.query.userId){
  155. this.form = {...this.$route.query}
  156. delete this.form.modifyTime
  157. }
  158. },
  159. async mounted() {
  160. if(this.$route.query.userId){
  161. this.getDataWay.param = {
  162. userId: this.$route.query.userId
  163. }
  164. this.$refs.table.loadData()
  165. }
  166. await this.$dicsListsInit({
  167. userTypeList: "useType"
  168. });
  169. },
  170. computed: {},
  171. methods: {
  172. save(){
  173. this.$axios({
  174. method:"POST",
  175. url:this.$api.systemManagement.saveCluster,
  176. data:{
  177. ...this.form
  178. }
  179. }).then(res=>{
  180. if(res.code == 200){
  181. this.$message.success("保存成功");
  182. this.cancel()
  183. }else{
  184. this.$message.error(res.message || "保存失败");
  185. }
  186. })
  187. },
  188. cancel(){
  189. this.$router.replace({path: '/clusteringManagement'})
  190. },
  191. },
  192. };
  193. </script>
  194. <style lang="less" scoped>
  195. .el-form {
  196. width: 60%;
  197. min-width: 900px;
  198. padding-top: 60px;
  199. margin: 0 auto;
  200. .formItemBox {
  201. flex: 1;
  202. /deep/ .el-input,
  203. .el-select {
  204. width: 100%;
  205. }
  206. }
  207. .el-textarea {
  208. height: 96px;
  209. }
  210. }
  211. .btns {
  212. padding-top: 30px;
  213. text-align: center;
  214. }
  215. .title {
  216. width: 60%;
  217. min-width: 900px;
  218. margin: 4px auto;
  219. border-left: 6px solid @themeColor;
  220. padding-left: 20px;
  221. color: @themeColor;
  222. font-size: 16px;
  223. font-weight: bold;
  224. }
  225. </style>