|
@@ -14,7 +14,7 @@
|
|
<div class="filter-item planOutage">
|
|
<div class="filter-item planOutage">
|
|
选择时间范围:
|
|
选择时间范围:
|
|
<el-date-picker
|
|
<el-date-picker
|
|
- v-model="value1"
|
|
|
|
|
|
+ v-model="dateTime"
|
|
type="datetimerange"
|
|
type="datetimerange"
|
|
range-separator="至"
|
|
range-separator="至"
|
|
start-placeholder="开始日期"
|
|
start-placeholder="开始日期"
|
|
@@ -28,12 +28,19 @@
|
|
v-model="region"
|
|
v-model="region"
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
style="width: 200px"
|
|
style="width: 200px"
|
|
|
|
+ clearable
|
|
>
|
|
>
|
|
- <el-option label="已执行" value="1"></el-option>
|
|
|
|
- <el-option label="未执行" value="2"></el-option>
|
|
|
|
|
|
+ <el-option label="未执行" :value="1"></el-option>
|
|
|
|
+ <el-option label="执行中" :value="2"></el-option>
|
|
|
|
+ <el-option label="已执行" :value="3"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</div>
|
|
</div>
|
|
- <el-button type="primary" icon="el-icon-search" class="search-button">
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-search"
|
|
|
|
+ @click="Select()"
|
|
|
|
+ class="search-button"
|
|
|
|
+ >
|
|
搜索
|
|
搜索
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
@@ -53,7 +60,7 @@
|
|
:header-cell-style="headClass"
|
|
:header-cell-style="headClass"
|
|
:cell-style="cellStyle"
|
|
:cell-style="cellStyle"
|
|
>
|
|
>
|
|
- <el-table-column prop="xh" label="序号" width=""></el-table-column>
|
|
|
|
|
|
+ <el-table-column type="index" label="序号" width=""></el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
prop="siteName"
|
|
prop="siteName"
|
|
label="站点名称"
|
|
label="站点名称"
|
|
@@ -70,28 +77,30 @@
|
|
width=""
|
|
width=""
|
|
></el-table-column>
|
|
></el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
- prop="subTime"
|
|
|
|
|
|
+ prop="createTime"
|
|
label="提交时间"
|
|
label="提交时间"
|
|
width=""
|
|
width=""
|
|
></el-table-column>
|
|
></el-table-column>
|
|
- <el-table-column
|
|
|
|
- prop="submitter"
|
|
|
|
- label="提交人"
|
|
|
|
- width=""
|
|
|
|
- ></el-table-column>
|
|
|
|
- <el-table-column prop="status" label="状态" width="">
|
|
|
|
|
|
+ <el-table-column prop="creator" label="提交人" width=""></el-table-column>
|
|
|
|
+ <el-table-column prop="type" label="状态" width="">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<span
|
|
<span
|
|
:style="{
|
|
:style="{
|
|
color:
|
|
color:
|
|
- scope.row.status == '已执行'
|
|
|
|
|
|
+ scope.row.type == 3
|
|
? '#8DCF6E'
|
|
? '#8DCF6E'
|
|
- : scope.row.status == '未执行'
|
|
|
|
|
|
+ : scope.row.type === 1
|
|
? '#FF747B'
|
|
? '#FF747B'
|
|
: '#5c88fa',
|
|
: '#5c88fa',
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
- {{ scope.row.status }}
|
|
|
|
|
|
+ {{
|
|
|
|
+ scope.row.type === 1
|
|
|
|
+ ? '未执行'
|
|
|
|
+ : scope.row.type === 2
|
|
|
|
+ ? '执行中'
|
|
|
|
+ : '已执行'
|
|
|
|
+ }}
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -104,14 +113,21 @@
|
|
>
|
|
>
|
|
编辑
|
|
编辑
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button
|
|
|
|
- @click="handleDelete(scope.$index, scope.row)"
|
|
|
|
- type="text"
|
|
|
|
- size="small"
|
|
|
|
- class="delete-text"
|
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
+ confirm-button-text="是"
|
|
|
|
+ cancel-button-text="否"
|
|
|
|
+ icon="el-icon-info"
|
|
|
|
+ icon-color="red"
|
|
|
|
+ title="确定删除?"
|
|
|
|
+ @confirm="handleDelete(scope.row)"
|
|
|
|
+ @cancel="cancelEvent"
|
|
>
|
|
>
|
|
- 删除
|
|
|
|
- </el-button>
|
|
|
|
|
|
+ <template #reference>
|
|
|
|
+ <el-button type="text" size="small" class="delete-text">
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-popconfirm>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -122,11 +138,11 @@
|
|
<el-pagination
|
|
<el-pagination
|
|
@size-change="handleSizeChange"
|
|
@size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
@current-change="handleCurrentChange"
|
|
- :current-page="currentPage4"
|
|
|
|
- :page-sizes="[100, 200, 300, 400]"
|
|
|
|
- :page-size="100"
|
|
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-sizes="[15, 20, 25, 30]"
|
|
|
|
+ :page-size="pageSize"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
- :total="400"
|
|
|
|
|
|
+ :total="total"
|
|
></el-pagination>
|
|
></el-pagination>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@@ -134,160 +150,202 @@
|
|
|
|
|
|
<!--弹框组件开始-----------------------start-->
|
|
<!--弹框组件开始-----------------------start-->
|
|
<dialog-component
|
|
<dialog-component
|
|
- v-if="showDialog"
|
|
|
|
- ref="dialogComponent"
|
|
|
|
:dialog-title="dialogTitle"
|
|
:dialog-title="dialogTitle"
|
|
:item-info="tableItem"
|
|
:item-info="tableItem"
|
|
@closeDialog="closeDialog"
|
|
@closeDialog="closeDialog"
|
|
|
|
+ :show_Dialog="showDialog"
|
|
></dialog-component>
|
|
></dialog-component>
|
|
<!--弹框组件开始-----------------------end-->
|
|
<!--弹框组件开始-----------------------end-->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { useStore } from 'vuex'
|
|
|
|
+import { defineComponent, ref } from 'vue'
|
|
import DialogComponent from './dialogComponent'
|
|
import DialogComponent from './dialogComponent'
|
|
|
|
+import * as api from '@/api/planOutage/index'
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
|
-export default {
|
|
|
|
|
|
+export default defineComponent({
|
|
name: 'VariableList',
|
|
name: 'VariableList',
|
|
|
|
|
|
components: { DialogComponent },
|
|
components: { DialogComponent },
|
|
|
|
+ setup() {
|
|
|
|
+ const store = useStore()
|
|
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
|
|
|
|
- select: 1,
|
|
|
|
- currentPage4: 4,
|
|
|
|
|
|
+ const tableItem = ref()
|
|
|
|
+ const dialogTitle = ref('')
|
|
|
|
+ const showDialog = ref(false)
|
|
|
|
+
|
|
|
|
+ const tableData = ref()
|
|
|
|
+ const currentPage = ref(1)
|
|
|
|
+ const pageSize = ref(15)
|
|
|
|
+ const total = ref(0)
|
|
|
|
+
|
|
|
|
+ const dateTime = ref([
|
|
|
|
+ new Date(2021, 8, 10, 10, 10),
|
|
|
|
+ new Date(2021, 10, 11, 10, 10),
|
|
|
|
+ ])
|
|
|
|
+ const select = ref(1)
|
|
|
|
|
|
- showDialog: false,
|
|
|
|
- tabPosition: 'one',
|
|
|
|
|
|
+ const tabPosition = ref('one')
|
|
|
|
+ const input = ref('')
|
|
|
|
+ const region = ref()
|
|
|
|
|
|
- input: '',
|
|
|
|
- region: '',
|
|
|
|
- tableData: [
|
|
|
|
- {
|
|
|
|
- xh: '1',
|
|
|
|
- siteName: '测试站点1',
|
|
|
|
- startTime: '2020-02-02 12:00:00',
|
|
|
|
- endTime: '2020-02-02 12:00:00',
|
|
|
|
- subTime: '2020-02-02 12:00:00',
|
|
|
|
- submitter: '张三',
|
|
|
|
- status: '未执行',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- xh: '1',
|
|
|
|
- siteName: '测试站点1',
|
|
|
|
- startTime: '2020-02-02 12:00:00',
|
|
|
|
- endTime: '2020-02-02 12:00:00',
|
|
|
|
- subTime: '2020-02-02 12:00:00',
|
|
|
|
- submitter: '张三',
|
|
|
|
- status: '未执行',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- xh: '1',
|
|
|
|
- siteName: '测试站点1',
|
|
|
|
- startTime: '2020-02-02 12:00:00',
|
|
|
|
- endTime: '2020-02-02 12:00:00',
|
|
|
|
- subTime: '2020-02-02 12:00:00',
|
|
|
|
- submitter: '张三',
|
|
|
|
- status: '未执行',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- xh: '1',
|
|
|
|
- siteName: '测试站点1',
|
|
|
|
- startTime: '2020-02-02 12:00:00',
|
|
|
|
- endTime: '2020-02-02 12:00:00',
|
|
|
|
- subTime: '2020-02-02 12:00:00',
|
|
|
|
- submitter: '张三',
|
|
|
|
- status: '执行中',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- xh: '1',
|
|
|
|
- siteName: '测试站点1',
|
|
|
|
- startTime: '2020-02-02 12:00:00',
|
|
|
|
- endTime: '2020-02-02 12:00:00',
|
|
|
|
- subTime: '2020-02-02 12:00:00',
|
|
|
|
- submitter: '张三',
|
|
|
|
- status: '已执行',
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ // 添加操作
|
|
|
|
+ const addItem = () => {
|
|
|
|
+ tableItem.value = {
|
|
|
|
+ siteId: '',
|
|
|
|
+ time: ['', ''],
|
|
|
|
+ startTime: '',
|
|
|
|
+ endTime: '',
|
|
|
|
+ phone: '',
|
|
|
|
+ contacts: '',
|
|
|
|
+ planType: '',
|
|
|
|
+ type: '',
|
|
|
|
+ }
|
|
|
|
+ dialogTitle.value = '新增'
|
|
|
|
+ showDialog.value = true
|
|
}
|
|
}
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- //处理状态状态值变色
|
|
|
|
- cellStyle(row, column, rowIndex, columnIndex) {
|
|
|
|
- console.log('rowIndex', row, column, rowIndex, columnIndex)
|
|
|
|
- console.log(row.row.status)
|
|
|
|
|
|
+ // 编辑操作
|
|
|
|
+ const editRow = (row) => {
|
|
console.log(row)
|
|
console.log(row)
|
|
- if (row.column.status == '未执行') {
|
|
|
|
- return 'color:#FF747B'
|
|
|
|
|
|
+ tableItem.value = {
|
|
|
|
+ id: row.id,
|
|
|
|
+ siteId: row.siteId,
|
|
|
|
+ time: [row.startTime, row.endTime],
|
|
|
|
+ startTime: row.startTime,
|
|
|
|
+ endTime: row.endTime,
|
|
|
|
+ phone: row.phone,
|
|
|
|
+ contacts: row.contacts,
|
|
|
|
+ planType: row.planType,
|
|
|
|
+ type: row.type,
|
|
}
|
|
}
|
|
- if (row.column.label == '已执行') {
|
|
|
|
- return 'color:#8DCF6E'
|
|
|
|
|
|
+ dialogTitle.value = '编辑'
|
|
|
|
+ showDialog.value = true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 关闭操作
|
|
|
|
+ const closeDialog = (flag) => {
|
|
|
|
+ if (flag) {
|
|
|
|
+ // 重新刷新表格内容
|
|
|
|
+ this.fetchData()
|
|
}
|
|
}
|
|
- },
|
|
|
|
- handleSizeChange(val) {
|
|
|
|
- console.log(`每页 ${val} 条`)
|
|
|
|
- },
|
|
|
|
- handleCurrentChange(val) {
|
|
|
|
- console.log(`当前页: ${val}`)
|
|
|
|
- },
|
|
|
|
|
|
+ showDialog.value = false
|
|
|
|
+ Select()
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ //删除 是否删除 ---- 是
|
|
|
|
+ const handleDelete = (row) => {
|
|
|
|
+ api.plannedOutageDel({ id: row.id }).then((requset) => {
|
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
|
+ ElMessage.success({
|
|
|
|
+ message: '删除成功',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ Select()
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ //是否删除 ---- 否
|
|
|
|
+ const cancelEvent = () => {
|
|
|
|
+ console.log('cancel!')
|
|
|
|
+ }
|
|
|
|
+ //查询设备列表
|
|
|
|
+ function Select() {
|
|
|
|
+ store.commit('TimeAll_function', dateTime.value)
|
|
|
|
+ const time = store.state.Time_Data
|
|
|
|
+ api
|
|
|
|
+ .plannedOutageList({
|
|
|
|
+ size: pageSize.value,
|
|
|
|
+ current: currentPage.value,
|
|
|
|
+ type: region.value,
|
|
|
|
+ startTime: time[0],
|
|
|
|
+ endTime: time[1],
|
|
|
|
+ })
|
|
|
|
+ .then((requset) => {
|
|
|
|
+ if (requset.status === 'SUCCESS') {
|
|
|
|
+ tableData.value = requset.data.records.map((val) => {
|
|
|
|
+ store.commit('getTimestampAll', val.startTime)
|
|
|
|
+ val.startTime = store.state.timeProcessing
|
|
|
|
+ store.commit('getTimestampAll', val.endTime)
|
|
|
|
+ val.endTime = store.state.timeProcessing
|
|
|
|
+ store.commit('getTimestampAll', val.createTime)
|
|
|
|
+ val.createTime = store.state.timeProcessing
|
|
|
|
+ })
|
|
|
|
+ tableData.value = requset.data.records
|
|
|
|
+ total.value = requset.data.total
|
|
|
|
+ } else {
|
|
|
|
+ ElMessage.error(requset.msg)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const handleSizeChange = (val) => {
|
|
|
|
+ pageSize.value = val
|
|
|
|
+ Select()
|
|
|
|
+ }
|
|
|
|
+ const handleCurrentChange = (val) => {
|
|
|
|
+ currentPage.value = val
|
|
|
|
+ Select()
|
|
|
|
+ }
|
|
// 表头样式设置
|
|
// 表头样式设置
|
|
- goVariableList() {
|
|
|
|
|
|
+ const goVariableList = () => {
|
|
// 跳转至订单列表页面传参
|
|
// 跳转至订单列表页面传参
|
|
this.$router.push({
|
|
this.$router.push({
|
|
path: '../siteManage/variableList/index.vue',
|
|
path: '../siteManage/variableList/index.vue',
|
|
})
|
|
})
|
|
// this.$router.push({ name:'variableList'})
|
|
// this.$router.push({ name:'variableList'})
|
|
- },
|
|
|
|
- headClass() {
|
|
|
|
|
|
+ }
|
|
|
|
+ const headClass = () => {
|
|
return 'background:#FAFAFA;'
|
|
return 'background:#FAFAFA;'
|
|
- },
|
|
|
|
-
|
|
|
|
- // 添加操作
|
|
|
|
- addItem() {
|
|
|
|
- this.tableItem = {
|
|
|
|
- id: '',
|
|
|
|
- stationName: '',
|
|
|
|
- xh: '',
|
|
|
|
- siteName: '',
|
|
|
|
- siteList: [],
|
|
|
|
- done: '',
|
|
|
|
- guaZai: '',
|
|
|
|
- checked: true,
|
|
|
|
|
|
+ }
|
|
|
|
+ //处理状态状态值变色
|
|
|
|
+ const cellStyle = (row, column, rowIndex, columnIndex) => {
|
|
|
|
+ column, rowIndex, columnIndex
|
|
|
|
+ // console.log('rowIndex', row, column, rowIndex, columnIndex)
|
|
|
|
+ // console.log(row.row.status)
|
|
|
|
+ // console.log(row)
|
|
|
|
+ if (row.column.status == '未执行') {
|
|
|
|
+ return 'color:#FF747B'
|
|
}
|
|
}
|
|
- this.dialogTitle = '新增'
|
|
|
|
- this.showDialog = true
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs['dialogComponent'].showDialog = true
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 编辑操作
|
|
|
|
- editRow(row) {
|
|
|
|
- console.log(row)
|
|
|
|
- this.tableItem = row
|
|
|
|
- this.dialogTitle = '编辑'
|
|
|
|
- this.showDialog = true
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs['dialogComponent'].showDialog = true
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 关闭操作
|
|
|
|
- closeDialog(flag) {
|
|
|
|
- if (flag) {
|
|
|
|
- // 重新刷新表格内容
|
|
|
|
- this.fetchData()
|
|
|
|
|
|
+ if (row.column.label == '已执行') {
|
|
|
|
+ return 'color:#8DCF6E'
|
|
}
|
|
}
|
|
- this.showDialog = false
|
|
|
|
- },
|
|
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ cellStyle,
|
|
|
|
+ headClass,
|
|
|
|
+ goVariableList,
|
|
|
|
+ handleSizeChange,
|
|
|
|
+ handleCurrentChange,
|
|
|
|
+ handleDelete,
|
|
|
|
+ cancelEvent,
|
|
|
|
+ closeDialog,
|
|
|
|
+ editRow,
|
|
|
|
+ addItem,
|
|
|
|
+ Select,
|
|
|
|
|
|
- //删除操作
|
|
|
|
- handleDelete(index, row) {
|
|
|
|
- console.log(index, row)
|
|
|
|
- alert(index)
|
|
|
|
- },
|
|
|
|
|
|
+ store,
|
|
|
|
+
|
|
|
|
+ total,
|
|
|
|
+ pageSize,
|
|
|
|
+ currentPage,
|
|
|
|
+ tableData,
|
|
|
|
+
|
|
|
|
+ showDialog,
|
|
|
|
+ tabPosition,
|
|
|
|
+ select,
|
|
|
|
+ dateTime,
|
|
|
|
+ tableItem,
|
|
|
|
+ dialogTitle,
|
|
|
|
+ input,
|
|
|
|
+ region,
|
|
|
|
+ }
|
|
},
|
|
},
|
|
-}
|
|
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|