clusteringDetail.vue 7.1 KB

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