|
@@ -19,7 +19,7 @@
|
|
|
v-model="filterText"
|
|
|
class="mb-20 searchInput"
|
|
|
>
|
|
|
- <template #suffix>
|
|
|
+ <template>
|
|
|
<i class="el-icon-search el-input__icon"></i>
|
|
|
</template>
|
|
|
</el-input>
|
|
@@ -64,7 +64,6 @@
|
|
|
v-if="this.treeLevel == 3"
|
|
|
v-model="activeName"
|
|
|
type="card"
|
|
|
- @tab-click="handleClick"
|
|
|
>
|
|
|
<el-tab-pane label="基本信息" name="first">
|
|
|
<basic-info class="basicInfo"></basic-info>
|
|
@@ -95,21 +94,19 @@
|
|
|
|
|
|
<!-- 新建分组start -->
|
|
|
<add-group-com
|
|
|
- v-if="showDialog"
|
|
|
- ref="addGroupCom"
|
|
|
- :dialog-title="dialogTitle"
|
|
|
- :item-info="tableItem"
|
|
|
- @closeDialog="closeDialog"
|
|
|
+ :dialogTitle="dialogTitle"
|
|
|
+ :itemInfo="tableItem"
|
|
|
+ @closeDialog="closeDialog"
|
|
|
+ :flag="showDialog"
|
|
|
></add-group-com>
|
|
|
<!-- 新建分组end -->
|
|
|
|
|
|
<!-- 新建站点start -->
|
|
|
<add-site-com
|
|
|
- v-if="showDialog"
|
|
|
- ref="addSiteCom"
|
|
|
- :dialog-title="dialogTitle"
|
|
|
- :item-info="tableItem"
|
|
|
- @closeDialog="closeDialog"
|
|
|
+ :dialogTitle="dialogTitle"
|
|
|
+ :itemInfo="tableItem"
|
|
|
+ @closeDialog="closeDialog"
|
|
|
+ :flag="showDialog2"
|
|
|
></add-site-com>
|
|
|
<!-- 新建站点end -->
|
|
|
</div>
|
|
@@ -118,6 +115,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+
|
|
|
+import { defineComponent, ref,reactive,watch} from 'vue'
|
|
|
+
|
|
|
import basicInfo from './basicInfo'
|
|
|
import WatchDog from './watchDog'
|
|
|
import variableList from './variableList'
|
|
@@ -128,7 +128,7 @@ import groupInfoCom from './groupInfoCom'
|
|
|
import addGroupCom from './addGroupCom'
|
|
|
import addSiteCom from './addSiteCom'
|
|
|
|
|
|
-export default {
|
|
|
+export default defineComponent({
|
|
|
components: {
|
|
|
basicInfo,
|
|
|
WatchDog,
|
|
@@ -139,15 +139,15 @@ export default {
|
|
|
addGroupCom,
|
|
|
addSiteCom,
|
|
|
},
|
|
|
- data() {
|
|
|
- return {
|
|
|
- deleteShow: false,
|
|
|
- showDialog: false,
|
|
|
- treeLevel: 0,
|
|
|
- activeName: 'first',
|
|
|
- filterText: '',
|
|
|
- data: [
|
|
|
- {
|
|
|
+ setup() {
|
|
|
+ const showDialog = ref(false)
|
|
|
+ const showDialog2 = ref(false)
|
|
|
+ const dialogTitle = ref('')
|
|
|
+ const treeLevel = ref(0)
|
|
|
+ const activeName = ref('first')
|
|
|
+ const filterText = ref('')
|
|
|
+ const data = ref([
|
|
|
+ {
|
|
|
label: '所有站点',
|
|
|
children: [
|
|
|
{
|
|
@@ -215,120 +215,112 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- ],
|
|
|
- defaultProps: {
|
|
|
+ ])
|
|
|
+ const defaultProps = ref({
|
|
|
children: 'children',
|
|
|
label: 'label',
|
|
|
- },
|
|
|
+ })
|
|
|
+
|
|
|
+ const getMsgFormSon=()=> {
|
|
|
+ activeName.value = 'third';
|
|
|
}
|
|
|
- },
|
|
|
- watch: {
|
|
|
- success(res) {
|
|
|
- res
|
|
|
- alert(1)
|
|
|
- // this.dialogCreate = res;
|
|
|
- // this.activeName = res;
|
|
|
- },
|
|
|
- filterText(val) {
|
|
|
- this.$refs.tree.filter(val)
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- getMsgFormSon() {
|
|
|
- this.activeName = 'third';
|
|
|
- },
|
|
|
- mouseenter(data) {
|
|
|
- // console.log("移入");
|
|
|
- // console.log(data);
|
|
|
+ function mouseenter(data) {
|
|
|
data.show = true
|
|
|
- // console.log(data.show);
|
|
|
- },
|
|
|
-
|
|
|
- mouseleave(data) {
|
|
|
- // console.log("移出");
|
|
|
- // console.log(data);
|
|
|
+ }
|
|
|
+ function mouseleave(data) {
|
|
|
data.show = false
|
|
|
- },
|
|
|
-
|
|
|
- handleClick(tab, event) {
|
|
|
- console.log(tab, event)
|
|
|
- },
|
|
|
- filterNode(value, data) {
|
|
|
+ }
|
|
|
+ function filterNode(value, data) {
|
|
|
if (!value) return true
|
|
|
return data.label.indexOf(value) !== -1
|
|
|
- },
|
|
|
- handleNodeClick(data, obj, node) {
|
|
|
+ }
|
|
|
+ const handleNodeClick=(data, obj, node)=> {
|
|
|
data, node
|
|
|
- this.treeLevel = obj.level
|
|
|
- // console.log(this.treeLevel);
|
|
|
- // console.log(node);
|
|
|
- },
|
|
|
- // 关闭操作
|
|
|
- closeDialog(flag) {
|
|
|
- if (flag) {
|
|
|
- // 重新刷新表格内容
|
|
|
- this.fetchData()
|
|
|
- }
|
|
|
- this.showDialog = false
|
|
|
- },
|
|
|
+ treeLevel.value = obj.level
|
|
|
+ }
|
|
|
+
|
|
|
+ const tree = ref(null)
|
|
|
|
|
|
- addGroup() {
|
|
|
- this.tableItem = {
|
|
|
- id: '',
|
|
|
- stationName: '',
|
|
|
- watchName: '',
|
|
|
- watchCode: '',
|
|
|
+ watch(filterText, (val) => { //直接监听
|
|
|
+ val
|
|
|
+ console.log(tree)
|
|
|
+ // tree.value.filter(val)
|
|
|
+ })
|
|
|
+
|
|
|
+ // 关闭操作
|
|
|
+ const closeDialog=()=> {
|
|
|
+ showDialog.value = false
|
|
|
+ showDialog2.value = false
|
|
|
+ }
|
|
|
+ //新建分组
|
|
|
+ const tableItem = reactive([])
|
|
|
+ const addGroup=() =>{
|
|
|
+ tableItem.value = {
|
|
|
+ id: "",
|
|
|
+ stationName: "",
|
|
|
+ xh: "",
|
|
|
+ userName: "",
|
|
|
siteList: [],
|
|
|
- done: '',
|
|
|
- guaZai: '',
|
|
|
+ done: "",
|
|
|
+ guaZai: "",
|
|
|
checked: true,
|
|
|
- resource: '',
|
|
|
- }
|
|
|
- this.dialogTitle = '新建分组'
|
|
|
- this.showDialog = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['addGroupCom'].showDialog = true
|
|
|
- })
|
|
|
- },
|
|
|
- addSite() {
|
|
|
- this.tableItem = {
|
|
|
- id: '',
|
|
|
- region: '',
|
|
|
- stationName: '',
|
|
|
- watchName: '',
|
|
|
- watchCode: '',
|
|
|
+ };
|
|
|
+ dialogTitle.value = '新建分组'
|
|
|
+ showDialog.value = true
|
|
|
+ }
|
|
|
+
|
|
|
+ //新建站点
|
|
|
+ const addSite=()=> {
|
|
|
+ tableItem.value = {
|
|
|
+ id: "",
|
|
|
+ stationName: "",
|
|
|
+ xh: "",
|
|
|
+ userName: "",
|
|
|
siteList: [],
|
|
|
- done: '',
|
|
|
- guaZai: '',
|
|
|
+ done: "",
|
|
|
+ guaZai: "",
|
|
|
checked: true,
|
|
|
- resource: '',
|
|
|
- }
|
|
|
- this.dialogTitle = '新建站点'
|
|
|
- this.showDialog = true
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['addSiteCom'].showDialog = true
|
|
|
- })
|
|
|
- },
|
|
|
- append(data) {
|
|
|
- var id
|
|
|
- const newChild = { id: id++, label: 'testtest', children: [] }
|
|
|
- if (!data.children) {
|
|
|
- this.$set(data, 'children', [])
|
|
|
- }
|
|
|
- data.children.push(newChild)
|
|
|
- },
|
|
|
-
|
|
|
- remove(node, data) {
|
|
|
+ };
|
|
|
+ dialogTitle.value = '新建站点'
|
|
|
+ showDialog2.value = true
|
|
|
+ }
|
|
|
+ const remove=(node, data)=> {
|
|
|
const parent = node.parent
|
|
|
const children = parent.data.children || parent.data
|
|
|
const index = children.findIndex((d) => d.id === data.id)
|
|
|
children.splice(index, 1)
|
|
|
this.dataSource = [...this.dataSource]
|
|
|
- },
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ showDialog,
|
|
|
+ showDialog2,
|
|
|
+ treeLevel,
|
|
|
+ activeName,
|
|
|
+ filterText,
|
|
|
+ dialogTitle,
|
|
|
+ data,
|
|
|
+ defaultProps,
|
|
|
+ tableItem,
|
|
|
+ getMsgFormSon,
|
|
|
+ mouseenter,
|
|
|
+ mouseleave,
|
|
|
+ filterNode,
|
|
|
+ handleNodeClick,
|
|
|
+ closeDialog,
|
|
|
+ addGroup,
|
|
|
+ addSite,
|
|
|
+ remove
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
-}
|
|
|
+})
|
|
|
</script>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<style scoped lang="scss">
|
|
|
.app-container.page-nesting {
|
|
|
padding: 0;
|