anemometer.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <div class="global-variable">
  3. <div class="condition">
  4. <el-form :inline="true" :model="formInline" class="demo-form-inline">
  5. <el-form-item label="测风塔名称:">
  6. <el-input
  7. v-model="formInline.user"
  8. placeholder="请输入批次编号"
  9. size="small"
  10. ></el-input>
  11. </el-form-item>
  12. <el-form-item label="选择日期:" size="small">
  13. <el-date-picker
  14. v-model="formInline.timeQuantum"
  15. type="daterange"
  16. range-separator="至"
  17. start-placeholder="开始日期"
  18. end-placeholder="结束日期"
  19. >
  20. </el-date-picker>
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button type="primary" @click="onSubmit" size="small"
  24. >查询</el-button
  25. >
  26. <el-button @click="reset" size="small">重置</el-button>
  27. </el-form-item>
  28. </el-form>
  29. </div>
  30. <div class="list-page">
  31. <div class="newly">
  32. <el-button type="primary" @click="newnuedialog" size="small"
  33. >新增</el-button
  34. >
  35. </div>
  36. <el-table
  37. class="center-align-table"
  38. :data="tableData"
  39. border
  40. :cell-style="rowStyle"
  41. >
  42. <el-table-column align="center" fixed prop="" label="测风塔名称">
  43. <template slot-scope="scope">
  44. <el-button @click="particulars(scope.row)" type="text" size="small"
  45. >泗洪风场</el-button
  46. >
  47. </template>
  48. </el-table-column>
  49. <el-table-column align="center" label="测风塔编号"> </el-table-column>
  50. <el-table-column prop="" align="center" label="机型类型">
  51. </el-table-column>
  52. <el-table-column prop="" align="center" label="经度" width="100">
  53. </el-table-column>
  54. <el-table-column prop="" align="center" label="纬度" width="100">
  55. </el-table-column>
  56. <el-table-column prop="" align="center" label="状态" width="100">
  57. </el-table-column>
  58. <el-table-column prop="" align="center" label="创建时间">
  59. </el-table-column>
  60. <el-table-column
  61. prop="transition"
  62. align="center"
  63. fixed="right"
  64. label="操作"
  65. width="200"
  66. >
  67. <template slot-scope="scope">
  68. <el-button @click="compile(scope.row)" type="text" size="small"
  69. >编辑</el-button
  70. >
  71. <el-button
  72. v-if="scope.row.transition == 1"
  73. @click="start(scope.row)"
  74. type="text"
  75. size="small"
  76. >启用</el-button
  77. >
  78. <el-button
  79. v-else
  80. style="color: #666"
  81. @click="stop(scope.row)"
  82. type="text"
  83. size="small"
  84. >停用</el-button
  85. >
  86. <el-button
  87. style="color: #f00"
  88. @click="deleted(scope.row)"
  89. type="text"
  90. size="small"
  91. >删除</el-button
  92. >
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. <div class="pagination-container">
  97. <el-pagination
  98. :page-size="10"
  99. :pager-count="11"
  100. layout="total, prev, pager, next"
  101. :total="35"
  102. >
  103. </el-pagination>
  104. </div>
  105. </div>
  106. <!-- 弹出层 -->
  107. <!-- 新增 -->
  108. <el-dialog :title="title" :visible.sync="nuedialog" width="800px">
  109. <div class="addition">
  110. <span @click="addition">
  111. <SvgIcons
  112. name="jia"
  113. class="jia"
  114. width="20px"
  115. height="22px"
  116. color="#222"
  117. ></SvgIcons>
  118. </span>
  119. <span @click="subtraction">
  120. <SvgIcons
  121. name="jian"
  122. class="jian"
  123. width="20px"
  124. height="22px"
  125. color="#222"
  126. ></SvgIcons>
  127. </span>
  128. </div>
  129. <div class="general">
  130. <div class="condition">
  131. <p>测风塔名称:</p>
  132. <el-input v-model="windsiteName"></el-input>
  133. </div>
  134. <div class="condition">
  135. <p>经度:</p>
  136. <el-input v-model="airdensity"></el-input>
  137. </div>
  138. <div class="condition">
  139. <p>纬度:</p>
  140. <el-input v-model="altitude"></el-input>
  141. </div>
  142. <div
  143. v-for="(input, index) in heightInputs"
  144. :key="index"
  145. class="condition"
  146. >
  147. <p>测风塔高度:</p>
  148. <el-input
  149. v-model="input.value"
  150. placeholder="请输入测风塔高度"
  151. ></el-input>
  152. </div>
  153. </div>
  154. <span slot="footer" class="dialog-footer">
  155. <el-button @click="nuedialog = false" size="small">取 消</el-button>
  156. <el-button type="primary" @click="newly" size="small">确 定</el-button>
  157. </span>
  158. </el-dialog>
  159. <!-- 风场详情 -->
  160. <el-dialog title="详情" :visible.sync="unusualdialog" width="800px">
  161. </el-dialog>
  162. </div>
  163. </template>
  164. <script>
  165. export default {
  166. data() {
  167. return {
  168. // 新增信息
  169. windsiteName: "",
  170. airdensity: "",
  171. superior: "",
  172. superiorOptions: [],
  173. altitude: "",
  174. sheng: "",
  175. shengOptions: [],
  176. shi: "",
  177. shiOptions: [],
  178. longitude: "",
  179. dimensionality: "",
  180. anemometer: "",
  181. anemometerOptions: [],
  182. fileList: [
  183. {
  184. name: "food.jpeg",
  185. url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
  186. },
  187. ],
  188. formInline: {
  189. user: "",
  190. region: "",
  191. timeQuantum: "",
  192. },
  193. tableData: [
  194. {
  195. id: 1,
  196. name: "王小虎",
  197. transition: "1",
  198. },
  199. {
  200. id: 3,
  201. name: "王小虎",
  202. abnormal: "1",
  203. transition: "0",
  204. children: [
  205. {
  206. id: 31,
  207. name: "王小虎",
  208. abnormal: "1",
  209. },
  210. ],
  211. },
  212. ],
  213. nuedialog: false,
  214. unusualdialog: false,
  215. newform: {
  216. unit: "",
  217. province: "",
  218. city: "",
  219. descr: "",
  220. },
  221. title: "",
  222. heightInputs: [{ value: "" }],
  223. };
  224. },
  225. methods: {
  226. rowStyle() {
  227. return "text-align:center";
  228. },
  229. // 查询
  230. onSubmit() {
  231. console.log("submit!");
  232. },
  233. // 重置
  234. reset() {},
  235. // 新增
  236. newly() {
  237. this.heightInputs.forEach((value, index) => {
  238. console.log(`测风塔高度 ${index + 1}:`, value);
  239. });
  240. this.nuedialog = false;
  241. this.heightInputs = [{ value: "" }];
  242. },
  243. //异常详情
  244. particulars(row) {
  245. this.unusualdialog = true;
  246. },
  247. // 编辑
  248. compile(row) {
  249. this.nuedialog = true;
  250. this.title = "编辑";
  251. },
  252. // 启用
  253. start(row) {},
  254. // 停用
  255. stop(row) {},
  256. // 删除
  257. deleted(row) {
  258. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  259. confirmButtonText: "确定",
  260. cancelButtonText: "取消",
  261. type: "warning",
  262. })
  263. .then(() => {
  264. this.$message({
  265. type: "success",
  266. message: "删除成功!",
  267. });
  268. })
  269. .catch(() => {
  270. this.$message({
  271. type: "info",
  272. message: "已取消删除",
  273. });
  274. });
  275. },
  276. // 删除附件
  277. deleteRow(row) {
  278. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  279. confirmButtonText: "确定",
  280. cancelButtonText: "取消",
  281. type: "warning",
  282. })
  283. .then(() => {
  284. this.$message({
  285. type: "success",
  286. message: "删除成功!",
  287. });
  288. })
  289. .catch(() => {
  290. this.$message({
  291. type: "info",
  292. message: "已取消删除",
  293. });
  294. });
  295. },
  296. addition() {
  297. this.heightInputs.push({ value: "" }); // Add a new object with an empty string property
  298. },
  299. // Method to remove the last input for "测风塔高度"
  300. subtraction() {
  301. if (this.heightInputs.length > 1) {
  302. // Ensure at least one input remains
  303. this.heightInputs.pop();
  304. }
  305. },
  306. // 新增
  307. newnuedialog() {
  308. this.nuedialog = true;
  309. this.title = "新增";
  310. },
  311. },
  312. };
  313. </script>
  314. <style lang="scss" scoped>
  315. .general {
  316. display: flex;
  317. flex-wrap: wrap;
  318. .condition {
  319. width: 50%;
  320. display: flex;
  321. p {
  322. width: 100px;
  323. text-align: right;
  324. line-height: 40px;
  325. }
  326. span {
  327. line-height: 40px;
  328. padding-left: 20px;
  329. }
  330. .el-select {
  331. width: 100%;
  332. margin-bottom: 20px;
  333. }
  334. .el-input {
  335. margin-bottom: 20px;
  336. }
  337. }
  338. }
  339. .attachment {
  340. display: flex;
  341. padding-top: 10px;
  342. p {
  343. margin-right: 20px;
  344. color: #409eff;
  345. }
  346. }
  347. .addition {
  348. display: flex;
  349. justify-content: flex-end;
  350. margin-bottom: 10px;
  351. }
  352. </style>