Newer
Older
KaiFengPC / src / views / floodSys / assetManage / RiverSaection.vue
@鲁yixuan 鲁yixuan on 19 Aug 8 KB updata
  1. <template>
  2. <div class="publicContainer">
  3. <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
  4. <el-form-item label="断面名称:" prop="searchContent">
  5. <el-input v-model="queryParams.searchContent" placeholder="请输入断面名称" clearable style="width: 180px" />
  6. </el-form-item>
  7. <el-form-item label="所属河道:" prop="fileTag1">
  8. <el-select v-model="queryParams.fileTag1" placeholder="请选择所属河道" clearable style="width: 100%">
  9. <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
  10. </el-select>
  11. </el-form-item>
  12.  
  13. <el-form-item label="目标水质:" prop="fileTag1">
  14. <el-select v-model="queryParams.fileTag1" placeholder="请选择目标水质" clearable style="width: 100%">
  15. <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
  16. </el-select>
  17. </el-form-item>
  18.  
  19. <el-form-item>
  20. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  21. <el-button type="primary" icon="Plus" @click="handleAdd">新增</el-button>
  22. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  23. </el-form-item>
  24. </el-form>
  25.  
  26. <!-- 表格 -->
  27. <el-table :data="dataList" v-loading="loading" stripe :max-height="580">
  28. <el-table-column type="index" width="55" label="序号" />
  29. <el-table-column label="断面编码" prop="q" />
  30. <el-table-column label="断面名称" prop="w" />
  31. <el-table-column label="所属河道" prop="e" />
  32. <el-table-column label="断面面积" prop="r" />
  33. <el-table-column label="断面长度" prop="t" />
  34. <el-table-column label="断面水质" prop="y" />
  35.  
  36. <el-table-column label="设计洪峰流量(m3/s)">
  37. <el-table-column prop="monthPlan1" label="20%" />
  38. <el-table-column prop="monthPlan2" label="10%" />
  39. <el-table-column prop="monthPlan3" label="5%" />
  40. <el-table-column prop="monthPlan4" label="2%" />
  41. <el-table-column prop="monthPlan5" label="1%" />
  42. </el-table-column>
  43.  
  44. <el-table-column label="区属" prop="i" />
  45. <el-table-column label="空间数据" prop="o" />
  46. <el-table-column label="操作" width="240">
  47. <template #default="scope">
  48. <el-button link icon="View" type="primary" @click="handleDetail(scope.row, 'view')">查看</el-button>
  49. <el-button link type="warning" icon="Edit" @click="handleUpdate(scope.row, 'view')">修改</el-button>
  50. <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row, 'view')">删除</el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <!-- 分页 -->
  55. <pagination
  56. v-show="total > 0"
  57. :total="total"
  58. v-model:page="queryParams.pageNum"
  59. v-model:limit="queryParams.pageSize"
  60. @pagination="getList"
  61. />
  62. <!-- 新增弹窗 -->
  63. <el-dialog :title="title" v-model="open" width="800px" append-to-body :close-on-click-modal="false">
  64. <el-form ref="roleRef" :model="form" :rules="rules" label-width="130px" :disabled="multiple">
  65. <el-row :gutter="20">
  66. <el-col :span="12">
  67. <el-form-item label="断面名称:" prop="w">
  68. <el-input v-model="form.w" placeholder="请输入断面名称" clearable style="width: 100%" />
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="12">
  72. <el-form-item label="断面编码:" prop="w">
  73. <el-input v-model="form.w" placeholder="请输入断面编码" clearable style="width: 100%" />
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77.  
  78. <el-row :gutter="20">
  79. <el-col :span="12">
  80. <el-form-item label="所属区属:" prop="fileTag1">
  81. <el-select v-model="form.fileTag1" placeholder="请选择所属区属" clearable style="width: 100%">
  82. <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. <el-col :span="12">
  87. <el-form-item label="所属河道:" prop="fileTag1">
  88. <el-select v-model="form.fileTag1" placeholder="请选择水所属河道" clearable style="width: 100%">
  89. <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
  90. </el-select>
  91. </el-form-item>
  92. </el-col>
  93. </el-row>
  94. <el-row :gutter="20">
  95. <el-col :span="12">
  96. <el-form-item label="断面面积:" prop="lon">
  97. <el-input-number v-model="form.lon" placeholder="请输入断面面积" style="width: 100%" controls-position="right" />
  98. </el-form-item>
  99. </el-col>
  100. <el-col :span="12">
  101. <el-form-item label="断面面积:" prop="lat">
  102. <el-input-number v-model="form.lat" placeholder="请输入断面面积" style="width: 100%" controls-position="right" />
  103. </el-form-item>
  104. </el-col>
  105. </el-row>
  106.  
  107. <el-row :gutter="20">
  108. <el-col :span="12">
  109. <el-form-item label="断面水质:" prop="fileTag1">
  110. <el-select v-model="form.fileTag1" placeholder="请选择断面水质" clearable style="width: 100%">
  111. <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
  112. </el-select>
  113. </el-form-item>
  114. </el-col>
  115. <el-col :span="12">
  116. <el-form-item label="目标水质:" prop="fileTag1">
  117. <el-select v-model="form.fileTag1" placeholder="请选择目标水质" clearable style="width: 100%">
  118. <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
  119. </el-select>
  120. </el-form-item>
  121. </el-col>
  122. </el-row>
  123.  
  124. <el-row :gutter="20">
  125. <el-col :span="12">
  126. <el-form-item label="空间数据:" prop="w">
  127. <el-input type="textarea" v-model="form.w" placeholder="请输入空间数据" clearable style="width: 100%" />
  128. </el-form-item>
  129. </el-col>
  130. </el-row>
  131. </el-form>
  132. <template #footer>
  133. <div class="dialog-footer">
  134. <el-button type="primary" @click="submitForm">确 定</el-button>
  135. <el-button @click="cancel">取 消</el-button>
  136. </div>
  137. </template>
  138. </el-dialog>
  139. </div>
  140. </template>
  141. <script setup name="RiverSaection">
  142. const { proxy } = getCurrentInstance();
  143. const open = ref(false);
  144. const multiple = ref(false);
  145. const showSearch = ref(true);
  146. const Xcfrequency = ref([
  147. {
  148. value: 'tian',
  149. label: '天',
  150. },
  151. {
  152. value: 'zhou',
  153. label: '周',
  154. },
  155. ]);
  156. const loading = ref(true);
  157. const total = ref(0);
  158. const title = ref('');
  159. const dataList = ref([]);
  160. const AllData = reactive({
  161. id: '',
  162. form: {},
  163. queryParams: {
  164. pageNum: 1,
  165. pageSize: 10,
  166. caseType: 1,
  167. handleStatus: '',
  168. searchContent: '',
  169. },
  170. rules: {
  171. id: [{ required: true, message: '请输入', trigger: 'blur' }],
  172. eventDescription: [{ required: true, message: '请输入', trigger: 'blur' }],
  173. },
  174. });
  175. const { queryParams, form, rules } = toRefs(AllData);
  176. //搜索
  177. function handleQuery() {
  178. getList();
  179. }
  180. //重置
  181. function resetQuery() {
  182. proxy.resetForm('queryRef');
  183. handleQuery();
  184. }
  185. // 新增
  186. function handleAdd() {
  187. title.value = '新增河道断面';
  188. open.value = true;
  189. form.value = {};
  190. multiple.value = false;
  191. form.value.fileTag = Xcfrequency.value[0].value;
  192. }
  193. // 新增中取消事件
  194. function cancel() {
  195. open.value = false;
  196. proxy.resetForm('roleRef');
  197. }
  198.  
  199. // 巡查频率下拉框点击事件
  200. function changeStation(value) {
  201. // console.log(value, 'value');
  202. }
  203.  
  204. //查看详情操作
  205. function handleDetail(row) {
  206. open.value = true;
  207. title.value = '查看河道断面';
  208. multiple.value = true;
  209. form.value = row;
  210. }
  211. // 修改按钮操作
  212. function handleUpdate(row) {
  213. open.value = true;
  214. title.value = '修改河道断面';
  215. multiple.value = false;
  216. form.value = { ...row };
  217. }
  218.  
  219. /** 搜索列表 */
  220. const getList = async () => {
  221. // loading.value = true;
  222. loading.value = false;
  223. };
  224.  
  225. onMounted(() => {
  226. getList();
  227. });
  228. </script>
  229. <style scoped lang="scss">
  230. .dituclass {
  231. width: 100%;
  232. height: 300px;
  233. // background: red;
  234. margin-bottom: 10px;
  235. border: 1px solid #004565;
  236. }
  237. </style>